@agent-team-foundation/first-tree-hub 0.10.14 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-B2x4TTyJ.mjs → bootstrap-DUeYbwm-.mjs} +60 -4
- package/dist/cli/index.mjs +6 -6
- package/dist/{dist-D6AOiyNg.mjs → dist-BoHl9HwW.mjs} +66 -2
- package/dist/drizzle/0030_chat_first_workspace.sql +129 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/{feishu-DQ1l18Ah.mjs → feishu-Dxk6ArOK.mjs} +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{invitation-CBnQyB7o-Bulf3Sl7.mjs → invitation-CBnQyB7o-TmnIj3kx.mjs} +1 -1
- package/dist/{saas-connect-DWcxHtjX.mjs → saas-connect-DLSyrQcC.mjs} +1394 -395
- package/dist/web/assets/index-BxGzfDTS.js +383 -0
- package/dist/web/assets/{index-BQda2sqe.js → index-COflQOwF.js} +1 -1
- package/dist/web/assets/{index-CKoTjI0J.css → index-DDqPt6PI.css} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-C7yW7sWI.js +0 -388
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
var K0=e=>{throw TypeError(e)};var Qm=(e,t,n)=>t.has(e)||K0("Cannot "+n);var I=(e,t,n)=>(Qm(e,t,"read from private field"),n?n.call(e):t.get(e)),ke=(e,t,n)=>t.has(e)?K0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,a)=>(Qm(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Ie=(e,t,n)=>(Qm(e,t,"access private method"),n);var md=(e,t,n,a)=>({set _(l){pe(e,t,l,n)},get _(){return I(e,t,a)}});function k2(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 u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function uf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Km={exports:{}},Xo={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var G0;function j2(){if(G0)return Xo;G0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:u,ref:l!==void 0?l:null,props:o}}return Xo.Fragment=t,Xo.jsx=n,Xo.jsxs=n,Xo}var Y0;function C2(){return Y0||(Y0=1,Km.exports=j2()),Km.exports}var c=C2(),Gm={exports:{}},$e={};/**
|
|
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 X0;function E2(){if(X0)return $e;X0=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"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function w(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function E(L,P,T){this.props=L,this.context=P,this.refs=C,this.updater=T||k}E.prototype.isReactComponent={},E.prototype.setState=function(L,P){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,P,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=E.prototype;function z(L,P,T){this.props=L,this.context=P,this.refs=C,this.updater=T||k}var M=z.prototype=new R;M.constructor=z,j(M,E.prototype),M.isPureReactComponent=!0;var B=Array.isArray;function O(){}var D={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function V(L,P,T){var q=T.ref;return{$$typeof:e,type:L,key:P,ref:q!==void 0?q:null,props:T}}function F(L,P){return V(L.type,P,L.props)}function ne(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function oe(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(T){return P[T]})}var Se=/\/+/g;function G(L,P){return typeof L=="object"&&L!==null&&L.key!=null?oe(""+L.key):P.toString(36)}function W(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function Z(L,P,T,q,X){var ue=typeof L;(ue==="undefined"||ue==="boolean")&&(L=null);var xe=!1;if(L===null)xe=!0;else switch(ue){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(L.$$typeof){case e:case t:xe=!0;break;case y:return xe=L._init,Z(xe(L._payload),P,T,q,X)}}if(xe)return X=X(L),xe=q===""?"."+G(L,0):q,B(X)?(T="",xe!=null&&(T=xe.replace(Se,"$&/")+"/"),Z(X,P,T,"",function(ee){return ee})):X!=null&&(ne(X)&&(X=F(X,T+(X.key==null||L&&L.key===X.key?"":(""+X.key).replace(Se,"$&/")+"/")+xe)),P.push(X)),1;xe=0;var be=q===""?".":q+":";if(B(L))for(var fe=0;fe<L.length;fe++)q=L[fe],ue=be+G(q,fe),xe+=Z(q,P,T,ue,X);else if(fe=w(L),typeof fe=="function")for(L=fe.call(L),fe=0;!(q=L.next()).done;)q=q.value,ue=be+G(q,fe++),xe+=Z(q,P,T,ue,X);else if(ue==="object"){if(typeof L.then=="function")return Z(W(L),P,T,q,X);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return xe}function re(L,P,T){if(L==null)return L;var q=[],X=0;return Z(L,q,"","",function(ue){return P.call(T,ue,X++)}),q}function ve(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(T){(L._status===0||L._status===-1)&&(L._status=1,L._result=T)},function(T){(L._status===0||L._status===-1)&&(L._status=2,L._result=T)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var Re=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},_={map:re,forEach:function(L,P,T){re(L,function(){P.apply(this,arguments)},T)},count:function(L){var P=0;return re(L,function(){P++}),P},toArray:function(L){return re(L,function(P){return P})||[]},only:function(L){if(!ne(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return $e.Activity=g,$e.Children=_,$e.Component=E,$e.Fragment=n,$e.Profiler=l,$e.PureComponent=z,$e.StrictMode=a,$e.Suspense=m,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,$e.__COMPILER_RUNTIME={__proto__:null,c:function(L){return D.H.useMemoCache(L)}},$e.cache=function(L){return function(){return L.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(L,P,T){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var q=j({},L.props),X=L.key;if(P!=null)for(ue in P.key!==void 0&&(X=""+P.key),P)!U.call(P,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&P.ref===void 0||(q[ue]=P[ue]);var ue=arguments.length-2;if(ue===1)q.children=T;else if(1<ue){for(var xe=Array(ue),be=0;be<ue;be++)xe[be]=arguments[be+2];q.children=xe}return V(L.type,X,q)},$e.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},$e.createElement=function(L,P,T){var q,X={},ue=null;if(P!=null)for(q in P.key!==void 0&&(ue=""+P.key),P)U.call(P,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(X[q]=P[q]);var xe=arguments.length-2;if(xe===1)X.children=T;else if(1<xe){for(var be=Array(xe),fe=0;fe<xe;fe++)be[fe]=arguments[fe+2];X.children=be}if(L&&L.defaultProps)for(q in xe=L.defaultProps,xe)X[q]===void 0&&(X[q]=xe[q]);return V(L,ue,X)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(L){return{$$typeof:f,render:L}},$e.isValidElement=ne,$e.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ve}},$e.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},$e.startTransition=function(L){var P=D.T,T={};D.T=T;try{var q=L(),X=D.S;X!==null&&X(T,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(O,Re)}catch(ue){Re(ue)}finally{P!==null&&T.types!==null&&(P.types=T.types),D.T=P}},$e.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},$e.use=function(L){return D.H.use(L)},$e.useActionState=function(L,P,T){return D.H.useActionState(L,P,T)},$e.useCallback=function(L,P){return D.H.useCallback(L,P)},$e.useContext=function(L){return D.H.useContext(L)},$e.useDebugValue=function(){},$e.useDeferredValue=function(L,P){return D.H.useDeferredValue(L,P)},$e.useEffect=function(L,P){return D.H.useEffect(L,P)},$e.useEffectEvent=function(L){return D.H.useEffectEvent(L)},$e.useId=function(){return D.H.useId()},$e.useImperativeHandle=function(L,P,T){return D.H.useImperativeHandle(L,P,T)},$e.useInsertionEffect=function(L,P){return D.H.useInsertionEffect(L,P)},$e.useLayoutEffect=function(L,P){return D.H.useLayoutEffect(L,P)},$e.useMemo=function(L,P){return D.H.useMemo(L,P)},$e.useOptimistic=function(L,P){return D.H.useOptimistic(L,P)},$e.useReducer=function(L,P,T){return D.H.useReducer(L,P,T)},$e.useRef=function(L){return D.H.useRef(L)},$e.useState=function(L){return D.H.useState(L)},$e.useSyncExternalStore=function(L,P,T){return D.H.useSyncExternalStore(L,P,T)},$e.useTransition=function(){return D.H.useTransition()},$e.version="19.2.4",$e}var J0;function qg(){return J0||(J0=1,Gm.exports=E2()),Gm.exports}var b=qg();const N2=uf(b),Hg=k2({__proto__:null,default:N2},[b]);var Ym={exports:{}},Jo={},Xm={exports:{}},Jm={};/**
|
|
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 W0;function _2(){return W0||(W0=1,(function(e){function t(Z,re){var ve=Z.length;Z.push(re);e:for(;0<ve;){var Re=ve-1>>>1,_=Z[Re];if(0<l(_,re))Z[Re]=re,Z[ve]=_,ve=Re;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var re=Z[0],ve=Z.pop();if(ve!==re){Z[0]=ve;e:for(var Re=0,_=Z.length,L=_>>>1;Re<L;){var P=2*(Re+1)-1,T=Z[P],q=P+1,X=Z[q];if(0>l(T,ve))q<_&&0>l(X,T)?(Z[Re]=X,Z[q]=ve,Re=q):(Z[Re]=T,Z[P]=ve,Re=P);else if(q<_&&0>l(X,ve))Z[Re]=X,Z[q]=ve,Re=q;else break e}}return re}function l(Z,re){var ve=Z.sortIndex-re.sortIndex;return ve!==0?ve:Z.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],y=1,g=null,x=3,w=!1,k=!1,j=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function M(Z){for(var re=n(h);re!==null;){if(re.callback===null)a(h);else if(re.startTime<=Z)a(h),re.sortIndex=re.expirationTime,t(m,re);else break;re=n(h)}}function B(Z){if(j=!1,M(Z),!k)if(n(m)!==null)k=!0,O||(O=!0,oe());else{var re=n(h);re!==null&&W(B,re.startTime-Z)}}var O=!1,D=-1,U=5,V=-1;function F(){return C?!0:!(e.unstable_now()-V<U)}function ne(){if(C=!1,O){var Z=e.unstable_now();V=Z;var re=!0;try{e:{k=!1,j&&(j=!1,R(D),D=-1),w=!0;var ve=x;try{t:{for(M(Z),g=n(m);g!==null&&!(g.expirationTime>Z&&F());){var Re=g.callback;if(typeof Re=="function"){g.callback=null,x=g.priorityLevel;var _=Re(g.expirationTime<=Z);if(Z=e.unstable_now(),typeof _=="function"){g.callback=_,M(Z),re=!0;break t}g===n(m)&&a(m),M(Z)}else a(m);g=n(m)}if(g!==null)re=!0;else{var L=n(h);L!==null&&W(B,L.startTime-Z),re=!1}}break e}finally{g=null,x=ve,w=!1}re=void 0}}finally{re?oe():O=!1}}}var oe;if(typeof z=="function")oe=function(){z(ne)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,G=Se.port2;Se.port1.onmessage=ne,oe=function(){G.postMessage(null)}}else oe=function(){E(ne,0)};function W(Z,re){D=E(function(){Z(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(Z){switch(x){case 1:case 2:case 3:var re=3;break;default:re=x}var ve=x;x=re;try{return Z()}finally{x=ve}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(Z,re){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ve=x;x=Z;try{return re()}finally{x=ve}},e.unstable_scheduleCallback=function(Z,re,ve){var Re=e.unstable_now();switch(typeof ve=="object"&&ve!==null?(ve=ve.delay,ve=typeof ve=="number"&&0<ve?Re+ve:Re):ve=Re,Z){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=ve+_,Z={id:y++,callback:re,priorityLevel:Z,startTime:ve,expirationTime:_,sortIndex:-1},ve>Re?(Z.sortIndex=ve,t(h,Z),n(m)===null&&Z===n(h)&&(j?(R(D),D=-1):j=!0,W(B,ve-Re))):(Z.sortIndex=_,t(m,Z),k||w||(k=!0,O||(O=!0,oe()))),Z},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(Z){var re=x;return function(){var ve=x;x=re;try{return Z.apply(this,arguments)}finally{x=ve}}}})(Jm)),Jm}var e1;function T2(){return e1||(e1=1,Xm.exports=_2()),Xm.exports}var Wm={exports:{}},wn={};/**
|
|
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 t1;function A2(){if(t1)return wn;t1=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 u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,wn.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)},wn.flushSync=function(m){var h=u.T,y=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=h,a.p=y,a.d.f()}},wn.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))},wn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},wn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:w}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:x,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},wn.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)},wn.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})}},wn.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)},wn.requestFormReset=function(m){a.d.r(m)},wn.unstable_batchedUpdates=function(m,h){return m(h)},wn.useFormState=function(m,h,y){return u.H.useFormState(m,h,y)},wn.useFormStatus=function(){return u.H.useHostTransitionStatus()},wn.version="19.2.4",wn}var n1;function PS(){if(n1)return Wm.exports;n1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Wm.exports=A2(),Wm.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 r1;function R2(){if(r1)return Jo;r1=1;var e=T2(),t=qg(),n=PS();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 u(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===d)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=v;else{for(var S=!1,N=p.child;N;){if(N===s){S=!0,s=p,d=v;break}if(N===d){S=!0,d=p,s=v;break}N=N.sibling}if(!S){for(N=v.child;N;){if(N===s){S=!0,s=v,d=p;break}if(N===d){S=!0,d=v,s=p;break}N=N.sibling}if(!S)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function y(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=y(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),w=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"),R=Symbol.for("react.consumer"),z=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function oe(r){return r===null||typeof r!="object"?null:(r=ne&&r[ne]||r["@@iterator"],typeof r=="function"?r:null)}var Se=Symbol.for("react.client.reference");function G(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Se?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 B:return"Suspense";case O:return"SuspenseList";case V:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case z:return r.displayName||"Context";case R:return(r._context.displayName||"Context")+".Consumer";case M:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case D:return i=r.displayName||null,i!==null?i:G(r.type)||"Memo";case U:i=r._payload,r=r._init;try{return G(r(i))}catch{}}return null}var W=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},Re=[],_=-1;function L(r){return{current:r}}function P(r){0>_||(r.current=Re[_],Re[_]=null,_--)}function T(r,i){_++,Re[_]=r.current,r.current=i}var q=L(null),X=L(null),ue=L(null),xe=L(null);function be(r,i){switch(T(ue,i),T(X,r),T(q,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?y0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=y0(i),r=v0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}P(q),T(q,r)}function fe(){P(q),P(X),P(ue)}function ee(r){r.memoizedState!==null&&T(xe,r);var i=q.current,s=v0(i,r.type);i!==s&&(T(X,r),T(q,s))}function me(r){X.current===r&&(P(q),P(X)),xe.current===r&&(P(xe),Qo._currentValue=ve)}var _e,Le;function it(r){if(_e===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);_e=i&&i[1]||"",Le=-1<s.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+_e+r+Le}var pt=!1;function Ur(r,i){if(!r||pt)return"";pt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(te){var J=te}Reflect.construct(r,[],de)}else{try{de.call()}catch(te){J=te}r.call(de.prototype)}}else{try{throw Error()}catch(te){J=te}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(te){if(te&&J&&typeof te.stack=="string")return[te.stack,J.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),S=v[0],N=v[1];if(S&&N){var $=S.split(`
|
|
44
|
+
`),Y=N.split(`
|
|
45
|
+
`);for(p=d=0;d<$.length&&!$[d].includes("DetermineComponentFrameRoot");)d++;for(;p<Y.length&&!Y[p].includes("DetermineComponentFrameRoot");)p++;if(d===$.length||p===Y.length)for(d=$.length-1,p=Y.length-1;1<=d&&0<=p&&$[d]!==Y[p];)p--;for(;1<=d&&0<=p;d--,p--)if($[d]!==Y[p]){if(d!==1||p!==1)do if(d--,p--,0>p||$[d]!==Y[p]){var ae=`
|
|
46
|
+
`+$[d].replace(" at new "," at ");return r.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",r.displayName)),ae}while(1<=d&&0<=p);break}}}finally{pt=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?it(s):""}function za(r,i){switch(r.tag){case 26:case 27:case 5:return it(r.type);case 16:return it("Lazy");case 13:return r.child!==i&&i!==null?it("Suspense Fallback"):it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return Ur(r.type,!1);case 11:return Ur(r.type.render,!1);case 1:return Ur(r.type,!0);case 31:return it("Activity");default:return""}}function jl(r){try{var i="",s=null;do i+=za(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
|
|
47
|
+
Error generating stack: `+d.message+`
|
|
48
|
+
`+d.stack}}var Oa=Object.prototype.hasOwnProperty,Da=e.unstable_scheduleCallback,Xr=e.unstable_cancelCallback,ro=e.unstable_shouldYield,ao=e.unstable_requestPaint,dn=e.unstable_now,io=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,Be=e.unstable_LowPriority,nt=e.unstable_IdlePriority,fn=e.log,or=e.unstable_setDisableYieldValue,Wt=null,Ft=null;function hn(r){if(typeof fn=="function"&&or(r),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(Wt,r)}catch{}}var ft=Math.clz32?Math.clz32:Wu,Nr=Math.log,On=Math.LN2;function Wu(r){return r>>>=0,r===0?32:31-(Nr(r)/On|0)|0}var Mi=256,Ii=262144,Li=4194304;function Pr(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,S=r.pingedLanes;r=r.warmLanes;var N=d&134217727;return N!==0?(d=N&~v,d!==0?p=Pr(d):(S&=N,S!==0?p=Pr(S):s||(s=N&~r,s!==0&&(p=Pr(s))))):(N=d&~v,N!==0?p=Pr(N):S!==0?p=Pr(S):s||(s=d&~r,s!==0&&(p=Pr(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 Ma(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function ec(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 we(){var r=Li;return Li<<=1,(Li&62914560)===0&&(Li=4194304),r}function Ge(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 Jr(r,i,s,d,p,v){var S=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,$=r.expirationTimes,Y=r.hiddenUpdates;for(s=S&~s;0<s;){var ae=31-ft(s),de=1<<ae;N[ae]=0,$[ae]=-1;var J=Y[ae];if(J!==null)for(Y[ae]=null,ae=0;ae<J.length;ae++){var te=J[ae];te!==null&&(te.lane&=-536870913)}s&=~de}d!==0&&lo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(S&~i))}function lo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-ft(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function tc(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-ft(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function tv(r,i){var s=i&-i;return s=(s&42)!==0?1:If(s),(s&(r.suspendedLanes|i))!==0?0:s}function If(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 Lf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function nv(){var r=re.p;return r!==0?r:(r=window.event,r===void 0?32:$0(r.type))}function rv(r,i){var s=re.p;try{return re.p=r,i()}finally{re.p=s}}var Ia=Math.random().toString(36).slice(2),pn="__reactFiber$"+Ia,Dn="__reactProps$"+Ia,Cl="__reactContainer$"+Ia,Uf="__reactEvents$"+Ia,fN="__reactListeners$"+Ia,hN="__reactHandles$"+Ia,av="__reactResources$"+Ia,so="__reactMarker$"+Ia;function Pf(r){delete r[pn],delete r[Dn],delete r[Uf],delete r[fN],delete r[hN]}function El(r){var i=r[pn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Cl]||s[pn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=C0(r);r!==null;){if(s=r[pn])return s;r=C0(r)}return i}r=s,s=r.parentNode}return null}function Nl(r){if(r=r[pn]||r[Cl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function oo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function _l(r){var i=r[av];return i||(i=r[av]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ln(r){r[so]=!0}var iv=new Set,lv={};function Pi(r,i){Tl(r,i),Tl(r+"Capture",i)}function Tl(r,i){for(lv[r]=i,r=0;r<i.length;r++)iv.add(i[r])}var mN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),sv={},ov={};function pN(r){return Oa.call(ov,r)?!0:Oa.call(sv,r)?!1:mN.test(r)?ov[r]=!0:(sv[r]=!0,!1)}function nc(r,i,s){if(pN(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 rc(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 Wr(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 ur(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function uv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function gN(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(S){s=""+S,v.call(this,S)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(S){s=""+S},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Bf(r){if(!r._valueTracker){var i=uv(r)?"checked":"value";r._valueTracker=gN(r,i,""+r[i])}}function cv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=uv(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function ac(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 yN=/[\n"\\]/g;function cr(r){return r.replace(yN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function $f(r,i,s,d,p,v,S,N){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),i!=null?S==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+ur(i)):r.value!==""+ur(i)&&(r.value=""+ur(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?Ff(r,S,ur(i)):s!=null?Ff(r,S,ur(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=""+ur(N):r.removeAttribute("name")}function dv(r,i,s,d,p,v,S,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)){Bf(r);return}s=s!=null?""+ur(s):"",i=i!=null?""+ur(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,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Bf(r)}function Ff(r,i,s){i==="number"&&ac(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Al(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+ur(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 fv(r,i,s){if(i!=null&&(i=""+ur(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+ur(s):""}function hv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(W(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=ur(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Bf(r)}function Rl(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var vN=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 mv(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||vN.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function pv(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&&mv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&mv(r,v,i[v])}function qf(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 bN=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"]]),xN=/^[\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 ic(r){return xN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ea(){}var Hf=null;function Zf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var zl=null,Ol=null;function gv(r){var i=Nl(r);if(i&&(r=i.stateNode)){var s=r[Dn]||null;e:switch(r=i.stateNode,i.type){case"input":if($f(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="'+cr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[Dn]||null;if(!p)throw Error(a(90));$f(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&cv(d)}break e;case"textarea":fv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Al(r,!!s.multiple,i,!1)}}}var Vf=!1;function yv(r,i,s){if(Vf)return r(i,s);Vf=!0;try{var d=r(i);return d}finally{if(Vf=!1,(zl!==null||Ol!==null)&&(Vc(),zl&&(i=zl,r=Ol,Ol=zl=null,gv(i),r)))for(i=0;i<r.length;i++)gv(r[i])}}function uo(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Dn]||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 ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qf=!1;if(ta)try{var co={};Object.defineProperty(co,"passive",{get:function(){Qf=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{Qf=!1}var La=null,Kf=null,lc=null;function vv(){if(lc)return lc;var r,i=Kf,s=i.length,d,p="value"in La?La.value:La.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var S=s-r;for(d=1;d<=S&&i[s-d]===p[v-d];d++);return lc=p.slice(r,1<d?1-d:void 0)}function sc(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 oc(){return!0}function bv(){return!1}function Mn(r){function i(s,d,p,v,S){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=S,this.currentTarget=null;for(var 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)?oc:bv,this.isPropagationStopped=bv,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=oc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=oc)},persist:function(){},isPersistent:oc}),i}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uc=Mn(Bi),fo=g({},Bi,{view:0,detail:0}),wN=Mn(fo),Gf,Yf,ho,cc=g({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ho&&(ho&&r.type==="mousemove"?(Gf=r.screenX-ho.screenX,Yf=r.screenY-ho.screenY):Yf=Gf=0,ho=r),Gf)},movementY:function(r){return"movementY"in r?r.movementY:Yf}}),xv=Mn(cc),SN=g({},cc,{dataTransfer:0}),kN=Mn(SN),jN=g({},fo,{relatedTarget:0}),Xf=Mn(jN),CN=g({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),EN=Mn(CN),NN=g({},Bi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),_N=Mn(NN),TN=g({},Bi,{data:0}),wv=Mn(TN),AN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},RN={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"},zN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ON(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=zN[r])?!!i[r]:!1}function Jf(){return ON}var DN=g({},fo,{key:function(r){if(r.key){var i=AN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=sc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?RN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jf,charCode:function(r){return r.type==="keypress"?sc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?sc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),MN=Mn(DN),IN=g({},cc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=Mn(IN),LN=g({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jf}),UN=Mn(LN),PN=g({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),BN=Mn(PN),$N=g({},cc,{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}),FN=Mn($N),qN=g({},Bi,{newState:0,oldState:0}),HN=Mn(qN),ZN=[9,13,27,32],Wf=ta&&"CompositionEvent"in window,mo=null;ta&&"documentMode"in document&&(mo=document.documentMode);var VN=ta&&"TextEvent"in window&&!mo,kv=ta&&(!Wf||mo&&8<mo&&11>=mo),jv=" ",Cv=!1;function Ev(r,i){switch(r){case"keyup":return ZN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Dl=!1;function QN(r,i){switch(r){case"compositionend":return Nv(i);case"keypress":return i.which!==32?null:(Cv=!0,jv);case"textInput":return r=i.data,r===jv&&Cv?null:r;default:return null}}function KN(r,i){if(Dl)return r==="compositionend"||!Wf&&Ev(r,i)?(r=vv(),lc=Kf=La=null,Dl=!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 kv&&i.locale!=="ko"?null:i.data;default:return null}}var GN={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 _v(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!GN[r.type]:i==="textarea"}function Tv(r,i,s,d){zl?Ol?Ol.push(d):Ol=[d]:zl=d,i=Wc(i,"onChange"),0<i.length&&(s=new uc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var po=null,go=null;function YN(r){d0(r,0)}function dc(r){var i=oo(r);if(cv(i))return r}function Av(r,i){if(r==="change")return i}var Rv=!1;if(ta){var eh;if(ta){var th="oninput"in document;if(!th){var zv=document.createElement("div");zv.setAttribute("oninput","return;"),th=typeof zv.oninput=="function"}eh=th}else eh=!1;Rv=eh&&(!document.documentMode||9<document.documentMode)}function Ov(){po&&(po.detachEvent("onpropertychange",Dv),go=po=null)}function Dv(r){if(r.propertyName==="value"&&dc(go)){var i=[];Tv(i,go,r,Zf(r)),yv(YN,i)}}function XN(r,i,s){r==="focusin"?(Ov(),po=i,go=s,po.attachEvent("onpropertychange",Dv)):r==="focusout"&&Ov()}function JN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return dc(go)}function WN(r,i){if(r==="click")return dc(i)}function e_(r,i){if(r==="input"||r==="change")return dc(i)}function t_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Gn=typeof Object.is=="function"?Object.is:t_;function yo(r,i){if(Gn(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(!Oa.call(i,p)||!Gn(r[p],i[p]))return!1}return!0}function Mv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Iv(r,i){var s=Mv(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=Mv(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 Uv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=ac(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=ac(r.document)}return i}function nh(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 n_=ta&&"documentMode"in document&&11>=document.documentMode,Ml=null,rh=null,vo=null,ah=!1;function Pv(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ah||Ml==null||Ml!==ac(d)||(d=Ml,"selectionStart"in d&&nh(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),vo&&yo(vo,d)||(vo=d,d=Wc(rh,"onSelect"),0<d.length&&(i=new uc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Ml)))}function $i(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Il={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")},ih={},Bv={};ta&&(Bv=document.createElement("div").style,"AnimationEvent"in window||(delete Il.animationend.animation,delete Il.animationiteration.animation,delete Il.animationstart.animation),"TransitionEvent"in window||delete Il.transitionend.transition);function Fi(r){if(ih[r])return ih[r];if(!Il[r])return r;var i=Il[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Bv)return ih[r]=i[s];return r}var $v=Fi("animationend"),Fv=Fi("animationiteration"),qv=Fi("animationstart"),r_=Fi("transitionrun"),a_=Fi("transitionstart"),i_=Fi("transitioncancel"),Hv=Fi("transitionend"),Zv=new Map,lh="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(" ");lh.push("scrollEnd");function _r(r,i){Zv.set(r,i),Pi(i,[r])}var fc=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)},dr=[],Ll=0,sh=0;function hc(){for(var r=Ll,i=sh=Ll=0;i<r;){var s=dr[i];dr[i++]=null;var d=dr[i];dr[i++]=null;var p=dr[i];dr[i++]=null;var v=dr[i];if(dr[i++]=null,d!==null&&p!==null){var S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}v!==0&&Vv(s,p,v)}}function mc(r,i,s,d){dr[Ll++]=r,dr[Ll++]=i,dr[Ll++]=s,dr[Ll++]=d,sh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function oh(r,i,s,d){return mc(r,i,s,d),pc(r)}function qi(r,i){return mc(r,null,null,i),pc(r)}function Vv(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-ft(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function pc(r){if(50<Bo)throw Bo=0,ym=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ul={};function l_(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 Yn(r,i,s,d){return new l_(r,i,s,d)}function uh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function na(r,i){var s=r.alternate;return s===null?(s=Yn(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 Qv(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 gc(r,i,s,d,p,v){var S=0;if(d=r,typeof r=="function")uh(r)&&(S=1);else if(typeof r=="string")S=d2(r,s,q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case V:return r=Yn(31,s,i,p),r.elementType=V,r.lanes=v,r;case j:return Hi(s.children,p,v,i);case C:S=8,p|=24;break;case E:return r=Yn(12,s,i,p|2),r.elementType=E,r.lanes=v,r;case B:return r=Yn(13,s,i,p),r.elementType=B,r.lanes=v,r;case O:return r=Yn(19,s,i,p),r.elementType=O,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:S=10;break e;case R:S=9;break e;case M:S=11;break e;case D:S=14;break e;case U:S=16,d=null;break e}S=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Yn(S,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Hi(r,i,s,d){return r=Yn(7,r,d,i),r.lanes=s,r}function ch(r,i,s){return r=Yn(6,r,null,i),r.lanes=s,r}function Kv(r){var i=Yn(18,null,null,0);return i.stateNode=r,i}function dh(r,i,s){return i=Yn(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 fr(r,i){if(typeof r=="object"&&r!==null){var s=Gv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:jl(i)},Gv.set(r,i),i)}return{value:r,source:i,stack:jl(i)}}var Pl=[],Bl=0,yc=null,bo=0,hr=[],mr=0,Ua=null,Br=1,$r="";function ra(r,i){Pl[Bl++]=bo,Pl[Bl++]=yc,yc=r,bo=i}function Yv(r,i,s){hr[mr++]=Br,hr[mr++]=$r,hr[mr++]=Ua,Ua=r;var d=Br;r=$r;var p=32-ft(d)-1;d&=~(1<<p),s+=1;var v=32-ft(i)+p;if(30<v){var S=p-p%5;v=(d&(1<<S)-1).toString(32),d>>=S,p-=S,Br=1<<32-ft(i)+p|s<<p|d,$r=v+r}else Br=1<<v|s<<p|d,$r=r}function fh(r){r.return!==null&&(ra(r,1),Yv(r,1,0))}function hh(r){for(;r===yc;)yc=Pl[--Bl],Pl[Bl]=null,bo=Pl[--Bl],Pl[Bl]=null;for(;r===Ua;)Ua=hr[--mr],hr[mr]=null,$r=hr[--mr],hr[mr]=null,Br=hr[--mr],hr[mr]=null}function Xv(r,i){hr[mr++]=Br,hr[mr++]=$r,hr[mr++]=Ua,Br=i.id,$r=i.overflow,Ua=r}var gn=null,Et=null,rt=!1,Pa=null,pr=!1,mh=Error(a(519));function Ba(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xo(fr(i,r)),mh}function Jv(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[pn]=r,i[Dn]=d,s){case"dialog":Xe("cancel",i),Xe("close",i);break;case"iframe":case"object":case"embed":Xe("load",i);break;case"video":case"audio":for(s=0;s<Fo.length;s++)Xe(Fo[s],i);break;case"source":Xe("error",i);break;case"img":case"image":case"link":Xe("error",i),Xe("load",i);break;case"details":Xe("toggle",i);break;case"input":Xe("invalid",i),dv(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Xe("invalid",i);break;case"textarea":Xe("invalid",i),hv(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||p0(i.textContent,s)?(d.popover!=null&&(Xe("beforetoggle",i),Xe("toggle",i)),d.onScroll!=null&&Xe("scroll",i),d.onScrollEnd!=null&&Xe("scrollend",i),d.onClick!=null&&(i.onclick=ea),i=!0):i=!1,i||Ba(r,!0)}function Wv(r){for(gn=r.return;gn;)switch(gn.tag){case 5:case 31:case 13:pr=!1;return;case 27:case 3:pr=!0;return;default:gn=gn.return}}function $l(r){if(r!==gn)return!1;if(!rt)return Wv(r),rt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||zm(r.type,r.memoizedProps)),s=!s),s&&Et&&Ba(r),Wv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=j0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=j0(r)}else i===27?(i=Et,ei(r.type)?(r=Lm,Lm=null,Et=r):Et=i):Et=gn?yr(r.stateNode.nextSibling):null;return!0}function Zi(){Et=gn=null,rt=!1}function ph(){var r=Pa;return r!==null&&(Pn===null?Pn=r:Pn.push.apply(Pn,r),Pa=null),r}function xo(r){Pa===null?Pa=[r]:Pa.push(r)}var gh=L(null),Vi=null,aa=null;function $a(r,i,s){T(gh,i._currentValue),i._currentValue=s}function ia(r){r._currentValue=gh.current,P(gh)}function yh(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 vh(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var S=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var $=0;$<i.length;$++)if(N.context===i[$]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),yh(v.return,s,r),d||(S=null);break e}v=N.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=s,v=S.alternate,v!==null&&(v.lanes|=s),yh(S,s,r),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===r){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Fl(r,i,s,d){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var N=p.type;Gn(p.pendingProps.value,S.value)||(r!==null?r.push(N):r=[N])}}else if(p===xe.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Qo):r=[Qo])}p=p.return}r!==null&&vh(i,r,s,d),i.flags|=262144}function vc(r){for(r=r.firstContext;r!==null;){if(!Gn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Qi(r){Vi=r,aa=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function yn(r){return eb(Vi,r)}function bc(r,i){return Vi===null&&Qi(r),eb(r,i)}function eb(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},aa===null){if(r===null)throw Error(a(308));aa=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else aa=aa.next=i;return s}var s_=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()})}},o_=e.unstable_scheduleCallback,u_=e.unstable_NormalPriority,Zt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bh(){return{controller:new s_,data:new Map,refCount:0}}function wo(r){r.refCount--,r.refCount===0&&o_(u_,function(){r.controller.abort()})}var So=null,xh=0,ql=0,Hl=null;function c_(r,i){if(So===null){var s=So=[];xh=0,ql=km(),Hl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return xh++,i.then(tb,tb),i}function tb(){if(--xh===0&&So!==null){Hl!==null&&(Hl.status="fulfilled");var r=So;So=null,ql=0,Hl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function d_(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 nb=Z.S;Z.S=function(r,i){Px=dn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&c_(r,i),nb!==null&&nb(r,i)};var Ki=L(null);function wh(){var r=Ki.current;return r!==null?r:St.pooledCache}function xc(r,i){i===null?T(Ki,Ki.current):T(Ki,i.pool)}function rb(){var r=wh();return r===null?null:{parent:Zt._currentValue,pool:r}}var Zl=Error(a(460)),Sh=Error(a(474)),wc=Error(a(542)),Sc={then:function(){}};function ab(r){return r=r.status,r==="fulfilled"||r==="rejected"}function ib(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(ea,ea),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,sb(r),r;default:if(typeof i.status=="string")i.then(ea,ea);else{if(r=St,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,sb(r),r}throw Yi=i,Zl}}function Gi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Yi=s,Zl):s}}var Yi=null;function lb(){if(Yi===null)throw Error(a(459));var r=Yi;return Yi=null,r}function sb(r){if(r===Zl||r===wc)throw Error(a(483))}var Vl=null,ko=0;function kc(r){var i=ko;return ko+=1,Vl===null&&(Vl=[]),ib(Vl,r,i)}function jo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function jc(r,i){throw i.$$typeof===x?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function ob(r){function i(Q,H){if(r){var K=Q.deletions;K===null?(Q.deletions=[H],Q.flags|=16):K.push(H)}}function s(Q,H){if(!r)return null;for(;H!==null;)i(Q,H),H=H.sibling;return null}function d(Q){for(var H=new Map;Q!==null;)Q.key!==null?H.set(Q.key,Q):H.set(Q.index,Q),Q=Q.sibling;return H}function p(Q,H){return Q=na(Q,H),Q.index=0,Q.sibling=null,Q}function v(Q,H,K){return Q.index=K,r?(K=Q.alternate,K!==null?(K=K.index,K<H?(Q.flags|=67108866,H):K):(Q.flags|=67108866,H)):(Q.flags|=1048576,H)}function S(Q){return r&&Q.alternate===null&&(Q.flags|=67108866),Q}function N(Q,H,K,ce){return H===null||H.tag!==6?(H=ch(K,Q.mode,ce),H.return=Q,H):(H=p(H,K),H.return=Q,H)}function $(Q,H,K,ce){var Oe=K.type;return Oe===j?ae(Q,H,K.props.children,ce,K.key):H!==null&&(H.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===U&&Gi(Oe)===H.type)?(H=p(H,K.props),jo(H,K),H.return=Q,H):(H=gc(K.type,K.key,K.props,null,Q.mode,ce),jo(H,K),H.return=Q,H)}function Y(Q,H,K,ce){return H===null||H.tag!==4||H.stateNode.containerInfo!==K.containerInfo||H.stateNode.implementation!==K.implementation?(H=dh(K,Q.mode,ce),H.return=Q,H):(H=p(H,K.children||[]),H.return=Q,H)}function ae(Q,H,K,ce,Oe){return H===null||H.tag!==7?(H=Hi(K,Q.mode,ce,Oe),H.return=Q,H):(H=p(H,K),H.return=Q,H)}function de(Q,H,K){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=ch(""+H,Q.mode,K),H.return=Q,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return K=gc(H.type,H.key,H.props,null,Q.mode,K),jo(K,H),K.return=Q,K;case k:return H=dh(H,Q.mode,K),H.return=Q,H;case U:return H=Gi(H),de(Q,H,K)}if(W(H)||oe(H))return H=Hi(H,Q.mode,K,null),H.return=Q,H;if(typeof H.then=="function")return de(Q,kc(H),K);if(H.$$typeof===z)return de(Q,bc(Q,H),K);jc(Q,H)}return null}function J(Q,H,K,ce){var Oe=H!==null?H.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Oe!==null?null:N(Q,H,""+K,ce);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return K.key===Oe?$(Q,H,K,ce):null;case k:return K.key===Oe?Y(Q,H,K,ce):null;case U:return K=Gi(K),J(Q,H,K,ce)}if(W(K)||oe(K))return Oe!==null?null:ae(Q,H,K,ce,null);if(typeof K.then=="function")return J(Q,H,kc(K),ce);if(K.$$typeof===z)return J(Q,H,bc(Q,K),ce);jc(Q,K)}return null}function te(Q,H,K,ce,Oe){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Q=Q.get(K)||null,N(H,Q,""+ce,Oe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case w:return Q=Q.get(ce.key===null?K:ce.key)||null,$(H,Q,ce,Oe);case k:return Q=Q.get(ce.key===null?K:ce.key)||null,Y(H,Q,ce,Oe);case U:return ce=Gi(ce),te(Q,H,K,ce,Oe)}if(W(ce)||oe(ce))return Q=Q.get(K)||null,ae(H,Q,ce,Oe,null);if(typeof ce.then=="function")return te(Q,H,K,kc(ce),Oe);if(ce.$$typeof===z)return te(Q,H,K,bc(H,ce),Oe);jc(H,ce)}return null}function Ce(Q,H,K,ce){for(var Oe=null,ot=null,Te=H,He=H=0,et=null;Te!==null&&He<K.length;He++){Te.index>He?(et=Te,Te=null):et=Te.sibling;var ut=J(Q,Te,K[He],ce);if(ut===null){Te===null&&(Te=et);break}r&&Te&&ut.alternate===null&&i(Q,Te),H=v(ut,H,He),ot===null?Oe=ut:ot.sibling=ut,ot=ut,Te=et}if(He===K.length)return s(Q,Te),rt&&ra(Q,He),Oe;if(Te===null){for(;He<K.length;He++)Te=de(Q,K[He],ce),Te!==null&&(H=v(Te,H,He),ot===null?Oe=Te:ot.sibling=Te,ot=Te);return rt&&ra(Q,He),Oe}for(Te=d(Te);He<K.length;He++)et=te(Te,Q,He,K[He],ce),et!==null&&(r&&et.alternate!==null&&Te.delete(et.key===null?He:et.key),H=v(et,H,He),ot===null?Oe=et:ot.sibling=et,ot=et);return r&&Te.forEach(function(ii){return i(Q,ii)}),rt&&ra(Q,He),Oe}function Me(Q,H,K,ce){if(K==null)throw Error(a(151));for(var Oe=null,ot=null,Te=H,He=H=0,et=null,ut=K.next();Te!==null&&!ut.done;He++,ut=K.next()){Te.index>He?(et=Te,Te=null):et=Te.sibling;var ii=J(Q,Te,ut.value,ce);if(ii===null){Te===null&&(Te=et);break}r&&Te&&ii.alternate===null&&i(Q,Te),H=v(ii,H,He),ot===null?Oe=ii:ot.sibling=ii,ot=ii,Te=et}if(ut.done)return s(Q,Te),rt&&ra(Q,He),Oe;if(Te===null){for(;!ut.done;He++,ut=K.next())ut=de(Q,ut.value,ce),ut!==null&&(H=v(ut,H,He),ot===null?Oe=ut:ot.sibling=ut,ot=ut);return rt&&ra(Q,He),Oe}for(Te=d(Te);!ut.done;He++,ut=K.next())ut=te(Te,Q,He,ut.value,ce),ut!==null&&(r&&ut.alternate!==null&&Te.delete(ut.key===null?He:ut.key),H=v(ut,H,He),ot===null?Oe=ut:ot.sibling=ut,ot=ut);return r&&Te.forEach(function(S2){return i(Q,S2)}),rt&&ra(Q,He),Oe}function xt(Q,H,K,ce){if(typeof K=="object"&&K!==null&&K.type===j&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case w:e:{for(var Oe=K.key;H!==null;){if(H.key===Oe){if(Oe=K.type,Oe===j){if(H.tag===7){s(Q,H.sibling),ce=p(H,K.props.children),ce.return=Q,Q=ce;break e}}else if(H.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===U&&Gi(Oe)===H.type){s(Q,H.sibling),ce=p(H,K.props),jo(ce,K),ce.return=Q,Q=ce;break e}s(Q,H);break}else i(Q,H);H=H.sibling}K.type===j?(ce=Hi(K.props.children,Q.mode,ce,K.key),ce.return=Q,Q=ce):(ce=gc(K.type,K.key,K.props,null,Q.mode,ce),jo(ce,K),ce.return=Q,Q=ce)}return S(Q);case k:e:{for(Oe=K.key;H!==null;){if(H.key===Oe)if(H.tag===4&&H.stateNode.containerInfo===K.containerInfo&&H.stateNode.implementation===K.implementation){s(Q,H.sibling),ce=p(H,K.children||[]),ce.return=Q,Q=ce;break e}else{s(Q,H);break}else i(Q,H);H=H.sibling}ce=dh(K,Q.mode,ce),ce.return=Q,Q=ce}return S(Q);case U:return K=Gi(K),xt(Q,H,K,ce)}if(W(K))return Ce(Q,H,K,ce);if(oe(K)){if(Oe=oe(K),typeof Oe!="function")throw Error(a(150));return K=Oe.call(K),Me(Q,H,K,ce)}if(typeof K.then=="function")return xt(Q,H,kc(K),ce);if(K.$$typeof===z)return xt(Q,H,bc(Q,K),ce);jc(Q,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,H!==null&&H.tag===6?(s(Q,H.sibling),ce=p(H,K),ce.return=Q,Q=ce):(s(Q,H),ce=ch(K,Q.mode,ce),ce.return=Q,Q=ce),S(Q)):s(Q,H)}return function(Q,H,K,ce){try{ko=0;var Oe=xt(Q,H,K,ce);return Vl=null,Oe}catch(Te){if(Te===Zl||Te===wc)throw Te;var ot=Yn(29,Te,null,Q.mode);return ot.lanes=ce,ot.return=Q,ot}finally{}}}var Xi=ob(!0),ub=ob(!1),Fa=!1;function kh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jh(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 qa(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ha(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(dt&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=pc(r),Vv(r,null,s),i}return mc(r,d,i,s),pc(r)}function Co(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,tc(r,s)}}function Ch(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=S:v=v.next=S,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var Eh=!1;function Eo(){if(Eh){var r=Hl;if(r!==null)throw r}}function No(r,i,s,d){Eh=!1;var p=r.updateQueue;Fa=!1;var v=p.firstBaseUpdate,S=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var $=N,Y=$.next;$.next=null,S===null?v=Y:S.next=Y,S=$;var ae=r.alternate;ae!==null&&(ae=ae.updateQueue,N=ae.lastBaseUpdate,N!==S&&(N===null?ae.firstBaseUpdate=Y:N.next=Y,ae.lastBaseUpdate=$))}if(v!==null){var de=p.baseState;S=0,ae=Y=$=null,N=v;do{var J=N.lane&-536870913,te=J!==N.lane;if(te?(We&J)===J:(d&J)===J){J!==0&&J===ql&&(Eh=!0),ae!==null&&(ae=ae.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Ce=r,Me=N;J=i;var xt=s;switch(Me.tag){case 1:if(Ce=Me.payload,typeof Ce=="function"){de=Ce.call(xt,de,J);break e}de=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Me.payload,J=typeof Ce=="function"?Ce.call(xt,de,J):Ce,J==null)break e;de=g({},de,J);break e;case 2:Fa=!0}}J=N.callback,J!==null&&(r.flags|=64,te&&(r.flags|=8192),te=p.callbacks,te===null?p.callbacks=[J]:te.push(J))}else te={lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ae===null?(Y=ae=te,$=de):ae=ae.next=te,S|=J;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;te=N,N=te.next,te.next=null,p.lastBaseUpdate=te,p.shared.pending=null}}while(!0);ae===null&&($=de),p.baseState=$,p.firstBaseUpdate=Y,p.lastBaseUpdate=ae,v===null&&(p.shared.lanes=0),Ga|=S,r.lanes=S,r.memoizedState=de}}function cb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function db(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)cb(s[r],i)}var Ql=L(null),Cc=L(0);function fb(r,i){r=ma,T(Cc,r),T(Ql,i),ma=r|i.baseLanes}function Nh(){T(Cc,ma),T(Ql,Ql.current)}function _h(){ma=Cc.current,P(Ql),P(Cc)}var Xn=L(null),gr=null;function Za(r){var i=r.alternate;T(qt,qt.current&1),T(Xn,r),gr===null&&(i===null||Ql.current!==null||i.memoizedState!==null)&&(gr=r)}function Th(r){T(qt,qt.current),T(Xn,r),gr===null&&(gr=r)}function hb(r){r.tag===22?(T(qt,qt.current),T(Xn,r),gr===null&&(gr=r)):Va()}function Va(){T(qt,qt.current),T(Xn,Xn.current)}function Jn(r){P(Xn),gr===r&&(gr=null),P(qt)}var qt=L(0);function Ec(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Mm(s)||Im(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 la=0,qe=null,vt=null,Vt=null,Nc=!1,Kl=!1,Ji=!1,_c=0,_o=0,Gl=null,f_=0;function Lt(){throw Error(a(321))}function Ah(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Gn(r[s],i[s]))return!1;return!0}function Rh(r,i,s,d,p,v){return la=v,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?Yb:Vh,Ji=!1,v=s(d,p),Ji=!1,Kl&&(v=pb(i,s,d,p)),mb(r),v}function mb(r){Z.H=Ro;var i=vt!==null&&vt.next!==null;if(la=0,Vt=vt=qe=null,Nc=!1,_o=0,Gl=null,i)throw Error(a(300));r===null||Qt||(r=r.dependencies,r!==null&&vc(r)&&(Qt=!0))}function pb(r,i,s,d){qe=r;var p=0;do{if(Kl&&(Gl=null),_o=0,Kl=!1,25<=p)throw Error(a(301));if(p+=1,Vt=vt=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=Xb,v=i(s,d)}while(Kl);return v}function h_(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?To(i):i,r=r.useState()[0],(vt!==null?vt.memoizedState:null)!==r&&(qe.flags|=1024),i}function zh(){var r=_c!==0;return _c=0,r}function Oh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Dh(r){if(Nc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Nc=!1}la=0,Vt=vt=qe=null,Kl=!1,_o=_c=0,Gl=null}function Nn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?qe.memoizedState=Vt=r:Vt=Vt.next=r,Vt}function Ht(){if(vt===null){var r=qe.alternate;r=r!==null?r.memoizedState:null}else r=vt.next;var i=Vt===null?qe.memoizedState:Vt.next;if(i!==null)Vt=i,vt=r;else{if(r===null)throw qe.alternate===null?Error(a(467)):Error(a(310));vt=r,r={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Vt===null?qe.memoizedState=Vt=r:Vt=Vt.next=r}return Vt}function Tc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(r){var i=_o;return _o+=1,Gl===null&&(Gl=[]),r=ib(Gl,r,i),i=qe,(Vt===null?i.memoizedState:Vt.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?Yb:Vh),r}function Ac(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return To(r);if(r.$$typeof===z)return yn(r)}throw Error(a(438,String(r)))}function Mh(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=Tc(),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]=F;return i.index++,s}function sa(r,i){return typeof i=="function"?i(r):i}function Rc(r){var i=Ht();return Ih(i,vt,r)}function Ih(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var S=p.next;p.next=v.next,v.next=S}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=S=null,$=null,Y=i,ae=!1;do{var de=Y.lane&-536870913;if(de!==Y.lane?(We&de)===de:(la&de)===de){var J=Y.revertLane;if(J===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),de===ql&&(ae=!0);else if((la&J)===J){Y=Y.next,J===ql&&(ae=!0);continue}else de={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},$===null?(N=$=de,S=v):$=$.next=de,qe.lanes|=J,Ga|=J;de=Y.action,Ji&&s(v,de),v=Y.hasEagerState?Y.eagerState:s(v,de)}else J={lane:de,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},$===null?(N=$=J,S=v):$=$.next=J,qe.lanes|=de,Ga|=de;Y=Y.next}while(Y!==null&&Y!==i);if($===null?S=v:$.next=N,!Gn(v,r.memoizedState)&&(Qt=!0,ae&&(s=Hl,s!==null)))throw s;r.memoizedState=v,r.baseState=S,r.baseQueue=$,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Lh(r){var i=Ht(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var S=p=p.next;do v=r(v,S.action),S=S.next;while(S!==p);Gn(v,i.memoizedState)||(Qt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function gb(r,i,s){var d=qe,p=Ht(),v=rt;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var S=!Gn((vt||p).memoizedState,s);if(S&&(p.memoizedState=s,Qt=!0),p=p.queue,Bh(bb.bind(null,d,p,r),[r]),p.getSnapshot!==i||S||Vt!==null&&Vt.memoizedState.tag&1){if(d.flags|=2048,Yl(9,{destroy:void 0},vb.bind(null,d,p,s,i),null),St===null)throw Error(a(349));v||(la&127)!==0||yb(d,i,s)}return s}function yb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=Tc(),qe.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function vb(r,i,s,d){i.value=s,i.getSnapshot=d,xb(i)&&wb(r)}function bb(r,i,s){return s(function(){xb(i)&&wb(r)})}function xb(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Gn(r,s)}catch{return!0}}function wb(r){var i=qi(r,2);i!==null&&Bn(i,r,2)}function Uh(r){var i=Nn();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:sa,lastRenderedState:r},i}function Sb(r,i,s,d){return r.baseState=s,Ih(r,vt,typeof d=="function"?d:sa)}function m_(r,i,s,d,p){if(Dc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){v.listeners.push(S)}};Z.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,kb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function kb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,S={};Z.T=S;try{var N=s(p,d),$=Z.S;$!==null&&$(S,N),jb(r,i,N)}catch(Y){Ph(r,i,Y)}finally{v!==null&&S.types!==null&&(v.types=S.types),Z.T=v}}else try{v=s(p,d),jb(r,i,v)}catch(Y){Ph(r,i,Y)}}function jb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){Cb(r,i,d)},function(d){return Ph(r,i,d)}):Cb(r,i,s)}function Cb(r,i,s){i.status="fulfilled",i.value=s,Eb(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,kb(r,s)))}function Ph(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,Eb(i),i=i.next;while(i!==d)}r.action=null}function Eb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Nb(r,i){return i}function _b(r,i){if(rt){var s=St.formState;if(s!==null){e:{var d=qe;if(rt){if(Et){t:{for(var p=Et,v=pr;p.nodeType!==8;){if(!v){p=null;break t}if(p=yr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Et=yr(p.nextSibling),d=p.data==="F!";break e}}Ba(d)}d=!1}d&&(i=s[0])}}return s=Nn(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nb,lastRenderedState:i},s.queue=d,s=Qb.bind(null,qe,d),d.dispatch=s,d=Uh(!1),v=Zh.bind(null,qe,!1,d.queue),d=Nn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=m_.bind(null,qe,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Tb(r){var i=Ht();return Ab(i,vt,r)}function Ab(r,i,s){if(i=Ih(r,i,Nb)[0],r=Rc(sa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=To(i)}catch(S){throw S===Zl?wc:S}else d=i;i=Ht();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,Yl(9,{destroy:void 0},p_.bind(null,p,s),null)),[d,v,r]}function p_(r,i){r.action=i}function Rb(r){var i=Ht(),s=vt;if(s!==null)return Ab(i,s,r);Ht(),i=i.memoizedState,s=Ht();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function Yl(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=qe.updateQueue,i===null&&(i=Tc(),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 zb(){return Ht().memoizedState}function zc(r,i,s,d){var p=Nn();qe.flags|=r,p.memoizedState=Yl(1|i,{destroy:void 0},s,d===void 0?null:d)}function Oc(r,i,s,d){var p=Ht();d=d===void 0?null:d;var v=p.memoizedState.inst;vt!==null&&d!==null&&Ah(d,vt.memoizedState.deps)?p.memoizedState=Yl(i,v,s,d):(qe.flags|=r,p.memoizedState=Yl(1|i,v,s,d))}function Ob(r,i){zc(8390656,8,r,i)}function Bh(r,i){Oc(2048,8,r,i)}function g_(r){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=Tc(),qe.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Db(r){var i=Ht().memoizedState;return g_({ref:i,nextImpl:r}),function(){if((dt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Mb(r,i){return Oc(4,2,r,i)}function Ib(r,i){return Oc(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 Ub(r,i,s){s=s!=null?s.concat([r]):null,Oc(4,4,Lb.bind(null,i,r),s)}function $h(){}function Pb(r,i){var s=Ht();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&Ah(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function Bb(r,i){var s=Ht();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&Ah(i,d[1]))return d[0];if(d=r(),Ji){hn(!0);try{r()}finally{hn(!1)}}return s.memoizedState=[d,i],d}function Fh(r,i,s){return s===void 0||(la&1073741824)!==0&&(We&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=$x(),qe.lanes|=r,Ga|=r,s)}function $b(r,i,s,d){return Gn(s,i)?s:Ql.current!==null?(r=Fh(r,s,d),Gn(r,i)||(Qt=!0),r):(la&42)===0||(la&1073741824)!==0&&(We&261930)===0?(Qt=!0,r.memoizedState=s):(r=$x(),qe.lanes|=r,Ga|=r,i)}function Fb(r,i,s,d,p){var v=re.p;re.p=v!==0&&8>v?v:8;var S=Z.T,N={};Z.T=N,Zh(r,!1,i,s);try{var $=p(),Y=Z.S;if(Y!==null&&Y(N,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ae=d_($,d);Ao(r,i,ae,tr(r))}else Ao(r,i,d,tr(r))}catch(de){Ao(r,i,{then:function(){},status:"rejected",reason:de},tr())}finally{re.p=v,S!==null&&N.types!==null&&(S.types=N.types),Z.T=S}}function y_(){}function qh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=qb(r).queue;Fb(r,p,i,ve,s===null?y_:function(){return Hb(r),s(d)})}function qb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:ve},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Hb(r){var i=qb(r);i.next===null&&(i=r.alternate.memoizedState),Ao(r,i.next.queue,{},tr())}function Hh(){return yn(Qo)}function Zb(){return Ht().memoizedState}function Vb(){return Ht().memoizedState}function v_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=tr();r=qa(s);var d=Ha(i,r,s);d!==null&&(Bn(d,i,s),Co(d,i,s)),i={cache:bh()},r.payload=i;return}i=i.return}}function b_(r,i,s){var d=tr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Dc(r)?Kb(i,s):(s=oh(r,i,s,d),s!==null&&(Bn(s,r,d),Gb(s,i,d)))}function Qb(r,i,s){var d=tr();Ao(r,i,s,d)}function Ao(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Dc(r))Kb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var S=i.lastRenderedState,N=v(S,s);if(p.hasEagerState=!0,p.eagerState=N,Gn(N,S))return mc(r,i,p,0),St===null&&hc(),!1}catch{}finally{}if(s=oh(r,i,p,d),s!==null)return Bn(s,r,d),Gb(s,i,d),!0}return!1}function Zh(r,i,s,d){if(d={lane:2,revertLane:km(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Dc(r)){if(i)throw Error(a(479))}else i=oh(r,s,d,2),i!==null&&Bn(i,r,2)}function Dc(r){var i=r.alternate;return r===qe||i!==null&&i===qe}function Kb(r,i){Kl=Nc=!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,tc(r,s)}}var Ro={readContext:yn,use:Ac,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};Ro.useEffectEvent=Lt;var Yb={readContext:yn,use:Ac,useCallback:function(r,i){return Nn().memoizedState=[r,i===void 0?null:i],r},useContext:yn,useEffect:Ob,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,zc(4194308,4,Lb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return zc(4194308,4,r,i)},useInsertionEffect:function(r,i){zc(4,2,r,i)},useMemo:function(r,i){var s=Nn();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=Nn();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=b_.bind(null,qe,r),[d.memoizedState,r]},useRef:function(r){var i=Nn();return r={current:r},i.memoizedState=r},useState:function(r){r=Uh(r);var i=r.queue,s=Qb.bind(null,qe,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:$h,useDeferredValue:function(r,i){var s=Nn();return Fh(s,r,i)},useTransition:function(){var r=Uh(!1);return r=Fb.bind(null,qe,r.queue,!0,!1),Nn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=qe,p=Nn();if(rt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),St===null)throw Error(a(349));(We&127)!==0||yb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Ob(bb.bind(null,d,v,r),[r]),d.flags|=2048,Yl(9,{destroy:void 0},vb.bind(null,d,v,s,i),null),s},useId:function(){var r=Nn(),i=St.identifierPrefix;if(rt){var s=$r,d=Br;s=(d&~(1<<32-ft(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=_c++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=f_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Hh,useFormState:_b,useActionState:_b,useOptimistic:function(r){var i=Nn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Zh.bind(null,qe,!0,s),s.dispatch=i,[r,i]},useMemoCache:Mh,useCacheRefresh:function(){return Nn().memoizedState=v_.bind(null,qe)},useEffectEvent:function(r){var i=Nn(),s={impl:r};return i.memoizedState=s,function(){if((dt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Vh={readContext:yn,use:Ac,useCallback:Pb,useContext:yn,useEffect:Bh,useImperativeHandle:Ub,useInsertionEffect:Mb,useLayoutEffect:Ib,useMemo:Bb,useReducer:Rc,useRef:zb,useState:function(){return Rc(sa)},useDebugValue:$h,useDeferredValue:function(r,i){var s=Ht();return $b(s,vt.memoizedState,r,i)},useTransition:function(){var r=Rc(sa)[0],i=Ht().memoizedState;return[typeof r=="boolean"?r:To(r),i]},useSyncExternalStore:gb,useId:Zb,useHostTransitionStatus:Hh,useFormState:Tb,useActionState:Tb,useOptimistic:function(r,i){var s=Ht();return Sb(s,vt,r,i)},useMemoCache:Mh,useCacheRefresh:Vb};Vh.useEffectEvent=Db;var Xb={readContext:yn,use:Ac,useCallback:Pb,useContext:yn,useEffect:Bh,useImperativeHandle:Ub,useInsertionEffect:Mb,useLayoutEffect:Ib,useMemo:Bb,useReducer:Lh,useRef:zb,useState:function(){return Lh(sa)},useDebugValue:$h,useDeferredValue:function(r,i){var s=Ht();return vt===null?Fh(s,r,i):$b(s,vt.memoizedState,r,i)},useTransition:function(){var r=Lh(sa)[0],i=Ht().memoizedState;return[typeof r=="boolean"?r:To(r),i]},useSyncExternalStore:gb,useId:Zb,useHostTransitionStatus:Hh,useFormState:Rb,useActionState:Rb,useOptimistic:function(r,i){var s=Ht();return vt!==null?Sb(s,vt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Mh,useCacheRefresh:Vb};Xb.useEffectEvent=Db;function Qh(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 Kh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=tr(),p=qa(d);p.payload=i,s!=null&&(p.callback=s),i=Ha(r,p,d),i!==null&&(Bn(i,r,d),Co(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=tr(),p=qa(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Ha(r,p,d),i!==null&&(Bn(i,r,d),Co(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=tr(),d=qa(s);d.tag=2,i!=null&&(d.callback=i),i=Ha(r,d,s),i!==null&&(Bn(i,r,s),Co(i,r,s))}};function Jb(r,i,s,d,p,v,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,S):i.prototype&&i.prototype.isPureReactComponent?!yo(s,d)||!yo(p,v):!0}function Wb(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&&Kh.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 ex(r){fc(r)}function tx(r){console.error(r)}function nx(r){fc(r)}function Mc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function rx(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 Gh(r,i,s){return s=qa(s),s.tag=3,s.payload={element:null},s.callback=function(){Mc(r,i)},s}function ax(r){return r=qa(r),r.tag=3,r}function ix(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(){rx(i,s,d)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){rx(i,s,d),typeof p!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function x_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Fl(i,s,p,!0),s=Xn.current,s!==null){switch(s.tag){case 31:case 13:return gr===null?Qc():s.alternate===null&&Ut===0&&(Ut=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===Sc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),xm(r,d,p)),!1;case 22:return s.flags|=65536,d===Sc?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)),xm(r,d,p)),!1}throw Error(a(435,s.tag))}return xm(r,d,p),Qc(),!1}if(rt)return i=Xn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==mh&&(r=Error(a(422),{cause:d}),xo(fr(r,s)))):(d!==mh&&(i=Error(a(423),{cause:d}),xo(fr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=fr(d,s),p=Gh(r.stateNode,d,p),Ch(r,p),Ut!==4&&(Ut=2)),!1;var v=Error(a(520),{cause:d});if(v=fr(v,s),Po===null?Po=[v]:Po.push(v),Ut!==4&&(Ut=2),i===null)return!0;d=fr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Gh(s.stateNode,d,r),Ch(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"&&(Ya===null||!Ya.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=ax(p),ix(p,r,s,d),Ch(s,p),!1}s=s.return}while(s!==null);return!1}var Yh=Error(a(461)),Qt=!1;function vn(r,i,s,d){i.child=r===null?ub(i,null,s,d):Xi(i,r.child,s,d)}function lx(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var S={};for(var N in d)N!=="ref"&&(S[N]=d[N])}else S=d;return Qi(i),d=Rh(r,i,s,S,v,p),N=zh(),r!==null&&!Qt?(Oh(r,i,p),oa(r,i,p)):(rt&&N&&fh(i),i.flags|=1,vn(r,i,d,p),i.child)}function sx(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!uh(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,ox(r,i,v,d,p)):(r=gc(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!am(r,p)){var S=v.memoizedProps;if(s=s.compare,s=s!==null?s:yo,s(S,d)&&r.ref===i.ref)return oa(r,i,p)}return i.flags|=1,r=na(v,d),r.ref=i.ref,r.return=i,i.child=r}function ox(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(yo(v,d)&&r.ref===i.ref)if(Qt=!1,i.pendingProps=d=v,am(r,p))(r.flags&131072)!==0&&(Qt=!0);else return i.lanes=r.lanes,oa(r,i,p)}return Xh(r,i,s,d,p)}function ux(r,i,s,d){var p=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~v}else d=0,i.child=null;return cx(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&xc(i,v!==null?v.cachePool:null),v!==null?fb(i,v):Nh(),hb(i);else return d=i.lanes=536870912,cx(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(xc(i,v.cachePool),fb(i,v),Va(),i.memoizedState=null):(r!==null&&xc(i,null),Nh(),Va());return vn(r,i,p,s),i.child}function zo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function cx(r,i,s,d,p){var v=wh();return v=v===null?null:{parent:Zt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&xc(i,null),Nh(),hb(i),r!==null&&Fl(r,i,d,!0),i.childLanes=p,null}function Ic(r,i){return i=Uc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function dx(r,i,s){return Xi(i,r.child,null,s),r=Ic(i,i.pendingProps),r.flags|=2,Jn(i),i.memoizedState=null,r}function w_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(rt){if(d.mode==="hidden")return r=Ic(i,d),i.lanes=536870912,zo(null,r);if(Th(i),(r=Et)?(r=k0(r,pr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ua!==null?{id:Br,overflow:$r}:null,retryLane:536870912,hydrationErrors:null},s=Kv(r),s.return=i,i.child=s,gn=i,Et=null)):r=null,r===null)throw Ba(i);return i.lanes=536870912,null}return Ic(i,d)}var v=r.memoizedState;if(v!==null){var S=v.dehydrated;if(Th(i),p)if(i.flags&256)i.flags&=-257,i=dx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Qt||Fl(r,i,s,!1),p=(s&r.childLanes)!==0,Qt||p){if(d=St,d!==null&&(S=tv(d,s),S!==0&&S!==v.retryLane))throw v.retryLane=S,qi(r,S),Bn(d,r,S),Yh;Qc(),i=dx(r,i,s)}else r=v.treeContext,Et=yr(S.nextSibling),gn=i,rt=!0,Pa=null,pr=!1,r!==null&&Xv(i,r),i=Ic(i,d),i.flags|=4096;return i}return r=na(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Lc(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 Xh(r,i,s,d,p){return Qi(i),s=Rh(r,i,s,d,void 0,p),d=zh(),r!==null&&!Qt?(Oh(r,i,p),oa(r,i,p)):(rt&&d&&fh(i),i.flags|=1,vn(r,i,s,p),i.child)}function fx(r,i,s,d,p,v){return Qi(i),i.updateQueue=null,s=pb(i,d,s,p),mb(r),d=zh(),r!==null&&!Qt?(Oh(r,i,v),oa(r,i,v)):(rt&&d&&fh(i),i.flags|=1,vn(r,i,s,v),i.child)}function hx(r,i,s,d,p){if(Qi(i),i.stateNode===null){var v=Ul,S=s.contextType;typeof S=="object"&&S!==null&&(v=yn(S)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Kh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},kh(i),S=s.contextType,v.context=typeof S=="object"&&S!==null?yn(S):Ul,v.state=i.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(Qh(i,s,S,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(S=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),S!==v.state&&Kh.enqueueReplaceState(v,v.state,null),No(i,d,v,p),Eo(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,$=Wi(s,N);v.props=$;var Y=v.context,ae=s.contextType;S=Ul,typeof ae=="object"&&ae!==null&&(S=yn(ae));var de=s.getDerivedStateFromProps;ae=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,ae||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||Y!==S)&&Wb(i,v,d,S),Fa=!1;var J=i.memoizedState;v.state=J,No(i,d,v,p),Eo(),Y=i.memoizedState,N||J!==Y||Fa?(typeof de=="function"&&(Qh(i,s,de,d),Y=i.memoizedState),($=Fa||Jb(i,s,$,d,J,Y,S))?(ae||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=Y),v.props=d,v.state=Y,v.context=S,d=$):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,jh(r,i),S=i.memoizedProps,ae=Wi(s,S),v.props=ae,de=i.pendingProps,J=v.context,Y=s.contextType,$=Ul,typeof Y=="object"&&Y!==null&&($=yn(Y)),N=s.getDerivedStateFromProps,(Y=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==de||J!==$)&&Wb(i,v,d,$),Fa=!1,J=i.memoizedState,v.state=J,No(i,d,v,p),Eo();var te=i.memoizedState;S!==de||J!==te||Fa||r!==null&&r.dependencies!==null&&vc(r.dependencies)?(typeof N=="function"&&(Qh(i,s,N,d),te=i.memoizedState),(ae=Fa||Jb(i,s,ae,d,J,te,$)||r!==null&&r.dependencies!==null&&vc(r.dependencies))?(Y||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,te,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,te,$)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=te),v.props=d,v.state=te,v.context=$,d=ae):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Lc(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=oa(r,i,p),r}function mx(r,i,s,d){return Zi(),i.flags|=256,vn(r,i,s,d),i.child}var Jh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wh(r){return{baseLanes:r,cachePool:rb()}}function em(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=er),r}function px(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,S;if((S=v)||(S=r!==null&&r.memoizedState===null?!1:(qt.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,r===null){if(rt){if(p?Za(i):Va(),(r=Et)?(r=k0(r,pr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ua!==null?{id:Br,overflow:$r}:null,retryLane:536870912,hydrationErrors:null},s=Kv(r),s.return=i,i.child=s,gn=i,Et=null)):r=null,r===null)throw Ba(i);return Im(r)?i.lanes=32:i.lanes=536870912,null}var N=d.children;return d=d.fallback,p?(Va(),p=i.mode,N=Uc({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=Wh(s),d.childLanes=em(r,S,s),i.memoizedState=Jh,zo(null,d)):(Za(i),tm(i,N))}var $=r.memoizedState;if($!==null&&(N=$.dehydrated,N!==null)){if(v)i.flags&256?(Za(i),i.flags&=-257,i=nm(r,i,s)):i.memoizedState!==null?(Va(),i.child=r.child,i.flags|=128,i=null):(Va(),N=d.fallback,p=i.mode,d=Uc({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=Wh(s),d.childLanes=em(r,S,s),i.memoizedState=Jh,i=zo(null,d));else if(Za(i),Im(N)){if(S=N.nextSibling&&N.nextSibling.dataset,S)var Y=S.dgst;S=Y,d=Error(a(419)),d.stack="",d.digest=S,xo({value:d,source:null,stack:null}),i=nm(r,i,s)}else if(Qt||Fl(r,i,s,!1),S=(s&r.childLanes)!==0,Qt||S){if(S=St,S!==null&&(d=tv(S,s),d!==0&&d!==$.retryLane))throw $.retryLane=d,qi(r,d),Bn(S,r,d),Yh;Mm(N)||Qc(),i=nm(r,i,s)}else Mm(N)?(i.flags|=192,i.child=r.child,i=null):(r=$.treeContext,Et=yr(N.nextSibling),gn=i,rt=!0,Pa=null,pr=!1,r!==null&&Xv(i,r),i=tm(i,d.children),i.flags|=4096);return i}return p?(Va(),N=d.fallback,p=i.mode,$=r.child,Y=$.sibling,d=na($,{mode:"hidden",children:d.children}),d.subtreeFlags=$.subtreeFlags&65011712,Y!==null?N=na(Y,N):(N=Hi(N,p,s,null),N.flags|=2),N.return=i,d.return=i,d.sibling=N,i.child=d,zo(null,d),d=i.child,N=r.child.memoizedState,N===null?N=Wh(s):(p=N.cachePool,p!==null?($=Zt._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=rb(),N={baseLanes:N.baseLanes|s,cachePool:p}),d.memoizedState=N,d.childLanes=em(r,S,s),i.memoizedState=Jh,zo(r.child,d)):(Za(i),s=r.child,r=s.sibling,s=na(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(S=i.deletions,S===null?(i.deletions=[r],i.flags|=16):S.push(r)),i.child=s,i.memoizedState=null,s)}function tm(r,i){return i=Uc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Uc(r,i){return r=Yn(22,r,null,i),r.lanes=0,r}function nm(r,i,s){return Xi(i,r.child,null,s),r=tm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function gx(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),yh(r.return,i,s)}function rm(r,i,s,d,p,v){var S=r.memoizedState;S===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=s,S.tailMode=p,S.treeForkCount=v)}function yx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var S=qt.current,N=(S&2)!==0;if(N?(S=S&1|2,i.flags|=128):S&=1,T(qt,S),vn(r,i,d,s),d=rt?bo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&gx(r,s,i);else if(r.tag===19)gx(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&&Ec(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),rm(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&&Ec(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}rm(i,!0,s,null,v,d);break;case"together":rm(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function oa(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Ga|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Fl(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=na(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=na(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function am(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&vc(r)))}function S_(r,i,s){switch(i.tag){case 3:be(i,i.stateNode.containerInfo),$a(i,Zt,r.memoizedState.cache),Zi();break;case 27:case 5:ee(i);break;case 4:be(i,i.stateNode.containerInfo);break;case 10:$a(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Th(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Za(i),i.flags|=128,null):(s&i.child.childLanes)!==0?px(r,i,s):(Za(i),r=oa(r,i,s),r!==null?r.sibling:null);Za(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Fl(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return yx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(qt,qt.current),d)break;return null;case 22:return i.lanes=0,ux(r,i,s,i.pendingProps);case 24:$a(i,Zt,r.memoizedState.cache)}return oa(r,i,s)}function vx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Qt=!0;else{if(!am(r,s)&&(i.flags&128)===0)return Qt=!1,S_(r,i,s);Qt=(r.flags&131072)!==0}else Qt=!1,rt&&(i.flags&1048576)!==0&&Yv(i,bo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Gi(i.elementType),i.type=r,typeof r=="function")uh(r)?(d=Wi(r,d),i.tag=1,i=hx(null,i,r,d,s)):(i.tag=0,i=Xh(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===M){i.tag=11,i=lx(null,i,r,d,s);break e}else if(p===D){i.tag=14,i=sx(null,i,r,d,s);break e}}throw i=G(r)||r,Error(a(306,i,""))}}return i;case 0:return Xh(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=Wi(d,i.pendingProps),hx(r,i,d,p,s);case 3:e:{if(be(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,jh(r,i),No(i,d,null,s);var S=i.memoizedState;if(d=S.cache,$a(i,Zt,d),d!==v.cache&&vh(i,[Zt],s,!0),Eo(),d=S.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=mx(r,i,d,s);break e}else if(d!==p){p=fr(Error(a(424)),i),xo(p),i=mx(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=yr(r.firstChild),gn=i,rt=!0,Pa=null,pr=!0,s=ub(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Zi(),d===p){i=oa(r,i,s);break e}vn(r,i,d,s)}i=i.child}return i;case 26:return Lc(r,i),r===null?(s=T0(i.type,null,i.pendingProps,null))?i.memoizedState=s:rt||(s=i.type,r=i.pendingProps,d=ed(ue.current).createElement(s),d[pn]=i,d[Dn]=r,bn(d,s,r),ln(d),i.stateNode=d):i.memoizedState=T0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return ee(i),r===null&&rt&&(d=i.stateNode=E0(i.type,i.pendingProps,ue.current),gn=i,pr=!0,p=Et,ei(i.type)?(Lm=p,Et=yr(d.firstChild)):Et=p),vn(r,i,i.pendingProps.children,s),Lc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&rt&&((p=d=Et)&&(d=J_(d,i.type,i.pendingProps,pr),d!==null?(i.stateNode=d,gn=i,Et=yr(d.firstChild),pr=!1,p=!0):p=!1),p||Ba(i)),ee(i),p=i.type,v=i.pendingProps,S=r!==null?r.memoizedProps:null,d=v.children,zm(p,v)?d=null:S!==null&&zm(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=Rh(r,i,h_,null,null,s),Qo._currentValue=p),Lc(r,i),vn(r,i,d,s),i.child;case 6:return r===null&&rt&&((r=s=Et)&&(s=W_(s,i.pendingProps,pr),s!==null?(i.stateNode=s,gn=i,Et=null,r=!0):r=!1),r||Ba(i)),null;case 13:return px(r,i,s);case 4:return be(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 lx(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,$a(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 sx(r,i,i.type,i.pendingProps,s);case 15:return ox(r,i,i.type,i.pendingProps,s);case 19:return yx(r,i,s);case 31:return w_(r,i,s);case 22:return ux(r,i,s,i.pendingProps);case 24:return Qi(i),d=yn(Zt),r===null?(p=wh(),p===null&&(p=St,v=bh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},kh(i),$a(i,Zt,p)):((r.lanes&s)!==0&&(jh(r,i),No(i,null,null,s),Eo()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),$a(i,Zt,d)):(d=v.cache,$a(i,Zt,d),d!==p.cache&&vh(i,[Zt],s,!0))),vn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ua(r){r.flags|=4}function im(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(Zx())r.flags|=8192;else throw Yi=Sc,Sh}else r.flags&=-16777217}function bx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!D0(i))if(Zx())r.flags|=8192;else throw Yi=Sc,Sh}function Pc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?we():536870912,r.lanes|=i,es|=i)}function Oo(r,i){if(!rt)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 k_(r,i,s){var d=i.pendingProps;switch(hh(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),ia(Zt),fe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&($l(i)?ua(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,ph())),Nt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ua(i),v!==null?(Nt(i),bx(i,v)):(Nt(i),im(i,p,null,d,s))):v?v!==r.memoizedState?(ua(i),Nt(i),bx(i,v)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&ua(i),Nt(i),im(i,p,r,d,s)),null;case 27:if(me(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ua(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}r=q.current,$l(i)?Jv(i):(r=E0(p,d,s),i.stateNode=r,ua(i))}return Nt(i),null;case 5:if(me(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ua(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(v=q.current,$l(i))Jv(i);else{var S=ed(ue.current);switch(v){case 1:v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=S.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?S.createElement(p,{is:d.is}):S.createElement(p)}}v[pn]=i,v[Dn]=d;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)v.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=v;e:switch(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&&ua(i)}}return Nt(i),im(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&ua(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,$l(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||p0(r.nodeValue,s)),r||Ba(i,!0)}else r=ed(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=$l(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[pn]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=ph(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Jn(i),i):(Jn(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=$l(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[pn]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=ph(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Jn(i),i):(Jn(i),null)}return Jn(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),Pc(i,i.updateQueue),Nt(i),null);case 4:return fe(),r===null&&Nm(i.stateNode.containerInfo),Nt(i),null;case 10:return ia(i.type),Nt(i),null;case 19:if(P(qt),d=i.memoizedState,d===null)return Nt(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Oo(d,!1);else{if(Ut!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=Ec(r),v!==null){for(i.flags|=128,Oo(d,!1),r=v.updateQueue,i.updateQueue=r,Pc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Qv(s,r),s=s.sibling;return T(qt,qt.current&1|2),rt&&ra(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&dn()>Hc&&(i.flags|=128,p=!0,Oo(d,!1),i.lanes=4194304)}else{if(!p)if(r=Ec(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Pc(i,r),Oo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!rt)return Nt(i),null}else 2*dn()-d.renderingStartTime>Hc&&s!==536870912&&(i.flags|=128,p=!0,Oo(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=dn(),r.sibling=null,s=qt.current,T(qt,p?s&1|2:s&1),rt&&ra(i,d.treeForkCount),r):(Nt(i),null);case 22:case 23:return Jn(i),_h(),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&&Pc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&P(Ki),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ia(Zt),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function j_(r,i){switch(hh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ia(Zt),fe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return me(i),null;case 31:if(i.memoizedState!==null){if(Jn(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(Jn(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 P(qt),null;case 4:return fe(),null;case 10:return ia(i.type),null;case 22:case 23:return Jn(i),_h(),r!==null&&P(Ki),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ia(Zt),null;case 25:return null;default:return null}}function xx(r,i){switch(hh(i),i.tag){case 3:ia(Zt),fe();break;case 26:case 27:case 5:me(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&Jn(i);break;case 13:Jn(i);break;case 19:P(qt);break;case 10:ia(i.type);break;case 22:case 23:Jn(i),_h(),r!==null&&P(Ki);break;case 24:ia(Zt)}}function Do(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var v=s.create,S=s.inst;d=v(),S.destroy=d}s=s.next}while(s!==p)}}catch(N){yt(i,i.return,N)}}function Qa(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var S=d.inst,N=S.destroy;if(N!==void 0){S.destroy=void 0,p=i;var $=s,Y=N;try{Y()}catch(ae){yt(p,$,ae)}}}d=d.next}while(d!==v)}}catch(ae){yt(i,i.return,ae)}}function wx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{db(i,s)}catch(d){yt(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){yt(r,i,d)}}function Mo(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){yt(r,i,p)}}function Fr(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){yt(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){yt(r,i,p)}else s.current=null}function kx(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){yt(r,r.return,p)}}function lm(r,i,s){try{var d=r.stateNode;V_(d,r.type,s,i),d[Dn]=i}catch(p){yt(r,r.return,p)}}function jx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ei(r.type)||r.tag===4}function sm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||jx(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&&ei(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 om(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=ea));else if(d!==4&&(d===27&&ei(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(om(r,i,s),r=r.sibling;r!==null;)om(r,i,s),r=r.sibling}function Bc(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&&ei(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Bc(r,i,s),r=r.sibling;r!==null;)Bc(r,i,s),r=r.sibling}function Cx(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[Dn]=s}catch(v){yt(r,r.return,v)}}var ca=!1,Kt=!1,um=!1,Ex=typeof WeakSet=="function"?WeakSet:Set,sn=null;function C_(r,i){if(r=r.containerInfo,Am=sd,r=Uv(r),nh(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var S=0,N=-1,$=-1,Y=0,ae=0,de=r,J=null;t:for(;;){for(var te;de!==s||p!==0&&de.nodeType!==3||(N=S+p),de!==v||d!==0&&de.nodeType!==3||($=S+d),de.nodeType===3&&(S+=de.nodeValue.length),(te=de.firstChild)!==null;)J=de,de=te;for(;;){if(de===r)break t;if(J===s&&++Y===p&&(N=S),J===v&&++ae===d&&($=S),(te=de.nextSibling)!==null)break;de=J,J=de.parentNode}de=te}s=N===-1||$===-1?null:{start:N,end:$}}else s=null}s=s||{start:0,end:0}}else s=null;for(Rm={focusedElem:r,selectionRange:s},sd=!1,sn=i;sn!==null;)if(i=sn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,sn=r;else for(;sn!==null;){switch(i=sn,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 Ce=Wi(s.type,p);r=d.getSnapshotBeforeUpdate(Ce,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Me){yt(s,s.return,Me)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Dm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Dm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,sn=r;break}sn=i.return}}function Nx(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:fa(r,s),d&4&&Do(5,s);break;case 1:if(fa(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(S){yt(s,s.return,S)}else{var p=Wi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(S){yt(s,s.return,S)}}d&64&&wx(s),d&512&&Mo(s,s.return);break;case 3:if(fa(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{db(r,i)}catch(S){yt(s,s.return,S)}}break;case 27:i===null&&d&4&&Cx(s);case 26:case 5:fa(r,s),i===null&&d&4&&kx(s),d&512&&Mo(s,s.return);break;case 12:fa(r,s);break;case 31:fa(r,s),d&4&&Ax(r,s);break;case 13:fa(r,s),d&4&&Rx(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=D_.bind(null,s),e2(r,s))));break;case 22:if(d=s.memoizedState!==null||ca,!d){i=i!==null&&i.memoizedState!==null||Kt,p=ca;var v=Kt;ca=d,(Kt=i)&&!v?ha(r,s,(s.subtreeFlags&8772)!==0):fa(r,s),ca=p,Kt=v}break;case 30:break;default:fa(r,s)}}function _x(r){var i=r.alternate;i!==null&&(r.alternate=null,_x(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Pf(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 Tt=null,In=!1;function da(r,i,s){for(s=s.child;s!==null;)Tx(r,i,s),s=s.sibling}function Tx(r,i,s){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(Wt,s)}catch{}switch(s.tag){case 26:Kt||Fr(s,i),da(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Kt||Fr(s,i);var d=Tt,p=In;ei(s.type)&&(Tt=s.stateNode,In=!1),da(r,i,s),Ho(s.stateNode),Tt=d,In=p;break;case 5:Kt||Fr(s,i);case 6:if(d=Tt,p=In,Tt=null,da(r,i,s),Tt=d,In=p,Tt!==null)if(In)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(s.stateNode)}catch(v){yt(s,i,v)}else try{Tt.removeChild(s.stateNode)}catch(v){yt(s,i,v)}break;case 18:Tt!==null&&(In?(r=Tt,w0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),os(r)):w0(Tt,s.stateNode));break;case 4:d=Tt,p=In,Tt=s.stateNode.containerInfo,In=!0,da(r,i,s),Tt=d,In=p;break;case 0:case 11:case 14:case 15:Qa(2,s,i),Kt||Qa(4,s,i),da(r,i,s);break;case 1:Kt||(Fr(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Sx(s,i,d)),da(r,i,s);break;case 21:da(r,i,s);break;case 22:Kt=(d=Kt)||s.memoizedState!==null,da(r,i,s),Kt=d;break;default:da(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{os(r)}catch(s){yt(i,i.return,s)}}}function Rx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{os(r)}catch(s){yt(i,i.return,s)}}function E_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Ex),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Ex),i;default:throw Error(a(435,r.tag))}}function $c(r,i){var s=E_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=M_.bind(null,r,d);d.then(p,p)}})}function Ln(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,S=i,N=S;e:for(;N!==null;){switch(N.tag){case 27:if(ei(N.type)){Tt=N.stateNode,In=!1;break e}break;case 5:Tt=N.stateNode,In=!1;break e;case 3:case 4:Tt=N.stateNode.containerInfo,In=!0;break e}N=N.return}if(Tt===null)throw Error(a(160));Tx(v,S,p),Tt=null,In=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)zx(i,r),i=i.sibling}var Tr=null;function zx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Ln(i,r),Un(r),d&4&&(Qa(3,r,r.return),Do(3,r),Qa(5,r,r.return));break;case 1:Ln(i,r),Un(r),d&512&&(Kt||s===null||Fr(s,s.return)),d&64&&ca&&(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=Tr;if(Ln(i,r),Un(r),d&512&&(Kt||s===null||Fr(s,s.return)),d&4){var v=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[so]||v[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,ln(v),d=v;break e;case"link":var S=z0("link","href",p).get(d+(s.href||""));if(S){for(var N=0;N<S.length;N++)if(v=S[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)){S.splice(N,1);break t}}v=p.createElement(d),bn(v,d,s),p.head.appendChild(v);break;case"meta":if(S=z0("meta","content",p).get(d+(s.content||""))){for(N=0;N<S.length;N++)if(v=S[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)){S.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,ln(v),d=v}r.stateNode=d}else O0(p,r.type,r.stateNode);else r.stateNode=R0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?O0(p,r.type,r.stateNode):R0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&lm(r,r.memoizedProps,s.memoizedProps)}break;case 27:Ln(i,r),Un(r),d&512&&(Kt||s===null||Fr(s,s.return)),s!==null&&d&4&&lm(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Ln(i,r),Un(r),d&512&&(Kt||s===null||Fr(s,s.return)),r.flags&32){p=r.stateNode;try{Rl(p,"")}catch(Ce){yt(r,r.return,Ce)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,lm(r,p,s!==null?s.memoizedProps:p)),d&1024&&(um=!0);break;case 6:if(Ln(i,r),Un(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(Ce){yt(r,r.return,Ce)}}break;case 3:if(rd=null,p=Tr,Tr=td(i.containerInfo),Ln(i,r),Tr=p,Un(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{os(i.containerInfo)}catch(Ce){yt(r,r.return,Ce)}um&&(um=!1,Ox(r));break;case 4:d=Tr,Tr=td(r.stateNode.containerInfo),Ln(i,r),Un(r),Tr=d;break;case 12:Ln(i,r),Un(r);break;case 31:Ln(i,r),Un(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,$c(r,d)));break;case 13:Ln(i,r),Un(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(qc=dn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,$c(r,d)));break;case 22:p=r.memoizedState!==null;var $=s!==null&&s.memoizedState!==null,Y=ca,ae=Kt;if(ca=Y||p,Kt=ae||$,Ln(i,r),Kt=ae,ca=Y,Un(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||$||ca||Kt||el(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){$=s=i;try{if(v=$.stateNode,p)S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{N=$.stateNode;var de=$.memoizedProps.style,J=de!=null&&de.hasOwnProperty("display")?de.display:null;N.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(Ce){yt($,$.return,Ce)}}}else if(i.tag===6){if(s===null){$=i;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(Ce){yt($,$.return,Ce)}}}else if(i.tag===18){if(s===null){$=i;try{var te=$.stateNode;p?S0(te,!0):S0($.stateNode,!1)}catch(Ce){yt($,$.return,Ce)}}}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,$c(r,s))));break;case 19:Ln(i,r),Un(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,$c(r,d)));break;case 30:break;case 21:break;default:Ln(i,r),Un(r)}}function Un(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(jx(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=sm(r);Bc(r,v,p);break;case 5:var S=s.stateNode;s.flags&32&&(Rl(S,""),s.flags&=-33);var N=sm(r);Bc(r,N,S);break;case 3:case 4:var $=s.stateNode.containerInfo,Y=sm(r);om(r,Y,$);break;default:throw Error(a(161))}}catch(ae){yt(r,r.return,ae)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Ox(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Ox(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function fa(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Nx(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:Qa(4,i,i.return),el(i);break;case 1:Fr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Sx(i,i.return,s),el(i);break;case 27:Ho(i.stateNode);case 26:case 5:Fr(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 ha(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,S=v.flags;switch(v.tag){case 0:case 11:case 15:ha(p,v,s),Do(4,v);break;case 1:if(ha(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Y){yt(d,d.return,Y)}if(d=v,p=d.updateQueue,p!==null){var N=d.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)cb($[p],N)}catch(Y){yt(d,d.return,Y)}}s&&S&64&&wx(v),Mo(v,v.return);break;case 27:Cx(v);case 26:case 5:ha(p,v,s),s&&d===null&&S&4&&kx(v),Mo(v,v.return);break;case 12:ha(p,v,s);break;case 31:ha(p,v,s),s&&S&4&&Ax(p,v);break;case 13:ha(p,v,s),s&&S&4&&Rx(p,v);break;case 22:v.memoizedState===null&&ha(p,v,s),Mo(v,v.return);break;case 30:break;default:ha(p,v,s)}i=i.sibling}}function cm(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&wo(s))}function dm(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wo(r))}function Ar(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Dx(r,i,s,d),i=i.sibling}function Dx(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Ar(r,i,s,d),p&2048&&Do(9,i);break;case 1:Ar(r,i,s,d);break;case 3:Ar(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wo(r)));break;case 12:if(p&2048){Ar(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,S=v.id,N=v.onPostCommit;typeof N=="function"&&N(S,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){yt(i,i.return,$)}}else Ar(r,i,s,d);break;case 31:Ar(r,i,s,d);break;case 13:Ar(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,S=i.alternate,i.memoizedState!==null?v._visibility&2?Ar(r,i,s,d):Io(r,i):v._visibility&2?Ar(r,i,s,d):(v._visibility|=2,Xl(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&cm(S,i);break;case 24:Ar(r,i,s,d),p&2048&&dm(i.alternate,i);break;default:Ar(r,i,s,d)}}function Xl(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,S=i,N=s,$=d,Y=S.flags;switch(S.tag){case 0:case 11:case 15:Xl(v,S,N,$,p),Do(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?Xl(v,S,N,$,p):Io(v,S):(ae._visibility|=2,Xl(v,S,N,$,p)),p&&Y&2048&&cm(S.alternate,S);break;case 24:Xl(v,S,N,$,p),p&&Y&2048&&dm(S.alternate,S);break;default:Xl(v,S,N,$,p)}i=i.sibling}}function Io(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:Io(s,d),p&2048&&cm(d.alternate,d);break;case 24:Io(s,d),p&2048&&dm(d.alternate,d);break;default:Io(s,d)}i=i.sibling}}var Lo=8192;function Jl(r,i,s){if(r.subtreeFlags&Lo)for(r=r.child;r!==null;)Mx(r,i,s),r=r.sibling}function Mx(r,i,s){switch(r.tag){case 26:Jl(r,i,s),r.flags&Lo&&r.memoizedState!==null&&f2(s,Tr,r.memoizedState,r.memoizedProps);break;case 5:Jl(r,i,s);break;case 3:case 4:var d=Tr;Tr=td(r.stateNode.containerInfo),Jl(r,i,s),Tr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Lo,Lo=16777216,Jl(r,i,s),Lo=d):Jl(r,i,s));break;default:Jl(r,i,s)}}function Ix(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function Uo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];sn=d,Ux(d,r)}Ix(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:Uo(r),r.flags&2048&&Qa(9,r,r.return);break;case 3:Uo(r);break;case 12:Uo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Fc(r)):Uo(r);break;default:Uo(r)}}function Fc(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];sn=d,Ux(d,r)}Ix(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Qa(8,i,i.return),Fc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Fc(i));break;default:Fc(i)}r=r.sibling}}function Ux(r,i){for(;sn!==null;){var s=sn;switch(s.tag){case 0:case 11:case 15:Qa(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:wo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,sn=d;else e:for(s=r;sn!==null;){d=sn;var p=d.sibling,v=d.return;if(_x(d),d===s){sn=null;break e}if(p!==null){p.return=v,sn=p;break e}sn=v}}}var N_={getCacheForType:function(r){var i=yn(Zt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return yn(Zt).controller.signal}},__=typeof WeakMap=="function"?WeakMap:Map,dt=0,St=null,Ye=null,We=0,gt=0,Wn=null,Ka=!1,Wl=!1,fm=!1,ma=0,Ut=0,Ga=0,tl=0,hm=0,er=0,es=0,Po=null,Pn=null,mm=!1,qc=0,Px=0,Hc=1/0,Zc=null,Ya=null,en=0,Xa=null,ts=null,pa=0,pm=0,gm=null,Bx=null,Bo=0,ym=null;function tr(){return(dt&2)!==0&&We!==0?We&-We:Z.T!==null?km():nv()}function $x(){if(er===0)if((We&536870912)===0||rt){var r=Ii;Ii<<=1,(Ii&3932160)===0&&(Ii=262144),er=r}else er=536870912;return r=Xn.current,r!==null&&(r.flags|=32),er}function Bn(r,i,s){(r===St&&(gt===2||gt===9)||r.cancelPendingCommit!==null)&&(ns(r,0),Ja(r,We,er,!1)),mn(r,s),((dt&2)===0||r!==St)&&(r===St&&((dt&2)===0&&(tl|=s),Ut===4&&Ja(r,We,er,!1)),qr(r))}function Fx(r,i,s){if((dt&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ma(r,i),p=d?R_(r,i):bm(r,i,!0),v=d;do{if(p===0){Wl&&!d&&Ja(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!T_(s)){p=bm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var N=r;p=Po;var $=N.current.memoizedState.isDehydrated;if($&&(ns(N,S).flags|=256),S=bm(N,S,!1),S!==2){if(fm&&!$){N.errorRecoveryDisabledLanes|=v,tl|=v,p=4;break e}v=Pn,Pn=p,v!==null&&(Pn===null?Pn=v:Pn.push.apply(Pn,v))}p=S}if(v=!1,p!==2)continue}}if(p===1){ns(r,0),Ja(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:Ja(d,i,er,!Ka);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=qc+300-dn(),10<p)){if(Ja(d,i,er,!Ka),Ui(d,0,!0)!==0)break e;pa=i,d.timeoutHandle=b0(qx.bind(null,d,s,Pn,Zc,mm,i,er,tl,es,Ka,v,"Throttled",-0,0),p);break e}qx(d,s,Pn,Zc,mm,i,er,tl,es,Ka,v,null,-0,0)}}break}while(!0);qr(r)}function qx(r,i,s,d,p,v,S,N,$,Y,ae,de,J,te){if(r.timeoutHandle=-1,de=i.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ea},Mx(i,v,de);var Ce=(v&62914560)===v?qc-dn():(v&4194048)===v?Px-dn():0;if(Ce=h2(de,Ce),Ce!==null){pa=v,r.cancelPendingCommit=Ce(Xx.bind(null,r,i,v,s,d,p,S,N,$,ae,de,null,J,te)),Ja(r,v,S,!Y);return}}Xx(r,i,v,s,d,p,S,N,$)}function T_(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(!Gn(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 Ja(r,i,s,d){i&=~hm,i&=~tl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-ft(p),S=1<<v;d[v]=-1,p&=~S}s!==0&&lo(r,s,i)}function Vc(){return(dt&6)===0?($o(0),!1):!0}function vm(){if(Ye!==null){if(gt===0)var r=Ye.return;else r=Ye,aa=Vi=null,Dh(r),Vl=null,ko=0,r=Ye;for(;r!==null;)xx(r.alternate,r),r=r.return;Ye=null}}function ns(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,G_(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),pa=0,vm(),St=r,Ye=s=na(r.current,null),We=i,gt=0,Wn=null,Ka=!1,Wl=Ma(r,i),fm=!1,es=er=hm=tl=Ga=Ut=0,Pn=Po=null,mm=!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-ft(d),v=1<<p;i|=r[p],d&=~v}return ma=i,hc(),s}function Hx(r,i){qe=null,Z.H=Ro,i===Zl||i===wc?(i=lb(),gt=3):i===Sh?(i=lb(),gt=4):gt=i===Yh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Wn=i,Ye===null&&(Ut=1,Mc(r,fr(i,r.current)))}function Zx(){var r=Xn.current;return r===null?!0:(We&4194048)===We?gr===null:(We&62914560)===We||(We&536870912)!==0?r===gr:!1}function Vx(){var r=Z.H;return Z.H=Ro,r===null?Ro:r}function Qx(){var r=Z.A;return Z.A=N_,r}function Qc(){Ut=4,Ka||(We&4194048)!==We&&Xn.current!==null||(Wl=!0),(Ga&134217727)===0&&(tl&134217727)===0||St===null||Ja(St,We,er,!1)}function bm(r,i,s){var d=dt;dt|=2;var p=Vx(),v=Qx();(St!==r||We!==i)&&(Zc=null,ns(r,i)),i=!1;var S=Ut;e:do try{if(gt!==0&&Ye!==null){var N=Ye,$=Wn;switch(gt){case 8:vm(),S=6;break e;case 3:case 2:case 9:case 6:Xn.current===null&&(i=!0);var Y=gt;if(gt=0,Wn=null,rs(r,N,$,Y),s&&Wl){S=0;break e}break;default:Y=gt,gt=0,Wn=null,rs(r,N,$,Y)}}A_(),S=Ut;break}catch(ae){Hx(r,ae)}while(!0);return i&&r.shellSuspendCounter++,aa=Vi=null,dt=d,Z.H=p,Z.A=v,Ye===null&&(St=null,We=0,hc()),S}function A_(){for(;Ye!==null;)Kx(Ye)}function R_(r,i){var s=dt;dt|=2;var d=Vx(),p=Qx();St!==r||We!==i?(Zc=null,Hc=dn()+500,ns(r,i)):Wl=Ma(r,i);e:do try{if(gt!==0&&Ye!==null){i=Ye;var v=Wn;t:switch(gt){case 1:gt=0,Wn=null,rs(r,i,v,1);break;case 2:case 9:if(ab(v)){gt=0,Wn=null,Gx(i);break}i=function(){gt!==2&>!==9||St!==r||(gt=7),qr(r)},v.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:ab(v)?(gt=0,Wn=null,Gx(i)):(gt=0,Wn=null,rs(r,i,v,7));break;case 5:var S=null;switch(Ye.tag){case 26:S=Ye.memoizedState;case 5:case 27:var N=Ye;if(S?D0(S):N.stateNode.complete){gt=0,Wn=null;var $=N.sibling;if($!==null)Ye=$;else{var Y=N.return;Y!==null?(Ye=Y,Kc(Y)):Ye=null}break t}}gt=0,Wn=null,rs(r,i,v,5);break;case 6:gt=0,Wn=null,rs(r,i,v,6);break;case 8:vm(),Ut=6;break e;default:throw Error(a(462))}}z_();break}catch(ae){Hx(r,ae)}while(!0);return aa=Vi=null,Z.H=d,Z.A=p,dt=s,Ye!==null?0:(St=null,We=0,hc(),Ut)}function z_(){for(;Ye!==null&&!ro();)Kx(Ye)}function Kx(r){var i=vx(r.alternate,r,ma);r.memoizedProps=r.pendingProps,i===null?Kc(r):Ye=i}function Gx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=fx(s,i,i.pendingProps,i.type,void 0,We);break;case 11:i=fx(s,i,i.pendingProps,i.type.render,i.ref,We);break;case 5:Dh(i);default:xx(s,i),i=Ye=Qv(i,ma),i=vx(s,i,ma)}r.memoizedProps=r.pendingProps,i===null?Kc(r):Ye=i}function rs(r,i,s,d){aa=Vi=null,Dh(i),Vl=null,ko=0;var p=i.return;try{if(x_(r,p,i,s,We)){Ut=1,Mc(r,fr(s,r.current)),Ye=null;return}}catch(v){if(p!==null)throw Ye=p,v;Ut=1,Mc(r,fr(s,r.current)),Ye=null;return}i.flags&32768?(rt||d===1?r=!0:Wl||(We&536870912)!==0?r=!1:(Ka=r=!0,(d===2||d===9||d===3||d===6)&&(d=Xn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Yx(i,r)):Kc(i)}function Kc(r){var i=r;do{if((i.flags&32768)!==0){Yx(i,Ka);return}r=i.return;var s=k_(i.alternate,i,ma);if(s!==null){Ye=s;return}if(i=i.sibling,i!==null){Ye=i;return}Ye=i=r}while(i!==null);Ut===0&&(Ut=5)}function Yx(r,i){do{var s=j_(r.alternate,r);if(s!==null){s.flags&=32767,Ye=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Ye=r;return}Ye=r=s}while(r!==null);Ut=6,Ye=null}function Xx(r,i,s,d,p,v,S,N,$){r.cancelPendingCommit=null;do Gc();while(en!==0);if((dt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=sh,Jr(r,s,v,S,N,$),r===St&&(Ye=St=null,We=0),ts=i,Xa=r,pa=s,pm=v,gm=p,Bx=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,I_(Ue,function(){return n0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=re.p,re.p=2,S=dt,dt|=4;try{C_(r,i,s)}finally{dt=S,re.p=p,Z.T=d}}en=1,Jx(),Wx(),e0()}}function Jx(){if(en===1){en=0;var r=Xa,i=ts,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var d=re.p;re.p=2;var p=dt;dt|=4;try{zx(i,r);var v=Rm,S=Uv(r.containerInfo),N=v.focusedElem,$=v.selectionRange;if(S!==N&&N&&N.ownerDocument&&Lv(N.ownerDocument.documentElement,N)){if($!==null&&nh(N)){var Y=$.start,ae=$.end;if(ae===void 0&&(ae=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(ae,N.value.length);else{var de=N.ownerDocument||document,J=de&&de.defaultView||window;if(J.getSelection){var te=J.getSelection(),Ce=N.textContent.length,Me=Math.min($.start,Ce),xt=$.end===void 0?Me:Math.min($.end,Ce);!te.extend&&Me>xt&&(S=xt,xt=Me,Me=S);var Q=Iv(N,Me),H=Iv(N,xt);if(Q&&H&&(te.rangeCount!==1||te.anchorNode!==Q.node||te.anchorOffset!==Q.offset||te.focusNode!==H.node||te.focusOffset!==H.offset)){var K=de.createRange();K.setStart(Q.node,Q.offset),te.removeAllRanges(),Me>xt?(te.addRange(K),te.extend(H.node,H.offset)):(K.setEnd(H.node,H.offset),te.addRange(K))}}}}for(de=[],te=N;te=te.parentNode;)te.nodeType===1&&de.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<de.length;N++){var ce=de[N];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}sd=!!Am,Rm=Am=null}finally{dt=p,re.p=d,Z.T=s}}r.current=i,en=2}}function Wx(){if(en===2){en=0;var r=Xa,i=ts,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var d=re.p;re.p=2;var p=dt;dt|=4;try{Nx(r,i.alternate,i)}finally{dt=p,re.p=d,Z.T=s}}en=3}}function e0(){if(en===4||en===3){en=0,ao();var r=Xa,i=ts,s=pa,d=Bx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?en=5:(en=0,ts=Xa=null,t0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ya=null),Lf(s),i=i.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(Wt,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=re.p,re.p=2,Z.T=null;try{for(var v=r.onRecoverableError,S=0;S<d.length;S++){var N=d[S];v(N.value,{componentStack:N.stack})}}finally{Z.T=i,re.p=p}}(pa&3)!==0&&Gc(),qr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===ym?Bo++:(Bo=0,ym=r):Bo=0,$o(0)}}function t0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,wo(i)))}function Gc(){return Jx(),Wx(),e0(),n0()}function n0(){if(en!==5)return!1;var r=Xa,i=pm;pm=0;var s=Lf(pa),d=Z.T,p=re.p;try{re.p=32>s?32:s,Z.T=null,s=gm,gm=null;var v=Xa,S=pa;if(en=0,ts=Xa=null,pa=0,(dt&6)!==0)throw Error(a(331));var N=dt;if(dt|=4,Lx(v.current),Dx(v,v.current,S,s),dt=N,$o(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(Wt,v)}catch{}return!0}finally{re.p=p,Z.T=d,t0(r,i)}}function r0(r,i,s){i=fr(s,i),i=Gh(r.stateNode,i,2),r=Ha(r,i,2),r!==null&&(mn(r,2),qr(r))}function yt(r,i,s){if(r.tag===3)r0(r,r,s);else for(;i!==null;){if(i.tag===3){r0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ya===null||!Ya.has(d))){r=fr(s,r),s=ax(2),d=Ha(i,s,2),d!==null&&(ix(s,d,i,r),mn(d,2),qr(d));break}}i=i.return}}function xm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new __;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)||(fm=!0,p.add(s),r=O_.bind(null,r,i,s),i.then(r,r))}function O_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,St===r&&(We&s)===s&&(Ut===4||Ut===3&&(We&62914560)===We&&300>dn()-qc?(dt&2)===0&&ns(r,0):hm|=s,es===We&&(es=0)),qr(r)}function a0(r,i){i===0&&(i=we()),r=qi(r,i),r!==null&&(mn(r,i),qr(r))}function D_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),a0(r,s)}function M_(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),a0(r,s)}function I_(r,i){return Da(r,i)}var Yc=null,as=null,wm=!1,Xc=!1,Sm=!1,Wa=0;function qr(r){r!==as&&r.next===null&&(as===null?Yc=as=r:as=as.next=r),Xc=!0,wm||(wm=!0,U_())}function $o(r,i){if(!Sm&&Xc){Sm=!0;do for(var s=!1,d=Yc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var S=d.suspendedLanes,N=d.pingedLanes;v=(1<<31-ft(42|r)+1)-1,v&=p&~(S&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,o0(d,v))}else v=We,v=Ui(d,d===St?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||Ma(d,v)||(s=!0,o0(d,v));d=d.next}while(s);Sm=!1}}function L_(){i0()}function i0(){Xc=wm=!1;var r=0;Wa!==0&&K_()&&(r=Wa);for(var i=dn(),s=null,d=Yc;d!==null;){var p=d.next,v=l0(d,i);v===0?(d.next=null,s===null?Yc=p:s.next=p,p===null&&(as=s)):(s=d,(r!==0||(v&3)!==0)&&(Xc=!0)),d=p}en!==0&&en!==5||$o(r),Wa!==0&&(Wa=0)}function l0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var S=31-ft(v),N=1<<S,$=p[S];$===-1?((N&s)===0||(N&d)!==0)&&(p[S]=ec(N,i)):$<=i&&(r.expiredLanes|=N),v&=~N}if(i=St,s=We,s=Ui(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(gt===2||gt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Xr(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ma(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&Xr(d),Lf(s)){case 2:case 8:s=ye;break;case 32:s=Ue;break;case 268435456:s=nt;break;default:s=Ue}return d=s0.bind(null,r),s=Da(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&Xr(d),r.callbackPriority=2,r.callbackNode=null,2}function s0(r,i){if(en!==0&&en!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Gc()&&r.callbackNode!==s)return null;var d=We;return d=Ui(r,r===St?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Fx(r,d,i),l0(r,dn()),r.callbackNode!=null&&r.callbackNode===s?s0.bind(null,r):null)}function o0(r,i){if(Gc())return null;Fx(r,i,!0)}function U_(){Y_(function(){(dt&6)!==0?Da(le,L_):i0()})}function km(){if(Wa===0){var r=ql;r===0&&(r=Mi,Mi<<=1,(Mi&261888)===0&&(Mi=256)),Wa=r}return Wa}function u0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ic(""+r)}function c0(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function P_(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=u0((p[Dn]||null).action),S=d.submitter;S&&(i=(i=S[Dn]||null)?u0(i.formAction):S.getAttribute("formAction"),i!==null&&(v=i,S=null));var N=new uc("action","action",null,d,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Wa!==0){var $=S?c0(p,S):new FormData(p);qh(s,{pending:!0,data:$,method:p.method,action:v},null,$)}}else typeof v=="function"&&(N.preventDefault(),$=S?c0(p,S):new FormData(p),qh(s,{pending:!0,data:$,method:p.method,action:v},v,$))},currentTarget:p}]})}}for(var jm=0;jm<lh.length;jm++){var Cm=lh[jm],B_=Cm.toLowerCase(),$_=Cm[0].toUpperCase()+Cm.slice(1);_r(B_,"on"+$_)}_r($v,"onAnimationEnd"),_r(Fv,"onAnimationIteration"),_r(qv,"onAnimationStart"),_r("dblclick","onDoubleClick"),_r("focusin","onFocus"),_r("focusout","onBlur"),_r(r_,"onTransitionRun"),_r(a_,"onTransitionStart"),_r(i_,"onTransitionCancel"),_r(Hv,"onTransitionEnd"),Tl("onMouseEnter",["mouseout","mouseover"]),Tl("onMouseLeave",["mouseout","mouseover"]),Tl("onPointerEnter",["pointerout","pointerover"]),Tl("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 Fo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),F_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fo));function d0(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var S=d.length-1;0<=S;S--){var N=d[S],$=N.instance,Y=N.currentTarget;if(N=N.listener,$!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=Y;try{v(p)}catch(ae){fc(ae)}p.currentTarget=null,v=$}else for(S=0;S<d.length;S++){if(N=d[S],$=N.instance,Y=N.currentTarget,N=N.listener,$!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=Y;try{v(p)}catch(ae){fc(ae)}p.currentTarget=null,v=$}}}}function Xe(r,i){var s=i[Uf];s===void 0&&(s=i[Uf]=new Set);var d=r+"__bubble";s.has(d)||(f0(i,r,2,!1),s.add(d))}function Em(r,i,s){var d=0;i&&(d|=4),f0(s,r,d,i)}var Jc="_reactListening"+Math.random().toString(36).slice(2);function Nm(r){if(!r[Jc]){r[Jc]=!0,iv.forEach(function(s){s!=="selectionchange"&&(F_.has(s)||Em(s,!1,r),Em(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Jc]||(i[Jc]=!0,Em("selectionchange",!1,i))}}function f0(r,i,s,d){switch($0(i)){case 2:var p=g2;break;case 8:p=y2;break;default:p=Fm}s=p.bind(null,i,s,r),p=void 0,!Qf||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 _m(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var N=d.stateNode.containerInfo;if(N===p)break;if(S===4)for(S=d.return;S!==null;){var $=S.tag;if(($===3||$===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;N!==null;){if(S=El(N),S===null)return;if($=S.tag,$===5||$===6||$===26||$===27){d=v=S;continue e}N=N.parentNode}}d=d.return}yv(function(){var Y=v,ae=Zf(s),de=[];e:{var J=Zv.get(r);if(J!==void 0){var te=uc,Ce=r;switch(r){case"keypress":if(sc(s)===0)break e;case"keydown":case"keyup":te=MN;break;case"focusin":Ce="focus",te=Xf;break;case"focusout":Ce="blur",te=Xf;break;case"beforeblur":case"afterblur":te=Xf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=xv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=kN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=UN;break;case $v:case Fv:case qv:te=EN;break;case Hv:te=BN;break;case"scroll":case"scrollend":te=wN;break;case"wheel":te=FN;break;case"copy":case"cut":case"paste":te=_N;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Sv;break;case"toggle":case"beforetoggle":te=HN}var Me=(i&4)!==0,xt=!Me&&(r==="scroll"||r==="scrollend"),Q=Me?J!==null?J+"Capture":null:J;Me=[];for(var H=Y,K;H!==null;){var ce=H;if(K=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||K===null||Q===null||(ce=uo(H,Q),ce!=null&&Me.push(qo(H,ce,K))),xt)break;H=H.return}0<Me.length&&(J=new te(J,Ce,null,s,ae),de.push({event:J,listeners:Me}))}}if((i&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",te=r==="mouseout"||r==="pointerout",J&&s!==Hf&&(Ce=s.relatedTarget||s.fromElement)&&(El(Ce)||Ce[Cl]))break e;if((te||J)&&(J=ae.window===ae?ae:(J=ae.ownerDocument)?J.defaultView||J.parentWindow:window,te?(Ce=s.relatedTarget||s.toElement,te=Y,Ce=Ce?El(Ce):null,Ce!==null&&(xt=o(Ce),Me=Ce.tag,Ce!==xt||Me!==5&&Me!==27&&Me!==6)&&(Ce=null)):(te=null,Ce=Y),te!==Ce)){if(Me=xv,ce="onMouseLeave",Q="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(Me=Sv,ce="onPointerLeave",Q="onPointerEnter",H="pointer"),xt=te==null?J:oo(te),K=Ce==null?J:oo(Ce),J=new Me(ce,H+"leave",te,s,ae),J.target=xt,J.relatedTarget=K,ce=null,El(ae)===Y&&(Me=new Me(Q,H+"enter",Ce,s,ae),Me.target=K,Me.relatedTarget=xt,ce=Me),xt=ce,te&&Ce)t:{for(Me=q_,Q=te,H=Ce,K=0,ce=Q;ce;ce=Me(ce))K++;ce=0;for(var Oe=H;Oe;Oe=Me(Oe))ce++;for(;0<K-ce;)Q=Me(Q),K--;for(;0<ce-K;)H=Me(H),ce--;for(;K--;){if(Q===H||H!==null&&Q===H.alternate){Me=Q;break t}Q=Me(Q),H=Me(H)}Me=null}else Me=null;te!==null&&h0(de,J,te,Me,!1),Ce!==null&&xt!==null&&h0(de,xt,Ce,Me,!0)}}e:{if(J=Y?oo(Y):window,te=J.nodeName&&J.nodeName.toLowerCase(),te==="select"||te==="input"&&J.type==="file")var ot=Av;else if(_v(J))if(Rv)ot=e_;else{ot=JN;var Te=XN}else te=J.nodeName,!te||te.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Y&&qf(Y.elementType)&&(ot=Av):ot=WN;if(ot&&(ot=ot(r,Y))){Tv(de,ot,s,ae);break e}Te&&Te(r,J,Y),r==="focusout"&&Y&&J.type==="number"&&Y.memoizedProps.value!=null&&Ff(J,"number",J.value)}switch(Te=Y?oo(Y):window,r){case"focusin":(_v(Te)||Te.contentEditable==="true")&&(Ml=Te,rh=Y,vo=null);break;case"focusout":vo=rh=Ml=null;break;case"mousedown":ah=!0;break;case"contextmenu":case"mouseup":case"dragend":ah=!1,Pv(de,s,ae);break;case"selectionchange":if(n_)break;case"keydown":case"keyup":Pv(de,s,ae)}var He;if(Wf)e:{switch(r){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else Dl?Ev(r,s)&&(et="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(et="onCompositionStart");et&&(kv&&s.locale!=="ko"&&(Dl||et!=="onCompositionStart"?et==="onCompositionEnd"&&Dl&&(He=vv()):(La=ae,Kf="value"in La?La.value:La.textContent,Dl=!0)),Te=Wc(Y,et),0<Te.length&&(et=new wv(et,r,null,s,ae),de.push({event:et,listeners:Te}),He?et.data=He:(He=Nv(s),He!==null&&(et.data=He)))),(He=VN?QN(r,s):KN(r,s))&&(et=Wc(Y,"onBeforeInput"),0<et.length&&(Te=new wv("onBeforeInput","beforeinput",null,s,ae),de.push({event:Te,listeners:et}),Te.data=He)),P_(de,r,Y,s,ae)}d0(de,i)})}function qo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function Wc(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=uo(r,s),p!=null&&d.unshift(qo(r,p,v)),p=uo(r,i),p!=null&&d.push(qo(r,p,v))),r.tag===3)return d;r=r.return}return[]}function q_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function h0(r,i,s,d,p){for(var v=i._reactName,S=[];s!==null&&s!==d;){var N=s,$=N.alternate,Y=N.stateNode;if(N=N.tag,$!==null&&$===d)break;N!==5&&N!==26&&N!==27||Y===null||($=Y,p?(Y=uo(s,v),Y!=null&&S.unshift(qo(s,Y,$))):p||(Y=uo(s,v),Y!=null&&S.push(qo(s,Y,$)))),s=s.return}S.length!==0&&r.push({event:i,listeners:S})}var H_=/\r\n?/g,Z_=/\u0000|\uFFFD/g;function m0(r){return(typeof r=="string"?r:""+r).replace(H_,`
|
|
49
|
+
`).replace(Z_,"")}function p0(r,i){return i=m0(i),m0(r)===i}function bt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Rl(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Rl(r,""+d);break;case"className":rc(r,"class",d);break;case"tabIndex":rc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":rc(r,s,d);break;case"style":pv(r,d,v);break;case"data":if(i!=="object"){rc(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=ic(""+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"&&bt(r,i,"name",p.name,p,null),bt(r,i,"formEncType",p.formEncType,p,null),bt(r,i,"formMethod",p.formMethod,p,null),bt(r,i,"formTarget",p.formTarget,p,null)):(bt(r,i,"encType",p.encType,p,null),bt(r,i,"method",p.method,p,null),bt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=ic(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=ea);break;case"onScroll":d!=null&&Xe("scroll",r);break;case"onScrollEnd":d!=null&&Xe("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=ic(""+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":Xe("beforetoggle",r),Xe("toggle",r),nc(r,"popover",d);break;case"xlinkActuate":Wr(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Wr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Wr(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Wr(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Wr(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Wr(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":nc(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=bN.get(s)||s,nc(r,s,d))}}function Tm(r,i,s,d,p,v){switch(s){case"style":pv(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?Rl(r,d):(typeof d=="number"||typeof d=="bigint")&&Rl(r,""+d);break;case"onScroll":d!=null&&Xe("scroll",r);break;case"onScrollEnd":d!=null&&Xe("scrollend",r);break;case"onClick":d!=null&&(r.onclick=ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lv.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[Dn]||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,""):nc(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":Xe("error",r),Xe("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var S=s[v];if(S!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,v,S,s,null)}}p&&bt(r,i,"srcSet",s.srcSet,s,null),d&&bt(r,i,"src",s.src,s,null);return;case"input":Xe("invalid",r);var N=v=S=p=null,$=null,Y=null;for(d in s)if(s.hasOwnProperty(d)){var ae=s[d];if(ae!=null)switch(d){case"name":p=ae;break;case"type":S=ae;break;case"checked":$=ae;break;case"defaultChecked":Y=ae;break;case"value":v=ae;break;case"defaultValue":N=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:bt(r,i,d,ae,s,null)}}dv(r,v,N,$,Y,S,p,!1);return;case"select":Xe("invalid",r),d=S=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":S=N;break;case"multiple":d=N;default:bt(r,i,p,N,s,null)}i=v,s=S,r.multiple=!!d,i!=null?Al(r,!!d,i,!1):s!=null&&Al(r,!!d,s,!0);return;case"textarea":Xe("invalid",r),v=p=d=null;for(S in s)if(s.hasOwnProperty(S)&&(N=s[S],N!=null))switch(S){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:bt(r,i,S,N,s,null)}hv(r,d,p,v);return;case"option":for($ in s)if(s.hasOwnProperty($)&&(d=s[$],d!=null))switch($){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:bt(r,i,$,d,s,null)}return;case"dialog":Xe("beforetoggle",r),Xe("toggle",r),Xe("cancel",r),Xe("close",r);break;case"iframe":case"object":Xe("load",r);break;case"video":case"audio":for(d=0;d<Fo.length;d++)Xe(Fo[d],r);break;case"image":Xe("error",r),Xe("load",r);break;case"details":Xe("toggle",r);break;case"embed":case"source":case"link":Xe("error",r),Xe("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(Y in s)if(s.hasOwnProperty(Y)&&(d=s[Y],d!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,Y,d,s,null)}return;default:if(qf(i)){for(ae in s)s.hasOwnProperty(ae)&&(d=s[ae],d!==void 0&&Tm(r,i,ae,d,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(d=s[N],d!=null&&bt(r,i,N,d,s,null))}function V_(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,S=null,N=null,$=null,Y=null,ae=null;for(te in s){var de=s[te];if(s.hasOwnProperty(te)&&de!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":$=de;default:d.hasOwnProperty(te)||bt(r,i,te,null,d,de)}}for(var J in d){var te=d[J];if(de=s[J],d.hasOwnProperty(J)&&(te!=null||de!=null))switch(J){case"type":v=te;break;case"name":p=te;break;case"checked":Y=te;break;case"defaultChecked":ae=te;break;case"value":S=te;break;case"defaultValue":N=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,i));break;default:te!==de&&bt(r,i,J,te,d,de)}}$f(r,S,N,$,Y,ae,v,p);return;case"select":te=S=N=J=null;for(v in s)if($=s[v],s.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":te=$;default:d.hasOwnProperty(v)||bt(r,i,v,null,d,$)}for(p in d)if(v=d[p],$=s[p],d.hasOwnProperty(p)&&(v!=null||$!=null))switch(p){case"value":J=v;break;case"defaultValue":N=v;break;case"multiple":S=v;default:v!==$&&bt(r,i,p,v,d,$)}i=N,s=S,d=te,J!=null?Al(r,!!s,J,!1):!!d!=!!s&&(i!=null?Al(r,!!s,i,!0):Al(r,!!s,s?[]:"",!1));return;case"textarea":te=J=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:bt(r,i,N,null,d,p)}for(S in d)if(p=d[S],v=s[S],d.hasOwnProperty(S)&&(p!=null||v!=null))switch(S){case"value":J=p;break;case"defaultValue":te=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&bt(r,i,S,p,d,v)}fv(r,J,te);return;case"option":for(var Ce in s)if(J=s[Ce],s.hasOwnProperty(Ce)&&J!=null&&!d.hasOwnProperty(Ce))switch(Ce){case"selected":r.selected=!1;break;default:bt(r,i,Ce,null,d,J)}for($ in d)if(J=d[$],te=s[$],d.hasOwnProperty($)&&J!==te&&(J!=null||te!=null))switch($){case"selected":r.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:bt(r,i,$,J,d,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in s)J=s[Me],s.hasOwnProperty(Me)&&J!=null&&!d.hasOwnProperty(Me)&&bt(r,i,Me,null,d,J);for(Y in d)if(J=d[Y],te=s[Y],d.hasOwnProperty(Y)&&J!==te&&(J!=null||te!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:bt(r,i,Y,J,d,te)}return;default:if(qf(i)){for(var xt in s)J=s[xt],s.hasOwnProperty(xt)&&J!==void 0&&!d.hasOwnProperty(xt)&&Tm(r,i,xt,void 0,d,J);for(ae in d)J=d[ae],te=s[ae],!d.hasOwnProperty(ae)||J===te||J===void 0&&te===void 0||Tm(r,i,ae,J,d,te);return}}for(var Q in s)J=s[Q],s.hasOwnProperty(Q)&&J!=null&&!d.hasOwnProperty(Q)&&bt(r,i,Q,null,d,J);for(de in d)J=d[de],te=s[de],!d.hasOwnProperty(de)||J===te||J==null&&te==null||bt(r,i,de,J,d,te)}function g0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q_(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],v=p.transferSize,S=p.initiatorType,N=p.duration;if(v&&N&&g0(S)){for(S=0,N=p.responseEnd,d+=1;d<s.length;d++){var $=s[d],Y=$.startTime;if(Y>N)break;var ae=$.transferSize,de=$.initiatorType;ae&&g0(de)&&($=$.responseEnd,S+=ae*($<N?1:(N-Y)/($-Y)))}if(--d,i+=8*(v+S)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Am=null,Rm=null;function ed(r){return r.nodeType===9?r:r.ownerDocument}function y0(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 v0(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 zm(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 Om=null;function K_(){var r=window.event;return r&&r.type==="popstate"?r===Om?!1:(Om=r,!0):(Om=null,!1)}var b0=typeof setTimeout=="function"?setTimeout:void 0,G_=typeof clearTimeout=="function"?clearTimeout:void 0,x0=typeof Promise=="function"?Promise:void 0,Y_=typeof queueMicrotask=="function"?queueMicrotask:typeof x0<"u"?function(r){return x0.resolve(null).then(r).catch(X_)}:b0;function X_(r){setTimeout(function(){throw r})}function ei(r){return r==="head"}function w0(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),os(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Ho(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Ho(s);for(var v=s.firstChild;v;){var S=v.nextSibling,N=v.nodeName;v[so]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=S}}else s==="body"&&Ho(r.ownerDocument.body);s=p}while(s);os(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 Dm(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":Dm(s),Pf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function J_(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[so])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=yr(r.nextSibling),r===null)break}return null}function W_(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=yr(r.nextSibling),r===null))return null;return r}function k0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=yr(r.nextSibling),r===null))return null;return r}function Mm(r){return r.data==="$?"||r.data==="$~"}function Im(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function e2(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 yr(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 Lm=null;function j0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return yr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function C0(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 E0(r,i,s){switch(i=ed(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Ho(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Pf(r)}var vr=new Map,N0=new Set;function td(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ga=re.d;re.d={f:t2,r:n2,D:r2,C:a2,L:i2,m:l2,X:o2,S:s2,M:u2};function t2(){var r=ga.f(),i=Vc();return r||i}function n2(r){var i=Nl(r);i!==null&&i.tag===5&&i.type==="form"?Hb(i):ga.r(r)}var is=typeof document>"u"?null:document;function _0(r,i,s){var d=is;if(d&&typeof i=="string"&&i){var p=cr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),N0.has(p)||(N0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),bn(i,"link",r),ln(i),d.head.appendChild(i)))}}function r2(r){ga.D(r),_0("dns-prefetch",r,null)}function a2(r,i){ga.C(r,i),_0("preconnect",r,i)}function i2(r,i,s){ga.L(r,i,s);var d=is;if(d&&r&&i){var p='link[rel="preload"][as="'+cr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+cr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+cr(s.imageSizes)+'"]')):p+='[href="'+cr(r)+'"]';var v=p;switch(i){case"style":v=ls(r);break;case"script":v=ss(r)}vr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),vr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Zo(v))||i==="script"&&d.querySelector(Vo(v))||(i=d.createElement("link"),bn(i,"link",r),ln(i),d.head.appendChild(i)))}}function l2(r,i){ga.m(r,i);var s=is;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+cr(d)+'"][href="'+cr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ss(r)}if(!vr.has(v)&&(r=g({rel:"modulepreload",href:r},i),vr.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Vo(v)))return}d=s.createElement("link"),bn(d,"link",r),ln(d),s.head.appendChild(d)}}}function s2(r,i,s){ga.S(r,i,s);var d=is;if(d&&r){var p=_l(d).hoistableStyles,v=ls(r);i=i||"default";var S=p.get(v);if(!S){var N={loading:0,preload:null};if(S=d.querySelector(Zo(v)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=vr.get(v))&&Um(r,s);var $=S=d.createElement("link");ln($),bn($,"link",r),$._p=new Promise(function(Y,ae){$.onload=Y,$.onerror=ae}),$.addEventListener("load",function(){N.loading|=1}),$.addEventListener("error",function(){N.loading|=2}),N.loading|=4,nd(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:N},p.set(v,S)}}}function o2(r,i){ga.X(r,i);var s=is;if(s&&r){var d=_l(s).hoistableScripts,p=ss(r),v=d.get(p);v||(v=s.querySelector(Vo(p)),v||(r=g({src:r,async:!0},i),(i=vr.get(p))&&Pm(r,i),v=s.createElement("script"),ln(v),bn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function u2(r,i){ga.M(r,i);var s=is;if(s&&r){var d=_l(s).hoistableScripts,p=ss(r),v=d.get(p);v||(v=s.querySelector(Vo(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=vr.get(p))&&Pm(r,i),v=s.createElement("script"),ln(v),bn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function T0(r,i,s,d){var p=(p=ue.current)?td(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=ls(s.href),s=_l(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=ls(s.href);var v=_l(p).hoistableStyles,S=v.get(r);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,S),(v=p.querySelector(Zo(r)))&&!v._p&&(S.instance=v,S.state.loading=5),vr.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},vr.set(r,s),v||c2(p,r,s,S.state))),i&&d===null)throw Error(a(528,""));return S}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ss(s),s=_l(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function ls(r){return'href="'+cr(r)+'"'}function Zo(r){return'link[rel="stylesheet"]['+r+"]"}function A0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function c2(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),ln(i),r.head.appendChild(i))}function ss(r){return'[src="'+cr(r)+'"]'}function Vo(r){return"script[async]"+r}function R0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+cr(s.href)+'"]');if(d)return i.instance=d,ln(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"),ln(d),bn(d,"style",p),nd(d,s.precedence,r),i.instance=d;case"stylesheet":p=ls(s.href);var v=r.querySelector(Zo(p));if(v)return i.state.loading|=4,i.instance=v,ln(v),v;d=A0(s),(p=vr.get(p))&&Um(d,p),v=(r.ownerDocument||r).createElement("link"),ln(v);var S=v;return S._p=new Promise(function(N,$){S.onload=N,S.onerror=$}),bn(v,"link",d),i.state.loading|=4,nd(v,s.precedence,r),i.instance=v;case"script":return v=ss(s.src),(p=r.querySelector(Vo(v)))?(i.instance=p,ln(p),p):(d=s,(p=vr.get(v))&&(d=g({},s),Pm(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),ln(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,nd(d,s.precedence,r));return i.instance}function nd(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,S=0;S<d.length;S++){var N=d[S];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 Um(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Pm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var rd=null;function z0(r,i,s){if(rd===null){var d=new Map,p=rd=new Map;p.set(s,d)}else p=rd,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[so]||v[pn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var S=v.getAttribute(i)||"";S=r+S;var N=d.get(S);N?N.push(v):d.set(S,[v])}}return d}function O0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function d2(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 D0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function f2(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=ls(d.href),v=i.querySelector(Zo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ad.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,ln(v);return}v=i.ownerDocument||i,d=A0(d),(p=vr.get(p))&&Um(d,p),v=v.createElement("link"),ln(v);var S=v;S._p=new Promise(function(N,$){S.onload=N,S.onerror=$}),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=ad.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Bm=0;function h2(r,i){return r.stylesheets&&r.count===0&&ld(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&ld(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Bm===0&&(Bm=62500*Q_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&ld(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Bm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function ad(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ld(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var id=null;function ld(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,id=new Map,i.forEach(m2,r),id=null,ad.call(r))}function m2(r,i){if(!(i.state.loading&4)){var s=id.get(r);if(s)var d=s.get(null);else{s=new Map,id.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var S=p[v];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(s.set(S.dataset.precedence,S),d=S)}d&&s.set(null,d)}p=i.instance,S=p.getAttribute("data-precedence"),v=s.get(S)||d,v===d&&s.set(null,p),s.set(S,p),this.count++,d=ad.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Qo={$$typeof:z,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function p2(r,i,s,d,p,v,S,N,$){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=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function M0(r,i,s,d,p,v,S,N,$,Y,ae,de){return r=new p2(r,i,s,S,$,Y,ae,de,N),i=1,v===!0&&(i|=24),v=Yn(3,null,null,i),r.current=v,v.stateNode=r,i=bh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},kh(v),r}function I0(r){return r?(r=Ul,r):Ul}function L0(r,i,s,d,p,v){p=I0(p),d.context===null?d.context=p:d.pendingContext=p,d=qa(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Ha(r,d,i),s!==null&&(Bn(s,r,i),Co(s,r,i))}function U0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function $m(r,i){U0(r,i),(r=r.alternate)&&U0(r,i)}function P0(r){if(r.tag===13||r.tag===31){var i=qi(r,67108864);i!==null&&Bn(i,r,67108864),$m(r,67108864)}}function B0(r){if(r.tag===13||r.tag===31){var i=tr();i=If(i);var s=qi(r,i);s!==null&&Bn(s,r,i),$m(r,i)}}var sd=!0;function g2(r,i,s,d){var p=Z.T;Z.T=null;var v=re.p;try{re.p=2,Fm(r,i,s,d)}finally{re.p=v,Z.T=p}}function y2(r,i,s,d){var p=Z.T;Z.T=null;var v=re.p;try{re.p=8,Fm(r,i,s,d)}finally{re.p=v,Z.T=p}}function Fm(r,i,s,d){if(sd){var p=qm(d);if(p===null)_m(r,i,d,od,s),F0(r,d);else if(b2(p,r,i,s,d))d.stopPropagation();else if(F0(r,d),i&4&&-1<v2.indexOf(r)){for(;p!==null;){var v=Nl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var S=Pr(v.pendingLanes);if(S!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;S;){var $=1<<31-ft(S);N.entanglements[1]|=$,S&=~$}qr(v),(dt&6)===0&&(Hc=dn()+500,$o(0))}}break;case 31:case 13:N=qi(v,2),N!==null&&Bn(N,v,2),Vc(),$m(v,2)}if(v=qm(d),v===null&&_m(r,i,d,od,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else _m(r,i,d,null,s)}}function qm(r){return r=Zf(r),Hm(r)}var od=null;function Hm(r){if(od=null,r=El(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=u(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 od=r,null}function $0(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(io()){case le:return 2;case ye:return 8;case Ue:case Be:return 32;case nt:return 268435456;default:return 32}default:return 32}}var Zm=!1,ti=null,ni=null,ri=null,Ko=new Map,Go=new Map,ai=[],v2="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 F0(r,i){switch(r){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":Ko.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(i.pointerId)}}function Yo(r,i,s,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Nl(i),i!==null&&P0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function b2(r,i,s,d,p){switch(i){case"focusin":return ti=Yo(ti,r,i,s,d,p),!0;case"dragenter":return ni=Yo(ni,r,i,s,d,p),!0;case"mouseover":return ri=Yo(ri,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Ko.set(v,Yo(Ko.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,Go.set(v,Yo(Go.get(v)||null,r,i,s,d,p)),!0}return!1}function q0(r){var i=El(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){r.blockedOn=i,rv(r.priority,function(){B0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,rv(r.priority,function(){B0(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 ud(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=qm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);Hf=d,s.target.dispatchEvent(d),Hf=null}else return i=Nl(s),i!==null&&P0(i),r.blockedOn=s,!1;i.shift()}return!0}function H0(r,i,s){ud(r)&&s.delete(i)}function x2(){Zm=!1,ti!==null&&ud(ti)&&(ti=null),ni!==null&&ud(ni)&&(ni=null),ri!==null&&ud(ri)&&(ri=null),Ko.forEach(H0),Go.forEach(H0)}function cd(r,i){r.blockedOn===i&&(r.blockedOn=null,Zm||(Zm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,x2)))}var dd=null;function Z0(r){dd!==r&&(dd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){dd===r&&(dd=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(Hm(d||s)===null)continue;break}var v=Nl(s);v!==null&&(r.splice(i,3),i-=3,qh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function os(r){function i($){return cd($,r)}ti!==null&&cd(ti,r),ni!==null&&cd(ni,r),ri!==null&&cd(ri,r),Ko.forEach(i),Go.forEach(i);for(var s=0;s<ai.length;s++){var d=ai[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<ai.length&&(s=ai[0],s.blockedOn===null);)q0(s),s.blockedOn===null&&ai.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],v=s[d+1],S=p[Dn]||null;if(typeof v=="function")S||Z0(s);else if(S){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,S=v[Dn]||null)N=S.formAction;else if(Hm(p)!==null)continue}else N=S.action;typeof N=="function"?s[d+1]=N:(s.splice(d,3),d-=3),Z0(s)}}}function V0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Vm(r){this._internalRoot=r}fd.prototype.render=Vm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=tr();L0(s,d,r,i,null,null)},fd.prototype.unmount=Vm.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),Vc(),i[Cl]=null}};function fd(r){this._internalRoot=r}fd.prototype.unstable_scheduleHydration=function(r){if(r){var i=nv();r={blockedOn:null,target:r,priority:i};for(var s=0;s<ai.length&&i!==0&&i<ai[s].priority;s++);ai.splice(s,0,r),s===0&&q0(r)}};var Q0=t.version;if(Q0!=="19.2.4")throw Error(a(527,Q0,"19.2.4"));re.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 w2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hd.isDisabled&&hd.supportsFiber)try{Wt=hd.inject(w2),Ft=hd}catch{}}return Jo.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=ex,v=tx,S=nx;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=M0(r,1,!1,null,null,s,d,null,p,v,S,V0),r[Cl]=i.current,Nm(r),new Vm(i)},Jo.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=ex,S=tx,N=nx,$=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&($=s.formState)),i=M0(r,1,!0,i,s??null,d,p,$,v,S,N,V0),i.context=I0(null),s=i.current,d=tr(),d=If(d),p=qa(d),p.callback=null,Ha(s,p,d),s=d,i.current.lanes=s,mn(i,s),qr(i),r[Cl]=i.current,Nm(r),new fd(i)},Jo.version="19.2.4",Jo}var a1;function z2(){if(a1)return Ym.exports;a1=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(),Ym.exports=R2(),Ym.exports}var O2=z2(),bl=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,js,NS,D2=(NS=class extends bl{constructor(){super();ke(this,il);ke(this,hi);ke(this,js);pe(this,js,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){I(this,hi)||this.setEventListener(I(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,hi))==null||t.call(this),pe(this,hi,void 0))}setEventListener(t){var n;pe(this,js,t),(n=I(this,hi))==null||n.call(this),pe(this,hi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){I(this,il)!==t&&(pe(this,il,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof I(this,il)=="boolean"?I(this,il):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},il=new WeakMap,hi=new WeakMap,js=new WeakMap,NS),Zg=new D2,M2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},mi,Fg,_S,I2=(_S=class{constructor(){ke(this,mi,M2);ke(this,Fg,!1)}setTimeoutProvider(e){pe(this,mi,e)}setTimeout(e,t){return I(this,mi).setTimeout(e,t)}clearTimeout(e){I(this,mi).clearTimeout(e)}setInterval(e,t){return I(this,mi).setInterval(e,t)}clearInterval(e){I(this,mi).clearInterval(e)}},mi=new WeakMap,Fg=new WeakMap,_S),al=new I2;function L2(e){setTimeout(e,0)}var U2=typeof window>"u"||"Deno"in globalThis;function jn(){}function P2(e,t){return typeof e=="function"?e(t):e}function $p(e){return typeof e=="number"&&e>=0&&e!==1/0}function BS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ji(e,t){return typeof e=="function"?e(t):e}function wr(e,t){return typeof e=="function"?e(t):e}function i1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==Vg(u,t.options))return!1}else if(!yu(t.queryKey,u))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function l1(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(!yu(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)=>Fp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function yu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>yu(e[n],t[n])):!1}var B2=Object.prototype.hasOwnProperty;function Qg(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=s1(e)&&s1(t);if(!a&&!(Fp(e)&&Fp(t)))return t;const o=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:u[y],x=e[g],w=t[g];if(x===w){m[g]=x,(a?y<o:B2.call(e,g))&&h++;continue}if(x===null||w===null||typeof x!="object"||typeof w!="object"){m[g]=w;continue}const k=Qg(x,w,n+1);m[g]=k,k===x&&h++}return o===f&&h===o?e:m}function vu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function s1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fp(e){if(!o1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!o1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function o1(e){return Object.prototype.toString.call(e)==="[object Object]"}function $2(e){return new Promise(t=>{al.setTimeout(t,e)})}function qp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Qg(e,t):t}function F2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function q2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Kg=Symbol();function $S(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Kg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gg(e,t){return typeof e=="function"?e(...t):!!e}function H2(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 bu=(()=>{let e=()=>U2;return{isServer(){return e()},setIsServer(t){e=t}}})();function Hp(){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 Z2=L2;function V2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=Z2;const o=f=>{t?e.push(f):l(()=>{n(f)})},u=()=>{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||u()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Bt=V2(),Cs,pi,Es,TS,Q2=(TS=class extends bl{constructor(){super();ke(this,Cs,!0);ke(this,pi);ke(this,Es);pe(this,Es,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(){I(this,pi)||this.setEventListener(I(this,Es))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,pi))==null||t.call(this),pe(this,pi,void 0))}setEventListener(t){var n;pe(this,Es,t),(n=I(this,pi))==null||n.call(this),pe(this,pi,t(this.setOnline.bind(this)))}setOnline(t){I(this,Cs)!==t&&(pe(this,Cs,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return I(this,Cs)}},Cs=new WeakMap,pi=new WeakMap,Es=new WeakMap,TS),Hd=new Q2;function K2(e){return Math.min(1e3*2**e,3e4)}function FS(e){return(e??"online")==="online"?Hd.isOnline():!0}var Zp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function qS(e){let t=!1,n=0,a;const l=Hp(),o=()=>l.status!=="pending",u=j=>{var C;if(!o()){const E=new Zp(j);x(E),(C=e.onCancel)==null||C.call(e,E)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Zg.isFocused()&&(e.networkMode==="always"||Hd.isOnline())&&e.canRun(),y=()=>FS(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},x=j=>{o()||(a==null||a(),l.reject(j))},w=()=>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 O;if(o())return;const R=e.retry??(bu.isServer()?0:3),z=e.retryDelay??K2,M=typeof z=="function"?z(n,E):z,B=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,E);if(t||!B){x(E);return}n++,(O=e.onFail)==null||O.call(e,n,E),$2(M).then(()=>h()?void 0:w()).then(()=>{t?x(E):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():w().then(k),l)}}var ll,AS,HS=(AS=class{constructor(){ke(this,ll)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$p(this.gcTime)&&pe(this,ll,al.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(bu.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,ll)&&(al.clearTimeout(I(this,ll)),pe(this,ll,void 0))}},ll=new WeakMap,AS),sl,Ns,br,ol,on,Au,ul,ir,ZS,va,RS,G2=(RS=class extends HS{constructor(t){super();ke(this,ir);ke(this,sl);ke(this,Ns);ke(this,br);ke(this,ol);ke(this,on);ke(this,Au);ke(this,ul);pe(this,ul,!1),pe(this,Au,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,ol,t.client),pe(this,br,I(this,ol).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,sl,c1(this.options)),this.state=t.state??I(this,sl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=I(this,on))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,Au),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=c1(this.options);n.data!==void 0&&(this.setState(u1(n.data,n.dataUpdatedAt)),pe(this,sl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,br).remove(this)}setData(t,n){const a=qp(this.state.data,t,this.options);return Ie(this,ir,va).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Ie(this,ir,va).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=I(this,on))==null?void 0:a.promise;return(l=I(this,on))==null||l.cancel(t),n?n.then(jn).catch(jn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,sl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>wr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kg||!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:!BS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=I(this,on))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=I(this,on))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(I(this,on)&&(I(this,ul)||Ie(this,ir,ZS).call(this)?I(this,on).cancel({revert:!0}):I(this,on).cancelRetry()),this.scheduleGc()),I(this,br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ie(this,ir,va).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,x,w,k,j,C,E,R,z;if(this.state.fetchStatus!=="idle"&&((m=I(this,on))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(I(this,on))return I(this,on).continueRetry(),I(this,on).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(B=>B.options.queryFn);M&&this.setOptions(M.options)}const a=new AbortController,l=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(pe(this,ul,!0),a.signal)})},o=()=>{const M=$S(this.options,n),O=(()=>{const D={client:I(this,ol),queryKey:this.queryKey,meta:this.meta};return l(D),D})();return pe(this,ul,!1),this.options.persister?this.options.persister(M,O,this):M(O)},f=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:I(this,ol),state:this.state,fetchFn:o};return l(M),M})();(h=this.options.behavior)==null||h.onFetch(f,this),pe(this,Ns,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Ie(this,ir,va).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),pe(this,on,qS({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:M=>{M instanceof Zp&&M.revert&&this.setState({...I(this,Ns),fetchStatus:"idle"}),a.abort()},onFail:(M,B)=>{Ie(this,ir,va).call(this,{type:"failed",failureCount:M,error:B})},onPause:()=>{Ie(this,ir,va).call(this,{type:"pause"})},onContinue:()=>{Ie(this,ir,va).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const M=await I(this,on).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(w=(x=I(this,br).config).onSuccess)==null||w.call(x,M,this),(j=(k=I(this,br).config).onSettled)==null||j.call(k,M,this.state.error,this),M}catch(M){if(M instanceof Zp){if(M.silent)return I(this,on).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Ie(this,ir,va).call(this,{type:"error",error:M}),(E=(C=I(this,br).config).onError)==null||E.call(C,M,this),(z=(R=I(this,br).config).onSettled)==null||z.call(R,this.state.data,M,this),M}finally{this.scheduleGc()}}},sl=new WeakMap,Ns=new WeakMap,br=new WeakMap,ol=new WeakMap,on=new WeakMap,Au=new WeakMap,ul=new WeakMap,ir=new WeakSet,ZS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},va=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,...VS(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...u1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return pe(this,Ns,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),Bt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),I(this,br).notify({query:this,type:"updated",action:t})})},RS);function VS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:FS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function u1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Fn,at,Ru,Tn,cl,_s,ba,gi,zu,Ts,As,dl,fl,yi,Rs,mt,uu,Vp,Qp,Kp,Gp,Yp,Xp,Jp,QS,zS,Yg=(zS=class extends bl{constructor(t,n){super();ke(this,mt);ke(this,Fn);ke(this,at);ke(this,Ru);ke(this,Tn);ke(this,cl);ke(this,_s);ke(this,ba);ke(this,gi);ke(this,zu);ke(this,Ts);ke(this,As);ke(this,dl);ke(this,fl);ke(this,yi);ke(this,Rs,new Set);this.options=n,pe(this,Fn,t),pe(this,gi,null),pe(this,ba,Hp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,at).addObserver(this),d1(I(this,at),this.options)?Ie(this,mt,uu).call(this):this.updateResult(),Ie(this,mt,Gp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Wp(I(this,at),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Wp(I(this,at),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ie(this,mt,Yp).call(this),Ie(this,mt,Xp).call(this),I(this,at).removeObserver(this)}setOptions(t){const n=this.options,a=I(this,at);if(this.options=I(this,Fn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wr(this.options.enabled,I(this,at))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ie(this,mt,Jp).call(this),I(this,at).setOptions(this.options),n._defaulted&&!vu(this.options,n)&&I(this,Fn).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,at),observer:this});const l=this.hasListeners();l&&f1(I(this,at),a,this.options,n)&&Ie(this,mt,uu).call(this),this.updateResult(),l&&(I(this,at)!==a||wr(this.options.enabled,I(this,at))!==wr(n.enabled,I(this,at))||ji(this.options.staleTime,I(this,at))!==ji(n.staleTime,I(this,at)))&&Ie(this,mt,Vp).call(this);const o=Ie(this,mt,Qp).call(this);l&&(I(this,at)!==a||wr(this.options.enabled,I(this,at))!==wr(n.enabled,I(this,at))||o!==I(this,yi))&&Ie(this,mt,Kp).call(this,o)}getOptimisticResult(t){const n=I(this,Fn).getQueryCache().build(I(this,Fn),t),a=this.createResult(n,t);return X2(this,a)&&(pe(this,Tn,a),pe(this,_s,this.options),pe(this,cl,I(this,at).state)),a}getCurrentResult(){return I(this,Tn)}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&&I(this,ba).status==="pending"&&I(this,ba).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){I(this,Rs).add(t)}getCurrentQuery(){return I(this,at)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=I(this,Fn).defaultQueryOptions(t),a=I(this,Fn).getQueryCache().build(I(this,Fn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Ie(this,mt,uu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,Tn)))}createResult(t,n){var V;const a=I(this,at),l=this.options,o=I(this,Tn),u=I(this,cl),f=I(this,_s),h=t!==a?t.state:I(this,Ru),{state:y}=t;let g={...y},x=!1,w;if(n._optimisticResults){const F=this.hasListeners(),ne=!F&&d1(t,n),oe=F&&f1(t,a,n,l);(ne||oe)&&(g={...g,...VS(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:C}=g;w=g.data;let E=!1;if(n.placeholderData!==void 0&&w===void 0&&C==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(F=o.data,E=!0):F=typeof n.placeholderData=="function"?n.placeholderData((V=I(this,As))==null?void 0:V.state.data,I(this,As)):n.placeholderData,F!==void 0&&(C="success",w=qp(o==null?void 0:o.data,F,n),x=!0)}if(n.select&&w!==void 0&&!E)if(o&&w===(u==null?void 0:u.data)&&n.select===I(this,zu))w=I(this,Ts);else try{pe(this,zu,n.select),w=n.select(w),w=qp(o==null?void 0:o.data,w,n),pe(this,Ts,w),pe(this,gi,null)}catch(F){pe(this,gi,F)}I(this,gi)&&(k=I(this,gi),w=I(this,Ts),j=Date.now(),C="error");const R=g.fetchStatus==="fetching",z=C==="pending",M=C==="error",B=z&&R,O=w!==void 0,U={status:C,fetchStatus:g.fetchStatus,isPending:z,isSuccess:C==="success",isError:M,isInitialLoading:B,isLoading:B,data:w,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:R,isRefetching:R&&!z,isLoadingError:M&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:M&&O,isStale:Xg(t,n),refetch:this.refetch,promise:I(this,ba),isEnabled:wr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=U.data!==void 0,ne=U.status==="error"&&!F,oe=W=>{ne?W.reject(U.error):F&&W.resolve(U.data)},Se=()=>{const W=pe(this,ba,U.promise=Hp());oe(W)},G=I(this,ba);switch(G.status){case"pending":t.queryHash===a.queryHash&&oe(G);break;case"fulfilled":(ne||U.data!==G.value)&&Se();break;case"rejected":(!ne||U.error!==G.reason)&&Se();break}}return U}updateResult(){const t=I(this,Tn),n=this.createResult(I(this,at),this.options);if(pe(this,cl,I(this,at).state),pe(this,_s,this.options),I(this,cl).data!==void 0&&pe(this,As,I(this,at)),vu(n,t))return;pe(this,Tn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!I(this,Rs).size)return!0;const u=new Set(o??I(this,Rs));return this.options.throwOnError&&u.add("error"),Object.keys(I(this,Tn)).some(f=>{const m=f;return I(this,Tn)[m]!==t[m]&&u.has(m)})};Ie(this,mt,QS).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ie(this,mt,Gp).call(this)}},Fn=new WeakMap,at=new WeakMap,Ru=new WeakMap,Tn=new WeakMap,cl=new WeakMap,_s=new WeakMap,ba=new WeakMap,gi=new WeakMap,zu=new WeakMap,Ts=new WeakMap,As=new WeakMap,dl=new WeakMap,fl=new WeakMap,yi=new WeakMap,Rs=new WeakMap,mt=new WeakSet,uu=function(t){Ie(this,mt,Jp).call(this);let n=I(this,at).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jn)),n},Vp=function(){Ie(this,mt,Yp).call(this);const t=ji(this.options.staleTime,I(this,at));if(bu.isServer()||I(this,Tn).isStale||!$p(t))return;const a=BS(I(this,Tn).dataUpdatedAt,t)+1;pe(this,dl,al.setTimeout(()=>{I(this,Tn).isStale||this.updateResult()},a))},Qp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,at)):this.options.refetchInterval)??!1},Kp=function(t){Ie(this,mt,Xp).call(this),pe(this,yi,t),!(bu.isServer()||wr(this.options.enabled,I(this,at))===!1||!$p(I(this,yi))||I(this,yi)===0)&&pe(this,fl,al.setInterval(()=>{(this.options.refetchIntervalInBackground||Zg.isFocused())&&Ie(this,mt,uu).call(this)},I(this,yi)))},Gp=function(){Ie(this,mt,Vp).call(this),Ie(this,mt,Kp).call(this,Ie(this,mt,Qp).call(this))},Yp=function(){I(this,dl)&&(al.clearTimeout(I(this,dl)),pe(this,dl,void 0))},Xp=function(){I(this,fl)&&(al.clearInterval(I(this,fl)),pe(this,fl,void 0))},Jp=function(){const t=I(this,Fn).getQueryCache().build(I(this,Fn),this.options);if(t===I(this,at))return;const n=I(this,at);pe(this,at,t),pe(this,Ru,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},QS=function(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(I(this,Tn))}),I(this,Fn).getQueryCache().notify({query:I(this,at),type:"observerResultsUpdated"})})},zS);function Y2(e,t){return wr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function d1(e,t){return Y2(e,t)||e.state.data!==void 0&&Wp(e,t,t.refetchOnMount)}function Wp(e,t,n){if(wr(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 f1(e,t,n,a){return(e!==t||wr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Xg(e,n)}function Xg(e,t){return wr(t.enabled,e)!==!1&&e.isStaleByTime(ji(t.staleTime,e))}function X2(e,t){return!vu(e.getCurrentResult(),t)}function h1(e){return{onFetch:(t,n)=>{var y,g,x,w,k;const a=t.options,l=(x=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:x.direction,o=((w=t.state.data)==null?void 0:w.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const C=z=>{H2(z,()=>t.signal,()=>j=!0)},E=$S(t.options,t.fetchOptions),R=async(z,M,B)=>{if(j)return Promise.reject();if(M==null&&z.pages.length)return Promise.resolve(z);const D=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:M,direction:B?"backward":"forward",meta:t.options.meta};return C(ne),ne})(),U=await E(D),{maxPages:V}=t.options,F=B?q2:F2;return{pages:F(z.pages,U,V),pageParams:F(z.pageParams,M,V)}};if(l&&o.length){const z=l==="backward",M=z?J2:m1,B={pages:o,pageParams:u},O=M(a,B);f=await R(B,O,z)}else{const z=e??o.length;do{const M=m===0?u[0]??a.initialPageParam:m1(a,f);if(m>0&&M==null)break;f=await R(f,M),m++}while(m<z)}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 m1(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 J2(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 Ou,Zr,Sn,hl,Vr,ui,OS,W2=(OS=class extends HS{constructor(t){super();ke(this,Vr);ke(this,Ou);ke(this,Zr);ke(this,Sn);ke(this,hl);pe(this,Ou,t.client),this.mutationId=t.mutationId,pe(this,Sn,t.mutationCache),pe(this,Zr,[]),this.state=t.state||KS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,Zr).includes(t)||(I(this,Zr).push(t),this.clearGcTimeout(),I(this,Sn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,Zr,I(this,Zr).filter(n=>n!==t)),this.scheduleGc(),I(this,Sn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,Zr).length||(this.state.status==="pending"?this.scheduleGc():I(this,Sn).remove(this))}continue(){var t;return((t=I(this,hl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,y,g,x,w,k,j,C,E,R,z,M,B,O,D;const n=()=>{Ie(this,Vr,ui).call(this,{type:"continue"})},a={client:I(this,Ou),meta:this.options.meta,mutationKey:this.options.mutationKey};pe(this,hl,qS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(U,V)=>{Ie(this,Vr,ui).call(this,{type:"failed",failureCount:U,error:V})},onPause:()=>{Ie(this,Vr,ui).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,Sn).canRun(this)}));const l=this.state.status==="pending",o=!I(this,hl).canStart();try{if(l)n();else{Ie(this,Vr,ui).call(this,{type:"pending",variables:t,isPaused:o}),I(this,Sn).config.onMutate&&await I(this,Sn).config.onMutate(t,this,a);const V=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,a));V!==this.state.context&&Ie(this,Vr,ui).call(this,{type:"pending",context:V,variables:t,isPaused:o})}const U=await I(this,hl).start();return await((h=(m=I(this,Sn).config).onSuccess)==null?void 0:h.call(m,U,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,U,t,this.state.context,a)),await((w=(x=I(this,Sn).config).onSettled)==null?void 0:w.call(x,U,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,U,null,t,this.state.context,a)),Ie(this,Vr,ui).call(this,{type:"success",data:U}),U}catch(U){try{await((E=(C=I(this,Sn).config).onError)==null?void 0:E.call(C,U,t,this.state.context,this,a))}catch(V){Promise.reject(V)}try{await((z=(R=this.options).onError)==null?void 0:z.call(R,U,t,this.state.context,a))}catch(V){Promise.reject(V)}try{await((B=(M=I(this,Sn).config).onSettled)==null?void 0:B.call(M,void 0,U,this.state.variables,this.state.context,this,a))}catch(V){Promise.reject(V)}try{await((D=(O=this.options).onSettled)==null?void 0:D.call(O,void 0,U,t,this.state.context,a))}catch(V){Promise.reject(V)}throw Ie(this,Vr,ui).call(this,{type:"error",error:U}),U}finally{I(this,Sn).runNext(this)}}},Ou=new WeakMap,Zr=new WeakMap,Sn=new WeakMap,hl=new WeakMap,Vr=new WeakSet,ui=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),Bt.batch(()=>{I(this,Zr).forEach(a=>{a.onMutationUpdate(t)}),I(this,Sn).notify({mutation:this,type:"updated",action:t})})},OS);function KS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xa,Rr,Du,DS,eT=(DS=class extends bl{constructor(t={}){super();ke(this,xa);ke(this,Rr);ke(this,Du);this.config=t,pe(this,xa,new Set),pe(this,Rr,new Map),pe(this,Du,0)}build(t,n,a){const l=new W2({client:t,mutationCache:this,mutationId:++md(this,Du)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){I(this,xa).add(t);const n=pd(t);if(typeof n=="string"){const a=I(this,Rr).get(n);a?a.push(t):I(this,Rr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,xa).delete(t)){const n=pd(t);if(typeof n=="string"){const a=I(this,Rr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&I(this,Rr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=pd(t);if(typeof n=="string"){const a=I(this,Rr).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=pd(t);if(typeof n=="string"){const l=(a=I(this,Rr).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(){Bt.batch(()=>{I(this,xa).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,xa).clear(),I(this,Rr).clear()})}getAll(){return Array.from(I(this,xa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>l1(n,a))}findAll(t={}){return this.getAll().filter(n=>l1(t,n))}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(t.map(n=>n.continue().catch(jn))))}},xa=new WeakMap,Rr=new WeakMap,Du=new WeakMap,DS);function pd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var wa,vi,qn,Sa,ja,Md,eg,MS,tT=(MS=class extends bl{constructor(n,a){super();ke(this,ja);ke(this,wa);ke(this,vi);ke(this,qn);ke(this,Sa);pe(this,wa,n),this.setOptions(a),this.bindMethods(),Ie(this,ja,Md).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=I(this,wa).defaultMutationOptions(n),vu(this.options,a)||I(this,wa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:I(this,qn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&ml(a.mutationKey)!==ml(this.options.mutationKey)?this.reset():((l=I(this,qn))==null?void 0:l.state.status)==="pending"&&I(this,qn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=I(this,qn))==null||n.removeObserver(this)}onMutationUpdate(n){Ie(this,ja,Md).call(this),Ie(this,ja,eg).call(this,n)}getCurrentResult(){return I(this,vi)}reset(){var n;(n=I(this,qn))==null||n.removeObserver(this),pe(this,qn,void 0),Ie(this,ja,Md).call(this),Ie(this,ja,eg).call(this)}mutate(n,a){var l;return pe(this,Sa,a),(l=I(this,qn))==null||l.removeObserver(this),pe(this,qn,I(this,wa).getMutationCache().build(I(this,wa),this.options)),I(this,qn).addObserver(this),I(this,qn).execute(n)}},wa=new WeakMap,vi=new WeakMap,qn=new WeakMap,Sa=new WeakMap,ja=new WeakSet,Md=function(){var a;const n=((a=I(this,qn))==null?void 0:a.state)??KS();pe(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})},eg=function(n){Bt.batch(()=>{var a,l,o,u,f,m,h,y;if(I(this,Sa)&&this.hasListeners()){const g=I(this,vi).variables,x=I(this,vi).context,w={client:I(this,wa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=I(this,Sa)).onSuccess)==null||l.call(a,n.data,g,x,w)}catch(k){Promise.reject(k)}try{(u=(o=I(this,Sa)).onSettled)==null||u.call(o,n.data,null,g,x,w)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=I(this,Sa)).onError)==null||m.call(f,n.error,g,x,w)}catch(k){Promise.reject(k)}try{(y=(h=I(this,Sa)).onSettled)==null||y.call(h,void 0,n.error,g,x,w)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(I(this,vi))})})},MS);function p1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function nT(e,t,n){const a=e.slice(0);return a[t]=n,a}var zs,rr,Os,Ds,xr,bi,Mu,Iu,Lu,Uu,xn,tg,ng,rg,ag,ig,IS,rT=(IS=class extends bl{constructor(t,n,a){super();ke(this,xn);ke(this,zs);ke(this,rr);ke(this,Os);ke(this,Ds);ke(this,xr);ke(this,bi);ke(this,Mu);ke(this,Iu);ke(this,Lu);ke(this,Uu,[]);pe(this,zs,t),pe(this,Ds,a),pe(this,Os,[]),pe(this,xr,[]),pe(this,rr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&I(this,xr).forEach(t=>{t.subscribe(n=>{Ie(this,xn,ag).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,I(this,xr).forEach(t=>{t.destroy()})}setQueries(t,n){pe(this,Os,t),pe(this,Ds,n),Bt.batch(()=>{const a=I(this,xr),l=Ie(this,xn,rg).call(this,I(this,Os));l.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=l.map(g=>g.observer),u=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,x)=>g!==a[x]),h=f||m,y=h?!0:u.some((g,x)=>{const w=I(this,rr)[x];return!w||!vu(g,w)});!h&&!y||(h&&(pe(this,Uu,l),pe(this,xr,o)),pe(this,rr,u),this.hasListeners()&&(h&&(p1(a,o).forEach(g=>{g.destroy()}),p1(o,a).forEach(g=>{g.subscribe(x=>{Ie(this,xn,ag).call(this,g,x)})})),Ie(this,xn,ig).call(this)))})}getCurrentResult(){return I(this,rr)}getQueries(){return I(this,xr).map(t=>t.getCurrentQuery())}getObservers(){return I(this,xr)}getOptimisticResult(t,n){const a=Ie(this,xn,rg).call(this,t),l=a.map(u=>u.observer.getOptimisticResult(u.defaultedQueryOptions)),o=a.map(u=>u.defaultedQueryOptions.queryHash);return[l,u=>Ie(this,xn,ng).call(this,u??l,n,o),()=>Ie(this,xn,tg).call(this,l,a)]}},zs=new WeakMap,rr=new WeakMap,Os=new WeakMap,Ds=new WeakMap,xr=new WeakMap,bi=new WeakMap,Mu=new WeakMap,Iu=new WeakMap,Lu=new WeakMap,Uu=new WeakMap,xn=new WeakSet,tg=function(t,n){return n.map((a,l)=>{const o=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,u=>{n.forEach(f=>{f.observer.trackProp(u)})})})},ng=function(t,n,a){if(n){const l=I(this,Lu),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((u,f)=>u!==l[f]));return(!I(this,bi)||I(this,rr)!==I(this,Iu)||o||n!==I(this,Mu))&&(pe(this,Mu,n),pe(this,Iu,I(this,rr)),a!==void 0&&pe(this,Lu,a),pe(this,bi,Qg(I(this,bi),n(t)))),I(this,bi)}return t},rg=function(t){const n=new Map;I(this,xr).forEach(l=>{const o=l.options.queryHash;if(!o)return;const u=n.get(o);u?u.push(l):n.set(o,[l])});const a=[];return t.forEach(l=>{var m;const o=I(this,zs).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new Yg(I(this,zs),o);a.push({defaultedQueryOptions:o,observer:f})}),a},ag=function(t,n){const a=I(this,xr).indexOf(t);a!==-1&&(pe(this,rr,nT(I(this,rr),a,n)),Ie(this,xn,ig).call(this))},ig=function(){var t;if(this.hasListeners()){const n=I(this,bi),a=Ie(this,xn,tg).call(this,I(this,rr),I(this,Uu)),l=Ie(this,xn,ng).call(this,a,(t=I(this,Ds))==null?void 0:t.combine);n!==l&&Bt.batch(()=>{this.listeners.forEach(o=>{o(I(this,rr))})})}},IS),Qr,LS,aT=(LS=class extends bl{constructor(t={}){super();ke(this,Qr);this.config=t,pe(this,Qr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??Vg(l,n);let u=this.get(o);return u||(u=new G2({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){I(this,Qr).has(t.queryHash)||(I(this,Qr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=I(this,Qr).get(t.queryHash);n&&(t.destroy(),n===t&&I(this,Qr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,Qr).get(t)}getAll(){return[...I(this,Qr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>i1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>i1(t,a)):n}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qr=new WeakMap,LS),Pt,xi,wi,Ms,Is,Si,Ls,Us,US,iT=(US=class{constructor(e={}){ke(this,Pt);ke(this,xi);ke(this,wi);ke(this,Ms);ke(this,Is);ke(this,Si);ke(this,Ls);ke(this,Us);pe(this,Pt,e.queryCache||new aT),pe(this,xi,e.mutationCache||new eT),pe(this,wi,e.defaultOptions||{}),pe(this,Ms,new Map),pe(this,Is,new Map),pe(this,Si,0)}mount(){md(this,Si)._++,I(this,Si)===1&&(pe(this,Ls,Zg.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Pt).onFocus())})),pe(this,Us,Hd.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Pt).onOnline())})))}unmount(){var e,t;md(this,Si)._--,I(this,Si)===0&&((e=I(this,Ls))==null||e.call(this),pe(this,Ls,void 0),(t=I(this,Us))==null||t.call(this),pe(this,Us,void 0))}isFetching(e){return I(this,Pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,xi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=I(this,Pt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=I(this,Pt).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 I(this,Pt).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=I(this,Pt).get(a.queryHash),o=l==null?void 0:l.state.data,u=P2(t,o);if(u!==void 0)return I(this,Pt).build(this,a).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Bt.batch(()=>I(this,Pt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=I(this,Pt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=I(this,Pt);Bt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=I(this,Pt);return Bt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Bt.batch(()=>I(this,Pt).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(jn).catch(jn)}invalidateQueries(e,t={}){return Bt.batch(()=>(I(this,Pt).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=Bt.batch(()=>I(this,Pt).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(jn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(jn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=I(this,Pt).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(jn).catch(jn)}fetchInfiniteQuery(e){return e.behavior=h1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jn).catch(jn)}ensureInfiniteQueryData(e){return e.behavior=h1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hd.isOnline()?I(this,xi).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,Pt)}getMutationCache(){return I(this,xi)}getDefaultOptions(){return I(this,wi)}setDefaultOptions(e){pe(this,wi,e)}setQueryDefaults(e,t){I(this,Ms).set(ml(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,Ms).values()],n={};return t.forEach(a=>{yu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){I(this,Is).set(ml(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,Is).values()],n={};return t.forEach(a=>{yu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,wi).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===Kg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,wi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,Pt).clear(),I(this,xi).clear()}},Pt=new WeakMap,xi=new WeakMap,wi=new WeakMap,Ms=new WeakMap,Is=new WeakMap,Si=new WeakMap,Ls=new WeakMap,Us=new WeakMap,US),GS=b.createContext(void 0),an=e=>{const t=b.useContext(GS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},lT=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(GS.Provider,{value:e,children:t})),YS=b.createContext(!1),XS=()=>b.useContext(YS);YS.Provider;function sT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var oT=b.createContext(sT()),JS=()=>b.useContext(oT),WS=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Gg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},ek=e=>{b.useEffect(()=>{e.clearReset()},[e])},tk=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Gg(n,[e.error,a])),nk=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))}},uT=(e,t)=>e.isLoading&&e.isFetching&&!t,lg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,sg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function cT({queries:e,...t},n){const a=an(),l=XS(),o=JS(),u=b.useMemo(()=>e.map(j=>{const C=a.defaultQueryOptions(j);return C._optimisticResults=l?"isRestoring":"optimistic",C}),[e,a,l]);u.forEach(j=>{nk(j);const C=a.getQueryCache().get(j.queryHash);WS(j,o,C)}),ek(o);const[f]=b.useState(()=>new rT(a,u,t)),[m,h,y]=f.getOptimisticResult(u,t.combine),g=!l&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(j=>g?f.subscribe(Bt.batchCalls(j)):jn,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setQueries(u,t)},[u,t,f]);const w=m.some((j,C)=>lg(u[C],j))?m.flatMap((j,C)=>{const E=u[C];if(E&&lg(E,j)){const R=new Yg(a,E);return sg(E,R,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const k=m.find((j,C)=>{const E=u[C];return E&&tk({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 dT(e,t,n){var x,w,k,j;const a=XS(),l=JS(),o=an(),u=o.defaultQueryOptions(e);(w=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||w.call(x,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",nk(u),WS(u,l,f),ek(l);const m=!o.getQueryCache().get(u.queryHash),[h]=b.useState(()=>new t(o,u)),y=h.getOptimisticResult(u),g=!a&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(C=>{const E=g?h.subscribe(Bt.batchCalls(C)):jn;return h.updateResult(),E},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),b.useEffect(()=>{h.setOptions(u)},[u,h]),lg(u,y))throw sg(u,h,l);if(tk({result:y,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,y),u.experimental_prefetchInRender&&!bu.isServer()&&uT(y,a)){const C=m?sg(u,h,l):f==null?void 0:f.promise;C==null||C.catch(jn).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?y:h.trackResult(y)}function Ve(e,t){return dT(e,Yg)}function kt(e,t){const n=an(),[a]=b.useState(()=>new tT(n,e));b.useEffect(()=>{a.setOptions(e)},[a,e]);const l=b.useSyncExternalStore(b.useCallback(u=>a.subscribe(Bt.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=b.useCallback((u,f)=>{a.mutate(u,f).catch(jn)},[a]);if(l.error&&Gg(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 g1="popstate";function y1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function fT(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||a.location;return og("",{pathname:u,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:xu(l)}return mT(t,n,null,e)}function Rt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hT(){return Math.random().toString(36).substring(2,10)}function v1(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 og(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ks(t):t,state:n,key:t&&t.key||a||hT(),unstable_mask:l}}function xu({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 Ks(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 mT(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,u=l.history,f="POP",m=null,h=y();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function y(){return(u.state||{idx:null}).idx}function g(){f="POP";let C=y(),E=C==null?null:C-h;h=C,m&&m({action:f,location:j.location,delta:E})}function x(C,E){f="PUSH";let R=y1(C)?C:og(j.location,C,E);h=y()+1;let z=v1(R,h),M=j.createHref(R.unstable_mask||R);try{u.pushState(z,"",M)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(M)}o&&m&&m({action:f,location:j.location,delta:1})}function w(C,E){f="REPLACE";let R=y1(C)?C:og(j.location,C,E);h=y();let z=v1(R,h),M=j.createHref(R.unstable_mask||R);u.replaceState(z,"",M),o&&m&&m({action:f,location:j.location,delta:0})}function k(C){return pT(C)}let j={get action(){return f},get location(){return e(l,u)},listen(C){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(g1,g),m=C,()=>{l.removeEventListener(g1,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:x,replace:w,go(C){return u.go(C)}};return j}function pT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Rt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:xu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function rk(e,t,n="/"){return gT(e,t,n,!1)}function gT(e,t,n,a){let l=typeof t=="string"?Ks(t):t,o=Ca(l.pathname||"/",n);if(o==null)return null;let u=ak(e);yT(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=_T(o);f=ET(u[m],h,a)}return f}function ak(e,t=[],n=[],a="",l=!1){let o=(u,f,m=l,h)=>{let y={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;Rt(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]),x=n.concat(y);u.children&&u.children.length>0&&(Rt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),ak(u.children,t,x,g,m)),!(u.path==null&&!u.index)&&t.push({path:g,score:jT(g,u.index),routesMeta:x})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of ik(u.path))o(u,f,!0,h)}),t}function ik(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 u=ik(a.join("/")),f=[];return f.push(...u.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function yT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:CT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var vT=/^:[\w-]+$/,bT=3,xT=2,wT=1,ST=10,kT=-2,b1=e=>e==="*";function jT(e,t){let n=e.split("/"),a=n.length;return n.some(b1)&&(a+=kT),t&&(a+=xT),n.filter(l=>!b1(l)).reduce((l,o)=>l+(vT.test(o)?bT:o===""?wT:ST),a)}function CT(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 ET(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",u=[];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=Zd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),x=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Zd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),u.push({params:l,pathname:Gr([o,g.pathname]),pathnameBase:zT(Gr([o,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(o=Gr([o,g.pathnameBase]))}return u}function Zd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=NT(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},x)=>{if(y==="*"){let k=f[x]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const w=f[x];return g&&!w?h[y]=void 0:h[y]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function NT(e,t=!1,n=!0){kr(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,(u,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function _T(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return kr(!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 Ca(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 TT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function AT(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Ks(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=x1(n.substring(1),"/"):o=x1(n,t)):o=t,{pathname:o,search:OT(a),hash:DT(l)}}function x1(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 ep(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 RT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jg(e){let t=RT(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function cf(e,t,n,a=!1){let l;typeof e=="string"?l=Ks(e):(l={...e},Rt(!l.pathname||!l.pathname.includes("?"),ep("?","pathname","search",l)),Rt(!l.pathname||!l.pathname.includes("#"),ep("#","pathname","hash",l)),Rt(!l.search||!l.search.includes("#"),ep("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=n;else{let g=t.length-1;if(!a&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),g-=1;l.pathname=x.join("/")}f=g>=0?t[g]:"/"}let m=AT(l,f),h=u&&u!=="/"&&u.endsWith("/"),y=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var Gr=e=>e.join("/").replace(/\/\/+/g,"/"),zT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),OT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,MT=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 IT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function LT(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var lk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sk(e,t){let n=e;if(typeof n!="string"||!TT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(lk)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ca(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{kr(!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 ok=["POST","PUT","PATCH","DELETE"];new Set(ok);var UT=["GET",...ok];new Set(UT);var Gs=b.createContext(null);Gs.displayName="DataRouter";var df=b.createContext(null);df.displayName="DataRouterState";var PT=b.createContext(!1),uk=b.createContext({isTransitioning:!1});uk.displayName="ViewTransition";var BT=b.createContext(new Map);BT.displayName="Fetchers";var $T=b.createContext(null);$T.displayName="Await";var sr=b.createContext(null);sr.displayName="Navigation";var Pu=b.createContext(null);Pu.displayName="Location";var Cr=b.createContext({outlet:null,matches:[],isDataRoute:!1});Cr.displayName="Route";var Wg=b.createContext(null);Wg.displayName="RouteError";var ck="REACT_ROUTER_ERROR",FT="REDIRECT",qT="ROUTE_ERROR_RESPONSE";function HT(e){if(e.startsWith(`${ck}:${FT}:{`))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 ZT(e){if(e.startsWith(`${ck}:${qT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new MT(t.status,t.statusText,t.data)}catch{}}function VT(e,{relative:t}={}){Rt(Ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=b.useContext(sr),{hash:l,pathname:o,search:u}=Bu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Gr([n,o])),a.createHref({pathname:f,search:u,hash:l})}function Ys(){return b.useContext(Pu)!=null}function Zn(){return Rt(Ys(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Pu).location}var dk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fk(e){b.useContext(sr).static||b.useLayoutEffect(e)}function zn(){let{isDataRoute:e}=b.useContext(Cr);return e?sA():QT()}function QT(){Rt(Ys(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Gs),{basename:t,navigator:n}=b.useContext(sr),{matches:a}=b.useContext(Cr),{pathname:l}=Zn(),o=JSON.stringify(Jg(a)),u=b.useRef(!1);return fk(()=>{u.current=!0}),b.useCallback((m,h={})=>{if(kr(u.current,dk),!u.current)return;if(typeof m=="number"){n.go(m);return}let y=cf(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 KT=b.createContext(null);function GT(e){let t=b.useContext(Cr).outlet;return b.useMemo(()=>t&&b.createElement(KT.Provider,{value:e},t),[t,e])}function hk(){let{matches:e}=b.useContext(Cr),t=e[e.length-1];return t?t.params:{}}function Bu(e,{relative:t}={}){let{matches:n}=b.useContext(Cr),{pathname:a}=Zn(),l=JSON.stringify(Jg(n));return b.useMemo(()=>cf(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function YT(e,t){return mk(e,t)}function mk(e,t,n){var C;Rt(Ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(sr),{matches:l}=b.useContext(Cr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let E=h&&h.path||"";gk(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=Zn(),g;if(t){let E=typeof t=="string"?Ks(t):t;Rt(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 x=g.pathname||"/",w=x;if(m!=="/"){let E=m.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=rk(e,{pathname:w});kr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),kr(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=tA(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},u,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?b.createElement(Pu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function XT(){let e=lA(),t=IT(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},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:l},n):null,u)}var JT=b.createElement(XT,null),pk=class extends b.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=ZT(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(Cr.Provider,{value:this.props.routeContext},b.createElement(Wg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(WT,{error:e},t):t}};pk.contextType=PT;var tp=new WeakMap;function WT({children:e,error:t}){let{basename:n}=b.useContext(sr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=HT(t.digest);if(a){let l=tp.get(t);if(l)throw l;let o=sk(a.location,n);if(lk&&!tp.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw tp.set(t,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function eA({routeContext:e,match:t,children:n}){let a=b.useContext(Gs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Cr.Provider,{value:e},n)}function tA(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);Rt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let u=!1,f=-1;if(n&&a){u=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:x,errors:w}=a,k=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(u=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(y,g)=>{var x,w;m(y,{location:a.location,params:((w=(x=a.matches)==null?void 0:x[0])==null?void 0:w.params)??{},unstable_pattern:LT(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,x)=>{let w,k=!1,j=null,C=null;a&&(w=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||JT,u&&(f<0&&x===0?(gk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,C=null):f===x&&(k=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,x+1)),R=()=>{let z;return w?z=j:k?z=C:g.route.Component?z=b.createElement(g.route.Component,null):g.route.element?z=g.route.element:z=y,b.createElement(eA,{match:g,routeContext:{outlet:y,matches:E,isDataRoute:a!=null},children:z})};return a&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?b.createElement(pk,{location:a.location,revalidation:a.revalidation,component:j,error:w,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):R()},null)}function ey(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nA(e){let t=b.useContext(Gs);return Rt(t,ey(e)),t}function rA(e){let t=b.useContext(df);return Rt(t,ey(e)),t}function aA(e){let t=b.useContext(Cr);return Rt(t,ey(e)),t}function ty(e){let t=aA(e),n=t.matches[t.matches.length-1];return Rt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function iA(){return ty("useRouteId")}function lA(){var a;let e=b.useContext(Wg),t=rA("useRouteError"),n=ty("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function sA(){let{router:e}=nA("useNavigate"),t=ty("useNavigate"),n=b.useRef(!1);return fk(()=>{n.current=!0}),b.useCallback(async(l,o={})=>{kr(n.current,dk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var w1={};function gk(e,t,n){!t&&!w1[e]&&(w1[e]=!0,kr(!1,n))}b.memo(oA);function oA({routes:e,future:t,state:n,isStatic:a,onError:l}){return mk(e,void 0,{state:n,isStatic:a,onError:l})}function ar({to:e,replace:t,state:n,relative:a}){Rt(Ys(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=b.useContext(sr);kr(!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}=b.useContext(Cr),{pathname:u}=Zn(),f=zn(),m=cf(e,Jg(o),u,a==="path"),h=JSON.stringify(m);return b.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function Ps(e){return GT(e.context)}function At(e){Rt(!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 uA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){Rt(!Ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=Ks(n));let{pathname:h="/",search:y="",hash:g="",state:x=null,key:w="default",unstable_mask:k}=n,j=b.useMemo(()=>{let C=Ca(h,f);return C==null?null:{location:{pathname:C,search:y,hash:g,state:x,key:w,unstable_mask:k},navigationType:a}},[f,h,y,g,x,w,a,k]);return kr(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:b.createElement(sr.Provider,{value:m},b.createElement(Pu.Provider,{children:t,value:j}))}function cA({children:e,location:t}){return YT(ug(e),t)}function ug(e,t=[]){let n=[];return b.Children.forEach(e,(a,l)=>{if(!b.isValidElement(a))return;let o=[...t,l];if(a.type===b.Fragment){n.push.apply(n,ug(a.props.children,o));return}Rt(a.type===At,`[${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>`),Rt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let u={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&&(u.children=ug(a.props.children,o)),n.push(u)}),n}var Id="get",Ld="application/x-www-form-urlencoded";function ff(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function dA(e){return ff(e)&&e.tagName.toLowerCase()==="button"}function fA(e){return ff(e)&&e.tagName.toLowerCase()==="form"}function hA(e){return ff(e)&&e.tagName.toLowerCase()==="input"}function mA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pA(e,t){return e.button===0&&(!t||t==="_self")&&!mA(e)}function cg(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 gA(e,t){let n=cg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var gd=null;function yA(){if(gd===null)try{new FormData(document.createElement("form"),0),gd=!1}catch{gd=!0}return gd}var vA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function np(e){return e!=null&&!vA.has(e)?(kr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ld}"`),null):e}function bA(e,t){let n,a,l,o,u;if(fA(e)){let f=e.getAttribute("action");a=f?Ca(f,t):null,n=e.getAttribute("method")||Id,l=np(e.getAttribute("enctype"))||Ld,o=new FormData(e)}else if(dA(e)||hA(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?Ca(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Id,l=np(e.getAttribute("formenctype"))||np(f.getAttribute("enctype"))||Ld,o=new FormData(f,e),!yA()){let{name:h,type:y,value:g}=e;if(y==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,g)}}else{if(ff(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Id,a=null,l=Ld,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ny(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xA(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&&Ca(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function wA(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 SA(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 kA(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await wA(o,n);return u.links?u.links():[]}return[]}));return NA(a.flat(1).filter(SA).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 u=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=a.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let x=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 x=="boolean")return x}return!0}):[]}function jA(e,t,{includeHydrateFallback:n}={}){return CA(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 CA(e){return[...new Set(e)]}function EA(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function NA(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(EA(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function yk(){let e=b.useContext(Gs);return ny(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function _A(){let e=b.useContext(df);return ny(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ry=b.createContext(void 0);ry.displayName="FrameworkContext";function vk(){let e=b.useContext(ry);return ny(e,"You must render this element inside a <HydratedRouter> element"),e}function TA(e,t){let n=b.useContext(ry),[a,l]=b.useState(!1),[o,u]=b.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,x=b.useRef(null);b.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=E=>{E.forEach(R=>{u(R.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[e]),b.useEffect(()=>{if(a){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[a]);let w=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,x,{}]:[o,x,{onFocus:Wo(f,w),onBlur:Wo(m,k),onMouseEnter:Wo(h,w),onMouseLeave:Wo(y,k),onTouchStart:Wo(g,w)}]:[!1,x,{}]}function Wo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function AA({page:e,...t}){let{router:n}=yk(),a=b.useMemo(()=>rk(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?b.createElement(zA,{page:e,matches:a,...t}):null}function RA(e){let{manifest:t,routeModules:n}=vk(),[a,l]=b.useState([]);return b.useEffect(()=>{let o=!1;return kA(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),a}function zA({page:e,matches:t,...n}){let a=Zn(),{future:l,manifest:o,routeModules:u}=vk(),{basename:f}=yk(),{loaderData:m,matches:h}=_A(),y=b.useMemo(()=>S1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=b.useMemo(()=>S1(e,t,h,o,a,"assets"),[e,t,h,o,a]),x=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,C=!1;if(t.forEach(R=>{var M;let z=o.routes[R.route.id];!z||!z.hasLoader||(!y.some(B=>B.route.id===R.route.id)&&R.route.id in m&&((M=u[R.route.id])!=null&&M.shouldRevalidate)||z.hasClientLoader?C=!0:j.add(R.route.id))}),j.size===0)return[];let E=xA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&E.searchParams.set("_routes",t.filter(R=>j.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,u]),w=b.useMemo(()=>jA(g,o),[g,o]),k=RA(g);return b.createElement(b.Fragment,null,x.map(j=>b.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),w.map(j=>b.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:C})=>b.createElement("link",{key:j,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function OA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var DA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{DA&&(window.__reactRouterVersion="7.13.1")}catch{}function MA({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=b.useRef();l.current==null&&(l.current=fT({window:a,v5Compat:!0}));let o=l.current,[u,f]=b.useState({action:o.action,location:o.location}),m=b.useCallback(h=>{n===!1?f(h):b.startTransition(()=>f(h))},[n]);return b.useLayoutEffect(()=>o.listen(m),[o,m]),b.createElement(uA,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var bk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$u=b.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:w,...k},j){let{basename:C,navigator:E,unstable_useTransitions:R}=b.useContext(sr),z=typeof y=="string"&&bk.test(y),M=sk(y,C);y=M.to;let B=VT(y,{relative:l}),O=Zn(),D=null;if(f){let W=cf(f,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);C!=="/"&&(W.pathname=W.pathname==="/"?C:Gr([C,W.pathname])),D=E.createHref(W)}let[U,V,F]=TA(a,k),ne=UA(y,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:x,unstable_defaultShouldRevalidate:w,unstable_useTransitions:R});function oe(W){t&&t(W),W.defaultPrevented||ne(W)}let Se=!(M.isExternal||o),G=b.createElement("a",{...k,...F,href:(Se?D:void 0)||M.absoluteURL||B,onClick:Se?oe:t,ref:OA(j,V),target:h,"data-discover":!z&&n==="render"?"true":void 0});return U&&!z?b.createElement(b.Fragment,null,G,b.createElement(AA,{page:B})):G});$u.displayName="Link";var hf=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},y){let g=Bu(u,{relative:h.relative}),x=Zn(),w=b.useContext(df),{navigator:k,basename:j}=b.useContext(sr),C=w!=null&&qA(g)&&f===!0,E=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,R=x.pathname,z=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(R=R.toLowerCase(),z=z?z.toLowerCase():null,E=E.toLowerCase()),z&&j&&(z=Ca(z,j)||z);const M=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let B=R===E||!l&&R.startsWith(E)&&R.charAt(M)==="/",O=z!=null&&(z===E||!l&&z.startsWith(E)&&z.charAt(E.length)==="/"),D={isActive:B,isPending:O,isTransitioning:C},U=B?t:void 0,V;typeof a=="function"?V=a(D):V=[a,B?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(D):o;return b.createElement($u,{...h,"aria-current":U,className:V,ref:y,style:F,to:u,viewTransition:f},typeof m=="function"?m(D):m)});hf.displayName="NavLink";var IA=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:u=Id,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x,...w},k)=>{let{unstable_useTransitions:j}=b.useContext(sr),C=$A(),E=FA(f,{relative:h}),R=u.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&bk.test(f),M=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let O=B.nativeEvent.submitter,D=(O==null?void 0:O.getAttribute("formmethod"))||u,U=()=>C(O||B.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x});j&&n!==!1?b.startTransition(()=>U()):U()};return b.createElement("form",{ref:k,method:R,action:E,onSubmit:a?m:M,...w,"data-discover":!z&&e==="render"?"true":void 0})});IA.displayName="Form";function LA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xk(e){let t=b.useContext(Gs);return Rt(t,LA(e)),t}function UA(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=zn(),g=Zn(),x=Bu(e,{relative:u});return b.useCallback(w=>{if(pA(w,t)){w.preventDefault();let k=n!==void 0?n:xu(g)===xu(x),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?b.startTransition(()=>j()):j()}},[g,y,x,n,a,l,t,e,o,u,f,m,h])}function wk(e){kr(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=b.useRef(cg(e)),n=b.useRef(!1),a=Zn(),l=b.useMemo(()=>gA(a.search,n.current?null:t.current),[a.search]),o=zn(),u=b.useCallback((f,m)=>{const h=cg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var PA=0,BA=()=>`__${String(++PA)}__`;function $A(){let{router:e}=xk("useSubmit"),{basename:t}=b.useContext(sr),n=iA(),a=e.fetch,l=e.navigate;return b.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=bA(o,t);if(u.navigate===!1){let x=u.fetcherKey||BA();await a(x,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await l(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,l,t,n])}function FA(e,{relative:t}={}){let{basename:n}=b.useContext(sr),a=b.useContext(Cr);Rt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Bu(e||".",{relative:t})},u=Zn();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Gr([n,o.pathname])),xu(o)}function qA(e,{relative:t}={}){let n=b.useContext(uk);Rt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=xk("useViewTransitionState"),l=Bu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ca(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=Ca(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Zd(l.pathname,u)!=null||Zd(l.pathname,o)!=null}const HA="/api/v1";async function ZA(e,t){const n=await fetch(`${HA}/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 Sk="/api/v1",ay="first-tree-hub:tokens";let dg=null;function eu(e){dg=e}function VA(e){if(!dg||!e.startsWith("/admin/")&&e!=="/admin"||/[?&]organizationId=/.test(e))return e;const t=e.includes("?")?"&":"?";return`${e}${t}organizationId=${encodeURIComponent(dg)}`}function iy(){const e=localStorage.getItem(ay);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function fg(e){localStorage.setItem(ay,JSON.stringify(e))}function kk(){localStorage.removeItem(ay)}class Fu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let tu=null;async function QA(e){return tu||(tu=(async()=>{try{const t=await fetch(`${Sk}/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 fg(a),a}catch{return null}finally{tu=null}})(),tu)}async function yd(e,t){const{method:n="GET",body:a}=t??{},l=VA(e),o=m=>{const h={};return m&&(h.Authorization=`Bearer ${m}`),a!==void 0&&(h["Content-Type"]="application/json"),fetch(`${Sk}${l}`,{method:n,headers:h,body:a!==void 0?JSON.stringify(a):void 0})},u=iy();let f=await o(u==null?void 0:u.accessToken);if(f.status===401&&(u!=null&&u.refreshToken)){const m=await QA(u.refreshToken);m&&(f=await o(m.accessToken))}if(!f.ok){f.status===401&&(kk(),window.dispatchEvent(new CustomEvent("auth:logout")));const m=await f.text();let h,y;try{const g=JSON.parse(m);h=g.error??m,Array.isArray(g.details)&&(y=g.details.filter(x=>typeof x=="object"&&x!==null&&Array.isArray(x.path)))}catch{h=m}throw new Fu(f.status,h,y)}if(f.status!==204)return await f.json()}const je={get:e=>yd(e),post:(e,t)=>yd(e,{method:"POST",body:t}),patch:(e,t)=>yd(e,{method:"PATCH",body:t}),delete:e=>yd(e,{method:"DELETE"})},ly="onboarding:joinPath",KA="onboarding:draft";function jk(e){typeof window>"u"||window.sessionStorage.setItem(ly,e)}function GA(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(ly);return e==="solo"||e==="invite"?e:null}function YA(){typeof window>"u"||window.sessionStorage.removeItem(ly)}function XA(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function sy(e){return`${KA}:${e}`}function JA(e){if(!e||typeof e!="object"||!("displayName"in e)||typeof e.displayName!="string")return null;const t="selectedRuntime"in e?e.selectedRuntime:null;if(t!==null&&typeof t!="string")return null;const n="connectToken"in e?e.connectToken:null;if(n!==null&&typeof n!="string")return null;const a="connectTokenExpiresAt"in e?e.connectTokenExpiresAt:null;return a!==null&&typeof a!="number"?null:{displayName:e.displayName,selectedRuntime:t,connectToken:n,connectTokenExpiresAt:a}}function WA(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(sy(e));if(!t)return null;try{return JA(JSON.parse(t))}catch{return null}}function eR(e,t){typeof window>"u"||window.sessionStorage.setItem(sy(e),JSON.stringify(t))}function tR(e){typeof window>"u"||window.sessionStorage.removeItem(sy(e))}const Ck=b.createContext(null),hg="first-tree-hub:selectedOrganizationId";function nR(){try{return localStorage.getItem(hg)}catch{return null}}function rp(e){try{e===null?localStorage.removeItem(hg):localStorage.setItem(hg,e)}catch{}}function rR({children:e}){const t=an(),[n,a]=b.useState(()=>!!iy()),[l,o]=b.useState(null),[u,f]=b.useState([]),[m,h]=b.useState(()=>{const M=nR();return eu(M),M}),[y,g]=b.useState(null),[x,w]=b.useState(null),k=b.useCallback(()=>{kk(),rp(null),eu(null),t.clear(),a(!1),o(null),f([]),h(null),g(null),w(null)},[t]),j=b.useCallback(async()=>{var M;try{const B=await je.get("/me");o(B.user??null),g(B.member);const O=B.memberships??[];f(O);const D=((M=B.wizard)==null?void 0:M.step)??null;w(D),D==="completed"&&YA(),h(U=>{var ne;const V=U&&O.some(oe=>oe.organizationId===U)?U:null;if(V)return eu(V),V;const F=B.member.organizationId??((ne=O[0])==null?void 0:ne.organizationId)??null;return rp(F),eu(F),F})}catch{}},[]),C=b.useCallback(async(M,B)=>{const O=await ZA(M,B);fg({accessToken:O.accessToken,refreshToken:O.refreshToken}),a(!0),await j()},[j]),E=b.useCallback(async M=>{fg(M),a(!0),await j()},[j]),R=b.useCallback(async M=>{await je.post("/auth/switch-org",{organizationId:M}),rp(M),eu(M),t.clear(),h(M),await j()},[j,t]);b.useEffect(()=>{n&&!l&&j()},[n,l,j]),b.useEffect(()=>{const M=()=>k();return window.addEventListener("auth:logout",M),()=>window.removeEventListener("auth:logout",M)},[k]);const z=b.useMemo(()=>{if(u.length>0){const M=u.find(B=>B.organizationId===m);return M||(u[0]??null)}if(y){const M=y.role==="admin"?"admin":"member";return{id:y.id,organizationId:y.organizationId,organizationName:"",role:M,agentId:y.agentId}}return null},[u,m,y]);return c.jsx(Ck.Provider,{value:{isAuthenticated:n,user:l,memberships:u,currentMembership:z,organizationId:(z==null?void 0:z.organizationId)??null,memberId:(z==null?void 0:z.id)??null,role:(z==null?void 0:z.role)??null,agentId:(z==null?void 0:z.agentId)??null,wizardStep:x,login:C,adoptTokens:E,selectOrganization:R,refreshMe:j,logout:k},children:e})}function zt(){const e=b.useContext(Ck);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const aR="modulepreload",iR=function(e){return"/"+e},k1={},lR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let u=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=u(n.map(h=>{if(h=iR(h),h in k1)return;k1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":aR,y||(x.as="script"),x.crossOrigin="",x.href=h,m&&x.setAttribute("nonce",m),document.head.appendChild(x),y)return new Promise((w,k)=>{x.addEventListener("load",w),x.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},sR=b.lazy(()=>lR(()=>import("./index-COflQOwF.js"),[]).then(e=>({default:e.LandingPage}))),oR=()=>c.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function uR(){const{isAuthenticated:e}=zt(),t=Zn();return e?c.jsx(Ps,{}):t.pathname==="/"?c.jsx(b.Suspense,{fallback:c.jsx(oR,{}),children:c.jsx(sR,{})}):c.jsx(ar,{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 Ek=(...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 cR=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 dR=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 j1=e=>{const t=dR(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 fR={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 hR=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 mR=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:u,...f},m)=>b.createElement("svg",{ref:m,...fR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Ek("lucide",l),...!o&&!hR(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,y])=>b.createElement(h,y)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
+
* @license lucide-react v0.577.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const st=(e,t)=>{const n=b.forwardRef(({className:a,...l},o)=>b.createElement(mR,{ref:o,iconNode:t,className:Ek(`lucide-${cR(j1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=j1(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 pR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],oy=st("arrow-left",pR);/**
|
|
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 gR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],yR=st("arrow-right",gR);/**
|
|
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 vR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Nk=st("arrow-up",vR);/**
|
|
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 bR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],xR=st("at-sign",bR);/**
|
|
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:"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"}]],SR=st("bell",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:"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"}]],jR=st("bot",kR);/**
|
|
131
|
+
* @license lucide-react v0.577.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const CR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jr=st("check",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:"m6 9 6 6 6-6",key:"qrunsl"}]],_k=st("chevron-down",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 NR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_R=st("chevron-right",NR);/**
|
|
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=[["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"}]],Tk=st("copy",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 AR=[["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"}]],RR=st("eye-off",AR);/**
|
|
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 zR=[["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"}]],OR=st("eye",zR);/**
|
|
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:"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"}]],Ak=st("github",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 MR=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],IR=st("key-round",MR);/**
|
|
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 LR=[["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"}]],UR=st("layout-dashboard",LR);/**
|
|
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:"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"}]],mg=st("link-2",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:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],$R=st("loader-circle",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=[["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=st("lock",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 qR=[["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"}]],HR=st("log-out",qR);/**
|
|
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 ZR=[["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"}]],uy=st("message-square",ZR);/**
|
|
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 VR=[["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"}]],QR=st("moon",VR);/**
|
|
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 KR=[["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"}]],GR=st("paperclip",KR);/**
|
|
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 YR=[["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"}]],mf=st("pencil",YR);/**
|
|
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 XR=[["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=st("play",XR);/**
|
|
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:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mr=st("plus",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 WR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cy=st("search",WR);/**
|
|
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 ez=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],tz=st("sun",ez);/**
|
|
236
|
+
* @license lucide-react v0.577.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const nz=[["path",{d:"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"}]],Bs=st("trash-2",nz);/**
|
|
241
|
+
* @license lucide-react v0.577.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const rz=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],dy=st("triangle-alert",rz);/**
|
|
246
|
+
* @license lucide-react v0.577.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const az=[["path",{d:"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"}]],iz=st("undo-2",az);/**
|
|
251
|
+
* @license lucide-react v0.577.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const lz=[["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"}]],sz=st("unplug",lz);/**
|
|
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 oz=[["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"}]],Ok=st("user-plus",oz);/**
|
|
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 uz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wu=st("x",uz);/**
|
|
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 cz=[["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"}]],dz=st("zap",cz);function Dk(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=Dk(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Mk(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Dk(e))&&(a&&(a+=" "),a+=t);return a}const fz=(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},hz=(e,t)=>({classGroupId:e,validator:t}),Ik=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vd="-",C1=[],mz="arbitrary..",pz=e=>{const t=yz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return gz(u);const f=u.split(Vd),m=f[0]===""&&f.length>1?1:0;return Lk(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],h=n[u];return m?h?fz(h,m):m:h||C1}return n[u]||C1}}},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 u=n.validators;if(u===null)return;const f=t===0?e.join(Vd):e.slice(t).join(Vd),m=u.length;for(let h=0;h<m;h++){const y=u[h];if(y.validator(f))return y.classGroupId}},gz=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?mz+a:void 0})(),yz=e=>{const{theme:t,classGroups:n}=e;return vz(n,t)},vz=(e,t)=>{const n=Ik();for(const a in e){const l=e[a];fy(l,n,a,t)}return n},fy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];bz(u,t,n,a)}},bz=(e,t,n,a)=>{if(typeof e=="string"){xz(e,t,n);return}if(typeof e=="function"){wz(e,t,n,a);return}Sz(e,t,n,a)},xz=(e,t,n)=>{const a=e===""?t:Uk(t,e);a.classGroupId=n},wz=(e,t,n,a)=>{if(kz(e)){fy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(hz(n,e))},Sz=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];fy(m,Uk(t,f),n,a)}},Uk=(e,t)=>{let n=e;const a=t.split(Vd),l=a.length;for(let o=0;o<l;o++){const u=a[o];let f=n.nextPart.get(u);f||(f=Ik(),n.nextPart.set(u,f)),n=f}return n},kz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,jz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,u)=>{n[o]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return l(o,u),u},set(o,u){o in n?n[o]=u:l(o,u)}}},pg="!",E1=":",Cz=[],N1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Ez=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let u=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const C=l[j];if(u===0&&f===0){if(C===E1){o.push(l.slice(m,j)),m=j+1;continue}if(C==="/"){h=j;continue}}C==="["?u++:C==="]"?u--:C==="("?f++:C===")"&&f--}const g=o.length===0?l:l.slice(m);let x=g,w=!1;g.endsWith(pg)?(x=g.slice(0,-1),w=!0):g.startsWith(pg)&&(x=g.slice(1),w=!0);const k=h&&h>m?h-m:void 0;return N1(o,w,x,k)};if(t){const l=t+E1,o=a;a=u=>u.startsWith(l)?o(u.slice(l.length)):N1(Cz,!1,u,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Nz=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 u=n[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(u)):l.push(u)}return l.length>0&&(l.sort(),a.push(...l)),a}},_z=e=>({cache:jz(e.cacheSize),parseClassName:Ez(e),sortModifiers:Nz(e),...pz(e)}),Tz=/\s+/,Az=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(Tz);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:x,hasImportantModifier:w,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 R=x.length===0?"":x.length===1?x[0]:o(x).join(":"),z=w?R+pg:R,M=z+E;if(u.indexOf(M)>-1)continue;u.push(M);const B=l(E,C);for(let O=0;O<B.length;++O){const D=B[O];u.push(z+D)}m=y+(m.length>0?" "+m:m)}return m},Rz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=Pk(n))&&(l&&(l+=" "),l+=a);return l},Pk=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Pk(e[a]))&&(n&&(n+=" "),n+=t);return n},zz=(e,...t)=>{let n,a,l,o;const u=m=>{const h=t.reduce((y,g)=>g(y),e());return n=_z(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=Az(m,n);return l(m,y),y};return o=u,(...m)=>o(Rz(...m))},Oz=[],tn=e=>{const t=n=>n[e]||Oz;return t.isThemeGetter=!0,t},Bk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$k=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Mz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Iz=/\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$/,Lz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Uz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,li=e=>Dz.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),si=e=>!!e&&Number.isInteger(Number(e)),ap=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),ya=e=>Mz.test(e),Fk=()=>!0,Bz=e=>Iz.test(e)&&!Lz.test(e),hy=()=>!1,$z=e=>Uz.test(e),Fz=e=>Pz.test(e),qz=e=>!Ee(e)&&!Ne(e),Hz=e=>Ri(e,Zk,hy),Ee=e=>Bk.test(e),nl=e=>Ri(e,Vk,Bz),_1=e=>Ri(e,Jz,Qe),Zz=e=>Ri(e,Kk,Fk),Vz=e=>Ri(e,Qk,hy),T1=e=>Ri(e,qk,hy),Qz=e=>Ri(e,Hk,Fz),vd=e=>Ri(e,Gk,$z),Ne=e=>$k.test(e),nu=e=>xl(e,Vk),Kz=e=>xl(e,Qk),A1=e=>xl(e,qk),Gz=e=>xl(e,Zk),Yz=e=>xl(e,Hk),bd=e=>xl(e,Gk,!0),Xz=e=>xl(e,Kk,!0),Ri=(e,t,n)=>{const a=Bk.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},xl=(e,t,n=!1)=>{const a=$k.exec(e);return a?a[1]?t(a[1]):n:!1},qk=e=>e==="position"||e==="percentage",Hk=e=>e==="image"||e==="url",Zk=e=>e==="length"||e==="size"||e==="bg-size",Vk=e=>e==="length",Jz=e=>e==="number",Qk=e=>e==="family-name",Kk=e=>e==="number"||e==="weight",Gk=e=>e==="shadow",Wz=()=>{const e=tn("color"),t=tn("font"),n=tn("text"),a=tn("font-weight"),l=tn("tracking"),o=tn("leading"),u=tn("breakpoint"),f=tn("container"),m=tn("spacing"),h=tn("radius"),y=tn("shadow"),g=tn("inset-shadow"),x=tn("text-shadow"),w=tn("drop-shadow"),k=tn("blur"),j=tn("perspective"),C=tn("aspect"),E=tn("ease"),R=tn("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...M(),Ne,Ee],O=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],U=()=>[Ne,Ee,m],V=()=>[li,"full","auto",...U()],F=()=>[si,"none","subgrid",Ne,Ee],ne=()=>["auto",{span:["full",si,Ne,Ee]},si,Ne,Ee],oe=()=>[si,"auto",Ne,Ee],Se=()=>["auto","min","max","fr",Ne,Ee],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...U()],re=()=>[li,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],ve=()=>[li,"screen","full","dvw","lvw","svw","min","max","fit",...U()],Re=()=>[li,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],_=()=>[e,Ne,Ee],L=()=>[...M(),A1,T1,{position:[Ne,Ee]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",Gz,Hz,{size:[Ne,Ee]}],q=()=>[ap,nu,nl],X=()=>["","none","full",h,Ne,Ee],ue=()=>["",Qe,nu,nl],xe=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Qe,ap,A1,T1],ee=()=>["","none",k,Ne,Ee],me=()=>["none",Qe,Ne,Ee],_e=()=>["none",Qe,Ne,Ee],Le=()=>[Qe,Ne,Ee],it=()=>[li,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ya],breakpoint:[ya],color:[Fk],container:[ya],"drop-shadow":[ya],ease:["in","out","in-out"],font:[qz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ya],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ya],shadow:[ya],spacing:["px",Qe],text:[ya],"text-shadow":[ya],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",li,Ee,Ne,C]}],container:["container"],columns:[{columns:[Qe,Ee,Ne,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:B()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[si,"auto",Ne,Ee]}],basis:[{basis:[li,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,li,"auto","initial","none",Ee]}],grow:[{grow:["",Qe,Ne,Ee]}],shrink:[{shrink:["",Qe,Ne,Ee]}],order:[{order:[si,"first","last","none",Ne,Ee]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Se()}],"auto-rows":[{"auto-rows":Se()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m: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":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],"inline-size":[{inline:["auto",...ve()]}],"min-inline-size":[{"min-inline":["auto",...ve()]}],"max-inline-size":[{"max-inline":["none",...ve()]}],"block-size":[{block:["auto",...Re()]}],"min-block-size":[{"min-block":["auto",...Re()]}],"max-block-size":[{"max-block":["none",...Re()]}],w:[{w:[f,"screen",...re()]}],"min-w":[{"min-w":[f,"screen","none",...re()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",n,nu,nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Xz,Zz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ap,Ee]}],"font-family":[{font:[Kz,Vz,t]}],"font-features":[{"font-features":[Ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ne,Ee]}],"line-clamp":[{"line-clamp":[Qe,"none",Ne,_1]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",Ne,Ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,Ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Ne,nl]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Qe,"auto",Ne,Ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ne,Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},si,Ne,Ee],radial:["",Ne,Ee],conic:[si,Ne,Ee]},Yz,Qz]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"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:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Ne,Ee]}],"outline-w":[{outline:["",Qe,nu,nl]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",y,bd,vd]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",g,bd,vd]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Qe,nl]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",x,bd,vd]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Qe,Ne,Ee]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"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":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[Ne,Ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ne,Ee]}],filter:[{filter:["","none",Ne,Ee]}],blur:[{blur:ee()}],brightness:[{brightness:[Qe,Ne,Ee]}],contrast:[{contrast:[Qe,Ne,Ee]}],"drop-shadow":[{"drop-shadow":["","none",w,bd,vd]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Qe,Ne,Ee]}],"hue-rotate":[{"hue-rotate":[Qe,Ne,Ee]}],invert:[{invert:["",Qe,Ne,Ee]}],saturate:[{saturate:[Qe,Ne,Ee]}],sepia:[{sepia:["",Qe,Ne,Ee]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,Ee]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Ne,Ee]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Ne,Ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Ne,Ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Ne,Ee]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Ne,Ee]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Ne,Ee]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Ne,Ee]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Ne,Ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,Ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Ne,Ee]}],ease:[{ease:["linear","initial",E,Ne,Ee]}],delay:[{delay:[Qe,Ne,Ee]}],animate:[{animate:["none",R,Ne,Ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ne,Ee]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[Ne,Ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ne,Ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ne,Ee]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Qe,nu,nl,_1]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},eO=zz(Wz);function Ae(...e){return eO(Mk(e))}function pl(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 tO(e){return je.delete(`/clients/${encodeURIComponent(e)}`)}function qu(){return je.get("/admin/agents/activity")}function Ei(){return je.get("/clients")}function my(e){return je.get(`/clients/${e}`)}function nO(e){return je.post(`/clients/${e}/disconnect`)}function rO(){return je.post("/connect-tokens")}const R1=e=>["agent-sessions",e];function aO(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.toolUseId!="string"||typeof t.name!="string"||t.status!=="pending"&&t.status!=="ok"&&t.status!=="error"?null:{toolUseId:t.toolUseId,name:t.name,args:t.args,status:t.status,durationMs:typeof t.durationMs=="number"?t.durationMs:void 0,resultPreview:typeof t.resultPreview=="string"?t.resultPreview:void 0}}function iO(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 lO(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Yk(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 je.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function sO(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 je.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}var z1=1,oO=.9,uO=.8,cO=.17,ip=.1,lp=.999,dO=.9999,fO=.99,hO=/[\\\/_+.#"@\[\(\{&]/,mO=/[\\\/_+.#"@\[\(\{&]/g,pO=/[\s-]/,Xk=/[\s-]/g;function gg(e,t,n,a,l,o,u){if(o===t.length)return l===e.length?z1:fO;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,x,w,k;h>=0;)g=gg(e,t,n,a,h+1,o+1,u),g>y&&(h===l?g*=z1:hO.test(e.charAt(h-1))?(g*=uO,w=e.slice(l,h-1).match(mO),w&&l>0&&(g*=Math.pow(lp,w.length))):pO.test(e.charAt(h-1))?(g*=oO,k=e.slice(l,h-1).match(Xk),k&&l>0&&(g*=Math.pow(lp,k.length))):(g*=cO,l>0&&(g*=Math.pow(lp,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=dO)),(g<ip&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(x=gg(e,t,n,a,h+1,o+2,u),x*ip>g&&(g=x*ip)),g>y&&(y=g),h=n.indexOf(m,h+1);return u[f]=y,y}function O1(e){return e.toLowerCase().replace(Xk," ")}function gO(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,gg(e,t,O1(e),O1(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 D1(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=D1(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():D1(e[l],null)}}}}function wl(...e){return b.useCallback(Ni(...e),e)}function yO(e,t){const n=b.createContext(t),a=o=>{const{children:u,...f}=o,m=b.useMemo(()=>f,Object.values(f));return c.jsx(n.Provider,{value:m,children:u})};a.displayName=e+"Provider";function l(o){const u=b.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function vO(e,t=[]){let n=[];function a(o,u){const f=b.createContext(u),m=n.length;n=[...n,u];const h=g=>{var E;const{scope:x,children:w,...k}=g,j=((E=x==null?void 0:x[e])==null?void 0:E[m])||f,C=b.useMemo(()=>k,Object.values(k));return c.jsx(j.Provider,{value:C,children:w})};h.displayName=o+"Provider";function y(g,x){var j;const w=((j=x==null?void 0:x[e])==null?void 0:j[m])||f,k=b.useContext(w);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(u=>b.createContext(u));return function(f){const m=(f==null?void 0:f[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,bO(l,...t)]}function bO(...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 u=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var Su=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},xO=Hg[" useId ".trim().toString()]||(()=>{}),wO=0;function ka(e){const[t,n]=b.useState(xO());return Su(()=>{n(a=>a??String(wO++))},[e]),t?`radix-${t}`:""}var SO=Hg[" useInsertionEffect ".trim().toString()]||Su;function kO({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,u]=jO({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=b.useRef(e!==void 0);b.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=b.useCallback(y=>{var g;if(f){const x=CO(y)?y(e):y;x!==e&&((g=u.current)==null||g.call(u,x))}else o(y)},[f,e,o,u]);return[m,h]}function jO({defaultProp:e,onChange:t}){const[n,a]=b.useState(e),l=b.useRef(n),o=b.useRef(t);return SO(()=>{o.current=t},[t]),b.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,a,o]}function CO(e){return typeof e=="function"}var py=PS();const EO=uf(py);function Jk(e){const t=NO(e),n=b.forwardRef((a,l)=>{const{children:o,...u}=a,f=b.Children.toArray(o),m=f.find(TO);if(m){const h=m.props.children,y=f.map(g=>g===m?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:g);return c.jsx(t,{...u,ref:l,children:b.isValidElement(h)?b.cloneElement(h,void 0,y):null})}return c.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function NO(e){const t=b.forwardRef((n,a)=>{const{children:l,...o}=n;if(b.isValidElement(l)){const u=RO(l),f=AO(o,l.props);return l.type!==b.Fragment&&(f.ref=a?Ni(a,u):u),b.cloneElement(l,f)}return b.Children.count(l)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _O=Symbol("radix.slottable");function TO(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_O}function AO(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 RO(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 zO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ea=zO.reduce((e,t)=>{const n=Jk(`Primitive.${t}`),a=b.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function OO(e,t){e&&py.flushSync(()=>e.dispatchEvent(t))}function ku(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function DO(e,t=globalThis==null?void 0:globalThis.document){const n=ku(e);b.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 MO="DismissableLayer",yg="dismissableLayer.update",IO="dismissableLayer.pointerDownOutside",LO="dismissableLayer.focusOutside",M1,Wk=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ej=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=b.useContext(Wk),[y,g]=b.useState(null),x=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=b.useState({}),k=wl(t,D=>g(D)),j=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=j.indexOf(C),R=y?j.indexOf(y):-1,z=h.layersWithOutsidePointerEventsDisabled.size>0,M=R>=E,B=BO(D=>{const U=D.target,V=[...h.branches].some(F=>F.contains(U));!M||V||(l==null||l(D),u==null||u(D),D.defaultPrevented||f==null||f())},x),O=$O(D=>{const U=D.target;[...h.branches].some(F=>F.contains(U))||(o==null||o(D),u==null||u(D),D.defaultPrevented||f==null||f())},x);return DO(D=>{R===h.layers.size-1&&(a==null||a(D),!D.defaultPrevented&&f&&(D.preventDefault(),f()))},x),b.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(M1=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),I1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=M1)}},[y,x,n,h]),b.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),I1())},[y,h]),b.useEffect(()=>{const D=()=>w({});return document.addEventListener(yg,D),()=>document.removeEventListener(yg,D)},[]),c.jsx(Ea.div,{...m,ref:k,style:{pointerEvents:z?M?"auto":"none":void 0,...e.style},onFocusCapture:Ci(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ci(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ci(e.onPointerDownCapture,B.onPointerDownCapture)})});ej.displayName=MO;var UO="DismissableLayerBranch",PO=b.forwardRef((e,t)=>{const n=b.useContext(Wk),a=b.useRef(null),l=wl(t,a);return b.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(Ea.div,{...e,ref:l})});PO.displayName=UO;function BO(e,t=globalThis==null?void 0:globalThis.document){const n=ku(e),a=b.useRef(!1),l=b.useRef(()=>{});return b.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){tj(IO,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},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function $O(e,t=globalThis==null?void 0:globalThis.document){const n=ku(e),a=b.useRef(!1);return b.useEffect(()=>{const l=o=>{o.target&&!a.current&&tj(LO,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 I1(){const e=new CustomEvent(yg);document.dispatchEvent(e)}function tj(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?OO(l,o):l.dispatchEvent(o)}var sp="focusScope.autoFocusOnMount",op="focusScope.autoFocusOnUnmount",L1={bubbles:!1,cancelable:!0},FO="FocusScope",nj=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=b.useState(null),h=ku(l),y=ku(o),g=b.useRef(null),x=wl(t,j=>m(j)),w=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(a){let j=function(z){if(w.paused||!f)return;const M=z.target;f.contains(M)?g.current=M:ci(g.current,{select:!0})},C=function(z){if(w.paused||!f)return;const M=z.relatedTarget;M!==null&&(f.contains(M)||ci(g.current,{select:!0}))},E=function(z){if(document.activeElement===document.body)for(const B of z)B.removedNodes.length>0&&ci(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",C);const R=new MutationObserver(E);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",C),R.disconnect()}}},[a,f,w.paused]),b.useEffect(()=>{if(f){P1.add(w);const j=document.activeElement;if(!f.contains(j)){const E=new CustomEvent(sp,L1);f.addEventListener(sp,h),f.dispatchEvent(E),E.defaultPrevented||(qO(KO(rj(f)),{select:!0}),document.activeElement===j&&ci(f))}return()=>{f.removeEventListener(sp,h),setTimeout(()=>{const E=new CustomEvent(op,L1);f.addEventListener(op,y),f.dispatchEvent(E),E.defaultPrevented||ci(j??document.body,{select:!0}),f.removeEventListener(op,y),P1.remove(w)},0)}}},[f,h,y,w]);const k=b.useCallback(j=>{if(!n&&!a||w.paused)return;const C=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,E=document.activeElement;if(C&&E){const R=j.currentTarget,[z,M]=HO(R);z&&M?!j.shiftKey&&E===M?(j.preventDefault(),n&&ci(z,{select:!0})):j.shiftKey&&E===z&&(j.preventDefault(),n&&ci(M,{select:!0})):E===R&&j.preventDefault()}},[n,a,w.paused]);return c.jsx(Ea.div,{tabIndex:-1,...u,ref:x,onKeyDown:k})});nj.displayName=FO;function qO(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ci(a,{select:t}),document.activeElement!==n)return}function HO(e){const t=rj(e),n=U1(t,e),a=U1(t.reverse(),e);return[n,a]}function rj(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 U1(e,t){for(const n of e)if(!ZO(n,{upTo:t}))return n}function ZO(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 VO(e){return e instanceof HTMLInputElement&&"select"in e}function ci(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&VO(e)&&t&&e.select()}}var P1=QO();function QO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=B1(e,t),e.unshift(t)},remove(t){var n;e=B1(e,t),(n=e[0])==null||n.resume()}}}function B1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function KO(e){return e.filter(t=>t.tagName!=="A")}var GO="Portal",aj=b.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=b.useState(!1);Su(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?EO.createPortal(c.jsx(Ea.div,{...a,ref:t}),u):null});aj.displayName=GO;function YO(e,t){return b.useReducer((n,a)=>t[n][a]??n,e)}var pf=e=>{const{present:t,children:n}=e,a=XO(t),l=typeof n=="function"?n({present:a.isPresent}):b.Children.only(n),o=wl(a.ref,JO(l));return typeof n=="function"||a.isPresent?b.cloneElement(l,{ref:o}):null};pf.displayName="Presence";function XO(e){const[t,n]=b.useState(),a=b.useRef(null),l=b.useRef(e),o=b.useRef("none"),u=e?"mounted":"unmounted",[f,m]=YO(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const h=xd(a.current);o.current=f==="mounted"?h:"none"},[f]),Su(()=>{const h=a.current,y=l.current;if(y!==e){const x=o.current,w=xd(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&x!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Su(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=w=>{const j=xd(a.current).includes(CSS.escape(w.animationName));if(w.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)})}},x=w=>{w.target===t&&(o.current=xd(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:b.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function xd(e){return(e==null?void 0:e.animationName)||"none"}function JO(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 up=0;function WO(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$1()),document.body.insertAdjacentElement("beforeend",e[1]??$1()),up++,()=>{up===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),up--}},[])}function $1(){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 Kr=function(){return Kr=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},Kr.apply(this,arguments)};function ij(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]]);return n}function e3(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,o;a<l;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var Ud="right-scroll-bar-position",Pd="width-before-scroll-bar",t3="with-scroll-bars-hidden",n3="--removed-body-scroll-bar-size";function cp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function r3(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var a3=typeof window<"u"?b.useLayoutEffect:b.useEffect,F1=new WeakMap;function i3(e,t){var n=r3(null,function(a){return e.forEach(function(l){return cp(l,a)})});return a3(function(){var a=F1.get(n);if(a){var l=new Set(a),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||cp(f,null)}),o.forEach(function(f){l.has(f)||cp(f,u)})}F1.set(n,e)},[e]),n}function l3(e){return e}function s3(e,t){t===void 0&&(t=l3);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 u=t(o,a);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(a=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var m=function(){var y=u;u=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){u.push(y),h()},filter:function(y){return u=u.filter(y),n}}}};return l}function o3(e){e===void 0&&(e={});var t=s3(null);return t.options=Kr({async:!0,ssr:!1},e),t}var lj=function(e){var t=e.sideCar,n=ij(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 b.createElement(a,Kr({},n))};lj.isSideCarExport=!0;function u3(e,t){return e.useMedium(t),lj}var sj=o3(),dp=function(){},gf=b.forwardRef(function(e,t){var n=b.useRef(null),a=b.useState({onScrollCapture:dp,onWheelCapture:dp,onTouchMoveCapture:dp}),l=a[0],o=a[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,x=e.sideCar,w=e.noRelative,k=e.noIsolation,j=e.inert,C=e.allowPinchZoom,E=e.as,R=E===void 0?"div":E,z=e.gapMode,M=ij(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=x,O=i3([n,t]),D=Kr(Kr({},M),l);return b.createElement(b.Fragment,null,y&&b.createElement(B,{sideCar:sj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:z}),u?b.cloneElement(b.Children.only(f),Kr(Kr({},D),{ref:O})):b.createElement(R,Kr({},D,{className:m,ref:O}),f))});gf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gf.classNames={fullWidth:Pd,zeroRight:Ud};var c3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function d3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=c3();return t&&e.setAttribute("nonce",t),e}function f3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function h3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var m3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=d3())&&(f3(t,n),h3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},p3=function(){var e=m3();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oj=function(){var e=p3(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},g3={left:0,top:0,right:0,gap:0},fp=function(e){return parseInt(e||"",10)||0},y3=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[fp(n),fp(a),fp(l)]},v3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return g3;var t=y3(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])}},b3=oj(),ws="data-scroll-locked",x3=function(e,t,n,a){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
271
|
+
.`.concat(t3,` {
|
|
272
|
+
overflow: hidden `).concat(a,`;
|
|
273
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
274
|
+
}
|
|
275
|
+
body[`).concat(ws,`] {
|
|
276
|
+
overflow: hidden `).concat(a,`;
|
|
277
|
+
overscroll-behavior: contain;
|
|
278
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
279
|
+
padding-left: `.concat(l,`px;
|
|
280
|
+
padding-top: `).concat(o,`px;
|
|
281
|
+
padding-right: `).concat(u,`px;
|
|
282
|
+
margin-left:0;
|
|
283
|
+
margin-top:0;
|
|
284
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
285
|
+
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.`).concat(Ud,` {
|
|
289
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.`).concat(Pd,` {
|
|
293
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.`).concat(Ud," .").concat(Ud,` {
|
|
297
|
+
right: 0 `).concat(a,`;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.`).concat(Pd," .").concat(Pd,` {
|
|
301
|
+
margin-right: 0 `).concat(a,`;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
body[`).concat(ws,`] {
|
|
305
|
+
`).concat(n3,": ").concat(f,`px;
|
|
306
|
+
}
|
|
307
|
+
`)},q1=function(){var e=parseInt(document.body.getAttribute(ws)||"0",10);return isFinite(e)?e:0},w3=function(){b.useEffect(function(){return document.body.setAttribute(ws,(q1()+1).toString()),function(){var e=q1()-1;e<=0?document.body.removeAttribute(ws):document.body.setAttribute(ws,e.toString())}},[])},S3=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;w3();var o=b.useMemo(function(){return v3(l)},[l]);return b.createElement(b3,{styles:x3(o,!t,l,n?"":"!important")})},vg=!1;if(typeof window<"u")try{var wd=Object.defineProperty({},"passive",{get:function(){return vg=!0,!0}});window.addEventListener("test",wd,wd),window.removeEventListener("test",wd,wd)}catch{vg=!1}var us=vg?{passive:!1}:!1,k3=function(e){return e.tagName==="TEXTAREA"},uj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!k3(e)&&n[t]==="visible")},j3=function(e){return uj(e,"overflowY")},C3=function(e){return uj(e,"overflowX")},H1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=cj(e,a);if(l){var o=dj(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},E3=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},N3=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},cj=function(e,t){return e==="v"?j3(t):C3(t)},dj=function(e,t){return e==="v"?E3(t):N3(t)},_3=function(e,t){return e==="h"&&t==="rtl"?-1:1},T3=function(e,t,n,a,l){var o=_3(e,window.getComputedStyle(t).direction),u=o*a,f=n.target,m=t.contains(f),h=!1,y=u>0,g=0,x=0;do{if(!f)break;var w=dj(e,f),k=w[0],j=w[1],C=w[2],E=j-C-o*k;(k||E)&&cj(e,f)&&(g+=E,x+=k);var R=f.parentNode;f=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(y&&Math.abs(g)<1||!y&&Math.abs(x)<1)&&(h=!0),h},Sd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Z1=function(e){return[e.deltaX,e.deltaY]},V1=function(e){return e&&"current"in e?e.current:e},A3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R3=function(e){return`
|
|
308
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
309
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
310
|
+
`)},z3=0,cs=[];function O3(e){var t=b.useRef([]),n=b.useRef([0,0]),a=b.useRef(),l=b.useState(z3++)[0],o=b.useState(oj)[0],u=b.useRef(e);b.useEffect(function(){u.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=e3([e.lockRef.current],(e.shards||[]).map(V1),!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=b.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var E=Sd(j),R=n.current,z="deltaX"in j?j.deltaX:R[0]-E[0],M="deltaY"in j?j.deltaY:R[1]-E[1],B,O=j.target,D=Math.abs(z)>Math.abs(M)?"h":"v";if("touches"in j&&D==="h"&&O.type==="range")return!1;var U=window.getSelection(),V=U&&U.anchorNode,F=V?V===O||V.contains(O):!1;if(F)return!1;var ne=H1(D,O);if(!ne)return!0;if(ne?B=D:(B=D==="v"?"h":"v",ne=H1(D,O)),!ne)return!1;if(!a.current&&"changedTouches"in j&&(z||M)&&(a.current=B),!B)return!0;var oe=a.current||B;return T3(oe,C,j,oe==="h"?z:M)},[]),m=b.useCallback(function(j){var C=j;if(!(!cs.length||cs[cs.length-1]!==o)){var E="deltaY"in C?Z1(C):Sd(C),R=t.current.filter(function(B){return B.name===C.type&&(B.target===C.target||C.target===B.shadowParent)&&A3(B.delta,E)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var z=(u.current.shards||[]).map(V1).filter(Boolean).filter(function(B){return B.contains(C.target)}),M=z.length>0?f(C,z[0]):!u.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),h=b.useCallback(function(j,C,E,R){var z={name:j,delta:C,target:E,should:R,shadowParent:D3(E)};t.current.push(z),setTimeout(function(){t.current=t.current.filter(function(M){return M!==z})},1)},[]),y=b.useCallback(function(j){n.current=Sd(j),a.current=void 0},[]),g=b.useCallback(function(j){h(j.type,Z1(j),j.target,f(j,e.lockRef.current))},[]),x=b.useCallback(function(j){h(j.type,Sd(j),j.target,f(j,e.lockRef.current))},[]);b.useEffect(function(){return cs.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",m,us),document.addEventListener("touchmove",m,us),document.addEventListener("touchstart",y,us),function(){cs=cs.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,us),document.removeEventListener("touchmove",m,us),document.removeEventListener("touchstart",y,us)}},[]);var w=e.removeScrollBar,k=e.inert;return b.createElement(b.Fragment,null,k?b.createElement(o,{styles:R3(l)}):null,w?b.createElement(S3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function D3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const M3=u3(sj,O3);var fj=b.forwardRef(function(e,t){return b.createElement(gf,Kr({},e,{ref:t,sideCar:M3}))});fj.classNames=gf.classNames;var I3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ds=new WeakMap,kd=new WeakMap,jd={},hp=0,hj=function(e){return e&&(e.host||hj(e.parentNode))},L3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=hj(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})},U3=function(e,t,n,a){var l=L3(t,Array.isArray(e)?e:[e]);jd[n]||(jd[n]=new WeakMap);var o=jd[n],u=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(x){if(f.has(x))y(x);else try{var w=x.getAttribute(a),k=w!==null&&w!=="false",j=(ds.get(x)||0)+1,C=(o.get(x)||0)+1;ds.set(x,j),o.set(x,C),u.push(x),j===1&&k&&kd.set(x,!0),C===1&&x.setAttribute(n,"true"),k||x.setAttribute(a,"true")}catch(E){console.error("aria-hidden: cannot operate on ",x,E)}})};return y(t),f.clear(),hp++,function(){u.forEach(function(g){var x=ds.get(g)-1,w=o.get(g)-1;ds.set(g,x),o.set(g,w),x||(kd.has(g)||g.removeAttribute(a),kd.delete(g)),w||g.removeAttribute(n)}),hp--,hp||(ds=new WeakMap,ds=new WeakMap,kd=new WeakMap,jd={})}},P3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=I3(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),U3(a,l,n,"aria-hidden")):function(){return null}},yf="Dialog",[mj]=vO(yf),[B3,Lr]=mj(yf),pj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=b.useRef(null),m=b.useRef(null),[h,y]=kO({prop:a,defaultProp:l??!1,onChange:o,caller:yf});return c.jsx(B3,{scope:t,triggerRef:f,contentRef:m,contentId:ka(),titleId:ka(),descriptionId:ka(),open:h,onOpenChange:y,onOpenToggle:b.useCallback(()=>y(g=>!g),[y]),modal:u,children:n})};pj.displayName=yf;var gj="DialogTrigger",$3=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(gj,n),o=wl(t,l.triggerRef);return c.jsx(Ea.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":vy(l.open),...a,ref:o,onClick:Ci(e.onClick,l.onOpenToggle)})});$3.displayName=gj;var gy="DialogPortal",[F3,yj]=mj(gy,{forceMount:void 0}),vj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Lr(gy,t);return c.jsx(F3,{scope:t,forceMount:n,children:b.Children.map(a,u=>c.jsx(pf,{present:n||o.open,children:c.jsx(aj,{asChild:!0,container:l,children:u})}))})};vj.displayName=gy;var Qd="DialogOverlay",bj=b.forwardRef((e,t)=>{const n=yj(Qd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(Qd,e.__scopeDialog);return o.modal?c.jsx(pf,{present:a||o.open,children:c.jsx(H3,{...l,ref:t})}):null});bj.displayName=Qd;var q3=Jk("DialogOverlay.RemoveScroll"),H3=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Qd,n);return c.jsx(fj,{as:q3,allowPinchZoom:!0,shards:[l.contentRef],children:c.jsx(Ea.div,{"data-state":vy(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),gl="DialogContent",xj=b.forwardRef((e,t)=>{const n=yj(gl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(gl,e.__scopeDialog);return c.jsx(pf,{present:a||o.open,children:o.modal?c.jsx(Z3,{...l,ref:t}):c.jsx(V3,{...l,ref:t})})});xj.displayName=gl;var Z3=b.forwardRef((e,t)=>{const n=Lr(gl,e.__scopeDialog),a=b.useRef(null),l=wl(t,n.contentRef,a);return b.useEffect(()=>{const o=a.current;if(o)return P3(o)},[]),c.jsx(wj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ci(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ci(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:Ci(e.onFocusOutside,o=>o.preventDefault())})}),V3=b.forwardRef((e,t)=>{const n=Lr(gl,e.__scopeDialog),a=b.useRef(!1),l=b.useRef(!1);return c.jsx(wj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.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 u=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),wj=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=Lr(gl,n),m=b.useRef(null),h=wl(t,m);return WO(),c.jsxs(c.Fragment,{children:[c.jsx(nj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:c.jsx(ej,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":vy(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Q3,{titleId:f.titleId}),c.jsx(G3,{contentRef:m,descriptionId:f.descriptionId})]})]})}),yy="DialogTitle",Sj=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(yy,n);return c.jsx(Ea.h2,{id:l.titleId,...a,ref:t})});Sj.displayName=yy;var kj="DialogDescription",jj=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(kj,n);return c.jsx(Ea.p,{id:l.descriptionId,...a,ref:t})});jj.displayName=kj;var Cj="DialogClose",Ej=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Cj,n);return c.jsx(Ea.button,{type:"button",...a,ref:t,onClick:Ci(e.onClick,()=>l.onOpenChange(!1))})});Ej.displayName=Cj;function vy(e){return e?"open":"closed"}var Nj="DialogTitleWarning",[YH,_j]=yO(Nj,{contentName:gl,titleName:yy,docsSlug:"dialog"}),Q3=({titleId:e})=>{const t=_j(Nj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
311
|
+
|
|
312
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
313
|
+
|
|
314
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},K3="DialogDescriptionWarning",G3=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_j(K3).contentName}}.`;return b.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},Tj=pj,Aj=vj,Rj=bj,zj=xj,Y3=Sj,X3=jj,J3=Ej,W3=Symbol.for("react.lazy"),Kd=Hg[" use ".trim().toString()];function eD(e){return typeof e=="object"&&e!==null&&"then"in e}function Oj(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===W3&&"_payload"in e&&eD(e._payload)}function Dj(e){const t=nD(e),n=b.forwardRef((a,l)=>{let{children:o,...u}=a;Oj(o)&&typeof Kd=="function"&&(o=Kd(o._payload));const f=b.Children.toArray(o),m=f.find(aD);if(m){const h=m.props.children,y=f.map(g=>g===m?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:g);return c.jsx(t,{...u,ref:l,children:b.isValidElement(h)?b.cloneElement(h,void 0,y):null})}return c.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var tD=Dj("Slot");function nD(e){const t=b.forwardRef((n,a)=>{let{children:l,...o}=n;if(Oj(l)&&typeof Kd=="function"&&(l=Kd(l._payload)),b.isValidElement(l)){const u=lD(l),f=iD(o,l.props);return l.type!==b.Fragment&&(f.ref=a?Ni(a,u):u),b.cloneElement(l,f)}return b.Children.count(l)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rD=Symbol("radix.slottable");function aD(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rD}function iD(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 lD(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 sD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Na=sD.reduce((e,t)=>{const n=Dj(`Primitive.${t}`),a=b.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),ru='[cmdk-group=""]',mp='[cmdk-group-items=""]',oD='[cmdk-group-heading=""]',Mj='[cmdk-item=""]',Q1=`${Mj}:not([aria-disabled="true"])`,bg="cmdk-item-select",ms="data-value",uD=(e,t,n)=>gO(e,t,n),Ij=b.createContext(void 0),Hu=()=>b.useContext(Ij),Lj=b.createContext(void 0),by=()=>b.useContext(Lj),Uj=b.createContext(void 0),Pj=b.forwardRef((e,t)=>{let n=ps(()=>{var P,T;return{search:"",value:(T=(P=e.value)!=null?P:e.defaultValue)!=null?T:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=ps(()=>new Set),l=ps(()=>new Map),o=ps(()=>new Map),u=ps(()=>new Set),f=Bj(e),{label:m,children:h,value:y,onValueChange:g,filter:x,shouldFilter:w,loop:k,disablePointerSelection:j=!1,vimBindings:C=!0,...E}=e,R=ka(),z=ka(),M=ka(),B=b.useRef(null),O=xD();yl(()=>{if(y!==void 0){let P=y.trim();n.current.value=P,D.emit()}},[y]),yl(()=>{O(6,Se)},[]);let D=b.useMemo(()=>({subscribe:P=>(u.current.add(P),()=>u.current.delete(P)),snapshot:()=>n.current,setState:(P,T,q)=>{var X,ue,xe,be;if(!Object.is(n.current[P],T)){if(n.current[P]=T,P==="search")oe(),F(),O(1,ne);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let fe=document.getElementById(M);fe?fe.focus():(X=document.getElementById(R))==null||X.focus()}if(O(7,()=>{var fe;n.current.selectedItemId=(fe=G())==null?void 0:fe.id,D.emit()}),q||O(5,Se),((ue=f.current)==null?void 0:ue.value)!==void 0){let fe=T??"";(be=(xe=f.current).onValueChange)==null||be.call(xe,fe);return}}D.emit()}},emit:()=>{u.current.forEach(P=>P())}}),[]),U=b.useMemo(()=>({value:(P,T,q)=>{var X;T!==((X=o.current.get(P))==null?void 0:X.value)&&(o.current.set(P,{value:T,keywords:q}),n.current.filtered.items.set(P,V(T,q)),O(2,()=>{F(),D.emit()}))},item:(P,T)=>(a.current.add(P),T&&(l.current.has(T)?l.current.get(T).add(P):l.current.set(T,new Set([P]))),O(3,()=>{oe(),F(),n.current.value||ne(),D.emit()}),()=>{o.current.delete(P),a.current.delete(P),n.current.filtered.items.delete(P);let q=G();O(4,()=>{oe(),(q==null?void 0:q.getAttribute("id"))===P&&ne(),D.emit()})}),group:P=>(l.current.has(P)||l.current.set(P,new Set),()=>{o.current.delete(P),l.current.delete(P)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:R,inputId:M,labelId:z,listInnerRef:B}),[]);function V(P,T){var q,X;let ue=(X=(q=f.current)==null?void 0:q.filter)!=null?X:uD;return P?ue(P,n.current.search,T):0}function F(){if(!n.current.search||f.current.shouldFilter===!1)return;let P=n.current.filtered.items,T=[];n.current.filtered.groups.forEach(X=>{let ue=l.current.get(X),xe=0;ue.forEach(be=>{let fe=P.get(be);xe=Math.max(fe,xe)}),T.push([X,xe])});let q=B.current;W().sort((X,ue)=>{var xe,be;let fe=X.getAttribute("id"),ee=ue.getAttribute("id");return((xe=P.get(ee))!=null?xe:0)-((be=P.get(fe))!=null?be:0)}).forEach(X=>{let ue=X.closest(mp);ue?ue.appendChild(X.parentElement===ue?X:X.closest(`${mp} > *`)):q.appendChild(X.parentElement===q?X:X.closest(`${mp} > *`))}),T.sort((X,ue)=>ue[1]-X[1]).forEach(X=>{var ue;let xe=(ue=B.current)==null?void 0:ue.querySelector(`${ru}[${ms}="${encodeURIComponent(X[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function ne(){let P=W().find(q=>q.getAttribute("aria-disabled")!=="true"),T=P==null?void 0:P.getAttribute(ms);D.setState("value",T||void 0)}function oe(){var P,T,q,X;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 be=(T=(P=o.current.get(xe))==null?void 0:P.value)!=null?T:"",fe=(X=(q=o.current.get(xe))==null?void 0:q.keywords)!=null?X:[],ee=V(be,fe);n.current.filtered.items.set(xe,ee),ee>0&&ue++}for(let[xe,be]of l.current)for(let fe of be)if(n.current.filtered.items.get(fe)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=ue}function Se(){var P,T,q;let X=G();X&&(((P=X.parentElement)==null?void 0:P.firstChild)===X&&((q=(T=X.closest(ru))==null?void 0:T.querySelector(oD))==null||q.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function G(){var P;return(P=B.current)==null?void 0:P.querySelector(`${Mj}[aria-selected="true"]`)}function W(){var P;return Array.from(((P=B.current)==null?void 0:P.querySelectorAll(Q1))||[])}function Z(P){let T=W()[P];T&&D.setState("value",T.getAttribute(ms))}function re(P){var T;let q=G(),X=W(),ue=X.findIndex(be=>be===q),xe=X[ue+P];(T=f.current)!=null&&T.loop&&(xe=ue+P<0?X[X.length-1]:ue+P===X.length?X[0]:X[ue+P]),xe&&D.setState("value",xe.getAttribute(ms))}function ve(P){let T=G(),q=T==null?void 0:T.closest(ru),X;for(;q&&!X;)q=P>0?vD(q,ru):bD(q,ru),X=q==null?void 0:q.querySelector(Q1);X?D.setState("value",X.getAttribute(ms)):re(P)}let Re=()=>Z(W().length-1),_=P=>{P.preventDefault(),P.metaKey?Re():P.altKey?ve(1):re(1)},L=P=>{P.preventDefault(),P.metaKey?Z(0):P.altKey?ve(-1):re(-1)};return b.createElement(Na.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:P=>{var T;(T=E.onKeyDown)==null||T.call(E,P);let q=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||q))switch(P.key){case"n":case"j":{C&&P.ctrlKey&&_(P);break}case"ArrowDown":{_(P);break}case"p":case"k":{C&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),Z(0);break}case"End":{P.preventDefault(),Re();break}case"Enter":{P.preventDefault();let X=G();if(X){let ue=new Event(bg);X.dispatchEvent(ue)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:SD},m),vf(e,P=>b.createElement(Lj.Provider,{value:D},b.createElement(Ij.Provider,{value:U},P))))}),cD=b.forwardRef((e,t)=>{var n,a;let l=ka(),o=b.useRef(null),u=b.useContext(Uj),f=Hu(),m=Bj(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:u==null?void 0:u.forceMount;yl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let y=$j(l,o,[e.value,e.children,o],e.keywords),g=by(),x=_i(O=>O.value&&O.value===y.current),w=_i(O=>h||f.filter()===!1?!0:O.search?O.filtered.items.get(l)>0:!0);b.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(bg,k),()=>O.removeEventListener(bg,k)},[w,e.onSelect,e.disabled]);function k(){var O,D;j(),(D=(O=m.current).onSelect)==null||D.call(O,y.current)}function j(){g.setState("value",y.current,!0)}if(!w)return null;let{disabled:C,value:E,onSelect:R,forceMount:z,keywords:M,...B}=e;return b.createElement(Na.div,{ref:Ni(o,t),...B,id:l,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!x,"data-disabled":!!C,"data-selected":!!x,onPointerMove:C||f.getDisablePointerSelection()?void 0:j,onClick:C?void 0:k},e.children)}),dD=b.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,u=ka(),f=b.useRef(null),m=b.useRef(null),h=ka(),y=Hu(),g=_i(w=>l||y.filter()===!1?!0:w.search?w.filtered.groups.has(u):!0);yl(()=>y.group(u),[]),$j(u,f,[e.value,e.heading,m]);let x=b.useMemo(()=>({id:u,forceMount:l}),[l]);return b.createElement(Na.div,{ref:Ni(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&b.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),vf(e,w=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},b.createElement(Uj.Provider,{value:x},w))))}),fD=b.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=b.useRef(null),o=_i(u=>!u.search);return!n&&!o?null:b.createElement(Na.div,{ref:Ni(l,t),...a,"cmdk-separator":"",role:"separator"})}),hD=b.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=by(),u=_i(h=>h.search),f=_i(h=>h.selectedItemId),m=Hu();return b.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),b.createElement(Na.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:u,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),mD=b.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=b.useRef(null),u=b.useRef(null),f=_i(h=>h.selectedItemId),m=Hu();return b.useEffect(()=>{if(u.current&&o.current){let h=u.current,y=o.current,g,x=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;y.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(g),x.unobserve(h)}}},[]),b.createElement(Na.div,{ref:Ni(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},vf(e,h=>b.createElement("div",{ref:Ni(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),pD=b.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:u,...f}=e;return b.createElement(Tj,{open:n,onOpenChange:a},b.createElement(Aj,{container:u},b.createElement(Rj,{"cmdk-overlay":"",className:l}),b.createElement(zj,{"aria-label":e.label,"cmdk-dialog":"",className:o},b.createElement(Pj,{ref:t,...f}))))}),gD=b.forwardRef((e,t)=>_i(n=>n.filtered.count===0)?b.createElement(Na.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),yD=b.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return b.createElement(Na.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},vf(e,u=>b.createElement("div",{"aria-hidden":!0},u)))}),Vn=Object.assign(Pj,{List:mD,Item:cD,Input:hD,Group:dD,Separator:fD,Dialog:pD,Empty:gD,Loading:yD});function vD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function bD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Bj(e){let t=b.useRef(e);return yl(()=>{t.current=e}),t}var yl=typeof window>"u"?b.useEffect:b.useLayoutEffect;function ps(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function _i(e){let t=by(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function $j(e,t,n,a=[]){let l=b.useRef(),o=Hu();return yl(()=>{var u;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(u=t.current)==null||u.setAttribute(ms,f),l.current=f}),l}var xD=()=>{let[e,t]=b.useState(),n=ps(()=>new Map);return yl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function wD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function vf({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(wD(t),{ref:t.ref},n(t.props.children)):n(t)}var SD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const nn=Tj,kD=Aj,Fj=b.forwardRef(({className:e,...t},n)=>c.jsx(Rj,{ref:n,className:Ae("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}));Fj.displayName="DialogOverlay";const Jt=b.forwardRef(({className:e,children:t,...n},a)=>c.jsxs(kD,{children:[c.jsx(Fj,{}),c.jsxs(zj,{ref:a,className:Ae("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,c.jsxs(J3,{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:[c.jsx(wu,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jt.displayName="DialogContent";function cn({className:e,...t}){return c.jsx("div",{className:Ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Rn({className:e,...t}){return c.jsx("div",{className:Ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const rn=b.forwardRef(({className:e,...t},n)=>c.jsx(Y3,{ref:n,className:Ae("text-subtitle leading-none tracking-tight",e),...t}));rn.displayName="DialogTitle";const xy=b.forwardRef(({className:e,...t},n)=>c.jsx(X3,{ref:n,className:Ae("text-body text-muted-foreground",e),...t}));xy.displayName="DialogDescription";const qj=b.forwardRef(({className:e,...t},n)=>c.jsx(Vn,{ref:n,className:Ae("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));qj.displayName=Vn.displayName;function jD({open:e,onOpenChange:t,children:n}){return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsx(Jt,{className:"overflow-hidden p-0 shadow-lg",children:c.jsx(qj,{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 Hj=b.forwardRef(({className:e,...t},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(cy,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(Vn.Input,{ref:n,className:Ae("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})]}));Hj.displayName=Vn.Input.displayName;const Zj=b.forwardRef(({className:e,...t},n)=>c.jsx(Vn.List,{ref:n,className:Ae("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Zj.displayName=Vn.List.displayName;const Vj=b.forwardRef((e,t)=>c.jsx(Vn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Vj.displayName=Vn.Empty.displayName;const Bd=b.forwardRef(({className:e,...t},n)=>c.jsx(Vn.Group,{ref:n,className:Ae("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}));Bd.displayName=Vn.Group.displayName;const xg=b.forwardRef(({className:e,...t},n)=>c.jsx(Vn.Separator,{ref:n,className:Ae("-mx-1 h-px bg-border",e),...t}));xg.displayName=Vn.Separator.displayName;const $d=b.forwardRef(({className:e,...t},n)=>c.jsx(Vn.Item,{ref:n,className:Ae("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}));$d.displayName=Vn.Item.displayName;function Zu(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 je.get(`/admin/agents${n?`?${n}`:""}`)}function Qj(){return je.get("/me/managed-agents")}function CD(e){return je.get(`/admin/agents/${encodeURIComponent(e)}`)}function ED(e){return je.post("/admin/agents",e)}function ND(e){return je.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function K1(e,t){return je.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function _D(e,t){return je.patch(`/admin/agents/${encodeURIComponent(e)}/rebind`,t)}function TD(e){return je.delete(`/admin/agents/${encodeURIComponent(e)}`)}function AD(e){return je.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function RD(e){return je.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function zD(e){return je.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function bf(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>Zu({limit:100}),staleTime:3e4}),{data:t}=Ve({queryKey:["managed-agents","name-map"],queryFn:Qj,staleTime:3e4});return b.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,a.displayName);if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,a.displayName);return a=>a?n.get(a)??a:"—"},[e,t])}function wy(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>Zu({limit:100}),staleTime:3e4}),{data:t}=Ve({queryKey:["managed-agents","name-map"],queryFn:Qj,staleTime:3e4});return b.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,{name:a.name,displayName:a.displayName});if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,{name:a.name,displayName:a.displayName});return a=>a?n.get(a)??null:null},[e,t])}const OD=[{path:"/",label:"Workspace"},{path:"/context",label:"Context"},{path:"/team",label:"Team"},{path:"/settings",label:"Settings"}];function DD({open:e,onOpenChange:t}){const n=zn(),a=bf(),{data:l}=Ve({queryKey:["activity"],queryFn:qu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=Ve({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await Yk(y.agentId);for(const x of g)h.push({agentId:y.agentId,session:x})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return c.jsxs(jD,{open:e,onOpenChange:t,children:[c.jsx(Hj,{placeholder:"Jump to agent, chat, or page…"}),c.jsxs(Zj,{children:[c.jsx(Vj,{children:"No results"}),o.length>0&&c.jsx(Bd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return c.jsxs($d,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[c.jsx(jR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{className:"flex-1 truncate",children:y}),c.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(xg,{}),c.jsx(Bd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return c.jsxs($d,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[c.jsx(uy,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{className:"flex-1 truncate",children:g}),c.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),c.jsx(xg,{}),c.jsx(Bd,{heading:"Pages",children:OD.map(h=>c.jsxs($d,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[c.jsx(UR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{children:h.label})]},h.path))})]})]})}function MD(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function ID(){var a;const{user:e}=zt(),{data:t}=Ve({queryKey:["clients"],queryFn:Ei,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=MD(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const LD=160;function UD(){const e=zn(),{rows:t,firstHostname:n}=ID();if(t.length===0)return null;const a=t.length>1,l=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return c.jsxs("button",{type:"button",onClick:()=>e("/settings/computers"),title:l,"aria-label":l,className:"inline-flex items-center cursor-pointer text-body font-medium",style:{gap:8,height:26,padding:"0 var(--sp-2_5) 0 var(--sp-2_25)",borderRadius:999,border:0,outline:"var(--hairline) solid color-mix(in oklch, var(--state-error) 38%, transparent)",outlineOffset:-1,background:"color-mix(in oklch, var(--state-error) 14%, transparent)",color:"color-mix(in oklch, var(--state-error) 80%, var(--fg))",minWidth:0},children:[c.jsx(PD,{}),a?c.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[c.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):c.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[c.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:LD,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),c.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function PD(){return c.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[c.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),c.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-error)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]})}function Vu(e){return c.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),c.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),c.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),c.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),c.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),c.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),c.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),c.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),c.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),c.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function G1(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 je.get(`/admin/notifications${n?`?${n}`:""}`)}function BD(e){return je.post(`/admin/notifications/${e}/read`)}function $D(){return je.post("/admin/notifications/read-all")}const FD={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 qD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function HD({notification:e,onClick:t,clickable:n}){const a=(FD[e.type]??e.type).toString(),l=qD(e.severity),o=n??!0;return c.jsxs("button",{type:"button",onClick:t,className:Ae("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[c.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[c.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:pl(e.createdAt)})]}),c.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function ZD(){var w;const[e,t]=b.useState(!1),[n,a]=b.useState(null),l=b.useRef(null),o=zn(),u=an(),{data:f}=Ve({queryKey:["notifications","bell"],queryFn:()=>G1({limit:8}),refetchInterval:1e4}),{data:m}=Ve({queryKey:["notifications","unread-count"],queryFn:()=>G1({read:!1,limit:100}),refetchInterval:1e4}),h=((w=m==null?void 0:m.items)==null?void 0:w.length)??0,y=h>0,g=b.useCallback(async k=>{k.read||(BD(k.id).catch(()=>{}),u.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,u]),x=b.useCallback(async()=>{a(null);try{await $D(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return c.jsxs("div",{className:"relative",children:[c.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:[c.jsx(SR,{className:"h-4 w-4"}),y&&c.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&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),c.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:[c.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&c.jsx("button",{type:"button",onClick:x,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&c.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}),c.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?c.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=>c.jsx(HD,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function VD(){if(typeof window>"u")return"light";const e=window.localStorage.getItem("theme");return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function QD(){const[e,t]=b.useState(VD);return b.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),c.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"?c.jsx(tz,{className:"h-4 w-4"}):c.jsx(QR,{className:"h-4 w-4"})})}function KD(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function Y1({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?c.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):c.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:c.jsx("span",{className:"text-subtitle font-semibold",children:KD(t)})})}const X1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,J1=Mk,GD=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return J1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,u=Object.keys(l).map(h=>{const y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const x=X1(y)||X1(g);return l[h][x]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,x]=y;return x===void 0||(h[g]=x),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,y)=>{let{class:g,className:x,...w}=y;return Object.entries(w).every(k=>{let[j,C]=k;return Array.isArray(C)?C.includes({...o,...f}[j]):{...o,...f}[j]===C})?[...h,g,x]:h},[]);return J1(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},YD=GD("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"}}),ge=b.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const u=a?tD:"button";return c.jsx(u,{className:Ae(YD({variant:t,size:n,className:e})),ref:o,...l})});ge.displayName="Button";const _t=b.forwardRef(({className:e,type:t,...n},a)=>c.jsx("input",{type:t,className:Ae("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}));_t.displayName="Input";function XD({action:e,onClose:t}){const n=e!==null;return c.jsx(nn,{open:n,onOpenChange:a=>!a&&t(),children:c.jsxs(Jt,{children:[c.jsxs(cn,{children:[c.jsx(rn,{children:e==="join"?"Join a team":"Create a new team"}),c.jsx(xy,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&c.jsx(WD,{onDone:t}),e==="join"&&c.jsx(eM,{onDone:t})]})})}function JD(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function WD({onDone:e}){const{adoptTokens:t}=zt(),n=zn(),[a,l]=b.useState(""),[o,u]=b.useState(null),[f,m]=b.useState(!1);b.useEffect(()=>{l(""),u(null),m(!1)},[]);const h=async y=>{y.preventDefault();const g=a.trim();if(g){m(!0),u(null);try{const x=await je.post("/me/organizations",{name:JD(g),displayName:g});await t(x.tokens),e(),n("/",{replace:!0})}catch(x){u(x instanceof Error?x.message:"Failed to create team")}finally{m(!1)}}};return c.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),c.jsx(_t,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.target.value),placeholder:"Acme Robotics",autoFocus:!0}),c.jsx(ge,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function eM({onDone:e}){const{adoptTokens:t}=zt(),n=zn(),[a,l]=b.useState(""),[o,u]=b.useState(null),[f,m]=b.useState(!1);b.useEffect(()=>{l(""),u(null),m(!1)},[]);const h=async y=>{if(y.preventDefault(),!!a.trim()){m(!0),u(null);try{const g=a.trim(),x=/\/invite\/([^/?#]+)/.exec(g),w=(x==null?void 0:x[1])??g,k=await je.post("/me/organizations/join",{token:w});await t(k.tokens),e(),n("/",{replace:!0})}catch(g){u(g instanceof Error?g.message:"Failed to join team")}finally{m(!1)}}};return c.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),c.jsx(_t,{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}),c.jsx(ge,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function tM(){var B,O;const{organizationId:e,role:t,user:n,selectOrganization:a,logout:l}=zt(),o=zn(),[u,f]=b.useState([]),[m,h]=b.useState(!1),[y,g]=b.useState(null),x=b.useRef(null);b.useEffect(()=>{(async()=>{try{const D=await je.get("/me/organizations");f(D)}catch{}})()},[]),b.useEffect(()=>{const D=V=>{m&&x.current&&!x.current.contains(V.target)&&h(!1)},U=V=>{m&&V.key==="Escape"&&h(!1)};return window.addEventListener("mousedown",D),window.addEventListener("keydown",U),()=>{window.removeEventListener("mousedown",D),window.removeEventListener("keydown",U)}},[m]);const w=(n==null?void 0:n.displayName)??"User",k=(n==null?void 0:n.username)??"",j=(n==null?void 0:n.avatarUrl)??null,C=u.find(D=>D.id===e)??null,E=(C==null?void 0:C.role)??(t==="admin"||t==="member"?t:null),R=async D=>{if(D===e){h(!1);return}try{await a(D),h(!1),o("/",{replace:!0})}catch{}},z=()=>{h(!1),g("create")},M=()=>{h(!1),g("join")};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:x,className:"relative","data-testid":"user-menu",children:[c.jsx("button",{type:"button","aria-label":`User menu, ${w}`,"aria-haspopup":"menu","aria-expanded":m,onClick:()=>h(D=>!D),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:m?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:c.jsx(Y1,{src:j,name:w,size:28})}),m&&c.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[c.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[c.jsx(Y1,{src:j,name:w,size:32}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:w}),k&&k!==w&&c.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",k]})]})]}),u.length>0&&c.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[c.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Current team"}),u.length===1?c.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[c.jsx("span",{style:{width:14,display:"inline-flex"},children:c.jsx(jr,{className:"h-3.5 w-3.5"})}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:(B=u[0])==null?void 0:B.displayName}),c.jsx(W1,{role:((O=u[0])==null?void 0:O.role)??E})]}):c.jsx("div",{children:u.map(D=>c.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void R(D.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:[c.jsx("span",{style:{width:14,display:"inline-flex"},children:D.id===e?c.jsx(jr,{className:"h-3.5 w-3.5"}):null}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:D.displayName}),c.jsx(W1,{role:D.role})]},D.id))})]}),c.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[c.jsxs("button",{type:"button",role:"menuitem",onClick:z,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:[c.jsx(Mr,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Create new team"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:M,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[c.jsx(Ok,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Join with invite link"})]})]}),c.jsx("div",{className:"py-1",children:c.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),l()},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[c.jsx(HR,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Sign out"})]})})]})]}),c.jsx(XD,{action:y,onClose:()=>g(null)})]})}function W1({role:e}){return e!=="admin"&&e!=="member"?null:c.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",color:e==="admin"?"var(--accent-dim)":"var(--fg-3)",border:"var(--hairline) solid var(--border)",background:e==="admin"?"var(--accent-bg)":"var(--bg-sunken)"},children:e})}const nM=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/context",label:"Context",end:!1,kbd:"⌘2"},{to:"/team",label:"Team",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}];function rM(){const[e,t]=b.useState(!1),n=Zn(),a=n.pathname==="/"||n.search.includes("a=");return b.useEffect(()=>{const l=o=>{(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),t(u=>!u))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),c.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[c.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"1fr auto 1fr",gap:"var(--sp-3)",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[c.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[c.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[c.jsx(Vu,{width:16,height:18,style:{color:"var(--fg)"}}),c.jsx("span",{className:"text-title",style:{color:"var(--fg)"},children:"First Tree"})]}),c.jsx(UD,{})]}),c.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:nM.map(l=>c.jsx(hf,{to:l.to,end:l.end,style:{pointerEvents:"auto"},className:({isActive:o})=>Ae("inline-flex items-center transition-colors",o?"":"hover:text-[var(--fg)]"),children:({isActive:o})=>c.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:o?"var(--fg)":"var(--fg-3)",background:o?"var(--bg-hover)":"transparent"},children:[l.label,o&&c.jsx("span",{className:"kbd",children:l.kbd})]})},l.to))}),c.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[c.jsxs("button",{type:"button",onClick:()=>t(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--fg)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--fg-3)"},children:[c.jsx(cy,{className:"h-4 w-4"}),c.jsx("span",{children:"Jump to…"}),c.jsx("span",{className:"kbd",children:"⌘K"})]}),c.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),c.jsx(ZD,{}),c.jsx(QD,{}),c.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),c.jsx(tM,{})]})]}),c.jsx(DD,{open:e,onOpenChange:t}),a?c.jsx(Ps,{}):c.jsx("main",{className:"flex-1 overflow-auto",children:c.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:c.jsx(Ps,{})})})]})}function se(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=u.prototype,y=Object.keys(h);for(let g=0;g<y.length;g++){const x=y[g];x in f||(f[x]=h[x].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function u(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}class Ss extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Kj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Gj={};function Ti(e){return Gj}function Yj(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 wg(e,t){return typeof t=="bigint"?t.toString():t}function xf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Sy(e){return e==null}function ky(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function aM(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,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const ew=Symbol("evaluating");function ht(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==ew)return a===void 0&&(a=ew,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function Sl(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 tw(e){return JSON.stringify(e)}function iM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Xj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ju(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const lM=xf(()=>{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 $s(e){if(ju(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ju(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Jj(e){return $s(e)?{...e}:Array.isArray(e)?[...e]:e}const sM=new Set(["string","number","symbol"]);function Fs(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 ze(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 oM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const uM={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 cM(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 u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return Sl(this,"shape",u),u},checks:[]});return Oi(e,o)}function dM(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 u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return Sl(this,"shape",u),u},checks:[]});return Oi(e,o)}function fM(e,t){if(!$s(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=zi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Sl(this,"shape",o),o}});return Oi(e,l)}function hM(e,t){if(!$s(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 Sl(this,"shape",a),a}});return Oi(e,n)}function mM(e,t){const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Sl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Oi(e,n)}function pM(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=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 Sl(this,"shape",m),m},checks:[]});return Oi(t,u)}function gM(e,t,n){const a=zi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const u in n){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)o[u]=new e({type:"nonoptional",innerType:l[u]});return Sl(this,"shape",o),o}});return Oi(t,a)}function ys(e,t=0){var n;if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(((n=e.issues[a])==null?void 0:n.continue)!==!0)return!0;return!1}function vs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Cd(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ai(e,t,n){var l,o,u,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=Cd((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??Cd((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Cd((m=n.customError)==null?void 0:m.call(n,e))??Cd((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 jy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Cu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const Wj=(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,wg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},eC=se("$ZodError",Wj),tC=se("$ZodError",Wj,{Parent:Error});function yM(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 vM(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(u=>a({issues:u}));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 u=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(o))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return a(e),n}const Cy=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new Ss;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>Ai(m,o,Ti())));throw Xj(f,l==null?void 0:l.callee),f}return u.value},Ey=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>Ai(m,o,Ti())));throw Xj(f,l==null?void 0:l.callee),f}return u.value},wf=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 Ss;return o.issues.length?{success:!1,error:new(e??eC)(o.issues.map(u=>Ai(u,l,Ti())))}:{success:!0,data:o.value}},bM=wf(tC),Sf=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(u=>Ai(u,l,Ti())))}:{success:!0,data:o.value}},xM=Sf(tC),wM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Cy(e)(t,n,l)},SM=e=>(t,n,a)=>Cy(e)(t,n,a),kM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ey(e)(t,n,l)},jM=e=>async(t,n,a)=>Ey(e)(t,n,a),CM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return wf(e)(t,n,l)},EM=e=>(t,n,a)=>wf(e)(t,n,a),NM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sf(e)(t,n,l)},_M=e=>async(t,n,a)=>Sf(e)(t,n,a),TM=/^[cC][^\s-]{8,}$/,AM=/^[0-9a-z]+$/,RM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zM=/^[0-9a-vA-V]{20}$/,OM=/^[A-Za-z0-9]{27}$/,DM=/^[a-zA-Z0-9_-]{21}$/,MM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,IM=/^([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})$/,nw=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)$/,LM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,UM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function PM(){return new RegExp(UM,"u")}const BM=/^(?:(?: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])$/,$M=/^(([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}|:))$/,FM=/^((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])$/,qM=/^(([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])$/,HM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nC=/^[A-Za-z0-9_-]*$/,ZM=/^\+[1-9]\d{6,14}$/,rC="(?:(?:\\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])))",VM=new RegExp(`^${rC}$`);function aC(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 QM(e){return new RegExp(`^${aC(e)}$`)}function KM(e){const t=aC({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(`^${rC}T(?:${a})$`)}const GM=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}$`)},YM=/^-?\d+$/,iC=/^-?\d+(?:\.\d+)?$/,XM=/^(?:true|false)$/i,JM=/^[^A-Z]*$/,WM=/^[^a-z]*$/,Qn=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),lC={number:"number",bigint:"bigint",object:"date"},sC=se("$ZodCheckLessThan",(e,t)=>{Qn.init(e,t);const n=lC[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})}}),oC=se("$ZodCheckGreaterThan",(e,t)=>{Qn.init(e,t);const n=lC[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?l.minimum=t.value:l.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),e4=se("$ZodCheckMultipleOf",(e,t)=>{Qn.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):aM(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})}}),t4=se("$ZodCheckNumberFormat",(e,t)=>{var u;Qn.init(e,t),t.format=t.format||"float64";const n=(u=t.format)==null?void 0:u.includes("int"),a=n?"int":"number",[l,o]=uM[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=YM)}),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})}}),n4=se("$ZodCheckMaxLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Sy(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 u=jy(l);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),r4=se("$ZodCheckMinLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Sy(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 u=jy(l);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),a4=se("$ZodCheckLengthEquals",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Sy(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 u=jy(l),f=o>t.length;a.issues.push({origin:u,...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})}}),kf=se("$ZodCheckStringFormat",(e,t)=>{var n,a;Qn.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=()=>{})}),i4=se("$ZodCheckRegex",(e,t)=>{kf.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})}}),l4=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=JM),kf.init(e,t)}),s4=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=WM),kf.init(e,t)}),o4=se("$ZodCheckIncludes",(e,t)=>{Qn.init(e,t);const n=Fs(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})}}),u4=se("$ZodCheckStartsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`^${Fs(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})}}),c4=se("$ZodCheckEndsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`.*${Fs(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})}}),d4=se("$ZodCheckOverwrite",(e,t)=>{Qn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class f4{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(`
|
|
315
|
+
`).filter(u=>u),l=Math.min(...a.map(u=>u.length-u.trimStart().length)),o=a.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of o)this.content.push(u)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
|
|
316
|
+
`))}}const h4={major:4,minor:3,patch:6},Dt=se("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=h4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const u of o._zod.onattach)u(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let y=ys(f),g;for(const x of m){if(x._zod.def.when){if(!x._zod.def.when(f))continue}else if(y)continue;const w=f.issues.length,k=x._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Ss;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==w&&(y||(y=ys(f,w)))});else{if(f.issues.length===w)continue;y||(y=ys(f,w))}}return g?g.then(()=>f):f},u=(f,m,h)=>{if(ys(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new Ss;return y.then(g=>e._zod.parse(g,h))}return e._zod.parse(y,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const y=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>u(g,f,m)):u(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Ss;return h.then(y=>o(y,a,m))}return o(h,a,m)}}ht(e,"~standard",()=>({validate:o=>{var u;try{const f=bM(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return xM(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}))}),Ny=se("$ZodString",(e,t)=>{var n;Dt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??GM(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}}),Ot=se("$ZodStringFormat",(e,t)=>{kf.init(e,t),Ny.init(e,t)}),m4=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=IM),Ot.init(e,t)}),p4=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=nw(a))}else t.pattern??(t.pattern=nw());Ot.init(e,t)}),g4=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=LM),Ot.init(e,t)}),y4=se("$ZodURL",(e,t)=>{Ot.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})}}}),v4=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=PM()),Ot.init(e,t)}),b4=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=DM),Ot.init(e,t)}),x4=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=TM),Ot.init(e,t)}),w4=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=AM),Ot.init(e,t)}),S4=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=RM),Ot.init(e,t)}),k4=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zM),Ot.init(e,t)}),j4=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=OM),Ot.init(e,t)}),C4=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=KM(t)),Ot.init(e,t)}),E4=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=VM),Ot.init(e,t)}),N4=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=QM(t)),Ot.init(e,t)}),_4=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=MM),Ot.init(e,t)}),T4=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=BM),Ot.init(e,t),e._zod.bag.format="ipv4"}),A4=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$M),Ot.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})}}}),R4=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=FM),Ot.init(e,t)}),z4=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=qM),Ot.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 u=Number(o);if(`${u}`!==o)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function uC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const O4=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=HM),Ot.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{uC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function D4(e){if(!nC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return uC(n)}const M4=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nC),Ot.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{D4(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),I4=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ZM),Ot.init(e,t)});function L4(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 U4=se("$ZodJWT",(e,t)=>{Ot.init(e,t),e._zod.check=n=>{L4(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),cC=se("$ZodNumber",(e,t)=>{Dt.init(e,t),e._zod.pattern=e._zod.bag.pattern??iC,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}}),P4=se("$ZodNumberFormat",(e,t)=>{t4.init(e,t),cC.init(e,t)}),B4=se("$ZodBoolean",(e,t)=>{Dt.init(e,t),e._zod.pattern=XM,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}}),$4=se("$ZodUnknown",(e,t)=>{Dt.init(e,t),e._zod.parse=n=>n}),F4=se("$ZodNever",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function rw(e,t,n){e.issues.length&&t.issues.push(...vs(n,e.issues)),t.value[n]=e.value}const q4=se("$ZodArray",(e,t)=>{Dt.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 u=0;u<l.length;u++){const f=l[u],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>rw(h,n,u))):rw(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function Gd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...vs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function dC(e){var a,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=oM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function fC(e,t,n,a,l,o){const u=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){u.push(g);continue}const x=m.run({value:t[g],issues:[]},a);x instanceof Promise?e.push(x.then(w=>Gd(w,n,g,t,y))):Gd(x,n,g,t,y)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const H4=se("$ZodObject",(e,t)=>{Dt.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=xf(()=>dC(t));ht(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=ju,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=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=u.shape;for(const x of u.keys){const w=g[x],k=w._zod.optout==="optional",j=w._zod.run({value:h[x],issues:[]},m);j instanceof Promise?y.push(j.then(C=>Gd(C,f,x,h,k))):Gd(j,f,x,h,k)}return o?fC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),Z4=se("$ZodObjectJIT",(e,t)=>{H4.init(e,t);const n=e._zod.parse,a=xf(()=>dC(t)),l=x=>{var z;const w=new f4(["shape","payload","ctx"]),k=a.value,j=M=>{const B=tw(M);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};w.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const M of k.keys)C[M]=`key_${E++}`;w.write("const newResult = {};");for(const M of k.keys){const B=C[M],O=tw(M),D=x[M],U=((z=D==null?void 0:D._zod)==null?void 0:z.optout)==="optional";w.write(`const ${B} = ${j(M)};`),U?w.write(`
|
|
317
|
+
if (${B}.issues.length) {
|
|
318
|
+
if (${O} in input) {
|
|
319
|
+
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
320
|
+
...iss,
|
|
321
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
322
|
+
})));
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (${B}.value === undefined) {
|
|
327
|
+
if (${O} in input) {
|
|
328
|
+
newResult[${O}] = undefined;
|
|
329
|
+
}
|
|
330
|
+
} else {
|
|
331
|
+
newResult[${O}] = ${B}.value;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
`):w.write(`
|
|
335
|
+
if (${B}.issues.length) {
|
|
336
|
+
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
337
|
+
...iss,
|
|
338
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
339
|
+
})));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (${B}.value === undefined) {
|
|
343
|
+
if (${O} in input) {
|
|
344
|
+
newResult[${O}] = undefined;
|
|
345
|
+
}
|
|
346
|
+
} else {
|
|
347
|
+
newResult[${O}] = ${B}.value;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
`)}w.write("payload.value = newResult;"),w.write("return payload;");const R=w.compile();return(M,B)=>R(x,M,B)};let o;const u=ju,f=!Gj.jitless,h=f&&lM.value,y=t.catchall;let g;e._zod.parse=(x,w)=>{g??(g=a.value);const k=x.value;return u(k)?f&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(o||(o=l(t.shape)),x=o(x,w),y?fC([],k,x,w,g,e):x):n(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),x)}});function aw(e,t,n,a){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!ys(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(u=>Ai(u,a,Ti())))}),t)}const hC=se("$ZodUnion",(e,t)=>{Dt.init(e,t),ht(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),ht(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ht(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),ht(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=>ky(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 u=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),u=!0;else{if(h.issues.length===0)return h;f.push(h)}}return u?Promise.all(f).then(m=>aw(m,l,e,o)):aw(f,l,e,o)}}),V4=se("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hC.init(e,t);const n=e._zod.parse;ht(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=xf(()=>{var u;const l=t.options,o=new Map;for(const f of l){const m=(u=f._zod.propValues)==null?void 0:u[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const u=l.value;if(!ju(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=a.value.get(u==null?void 0:u[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),l)}}),Q4=se("$ZodIntersection",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),u=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>iw(n,m,h)):iw(n,o,u)}});function Sg(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($s(e)&&$s(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 u=Sg(e[o],t[o]);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};l[o]=u.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const l=e[a],o=t[a],u=Sg(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function iw(e,t,n){const a=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const o=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),ys(e))return e;const u=Sg(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const K4=se("$ZodRecord",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!$s(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...vs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...vs(h,y.issues)),n.value[h]=y.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&iC.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=>Ai(g,a,Ti())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...vs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...vs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),G4=se("$ZodEnum",(e,t)=>{Dt.init(e,t);const n=Yj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>sM.has(typeof l)).map(l=>typeof l=="string"?Fs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return a.has(u)||l.issues.push({code:"invalid_value",values:n,input:u,inst:e}),l}}),Y4=se("$ZodLiteral",(e,t)=>{if(Dt.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"?Fs(a):a?Fs(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}}),X4=se("$ZodTransform",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Kj(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(n.value=u,n));if(l instanceof Promise)throw new Ss;return n.value=l,n}});function lw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const mC=se("$ZodOptional",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ht(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ht(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ky(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=>lw(o,n.value)):lw(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),J4=se("$ZodExactOptional",(e,t)=>{mC.init(e,t),ht(e._zod,"values",()=>t.innerType._zod.values),ht(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),W4=se("$ZodNullable",(e,t)=>{Dt.init(e,t),ht(e._zod,"optin",()=>t.innerType._zod.optin),ht(e._zod,"optout",()=>t.innerType._zod.optout),ht(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ky(n.source)}|null)$`):void 0}),ht(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),e5=se("$ZodDefault",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",ht(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=>sw(o,t)):sw(l,t)}});function sw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const t5=se("$ZodPrefault",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",ht(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))}),n5=se("$ZodNonOptional",(e,t)=>{Dt.init(e,t),ht(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=>ow(o,e)):ow(l,e)}});function ow(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 r5=se("$ZodCatch",(e,t)=>{Dt.init(e,t),ht(e._zod,"optin",()=>t.innerType._zod.optin),ht(e._zod,"optout",()=>t.innerType._zod.optout),ht(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(u=>Ai(u,a,Ti()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ai(o,a,Ti()))},input:n.value}),n.issues=[]),n)}}),a5=se("$ZodPipe",(e,t)=>{Dt.init(e,t),ht(e._zod,"values",()=>t.in._zod.values),ht(e._zod,"optin",()=>t.in._zod.optin),ht(e._zod,"optout",()=>t.out._zod.optout),ht(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(u=>Ed(u,t.in,a)):Ed(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>Ed(o,t.out,a)):Ed(l,t.out,a)}});function Ed(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const i5=se("$ZodReadonly",(e,t)=>{Dt.init(e,t),ht(e._zod,"propValues",()=>t.innerType._zod.propValues),ht(e._zod,"values",()=>t.innerType._zod.values),ht(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),ht(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(uw):uw(l)}});function uw(e){return e.value=Object.freeze(e.value),e}const l5=se("$ZodCustom",(e,t)=>{Qn.init(e,t),Dt.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=>cw(o,n,a,e));cw(l,n,a,e)}});function cw(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(Cu(l))}}var dw;class s5{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 o5(){return new s5}(dw=globalThis).__zod_globalRegistry??(dw.__zod_globalRegistry=o5());const cu=globalThis.__zod_globalRegistry;function u5(e,t){return new e({type:"string",...ze(t)})}function c5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function fw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function d5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function f5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function h5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function m5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function p5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function g5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function y5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function v5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function b5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function x5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function w5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function S5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function k5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function j5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function C5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function E5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function N5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function _5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function T5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function A5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function R5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function z5(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function O5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function D5(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function M5(e,t){return new e({type:"number",checks:[],...ze(t)})}function I5(e,t){return new e({type:"number",coerce:!0,checks:[],...ze(t)})}function L5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function U5(e,t){return new e({type:"boolean",...ze(t)})}function P5(e){return new e({type:"unknown"})}function B5(e,t){return new e({type:"never",...ze(t)})}function hw(e,t){return new sC({check:"less_than",...ze(t),value:e,inclusive:!1})}function pp(e,t){return new sC({check:"less_than",...ze(t),value:e,inclusive:!0})}function mw(e,t){return new oC({check:"greater_than",...ze(t),value:e,inclusive:!1})}function gp(e,t){return new oC({check:"greater_than",...ze(t),value:e,inclusive:!0})}function pw(e,t){return new e4({check:"multiple_of",...ze(t),value:e})}function pC(e,t){return new n4({check:"max_length",...ze(t),maximum:e})}function Yd(e,t){return new r4({check:"min_length",...ze(t),minimum:e})}function gC(e,t){return new a4({check:"length_equals",...ze(t),length:e})}function $5(e,t){return new i4({check:"string_format",format:"regex",...ze(t),pattern:e})}function F5(e){return new l4({check:"string_format",format:"lowercase",...ze(e)})}function q5(e){return new s4({check:"string_format",format:"uppercase",...ze(e)})}function H5(e,t){return new o4({check:"string_format",format:"includes",...ze(t),includes:e})}function Z5(e,t){return new u4({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function V5(e,t){return new c4({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function Xs(e){return new d4({check:"overwrite",tx:e})}function Q5(e){return Xs(t=>t.normalize(e))}function K5(){return Xs(e=>e.trim())}function G5(){return Xs(e=>e.toLowerCase())}function Y5(){return Xs(e=>e.toUpperCase())}function X5(){return Xs(e=>iM(e))}function J5(e,t,n){return new e({type:"array",element:t,...ze(n)})}function W5(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function eI(e){const t=tI(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Cu(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(Cu(l))}},e(n.value,n)));return t}function tI(e,t){const n=new Qn({check:"custom",...ze(t)});return n._zod.check=e,n}function yC(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??cu,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Xt(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 u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)u.schema=f;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,x);else{const k=u.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,x)}const w=e._zod.parent;w&&(u.ref||(u.ref=w),Xt(w,t,x),t.seen.get(w).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&_n(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function vC(e,t){var u,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const y of e.seen.entries()){const g=(u=e.metadataRegistry.get(y[0]))==null?void 0:u.id;if(g){const x=a.get(g);if(x&&x!==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??(z=>z);if(C)return{ref:E(C)};const R=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=R,{defId:R,ref:`${E("__shared")}#/${g}/${R}`}}if(y[1]===n)return{ref:"#"};const w=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:w+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:x,defId:w}=l(y);g.def={...g.schema},w&&(g.defId=w);const k=g.schema;for(const j in k)delete k[j];k.$ref=x};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>
|
|
351
|
+
|
|
352
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const w=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&w){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function bC(e,t){var u,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,x={...g},w=y.ref;if(y.ref=null,w){a(w);const j=e.seen.get(w),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,x),h._zod.parent===w)for(const R in g)R==="$ref"||R==="allOf"||R in x||delete g[R];if(C.$ref&&j.def)for(const R in g)R==="$ref"||R==="allOf"||R in j.def&&JSON.stringify(g[R])===JSON.stringify(j.def[R])&&delete g[R]}const k=h._zod.parent;if(k&&k!==w){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const 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,(u=e.external)!=null&&u.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(o[y.defId]=y.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Xd(t,"input",e.processors),output:Xd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function _n(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return _n(a.element,n);if(a.type==="set")return _n(a.valueType,n);if(a.type==="lazy")return _n(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return _n(a.innerType,n);if(a.type==="intersection")return _n(a.left,n)||_n(a.right,n);if(a.type==="record"||a.type==="map")return _n(a.keyType,n)||_n(a.valueType,n);if(a.type==="pipe")return _n(a.in,n)||_n(a.out,n);if(a.type==="object"){for(const l in a.shape)if(_n(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(_n(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(_n(l,n))return!0;return!!(a.rest&&_n(a.rest,n))}return!1}const nI=(e,t={})=>n=>{const a=yC({...n,processors:t});return Xt(e,a),vC(a,e),bC(a,e)},Xd=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},u=yC({...l??{},target:o,io:t,processors:n});return Xt(e,u),vC(u,e),bC(u,e)},rI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},aI=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:u,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof u=="number"&&(l.maxLength=u),f&&(l.format=rI[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}))])}},iI=(e,t,n,a)=>{const l=n,{minimum:o,maximum:u,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof u=="number"&&(l.maximum=u,typeof h=="number"&&t.target!=="draft-04"&&(h<=u?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},lI=(e,t,n,a)=>{n.type="boolean"},sI=(e,t,n,a)=>{n.not={}},oI=(e,t,n,a)=>{},uI=(e,t,n,a)=>{const l=e._zod.def,o=Yj(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},cI=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const u of l.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(u))}else o.push(u);if(o.length!==0)if(o.length===1){const u=o[0];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),o.every(u=>typeof u=="boolean")&&(n.type="boolean"),o.every(u=>u===null)&&(n.type="null"),n.enum=o},dI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},fI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hI=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Xt(o.element,t,{...a,path:[...a.path,"items"]})},mI=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const y in u)l.properties[y]=Xt(u[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Xt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},pI=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Xt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},gI=(e,t,n,a)=>{const l=e._zod.def,o=Xt(l.left,t,{...a,path:[...a.path,"allOf",0]}),u=Xt(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(u)?u.allOf:[u]];n.allOf=m},yI=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const u=o.keyType,f=u._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Xt(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=Xt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Xt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=u._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},vI=(e,t,n,a)=>{const l=e._zod.def,o=Xt(l.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},bI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},xI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},wI=(e,t,n,a)=>{const l=e._zod.def;Xt(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)))},SI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},kI=(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;Xt(o,t,a);const u=t.seen.get(e);u.ref=o},jI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},xC=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},CI=se("ZodISODateTime",(e,t)=>{C4.init(e,t),It.init(e,t)});function EI(e){return R5(CI,e)}const NI=se("ZodISODate",(e,t)=>{E4.init(e,t),It.init(e,t)});function _I(e){return z5(NI,e)}const TI=se("ZodISOTime",(e,t)=>{N4.init(e,t),It.init(e,t)});function AI(e){return O5(TI,e)}const RI=se("ZodISODuration",(e,t)=>{_4.init(e,t),It.init(e,t)});function zI(e){return D5(RI,e)}const OI=(e,t)=>{eC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>vM(e,n)},flatten:{value:n=>yM(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,wg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,wg,2)}},isEmpty:{get(){return e.issues.length===0}}})},Er=se("ZodError",OI,{Parent:Error}),DI=Cy(Er),MI=Ey(Er),II=wf(Er),LI=Sf(Er),UI=wM(Er),PI=SM(Er),BI=kM(Er),$I=jM(Er),FI=CM(Er),qI=EM(Er),HI=NM(Er),ZI=_M(Er),Mt=se("ZodType",(e,t)=>(Dt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Xd(e,"input"),output:Xd(e,"output")}}),e.toJSONSchema=nI(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)=>DI(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>II(e,n,a),e.parseAsync=async(n,a)=>MI(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>LI(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>UI(e,n,a),e.decode=(n,a)=>PI(e,n,a),e.encodeAsync=async(n,a)=>BI(e,n,a),e.decodeAsync=async(n,a)=>$I(e,n,a),e.safeEncode=(n,a)=>FI(e,n,a),e.safeDecode=(n,a)=>qI(e,n,a),e.safeEncodeAsync=async(n,a)=>HI(e,n,a),e.safeDecodeAsync=async(n,a)=>ZI(e,n,a),e.refine=(n,a)=>e.check(LL(n,a)),e.superRefine=n=>e.check(UL(n)),e.overwrite=n=>e.check(Xs(n)),e.optional=()=>vw(e),e.exactOptional=()=>jL(e),e.nullable=()=>bw(e),e.nullish=()=>vw(bw(e)),e.nonoptional=n=>AL(e,n),e.array=()=>un(e),e.or=n=>kC([e,n]),e.and=n=>bL(e,n),e.transform=n=>jg(e,jC(n)),e.default=n=>NL(e,n),e.prefault=n=>TL(e,n),e.catch=n=>zL(e,n),e.pipe=n=>jg(e,n),e.readonly=()=>ML(e),e.describe=n=>{const a=e.clone();return cu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=cu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cu.get(e);const a=e.clone();return cu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),wC=se("_ZodString",(e,t)=>{Ny.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>aI(e,a,l);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check($5(...a)),e.includes=(...a)=>e.check(H5(...a)),e.startsWith=(...a)=>e.check(Z5(...a)),e.endsWith=(...a)=>e.check(V5(...a)),e.min=(...a)=>e.check(Yd(...a)),e.max=(...a)=>e.check(pC(...a)),e.length=(...a)=>e.check(gC(...a)),e.nonempty=(...a)=>e.check(Yd(1,...a)),e.lowercase=a=>e.check(F5(a)),e.uppercase=a=>e.check(q5(a)),e.trim=()=>e.check(K5()),e.normalize=(...a)=>e.check(Q5(...a)),e.toLowerCase=()=>e.check(G5()),e.toUpperCase=()=>e.check(Y5()),e.slugify=()=>e.check(X5())}),VI=se("ZodString",(e,t)=>{Ny.init(e,t),wC.init(e,t),e.email=n=>e.check(c5(QI,n)),e.url=n=>e.check(p5(KI,n)),e.jwt=n=>e.check(A5(uL,n)),e.emoji=n=>e.check(g5(GI,n)),e.guid=n=>e.check(fw(gw,n)),e.uuid=n=>e.check(d5(Nd,n)),e.uuidv4=n=>e.check(f5(Nd,n)),e.uuidv6=n=>e.check(h5(Nd,n)),e.uuidv7=n=>e.check(m5(Nd,n)),e.nanoid=n=>e.check(y5(YI,n)),e.guid=n=>e.check(fw(gw,n)),e.cuid=n=>e.check(v5(XI,n)),e.cuid2=n=>e.check(b5(JI,n)),e.ulid=n=>e.check(x5(WI,n)),e.base64=n=>e.check(N5(lL,n)),e.base64url=n=>e.check(_5(sL,n)),e.xid=n=>e.check(w5(eL,n)),e.ksuid=n=>e.check(S5(tL,n)),e.ipv4=n=>e.check(k5(nL,n)),e.ipv6=n=>e.check(j5(rL,n)),e.cidrv4=n=>e.check(C5(aL,n)),e.cidrv6=n=>e.check(E5(iL,n)),e.e164=n=>e.check(T5(oL,n)),e.datetime=n=>e.check(EI(n)),e.date=n=>e.check(_I(n)),e.time=n=>e.check(AI(n)),e.duration=n=>e.check(zI(n))});function A(e){return u5(VI,e)}const It=se("ZodStringFormat",(e,t)=>{Ot.init(e,t),wC.init(e,t)}),QI=se("ZodEmail",(e,t)=>{g4.init(e,t),It.init(e,t)}),gw=se("ZodGUID",(e,t)=>{m4.init(e,t),It.init(e,t)}),Nd=se("ZodUUID",(e,t)=>{p4.init(e,t),It.init(e,t)}),KI=se("ZodURL",(e,t)=>{y4.init(e,t),It.init(e,t)}),GI=se("ZodEmoji",(e,t)=>{v4.init(e,t),It.init(e,t)}),YI=se("ZodNanoID",(e,t)=>{b4.init(e,t),It.init(e,t)}),XI=se("ZodCUID",(e,t)=>{x4.init(e,t),It.init(e,t)}),JI=se("ZodCUID2",(e,t)=>{w4.init(e,t),It.init(e,t)}),WI=se("ZodULID",(e,t)=>{S4.init(e,t),It.init(e,t)}),eL=se("ZodXID",(e,t)=>{k4.init(e,t),It.init(e,t)}),tL=se("ZodKSUID",(e,t)=>{j4.init(e,t),It.init(e,t)}),nL=se("ZodIPv4",(e,t)=>{T4.init(e,t),It.init(e,t)}),rL=se("ZodIPv6",(e,t)=>{A4.init(e,t),It.init(e,t)}),aL=se("ZodCIDRv4",(e,t)=>{R4.init(e,t),It.init(e,t)}),iL=se("ZodCIDRv6",(e,t)=>{z4.init(e,t),It.init(e,t)}),lL=se("ZodBase64",(e,t)=>{O4.init(e,t),It.init(e,t)}),sL=se("ZodBase64URL",(e,t)=>{M4.init(e,t),It.init(e,t)}),oL=se("ZodE164",(e,t)=>{I4.init(e,t),It.init(e,t)}),uL=se("ZodJWT",(e,t)=>{U4.init(e,t),It.init(e,t)}),_y=se("ZodNumber",(e,t)=>{cC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>iI(e,a,l),e.gt=(a,l)=>e.check(mw(a,l)),e.gte=(a,l)=>e.check(gp(a,l)),e.min=(a,l)=>e.check(gp(a,l)),e.lt=(a,l)=>e.check(hw(a,l)),e.lte=(a,l)=>e.check(pp(a,l)),e.max=(a,l)=>e.check(pp(a,l)),e.int=a=>e.check(yw(a)),e.safe=a=>e.check(yw(a)),e.positive=a=>e.check(mw(0,a)),e.nonnegative=a=>e.check(gp(0,a)),e.negative=a=>e.check(hw(0,a)),e.nonpositive=a=>e.check(pp(0,a)),e.multipleOf=(a,l)=>e.check(pw(a,l)),e.step=(a,l)=>e.check(pw(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 Fe(e){return M5(_y,e)}const cL=se("ZodNumberFormat",(e,t)=>{P4.init(e,t),_y.init(e,t)});function yw(e){return L5(cL,e)}const dL=se("ZodBoolean",(e,t)=>{B4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>lI(e,n,a)});function Ir(e){return U5(dL,e)}const fL=se("ZodUnknown",(e,t)=>{$4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>oI()});function wt(){return P5(fL)}const hL=se("ZodNever",(e,t)=>{F4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>sI(e,n,a)});function mL(e){return B5(hL,e)}const pL=se("ZodArray",(e,t)=>{q4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>hI(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(Yd(n,a)),e.nonempty=n=>e.check(Yd(1,n)),e.max=(n,a)=>e.check(pC(n,a)),e.length=(n,a)=>e.check(gC(n,a)),e.unwrap=()=>e.element});function un(e,t){return J5(pL,e,t)}const gL=se("ZodObject",(e,t)=>{Z4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>mI(e,n,a,l),ht(e,"shape",()=>t.shape),e.keyof=()=>Pe(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:wt()}),e.loose=()=>e.clone({...e._zod.def,catchall:wt()}),e.strict=()=>e.clone({...e._zod.def,catchall:mL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>fM(e,n),e.safeExtend=n=>hM(e,n),e.merge=n=>mM(e,n),e.pick=n=>cM(e,n),e.omit=n=>dM(e,n),e.partial=(...n)=>pM(CC,e,n[0]),e.required=(...n)=>gM(EC,e,n[0])});function ie(e,t){const n={type:"object",shape:e??{},...ze(t)};return new gL(n)}const SC=se("ZodUnion",(e,t)=>{hC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>pI(e,n,a,l),e.options=t.options});function kC(e,t){return new SC({type:"union",options:e,...ze(t)})}const yL=se("ZodDiscriminatedUnion",(e,t)=>{SC.init(e,t),V4.init(e,t)});function Ty(e,t,n){return new yL({type:"union",options:t,discriminator:e,...ze(n)})}const vL=se("ZodIntersection",(e,t)=>{Q4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>gI(e,n,a,l)});function bL(e,t){return new vL({type:"intersection",left:e,right:t})}const xL=se("ZodRecord",(e,t)=>{K4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>yI(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function $t(e,t,n){return new xL({type:"record",keyType:e,valueType:t,...ze(n)})}const kg=se("ZodEnum",(e,t)=>{G4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>uI(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 u of a)if(n.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new kg({...t,checks:[],...ze(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const u of a)if(n.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new kg({...t,checks:[],...ze(l),entries:o})}});function Pe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new kg({type:"enum",entries:n,...ze(t)})}const wL=se("ZodLiteral",(e,t)=>{Y4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>cI(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 Yt(e,t){return new wL({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const SL=se("ZodTransform",(e,t)=>{X4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>fI(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Kj(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Cu(o,n.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(Cu(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function jC(e){return new SL({type:"transform",transform:e})}const CC=se("ZodOptional",(e,t)=>{mC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>xC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function vw(e){return new CC({type:"optional",innerType:e})}const kL=se("ZodExactOptional",(e,t)=>{J4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>xC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function jL(e){return new kL({type:"optional",innerType:e})}const CL=se("ZodNullable",(e,t)=>{W4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>vI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function bw(e){return new CL({type:"nullable",innerType:e})}const EL=se("ZodDefault",(e,t)=>{e5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>xI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function NL(e,t){return new EL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Jj(t)}})}const _L=se("ZodPrefault",(e,t)=>{t5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>wI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function TL(e,t){return new _L({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Jj(t)}})}const EC=se("ZodNonOptional",(e,t)=>{n5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>bI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function AL(e,t){return new EC({type:"nonoptional",innerType:e,...ze(t)})}const RL=se("ZodCatch",(e,t)=>{r5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>SI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function zL(e,t){return new RL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const OL=se("ZodPipe",(e,t)=>{a5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>kI(e,n,a,l),e.in=t.in,e.out=t.out});function jg(e,t){return new OL({type:"pipe",in:e,out:t})}const DL=se("ZodReadonly",(e,t)=>{i5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>jI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function ML(e){return new DL({type:"readonly",innerType:e})}const IL=se("ZodCustom",(e,t)=>{l5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>dI(e,n)});function LL(e,t={}){return W5(IL,e,t)}function UL(e){return eI(e)}function PL(e,t){return jg(jC(e),t)}const yp={custom:"custom"};function Qu(e){return I5(_y,e)}const BL=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function $L(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function NC(e,t){const n=$L(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(BL)){const u=o[1];if(!u)continue;const f=a.get(u.toLowerCase());f&&l.add(f)}return[...l]}const FL=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,xw="/";function _C(e){return!e||typeof e!="string"||e.length>256||!FL.test(e)?"/":e}const qL={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},TC=Pe(["feishu","slack","kael"]),AC=Pe(["active","inactive"]);ie({platform:TC,agentId:A().min(1),credentials:$t(A(),wt()),status:AC.default("active")});ie({agentId:A().min(1).optional(),credentials:$t(A(),wt()).optional(),status:AC.optional()});ie({id:Fe(),platform:A(),agentId:A(),hasCredentials:Ir(),status:A(),createdAt:A(),updatedAt:A()});const HL=Pe(["code","reverse_token","oauth","manual"]);ie({appId:A().min(1),appSecret:A().min(1)});ie({platform:TC,externalUserId:A().min(1),agentId:A().min(1),boundVia:HL.default("manual"),displayName:A().max(200).optional()});ie({id:Fe(),platform:A(),externalUserId:A(),agentId:A(),boundVia:A().nullable(),displayName:A().nullable(),createdAt:A()});ie({feishuUserId:A().min(1),displayName:A().max(200).optional()});ie({configId:Fe(),platform:A(),agentId:A(),appId:A(),connected:Ir(),lastActiveAt:A().nullable()});const RC=Pe(["online","offline"]),zC=Pe(["idle","working","blocked","error"]);Pe(["active","suspended","evicted"]);const ZL=Pe(["active","suspended"]);ie({chatId:A().min(1),state:ZL});ie({runtimeState:zC});ie({agentId:A().min(1),runtimeType:A().max(50),runtimeVersion:A().max(50).optional()});Pe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);ie({agentId:A(),status:RC,connectedAt:A().nullable(),lastSeenAt:A(),clientId:A().nullable().optional(),runtimeType:A().nullable().optional(),runtimeVersion:A().nullable().optional(),runtimeState:zC.nullable().optional(),activeSessions:Fe().int().nullable().optional(),totalSessions:Fe().int().nullable().optional(),runtimeUpdatedAt:A().nullable().optional()});ie({total:Fe().int(),running:Fe().int(),byState:ie({idle:Fe().int(),working:Fe().int(),blocked:Fe().int(),error:Fe().int()}),clients:Fe().int()});const Jd={CLAUDE_CODE:"claude-code",CODEX:"codex"},jf=Pe(["claude-code","codex"]),Cf=Pe(["human","personal_assistant","autonomous_agent"]),ww={PRIVATE:"private",ORGANIZATION:"organization"},Ay=Pe(["private","organization"]),VL=Pe(["admin-api","portal"]);Pe(["active","suspended"]);const Cg=/^[a-z0-9][a-z0-9_-]{0,63}$/,bs=64,QL=["admin","agent","first-tree","hub","me","null","system","undefined"],KL=new Set(QL);function Eg(e){return KL.has(e)}ie({name:A().min(1).max(64).regex(Cg,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!Eg(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:Cf,displayName:A().min(1).max(200).optional(),delegateMention:A().max(100).optional(),organizationId:A().min(1).max(100).optional(),source:VL.optional(),visibility:Ay.optional(),metadata:$t(A(),wt()).optional(),managerId:A().optional(),clientId:A().min(1).max(100).optional(),runtimeProvider:jf.optional()});ie({type:Cf.optional(),displayName:A().min(1).max(200).optional(),delegateMention:A().max(100).nullable().optional(),visibility:Ay.optional(),metadata:$t(A(),wt()).optional(),managerId:A().nullable().optional(),clientId:A().min(1).max(100).nullable().optional()});ie({clientId:A().min(1).max(100),runtimeProvider:jf,force:Ir().optional()});ie({uuid:A(),name:A().nullable(),organizationId:A(),type:Cf,displayName:A(),delegateMention:A().nullable(),inboxId:A(),status:A(),source:A().nullable().optional(),visibility:Ay,metadata:$t(A(),wt()),managerId:A().nullable(),clientId:A().nullable(),runtimeProvider:jf,presenceStatus:RC.optional(),createdAt:A(),updatedAt:A()});ie({repo:A().nullable(),branch:A().nullable()});ie({type:Yt("agent:pinned"),agentId:A(),name:A().nullable(),displayName:A(),agentType:Cf,runtimeProvider:jf});const GL=32e3,Ry=/^[a-z0-9][a-z0-9_-]{0,63}$/i,YL=/^[A-Z][A-Z0-9_]*$/,XL=ie({append:A().max(GL).default("")}),JL=ie({name:A().regex(Ry,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Yt("stdio"),command:A().min(1),args:un(A()).optional()}),WL=ie({name:A().regex(Ry,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Yt("http"),url:A().url(),headers:$t(A(),A()).optional()}),e6=ie({name:A().regex(Ry,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Yt("sse"),url:A().url(),headers:$t(A(),A()).optional()}),t6=Ty("transport",[JL,WL,e6]),n6=ie({key:A().regex(YL,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:A(),sensitive:Ir().default(!1)}),r6=ie({url:A().min(1),ref:A().min(1).optional(),localPath:A().min(1).optional()}),Ef=ie({prompt:XL.default({append:""}),model:A().default("opus"),mcpServers:un(t6).default([]),env:un(n6).default([]),gitRepos:un(r6).default([])}),a6=Ef.extend({kind:Yt("claude-code")}),i6=Ef.extend({kind:Yt("codex")}),l6=Ty("kind",[a6,i6]),s6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:yp.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,u)=>{a.has(o.key)&&t.addIssue({code:yp.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??ef(o.url);f&&(l.has(f)&&t.addIssue({code:yp.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},OC=PL(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,l6).superRefine((e,t)=>{s6(e,t)}),o6=ie({agentId:A(),version:Fe().int().positive(),payload:OC,updatedAt:A(),updatedBy:A()});ie({expectedVersion:Fe().int().positive(),payload:Ef.partial()});ie({payload:Ef.partial()});ie({current:o6,next:OC,diff:un(ie({path:A(),op:Pe(["add","remove","replace"]),before:wt().optional(),after:wt().optional()}))});const Wd="***";function ef(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}ie({username:A().min(1),password:A().min(1)});ie({accessToken:A(),refreshToken:A()});ie({refreshToken:A().min(1)});ie({token:A().min(1)});ie({token:A(),expiresIn:Fe(),command:A()});const u6=Pe(["direct","group","thread"]);ie({type:u6,topic:A().max(500).optional(),participantIds:un(A()).min(1),metadata:$t(A(),wt()).optional()});const DC=ie({agentId:A(),role:A(),mode:A(),joinedAt:A()});DC.extend({name:A().nullable(),displayName:A(),type:A()});const c6=ie({id:A(),organizationId:A(),type:A(),topic:A().nullable(),lifecyclePolicy:A().nullable().optional(),metadata:$t(A(),wt()),createdAt:A(),updatedAt:A()});c6.extend({participants:un(DC),title:A(),firstMessagePreview:A().nullable()});ie({topic:A().trim().max(500).nullable()});ie({agentId:A().min(1),mode:Pe(["full","mention_only"]).default("full")});ie({agentId:A().min(1)});const d6=Pe(["connected","disconnected"]),f6=Pe(["ok","expired"]);ie({id:A(),userId:A().nullable(),status:d6,authState:f6,sdkVersion:A().max(50).nullable(),hostname:A().max(100).nullable(),os:A().max(50).nullable(),agentCount:Fe().int().min(0),connectedAt:A().nullable(),lastSeenAt:A(),metadata:$t(A(),wt()).nullable()});const h6=ie({wsInboxDeliver:Ir().default(!1)}).partial();ie({clientId:A().min(1).max(100),hostname:A().max(100).optional(),os:A().max(50).optional(),sdkVersion:A().max(50).optional(),wireCapabilities:h6.optional()});ie({clientId:A(),previousUserId:A().nullable(),unpinnedAgentCount:Fe().int().nonnegative()});const m6=Pe(["ok","missing","unauthenticated","error"]),p6=Pe(["api_key","oauth","auth_json","none"]),g6=ie({state:m6,available:Ir(),authenticated:Ir(),sdkVersion:A().nullable().optional(),authMethod:p6,error:A().nullable().optional(),detectedAt:A()}),y6=$t(A(),g6);ie({capabilities:y6});ie({limit:Qu().int().min(1).max(100).default(20),cursor:A().optional()});const v6=["image/png","image/jpeg","image/gif","image/webp"],zy=Pe(v6);ie({data:A().min(1),mimeType:zy,filename:A().min(1),size:Fe().int().nonnegative().optional(),imageId:A().uuid().optional()});ie({imageId:A().uuid(),mimeType:zy,filename:A().min(1),size:Fe().int().nonnegative().optional()});ie({type:Yt("image_payload"),imageId:A().uuid(),chatId:A(),base64:A().min(1),mimeType:zy,filename:A().min(1),size:Fe().int().nonnegative().optional()});const Oy=Pe(["hub_ui","cli","feishu","github","api"]),MC=Pe(["text","markdown","card","reference","file","task"]);ie({format:MC.default("text"),content:wt(),metadata:$t(A(),wt()).optional(),inReplyTo:A().optional(),replyToInbox:A().optional(),replyToChat:A().optional(),source:Oy.optional()});ie({format:MC.default("text"),content:wt(),metadata:$t(A(),wt()).optional(),replyToInbox:A().optional(),replyToChat:A().optional(),source:Oy.optional()});const b6=ie({id:A(),chatId:A(),senderId:A(),format:A(),content:wt(),metadata:$t(A(),wt()),replyToInbox:A().nullable(),replyToChat:A().nullable(),inReplyTo:A().nullable(),source:Oy.nullable(),createdAt:A()}),x6=ie({senderId:A(),chatId:A(),replyToChat:A().nullable()}).nullable(),w6=Pe(["full","mention_only"]),S6=ie({id:A(),senderId:A(),format:A(),content:wt(),metadata:$t(A(),wt()).default({}),createdAt:A()}),IC=b6.extend({configVersion:Fe().int().positive(),recipientMode:w6.default("full"),inReplyToSnapshot:x6.default(null),precedingMessages:un(S6).default([])});Pe(["pending","delivered","acked","failed"]);const k6=ie({id:Fe(),inboxId:A(),messageId:A(),chatId:A().nullable(),status:A(),retryCount:Fe(),createdAt:A(),deliveredAt:A().nullable(),ackedAt:A().nullable()});k6.extend({message:IC});ie({limit:Qu().int().min(1).max(50).default(10)});ie({type:Yt("inbox:deliver"),entryId:Fe().int().nonnegative(),inboxId:A().min(1),chatId:A().nullable(),message:IC}).passthrough();ie({type:Yt("inbox:ack"),entryId:Fe().int().nonnegative()});const j6=7;ie({organizationId:A(),organizationName:A(),organizationDisplayName:A(),role:A(),expiresAt:A().nullable()});ie({id:A(),organizationId:A(),token:A(),inviteUrl:A(),role:A(),createdAt:A(),expiresAt:A().nullable()});ie({token:A().min(1)});ie({}).optional();const C6=["all","unread","watching"],E6=Pe(C6),LC=Pe(["participant","watching"]);ie({cursor:A().optional(),limit:Qu().int().min(1).max(200).default(50),filter:E6.default("all")});const N6=ie({agentId:A(),displayName:A(),type:A()}),_6=ie({chatId:A(),type:A(),membershipKind:LC,title:A(),topic:A().nullable(),participants:un(N6),participantCount:Fe().int(),lastMessageAt:A().nullable(),lastMessagePreview:A().nullable(),unreadMentionCount:Fe().int(),canReply:Ir(),taskId:A().nullable(),taskStatus:A().nullable()});ie({rows:un(_6),nextCursor:A().nullable()});ie({participantIds:un(A().min(1)).min(1),topic:A().trim().max(500).optional().nullable()});ie({participantIds:un(A().min(1)).min(1)});ie({chatId:A(),lastReadAt:A(),unreadMentionCount:Fe().int()});ie({chatId:A(),membershipKind:LC.nullable()});ie({type:Yt("chat:message"),chatId:A()});Pe(["connect","create_agent","completed"]);ie({id:A(),name:A(),displayName:A(),role:Pe(["admin","member"])});ie({name:A().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:A().min(1).max(200)});ie({organizationId:A().min(1)});ie({id:A(),organizationId:A(),organizationName:A(),role:Pe(["admin","member"]),agentId:A()});const T6={ADMIN:"admin",MEMBER:"member"},Dy=Pe(["admin","member"]),A6=ie({id:A(),userId:A(),organizationId:A(),agentId:A(),role:Dy,createdAt:A()});ie({username:A().min(1).max(100),displayName:A().min(1).max(200),role:Dy.default("member")});ie({role:Dy.optional(),displayName:A().min(1).max(200).optional()});A6.extend({username:A(),displayName:A(),password:A()});const R6=Pe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),UC=Pe(["high","medium","low"]);ie({id:A(),organizationId:A(),type:R6,severity:UC,agentId:A().nullable(),chatId:A().nullable(),message:A(),read:Ir(),createdAt:A()});ie({limit:Qu().int().min(1).max(100).default(20),cursor:A().optional(),severity:UC.optional(),read:Pe(["true","false"]).transform(e=>e==="true").optional(),agentId:A().optional()});ie({next:A().max(256).optional()});ie({code:A().min(1),state:A().min(1)});ie({githubId:A().min(1),login:A().min(1),email:A().email().optional(),displayName:A().optional(),next:A().max(256).optional()});const PC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ie({name:A().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=>!PC.test(e),"Name must not be a UUID format"),displayName:A().min(1).max(200),maxAgents:Fe().int().min(0).default(0),maxMessagesPerMinute:Fe().int().min(0).default(0),features:$t(A(),wt()).default({})});ie({name:A().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=>!PC.test(e),"Name must not be a UUID format").optional(),displayName:A().min(1).max(200).optional(),maxAgents:Fe().int().min(0).optional(),maxMessagesPerMinute:Fe().int().min(0).optional(),features:$t(A(),wt()).optional()});ie({id:A(),name:A(),displayName:A(),maxAgents:Fe(),maxMessagesPerMinute:Fe(),features:$t(A(),wt()),createdAt:A(),updatedAt:A()});const z6=ie({workingCount:Fe().int().nonnegative(),errorMask:Ir()}),O6=ie({type:Yt("pulse:tick"),organizationId:A(),agents:$t(A(),un(z6).length(32))}),D6=Pe(["tool_call","error","assistant_text","thinking","turn_end"]),BC=ie({toolUseId:A(),name:A(),args:wt(),status:Pe(["pending","ok","error"]),durationMs:Fe().int().nonnegative().optional(),resultPreview:A().max(400).optional()}),$C=ie({source:Pe(["sdk","runtime","tool"]),message:A().max(2e3)}),FC=ie({text:A().max(8e3)}),qC=ie({}),HC=ie({status:Pe(["success","error"])}),M6=Ty("kind",[ie({kind:Yt("tool_call"),payload:BC}),ie({kind:Yt("error"),payload:$C}),ie({kind:Yt("assistant_text"),payload:FC}),ie({kind:Yt("thinking"),payload:qC}),ie({kind:Yt("turn_end"),payload:HC})]);ie({id:A(),agentId:A(),chatId:A(),seq:Fe().int().positive(),kind:D6,payload:kC([BC,$C,FC,qC,HC]),createdAt:A()});ie({agentId:A(),chatId:A(),event:M6});ie({agentId:A(),chatId:A()});ie({type:Yt("session:reconcile"),agentId:A().min(1),chatIds:un(A().min(1)).max(500)});ie({type:Yt("session:reconcile:result"),agentId:A().min(1),staleChatIds:un(A().min(1))});const I6=ie({organizationId:A(),agentCount:Fe(),chatCount:Fe(),messageCount:Fe()});ie({totalAgents:Fe(),totalChats:Fe(),totalMessages:Fe(),byOrganization:un(I6)});ie({key:A(),value:wt(),updatedAt:A()});$t(A(),wt());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"},Fd={[ki.INBOX_TIMEOUT_SECONDS]:300,[ki.MAX_RETRY_COUNT]:3,[ki.POLLING_INTERVAL_SECONDS]:5,[ki.PRESENCE_CLEANUP_SECONDS]:60},Eu=Pe(["pending","assigned","working","completed","failed","cancelled"]),Sw=Pe(["agent","admin"]),L6=Pe(["assigned","status_changed","cancelled"]);ie({taskId:A(),event:L6,title:A(),body:A().default(""),status:Eu,fromStatus:Eu.optional(),originRef:A().nullable().optional()});const U6=ie({title:A().min(1).max(500),body:A().optional(),assigneeAgentId:A().optional(),originRef:A().max(500).optional(),metadata:$t(A(),wt()).optional()});U6.extend({organizationId:A().optional()});ie({status:Pe(["working","completed","failed"]),result:A().optional()});ie({assigneeAgentId:A().nullable().optional(),status:Eu.optional(),result:A().optional()});ie({chatId:A().min(1)});const P6=ie({id:A(),organizationId:A(),title:A(),body:A(),status:Eu,assigneeAgentId:A().nullable(),createdByType:Sw,createdById:A(),originRef:A().nullable(),result:A().nullable(),metadata:$t(A(),wt()),createdAt:A(),updatedAt:A(),cancelledAt:A().nullable(),cancelledByType:Sw.nullable(),cancelledById:A().nullable()}),B6=ie({taskId:A(),chatId:A(),linkedByAgentId:A().nullable(),linkedAt:A()});P6.extend({chats:un(B6)});ie({status:Eu.optional(),assigneeAgentId:A().optional(),originRef:A().optional(),limit:Qu().int().min(1).max(100).default(20),cursor:A().optional()});const $6=Pe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);ie({taskId:A(),signal:$6,reason:A()});const F6=Pe(["active","suspended"]);ie({id:A(),username:A(),displayName:A(),avatarUrl:A().nullable(),status:F6,createdAt:A(),updatedAt:A()});ie({username:A().min(1).max(100),displayName:A().min(1).max(200),password:A().min(8).max(200)});ie({displayName:A().min(1).max(200).optional(),password:A().min(8).max(200).optional()});ie({type:Yt("auth"),token:A().min(1)});const q6=ie({wsInboxDeliver:Ir().default(!1)}).partial();ie({type:Yt("server:welcome"),serverCommandVersion:A().min(1),serverTimeMs:Fe().int().nonnegative(),capabilities:q6.optional()}).passthrough();const ZC=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function H6(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 Z6=2e3,V6=3e4;let fi=null,tf=!1,vp=0,du=null;const Ng=new Set;let di=null,xs=0;function Q6(e){for(const t of Ng)try{t(e)}catch{}if(di){if(e.type==="notification")di.invalidateQueries({queryKey:["notifications"]});else if(e.type==="session:state")di.invalidateQueries({queryKey:["activity"]}),di.invalidateQueries({queryKey:["sessions"]});else if(e.type==="chat:message"){const t=typeof e.chatId=="string"?e.chatId:null;di.invalidateQueries({queryKey:["me","chats"]}),t&&(di.invalidateQueries({queryKey:["chat-messages",t]}),di.invalidateQueries({queryKey:["chat-detail",t]}))}}}function VC(){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);Q6(o)}catch{}},a.onopen=()=>{a===fi&&(vp=0)},a.onclose=()=>{if(a!==fi||(fi=null,tf||xs===0))return;vp++;const l=Math.min(Z6*2**(vp-1),V6);du=setTimeout(()=>{du=null,!tf&&xs>0&&VC()},l)}}function K6(){tf=!0,du&&(clearTimeout(du),du=null),fi&&(fi.close(1e3,"unmount"),fi=null)}function QC(e){const{onMessage:t,enabled:n=!0}=e??{},a=an(),l=b.useRef(t);l.current=t,b.useEffect(()=>{di=a},[a]),b.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return Ng.add(o),xs++,xs===1&&(tf=!1,VC()),()=>{Ng.delete(o),xs--,xs===0&&K6()}},[n])}const G6=b.createContext({aggregated:ZC,agents:{},receivedAtMs:null,stale:!0});function Y6({children:e}){const[t,n]=b.useState({aggregated:ZC,agents:{},receivedAtMs:null}),[a,l]=b.useState(()=>Date.now());QC({onMessage:u=>{const f=O6.safeParse(u);f.success&&n({aggregated:H6(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),b.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=b.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return c.jsx(G6.Provider,{value:o,children:e})}function X6(e){return je.get(`/admin/agents/${e}/config`)}function J6(e,t){return je.patch(`/admin/agents/${e}/config`,t)}function W6(e,t){return je.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function eU(e){return je.get(`/admin/agents/${e}/client-status`)}function tU({className:e,style:t,...n}){return c.jsx("div",{className:Ae("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function nU({onClick:e,children:t}){return c.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 rU(){return c.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function aU({children:e,mono:t}){return c.jsx("span",{className:Ae("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}const iU={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 zr({tone:e="neutral",className:t,style:n,...a}){const l=iU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return c.jsx("span",{className:Ae("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...a})}function _g({children:e,right:t,className:n,style:a,...l}){return c.jsxs("div",{className:Ae("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:[c.jsx("span",{children:e}),t]})}function Nf({className:e,style:t,...n}){return c.jsx("span",{className:Ae("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function fu({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?c.jsxs("span",{className:Ae("shrink-0",n),style:a,role:"img","aria-label":"working",children:[c.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),c.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"?c.jsx("span",{className:Ae("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:c.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?c.jsx("span",{className:Ae("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"?c.jsx("span",{className:Ae("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):c.jsx("span",{className:Ae("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function lU(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Nu({state:e,className:t}){const n=e!==null&&lU(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return c.jsxs("span",{className:Ae("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[c.jsx(fu,{state:n,size:7}),n]})}function _d({label:e,value:t,accent:n}){return c.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[c.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),c.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function sU({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?c.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:c.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[c.jsxs("span",{children:["Runs on ",c.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&c.jsxs(c.Fragment,{children:[c.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),c.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function oU(e){const{agent:t}=e,[n,a]=b.useState(!1),[l,o]=b.useState(!1),u=t.displayName||t.name||t.uuid;return c.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:[c.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[c.jsx(dy,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),c.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),c.jsxs("div",{children:[t.status==="active"?c.jsx(bp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:c.jsx(ge,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):c.jsx(bp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:c.jsx(ge,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),c.jsx(bp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:c.jsxs(ge,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[c.jsx(Bs,{className:"h-3 w-3"}),"Delete"]})})]}),c.jsx(uU,{open:l,onOpenChange:o,label:u,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),c.jsx(cU,{open:n,onOpenChange:a,expected:u,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function bp(e){return c.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:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),c.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),c.jsx("div",{children:e.action})]})}function uU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsxs(rn,{children:['Suspend "',n,'"?']})}),c.jsx("div",{className:"space-y-3",children:c.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."})}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),c.jsx(ge,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function cU({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,u]=b.useState("");function f(m){m.preventDefault(),o===n&&a()}return c.jsx(nn,{open:e,onOpenChange:m=>{t(m),m||u("")},children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsxs(rn,{children:['Delete "',n,'"?']})}),c.jsxs("form",{onSubmit:f,className:"space-y-4",children:[c.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",c.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),c.jsx(_t,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),c.jsx(ge,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}var dU="Label",KC=b.forwardRef((e,t)=>c.jsx(Na.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())}}));KC.displayName=dU;var fU=KC;const ct=b.forwardRef(({className:e,...t},n)=>c.jsx(fU,{ref:n,className:Ae("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));ct.displayName="Label";const Hn=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Ae("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));Hn.displayName="Panel";const _a=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Ae("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}));_a.displayName="PanelHeader";const Ta=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Ae("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Ta.displayName="PanelTitle";const Aa=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Ae(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Aa.displayName="PanelBody";const hU={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 My({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const u=hU[e],f=e==="deleted";return c.jsxs("div",{className:Ae("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:[c.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&c.jsx("span",{className:Ae("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?c.jsxs(ge,{size:"sm",variant:"ghost",onClick:a,children:[c.jsx(iz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsxs(ge,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[c.jsx(mf,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"sr-only",children:"Edit"})]}),c.jsxs(ge,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[c.jsx(Bs,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function mU(e){const[t,n]=b.useState(null),[a,l]=b.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),u=e.items.filter(f=>f.status!=="deleted").length;return c.jsxs(Hn,{children:[c.jsxs(_a,{children:[c.jsxs(Ta,{children:["Environment variables (",u,")"]}),!e.disabled&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(Mr,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Aa,{className:"space-y-2",children:e.items.length===0?c.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===Wd,y=m&&!h&&!!f.value.value,g=a.has(f.key);let x;return m?y&&g?x=f.value.value:x="••••••":x=f.value.value||c.jsx("em",{children:"(empty)"}),c.jsxs(My,{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:[c.jsx("span",{className:"font-mono font-medium",children:f.value.key}),c.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:x}),m&&c.jsx(Rk,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&c.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?c.jsx(RR,{className:"h-3.5 w-3.5"}):c.jsx(OR,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&c.jsx(pU,{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 pU({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,u]=b.useState((n==null?void 0:n.key)??""),[f,m]=b.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=b.useState((n==null?void 0:n.sensitive)??!1),[g,x]=b.useState(null);b.useEffect(()=>{e&&(u((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),x(null))},[e,n]);function w(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){x("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){x(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=Wd),!h&&!n&&!f){x("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:n?"Edit environment variable":"Add environment variable"})}),c.jsxs("form",{onSubmit:w,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"env-key",children:"Key"}),c.jsx(_t,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&c.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"env-value",children:"Value"}),c.jsx(_t,{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"})]}),c.jsxs("label",{className:"flex items-center gap-2 text-body",children:[c.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)"]}),c.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&&c.jsx("p",{className:"text-body text-destructive",children:g}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(ge,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function gU(e){const[t,n]=b.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return c.jsxs(Hn,{children:[c.jsxs(_a,{children:[c.jsxs(Ta,{children:["Git repositories (",a,")"]}),!e.disabled&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(Mr,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Aa,{className:"space-y-2",children:e.items.length===0?c.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??ef(l.value.url);return c.jsxs(My,{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:[c.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&c.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),c.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&c.jsx(yU,{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 yU({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,u]=b.useState((n==null?void 0:n.url)??""),[f,m]=b.useState((n==null?void 0:n.ref)??""),[h,y]=b.useState((n==null?void 0:n.localPath)??""),[g,x]=b.useState(null);b.useEffect(()=>{e&&(u((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),x(null))},[e,n]);function w(k){k.preventDefault();const j=o.trim();if(!j){x("URL is required.");return}const C=h.trim()||ef(j);if(C&&a.has(C)){x(`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 c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:n?"Edit Git repository":"Add Git repository"})}),c.jsxs("form",{onSubmit:w,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"git-url",children:"URL"}),c.jsx(_t,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),c.jsx(_t,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"git-path",children:"Local path (optional)"}),c.jsx(_t,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:ef(o)||"repo-name",className:"font-mono"}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&c.jsx("p",{className:"text-body text-destructive",children:g}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(ge,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function vU({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:u,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return c.jsx("span",{className:Ae("mono text-label",o),style:{color:"var(--fg-4)",...u},title:f,children:l});const y=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,x=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?c.jsxs("span",{className:Ae("inline-flex flex-col leading-tight",o),style:{gap:1,...u},title:y??void 0,children:[h&&c.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&c.jsxs("span",{className:"mono text-caption",style:{color:x},children:["@",e]})]}):c.jsxs("span",{className:Ae("inline-flex items-baseline gap-1.5",o),style:u,title:y??void 0,children:[h&&c.jsx("span",{style:{color:g},children:t}),m&&c.jsxs("span",{className:"mono text-caption",style:{color:x},children:["@",e]})]})}function _f(){return je.get("/members")}function bU(e,t){return je.patch(`/members/${encodeURIComponent(e)}`,t)}function xU(e){return je.delete(`/members/${encodeURIComponent(e)}`)}function GC(){const{data:e}=Ve({queryKey:["members","name-map"],queryFn:_f,staleTime:3e4});return b.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 wU({agent:e,onSave:t}){const[n,a]=b.useState(!1),l=wy(),o=GC(),u=e.metadata,f=u==null?void 0:u.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(x=>typeof x=="string"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return c.jsxs(Hn,{children:[c.jsxs(_a,{children:[c.jsx(Ta,{children:"Profile"}),e.status==="active"&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[c.jsx(mf,{className:"h-3 w-3"})," Edit"]})]}),c.jsxs(Aa,{className:"text-body space-y-1",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&c.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),c.jsxs("span",{className:"text-muted-foreground",children:["delegate ",c.jsx(vU,{name:g.name,displayName:g.displayName})]})]})]}),c.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[c.jsxs("span",{children:["owner ",c.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&c.jsxs("span",{children:["role ",c.jsx("span",{className:"text-foreground",children:m})]}),c.jsxs("span",{children:["type ",c.jsx(zr,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),c.jsxs("span",{children:["visibility"," ",c.jsx(zr,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&c.jsxs("span",{children:["domains"," ",c.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(x=>c.jsx(zr,{tone:"outline",children:x},x))})]})]})]}),c.jsx(SU,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function SU({agent:e,open:t,onOpenChange:n,onSave:a}){var M;const{memberId:l,role:o}=zt(),[u,f]=b.useState(e.displayName),[m,h]=b.useState(e.delegateMention??""),[y,g]=b.useState(e.visibility),[x,w]=b.useState(!1),[k,j]=b.useState(null);b.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,R=Ve({queryKey:["agents-for-delegate"],queryFn:async()=>(await Zu({limit:100})).items.filter(O=>O.type==="personal_assistant"&&O.status==="active"),enabled:t&&C});async function z(B){B.preventDefault(),j(null);const O=u.trim();if(!O){j("Display name is required.");return}w(!0);try{const D={displayName:O,delegateMention:m||null};y!==e.visibility&&(D.visibility=y),await a(D),n(!1)}catch(D){j(D instanceof Error?D.message:String(D))}finally{w(!1)}}return c.jsx(nn,{open:t,onOpenChange:n,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:"Edit Identity"})}),c.jsxs("form",{onSubmit:z,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Agent name"}),c.jsx(_t,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"id-display",children:"Display Name"}),c.jsx(_t,{id:"id-display",value:u,onChange:B=>f(B.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"id-visibility",children:"Visibility"}),c.jsxs("select",{id:"id-visibility",value:y,onChange:B=>g(B.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:[c.jsx("option",{value:ww.PRIVATE,children:"Private — only the manager"}),c.jsx("option",{value:ww.ORGANIZATION,children:"Organization — all members"})]}),c.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&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"id-delegate",children:"Delegate Mention"}),c.jsxs("select",{id:"id-delegate",value:m,onChange:B=>h(B.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[c.jsx("option",{value:"",children:"None"}),(M=R.data)==null?void 0:M.map(B=>c.jsx("option",{value:B.uuid,children:B.displayName?`${B.displayName} (@${B.name??B.uuid})`:B.name?`@${B.name}`:B.uuid},B.uuid))]}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&c.jsx("p",{className:"text-body text-destructive",children:k}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:x,children:"Cancel"}),c.jsx(ge,{type:"submit",disabled:x,children:x?"Saving…":"Save"})]})]})]})})}function kU(e){return e==="working"?"accent":e==="error"?"error":"outline"}function jU(e){const[t,n]=b.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return c.jsxs(Hn,{children:[c.jsxs(_a,{children:[c.jsxs(Ta,{children:["MCP servers (",a,")"]}),!e.disabled&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(Mr,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Aa,{className:"space-y-2",children:e.items.length===0?c.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 c.jsxs(My,{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:[c.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),c.jsx("span",{className:"font-medium font-mono",children:l.value.name}),c.jsx(zr,{tone:kU(o),children:o}),c.jsx("span",{className:"text-caption text-muted-foreground truncate",children:CU(l.value)})]},l.key)})}),t&&c.jsx(EU,{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 CU(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 EU({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,u]=b.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=b.useState((n==null?void 0:n.name)??""),[h,y]=b.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,x]=b.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[w,k]=b.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,C]=b.useState(null);b.useEffect(()=>{e&&(u((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((n==null?void 0:n.transport)==="stdio"?n.command:""),x((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(R){if(R.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 z;if(o==="stdio"){if(!h.trim()){C("stdio transport requires a command.");return}const M=g.trim().split(/\s+/).filter(B=>B.length>0);z={name:f,transport:"stdio",command:h.trim(),...M.length?{args:M}:{}}}else{const M=w.trim();try{new URL(M)}catch{C("URL is not valid.");return}z={name:f,transport:o,url:M}}l(z)}return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:n?"Edit MCP server":"Add MCP server"})}),c.jsxs("form",{onSubmit:E,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-transport",children:"Transport"}),c.jsxs("select",{id:"mcp-transport",value:o,onChange:R=>u(R.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[c.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),c.jsx("option",{value:"http",children:"http"}),c.jsx("option",{value:"sse",children:"sse"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-name",children:"Name"}),c.jsx(_t,{id:"mcp-name",value:f,onChange:R=>m(R.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-command",children:"Command"}),c.jsx(_t,{id:"mcp-command",value:h,onChange:R=>y(R.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),c.jsx(_t,{id:"mcp-args",value:g,onChange:R=>x(R.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-url",children:"URL"}),c.jsx(_t,{id:"mcp-url",value:w,onChange:R=>k(R.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&c.jsx("p",{className:"text-body text-destructive",children:j}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(ge,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const NU=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],_U=[{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"}],TU={"claude-code":NU,codex:_U},AU={"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."},RU={value:"",label:"(unset — inherits local)"};function zU({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const u=e!==t,f=TU[o],m=b.useMemo(()=>{const h=[RU,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return c.jsxs(Hn,{style:{borderColor:u?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[c.jsxs(_a,{children:[c.jsxs(Ta,{children:["Model",u&&c.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"})]}),u&&c.jsx(ge,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),c.jsxs(Aa,{className:"space-y-2",children:[c.jsx(OU,{items:m,value:e,onChange:n,disabled:l}),c.jsx("p",{className:"text-caption text-muted-foreground",children:AU[o]})]})]})}function OU({items:e,value:t,onChange:n,disabled:a}){const[l,o]=b.useState(!1),[u,f]=b.useState(null),m=b.useRef(null),h=b.useRef(null),y=e.find(x=>x.value===t)??e[0],g=b.useCallback(()=>{const x=m.current;if(!x)return;const w=x.getBoundingClientRect();f({top:w.bottom+4,left:w.left,width:w.width})},[]);return b.useLayoutEffect(()=>{l&&g()},[l,g]),b.useEffect(()=>{if(!l)return;const x=j=>{var E,R;const C=j.target;(E=m.current)!=null&&E.contains(C)||(R=h.current)!=null&&R.contains(C)||o(!1)},w=j=>{var C;j.key==="Escape"&&(o(!1),(C=m.current)==null||C.focus())},k=()=>g();return document.addEventListener("pointerdown",x),document.addEventListener("keydown",w),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",w),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,g]),c.jsxs("div",{className:"max-w-md",children:[c.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(x=>!x),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:[c.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}),c.jsx(_k,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&u&&py.createPortal(c.jsx("div",{ref:h,className:"fixed z-50 overflow-hidden rounded-[var(--radius-input)] py-1",style:{top:u.top,left:u.left,width:u.width,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",boxShadow:"var(--shadow-md)",maxHeight:280,overflowY:"auto"},children:e.map(x=>{const w=x.value===t;return c.jsxs("button",{type:"button",onClick:()=>{n(x.value),o(!1)},className:"mono flex w-full items-center gap-2 cursor-pointer px-3 py-1.5 text-body text-left hover:bg-accent/40 transition-colors focus-visible:outline-none focus-visible:bg-accent/40",style:{background:w?"var(--bg-hover)":void 0,color:x.value===""?"var(--fg-3)":void 0},children:[c.jsx(jr,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:w?"visible":"hidden",color:"var(--state-idle)"}}),c.jsx("span",{className:"flex-1 truncate",children:x.label}),x.hint&&c.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:x.hint})]},x.value||"__unset")})}),document.body)]})}function DU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const MU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LU={};function kw(e,t){return(LU.jsx?IU:MU).test(e)}const UU=/[ \t\n\f\r]/g;function PU(e){return typeof e=="object"?e.type==="text"?jw(e.value):!1:jw(e)}function jw(e){return e.replace(UU,"")===""}class Ku{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Ku.prototype.normal={};Ku.prototype.property={};Ku.prototype.space=void 0;function YC(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Ku(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 BU=0;const Ze=kl(),Gt=kl(),Ag=kl(),he=kl(),Ct=kl(),ks=kl(),nr=kl();function kl(){return 2**++BU}const Rg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:Gt,commaOrSpaceSeparated:nr,commaSeparated:ks,number:he,overloadedBoolean:Ag,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),xp=Object.keys(Rg);class Iy extends Kn{constructor(t,n,a,l){let o=-1;if(super(t,n),Cw(this,"space",l),typeof a=="number")for(;++o<xp.length;){const u=xp[o];Cw(this,xp[o],(a&Rg[u])===Rg[u])}}}Iy.prototype.defined=!0;function Cw(e,t,n){n&&(e[t]=n)}function Js(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new Iy(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 Ku(t,n,e.space)}const XC=Js({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:Ct,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:he,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:Ct,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Gt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function JC(e,t){return t in e?e[t]:t}function WC(e,t){return JC(e,t.toLowerCase())}const $U=Js({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ks,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:Ct,autoFocus:Ze,autoPlay:Ze,blocking:Ct,capture:null,charSet:null,checked:Ze,cite:null,className:Ct,cols:he,colSpan:null,content:null,contentEditable:Gt,controls:Ze,controlsList:Ct,coords:he|ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:Ag,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:Ct,height:he,hidden:Ag,high:he,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Ze,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ze,optimum:he,pattern:null,ping:Ct,placeholder:null,playsInline:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:Ct,required:Ze,reversed:Ze,rows:he,rowSpan:he,sandbox:Ct,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ze,useMap:null,value:Gt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:WC}),FU=Js({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:nr,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ks,g2:ks,glyphName:ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:nr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nr,rev:nr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nr,requiredFeatures:nr,requiredFonts:nr,requiredFormats:nr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:nr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nr,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:JC}),eE=Js({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),tE=Js({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:WC}),nE=Js({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),qU={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"},HU=/[A-Z]/g,Ew=/-[a-z]/g,ZU=/^data[-\w.:]+$/i;function VU(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"&&ZU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Ew,KU);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Ew.test(o)){let u=o.replace(HU,QU);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=Iy}return new l(a,t)}function QU(e){return"-"+e.toLowerCase()}function KU(e){return e.charAt(1).toUpperCase()}const GU=YC([XC,$U,eE,tE,nE],"html"),Ly=YC([XC,FU,eE,tE,nE],"svg");function YU(e){return e.join(" ").trim()}var fs={},wp,Nw;function XU(){if(Nw)return wp;Nw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
353
|
+
`,h="/",y="*",g="",x="comment",w="declaration";function k(C,E){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];E=E||{};var R=1,z=1;function M(G){var W=G.match(t);W&&(R+=W.length);var Z=G.lastIndexOf(m);z=~Z?G.length-Z:z+G.length}function B(){var G={line:R,column:z};return function(W){return W.position=new O(G),V(),W}}function O(G){this.start=G,this.end={line:R,column:z},this.source=E.source}O.prototype.content=C;function D(G){var W=new Error(E.source+":"+R+":"+z+": "+G);if(W.reason=G,W.filename=E.source,W.line=R,W.column=z,W.source=C,!E.silent)throw W}function U(G){var W=G.exec(C);if(W){var Z=W[0];return M(Z),C=C.slice(Z.length),W}}function V(){U(n)}function F(G){var W;for(G=G||[];W=ne();)W!==!1&&G.push(W);return G}function ne(){var G=B();if(!(h!=C.charAt(0)||y!=C.charAt(1))){for(var W=2;g!=C.charAt(W)&&(y!=C.charAt(W)||h!=C.charAt(W+1));)++W;if(W+=2,g===C.charAt(W-1))return D("End of comment missing");var Z=C.slice(2,W-2);return z+=2,M(Z),C=C.slice(W),z+=2,G({type:x,comment:Z})}}function oe(){var G=B(),W=U(a);if(W){if(ne(),!U(l))return D("property missing ':'");var Z=U(o),re=G({type:w,property:j(W[0].replace(e,g)),value:Z?j(Z[0].replace(e,g)):g});return U(u),re}}function Se(){var G=[];F(G);for(var W;W=oe();)W!==!1&&(G.push(W),F(G));return G}return V(),Se()}function j(C){return C?C.replace(f,g):g}return wp=k,wp}var _w;function JU(){if(_w)return fs;_w=1;var e=fs&&fs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.default=n;const t=e(XU());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const u=(0,t.default)(a),f=typeof l=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return fs}var au={},Tw;function WU(){if(Tw)return au;Tw=1,Object.defineProperty(au,"__esModule",{value:!0}),au.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},u=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,u))};return au.camelCase=m,au}var iu,Aw;function eP(){if(Aw)return iu;Aw=1;var e=iu&&iu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(JU()),n=WU();function a(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,n.camelCase)(f,o)]=m)}),u}return a.default=a,iu=a,iu}var tP=eP();const nP=uf(tP),rE=aE("end"),Uy=aE("start");function aE(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 rP(e){const t=Uy(e),n=rE(e);if(t&&n)return{start:t,end:n}}function hu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rw(e.position):"start"in e||"end"in e?Rw(e):"line"in e||"column"in e?zg(e):""}function zg(e){return zw(e&&e.line)+":"+zw(e&&e.column)}function Rw(e){return zg(e&&e.start)+"-"+zg(e&&e.end)}function zw(e){return e&&typeof e=="number"?e:1}class En extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(u=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof 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=hu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}En.prototype.file="";En.prototype.name="";En.prototype.reason="";En.prototype.message="";En.prototype.stack="";En.prototype.column=void 0;En.prototype.line=void 0;En.prototype.ancestors=void 0;En.prototype.cause=void 0;En.prototype.fatal=void 0;En.prototype.place=void 0;En.prototype.ruleId=void 0;En.prototype.source=void 0;const Py={}.hasOwnProperty,aP=new Map,iP=/[A-Z]/g,lP=new Set(["table","tbody","thead","tfoot","tr"]),sP=new Set(["td","th"]),iE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function oP(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=gP(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=pP(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:GU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=lE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function lE(e,t,n){if(t.type==="element")return uP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return cP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fP(e,t,n);if(t.type==="mdxjsEsm")return dP(e,t);if(t.type==="root")return hP(e,t,n);if(t.type==="text")return mP(e,t)}function uP(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=oE(e,t.tagName,!1),u=yP(e,t);let f=$y(e,t);return lP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!PU(m):!0})),sE(e,u,o,t),By(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function cP(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)}_u(e,t.position)}function dP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_u(e,t.position)}function fP(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:oE(e,t.name,!0),u=vP(e,t),f=$y(e,t);return sE(e,u,o,t),By(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function hP(e,t,n){const a={};return By(a,$y(e,t)),e.create(t,e.Fragment,a,n)}function mP(e,t){return t.value}function sE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function By(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function pP(e,t,n){return a;function a(l,o,u,f){const h=Array.isArray(u.children)?n:t;return f?h(o,u,f):h(o,u)}}function gP(e,t){return n;function n(a,l,o,u){const f=Array.isArray(o.children),m=Uy(a);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function yP(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Py.call(t.properties,l)){const o=bP(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&sP.has(t.tagName)?a=f:n[u]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function vP(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 u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else _u(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 _u(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function $y(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:aP;for(;++a<t.children.length;){const o=t.children[a];let u;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;u=m+"-"+h,l.set(m,h+1)}}const f=lE(e,o,u);f!==void 0&&n.push(f)}return n}function bP(e,t,n){const a=VU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?DU(n):YU(n)),a.property==="style"){let l=typeof n=="object"?n:xP(e,String(n));return e.stylePropertyNameCase==="css"&&(l=wP(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?qU[a.property]||a.property:a.attribute,n]}}function xP(e,t){try{return nP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new En("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=iE+"#cannot-parse-style-attribute",l}}function oE(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=kw(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=kw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Py.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);_u(e)}function _u(e,t){const n=new En("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=iE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function wP(e){const t={};let n;for(n in e)Py.call(e,n)&&(t[SP(n)]=e[n]);return t}function SP(e){let t=e.replace(iP,kP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function kP(e){return"-"+e.toLowerCase()}const Sp={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"]},jP={};function Fy(e,t){const n=jP,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return uE(e,a,l)}function uE(e,t,n){if(CP(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 Ow(e.children,t,n)}return Array.isArray(e)?Ow(e,t,n):""}function Ow(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=uE(e[l],t,n);return a.join("")}function CP(e){return!!(e&&typeof e=="object")}const Dw=document.createElement("i");function qy(e){const t="&"+e+";";Dw.innerHTML=t;const n=Dw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function lr(e,t,n,a){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)u=Array.from(a),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<a.length;)u=a.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function Sr(e,t){return e.length>0?(lr(e,e.length,0,t),e):t}const Mw={}.hasOwnProperty;function cE(e){const t={};let n=-1;for(;++n<e.length;)EP(t,e[n]);return t}function EP(e,t){let n;for(n in t){const l=(Mw.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){Mw.call(l,u)||(l[u]=[]);const f=o[u];NP(l[u],Array.isArray(f)?f:f?[f]:[])}}}function NP(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);lr(e,0,0,a)}function dE(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 Dr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const An=Di(/[A-Za-z]/),Cn=Di(/[\dA-Za-z]/),_P=Di(/[#-'*+\--9=?A-Z^-~]/);function nf(e){return e!==null&&(e<32||e===127)}const Og=Di(/\d/),TP=Di(/[\dA-Fa-f]/),AP=Di(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const Tf=Di(new RegExp("\\p{P}|\\p{S}","u")),vl=Di(/\s/);function Di(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ws(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&Cn(e.charCodeAt(n+1))&&Cn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(a,n),encodeURIComponent(u)),a=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function lt(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Je(m)?(e.enter(n),f(m)):t(m)}function f(m){return Je(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const RP={tokenize:zP};function zP(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"),lt(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return De(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const OP={tokenize:DP},Iw={tokenize:MP};function DP(e){const t=this,n=[];let a=0,l,o,u;return f;function f(z){if(a<n.length){const M=n[a];return t.containerState=M[1],e.attempt(M[0].continuation,m,h)(z)}return h(z)}function m(z){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&R();const M=t.events.length;let B=M,O;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){O=t.events[B][1].end;break}E(a);let D=M;for(;D<t.events.length;)t.events[D][1].end={...O},D++;return lr(t.events,B+1,0,t.events.slice(M)),t.events.length=D,h(z)}return f(z)}function h(z){if(a===n.length){if(!l)return x(z);if(l.currentConstruct&&l.currentConstruct.concrete)return k(z);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Iw,y,g)(z)}function y(z){return l&&R(),E(a),x(z)}function g(z){return t.parser.lazy[t.now().line]=a!==n.length,u=t.now().offset,k(z)}function x(z){return t.containerState={},e.attempt(Iw,w,k)(z)}function w(z){return a++,n.push([t.currentConstruct,t.containerState]),x(z)}function k(z){if(z===null){l&&R(),E(0),e.consume(z);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(z)}function j(z){if(z===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(z);return}return De(z)?(e.consume(z),C(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(z),j)}function C(z,M){const B=t.sliceStream(z);if(M&&B.push(null),z.previous=o,o&&(o.next=z),o=z,l.defineSkip(z.start),l.write(B),t.parser.lazy[z.start.line]){let O=l.events.length;for(;O--;)if(l.events[O][1].start.offset<u&&(!l.events[O][1].end||l.events[O][1].end.offset>u))return;const D=t.events.length;let U=D,V,F;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(V){F=t.events[U][1].end;break}V=!0}for(E(a),O=D;O<t.events.length;)t.events[O][1].end={...F},O++;lr(t.events,U+1,0,t.events.slice(D)),t.events.length=O}}function E(z){let M=n.length;for(;M-- >z;){const B=n[M];t.containerState=B[1],B[0].exit.call(t,e)}n.length=z}function R(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function MP(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qs(e){if(e===null||jt(e)||vl(e))return 1;if(Tf(e))return 2}function Af(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 Dg={name:"attention",resolveAll:IP,tokenize:LP};function IP(e,t){let n=-1,a,l,o,u,f,m,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(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},x={...e[n][1].start};Lw(g,-m),Lw(x,m),u={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=Sr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=Sr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=Sr(h,Af(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=Sr(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=Sr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,lr(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 LP(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=qs(a);let o;return u;function u(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),y=qs(m),g=!y||y===2&&l||n.includes(m),x=!l||l===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(l||!x)),h._close=!!(o===42?x:x&&(y||!g)),t(m)}}function Lw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const UP={name:"autolink",tokenize:PP};function PP(e,t,n){let a=0;return l;function l(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(w){return An(w)?(e.consume(w),u):w===64?n(w):h(w)}function u(w){return w===43||w===45||w===46||Cn(w)?(a=1,f(w)):h(w)}function f(w){return w===58?(e.consume(w),a=0,m):(w===43||w===45||w===46||Cn(w))&&a++<32?(e.consume(w),f):(a=0,h(w))}function m(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||nf(w)?n(w):(e.consume(w),m)}function h(w){return w===64?(e.consume(w),y):_P(w)?(e.consume(w),h):n(w)}function y(w){return Cn(w)?g(w):n(w)}function g(w){return w===46?(e.consume(w),a=0,y):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):x(w)}function x(w){if((w===45||Cn(w))&&a++<63){const k=w===45?x:g;return e.consume(w),k}return n(w)}}const Gu={partial:!0,tokenize:BP};function BP(e,t,n){return a;function a(o){return Je(o)?lt(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||De(o)?t(o):n(o)}}const fE={continuation:{tokenize:FP},exit:qP,name:"blockQuote",tokenize:$P};function $P(e,t,n){const a=this;return l;function l(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Je(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function FP(e,t,n){const a=this;return l;function l(u){return Je(u)?lt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(fE,t,n)(u)}}function qP(e){e.exit("blockQuote")}const hE={name:"characterEscape",tokenize:HP};function HP(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 AP(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const mE={name:"characterReference",tokenize:ZP};function ZP(e,t,n){const a=this;let l=0,o,u;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,u=Cn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=TP,y):(e.enter("characterReferenceValue"),o=7,u=Og,y(g))}function y(g){if(g===59&&l){const x=e.exit("characterReferenceValue");return u===Cn&&!qy(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&l++<o?(e.consume(g),y):n(g)}}const Uw={partial:!0,tokenize:QP},Pw={concrete:!0,name:"codeFenced",tokenize:VP};function VP(e,t,n){const a=this,l={partial:!0,tokenize:B};let o=0,u=0,f;return m;function m(O){return h(O)}function h(O){const D=a.events[a.events.length-1];return o=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===f?(u++,e.consume(O),y):u<3?n(O):(e.exit("codeFencedFenceSequence"),Je(O)?lt(e,g,"whitespace")(O):g(O))}function g(O){return O===null||De(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check(Uw,j,M)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||De(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(O)):Je(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lt(e,w,"whitespace")(O)):O===96&&O===f?n(O):(e.consume(O),x)}function w(O){return O===null||De(O)?g(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||De(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(O)):O===96&&O===f?n(O):(e.consume(O),k)}function j(O){return e.attempt(l,M,C)(O)}function C(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return o>0&&Je(O)?lt(e,R,"linePrefix",o+1)(O):R(O)}function R(O){return O===null||De(O)?e.check(Uw,j,M)(O):(e.enter("codeFlowValue"),z(O))}function z(O){return O===null||De(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),z)}function M(O){return e.exit("codeFenced"),t(O)}function B(O,D,U){let V=0;return F;function F(W){return O.enter("lineEnding"),O.consume(W),O.exit("lineEnding"),ne}function ne(W){return O.enter("codeFencedFence"),Je(W)?lt(O,oe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):oe(W)}function oe(W){return W===f?(O.enter("codeFencedFenceSequence"),Se(W)):U(W)}function Se(W){return W===f?(V++,O.consume(W),Se):V>=u?(O.exit("codeFencedFenceSequence"),Je(W)?lt(O,G,"whitespace")(W):G(W)):U(W)}function G(W){return W===null||De(W)?(O.exit("codeFencedFence"),D(W)):U(W)}}}function QP(e,t,n){const a=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}const kp={name:"codeIndented",tokenize:GP},KP={partial:!0,tokenize:YP};function GP(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),lt(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?u(h):n(h)}function u(h){return h===null?m(h):De(h)?e.attempt(KP,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||De(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function YP(e,t,n){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?n(u):De(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):lt(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):De(u)?l(u):n(u)}}const XP={name:"codeText",previous:WP,resolve:JP,tokenize:e9};function JP(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 WP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function e9(e,t,n){let a=0,l,o;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):De(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||De(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class t9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&lu(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),lu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);lu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);lu(this.left,n.reverse())}}}function lu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function pE(e){const t={};let n=-1,a,l,o,u,f,m,h;const y=new t9(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,n9(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(u=y.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(a[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(a),y.splice(l,n-l+1,f))}}return lr(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function n9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let y,g,x=-1,w=n,k=0,j=0;const C=[j];for(;w;){for(;e.get(++l)[1]!==w;);o.push(l),w._tokenizer||(y=a.sliceStream(w),w.next||y.push(null),g&&u.defineSkip(w.start),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=n;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(j=x+1,C.push(j),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(u.events=[],w?(w._tokenizer=void 0,w.previous=void 0):C.pop(),x=C.length;x--;){const E=f.slice(C[x],C[x+1]),R=o.pop();m.push([R,R+E.length-1]),e.splice(R,2,E)}for(m.reverse(),x=-1;++x<m.length;)h[k+m[x][0]]=k+m[x][1],k+=m[x][1]-m[x][0]-1;return h}const r9={resolve:i9,tokenize:l9},a9={partial:!0,tokenize:s9};function i9(e){return pE(e),e}function l9(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):De(f)?e.check(a9,u,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function s9(e,t,n){const a=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),lt(e,o,"linePrefix")}function o(u){if(u===null||De(u))return n(u);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(u):e.interrupt(a.parser.constructs.flow,n,t)(u)}}function gE(e,t,n,a,l,o,u,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),x):E===null||E===32||E===41||nf(E)?n(E):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function x(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"}),w(E))}function w(E){return E===62?(e.exit("chunkString"),e.exit(f),x(E)):E===null||E===60||De(E)?n(E):(e.consume(E),E===92?k:w)}function k(E){return E===60||E===62||E===92?(e.consume(E),w):w(E)}function j(E){return!y&&(E===null||E===41||jt(E))?(e.exit("chunkString"),e.exit(f),e.exit(u),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||nf(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 yE(e,t,n,a,l,o){const u=this;let f=0,m;return h;function h(w){return e.enter(a),e.enter(l),e.consume(w),e.exit(l),e.enter(o),y}function y(w){return f>999||w===null||w===91||w===93&&!m||w===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(w):w===93?(e.exit(o),e.enter(l),e.consume(w),e.exit(l),e.exit(a),t):De(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||De(w)||f++>999?(e.exit("chunkString"),y(w)):(e.consume(w),m||(m=!Je(w)),w===92?x:g)}function x(w){return w===91||w===92||w===93?(e.consume(w),f++,g):g(w)}}function vE(e,t,n,a,l,o){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(l),e.consume(x),e.exit(l),u=x===40?41:x,m):n(x)}function m(x){return x===u?(e.enter(l),e.consume(x),e.exit(l),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===u?(e.exit(o),m(u)):x===null?n(x):De(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),lt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===u||x===null||De(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?g:y)}function g(x){return x===u||x===92?(e.consume(x),y):y(x)}}function mu(e,t){let n;return a;function a(l){return De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Je(l)?lt(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const o9={name:"definition",tokenize:c9},u9={partial:!0,tokenize:d9};function c9(e,t,n){const a=this;let l;return o;function o(w){return e.enter("definition"),u(w)}function u(w){return yE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return l=Dr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),m):n(w)}function m(w){return jt(w)?mu(e,h)(w):h(w)}function h(w){return gE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return e.attempt(u9,g,g)(w)}function g(w){return Je(w)?lt(e,x,"whitespace")(w):x(w)}function x(w){return w===null||De(w)?(e.exit("definition"),a.parser.defined.push(l),t(w)):n(w)}}function d9(e,t,n){return a;function a(f){return jt(f)?mu(e,l)(f):n(f)}function l(f){return vE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Je(f)?lt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||De(f)?t(f):n(f)}}const f9={name:"hardBreakEscape",tokenize:h9};function h9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return De(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const m9={name:"headingAtx",resolve:p9,tokenize:g9};function p9(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"},lr(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function g9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&a++<6?(e.consume(y),u):y===null||jt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||De(y)?(e.exit("atxHeading"),t(y)):Je(y)?lt(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||jt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const y9=["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"],Bw=["pre","script","style","textarea"],v9={concrete:!0,name:"htmlFlow",resolveTo:w9,tokenize:S9},b9={partial:!0,tokenize:j9},x9={partial:!0,tokenize:k9};function w9(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 S9(e,t,n){const a=this;let l,o,u,f,m;return h;function h(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),x):T===47?(e.consume(T),o=!0,j):T===63?(e.consume(T),l=3,a.interrupt?t:_):An(T)?(e.consume(T),u=String.fromCharCode(T),C):n(T)}function x(T){return T===45?(e.consume(T),l=2,w):T===91?(e.consume(T),l=5,f=0,k):An(T)?(e.consume(T),l=4,a.interrupt?t:_):n(T)}function w(T){return T===45?(e.consume(T),a.interrupt?t:_):n(T)}function k(T){const q="CDATA[";return T===q.charCodeAt(f++)?(e.consume(T),f===q.length?a.interrupt?t:oe:k):n(T)}function j(T){return An(T)?(e.consume(T),u=String.fromCharCode(T),C):n(T)}function C(T){if(T===null||T===47||T===62||jt(T)){const q=T===47,X=u.toLowerCase();return!q&&!o&&Bw.includes(X)?(l=1,a.interrupt?t(T):oe(T)):y9.includes(u.toLowerCase())?(l=6,q?(e.consume(T),E):a.interrupt?t(T):oe(T)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(T):o?R(T):z(T))}return T===45||Cn(T)?(e.consume(T),u+=String.fromCharCode(T),C):n(T)}function E(T){return T===62?(e.consume(T),a.interrupt?t:oe):n(T)}function R(T){return Je(T)?(e.consume(T),R):F(T)}function z(T){return T===47?(e.consume(T),F):T===58||T===95||An(T)?(e.consume(T),M):Je(T)?(e.consume(T),z):F(T)}function M(T){return T===45||T===46||T===58||T===95||Cn(T)?(e.consume(T),M):B(T)}function B(T){return T===61?(e.consume(T),O):Je(T)?(e.consume(T),B):z(T)}function O(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),m=T,D):Je(T)?(e.consume(T),O):U(T)}function D(T){return T===m?(e.consume(T),m=null,V):T===null||De(T)?n(T):(e.consume(T),D)}function U(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||jt(T)?B(T):(e.consume(T),U)}function V(T){return T===47||T===62||Je(T)?z(T):n(T)}function F(T){return T===62?(e.consume(T),ne):n(T)}function ne(T){return T===null||De(T)?oe(T):Je(T)?(e.consume(T),ne):n(T)}function oe(T){return T===45&&l===2?(e.consume(T),Z):T===60&&l===1?(e.consume(T),re):T===62&&l===4?(e.consume(T),L):T===63&&l===3?(e.consume(T),_):T===93&&l===5?(e.consume(T),Re):De(T)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(b9,P,Se)(T)):T===null||De(T)?(e.exit("htmlFlowData"),Se(T)):(e.consume(T),oe)}function Se(T){return e.check(x9,G,P)(T)}function G(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),W}function W(T){return T===null||De(T)?Se(T):(e.enter("htmlFlowData"),oe(T))}function Z(T){return T===45?(e.consume(T),_):oe(T)}function re(T){return T===47?(e.consume(T),u="",ve):oe(T)}function ve(T){if(T===62){const q=u.toLowerCase();return Bw.includes(q)?(e.consume(T),L):oe(T)}return An(T)&&u.length<8?(e.consume(T),u+=String.fromCharCode(T),ve):oe(T)}function Re(T){return T===93?(e.consume(T),_):oe(T)}function _(T){return T===62?(e.consume(T),L):T===45&&l===2?(e.consume(T),_):oe(T)}function L(T){return T===null||De(T)?(e.exit("htmlFlowData"),P(T)):(e.consume(T),L)}function P(T){return e.exit("htmlFlow"),t(T)}}function k9(e,t,n){const a=this;return l;function l(u){return De(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}function j9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Gu,t,n)}}const C9={name:"htmlText",tokenize:E9};function E9(e,t,n){const a=this;let l,o,u;return f;function f(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),m}function m(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),B):_===63?(e.consume(_),z):An(_)?(e.consume(_),U):n(_)}function h(_){return _===45?(e.consume(_),y):_===91?(e.consume(_),o=0,k):An(_)?(e.consume(_),R):n(_)}function y(_){return _===45?(e.consume(_),w):n(_)}function g(_){return _===null?n(_):_===45?(e.consume(_),x):De(_)?(u=g,re(_)):(e.consume(_),g)}function x(_){return _===45?(e.consume(_),w):g(_)}function w(_){return _===62?Z(_):_===45?x(_):g(_)}function k(_){const L="CDATA[";return _===L.charCodeAt(o++)?(e.consume(_),o===L.length?j:k):n(_)}function j(_){return _===null?n(_):_===93?(e.consume(_),C):De(_)?(u=j,re(_)):(e.consume(_),j)}function C(_){return _===93?(e.consume(_),E):j(_)}function E(_){return _===62?Z(_):_===93?(e.consume(_),E):j(_)}function R(_){return _===null||_===62?Z(_):De(_)?(u=R,re(_)):(e.consume(_),R)}function z(_){return _===null?n(_):_===63?(e.consume(_),M):De(_)?(u=z,re(_)):(e.consume(_),z)}function M(_){return _===62?Z(_):z(_)}function B(_){return An(_)?(e.consume(_),O):n(_)}function O(_){return _===45||Cn(_)?(e.consume(_),O):D(_)}function D(_){return De(_)?(u=D,re(_)):Je(_)?(e.consume(_),D):Z(_)}function U(_){return _===45||Cn(_)?(e.consume(_),U):_===47||_===62||jt(_)?V(_):n(_)}function V(_){return _===47?(e.consume(_),Z):_===58||_===95||An(_)?(e.consume(_),F):De(_)?(u=V,re(_)):Je(_)?(e.consume(_),V):Z(_)}function F(_){return _===45||_===46||_===58||_===95||Cn(_)?(e.consume(_),F):ne(_)}function ne(_){return _===61?(e.consume(_),oe):De(_)?(u=ne,re(_)):Je(_)?(e.consume(_),ne):V(_)}function oe(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,Se):De(_)?(u=oe,re(_)):Je(_)?(e.consume(_),oe):(e.consume(_),G)}function Se(_){return _===l?(e.consume(_),l=void 0,W):_===null?n(_):De(_)?(u=Se,re(_)):(e.consume(_),Se)}function G(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||jt(_)?V(_):(e.consume(_),G)}function W(_){return _===47||_===62||jt(_)?V(_):n(_)}function Z(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function re(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ve}function ve(_){return Je(_)?lt(e,Re,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Re(_)}function Re(_){return e.enter("htmlTextData"),u(_)}}const Hy={name:"labelEnd",resolveAll:A9,resolveTo:R9,tokenize:z9},N9={tokenize:O9},_9={tokenize:D9},T9={tokenize:M9};function A9(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&&lr(e,0,e.length,n),e}function R9(e,t){let n=e.length,a=0,l,o,u,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(u=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=Sr(f,e.slice(o+1,o+a+3)),f=Sr(f,[["enter",y,t]]),f=Sr(f,Af(t.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),t)),f=Sr(f,[["exit",y,t],e[u-2],e[u-1],["exit",h,t]]),f=Sr(f,e.slice(u+1)),f=Sr(f,[["exit",m,t]]),lr(e,o,e.length,f),e}function z9(e,t,n){const a=this;let l=a.events.length,o,u;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(x){return o?o._inactive?g(x):(u=a.parser.defined.includes(Dr(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),m):n(x)}function m(x){return x===40?e.attempt(N9,y,u?y:g)(x):x===91?e.attempt(_9,y,u?h:g)(x):u?y(x):g(x)}function h(x){return e.attempt(T9,y,g)(x)}function y(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function O9(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 jt(g)?mu(e,o)(g):o(g)}function o(g){return g===41?y(g):gE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return jt(g)?mu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?vE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return jt(g)?mu(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 D9(e,t,n){const a=this;return l;function l(f){return yE.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Dr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function M9(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 I9={name:"labelStartImage",resolveAll:Hy.resolveAll,tokenize:L9};function L9(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"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const U9={name:"labelStartLink",resolveAll:Hy.resolveAll,tokenize:P9};function P9(e,t,n){const a=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(u):t(u)}}const jp={name:"lineEnding",tokenize:B9};function B9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),lt(e,t,"linePrefix")}}const qd={name:"thematicBreak",tokenize:$9};function $9(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||De(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),Je(h)?lt(e,f,"whitespace")(h):f(h))}}const $n={continuation:{tokenize:Z9},exit:Q9,name:"list",tokenize:H9},F9={partial:!0,tokenize:K9},q9={partial:!0,tokenize:V9};function H9(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,u=0;return f;function f(w){const k=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:Og(w)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(qd,n,h)(w):h(w);if(!a.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(w)}return n(w)}function m(w){return Og(w)&&++u<10?(e.consume(w),m):(!a.interrupt||u<2)&&(a.containerState.marker?w===a.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||w,e.check(Gu,a.interrupt?n:y,e.attempt(F9,x,g))}function y(w){return a.containerState.initialBlankLine=!0,o++,x(w)}function g(w){return Je(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),x):n(w)}function x(w){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function Z9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Gu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,lt(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Je(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(q9,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,lt(e,e.attempt($n,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function V9(e,t,n){const a=this;return lt(e,l,"listItemIndent",a.containerState.size+1);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(o):n(o)}}function Q9(e){e.exit(this.containerState.type)}function K9(e,t,n){const a=this;return lt(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=a.events[a.events.length-1];return!Je(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const $w={name:"setextUnderline",resolveTo:G9,tokenize:Y9};function G9(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 u={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",u,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function Y9(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,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Je(h)?lt(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||De(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const X9={tokenize:J9};function J9(e){const t=this,n=e.attempt(Gu,a,e.attempt(this.parser.constructs.flowInitial,l,lt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(r9,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 W9={resolveAll:xE()},e8=bE("string"),t8=bE("text");function bE(e){return{resolveAll:xE(e==="text"?n8:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,u,f);return u;function u(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let x=-1;if(g)for(;++x<g.length;){const w=g[x];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function xE(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 n8(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,u=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:a.start._bufferIndex+u,_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 r8={42:$n,43:$n,45:$n,48:$n,49:$n,50:$n,51:$n,52:$n,53:$n,54:$n,55:$n,56:$n,57:$n,62:fE},a8={91:o9},i8={[-2]:kp,[-1]:kp,32:kp},l8={35:m9,42:qd,45:[$w,qd],60:v9,61:$w,95:qd,96:Pw,126:Pw},s8={38:mE,92:hE},o8={[-5]:jp,[-4]:jp,[-3]:jp,33:I9,38:mE,42:Dg,60:[UP,C9],91:U9,92:[f9,hE],93:Hy,95:Dg,96:XP},u8={null:[Dg,W9]},c8={null:[42,95]},d8={null:[]},f8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:c8,contentInitial:a8,disable:d8,document:r8,flow:l8,flowInitial:i8,insideSpan:u8,string:s8,text:o8},Symbol.toStringTag,{value:"Module"}));function h8(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 u=[],f=[];const m={attempt:D(B),check:D(O),consume:R,enter:z,exit:M,interrupt:D(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:w,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(ne){return u=Sr(u,ne),C(),u[u.length-1]!==null?[]:(U(t,0),h.events=Af(o,h.events,h),h.events)}function x(ne,oe){return p8(w(ne),oe)}function w(ne){return m8(u,ne)}function k(){const{_bufferIndex:ne,_index:oe,line:Se,column:G,offset:W}=a;return{_bufferIndex:ne,_index:oe,line:Se,column:G,offset:W}}function j(ne){l[ne.line]=ne.column,F()}function C(){let ne;for(;a._index<u.length;){const oe=u[a._index];if(typeof oe=="string")for(ne=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ne&&a._bufferIndex<oe.length;)E(oe.charCodeAt(a._bufferIndex));else E(oe)}}function E(ne){y=y(ne)}function R(ne){De(ne)?(a.line++,a.column=1,a.offset+=ne===-3?2:1,F()):ne!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=ne}function z(ne,oe){const Se=oe||{};return Se.type=ne,Se.start=k(),h.events.push(["enter",Se,h]),f.push(Se),Se}function M(ne){const oe=f.pop();return oe.end=k(),h.events.push(["exit",oe,h]),oe}function B(ne,oe){U(ne,oe.from)}function O(ne,oe){oe.restore()}function D(ne,oe){return Se;function Se(G,W,Z){let re,ve,Re,_;return Array.isArray(G)?P(G):"tokenize"in G?P([G]):L(G);function L(ue){return xe;function xe(be){const fe=be!==null&&ue[be],ee=be!==null&&ue.null,me=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return P(me)(be)}}function P(ue){return re=ue,ve=0,ue.length===0?Z:T(ue[ve])}function T(ue){return xe;function xe(be){return _=V(),Re=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?X():ue.tokenize.call(oe?Object.assign(Object.create(h),oe):h,m,q,X)(be)}}function q(ue){return ne(Re,_),W}function X(ue){return _.restore(),++ve<re.length?T(re[ve]):Z}}}function U(ne,oe){ne.resolveAll&&!o.includes(ne)&&o.push(ne),ne.resolve&&lr(h.events,oe,h.events.length-oe,ne.resolve(h.events.slice(oe),h)),ne.resolveTo&&(h.events=ne.resolveTo(h.events,h))}function V(){const ne=k(),oe=h.previous,Se=h.currentConstruct,G=h.events.length,W=Array.from(f);return{from:G,restore:Z};function Z(){a=ne,h.previous=oe,h.currentConstruct=Se,h.events.length=G,f=W,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function m8(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(a,o)];else{if(u=e.slice(n,l),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function p8(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
354
|
+
`;break}case-3:{u=`\r
|
|
355
|
+
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,a.push(u)}return a.join("")}function g8(e){const a={constructs:cE([f8,...(e||{}).extensions||[]]),content:l(RP),defined:[],document:l(OP),flow:l(X9),lazy:{},string:l(e8),text:l(t8)};return a;function l(o){return u;function u(f){return h8(a,o,f)}}}function y8(e){for(;!pE(e););return e}const Fw=/[\0\t\n\r]/g;function v8(){let e=1,t="",n=!0,a;return l;function l(o,u,f){const m=[];let h,y,g,x,w;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Fw.lastIndex=g,h=Fw.exec(o),x=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(x),!h){t=o.slice(g);break}if(w===10&&g===x&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<x&&(m.push(o.slice(g,x)),e+=x-g),w){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const b8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function x8(e){return e.replace(b8,w8)}function w8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return dE(n.slice(o?2:1),o?16:10)}return qy(n)||e}const wE={}.hasOwnProperty;function S8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),k8(n)(y8(g8(n).document().write(v8()(e,t,!0))))}function k8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Oa),autolinkProtocol:V,autolinkEmail:V,atxHeading:o(pt),blockQuote:o(ee),characterEscape:V,characterReference:V,codeFenced:o(me),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(me,u),codeText:o(_e,u),codeTextData:V,data:V,codeFlowValue:V,definition:o(Le),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(it),hardBreakEscape:o(Ur),hardBreakTrailing:o(Ur),htmlFlow:o(za,u),htmlFlowData:V,htmlText:o(za,u),htmlTextData:V,image:o(jl),label:u,link:o(Oa),listItem:o(Xr),listItemValue:x,listOrdered:o(Da,g),listUnordered:o(Da),paragraph:o(ro),reference:T,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(pt),strong:o(ao),thematicBreak:o(io)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:fe,autolinkProtocol:be,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:ue,characterReference:xe,codeFenced:m(C),codeFencedFence:j,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:m(E),codeText:m(W),codeTextData:F,data:F,definition:m(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:z,emphasis:m(),hardBreakEscape:m(oe),hardBreakTrailing:m(oe),htmlFlow:m(Se),htmlFlowData:F,htmlText:m(G),htmlTextData:F,image:m(re),label:Re,labelText:ve,lineEnding:ne,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:q,resourceDestinationString:_,resourceTitleString:L,resource:P,setextHeading:m(U),setextHeadingLineSequence:D,setextHeadingText:O,strong:m(),thematicBreak:m()}};SE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(le){let ye={type:"root",children:[]};const Ue={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:y,data:n},Be=[];let nt=-1;for(;++nt<le.length;)if(le[nt][1].type==="listOrdered"||le[nt][1].type==="listUnordered")if(le[nt][0]==="enter")Be.push(nt);else{const fn=Be.pop();nt=l(le,fn,nt)}for(nt=-1;++nt<le.length;){const fn=t[le[nt][0]];wE.call(fn,le[nt][1].type)&&fn[le[nt][1].type].call(Object.assign({sliceSerialize:le[nt][2].sliceSerialize},Ue),le[nt][1])}if(Ue.tokenStack.length>0){const fn=Ue.tokenStack[Ue.tokenStack.length-1];(fn[1]||qw).call(Ue,void 0,fn[0])}for(ye.position={start:oi(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:oi(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)ye=t.transforms[nt](ye)||ye;return ye}function l(le,ye,Ue){let Be=ye-1,nt=-1,fn=!1,or,Wt,Ft,hn;for(;++Be<=Ue;){const ft=le[Be];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?nt++:nt--,hn=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(or&&!hn&&!nt&&!Ft&&(Ft=Be),hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hn=void 0}if(!nt&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||nt===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(or){let Nr=Be;for(Wt=void 0;Nr--;){const On=le[Nr];if(On[1].type==="lineEnding"||On[1].type==="lineEndingBlank"){if(On[0]==="exit")continue;Wt&&(le[Wt][1].type="lineEndingBlank",fn=!0),On[1].type="lineEnding",Wt=Nr}else if(!(On[1].type==="linePrefix"||On[1].type==="blockQuotePrefix"||On[1].type==="blockQuotePrefixWhitespace"||On[1].type==="blockQuoteMarker"||On[1].type==="listItemIndent"))break}Ft&&(!Wt||Ft<Wt)&&(or._spread=!0),or.end=Object.assign({},Wt?le[Wt][1].start:ft[1].end),le.splice(Wt||Be,0,["exit",or,ft[2]]),Be++,Ue++}if(ft[1].type==="listItemPrefix"){const Nr={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};or=Nr,le.splice(Be,0,["enter",Nr,ft[2]]),Be++,Ue++,Ft=void 0,hn=!0}}}return le[ye][1]._spread=fn,Ue}function o(le,ye){return Ue;function Ue(Be){f.call(this,le(Be),Be),ye&&ye.call(this,Be)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(le,ye,Ue){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ye,Ue||void 0]),le.position={start:oi(ye.start),end:void 0}}function m(le){return ye;function ye(Ue){le&&le.call(this,Ue),h.call(this,Ue)}}function h(le,ye){const Ue=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==le.type&&(ye?ye.call(this,le,Be[0]):(Be[1]||qw).call(this,le,Be[0]));else throw new Error("Cannot close `"+le.type+"` ("+hu({start:le.start,end:le.end})+"): it’s not open");Ue.position.end=oi(le.end)}function y(){return Fy(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(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 w(){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 R(le){const ye=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ye,Ue.identifier=Dr(this.sliceSerialize(le)).toLowerCase()}function z(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function M(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function B(le){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Ue=this.sliceSerialize(le).length;ye.depth=Ue}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function D(le){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function V(le){const Ue=this.stack[this.stack.length-1].children;let Be=Ue[Ue.length-1];(!Be||Be.type!=="text")&&(Be=dn(),Be.position={start:oi(le.start),end:void 0},Ue.push(Be)),this.stack.push(Be)}function F(le){const ye=this.stack.pop();ye.value+=this.sliceSerialize(le),ye.position.end=oi(le.end)}function ne(le){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=ye.children[ye.children.length-1];Ue.position.end=oi(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(V.call(this,le),F.call(this,le))}function oe(){this.data.atHardBreak=!0}function Se(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function G(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function W(){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 re(){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 ve(le){const ye=this.sliceSerialize(le),Ue=this.stack[this.stack.length-2];Ue.label=x8(ye),Ue.identifier=Dr(ye).toLowerCase()}function Re(){const le=this.stack[this.stack.length-1],ye=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const Be=le.children;Ue.children=Be}else Ue.alt=ye}function _(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function L(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function P(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function q(le){const ye=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ye,Ue.identifier=Dr(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function X(le){this.data.characterReferenceType=le.type}function ue(le){const ye=this.sliceSerialize(le),Ue=this.data.characterReferenceType;let Be;Ue?(Be=dE(ye,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=qy(ye);const nt=this.stack[this.stack.length-1];nt.value+=Be}function xe(le){const ye=this.stack.pop();ye.position.end=oi(le.end)}function be(le){F.call(this,le);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(le)}function fe(le){F.call(this,le);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(le)}function ee(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function _e(){return{type:"inlineCode",value:""}}function Le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function it(){return{type:"emphasis",children:[]}}function pt(){return{type:"heading",depth:0,children:[]}}function Ur(){return{type:"break"}}function za(){return{type:"html",value:""}}function jl(){return{type:"image",title:null,url:"",alt:null}}function Oa(){return{type:"link",title:null,url:"",children:[]}}function Da(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Xr(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function ro(){return{type:"paragraph",children:[]}}function ao(){return{type:"strong",children:[]}}function dn(){return{type:"text",value:""}}function io(){return{type:"thematicBreak"}}}function oi(e){return{line:e.line,column:e.column,offset:e.offset}}function SE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?SE(e,a):j8(e,a)}}function j8(e,t){let n;for(n in t)if(wE.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 qw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hu({start:t.start,end:t.end})+") is still open")}function C8(e){const t=this;t.parser=n;function n(a){return S8(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function E8(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 N8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
356
|
+
`}]}function _8(e,t){const n=t.value?t.value+`
|
|
357
|
+
`:"",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 T8(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A8(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R8(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Ws(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=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(u)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function z8(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 O8(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function kE(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 u=l[l.length-1];return u&&u.type==="text"?u.value+=a:l.push({type:"text",value:a}),l}function D8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return kE(e,t);const l={src:Ws(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function M8(e,t){const n={src:Ws(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function I8(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 L8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return kE(e,t);const l={href:Ws(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function U8(e,t){const n={href:Ws(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function P8(e,t,n){const a=e.all(t),l=n?B8(n):jE(t),o={},u=[];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")&&u.push({type:"text",value:`
|
|
358
|
+
`}),y.type==="element"&&y.tagName==="p"&&!l?u.push(...y.children):u.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
|
|
359
|
+
`});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function B8(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=jE(n[a])}return t}function jE(e){const t=e.spread;return t??e.children.length>1}function $8(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 u=a[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function F8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function q8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function H8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z8(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Uy(t.children[1]),m=rE(t.children[t.children.length-1]);f&&m&&(u.position={start:f,end:m}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function V8(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],x={},w=u?u[m]:void 0;w&&(x.align=w);let k={type:"element",tagName:o,properties:x,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 Q8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Hw=9,Zw=32;function K8(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(Vw(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(Vw(t.slice(l),l>0,!1)),o.join("")}function Vw(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===Hw||o===Zw;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===Hw||o===Zw;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function G8(e,t){const n={type:"text",value:K8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Y8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const X8={blockquote:E8,break:N8,code:_8,delete:T8,emphasis:A8,footnoteReference:R8,heading:z8,html:O8,imageReference:D8,image:M8,inlineCode:I8,linkReference:L8,link:U8,listItem:P8,list:$8,paragraph:F8,root:q8,strong:H8,table:Z8,tableCell:Q8,tableRow:V8,text:G8,thematicBreak:Y8,toml:Td,yaml:Td,definition:Td,footnoteDefinition:Td};function Td(){}const CE=-1,Rf=0,pu=1,rf=2,Zy=3,Vy=4,Qy=5,Ky=6,EE=7,NE=8,Qw=typeof self=="object"?self:globalThis,J8=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case Rf:case CE:return n(u,l);case pu:{const f=n([],l);for(const m of u)f.push(a(m));return f}case rf:{const f=n({},l);for(const[m,h]of u)f[a(m)]=a(h);return f}case Zy:return n(new Date(u),l);case Vy:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case Qy:{const f=n(new Map,l);for(const[m,h]of u)f.set(a(m),a(h));return f}case Ky:{const f=n(new Set,l);for(const m of u)f.add(a(m));return f}case EE:{const{name:f,message:m}=u;return n(new Qw[f](m),l)}case NE:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new Qw[o](u),l)};return a},Kw=e=>J8(new Map,e)(0),hs="",{toString:W8}={},{keys:eB}=Object,su=e=>{const t=typeof e;if(t!=="object"||!e)return[Rf,t];const n=W8.call(e).slice(8,-1);switch(n){case"Array":return[pu,hs];case"Object":return[rf,hs];case"Date":return[Zy,hs];case"RegExp":return[Vy,hs];case"Map":return[Qy,hs];case"Set":return[Ky,hs];case"DataView":return[pu,n]}return n.includes("Array")?[pu,n]:n.includes("Error")?[EE,n]:[rf,n]},Ad=([e,t])=>e===Rf&&(t==="function"||t==="symbol"),tB=(e,t,n,a)=>{const l=(u,f)=>{const m=a.push(u)-1;return n.set(f,m),m},o=u=>{if(n.has(u))return n.get(u);let[f,m]=su(u);switch(f){case Rf:{let y=u;switch(m){case"bigint":f=NE,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([CE],u)}return l([f,y],u)}case pu:{if(m){let x=u;return m==="DataView"?x=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(x=new Uint8Array(u)),l([m,[...x]],u)}const y=[],g=l([f,y],u);for(const x of u)y.push(o(x));return g}case rf:{if(m)switch(m){case"BigInt":return l([m,u.toString()],u);case"Boolean":case"Number":case"String":return l([m,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const y=[],g=l([f,y],u);for(const x of eB(u))(e||!Ad(su(u[x])))&&y.push([o(x),o(u[x])]);return g}case Zy:return l([f,u.toISOString()],u);case Vy:{const{source:y,flags:g}=u;return l([f,{source:y,flags:g}],u)}case Qy:{const y=[],g=l([f,y],u);for(const[x,w]of u)(e||!(Ad(su(x))||Ad(su(w))))&&y.push([o(x),o(w)]);return g}case Ky:{const y=[],g=l([f,y],u);for(const x of u)(e||!Ad(su(x)))&&y.push(o(x));return g}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},Gw=(e,{json:t,lossy:n}={})=>{const a=[];return tB(!(t||n),!!t,new Map,a)(e),a},af=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Kw(Gw(e,t)):structuredClone(e):(e,t)=>Kw(Gw(e,t));function nB(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 rB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nB,a=e.options.footnoteBackLabel||rB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const y=e.all(h),g=String(h.identifier).toUpperCase(),x=Ws(g.toLowerCase());let w=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++w<=j;){k.length>0&&k.push({type:"text",value:" "});let R=typeof n=="string"?n:n(m,w);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const C=y[y.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const R=C.children[C.children.length-1];R&&R.type==="text"?R.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-"+x},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:{...af(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
360
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
361
|
+
`}]}}const zf=(function(e){if(e==null)return oB;if(typeof e=="function")return Of(e);if(typeof e=="object")return Array.isArray(e)?iB(e):lB(e);if(typeof e=="string")return sB(e);throw new Error("Expected function, string, or object as test")});function iB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zf(e[n]);return Of(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function lB(e){const t=e;return Of(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function sB(e){return Of(t);function t(n){return n&&n.type===e}}function Of(e){return t;function t(n,a,l){return!!(uB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function oB(){return!0}function uB(e){return e!==null&&typeof e=="object"&&"type"in e}const _E=[],cB=!0,Mg=!1,dB="skip";function TE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=zf(l),u=a?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return x;function x(){let w=_E,k,j,C;if((!t||o(m,h,y[y.length-1]||void 0))&&(w=fB(n(m,y)),w[0]===Mg))return w;if("children"in m&&m.children){const E=m;if(E.children&&w[0]!==dB)for(j=(a?E.children.length:-1)+u,C=y.concat(E);j>-1&&j<E.children.length;){const R=E.children[j];if(k=f(R,j,C)(),k[0]===Mg)return k;j=typeof k[1]=="number"?k[1]:j+u}}return w}}}function fB(e){return Array.isArray(e)?e:typeof e=="number"?[cB,e]:e==null?_E:[e]}function Gy(e,t,n,a){let l,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,l=n):(o=t,u=n,l=a),TE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return u(m,g,y)}}const Ig={}.hasOwnProperty,hB={};function mB(e,t){const n=t||hB,a=new Map,l=new Map,o=new Map,u={...X8,...n.handlers},f={all:h,applyData:gB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:pB,wrap:vB};return Gy(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:l,x=String(y.identifier).toUpperCase();g.has(x)||g.set(x,y)}}),f;function m(y,g){const x=y.type,w=f.handlers[x];if(Ig.call(f.handlers,x)&&w)return w(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in y){const{children:j,...C}=y,E=af(C);return E.children=f.all(y),E}return af(y)}return(f.options.unknownHandler||yB)(f,y,g)}function h(y){const g=[];if("children"in y){const x=y.children;let w=-1;for(;++w<x.length;){const k=f.one(x[w],y);if(k){if(w&&x[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Yw(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=Yw(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function pB(e,t){e.position&&(t.position=rP(e))}function gB(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 u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,af(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function yB(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 vB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
362
|
+
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
363
|
+
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
364
|
+
`}),n}function Yw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xw(e,t){const n=mB(e,t),a=n.one(e,void 0),l=aB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
365
|
+
`},l),o}function bB(e,t){return e&&"run"in e?async function(n,a){const l=Xw(n,{file:a,...t});await e.run(l,a)}:function(n,a){return Xw(n,{file:a,...e||t})}}function Jw(e){if(e)throw e}var Cp,Ww;function xB(){if(Ww)return Cp;Ww=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 x;for(x in h);return typeof x>"u"||e.call(h,x)},u=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(a)return a(h,y).value}else return;return h[y]};return Cp=function m(){var h,y,g,x,w,k,j=arguments[0],C=1,E=arguments.length,R=!1;for(typeof j=="boolean"&&(R=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),x=f(h,y),j!==x&&(R&&x&&(o(x)||(w=l(x)))?(w?(w=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},u(j,{name:y,newValue:m(R,k,x)})):typeof x<"u"&&u(j,{name:y,newValue:x}));return j},Cp}var wB=xB();const Ep=uf(wB);function Lg(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 SB(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){u(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?kB(y,f)(...h):u(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 kB(e,t){let n;return a;function a(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}catch(h){const y=h;if(f&&n)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(u,...f){n||(n=!0,t(u,...f))}function o(u){l(null,u)}}const Hr={basename:jB,dirname:CB,extname:EB,join:NB,sep:"/"};function jB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Yu(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 u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function CB(e){if(Yu(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 EB(e){Yu(e);let t=e.length,n=-1,a=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function NB(...e){let t=-1,n;for(;++t<e.length;)Yu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_B(n)}function _B(e){Yu(e);const t=e.codePointAt(0)===47;let n=TB(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function TB(e,t){let n="",a=0,l=-1,o=0,u=-1,f,m;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(l===u-1||o===1))if(l!==u-1&&o===2){if(n.length<2||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=u,o=0;continue}}else if(n.length>0){n="",a=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),a=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Yu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const AB={cwd:RB};function RB(){return"/"}function Ug(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function zB(e){if(typeof e=="string")e=new URL(e);else if(!Ug(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 OB(e)}function OB(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 Np=["history","path","basename","stem","extname","dirname"];class AE{constructor(t){let n;t?Ug(t)?n={path:t}:typeof t=="string"||DB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":AB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Np.length;){const o=Np[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)Np.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Hr.basename(this.path):void 0}set basename(t){Tp(t,"basename"),_p(t,"basename"),this.path=Hr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Hr.dirname(this.path):void 0}set dirname(t){eS(this.basename,"dirname"),this.path=Hr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Hr.extname(this.path):void 0}set extname(t){if(_p(t,"extname"),eS(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=Hr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ug(t)&&(t=zB(t)),Tp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Hr.basename(this.path,this.extname):void 0}set stem(t){Tp(t,"stem"),_p(t,"stem"),this.path=Hr.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 En(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 _p(e,t){if(e&&e.includes(Hr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Hr.sep+"`")}function Tp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function eS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function DB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MB=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),IB={}.hasOwnProperty;class Yy extends MB{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=SB()}copy(){const t=new Yy;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Ep(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(zp("data",this.frozen),this.namespace[t]=n,this):IB.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zp("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=Rd(t),a=this.parser||this.Parser;return Ap("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Ap("process",this.parser||this.Parser),Rp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=Rd(t),m=a.parse(f);a.run(m,f,function(y,g,x){if(y||!g||!x)return h(y);const w=g,k=a.stringify(w,x);PB(k)?x.value=k:x.result=k,h(y,x)});function h(y,g){y||!g?u(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),Ap("processSync",this.parser||this.Parser),Rp("processSync",this.compiler||this.Compiler),this.process(t,l),nS("processSync","process",n),a;function l(o,u){n=!0,Jw(o),a=u}}run(t,n,a){tS(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(u,f){const m=Rd(n);l.run(t,m,h);function h(y,g,x){const w=g||t;y?f(y):u?u(w):a(void 0,w,x)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),nS("runSync","run",a),l;function o(u,f){Jw(u),l=f,a=!0}}stringify(t,n){this.freeze();const a=Rd(n),l=this.compiler||this.Compiler;return Rp("stringify",l),tS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(zp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;m(y,g)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=Ep(!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,x=-1;for(;++g<a.length;)if(a[g][0]===h){x=g;break}if(x===-1)a.push([h,...y]);else if(y.length>0){let[w,...k]=y;const j=a[x][1];Lg(j)&&Lg(w)&&(w=Ep(!0,j,w)),a[x]=[h,w,...k]}}}}const LB=new Yy().freeze();function Ap(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Rp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zp(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 tS(e){if(!Lg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rd(e){return UB(e)?e:new AE(e)}function UB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function PB(e){return typeof e=="string"||BB(e)}function BB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $B="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rS=[],aS={allowDangerousHtml:!0},FB=/^(https?|ircs?|mailto|xmpp)$/i,qB=[{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 HB(e){const t=ZB(e),n=VB(e);return QB(t.runSync(t.parse(n),n),e)}function ZB(e){const t=e.rehypePlugins||rS,n=e.remarkPlugins||rS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...aS}:aS;return LB().use(C8).use(n).use(bB,a).use(t)}function VB(e){const t=e.children||"",n=new AE;return typeof t=="string"&&(n.value=t),n}function QB(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||KB;for(const y of qB)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+$B+y.id,void 0);return Gy(e,h),oP(e,{Fragment:c.Fragment,components:l,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(y,g,x){if(y.type==="raw"&&x&&typeof g=="number")return u?x.children.splice(g,1):x.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in Sp)if(Object.hasOwn(Sp,w)&&Object.hasOwn(y.properties,w)){const k=y.properties[w],j=Sp[w];(j===null||j.includes(y.tagName))&&(y.properties[w]=m(String(k||""),w,y))}}if(y.type==="element"){let w=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(y,g,x)),w&&x&&typeof g=="number")return f&&y.children?x.children.splice(g,1,...y.children):x.children.splice(g,1),g}}}function KB(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||FB.test(e.slice(0,t))?e:""}function GB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function RE(e,t,n){const l=zf((n||{}).ignore||[]),o=YB(t);let u=-1;for(;++u<o.length;)TE(e,"text",f);function f(h,y){let g=-1,x;for(;++g<y.length;){const w=y[g],k=x?x.children:void 0;if(l(w,k?k.indexOf(w):void 0,x))return;x=w}if(x)return m(h,y)}function m(h,y){const g=y[y.length-1],x=o[u][0],w=o[u][1];let k=0;const C=g.children.indexOf(h);let E=!1,R=[];x.lastIndex=0;let z=x.exec(h.value);for(;z;){const M=z.index,B={index:z.index,input:z.input,stack:[...y,h]};let O=w(...z,B);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?x.lastIndex=M+1:(k!==M&&R.push({type:"text",value:h.value.slice(k,M)}),Array.isArray(O)?R.push(...O):O&&R.push(O),k=M+z[0].length,E=!0),!x.global)break;z=x.exec(h.value)}return E?(k<h.value.length&&R.push({type:"text",value:h.value.slice(k)}),g.children.splice(C,1,...R)):R=[h],C+R.length}}function YB(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([XB(l[0]),JB(l[1])])}return t}function XB(e){return typeof e=="string"?new RegExp(GB(e),"g"):e}function JB(e){return typeof e=="function"?e:function(){return e}}function WB(e){RE(e,[/\r?\n|\r/g,e$])}function e$(){return{type:"break"}}function t$(){return function(e){WB(e)}}function iS(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 Op="phrasing",Dp=["autolink","link","image","label"];function n$(){return{transforms:[u$],enter:{literalAutolink:a$,literalAutolinkEmail:Mp,literalAutolinkHttp:Mp,literalAutolinkWww:Mp},exit:{literalAutolink:o$,literalAutolinkEmail:s$,literalAutolinkHttp:i$,literalAutolinkWww:l$}}}function r$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Op,notInConstruct:Dp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Op,notInConstruct:Dp},{character:":",before:"[ps]",after:"\\/",inConstruct:Op,notInConstruct:Dp}]}}function a$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Mp(e){this.config.enter.autolinkProtocol.call(this,e)}function i$(e){this.config.exit.autolinkProtocol.call(this,e)}function l$(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 s$(e){this.config.exit.autolinkEmail.call(this,e)}function o$(e){this.exit(e)}function u$(e){RE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,c$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),d$]],{ignore:["link","linkReference"]})}function c$(e,t,n,a,l){let o="";if(!zE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!f$(n)))return!1;const u=h$(n+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function d$(e,t,n,a){return!zE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function f$(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 h$(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=iS(e,"(");let o=iS(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 zE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||vl(n)||Tf(n))&&(!t||n!==47)}OE.peek=S$;function m$(){this.buffer()}function p$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function g$(){this.buffer()}function y$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function v$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function b$(e){this.exit(e)}function x$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function w$(e){this.exit(e)}function S$(){return"["}function OE(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function k$(){return{enter:{gfmFootnoteCallString:m$,gfmFootnoteCall:p$,gfmFootnoteDefinitionLabelString:g$,gfmFootnoteDefinition:y$},exit:{gfmFootnoteCallString:v$,gfmFootnoteCall:b$,gfmFootnoteDefinitionLabelString:x$,gfmFootnoteDefinition:w$}}}function j$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:OE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,u){const f=o.createTracker(u);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
366
|
+
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?DE:C$))),h(),m}}function C$(e,t,n){return t===0?e:DE(e,t,n)}function DE(e,t,n){return(n?"":" ")+e}const E$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ME.peek=R$;function N$(){return{canContainEols:["delete"],enter:{strikethrough:T$},exit:{strikethrough:A$}}}function _$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:E$}],handlers:{delete:ME}}}function T$(e){this.enter({type:"delete",children:[]},e)}function A$(e){this.exit(e)}function ME(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function R$(){return"~"}function z$(e){return e.length}function O$(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||z$,o=[],u=[],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 R=D$(e[y][E]);if(n.alignDelimiters!==!1){const z=l(R);C[E]=z,(m[E]===void 0||z>m[E])&&(m[E]=z)}j.push(R)}u[y]=j,f[y]=C}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=lS(a[g]);else{const j=lS(a);for(;++g<h;)o[g]=j}g=-1;const x=[],w=[];for(;++g<h;){const j=o[g];let C="",E="";j===99?(C=":",E=":"):j===108?C=":":j===114&&(E=":");let R=n.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-E.length);const z=C+"-".repeat(R)+E;n.alignDelimiters!==!1&&(R=C.length+R+E.length,R>m[g]&&(m[g]=R),w[g]=R),x[g]=z}u.splice(1,0,x),f.splice(1,0,w),y=-1;const k=[];for(;++y<u.length;){const j=u[y],C=f[y];g=-1;const E=[];for(;++g<h;){const R=j[g]||"";let z="",M="";if(n.alignDelimiters!==!1){const B=m[g]-(C[g]||0),O=o[g];O===114?z=" ".repeat(B):O===99?B%2?(z=" ".repeat(B/2+.5),M=" ".repeat(B/2-.5)):(z=" ".repeat(B/2),M=z):M=" ".repeat(B)}n.delimiterStart!==!1&&!g&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||g)&&E.push(" "),n.alignDelimiters!==!1&&E.push(z),E.push(R),n.alignDelimiters!==!1&&E.push(M),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(`
|
|
367
|
+
`)}function D$(e){return e==null?"":String(e)}function lS(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 M$(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),I$);return l(),u}function I$(e,t,n){return">"+(n?"":" ")+e}function L$(e,t){return sS(e,t.inConstruct,!0)&&!sS(e,t.notInConstruct,!1)}function sS(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 oS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
368
|
+
`&&L$(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
369
|
+
`}function U$(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>u&&(u=o):o=1,l=a+t.length,a=n.indexOf(t,l);return u}function P$(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 B$(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 $$(e,t,n,a){const l=B$(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(P$(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(o,F$);return g(),x}const f=n.createTracker(a),m=l.repeat(Math.max(U$(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${u}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
370
|
+
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
371
|
+
`),o&&(y+=f.move(o+`
|
|
372
|
+
`)),y+=f.move(m),h(),y}function F$(e,t,n){return(n?"":" ")+e}function Xy(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 q$(e,t,n,a){const l=Xy(n),o=l==='"'?"Quote":"Apostrophe",u=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?" ":`
|
|
373
|
+
`,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),u(),h}function H$(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 Tu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function lf(e,t,n){const a=qs(e),l=qs(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}}IE.peek=Z$;function IE(e,t,n,a){const l=H$(n),o=n.enter("emphasis"),u=n.createTracker(a),f=u.move(l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=lf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Tu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),x=lf(a.after.charCodeAt(0),g,l);x.inside&&(m=m.slice(0,-1)+Tu(g));const w=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},f+m+w}function Z$(e,t,n){return n.options.emphasis||"*"}function V$(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,Mg}),!!((!e.depth||e.depth<3)&&Fy(e)&&(t.options.setext||n))}function Q$(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(V$(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...o.current(),before:`
|
|
374
|
+
`,after:`
|
|
375
|
+
`});return g(),y(),x+`
|
|
376
|
+
`+(l===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
377
|
+
`))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
378
|
+
`,...o.current()});return/^[\t ]/.test(h)&&(h=Tu(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}LE.peek=K$;function LE(e){return e.value||""}function K$(){return"<"}UE.peek=G$;function UE(e,t,n,a){const l=Xy(n),o=l==='"'?"Quote":"Apostrophe",u=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(")"),u(),h}function G$(){return"!"}PE.peek=Y$;function PE(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let u=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+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function Y$(){return"!"}BE.peek=X$;function BE(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 u=n.unsafe[o],f=n.compilePattern(u);let m;if(u.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 X$(){return"`"}function $E(e,t){const n=Fy(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))}FE.peek=J$;function FE(e,t,n,a){const l=Xy(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let f,m;if($E(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=u.move("<");return g+=u.move(n.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function J$(e,t,n){return $E(e,n)?"<":"["}qE.peek=W$;function qE(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let u=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+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function W$(){return"["}function Jy(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 eF(e){const t=Jy(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 tF(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 HE(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 nF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?tF(n):Jy(n);const f=e.ordered?u==="."?")":".":eF(n);let m=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),HE(n)===u&&y){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,a);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),h}function rF(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 aF(e,t,n,a){const l=rF(n);let o=n.bulletCurrent||Jy(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(u-o.length)),f.shift(u);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,x,w){return x?(w?"":" ".repeat(u))+g:(w?o:o+" ".repeat(u-o.length))+g}}function iF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,a);return o(),l(),u}const lF=zf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sF(e,t,n,a){return(e.children.some(function(u){return lF(u)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function oF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ZE.peek=uF;function ZE(e,t,n,a){const l=oF(n),o=n.enter("strong"),u=n.createTracker(a),f=u.move(l+l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=lf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Tu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),x=lf(a.after.charCodeAt(0),g,l);x.inside&&(m=m.slice(0,-1)+Tu(g));const w=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},f+m+w}function uF(e,t,n){return n.options.strong||"*"}function cF(e,t,n,a){return n.safe(e.value,a)}function dF(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 fF(e,t,n){const a=(HE(n)+(n.options.ruleSpaces?" ":"")).repeat(dF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const VE={blockquote:M$,break:oS,code:$$,definition:q$,emphasis:IE,hardBreak:oS,heading:Q$,html:LE,image:UE,imageReference:PE,inlineCode:BE,link:FE,linkReference:qE,list:nF,listItem:aF,paragraph:iF,root:sF,strong:ZE,text:cF,thematicBreak:fF};function hF(){return{enter:{table:mF,tableData:uS,tableHeader:uS,tableRow:gF},exit:{codeText:yF,table:pF,tableData:Ip,tableHeader:Ip,tableRow:Ip}}}function mF(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 gF(e){this.enter({type:"tableRow",children:[]},e)}function Ip(e){this.exit(e)}function uS(e){this.enter({type:"tableCell",children:[]},e)}function yF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vF(e,t){return t==="|"?t:e}function bF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
379
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:m,tableRow:f}};function u(w,k,j,C){return h(y(w,j,C),w.align)}function f(w,k,j,C){const E=g(w,j,C),R=h([E]);return R.slice(0,R.indexOf(`
|
|
380
|
+
`))}function m(w,k,j,C){const E=j.enter("tableCell"),R=j.enter("phrasing"),z=j.containerPhrasing(w,{...C,before:o,after:o});return R(),E(),z}function h(w,k){return O$(w,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(w,k,j){const C=w.children;let E=-1;const R=[],z=k.enter("table");for(;++E<C.length;)R[E]=g(C[E],k,j);return z(),R}function g(w,k,j){const C=w.children;let E=-1;const R=[],z=k.enter("tableRow");for(;++E<C.length;)R[E]=m(C[E],w,k,j);return z(),R}function x(w,k,j){let C=VE.inlineCode(w,k,j);return j.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function xF(){return{exit:{taskListCheckValueChecked:cS,taskListCheckValueUnchecked:cS,paragraph:SF}}}function wF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:kF}}}function cS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function SF(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,u;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){u=f;break}}u===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 kF(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(u);let m=VE.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+u}}function jF(){return[n$(),k$(),N$(),hF(),xF()]}function CF(e){return{extensions:[r$(),j$(e),_$(),bF(e),wF()]}}const EF={tokenize:zF,partial:!0},QE={tokenize:OF,partial:!0},KE={tokenize:DF,partial:!0},GE={tokenize:MF,partial:!0},NF={tokenize:IF,partial:!0},YE={name:"wwwAutolink",tokenize:AF,previous:JE},XE={name:"protocolAutolink",tokenize:RF,previous:WE},Ra={name:"emailAutolink",tokenize:TF,previous:eN},Yr={};function _F(){return{text:Yr}}let rl=48;for(;rl<123;)Yr[rl]=Ra,rl++,rl===58?rl=65:rl===91&&(rl=97);Yr[43]=Ra;Yr[45]=Ra;Yr[46]=Ra;Yr[95]=Ra;Yr[72]=[Ra,XE];Yr[104]=[Ra,XE];Yr[87]=[Ra,YE];Yr[119]=[Ra,YE];function TF(e,t,n){const a=this;let l,o;return u;function u(g){return!Pg(g)||!eN.call(a,a.previous)||Wy(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Pg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(NF,y,h)(g):g===45||g===95||Cn(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&&An(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function AF(e,t,n){const a=this;return l;function l(u){return u!==87&&u!==119||!JE.call(a,a.previous)||Wy(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(EF,e.attempt(QE,e.attempt(KE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function RF(e,t,n){const a=this;let l="",o=!1;return u;function u(g){return(g===72||g===104)&&WE.call(a,a.previous)&&!Wy(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(An(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const x=l.toLowerCase();if(x==="http"||x==="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||nf(g)||jt(g)||vl(g)||Tf(g)?n(g):e.attempt(QE,e.attempt(KE,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function zF(e,t,n){let a=0;return l;function l(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),l):u===46&&a===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function OF(e,t,n){let a,l,o;return u;function u(h){return h===46||h===95?e.check(GE,m,f)(h):h===null||jt(h)||vl(h)||h!==45&&Tf(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),u}function m(h){return l||a||!o?n(h):t(h)}}function DF(e,t){let n=0,a=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&a<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(GE,t,o)(u):u===null||jt(u)||vl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&a++,e.consume(u),l}}function MF(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||jt(f)||vl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||jt(f)||vl(f)?t(f):a(f)}function o(f){return An(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),a):An(f)?(e.consume(f),u):n(f)}}function IF(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return Cn(o)?n(o):t(o)}}function JE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function WE(e){return!An(e)}function eN(e){return!(e===47||Pg(e))}function Pg(e){return e===43||e===45||e===46||e===95||Cn(e)}function Wy(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 LF={tokenize:ZF,partial:!0};function UF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:FF,continuation:{tokenize:qF},exit:HF}},text:{91:{name:"gfmFootnoteCall",tokenize:$F},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PF,resolveTo:BF}}}}function PF(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){u=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!u||!u._balanced)return n(m);const h=Dr(a.sliceSerialize({start:u.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 BF(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)},u={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",u,t],["exit",u,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 $F(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!u||g===null||g===91||jt(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return l.includes(Dr(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return jt(g)||(u=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function FF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(k)}function y(k){if(u>999||k===93&&!f||k===null||k===91||jt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Dr(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return jt(k)||(f=!0),u++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function x(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),lt(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function qF(e,t,n){return e.check(Gu,t,e.attempt(LF,t,n))}function HF(e){e.exit("gfmFootnoteDefinition")}function ZF(e,t,n){const a=this;return lt(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function VF(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(u,f){let m=-1;for(;++m<u.length;)if(u[m][0]==="enter"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._close){let h=m;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[m][1].end.offset-u[m][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[m][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},g={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},x=[["enter",y,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",g,f]],w=f.parser.constructs.insideSpan.null;w&&lr(x,x.length,0,Af(w,u.slice(h+1,m),f)),lr(x,x.length,0,[["exit",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",y,f]]),lr(u,h-1,m-h+3,x),m=h+x.length-2;break}}for(m=-1;++m<u.length;)u[m][1].type==="strikethroughSequenceTemporary"&&(u[m][1].type="data");return u}function o(u,f,m){const h=this.previous,y=this.events;let g=0;return x;function x(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(u.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const j=qs(h);if(k===126)return g>1?m(k):(u.consume(k),g++,w);if(g<2&&!n)return m(k);const C=u.exit("strikethroughSequenceTemporary"),E=qs(k);return C._open=!E||E===2&&!!j,C._close=!j||j===2&&!!E,f(k)}}}class QF{constructor(){this.map=[]}add(t,n,a){KF(this,t,n,a)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const 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 KF(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 GF(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 YF(){return{flow:{null:{name:"table",tokenize:XF,resolveAll:JF}}}}function XF(e,t,n){const a=this;let l=0,o=0,u;return f;function f(F){let ne=a.events.length-1;for(;ne>-1;){const G=a.events[ne][1].type;if(G==="lineEnding"||G==="linePrefix")ne--;else break}const oe=ne>-1?a.events[ne][1].type:null,Se=oe==="tableHead"||oe==="tableRow"?O:m;return Se===O&&a.parser.lazy[a.now().line]?n(F):Se(F)}function m(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(u=!0,o+=1),y(F)}function y(F){return F===null?n(F):De(F)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),w):n(F):Je(F)?lt(e,y,"whitespace")(F):(o+=1,u&&(u=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),g(F)))}function g(F){return F===null||F===124||jt(F)?(e.exit("data"),y(F)):(e.consume(F),F===92?x:g)}function x(F){return F===92||F===124?(e.consume(F),g):g(F)}function w(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),u=!1,Je(F)?lt(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):k(F))}function k(F){return F===45||F===58?C(F):F===124?(u=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),j):B(F)}function j(F){return Je(F)?lt(e,C,"whitespace")(F):C(F)}function C(F){return F===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),E):F===45?(o+=1,E(F)):F===null||De(F)?M(F):B(F)}function E(F){return F===45?(e.enter("tableDelimiterFiller"),R(F)):B(F)}function R(F){return F===45?(e.consume(F),R):F===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):(e.exit("tableDelimiterFiller"),z(F))}function z(F){return Je(F)?lt(e,M,"whitespace")(F):M(F)}function M(F){return F===124?k(F):F===null||De(F)?!u||l!==o?B(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):B(F)}function B(F){return n(F)}function O(F){return e.enter("tableRow"),D(F)}function D(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),D):F===null||De(F)?(e.exit("tableRow"),t(F)):Je(F)?lt(e,D,"whitespace")(F):(e.enter("data"),U(F))}function U(F){return F===null||F===124||jt(F)?(e.exit("data"),D(F)):(e.consume(F),F===92?V:U)}function V(F){return F===92||F===124?(e.consume(F),U):U(F)}}function JF(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,y,g;const x=new QF;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(dS(x,t,m,h,y),y=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.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,u[2]===0&&(o[1]!==0&&(u[0]=u[1],g=zd(x,t,o,l,void 0,g),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],g=zd(x,t,o,l,void 0,g)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(u[0]=u[1],g=zd(x,t,o,l,n,g)):u[1]!==0&&(g=zd(x,t,u,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&dS(x,t,m,h,y),x.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=GF(t.events,n))}return e}function zd(e,t,n,a,l,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},gs(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=gs(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=gs(t.events,n[2]),y=gs(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const x=t.events[n[2]],w=t.events[n[3]];if(x[1].end=Object.assign({},w[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},gs(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function dS(e,t,n,a,l){const o=[],u=gs(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),a.end=Object.assign({},u),o.push(["exit",a,t]),e.add(n+1,0,o)}function gs(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const WF={name:"tasklistCheck",tokenize:tq};function eq(){return{text:{91:WF}}}function tq(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 jt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),u):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),u):n(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return De(m)?t(m):Je(m)?e.check({tokenize:nq},t,n)(m):n(m)}}function nq(e,t,n){return lt(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function rq(e){return cE([_F(),UF(),VF(e),YF(),eq()])}const aq={};function iq(e){const t=this,n=e||aq,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(rq(n)),o.push(jF()),u.push(CF(n))}function tN({children:e,className:t}){return c.jsx("div",{className:Ae("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:c.jsx(HB,{remarkPlugins:[iq,t$],children:e})})}function lq({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,u]=b.useState(!1),f=b.useRef(null),m=e!==t;return b.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),c.jsxs(Hn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[c.jsxs(_a,{children:[c.jsxs(Ta,{children:["System prompt append",m&&c.jsx(sq,{})]}),!o&&!l&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[c.jsx(mf,{className:"h-3 w-3"})," Edit"]})]}),c.jsx(Aa,{children:o?c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(ge,{size:"xs",variant:"ghost",onClick:()=>{a(),u(!1)},disabled:!m,children:"Revert"}),c.jsx(ge,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),c.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."})]}):c.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?c.jsx(tN,{children:e}):c.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function sq(){return c.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 nN={"claude-code":"Claude Code",codex:"Codex"},oq=[Jd.CLAUDE_CODE,Jd.CODEX];function uq({open:e,onOpenChange:t,agent:n}){const a=an(),l=n.clientId,o=n.runtimeProvider,[u,f]=b.useState(l),[m,h]=b.useState(o),[y,g]=b.useState(!1),w=Ve({queryKey:["clients-rebind"],queryFn:Ei,enabled:e}).data??[],k=cT({queries:w.map(U=>({queryKey:["client-capabilities",U.id],queryFn:()=>my(U.id),enabled:e}))}),j=b.useMemo(()=>{const U=new Map;return k.forEach((V,F)=>{const ne=w[F];if(!ne)return;const oe=V.data;oe!=null&&oe.capabilities&&U.set(ne.id,oe.capabilities)}),U},[k,w]);b.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const C=u?j.get(u)??null:null,E=(C==null?void 0:C[m])??null,R=!E||E.state==="missing"||E.state==="error",z=!!u&&(u!==l||m!==o)&&(!R||y),M=m!==o,B=u!==l,O=kt({mutationFn:()=>{if(!u)throw new Error("clientId required");return _D(n.uuid,{clientId:u,runtimeProvider:m,force:R&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),D=O.error instanceof Fu||O.error instanceof Error?O.error.message:null;return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{className:"max-w-lg",children:[c.jsx(cn,{children:c.jsx(rn,{children:"Re-bind agent"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",c.jsx("span",{className:"mono",children:dq(l,w,o)})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Computer"}),c.jsx("select",{value:u??"",onChange:U=>f(U.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:w.map(U=>c.jsx("option",{value:U.id,children:cq(U)},U.id))})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Runtime"}),c.jsx("div",{className:"space-y-2",children:oq.map(U=>{const V=(C==null?void 0:C[U])??null,F=!!V&&V.state!=="missing",ne=m===U;return c.jsxs("label",{className:ne?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":F?"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:[c.jsx("input",{type:"radio",name:"rebind-runtime",checked:ne,onChange:()=>h(U),className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",children:nN[U]}),c.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:hq(V,U)})]})]},U)})})]}),(B||M)&&c.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[c.jsxs("p",{children:[c.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),M&&c.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),R&&c.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[c.jsx("input",{type:"checkbox",checked:y,onChange:U=>g(U.target.checked),className:"mt-0.5"}),c.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."})]}),D&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:D})]}),c.jsxs(Rn,{children:[c.jsx(ge,{variant:"outline",onClick:()=>t(!1),disabled:O.isPending,children:"Cancel"}),c.jsx(ge,{onClick:()=>O.mutate(),disabled:!z||O.isPending,children:O.isPending?"Re-binding…":"Re-bind"})]})]})})}function cq(e){return`${e.hostname??e.id} · ${e.status}`}function dq(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${nN[n]}`}const fq={"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 hq(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. ${fq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const mq={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 c.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:c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx(fu,{state:"blocked",size:8}),c.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),c.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),c.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>c.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:mq[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&c.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[c.jsx(jr,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&c.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&c.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&c.jsx(ge,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),c.jsx(ge,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),c.jsx(ge,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx($R,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function gu(e){return`agent-cfg-${e}`}function ou({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:u}){return c.jsxs("section",{id:e,className:Ae("space-y-3",o),...u,children:[c.jsxs("div",{className:"flex items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&c.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),c.jsx("div",{className:"space-y-3",children:l})]})}function gq(){return c.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const yq={"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 vq(e){const t=yq[e.runtimeProvider];return c.jsxs("div",{className:"space-y-3",children:[c.jsx(bq,{name:t.name,caption:t.caption,locked:!0}),c.jsx(xq,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function bq({name:e,caption:t,locked:n}){return c.jsxs(Hn,{children:[c.jsx(_a,{children:c.jsxs(Ta,{children:["Where it runs",n&&c.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[c.jsx(Rk,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),c.jsxs(Aa,{className:"space-y-1 text-body",children:[c.jsxs("div",{className:"inline-flex items-center gap-2",children:[c.jsx(zk,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),c.jsx("span",{className:"font-medium",children:e})]}),c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function xq(e){const t=!!e.computerLabel;return c.jsxs(Hn,{children:[c.jsxs(_a,{children:[c.jsx(Ta,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[c.jsx(mg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:e.onRebind,children:[c.jsx(mg,{className:"h-3 w-3"}),"Re-bind"]})]}),c.jsx(Aa,{className:"text-body",children:t?c.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):c.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 wq(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 Sq(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function kq(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Lp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function fS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:kq(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Up(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=Sq(n,u),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:fS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:fS(f)}}),remove:a=>t(l=>{const u=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:a=>t(l=>{const u=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function jq(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Lp(e.payload.mcpServers,"mcp"),env:Lp(e.payload.env,"env"),git:Lp(e.payload.gitRepos,"git")}}function Cq(e){const[t,n]=b.useState(null);b.useEffect(()=>{e&&t===null&&n(jq(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)??"",u=a.promptAppend!==l,f=a.model!==o,m=b.useMemo(()=>{const z=[],M=U=>U.reduce((V,F)=>F.status==="unchanged"?V:V+1,0),B=M(a.mcp),O=M(a.env),D=M(a.git);return u&&z.push("prompt"),f&&z.push("model"),B>0&&z.push("mcp"),O>0&&z.push("env"),D>0&&z.push("git"),{anyDirty:z.length>0,dirtySections:z,counts:{prompt:u?1:0,model:f?1:0,mcp:B,env:O,git:D}}},[a,u,f]),h=b.useCallback(z=>{n(M=>M&&z(M))},[]),y=b.useCallback(z=>h(M=>({...M,promptAppend:z})),[h]),g=b.useCallback(()=>h(z=>({...z,promptAppend:l})),[h,l]),x=b.useCallback(z=>h(M=>({...M,model:z})),[h]),w=b.useCallback(()=>h(z=>({...z,model:o})),[h,o]),k=b.useMemo(()=>Up("mcp",h),[h]),j=b.useMemo(()=>Up("env",h),[h]),C=b.useMemo(()=>Up("git",h),[h]),E=b.useCallback(()=>{n(null)},[]),R=b.useCallback(()=>{if(!t||!e)return{};const z={};u&&(z.prompt={append:t.promptAppend}),f&&(z.model=t.model);const M=m.counts.mcp>0,B=m.counts.env>0,O=m.counts.git>0;return M&&(z.mcpServers=t.mcp.filter(D=>D.status!=="deleted").map(D=>D.value)),B&&(z.env=t.env.filter(D=>D.status!=="deleted").map(D=>{const U=D.value;return U.sensitive&&U.value===Wd?{key:U.key,value:Wd,sensitive:!0}:U})),O&&(z.gitRepos=t.git.filter(D=>D.status!=="deleted").map(D=>D.value)),z},[t,e,u,f,m]);return{draft:a,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:x,revertModel:w,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:C.add,updateGit:C.update,deleteGit:C.remove,undoDeleteGit:C.undo,resetAll:E,buildPayloadPatch:R}}const kn={overview:"ad-overview",setup:"ad-setup",prompt:gu("prompt"),tools:gu("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function Eq(e){const t=[{key:"overview",label:"Profile",anchor:kn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:kn.setup},{key:"prompt",label:"Prompt",anchor:kn.prompt},{key:"tools",label:"Tools",anchor:kn.tools},{key:"advanced",label:"Advanced",anchor:kn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:kn.danger,divider:!0,danger:!0}),t}function Nq(){var hn,ft,Nr,On,Wu,Mi,Ii,Li,Pr,Ui,Ma,ec;const t=hk().uuid??"",n=zn(),a=an(),l=Ve({queryKey:["agent",t],queryFn:()=>CD(t),enabled:!!t}),o=Ve({queryKey:["agent-config",t],queryFn:()=>X6(t),enabled:!!t&&((hn=l.data)==null?void 0:hn.type)!=="human"}),u=Ve({queryKey:["agent-client-status",t],queryFn:()=>eU(t),enabled:!!t&&((ft=l.data)==null?void 0:ft.type)!=="human"}),f=Ve({queryKey:["agent-sessions-active",t],queryFn:()=>Yk(t,{state:"active"}),enabled:!!t&&((Nr=l.data)==null?void 0:Nr.type)!=="human"}),m=Ve({queryKey:["clients"],queryFn:Ei,enabled:!!t&&((On=l.data)==null?void 0:On.type)!=="human",refetchInterval:3e4}),h=Cq(o.data),[y,g]=b.useState(null),[x,w]=b.useState(null),[k,j]=b.useState(!1),C=kt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const we=h.buildPayloadPatch();return J6(t,{expectedVersion:o.data.version,payload:we})},onSuccess:we=>{a.setQueryData(["agent-config",t],we),g(null),w(null),j(!0)},onError:we=>{if(j(!1),we instanceof Fu&&we.status===409){w("Someone else saved a newer version while you were editing."),g(null);return}g(we instanceof Error?we.message:String(we))}});b.useEffect(()=>{if(!k)return;const we=setTimeout(()=>j(!1),2500);return()=>clearTimeout(we)},[k]),b.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const E=b.useCallback(()=>{w(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),R=b.useCallback(we=>{const Ge=document.getElementById(we);Ge&&Ge.scrollIntoView({behavior:"smooth",block:"start"})},[]),z=kt({mutationFn:we=>K1(t,we),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),M=kt({mutationFn:()=>AD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),B=kt({mutationFn:()=>RD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),O=kt({mutationFn:()=>TD(t),onSuccess:()=>n("/team")}),D=kt({mutationFn:()=>zD(t)}),[U,V]=b.useState(!1),[F,ne]=b.useState(""),[oe,Se]=b.useState(null),[G,W]=b.useState(!1),Z=Ve({queryKey:["clients"],queryFn:Ei,enabled:U}),re=kt({mutationFn:we=>K1(t,{clientId:we}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),V(!1),ne(""),Se(null)},onError:we=>Se(we instanceof Error?we.message:String(we))}),[ve,Re]=b.useState(!1),[_,L]=b.useState(null),P=kt({mutationFn:()=>W6(t,h.buildPayloadPatch()),onSuccess:we=>{const Ge=we.diff.length?we.diff.map(mn=>`${mn.op} ${mn.path}`).join(`
|
|
381
|
+
`):"(no changes)";L(Ge)},onError:we=>L(`Dry run failed: ${we instanceof Error?we.message:String(we)}`)});b.useEffect(()=>{if(!h.summary.anyDirty)return;const we=Ge=>{Ge.preventDefault(),Ge.returnValue=""};return window.addEventListener("beforeunload",we),()=>window.removeEventListener("beforeunload",we)},[h.summary.anyDirty]);const T=((Wu=l.data)==null?void 0:Wu.type)==="human",q=b.useMemo(()=>Eq(T),[T]),X=b.useRef(null),[ue,xe]=b.useState(!1);b.useEffect(()=>{if(T)return;const we=X.current;if(!we||typeof IntersectionObserver>"u")return;const Ge=new IntersectionObserver(mn=>{const Jr=mn[0];Jr&&xe(!Jr.isIntersecting&&Jr.boundingClientRect.top<0)},{threshold:0});return Ge.observe(we),()=>Ge.disconnect()},[T]);const[be,fe]=b.useState(kn.overview);b.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const we=[];for(const Ge of q){const mn=document.getElementById(Ge.anchor);if(!mn)continue;const Jr=new IntersectionObserver(lo=>{for(const tc of lo)tc.isIntersecting&&fe(Ge.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});Jr.observe(mn),we.push(Jr)}return()=>{for(const Ge of we)Ge.disconnect()}},[q]);const ee=b.useMemo(()=>{const we=new Set;for(const Ge of h.summary.dirtySections)Ge==="prompt"&&we.add(kn.prompt),Ge==="model"&&we.add(kn.setup),Ge==="mcp"&&we.add(kn.tools),(Ge==="env"||Ge==="git")&&we.add(kn.advanced);return we},[h.summary.dirtySections]);if(l.isLoading)return c.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:c.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return c.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 me=l.data;if(!me)return c.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const _e=me.type==="human",Le=u.data,it=((Mi=f.data)==null?void 0:Mi.length)??0,pt=!_e&&!(Le!=null&&Le.clientId),Ur=!_e&&Le?!Le.online&&!!Le.clientId:!1,za=me,jl=za.runtimeState??null,Oa=za.runtimeType??null,Da=za.totalSessions??null,Xr=me.uuid.slice(0,8),ro=wq({activeSessions:it,isUnclaimed:pt,isOffline:Ur}),ao=h.draft.mcp.filter(we=>we.status!=="deleted"),dn=h.draft.env.filter(we=>we.status!=="deleted"),io=h.draft.git.filter(we=>we.status!=="deleted"),le=we=>new Set(ao.filter(Ge=>Ge.key!==we).map(Ge=>Ge.value.name.toLowerCase())),ye=we=>new Set(dn.filter(Ge=>Ge.key!==we).map(Ge=>Ge.value.key)),Ue=we=>new Set(io.filter(Ge=>Ge.key!==we).map(Ge=>{const{value:mn}=Ge;return mn.localPath?mn.localPath:((mn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Be={sessions:Da??"—",active:it,runtime:Oa??(_e?"human":"—"),model:((Li=(Ii=o.data)==null?void 0:Ii.payload.model)==null?void 0:Li.trim())||"—"},nt=(Le==null?void 0:Le.clientId)??null,fn=nt?((Pr=m.data)==null?void 0:Pr.find(we=>we.id===nt))??null:null,or=nt?(fn==null?void 0:fn.hostname)??nt:null,Wt=me.runtimeProvider??"claude-code",Ft=Wt==="codex"?"Codex":"Claude Code";return c.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[c.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:[c.jsx(Nf,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),q.map(we=>c.jsxs("div",{children:[we.divider&&c.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),c.jsx(_q,{label:we.label,active:be===we.anchor,danger:we.danger??!1,dirty:ee.has(we.anchor),onClick:()=>R(we.anchor)})]},we.key))]}),c.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[c.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[c.jsxs(tU,{style:{marginBottom:"var(--sp-2)"},children:[c.jsx(nU,{onClick:()=>n("/team"),children:"Agents"}),c.jsx(rU,{}),c.jsx(aU,{mono:!0,children:me.name??Xr})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.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:c.jsx(Vu,{width:18,height:20,style:{color:"var(--accent)"}})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-title",title:`agt_${Xr}`,children:me.displayName}),c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",me.name??Xr]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[c.jsx(zr,{tone:me.type==="autonomous_agent"?"accent":"neutral",children:me.type}),me.visibility&&c.jsx(zr,{tone:me.visibility==="organization"?"accent":"outline",children:me.visibility}),(Le==null?void 0:Le.offlineSince)&&c.jsxs("span",{className:"mono",children:["offline since ",pl(Le.offlineSince)]})]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(Nu,{state:jl}),c.jsxs(ge,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${me.uuid}`),children:[c.jsx(uy,{className:"h-3 w-3"})," Open chat"]}),!_e&&me.status==="active"&&c.jsxs(ge,{variant:"outline",size:"xs",onClick:()=>{D.reset(),D.mutate()},disabled:D.isPending,children:[c.jsx(zk,{className:"h-3 w-3"}),D.isPending?"Testing…":"Test"]})]})]}),c.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[c.jsx(_d,{label:"sessions",value:Be.sessions}),c.jsx(_d,{label:"active",value:Be.active,accent:typeof Be.active=="number"&&Be.active>0?"var(--accent)":void 0}),c.jsx(_d,{label:"runtime",value:Be.runtime}),c.jsx(_d,{label:"model",value:Be.model})]})]}),c.jsx("div",{ref:X,"aria-hidden":!0,style:{height:0}}),!_e&&c.jsx(sU,{runtimeLabel:Ft,computerLabel:or,visible:ue}),c.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:[(D.data||D.error)&&c.jsx(Dq,{result:D.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>D.reset()}),c.jsx(ou,{anchorId:kn.overview,title:"Profile",right:c.jsxs(ge,{variant:"outline",size:"xs",onClick:()=>n(`/settings/integrations?agent=${me.uuid}`),title:"Manage platform bindings in Integrations",children:[c.jsx(mg,{className:"h-3 w-3"}),"Manage bindings"]}),children:c.jsx(wU,{agent:me,onSave:async we=>{await z.mutateAsync(we)}})}),!_e&&c.jsxs(c.Fragment,{children:[c.jsxs(ou,{anchorId:kn.setup,title:"Setup",caption:((Ui=o.data)==null?void 0:Ui.version)!=null?c.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&c.jsxs(c.Fragment,{children:[" · ",c.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&c.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&c.jsx(vq,{runtimeProvider:Wt,computerLabel:or,canBindComputer:pt&&me.status==="active",bindComputerPending:re.isPending,onBindComputer:()=>V(!0),onRebind:me.clientId?()=>W(!0):void 0,modelSlot:c.jsx(zU,{value:h.draft.model,baseline:((Ma=o.data)==null?void 0:Ma.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:me.status!=="active",provider:Wt})})]}),c.jsx(ou,{anchorId:kn.prompt,title:"Prompt",children:o.data?c.jsx(lq,{value:h.draft.promptAppend,baseline:((ec=o.data)==null?void 0:ec.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:me.status!=="active"}):null}),c.jsx(ou,{anchorId:kn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?c.jsx(jU,{items:h.draft.mcp,otherNames:le,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:me.status!=="active"}):null}),c.jsx(ou,{anchorId:kn.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{id:gu("env"),children:c.jsx(mU,{items:h.draft.env,otherKeys:ye,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:me.status!=="active"})}),c.jsx("div",{id:gu("git"),children:c.jsx(gU,{items:h.draft.git,otherPaths:Ue,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:me.status!=="active"})}),_&&c.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:_}),h.summary.anyDirty&&c.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:c.jsx("button",{type:"button",onClick:()=>P.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:P.isPending,children:P.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),c.jsx(gq,{}),c.jsx(oU,{agent:me,suspendPending:M.isPending,reactivatePending:B.isPending,deletePending:O.isPending,onSuspend:()=>M.mutate(),onReactivate:()=>B.mutate(),onDelete:()=>O.mutate()})]}),!_e&&c.jsx(pq,{summary:h.summary,saveHint:ro,conflictMessage:x,errorMessage:y,saving:C.isPending,justSaved:k,onSave:()=>C.mutate(),onDiscard:()=>{h.summary.anyDirty&&Re(!0)},onReloadRemote:E,onJumpTo:we=>R(gu(we))})]}),c.jsx(Tq,{open:ve,onOpenChange:Re,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),g(null),w(null),Re(!1)}}),c.jsx(nn,{open:U,onOpenChange:we=>{V(we),we||(ne(""),Se(null),re.reset())},children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:"Bind computer"})}),c.jsxs("div",{className:"space-y-4",children:[c.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?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):Z.error?c.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",Z.error instanceof Error?Z.error.message:"Unknown"]}):c.jsx(Aq,{clients:Z.data??[],selected:F,onSelect:ne}),oe&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:oe})]}),c.jsxs(Rn,{children:[c.jsx(ge,{variant:"outline",onClick:()=>V(!1),children:"Cancel"}),c.jsx(ge,{disabled:!F||re.isPending,onClick:()=>{Se(null),re.mutate(F)},children:re.isPending?"Binding…":"Bind"})]})]})}),c.jsx(uq,{open:G,onOpenChange:W,agent:me})]})}function _q({label:e,active:t,danger:n,dirty:a,onClick:l}){return c.jsx("button",{type:"button",onClick:l,className:Ae("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:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"flex-1 truncate",children:e}),a&&c.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&&c.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 Tq(e){return c.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:e.title})}),c.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(ge,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function Aq({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?c.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"," ",c.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."]}):c.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,u=l.status==="online"||l.status==="active";return c.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:c.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Ae("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:[c.jsx("span",{className:Ae("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),c.jsxs("span",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),c.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}`:""]})]}),c.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const Rq={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},zq={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},Oq={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function Dq({result:e,onDismiss:t}){const n=zq[e.status],a=Oq[e.status],l=e.connection;return c.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:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(zr,{tone:a,children:Rq[e.status]}),e.responseTime!=null&&c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&c.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[c.jsx("div",{children:l.runtimeState&&c.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?c.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):c.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&c.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&c.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})]}),c.jsx(ge,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function Xu({title:e,subtitle:t,right:n,className:a,style:l,...o}){return c.jsxs("div",{className:Ae("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-4) var(--sp-5) var(--sp-3)",...l},...o,children:[c.jsx("h1",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t&&c.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),c.jsx("div",{style:{flex:1}}),n]})}function Mq(){return c.jsxs("div",{className:"-m-6",children:[c.jsx(Xu,{title:"Context",subtitle:"The team's living source of truth"}),c.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:c.jsx(Hn,{children:c.jsx("div",{className:"text-body",style:{padding:"var(--sp-6) var(--sp-5)",color:"var(--fg-3)",textAlign:"center"},children:"Tree visualization is on the way. This view will surface structure, relationships, and recent changes to the context-tree at a glance."})})})]})}const eo=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ae("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));eo.displayName="Card";const to=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ae("flex flex-col space-y-1.5 p-6",e),...t}));to.displayName="CardHeader";const Ju=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ae("text-subtitle leading-none",e),...t}));Ju.displayName="CardTitle";const rN=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ae("text-body text-muted-foreground",e),...t}));rN.displayName="CardDescription";const no=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ae("p-6 pt-0",e),...t}));no.displayName="CardContent";const Iq=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ae("flex items-center p-6 pt-0",e),...t}));Iq.displayName="CardFooter";function Lq(){const{token:e}=hk(),t=zn(),{isAuthenticated:n,adoptTokens:a}=zt(),[l,o]=b.useState(null),[u,f]=b.useState(null),[m,h]=b.useState(!1),[y,g]=b.useState(null);if(b.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]),b.useEffect(()=>{n&&(async()=>{try{const C=await je.get("/me/organizations"),E=await je.get("/me"),R=C.find(z=>z.id===E.member.organizationId);g((R==null?void 0:R.displayName)??null)}catch{}})()},[n]),!e)return c.jsx(hS,{message:"Bad invitation URL"});if(u)return c.jsx(hS,{message:"This invitation is no longer valid"});if(!l)return c.jsx(Uq,{});const x=async()=>{h(!0);try{const C=await je.post("/me/organizations/join",{token:e});await a(C.tokens),jk("invite"),t("/",{replace:!0})}catch(C){f(C instanceof Error?C.message:"Failed to join team")}finally{h(!1)}},w=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&y&&y!==l.organizationDisplayName,j=Pq(l.expiresAt);return c.jsx(ev,{children:c.jsxs(eo,{className:"w-full max-w-sm",children:[c.jsx(to,{className:"text-center",children:c.jsxs(Ju,{className:"text-title",children:["You're invited to join",c.jsx("br",{}),l.organizationDisplayName]})}),c.jsxs(no,{className:"space-y-4",children:[k&&c.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[c.jsx(dy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),c.jsxs("span",{children:["You'll switch from ",c.jsx("span",{className:"font-medium",children:y})," to"," ",c.jsx("span",{className:"font-medium",children:l.organizationDisplayName}),"."]})]}),n?c.jsx(ge,{className:"w-full",disabled:m,onClick:x,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):c.jsx(ge,{asChild:!0,className:"w-full",children:c.jsxs("a",{href:w,children:[c.jsx(Ak,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&c.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.text}),c.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",c.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",c.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]})]})]})})}function ev({children:e}){return c.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[c.jsx("header",{className:"px-4 py-3",children:c.jsxs($u,{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:[c.jsx(oy,{className:"h-3.5 w-3.5"}),"Back to home"]})}),c.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:e})]})}function Uq(){return c.jsx(ev,{children:c.jsxs(eo,{className:"w-full max-w-sm",children:[c.jsxs(to,{className:"text-center",children:[c.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),c.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),c.jsxs(no,{className:"space-y-4",children:[c.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),c.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function hS({message:e}){return c.jsx(ev,{children:c.jsxs(eo,{className:"w-full max-w-sm",children:[c.jsxs(to,{className:"text-center",children:[c.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:c.jsx(dy,{className:"h-6 w-6"})}),c.jsx(Ju,{className:"text-title",children:e})]}),c.jsxs(no,{className:"space-y-4",children:[c.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."}),c.jsx(ge,{asChild:!0,variant:"outline",className:"w-full",children:c.jsxs($u,{to:"/",children:[c.jsx(oy,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function Pq(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 Bq(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=_C(l);return o===xw&&l!==xw?null:o}function $q(){const{isAuthenticated:e}=zt(),t=Zn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=Bq(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?c.jsx(ar,{to:a,replace:!0}):c.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[c.jsx("header",{className:"px-4 py-3",children:c.jsxs($u,{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:[c.jsx(oy,{className:"h-3.5 w-3.5"}),"Back to home"]})}),c.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:c.jsxs(eo,{className:"w-full max-w-sm",children:[c.jsxs(to,{className:"text-center",children:[c.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:c.jsx(Vu,{width:28,height:32})}),c.jsxs(Ju,{className:"text-title",children:["First Tree ",c.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),c.jsxs(no,{className:"space-y-4",children:[c.jsx(ge,{asChild:!0,className:"w-full",children:c.jsxs("a",{href:l,children:[c.jsx(Ak,{className:"h-4 w-4"}),"Continue with GitHub"]})}),c.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",c.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",c.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[c.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),c.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),c.jsx(ge,{asChild:!0,variant:"outline",className:"w-full",children:c.jsxs("a",{href:o,children:[c.jsx(dz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function Fq(){const e=zn(),{adoptTokens:t}=zt(),[n,a]=b.useState(null);return b.useEffect(()=>{const l=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(l),u=o.get("access"),f=o.get("refresh"),m=_C(o.get("next")),h=o.get("joinPath");if(!u||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&jk(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:u,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}const Hs=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("table",{ref:a,className:Ae("w-full",e),style:{borderCollapse:"separate",borderSpacing:0,...t},...n}));Hs.displayName="DenseTable";const Zs=b.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:e,...t}));Zs.displayName="DenseTableHeader";const Vs=b.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:e,...t}));Vs.displayName="DenseTableBody";const Or=b.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>c.jsx("tr",{ref:o,className:Ae("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}));Or.displayName="DenseTableRow";const tt=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("th",{ref:a,className:Ae("text-left text-label whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3_5)",color:"var(--fg-3)",fontWeight:500,borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));tt.displayName="DenseTableHead";const Ke=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("td",{ref:a,className:Ae("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ke.displayName="DenseTableCell";function qq(){const{data:e}=Ve({queryKey:["members","user-name-map"],queryFn:_f,staleTime:3e4});return b.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])}const Hq=1500;function Zq({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:l="Waiting for your computer to connect…",successContent:o,errorContent:u,caption:f="Single-use · regenerates the previous one.",copyButtonPlacement:m="right"}){const[h,y]=b.useState(!1),g=async()=>{e&&(await navigator.clipboard.writeText(e),y(!0),setTimeout(()=>y(!1),Hq))},x=t!==void 0?Math.max(1,Math.round(t/60)):null,w=c.jsx("pre",{className:"mono text-label",style:{margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",minWidth:0,flex:m==="right"?1:void 0},title:e??"",children:e?c.jsxs(c.Fragment,{children:[e,x!==null&&c.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",x,"m"]})]}):"Generating token…"}),k=c.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?c.jsx(jr,{className:"h-3.5 w-3.5"}):c.jsx(Tk,{className:"h-3.5 w-3.5"}),h?a.done:a.idle]});return c.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[m==="right"?c.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[w,k]}):c.jsxs(c.Fragment,{children:[w,k]}),f&&c.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),n==="waiting"&&c.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-blocked) 35%, var(--fg))"},children:[c.jsx(Vq,{}),l]}),n==="success"&&o&&c.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-idle) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-idle) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-idle) 45%, var(--fg))"},children:[c.jsx(jr,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),c.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&u&&c.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:u})]})}function Vq(){return c.jsx("span",{"aria-hidden":"true",style:{width:12,height:12,flexShrink:0,borderRadius:"50%",border:"var(--hairline-bold) solid color-mix(in oklch, var(--state-blocked) 30%, transparent)",borderTopColor:"var(--state-blocked)",animation:"spin 0.85s linear infinite"}})}const Qq=3e3,Kq=1200;function Gq({open:e,onOpenChange:t}){const n=an(),{user:a}=zt(),[l,o]=b.useState("loading"),[u,f]=b.useState(null),[m,h]=b.useState(null),[y,g]=b.useState(null),x=b.useRef(new Set);return b.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),x.current=new Set;return}let w=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return x.current=new Set(k),(async()=>{try{const j=await rO();if(w)return;f(j),o("waiting")}catch(j){if(w)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{w=!0}},[e,n]),b.useEffect(()=>{if(!e||l!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:Ei}),C=x.current,E=j.find(R=>!C.has(R.id)&&R.status==="connected"&&R.userId===a.id);E&&(g(E.hostname??null),o("success"))}catch{}},Qq);return()=>clearInterval(k)},[e,l,n,a]),b.useEffect(()=>{if(l!=="success")return;const w=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},Kq);return()=>clearTimeout(w)},[l,t,n]),c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsxs(cn,{children:[c.jsx(rn,{children:"Connect computer"}),c.jsx(xy,{children:"Run this command on the machine you want to pair with this Hub."})]}),c.jsx(Zq,{command:(u==null?void 0:u.command)??null,expiresInSeconds:u==null?void 0:u.expiresIn,phase:l,successContent:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-semibold",children:y??"Computer"})," connected. Closing…"]}),errorContent:m}),c.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:c.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function Yq({embedded:e=!1}={}){const t=an(),n=bf(),a=qq(),{role:l}=zt(),o=l==="admin",[u,f]=b.useState(null),[m,h]=b.useState(null),[y,g]=b.useState(null),[x,w]=b.useState(null),[k,j]=b.useState(!1),{data:C}=Ve({queryKey:["clients"],queryFn:Ei,refetchInterval:1e4}),{data:E}=Ve({queryKey:["activity"],queryFn:qu,refetchInterval:1e4}),R=kt({mutationFn:nO,onSuccess:()=>{h(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})}}),z=kt({mutationFn:tO,onSuccess:()=>{g(null),w(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})},onError:V=>{V instanceof Fu?w(V.message):w(V instanceof Error?V.message:String(V))}}),M=b.useMemo(()=>{const V=new Map;for(const F of(E==null?void 0:E.agents)??[]){if(!F.clientId)continue;const ne=V.get(F.clientId)??[];ne.push(F),V.set(F.clientId,ne)}return V},[E==null?void 0:E.agents]),B=V=>M.get(V)??[],O=(C??[]).filter(V=>V.status==="connected").length,D=(C??[]).reduce((V,F)=>V+F.agentCount,0),U=(C??[]).filter(V=>V.authState!=="ok").length;return c.jsxs("div",{className:e?"":"-m-6",children:[c.jsx(Xu,{title:"Computers",subtitle:C&&C.length>0?c.jsxs(c.Fragment,{children:[C.length," total · ",O," connected · ",D," agents bound",U>0&&c.jsxs(c.Fragment,{children:[" · ",c.jsxs("span",{style:{color:"var(--state-error)"},children:[U," need re-auth"]})]})]}):null,right:c.jsx("div",{className:"flex items-center gap-1.5",children:c.jsxs(ge,{size:"xs",onClick:()=>j(!0),children:[c.jsx(Mr,{className:"h-3 w-3"}),"Connect computer"]})})}),c.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[c.jsx(Gq,{open:k,onOpenChange:j}),y&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:c.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:[c.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),c.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",c.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:y.hostname??y.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)."]}),B(y.id).length>0&&c.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:[c.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),c.jsx("ul",{className:"text-body space-y-0.5",children:B(y.id).map(V=>c.jsx("li",{className:"font-medium",children:n(V.agentId)},V.agentId))})]}),x&&c.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:x}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(ge,{variant:"outline",size:"sm",onClick:()=>{g(null),w(null)},children:"Cancel"}),c.jsx(ge,{variant:"destructive",size:"sm",onClick:()=>z.mutate(y.id),disabled:z.isPending,children:z.isPending?"Retiring…":"Retire"})]})]})}),m&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:c.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:[c.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),c.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",c.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:m.hostname??m.id.slice(0,8)})," ","and affect all bound agents:"]}),c.jsx("ul",{className:"mb-4 space-y-1",children:B(m.id).length===0?c.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):B(m.id).map(V=>c.jsxs("li",{className:"text-body flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:n(V.agentId)}),c.jsx(Nu,{state:V.runtimeState})]},V.agentId))}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(ge,{variant:"outline",size:"sm",onClick:()=>h(null),children:"Cancel"}),c.jsx(ge,{variant:"destructive",size:"sm",onClick:()=>R.mutate(m.id),disabled:R.isPending,children:R.isPending?"Disconnecting…":"Disconnect"})]})]})}),!C||C.length===0?c.jsx(Hn,{children:c.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers connected. Use the button above to generate a connect command."})}):c.jsxs(Hn,{children:[c.jsxs(_g,{right:c.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",C.length]}),c.jsxs(Hs,{children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{style:{width:16}}),c.jsx(tt,{children:"Hostname"}),o&&c.jsx(tt,{children:"Owner"}),c.jsx(tt,{children:"OS"}),c.jsx(tt,{children:"SDK"}),c.jsx(tt,{children:"Agents"}),c.jsx(tt,{children:"Connected"}),c.jsx(tt,{children:"Status"}),c.jsx(tt,{})]})}),c.jsx(Vs,{children:C.map(V=>{const F=u===V.id,ne=B(V.id);return c.jsx(r7,{client:V,boundAgents:ne,isExpanded:F,agentName:n,showOwner:o,ownerName:a,onToggle:()=>f(F?null:V.id),onDisconnect:()=>h(V),onRetire:()=>{w(null),g(V)},onReconnect:()=>j(!0)},V.id)})})]})]})]})]})}const Xq={"claude-code":"Claude Code",codex:"Codex"},Jq=[Jd.CLAUDE_CODE,Jd.CODEX],mS={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},Wq={"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 e7({clientId:e,enabled:t}){const{data:n,isLoading:a}=Ve({queryKey:["client-capabilities",e],queryFn:()=>my(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return c.jsxs(c.Fragment,{children:[c.jsx(Nf,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!l?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l&&Object.keys(l).length===0?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):c.jsx("div",{className:"flex flex-col gap-1",children:Jq.map(o=>c.jsx(t7,{provider:o,entry:l?l[o]??null:null},o))})]})}function t7({provider:e,entry:t}){const n=Xq[e];if(!t)return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",mS[e]]})]});switch(t.state){case"ok":return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",Wq[e]]})]});case"missing":return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",mS[e]]})]});case"error":return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function n7(){return c.jsxs("span",{className:"mono inline-flex items-center gap-1.5 uppercase text-caption",style:{color:"var(--state-error)"},children:[c.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"var(--state-error)",display:"inline-block"}}),"AUTH EXPIRED"]})}function r7({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m,onReconnect:h}){const y=l?9:8,g=e.status!=="connected",x=e.authState!=="ok",w=e.status==="connected"?"idle":"offline";return c.jsxs(c.Fragment,{children:[c.jsxs(Or,{interactive:!0,selected:n,onClick:u,children:[c.jsx(Ke,{style:{width:16},children:c.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?c.jsx(_k,{className:"h-3.5 w-3.5"}):c.jsx(_R,{className:"h-3.5 w-3.5"})})}),c.jsx(Ke,{className:"font-medium",children:e.hostname??"—"}),l&&c.jsx(Ke,{style:{color:"var(--fg-2)"},children:o(e.userId)}),c.jsx(Ke,{style:{color:"var(--fg-3)"},children:e.os??"—"}),c.jsx(Ke,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),c.jsx(Ke,{children:c.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?pl(e.connectedAt):"—"}),c.jsx(Ke,{children:x?c.jsx(n7,{}):c.jsx(Nu,{state:w})}),c.jsx(Ke,{style:{width:1,whiteSpace:"nowrap"},children:c.jsxs("div",{className:"flex gap-1 justify-end",children:[g&&c.jsxs(ge,{variant:"ghost",size:"xs",className:"text-label",style:x?{color:"var(--state-error)"}:void 0,onClick:k=>{k.stopPropagation(),h()},children:[c.jsx(IR,{className:"h-3 w-3"})," Reconnect"]}),c.jsxs(ge,{variant:"ghost",size:"xs",className:"text-label",onClick:k=>{k.stopPropagation(),f()},children:[c.jsx(sz,{className:"h-3 w-3"})," Disconnect"]}),c.jsxs(ge,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:k=>{k.stopPropagation(),m()},children:[c.jsx(Bs,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&c.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[c.jsx(Ke,{}),c.jsxs(Ke,{colSpan:y-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[c.jsx(e7,{clientId:e.id,enabled:n}),c.jsxs(Nf,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):c.jsx("div",{className:"flex flex-col gap-1",children:t.map(k=>c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(k.agentId)}),c.jsx(Nu,{state:k.runtimeState}),k.activeSessions!==null&&c.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[k.activeSessions," / ",k.totalSessions??0," sessions"]})]},k.agentId))})]})]})]})}function a7(){return c.jsx(Yq,{embedded:!0})}function i7(){return je.get("/admin/adapter-mappings")}function l7(e){return je.post("/admin/adapter-mappings",e)}function s7(e){return je.delete(`/admin/adapter-mappings/${e}`)}function o7(){return je.get("/admin/adapters/status")}function u7(){return je.get("/admin/adapters")}function c7(e){return je.post("/admin/adapters",e)}function d7(e,t){return je.patch(`/admin/adapters/${e}`,t)}function f7(e){return je.delete(`/admin/adapters/${e}`)}const h7=Object.values(qL),pS={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function gS(e){const[t,n]=b.useState(pS),[a,l]=b.useState("");b.useEffect(()=>{e.open&&(n({...pS,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=m7(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 u=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return c.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:u})}),c.jsxs("form",{onSubmit:o,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"binding-platform",children:"Platform"}),c.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:h7.map(f=>c.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"binding-ext-id",children:"External user ID"}),c.jsx(_t,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"binding-name",children:"Display name (optional)"}),c.jsx(_t,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):c.jsxs(c.Fragment,{children:[t.platform==="feishu"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(_t,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),c.jsx(_t,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(_t,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(_t,{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&&c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),c.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&&c.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"binding-status",children:"Status"}),c.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:[c.jsx("option",{value:"active",children:"active"}),c.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(ge,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function m7(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 p7(){var T;const e=zn(),t=an(),[n,a]=wk(),l=n.get("agent"),o=bf(),u=Ve({queryKey:["adapters"],queryFn:u7}),f=Ve({queryKey:["adapter-mappings"],queryFn:i7}),m=Ve({queryKey:["adapter-statuses"],queryFn:o7,refetchInterval:15e3}),y=((T=Ve({queryKey:["agents","name-map"],queryFn:()=>Zu({limit:100}),staleTime:3e4}).data)==null?void 0:T.items)??[],g=b.useMemo(()=>{const q=new Map;for(const X of m.data??[])q.set(X.configId,X);return q},[m.data]),x=b.useMemo(()=>{const q=u.data??[];return l?q.filter(X=>X.agentId===l):q},[u.data,l]),w=b.useMemo(()=>{const q=f.data??[];return l?q.filter(X=>X.agentId===l):q},[f.data,l]),k=x.reduce((q,X)=>{var ue;return q+((ue=g.get(X.id))!=null&&ue.connected?1:0)},0),j=x.length-k,C=u.isLoading||f.isLoading,[E,R]=b.useState(null),[z,M]=b.useState(""),[B,O]=b.useState(null),[D,U]=b.useState(null),[V,F]=b.useState(null),[ne,oe]=b.useState(null),Se=kt({mutationFn:q=>c7({platform:q.platform,agentId:q.agentId,credentials:q.credentials,status:q.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),G=kt({mutationFn:q=>{const X={status:q.status};return q.credentials&&(X.credentials=q.credentials),d7(q.id,X)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),W=kt({mutationFn:f7,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=kt({mutationFn:q=>l7({platform:q.platform,externalUserId:q.externalUserId,agentId:q.agentId,boundVia:"manual",displayName:q.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),U(null)}}),re=kt({mutationFn:s7,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function ve(q){if(l){q==="bot"?O({agentId:l,editingId:null}):U({agentId:l});return}M(""),R({kind:q})}function Re(){!E||!z||(E.kind==="bot"?O({agentId:z,editingId:null}):U({agentId:z}),R(null))}function _(q){if(B){if(q.kind==="bot-create")Se.mutate({agentId:B.agentId,platform:q.draft.platform,status:q.draft.status,credentials:q.draft.credentials});else if(q.kind==="bot-update"){if(!B.editingId)return;G.mutate({id:B.editingId,status:q.status,credentials:q.credentials})}}}function L(q){!D||q.kind!=="user-create"||Z.mutate({agentId:D.agentId,platform:q.draft.platform,externalUserId:q.draft.externalUserId,displayName:q.draft.displayName})}const P=l?y.find(q=>q.uuid===l):null;return c.jsxs(c.Fragment,{children:[c.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&&c.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[c.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[(P==null?void 0:P.displayName)??l,c.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:c.jsx(wu,{className:"h-3 w-3"})})]})]}),c.jsxs(Hn,{className:"mb-3.5",children:[c.jsxs(_g,{right:c.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[c.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[c.jsx(fu,{state:"idle",size:6})," ",k," online"]}),c.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[c.jsx(fu,{state:"offline",size:6})," ",j," offline"]})]}),c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>ve("bot"),children:[c.jsx(Mr,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",x.length]}),C?c.jsx(Od,{children:"Loading…"}):x.length?c.jsxs(Hs,{children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{children:"Agent"}),c.jsx(tt,{children:"Platform"}),c.jsx(tt,{children:"Status"}),c.jsx(tt,{children:"Connection"}),c.jsx(tt,{children:"Created"}),c.jsx(tt,{style:{width:96,textAlign:"right"}})]})}),c.jsx(Vs,{children:x.map(q=>{var ue;const X=((ue=g.get(q.id))==null?void 0:ue.connected)??!1;return c.jsxs(Or,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[c.jsx(Ke,{children:c.jsx("span",{className:"mono font-medium",children:o(q.agentId)})}),c.jsx(Ke,{children:c.jsx(zr,{children:q.platform})}),c.jsx(Ke,{children:c.jsx(zr,{tone:q.status==="active"?"accent":"outline",children:q.status})}),c.jsx(Ke,{children:c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[c.jsx(fu,{state:X?"idle":"offline",size:7}),c.jsx("span",{style:{color:"var(--fg-3)"},children:X?"Online":"Offline"})]})}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:pl(q.createdAt)}),c.jsxs(Ke,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:xe=>xe.stopPropagation(),children:[c.jsx(ge,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>O({agentId:q.agentId,editingId:q.id,initialPlatform:g7(q.platform),initialStatus:y7(q.status)}),children:"Edit"}),c.jsx(ge,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>F(q.id),disabled:W.isPending,title:"Delete",children:c.jsx(Bs,{className:"h-3.5 w-3.5"})})]})]},q.id)})})]}):c.jsx(Od,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),c.jsxs(Hn,{children:[c.jsxs(_g,{right:c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>ve("user"),children:[c.jsx(Mr,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",w.length]}),C?c.jsx(Od,{children:"Loading…"}):w.length?c.jsxs(Hs,{children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{children:"Agent"}),c.jsx(tt,{children:"Platform"}),c.jsx(tt,{children:"External user ID"}),c.jsx(tt,{children:"Display name"}),c.jsx(tt,{children:"Bound via"}),c.jsx(tt,{children:"Created"}),c.jsx(tt,{style:{width:32}})]})}),c.jsx(Vs,{children:w.map(q=>c.jsxs(Or,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[c.jsx(Ke,{children:c.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(q.agentId)})}),c.jsx(Ke,{children:c.jsx(zr,{children:q.platform})}),c.jsx(Ke,{children:c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:q.externalUserId})}),c.jsx(Ke,{style:{color:"var(--fg-2)"},children:q.displayName??"—"}),c.jsx(Ke,{children:c.jsx(zr,{tone:"outline",children:q.boundVia??"—"})}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:pl(q.createdAt)}),c.jsx(Ke,{onClick:X=>X.stopPropagation(),children:c.jsx(ge,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>oe(q.id),disabled:re.isPending,title:"Delete",children:c.jsx(Bs,{className:"h-3.5 w-3.5"})})})]},q.id))})]}):c.jsx(Od,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),c.jsx(v7,{open:E!=null,kind:(E==null?void 0:E.kind)??"bot",agents:y,agentId:z,onAgentChange:M,onCancel:()=>R(null),onConfirm:Re}),c.jsx(gS,{open:B!=null,kind:"bot",editingId:(B==null?void 0:B.editingId)??null,initialPlatform:B==null?void 0:B.initialPlatform,initialStatus:B==null?void 0:B.initialStatus,agentLabel:B?o(B.agentId):"",pending:Se.isPending||G.isPending,errorMessage:(Se.error??G.error)instanceof Error?(Se.error??G.error).message:null,onOpenChange:q=>{q||(O(null),Se.reset(),G.reset())},onSubmit:_}),c.jsx(gS,{open:D!=null,kind:"user",editingId:null,agentLabel:D?o(D.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:q=>{q||(U(null),Z.reset())},onSubmit:L}),c.jsx(yS,{open:V!=null,onOpenChange:q=>!q&&F(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:W.isPending,onConfirm:()=>{V!=null&&(W.mutate(V),F(null))}}),c.jsx(yS,{open:ne!=null,onOpenChange:q=>!q&&oe(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:re.isPending,onConfirm:()=>{ne!=null&&(re.mutate(ne),oe(null))}})]})}function g7(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function y7(e){return e==="inactive"?"inactive":"active"}function Od({children:e}){return c.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function v7(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 c.jsx(nn,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),c.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:[c.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>c.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),c.jsxs(Rn,{children:[c.jsx(ge,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),c.jsx(ge,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function yS(e){return c.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:e.title})}),c.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(ge,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function b7({embedded:e=!1}={}){return c.jsxs("div",{className:e?"":"-m-6",children:[c.jsx(Xu,{title:"Integrations",subtitle:"External platform bindings"}),c.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:c.jsx(p7,{})})]})}function x7(){return c.jsx(b7,{embedded:!0})}function w7(){return c.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[c.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[c.jsx(vS,{to:"/settings/computers",label:"Computers"}),c.jsx(vS,{to:"/settings/integrations",label:"Integrations"})]}),c.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:c.jsx(Ps,{})})]})}function vS({to:e,label:t}){return c.jsx(hf,{to:e,className:({isActive:n})=>Ae("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!n&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:n})=>c.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:n?"var(--bg-active)":"transparent",color:n?"var(--fg)":"var(--fg-3)",fontWeight:n?500:400,borderRadius:"var(--radius-input)"},children:c.jsx("span",{className:"flex-1 truncate",children:t})})})}function Bg(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,bs)}const Pp=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 k7(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,bs)}function j7(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=an(),{refreshMe:l,organizationId:o}=zt(),[u,f]=b.useState(""),[m,h]=b.useState(""),[y,g]=b.useState(!1),[x,w]=b.useState("claude-code"),[k,j]=b.useState("form"),[C,E]=b.useState([]),[R,z]=b.useState(null),[M,B]=b.useState(!1),[O,D]=b.useState({}),[U,V]=b.useState({status:"idle"});b.useEffect(()=>{e&&(f(""),h(""),g(!1),w("claude-code"),j("form"),E([]),z(null),B(!1),D({}),V({status:"idle"}))},[e]),b.useEffect(()=>{y||h(Bg(u))},[u,y]);const F=b.useRef(0);b.useEffect(()=>{if(!e||!m){V({status:"idle"});return}if(!Cg.test(m)){V({status:"bad",reason:"invalid"});return}if(Eg(m)){V({status:"bad",reason:"reserved"});return}const _=++F.current;V({status:"checking"});const L=window.setTimeout(()=>{ND(m).then(P=>{_===F.current&&(P.available?V({status:"ok"}):V({status:"bad",reason:P.reason}))}).catch(()=>{_===F.current&&V({status:"idle"})})},300);return()=>window.clearTimeout(L)},[m,e]);const ne=kt({mutationFn:async _=>{const L=u.trim()||m.trim()||"Untitled assistant";return ED({name:m||void 0,type:"personal_assistant",displayName:L,clientId:_.clientId,runtimeProvider:x,...o?{organizationId:o}:{}})},onSuccess:_=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),l(),n(_,x)}}),oe=b.useMemo(()=>{const _=ne.error;if(!_)return{};if(_ instanceof Fu){const L=S7(_.issues);return Object.keys(L).length>0?L:_.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:_.message}}return _ instanceof Error?{_root:_.message}:{}},[ne.error]),Se=U.status==="bad"?j7(U.reason):void 0,G={...Se?{name:Se}:{},...oe,...O};function W(){const _={};return m?m.length>bs?_.name=`Agent name must be at most ${bs} characters (got ${m.length}).`:Cg.test(m)?Eg(m)&&(_.name="That agent name is reserved — pick a different one."):_.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":u.trim().length>0&&(_.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),u.length>Pp&&(_.displayName=`Display name must be at most ${Pp} characters (got ${u.length}).`),_}async function Z(_){var P,T;_.preventDefault();const L=W();if(D(L),!(Object.keys(L).length>0)&&U.status!=="bad"){B(!0);try{const X=(await Ei()).filter(xe=>xe.status==="connected");if(X.length===0){ne.mutate({clientId:void 0});return}if(X.length===1){ne.mutate({clientId:(P=X[0])==null?void 0:P.id});return}const ue=[...X].sort((xe,be)=>be.lastSeenAt.localeCompare(xe.lastSeenAt));E(ue),z(((T=ue[0])==null?void 0:T.id)??null),j("pick-computer")}catch{ne.mutate({clientId:void 0})}finally{B(!1)}}}function re(){R&&ne.mutate({clientId:R})}const ve=U.status==="bad",Re=u.trim().length>0&&!ve&&!ne.isPending&&!M;return k==="pick-computer"?c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{className:"max-w-lg",children:[c.jsx(cn,{children:c.jsx(rn,{children:"Choose a computer"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",c.jsx("span",{className:"font-medium",children:u||m})," ","should run:"]}),c.jsx("div",{className:"space-y-2",children:C.map(_=>{const L=R===_.id;return c.jsxs("label",{className:L?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[c.jsx("input",{type:"radio",name:"target-computer",checked:L,onChange:()=>z(_.id),className:"mt-1"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-body font-medium truncate",children:_.hostname??_.id}),c.jsxs("div",{className:"text-caption text-muted-foreground",children:[_.os??"unknown OS"," · last seen ",new Date(_.lastSeenAt).toLocaleString()]})]})]},_.id)})}),G.clientId&&c.jsx("p",{className:"text-body text-destructive",children:G.clientId}),G._root&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:G._root})]}),c.jsxs(Rn,{children:[c.jsx(ge,{variant:"outline",onClick:()=>j("form"),disabled:ne.isPending,children:"Back"}),c.jsx(ge,{onClick:re,disabled:!R||ne.isPending,children:ne.isPending?"Creating…":"Create"})]})]})}):c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{className:"max-w-lg",children:[c.jsx(cn,{children:c.jsx(rn,{children:"New Agent"})}),c.jsxs("form",{onSubmit:Z,className:"space-y-5",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"new-agent-display-name",children:"Display name"}),c.jsx(_t,{id:"new-agent-display-name",value:u,onChange:_=>{f(_.target.value),O.displayName&&D(L=>({...L,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:Pp,"aria-invalid":G.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),c.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."}),G.displayName&&c.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:G.displayName})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"new-agent-name",children:"Agent name"}),c.jsxs("div",{className:"flex items-stretch",children:[c.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:"@"}),c.jsx(_t,{id:"new-agent-name",value:m,onChange:_=>{const L=k7(_.target.value);h(L),g(!0),O.name&&D(P=>({...P,name:void 0}))},onBlur:_=>{const L=Bg(_.target.value);L!==m&&h(L)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:bs,"aria-invalid":G.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),c.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Used in @mentions and CLI commands. Lowercase letters, digits, hyphens (-), and underscores (_). Up to"," ",bs," characters. Permanent after creation."]}),m&&!G.name&&U.status!=="idle"&&c.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:U.status==="ok"?"var(--state-idle)":U.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[U.status==="checking"&&"Checking availability…",U.status==="ok"&&"Available."]}),G.name&&c.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:G.name})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Where it runs"}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:x==="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:[c.jsx("input",{type:"radio",name:"runtime",checked:x==="claude-code",onChange:()=>w("claude-code"),className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),c.jsx("div",{className:"text-caption text-muted-foreground",children:"Anthropic's Claude Code on the bound computer. (default)"})]})]}),c.jsxs("label",{className:x==="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:[c.jsx("input",{type:"radio",name:"runtime",checked:x==="codex",onChange:()=>w("codex"),className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",children:"Codex"}),c.jsxs("div",{className:"text-caption text-muted-foreground",children:["OpenAI Codex CLI on the bound computer. Run ",c.jsx("code",{children:"codex login"})," on the host once."]})]})]})]})]}),G._root&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:G._root}),c.jsx(Rn,{children:c.jsx(ge,{type:"submit",disabled:!Re,children:M?"Checking computers…":ne.isPending?"Creating…":"Create"})})]})]})})}function Df({children:e,count:t,right:n}){return c.jsxs("div",{className:"flex items-baseline justify-between",style:{padding:"var(--sp-1) var(--sp-1) var(--sp-2)"},children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)"},children:[c.jsx("h2",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t!==void 0&&c.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:t})]}),n]})}function E7(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 N7(){const{organizationId:e}=zt(),[t,n]=b.useState(null),[a,l]=b.useState(null),[o,u]=b.useState(!1),[f,m]=b.useState(!1);b.useEffect(()=>{e&&(async()=>{try{const y=await je.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){u(!0),l(null);try{const y=await je.post(`/admin/organizations/${e}/invitations/rotate`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{u(!1)}}};return c.jsxs(eo,{children:[c.jsxs(to,{children:[c.jsx(Ju,{children:"Invite link"}),c.jsxs(rN,{children:["Anyone with this link can join your team as a member. Links expire after ",j6," days; rotating revokes the old link instantly and resets the timer."]})]}),c.jsxs(no,{className:"space-y-3",children:[a&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),c.jsx(ge,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),c.jsx(ge,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),c.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${E7(t.expiresAt)}`:" · no expiry"]})]}):c.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}const _7=Object.values(T6);function T7(){const e=an(),{memberId:t,role:n}=zt(),a=n==="admin",[l,o]=b.useState(null),{data:u,isLoading:f,error:m}=Ve({queryKey:["members"],queryFn:_f}),h=kt({mutationFn:xU,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function y(g){window.confirm("Delete this member? Their human agent will also be deactivated.")&&h.mutate(g)}return c.jsxs(c.Fragment,{children:[c.jsx("section",{children:f?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):m?c.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",m instanceof Error?m.message:"Unknown error"]}):(u==null?void 0:u.length)===0?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:a?"No members yet — share the Invite link to add teammates.":"No members yet."}):c.jsxs(Hs,{className:"table-fixed",children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{style:{width:160},children:"Display name"}),c.jsx(tt,{style:{width:140},children:"Username"}),c.jsx(tt,{style:{width:120},children:"Role"}),c.jsx(tt,{style:{width:150},children:"Created"}),c.jsx(tt,{"aria-hidden":!0}),a&&c.jsx(tt,{style:{width:80,textAlign:"right"}})]})}),c.jsx(Vs,{children:u==null?void 0:u.map(g=>{const x=t===g.id;return c.jsxs(Or,{children:[c.jsxs(Ke,{children:[c.jsx("span",{className:"font-medium",children:g.displayName}),x&&c.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),c.jsx(Ke,{children:c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",g.username]})}),c.jsx(Ke,{className:"text-label",style:{color:"var(--fg-3)"},children:g.role==="admin"?"Admin":"Member"}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:pl(g.createdAt)}),c.jsx(Ke,{"aria-hidden":!0}),a&&c.jsx(Ke,{style:{whiteSpace:"nowrap"},children:c.jsxs("div",{className:"flex gap-0.5 justify-end",children:[c.jsx(ge,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({id:g.id,username:g.username,displayName:g.displayName,role:g.role}),title:"Edit",children:c.jsx(mf,{className:"h-3.5 w-3.5"})}),!x&&c.jsx(ge,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>y(g.id),disabled:h.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:c.jsx(Bs,{className:"h-3.5 w-3.5"})})]})})]},g.id)})})]})}),c.jsx(A7,{target:l,onClose:()=>o(null),onSaved:()=>{o(null),e.invalidateQueries({queryKey:["members"]})}})]})}function A7({target:e,onClose:t,onSaved:n}){const[a,l]=b.useState(""),[o,u]=b.useState("member"),[f,m]=b.useState(null);b.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=kt({mutationFn:async()=>{if(!e)throw new Error("No target");const x={};return a.trim()&&a!==e.displayName&&(x.displayName=a.trim()),o!==e.role&&(x.role=o),Object.keys(x).length===0?e:bU(e.id,x)},onSuccess:()=>{m(null),n()},onError:x=>{m(x instanceof Error?x.message:String(x))}});function y(x){x.preventDefault(),h.mutate()}const g=e!==null;return c.jsx(nn,{open:g,onOpenChange:x=>x?void 0:t(),children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:"Edit Member"})}),e&&c.jsxs("form",{onSubmit:y,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Username"}),c.jsx(_t,{value:e.username,disabled:!0,className:"font-mono"}),c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"edit-member-display",children:"Display Name"}),c.jsx(_t,{id:"edit-member-display",value:a,onChange:x=>l(x.target.value),required:!0,maxLength:200})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"edit-member-role",children:"Role"}),c.jsx("select",{id:"edit-member-role",value:o,onChange:x=>u(x.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:_7.map(x=>c.jsx("option",{value:x,children:x},x))}),c.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&&c.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),c.jsxs(Rn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),c.jsx(ge,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function R7(){var m;const{role:e}=zt(),t=e==="admin",[n,a]=b.useState(!1),{data:l}=Ve({queryKey:["members"],queryFn:_f}),o=Ve({queryKey:["agents","team-page"],queryFn:()=>Zu({limit:100})}),u=(l==null?void 0:l.length)??0,f=(((m=o.data)==null?void 0:m.items)??[]).filter(h=>h.type!=="human").length;return c.jsxs(c.Fragment,{children:[c.jsx(Xu,{title:"Team",subtitle:`${u} ${u===1?"human":"humans"} and ${f} ${f===1?"agent":"agents"} working together`,right:t&&c.jsxs(ge,{size:"xs",variant:"ghost",onClick:()=>a(!0),children:[c.jsx(Ok,{className:"h-3 w-3"}),"Invite link"]})}),c.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)",display:"flex",flexDirection:"column",gap:"var(--sp-5)"},children:[c.jsx(z7,{}),c.jsx(O7,{data:o.data,isLoading:o.isLoading,error:o.error})]}),c.jsx(nn,{open:n,onOpenChange:a,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:"Invite link"})}),c.jsx(N7,{})]})})]})}function z7(){return c.jsxs("section",{children:[c.jsx(Df,{children:"Humans"}),c.jsx(T7,{})]})}function O7({data:e,isLoading:t,error:n}){const a=zn(),l=an(),o=GC(),{memberId:u}=zt(),[f,m]=b.useState(!1),{data:h}=Ve({queryKey:["activity"],queryFn:qu,refetchInterval:1e4}),y=b.useMemo(()=>{const w=new Map;for(const k of(h==null?void 0:h.agents)??[])w.set(k.agentId,k);return w},[h==null?void 0:h.agents]),g=b.useMemo(()=>{const w=((e==null?void 0:e.items)??[]).filter(C=>C.type!=="human");if(!u)return w;const k=[],j=[];for(const C of w)(C.managerId===u?k:j).push(C);return[...k,...j]},[e==null?void 0:e.items,u]);function x(w,k){m(!1),l.invalidateQueries({queryKey:["agents"]}),l.invalidateQueries({queryKey:["activity"]})}return c.jsxs(c.Fragment,{children:[c.jsxs("section",{children:[c.jsx(Df,{right:c.jsxs(ge,{size:"xs",variant:"ghost",className:"normal-case tracking-normal",onClick:()=>m(!0),children:[c.jsx(Mr,{className:"h-3 w-3"}),"New agent"]}),children:"Agents"}),t?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n?c.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",n instanceof Error?n.message:"Unknown error"]}):g.length===0?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents yet — create one with “New agent”."}):c.jsxs(Hs,{children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{style:{width:160},children:"Display name"}),c.jsx(tt,{style:{width:140},children:"Agent name"}),c.jsx(tt,{style:{minWidth:150},children:"Type"}),c.jsx(tt,{style:{minWidth:160},children:"Managed by"}),c.jsx(tt,{style:{minWidth:100},children:"Visibility"}),c.jsx(tt,{style:{minWidth:110},children:"Status"}),c.jsx(tt,{style:{minWidth:150},children:"Created"})]})}),c.jsx(Vs,{children:g.map(w=>{const k=y.get(w.uuid);return c.jsxs(Or,{interactive:!0,onClick:()=>a(`/agents/${encodeURIComponent(w.uuid)}`),children:[c.jsx(Ke,{children:c.jsx("span",{className:"font-medium",children:w.displayName})}),c.jsx(Ke,{children:w.name?c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",w.name]}):c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),c.jsx(Ke,{className:"text-label",style:{color:"var(--fg-3)"},children:D7(w.type)}),c.jsxs(Ke,{className:"text-label",style:{color:"var(--fg-2)"},children:[w.managerId?o(w.managerId):"—",w.managerId&&w.managerId===u&&c.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),c.jsx(Ke,{className:"text-label",style:{color:"var(--fg-3)"},children:M7(w.visibility)}),c.jsx(Ke,{children:c.jsx(Nu,{state:(k==null?void 0:k.runtimeState)??null})}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:pl(w.createdAt)})]},w.uuid)})})]})]}),c.jsx(C7,{open:f,onOpenChange:m,onCreated:x})]})}function D7(e){return e==="autonomous_agent"?"Autonomous agent":e==="personal_assistant"?"Personal assistant":e}function M7(e){return e==="organization"?"Shared":e==="private"?"Private":e}function I7(){return je.get("/admin/system/config")}function L7(e){return je.patch("/admin/system/config",e)}function U7(e){return je.get(`/admin/organizations/${encodeURIComponent(e)}`)}function P7(e,t){return je.patch(`/admin/organizations/${encodeURIComponent(e)}`,t)}function B7(){const{organizationId:e}=zt(),t=an(),n=Ve({queryKey:["organization",e],queryFn:()=>e?U7(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=b.useState(""),[o,u]=b.useState(""),[f,m]=b.useState(!1);b.useEffect(()=>{n.data&&(l(n.data.displayName),u(n.data.name))},[n.data]);const h=kt({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const g={},x=a.trim(),w=o.trim();return x&&x!==n.data.displayName&&(g.displayName=x),w&&w!==n.data.name&&(g.name=w),Object.keys(g).length===0?Promise.resolve(n.data):P7(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 c.jsxs("section",{children:[c.jsx(Df,{right:c.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),c.jsxs(ge,{type:"submit",form:"team-identity-form",size:"xs",variant:"outline",disabled:h.isPending||!n.data,children:[c.jsx(jr,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]}),children:"Team identity"}),n.isLoading?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):n.error?c.jsx("div",{className:"text-body",style:{color:"var(--state-error)",padding:"var(--sp-3) var(--sp-1)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):c.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[c.jsx(bS,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),c.jsx(bS,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:o,onChange:g=>u(g.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),h.error instanceof Error&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h.error.message})]})]})}function bS({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return c.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),c.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),c.jsx("input",{value:n,onChange:u=>a(u.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 aN=[{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"}],xS=aN.map(e=>e.key);function $7(){const e=an(),{data:t,isLoading:n}=Ve({queryKey:["system-config"],queryFn:I7}),[a,l]=b.useState({}),[o,u]=b.useState(!1);b.useEffect(()=>{if(!t)return;const y={};for(const g of xS){const x=t[g]??Fd[g]??"";y[g]=String(x)}l(y)},[t]);const f=kt({mutationFn:()=>{const y={};for(const[g,x]of Object.entries(a)){const w=x.trim();if(w==="")y[g]=Fd[g]??0;else{const k=Number(w);y[g]=Number.isNaN(k)?w:k}}return L7(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}});function m(){const y={};for(const g of xS)y[g]=String(Fd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[c.jsx(B7,{}),c.jsx("form",{onSubmit:h,children:c.jsxs("section",{children:[c.jsx(Df,{right:c.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),c.jsx(ge,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),c.jsxs(ge,{type:"submit",size:"xs",variant:"outline",disabled:f.isPending,children:[c.jsx(jr,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]}),children:"System configuration"}),n?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):aN.map(y=>c.jsx(F7,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&c.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})})]})}function F7({field:e,value:t,onChange:n}){const a=String(Fd[e.key]??"—");return c.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),c.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),c.jsxs(Nf,{style:{marginTop:4,display:"block"},children:["default"," ",c.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),c.jsxs("div",{style:{position:"relative"},children:[c.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&&c.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})]})]})}function q7(){const{role:e}=zt();return e===null?c.jsx("div",{className:"text-body",style:{padding:"var(--sp-5)",color:"var(--fg-3)"},children:"Loading..."}):e!=="admin"?c.jsx(ar,{to:"/team",replace:!0}):c.jsxs(c.Fragment,{children:[c.jsx(Xu,{title:"Team settings",subtitle:"Organization name, slug, and metadata"}),c.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:c.jsx($7,{})})]})}function H7(){const{role:e}=zt();return e!=="admin"?c.jsx(Ps,{}):c.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[c.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[c.jsx(wS,{to:"/team",end:!0,label:"Members"}),c.jsx(wS,{to:"/team/settings",label:"Team settings"})]}),c.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:c.jsx(Ps,{})})]})}function wS({to:e,label:t,end:n}){return c.jsx(hf,{to:e,end:n,className:({isActive:a})=>Ae("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!a&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:a})=>c.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:a?"var(--bg-active)":"transparent",color:a?"var(--fg)":"var(--fg-3)",fontWeight:a?500:400,borderRadius:"var(--radius-input)"},children:c.jsx("span",{className:"flex-1 truncate",children:t})})})}function sf(e){const t=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.filter&&t.set("filter",e.filter);const n=t.toString();return je.get(`/me/chats${n?`?${n}`:""}`)}function Z7(e){return je.post("/me/chats",e)}function V7(e){return je.post(`/me/chats/${encodeURIComponent(e)}/read`)}function iN(e,t){return je.post(`/me/chats/${encodeURIComponent(e)}/participants`,t)}function Q7(e){return je.post(`/me/chats/${encodeURIComponent(e)}/join`)}function K7({active:e,count:t,warn:n,className:a,children:l,style:o,...u}){return c.jsxs("button",{type:"button",className:Ae("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},...u,children:[l,t!==void 0&&c.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const of="draft";function G7(e){if(!e)return"";const t=new Date(e),a=Date.now()-t.getTime();if(a<6e4)return"now";if(a<60*6e4)return`${Math.round(a/6e4)}m`;if(a<1440*6e4)return`${Math.round(a/36e5)}h`;const l=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),o=u=>{var f;return((f=l.find(m=>m.type===u))==null?void 0:f.value)??""};return`${o("month")}/${o("day")} ${o("hour")}:${o("minute")}`}function Y7(e){return e.membershipKind==="watching"?e.lastMessagePreview?`Watching · ${e.lastMessagePreview}`:"Watching":e.lastMessagePreview??""}function X7({selectedChatId:e,onSelectChat:t,onNewChat:n}){const[a,l]=b.useState("all"),[o,u]=b.useState(""),[f,m]=b.useState([]),[h,y]=b.useState(!1),[g,x]=b.useState(null),{data:w,isLoading:k}=Ve({queryKey:["me","chats",a],queryFn:()=>sf({filter:a}),refetchInterval:15e3}),j=()=>{f.length>0&&m([]),x(null)},C=(w==null?void 0:w.rows)??[],E=b.useMemo(()=>[...C,...f],[C,f]),R=b.useMemo(()=>{const U=o.trim().toLowerCase();return U?E.filter(V=>V.title.toLowerCase().includes(U)||(V.lastMessagePreview??"").toLowerCase().includes(U)?!0:V.participants.map(Se=>Se.displayName.toLowerCase()).join(" ").includes(U)):E},[E,o]),z=async()=>{if(h)return;const U=w==null?void 0:w.nextCursor;if(U){y(!0),x(null);try{const V=await sf({filter:a,cursor:U});m(F=>[...F,...V.rows]),B(V.nextCursor)}catch(V){x(V instanceof Error?V.message:"Failed to load more")}finally{y(!1)}}},[M,B]=b.useState(null),O=(w==null?void 0:w.nextCursor)??null;b.useEffect(()=>{B(O)},[O]);const D=b.useMemo(()=>E.reduce((U,V)=>U+(V.unreadMentionCount>0?1:0),0),[E]);return c.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:320,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[c.jsxs("div",{className:"shrink-0 flex flex-col",style:{gap:6,padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsxs("button",{type:"button",onClick:n,className:"w-full inline-flex items-center transition-colors text-body hover:bg-[var(--bg-hover)]",style:{gap:6,padding:"var(--sp-1_25) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:e===of?"var(--bg-active)":"transparent",color:e===of?"var(--accent)":"var(--fg)",cursor:"pointer",fontWeight:500},title:"New chat",children:[c.jsx(Mr,{className:"h-3.5 w-3.5",strokeWidth:2}),"New chat"]}),c.jsxs("div",{className:"flex items-center",style:{gap:8},children:[c.jsx("div",{className:"flex gap-1 shrink-0",children:D>0&&c.jsx(K7,{active:a==="unread",count:D,onClick:()=>{l(a==="unread"?"all":"unread"),j()},children:"unread"})}),c.jsxs("div",{className:"relative",style:{flex:1,minWidth:0},children:[c.jsx(cy,{className:"h-3 w-3 absolute pointer-events-none",style:{left:4,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),c.jsx("input",{value:o,onChange:U=>u(U.target.value),placeholder:"Search…",className:"w-full outline-none text-caption",style:{padding:"var(--sp-0_5) var(--sp-1) var(--sp-0_5) var(--sp-5)",background:"transparent",border:"none",color:"var(--fg-2)"}})]})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[k&&R.length===0&&c.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:"Loading…"}),!k&&R.length===0&&c.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:o?"No matches":c.jsxs(c.Fragment,{children:[c.jsx("p",{style:{margin:0},children:"No conversations yet."}),c.jsx("p",{className:"text-label",style:{margin:"var(--sp-1) 0 0",color:"var(--fg-4)"},children:"Start with New chat."})]})}),R.map(U=>{const V=e===U.chatId,F=Y7(U),ne=F&&F!==U.title?F:"",oe=U.unreadMentionCount>0;return c.jsx("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:c.jsxs("button",{type:"button",onClick:()=>t(U.chatId),className:Ae("w-full text-left transition-colors flex flex-col","hover:bg-[var(--bg-hover)]"),style:{padding:"var(--sp-2) var(--sp-3)",background:V?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${V?"var(--accent)":"transparent"}`},children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:6},children:[oe&&c.jsx("span",{"aria-label":`${U.unreadMentionCount} unread mentions`,role:"status",style:{width:6,height:6,borderRadius:"50%",background:"var(--state-error)",flexShrink:0,alignSelf:"center"}}),c.jsx("span",{className:"truncate text-subtitle",style:{color:oe?"var(--fg)":"var(--fg-2)",fontWeight:oe?700:500,flex:1,minWidth:0},children:U.title}),U.lastMessageAt&&c.jsx("span",{className:"mono text-caption shrink-0",style:{color:"var(--fg-4)"},children:G7(U.lastMessageAt)})]}),c.jsx("div",{className:"truncate text-body",style:{color:oe?"var(--fg-2)":"var(--fg-3)",marginTop:2},children:ne||"—"})]})},U.chatId)}),M&&R.length>0&&c.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)"},children:[c.jsx("button",{type:"button",onClick:z,disabled:h,className:"w-full text-body mono",style:{padding:"var(--sp-1_25) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",color:"var(--fg-2)",cursor:h?"default":"pointer",opacity:h?.6:1},children:h?"Loading…":"Load more"}),g&&c.jsx("p",{className:"mono text-caption",style:{color:"var(--state-error)",marginTop:4},children:g})]})]})]})}function lN(e){return je.get(`/admin/chats/${encodeURIComponent(e)}`)}function J7(e,t){return je.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function $g(e,t){return je.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function W7(e,t){return je.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function eH(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 tH(e){return je.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function nH(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 je.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}function rH(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 aH(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 u=1/0;l.startsWith(t)?u=0:o.startsWith(t)?u=1:o.includes(t)&&(u=2),u!==1/0&&n.push({c:a,score:u})}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 iH(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),u=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${u}${m}`,y=l.length+u.length+(f?1:0);return{text:h,cursor:y}}function sN({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,u]=b.useState(0),[f,m]=b.useState(null),h=b.useMemo(()=>l?null:rH(e,t),[e,t,l]),y=b.useMemo(()=>h?aH(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";b.useEffect(()=>{u(0)},[g]),b.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const x=f!==null&&h!==null&&f===h.triggerIndex,w=h!==null&&y.length>0&&!x;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(E){if(!h)return;const R=iH(e,h,t,E);R&&a(R)}return{trigger:w?h:null,results:w?y:[],highlightIndex:o,handleKey:E=>{if(!w||!h)return!1;if(E.key==="ArrowDown")return E.preventDefault(),u(R=>y.length===0?0:(R+1)%y.length),!0;if(E.key==="ArrowUp")return E.preventDefault(),u(R=>y.length===0?0:(R-1+y.length)%y.length),!0;if(E.key==="Enter"||E.key==="Tab"){const R=y[o]??y[0];return R?(E.preventDefault(),j(R),!0):!1}return E.key==="Escape"?(E.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function oN({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:l}){const o=b.useRef(null);return b.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:c.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Ae("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,minWidth:240,maxWidth:360,background:"var(--bg-raised)",borderColor:"var(--border)"},children:t.map((f,m)=>{const h=m===n;return c.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(--bg-hover)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:[c.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&c.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function lH({onCreated:e}){const t=an(),{agentId:n}=zt(),a=wy(),[l,o]=b.useState([]),[u,f]=b.useState(""),[m,h]=b.useState(0),[y,g]=b.useState(null),[x,w]=b.useState(!1),[k,j]=b.useState(!1),C=b.useRef(null),E=b.useRef(!1),R=b.useRef(null),{data:z}=Ve({queryKey:["activity"],queryFn:qu,refetchInterval:15e3}),M=b.useMemo(()=>{const G=(z==null?void 0:z.agents)??[],W=[];for(const Z of G){if(n&&Z.agentId===n)continue;const re=a(Z.agentId);!re||!re.name||W.push({agentId:Z.agentId,name:re.name,displayName:re.displayName})}return W},[z,a,n]);b.useEffect(()=>{if(E.current||l.length>0||M.length===0)return;const G=oH(M,(z==null?void 0:z.agents)??[]);G&&(o([G]),E.current=!0)},[M,z,l.length]);const B=b.useMemo(()=>{const G=M.map(W=>({agentId:W.agentId,name:W.name}));return NC(u,G)},[u,M]),O=sN({value:u,cursor:m,candidates:M,disabled:x,onSelect:G=>{f(G.text),h(G.cursor),requestAnimationFrame(()=>{const W=C.current;W&&(W.focus(),W.setSelectionRange(G.cursor,G.cursor))})}});b.useEffect(()=>{B.length!==0&&o(G=>{const W=new Set(G);let Z=!1;for(const re of B)W.has(re)||(W.add(re),Z=!0);return Z?[...W]:G})},[B]),b.useEffect(()=>{if(!k)return;const G=W=>{R.current&&(R.current.contains(W.target)||j(!1))};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[k]);const D=kt({mutationFn:async({participantIds:G,text:W})=>{const Z=await Z7({participantIds:G}),re=W.trim();return re.length>0&&await $g(Z.chatId,re),Z.chatId},onSuccess:G=>{f(""),o([]),E.current=!1,t.invalidateQueries({queryKey:["me","chats"]}),e(G)},onError:G=>{g(G instanceof Error?G.message:"Failed to create chat")}}),U=b.useMemo(()=>!(x||D.isPending||l.length===0||u.trim().length===0||l.length>=2&&B.length===0),[x,D.isPending,l.length,u,B.length]),V=b.useMemo(()=>l.length===0?"Add at least one participant":u.trim().length===0?null:l.length>=2&&B.length===0?"Group chats need an @ to wake at least one participant":null,[l.length,u,B.length]),F=async()=>{if(!U)return;const G=Array.from(new Set([...l,...B]));g(null),w(!0);try{await D.mutateAsync({participantIds:G,text:u})}finally{w(!1)}},ne=G=>{o(W=>W.filter(Z=>Z!==G))},oe=G=>{o(W=>W.includes(G)?W:[...W,G]),j(!1)},Se=b.useMemo(()=>M.filter(G=>!l.includes(G.agentId)),[M,l]);return c.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:"var(--bg-base)"},children:c.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",style:{padding:"var(--sp-6)"},children:c.jsxs("div",{style:{width:"100%",maxWidth:"clamp(55rem, 75%, 70rem)"},children:[c.jsx("p",{className:"text-title",style:{color:"var(--fg)",textAlign:"center",marginBottom:"var(--sp-5)"},children:"What's the task?"}),c.jsxs("div",{style:{borderRadius:10,background:"var(--bg-raised)",boxShadow:"var(--shadow-md)",overflow:"visible"},children:[c.jsx(sH,{chips:l,candidates:M,chipCandidates:Se,pickerOpen:k,setPickerOpen:j,pickerContainerRef:R,onAdd:oe,onRemove:ne}),c.jsxs("div",{style:{position:"relative"},children:[c.jsx(oN,{trigger:O.trigger,results:O.results,highlightIndex:O.highlightIndex,anchorRef:C,onPick:O.pick}),c.jsx("textarea",{ref:C,value:u,onChange:G=>{f(G.target.value),h(G.target.selectionStart??G.target.value.length)},onSelect:G=>{h(G.currentTarget.selectionStart??u.length)},placeholder:l.length>=2?"Describe the task. Use @ to address one or more.":"Describe the task…",rows:1,onKeyDown:G=>{O.handleKey(G)||G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),F())},disabled:x||D.isPending,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2) var(--sp-3)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}}),l.length>=2&&B.length===0&&u.trim().length>0&&c.jsxs("div",{"aria-hidden":"true",className:"text-subtitle font-normal",style:{position:"absolute",inset:0,padding:"var(--sp-2) var(--sp-3)",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",pointerEvents:"none",color:"transparent",overflow:"hidden"},children:[u,c.jsx("span",{style:{color:"var(--fg-4)"},children:" ← @ a group member to send"})]})]}),c.jsx("div",{className:"flex items-center justify-end",style:{padding:"var(--sp-1_5) var(--sp-2_5)"},children:c.jsx("button",{type:"button",onClick:()=>void F(),disabled:!U,title:V??"Send (Enter)","aria-label":"Send",className:Ae("inline-flex items-center justify-center transition-opacity",!U&&"opacity-40 cursor-not-allowed"),style:{width:28,height:28,borderRadius:"var(--radius-input)",background:"var(--fg)",color:"var(--bg-raised)",border:"none"},children:c.jsx(Nk,{className:"h-3.5 w-3.5",strokeWidth:2.5})})})]}),y&&c.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:8},children:y})]})})})}function sH({chips:e,candidates:t,chipCandidates:n,pickerOpen:a,setPickerOpen:l,pickerContainerRef:o,onAdd:u,onRemove:f}){return c.jsxs("div",{className:"flex items-center flex-wrap",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) var(--sp-1)"},children:[e.map(m=>{const h=t.find(g=>g.agentId===m),y=(h==null?void 0:h.displayName)??(h==null?void 0:h.name)??m;return c.jsxs("span",{className:"group inline-flex items-center text-label",style:{gap:2,padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-sunken)",color:"var(--fg)"},children:[c.jsx("span",{children:y}),c.jsx("button",{type:"button",onClick:()=>f(m),title:"Remove participant",className:"opacity-0 group-hover:opacity-100 transition-opacity",style:{background:"none",border:"none",padding:0,marginLeft:2,cursor:"pointer",color:"var(--fg-3)",display:"inline-flex",alignItems:"center"},children:c.jsx(wu,{className:"h-3 w-3"})})]},m)}),c.jsxs("div",{ref:o,style:{position:"relative"},children:[c.jsx("button",{type:"button",onClick:()=>l(!a),title:"Add participant","aria-label":"Add participant",disabled:n.length===0,className:"inline-flex items-center transition-colors hover:bg-[var(--bg-sunken)]",style:{padding:"var(--sp-0_5) var(--sp-1)",borderRadius:"var(--radius-chip)",border:"var(--hairline) solid var(--border)",background:"transparent",color:n.length===0?"var(--fg-4)":"var(--fg-3)",cursor:n.length===0?"not-allowed":"pointer"},children:c.jsx(Mr,{className:"h-3 w-3"})}),a&&n.length>0&&c.jsx("div",{role:"listbox","aria-label":"Add participant",className:"absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg",style:{top:"calc(100% + var(--sp-1))",left:0,minWidth:280,background:"var(--bg-raised)",borderColor:"var(--border)"},children:n.map(m=>c.jsxs("button",{type:"button",role:"option","aria-selected":"false",onClick:()=>u(m.agentId),className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:[c.jsx("span",{className:"font-medium",children:m.displayName??(m.name?`@${m.name}`:"—")}),m.name&&m.displayName&&c.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",m.name]})]},m.agentId))})]})]})}function oH(e,t){var o;const n=new Set(e.map(u=>u.agentId)),a=[...t].filter(u=>n.has(u.agentId)&&u.runtimeUpdatedAt).sort((u,f)=>(f.runtimeUpdatedAt??"").localeCompare(u.runtimeUpdatedAt??""))[0];if(a)return a.agentId;const l=t.find(u=>n.has(u.agentId)&&u.type==="personal_assistant");return l?l.agentId:((o=e[0])==null?void 0:o.agentId)??null}const uH="first-tree-hub-images",cH=1,Qs="images";let Dd=null;function uN(){return Dd||(Dd=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(uH,cH);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Qs)||n.createObjectStore(Qs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Dd)}async function dH(e){const t=await uN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Qs,"readwrite"),o=l.objectStore(Qs),u={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(u),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 fH(e){const t=await uN();return t?new Promise(n=>{const o=t.transaction(Qs,"readonly").objectStore(Qs).get(e);o.onsuccess=()=>{const u=o.result;if(!u){n(null);return}n({base64:u.base64,mimeType:u.mimeType})},o.onerror=()=>n(null)}):null}function hH(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=SS(l.payload);if(!o)continue;const u=a.get(o)??-1;l.seq>u&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=SS(l.payload);return o?a.get(o)===l.seq:!0})}function SS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Mf(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(u=>u.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function mH(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function kS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function pH({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function gH({event:e}){const t=aO(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",l=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return c.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?c.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}}):c.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),c.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?kS(t.args):void 0,children:[c.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",c.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?c.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",kS(t.args),")"]}):null,t.durationMs!==void 0&&!a?c.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",mH(t.durationMs)]}):null]})]})}function yH({event:e,agentNameFn:t,agentId:n}){const a=lO(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return c.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[c.jsx(cN,{name:l,isSelf:!1}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[c.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Mf(e.createdAt)}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),c.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function vH({event:e}){return c.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:[c.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}}),c.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Mf(e.createdAt)})]})}function bH({event:e}){const t=iO(e.payload),n=Mf(e.createdAt);return c.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:[c.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),c.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 cN({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return c.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:c.jsx(Vu,{width:9,height:10,style:{color:"var(--accent)"}})})}function xH({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return c.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[c.jsx(cN,{name:a,isSelf:l}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[c.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Mf(e.createdAt)}),c.jsx("span",{style:{marginLeft:"auto"},children:c.jsx(pH,{msg:e,myAgentId:t})})]}),c.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&wH(e.content)?c.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"&&SH(e.content)?c.jsx(kH,{content:e.content}):e.format==="text"?c.jsx(tN,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):c.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 wH(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 SH(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 kH({content:e}){const[t,n]=b.useState({kind:"loading"});return b.useEffect(()=>{let a=!1;return fH(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"?c.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?c.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):c.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function jS({agentId:e,chatId:t}){var fe;const n=an(),a=bf(),l=wy(),{agentId:o}=zt(),[u,f]=b.useState(""),[m,h]=b.useState(0),[y,g]=b.useState([]),[x,w]=b.useState(!1),[k,j]=b.useState(null),C=b.useRef(null),E=b.useRef(null),R=b.useRef(null),z=b.useRef(!1),M=b.useRef(new Set);b.useEffect(()=>{z.current=!1},[t]);const{data:B}=Ve({queryKey:["chat-messages",t],queryFn:()=>nH(t,{limit:50}),refetchInterval:5e3}),{data:O}=Ve({queryKey:["session-events",e,t],queryFn:()=>sO(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:D}=Ve({queryKey:["chat-detail",t],queryFn:()=>lN(t),enabled:!!t}),{data:U}=Ve({queryKey:["activity"],queryFn:qu,refetchInterval:15e3}),V=kt({mutationFn:ee=>$g(t,ee),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:R1(e)})}}),F=b.useCallback(ee=>{const _e=ee.filter(pt=>pt.type.startsWith("image/"));if(_e.length===0)return;const Le=_e.find(pt=>pt.size>5242880);if(Le){j(`Image too large (${(Le.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const it=_e.map(pt=>({id:crypto.randomUUID(),file:pt,previewUrl:URL.createObjectURL(pt)}));g(pt=>[...pt,...it]),j(null)},[]),ne=b.useCallback(ee=>{g(me=>{const _e=me.find(Le=>Le.id===ee);return _e&&URL.revokeObjectURL(_e.previewUrl),me.filter(Le=>Le.id!==ee)})},[]),oe=async()=>{const ee=u.trim(),me=y;if(!(!ee&&me.length===0)&&!x&&!(X&&ue.length===0)){if(xe.length>0)try{await iN(t,{participantIds:xe}),await n.invalidateQueries({queryKey:["chat-detail",t]})}catch(_e){j(_e instanceof Error?_e.message:"Failed to add participants");return}if(me.length>0){w(!0),j(null);try{for(const _e of me){const Le=await eH(_e.file),it=crypto.randomUUID();await dH({imageId:it,base64:Le,mimeType:_e.file.type}),await W7(t,{data:Le,mimeType:_e.file.type,filename:_e.file.name,size:_e.file.size,imageId:it}),URL.revokeObjectURL(_e.previewUrl)}g([]),ee&&await $g(t,ee),f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:R1(e)})}catch(_e){j(_e instanceof Error?_e.message:"Failed to send image")}finally{w(!1)}return}V.mutate(ee)}},[Se,G]=b.useState(!1),[W,Z]=b.useState(""),re=b.useRef(null);b.useEffect(()=>{var ee;Se&&((ee=re.current)==null||ee.focus())},[Se]);const ve=kt({mutationFn:ee=>J7(t,ee),onSuccess:()=>{G(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),Re=()=>{const ee=W.trim();ve.mutate(ee.length>0?ee:null)},_=b.useMemo(()=>{const ee=(B==null?void 0:B.items)??[],me=hH((O==null?void 0:O.items)??[]),_e=[...ee.map(Le=>({kind:"message",at:Le.createdAt,key:`m-${Le.id}`,data:Le})),...me.map(Le=>({kind:"event",at:Le.createdAt,key:`e-${Le.id}`,data:Le}))];return _e.sort((Le,it)=>Le.at.localeCompare(it.at)),_e},[B,O]),L=_.length;b.useEffect(()=>{var ee;L>0&&((ee=R.current)==null||ee.scrollIntoView({behavior:"smooth"}))},[L]);const P=a(e),T=b.useMemo(()=>{var ee;return new Set(((ee=D==null?void 0:D.participants)==null?void 0:ee.map(me=>me.agentId))??[])},[D==null?void 0:D.participants]),q=b.useMemo(()=>{const ee=new Set;for(const _e of(D==null?void 0:D.participants)??[])ee.add(_e.agentId);for(const _e of(U==null?void 0:U.agents)??[])ee.add(_e.agentId);ee.size===0&&ee.add(e);const me=[];for(const _e of ee){if(_e===o)continue;const Le=l(_e);!Le||!Le.name||me.push({agentId:_e,name:Le.name,displayName:Le.displayName})}return me},[D==null?void 0:D.participants,U==null?void 0:U.agents,e,l,o]),X=b.useMemo(()=>{if(!D)return!1;if(D.type==="group")return!0;const ee=D.participants.some(me=>me.agentId===o);return D.type==="direct"&&!ee&&D.participants.length>=2},[D,o]);b.useEffect(()=>{if(M.current.has(t)||!B||!O||!D||_.length>0||u.length>0||X||P===e)return;const ee=`Hi ${P}! What can you help with?`;f(ee),h(ee.length),M.current.add(t),requestAnimationFrame(()=>{const me=E.current;me&&(me.focus(),me.setSelectionRange(ee.length,ee.length))})},[t,e,B,O,D,_.length,u.length,P,X]);const ue=b.useMemo(()=>{const ee=q.map(me=>({agentId:me.agentId,name:me.name}));return NC(u,ee)},[u,q]),xe=b.useMemo(()=>T.size===0?[]:ue.filter(ee=>!T.has(ee)),[ue,T]),be=sN({value:u,cursor:m,candidates:q,disabled:V.isPending||x,onSelect:ee=>{f(ee.text),h(ee.cursor),requestAnimationFrame(()=>{const me=E.current;me&&(me.focus(),me.setSelectionRange(ee.cursor,ee.cursor))})}});return c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6)",borderBottom:"var(--hairline) solid var(--border)"},children:c.jsxs("div",{className:"flex items-center",style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%",gap:10},children:[c.jsx("div",{className:"flex items-center min-w-0",style:{gap:8,flex:1},children:Se?c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:re,value:W,onChange:ee=>Z(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"?(ee.preventDefault(),Re()):ee.key==="Escape"&&(ee.preventDefault(),G(!1))},disabled:ve.isPending,maxLength:500,placeholder:(D==null?void 0:D.title)??"Chat name",className:"outline-none text-subtitle",style:{fieldSizing:"content",minWidth:200,maxWidth:480,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),c.jsx("button",{type:"button",onClick:Re,disabled:ve.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:c.jsx(jr,{className:"h-3.5 w-3.5"})}),c.jsx("button",{type:"button",onClick:()=>G(!1),disabled:ve.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:c.jsx(wu,{className:"h-3.5 w-3.5"})})]}):c.jsx("button",{type:"button",onClick:()=>{Z((D==null?void 0:D.topic)??""),G(!0)},title:"Click to rename",className:"truncate text-subtitle text-left min-w-0",style:{color:"var(--fg)",background:"transparent",border:"none",padding:0,cursor:"pointer"},children:(D==null?void 0:D.title)??"…"})}),c.jsx(jH,{chatId:t,participantIds:((fe=D==null?void 0:D.participants)==null?void 0:fe.map(ee=>ee.agentId))??[e],candidates:q,agentIdentity:l,onAdded:()=>n.invalidateQueries({queryKey:["chat-detail",t]})})]})}),c.jsx("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-6)"},children:c.jsxs("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:[L===0&&c.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[c.jsx(uy,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),c.jsx("div",{className:"flex flex-col",style:{gap:4},children:_.map(ee=>{if(ee.kind==="event"){const me=ee.data;switch(me.kind){case"tool_call":return c.jsx(gH,{event:me},ee.key);case"assistant_text":return c.jsx(yH,{event:me,agentId:e,agentNameFn:a},ee.key);case"thinking":return c.jsx(vH,{event:me},ee.key);case"error":return c.jsx(bH,{event:me},ee.key);default:return null}}return c.jsx(xH,{msg:ee.data,myAgentId:o,agentNameFn:a},ee.key)})}),c.jsx("div",{ref:R})]})}),c.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6) var(--sp-3)"},children:c.jsxs("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:[c.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ee=>ee.preventDefault(),onDrop:ee=>{ee.preventDefault(),F(Array.from(ee.dataTransfer.files))},children:[y.length>0&&c.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:y.map(ee=>c.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[c.jsx("img",{src:ee.previewUrl,alt:ee.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),c.jsx("button",{type:"button",onClick:()=>ne(ee.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:c.jsx(wu,{className:"h-2 w-2"})})]},ee.id))}),c.jsxs("div",{style:{position:"relative"},children:[c.jsx(oN,{trigger:be.trigger,results:be.results,highlightIndex:be.highlightIndex,anchorRef:E,onPick:be.pick}),c.jsx("textarea",{ref:E,value:u,onChange:ee=>{f(ee.target.value),h(ee.target.selectionStart??ee.target.value.length)},onSelect:ee=>{h(ee.currentTarget.selectionStart??u.length)},onFocus:()=>{X&&(z.current||u.length>0||q.length===0||(z.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const ee=E.current;ee&&ee.setSelectionRange(1,1)})))},onPaste:ee=>{const me=Array.from(ee.clipboardData.files);me.length>0&&(ee.preventDefault(),F(me))},placeholder:X?"Type @ to pick a recipient, then your message":`Message @${P} · / for commands · @ to mention`,rows:2,onKeyDown:ee=>{be.handleKey(ee)||ee.key==="Enter"&&!ee.shiftKey&&(ee.preventDefault(),oe())},disabled:V.isPending||x,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)"}})]}),c.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[c.jsxs("span",{className:"mono flex items-center",style:{gap:10},children:[c.jsx("button",{type:"button",onClick:()=>{const ee=E.current;if(!ee)return;const me=ee.selectionStart??u.length,_e=ee.selectionEnd??me,Le=`${u.slice(0,me)}@${u.slice(_e)}`;f(Le),h(me+1),requestAnimationFrame(()=>{ee.focus(),ee.setSelectionRange(me+1,me+1)})},title:"Mention an agent (or type @)",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:c.jsx(xR,{className:"h-3.5 w-3.5"})}),c.jsx("button",{type:"button",onClick:()=>{var ee;return(ee=C.current)==null?void 0:ee.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:c.jsx(GR,{className:"h-3.5 w-3.5"})}),c.jsx("input",{ref:C,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ee=>{ee.target.files&&(F(Array.from(ee.target.files)),ee.target.value="")}})]}),c.jsxs("span",{className:"flex items-center",style:{gap:8},children:[x&&c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),c.jsx("button",{type:"button",onClick:oe,disabled:V.isPending||x||!u.trim()&&y.length===0||X&&ue.length===0,title:X&&ue.length===0?"Pick at least one recipient with @ before sending in a group chat":"Send (Enter)","aria-label":"Send",className:Ae("inline-flex items-center justify-center transition-opacity",(V.isPending||x||!u.trim()&&y.length===0||X&&ue.length===0)&&"opacity-40 cursor-not-allowed"),style:{width:28,height:28,borderRadius:"var(--radius-input)",background:"var(--fg)",color:"var(--bg-raised)",border:"none"},children:c.jsx(Nk,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]})]}),(V.isError||k)&&c.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(V.error instanceof Error?V.error.message:"Failed to send")})]})})]})}function jH({chatId:e,participantIds:t,candidates:n,agentIdentity:a,onAdded:l}){const[o,u]=b.useState(!1),f=b.useRef(null);b.useEffect(()=>{if(!o)return;const y=g=>{f.current&&(f.current.contains(g.target)||u(!1))};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o]);const m=kt({mutationFn:y=>iN(e,{participantIds:[y]}),onSuccess:()=>{u(!1),l()}}),h=b.useMemo(()=>n.filter(y=>!t.includes(y.agentId)),[n,t]);return c.jsxs("div",{className:"inline-flex items-center flex-wrap",style:{gap:4},children:[t.map(y=>{const g=a(y),x=(g==null?void 0:g.displayName)??(g==null?void 0:g.name)??y.slice(0,8);return c.jsx("span",{className:"inline-flex items-center text-label",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-sunken)",color:"var(--fg-2)"},children:x},y)}),c.jsxs("div",{ref:f,style:{position:"relative"},children:[c.jsx("button",{type:"button",onClick:()=>u(!o),disabled:h.length===0||m.isPending,title:h.length===0?"All available agents are already in this chat":"Add participant","aria-label":"Add participant",className:"inline-flex items-center transition-colors hover:bg-[var(--bg-sunken)]",style:{padding:"var(--sp-0_5) var(--sp-1)",borderRadius:"var(--radius-chip)",border:"var(--hairline) solid var(--border)",background:"transparent",color:h.length===0?"var(--fg-4)":"var(--fg-3)",cursor:h.length===0?"not-allowed":"pointer"},children:c.jsx(Mr,{className:"h-3 w-3"})}),o&&h.length>0&&c.jsx("div",{role:"listbox","aria-label":"Add participant",className:"absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg",style:{top:"calc(100% + var(--sp-1))",right:0,minWidth:280,background:"var(--bg-raised)",borderColor:"var(--border)"},children:h.map(y=>c.jsxs("button",{type:"button",role:"option","aria-selected":"false",onClick:()=>m.mutate(y.agentId),disabled:m.isPending,className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:[c.jsx("span",{className:"font-medium",children:y.displayName??(y.name?`@${y.name}`:"—")}),y.name&&y.displayName&&c.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",y.name]})]},y.agentId))})]})]})}function CS(e,t){return e?e.find(n=>n.chatId===t)??null:null}function CH(e,t){var l;const n=e.filter(o=>o.agentId!==t),a=n.find(o=>o.type!==void 0&&o.type!=="human");return a?a.agentId:((l=n[0])==null?void 0:l.agentId)??null}function EH({chatId:e}){const t=an(),{agentId:n}=zt(),a=b.useRef(new Map),{data:l}=Ve({queryKey:["chat-detail",e],queryFn:()=>lN(e),enabled:!!e}),{data:o}=Ve({queryKey:["me","chats","all"],queryFn:()=>sf({filter:"all"}),refetchInterval:3e4}),{data:u}=Ve({queryKey:["me","chats","watching"],queryFn:()=>sf({filter:"watching"}),refetchInterval:3e4}),f=b.useMemo(()=>CS(o==null?void 0:o.rows,e)??CS(u==null?void 0:u.rows,e)??null,[o,u,e]),m=b.useMemo(()=>f?f.participants.map(j=>({agentId:j.agentId,type:j.type})):l?l.participants.map(j=>({agentId:j.agentId,type:void 0})):[],[f,l]),h=b.useMemo(()=>CH(m,n),[m,n]),g=kt({mutationFn:()=>V7(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]})}}).mutate,x=(f==null?void 0:f.lastMessageAt)??"";b.useEffect(()=>{!f||a.current.get(e)===x||(a.current.set(e,x),g())},[e,f,x,g]);const w=kt({mutationFn:()=>Q7(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]}),t.invalidateQueries({queryKey:["chat-detail",e]})}}),k=(f==null?void 0:f.membershipKind)==="watching";return h?k?c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[c.jsxs("div",{className:"flex items-center",style:{gap:8},children:[c.jsx("span",{className:"text-subtitle",style:{color:"var(--fg)"},children:(f==null?void 0:f.title)??"Chat"}),c.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--fg-3)",background:"var(--bg-sunken)"},children:"watching"})]}),c.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)",marginTop:4},children:"You can read this chat. Join to reply."})]}),c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(jS,{agentId:h,chatId:e})}),c.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:c.jsxs("div",{style:{maxWidth:640,margin:"0 auto"},children:[c.jsx(ge,{type:"button",onClick:()=>w.mutate(),disabled:w.isPending,style:{width:"100%"},children:w.isPending?"Joining…":"Join to reply"}),w.isError&&c.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:6},children:w.error instanceof Error?w.error.message:"Failed to join"})]})})]}):c.jsx(jS,{agentId:h,chatId:e}):c.jsx("div",{className:"flex-1 flex items-center justify-center",style:{padding:"var(--sp-8)"},children:c.jsxs("div",{className:"text-center",style:{color:"var(--fg-3)"},children:[c.jsx("div",{className:"text-subtitle",style:{color:"var(--fg-2)",marginBottom:6},children:"Loading chat…"}),c.jsx("div",{className:"text-body",children:"Resolving participants."})]})})}function NH(){return c.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:c.jsxs("div",{className:"text-center max-w-sm",children:[c.jsx(Vu,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),c.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),c.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}const _H=3e4,TH=1e3,AH=3e3;function RH(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function zH(){var xe;const{refreshMe:e,organizationId:t,memberId:n}=zt(),a=zn(),l=XA(t,n),o=WA(l),u=o!=null&&o.connectToken&&o.connectTokenExpiresAt&&o.connectTokenExpiresAt>Date.now()?o.connectToken:null,f=u?(o==null?void 0:o.connectTokenExpiresAt)??null:null,[m,h]=b.useState(()=>(o==null?void 0:o.displayName)??""),[y,g]=b.useState(()=>(o==null?void 0:o.selectedRuntime)??null),[x,w]=b.useState(null),[k,j]=b.useState(null),[C,E]=b.useState(null),[R,z]=b.useState(()=>u),[M,B]=b.useState(()=>f),[O,D]=b.useState([]),[U,V]=b.useState("form"),[F,ne]=b.useState(null),[oe]=b.useState(()=>GA()),Se=b.useRef(null),G=b.useRef(null),W=b.useRef(null),Z=b.useRef(0);b.useEffect(()=>()=>{G.current&&(G.current.cancelled=!0)},[]),b.useEffect(()=>{eR(l,{displayName:m,selectedRuntime:y,connectToken:R,connectTokenExpiresAt:M})},[l,m,y,R,M]),b.useEffect(()=>{(async()=>{try{const be=await je.get("/me/organizations");D(be)}catch{}})()},[]),b.useEffect(()=>{if(U!=="form")return;let be=!1;const fe=async()=>{const me=++Z.current;try{const _e=await Ei();if(be||me!==Z.current)return;const it=_e.filter(pt=>pt.status==="connected").sort((pt,Ur)=>Ur.lastSeenAt.localeCompare(pt.lastSeenAt))[0]??null;if(w(pt=>(pt==null?void 0:pt.id)===(it==null?void 0:it.id)?pt:it),it){W.current!==it.id&&(W.current=null,E(null),j(null));try{const pt=await my(it.id);if(be||me!==Z.current)return;W.current=it.id,E(it.id),j(pt.capabilities)}catch{}}else W.current=null,E(null),j(null)}catch{}};fe();const ee=setInterval(fe,AH);return()=>{be=!0,clearInterval(ee)}},[U]),b.useEffect(()=>{if(x)return;if(R&&M&&M>Date.now()){const fe=Math.max(M-Date.now(),0),ee=window.setTimeout(()=>{z(null),B(null)},fe);return()=>window.clearTimeout(ee)}R&&(z(null),B(null));let be=!1;return(async()=>{try{const fe=await je.post("/connect-tokens",{});be||(z(fe.token),B(Date.now()+fe.expiresIn*1e3))}catch(fe){be||ne(fe instanceof Error?fe.message:"Failed to generate connect token")}})(),()=>{be=!0}},[x,R,M]);const re=x&&C===x.id?k:null;b.useEffect(()=>{g(be=>{if(!re)return be;const fe=Object.entries(re).filter(([,ee])=>ee.state==="ok").map(([ee])=>ee);return be&&fe.includes(be)?be:fe[0]??null})},[re]);const ve=re?Object.entries(re).filter(([,be])=>be.state==="ok").map(([be])=>be):[],Re=((xe=O.find(be=>be.id===t))==null?void 0:xe.displayName)??"",_=m.trim(),L=_||"your agent",P=R?`npm install -g @agent-team-foundation/first-tree-hub
|
|
382
|
+
first-tree-hub connect ${R}`:null,T=b.useCallback(async be=>{G.current&&(G.current.cancelled=!0);const fe={cancelled:!1};G.current=fe;const ee=Date.now();for(;!fe.cancelled;){let me=!1;try{const _e=await je.get(`/admin/agents/${encodeURIComponent(be)}/client-status`);if(fe.cancelled)return;me=_e.online===!0}catch{if(fe.cancelled)return}if(me){try{const _e=await tH(be);if(fe.cancelled||(tR(l),await e(),fe.cancelled))return;a(`/?a=${encodeURIComponent(be)}&c=${encodeURIComponent(_e.id)}`,{replace:!0})}catch(_e){if(fe.cancelled)return;ne(_e instanceof Error?_e.message:"Failed to open chat"),V("timeout")}return}if(Date.now()-ee>_H){fe.cancelled||V("timeout");return}await new Promise(_e=>setTimeout(_e,TH))}},[l,e,a]),q=!!(_&&x&&y&&ve.includes(y)&&U==="form"),X=b.useCallback(async()=>{if(!x||!y||!_)return;ne(null),V("creating");const be=Bg(_);let fe;try{fe=(await je.post("/admin/agents",{type:"personal_assistant",displayName:_,...be?{name:be}:{},clientId:x.id,runtimeProvider:y,...t?{organizationId:t}:{}})).uuid,Se.current=fe}catch(ee){ne(ee instanceof Error?ee.message:"Failed to create agent"),V("form");return}await T(fe)},[_,x,y,T,t]),ue=b.useCallback(async()=>{const be=Se.current;be&&(ne(null),V("creating"),await T(be))},[T]);return c.jsx("div",{className:"flex-1 overflow-auto",style:{display:"flex",justifyContent:"center",padding:"clamp(var(--sp-16), 12vh, var(--sp-45)) var(--sp-4) var(--sp-12)"},children:c.jsxs("div",{style:{width:"100%",maxWidth:560},children:[U==="form"&&c.jsx(OH,{joinPath:oe,teamName:Re,displayName:m,setDisplayName:h,trimmedName:_,connectedClient:x,cliCommand:P,okRuntimes:ve,selectedRuntime:y,setSelectedRuntime:g,capabilitiesLoaded:re!==null,error:F,canCreate:q,onCreate:X}),U==="creating"&&c.jsx(BH,{nameOrFallback:L}),U==="timeout"&&c.jsx($H,{nameOrFallback:L,hostname:(x==null?void 0:x.hostname)??null,error:F,onRetry:ue})]})})}function OH({joinPath:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:l,connectedClient:o,cliCommand:u,okRuntimes:f,selectedRuntime:m,setSelectedRuntime:h,capabilitiesLoaded:y,error:g,canCreate:x,onCreate:w}){const k=b.useRef(null),C=e==="invite"&&t?`Welcome — you've joined ${t}`:"Welcome to First Tree Hub",E=l?o?m?"Ready to create.":"Next: choose a runtime.":"Next: connect the computer where they'll work.":"Next: name your agent.";return b.useEffect(()=>{var R;l||(R=k.current)==null||R.focus()},[l]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-col items-start",style:{gap:"var(--sp-4)",paddingTop:0},children:[c.jsxs("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)",maxWidth:420},children:[c.jsx("span",{style:{color:"var(--fg-2)"},children:C}),c.jsx("span",{style:{color:"var(--fg-4)"},children:" · "}),"Where agents and humans work as one team."]}),c.jsx("h1",{className:"text-title font-semibold",style:{margin:0,color:"var(--fg)"},children:"Let's create your first agent."})]}),c.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[c.jsx(DH,{}),c.jsx(ES,{number:"01",state:l?"complete":"active",children:c.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)",flexWrap:"wrap"},children:[c.jsx("label",{htmlFor:"onboarding-name",className:"text-body font-normal",style:{color:"var(--fg-2)",whiteSpace:"nowrap"},children:"What should we call this agent?"}),c.jsx("input",{ref:k,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange:R=>a(R.target.value),placeholder:"e.g. Code Reviewer",maxLength:200,className:"onboarding-name-input text-body font-medium",style:{flex:"0 1 28ch",minWidth:"22ch",maxWidth:"30ch",padding:"var(--sp-0_5) 0",background:"transparent",border:0,borderBottom:"var(--hairline) solid var(--border-faint)",borderRadius:0,boxShadow:"none",color:"var(--fg)",outline:"none",caretColor:"var(--accent)",transition:"border-color 160ms ease, color 160ms ease"},onFocus:R=>{R.currentTarget.style.borderBottomColor="var(--accent)"},onBlur:R=>{R.currentTarget.style.borderBottomColor="var(--border-faint)"}})]})}),c.jsx(ES,{number:"02",state:x?"complete":l?"active":"idle",children:c.jsxs("div",{style:{animation:l?"subtle-fade 200ms ease-out":void 0},children:[c.jsxs("h2",{className:"text-subtitle font-semibold",style:{color:l?"var(--fg)":"var(--fg-4)",fontWeight:l?600:500},children:["Where will ",l||"this agent"," run?"]}),l?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:o?`This computer will run ${l} and keep it connected to Hub.`:"This agent needs a computer to do its work. Connect the one it should use."}),!o&&c.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",marginTop:"var(--sp-2)"},children:"Open Terminal on that computer and run this command."}),o?c.jsx(LH,{hostname:o.hostname??o.id}):c.jsxs(c.Fragment,{children:[c.jsx(MH,{command:u}),c.jsx(IH,{})]}),o&&c.jsx(UH,{runtimes:f,selected:m,onSelect:h,capabilitiesLoaded:y})]}):null]})})]}),g&&c.jsx("div",{className:"text-body",style:{marginTop:"var(--sp-4)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:g}),l&&c.jsxs("div",{style:{marginTop:x?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!x&&c.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:E}),x&&c.jsxs(ge,{type:"button",size:"default",style:{marginTop:0,border:"var(--hairline) solid color-mix(in oklch, var(--accent) 32%, transparent)",background:"var(--accent)",boxShadow:"var(--shadow-md)",color:"var(--primary-foreground, var(--color-primary-foreground))",opacity:1,transform:"translateZ(0)",transition:"box-shadow 160ms ease, transform 160ms ease"},onClick:w,onMouseEnter:R=>{R.currentTarget.style.transform="scale(1.01)",R.currentTarget.style.boxShadow="var(--shadow-md)"},onMouseLeave:R=>{R.currentTarget.style.transform="scale(1)",R.currentTarget.style.boxShadow="var(--shadow-md)"},children:[c.jsxs("span",{children:["Create ",l]}),c.jsx(yR,{className:"h-4 w-4"})]}),c.jsx("p",{className:"text-caption",style:{margin:x?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function DH(){return c.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"var(--sp-5)",bottom:"var(--sp-5)",left:"calc(var(--sp-2_5) - var(--hairline))",width:"var(--hairline)",background:"color-mix(in oklch, var(--border-faint) 56%, transparent)"}})}function ES({number:e,state:t,children:n}){const a=t==="active",l=t==="complete";return c.jsxs("section",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:"var(--sp-3)",marginTop:e==="01"?0:"var(--sp-5)",position:"relative"},children:[c.jsx("div",{className:"mono text-caption flex items-center justify-center",style:{width:"var(--sp-5)",height:"var(--sp-5)",borderRadius:999,background:a||l?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:a||l?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",color:a||l?"var(--accent)":"var(--fg-4)",zIndex:1},children:l?c.jsx(jr,{className:"h-3 w-3"}):e}),c.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}function MH({command:e}){const[t,n]=b.useState(!1),l=(e?e.split(`
|
|
383
|
+
`):[]).find(m=>m.startsWith("first-tree-hub"))??"",o="first-tree-hub connect ",u=l.startsWith(o)?`${o}${l.slice(o.length,o.length+22)}…`:l.length>52?`${l.slice(0,52)}…`:l,f=async()=>{e&&(await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500))};return c.jsx("div",{style:{marginTop:"var(--sp-2)"},children:c.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[c.jsx("pre",{className:"mono text-label",title:l,style:{flex:1,minHeight:38,margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--bg-sunken) 42%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--border-faint) 58%, transparent)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:u||"Generating token…"}),c.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:!e,style:{alignSelf:"stretch",background:"color-mix(in oklch, var(--bg-raised) 48%, transparent)",borderColor:"color-mix(in oklch, var(--border) 58%, transparent)",boxShadow:"none",height:"auto",minHeight:38},children:[t?c.jsx(jr,{className:"h-3.5 w-3.5"}):c.jsx(Tk,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function IH(){return c.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",color:"color-mix(in oklch, var(--accent) 24%, var(--fg-3))"},children:[c.jsx(PH,{}),c.jsx("span",{children:"Waiting for your computer…"})]})}function LH({hostname:e}){return c.jsxs("div",{className:"inline-flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",padding:"var(--sp-1_5) var(--sp-2_5)",borderRadius:999,background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"color-mix(in oklch, var(--accent) 26%, var(--fg))",animation:"onboarding-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1.15)"},children:[c.jsx(jr,{className:"h-3.5 w-3.5"}),c.jsxs("span",{children:[c.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function UH({runtimes:e,selected:t,onSelect:n,capabilitiesLoaded:a}){return e.length===0?c.jsx("p",{className:"text-label",style:{marginTop:"var(--sp-3)",color:"var(--fg-3)"},children:a?"No runtime ready on this computer. Install Claude Code or Codex, then check back.":"Detecting installed runtimes…"}):c.jsxs("div",{style:{marginTop:"var(--sp-3)"},children:[c.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Powered by"}),c.jsxs("fieldset",{className:"flex",style:{gap:"var(--sp-4)",flexWrap:"wrap",margin:0,padding:0,border:0},children:[c.jsx("legend",{className:"sr-only",children:"Runtime provider"}),e.map((l,o)=>{const u=t===l;return c.jsxs("label",{className:"onboarding-runtime-option inline-flex items-center text-body",style:{gap:"var(--sp-1_5)",padding:"var(--sp-1) 0",cursor:"pointer",color:u?"color-mix(in oklch, var(--accent) 30%, var(--fg))":"var(--fg)",fontWeight:u?600:400,animation:`onboarding-rise 220ms ease-out ${o*80}ms both`,transition:"color 160ms ease, opacity 160ms ease, transform 160ms ease"},children:[c.jsx("input",{type:"radio",name:"onboarding-runtime",value:l,checked:u,onChange:()=>n(l),className:"sr-only"}),c.jsx("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center",style:{width:14,height:14,borderRadius:"50%",border:u?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-strong)",background:u?"color-mix(in oklch, var(--accent) 8%, transparent)":"transparent",boxShadow:u?"0 0 0 var(--sp-0_5) color-mix(in oklch, var(--accent) 10%, transparent)":"none",transition:"border-color 160ms ease, background 160ms ease, box-shadow 160ms ease"},children:u&&c.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)"}})}),RH(l)]},l)})]})]})}function PH(){return c.jsxs("span",{"aria-hidden":"true",style:{position:"relative",display:"inline-block",width:8,height:8,flexShrink:0},children:[c.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)"}}),c.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.55}})]})}function BH({nameOrFallback:e}){return c.jsxs("div",{className:"flex flex-col items-center text-center",style:{paddingTop:"var(--sp-12)",gap:"var(--sp-4)"},children:[c.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:["Creating ",e,"…"]}),c.jsx(FH,{}),c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function $H({nameOrFallback:e,hostname:t,error:n,onRetry:a}){const l=t??"your computer";return c.jsxs("div",{className:"flex flex-col",style:{paddingTop:"var(--sp-8)",gap:"var(--sp-4)"},children:[c.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:[e," is taking longer than expected."]}),n?c.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 25%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:n}):c.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)"},children:[c.jsx("p",{children:"This usually means:"}),c.jsxs("ul",{style:{paddingLeft:"var(--sp-4)",listStyle:"disc",marginTop:"var(--sp-1_5)"},children:[c.jsxs("li",{children:["The runtime can't start on ",l," (missing API key, etc.)"]}),c.jsxs("li",{children:["The connection to ",l," dropped"]})]}),c.jsxs("p",{style:{marginTop:"var(--sp-2)"},children:["Fix it on ",l,", then click ",c.jsx("span",{className:"font-semibold",children:"Try again"}),"."]})]}),c.jsx("div",{className:"flex",style:{gap:"var(--sp-2)"},children:c.jsx(ge,{onClick:a,children:"Try again"})})]})}function FH(){return c.jsxs("span",{className:"flex items-center",style:{gap:6},children:[c.jsx(Bp,{delayMs:0}),c.jsx(Bp,{delayMs:160}),c.jsx(Bp,{delayMs:320})]})}function Bp({delayMs:e}){return c.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",animationDelay:`${e}ms`,display:"inline-block"}})}function qH({selectedChatId:e,onSelectChat:t}){const{wizardStep:n}=zt();return e===of?c.jsx(lH,{onCreated:t}):e?c.jsx(EH,{chatId:e}):n!==null&&n!=="completed"?c.jsx(zH,{}):c.jsx(NH,{})}function HH(){const[e,t]=wk(),n=e.get("c"),a=e.get("a");QC(),b.useEffect(()=>{if(a&&n){t({c:n},{replace:!0});return}a&&!n&&t({},{replace:!0})},[a,n,t]);const l=b.useCallback(u=>{t({c:u})},[t]),o=b.useCallback(()=>{t({c:of})},[t]);return c.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[c.jsx(X7,{selectedChatId:n,onSelectChat:l,onNewChat:o}),c.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:c.jsx(qH,{selectedChatId:n,onSelectChat:l})})]})}const ZH=new iT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function VH(){return c.jsx(lT,{client:ZH,children:c.jsx(rR,{children:c.jsx(MA,{children:c.jsxs(cA,{children:[c.jsx(At,{path:"/login",element:c.jsx($q,{})}),c.jsx(At,{path:"/signup",element:c.jsx(ar,{to:"/login",replace:!0})}),c.jsx(At,{path:"/auth/github/complete",element:c.jsx(Fq,{})}),c.jsx(At,{path:"/invite/:token",element:c.jsx(Lq,{})}),c.jsx(At,{element:c.jsx(uR,{}),children:c.jsxs(At,{element:c.jsx(Y6,{children:c.jsx(rM,{})}),children:[c.jsx(At,{index:!0,element:c.jsx(HH,{})}),c.jsx(At,{path:"context",element:c.jsx(Mq,{})}),c.jsx(At,{path:"agents/:uuid",element:c.jsx(Nq,{})}),c.jsxs(At,{path:"team",element:c.jsx(H7,{}),children:[c.jsx(At,{index:!0,element:c.jsx(R7,{})}),c.jsx(At,{path:"settings",element:c.jsx(q7,{})})]}),c.jsxs(At,{path:"settings",element:c.jsx(w7,{}),children:[c.jsx(At,{index:!0,element:c.jsx(ar,{to:"computers",replace:!0})}),c.jsx(At,{path:"computers",element:c.jsx(a7,{})}),c.jsx(At,{path:"integrations",element:c.jsx(x7,{})})]}),c.jsx(At,{path:"agents",element:c.jsx(ar,{to:"/team",replace:!0})}),c.jsx(At,{path:"clients",element:c.jsx(ar,{to:"/settings/computers",replace:!0})}),c.jsx(At,{path:"integrations",element:c.jsx(ar,{to:"/settings/integrations",replace:!0})}),c.jsx(At,{path:"team/members",element:c.jsx(ar,{to:"/team",replace:!0})}),c.jsx(At,{path:"team/agents",element:c.jsx(ar,{to:"/team",replace:!0})}),c.jsx(At,{path:"team/invite",element:c.jsx(ar,{to:"/team",replace:!0})}),c.jsx(At,{path:"admin",element:c.jsx(QH,{})})]})})]})})})})}function QH(){const e=Zn();return e.hash==="#bindings"?c.jsx(ar,{to:`/settings/integrations${e.search}`,replace:!0}):c.jsx(ar,{to:`/team${e.hash}`,replace:!0})}const dN=document.getElementById("root");if(!dN)throw new Error("Root element not found");O2.createRoot(dN).render(c.jsx(b.StrictMode,{children:c.jsx(VH,{})}));export{yR as A,Vu as F,$u as L,st as c,c as j,b as r};
|