@agent-team-foundation/first-tree-hub 0.9.4 → 0.9.7
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/web/assets/index-CzlAfdgm.js +361 -0
- package/dist/web/assets/index-DEwlT6PE.css +1 -0
- package/dist/web/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/web/fonts/inter-latin.woff2 +0 -0
- package/dist/web/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
- package/dist/web/fonts/jetbrains-mono-latin.woff2 +0 -0
- package/dist/web/index.html +4 -2
- package/package.json +1 -1
- package/dist/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/dist/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/dist/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/dist/web/assets/geist-mono-cyrillic-wght-normal-BZdD_g9V.woff2 +0 -0
- package/dist/web/assets/geist-mono-latin-ext-wght-normal-b6lpi8_2.woff2 +0 -0
- package/dist/web/assets/geist-mono-latin-wght-normal-Cjtb1TV-.woff2 +0 -0
- package/dist/web/assets/index-DEbM78Bl.css +0 -1
- package/dist/web/assets/index-os2Tqmer.js +0 -361
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
var Xb=e=>{throw TypeError(e)};var gm=(e,t,n)=>t.has(e)||Xb("Cannot "+n);var U=(e,t,n)=>(gm(e,t,"read from private field"),n?n.call(e):t.get(e)),Ne=(e,t,n)=>t.has(e)?Xb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,a)=>(gm(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Be=(e,t,n)=>(gm(e,t,"access private method"),n);var Fc=(e,t,n,a)=>({set _(l){ye(e,t,l,n)},get _(){return U(e,t,a)}});function x2(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 Od(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ym={exports:{}},Bo={};/**
|
|
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 Jb;function b2(){if(Jb)return Bo;Jb=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 Bo.Fragment=t,Bo.jsx=n,Bo.jsxs=n,Bo}var Wb;function S2(){return Wb||(Wb=1,ym.exports=b2()),ym.exports}var d=S2(),vm={exports:{}},Le={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var e0;function w2(){if(e0)return Le;e0=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 b(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,E={};function _(L,z,C){this.props=L,this.context=z,this.refs=E,this.updater=C||k}_.prototype.isReactComponent={},_.prototype.setState=function(L,z){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,z,"setState")},_.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function A(){}A.prototype=_.prototype;function O(L,z,C){this.props=L,this.context=z,this.refs=E,this.updater=C||k}var I=O.prototype=new A;I.constructor=O,j(I,_.prototype),I.isPureReactComponent=!0;var B=Array.isArray;function R(){}var $={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function ee(L,z,C){var J=C.ref;return{$$typeof:e,type:L,key:z,ref:J!==void 0?J:null,props:C}}function q(L,z){return ee(L.type,z,L.props)}function ie(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function re(L){var z={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(C){return z[C]})}var pe=/\/+/g;function de(L,z){return typeof L=="object"&&L!==null&&L.key!=null?re(""+L.key):z.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(R,R):(L.status="pending",L.then(function(z){L.status==="pending"&&(L.status="fulfilled",L.value=z)},function(z){L.status==="pending"&&(L.status="rejected",L.reason=z)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function P(L,z,C,J,Y){var ue=typeof L;(ue==="undefined"||ue==="boolean")&&(L=null);var ge=!1;if(L===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(L.$$typeof){case e:case t:ge=!0;break;case y:return ge=L._init,P(ge(L._payload),z,C,J,Y)}}if(ge)return Y=Y(L),ge=J===""?"."+de(L,0):J,B(Y)?(C="",ge!=null&&(C=ge.replace(pe,"$&/")+"/"),P(Y,z,C,"",function(Nt){return Nt})):Y!=null&&(ie(Y)&&(Y=q(Y,C+(Y.key==null||L&&L.key===Y.key?"":(""+Y.key).replace(pe,"$&/")+"/")+ge)),z.push(Y)),1;ge=0;var Me=J===""?".":J+":";if(B(L))for(var be=0;be<L.length;be++)J=L[be],ue=Me+de(J,be),ge+=P(J,z,C,ue,Y);else if(be=b(L),typeof be=="function")for(L=be.call(L),be=0;!(J=L.next()).done;)J=J.value,ue=Me+de(J,be++),ge+=P(J,z,C,ue,Y);else if(ue==="object"){if(typeof L.then=="function")return P(W(L),z,C,J,Y);throw z=String(L),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return ge}function V(L,z,C){if(L==null)return L;var J=[],Y=0;return P(L,J,"","",function(ue){return z.call(C,ue,Y++)}),J}function ce(L){if(L._status===-1){var z=L._result;z=z(),z.then(function(C){(L._status===0||L._status===-1)&&(L._status=1,L._result=C)},function(C){(L._status===0||L._status===-1)&&(L._status=2,L._result=C)}),L._status===-1&&(L._status=0,L._result=z)}if(L._status===1)return L._result.default;throw L._result}var xe=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=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(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},T={map:V,forEach:function(L,z,C){V(L,function(){z.apply(this,arguments)},C)},count:function(L){var z=0;return V(L,function(){z++}),z},toArray:function(L){return V(L,function(z){return z})||[]},only:function(L){if(!ie(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Le.Activity=g,Le.Children=T,Le.Component=_,Le.Fragment=n,Le.Profiler=l,Le.PureComponent=O,Le.StrictMode=a,Le.Suspense=m,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Le.__COMPILER_RUNTIME={__proto__:null,c:function(L){return $.H.useMemoCache(L)}},Le.cache=function(L){return function(){return L.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(L,z,C){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var J=j({},L.props),Y=L.key;if(z!=null)for(ue in z.key!==void 0&&(Y=""+z.key),z)!Z.call(z,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&z.ref===void 0||(J[ue]=z[ue]);var ue=arguments.length-2;if(ue===1)J.children=C;else if(1<ue){for(var ge=Array(ue),Me=0;Me<ue;Me++)ge[Me]=arguments[Me+2];J.children=ge}return ee(L.type,Y,J)},Le.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},Le.createElement=function(L,z,C){var J,Y={},ue=null;if(z!=null)for(J in z.key!==void 0&&(ue=""+z.key),z)Z.call(z,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(Y[J]=z[J]);var ge=arguments.length-2;if(ge===1)Y.children=C;else if(1<ge){for(var Me=Array(ge),be=0;be<ge;be++)Me[be]=arguments[be+2];Y.children=Me}if(L&&L.defaultProps)for(J in ge=L.defaultProps,ge)Y[J]===void 0&&(Y[J]=ge[J]);return ee(L,ue,Y)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(L){return{$$typeof:f,render:L}},Le.isValidElement=ie,Le.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ce}},Le.memo=function(L,z){return{$$typeof:h,type:L,compare:z===void 0?null:z}},Le.startTransition=function(L){var z=$.T,C={};$.T=C;try{var J=L(),Y=$.S;Y!==null&&Y(C,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(R,xe)}catch(ue){xe(ue)}finally{z!==null&&C.types!==null&&(z.types=C.types),$.T=z}},Le.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Le.use=function(L){return $.H.use(L)},Le.useActionState=function(L,z,C){return $.H.useActionState(L,z,C)},Le.useCallback=function(L,z){return $.H.useCallback(L,z)},Le.useContext=function(L){return $.H.useContext(L)},Le.useDebugValue=function(){},Le.useDeferredValue=function(L,z){return $.H.useDeferredValue(L,z)},Le.useEffect=function(L,z){return $.H.useEffect(L,z)},Le.useEffectEvent=function(L){return $.H.useEffectEvent(L)},Le.useId=function(){return $.H.useId()},Le.useImperativeHandle=function(L,z,C){return $.H.useImperativeHandle(L,z,C)},Le.useInsertionEffect=function(L,z){return $.H.useInsertionEffect(L,z)},Le.useLayoutEffect=function(L,z){return $.H.useLayoutEffect(L,z)},Le.useMemo=function(L,z){return $.H.useMemo(L,z)},Le.useOptimistic=function(L,z){return $.H.useOptimistic(L,z)},Le.useReducer=function(L,z,C){return $.H.useReducer(L,z,C)},Le.useRef=function(L){return $.H.useRef(L)},Le.useState=function(L){return $.H.useState(L)},Le.useSyncExternalStore=function(L,z,C){return $.H.useSyncExternalStore(L,z,C)},Le.useTransition=function(){return $.H.useTransition()},Le.version="19.2.4",Le}var t0;function ng(){return t0||(t0=1,vm.exports=w2()),vm.exports}var S=ng();const k2=Od(S),rg=x2({__proto__:null,default:k2},[S]);var xm={exports:{}},Po={},bm={exports:{}},Sm={};/**
|
|
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 n0;function j2(){return n0||(n0=1,(function(e){function t(P,V){var ce=P.length;P.push(V);e:for(;0<ce;){var xe=ce-1>>>1,T=P[xe];if(0<l(T,V))P[xe]=V,P[ce]=T,ce=xe;else break e}}function n(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var V=P[0],ce=P.pop();if(ce!==V){P[0]=ce;e:for(var xe=0,T=P.length,L=T>>>1;xe<L;){var z=2*(xe+1)-1,C=P[z],J=z+1,Y=P[J];if(0>l(C,ce))J<T&&0>l(Y,C)?(P[xe]=Y,P[J]=ce,xe=J):(P[xe]=C,P[z]=ce,xe=z);else if(J<T&&0>l(Y,ce))P[xe]=Y,P[J]=ce,xe=J;else break e}}return V}function l(P,V){var ce=P.sortIndex-V.sortIndex;return ce!==0?ce:P.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],y=1,g=null,x=3,b=!1,k=!1,j=!1,E=!1,_=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function I(P){for(var V=n(h);V!==null;){if(V.callback===null)a(h);else if(V.startTime<=P)a(h),V.sortIndex=V.expirationTime,t(m,V);else break;V=n(h)}}function B(P){if(j=!1,I(P),!k)if(n(m)!==null)k=!0,R||(R=!0,re());else{var V=n(h);V!==null&&W(B,V.startTime-P)}}var R=!1,$=-1,Z=5,ee=-1;function q(){return E?!0:!(e.unstable_now()-ee<Z)}function ie(){if(E=!1,R){var P=e.unstable_now();ee=P;var V=!0;try{e:{k=!1,j&&(j=!1,A($),$=-1),b=!0;var ce=x;try{t:{for(I(P),g=n(m);g!==null&&!(g.expirationTime>P&&q());){var xe=g.callback;if(typeof xe=="function"){g.callback=null,x=g.priorityLevel;var T=xe(g.expirationTime<=P);if(P=e.unstable_now(),typeof T=="function"){g.callback=T,I(P),V=!0;break t}g===n(m)&&a(m),I(P)}else a(m);g=n(m)}if(g!==null)V=!0;else{var L=n(h);L!==null&&W(B,L.startTime-P),V=!1}}break e}finally{g=null,x=ce,b=!1}V=void 0}}finally{V?re():R=!1}}}var re;if(typeof O=="function")re=function(){O(ie)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,de=pe.port2;pe.port1.onmessage=ie,re=function(){de.postMessage(null)}}else re=function(){_(ie,0)};function W(P,V){$=_(function(){P(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(P){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var ce=x;x=V;try{return P()}finally{x=ce}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(P,V){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var ce=x;x=P;try{return V()}finally{x=ce}},e.unstable_scheduleCallback=function(P,V,ce){var xe=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?xe+ce:xe):ce=xe,P){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=ce+T,P={id:y++,callback:V,priorityLevel:P,startTime:ce,expirationTime:T,sortIndex:-1},ce>xe?(P.sortIndex=ce,t(h,P),n(m)===null&&P===n(h)&&(j?(A($),$=-1):j=!0,W(B,ce-xe))):(P.sortIndex=T,t(m,P),k||b||(k=!0,R||(R=!0,re()))),P},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(P){var V=x;return function(){var ce=x;x=V;try{return P.apply(this,arguments)}finally{x=ce}}}})(Sm)),Sm}var r0;function E2(){return r0||(r0=1,bm.exports=j2()),bm.exports}var wm={exports:{}},fn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var i0;function C2(){if(i0)return fn;i0=1;var e=ng();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 fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,fn.createPortal=function(m,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,y)},fn.flushSync=function(m){var h=u.T,y=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=h,a.p=y,a.d.f()}},fn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},fn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},fn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,b=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:b}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},fn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);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)},fn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin);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})}},fn.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)},fn.requestFormReset=function(m){a.d.r(m)},fn.unstable_batchedUpdates=function(m,h){return m(h)},fn.useFormState=function(m,h,y){return u.H.useFormState(m,h,y)},fn.useFormStatus=function(){return u.H.useHostTransitionStatus()},fn.version="19.2.4",fn}var a0;function MS(){if(a0)return wm.exports;a0=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=C2(),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 l0;function N2(){if(l0)return Po;l0=1;var e=E2(),t=ng(),n=MS();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,c=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===c)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==c.return)s=p,c=v;else{for(var w=!1,N=p.child;N;){if(N===s){w=!0,s=p,c=v;break}if(N===c){w=!0,c=p,s=v;break}N=N.sibling}if(!w){for(N=v.child;N;){if(N===s){w=!0,s=v,c=p;break}if(N===c){w=!0,c=v,s=p;break}N=N.sibling}if(!w)throw Error(a(189))}}if(s.alternate!==c)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"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function re(r){return r===null||typeof r!="object"?null:(r=ie&&r[ie]||r["@@iterator"],typeof r=="function"?r:null)}var pe=Symbol.for("react.client.reference");function de(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===pe?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case _:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case R:return"SuspenseList";case ee:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case I:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case $:return i=r.displayName||null,i!==null?i:de(r.type)||"Memo";case Z:i=r._payload,r=r._init;try{return de(r(i))}catch{}}return null}var W=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},xe=[],T=-1;function L(r){return{current:r}}function z(r){0>T||(r.current=xe[T],xe[T]=null,T--)}function C(r,i){T++,xe[T]=r.current,r.current=i}var J=L(null),Y=L(null),ue=L(null),ge=L(null);function Me(r,i){switch(C(ue,i),C(Y,r),C(J,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?bb(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=bb(i),r=Sb(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}z(J),C(J,r)}function be(){z(J),z(Y),z(ue)}function Nt(r){r.memoizedState!==null&&C(ge,r);var i=J.current,s=Sb(i,r.type);i!==s&&(C(Y,r),C(J,s))}function en(r){Y.current===r&&(z(J),z(Y)),ge.current===r&&(z(ge),Mo._currentValue=ce)}var Bn,tr;function tn(r){if(Bn===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Bn=i&&i[1]||"",tr=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Bn+r+tr}var _i=!1;function ft(r,i){if(!r||_i)return"";_i=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(X){var K=X}Reflect.construct(r,[],se)}else{try{se.call()}catch(X){K=X}r.call(se.prototype)}}else{try{throw Error()}catch(X){K=X}(se=r())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(X){if(X&&K&&typeof X.stack=="string")return[X.stack,K.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),w=v[0],N=v[1];if(w&&N){var M=w.split(`
|
|
44
|
-
`),G=N.split(`
|
|
45
|
-
`);for(p=c=0;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(c===M.length||p===G.length)for(c=M.length-1,p=G.length-1;1<=c&&0<=p&&M[c]!==G[p];)p--;for(;1<=c&&0<=p;c--,p--)if(M[c]!==G[p]){if(c!==1||p!==1)do if(c--,p--,0>p||M[c]!==G[p]){var te=`
|
|
46
|
-
`+M[c].replace(" at new "," at ");return r.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",r.displayName)),te}while(1<=c&&0<=p);break}}}finally{_i=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?tn(s):""}function Gt(r,i){switch(r.tag){case 26:case 27:case 5:return tn(r.type);case 16:return tn("Lazy");case 13:return r.child!==i&&i!==null?tn("Suspense Fallback"):tn("Suspense");case 19:return tn("SuspenseList");case 0:case 15:return ft(r.type,!1);case 11:return ft(r.type.render,!1);case 1:return ft(r.type,!0);case 31:return tn("Activity");default:return""}}function xr(r){try{var i="",s=null;do i+=Gt(r,s),s=r,r=r.return;while(r);return i}catch(c){return`
|
|
47
|
-
Error generating stack: `+c.message+`
|
|
48
|
-
`+c.stack}}var Zr=Object.prototype.hasOwnProperty,Vr=e.unstable_scheduleCallback,za=e.unstable_cancelCallback,Aa=e.unstable_shouldYield,Zs=e.unstable_requestPaint,nn=e.unstable_now,Vs=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,$e=e.unstable_LowPriority,nt=e.unstable_IdlePriority,cn=e.log,br=e.unstable_setDisableYieldValue,rn=null,Dt=null;function dn(r){if(typeof cn=="function"&&br(r),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(rn,r)}catch{}}var ut=Math.clz32?Math.clz32:zi,_r=Math.log,Pn=Math.LN2;function zi(r){return r>>>=0,r===0?32:31-(_r(r)/Pn|0)|0}var Ta=256,Ra=262144,Oa=4194304;function zr(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Da(r,i,s){var c=r.pendingLanes;if(c===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var N=c&134217727;return N!==0?(c=N&~v,c!==0?p=zr(c):(w&=N,w!==0?p=zr(w):s||(s=N&~r,s!==0&&(p=zr(s))))):(N=c&~v,N!==0?p=zr(N):w!==0?p=zr(w):s||(s=c&~r,s!==0&&(p=zr(s)))),p===0?0:i!==0&&i!==p&&(i&v)===0&&(v=p&-p,s=i&-i,v>=s||v===32&&(s&4194048)!==0)?i:p}function Ai(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function _u(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 Qs(){var r=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),r}function Sl(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function Ti(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function zu(r,i,s,c,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,M=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var te=31-ut(s),se=1<<te;N[te]=0,M[te]=-1;var K=G[te];if(K!==null)for(G[te]=null,te=0;te<K.length;te++){var X=K[te];X!==null&&(X.lane&=-536870913)}s&=~se}c!==0&&Gs(r,c,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~i))}function Gs(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-ut(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function oe(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var c=31-ut(s),p=1<<c;p&i|r[c]&i&&(r[c]|=i),s&=~p}}function He(r,i){var s=i&-i;return s=(s&42)!==0?1:Kt(s),(s&(r.suspendedLanes|i))!==0?0:s}function Kt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function wl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function lf(){var r=V.p;return r!==0?r:(r=window.event,r===void 0?32:Hb(r.type))}function ly(r,i){var s=V.p;try{return V.p=r,i()}finally{V.p=s}}var Ri=Math.random().toString(36).slice(2),an="__reactFiber$"+Ri,wn="__reactProps$"+Ri,kl="__reactContainer$"+Ri,sf="__reactEvents$"+Ri,oC="__reactListeners$"+Ri,uC="__reactHandles$"+Ri,sy="__reactResources$"+Ri,Ks="__reactMarker$"+Ri;function of(r){delete r[an],delete r[wn],delete r[sf],delete r[oC],delete r[uC]}function jl(r){var i=r[an];if(i)return i;for(var s=r.parentNode;s;){if(i=s[kl]||s[an]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=_b(r);r!==null;){if(s=r[an])return s;r=_b(r)}return i}r=s,s=r.parentNode}return null}function El(r){if(r=r[an]||r[kl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Ys(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Cl(r){var i=r[sy];return i||(i=r[sy]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Yt(r){r[Ks]=!0}var oy=new Set,uy={};function Ma(r,i){Nl(r,i),Nl(r+"Capture",i)}function Nl(r,i){for(uy[r]=i,r=0;r<i.length;r++)oy.add(i[r])}var cC=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]*$"),cy={},dy={};function dC(r){return Zr.call(dy,r)?!0:Zr.call(cy,r)?!1:cC.test(r)?dy[r]=!0:(cy[r]=!0,!1)}function Au(r,i,s){if(dC(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function Tu(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 Qr(r,i,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+c)}}function nr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function fy(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function fC(r,i,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,v=c.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,i,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function uf(r){if(!r._valueTracker){var i=fy(r)?"checked":"value";r._valueTracker=fC(r,i,""+r[i])}}function hy(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return r&&(c=fy(r)?r.checked?"true":"false":r.value),r=c,r!==s?(i.setValue(r),!0):!1}function Ru(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 hC=/[\n"\\]/g;function rr(r){return r.replace(hC,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function cf(r,i,s,c,p,v,w,N){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+nr(i)):r.value!==""+nr(i)&&(r.value=""+nr(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?df(r,w,nr(i)):s!=null?df(r,w,nr(s)):c!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+nr(N):r.removeAttribute("name")}function my(r,i,s,c,p,v,w,N){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){uf(r);return}s=s!=null?""+nr(s):"",i=i!=null?""+nr(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=N?r.checked:!!c,r.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),uf(r)}function df(r,i,s){i==="number"&&Ru(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function _l(r,i,s,c){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&&c&&(r[s].defaultSelected=!0)}else{for(s=""+nr(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function py(r,i,s){if(i!=null&&(i=""+nr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+nr(s):""}function gy(r,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(W(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=nr(i),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),uf(r)}function zl(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var mC=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 yy(r,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,s):typeof s!="number"||s===0||mC.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function vy(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&s[p]!==c&&yy(r,p,c)}else for(var v in i)i.hasOwnProperty(v)&&yy(r,v,i[v])}function ff(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 pC=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"]]),gC=/^[\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 Ou(r){return gC.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Gr(){}var hf=null;function mf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Al=null,Tl=null;function xy(r){var i=El(r);if(i&&(r=i.stateNode)){var s=r[wn]||null;e:switch(r=i.stateNode,i.type){case"input":if(cf(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="'+rr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==r&&c.form===r.form){var p=c[wn]||null;if(!p)throw Error(a(90));cf(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)c=s[i],c.form===r.form&&hy(c)}break e;case"textarea":py(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&_l(r,!!s.multiple,i,!1)}}}var pf=!1;function by(r,i,s){if(pf)return r(i,s);pf=!0;try{var c=r(i);return c}finally{if(pf=!1,(Al!==null||Tl!==null)&&(bc(),Al&&(i=Al,r=Tl,Tl=Al=null,xy(i),r)))for(i=0;i<r.length;i++)xy(r[i])}}function Xs(r,i){var s=r.stateNode;if(s===null)return null;var c=s[wn]||null;if(c===null)return null;s=c[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":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Kr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gf=!1;if(Kr)try{var Js={};Object.defineProperty(Js,"passive",{get:function(){gf=!0}}),window.addEventListener("test",Js,Js),window.removeEventListener("test",Js,Js)}catch{gf=!1}var Oi=null,yf=null,Du=null;function Sy(){if(Du)return Du;var r,i=yf,s=i.length,c,p="value"in Oi?Oi.value:Oi.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var w=s-r;for(c=1;c<=w&&i[s-c]===p[v-c];c++);return Du=p.slice(r,1<c?1-c:void 0)}function Mu(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 Lu(){return!0}function wy(){return!1}function kn(r){function i(s,c,p,v,w){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var 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)?Lu:wy,this.isPropagationStopped=wy,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=Lu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Lu)},persist:function(){},isPersistent:Lu}),i}var La={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uu=kn(La),Ws=g({},La,{view:0,detail:0}),yC=kn(Ws),vf,xf,eo,Iu=g({},Ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sf,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!==eo&&(eo&&r.type==="mousemove"?(vf=r.screenX-eo.screenX,xf=r.screenY-eo.screenY):xf=vf=0,eo=r),vf)},movementY:function(r){return"movementY"in r?r.movementY:xf}}),ky=kn(Iu),vC=g({},Iu,{dataTransfer:0}),xC=kn(vC),bC=g({},Ws,{relatedTarget:0}),bf=kn(bC),SC=g({},La,{animationName:0,elapsedTime:0,pseudoElement:0}),wC=kn(SC),kC=g({},La,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),jC=kn(kC),EC=g({},La,{data:0}),jy=kn(EC),CC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NC={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"},_C={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zC(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=_C[r])?!!i[r]:!1}function Sf(){return zC}var AC=g({},Ws,{key:function(r){if(r.key){var i=CC[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Mu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?NC[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sf,charCode:function(r){return r.type==="keypress"?Mu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Mu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),TC=kn(AC),RC=g({},Iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ey=kn(RC),OC=g({},Ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sf}),DC=kn(OC),MC=g({},La,{propertyName:0,elapsedTime:0,pseudoElement:0}),LC=kn(MC),UC=g({},Iu,{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}),IC=kn(UC),BC=g({},La,{newState:0,oldState:0}),PC=kn(BC),$C=[9,13,27,32],wf=Kr&&"CompositionEvent"in window,to=null;Kr&&"documentMode"in document&&(to=document.documentMode);var FC=Kr&&"TextEvent"in window&&!to,Cy=Kr&&(!wf||to&&8<to&&11>=to),Ny=" ",_y=!1;function zy(r,i){switch(r){case"keyup":return $C.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ay(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Rl=!1;function qC(r,i){switch(r){case"compositionend":return Ay(i);case"keypress":return i.which!==32?null:(_y=!0,Ny);case"textInput":return r=i.data,r===Ny&&_y?null:r;default:return null}}function HC(r,i){if(Rl)return r==="compositionend"||!wf&&zy(r,i)?(r=Sy(),Du=yf=Oi=null,Rl=!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 Cy&&i.locale!=="ko"?null:i.data;default:return null}}var ZC={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 Ty(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!ZC[r.type]:i==="textarea"}function Ry(r,i,s,c){Al?Tl?Tl.push(c):Tl=[c]:Al=c,i=Nc(i,"onChange"),0<i.length&&(s=new Uu("onChange","change",null,s,c),r.push({event:s,listeners:i}))}var no=null,ro=null;function VC(r){mb(r,0)}function Bu(r){var i=Ys(r);if(hy(i))return r}function Oy(r,i){if(r==="change")return i}var Dy=!1;if(Kr){var kf;if(Kr){var jf="oninput"in document;if(!jf){var My=document.createElement("div");My.setAttribute("oninput","return;"),jf=typeof My.oninput=="function"}kf=jf}else kf=!1;Dy=kf&&(!document.documentMode||9<document.documentMode)}function Ly(){no&&(no.detachEvent("onpropertychange",Uy),ro=no=null)}function Uy(r){if(r.propertyName==="value"&&Bu(ro)){var i=[];Ry(i,ro,r,mf(r)),by(VC,i)}}function QC(r,i,s){r==="focusin"?(Ly(),no=i,ro=s,no.attachEvent("onpropertychange",Uy)):r==="focusout"&&Ly()}function GC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Bu(ro)}function KC(r,i){if(r==="click")return Bu(i)}function YC(r,i){if(r==="input"||r==="change")return Bu(i)}function XC(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var $n=typeof Object.is=="function"?Object.is:XC;function io(r,i){if($n(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Zr.call(i,p)||!$n(r[p],i[p]))return!1}return!0}function Iy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function By(r,i){var s=Iy(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=i&&c>=i)return{node:s,offset:i-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Iy(s)}}function Py(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Py(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function $y(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ru(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=Ru(r.document)}return i}function Ef(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 JC=Kr&&"documentMode"in document&&11>=document.documentMode,Ol=null,Cf=null,ao=null,Nf=!1;function Fy(r,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Nf||Ol==null||Ol!==Ru(c)||(c=Ol,"selectionStart"in c&&Ef(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ao&&io(ao,c)||(ao=c,c=Nc(Cf,"onSelect"),0<c.length&&(i=new Uu("onSelect","select",null,i,s),r.push({event:i,listeners:c}),i.target=Ol)))}function Ua(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Dl={animationend:Ua("Animation","AnimationEnd"),animationiteration:Ua("Animation","AnimationIteration"),animationstart:Ua("Animation","AnimationStart"),transitionrun:Ua("Transition","TransitionRun"),transitionstart:Ua("Transition","TransitionStart"),transitioncancel:Ua("Transition","TransitionCancel"),transitionend:Ua("Transition","TransitionEnd")},_f={},qy={};Kr&&(qy=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function Ia(r){if(_f[r])return _f[r];if(!Dl[r])return r;var i=Dl[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in qy)return _f[r]=i[s];return r}var Hy=Ia("animationend"),Zy=Ia("animationiteration"),Vy=Ia("animationstart"),WC=Ia("transitionrun"),eN=Ia("transitionstart"),tN=Ia("transitioncancel"),Qy=Ia("transitionend"),Gy=new Map,zf="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(" ");zf.push("scrollEnd");function Sr(r,i){Gy.set(r,i),Ma(i,[r])}var Pu=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)},ir=[],Ml=0,Af=0;function $u(){for(var r=Ml,i=Af=Ml=0;i<r;){var s=ir[i];ir[i++]=null;var c=ir[i];ir[i++]=null;var p=ir[i];ir[i++]=null;var v=ir[i];if(ir[i++]=null,c!==null&&p!==null){var w=c.pending;w===null?p.next=p:(p.next=w.next,w.next=p),c.pending=p}v!==0&&Ky(s,p,v)}}function Fu(r,i,s,c){ir[Ml++]=r,ir[Ml++]=i,ir[Ml++]=s,ir[Ml++]=c,Af|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Tf(r,i,s,c){return Fu(r,i,s,c),qu(r)}function Ba(r,i){return Fu(r,null,null,i),qu(r)}function Ky(r,i,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,c=v.alternate,c!==null&&(c.childLanes|=s),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&i!==null&&(p=31-ut(s),r=v.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=s|536870912),v):null}function qu(r){if(50<_o)throw _o=0,Ph=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ll={};function nN(r,i,s,c){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(r,i,s,c){return new nN(r,i,s,c)}function Rf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Yr(r,i){var s=r.alternate;return s===null?(s=Fn(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 Yy(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 Hu(r,i,s,c,p,v){var w=0;if(c=r,typeof r=="function")Rf(r)&&(w=1);else if(typeof r=="string")w=s2(r,s,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case ee:return r=Fn(31,s,i,p),r.elementType=ee,r.lanes=v,r;case j:return Pa(s.children,p,v,i);case E:w=8,p|=24;break;case _:return r=Fn(12,s,i,p|2),r.elementType=_,r.lanes=v,r;case B:return r=Fn(13,s,i,p),r.elementType=B,r.lanes=v,r;case R:return r=Fn(19,s,i,p),r.elementType=R,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:w=10;break e;case A:w=9;break e;case I:w=11;break e;case $:w=14;break e;case Z:w=16,c=null;break e}w=29,s=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Fn(w,s,i,p),i.elementType=r,i.type=c,i.lanes=v,i}function Pa(r,i,s,c){return r=Fn(7,r,c,i),r.lanes=s,r}function Of(r,i,s){return r=Fn(6,r,null,i),r.lanes=s,r}function Xy(r){var i=Fn(18,null,null,0);return i.stateNode=r,i}function Df(r,i,s){return i=Fn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Jy=new WeakMap;function ar(r,i){if(typeof r=="object"&&r!==null){var s=Jy.get(r);return s!==void 0?s:(i={value:r,source:i,stack:xr(i)},Jy.set(r,i),i)}return{value:r,source:i,stack:xr(i)}}var Ul=[],Il=0,Zu=null,lo=0,lr=[],sr=0,Di=null,Ar=1,Tr="";function Xr(r,i){Ul[Il++]=lo,Ul[Il++]=Zu,Zu=r,lo=i}function Wy(r,i,s){lr[sr++]=Ar,lr[sr++]=Tr,lr[sr++]=Di,Di=r;var c=Ar;r=Tr;var p=32-ut(c)-1;c&=~(1<<p),s+=1;var v=32-ut(i)+p;if(30<v){var w=p-p%5;v=(c&(1<<w)-1).toString(32),c>>=w,p-=w,Ar=1<<32-ut(i)+p|s<<p|c,Tr=v+r}else Ar=1<<v|s<<p|c,Tr=r}function Mf(r){r.return!==null&&(Xr(r,1),Wy(r,1,0))}function Lf(r){for(;r===Zu;)Zu=Ul[--Il],Ul[Il]=null,lo=Ul[--Il],Ul[Il]=null;for(;r===Di;)Di=lr[--sr],lr[sr]=null,Tr=lr[--sr],lr[sr]=null,Ar=lr[--sr],lr[sr]=null}function ev(r,i){lr[sr++]=Ar,lr[sr++]=Tr,lr[sr++]=Di,Ar=i.id,Tr=i.overflow,Di=r}var ln=null,wt=null,Ye=!1,Mi=null,or=!1,Uf=Error(a(519));function Li(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(ar(i,r)),Uf}function tv(r){var i=r.stateNode,s=r.type,c=r.memoizedProps;switch(i[an]=r,i[wn]=c,s){case"dialog":Ve("cancel",i),Ve("close",i);break;case"iframe":case"object":case"embed":Ve("load",i);break;case"video":case"audio":for(s=0;s<Ao.length;s++)Ve(Ao[s],i);break;case"source":Ve("error",i);break;case"img":case"image":case"link":Ve("error",i),Ve("load",i);break;case"details":Ve("toggle",i);break;case"input":Ve("invalid",i),my(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ve("invalid",i);break;case"textarea":Ve("invalid",i),gy(i,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||c.suppressHydrationWarning===!0||vb(i.textContent,s)?(c.popover!=null&&(Ve("beforetoggle",i),Ve("toggle",i)),c.onScroll!=null&&Ve("scroll",i),c.onScrollEnd!=null&&Ve("scrollend",i),c.onClick!=null&&(i.onclick=Gr),i=!0):i=!1,i||Li(r,!0)}function nv(r){for(ln=r.return;ln;)switch(ln.tag){case 5:case 31:case 13:or=!1;return;case 27:case 3:or=!0;return;default:ln=ln.return}}function Bl(r){if(r!==ln)return!1;if(!Ye)return nv(r),Ye=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||tm(r.type,r.memoizedProps)),s=!s),s&&wt&&Li(r),nv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));wt=Nb(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));wt=Nb(r)}else i===27?(i=wt,Yi(r.type)?(r=lm,lm=null,wt=r):wt=i):wt=ln?cr(r.stateNode.nextSibling):null;return!0}function $a(){wt=ln=null,Ye=!1}function If(){var r=Mi;return r!==null&&(Nn===null?Nn=r:Nn.push.apply(Nn,r),Mi=null),r}function so(r){Mi===null?Mi=[r]:Mi.push(r)}var Bf=L(null),Fa=null,Jr=null;function Ui(r,i,s){C(Bf,i._currentValue),i._currentValue=s}function Wr(r){r._currentValue=Bf.current,z(Bf)}function Pf(r,i,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),r===s)break;r=r.return}}function $f(r,i,s,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var w=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var M=0;M<i.length;M++)if(N.context===i[M]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),Pf(v.return,s,r),c||(w=null);break e}v=N.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(a(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),Pf(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Pl(r,i,s,c){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var N=p.type;$n(p.pendingProps.value,w.value)||(r!==null?r.push(N):r=[N])}}else if(p===ge.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Mo):r=[Mo])}p=p.return}r!==null&&$f(i,r,s,c),i.flags|=262144}function Vu(r){for(r=r.firstContext;r!==null;){if(!$n(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function qa(r){Fa=r,Jr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function sn(r){return rv(Fa,r)}function Qu(r,i){return Fa===null&&qa(r),rv(r,i)}function rv(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Jr===null){if(r===null)throw Error(a(308));Jr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Jr=Jr.next=i;return s}var rN=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},iN=e.unstable_scheduleCallback,aN=e.unstable_NormalPriority,Ut={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ff(){return{controller:new rN,data:new Map,refCount:0}}function oo(r){r.refCount--,r.refCount===0&&iN(aN,function(){r.controller.abort()})}var uo=null,qf=0,$l=0,Fl=null;function lN(r,i){if(uo===null){var s=uo=[];qf=0,$l=Vh(),Fl={status:"pending",value:void 0,then:function(c){s.push(c)}}}return qf++,i.then(iv,iv),i}function iv(){if(--qf===0&&uo!==null){Fl!==null&&(Fl.status="fulfilled");var r=uo;uo=null,$l=0,Fl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function sN(r,i){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var av=P.S;P.S=function(r,i){Fx=nn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&lN(r,i),av!==null&&av(r,i)};var Ha=L(null);function Hf(){var r=Ha.current;return r!==null?r:gt.pooledCache}function Gu(r,i){i===null?C(Ha,Ha.current):C(Ha,i.pool)}function lv(){var r=Hf();return r===null?null:{parent:Ut._currentValue,pool:r}}var ql=Error(a(460)),Zf=Error(a(474)),Ku=Error(a(542)),Yu={then:function(){}};function sv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function ov(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(Gr,Gr),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,cv(r),r;default:if(typeof i.status=="string")i.then(Gr,Gr);else{if(r=gt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(c){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=c}},function(c){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,cv(r),r}throw Va=i,ql}}function Za(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Va=s,ql):s}}var Va=null;function uv(){if(Va===null)throw Error(a(459));var r=Va;return Va=null,r}function cv(r){if(r===ql||r===Ku)throw Error(a(483))}var Hl=null,co=0;function Xu(r){var i=co;return co+=1,Hl===null&&(Hl=[]),ov(Hl,r,i)}function fo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Ju(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 dv(r){function i(H,F){if(r){var Q=H.deletions;Q===null?(H.deletions=[F],H.flags|=16):Q.push(F)}}function s(H,F){if(!r)return null;for(;F!==null;)i(H,F),F=F.sibling;return null}function c(H){for(var F=new Map;H!==null;)H.key!==null?F.set(H.key,H):F.set(H.index,H),H=H.sibling;return F}function p(H,F){return H=Yr(H,F),H.index=0,H.sibling=null,H}function v(H,F,Q){return H.index=Q,r?(Q=H.alternate,Q!==null?(Q=Q.index,Q<F?(H.flags|=67108866,F):Q):(H.flags|=67108866,F)):(H.flags|=1048576,F)}function w(H){return r&&H.alternate===null&&(H.flags|=67108866),H}function N(H,F,Q,le){return F===null||F.tag!==6?(F=Of(Q,H.mode,le),F.return=H,F):(F=p(F,Q),F.return=H,F)}function M(H,F,Q,le){var _e=Q.type;return _e===j?te(H,F,Q.props.children,le,Q.key):F!==null&&(F.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===Z&&Za(_e)===F.type)?(F=p(F,Q.props),fo(F,Q),F.return=H,F):(F=Hu(Q.type,Q.key,Q.props,null,H.mode,le),fo(F,Q),F.return=H,F)}function G(H,F,Q,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=Df(Q,H.mode,le),F.return=H,F):(F=p(F,Q.children||[]),F.return=H,F)}function te(H,F,Q,le,_e){return F===null||F.tag!==7?(F=Pa(Q,H.mode,le,_e),F.return=H,F):(F=p(F,Q),F.return=H,F)}function se(H,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Of(""+F,H.mode,Q),F.return=H,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case b:return Q=Hu(F.type,F.key,F.props,null,H.mode,Q),fo(Q,F),Q.return=H,Q;case k:return F=Df(F,H.mode,Q),F.return=H,F;case Z:return F=Za(F),se(H,F,Q)}if(W(F)||re(F))return F=Pa(F,H.mode,Q,null),F.return=H,F;if(typeof F.then=="function")return se(H,Xu(F),Q);if(F.$$typeof===O)return se(H,Qu(H,F),Q);Ju(H,F)}return null}function K(H,F,Q,le){var _e=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return _e!==null?null:N(H,F,""+Q,le);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return Q.key===_e?M(H,F,Q,le):null;case k:return Q.key===_e?G(H,F,Q,le):null;case Z:return Q=Za(Q),K(H,F,Q,le)}if(W(Q)||re(Q))return _e!==null?null:te(H,F,Q,le,null);if(typeof Q.then=="function")return K(H,F,Xu(Q),le);if(Q.$$typeof===O)return K(H,F,Qu(H,Q),le);Ju(H,Q)}return null}function X(H,F,Q,le,_e){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(Q)||null,N(F,H,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return H=H.get(le.key===null?Q:le.key)||null,M(F,H,le,_e);case k:return H=H.get(le.key===null?Q:le.key)||null,G(F,H,le,_e);case Z:return le=Za(le),X(H,F,Q,le,_e)}if(W(le)||re(le))return H=H.get(Q)||null,te(F,H,le,_e,null);if(typeof le.then=="function")return X(H,F,Q,Xu(le),_e);if(le.$$typeof===O)return X(H,F,Q,Qu(F,le),_e);Ju(F,le)}return null}function Se(H,F,Q,le){for(var _e=null,rt=null,je=F,Ie=F=0,Ke=null;je!==null&&Ie<Q.length;Ie++){je.index>Ie?(Ke=je,je=null):Ke=je.sibling;var it=K(H,je,Q[Ie],le);if(it===null){je===null&&(je=Ke);break}r&&je&&it.alternate===null&&i(H,je),F=v(it,F,Ie),rt===null?_e=it:rt.sibling=it,rt=it,je=Ke}if(Ie===Q.length)return s(H,je),Ye&&Xr(H,Ie),_e;if(je===null){for(;Ie<Q.length;Ie++)je=se(H,Q[Ie],le),je!==null&&(F=v(je,F,Ie),rt===null?_e=je:rt.sibling=je,rt=je);return Ye&&Xr(H,Ie),_e}for(je=c(je);Ie<Q.length;Ie++)Ke=X(je,H,Ie,Q[Ie],le),Ke!==null&&(r&&Ke.alternate!==null&&je.delete(Ke.key===null?Ie:Ke.key),F=v(Ke,F,Ie),rt===null?_e=Ke:rt.sibling=Ke,rt=Ke);return r&&je.forEach(function(ta){return i(H,ta)}),Ye&&Xr(H,Ie),_e}function Re(H,F,Q,le){if(Q==null)throw Error(a(151));for(var _e=null,rt=null,je=F,Ie=F=0,Ke=null,it=Q.next();je!==null&&!it.done;Ie++,it=Q.next()){je.index>Ie?(Ke=je,je=null):Ke=je.sibling;var ta=K(H,je,it.value,le);if(ta===null){je===null&&(je=Ke);break}r&&je&&ta.alternate===null&&i(H,je),F=v(ta,F,Ie),rt===null?_e=ta:rt.sibling=ta,rt=ta,je=Ke}if(it.done)return s(H,je),Ye&&Xr(H,Ie),_e;if(je===null){for(;!it.done;Ie++,it=Q.next())it=se(H,it.value,le),it!==null&&(F=v(it,F,Ie),rt===null?_e=it:rt.sibling=it,rt=it);return Ye&&Xr(H,Ie),_e}for(je=c(je);!it.done;Ie++,it=Q.next())it=X(je,H,Ie,it.value,le),it!==null&&(r&&it.alternate!==null&&je.delete(it.key===null?Ie:it.key),F=v(it,F,Ie),rt===null?_e=it:rt.sibling=it,rt=it);return r&&je.forEach(function(v2){return i(H,v2)}),Ye&&Xr(H,Ie),_e}function pt(H,F,Q,le){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:e:{for(var _e=Q.key;F!==null;){if(F.key===_e){if(_e=Q.type,_e===j){if(F.tag===7){s(H,F.sibling),le=p(F,Q.props.children),le.return=H,H=le;break e}}else if(F.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===Z&&Za(_e)===F.type){s(H,F.sibling),le=p(F,Q.props),fo(le,Q),le.return=H,H=le;break e}s(H,F);break}else i(H,F);F=F.sibling}Q.type===j?(le=Pa(Q.props.children,H.mode,le,Q.key),le.return=H,H=le):(le=Hu(Q.type,Q.key,Q.props,null,H.mode,le),fo(le,Q),le.return=H,H=le)}return w(H);case k:e:{for(_e=Q.key;F!==null;){if(F.key===_e)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){s(H,F.sibling),le=p(F,Q.children||[]),le.return=H,H=le;break e}else{s(H,F);break}else i(H,F);F=F.sibling}le=Df(Q,H.mode,le),le.return=H,H=le}return w(H);case Z:return Q=Za(Q),pt(H,F,Q,le)}if(W(Q))return Se(H,F,Q,le);if(re(Q)){if(_e=re(Q),typeof _e!="function")throw Error(a(150));return Q=_e.call(Q),Re(H,F,Q,le)}if(typeof Q.then=="function")return pt(H,F,Xu(Q),le);if(Q.$$typeof===O)return pt(H,F,Qu(H,Q),le);Ju(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,F!==null&&F.tag===6?(s(H,F.sibling),le=p(F,Q),le.return=H,H=le):(s(H,F),le=Of(Q,H.mode,le),le.return=H,H=le),w(H)):s(H,F)}return function(H,F,Q,le){try{co=0;var _e=pt(H,F,Q,le);return Hl=null,_e}catch(je){if(je===ql||je===Ku)throw je;var rt=Fn(29,je,null,H.mode);return rt.lanes=le,rt.return=H,rt}finally{}}}var Qa=dv(!0),fv=dv(!1),Ii=!1;function Vf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qf(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 Bi(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Pi(r,i,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(at&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=qu(r),Ky(r,null,s),i}return Fu(r,c,i,s),qu(r)}function ho(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,oe(r,s)}}function Gf(r,i){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var Kf=!1;function mo(){if(Kf){var r=Fl;if(r!==null)throw r}}function po(r,i,s,c){Kf=!1;var p=r.updateQueue;Ii=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var M=N,G=M.next;M.next=null,w===null?v=G:w.next=G,w=M;var te=r.alternate;te!==null&&(te=te.updateQueue,N=te.lastBaseUpdate,N!==w&&(N===null?te.firstBaseUpdate=G:N.next=G,te.lastBaseUpdate=M))}if(v!==null){var se=p.baseState;w=0,te=G=M=null,N=v;do{var K=N.lane&-536870913,X=K!==N.lane;if(X?(Ge&K)===K:(c&K)===K){K!==0&&K===$l&&(Kf=!0),te!==null&&(te=te.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Se=r,Re=N;K=i;var pt=s;switch(Re.tag){case 1:if(Se=Re.payload,typeof Se=="function"){se=Se.call(pt,se,K);break e}se=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Re.payload,K=typeof Se=="function"?Se.call(pt,se,K):Se,K==null)break e;se=g({},se,K);break e;case 2:Ii=!0}}K=N.callback,K!==null&&(r.flags|=64,X&&(r.flags|=8192),X=p.callbacks,X===null?p.callbacks=[K]:X.push(K))}else X={lane:K,tag:N.tag,payload:N.payload,callback:N.callback,next:null},te===null?(G=te=X,M=se):te=te.next=X,w|=K;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;X=N,N=X.next,X.next=null,p.lastBaseUpdate=X,p.shared.pending=null}}while(!0);te===null&&(M=se),p.baseState=M,p.firstBaseUpdate=G,p.lastBaseUpdate=te,v===null&&(p.shared.lanes=0),Zi|=w,r.lanes=w,r.memoizedState=se}}function hv(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function mv(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)hv(s[r],i)}var Zl=L(null),Wu=L(0);function pv(r,i){r=oi,C(Wu,r),C(Zl,i),oi=r|i.baseLanes}function Yf(){C(Wu,oi),C(Zl,Zl.current)}function Xf(){oi=Wu.current,z(Zl),z(Wu)}var qn=L(null),ur=null;function $i(r){var i=r.alternate;C(Mt,Mt.current&1),C(qn,r),ur===null&&(i===null||Zl.current!==null||i.memoizedState!==null)&&(ur=r)}function Jf(r){C(Mt,Mt.current),C(qn,r),ur===null&&(ur=r)}function gv(r){r.tag===22?(C(Mt,Mt.current),C(qn,r),ur===null&&(ur=r)):Fi()}function Fi(){C(Mt,Mt.current),C(qn,qn.current)}function Hn(r){z(qn),ur===r&&(ur=null),z(Mt)}var Mt=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||im(s)||am(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 ei=0,Ue=null,ht=null,It=null,tc=!1,Vl=!1,Ga=!1,nc=0,go=0,Ql=null,oN=0;function Tt(){throw Error(a(321))}function Wf(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!$n(r[s],i[s]))return!1;return!0}function eh(r,i,s,c,p,v){return ei=v,Ue=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,P.H=r===null||r.memoizedState===null?Wv:ph,Ga=!1,v=s(c,p),Ga=!1,Vl&&(v=vv(i,s,c,p)),yv(r),v}function yv(r){P.H=xo;var i=ht!==null&&ht.next!==null;if(ei=0,It=ht=Ue=null,tc=!1,go=0,Ql=null,i)throw Error(a(300));r===null||Bt||(r=r.dependencies,r!==null&&Vu(r)&&(Bt=!0))}function vv(r,i,s,c){Ue=r;var p=0;do{if(Vl&&(Ql=null),go=0,Vl=!1,25<=p)throw Error(a(301));if(p+=1,It=ht=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}P.H=ex,v=i(s,c)}while(Vl);return v}function uN(){var r=P.H,i=r.useState()[0];return i=typeof i.then=="function"?yo(i):i,r=r.useState()[0],(ht!==null?ht.memoizedState:null)!==r&&(Ue.flags|=1024),i}function th(){var r=nc!==0;return nc=0,r}function nh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function rh(r){if(tc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}tc=!1}ei=0,It=ht=Ue=null,Vl=!1,go=nc=0,Ql=null}function gn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?Ue.memoizedState=It=r:It=It.next=r,It}function Lt(){if(ht===null){var r=Ue.alternate;r=r!==null?r.memoizedState:null}else r=ht.next;var i=It===null?Ue.memoizedState:It.next;if(i!==null)It=i,ht=r;else{if(r===null)throw Ue.alternate===null?Error(a(467)):Error(a(310));ht=r,r={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},It===null?Ue.memoizedState=It=r:It=It.next=r}return It}function rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(r){var i=go;return go+=1,Ql===null&&(Ql=[]),r=ov(Ql,r,i),i=Ue,(It===null?i.memoizedState:It.next)===null&&(i=i.alternate,P.H=i===null||i.memoizedState===null?Wv:ph),r}function ic(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return yo(r);if(r.$$typeof===O)return sn(r)}throw Error(a(438,String(r)))}function ih(r){var i=null,s=Ue.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=Ue.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=rc(),Ue.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),c=0;c<r;c++)s[c]=q;return i.index++,s}function ti(r,i){return typeof i=="function"?i(r):i}function ac(r){var i=Lt();return ah(i,ht,r)}function ah(r,i,s){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var p=r.baseQueue,v=c.pending;if(v!==null){if(p!==null){var w=p.next;p.next=v.next,v.next=w}i.baseQueue=p=v,c.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=w=null,M=null,G=i,te=!1;do{var se=G.lane&-536870913;if(se!==G.lane?(Ge&se)===se:(ei&se)===se){var K=G.revertLane;if(K===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),se===$l&&(te=!0);else if((ei&K)===K){G=G.next,K===$l&&(te=!0);continue}else se={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(N=M=se,w=v):M=M.next=se,Ue.lanes|=K,Zi|=K;se=G.action,Ga&&s(v,se),v=G.hasEagerState?G.eagerState:s(v,se)}else K={lane:se,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(N=M=K,w=v):M=M.next=K,Ue.lanes|=se,Zi|=se;G=G.next}while(G!==null&&G!==i);if(M===null?w=v:M.next=N,!$n(v,r.memoizedState)&&(Bt=!0,te&&(s=Fl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=M,c.lastRenderedState=v}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function lh(r){var i=Lt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var c=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);$n(v,i.memoizedState)||(Bt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,c]}function xv(r,i,s){var c=Ue,p=Lt(),v=Ye;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!$n((ht||p).memoizedState,s);if(w&&(p.memoizedState=s,Bt=!0),p=p.queue,uh(wv.bind(null,c,p,r),[r]),p.getSnapshot!==i||w||It!==null&&It.memoizedState.tag&1){if(c.flags|=2048,Gl(9,{destroy:void 0},Sv.bind(null,c,p,s,i),null),gt===null)throw Error(a(349));v||(ei&127)!==0||bv(c,i,s)}return s}function bv(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Ue.updateQueue,i===null?(i=rc(),Ue.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Sv(r,i,s,c){i.value=s,i.getSnapshot=c,kv(i)&&jv(r)}function wv(r,i,s){return s(function(){kv(i)&&jv(r)})}function kv(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!$n(r,s)}catch{return!0}}function jv(r){var i=Ba(r,2);i!==null&&_n(i,r,2)}function sh(r){var i=gn();if(typeof r=="function"){var s=r;if(r=s(),Ga){dn(!0);try{s()}finally{dn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:r},i}function Ev(r,i,s,c){return r.baseState=s,ah(r,ht,typeof c=="function"?c:ti)}function cN(r,i,s,c,p){if(oc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};P.T!==null?s(!0):v.isTransition=!1,c(v),s=i.pending,s===null?(v.next=i.pending=v,Cv(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Cv(r,i){var s=i.action,c=i.payload,p=r.state;if(i.isTransition){var v=P.T,w={};P.T=w;try{var N=s(p,c),M=P.S;M!==null&&M(w,N),Nv(r,i,N)}catch(G){oh(r,i,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),P.T=v}}else try{v=s(p,c),Nv(r,i,v)}catch(G){oh(r,i,G)}}function Nv(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){_v(r,i,c)},function(c){return oh(r,i,c)}):_v(r,i,s)}function _v(r,i,s){i.status="fulfilled",i.value=s,zv(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Cv(r,s)))}function oh(r,i,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,zv(i),i=i.next;while(i!==c)}r.action=null}function zv(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Av(r,i){return i}function Tv(r,i){if(Ye){var s=gt.formState;if(s!==null){e:{var c=Ue;if(Ye){if(wt){t:{for(var p=wt,v=or;p.nodeType!==8;){if(!v){p=null;break t}if(p=cr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){wt=cr(p.nextSibling),c=p.data==="F!";break e}}Li(c)}c=!1}c&&(i=s[0])}}return s=gn(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Av,lastRenderedState:i},s.queue=c,s=Yv.bind(null,Ue,c),c.dispatch=s,c=sh(!1),v=mh.bind(null,Ue,!1,c.queue),c=gn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,s=cN.bind(null,Ue,p,v,s),p.dispatch=s,c.memoizedState=r,[i,s,!1]}function Rv(r){var i=Lt();return Ov(i,ht,r)}function Ov(r,i,s){if(i=ah(r,i,Av)[0],r=ac(ti)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=yo(i)}catch(w){throw w===ql?Ku:w}else c=i;i=Lt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(Ue.flags|=2048,Gl(9,{destroy:void 0},dN.bind(null,p,s),null)),[c,v,r]}function dN(r,i){r.action=i}function Dv(r){var i=Lt(),s=ht;if(s!==null)return Ov(i,s,r);Lt(),i=i.memoizedState,s=Lt();var c=s.queue.dispatch;return s.memoizedState=r,[i,c,!1]}function Gl(r,i,s,c){return r={tag:r,create:s,deps:c,inst:i,next:null},i=Ue.updateQueue,i===null&&(i=rc(),Ue.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,i.lastEffect=r),r}function Mv(){return Lt().memoizedState}function lc(r,i,s,c){var p=gn();Ue.flags|=r,p.memoizedState=Gl(1|i,{destroy:void 0},s,c===void 0?null:c)}function sc(r,i,s,c){var p=Lt();c=c===void 0?null:c;var v=p.memoizedState.inst;ht!==null&&c!==null&&Wf(c,ht.memoizedState.deps)?p.memoizedState=Gl(i,v,s,c):(Ue.flags|=r,p.memoizedState=Gl(1|i,v,s,c))}function Lv(r,i){lc(8390656,8,r,i)}function uh(r,i){sc(2048,8,r,i)}function fN(r){Ue.flags|=4;var i=Ue.updateQueue;if(i===null)i=rc(),Ue.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Uv(r){var i=Lt().memoizedState;return fN({ref:i,nextImpl:r}),function(){if((at&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Iv(r,i){return sc(4,2,r,i)}function Bv(r,i){return sc(4,4,r,i)}function Pv(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 $v(r,i,s){s=s!=null?s.concat([r]):null,sc(4,4,Pv.bind(null,i,r),s)}function ch(){}function Fv(r,i){var s=Lt();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&Wf(i,c[1])?c[0]:(s.memoizedState=[r,i],r)}function qv(r,i){var s=Lt();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&Wf(i,c[1]))return c[0];if(c=r(),Ga){dn(!0);try{r()}finally{dn(!1)}}return s.memoizedState=[c,i],c}function dh(r,i,s){return s===void 0||(ei&1073741824)!==0&&(Ge&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Hx(),Ue.lanes|=r,Zi|=r,s)}function Hv(r,i,s,c){return $n(s,i)?s:Zl.current!==null?(r=dh(r,s,c),$n(r,i)||(Bt=!0),r):(ei&42)===0||(ei&1073741824)!==0&&(Ge&261930)===0?(Bt=!0,r.memoizedState=s):(r=Hx(),Ue.lanes|=r,Zi|=r,i)}function Zv(r,i,s,c,p){var v=V.p;V.p=v!==0&&8>v?v:8;var w=P.T,N={};P.T=N,mh(r,!1,i,s);try{var M=p(),G=P.S;if(G!==null&&G(N,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var te=sN(M,c);vo(r,i,te,Qn(r))}else vo(r,i,c,Qn(r))}catch(se){vo(r,i,{then:function(){},status:"rejected",reason:se},Qn())}finally{V.p=v,w!==null&&N.types!==null&&(w.types=N.types),P.T=w}}function hN(){}function fh(r,i,s,c){if(r.tag!==5)throw Error(a(476));var p=Vv(r).queue;Zv(r,p,i,ce,s===null?hN:function(){return Qv(r),s(c)})}function Vv(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:ce},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Qv(r){var i=Vv(r);i.next===null&&(i=r.alternate.memoizedState),vo(r,i.next.queue,{},Qn())}function hh(){return sn(Mo)}function Gv(){return Lt().memoizedState}function Kv(){return Lt().memoizedState}function mN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=Qn();r=Bi(s);var c=Pi(i,r,s);c!==null&&(_n(c,i,s),ho(c,i,s)),i={cache:Ff()},r.payload=i;return}i=i.return}}function pN(r,i,s){var c=Qn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},oc(r)?Xv(i,s):(s=Tf(r,i,s,c),s!==null&&(_n(s,r,c),Jv(s,i,c)))}function Yv(r,i,s){var c=Qn();vo(r,i,s,c)}function vo(r,i,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(oc(r))Xv(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,N=v(w,s);if(p.hasEagerState=!0,p.eagerState=N,$n(N,w))return Fu(r,i,p,0),gt===null&&$u(),!1}catch{}finally{}if(s=Tf(r,i,p,c),s!==null)return _n(s,r,c),Jv(s,i,c),!0}return!1}function mh(r,i,s,c){if(c={lane:2,revertLane:Vh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},oc(r)){if(i)throw Error(a(479))}else i=Tf(r,s,c,2),i!==null&&_n(i,r,2)}function oc(r){var i=r.alternate;return r===Ue||i!==null&&i===Ue}function Xv(r,i){Vl=tc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Jv(r,i,s){if((s&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,oe(r,s)}}var xo={readContext:sn,use:ic,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};xo.useEffectEvent=Tt;var Wv={readContext:sn,use:ic,useCallback:function(r,i){return gn().memoizedState=[r,i===void 0?null:i],r},useContext:sn,useEffect:Lv,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,lc(4194308,4,Pv.bind(null,i,r),s)},useLayoutEffect:function(r,i){return lc(4194308,4,r,i)},useInsertionEffect:function(r,i){lc(4,2,r,i)},useMemo:function(r,i){var s=gn();i=i===void 0?null:i;var c=r();if(Ga){dn(!0);try{r()}finally{dn(!1)}}return s.memoizedState=[c,i],c},useReducer:function(r,i,s){var c=gn();if(s!==void 0){var p=s(i);if(Ga){dn(!0);try{s(i)}finally{dn(!1)}}}else p=i;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=pN.bind(null,Ue,r),[c.memoizedState,r]},useRef:function(r){var i=gn();return r={current:r},i.memoizedState=r},useState:function(r){r=sh(r);var i=r.queue,s=Yv.bind(null,Ue,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:ch,useDeferredValue:function(r,i){var s=gn();return dh(s,r,i)},useTransition:function(){var r=sh(!1);return r=Zv.bind(null,Ue,r.queue,!0,!1),gn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var c=Ue,p=gn();if(Ye){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),gt===null)throw Error(a(349));(Ge&127)!==0||bv(c,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Lv(wv.bind(null,c,v,r),[r]),c.flags|=2048,Gl(9,{destroy:void 0},Sv.bind(null,c,v,s,i),null),s},useId:function(){var r=gn(),i=gt.identifierPrefix;if(Ye){var s=Tr,c=Ar;s=(c&~(1<<32-ut(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=nc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=oN++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:hh,useFormState:Tv,useActionState:Tv,useOptimistic:function(r){var i=gn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=mh.bind(null,Ue,!0,s),s.dispatch=i,[r,i]},useMemoCache:ih,useCacheRefresh:function(){return gn().memoizedState=mN.bind(null,Ue)},useEffectEvent:function(r){var i=gn(),s={impl:r};return i.memoizedState=s,function(){if((at&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},ph={readContext:sn,use:ic,useCallback:Fv,useContext:sn,useEffect:uh,useImperativeHandle:$v,useInsertionEffect:Iv,useLayoutEffect:Bv,useMemo:qv,useReducer:ac,useRef:Mv,useState:function(){return ac(ti)},useDebugValue:ch,useDeferredValue:function(r,i){var s=Lt();return Hv(s,ht.memoizedState,r,i)},useTransition:function(){var r=ac(ti)[0],i=Lt().memoizedState;return[typeof r=="boolean"?r:yo(r),i]},useSyncExternalStore:xv,useId:Gv,useHostTransitionStatus:hh,useFormState:Rv,useActionState:Rv,useOptimistic:function(r,i){var s=Lt();return Ev(s,ht,r,i)},useMemoCache:ih,useCacheRefresh:Kv};ph.useEffectEvent=Uv;var ex={readContext:sn,use:ic,useCallback:Fv,useContext:sn,useEffect:uh,useImperativeHandle:$v,useInsertionEffect:Iv,useLayoutEffect:Bv,useMemo:qv,useReducer:lh,useRef:Mv,useState:function(){return lh(ti)},useDebugValue:ch,useDeferredValue:function(r,i){var s=Lt();return ht===null?dh(s,r,i):Hv(s,ht.memoizedState,r,i)},useTransition:function(){var r=lh(ti)[0],i=Lt().memoizedState;return[typeof r=="boolean"?r:yo(r),i]},useSyncExternalStore:xv,useId:Gv,useHostTransitionStatus:hh,useFormState:Dv,useActionState:Dv,useOptimistic:function(r,i){var s=Lt();return ht!==null?Ev(s,ht,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:ih,useCacheRefresh:Kv};ex.useEffectEvent=Uv;function gh(r,i,s,c){i=r.memoizedState,s=s(c,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var yh={enqueueSetState:function(r,i,s){r=r._reactInternals;var c=Qn(),p=Bi(c);p.payload=i,s!=null&&(p.callback=s),i=Pi(r,p,c),i!==null&&(_n(i,r,c),ho(i,r,c))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var c=Qn(),p=Bi(c);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Pi(r,p,c),i!==null&&(_n(i,r,c),ho(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=Qn(),c=Bi(s);c.tag=2,i!=null&&(c.callback=i),i=Pi(r,c,s),i!==null&&(_n(i,r,s),ho(i,r,s))}};function tx(r,i,s,c,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,v,w):i.prototype&&i.prototype.isPureReactComponent?!io(s,c)||!io(p,v):!0}function nx(r,i,s,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==r&&yh.enqueueReplaceState(i,i.state,null)}function Ka(r,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}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 rx(r){Pu(r)}function ix(r){console.error(r)}function ax(r){Pu(r)}function uc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function lx(r,i,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function vh(r,i,s){return s=Bi(s),s.tag=3,s.payload={element:null},s.callback=function(){uc(r,i)},s}function sx(r){return r=Bi(r),r.tag=3,r}function ox(r,i,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=c.value;r.payload=function(){return p(v)},r.callback=function(){lx(i,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){lx(i,s,c),typeof p!="function"&&(Vi===null?Vi=new Set([this]):Vi.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})})}function gN(r,i,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Pl(i,s,p,!0),s=qn.current,s!==null){switch(s.tag){case 31:case 13:return ur===null?Sc():s.alternate===null&&Rt===0&&(Rt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===Yu?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),qh(r,c,p)),!1;case 22:return s.flags|=65536,c===Yu?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([c]):s.add(c)),qh(r,c,p)),!1}throw Error(a(435,s.tag))}return qh(r,c,p),Sc(),!1}if(Ye)return i=qn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==Uf&&(r=Error(a(422),{cause:c}),so(ar(r,s)))):(c!==Uf&&(i=Error(a(423),{cause:c}),so(ar(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=ar(c,s),p=vh(r.stateNode,c,p),Gf(r,p),Rt!==4&&(Rt=2)),!1;var v=Error(a(520),{cause:c});if(v=ar(v,s),No===null?No=[v]:No.push(v),Rt!==4&&(Rt=2),i===null)return!0;c=ar(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=vh(s.stateNode,c,r),Gf(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"&&(Vi===null||!Vi.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=sx(p),ox(p,r,s,c),Gf(s,p),!1}s=s.return}while(s!==null);return!1}var xh=Error(a(461)),Bt=!1;function on(r,i,s,c){i.child=r===null?fv(i,null,s,c):Qa(i,r.child,s,c)}function ux(r,i,s,c,p){s=s.render;var v=i.ref;if("ref"in c){var w={};for(var N in c)N!=="ref"&&(w[N]=c[N])}else w=c;return qa(i),c=eh(r,i,s,w,v,p),N=th(),r!==null&&!Bt?(nh(r,i,p),ni(r,i,p)):(Ye&&N&&Mf(i),i.flags|=1,on(r,i,c,p),i.child)}function cx(r,i,s,c,p){if(r===null){var v=s.type;return typeof v=="function"&&!Rf(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,dx(r,i,v,c,p)):(r=Hu(s.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Nh(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:io,s(w,c)&&r.ref===i.ref)return ni(r,i,p)}return i.flags|=1,r=Yr(v,c),r.ref=i.ref,r.return=i,i.child=r}function dx(r,i,s,c,p){if(r!==null){var v=r.memoizedProps;if(io(v,c)&&r.ref===i.ref)if(Bt=!1,i.pendingProps=c=v,Nh(r,p))(r.flags&131072)!==0&&(Bt=!0);else return i.lanes=r.lanes,ni(r,i,p)}return bh(r,i,s,c,p)}function fx(r,i,s,c){var p=c.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~v}else c=0,i.child=null;return hx(r,i,v,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Gu(i,v!==null?v.cachePool:null),v!==null?pv(i,v):Yf(),gv(i);else return c=i.lanes=536870912,hx(r,i,v!==null?v.baseLanes|s:s,s,c)}else v!==null?(Gu(i,v.cachePool),pv(i,v),Fi(),i.memoizedState=null):(r!==null&&Gu(i,null),Yf(),Fi());return on(r,i,p,s),i.child}function bo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function hx(r,i,s,c,p){var v=Hf();return v=v===null?null:{parent:Ut._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&Gu(i,null),Yf(),gv(i),r!==null&&Pl(r,i,c,!0),i.childLanes=p,null}function cc(r,i){return i=fc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function mx(r,i,s){return Qa(i,r.child,null,s),r=cc(i,i.pendingProps),r.flags|=2,Hn(i),i.memoizedState=null,r}function yN(r,i,s){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ye){if(c.mode==="hidden")return r=cc(i,c),i.lanes=536870912,bo(null,r);if(Jf(i),(r=wt)?(r=Cb(r,or),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Di!==null?{id:Ar,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},s=Xy(r),s.return=i,i.child=s,ln=i,wt=null)):r=null,r===null)throw Li(i);return i.lanes=536870912,null}return cc(i,c)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(Jf(i),p)if(i.flags&256)i.flags&=-257,i=mx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Bt||Pl(r,i,s,!1),p=(s&r.childLanes)!==0,Bt||p){if(c=gt,c!==null&&(w=He(c,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,Ba(r,w),_n(c,r,w),xh;Sc(),i=mx(r,i,s)}else r=v.treeContext,wt=cr(w.nextSibling),ln=i,Ye=!0,Mi=null,or=!1,r!==null&&ev(i,r),i=cc(i,c),i.flags|=4096;return i}return r=Yr(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function dc(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 bh(r,i,s,c,p){return qa(i),s=eh(r,i,s,c,void 0,p),c=th(),r!==null&&!Bt?(nh(r,i,p),ni(r,i,p)):(Ye&&c&&Mf(i),i.flags|=1,on(r,i,s,p),i.child)}function px(r,i,s,c,p,v){return qa(i),i.updateQueue=null,s=vv(i,c,s,p),yv(r),c=th(),r!==null&&!Bt?(nh(r,i,v),ni(r,i,v)):(Ye&&c&&Mf(i),i.flags|=1,on(r,i,s,v),i.child)}function gx(r,i,s,c,p){if(qa(i),i.stateNode===null){var v=Ll,w=s.contextType;typeof w=="object"&&w!==null&&(v=sn(w)),v=new s(c,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=yh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=c,v.state=i.memoizedState,v.refs={},Vf(i),w=s.contextType,v.context=typeof w=="object"&&w!==null?sn(w):Ll,v.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(gh(i,s,w,c),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&yh.enqueueReplaceState(v,v.state,null),po(i,c,v,p),mo(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,M=Ka(s,N);v.props=M;var G=v.context,te=s.contextType;w=Ll,typeof te=="object"&&te!==null&&(w=sn(te));var se=s.getDerivedStateFromProps;te=typeof se=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,te||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==w)&&nx(i,v,c,w),Ii=!1;var K=i.memoizedState;v.state=K,po(i,c,v,p),mo(),G=i.memoizedState,N||K!==G||Ii?(typeof se=="function"&&(gh(i,s,se,c),G=i.memoizedState),(M=Ii||tx(i,s,M,c,K,G,w))?(te||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=G),v.props=c,v.state=G,v.context=w,c=M):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{v=i.stateNode,Qf(r,i),w=i.memoizedProps,te=Ka(s,w),v.props=te,se=i.pendingProps,K=v.context,G=s.contextType,M=Ll,typeof G=="object"&&G!==null&&(M=sn(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==se||K!==M)&&nx(i,v,c,M),Ii=!1,K=i.memoizedState,v.state=K,po(i,c,v,p),mo();var X=i.memoizedState;w!==se||K!==X||Ii||r!==null&&r.dependencies!==null&&Vu(r.dependencies)?(typeof N=="function"&&(gh(i,s,N,c),X=i.memoizedState),(te=Ii||tx(i,s,te,c,K,X,M)||r!==null&&r.dependencies!==null&&Vu(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,X,M),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,X,M)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=X),v.props=c,v.state=X,v.context=M,c=te):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(i.flags|=1024),c=!1)}return v=c,dc(r,i),c=(i.flags&128)!==0,v||c?(v=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&c?(i.child=Qa(i,r.child,null,p),i.child=Qa(i,null,s,p)):on(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ni(r,i,p),r}function yx(r,i,s,c){return $a(),i.flags|=256,on(r,i,s,c),i.child}var Sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wh(r){return{baseLanes:r,cachePool:lv()}}function kh(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Vn),r}function vx(r,i,s){var c=i.pendingProps,p=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Mt.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ye){if(p?$i(i):Fi(),(r=wt)?(r=Cb(r,or),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Di!==null?{id:Ar,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},s=Xy(r),s.return=i,i.child=s,ln=i,wt=null)):r=null,r===null)throw Li(i);return am(r)?i.lanes=32:i.lanes=536870912,null}var N=c.children;return c=c.fallback,p?(Fi(),p=i.mode,N=fc({mode:"hidden",children:N},p),c=Pa(c,p,s,null),N.return=i,c.return=i,N.sibling=c,i.child=N,c=i.child,c.memoizedState=wh(s),c.childLanes=kh(r,w,s),i.memoizedState=Sh,bo(null,c)):($i(i),jh(i,N))}var M=r.memoizedState;if(M!==null&&(N=M.dehydrated,N!==null)){if(v)i.flags&256?($i(i),i.flags&=-257,i=Eh(r,i,s)):i.memoizedState!==null?(Fi(),i.child=r.child,i.flags|=128,i=null):(Fi(),N=c.fallback,p=i.mode,c=fc({mode:"visible",children:c.children},p),N=Pa(N,p,s,null),N.flags|=2,c.return=i,N.return=i,c.sibling=N,i.child=c,Qa(i,r.child,null,s),c=i.child,c.memoizedState=wh(s),c.childLanes=kh(r,w,s),i.memoizedState=Sh,i=bo(null,c));else if($i(i),am(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var G=w.dgst;w=G,c=Error(a(419)),c.stack="",c.digest=w,so({value:c,source:null,stack:null}),i=Eh(r,i,s)}else if(Bt||Pl(r,i,s,!1),w=(s&r.childLanes)!==0,Bt||w){if(w=gt,w!==null&&(c=He(w,s),c!==0&&c!==M.retryLane))throw M.retryLane=c,Ba(r,c),_n(w,r,c),xh;im(N)||Sc(),i=Eh(r,i,s)}else im(N)?(i.flags|=192,i.child=r.child,i=null):(r=M.treeContext,wt=cr(N.nextSibling),ln=i,Ye=!0,Mi=null,or=!1,r!==null&&ev(i,r),i=jh(i,c.children),i.flags|=4096);return i}return p?(Fi(),N=c.fallback,p=i.mode,M=r.child,G=M.sibling,c=Yr(M,{mode:"hidden",children:c.children}),c.subtreeFlags=M.subtreeFlags&65011712,G!==null?N=Yr(G,N):(N=Pa(N,p,s,null),N.flags|=2),N.return=i,c.return=i,c.sibling=N,i.child=c,bo(null,c),c=i.child,N=r.child.memoizedState,N===null?N=wh(s):(p=N.cachePool,p!==null?(M=Ut._currentValue,p=p.parent!==M?{parent:M,pool:M}:p):p=lv(),N={baseLanes:N.baseLanes|s,cachePool:p}),c.memoizedState=N,c.childLanes=kh(r,w,s),i.memoizedState=Sh,bo(r.child,c)):($i(i),s=r.child,r=s.sibling,s=Yr(s,{mode:"visible",children:c.children}),s.return=i,s.sibling=null,r!==null&&(w=i.deletions,w===null?(i.deletions=[r],i.flags|=16):w.push(r)),i.child=s,i.memoizedState=null,s)}function jh(r,i){return i=fc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function fc(r,i){return r=Fn(22,r,null,i),r.lanes=0,r}function Eh(r,i,s){return Qa(i,r.child,null,s),r=jh(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function xx(r,i,s){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),Pf(r.return,i,s)}function Ch(r,i,s,c,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function bx(r,i,s){var c=i.pendingProps,p=c.revealOrder,v=c.tail;c=c.children;var w=Mt.current,N=(w&2)!==0;if(N?(w=w&1|2,i.flags|=128):w&=1,C(Mt,w),on(r,i,c,s),c=Ye?lo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&xx(r,s,i);else if(r.tag===19)xx(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),Ch(i,!1,p,s,v,c);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}Ch(i,!0,s,null,v,c);break;case"together":Ch(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function ni(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Zi|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Pl(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=Yr(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=Yr(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Nh(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Vu(r)))}function vN(r,i,s){switch(i.tag){case 3:Me(i,i.stateNode.containerInfo),Ui(i,Ut,r.memoizedState.cache),$a();break;case 27:case 5:Nt(i);break;case 4:Me(i,i.stateNode.containerInfo);break;case 10:Ui(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Jf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?($i(i),i.flags|=128,null):(s&i.child.childLanes)!==0?vx(r,i,s):($i(i),r=ni(r,i,s),r!==null?r.sibling:null);$i(i);break;case 19:var p=(r.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Pl(r,i,s,!1),c=(s&i.childLanes)!==0),p){if(c)return bx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),C(Mt,Mt.current),c)break;return null;case 22:return i.lanes=0,fx(r,i,s,i.pendingProps);case 24:Ui(i,Ut,r.memoizedState.cache)}return ni(r,i,s)}function Sx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Bt=!0;else{if(!Nh(r,s)&&(i.flags&128)===0)return Bt=!1,vN(r,i,s);Bt=(r.flags&131072)!==0}else Bt=!1,Ye&&(i.flags&1048576)!==0&&Wy(i,lo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=Za(i.elementType),i.type=r,typeof r=="function")Rf(r)?(c=Ka(r,c),i.tag=1,i=gx(null,i,r,c,s)):(i.tag=0,i=bh(null,i,r,c,s));else{if(r!=null){var p=r.$$typeof;if(p===I){i.tag=11,i=ux(null,i,r,c,s);break e}else if(p===$){i.tag=14,i=cx(null,i,r,c,s);break e}}throw i=de(r)||r,Error(a(306,i,""))}}return i;case 0:return bh(r,i,i.type,i.pendingProps,s);case 1:return c=i.type,p=Ka(c,i.pendingProps),gx(r,i,c,p,s);case 3:e:{if(Me(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var v=i.memoizedState;p=v.element,Qf(r,i),po(i,c,null,s);var w=i.memoizedState;if(c=w.cache,Ui(i,Ut,c),c!==v.cache&&$f(i,[Ut],s,!0),mo(),c=w.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=yx(r,i,c,s);break e}else if(c!==p){p=ar(Error(a(424)),i),so(p),i=yx(r,i,c,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(wt=cr(r.firstChild),ln=i,Ye=!0,Mi=null,or=!0,s=fv(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if($a(),c===p){i=ni(r,i,s);break e}on(r,i,c,s)}i=i.child}return i;case 26:return dc(r,i),r===null?(s=Rb(i.type,null,i.pendingProps,null))?i.memoizedState=s:Ye||(s=i.type,r=i.pendingProps,c=_c(ue.current).createElement(s),c[an]=i,c[wn]=r,un(c,s,r),Yt(c),i.stateNode=c):i.memoizedState=Rb(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Nt(i),r===null&&Ye&&(c=i.stateNode=zb(i.type,i.pendingProps,ue.current),ln=i,or=!0,p=wt,Yi(i.type)?(lm=p,wt=cr(c.firstChild)):wt=p),on(r,i,i.pendingProps.children,s),dc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ye&&((p=c=wt)&&(c=GN(c,i.type,i.pendingProps,or),c!==null?(i.stateNode=c,ln=i,wt=cr(c.firstChild),or=!1,p=!0):p=!1),p||Li(i)),Nt(i),p=i.type,v=i.pendingProps,w=r!==null?r.memoizedProps:null,c=v.children,tm(p,v)?c=null:w!==null&&tm(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=eh(r,i,uN,null,null,s),Mo._currentValue=p),dc(r,i),on(r,i,c,s),i.child;case 6:return r===null&&Ye&&((r=s=wt)&&(s=KN(s,i.pendingProps,or),s!==null?(i.stateNode=s,ln=i,wt=null,r=!0):r=!1),r||Li(i)),null;case 13:return vx(r,i,s);case 4:return Me(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=Qa(i,null,c,s):on(r,i,c,s),i.child;case 11:return ux(r,i,i.type,i.pendingProps,s);case 7:return on(r,i,i.pendingProps,s),i.child;case 8:return on(r,i,i.pendingProps.children,s),i.child;case 12:return on(r,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,Ui(i,i.type,c.value),on(r,i,c.children,s),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,qa(i),p=sn(p),c=c(p),i.flags|=1,on(r,i,c,s),i.child;case 14:return cx(r,i,i.type,i.pendingProps,s);case 15:return dx(r,i,i.type,i.pendingProps,s);case 19:return bx(r,i,s);case 31:return yN(r,i,s);case 22:return fx(r,i,s,i.pendingProps);case 24:return qa(i),c=sn(Ut),r===null?(p=Hf(),p===null&&(p=gt,v=Ff(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:c,cache:p},Vf(i),Ui(i,Ut,p)):((r.lanes&s)!==0&&(Qf(r,i),po(i,null,null,s),mo()),p=r.memoizedState,v=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Ui(i,Ut,c)):(c=v.cache,Ui(i,Ut,c),c!==p.cache&&$f(i,[Ut],s,!0))),on(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ri(r){r.flags|=4}function _h(r,i,s,c,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(Gx())r.flags|=8192;else throw Va=Yu,Zf}else r.flags&=-16777217}function wx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Ub(i))if(Gx())r.flags|=8192;else throw Va=Yu,Zf}function hc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Qs():536870912,r.lanes|=i,Jl|=i)}function So(r,i){if(!Ye)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 c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function kt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=s,i}function xN(r,i,s){var c=i.pendingProps;switch(Lf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(i),null;case 1:return kt(i),null;case 3:return s=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Wr(Ut),be(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Bl(i)?ri(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,If())),kt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ri(i),v!==null?(kt(i),wx(i,v)):(kt(i),_h(i,p,null,c,s))):v?v!==r.memoizedState?(ri(i),kt(i),wx(i,v)):(kt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&ri(i),kt(i),_h(i,p,r,c,s)),null;case 27:if(en(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&ri(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return kt(i),null}r=J.current,Bl(i)?tv(i):(r=zb(p,c,s),i.stateNode=r,ri(i))}return kt(i),null;case 5:if(en(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&ri(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return kt(i),null}if(v=J.current,Bl(i))tv(i);else{var w=_c(ue.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?w.createElement(p,{is:c.is}):w.createElement(p)}}v[an]=i,v[wn]=c;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(un(v,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ri(i)}}return kt(i),_h(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&ri(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,Bl(i)){if(r=i.stateNode,s=i.memoizedProps,c=null,p=ln,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[an]=i,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||vb(r.nodeValue,s)),r||Li(i,!0)}else r=_c(r).createTextNode(c),r[an]=i,i.stateNode=r}return kt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(c=Bl(i),s!==null){if(r===null){if(!c)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[an]=i}else $a(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),r=!1}else s=If(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Hn(i),i):(Hn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return kt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Bl(i),c!==null&&c.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[an]=i}else $a(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),p=!1}else p=If(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Hn(i),i):(Hn(i),null)}return Hn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,r=r!==null&&r.memoizedState!==null,s&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),hc(i,i.updateQueue),kt(i),null);case 4:return be(),r===null&&Yh(i.stateNode.containerInfo),kt(i),null;case 10:return Wr(i.type),kt(i),null;case 19:if(z(Mt),c=i.memoizedState,c===null)return kt(i),null;if(p=(i.flags&128)!==0,v=c.rendering,v===null)if(p)So(c,!1);else{if(Rt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=ec(r),v!==null){for(i.flags|=128,So(c,!1),r=v.updateQueue,i.updateQueue=r,hc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Yy(s,r),s=s.sibling;return C(Mt,Mt.current&1|2),Ye&&Xr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&nn()>vc&&(i.flags|=128,p=!0,So(c,!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,hc(i,r),So(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!Ye)return kt(i),null}else 2*nn()-c.renderingStartTime>vc&&s!==536870912&&(i.flags|=128,p=!0,So(c,!1),i.lanes=4194304);c.isBackwards?(v.sibling=i.child,i.child=v):(r=c.last,r!==null?r.sibling=v:i.child=v,c.last=v)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=nn(),r.sibling=null,s=Mt.current,C(Mt,p?s&1|2:s&1),Ye&&Xr(i,c.treeForkCount),r):(kt(i),null);case 22:case 23:return Hn(i),Xf(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(kt(i),i.subtreeFlags&6&&(i.flags|=8192)):kt(i),s=i.updateQueue,s!==null&&hc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),r!==null&&z(Ha),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Wr(Ut),kt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function bN(r,i){switch(Lf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Wr(Ut),be(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return en(i),null;case 31:if(i.memoizedState!==null){if(Hn(i),i.alternate===null)throw Error(a(340));$a()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Hn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));$a()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return z(Mt),null;case 4:return be(),null;case 10:return Wr(i.type),null;case 22:case 23:return Hn(i),Xf(),r!==null&&z(Ha),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Wr(Ut),null;case 25:return null;default:return null}}function kx(r,i){switch(Lf(i),i.tag){case 3:Wr(Ut),be();break;case 26:case 27:case 5:en(i);break;case 4:be();break;case 31:i.memoizedState!==null&&Hn(i);break;case 13:Hn(i);break;case 19:z(Mt);break;case 10:Wr(i.type);break;case 22:case 23:Hn(i),Xf(),r!==null&&z(Ha);break;case 24:Wr(Ut)}}function wo(r,i){try{var s=i.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&r)===r){c=void 0;var v=s.create,w=s.inst;c=v(),w.destroy=c}s=s.next}while(s!==p)}}catch(N){dt(i,i.return,N)}}function qi(r,i,s){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&r)===r){var w=c.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=i;var M=s,G=N;try{G()}catch(te){dt(p,M,te)}}}c=c.next}while(c!==v)}}catch(te){dt(i,i.return,te)}}function jx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{mv(i,s)}catch(c){dt(r,r.return,c)}}}function Ex(r,i,s){s.props=Ka(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){dt(r,i,c)}}function ko(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(p){dt(r,i,p)}}function Rr(r,i){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){dt(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){dt(r,i,p)}else s.current=null}function Cx(r){var i=r.type,s=r.memoizedProps,c=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){dt(r,r.return,p)}}function zh(r,i,s){try{var c=r.stateNode;FN(c,r.type,s,i),c[wn]=i}catch(p){dt(r,r.return,p)}}function Nx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Yi(r.type)||r.tag===4}function Ah(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Nx(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&&Yi(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 Th(r,i,s){var c=r.tag;if(c===5||c===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=Gr));else if(c!==4&&(c===27&&Yi(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Th(r,i,s),r=r.sibling;r!==null;)Th(r,i,s),r=r.sibling}function mc(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(c!==4&&(c===27&&Yi(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(mc(r,i,s),r=r.sibling;r!==null;)mc(r,i,s),r=r.sibling}function _x(r){var i=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);un(i,c,s),i[an]=r,i[wn]=s}catch(v){dt(r,r.return,v)}}var ii=!1,Pt=!1,Rh=!1,zx=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function SN(r,i){if(r=r.containerInfo,Wh=Mc,r=$y(r),Ef(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,N=-1,M=-1,G=0,te=0,se=r,K=null;t:for(;;){for(var X;se!==s||p!==0&&se.nodeType!==3||(N=w+p),se!==v||c!==0&&se.nodeType!==3||(M=w+c),se.nodeType===3&&(w+=se.nodeValue.length),(X=se.firstChild)!==null;)K=se,se=X;for(;;){if(se===r)break t;if(K===s&&++G===p&&(N=w),K===v&&++te===c&&(M=w),(X=se.nextSibling)!==null)break;se=K,K=se.parentNode}se=X}s=N===-1||M===-1?null:{start:N,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(em={focusedElem:r,selectionRange:s},Mc=!1,Xt=i;Xt!==null;)if(i=Xt,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Xt=r;else for(;Xt!==null;){switch(i=Xt,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,c=s.stateNode;try{var Se=Ka(s.type,p);r=c.getSnapshotBeforeUpdate(Se,v),c.__reactInternalSnapshotBeforeUpdate=r}catch(Re){dt(s,s.return,Re)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)rm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":rm(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,Xt=r;break}Xt=i.return}}function Ax(r,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:li(r,s),c&4&&wo(5,s);break;case 1:if(li(r,s),c&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(w){dt(s,s.return,w)}else{var p=Ka(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(w){dt(s,s.return,w)}}c&64&&jx(s),c&512&&ko(s,s.return);break;case 3:if(li(r,s),c&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{mv(r,i)}catch(w){dt(s,s.return,w)}}break;case 27:i===null&&c&4&&_x(s);case 26:case 5:li(r,s),i===null&&c&4&&Cx(s),c&512&&ko(s,s.return);break;case 12:li(r,s);break;case 31:li(r,s),c&4&&Ox(r,s);break;case 13:li(r,s),c&4&&Dx(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=AN.bind(null,s),YN(r,s))));break;case 22:if(c=s.memoizedState!==null||ii,!c){i=i!==null&&i.memoizedState!==null||Pt,p=ii;var v=Pt;ii=c,(Pt=i)&&!v?si(r,s,(s.subtreeFlags&8772)!==0):li(r,s),ii=p,Pt=v}break;case 30:break;default:li(r,s)}}function Tx(r){var i=r.alternate;i!==null&&(r.alternate=null,Tx(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&of(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 jt=null,jn=!1;function ai(r,i,s){for(s=s.child;s!==null;)Rx(r,i,s),s=s.sibling}function Rx(r,i,s){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(rn,s)}catch{}switch(s.tag){case 26:Pt||Rr(s,i),ai(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Pt||Rr(s,i);var c=jt,p=jn;Yi(s.type)&&(jt=s.stateNode,jn=!1),ai(r,i,s),Ro(s.stateNode),jt=c,jn=p;break;case 5:Pt||Rr(s,i);case 6:if(c=jt,p=jn,jt=null,ai(r,i,s),jt=c,jn=p,jt!==null)if(jn)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(s.stateNode)}catch(v){dt(s,i,v)}else try{jt.removeChild(s.stateNode)}catch(v){dt(s,i,v)}break;case 18:jt!==null&&(jn?(r=jt,jb(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),ls(r)):jb(jt,s.stateNode));break;case 4:c=jt,p=jn,jt=s.stateNode.containerInfo,jn=!0,ai(r,i,s),jt=c,jn=p;break;case 0:case 11:case 14:case 15:qi(2,s,i),Pt||qi(4,s,i),ai(r,i,s);break;case 1:Pt||(Rr(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Ex(s,i,c)),ai(r,i,s);break;case 21:ai(r,i,s);break;case 22:Pt=(c=Pt)||s.memoizedState!==null,ai(r,i,s),Pt=c;break;default:ai(r,i,s)}}function Ox(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ls(r)}catch(s){dt(i,i.return,s)}}}function Dx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ls(r)}catch(s){dt(i,i.return,s)}}function wN(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new zx),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new zx),i;default:throw Error(a(435,r.tag))}}function pc(r,i){var s=wN(r);i.forEach(function(c){if(!s.has(c)){s.add(c);var p=TN.bind(null,r,c);c.then(p,p)}})}function En(r,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],v=r,w=i,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(Yi(N.type)){jt=N.stateNode,jn=!1;break e}break;case 5:jt=N.stateNode,jn=!1;break e;case 3:case 4:jt=N.stateNode.containerInfo,jn=!0;break e}N=N.return}if(jt===null)throw Error(a(160));Rx(v,w,p),jt=null,jn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Mx(i,r),i=i.sibling}var wr=null;function Mx(r,i){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:En(i,r),Cn(r),c&4&&(qi(3,r,r.return),wo(3,r),qi(5,r,r.return));break;case 1:En(i,r),Cn(r),c&512&&(Pt||s===null||Rr(s,s.return)),c&64&&ii&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=wr;if(En(i,r),Cn(r),c&512&&(Pt||s===null||Rr(s,s.return)),c&4){var v=s!==null?s.memoizedState:null;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Ks]||v[an]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(c),p.head.insertBefore(v,p.querySelector("head > title"))),un(v,c,s),v[an]=r,Yt(v),c=v;break e;case"link":var w=Mb("link","href",p).get(c+(s.href||""));if(w){for(var N=0;N<w.length;N++)if(v=w[N],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(N,1);break t}}v=p.createElement(c),un(v,c,s),p.head.appendChild(v);break;case"meta":if(w=Mb("meta","content",p).get(c+(s.content||""))){for(N=0;N<w.length;N++)if(v=w[N],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(N,1);break t}}v=p.createElement(c),un(v,c,s),p.head.appendChild(v);break;default:throw Error(a(468,c))}v[an]=r,Yt(v),c=v}r.stateNode=c}else Lb(p,r.type,r.stateNode);else r.stateNode=Db(p,c,r.memoizedProps);else v!==c?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,c===null?Lb(p,r.type,r.stateNode):Db(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&zh(r,r.memoizedProps,s.memoizedProps)}break;case 27:En(i,r),Cn(r),c&512&&(Pt||s===null||Rr(s,s.return)),s!==null&&c&4&&zh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(En(i,r),Cn(r),c&512&&(Pt||s===null||Rr(s,s.return)),r.flags&32){p=r.stateNode;try{zl(p,"")}catch(Se){dt(r,r.return,Se)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,zh(r,p,s!==null?s.memoizedProps:p)),c&1024&&(Rh=!0);break;case 6:if(En(i,r),Cn(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(Se){dt(r,r.return,Se)}}break;case 3:if(Tc=null,p=wr,wr=zc(i.containerInfo),En(i,r),wr=p,Cn(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{ls(i.containerInfo)}catch(Se){dt(r,r.return,Se)}Rh&&(Rh=!1,Lx(r));break;case 4:c=wr,wr=zc(r.stateNode.containerInfo),En(i,r),Cn(r),wr=c;break;case 12:En(i,r),Cn(r);break;case 31:En(i,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,pc(r,c)));break;case 13:En(i,r),Cn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(yc=nn()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,pc(r,c)));break;case 22:p=r.memoizedState!==null;var M=s!==null&&s.memoizedState!==null,G=ii,te=Pt;if(ii=G||p,Pt=te||M,En(i,r),Pt=te,ii=G,Cn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||M||ii||Pt||Ya(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){M=s=i;try{if(v=M.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=M.stateNode;var se=M.memoizedProps.style,K=se!=null&&se.hasOwnProperty("display")?se.display:null;N.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(Se){dt(M,M.return,Se)}}}else if(i.tag===6){if(s===null){M=i;try{M.stateNode.nodeValue=p?"":M.memoizedProps}catch(Se){dt(M,M.return,Se)}}}else if(i.tag===18){if(s===null){M=i;try{var X=M.stateNode;p?Eb(X,!0):Eb(M.stateNode,!1)}catch(Se){dt(M,M.return,Se)}}}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}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,pc(r,s))));break;case 19:En(i,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,pc(r,c)));break;case 30:break;case 21:break;default:En(i,r),Cn(r)}}function Cn(r){var i=r.flags;if(i&2){try{for(var s,c=r.return;c!==null;){if(Nx(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=Ah(r);mc(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(zl(w,""),s.flags&=-33);var N=Ah(r);mc(r,N,w);break;case 3:case 4:var M=s.stateNode.containerInfo,G=Ah(r);Th(r,G,M);break;default:throw Error(a(161))}}catch(te){dt(r,r.return,te)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Lx(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Lx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function li(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Ax(r,i.alternate,i),i=i.sibling}function Ya(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:qi(4,i,i.return),Ya(i);break;case 1:Rr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Ex(i,i.return,s),Ya(i);break;case 27:Ro(i.stateNode);case 26:case 5:Rr(i,i.return),Ya(i);break;case 22:i.memoizedState===null&&Ya(i);break;case 30:Ya(i);break;default:Ya(i)}r=r.sibling}}function si(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:si(p,v,s),wo(4,v);break;case 1:if(si(p,v,s),c=v,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){dt(c,c.return,G)}if(c=v,p=c.updateQueue,p!==null){var N=c.stateNode;try{var M=p.shared.hiddenCallbacks;if(M!==null)for(p.shared.hiddenCallbacks=null,p=0;p<M.length;p++)hv(M[p],N)}catch(G){dt(c,c.return,G)}}s&&w&64&&jx(v),ko(v,v.return);break;case 27:_x(v);case 26:case 5:si(p,v,s),s&&c===null&&w&4&&Cx(v),ko(v,v.return);break;case 12:si(p,v,s);break;case 31:si(p,v,s),s&&w&4&&Ox(p,v);break;case 13:si(p,v,s),s&&w&4&&Dx(p,v);break;case 22:v.memoizedState===null&&si(p,v,s),ko(v,v.return);break;case 30:break;default:si(p,v,s)}i=i.sibling}}function Oh(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&&oo(s))}function Dh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&oo(r))}function kr(r,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ux(r,i,s,c),i=i.sibling}function Ux(r,i,s,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:kr(r,i,s,c),p&2048&&wo(9,i);break;case 1:kr(r,i,s,c);break;case 3:kr(r,i,s,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&oo(r)));break;case 12:if(p&2048){kr(r,i,s,c),r=i.stateNode;try{var v=i.memoizedProps,w=v.id,N=v.onPostCommit;typeof N=="function"&&N(w,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(M){dt(i,i.return,M)}}else kr(r,i,s,c);break;case 31:kr(r,i,s,c);break;case 13:kr(r,i,s,c);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?kr(r,i,s,c):jo(r,i):v._visibility&2?kr(r,i,s,c):(v._visibility|=2,Kl(r,i,s,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Oh(w,i);break;case 24:kr(r,i,s,c),p&2048&&Dh(i.alternate,i);break;default:kr(r,i,s,c)}}function Kl(r,i,s,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,w=i,N=s,M=c,G=w.flags;switch(w.tag){case 0:case 11:case 15:Kl(v,w,N,M,p),wo(8,w);break;case 23:break;case 22:var te=w.stateNode;w.memoizedState!==null?te._visibility&2?Kl(v,w,N,M,p):jo(v,w):(te._visibility|=2,Kl(v,w,N,M,p)),p&&G&2048&&Oh(w.alternate,w);break;case 24:Kl(v,w,N,M,p),p&&G&2048&&Dh(w.alternate,w);break;default:Kl(v,w,N,M,p)}i=i.sibling}}function jo(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,c=i,p=c.flags;switch(c.tag){case 22:jo(s,c),p&2048&&Oh(c.alternate,c);break;case 24:jo(s,c),p&2048&&Dh(c.alternate,c);break;default:jo(s,c)}i=i.sibling}}var Eo=8192;function Yl(r,i,s){if(r.subtreeFlags&Eo)for(r=r.child;r!==null;)Ix(r,i,s),r=r.sibling}function Ix(r,i,s){switch(r.tag){case 26:Yl(r,i,s),r.flags&Eo&&r.memoizedState!==null&&o2(s,wr,r.memoizedState,r.memoizedProps);break;case 5:Yl(r,i,s);break;case 3:case 4:var c=wr;wr=zc(r.stateNode.containerInfo),Yl(r,i,s),wr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=Eo,Eo=16777216,Yl(r,i,s),Eo=c):Yl(r,i,s));break;default:Yl(r,i,s)}}function Bx(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 Co(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Xt=c,$x(c,r)}Bx(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Px(r),r=r.sibling}function Px(r){switch(r.tag){case 0:case 11:case 15:Co(r),r.flags&2048&&qi(9,r,r.return);break;case 3:Co(r);break;case 12:Co(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,gc(r)):Co(r);break;default:Co(r)}}function gc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Xt=c,$x(c,r)}Bx(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:qi(8,i,i.return),gc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,gc(i));break;default:gc(i)}r=r.sibling}}function $x(r,i){for(;Xt!==null;){var s=Xt;switch(s.tag){case 0:case 11:case 15:qi(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:oo(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Xt=c;else e:for(s=r;Xt!==null;){c=Xt;var p=c.sibling,v=c.return;if(Tx(c),c===s){Xt=null;break e}if(p!==null){p.return=v,Xt=p;break e}Xt=v}}}var kN={getCacheForType:function(r){var i=sn(Ut),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return sn(Ut).controller.signal}},jN=typeof WeakMap=="function"?WeakMap:Map,at=0,gt=null,Ze=null,Ge=0,ct=0,Zn=null,Hi=!1,Xl=!1,Mh=!1,oi=0,Rt=0,Zi=0,Xa=0,Lh=0,Vn=0,Jl=0,No=null,Nn=null,Uh=!1,yc=0,Fx=0,vc=1/0,xc=null,Vi=null,Ht=0,Qi=null,Wl=null,ui=0,Ih=0,Bh=null,qx=null,_o=0,Ph=null;function Qn(){return(at&2)!==0&&Ge!==0?Ge&-Ge:P.T!==null?Vh():lf()}function Hx(){if(Vn===0)if((Ge&536870912)===0||Ye){var r=Ra;Ra<<=1,(Ra&3932160)===0&&(Ra=262144),Vn=r}else Vn=536870912;return r=qn.current,r!==null&&(r.flags|=32),Vn}function _n(r,i,s){(r===gt&&(ct===2||ct===9)||r.cancelPendingCommit!==null)&&(es(r,0),Gi(r,Ge,Vn,!1)),Ti(r,s),((at&2)===0||r!==gt)&&(r===gt&&((at&2)===0&&(Xa|=s),Rt===4&&Gi(r,Ge,Vn,!1)),Or(r))}function Zx(r,i,s){if((at&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ai(r,i),p=c?NN(r,i):Fh(r,i,!0),v=c;do{if(p===0){Xl&&!c&&Gi(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!EN(s)){p=Fh(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var N=r;p=No;var M=N.current.memoizedState.isDehydrated;if(M&&(es(N,w).flags|=256),w=Fh(N,w,!1),w!==2){if(Mh&&!M){N.errorRecoveryDisabledLanes|=v,Xa|=v,p=4;break e}v=Nn,Nn=p,v!==null&&(Nn===null?Nn=v:Nn.push.apply(Nn,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){es(r,0),Gi(r,i,0,!0);break}e:{switch(c=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Gi(c,i,Vn,!Hi);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=yc+300-nn(),10<p)){if(Gi(c,i,Vn,!Hi),Da(c,0,!0)!==0)break e;ui=i,c.timeoutHandle=wb(Vx.bind(null,c,s,Nn,xc,Uh,i,Vn,Xa,Jl,Hi,v,"Throttled",-0,0),p);break e}Vx(c,s,Nn,xc,Uh,i,Vn,Xa,Jl,Hi,v,null,-0,0)}}break}while(!0);Or(r)}function Vx(r,i,s,c,p,v,w,N,M,G,te,se,K,X){if(r.timeoutHandle=-1,se=i.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gr},Ix(i,v,se);var Se=(v&62914560)===v?yc-nn():(v&4194048)===v?Fx-nn():0;if(Se=u2(se,Se),Se!==null){ui=v,r.cancelPendingCommit=Se(eb.bind(null,r,i,v,s,c,p,w,N,M,te,se,null,K,X)),Gi(r,v,w,!G);return}}eb(r,i,v,s,c,p,w,N,M)}function EN(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 c=0;c<s.length;c++){var p=s[c],v=p.getSnapshot;p=p.value;try{if(!$n(v(),p))return!1}catch{return!1}}if(s=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 Gi(r,i,s,c){i&=~Lh,i&=~Xa,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var v=31-ut(p),w=1<<v;c[v]=-1,p&=~w}s!==0&&Gs(r,s,i)}function bc(){return(at&6)===0?(zo(0),!1):!0}function $h(){if(Ze!==null){if(ct===0)var r=Ze.return;else r=Ze,Jr=Fa=null,rh(r),Hl=null,co=0,r=Ze;for(;r!==null;)kx(r.alternate,r),r=r.return;Ze=null}}function es(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,ZN(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ui=0,$h(),gt=r,Ze=s=Yr(r.current,null),Ge=i,ct=0,Zn=null,Hi=!1,Xl=Ai(r,i),Mh=!1,Jl=Vn=Lh=Xa=Zi=Rt=0,Nn=No=null,Uh=!1,(i&8)!==0&&(i|=i&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=i;0<c;){var p=31-ut(c),v=1<<p;i|=r[p],c&=~v}return oi=i,$u(),s}function Qx(r,i){Ue=null,P.H=xo,i===ql||i===Ku?(i=uv(),ct=3):i===Zf?(i=uv(),ct=4):ct=i===xh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Zn=i,Ze===null&&(Rt=1,uc(r,ar(i,r.current)))}function Gx(){var r=qn.current;return r===null?!0:(Ge&4194048)===Ge?ur===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?r===ur:!1}function Kx(){var r=P.H;return P.H=xo,r===null?xo:r}function Yx(){var r=P.A;return P.A=kN,r}function Sc(){Rt=4,Hi||(Ge&4194048)!==Ge&&qn.current!==null||(Xl=!0),(Zi&134217727)===0&&(Xa&134217727)===0||gt===null||Gi(gt,Ge,Vn,!1)}function Fh(r,i,s){var c=at;at|=2;var p=Kx(),v=Yx();(gt!==r||Ge!==i)&&(xc=null,es(r,i)),i=!1;var w=Rt;e:do try{if(ct!==0&&Ze!==null){var N=Ze,M=Zn;switch(ct){case 8:$h(),w=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(i=!0);var G=ct;if(ct=0,Zn=null,ts(r,N,M,G),s&&Xl){w=0;break e}break;default:G=ct,ct=0,Zn=null,ts(r,N,M,G)}}CN(),w=Rt;break}catch(te){Qx(r,te)}while(!0);return i&&r.shellSuspendCounter++,Jr=Fa=null,at=c,P.H=p,P.A=v,Ze===null&&(gt=null,Ge=0,$u()),w}function CN(){for(;Ze!==null;)Xx(Ze)}function NN(r,i){var s=at;at|=2;var c=Kx(),p=Yx();gt!==r||Ge!==i?(xc=null,vc=nn()+500,es(r,i)):Xl=Ai(r,i);e:do try{if(ct!==0&&Ze!==null){i=Ze;var v=Zn;t:switch(ct){case 1:ct=0,Zn=null,ts(r,i,v,1);break;case 2:case 9:if(sv(v)){ct=0,Zn=null,Jx(i);break}i=function(){ct!==2&&ct!==9||gt!==r||(ct=7),Or(r)},v.then(i,i);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:sv(v)?(ct=0,Zn=null,Jx(i)):(ct=0,Zn=null,ts(r,i,v,7));break;case 5:var w=null;switch(Ze.tag){case 26:w=Ze.memoizedState;case 5:case 27:var N=Ze;if(w?Ub(w):N.stateNode.complete){ct=0,Zn=null;var M=N.sibling;if(M!==null)Ze=M;else{var G=N.return;G!==null?(Ze=G,wc(G)):Ze=null}break t}}ct=0,Zn=null,ts(r,i,v,5);break;case 6:ct=0,Zn=null,ts(r,i,v,6);break;case 8:$h(),Rt=6;break e;default:throw Error(a(462))}}_N();break}catch(te){Qx(r,te)}while(!0);return Jr=Fa=null,P.H=c,P.A=p,at=s,Ze!==null?0:(gt=null,Ge=0,$u(),Rt)}function _N(){for(;Ze!==null&&!Aa();)Xx(Ze)}function Xx(r){var i=Sx(r.alternate,r,oi);r.memoizedProps=r.pendingProps,i===null?wc(r):Ze=i}function Jx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=px(s,i,i.pendingProps,i.type,void 0,Ge);break;case 11:i=px(s,i,i.pendingProps,i.type.render,i.ref,Ge);break;case 5:rh(i);default:kx(s,i),i=Ze=Yy(i,oi),i=Sx(s,i,oi)}r.memoizedProps=r.pendingProps,i===null?wc(r):Ze=i}function ts(r,i,s,c){Jr=Fa=null,rh(i),Hl=null,co=0;var p=i.return;try{if(gN(r,p,i,s,Ge)){Rt=1,uc(r,ar(s,r.current)),Ze=null;return}}catch(v){if(p!==null)throw Ze=p,v;Rt=1,uc(r,ar(s,r.current)),Ze=null;return}i.flags&32768?(Ye||c===1?r=!0:Xl||(Ge&536870912)!==0?r=!1:(Hi=r=!0,(c===2||c===9||c===3||c===6)&&(c=qn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Wx(i,r)):wc(i)}function wc(r){var i=r;do{if((i.flags&32768)!==0){Wx(i,Hi);return}r=i.return;var s=xN(i.alternate,i,oi);if(s!==null){Ze=s;return}if(i=i.sibling,i!==null){Ze=i;return}Ze=i=r}while(i!==null);Rt===0&&(Rt=5)}function Wx(r,i){do{var s=bN(r.alternate,r);if(s!==null){s.flags&=32767,Ze=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Ze=r;return}Ze=r=s}while(r!==null);Rt=6,Ze=null}function eb(r,i,s,c,p,v,w,N,M){r.cancelPendingCommit=null;do kc();while(Ht!==0);if((at&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=Af,zu(r,s,v,w,N,M),r===gt&&(Ze=gt=null,Ge=0),Wl=i,Qi=r,ui=s,Ih=v,Bh=p,qx=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,RN(Oe,function(){return ab(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=P.T,P.T=null,p=V.p,V.p=2,w=at,at|=4;try{SN(r,i,s)}finally{at=w,V.p=p,P.T=c}}Ht=1,tb(),nb(),rb()}}function tb(){if(Ht===1){Ht=0;var r=Qi,i=Wl,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var c=V.p;V.p=2;var p=at;at|=4;try{Mx(i,r);var v=em,w=$y(r.containerInfo),N=v.focusedElem,M=v.selectionRange;if(w!==N&&N&&N.ownerDocument&&Py(N.ownerDocument.documentElement,N)){if(M!==null&&Ef(N)){var G=M.start,te=M.end;if(te===void 0&&(te=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(te,N.value.length);else{var se=N.ownerDocument||document,K=se&&se.defaultView||window;if(K.getSelection){var X=K.getSelection(),Se=N.textContent.length,Re=Math.min(M.start,Se),pt=M.end===void 0?Re:Math.min(M.end,Se);!X.extend&&Re>pt&&(w=pt,pt=Re,Re=w);var H=By(N,Re),F=By(N,pt);if(H&&F&&(X.rangeCount!==1||X.anchorNode!==H.node||X.anchorOffset!==H.offset||X.focusNode!==F.node||X.focusOffset!==F.offset)){var Q=se.createRange();Q.setStart(H.node,H.offset),X.removeAllRanges(),Re>pt?(X.addRange(Q),X.extend(F.node,F.offset)):(Q.setEnd(F.node,F.offset),X.addRange(Q))}}}}for(se=[],X=N;X=X.parentNode;)X.nodeType===1&&se.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<se.length;N++){var le=se[N];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Mc=!!Wh,em=Wh=null}finally{at=p,V.p=c,P.T=s}}r.current=i,Ht=2}}function nb(){if(Ht===2){Ht=0;var r=Qi,i=Wl,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=P.T,P.T=null;var c=V.p;V.p=2;var p=at;at|=4;try{Ax(r,i.alternate,i)}finally{at=p,V.p=c,P.T=s}}Ht=3}}function rb(){if(Ht===4||Ht===3){Ht=0,Zs();var r=Qi,i=Wl,s=ui,c=qx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ht=5:(Ht=0,Wl=Qi=null,ib(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Vi=null),wl(s),i=i.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(rn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=P.T,p=V.p,V.p=2,P.T=null;try{for(var v=r.onRecoverableError,w=0;w<c.length;w++){var N=c[w];v(N.value,{componentStack:N.stack})}}finally{P.T=i,V.p=p}}(ui&3)!==0&&kc(),Or(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===Ph?_o++:(_o=0,Ph=r):_o=0,zo(0)}}function ib(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,oo(i)))}function kc(){return tb(),nb(),rb(),ab()}function ab(){if(Ht!==5)return!1;var r=Qi,i=Ih;Ih=0;var s=wl(ui),c=P.T,p=V.p;try{V.p=32>s?32:s,P.T=null,s=Bh,Bh=null;var v=Qi,w=ui;if(Ht=0,Wl=Qi=null,ui=0,(at&6)!==0)throw Error(a(331));var N=at;if(at|=4,Px(v.current),Ux(v,v.current,w,s),at=N,zo(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(rn,v)}catch{}return!0}finally{V.p=p,P.T=c,ib(r,i)}}function lb(r,i,s){i=ar(s,i),i=vh(r.stateNode,i,2),r=Pi(r,i,2),r!==null&&(Ti(r,2),Or(r))}function dt(r,i,s){if(r.tag===3)lb(r,r,s);else for(;i!==null;){if(i.tag===3){lb(i,r,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Vi===null||!Vi.has(c))){r=ar(s,r),s=sx(2),c=Pi(i,s,2),c!==null&&(ox(s,c,i,r),Ti(c,2),Or(c));break}}i=i.return}}function qh(r,i,s){var c=r.pingCache;if(c===null){c=r.pingCache=new jN;var p=new Set;c.set(i,p)}else p=c.get(i),p===void 0&&(p=new Set,c.set(i,p));p.has(s)||(Mh=!0,p.add(s),r=zN.bind(null,r,i,s),i.then(r,r))}function zN(r,i,s){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,gt===r&&(Ge&s)===s&&(Rt===4||Rt===3&&(Ge&62914560)===Ge&&300>nn()-yc?(at&2)===0&&es(r,0):Lh|=s,Jl===Ge&&(Jl=0)),Or(r)}function sb(r,i){i===0&&(i=Qs()),r=Ba(r,i),r!==null&&(Ti(r,i),Or(r))}function AN(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),sb(r,s)}function TN(r,i){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),sb(r,s)}function RN(r,i){return Vr(r,i)}var jc=null,ns=null,Hh=!1,Ec=!1,Zh=!1,Ki=0;function Or(r){r!==ns&&r.next===null&&(ns===null?jc=ns=r:ns=ns.next=r),Ec=!0,Hh||(Hh=!0,DN())}function zo(r,i){if(!Zh&&Ec){Zh=!0;do for(var s=!1,c=jc;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var v=0;else{var w=c.suspendedLanes,N=c.pingedLanes;v=(1<<31-ut(42|r)+1)-1,v&=p&~(w&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,db(c,v))}else v=Ge,v=Da(c,c===gt?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Ai(c,v)||(s=!0,db(c,v));c=c.next}while(s);Zh=!1}}function ON(){ob()}function ob(){Ec=Hh=!1;var r=0;Ki!==0&&HN()&&(r=Ki);for(var i=nn(),s=null,c=jc;c!==null;){var p=c.next,v=ub(c,i);v===0?(c.next=null,s===null?jc=p:s.next=p,p===null&&(ns=s)):(s=c,(r!==0||(v&3)!==0)&&(Ec=!0)),c=p}Ht!==0&&Ht!==5||zo(r),Ki!==0&&(Ki=0)}function ub(r,i){for(var s=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-ut(v),N=1<<w,M=p[w];M===-1?((N&s)===0||(N&c)!==0)&&(p[w]=_u(N,i)):M<=i&&(r.expiredLanes|=N),v&=~N}if(i=gt,s=Ge,s=Da(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===i&&(ct===2||ct===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&za(c),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ai(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(c!==null&&za(c),wl(s)){case 2:case 8:s=me;break;case 32:s=Oe;break;case 268435456:s=nt;break;default:s=Oe}return c=cb.bind(null,r),s=Vr(s,c),r.callbackPriority=i,r.callbackNode=s,i}return c!==null&&c!==null&&za(c),r.callbackPriority=2,r.callbackNode=null,2}function cb(r,i){if(Ht!==0&&Ht!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(kc()&&r.callbackNode!==s)return null;var c=Ge;return c=Da(r,r===gt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(Zx(r,c,i),ub(r,nn()),r.callbackNode!=null&&r.callbackNode===s?cb.bind(null,r):null)}function db(r,i){if(kc())return null;Zx(r,i,!0)}function DN(){VN(function(){(at&6)!==0?Vr(ne,ON):ob()})}function Vh(){if(Ki===0){var r=$l;r===0&&(r=Ta,Ta<<=1,(Ta&261888)===0&&(Ta=256)),Ki=r}return Ki}function fb(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Ou(""+r)}function hb(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 MN(r,i,s,c,p){if(i==="submit"&&s&&s.stateNode===p){var v=fb((p[wn]||null).action),w=c.submitter;w&&(i=(i=w[wn]||null)?fb(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var N=new Uu("action","action",null,c,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ki!==0){var M=w?hb(p,w):new FormData(p);fh(s,{pending:!0,data:M,method:p.method,action:v},null,M)}}else typeof v=="function"&&(N.preventDefault(),M=w?hb(p,w):new FormData(p),fh(s,{pending:!0,data:M,method:p.method,action:v},v,M))},currentTarget:p}]})}}for(var Qh=0;Qh<zf.length;Qh++){var Gh=zf[Qh],LN=Gh.toLowerCase(),UN=Gh[0].toUpperCase()+Gh.slice(1);Sr(LN,"on"+UN)}Sr(Hy,"onAnimationEnd"),Sr(Zy,"onAnimationIteration"),Sr(Vy,"onAnimationStart"),Sr("dblclick","onDoubleClick"),Sr("focusin","onFocus"),Sr("focusout","onBlur"),Sr(WC,"onTransitionRun"),Sr(eN,"onTransitionStart"),Sr(tN,"onTransitionCancel"),Sr(Qy,"onTransitionEnd"),Nl("onMouseEnter",["mouseout","mouseover"]),Nl("onMouseLeave",["mouseout","mouseover"]),Nl("onPointerEnter",["pointerout","pointerover"]),Nl("onPointerLeave",["pointerout","pointerover"]),Ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ao="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(" "),IN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ao));function mb(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var c=r[s],p=c.event;c=c.listeners;e:{var v=void 0;if(i)for(var w=c.length-1;0<=w;w--){var N=c[w],M=N.instance,G=N.currentTarget;if(N=N.listener,M!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(te){Pu(te)}p.currentTarget=null,v=M}else for(w=0;w<c.length;w++){if(N=c[w],M=N.instance,G=N.currentTarget,N=N.listener,M!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(te){Pu(te)}p.currentTarget=null,v=M}}}}function Ve(r,i){var s=i[sf];s===void 0&&(s=i[sf]=new Set);var c=r+"__bubble";s.has(c)||(pb(i,r,2,!1),s.add(c))}function Kh(r,i,s){var c=0;i&&(c|=4),pb(s,r,c,i)}var Cc="_reactListening"+Math.random().toString(36).slice(2);function Yh(r){if(!r[Cc]){r[Cc]=!0,oy.forEach(function(s){s!=="selectionchange"&&(IN.has(s)||Kh(s,!1,r),Kh(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Cc]||(i[Cc]=!0,Kh("selectionchange",!1,i))}}function pb(r,i,s,c){switch(Hb(i)){case 2:var p=f2;break;case 8:p=h2;break;default:p=dm}s=p.bind(null,i,s,r),p=void 0,!gf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?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 Xh(r,i,s,c,p){var v=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var N=c.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=c.return;w!==null;){var M=w.tag;if((M===3||M===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=jl(N),w===null)return;if(M=w.tag,M===5||M===6||M===26||M===27){c=v=w;continue e}N=N.parentNode}}c=c.return}by(function(){var G=v,te=mf(s),se=[];e:{var K=Gy.get(r);if(K!==void 0){var X=Uu,Se=r;switch(r){case"keypress":if(Mu(s)===0)break e;case"keydown":case"keyup":X=TC;break;case"focusin":Se="focus",X=bf;break;case"focusout":Se="blur",X=bf;break;case"beforeblur":case"afterblur":X=bf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=ky;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=xC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=DC;break;case Hy:case Zy:case Vy:X=wC;break;case Qy:X=LC;break;case"scroll":case"scrollend":X=yC;break;case"wheel":X=IC;break;case"copy":case"cut":case"paste":X=jC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Ey;break;case"toggle":case"beforetoggle":X=PC}var Re=(i&4)!==0,pt=!Re&&(r==="scroll"||r==="scrollend"),H=Re?K!==null?K+"Capture":null:K;Re=[];for(var F=G,Q;F!==null;){var le=F;if(Q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Q===null||H===null||(le=Xs(F,H),le!=null&&Re.push(To(F,le,Q))),pt)break;F=F.return}0<Re.length&&(K=new X(K,Se,null,s,te),se.push({event:K,listeners:Re}))}}if((i&7)===0){e:{if(K=r==="mouseover"||r==="pointerover",X=r==="mouseout"||r==="pointerout",K&&s!==hf&&(Se=s.relatedTarget||s.fromElement)&&(jl(Se)||Se[kl]))break e;if((X||K)&&(K=te.window===te?te:(K=te.ownerDocument)?K.defaultView||K.parentWindow:window,X?(Se=s.relatedTarget||s.toElement,X=G,Se=Se?jl(Se):null,Se!==null&&(pt=o(Se),Re=Se.tag,Se!==pt||Re!==5&&Re!==27&&Re!==6)&&(Se=null)):(X=null,Se=G),X!==Se)){if(Re=ky,le="onMouseLeave",H="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&(Re=Ey,le="onPointerLeave",H="onPointerEnter",F="pointer"),pt=X==null?K:Ys(X),Q=Se==null?K:Ys(Se),K=new Re(le,F+"leave",X,s,te),K.target=pt,K.relatedTarget=Q,le=null,jl(te)===G&&(Re=new Re(H,F+"enter",Se,s,te),Re.target=Q,Re.relatedTarget=pt,le=Re),pt=le,X&&Se)t:{for(Re=BN,H=X,F=Se,Q=0,le=H;le;le=Re(le))Q++;le=0;for(var _e=F;_e;_e=Re(_e))le++;for(;0<Q-le;)H=Re(H),Q--;for(;0<le-Q;)F=Re(F),le--;for(;Q--;){if(H===F||F!==null&&H===F.alternate){Re=H;break t}H=Re(H),F=Re(F)}Re=null}else Re=null;X!==null&&gb(se,K,X,Re,!1),Se!==null&&pt!==null&&gb(se,pt,Se,Re,!0)}}e:{if(K=G?Ys(G):window,X=K.nodeName&&K.nodeName.toLowerCase(),X==="select"||X==="input"&&K.type==="file")var rt=Oy;else if(Ty(K))if(Dy)rt=YC;else{rt=GC;var je=QC}else X=K.nodeName,!X||X.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?G&&ff(G.elementType)&&(rt=Oy):rt=KC;if(rt&&(rt=rt(r,G))){Ry(se,rt,s,te);break e}je&&je(r,K,G),r==="focusout"&&G&&K.type==="number"&&G.memoizedProps.value!=null&&df(K,"number",K.value)}switch(je=G?Ys(G):window,r){case"focusin":(Ty(je)||je.contentEditable==="true")&&(Ol=je,Cf=G,ao=null);break;case"focusout":ao=Cf=Ol=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,Fy(se,s,te);break;case"selectionchange":if(JC)break;case"keydown":case"keyup":Fy(se,s,te)}var Ie;if(wf)e:{switch(r){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Rl?zy(r,s)&&(Ke="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(Ke="onCompositionStart");Ke&&(Cy&&s.locale!=="ko"&&(Rl||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Rl&&(Ie=Sy()):(Oi=te,yf="value"in Oi?Oi.value:Oi.textContent,Rl=!0)),je=Nc(G,Ke),0<je.length&&(Ke=new jy(Ke,r,null,s,te),se.push({event:Ke,listeners:je}),Ie?Ke.data=Ie:(Ie=Ay(s),Ie!==null&&(Ke.data=Ie)))),(Ie=FC?qC(r,s):HC(r,s))&&(Ke=Nc(G,"onBeforeInput"),0<Ke.length&&(je=new jy("onBeforeInput","beforeinput",null,s,te),se.push({event:je,listeners:Ke}),je.data=Ie)),MN(se,r,G,s,te)}mb(se,i)})}function To(r,i,s){return{instance:r,listener:i,currentTarget:s}}function Nc(r,i){for(var s=i+"Capture",c=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=Xs(r,s),p!=null&&c.unshift(To(r,p,v)),p=Xs(r,i),p!=null&&c.push(To(r,p,v))),r.tag===3)return c;r=r.return}return[]}function BN(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function gb(r,i,s,c,p){for(var v=i._reactName,w=[];s!==null&&s!==c;){var N=s,M=N.alternate,G=N.stateNode;if(N=N.tag,M!==null&&M===c)break;N!==5&&N!==26&&N!==27||G===null||(M=G,p?(G=Xs(s,v),G!=null&&w.unshift(To(s,G,M))):p||(G=Xs(s,v),G!=null&&w.push(To(s,G,M)))),s=s.return}w.length!==0&&r.push({event:i,listeners:w})}var PN=/\r\n?/g,$N=/\u0000|\uFFFD/g;function yb(r){return(typeof r=="string"?r:""+r).replace(PN,`
|
|
49
|
-
`).replace($N,"")}function vb(r,i){return i=yb(i),yb(r)===i}function mt(r,i,s,c,p,v){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||zl(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&zl(r,""+c);break;case"className":Tu(r,"class",c);break;case"tabIndex":Tu(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Tu(r,s,c);break;case"style":vy(r,c,v);break;case"data":if(i!=="object"){Tu(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Ou(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(s==="formAction"?(i!=="input"&&mt(r,i,"name",p.name,p,null),mt(r,i,"formEncType",p.formEncType,p,null),mt(r,i,"formMethod",p.formMethod,p,null),mt(r,i,"formTarget",p.formTarget,p,null)):(mt(r,i,"encType",p.encType,p,null),mt(r,i,"method",p.method,p,null),mt(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Ou(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=Gr);break;case"onScroll":c!=null&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=Ou(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":Ve("beforetoggle",r),Ve("toggle",r),Au(r,"popover",c);break;case"xlinkActuate":Qr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Qr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Qr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Qr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Qr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Qr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Au(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=pC.get(s)||s,Au(r,s,c))}}function Jh(r,i,s,c,p,v){switch(s){case"style":vy(r,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof c=="string"?zl(r,c):(typeof c=="number"||typeof c=="bigint")&&zl(r,""+c);break;case"onScroll":c!=null&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Gr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!uy.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[wn]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof c=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,c,p);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):Au(r,s,c)}}}function un(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",r),Ve("load",r);var c=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=null)switch(v){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:mt(r,i,v,w,s,null)}}p&&mt(r,i,"srcSet",s.srcSet,s,null),c&&mt(r,i,"src",s.src,s,null);return;case"input":Ve("invalid",r);var N=v=w=p=null,M=null,G=null;for(c in s)if(s.hasOwnProperty(c)){var te=s[c];if(te!=null)switch(c){case"name":p=te;break;case"type":w=te;break;case"checked":M=te;break;case"defaultChecked":G=te;break;case"value":v=te;break;case"defaultValue":N=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,i));break;default:mt(r,i,c,te,s,null)}}my(r,v,N,M,G,w,p,!1);return;case"select":Ve("invalid",r),c=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":w=N;break;case"multiple":c=N;default:mt(r,i,p,N,s,null)}i=v,s=w,r.multiple=!!c,i!=null?_l(r,!!c,i,!1):s!=null&&_l(r,!!c,s,!0);return;case"textarea":Ve("invalid",r),v=p=c=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":c=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:mt(r,i,w,N,s,null)}gy(r,c,p,v);return;case"option":for(M in s)if(s.hasOwnProperty(M)&&(c=s[M],c!=null))switch(M){case"selected":r.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:mt(r,i,M,c,s,null)}return;case"dialog":Ve("beforetoggle",r),Ve("toggle",r),Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":Ve("load",r);break;case"video":case"audio":for(c=0;c<Ao.length;c++)Ve(Ao[c],r);break;case"image":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"embed":case"source":case"link":Ve("error",r),Ve("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in s)if(s.hasOwnProperty(G)&&(c=s[G],c!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:mt(r,i,G,c,s,null)}return;default:if(ff(i)){for(te in s)s.hasOwnProperty(te)&&(c=s[te],c!==void 0&&Jh(r,i,te,c,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(c=s[N],c!=null&&mt(r,i,N,c,s,null))}function FN(r,i,s,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,w=null,N=null,M=null,G=null,te=null;for(X in s){var se=s[X];if(s.hasOwnProperty(X)&&se!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":M=se;default:c.hasOwnProperty(X)||mt(r,i,X,null,c,se)}}for(var K in c){var X=c[K];if(se=s[K],c.hasOwnProperty(K)&&(X!=null||se!=null))switch(K){case"type":v=X;break;case"name":p=X;break;case"checked":G=X;break;case"defaultChecked":te=X;break;case"value":w=X;break;case"defaultValue":N=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:X!==se&&mt(r,i,K,X,c,se)}}cf(r,w,N,M,G,te,v,p);return;case"select":X=w=N=K=null;for(v in s)if(M=s[v],s.hasOwnProperty(v)&&M!=null)switch(v){case"value":break;case"multiple":X=M;default:c.hasOwnProperty(v)||mt(r,i,v,null,c,M)}for(p in c)if(v=c[p],M=s[p],c.hasOwnProperty(p)&&(v!=null||M!=null))switch(p){case"value":K=v;break;case"defaultValue":N=v;break;case"multiple":w=v;default:v!==M&&mt(r,i,p,v,c,M)}i=N,s=w,c=X,K!=null?_l(r,!!s,K,!1):!!c!=!!s&&(i!=null?_l(r,!!s,i,!0):_l(r,!!s,s?[]:"",!1));return;case"textarea":X=K=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!c.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:mt(r,i,N,null,c,p)}for(w in c)if(p=c[w],v=s[w],c.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":K=p;break;case"defaultValue":X=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&mt(r,i,w,p,c,v)}py(r,K,X);return;case"option":for(var Se in s)if(K=s[Se],s.hasOwnProperty(Se)&&K!=null&&!c.hasOwnProperty(Se))switch(Se){case"selected":r.selected=!1;break;default:mt(r,i,Se,null,c,K)}for(M in c)if(K=c[M],X=s[M],c.hasOwnProperty(M)&&K!==X&&(K!=null||X!=null))switch(M){case"selected":r.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:mt(r,i,M,K,c,X)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in s)K=s[Re],s.hasOwnProperty(Re)&&K!=null&&!c.hasOwnProperty(Re)&&mt(r,i,Re,null,c,K);for(G in c)if(K=c[G],X=s[G],c.hasOwnProperty(G)&&K!==X&&(K!=null||X!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,i));break;default:mt(r,i,G,K,c,X)}return;default:if(ff(i)){for(var pt in s)K=s[pt],s.hasOwnProperty(pt)&&K!==void 0&&!c.hasOwnProperty(pt)&&Jh(r,i,pt,void 0,c,K);for(te in c)K=c[te],X=s[te],!c.hasOwnProperty(te)||K===X||K===void 0&&X===void 0||Jh(r,i,te,K,c,X);return}}for(var H in s)K=s[H],s.hasOwnProperty(H)&&K!=null&&!c.hasOwnProperty(H)&&mt(r,i,H,null,c,K);for(se in c)K=c[se],X=s[se],!c.hasOwnProperty(se)||K===X||K==null&&X==null||mt(r,i,se,K,c,X)}function xb(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function qN(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],v=p.transferSize,w=p.initiatorType,N=p.duration;if(v&&N&&xb(w)){for(w=0,N=p.responseEnd,c+=1;c<s.length;c++){var M=s[c],G=M.startTime;if(G>N)break;var te=M.transferSize,se=M.initiatorType;te&&xb(se)&&(M=M.responseEnd,w+=te*(M<N?1:(N-G)/(M-G)))}if(--c,i+=8*(v+w)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Wh=null,em=null;function _c(r){return r.nodeType===9?r:r.ownerDocument}function bb(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 Sb(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 tm(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 nm=null;function HN(){var r=window.event;return r&&r.type==="popstate"?r===nm?!1:(nm=r,!0):(nm=null,!1)}var wb=typeof setTimeout=="function"?setTimeout:void 0,ZN=typeof clearTimeout=="function"?clearTimeout:void 0,kb=typeof Promise=="function"?Promise:void 0,VN=typeof queueMicrotask=="function"?queueMicrotask:typeof kb<"u"?function(r){return kb.resolve(null).then(r).catch(QN)}:wb;function QN(r){setTimeout(function(){throw r})}function Yi(r){return r==="head"}function jb(r,i){var s=i,c=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(p),ls(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Ro(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Ro(s);for(var v=s.firstChild;v;){var w=v.nextSibling,N=v.nodeName;v[Ks]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Ro(r.ownerDocument.body);s=p}while(s);ls(i)}function Eb(r,i){var s=r;r=0;do{var c=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||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function rm(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":rm(s),of(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function GN(r,i,s,c){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[Ks])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=cr(r.nextSibling),r===null)break}return null}function KN(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=cr(r.nextSibling),r===null))return null;return r}function Cb(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=cr(r.nextSibling),r===null))return null;return r}function im(r){return r.data==="$?"||r.data==="$~"}function am(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function YN(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function cr(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 Nb(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return cr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function _b(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 zb(r,i,s){switch(i=_c(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 Ro(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);of(r)}var dr=new Map,Ab=new Set;function zc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ci=V.d;V.d={f:XN,r:JN,D:WN,C:e2,L:t2,m:n2,X:i2,S:r2,M:a2};function XN(){var r=ci.f(),i=bc();return r||i}function JN(r){var i=El(r);i!==null&&i.tag===5&&i.type==="form"?Qv(i):ci.r(r)}var rs=typeof document>"u"?null:document;function Tb(r,i,s){var c=rs;if(c&&typeof i=="string"&&i){var p=rr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Ab.has(p)||(Ab.add(p),r={rel:r,crossOrigin:s,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),un(i,"link",r),Yt(i),c.head.appendChild(i)))}}function WN(r){ci.D(r),Tb("dns-prefetch",r,null)}function e2(r,i){ci.C(r,i),Tb("preconnect",r,i)}function t2(r,i,s){ci.L(r,i,s);var c=rs;if(c&&r&&i){var p='link[rel="preload"][as="'+rr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+rr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+rr(s.imageSizes)+'"]')):p+='[href="'+rr(r)+'"]';var v=p;switch(i){case"style":v=is(r);break;case"script":v=as(r)}dr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),dr.set(v,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(Oo(v))||i==="script"&&c.querySelector(Do(v))||(i=c.createElement("link"),un(i,"link",r),Yt(i),c.head.appendChild(i)))}}function n2(r,i){ci.m(r,i);var s=rs;if(s&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+rr(c)+'"][href="'+rr(r)+'"]',v=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=as(r)}if(!dr.has(v)&&(r=g({rel:"modulepreload",href:r},i),dr.set(v,r),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Do(v)))return}c=s.createElement("link"),un(c,"link",r),Yt(c),s.head.appendChild(c)}}}function r2(r,i,s){ci.S(r,i,s);var c=rs;if(c&&r){var p=Cl(c).hoistableStyles,v=is(r);i=i||"default";var w=p.get(v);if(!w){var N={loading:0,preload:null};if(w=c.querySelector(Oo(v)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=dr.get(v))&&sm(r,s);var M=w=c.createElement("link");Yt(M),un(M,"link",r),M._p=new Promise(function(G,te){M.onload=G,M.onerror=te}),M.addEventListener("load",function(){N.loading|=1}),M.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ac(w,i,c)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(v,w)}}}function i2(r,i){ci.X(r,i);var s=rs;if(s&&r){var c=Cl(s).hoistableScripts,p=as(r),v=c.get(p);v||(v=s.querySelector(Do(p)),v||(r=g({src:r,async:!0},i),(i=dr.get(p))&&om(r,i),v=s.createElement("script"),Yt(v),un(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function a2(r,i){ci.M(r,i);var s=rs;if(s&&r){var c=Cl(s).hoistableScripts,p=as(r),v=c.get(p);v||(v=s.querySelector(Do(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=dr.get(p))&&om(r,i),v=s.createElement("script"),Yt(v),un(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function Rb(r,i,s,c){var p=(p=ue.current)?zc(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=is(s.href),s=Cl(p).hoistableStyles,c=s.get(i),c||(c={type:"style",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=is(s.href);var v=Cl(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Oo(r)))&&!v._p&&(w.instance=v,w.state.loading=5),dr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},dr.set(r,s),v||l2(p,r,s,w.state))),i&&c===null)throw Error(a(528,""));return w}if(i&&c!==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=as(s),s=Cl(p).hoistableScripts,c=s.get(i),c||(c={type:"script",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function is(r){return'href="'+rr(r)+'"'}function Oo(r){return'link[rel="stylesheet"]['+r+"]"}function Ob(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function l2(r,i,s,c){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=r.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),un(i,"link",s),Yt(i),r.head.appendChild(i))}function as(r){return'[src="'+rr(r)+'"]'}function Do(r){return"script[async]"+r}function Db(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+rr(s.href)+'"]');if(c)return i.instance=c,Yt(c),c;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Yt(c),un(c,"style",p),Ac(c,s.precedence,r),i.instance=c;case"stylesheet":p=is(s.href);var v=r.querySelector(Oo(p));if(v)return i.state.loading|=4,i.instance=v,Yt(v),v;c=Ob(s),(p=dr.get(p))&&sm(c,p),v=(r.ownerDocument||r).createElement("link"),Yt(v);var w=v;return w._p=new Promise(function(N,M){w.onload=N,w.onerror=M}),un(v,"link",c),i.state.loading|=4,Ac(v,s.precedence,r),i.instance=v;case"script":return v=as(s.src),(p=r.querySelector(Do(v)))?(i.instance=p,Yt(p),p):(c=s,(p=dr.get(v))&&(c=g({},s),om(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Yt(p),un(p,"link",c),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&&(c=i.instance,i.state.loading|=4,Ac(c,s.precedence,r));return i.instance}function Ac(r,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,v=p,w=0;w<c.length;w++){var N=c[w];if(N.dataset.precedence===i)v=N;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function sm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function om(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Tc=null;function Mb(r,i,s){if(Tc===null){var c=new Map,p=Tc=new Map;p.set(s,c)}else p=Tc,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[Ks]||v[an]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=r+w;var N=c.get(w);N?N.push(v):c.set(w,[v])}}return c}function Lb(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function s2(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 Ub(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function o2(r,i,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=is(c.href),v=i.querySelector(Oo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Rc.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,Yt(v);return}v=i.ownerDocument||i,c=Ob(c),(p=dr.get(p))&&sm(c,p),v=v.createElement("link"),Yt(v);var w=v;w._p=new Promise(function(N,M){w.onload=N,w.onerror=M}),un(v,"link",c),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=Rc.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var um=0;function u2(r,i){return r.stylesheets&&r.count===0&&Dc(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Dc(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&um===0&&(um=62500*qN());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Dc(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>um?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Oc=null;function Dc(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Oc=new Map,i.forEach(c2,r),Oc=null,Rc.call(r))}function c2(r,i){if(!(i.state.loading&4)){var s=Oc.get(r);if(s)var c=s.get(null);else{s=new Map,Oc.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),c=w)}c&&s.set(null,c)}p=i.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||c,v===c&&s.set(null,p),s.set(w,p),this.count++,c=Rc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Mo={$$typeof:O,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function d2(r,i,s,c,p,v,w,N,M){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sl(0),this.hiddenUpdates=Sl(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Ib(r,i,s,c,p,v,w,N,M,G,te,se){return r=new d2(r,i,s,w,M,G,te,se,N),i=1,v===!0&&(i|=24),v=Fn(3,null,null,i),r.current=v,v.stateNode=r,i=Ff(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:c,isDehydrated:s,cache:i},Vf(v),r}function Bb(r){return r?(r=Ll,r):Ll}function Pb(r,i,s,c,p,v){p=Bb(p),c.context===null?c.context=p:c.pendingContext=p,c=Bi(i),c.payload={element:s},v=v===void 0?null:v,v!==null&&(c.callback=v),s=Pi(r,c,i),s!==null&&(_n(s,r,i),ho(s,r,i))}function $b(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function cm(r,i){$b(r,i),(r=r.alternate)&&$b(r,i)}function Fb(r){if(r.tag===13||r.tag===31){var i=Ba(r,67108864);i!==null&&_n(i,r,67108864),cm(r,67108864)}}function qb(r){if(r.tag===13||r.tag===31){var i=Qn();i=Kt(i);var s=Ba(r,i);s!==null&&_n(s,r,i),cm(r,i)}}var Mc=!0;function f2(r,i,s,c){var p=P.T;P.T=null;var v=V.p;try{V.p=2,dm(r,i,s,c)}finally{V.p=v,P.T=p}}function h2(r,i,s,c){var p=P.T;P.T=null;var v=V.p;try{V.p=8,dm(r,i,s,c)}finally{V.p=v,P.T=p}}function dm(r,i,s,c){if(Mc){var p=fm(c);if(p===null)Xh(r,i,c,Lc,s),Zb(r,c);else if(p2(p,r,i,s,c))c.stopPropagation();else if(Zb(r,c),i&4&&-1<m2.indexOf(r)){for(;p!==null;){var v=El(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=zr(v.pendingLanes);if(w!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var M=1<<31-ut(w);N.entanglements[1]|=M,w&=~M}Or(v),(at&6)===0&&(vc=nn()+500,zo(0))}}break;case 31:case 13:N=Ba(v,2),N!==null&&_n(N,v,2),bc(),cm(v,2)}if(v=fm(c),v===null&&Xh(r,i,c,Lc,s),v===p)break;p=v}p!==null&&c.stopPropagation()}else Xh(r,i,c,null,s)}}function fm(r){return r=mf(r),hm(r)}var Lc=null;function hm(r){if(Lc=null,r=jl(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 Lc=r,null}function Hb(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(Vs()){case ne:return 2;case me:return 8;case Oe:case $e:return 32;case nt:return 268435456;default:return 32}default:return 32}}var mm=!1,Xi=null,Ji=null,Wi=null,Lo=new Map,Uo=new Map,ea=[],m2="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 Zb(r,i){switch(r){case"focusin":case"focusout":Xi=null;break;case"dragenter":case"dragleave":Ji=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":Lo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(i.pointerId)}}function Io(r,i,s,c,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:v,targetContainers:[p]},i!==null&&(i=El(i),i!==null&&Fb(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function p2(r,i,s,c,p){switch(i){case"focusin":return Xi=Io(Xi,r,i,s,c,p),!0;case"dragenter":return Ji=Io(Ji,r,i,s,c,p),!0;case"mouseover":return Wi=Io(Wi,r,i,s,c,p),!0;case"pointerover":var v=p.pointerId;return Lo.set(v,Io(Lo.get(v)||null,r,i,s,c,p)),!0;case"gotpointercapture":return v=p.pointerId,Uo.set(v,Io(Uo.get(v)||null,r,i,s,c,p)),!0}return!1}function Vb(r){var i=jl(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,ly(r.priority,function(){qb(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,ly(r.priority,function(){qb(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 Uc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=fm(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);hf=c,s.target.dispatchEvent(c),hf=null}else return i=El(s),i!==null&&Fb(i),r.blockedOn=s,!1;i.shift()}return!0}function Qb(r,i,s){Uc(r)&&s.delete(i)}function g2(){mm=!1,Xi!==null&&Uc(Xi)&&(Xi=null),Ji!==null&&Uc(Ji)&&(Ji=null),Wi!==null&&Uc(Wi)&&(Wi=null),Lo.forEach(Qb),Uo.forEach(Qb)}function Ic(r,i){r.blockedOn===i&&(r.blockedOn=null,mm||(mm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,g2)))}var Bc=null;function Gb(r){Bc!==r&&(Bc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Bc===r&&(Bc=null);for(var i=0;i<r.length;i+=3){var s=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(hm(c||s)===null)continue;break}var v=El(s);v!==null&&(r.splice(i,3),i-=3,fh(v,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function ls(r){function i(M){return Ic(M,r)}Xi!==null&&Ic(Xi,r),Ji!==null&&Ic(Ji,r),Wi!==null&&Ic(Wi,r),Lo.forEach(i),Uo.forEach(i);for(var s=0;s<ea.length;s++){var c=ea[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<ea.length&&(s=ea[0],s.blockedOn===null);)Vb(s),s.blockedOn===null&&ea.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],v=s[c+1],w=p[wn]||null;if(typeof v=="function")w||Gb(s);else if(w){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[wn]||null)N=w.formAction;else if(hm(p)!==null)continue}else N=w.action;typeof N=="function"?s[c+1]=N:(s.splice(c,3),c-=3),Gb(s)}}}function Kb(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function pm(r){this._internalRoot=r}Pc.prototype.render=pm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=Qn();Pb(s,c,r,i,null,null)},Pc.prototype.unmount=pm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Pb(r.current,2,null,r,null,null),bc(),i[kl]=null}};function Pc(r){this._internalRoot=r}Pc.prototype.unstable_scheduleHydration=function(r){if(r){var i=lf();r={blockedOn:null,target:r,priority:i};for(var s=0;s<ea.length&&i!==0&&i<ea[s].priority;s++);ea.splice(s,0,r),s===0&&Vb(r)}};var Yb=t.version;if(Yb!=="19.2.4")throw Error(a(527,Yb,"19.2.4"));V.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 y2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$c.isDisabled&&$c.supportsFiber)try{rn=$c.inject(y2),Dt=$c}catch{}}return Po.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,c="",p=rx,v=ix,w=ax;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=Ib(r,1,!1,null,null,s,c,null,p,v,w,Kb),r[kl]=i.current,Yh(r),new pm(i)},Po.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var c=!1,p="",v=rx,w=ix,N=ax,M=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(M=s.formState)),i=Ib(r,1,!0,i,s??null,c,p,M,v,w,N,Kb),i.context=Bb(null),s=i.current,c=Qn(),c=Kt(c),p=Bi(c),p.callback=null,Pi(s,p,c),s=c,i.current.lanes=s,Ti(i,s),Or(i),r[kl]=i.current,Yh(r),new Pc(i)},Po.version="19.2.4",Po}var s0;function _2(){if(s0)return xm.exports;s0=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(),xm.exports=N2(),xm.exports}var z2=_2(),Us=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tl,oa,Ss,jS,A2=(jS=class extends Us{constructor(){super();Ne(this,tl);Ne(this,oa);Ne(this,Ss);ye(this,Ss,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,oa)||this.setEventListener(U(this,Ss))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,oa))==null||t.call(this),ye(this,oa,void 0))}setEventListener(t){var n;ye(this,Ss,t),(n=U(this,oa))==null||n.call(this),ye(this,oa,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){U(this,tl)!==t&&(ye(this,tl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof U(this,tl)=="boolean"?U(this,tl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},tl=new WeakMap,oa=new WeakMap,Ss=new WeakMap,jS),ig=new A2,T2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ua,tg,ES,R2=(ES=class{constructor(){Ne(this,ua,T2);Ne(this,tg,!1)}setTimeoutProvider(e){ye(this,ua,e)}setTimeout(e,t){return U(this,ua).setTimeout(e,t)}clearTimeout(e){U(this,ua).clearTimeout(e)}setInterval(e,t){return U(this,ua).setInterval(e,t)}clearInterval(e){U(this,ua).clearInterval(e)}},ua=new WeakMap,tg=new WeakMap,ES),el=new R2;function O2(e){setTimeout(e,0)}var D2=typeof window>"u"||"Deno"in globalThis;function xn(){}function M2(e,t){return typeof e=="function"?e(t):e}function cp(e){return typeof e=="number"&&e>=0&&e!==1/0}function LS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function va(e,t){return typeof e=="function"?e(t):e}function hr(e,t){return typeof e=="function"?e(t):e}function o0(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==ag(u,t.options))return!1}else if(!nu(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 u0(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(cl(t.options.mutationKey)!==cl(o))return!1}else if(!nu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function ag(e,t){return((t==null?void 0:t.queryKeyHashFn)||cl)(e)}function cl(e){return JSON.stringify(e,(t,n)=>dp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function nu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>nu(e[n],t[n])):!1}var L2=Object.prototype.hasOwnProperty;function US(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=c0(e)&&c0(t);if(!a&&!(dp(e)&&dp(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],b=t[g];if(x===b){m[g]=x,(a?y<o:L2.call(e,g))&&h++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){m[g]=b;continue}const k=US(x,b,n+1);m[g]=k,k===x&&h++}return o===f&&h===o?e:m}function vd(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 c0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function dp(e){if(!d0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!d0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function d0(e){return Object.prototype.toString.call(e)==="[object Object]"}function U2(e){return new Promise(t=>{el.setTimeout(t,e)})}function fp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?US(e,t):t}function I2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function B2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var lg=Symbol();function IS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===lg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function sg(e,t){return typeof e=="function"?e(...t):!!e}function P2(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 ru=(()=>{let e=()=>D2;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 $2=O2;function F2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=$2;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 Vt=F2(),ws,ca,ks,CS,q2=(CS=class extends Us{constructor(){super();Ne(this,ws,!0);Ne(this,ca);Ne(this,ks);ye(this,ks,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(){U(this,ca)||this.setEventListener(U(this,ks))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,ca))==null||t.call(this),ye(this,ca,void 0))}setEventListener(t){var n;ye(this,ks,t),(n=U(this,ca))==null||n.call(this),ye(this,ca,t(this.setOnline.bind(this)))}setOnline(t){U(this,ws)!==t&&(ye(this,ws,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return U(this,ws)}},ws=new WeakMap,ca=new WeakMap,ks=new WeakMap,CS),xd=new q2;function H2(e){return Math.min(1e3*2**e,3e4)}function BS(e){return(e??"online")==="online"?xd.isOnline():!0}var mp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function PS(e){let t=!1,n=0,a;const l=hp(),o=()=>l.status!=="pending",u=j=>{var E;if(!o()){const _=new mp(j);x(_),(E=e.onCancel)==null||E.call(e,_)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>ig.isFocused()&&(e.networkMode==="always"||xd.isOnline())&&e.canRun(),y=()=>BS(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},x=j=>{o()||(a==null||a(),l.reject(j))},b=()=>new Promise(j=>{var E;a=_=>{(o()||h())&&j(_)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(_){j=Promise.reject(_)}Promise.resolve(j).then(g).catch(_=>{var R;if(o())return;const A=e.retry??(ru.isServer()?0:3),O=e.retryDelay??H2,I=typeof O=="function"?O(n,_):O,B=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,_);if(t||!B){x(_);return}n++,(R=e.onFail)==null||R.call(e,n,_),U2(I).then(()=>h()?void 0:b()).then(()=>{t?x(_):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():b().then(k),l)}}var nl,NS,$S=(NS=class{constructor(){Ne(this,nl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cp(this.gcTime)&&ye(this,nl,el.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ru.isServer()?1/0:300*1e3))}clearGcTimeout(){U(this,nl)&&(el.clearTimeout(U(this,nl)),ye(this,nl,void 0))}},nl=new WeakMap,NS),rl,js,fr,il,Jt,hu,al,Kn,FS,fi,_S,Z2=(_S=class extends $S{constructor(t){super();Ne(this,Kn);Ne(this,rl);Ne(this,js);Ne(this,fr);Ne(this,il);Ne(this,Jt);Ne(this,hu);Ne(this,al);ye(this,al,!1),ye(this,hu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,il,t.client),ye(this,fr,U(this,il).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,rl,h0(this.options)),this.state=t.state??U(this,rl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=U(this,Jt))==null?void 0:t.promise}setOptions(t){if(this.options={...U(this,hu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=h0(this.options);n.data!==void 0&&(this.setState(f0(n.data,n.dataUpdatedAt)),ye(this,rl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,fr).remove(this)}setData(t,n){const a=fp(this.state.data,t,this.options);return Be(this,Kn,fi).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Be(this,Kn,fi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=U(this,Jt))==null?void 0:a.promise;return(l=U(this,Jt))==null||l.cancel(t),n?n.then(xn).catch(xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return U(this,rl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>hr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>va(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:!LS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Jt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Jt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),U(this,fr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(U(this,Jt)&&(U(this,al)||Be(this,Kn,FS).call(this)?U(this,Jt).cancel({revert:!0}):U(this,Jt).cancelRetry()),this.scheduleGc()),U(this,fr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Be(this,Kn,fi).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,x,b,k,j,E,_,A,O;if(this.state.fetchStatus!=="idle"&&((m=U(this,Jt))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Jt))return U(this,Jt).continueRetry(),U(this,Jt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const I=this.observers.find(B=>B.options.queryFn);I&&this.setOptions(I.options)}const a=new AbortController,l=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(ye(this,al,!0),a.signal)})},o=()=>{const I=IS(this.options,n),R=(()=>{const $={client:U(this,il),queryKey:this.queryKey,meta:this.meta};return l($),$})();return ye(this,al,!1),this.options.persister?this.options.persister(I,R,this):I(R)},f=(()=>{const I={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,il),state:this.state,fetchFn:o};return l(I),I})();(h=this.options.behavior)==null||h.onFetch(f,this),ye(this,js,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Be(this,Kn,fi).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ye(this,Jt,PS({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:I=>{I instanceof mp&&I.revert&&this.setState({...U(this,js),fetchStatus:"idle"}),a.abort()},onFail:(I,B)=>{Be(this,Kn,fi).call(this,{type:"failed",failureCount:I,error:B})},onPause:()=>{Be(this,Kn,fi).call(this,{type:"pause"})},onContinue:()=>{Be(this,Kn,fi).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const I=await U(this,Jt).start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(b=(x=U(this,fr).config).onSuccess)==null||b.call(x,I,this),(j=(k=U(this,fr).config).onSettled)==null||j.call(k,I,this.state.error,this),I}catch(I){if(I instanceof mp){if(I.silent)return U(this,Jt).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw Be(this,Kn,fi).call(this,{type:"error",error:I}),(_=(E=U(this,fr).config).onError)==null||_.call(E,I,this),(O=(A=U(this,fr).config).onSettled)==null||O.call(A,this.state.data,I,this),I}finally{this.scheduleGc()}}},rl=new WeakMap,js=new WeakMap,fr=new WeakMap,il=new WeakMap,Jt=new WeakMap,hu=new WeakMap,al=new WeakMap,Kn=new WeakSet,FS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},fi=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,...qS(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...f0(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,js,t.manual?l:void 0),l;case"error":const o=t.error;return{...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),Vt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),U(this,fr).notify({query:this,type:"updated",action:t})})},_S);function qS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:BS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function f0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function h0(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 An,Xe,mu,vn,ll,Es,hi,da,pu,Cs,Ns,sl,ol,fa,_s,st,Ko,pp,gp,yp,vp,xp,bp,Sp,HS,zS,V2=(zS=class extends Us{constructor(t,n){super();Ne(this,st);Ne(this,An);Ne(this,Xe);Ne(this,mu);Ne(this,vn);Ne(this,ll);Ne(this,Es);Ne(this,hi);Ne(this,da);Ne(this,pu);Ne(this,Cs);Ne(this,Ns);Ne(this,sl);Ne(this,ol);Ne(this,fa);Ne(this,_s,new Set);this.options=n,ye(this,An,t),ye(this,da,null),ye(this,hi,hp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,Xe).addObserver(this),m0(U(this,Xe),this.options)?Be(this,st,Ko).call(this):this.updateResult(),Be(this,st,vp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wp(U(this,Xe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wp(U(this,Xe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Be(this,st,xp).call(this),Be(this,st,bp).call(this),U(this,Xe).removeObserver(this)}setOptions(t){const n=this.options,a=U(this,Xe);if(this.options=U(this,An).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hr(this.options.enabled,U(this,Xe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Be(this,st,Sp).call(this),U(this,Xe).setOptions(this.options),n._defaulted&&!vd(this.options,n)&&U(this,An).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,Xe),observer:this});const l=this.hasListeners();l&&p0(U(this,Xe),a,this.options,n)&&Be(this,st,Ko).call(this),this.updateResult(),l&&(U(this,Xe)!==a||hr(this.options.enabled,U(this,Xe))!==hr(n.enabled,U(this,Xe))||va(this.options.staleTime,U(this,Xe))!==va(n.staleTime,U(this,Xe)))&&Be(this,st,pp).call(this);const o=Be(this,st,gp).call(this);l&&(U(this,Xe)!==a||hr(this.options.enabled,U(this,Xe))!==hr(n.enabled,U(this,Xe))||o!==U(this,fa))&&Be(this,st,yp).call(this,o)}getOptimisticResult(t){const n=U(this,An).getQueryCache().build(U(this,An),t),a=this.createResult(n,t);return G2(this,a)&&(ye(this,vn,a),ye(this,Es,this.options),ye(this,ll,U(this,Xe).state)),a}getCurrentResult(){return U(this,vn)}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&&U(this,hi).status==="pending"&&U(this,hi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){U(this,_s).add(t)}getCurrentQuery(){return U(this,Xe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,An).defaultQueryOptions(t),a=U(this,An).getQueryCache().build(U(this,An),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Be(this,st,Ko).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,vn)))}createResult(t,n){var ee;const a=U(this,Xe),l=this.options,o=U(this,vn),u=U(this,ll),f=U(this,Es),h=t!==a?t.state:U(this,mu),{state:y}=t;let g={...y},x=!1,b;if(n._optimisticResults){const q=this.hasListeners(),ie=!q&&m0(t,n),re=q&&p0(t,a,n,l);(ie||re)&&(g={...g,...qS(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;b=g.data;let _=!1;if(n.placeholderData!==void 0&&b===void 0&&E==="pending"){let q;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(q=o.data,_=!0):q=typeof n.placeholderData=="function"?n.placeholderData((ee=U(this,Ns))==null?void 0:ee.state.data,U(this,Ns)):n.placeholderData,q!==void 0&&(E="success",b=fp(o==null?void 0:o.data,q,n),x=!0)}if(n.select&&b!==void 0&&!_)if(o&&b===(u==null?void 0:u.data)&&n.select===U(this,pu))b=U(this,Cs);else try{ye(this,pu,n.select),b=n.select(b),b=fp(o==null?void 0:o.data,b,n),ye(this,Cs,b),ye(this,da,null)}catch(q){ye(this,da,q)}U(this,da)&&(k=U(this,da),b=U(this,Cs),j=Date.now(),E="error");const A=g.fetchStatus==="fetching",O=E==="pending",I=E==="error",B=O&&A,R=b!==void 0,Z={status:E,fetchStatus:g.fetchStatus,isPending:O,isSuccess:E==="success",isError:I,isInitialLoading:B,isLoading:B,data:b,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!O,isLoadingError:I&&!R,isPaused:g.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:I&&R,isStale:og(t,n),refetch:this.refetch,promise:U(this,hi),isEnabled:hr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=Z.data!==void 0,ie=Z.status==="error"&&!q,re=W=>{ie?W.reject(Z.error):q&&W.resolve(Z.data)},pe=()=>{const W=ye(this,hi,Z.promise=hp());re(W)},de=U(this,hi);switch(de.status){case"pending":t.queryHash===a.queryHash&&re(de);break;case"fulfilled":(ie||Z.data!==de.value)&&pe();break;case"rejected":(!ie||Z.error!==de.reason)&&pe();break}}return Z}updateResult(){const t=U(this,vn),n=this.createResult(U(this,Xe),this.options);if(ye(this,ll,U(this,Xe).state),ye(this,Es,this.options),U(this,ll).data!==void 0&&ye(this,Ns,U(this,Xe)),vd(n,t))return;ye(this,vn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!U(this,_s).size)return!0;const u=new Set(o??U(this,_s));return this.options.throwOnError&&u.add("error"),Object.keys(U(this,vn)).some(f=>{const m=f;return U(this,vn)[m]!==t[m]&&u.has(m)})};Be(this,st,HS).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Be(this,st,vp).call(this)}},An=new WeakMap,Xe=new WeakMap,mu=new WeakMap,vn=new WeakMap,ll=new WeakMap,Es=new WeakMap,hi=new WeakMap,da=new WeakMap,pu=new WeakMap,Cs=new WeakMap,Ns=new WeakMap,sl=new WeakMap,ol=new WeakMap,fa=new WeakMap,_s=new WeakMap,st=new WeakSet,Ko=function(t){Be(this,st,Sp).call(this);let n=U(this,Xe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(xn)),n},pp=function(){Be(this,st,xp).call(this);const t=va(this.options.staleTime,U(this,Xe));if(ru.isServer()||U(this,vn).isStale||!cp(t))return;const a=LS(U(this,vn).dataUpdatedAt,t)+1;ye(this,sl,el.setTimeout(()=>{U(this,vn).isStale||this.updateResult()},a))},gp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,Xe)):this.options.refetchInterval)??!1},yp=function(t){Be(this,st,bp).call(this),ye(this,fa,t),!(ru.isServer()||hr(this.options.enabled,U(this,Xe))===!1||!cp(U(this,fa))||U(this,fa)===0)&&ye(this,ol,el.setInterval(()=>{(this.options.refetchIntervalInBackground||ig.isFocused())&&Be(this,st,Ko).call(this)},U(this,fa)))},vp=function(){Be(this,st,pp).call(this),Be(this,st,yp).call(this,Be(this,st,gp).call(this))},xp=function(){U(this,sl)&&(el.clearTimeout(U(this,sl)),ye(this,sl,void 0))},bp=function(){U(this,ol)&&(el.clearInterval(U(this,ol)),ye(this,ol,void 0))},Sp=function(){const t=U(this,An).getQueryCache().build(U(this,An),this.options);if(t===U(this,Xe))return;const n=U(this,Xe);ye(this,Xe,t),ye(this,mu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},HS=function(t){Vt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,vn))}),U(this,An).getQueryCache().notify({query:U(this,Xe),type:"observerResultsUpdated"})})},zS);function Q2(e,t){return hr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function m0(e,t){return Q2(e,t)||e.state.data!==void 0&&wp(e,t,t.refetchOnMount)}function wp(e,t,n){if(hr(t.enabled,e)!==!1&&va(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&og(e,t)}return!1}function p0(e,t,n,a){return(e!==t||hr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&og(e,n)}function og(e,t){return hr(t.enabled,e)!==!1&&e.isStaleByTime(va(t.staleTime,e))}function G2(e,t){return!vd(e.getCurrentResult(),t)}function g0(e){return{onFetch:(t,n)=>{var y,g,x,b,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=((b=t.state.data)==null?void 0:b.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{P2(O,()=>t.signal,()=>j=!0)},_=IS(t.options,t.fetchOptions),A=async(O,I,B)=>{if(j)return Promise.reject();if(I==null&&O.pages.length)return Promise.resolve(O);const $=(()=>{const ie={client:t.client,queryKey:t.queryKey,pageParam:I,direction:B?"backward":"forward",meta:t.options.meta};return E(ie),ie})(),Z=await _($),{maxPages:ee}=t.options,q=B?B2:I2;return{pages:q(O.pages,Z,ee),pageParams:q(O.pageParams,I,ee)}};if(l&&o.length){const O=l==="backward",I=O?K2:y0,B={pages:o,pageParams:u},R=I(a,B);f=await A(B,R,O)}else{const O=e??o.length;do{const I=m===0?u[0]??a.initialPageParam:y0(a,f);if(m>0&&I==null)break;f=await A(f,I),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function y0(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 K2(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 gu,Lr,hn,ul,Ur,aa,AS,Y2=(AS=class extends $S{constructor(t){super();Ne(this,Ur);Ne(this,gu);Ne(this,Lr);Ne(this,hn);Ne(this,ul);ye(this,gu,t.client),this.mutationId=t.mutationId,ye(this,hn,t.mutationCache),ye(this,Lr,[]),this.state=t.state||ZS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,Lr).includes(t)||(U(this,Lr).push(t),this.clearGcTimeout(),U(this,hn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,Lr,U(this,Lr).filter(n=>n!==t)),this.scheduleGc(),U(this,hn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,Lr).length||(this.state.status==="pending"?this.scheduleGc():U(this,hn).remove(this))}continue(){var t;return((t=U(this,ul))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,y,g,x,b,k,j,E,_,A,O,I,B,R,$;const n=()=>{Be(this,Ur,aa).call(this,{type:"continue"})},a={client:U(this,gu),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,ul,PS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(Z,ee)=>{Be(this,Ur,aa).call(this,{type:"failed",failureCount:Z,error:ee})},onPause:()=>{Be(this,Ur,aa).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,hn).canRun(this)}));const l=this.state.status==="pending",o=!U(this,ul).canStart();try{if(l)n();else{Be(this,Ur,aa).call(this,{type:"pending",variables:t,isPaused:o}),U(this,hn).config.onMutate&&await U(this,hn).config.onMutate(t,this,a);const ee=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,a));ee!==this.state.context&&Be(this,Ur,aa).call(this,{type:"pending",context:ee,variables:t,isPaused:o})}const Z=await U(this,ul).start();return await((h=(m=U(this,hn).config).onSuccess)==null?void 0:h.call(m,Z,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,Z,t,this.state.context,a)),await((b=(x=U(this,hn).config).onSettled)==null?void 0:b.call(x,Z,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,Z,null,t,this.state.context,a)),Be(this,Ur,aa).call(this,{type:"success",data:Z}),Z}catch(Z){try{await((_=(E=U(this,hn).config).onError)==null?void 0:_.call(E,Z,t,this.state.context,this,a))}catch(ee){Promise.reject(ee)}try{await((O=(A=this.options).onError)==null?void 0:O.call(A,Z,t,this.state.context,a))}catch(ee){Promise.reject(ee)}try{await((B=(I=U(this,hn).config).onSettled)==null?void 0:B.call(I,void 0,Z,this.state.variables,this.state.context,this,a))}catch(ee){Promise.reject(ee)}try{await(($=(R=this.options).onSettled)==null?void 0:$.call(R,void 0,Z,t,this.state.context,a))}catch(ee){Promise.reject(ee)}throw Be(this,Ur,aa).call(this,{type:"error",error:Z}),Z}finally{U(this,hn).runNext(this)}}},gu=new WeakMap,Lr=new WeakMap,hn=new WeakMap,ul=new WeakMap,Ur=new WeakSet,aa=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),Vt.batch(()=>{U(this,Lr).forEach(a=>{a.onMutationUpdate(t)}),U(this,hn).notify({mutation:this,type:"updated",action:t})})},AS);function ZS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mi,jr,yu,TS,X2=(TS=class extends Us{constructor(t={}){super();Ne(this,mi);Ne(this,jr);Ne(this,yu);this.config=t,ye(this,mi,new Set),ye(this,jr,new Map),ye(this,yu,0)}build(t,n,a){const l=new Y2({client:t,mutationCache:this,mutationId:++Fc(this,yu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){U(this,mi).add(t);const n=qc(t);if(typeof n=="string"){const a=U(this,jr).get(n);a?a.push(t):U(this,jr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(U(this,mi).delete(t)){const n=qc(t);if(typeof n=="string"){const a=U(this,jr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&U(this,jr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=qc(t);if(typeof n=="string"){const a=U(this,jr).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=qc(t);if(typeof n=="string"){const l=(a=U(this,jr).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(){Vt.batch(()=>{U(this,mi).forEach(t=>{this.notify({type:"removed",mutation:t})}),U(this,mi).clear(),U(this,jr).clear()})}getAll(){return Array.from(U(this,mi))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>u0(n,a))}findAll(t={}){return this.getAll().filter(n=>u0(t,n))}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Vt.batch(()=>Promise.all(t.map(n=>n.continue().catch(xn))))}},mi=new WeakMap,jr=new WeakMap,yu=new WeakMap,TS);function qc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var pi,ha,Tn,gi,vi,ud,kp,RS,J2=(RS=class extends Us{constructor(n,a){super();Ne(this,vi);Ne(this,pi);Ne(this,ha);Ne(this,Tn);Ne(this,gi);ye(this,pi,n),this.setOptions(a),this.bindMethods(),Be(this,vi,ud).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var l;const a=this.options;this.options=U(this,pi).defaultMutationOptions(n),vd(this.options,a)||U(this,pi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:U(this,Tn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&cl(a.mutationKey)!==cl(this.options.mutationKey)?this.reset():((l=U(this,Tn))==null?void 0:l.state.status)==="pending"&&U(this,Tn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=U(this,Tn))==null||n.removeObserver(this)}onMutationUpdate(n){Be(this,vi,ud).call(this),Be(this,vi,kp).call(this,n)}getCurrentResult(){return U(this,ha)}reset(){var n;(n=U(this,Tn))==null||n.removeObserver(this),ye(this,Tn,void 0),Be(this,vi,ud).call(this),Be(this,vi,kp).call(this)}mutate(n,a){var l;return ye(this,gi,a),(l=U(this,Tn))==null||l.removeObserver(this),ye(this,Tn,U(this,pi).getMutationCache().build(U(this,pi),this.options)),U(this,Tn).addObserver(this),U(this,Tn).execute(n)}},pi=new WeakMap,ha=new WeakMap,Tn=new WeakMap,gi=new WeakMap,vi=new WeakSet,ud=function(){var a;const n=((a=U(this,Tn))==null?void 0:a.state)??ZS();ye(this,ha,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},kp=function(n){Vt.batch(()=>{var a,l,o,u,f,m,h,y;if(U(this,gi)&&this.hasListeners()){const g=U(this,ha).variables,x=U(this,ha).context,b={client:U(this,pi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=U(this,gi)).onSuccess)==null||l.call(a,n.data,g,x,b)}catch(k){Promise.reject(k)}try{(u=(o=U(this,gi)).onSettled)==null||u.call(o,n.data,null,g,x,b)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=U(this,gi)).onError)==null||m.call(f,n.error,g,x,b)}catch(k){Promise.reject(k)}try{(y=(h=U(this,gi)).onSettled)==null||y.call(h,void 0,n.error,g,x,b)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(U(this,ha))})})},RS),Ir,OS,W2=(OS=class extends Us{constructor(t={}){super();Ne(this,Ir);this.config=t,ye(this,Ir,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??ag(l,n);let u=this.get(o);return u||(u=new Z2({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){U(this,Ir).has(t.queryHash)||(U(this,Ir).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=U(this,Ir).get(t.queryHash);n&&(t.destroy(),n===t&&U(this,Ir).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,Ir).get(t)}getAll(){return[...U(this,Ir).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>o0(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>o0(t,a)):n}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ir=new WeakMap,OS),Ot,ma,pa,zs,As,ga,Ts,Rs,DS,e_=(DS=class{constructor(e={}){Ne(this,Ot);Ne(this,ma);Ne(this,pa);Ne(this,zs);Ne(this,As);Ne(this,ga);Ne(this,Ts);Ne(this,Rs);ye(this,Ot,e.queryCache||new W2),ye(this,ma,e.mutationCache||new X2),ye(this,pa,e.defaultOptions||{}),ye(this,zs,new Map),ye(this,As,new Map),ye(this,ga,0)}mount(){Fc(this,ga)._++,U(this,ga)===1&&(ye(this,Ts,ig.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,Ot).onFocus())})),ye(this,Rs,xd.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,Ot).onOnline())})))}unmount(){var e,t;Fc(this,ga)._--,U(this,ga)===0&&((e=U(this,Ts))==null||e.call(this),ye(this,Ts,void 0),(t=U(this,Rs))==null||t.call(this),ye(this,Rs,void 0))}isFetching(e){return U(this,Ot).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,ma).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,Ot).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=U(this,Ot).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(va(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return U(this,Ot).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=U(this,Ot).get(a.queryHash),o=l==null?void 0:l.state.data,u=M2(t,o);if(u!==void 0)return U(this,Ot).build(this,a).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Vt.batch(()=>U(this,Ot).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,Ot).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=U(this,Ot);Vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,Ot);return Vt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Vt.batch(()=>U(this,Ot).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(xn).catch(xn)}invalidateQueries(e,t={}){return Vt.batch(()=>(U(this,Ot).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=Vt.batch(()=>U(this,Ot).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(xn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(xn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=U(this,Ot).build(this,t);return n.isStaleByTime(va(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xn).catch(xn)}fetchInfiniteQuery(e){return e.behavior=g0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xn).catch(xn)}ensureInfiniteQueryData(e){return e.behavior=g0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xd.isOnline()?U(this,ma).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,Ot)}getMutationCache(){return U(this,ma)}getDefaultOptions(){return U(this,pa)}setDefaultOptions(e){ye(this,pa,e)}setQueryDefaults(e,t){U(this,zs).set(cl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,zs).values()],n={};return t.forEach(a=>{nu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){U(this,As).set(cl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,As).values()],n={};return t.forEach(a=>{nu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...U(this,pa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ag(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===lg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,pa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,Ot).clear(),U(this,ma).clear()}},Ot=new WeakMap,ma=new WeakMap,pa=new WeakMap,zs=new WeakMap,As=new WeakMap,ga=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,DS),VS=S.createContext(void 0),Wn=e=>{const t=S.useContext(VS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},t_=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(VS.Provider,{value:e,children:t})),QS=S.createContext(!1),n_=()=>S.useContext(QS);QS.Provider;function r_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var i_=S.createContext(r_()),a_=()=>S.useContext(i_),l_=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?sg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},s_=e=>{S.useEffect(()=>{e.clearReset()},[e])},o_=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||sg(n,[e.error,a])),u_=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))}},c_=(e,t)=>e.isLoading&&e.isFetching&&!t,d_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,v0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function f_(e,t,n){var x,b,k,j;const a=n_(),l=a_(),o=Wn(),u=o.defaultQueryOptions(e);(b=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||b.call(x,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",u_(u),l_(u,l,f),s_(l);const m=!o.getQueryCache().get(u.queryHash),[h]=S.useState(()=>new t(o,u)),y=h.getOptimisticResult(u),g=!a&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(E=>{const _=g?h.subscribe(Vt.batchCalls(E)):xn;return h.updateResult(),_},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),S.useEffect(()=>{h.setOptions(u)},[u,h]),d_(u,y))throw v0(u,h,l);if(o_({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&&!ru.isServer()&&c_(y,a)){const E=m?v0(u,h,l):f==null?void 0:f.promise;E==null||E.catch(xn).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?y:h.trackResult(y)}function qe(e,t){return f_(e,V2)}function yt(e,t){const n=Wn(),[a]=S.useState(()=>new J2(n,e));S.useEffect(()=>{a.setOptions(e)},[a,e]);const l=S.useSyncExternalStore(S.useCallback(u=>a.subscribe(Vt.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=S.useCallback((u,f)=>{a.mutate(u,f).catch(xn)},[a]);if(l.error&&sg(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 x0="popstate";function b0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function h_(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 jp("",{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:iu(l)}return p_(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function m_(){return Math.random().toString(36).substring(2,10)}function S0(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 jp(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Is(t):t,state:n,key:t&&t.key||a||m_(),unstable_mask:l}}function iu({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 Is(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 p_(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 E=y(),_=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:_})}function x(E,_){f="PUSH";let A=b0(E)?E:jp(j.location,E,_);h=y()+1;let O=S0(A,h),I=j.createHref(A.unstable_mask||A);try{u.pushState(O,"",I)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(I)}o&&m&&m({action:f,location:j.location,delta:1})}function b(E,_){f="REPLACE";let A=b0(E)?E:jp(j.location,E,_);h=y();let O=S0(A,h),I=j.createHref(A.unstable_mask||A);u.replaceState(O,"",I),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return g_(E)}let j={get action(){return f},get location(){return e(l,u)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(x0,g),m=E,()=>{l.removeEventListener(x0,g),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let _=k(E);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:x,replace:b,go(E){return u.go(E)}};return j}function g_(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Et(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:iu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function GS(e,t,n="/"){return y_(e,t,n,!1)}function y_(e,t,n,a){let l=typeof t=="string"?Is(t):t,o=xi(l.pathname||"/",n);if(o==null)return null;let u=KS(e);v_(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=z_(o);f=N_(u[m],h,a)}return f}function KS(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;Et(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=$r([a,y.relativePath]),x=n.concat(y);u.children&&u.children.length>0&&(Et(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),KS(u.children,t,x,g,m)),!(u.path==null&&!u.index)&&t.push({path:g,score:E_(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 YS(u.path))o(u,f,!0,h)}),t}function YS(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=YS(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 v_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:C_(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var x_=/^:[\w-]+$/,b_=3,S_=2,w_=1,k_=10,j_=-2,w0=e=>e==="*";function E_(e,t){let n=e.split("/"),a=n.length;return n.some(w0)&&(a+=j_),t&&(a+=S_),n.filter(l=>!w0(l)).reduce((l,o)=>l+(x_.test(o)?b_:o===""?w_:k_),a)}function C_(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 N_(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=bd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),x=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=bd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),u.push({params:l,pathname:$r([o,g.pathname]),pathnameBase:O_($r([o,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(o=$r([o,g.pathnameBase]))}return u}function bd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=__(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 b=f[x];return g&&!b?h[y]=void 0:h[y]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function __(e,t=!1,n=!0){pr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let 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 z_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function xi(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 A_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function T_(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Is(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=k0(n.substring(1),"/"):o=k0(n,t)):o=t,{pathname:o,search:D_(a),hash:M_(l)}}function k0(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 km(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 R_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ug(e){let t=R_(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Dd(e,t,n,a=!1){let l;typeof e=="string"?l=Is(e):(l={...e},Et(!l.pathname||!l.pathname.includes("?"),km("?","pathname","search",l)),Et(!l.pathname||!l.pathname.includes("#"),km("#","pathname","hash",l)),Et(!l.search||!l.search.includes("#"),km("#","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=T_(l,f),h=u&&u!=="/"&&u.endsWith("/"),y=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var $r=e=>e.join("/").replace(/\/\/+/g,"/"),O_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),D_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,M_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,L_=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 U_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function I_(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var XS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function JS(e,t){let n=e;if(typeof n!="string"||!A_.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(XS)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=xi(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{pr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var WS=["POST","PUT","PATCH","DELETE"];new Set(WS);var B_=["GET",...WS];new Set(B_);var Bs=S.createContext(null);Bs.displayName="DataRouter";var Md=S.createContext(null);Md.displayName="DataRouterState";var P_=S.createContext(!1),ew=S.createContext({isTransitioning:!1});ew.displayName="ViewTransition";var $_=S.createContext(new Map);$_.displayName="Fetchers";var F_=S.createContext(null);F_.displayName="Await";var er=S.createContext(null);er.displayName="Navigation";var vu=S.createContext(null);vu.displayName="Location";var gr=S.createContext({outlet:null,matches:[],isDataRoute:!1});gr.displayName="Route";var cg=S.createContext(null);cg.displayName="RouteError";var tw="REACT_ROUTER_ERROR",q_="REDIRECT",H_="ROUTE_ERROR_RESPONSE";function Z_(e){if(e.startsWith(`${tw}:${q_}:{`))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 V_(e){if(e.startsWith(`${tw}:${H_}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new L_(t.status,t.statusText,t.data)}catch{}}function Q_(e,{relative:t}={}){Et(Ps(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=S.useContext(er),{hash:l,pathname:o,search:u}=xu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:$r([n,o])),a.createHref({pathname:f,search:u,hash:l})}function Ps(){return S.useContext(vu)!=null}function yr(){return Et(Ps(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(vu).location}var nw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rw(e){S.useContext(er).static||S.useLayoutEffect(e)}function qr(){let{isDataRoute:e}=S.useContext(gr);return e?uz():G_()}function G_(){Et(Ps(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(Bs),{basename:t,navigator:n}=S.useContext(er),{matches:a}=S.useContext(gr),{pathname:l}=yr(),o=JSON.stringify(ug(a)),u=S.useRef(!1);return rw(()=>{u.current=!0}),S.useCallback((m,h={})=>{if(pr(u.current,nw),!u.current)return;if(typeof m=="number"){n.go(m);return}let y=Dd(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:$r([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var K_=S.createContext(null);function Y_(e){let t=S.useContext(gr).outlet;return S.useMemo(()=>t&&S.createElement(K_.Provider,{value:e},t),[t,e])}function X_(){let{matches:e}=S.useContext(gr),t=e[e.length-1];return t?t.params:{}}function xu(e,{relative:t}={}){let{matches:n}=S.useContext(gr),{pathname:a}=yr(),l=JSON.stringify(ug(n));return S.useMemo(()=>Dd(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function J_(e,t){return iw(e,t)}function iw(e,t,n){var E;Et(Ps(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=S.useContext(er),{matches:l}=S.useContext(gr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let _=h&&h.path||"";lw(f,!h||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${_}">) 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="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let y=yr(),g;if(t){let _=typeof t=="string"?Is(t):t;Et(m==="/"||((E=_.pathname)==null?void 0:E.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${_.pathname}" was given in the \`location\` prop.`),g=_}else g=y;let x=g.pathname||"/",b=x;if(m!=="/"){let _=m.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(_.length).join("/")}let k=GS(e,{pathname:b});pr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),pr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=rz(k&&k.map(_=>Object.assign({},_,{params:Object.assign({},u,_.params),pathname:$r([m,a.encodeLocation?a.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?m:$r([m,a.encodeLocation?a.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,n);return t&&j?S.createElement(vu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function W_(){let e=oz(),t=U_(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=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:o},"ErrorBoundary")," or"," ",S.createElement("code",{style:o},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:l},n):null,u)}var ez=S.createElement(W_,null),aw=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=V_(e.digest);n&&(e=n)}let t=e!==void 0?S.createElement(gr.Provider,{value:this.props.routeContext},S.createElement(cg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(tz,{error:e},t):t}};aw.contextType=P_;var jm=new WeakMap;function tz({children:e,error:t}){let{basename:n}=S.useContext(er);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=Z_(t.digest);if(a){let l=jm.get(t);if(l)throw l;let o=JS(a.location,n);if(XS&&!jm.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 jm.set(t,u),u}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function nz({routeContext:e,match:t,children:n}){let a=S.useContext(Bs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(gr.Provider,{value:e},n)}function rz(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);Et(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let u=!1,f=-1;if(n&&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:b}=a,k=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!b||b[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,b;m(y,{location:a.location,params:((b=(x=a.matches)==null?void 0:x[0])==null?void 0:b.params)??{},unstable_pattern:I_(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,x)=>{let b,k=!1,j=null,E=null;a&&(b=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||ez,u&&(f<0&&x===0?(lw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===x&&(k=!0,E=g.route.hydrateFallbackElement||null)));let _=t.concat(l.slice(0,x+1)),A=()=>{let O;return b?O=j:k?O=E:g.route.Component?O=S.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=y,S.createElement(nz,{match:g,routeContext:{outlet:y,matches:_,isDataRoute:a!=null},children:O})};return a&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?S.createElement(aw,{location:a.location,revalidation:a.revalidation,component:j,error:b,children:A(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:h}):A()},null)}function dg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function iz(e){let t=S.useContext(Bs);return Et(t,dg(e)),t}function az(e){let t=S.useContext(Md);return Et(t,dg(e)),t}function lz(e){let t=S.useContext(gr);return Et(t,dg(e)),t}function fg(e){let t=lz(e),n=t.matches[t.matches.length-1];return Et(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sz(){return fg("useRouteId")}function oz(){var a;let e=S.useContext(cg),t=az("useRouteError"),n=fg("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function uz(){let{router:e}=iz("useNavigate"),t=fg("useNavigate"),n=S.useRef(!1);return rw(()=>{n.current=!0}),S.useCallback(async(l,o={})=>{pr(n.current,nw),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var j0={};function lw(e,t,n){!t&&!j0[e]&&(j0[e]=!0,pr(!1,n))}S.memo(cz);function cz({routes:e,future:t,state:n,isStatic:a,onError:l}){return iw(e,void 0,{state:n,isStatic:a,onError:l})}function hg({to:e,replace:t,state:n,relative:a}){Et(Ps(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=S.useContext(er);pr(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=S.useContext(gr),{pathname:u}=yr(),f=qr(),m=Dd(e,ug(o),u,a==="path"),h=JSON.stringify(m);return S.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function Ep(e){return Y_(e.context)}function Dr(e){Et(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function dz({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){Et(!Ps(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=S.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=Is(n));let{pathname:h="/",search:y="",hash:g="",state:x=null,key:b="default",unstable_mask:k}=n,j=S.useMemo(()=>{let E=xi(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:x,key:b,unstable_mask:k},navigationType:a}},[f,h,y,g,x,b,a,k]);return pr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:S.createElement(er.Provider,{value:m},S.createElement(vu.Provider,{children:t,value:j}))}function fz({children:e,location:t}){return J_(Cp(e),t)}function Cp(e,t=[]){let n=[];return S.Children.forEach(e,(a,l)=>{if(!S.isValidElement(a))return;let o=[...t,l];if(a.type===S.Fragment){n.push.apply(n,Cp(a.props.children,o));return}Et(a.type===Dr,`[${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>`),Et(!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=Cp(a.props.children,o)),n.push(u)}),n}var cd="get",dd="application/x-www-form-urlencoded";function Ld(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function hz(e){return Ld(e)&&e.tagName.toLowerCase()==="button"}function mz(e){return Ld(e)&&e.tagName.toLowerCase()==="form"}function pz(e){return Ld(e)&&e.tagName.toLowerCase()==="input"}function gz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yz(e,t){return e.button===0&&(!t||t==="_self")&&!gz(e)}function Np(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 vz(e,t){let n=Np(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var Hc=null;function xz(){if(Hc===null)try{new FormData(document.createElement("form"),0),Hc=!1}catch{Hc=!0}return Hc}var bz=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Em(e){return e!=null&&!bz.has(e)?(pr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dd}"`),null):e}function Sz(e,t){let n,a,l,o,u;if(mz(e)){let f=e.getAttribute("action");a=f?xi(f,t):null,n=e.getAttribute("method")||cd,l=Em(e.getAttribute("enctype"))||dd,o=new FormData(e)}else if(hz(e)||pz(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?xi(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||cd,l=Em(e.getAttribute("formenctype"))||Em(f.getAttribute("enctype"))||dd,o=new FormData(f,e),!xz()){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(Ld(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=cd,a=null,l=dd,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 mg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wz(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&&xi(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function kz(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 jz(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 Ez(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await kz(o,n);return u.links?u.links():[]}return[]}));return zz(a.flat(1).filter(jz).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function E0(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 Cz(e,t,{includeHydrateFallback:n}={}){return Nz(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 Nz(e){return[...new Set(e)]}function _z(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function zz(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(_z(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function sw(){let e=S.useContext(Bs);return mg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Az(){let e=S.useContext(Md);return mg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pg=S.createContext(void 0);pg.displayName="FrameworkContext";function ow(){let e=S.useContext(pg);return mg(e,"You must render this element inside a <HydratedRouter> element"),e}function Tz(e,t){let n=S.useContext(pg),[a,l]=S.useState(!1),[o,u]=S.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,x=S.useRef(null);S.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=_=>{_.forEach(A=>{u(A.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),S.useEffect(()=>{if(a){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[a]);let b=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,x,{}]:[o,x,{onFocus:$o(f,b),onBlur:$o(m,k),onMouseEnter:$o(h,b),onMouseLeave:$o(y,k),onTouchStart:$o(g,b)}]:[!1,x,{}]}function $o(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Rz({page:e,...t}){let{router:n}=sw(),a=S.useMemo(()=>GS(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?S.createElement(Dz,{page:e,matches:a,...t}):null}function Oz(e){let{manifest:t,routeModules:n}=ow(),[a,l]=S.useState([]);return S.useEffect(()=>{let o=!1;return Ez(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),a}function Dz({page:e,matches:t,...n}){let a=yr(),{future:l,manifest:o,routeModules:u}=ow(),{basename:f}=sw(),{loaderData:m,matches:h}=Az(),y=S.useMemo(()=>E0(e,t,h,o,a,"data"),[e,t,h,o,a]),g=S.useMemo(()=>E0(e,t,h,o,a,"assets"),[e,t,h,o,a]),x=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,E=!1;if(t.forEach(A=>{var I;let O=o.routes[A.route.id];!O||!O.hasLoader||(!y.some(B=>B.route.id===A.route.id)&&A.route.id in m&&((I=u[A.route.id])!=null&&I.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(A.route.id))}),j.size===0)return[];let _=wz(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&_.searchParams.set("_routes",t.filter(A=>j.has(A.route.id)).map(A=>A.route.id).join(",")),[_.pathname+_.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,u]),b=S.useMemo(()=>Cz(g,o),[g,o]),k=Oz(g);return S.createElement(S.Fragment,null,x.map(j=>S.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),b.map(j=>S.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>S.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function Mz(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Lz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Lz&&(window.__reactRouterVersion="7.13.1")}catch{}function Uz({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=S.useRef();l.current==null&&(l.current=h_({window:a,v5Compat:!0}));let o=l.current,[u,f]=S.useState({action:o.action,location:o.location}),m=S.useCallback(h=>{n===!1?f(h):S.startTransition(()=>f(h))},[n]);return S.useLayoutEffect(()=>o.listen(m),[o,m]),S.createElement(dz,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var uw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cw=S.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:b,...k},j){let{basename:E,navigator:_,unstable_useTransitions:A}=S.useContext(er),O=typeof y=="string"&&uw.test(y),I=JS(y,E);y=I.to;let B=Q_(y,{relative:l}),R=yr(),$=null;if(f){let W=Dd(f,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);E!=="/"&&(W.pathname=W.pathname==="/"?E:$r([E,W.pathname])),$=_.createHref(W)}let[Z,ee,q]=Tz(a,k),ie=Pz(y,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:x,unstable_defaultShouldRevalidate:b,unstable_useTransitions:A});function re(W){t&&t(W),W.defaultPrevented||ie(W)}let pe=!(I.isExternal||o),de=S.createElement("a",{...k,...q,href:(pe?$:void 0)||I.absoluteURL||B,onClick:pe?re:t,ref:Mz(j,ee),target:h,"data-discover":!O&&n==="render"?"true":void 0});return Z&&!O?S.createElement(S.Fragment,null,de,S.createElement(Rz,{page:B})):de});cw.displayName="Link";var dw=S.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=xu(u,{relative:h.relative}),x=yr(),b=S.useContext(Md),{navigator:k,basename:j}=S.useContext(er),E=b!=null&&Zz(g)&&f===!0,_=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,A=x.pathname,O=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(A=A.toLowerCase(),O=O?O.toLowerCase():null,_=_.toLowerCase()),O&&j&&(O=xi(O,j)||O);const I=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let B=A===_||!l&&A.startsWith(_)&&A.charAt(I)==="/",R=O!=null&&(O===_||!l&&O.startsWith(_)&&O.charAt(_.length)==="/"),$={isActive:B,isPending:R,isTransitioning:E},Z=B?t:void 0,ee;typeof a=="function"?ee=a($):ee=[a,B?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let q=typeof o=="function"?o($):o;return S.createElement(cw,{...h,"aria-current":Z,className:ee,ref:y,style:q,to:u,viewTransition:f},typeof m=="function"?m($):m)});dw.displayName="NavLink";var Iz=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:u=cd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x,...b},k)=>{let{unstable_useTransitions:j}=S.useContext(er),E=qz(),_=Hz(f,{relative:h}),A=u.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&uw.test(f),I=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let R=B.nativeEvent.submitter,$=(R==null?void 0:R.getAttribute("formmethod"))||u,Z=()=>E(R||B.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x});j&&n!==!1?S.startTransition(()=>Z()):Z()};return S.createElement("form",{ref:k,method:A,action:_,onSubmit:a?m:I,...b,"data-discover":!O&&e==="render"?"true":void 0})});Iz.displayName="Form";function Bz(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fw(e){let t=S.useContext(Bs);return Et(t,Bz(e)),t}function Pz(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=qr(),g=yr(),x=xu(e,{relative:u});return S.useCallback(b=>{if(yz(b,t)){b.preventDefault();let k=n!==void 0?n:iu(g)===iu(x),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?S.startTransition(()=>j()):j()}},[g,y,x,n,a,l,t,e,o,u,f,m,h])}function gg(e){pr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=S.useRef(Np(e)),n=S.useRef(!1),a=yr(),l=S.useMemo(()=>vz(a.search,n.current?null:t.current),[a.search]),o=qr(),u=S.useCallback((f,m)=>{const h=Np(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var $z=0,Fz=()=>`__${String(++$z)}__`;function qz(){let{router:e}=fw("useSubmit"),{basename:t}=S.useContext(er),n=sz(),a=e.fetch,l=e.navigate;return S.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=Sz(o,t);if(u.navigate===!1){let x=u.fetcherKey||Fz();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 Hz(e,{relative:t}={}){let{basename:n}=S.useContext(er),a=S.useContext(gr);Et(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...xu(e||".",{relative:t})},u=yr();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:$r([n,o.pathname])),iu(o)}function Zz(e,{relative:t}={}){let n=S.useContext(ew);Et(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=fw("useViewTransitionState"),l=xu(e,{relative:t});if(!n.isTransitioning)return!1;let o=xi(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=xi(n.nextLocation.pathname,a)||n.nextLocation.pathname;return bd(l.pathname,u)!=null||bd(l.pathname,o)!=null}const Vz="/api/v1";async function Qz(e,t){const n=await fetch(`${Vz}/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 hw="/api/v1",yg="first-tree-hub:tokens";function vg(){const e=localStorage.getItem(yg);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function mw(e){localStorage.setItem(yg,JSON.stringify(e))}function pw(){localStorage.removeItem(yg)}class Ud extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let Fo=null;async function Gz(e){return Fo||(Fo=(async()=>{try{const t=await fetch(`${hw}/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 mw(a),a}catch{return null}finally{Fo=null}})(),Fo)}async function Zc(e,t){const{method:n="GET",body:a}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${hw}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=vg();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await Gz(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(pw(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.text();let m,h;try{const y=JSON.parse(f);m=y.error??f,Array.isArray(y.details)&&(h=y.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=f}throw new Ud(u.status,m,h)}if(u.status!==204)return await u.json()}const De={get:e=>Zc(e),post:(e,t)=>Zc(e,{method:"POST",body:t}),patch:(e,t)=>Zc(e,{method:"PATCH",body:t}),delete:e=>Zc(e,{method:"DELETE"})},gw=S.createContext(null);function Kz({children:e}){const[t,n]=S.useState(()=>!!vg()),[a,l]=S.useState(null),[o,u]=S.useState(null),[f,m]=S.useState(null),h=S.useCallback(()=>{pw(),n(!1),l(null),u(null),m(null)},[]),y=S.useCallback(async()=>{try{const x=await De.get("/me");l(x.member.role),u(x.member.id),m(x.member.agentId)}catch{}},[]),g=S.useCallback(async(x,b)=>{const k=await Qz(x,b);mw({accessToken:k.accessToken,refreshToken:k.refreshToken}),n(!0),await De.get("/me").then(j=>{l(j.member.role),u(j.member.id),m(j.member.agentId)}).catch(()=>{})},[]);return S.useEffect(()=>{t&&!a&&y()},[t,a,y]),S.useEffect(()=>{const x=()=>h();return window.addEventListener("auth:logout",x),()=>window.removeEventListener("auth:logout",x)},[h]),d.jsx(gw.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,login:g,logout:h},children:e})}function ji(){const e=S.useContext(gw);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function Yz(){const{isAuthenticated:e}=ji();return e?d.jsx(Ep,{}):d.jsx(hg,{to:"/login",replace:!0})}/**
|
|
61
|
-
* @license lucide-react v0.577.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const yw=(...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 Xz=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 Jz=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 C0=e=>{const t=Jz(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 Wz={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 eA=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 tA=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:u,...f},m)=>S.createElement("svg",{ref:m,...Wz,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:yw("lucide",l),...!o&&!eA(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,y])=>S.createElement(h,y)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
-
* @license lucide-react v0.577.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const ot=(e,t)=>{const n=S.forwardRef(({className:a,...l},o)=>S.createElement(tA,{ref:o,iconNode:t,className:yw(`lucide-${Xz(C0(e))}`,`lucide-${e}`,a),...l}));return n.displayName=C0(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 nA=[["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"}]],rA=ot("bell",nA);/**
|
|
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 iA=[["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"}]],aA=ot("bot",iA);/**
|
|
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 lA=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],sA=ot("cable",lA);/**
|
|
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 oA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Id=ot("check",oA);/**
|
|
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 uA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cA=ot("chevron-down",uA);/**
|
|
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 dA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],fA=ot("chevron-right",dA);/**
|
|
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 hA=[["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"}]],xg=ot("copy",hA);/**
|
|
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 mA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],pA=ot("ellipsis",mA);/**
|
|
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 gA=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],yA=ot("funnel",gA);/**
|
|
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 vA=[["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"}]],xA=ot("layout-dashboard",vA);/**
|
|
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 bA=[["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"}]],_p=ot("link-2",bA);/**
|
|
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 SA=[["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"}]],wA=ot("lock",SA);/**
|
|
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 kA=[["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"}]],jA=ot("log-out",kA);/**
|
|
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 EA=[["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"}]],vw=ot("message-square",EA);/**
|
|
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 CA=[["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"}]],NA=ot("moon",CA);/**
|
|
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 _A=[["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"}]],zA=ot("paperclip",_A);/**
|
|
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 AA=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],TA=ot("pause",AA);/**
|
|
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 RA=[["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"}]],Bd=ot("pencil",RA);/**
|
|
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 OA=[["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"}]],DA=ot("play",OA);/**
|
|
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 MA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],gl=ot("plus",MA);/**
|
|
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 LA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pd=ot("search",LA);/**
|
|
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 UA=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],IA=ot("send",UA);/**
|
|
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 BA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],PA=ot("square",BA);/**
|
|
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 $A=[["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"}]],FA=ot("sun",$A);/**
|
|
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 qA=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],HA=ot("terminal",qA);/**
|
|
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 ZA=[["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"}]],au=ot("trash-2",ZA);/**
|
|
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 VA=[["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"}]],QA=ot("triangle-alert",VA);/**
|
|
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 GA=[["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"}]],KA=ot("undo-2",GA);/**
|
|
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 YA=[["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"}]],XA=ot("unplug",YA);/**
|
|
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 JA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zp=ot("x",JA);function xw(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=xw(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function bw(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=xw(e))&&(a&&(a+=" "),a+=t);return a}const WA=(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},eT=(e,t)=>({classGroupId:e,validator:t}),Sw=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Sd="-",N0=[],tT="arbitrary..",nT=e=>{const t=iT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return rT(u);const f=u.split(Sd),m=f[0]===""&&f.length>1?1:0;return ww(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],h=n[u];return m?h?WA(h,m):m:h||N0}return n[u]||N0}}},ww=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=ww(e,t+1,o);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(Sd):e.slice(t).join(Sd),m=u.length;for(let h=0;h<m;h++){const y=u[h];if(y.validator(f))return y.classGroupId}},rT=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?tT+a:void 0})(),iT=e=>{const{theme:t,classGroups:n}=e;return aT(n,t)},aT=(e,t)=>{const n=Sw();for(const a in e){const l=e[a];bg(l,n,a,t)}return n},bg=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];lT(u,t,n,a)}},lT=(e,t,n,a)=>{if(typeof e=="string"){sT(e,t,n);return}if(typeof e=="function"){oT(e,t,n,a);return}uT(e,t,n,a)},sT=(e,t,n)=>{const a=e===""?t:kw(t,e);a.classGroupId=n},oT=(e,t,n,a)=>{if(cT(e)){bg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(eT(n,e))},uT=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];bg(m,kw(t,f),n,a)}},kw=(e,t)=>{let n=e;const a=t.split(Sd),l=a.length;for(let o=0;o<l;o++){const u=a[o];let f=n.nextPart.get(u);f||(f=Sw(),n.nextPart.set(u,f)),n=f}return n},cT=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dT=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)}}},Ap="!",_0=":",fT=[],z0=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),hT=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 E=l[j];if(u===0&&f===0){if(E===_0){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let x=g,b=!1;g.endsWith(Ap)?(x=g.slice(0,-1),b=!0):g.startsWith(Ap)&&(x=g.slice(1),b=!0);const k=h&&h>m?h-m:void 0;return z0(o,b,x,k)};if(t){const l=t+_0,o=a;a=u=>u.startsWith(l)?o(u.slice(l.length)):z0(fT,!1,u,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},mT=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}},pT=e=>({cache:dT(e.cacheSize),parseClassName:hT(e),sortModifiers:mT(e),...nT(e)}),gT=/\s+/,yT=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(gT);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:x,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let E=!!j,_=a(E?k.substring(0,j):k);if(!_){if(!E){m=y+(m.length>0?" "+m:m);continue}if(_=a(k),!_){m=y+(m.length>0?" "+m:m);continue}E=!1}const A=x.length===0?"":x.length===1?x[0]:o(x).join(":"),O=b?A+Ap:A,I=O+_;if(u.indexOf(I)>-1)continue;u.push(I);const B=l(_,E);for(let R=0;R<B.length;++R){const $=B[R];u.push(O+$)}m=y+(m.length>0?" "+m:m)}return m},vT=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=jw(n))&&(l&&(l+=" "),l+=a);return l},jw=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=jw(e[a]))&&(n&&(n+=" "),n+=t);return n},xT=(e,...t)=>{let n,a,l,o;const u=m=>{const h=t.reduce((y,g)=>g(y),e());return n=pT(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=yT(m,n);return l(m,y),y};return o=u,(...m)=>o(vT(...m))},bT=[],Zt=e=>{const t=n=>n[e]||bT;return t.isThemeGetter=!0,t},Ew=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ST=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kT=/\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$/,jT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ET=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=e=>ST.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),ra=e=>!!e&&Number.isInteger(Number(e)),Cm=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),di=e=>wT.test(e),Nw=()=>!0,NT=e=>kT.test(e)&&!jT.test(e),Sg=()=>!1,_T=e=>ET.test(e),zT=e=>CT.test(e),AT=e=>!we(e)&&!ke(e),TT=e=>ja(e,Aw,Sg),we=e=>Ew.test(e),Ja=e=>ja(e,Tw,NT),A0=e=>ja(e,BT,Fe),RT=e=>ja(e,Ow,Nw),OT=e=>ja(e,Rw,Sg),T0=e=>ja(e,_w,Sg),DT=e=>ja(e,zw,zT),Vc=e=>ja(e,Dw,_T),ke=e=>Cw.test(e),qo=e=>yl(e,Tw),MT=e=>yl(e,Rw),R0=e=>yl(e,_w),LT=e=>yl(e,Aw),UT=e=>yl(e,zw),Qc=e=>yl(e,Dw,!0),IT=e=>yl(e,Ow,!0),ja=(e,t,n)=>{const a=Ew.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},yl=(e,t,n=!1)=>{const a=Cw.exec(e);return a?a[1]?t(a[1]):n:!1},_w=e=>e==="position"||e==="percentage",zw=e=>e==="image"||e==="url",Aw=e=>e==="length"||e==="size"||e==="bg-size",Tw=e=>e==="length",BT=e=>e==="number",Rw=e=>e==="family-name",Ow=e=>e==="number"||e==="weight",Dw=e=>e==="shadow",PT=()=>{const e=Zt("color"),t=Zt("font"),n=Zt("text"),a=Zt("font-weight"),l=Zt("tracking"),o=Zt("leading"),u=Zt("breakpoint"),f=Zt("container"),m=Zt("spacing"),h=Zt("radius"),y=Zt("shadow"),g=Zt("inset-shadow"),x=Zt("text-shadow"),b=Zt("drop-shadow"),k=Zt("blur"),j=Zt("perspective"),E=Zt("aspect"),_=Zt("ease"),A=Zt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...I(),ke,we],R=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],Z=()=>[ke,we,m],ee=()=>[na,"full","auto",...Z()],q=()=>[ra,"none","subgrid",ke,we],ie=()=>["auto",{span:["full",ra,ke,we]},ra,ke,we],re=()=>[ra,"auto",ke,we],pe=()=>["auto","min","max","fr",ke,we],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...Z()],V=()=>[na,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],ce=()=>[na,"screen","full","dvw","lvw","svw","min","max","fit",...Z()],xe=()=>[na,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Z()],T=()=>[e,ke,we],L=()=>[...I(),R0,T0,{position:[ke,we]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",LT,TT,{size:[ke,we]}],J=()=>[Cm,qo,Ja],Y=()=>["","none","full",h,ke,we],ue=()=>["",Fe,qo,Ja],ge=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[Fe,Cm,R0,T0],Nt=()=>["","none",k,ke,we],en=()=>["none",Fe,ke,we],Bn=()=>["none",Fe,ke,we],tr=()=>[Fe,ke,we],tn=()=>[na,"full",...Z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[di],breakpoint:[di],color:[Nw],container:[di],"drop-shadow":[di],ease:["in","out","in-out"],font:[AT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[di],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[di],shadow:[di],spacing:["px",Fe],text:[di],"text-shadow":[di],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",na,we,ke,E]}],container:["container"],columns:[{columns:[Fe,we,ke,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:B()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ee()}],"inset-x":[{"inset-x":ee()}],"inset-y":[{"inset-y":ee()}],start:[{"inset-s":ee(),start:ee()}],end:[{"inset-e":ee(),end:ee()}],"inset-bs":[{"inset-bs":ee()}],"inset-be":[{"inset-be":ee()}],top:[{top:ee()}],right:[{right:ee()}],bottom:[{bottom:ee()}],left:[{left:ee()}],visibility:["visible","invisible","collapse"],z:[{z:[ra,"auto",ke,we]}],basis:[{basis:[na,"full","auto",f,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,na,"auto","initial","none",we]}],grow:[{grow:["",Fe,ke,we]}],shrink:[{shrink:["",Fe,ke,we]}],order:[{order:[ra,"first","last","none",ke,we]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pbs:[{pbs:Z()}],pbe:[{pbe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...ce()]}],"min-inline-size":[{"min-inline":["auto",...ce()]}],"max-inline-size":[{"max-inline":["none",...ce()]}],"block-size":[{block:["auto",...xe()]}],"min-block-size":[{"min-block":["auto",...xe()]}],"max-block-size":[{"max-block":["none",...xe()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,qo,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,IT,RT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cm,we]}],"font-family":[{font:[MT,OT,t]}],"font-features":[{"font-features":[we]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,ke,we]}],"line-clamp":[{"line-clamp":[Fe,"none",ke,A0]}],leading:[{leading:[o,...Z()]}],"list-image":[{"list-image":["none",ke,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",ke,Ja]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Fe,"auto",ke,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ra,ke,we],radial:["",ke,we],conic:[ra,ke,we]},UT,DT]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,ke,we]}],"outline-w":[{outline:["",Fe,qo,Ja]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",y,Qc,Vc]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",g,Qc,Vc]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Fe,Ja]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",x,Qc,Vc]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Fe,ke,we]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[ke,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,we]}],filter:[{filter:["","none",ke,we]}],blur:[{blur:Nt()}],brightness:[{brightness:[Fe,ke,we]}],contrast:[{contrast:[Fe,ke,we]}],"drop-shadow":[{"drop-shadow":["","none",b,Qc,Vc]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Fe,ke,we]}],"hue-rotate":[{"hue-rotate":[Fe,ke,we]}],invert:[{invert:["",Fe,ke,we]}],saturate:[{saturate:[Fe,ke,we]}],sepia:[{sepia:["",Fe,ke,we]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,we]}],"backdrop-blur":[{"backdrop-blur":Nt()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,ke,we]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,ke,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,ke,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,ke,we]}],"backdrop-invert":[{"backdrop-invert":["",Fe,ke,we]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,ke,we]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,ke,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,ke,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",ke,we]}],ease:[{ease:["linear","initial",_,ke,we]}],delay:[{delay:[Fe,ke,we]}],animate:[{animate:["none",A,ke,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,ke,we]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:en()}],"rotate-x":[{"rotate-x":en()}],"rotate-y":[{"rotate-y":en()}],"rotate-z":[{"rotate-z":en()}],scale:[{scale:Bn()}],"scale-x":[{"scale-x":Bn()}],"scale-y":[{"scale-y":Bn()}],"scale-z":[{"scale-z":Bn()}],"scale-3d":["scale-3d"],skew:[{skew:tr()}],"skew-x":[{"skew-x":tr()}],"skew-y":[{"skew-y":tr()}],transform:[{transform:[ke,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tn()}],"translate-x":[{"translate-x":tn()}],"translate-y":[{"translate-y":tn()}],"translate-z":[{"translate-z":tn()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mbs":[{"scroll-mbs":Z()}],"scroll-mbe":[{"scroll-mbe":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pbs":[{"scroll-pbs":Z()}],"scroll-pbe":[{"scroll-pbe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,we]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Fe,qo,Ja,A0]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},$T=xT(PT);function Te(...e){return $T(bw(e))}function bi(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 FT(e){return De.delete(`/clients/${encodeURIComponent(e)}`)}function bu(){return De.get("/admin/agents/activity")}function $d(){return De.get("/clients")}function qT(e){return De.post(`/clients/${e}/disconnect`)}function Mw(){return De.post("/connect-tokens")}const Lw=(e,t)=>["session",e,t],Tp=e=>["agent-sessions",e];function HT(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 ZT(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 VT(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function $s(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 De.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function QT(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 De.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function GT(e,t){return De.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function KT(e,t){return De.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var O0=1,YT=.9,XT=.8,JT=.17,Nm=.1,_m=.999,WT=.9999,eR=.99,tR=/[\\\/_+.#"@\[\(\{&]/,nR=/[\\\/_+.#"@\[\(\{&]/g,rR=/[\s-]/,Uw=/[\s-]/g;function Rp(e,t,n,a,l,o,u){if(o===t.length)return l===e.length?O0:eR;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,b,k;h>=0;)g=Rp(e,t,n,a,h+1,o+1,u),g>y&&(h===l?g*=O0:tR.test(e.charAt(h-1))?(g*=XT,b=e.slice(l,h-1).match(nR),b&&l>0&&(g*=Math.pow(_m,b.length))):rR.test(e.charAt(h-1))?(g*=YT,k=e.slice(l,h-1).match(Uw),k&&l>0&&(g*=Math.pow(_m,k.length))):(g*=JT,l>0&&(g*=Math.pow(_m,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=WT)),(g<Nm&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(x=Rp(e,t,n,a,h+1,o+2,u),x*Nm>g&&(g=x*Nm)),g>y&&(y=g),h=n.indexOf(m,h+1);return u[f]=y,y}function D0(e){return e.toLowerCase().replace(Uw," ")}function iR(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Rp(e,t,D0(e),D0(t),0,0,{})}function xa(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 M0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ba(...e){return t=>{let n=!1;const a=e.map(l=>{const o=M0(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():M0(e[l],null)}}}}function vl(...e){return S.useCallback(ba(...e),e)}function aR(e,t){const n=S.createContext(t),a=o=>{const{children:u,...f}=o,m=S.useMemo(()=>f,Object.values(f));return d.jsx(n.Provider,{value:m,children:u})};a.displayName=e+"Provider";function l(o){const u=S.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function lR(e,t=[]){let n=[];function a(o,u){const f=S.createContext(u),m=n.length;n=[...n,u];const h=g=>{var _;const{scope:x,children:b,...k}=g,j=((_=x==null?void 0:x[e])==null?void 0:_[m])||f,E=S.useMemo(()=>k,Object.values(k));return d.jsx(j.Provider,{value:E,children:b})};h.displayName=o+"Provider";function y(g,x){var j;const b=((j=x==null?void 0:x[e])==null?void 0:j[m])||f,k=S.useContext(b);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(u=>S.createContext(u));return function(f){const m=(f==null?void 0:f[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,sR(l,...t)]}function sR(...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 S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var lu=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},oR=rg[" useId ".trim().toString()]||(()=>{}),uR=0;function yi(e){const[t,n]=S.useState(oR());return lu(()=>{n(a=>a??String(uR++))},[e]),t?`radix-${t}`:""}var cR=rg[" useInsertionEffect ".trim().toString()]||lu;function dR({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,u]=fR({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${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=S.useCallback(y=>{var g;if(f){const x=hR(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 fR({defaultProp:e,onChange:t}){const[n,a]=S.useState(e),l=S.useRef(n),o=S.useRef(t);return cR(()=>{o.current=t},[t]),S.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,a,o]}function hR(e){return typeof e=="function"}var Iw=MS();const mR=Od(Iw);function Bw(e){const t=pR(e),n=S.forwardRef((a,l)=>{const{children:o,...u}=a,f=S.Children.toArray(o),m=f.find(yR);if(m){const h=m.props.children,y=f.map(g=>g===m?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:g);return d.jsx(t,{...u,ref:l,children:S.isValidElement(h)?S.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function pR(e){const t=S.forwardRef((n,a)=>{const{children:l,...o}=n;if(S.isValidElement(l)){const u=xR(l),f=vR(o,l.props);return l.type!==S.Fragment&&(f.ref=a?ba(a,u):u),S.cloneElement(l,f)}return S.Children.count(l)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gR=Symbol("radix.slottable");function yR(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gR}function vR(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 xR(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 bR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ei=bR.reduce((e,t)=>{const n=Bw(`Primitive.${t}`),a=S.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function SR(e,t){e&&Iw.flushSync(()=>e.dispatchEvent(t))}function su(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function wR(e,t=globalThis==null?void 0:globalThis.document){const n=su(e);S.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 kR="DismissableLayer",Op="dismissableLayer.update",jR="dismissableLayer.pointerDownOutside",ER="dismissableLayer.focusOutside",L0,Pw=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$w=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=S.useContext(Pw),[y,g]=S.useState(null),x=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=S.useState({}),k=vl(t,$=>g($)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),_=j.indexOf(E),A=y?j.indexOf(y):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,I=A>=_,B=_R($=>{const Z=$.target,ee=[...h.branches].some(q=>q.contains(Z));!I||ee||(l==null||l($),u==null||u($),$.defaultPrevented||f==null||f())},x),R=zR($=>{const Z=$.target;[...h.branches].some(q=>q.contains(Z))||(o==null||o($),u==null||u($),$.defaultPrevented||f==null||f())},x);return wR($=>{A===h.layers.size-1&&(a==null||a($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},x),S.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(L0=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),U0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=L0)}},[y,x,n,h]),S.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),U0())},[y,h]),S.useEffect(()=>{const $=()=>b({});return document.addEventListener(Op,$),()=>document.removeEventListener(Op,$)},[]),d.jsx(Ei.div,{...m,ref:k,style:{pointerEvents:O?I?"auto":"none":void 0,...e.style},onFocusCapture:xa(e.onFocusCapture,R.onFocusCapture),onBlurCapture:xa(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:xa(e.onPointerDownCapture,B.onPointerDownCapture)})});$w.displayName=kR;var CR="DismissableLayerBranch",NR=S.forwardRef((e,t)=>{const n=S.useContext(Pw),a=S.useRef(null),l=vl(t,a);return S.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(Ei.div,{...e,ref:l})});NR.displayName=CR;function _R(e,t=globalThis==null?void 0:globalThis.document){const n=su(e),a=S.useRef(!1),l=S.useRef(()=>{});return S.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){Fw(jR,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 zR(e,t=globalThis==null?void 0:globalThis.document){const n=su(e),a=S.useRef(!1);return S.useEffect(()=>{const l=o=>{o.target&&!a.current&&Fw(ER,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 U0(){const e=new CustomEvent(Op);document.dispatchEvent(e)}function Fw(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?SR(l,o):l.dispatchEvent(o)}var zm="focusScope.autoFocusOnMount",Am="focusScope.autoFocusOnUnmount",I0={bubbles:!1,cancelable:!0},AR="FocusScope",qw=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=S.useState(null),h=su(l),y=su(o),g=S.useRef(null),x=vl(t,j=>m(j)),b=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(a){let j=function(O){if(b.paused||!f)return;const I=O.target;f.contains(I)?g.current=I:la(g.current,{select:!0})},E=function(O){if(b.paused||!f)return;const I=O.relatedTarget;I!==null&&(f.contains(I)||la(g.current,{select:!0}))},_=function(O){if(document.activeElement===document.body)for(const B of O)B.removedNodes.length>0&&la(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const A=new MutationObserver(_);return f&&A.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),A.disconnect()}}},[a,f,b.paused]),S.useEffect(()=>{if(f){P0.add(b);const j=document.activeElement;if(!f.contains(j)){const _=new CustomEvent(zm,I0);f.addEventListener(zm,h),f.dispatchEvent(_),_.defaultPrevented||(TR(LR(Hw(f)),{select:!0}),document.activeElement===j&&la(f))}return()=>{f.removeEventListener(zm,h),setTimeout(()=>{const _=new CustomEvent(Am,I0);f.addEventListener(Am,y),f.dispatchEvent(_),_.defaultPrevented||la(j??document.body,{select:!0}),f.removeEventListener(Am,y),P0.remove(b)},0)}}},[f,h,y,b]);const k=S.useCallback(j=>{if(!n&&!a||b.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,_=document.activeElement;if(E&&_){const A=j.currentTarget,[O,I]=RR(A);O&&I?!j.shiftKey&&_===I?(j.preventDefault(),n&&la(O,{select:!0})):j.shiftKey&&_===O&&(j.preventDefault(),n&&la(I,{select:!0})):_===A&&j.preventDefault()}},[n,a,b.paused]);return d.jsx(Ei.div,{tabIndex:-1,...u,ref:x,onKeyDown:k})});qw.displayName=AR;function TR(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(la(a,{select:t}),document.activeElement!==n)return}function RR(e){const t=Hw(e),n=B0(t,e),a=B0(t.reverse(),e);return[n,a]}function Hw(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 B0(e,t){for(const n of e)if(!OR(n,{upTo:t}))return n}function OR(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 DR(e){return e instanceof HTMLInputElement&&"select"in e}function la(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&DR(e)&&t&&e.select()}}var P0=MR();function MR(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$0(e,t),e.unshift(t)},remove(t){var n;e=$0(e,t),(n=e[0])==null||n.resume()}}}function $0(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function LR(e){return e.filter(t=>t.tagName!=="A")}var UR="Portal",Zw=S.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=S.useState(!1);lu(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?mR.createPortal(d.jsx(Ei.div,{...a,ref:t}),u):null});Zw.displayName=UR;function IR(e,t){return S.useReducer((n,a)=>t[n][a]??n,e)}var Fd=e=>{const{present:t,children:n}=e,a=BR(t),l=typeof n=="function"?n({present:a.isPresent}):S.Children.only(n),o=vl(a.ref,PR(l));return typeof n=="function"||a.isPresent?S.cloneElement(l,{ref:o}):null};Fd.displayName="Presence";function BR(e){const[t,n]=S.useState(),a=S.useRef(null),l=S.useRef(e),o=S.useRef("none"),u=e?"mounted":"unmounted",[f,m]=IR(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const h=Gc(a.current);o.current=f==="mounted"?h:"none"},[f]),lu(()=>{const h=a.current,y=l.current;if(y!==e){const x=o.current,b=Gc(h);e?m("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&x!==b?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),lu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=b=>{const j=Gc(a.current).includes(CSS.escape(b.animationName));if(b.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},x=b=>{b.target===t&&(o.current=Gc(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:S.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function Gc(e){return(e==null?void 0:e.animationName)||"none"}function PR(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 Tm=0;function $R(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??F0()),document.body.insertAdjacentElement("beforeend",e[1]??F0()),Tm++,()=>{Tm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Tm--}},[])}function F0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Br=function(){return Br=Object.assign||function(t){for(var n,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},Br.apply(this,arguments)};function Vw(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 FR(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,o;a<l;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var fd="right-scroll-bar-position",hd="width-before-scroll-bar",qR="with-scroll-bars-hidden",HR="--removed-body-scroll-bar-size";function Rm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ZR(e,t){var n=S.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 VR=typeof window<"u"?S.useLayoutEffect:S.useEffect,q0=new WeakMap;function QR(e,t){var n=ZR(null,function(a){return e.forEach(function(l){return Rm(l,a)})});return VR(function(){var a=q0.get(n);if(a){var l=new Set(a),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||Rm(f,null)}),o.forEach(function(f){l.has(f)||Rm(f,u)})}q0.set(n,e)},[e]),n}function GR(e){return e}function KR(e,t){t===void 0&&(t=GR);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 YR(e){e===void 0&&(e={});var t=KR(null);return t.options=Br({async:!0,ssr:!1},e),t}var Qw=function(e){var t=e.sideCar,n=Vw(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 S.createElement(a,Br({},n))};Qw.isSideCarExport=!0;function XR(e,t){return e.useMedium(t),Qw}var Gw=YR(),Om=function(){},qd=S.forwardRef(function(e,t){var n=S.useRef(null),a=S.useState({onScrollCapture:Om,onWheelCapture:Om,onTouchMoveCapture:Om}),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,b=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,_=e.as,A=_===void 0?"div":_,O=e.gapMode,I=Vw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=x,R=QR([n,t]),$=Br(Br({},I),l);return S.createElement(S.Fragment,null,y&&S.createElement(B,{sideCar:Gw,removeScrollBar:h,shards:g,noRelative:b,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),u?S.cloneElement(S.Children.only(f),Br(Br({},$),{ref:R})):S.createElement(A,Br({},$,{className:m,ref:R}),f))});qd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qd.classNames={fullWidth:hd,zeroRight:fd};var JR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=JR();return t&&e.setAttribute("nonce",t),e}function eO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=WR())&&(eO(t,n),tO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rO=function(){var e=nO();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Kw=function(){var e=rO(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},iO={left:0,top:0,right:0,gap:0},Dm=function(e){return parseInt(e||"",10)||0},aO=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[Dm(n),Dm(a),Dm(l)]},lO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return iO;var t=aO(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])}},sO=Kw(),vs="data-scroll-locked",oO=function(e,t,n,a){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
251
|
-
.`.concat(qR,` {
|
|
252
|
-
overflow: hidden `).concat(a,`;
|
|
253
|
-
padding-right: `).concat(f,"px ").concat(a,`;
|
|
254
|
-
}
|
|
255
|
-
body[`).concat(vs,`] {
|
|
256
|
-
overflow: hidden `).concat(a,`;
|
|
257
|
-
overscroll-behavior: contain;
|
|
258
|
-
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
259
|
-
padding-left: `.concat(l,`px;
|
|
260
|
-
padding-top: `).concat(o,`px;
|
|
261
|
-
padding-right: `).concat(u,`px;
|
|
262
|
-
margin-left:0;
|
|
263
|
-
margin-top:0;
|
|
264
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
265
|
-
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.`).concat(fd,` {
|
|
269
|
-
right: `).concat(f,"px ").concat(a,`;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.`).concat(hd,` {
|
|
273
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.`).concat(fd," .").concat(fd,` {
|
|
277
|
-
right: 0 `).concat(a,`;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.`).concat(hd," .").concat(hd,` {
|
|
281
|
-
margin-right: 0 `).concat(a,`;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
body[`).concat(vs,`] {
|
|
285
|
-
`).concat(HR,": ").concat(f,`px;
|
|
286
|
-
}
|
|
287
|
-
`)},H0=function(){var e=parseInt(document.body.getAttribute(vs)||"0",10);return isFinite(e)?e:0},uO=function(){S.useEffect(function(){return document.body.setAttribute(vs,(H0()+1).toString()),function(){var e=H0()-1;e<=0?document.body.removeAttribute(vs):document.body.setAttribute(vs,e.toString())}},[])},cO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;uO();var o=S.useMemo(function(){return lO(l)},[l]);return S.createElement(sO,{styles:oO(o,!t,l,n?"":"!important")})},Dp=!1;if(typeof window<"u")try{var Kc=Object.defineProperty({},"passive",{get:function(){return Dp=!0,!0}});window.addEventListener("test",Kc,Kc),window.removeEventListener("test",Kc,Kc)}catch{Dp=!1}var ss=Dp?{passive:!1}:!1,dO=function(e){return e.tagName==="TEXTAREA"},Yw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dO(e)&&n[t]==="visible")},fO=function(e){return Yw(e,"overflowY")},hO=function(e){return Yw(e,"overflowX")},Z0=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=Xw(e,a);if(l){var o=Jw(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},mO=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},pO=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},Xw=function(e,t){return e==="v"?fO(t):hO(t)},Jw=function(e,t){return e==="v"?mO(t):pO(t)},gO=function(e,t){return e==="h"&&t==="rtl"?-1:1},yO=function(e,t,n,a,l){var o=gO(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 b=Jw(e,f),k=b[0],j=b[1],E=b[2],_=j-E-o*k;(k||_)&&Xw(e,f)&&(g+=_,x+=k);var A=f.parentNode;f=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(y&&Math.abs(g)<1||!y&&Math.abs(x)<1)&&(h=!0),h},Yc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},V0=function(e){return[e.deltaX,e.deltaY]},Q0=function(e){return e&&"current"in e?e.current:e},vO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xO=function(e){return`
|
|
288
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
289
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
290
|
-
`)},bO=0,os=[];function SO(e){var t=S.useRef([]),n=S.useRef([0,0]),a=S.useRef(),l=S.useState(bO++)[0],o=S.useState(Kw)[0],u=S.useRef(e);S.useEffect(function(){u.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=FR([e.lockRef.current],(e.shards||[]).map(Q0),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=S.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var _=Yc(j),A=n.current,O="deltaX"in j?j.deltaX:A[0]-_[0],I="deltaY"in j?j.deltaY:A[1]-_[1],B,R=j.target,$=Math.abs(O)>Math.abs(I)?"h":"v";if("touches"in j&&$==="h"&&R.type==="range")return!1;var Z=window.getSelection(),ee=Z&&Z.anchorNode,q=ee?ee===R||ee.contains(R):!1;if(q)return!1;var ie=Z0($,R);if(!ie)return!0;if(ie?B=$:(B=$==="v"?"h":"v",ie=Z0($,R)),!ie)return!1;if(!a.current&&"changedTouches"in j&&(O||I)&&(a.current=B),!B)return!0;var re=a.current||B;return yO(re,E,j,re==="h"?O:I)},[]),m=S.useCallback(function(j){var E=j;if(!(!os.length||os[os.length-1]!==o)){var _="deltaY"in E?V0(E):Yc(E),A=t.current.filter(function(B){return B.name===E.type&&(B.target===E.target||E.target===B.shadowParent)&&vO(B.delta,_)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var O=(u.current.shards||[]).map(Q0).filter(Boolean).filter(function(B){return B.contains(E.target)}),I=O.length>0?f(E,O[0]):!u.current.noIsolation;I&&E.cancelable&&E.preventDefault()}}},[]),h=S.useCallback(function(j,E,_,A){var O={name:j,delta:E,target:_,should:A,shadowParent:wO(_)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(I){return I!==O})},1)},[]),y=S.useCallback(function(j){n.current=Yc(j),a.current=void 0},[]),g=S.useCallback(function(j){h(j.type,V0(j),j.target,f(j,e.lockRef.current))},[]),x=S.useCallback(function(j){h(j.type,Yc(j),j.target,f(j,e.lockRef.current))},[]);S.useEffect(function(){return os.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",m,ss),document.addEventListener("touchmove",m,ss),document.addEventListener("touchstart",y,ss),function(){os=os.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ss),document.removeEventListener("touchmove",m,ss),document.removeEventListener("touchstart",y,ss)}},[]);var b=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(o,{styles:xO(l)}):null,b?S.createElement(cO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kO=XR(Gw,SO);var Ww=S.forwardRef(function(e,t){return S.createElement(qd,Br({},e,{ref:t,sideCar:kO}))});Ww.classNames=qd.classNames;var jO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},us=new WeakMap,Xc=new WeakMap,Jc={},Mm=0,ek=function(e){return e&&(e.host||ek(e.parentNode))},EO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=ek(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})},CO=function(e,t,n,a){var l=EO(t,Array.isArray(e)?e:[e]);Jc[n]||(Jc[n]=new WeakMap);var o=Jc[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 b=x.getAttribute(a),k=b!==null&&b!=="false",j=(us.get(x)||0)+1,E=(o.get(x)||0)+1;us.set(x,j),o.set(x,E),u.push(x),j===1&&k&&Xc.set(x,!0),E===1&&x.setAttribute(n,"true"),k||x.setAttribute(a,"true")}catch(_){console.error("aria-hidden: cannot operate on ",x,_)}})};return y(t),f.clear(),Mm++,function(){u.forEach(function(g){var x=us.get(g)-1,b=o.get(g)-1;us.set(g,x),o.set(g,b),x||(Xc.has(g)||g.removeAttribute(a),Xc.delete(g)),b||g.removeAttribute(n)}),Mm--,Mm||(us=new WeakMap,us=new WeakMap,Xc=new WeakMap,Jc={})}},NO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=jO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),CO(a,l,n,"aria-hidden")):function(){return null}},Hd="Dialog",[tk]=lR(Hd),[_O,Nr]=tk(Hd),nk=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=S.useRef(null),m=S.useRef(null),[h,y]=dR({prop:a,defaultProp:l??!1,onChange:o,caller:Hd});return d.jsx(_O,{scope:t,triggerRef:f,contentRef:m,contentId:yi(),titleId:yi(),descriptionId:yi(),open:h,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(g=>!g),[y]),modal:u,children:n})};nk.displayName=Hd;var rk="DialogTrigger",ik=S.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Nr(rk,n),o=vl(t,l.triggerRef);return d.jsx(Ei.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":jg(l.open),...a,ref:o,onClick:xa(e.onClick,l.onOpenToggle)})});ik.displayName=rk;var wg="DialogPortal",[zO,ak]=tk(wg,{forceMount:void 0}),lk=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Nr(wg,t);return d.jsx(zO,{scope:t,forceMount:n,children:S.Children.map(a,u=>d.jsx(Fd,{present:n||o.open,children:d.jsx(Zw,{asChild:!0,container:l,children:u})}))})};lk.displayName=wg;var wd="DialogOverlay",sk=S.forwardRef((e,t)=>{const n=ak(wd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Nr(wd,e.__scopeDialog);return o.modal?d.jsx(Fd,{present:a||o.open,children:d.jsx(TO,{...l,ref:t})}):null});sk.displayName=wd;var AO=Bw("DialogOverlay.RemoveScroll"),TO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Nr(wd,n);return d.jsx(Ww,{as:AO,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(Ei.div,{"data-state":jg(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),dl="DialogContent",ok=S.forwardRef((e,t)=>{const n=ak(dl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Nr(dl,e.__scopeDialog);return d.jsx(Fd,{present:a||o.open,children:o.modal?d.jsx(RO,{...l,ref:t}):d.jsx(OO,{...l,ref:t})})});ok.displayName=dl;var RO=S.forwardRef((e,t)=>{const n=Nr(dl,e.__scopeDialog),a=S.useRef(null),l=vl(t,n.contentRef,a);return S.useEffect(()=>{const o=a.current;if(o)return NO(o)},[]),d.jsx(uk,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xa(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:xa(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:xa(e.onFocusOutside,o=>o.preventDefault())})}),OO=S.forwardRef((e,t)=>{const n=Nr(dl,e.__scopeDialog),a=S.useRef(!1),l=S.useRef(!1);return d.jsx(uk,{...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()}})}),uk=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=Nr(dl,n),m=S.useRef(null),h=vl(t,m);return $R(),d.jsxs(d.Fragment,{children:[d.jsx(qw,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:d.jsx($w,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":jg(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(DO,{titleId:f.titleId}),d.jsx(LO,{contentRef:m,descriptionId:f.descriptionId})]})]})}),kg="DialogTitle",ck=S.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Nr(kg,n);return d.jsx(Ei.h2,{id:l.titleId,...a,ref:t})});ck.displayName=kg;var dk="DialogDescription",fk=S.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Nr(dk,n);return d.jsx(Ei.p,{id:l.descriptionId,...a,ref:t})});fk.displayName=dk;var hk="DialogClose",mk=S.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Nr(hk,n);return d.jsx(Ei.button,{type:"button",...a,ref:t,onClick:xa(e.onClick,()=>l.onOpenChange(!1))})});mk.displayName=hk;function jg(e){return e?"open":"closed"}var pk="DialogTitleWarning",[IF,gk]=aR(pk,{contentName:dl,titleName:kg,docsSlug:"dialog"}),DO=({titleId:e})=>{const t=gk(pk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
291
|
-
|
|
292
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
293
|
-
|
|
294
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},MO="DialogDescriptionWarning",LO=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gk(MO).contentName}}.`;return S.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},yk=nk,UO=ik,vk=lk,xk=sk,bk=ok,IO=ck,BO=fk,PO=mk,$O=Symbol.for("react.lazy"),kd=rg[" use ".trim().toString()];function FO(e){return typeof e=="object"&&e!==null&&"then"in e}function Sk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$O&&"_payload"in e&&FO(e._payload)}function wk(e){const t=HO(e),n=S.forwardRef((a,l)=>{let{children:o,...u}=a;Sk(o)&&typeof kd=="function"&&(o=kd(o._payload));const f=S.Children.toArray(o),m=f.find(VO);if(m){const h=m.props.children,y=f.map(g=>g===m?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:g);return d.jsx(t,{...u,ref:l,children:S.isValidElement(h)?S.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var qO=wk("Slot");function HO(e){const t=S.forwardRef((n,a)=>{let{children:l,...o}=n;if(Sk(l)&&typeof kd=="function"&&(l=kd(l._payload)),S.isValidElement(l)){const u=GO(l),f=QO(o,l.props);return l.type!==S.Fragment&&(f.ref=a?ba(a,u):u),S.cloneElement(l,f)}return S.Children.count(l)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZO=Symbol("radix.slottable");function VO(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZO}function QO(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 GO(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 KO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ci=KO.reduce((e,t)=>{const n=wk(`Primitive.${t}`),a=S.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Ho='[cmdk-group=""]',Lm='[cmdk-group-items=""]',YO='[cmdk-group-heading=""]',kk='[cmdk-item=""]',G0=`${kk}:not([aria-disabled="true"])`,Mp="cmdk-item-select",fs="data-value",XO=(e,t,n)=>iR(e,t,n),jk=S.createContext(void 0),Su=()=>S.useContext(jk),Ek=S.createContext(void 0),Eg=()=>S.useContext(Ek),Ck=S.createContext(void 0),Nk=S.forwardRef((e,t)=>{let n=hs(()=>{var z,C;return{search:"",value:(C=(z=e.value)!=null?z:e.defaultValue)!=null?C:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=hs(()=>new Set),l=hs(()=>new Map),o=hs(()=>new Map),u=hs(()=>new Set),f=_k(e),{label:m,children:h,value:y,onValueChange:g,filter:x,shouldFilter:b,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,..._}=e,A=yi(),O=yi(),I=yi(),B=S.useRef(null),R=oD();fl(()=>{if(y!==void 0){let z=y.trim();n.current.value=z,$.emit()}},[y]),fl(()=>{R(6,pe)},[]);let $=S.useMemo(()=>({subscribe:z=>(u.current.add(z),()=>u.current.delete(z)),snapshot:()=>n.current,setState:(z,C,J)=>{var Y,ue,ge,Me;if(!Object.is(n.current[z],C)){if(n.current[z]=C,z==="search")re(),q(),R(1,ie);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let be=document.getElementById(I);be?be.focus():(Y=document.getElementById(A))==null||Y.focus()}if(R(7,()=>{var be;n.current.selectedItemId=(be=de())==null?void 0:be.id,$.emit()}),J||R(5,pe),((ue=f.current)==null?void 0:ue.value)!==void 0){let be=C??"";(Me=(ge=f.current).onValueChange)==null||Me.call(ge,be);return}}$.emit()}},emit:()=>{u.current.forEach(z=>z())}}),[]),Z=S.useMemo(()=>({value:(z,C,J)=>{var Y;C!==((Y=o.current.get(z))==null?void 0:Y.value)&&(o.current.set(z,{value:C,keywords:J}),n.current.filtered.items.set(z,ee(C,J)),R(2,()=>{q(),$.emit()}))},item:(z,C)=>(a.current.add(z),C&&(l.current.has(C)?l.current.get(C).add(z):l.current.set(C,new Set([z]))),R(3,()=>{re(),q(),n.current.value||ie(),$.emit()}),()=>{o.current.delete(z),a.current.delete(z),n.current.filtered.items.delete(z);let J=de();R(4,()=>{re(),(J==null?void 0:J.getAttribute("id"))===z&&ie(),$.emit()})}),group:z=>(l.current.has(z)||l.current.set(z,new Set),()=>{o.current.delete(z),l.current.delete(z)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:A,inputId:I,labelId:O,listInnerRef:B}),[]);function ee(z,C){var J,Y;let ue=(Y=(J=f.current)==null?void 0:J.filter)!=null?Y:XO;return z?ue(z,n.current.search,C):0}function q(){if(!n.current.search||f.current.shouldFilter===!1)return;let z=n.current.filtered.items,C=[];n.current.filtered.groups.forEach(Y=>{let ue=l.current.get(Y),ge=0;ue.forEach(Me=>{let be=z.get(Me);ge=Math.max(be,ge)}),C.push([Y,ge])});let J=B.current;W().sort((Y,ue)=>{var ge,Me;let be=Y.getAttribute("id"),Nt=ue.getAttribute("id");return((ge=z.get(Nt))!=null?ge:0)-((Me=z.get(be))!=null?Me:0)}).forEach(Y=>{let ue=Y.closest(Lm);ue?ue.appendChild(Y.parentElement===ue?Y:Y.closest(`${Lm} > *`)):J.appendChild(Y.parentElement===J?Y:Y.closest(`${Lm} > *`))}),C.sort((Y,ue)=>ue[1]-Y[1]).forEach(Y=>{var ue;let ge=(ue=B.current)==null?void 0:ue.querySelector(`${Ho}[${fs}="${encodeURIComponent(Y[0])}"]`);ge==null||ge.parentElement.appendChild(ge)})}function ie(){let z=W().find(J=>J.getAttribute("aria-disabled")!=="true"),C=z==null?void 0:z.getAttribute(fs);$.setState("value",C||void 0)}function re(){var z,C,J,Y;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 ge of a.current){let Me=(C=(z=o.current.get(ge))==null?void 0:z.value)!=null?C:"",be=(Y=(J=o.current.get(ge))==null?void 0:J.keywords)!=null?Y:[],Nt=ee(Me,be);n.current.filtered.items.set(ge,Nt),Nt>0&&ue++}for(let[ge,Me]of l.current)for(let be of Me)if(n.current.filtered.items.get(be)>0){n.current.filtered.groups.add(ge);break}n.current.filtered.count=ue}function pe(){var z,C,J;let Y=de();Y&&(((z=Y.parentElement)==null?void 0:z.firstChild)===Y&&((J=(C=Y.closest(Ho))==null?void 0:C.querySelector(YO))==null||J.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function de(){var z;return(z=B.current)==null?void 0:z.querySelector(`${kk}[aria-selected="true"]`)}function W(){var z;return Array.from(((z=B.current)==null?void 0:z.querySelectorAll(G0))||[])}function P(z){let C=W()[z];C&&$.setState("value",C.getAttribute(fs))}function V(z){var C;let J=de(),Y=W(),ue=Y.findIndex(Me=>Me===J),ge=Y[ue+z];(C=f.current)!=null&&C.loop&&(ge=ue+z<0?Y[Y.length-1]:ue+z===Y.length?Y[0]:Y[ue+z]),ge&&$.setState("value",ge.getAttribute(fs))}function ce(z){let C=de(),J=C==null?void 0:C.closest(Ho),Y;for(;J&&!Y;)J=z>0?lD(J,Ho):sD(J,Ho),Y=J==null?void 0:J.querySelector(G0);Y?$.setState("value",Y.getAttribute(fs)):V(z)}let xe=()=>P(W().length-1),T=z=>{z.preventDefault(),z.metaKey?xe():z.altKey?ce(1):V(1)},L=z=>{z.preventDefault(),z.metaKey?P(0):z.altKey?ce(-1):V(-1)};return S.createElement(Ci.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:z=>{var C;(C=_.onKeyDown)==null||C.call(_,z);let J=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||J))switch(z.key){case"n":case"j":{E&&z.ctrlKey&&T(z);break}case"ArrowDown":{T(z);break}case"p":case"k":{E&&z.ctrlKey&&L(z);break}case"ArrowUp":{L(z);break}case"Home":{z.preventDefault(),P(0);break}case"End":{z.preventDefault(),xe();break}case"Enter":{z.preventDefault();let Y=de();if(Y){let ue=new Event(Mp);Y.dispatchEvent(ue)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:Z.inputId,id:Z.labelId,style:cD},m),Zd(e,z=>S.createElement(Ek.Provider,{value:$},S.createElement(jk.Provider,{value:Z},z))))}),JO=S.forwardRef((e,t)=>{var n,a;let l=yi(),o=S.useRef(null),u=S.useContext(Ck),f=Su(),m=_k(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:u==null?void 0:u.forceMount;fl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let y=zk(l,o,[e.value,e.children,o],e.keywords),g=Eg(),x=Sa(R=>R.value&&R.value===y.current),b=Sa(R=>h||f.filter()===!1?!0:R.search?R.filtered.items.get(l)>0:!0);S.useEffect(()=>{let R=o.current;if(!(!R||e.disabled))return R.addEventListener(Mp,k),()=>R.removeEventListener(Mp,k)},[b,e.onSelect,e.disabled]);function k(){var R,$;j(),($=(R=m.current).onSelect)==null||$.call(R,y.current)}function j(){g.setState("value",y.current,!0)}if(!b)return null;let{disabled:E,value:_,onSelect:A,forceMount:O,keywords:I,...B}=e;return S.createElement(Ci.div,{ref:ba(o,t),...B,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!x,"data-disabled":!!E,"data-selected":!!x,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),WO=S.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,u=yi(),f=S.useRef(null),m=S.useRef(null),h=yi(),y=Su(),g=Sa(b=>l||y.filter()===!1?!0:b.search?b.filtered.groups.has(u):!0);fl(()=>y.group(u),[]),zk(u,f,[e.value,e.heading,m]);let x=S.useMemo(()=>({id:u,forceMount:l}),[l]);return S.createElement(Ci.div,{ref:ba(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&S.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Zd(e,b=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},S.createElement(Ck.Provider,{value:x},b))))}),eD=S.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=S.useRef(null),o=Sa(u=>!u.search);return!n&&!o?null:S.createElement(Ci.div,{ref:ba(l,t),...a,"cmdk-separator":"",role:"separator"})}),tD=S.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=Eg(),u=Sa(h=>h.search),f=Sa(h=>h.selectedItemId),m=Su();return S.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),S.createElement(Ci.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)}})}),nD=S.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=S.useRef(null),u=S.useRef(null),f=Sa(h=>h.selectedItemId),m=Su();return S.useEffect(()=>{if(u.current&&o.current){let h=u.current,y=o.current,g,x=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let b=h.offsetHeight;y.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(g),x.unobserve(h)}}},[]),S.createElement(Ci.div,{ref:ba(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},Zd(e,h=>S.createElement("div",{ref:ba(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),rD=S.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:u,...f}=e;return S.createElement(yk,{open:n,onOpenChange:a},S.createElement(vk,{container:u},S.createElement(xk,{"cmdk-overlay":"",className:l}),S.createElement(bk,{"aria-label":e.label,"cmdk-dialog":"",className:o},S.createElement(Nk,{ref:t,...f}))))}),iD=S.forwardRef((e,t)=>Sa(n=>n.filtered.count===0)?S.createElement(Ci.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),aD=S.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return S.createElement(Ci.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Zd(e,u=>S.createElement("div",{"aria-hidden":!0},u)))}),Ln=Object.assign(Nk,{List:nD,Item:JO,Input:tD,Group:WO,Separator:eD,Dialog:rD,Empty:iD,Loading:aD});function lD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function sD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function _k(e){let t=S.useRef(e);return fl(()=>{t.current=e}),t}var fl=typeof window>"u"?S.useEffect:S.useLayoutEffect;function hs(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function Sa(e){let t=Eg(),n=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,n,n)}function zk(e,t,n,a=[]){let l=S.useRef(),o=Su();return fl(()=>{var u;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(u=t.current)==null||u.setAttribute(fs,f),l.current=f}),l}var oD=()=>{let[e,t]=S.useState(),n=hs(()=>new Map);return fl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function uD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Zd({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(uD(t),{ref:t.ref},n(t.props.children)):n(t)}var cD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const On=yk,dD=UO,fD=vk,Ak=S.forwardRef(({className:e,...t},n)=>d.jsx(xk,{ref:n,className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ak.displayName="DialogOverlay";const Sn=S.forwardRef(({className:e,children:t,...n},a)=>d.jsxs(fD,{children:[d.jsx(Ak,{}),d.jsxs(bk,{ref:a,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,d.jsxs(PO,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(zp,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sn.displayName="DialogContent";function Jn({className:e,...t}){return d.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Dn({className:e,...t}){return d.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const Mn=S.forwardRef(({className:e,...t},n)=>d.jsx(IO,{ref:n,className:Te("text-lg font-semibold leading-none tracking-tight",e),...t}));Mn.displayName="DialogTitle";const hD=S.forwardRef(({className:e,...t},n)=>d.jsx(BO,{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));hD.displayName="DialogDescription";const Tk=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Tk.displayName=Ln.displayName;function mD({open:e,onOpenChange:t,children:n}){return d.jsx(On,{open:e,onOpenChange:t,children:d.jsx(Sn,{className:"overflow-hidden p-0 shadow-lg",children:d.jsx(Tk,{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 Rk=S.forwardRef(({className:e,...t},n)=>d.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[d.jsx(Pd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),d.jsx(Ln.Input,{ref:n,className:Te("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Rk.displayName=Ln.Input.displayName;const Ok=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.List,{ref:n,className:Te("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ok.displayName=Ln.List.displayName;const Dk=S.forwardRef((e,t)=>d.jsx(Ln.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Dk.displayName=Ln.Empty.displayName;const md=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Group,{ref:n,className:Te("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));md.displayName=Ln.Group.displayName;const Lp=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));Lp.displayName=Ln.Separator.displayName;const pd=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Item,{ref:n,className:Te("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));pd.displayName=Ln.Item.displayName;function Cg(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.type&&t.set("type",e.type);const n=t.toString();return De.get(`/admin/agents${n?`?${n}`:""}`)}function pD(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return De.get(`/admin/agents/all${n?`?${n}`:""}`)}function Mk(e){return De.get(`/admin/agents/${encodeURIComponent(e)}`)}function gD(e){return De.post("/admin/agents",e)}function K0(e,t){return De.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function yD(e){return De.delete(`/admin/agents/${encodeURIComponent(e)}`)}function vD(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function xD(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function bD(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Ea(){const{data:e}=qe({queryKey:["agents","name-map"],queryFn:()=>Cg({limit:100}),staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,n.displayName??n.name??n.uuid);return n=>n?t.get(n)??n:"—"},[e])}const SD=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function wD({open:e,onOpenChange:t}){const n=qr(),a=Ea(),{data:l}=qe({queryKey:["activity"],queryFn:bu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=qe({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await $s(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 d.jsxs(mD,{open:e,onOpenChange:t,children:[d.jsx(Rk,{placeholder:"Jump to agent, chat, or page…"}),d.jsxs(Ok,{children:[d.jsx(Dk,{children:"No results"}),o.length>0&&d.jsx(md,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return d.jsxs(pd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[d.jsx(aA,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:y}),d.jsx("span",{className:"text-xs text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(Lp,{}),d.jsx(md,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return d.jsxs(pd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[d.jsx(vw,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:g}),d.jsx("span",{className:"text-xs text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),d.jsx(Lp,{}),d.jsx(md,{heading:"Pages",children:SD.map(h=>d.jsxs(pd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[d.jsx(xA,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{children:h.label})]},h.path))})]})]})}function wu(e){return d.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[d.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),d.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),d.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),d.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),d.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),d.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function Up(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.severity&&t.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&t.set("read",String(e.read)),e!=null&&e.agentId&&t.set("agentId",e.agentId);const n=t.toString();return De.get(`/admin/notifications${n?`?${n}`:""}`)}function Lk(e){return De.post(`/admin/notifications/${e}/read`)}function kD(){return De.post("/admin/notifications/read-all")}const jD={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 ED(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Uk({notification:e,onClick:t,clickable:n}){const a=(jD[e.type]??e.type).toString(),l=ED(e.severity),o=n??!0;return d.jsxs("button",{type:"button",onClick:t,className:Te("w-full text-left transition-colors",o?"cursor-pointer":"cursor-default"),style:{padding:"6px 8px",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`2px solid ${l}`,borderRadius:"0 3px 3px 0",fontSize:13},onMouseEnter:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[d.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[d.jsx("span",{className:"mono uppercase",style:{fontSize:11,letterSpacing:.08,color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),d.jsx("span",{className:"mono",style:{fontSize:11,color:"var(--fg-4)",whiteSpace:"nowrap"},children:bi(e.createdAt)})]}),d.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function CD(){var b;const[e,t]=S.useState(!1),[n,a]=S.useState(null),l=S.useRef(null),o=qr(),u=Wn(),{data:f}=qe({queryKey:["notifications","bell"],queryFn:()=>Up({limit:8}),refetchInterval:1e4}),{data:m}=qe({queryKey:["notifications","unread-count"],queryFn:()=>Up({read:!1,limit:100}),refetchInterval:1e4}),h=((b=m==null?void 0:m.items)==null?void 0:b.length)??0,y=h>0,g=S.useCallback(async k=>{k.read||(Lk(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=S.useCallback(async()=>{a(null);try{await kD(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return d.jsxs("div",{className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[d.jsx(rA,{className:"h-4 w-4"}),y&&d.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)",fontSize:11},children:h>99?"99+":h})]}),e&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),d.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6,boxShadow:"0 8px 24px rgba(0,0,0,0.25)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx("span",{className:"mono uppercase",style:{fontSize:11,letterSpacing:.1,color:"var(--fg-4)"},children:"Notifications"}),y&&d.jsx("button",{type:"button",onClick:x,className:"hover:underline",style:{fontSize:12,color:"var(--accent)"},children:"Mark all read"})]}),n&&d.jsx("div",{style:{padding:"6px 12px",fontSize:13,color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"1px solid var(--border-faint)"},children:n}),d.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?d.jsx("div",{className:"text-center",style:{fontSize:13,color:"var(--fg-3)",padding:"18px 0"},children:"No notifications"}):f.items.map(k=>d.jsx(Uk,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function ND(){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 _D(){const[e,t]=S.useState(ND);return S.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),d.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:e==="dark"?d.jsx(FA,{className:"h-4 w-4"}):d.jsx(NA,{className:"h-4 w-4"})})}const Y0=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}],zD={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function AD(){const{role:e,logout:t}=ji(),n=e==="admin",[a,l]=S.useState(!1),o=n?[...Y0,zD]:Y0,u=yr(),f=u.pathname==="/"||u.search.includes("a=");return S.useEffect(()=>{const m=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),l(y=>!y))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),d.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[d.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:40,gridTemplateColumns:"auto 1fr auto",padding:"0 12px",borderBottom:"1px solid var(--border)",background:"var(--bg-raised)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx(wu,{width:14,height:16,style:{color:"var(--fg)"}}),d.jsxs("span",{style:{fontWeight:600,fontSize:13,letterSpacing:-.1,color:"var(--fg)"},children:["First Tree ",d.jsx("span",{style:{color:"var(--fg-3)",fontWeight:400},children:"Hub"})]})]}),d.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:o.map(m=>d.jsx(dw,{to:m.to,end:m.end,style:{pointerEvents:"auto"},className:({isActive:h})=>Te("inline-flex items-center transition-colors",h?"":"hover:text-[var(--fg)]"),children:({isActive:h})=>d.jsxs("span",{className:"inline-flex items-center",style:{padding:"5px 12px",fontSize:16,fontWeight:500,gap:6,borderRadius:5,color:h?"var(--fg)":"var(--fg-3)",background:h?"var(--bg-hover)":"transparent"},children:[m.label,h&&d.jsx("span",{className:"kbd",children:m.kbd})]})},m.to))}),d.jsxs("div",{className:"flex items-center",style:{gap:6},children:[d.jsxs("button",{type:"button",onClick:()=>l(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors",style:{gap:8,padding:"4px 8px",fontSize:11,color:"var(--fg-3)",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg-sunken)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--fg)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--fg-3)"},children:[d.jsx(Pd,{className:"h-3.5 w-3.5"}),d.jsx("span",{children:"Jump to…"}),d.jsx("span",{className:"kbd",children:"⌘K"})]}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 4px"}}),d.jsx(CD,{}),d.jsx(_D,{}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 4px"}}),d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center transition-colors hover:text-[var(--fg)]",style:{padding:"4px 8px",color:"var(--fg-3)",borderRadius:4,gap:6,fontSize:11},"aria-label":"Log out",children:d.jsx(jA,{className:"h-3.5 w-3.5"})})]})]}),d.jsx(wD,{open:a,onOpenChange:l}),f?d.jsx(Ep,{}):d.jsx("main",{className:"flex-1 overflow-auto",children:d.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:d.jsx(Ep,{})})})]})}function ae(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 xs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ik extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Bk={};function wa(e){return Bk}function Pk(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 Ip(e,t){return typeof t=="bigint"?t.toString():t}function Vd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ng(e){return e==null}function _g(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function TD(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 X0=Symbol("evaluating");function lt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==X0)return a===void 0&&(a=X0,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function xl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ca(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function J0(e){return JSON.stringify(e)}function RD(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $k="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ou(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const OD=Vd(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Os(e){if(ou(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ou(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Fk(e){return Os(e)?{...e}:Array.isArray(e)?[...e]:e}const DD=new Set(["string","number","symbol"]);function Ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Na(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 Ce(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function MD(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const LD={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 UD(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=Ca(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 xl(this,"shape",u),u},checks:[]});return Na(e,o)}function ID(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=Ca(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 xl(this,"shape",u),u},checks:[]});return Na(e,o)}function BD(e,t){if(!Os(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Ca(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return xl(this,"shape",o),o}});return Na(e,l)}function PD(e,t){if(!Os(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ca(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return xl(this,"shape",a),a}});return Na(e,n)}function $D(e,t){const n=Ca(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return xl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Na(e,n)}function FD(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=Ca(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 xl(this,"shape",m),m},checks:[]});return Na(t,u)}function qD(e,t,n){const a=Ca(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 xl(this,"shape",o),o}});return Na(t,a)}function ps(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 gs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Wc(e){return typeof e=="string"?e:e==null?void 0:e.message}function ka(e,t,n){var l,o,u,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=Wc((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??Wc((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Wc((m=n.customError)==null?void 0:m.call(n,e))??Wc((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 zg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function uu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const qk=(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,Ip,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hk=ae("$ZodError",qk),Zk=ae("$ZodError",qk,{Parent:Error});function HD(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 ZD(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 Ag=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 xs;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ka(m,o,wa())));throw $k(f,l==null?void 0:l.callee),f}return u.value},Tg=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=>ka(m,o,wa())));throw $k(f,l==null?void 0:l.callee),f}return u.value},Qd=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 xs;return o.issues.length?{success:!1,error:new(e??Hk)(o.issues.map(u=>ka(u,l,wa())))}:{success:!0,data:o.value}},VD=Qd(Zk),Gd=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=>ka(u,l,wa())))}:{success:!0,data:o.value}},QD=Gd(Zk),GD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ag(e)(t,n,l)},KD=e=>(t,n,a)=>Ag(e)(t,n,a),YD=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Tg(e)(t,n,l)},XD=e=>async(t,n,a)=>Tg(e)(t,n,a),JD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Qd(e)(t,n,l)},WD=e=>(t,n,a)=>Qd(e)(t,n,a),e4=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gd(e)(t,n,l)},t4=e=>async(t,n,a)=>Gd(e)(t,n,a),n4=/^[cC][^\s-]{8,}$/,r4=/^[0-9a-z]+$/,i4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,a4=/^[0-9a-vA-V]{20}$/,l4=/^[A-Za-z0-9]{27}$/,s4=/^[a-zA-Z0-9_-]{21}$/,o4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,u4=/^([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})$/,W0=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)$/,c4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,d4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function f4(){return new RegExp(d4,"u")}const h4=/^(?:(?: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])$/,m4=/^(([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}|:))$/,p4=/^((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])$/,g4=/^(([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])$/,y4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vk=/^[A-Za-z0-9_-]*$/,v4=/^\+[1-9]\d{6,14}$/,Qk="(?:(?:\\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])))",x4=new RegExp(`^${Qk}$`);function Gk(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function b4(e){return new RegExp(`^${Gk(e)}$`)}function S4(e){const t=Gk({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(`^${Qk}T(?:${a})$`)}const w4=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},k4=/^-?\d+$/,Kk=/^-?\d+(?:\.\d+)?$/,j4=/^(?:true|false)$/i,E4=/^[^A-Z]*$/,C4=/^[^a-z]*$/,Un=ae("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Yk={number:"number",bigint:"bigint",object:"date"},Xk=ae("$ZodCheckLessThan",(e,t)=>{Un.init(e,t);const n=Yk[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})}}),Jk=ae("$ZodCheckGreaterThan",(e,t)=>{Un.init(e,t);const n=Yk[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})}}),N4=ae("$ZodCheckMultipleOf",(e,t)=>{Un.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):TD(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})}}),_4=ae("$ZodCheckNumberFormat",(e,t)=>{var u;Un.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]=LD[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=k4)}),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})}}),z4=ae("$ZodCheckMaxLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ng(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=zg(l);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),A4=ae("$ZodCheckMinLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ng(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=zg(l);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),T4=ae("$ZodCheckLengthEquals",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ng(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=zg(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})}}),Kd=ae("$ZodCheckStringFormat",(e,t)=>{var n,a;Un.init(e,t),e._zod.onattach.push(l=>{const o=l._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),R4=ae("$ZodCheckRegex",(e,t)=>{Kd.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})}}),O4=ae("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=E4),Kd.init(e,t)}),D4=ae("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=C4),Kd.init(e,t)}),M4=ae("$ZodCheckIncludes",(e,t)=>{Un.init(e,t);const n=Ds(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})}}),L4=ae("$ZodCheckStartsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`^${Ds(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})}}),U4=ae("$ZodCheckEndsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`.*${Ds(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})}}),I4=ae("$ZodCheckOverwrite",(e,t)=>{Un.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class B4{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(`
|
|
295
|
-
`).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(`
|
|
296
|
-
`))}}const P4={major:4,minor:3,patch:6},_t=ae("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=P4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const 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=ps(f),g;for(const x of m){if(x._zod.def.when){if(!x._zod.def.when(f))continue}else if(y)continue;const b=f.issues.length,k=x._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new xs;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==b&&(y||(y=ps(f,b)))});else{if(f.issues.length===b)continue;y||(y=ps(f,b))}}return g?g.then(()=>f):f},u=(f,m,h)=>{if(ps(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new xs;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 xs;return h.then(y=>o(y,a,m))}return o(h,a,m)}}lt(e,"~standard",()=>({validate:o=>{var u;try{const f=VD(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return QD(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}))}),Rg=ae("$ZodString",(e,t)=>{var n;_t.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??w4(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Ct=ae("$ZodStringFormat",(e,t)=>{Kd.init(e,t),Rg.init(e,t)}),$4=ae("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=u4),Ct.init(e,t)}),F4=ae("$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=W0(a))}else t.pattern??(t.pattern=W0());Ct.init(e,t)}),q4=ae("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=c4),Ct.init(e,t)}),H4=ae("$ZodURL",(e,t)=>{Ct.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})}}}),Z4=ae("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=f4()),Ct.init(e,t)}),V4=ae("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=s4),Ct.init(e,t)}),Q4=ae("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=n4),Ct.init(e,t)}),G4=ae("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=r4),Ct.init(e,t)}),K4=ae("$ZodULID",(e,t)=>{t.pattern??(t.pattern=i4),Ct.init(e,t)}),Y4=ae("$ZodXID",(e,t)=>{t.pattern??(t.pattern=a4),Ct.init(e,t)}),X4=ae("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=l4),Ct.init(e,t)}),J4=ae("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=S4(t)),Ct.init(e,t)}),W4=ae("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=x4),Ct.init(e,t)}),eM=ae("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=b4(t)),Ct.init(e,t)}),tM=ae("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o4),Ct.init(e,t)}),nM=ae("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=h4),Ct.init(e,t),e._zod.bag.format="ipv4"}),rM=ae("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=m4),Ct.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),iM=ae("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=p4),Ct.init(e,t)}),aM=ae("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=g4),Ct.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 Wk(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const lM=ae("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=y4),Ct.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Wk(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function sM(e){if(!Vk.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Wk(n)}const oM=ae("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vk),Ct.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{sM(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),uM=ae("$ZodE164",(e,t)=>{t.pattern??(t.pattern=v4),Ct.init(e,t)});function cM(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 dM=ae("$ZodJWT",(e,t)=>{Ct.init(e,t),e._zod.check=n=>{cM(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ej=ae("$ZodNumber",(e,t)=>{_t.init(e,t),e._zod.pattern=e._zod.bag.pattern??Kk,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}}),fM=ae("$ZodNumberFormat",(e,t)=>{_4.init(e,t),ej.init(e,t)}),hM=ae("$ZodBoolean",(e,t)=>{_t.init(e,t),e._zod.pattern=j4,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}}),mM=ae("$ZodUnknown",(e,t)=>{_t.init(e,t),e._zod.parse=n=>n}),pM=ae("$ZodNever",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function e1(e,t,n){e.issues.length&&t.issues.push(...gs(n,e.issues)),t.value[n]=e.value}const gM=ae("$ZodArray",(e,t)=>{_t.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=>e1(h,n,u))):e1(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function jd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...gs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function tj(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=MD(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function nj(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(b=>jd(b,n,g,t,y))):jd(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 yM=ae("$ZodObject",(e,t)=>{_t.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=Vd(()=>tj(t));lt(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=ou,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 b=g[x],k=b._zod.optout==="optional",j=b._zod.run({value:h[x],issues:[]},m);j instanceof Promise?y.push(j.then(E=>jd(E,f,x,h,k))):jd(j,f,x,h,k)}return o?nj(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),vM=ae("$ZodObjectJIT",(e,t)=>{yM.init(e,t);const n=e._zod.parse,a=Vd(()=>tj(t)),l=x=>{var O;const b=new B4(["shape","payload","ctx"]),k=a.value,j=I=>{const B=J0(I);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};b.write("const input = payload.value;");const E=Object.create(null);let _=0;for(const I of k.keys)E[I]=`key_${_++}`;b.write("const newResult = {};");for(const I of k.keys){const B=E[I],R=J0(I),$=x[I],Z=((O=$==null?void 0:$._zod)==null?void 0:O.optout)==="optional";b.write(`const ${B} = ${j(I)};`),Z?b.write(`
|
|
297
|
-
if (${B}.issues.length) {
|
|
298
|
-
if (${R} in input) {
|
|
299
|
-
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
300
|
-
...iss,
|
|
301
|
-
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
302
|
-
})));
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (${B}.value === undefined) {
|
|
307
|
-
if (${R} in input) {
|
|
308
|
-
newResult[${R}] = undefined;
|
|
309
|
-
}
|
|
310
|
-
} else {
|
|
311
|
-
newResult[${R}] = ${B}.value;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
`):b.write(`
|
|
315
|
-
if (${B}.issues.length) {
|
|
316
|
-
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
317
|
-
...iss,
|
|
318
|
-
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
319
|
-
})));
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
if (${B}.value === undefined) {
|
|
323
|
-
if (${R} in input) {
|
|
324
|
-
newResult[${R}] = undefined;
|
|
325
|
-
}
|
|
326
|
-
} else {
|
|
327
|
-
newResult[${R}] = ${B}.value;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
`)}b.write("payload.value = newResult;"),b.write("return payload;");const A=b.compile();return(I,B)=>A(x,I,B)};let o;const u=ou,f=!Bk.jitless,h=f&&OD.value,y=t.catchall;let g;e._zod.parse=(x,b)=>{g??(g=a.value);const k=x.value;return u(k)?f&&h&&(b==null?void 0:b.async)===!1&&b.jitless!==!0?(o||(o=l(t.shape)),x=o(x,b),y?nj([],k,x,b,g,e):x):n(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),x)}});function t1(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=>!ps(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(u=>ka(u,a,wa())))}),t)}const rj=ae("$ZodUnion",(e,t)=>{_t.init(e,t),lt(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),lt(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),lt(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),lt(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${l.map(o=>_g(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=>t1(m,l,e,o)):t1(f,l,e,o)}}),xM=ae("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rj.init(e,t);const n=e._zod.parse;lt(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=Vd(()=>{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(!ou(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)}}),bM=ae("$ZodIntersection",(e,t)=>{_t.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])=>n1(n,m,h)):n1(n,o,u)}});function Bp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Os(e)&&Os(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const u=Bp(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=Bp(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 n1(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}),ps(e))return e;const u=Bp(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 SM=ae("$ZodRecord",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Os(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...gs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...gs(h,y.issues)),n.value[h]=y.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Kk.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=>ka(g,a,wa())),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(...gs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...gs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),wM=ae("$ZodEnum",(e,t)=>{_t.init(e,t);const n=Pk(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>DD.has(typeof l)).map(l=>typeof l=="string"?Ds(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}}),kM=ae("$ZodLiteral",(e,t)=>{if(_t.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"?Ds(a):a?Ds(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}}),jM=ae("$ZodTransform",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Ik(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 xs;return n.value=l,n}});function r1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ij=ae("$ZodOptional",(e,t)=>{_t.init(e,t),e._zod.optin="optional",e._zod.optout="optional",lt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),lt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${_g(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=>r1(o,n.value)):r1(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),EM=ae("$ZodExactOptional",(e,t)=>{ij.init(e,t),lt(e._zod,"values",()=>t.innerType._zod.values),lt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),CM=ae("$ZodNullable",(e,t)=>{_t.init(e,t),lt(e._zod,"optin",()=>t.innerType._zod.optin),lt(e._zod,"optout",()=>t.innerType._zod.optout),lt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${_g(n.source)}|null)$`):void 0}),lt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),NM=ae("$ZodDefault",(e,t)=>{_t.init(e,t),e._zod.optin="optional",lt(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=>i1(o,t)):i1(l,t)}});function i1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const _M=ae("$ZodPrefault",(e,t)=>{_t.init(e,t),e._zod.optin="optional",lt(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))}),zM=ae("$ZodNonOptional",(e,t)=>{_t.init(e,t),lt(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=>a1(o,e)):a1(l,e)}});function a1(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 AM=ae("$ZodCatch",(e,t)=>{_t.init(e,t),lt(e._zod,"optin",()=>t.innerType._zod.optin),lt(e._zod,"optout",()=>t.innerType._zod.optout),lt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,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=>ka(u,a,wa()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>ka(o,a,wa()))},input:n.value}),n.issues=[]),n)}}),TM=ae("$ZodPipe",(e,t)=>{_t.init(e,t),lt(e._zod,"values",()=>t.in._zod.values),lt(e._zod,"optin",()=>t.in._zod.optin),lt(e._zod,"optout",()=>t.out._zod.optout),lt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,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 RM=ae("$ZodReadonly",(e,t)=>{_t.init(e,t),lt(e._zod,"propValues",()=>t.innerType._zod.propValues),lt(e._zod,"values",()=>t.innerType._zod.values),lt(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),lt(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(l1):l1(l)}});function l1(e){return e.value=Object.freeze(e.value),e}const OM=ae("$ZodCustom",(e,t)=>{Un.init(e,t),_t.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=>s1(o,n,a,e));s1(l,n,a,e)}});function s1(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(uu(l))}}var o1;class DM{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 MM(){return new DM}(o1=globalThis).__zod_globalRegistry??(o1.__zod_globalRegistry=MM());const Yo=globalThis.__zod_globalRegistry;function LM(e,t){return new e({type:"string",...Ce(t)})}function UM(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function u1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function IM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function BM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function PM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function $M(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function FM(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function qM(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function HM(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function ZM(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function VM(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function QM(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function GM(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function KM(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function YM(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function XM(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function JM(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function WM(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function e3(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function t3(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function n3(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function r3(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}function i3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function a3(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function l3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function s3(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function o3(e,t){return new e({type:"number",checks:[],...Ce(t)})}function u3(e,t){return new e({type:"number",coerce:!0,checks:[],...Ce(t)})}function c3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(t)})}function d3(e,t){return new e({type:"boolean",...Ce(t)})}function f3(e){return new e({type:"unknown"})}function h3(e,t){return new e({type:"never",...Ce(t)})}function c1(e,t){return new Xk({check:"less_than",...Ce(t),value:e,inclusive:!1})}function Um(e,t){return new Xk({check:"less_than",...Ce(t),value:e,inclusive:!0})}function d1(e,t){return new Jk({check:"greater_than",...Ce(t),value:e,inclusive:!1})}function Im(e,t){return new Jk({check:"greater_than",...Ce(t),value:e,inclusive:!0})}function f1(e,t){return new N4({check:"multiple_of",...Ce(t),value:e})}function aj(e,t){return new z4({check:"max_length",...Ce(t),maximum:e})}function Ed(e,t){return new A4({check:"min_length",...Ce(t),minimum:e})}function lj(e,t){return new T4({check:"length_equals",...Ce(t),length:e})}function m3(e,t){return new R4({check:"string_format",format:"regex",...Ce(t),pattern:e})}function p3(e){return new O4({check:"string_format",format:"lowercase",...Ce(e)})}function g3(e){return new D4({check:"string_format",format:"uppercase",...Ce(e)})}function y3(e,t){return new M4({check:"string_format",format:"includes",...Ce(t),includes:e})}function v3(e,t){return new L4({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function x3(e,t){return new U4({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function Fs(e){return new I4({check:"overwrite",tx:e})}function b3(e){return Fs(t=>t.normalize(e))}function S3(){return Fs(e=>e.trim())}function w3(){return Fs(e=>e.toLowerCase())}function k3(){return Fs(e=>e.toUpperCase())}function j3(){return Fs(e=>RD(e))}function E3(e,t,n){return new e({type:"array",element:t,...Ce(n)})}function C3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ce(n)})}function N3(e){const t=_3(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(uu(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(uu(l))}},e(n.value,n)));return t}function _3(e,t){const n=new Un({check:"custom",...Ce(t)});return n._zod.check=e,n}function sj(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)??Yo,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Ft(e,t,n={path:[],schemaPath:[]}){var y,g;var 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 b=e._zod.parent;b&&(u.ref||(u.ref=b),Ft(b,t,x),t.seen.get(b).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&yn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function oj(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 E=(j=e.external.registry.get(y[0]))==null?void 0:j.id,_=e.external.uri??(O=>O);if(E)return{ref:_(E)};const A=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=A,{defId:A,ref:`${_("__shared")}#/${g}/${A}`}}if(y[1]===n)return{ref:"#"};const b=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:b+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:x,defId:b}=l(y);g.def={...g.schema},b&&(g.defId=b);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>
|
|
331
|
-
|
|
332
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const b=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&b){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 uj(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},b=y.ref;if(y.ref=null,b){a(b);const j=e.seen.get(b),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Object.assign(g,E),Object.assign(g,x),h._zod.parent===b)for(const A in g)A==="$ref"||A==="allOf"||A in x||delete g[A];if(E.$ref&&j.def)for(const A in g)A==="$ref"||A==="allOf"||A in j.def&&JSON.stringify(g[A])===JSON.stringify(j.def[A])&&delete g[A]}const k=h._zod.parent;if(k&&k!==b){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const E in g)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(g[E])===JSON.stringify(j.def[E])&&delete g[E]}e.override({zodSchema:h,jsonSchema:g,path:y.path??[]})};for(const h of[...e.seen.entries()].reverse())a(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(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:Cd(t,"input",e.processors),output:Cd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function yn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return yn(a.element,n);if(a.type==="set")return yn(a.valueType,n);if(a.type==="lazy")return yn(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 yn(a.innerType,n);if(a.type==="intersection")return yn(a.left,n)||yn(a.right,n);if(a.type==="record"||a.type==="map")return yn(a.keyType,n)||yn(a.valueType,n);if(a.type==="pipe")return yn(a.in,n)||yn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(yn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(yn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(yn(l,n))return!0;return!!(a.rest&&yn(a.rest,n))}return!1}const z3=(e,t={})=>n=>{const a=sj({...n,processors:t});return Ft(e,a),oj(a,e),uj(a,e)},Cd=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},u=sj({...l??{},target:o,io:t,processors:n});return Ft(e,u),oj(u,e),uj(u,e)},A3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},T3=(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=A3[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}))])}},R3=(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)},O3=(e,t,n,a)=>{n.type="boolean"},D3=(e,t,n,a)=>{n.not={}},M3=(e,t,n,a)=>{},L3=(e,t,n,a)=>{const l=e._zod.def,o=Pk(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},U3=(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},I3=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},B3=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},P3=(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=Ft(o.element,t,{...a,path:[...a.path,"items"]})},$3=(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]=Ft(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=Ft(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},F3=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Ft(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},q3=(e,t,n,a)=>{const l=e._zod.def,o=Ft(l.left,t,{...a,path:[...a.path,"allOf",0]}),u=Ft(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},H3=(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=Ft(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=Ft(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Ft(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)}},Z3=(e,t,n,a)=>{const l=e._zod.def,o=Ft(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"}]},V3=(e,t,n,a)=>{const l=e._zod.def;Ft(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},Q3=(e,t,n,a)=>{const l=e._zod.def;Ft(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},G3=(e,t,n,a)=>{const l=e._zod.def;Ft(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)))},K3=(e,t,n,a)=>{const l=e._zod.def;Ft(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},Y3=(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;Ft(o,t,a);const u=t.seen.get(e);u.ref=o},X3=(e,t,n,a)=>{const l=e._zod.def;Ft(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},cj=(e,t,n,a)=>{const l=e._zod.def;Ft(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},J3=ae("ZodISODateTime",(e,t)=>{J4.init(e,t),At.init(e,t)});function W3(e){return i3(J3,e)}const e6=ae("ZodISODate",(e,t)=>{W4.init(e,t),At.init(e,t)});function t6(e){return a3(e6,e)}const n6=ae("ZodISOTime",(e,t)=>{eM.init(e,t),At.init(e,t)});function r6(e){return l3(n6,e)}const i6=ae("ZodISODuration",(e,t)=>{tM.init(e,t),At.init(e,t)});function a6(e){return s3(i6,e)}const l6=(e,t)=>{Hk.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ZD(e,n)},flatten:{value:n=>HD(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ip,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ip,2)}},isEmpty:{get(){return e.issues.length===0}}})},vr=ae("ZodError",l6,{Parent:Error}),s6=Ag(vr),o6=Tg(vr),u6=Qd(vr),c6=Gd(vr),d6=GD(vr),f6=KD(vr),h6=YD(vr),m6=XD(vr),p6=JD(vr),g6=WD(vr),y6=e4(vr),v6=t4(vr),zt=ae("ZodType",(e,t)=>(_t.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cd(e,"input"),output:Cd(e,"output")}}),e.toJSONSchema=z3(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ca(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)=>Na(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>s6(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>u6(e,n,a),e.parseAsync=async(n,a)=>o6(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>c6(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>d6(e,n,a),e.decode=(n,a)=>f6(e,n,a),e.encodeAsync=async(n,a)=>h6(e,n,a),e.decodeAsync=async(n,a)=>m6(e,n,a),e.safeEncode=(n,a)=>p6(e,n,a),e.safeDecode=(n,a)=>g6(e,n,a),e.safeEncodeAsync=async(n,a)=>y6(e,n,a),e.safeDecodeAsync=async(n,a)=>v6(e,n,a),e.refine=(n,a)=>e.check(d5(n,a)),e.superRefine=n=>e.check(f5(n)),e.overwrite=n=>e.check(Fs(n)),e.optional=()=>p1(e),e.exactOptional=()=>J6(e),e.nullable=()=>g1(e),e.nullish=()=>p1(g1(e)),e.nonoptional=n=>i5(e,n),e.array=()=>Yn(e),e.or=n=>hj([e,n]),e.and=n=>V6(e,n),e.transform=n=>y1(e,Y6(n)),e.default=n=>t5(e,n),e.prefault=n=>r5(e,n),e.catch=n=>l5(e,n),e.pipe=n=>y1(e,n),e.readonly=()=>u5(e),e.describe=n=>{const a=e.clone();return Yo.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=Yo.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Yo.get(e);const a=e.clone();return Yo.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),dj=ae("_ZodString",(e,t)=>{Rg.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>T3(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(m3(...a)),e.includes=(...a)=>e.check(y3(...a)),e.startsWith=(...a)=>e.check(v3(...a)),e.endsWith=(...a)=>e.check(x3(...a)),e.min=(...a)=>e.check(Ed(...a)),e.max=(...a)=>e.check(aj(...a)),e.length=(...a)=>e.check(lj(...a)),e.nonempty=(...a)=>e.check(Ed(1,...a)),e.lowercase=a=>e.check(p3(a)),e.uppercase=a=>e.check(g3(a)),e.trim=()=>e.check(S3()),e.normalize=(...a)=>e.check(b3(...a)),e.toLowerCase=()=>e.check(w3()),e.toUpperCase=()=>e.check(k3()),e.slugify=()=>e.check(j3())}),x6=ae("ZodString",(e,t)=>{Rg.init(e,t),dj.init(e,t),e.email=n=>e.check(UM(b6,n)),e.url=n=>e.check(FM(S6,n)),e.jwt=n=>e.check(r3(L6,n)),e.emoji=n=>e.check(qM(w6,n)),e.guid=n=>e.check(u1(h1,n)),e.uuid=n=>e.check(IM(td,n)),e.uuidv4=n=>e.check(BM(td,n)),e.uuidv6=n=>e.check(PM(td,n)),e.uuidv7=n=>e.check($M(td,n)),e.nanoid=n=>e.check(HM(k6,n)),e.guid=n=>e.check(u1(h1,n)),e.cuid=n=>e.check(ZM(j6,n)),e.cuid2=n=>e.check(VM(E6,n)),e.ulid=n=>e.check(QM(C6,n)),e.base64=n=>e.check(e3(O6,n)),e.base64url=n=>e.check(t3(D6,n)),e.xid=n=>e.check(GM(N6,n)),e.ksuid=n=>e.check(KM(_6,n)),e.ipv4=n=>e.check(YM(z6,n)),e.ipv6=n=>e.check(XM(A6,n)),e.cidrv4=n=>e.check(JM(T6,n)),e.cidrv6=n=>e.check(WM(R6,n)),e.e164=n=>e.check(n3(M6,n)),e.datetime=n=>e.check(W3(n)),e.date=n=>e.check(t6(n)),e.time=n=>e.check(r6(n)),e.duration=n=>e.check(a6(n))});function D(e){return LM(x6,e)}const At=ae("ZodStringFormat",(e,t)=>{Ct.init(e,t),dj.init(e,t)}),b6=ae("ZodEmail",(e,t)=>{q4.init(e,t),At.init(e,t)}),h1=ae("ZodGUID",(e,t)=>{$4.init(e,t),At.init(e,t)}),td=ae("ZodUUID",(e,t)=>{F4.init(e,t),At.init(e,t)}),S6=ae("ZodURL",(e,t)=>{H4.init(e,t),At.init(e,t)}),w6=ae("ZodEmoji",(e,t)=>{Z4.init(e,t),At.init(e,t)}),k6=ae("ZodNanoID",(e,t)=>{V4.init(e,t),At.init(e,t)}),j6=ae("ZodCUID",(e,t)=>{Q4.init(e,t),At.init(e,t)}),E6=ae("ZodCUID2",(e,t)=>{G4.init(e,t),At.init(e,t)}),C6=ae("ZodULID",(e,t)=>{K4.init(e,t),At.init(e,t)}),N6=ae("ZodXID",(e,t)=>{Y4.init(e,t),At.init(e,t)}),_6=ae("ZodKSUID",(e,t)=>{X4.init(e,t),At.init(e,t)}),z6=ae("ZodIPv4",(e,t)=>{nM.init(e,t),At.init(e,t)}),A6=ae("ZodIPv6",(e,t)=>{rM.init(e,t),At.init(e,t)}),T6=ae("ZodCIDRv4",(e,t)=>{iM.init(e,t),At.init(e,t)}),R6=ae("ZodCIDRv6",(e,t)=>{aM.init(e,t),At.init(e,t)}),O6=ae("ZodBase64",(e,t)=>{lM.init(e,t),At.init(e,t)}),D6=ae("ZodBase64URL",(e,t)=>{oM.init(e,t),At.init(e,t)}),M6=ae("ZodE164",(e,t)=>{uM.init(e,t),At.init(e,t)}),L6=ae("ZodJWT",(e,t)=>{dM.init(e,t),At.init(e,t)}),Og=ae("ZodNumber",(e,t)=>{ej.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>R3(e,a,l),e.gt=(a,l)=>e.check(d1(a,l)),e.gte=(a,l)=>e.check(Im(a,l)),e.min=(a,l)=>e.check(Im(a,l)),e.lt=(a,l)=>e.check(c1(a,l)),e.lte=(a,l)=>e.check(Um(a,l)),e.max=(a,l)=>e.check(Um(a,l)),e.int=a=>e.check(m1(a)),e.safe=a=>e.check(m1(a)),e.positive=a=>e.check(d1(0,a)),e.nonnegative=a=>e.check(Im(0,a)),e.negative=a=>e.check(c1(0,a)),e.nonpositive=a=>e.check(Um(0,a)),e.multipleOf=(a,l)=>e.check(f1(a,l)),e.step=(a,l)=>e.check(f1(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 We(e){return o3(Og,e)}const U6=ae("ZodNumberFormat",(e,t)=>{fM.init(e,t),Og.init(e,t)});function m1(e){return c3(U6,e)}const I6=ae("ZodBoolean",(e,t)=>{hM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>O3(e,n,a)});function ku(e){return d3(I6,e)}const B6=ae("ZodUnknown",(e,t)=>{mM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>M3()});function St(){return f3(B6)}const P6=ae("ZodNever",(e,t)=>{pM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>D3(e,n,a)});function $6(e){return h3(P6,e)}const F6=ae("ZodArray",(e,t)=>{gM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>P3(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(Ed(n,a)),e.nonempty=n=>e.check(Ed(1,n)),e.max=(n,a)=>e.check(aj(n,a)),e.length=(n,a)=>e.check(lj(n,a)),e.unwrap=()=>e.element});function Yn(e,t){return E3(F6,e,t)}const q6=ae("ZodObject",(e,t)=>{vM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>$3(e,n,a,l),lt(e,"shape",()=>t.shape),e.keyof=()=>tt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:St()}),e.loose=()=>e.clone({...e._zod.def,catchall:St()}),e.strict=()=>e.clone({...e._zod.def,catchall:$6()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>BD(e,n),e.safeExtend=n=>PD(e,n),e.merge=n=>$D(e,n),e.pick=n=>UD(e,n),e.omit=n=>ID(e,n),e.partial=(...n)=>FD(pj,e,n[0]),e.required=(...n)=>qD(gj,e,n[0])});function fe(e,t){const n={type:"object",shape:e??{},...Ce(t)};return new q6(n)}const fj=ae("ZodUnion",(e,t)=>{rj.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>F3(e,n,a,l),e.options=t.options});function hj(e,t){return new fj({type:"union",options:e,...Ce(t)})}const H6=ae("ZodDiscriminatedUnion",(e,t)=>{fj.init(e,t),xM.init(e,t)});function mj(e,t,n){return new H6({type:"union",options:t,discriminator:e,...Ce(n)})}const Z6=ae("ZodIntersection",(e,t)=>{bM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>q3(e,n,a,l)});function V6(e,t){return new Z6({type:"intersection",left:e,right:t})}const Q6=ae("ZodRecord",(e,t)=>{SM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>H3(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function qt(e,t,n){return new Q6({type:"record",keyType:e,valueType:t,...Ce(n)})}const Pp=ae("ZodEnum",(e,t)=>{wM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>L3(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 Pp({...t,checks:[],...Ce(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 Pp({...t,checks:[],...Ce(l),entries:o})}});function tt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Pp({type:"enum",entries:n,...Ce(t)})}const G6=ae("ZodLiteral",(e,t)=>{kM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>U3(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Rn(e,t){return new G6({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const K6=ae("ZodTransform",(e,t)=>{jM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>B3(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Ik(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(uu(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(uu(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function Y6(e){return new K6({type:"transform",transform:e})}const pj=ae("ZodOptional",(e,t)=>{ij.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>cj(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function p1(e){return new pj({type:"optional",innerType:e})}const X6=ae("ZodExactOptional",(e,t)=>{EM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>cj(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function J6(e){return new X6({type:"optional",innerType:e})}const W6=ae("ZodNullable",(e,t)=>{CM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Z3(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function g1(e){return new W6({type:"nullable",innerType:e})}const e5=ae("ZodDefault",(e,t)=>{NM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Q3(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function t5(e,t){return new e5({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Fk(t)}})}const n5=ae("ZodPrefault",(e,t)=>{_M.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>G3(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function r5(e,t){return new n5({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Fk(t)}})}const gj=ae("ZodNonOptional",(e,t)=>{zM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>V3(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function i5(e,t){return new gj({type:"nonoptional",innerType:e,...Ce(t)})}const a5=ae("ZodCatch",(e,t)=>{AM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>K3(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function l5(e,t){return new a5({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const s5=ae("ZodPipe",(e,t)=>{TM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Y3(e,n,a,l),e.in=t.in,e.out=t.out});function y1(e,t){return new s5({type:"pipe",in:e,out:t})}const o5=ae("ZodReadonly",(e,t)=>{RM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>X3(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function u5(e){return new o5({type:"readonly",innerType:e})}const c5=ae("ZodCustom",(e,t)=>{OM.init(e,t),zt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>I3(e,n)});function d5(e,t={}){return C3(c5,e,t)}function f5(e){return N3(e)}const Bm={custom:"custom"};function Yd(e){return u3(Og,e)}const h5={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},yj=tt(["feishu","slack","kael"]),vj=tt(["active","inactive"]);fe({platform:yj,agentId:D().min(1),credentials:qt(D(),St()),status:vj.default("active")});fe({agentId:D().min(1).optional(),credentials:qt(D(),St()).optional(),status:vj.optional()});fe({id:We(),platform:D(),agentId:D(),hasCredentials:ku(),status:D(),createdAt:D(),updatedAt:D()});const m5=tt(["code","reverse_token","oauth","manual"]);fe({appId:D().min(1),appSecret:D().min(1)});fe({platform:yj,externalUserId:D().min(1),agentId:D().min(1),boundVia:m5.default("manual"),displayName:D().max(200).optional()});fe({id:We(),platform:D(),externalUserId:D(),agentId:D(),boundVia:D().nullable(),displayName:D().nullable(),createdAt:D()});fe({feishuUserId:D().min(1),displayName:D().max(200).optional()});fe({configId:We(),platform:D(),agentId:D(),appId:D(),connected:ku(),lastActiveAt:D().nullable()});const xj=tt(["online","offline"]),bj=tt(["idle","working","blocked","error"]);tt(["active","suspended","evicted"]);const p5=tt(["active","suspended"]);fe({chatId:D().min(1),state:p5});fe({runtimeState:bj});fe({agentId:D().min(1),runtimeType:D().max(50),runtimeVersion:D().max(50).optional()});tt(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);fe({agentId:D(),status:xj,connectedAt:D().nullable(),lastSeenAt:D(),clientId:D().nullable().optional(),runtimeType:D().nullable().optional(),runtimeVersion:D().nullable().optional(),runtimeState:bj.nullable().optional(),activeSessions:We().int().nullable().optional(),totalSessions:We().int().nullable().optional(),runtimeUpdatedAt:D().nullable().optional()});fe({total:We().int(),running:We().int(),byState:fe({idle:We().int(),working:We().int(),blocked:We().int(),error:We().int()}),clients:We().int()});const g5={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Xd=tt(["human","personal_assistant","autonomous_agent"]),v1={PRIVATE:"private",ORGANIZATION:"organization"},Dg=tt(["private","organization"]),y5=tt(["admin-api","portal"]);tt(["active","suspended"]);fe({name:D().min(1).max(100).regex(/^[a-z0-9_-]+$/,"Only lowercase alphanumeric, hyphens, and underscores").optional(),type:Xd,displayName:D().max(200).optional(),delegateMention:D().max(100).optional(),organizationId:D().max(100).optional(),source:y5.optional(),visibility:Dg.optional(),metadata:qt(D(),St()).optional(),managerId:D().optional(),clientId:D().min(1).max(100).optional()});fe({type:Xd.optional(),displayName:D().max(200).nullable().optional(),delegateMention:D().max(100).nullable().optional(),visibility:Dg.optional(),metadata:qt(D(),St()).optional(),managerId:D().nullable().optional(),clientId:D().min(1).max(100).nullable().optional()});fe({uuid:D(),name:D().nullable(),organizationId:D(),type:Xd,displayName:D().nullable(),delegateMention:D().nullable(),inboxId:D(),status:D(),source:D().nullable().optional(),cloudUserId:D().nullable().optional(),visibility:Dg,metadata:qt(D(),St()),managerId:D().nullable(),clientId:D().nullable(),presenceStatus:xj.optional(),createdAt:D(),updatedAt:D()});fe({repo:D().nullable(),branch:D().nullable()});fe({type:Rn("agent:pinned"),agentId:D(),name:D().nullable(),displayName:D().nullable(),agentType:Xd});const v5=32e3,Mg=/^[a-z0-9][a-z0-9_-]{0,63}$/i,x5=/^[A-Z][A-Z0-9_]*$/,b5=fe({append:D().max(v5).default("")}),S5=fe({name:D().regex(Mg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Rn("stdio"),command:D().min(1),args:Yn(D()).optional()}),w5=fe({name:D().regex(Mg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Rn("http"),url:D().url(),headers:qt(D(),D()).optional()}),k5=fe({name:D().regex(Mg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Rn("sse"),url:D().url(),headers:qt(D(),D()).optional()}),j5=mj("transport",[S5,w5,k5]),E5=fe({key:D().regex(x5,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:D(),sensitive:ku().default(!1)}),C5=fe({url:D().min(1),ref:D().min(1).optional(),localPath:D().min(1).optional()}),Lg=fe({prompt:b5.default({append:""}),model:D().default(""),mcpServers:Yn(j5).default([]),env:Yn(E5).default([]),gitRepos:Yn(C5).default([])}),N5=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:Bm.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:Bm.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??Nd(o.url);f&&(l.has(f)&&t.addIssue({code:Bm.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},Sj=Lg.superRefine(N5),_5=fe({agentId:D(),version:We().int().positive(),payload:Sj,updatedAt:D(),updatedBy:D()});fe({expectedVersion:We().int().positive(),payload:Lg.partial()});fe({payload:Lg.partial()});fe({current:_5,next:Sj,diff:Yn(fe({path:D(),op:tt(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const $p="***";function Nd(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}fe({username:D().min(1),password:D().min(1)});fe({accessToken:D(),refreshToken:D()});fe({refreshToken:D().min(1)});fe({token:D().min(1)});fe({token:D(),expiresIn:We(),command:D()});const z5=tt(["direct","group","thread"]);fe({type:z5,topic:D().max(500).optional(),participantIds:Yn(D()).min(1),metadata:qt(D(),St()).optional()});const A5=fe({agentId:D(),role:D(),mode:D(),joinedAt:D()}),T5=fe({id:D(),organizationId:D(),type:D(),topic:D().nullable(),lifecyclePolicy:D().nullable().optional(),metadata:qt(D(),St()),createdAt:D(),updatedAt:D()});T5.extend({participants:Yn(A5)});fe({topic:D().trim().max(500).nullable()});fe({agentId:D().min(1),mode:tt(["full","mention_only"]).default("full")});fe({agentId:D().min(1)});const R5=tt(["connected","disconnected"]);fe({id:D(),userId:D().nullable(),status:R5,sdkVersion:D().max(50).nullable(),hostname:D().max(100).nullable(),os:D().max(50).nullable(),agentCount:We().int().min(0),connectedAt:D().nullable(),lastSeenAt:D(),metadata:qt(D(),St()).nullable()});fe({clientId:D().min(1).max(100),hostname:D().max(100).optional(),os:D().max(50).optional(),sdkVersion:D().max(50).optional()});fe({limit:Yd().int().min(1).max(100).default(20),cursor:D().optional()});const Ug=tt(["hub_ui","cli","feishu","github","api"]),wj=tt(["text","markdown","card","reference","file","task"]);fe({format:wj.default("text"),content:St(),metadata:qt(D(),St()).optional(),inReplyTo:D().optional(),replyToInbox:D().optional(),replyToChat:D().optional(),source:Ug.optional()});fe({format:wj.default("text"),content:St(),metadata:qt(D(),St()).optional(),replyToInbox:D().optional(),replyToChat:D().optional(),source:Ug.optional()});const O5=fe({id:D(),chatId:D(),senderId:D(),format:D(),content:St(),metadata:qt(D(),St()),replyToInbox:D().nullable(),replyToChat:D().nullable(),inReplyTo:D().nullable(),source:Ug.nullable(),createdAt:D()}),D5=O5.extend({configVersion:We().int().positive()});tt(["pending","delivered","acked","failed"]);const M5=fe({id:We(),inboxId:D(),messageId:D(),chatId:D().nullable(),status:D(),retryCount:We(),createdAt:D(),deliveredAt:D().nullable(),ackedAt:D().nullable()});M5.extend({message:D5});fe({limit:Yd().int().min(1).max(50).default(10)});const L5={ADMIN:"admin",MEMBER:"member"},Ig=tt(["admin","member"]),U5=fe({id:D(),userId:D(),organizationId:D(),agentId:D(),role:Ig,createdAt:D()});fe({username:D().min(1).max(100),displayName:D().min(1).max(200),role:Ig.default("member")});fe({role:Ig.optional(),displayName:D().min(1).max(200).optional()});U5.extend({username:D(),displayName:D(),password:D()});const I5=tt(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),kj=tt(["high","medium","low"]);fe({id:D(),organizationId:D(),type:I5,severity:kj,agentId:D().nullable(),chatId:D().nullable(),message:D(),read:ku(),createdAt:D()});fe({limit:Yd().int().min(1).max(100).default(20),cursor:D().optional(),severity:kj.optional(),read:tt(["true","false"]).transform(e=>e==="true").optional(),agentId:D().optional()});const jj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;fe({name:D().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=>!jj.test(e),"Name must not be a UUID format"),displayName:D().min(1).max(200),maxAgents:We().int().min(0).default(0),maxMessagesPerMinute:We().int().min(0).default(0),features:qt(D(),St()).default({})});fe({name:D().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=>!jj.test(e),"Name must not be a UUID format").optional(),displayName:D().min(1).max(200).optional(),maxAgents:We().int().min(0).optional(),maxMessagesPerMinute:We().int().min(0).optional(),features:qt(D(),St()).optional()});fe({id:D(),name:D(),displayName:D(),maxAgents:We(),maxMessagesPerMinute:We(),features:qt(D(),St()),createdAt:D(),updatedAt:D()});const B5=fe({workingCount:We().int().nonnegative(),errorMask:ku()}),P5=fe({type:Rn("pulse:tick"),organizationId:D(),agents:qt(D(),Yn(B5).length(32))}),$5=tt(["tool_call","error","assistant_text","thinking","turn_end"]),Ej=fe({toolUseId:D(),name:D(),args:St(),status:tt(["pending","ok","error"]),durationMs:We().int().nonnegative().optional(),resultPreview:D().max(400).optional()}),Cj=fe({source:tt(["sdk","runtime","tool"]),message:D().max(2e3)}),Nj=fe({text:D().max(8e3)}),_j=fe({}),zj=fe({status:tt(["success","error"])}),F5=mj("kind",[fe({kind:Rn("tool_call"),payload:Ej}),fe({kind:Rn("error"),payload:Cj}),fe({kind:Rn("assistant_text"),payload:Nj}),fe({kind:Rn("thinking"),payload:_j}),fe({kind:Rn("turn_end"),payload:zj})]);fe({id:D(),agentId:D(),chatId:D(),seq:We().int().positive(),kind:$5,payload:hj([Ej,Cj,Nj,_j,zj]),createdAt:D()});fe({agentId:D(),chatId:D(),event:F5});fe({agentId:D(),chatId:D()});fe({type:Rn("session:reconcile"),agentId:D().min(1),chatIds:Yn(D().min(1)).max(500)});fe({type:Rn("session:reconcile:result"),agentId:D().min(1),staleChatIds:Yn(D().min(1))});const q5=fe({organizationId:D(),agentCount:We(),chatCount:We(),messageCount:We()});fe({totalAgents:We(),totalChats:We(),totalMessages:We(),byOrganization:Yn(q5)});fe({key:D(),value:St(),updatedAt:D()});qt(D(),St());const ya={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},gd={[ya.INBOX_TIMEOUT_SECONDS]:300,[ya.MAX_RETRY_COUNT]:3,[ya.POLLING_INTERVAL_SECONDS]:5,[ya.PRESENCE_CLEANUP_SECONDS]:60},cu=tt(["pending","assigned","working","completed","failed","cancelled"]),x1=tt(["agent","admin"]),H5=tt(["assigned","status_changed","cancelled"]);fe({taskId:D(),event:H5,title:D(),body:D().default(""),status:cu,fromStatus:cu.optional(),originRef:D().nullable().optional()});const Z5=fe({title:D().min(1).max(500),body:D().optional(),assigneeAgentId:D().optional(),originRef:D().max(500).optional(),metadata:qt(D(),St()).optional()});Z5.extend({organizationId:D().optional()});fe({status:tt(["working","completed","failed"]),result:D().optional()});fe({assigneeAgentId:D().nullable().optional(),status:cu.optional(),result:D().optional()});fe({chatId:D().min(1)});const V5=fe({id:D(),organizationId:D(),title:D(),body:D(),status:cu,assigneeAgentId:D().nullable(),createdByType:x1,createdById:D(),originRef:D().nullable(),result:D().nullable(),metadata:qt(D(),St()),createdAt:D(),updatedAt:D(),cancelledAt:D().nullable(),cancelledByType:x1.nullable(),cancelledById:D().nullable()}),Q5=fe({taskId:D(),chatId:D(),linkedByAgentId:D().nullable(),linkedAt:D()});V5.extend({chats:Yn(Q5)});fe({status:cu.optional(),assigneeAgentId:D().optional(),originRef:D().optional(),limit:Yd().int().min(1).max(100).default(20),cursor:D().optional()});const G5=tt(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);fe({taskId:D(),signal:G5,reason:D()});const K5=tt(["active","suspended"]);fe({id:D(),username:D(),displayName:D(),avatarUrl:D().nullable(),status:K5,createdAt:D(),updatedAt:D()});fe({username:D().min(1).max(100),displayName:D().min(1).max(200),password:D().min(8).max(200)});fe({displayName:D().min(1).max(200).optional(),password:D().min(8).max(200).optional()});fe({type:Rn("auth"),token:D().min(1)});fe({type:Rn("server:welcome"),serverCommandVersion:D().min(1),serverTimeMs:We().int().nonnegative()}).passthrough();const Aj=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function Y5(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 X5=2e3,J5=3e4;let sa=null,_d=!1,Pm=0,Jo=null;const Fp=new Set;let Xo=null,ys=0;function W5(e){for(const t of Fp)try{t(e)}catch{}Xo&&(e.type==="notification"?Xo.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(Xo.invalidateQueries({queryKey:["activity"]}),Xo.invalidateQueries({queryKey:["sessions"]})))}function Tj(){const e=vg();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);sa=a,a.onmessage=l=>{if(a===sa)try{const o=JSON.parse(l.data);W5(o)}catch{}},a.onopen=()=>{a===sa&&(Pm=0)},a.onclose=()=>{if(a!==sa||(sa=null,_d||ys===0))return;Pm++;const l=Math.min(X5*2**(Pm-1),J5);Jo=setTimeout(()=>{Jo=null,!_d&&ys>0&&Tj()},l)}}function eL(){_d=!0,Jo&&(clearTimeout(Jo),Jo=null),sa&&(sa.close(1e3,"unmount"),sa=null)}function Rj(e){const{onMessage:t,enabled:n=!0}=e??{},a=Wn(),l=S.useRef(t);l.current=t,S.useEffect(()=>{Xo=a},[a]),S.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return Fp.add(o),ys++,ys===1&&(_d=!1,Tj()),()=>{Fp.delete(o),ys--,ys===0&&eL()}},[n])}const Oj=S.createContext({aggregated:Aj,agents:{},receivedAtMs:null,stale:!0});function tL({children:e}){const[t,n]=S.useState({aggregated:Aj,agents:{},receivedAtMs:null}),[a,l]=S.useState(()=>Date.now());Rj({onMessage:u=>{const f=P5.safeParse(u);f.success&&n({aggregated:Y5(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),S.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=S.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return d.jsx(Oj.Provider,{value:o,children:e})}function nL(){return S.useContext(Oj)}function Jd({title:e,subtitle:t,right:n,className:a,style:l,...o}){return d.jsxs("div",{className:Te("flex items-baseline gap-3 shrink-0",a),style:{padding:"12px 20px 10px",borderBottom:"1px solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[d.jsx("h1",{className:"m-0",style:{fontSize:16,fontWeight:600,letterSpacing:-.2,color:"var(--fg)"},children:e}),t&&d.jsx("span",{style:{fontSize:11.5,color:"var(--fg-3)"},children:t}),d.jsx("div",{style:{flex:1}}),n]})}function Dj({className:e,style:t,...n}){return d.jsx("div",{className:Te("flex items-end",e),style:{gap:2,height:34,padding:"0 20px",borderBottom:"1px solid var(--border)",background:"var(--bg-raised)",...t},...n})}function Mj({active:e,onClick:t,children:n}){return d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent",style:{padding:"7px 12px",marginBottom:-1,borderBottom:`2px solid ${e?"var(--accent)":"transparent"}`,fontSize:12,fontWeight:500,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:a=>{e||(a.currentTarget.style.color="var(--fg)")},onMouseLeave:a=>{e||(a.currentTarget.style.color="var(--fg-3)")},children:n})}function Wt({tone:e="neutral",className:t,style:n,...a}){const l=rL[e],o={background:l.bg,color:l.fg,border:`1px solid ${l.bd}`,...n};return d.jsx("span",{className:Te("mono inline-flex items-center uppercase",t),style:{fontSize:10,padding:"1px 7px",borderRadius:3,letterSpacing:"0.06em",lineHeight:1.6,...o},...a})}const rL={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)"}},Si=S.forwardRef(({className:e,...t},n)=>d.jsx("table",{ref:n,className:Te("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));Si.displayName="DenseTable";const wi=S.forwardRef(({className:e,...t},n)=>d.jsx("thead",{ref:n,className:e,...t}));wi.displayName="DenseTableHeader";const ki=S.forwardRef(({className:e,...t},n)=>d.jsx("tbody",{ref:n,className:e,...t}));ki.displayName="DenseTableBody";const Qt=S.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>d.jsx("tr",{ref:o,className:Te("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...a},...l}));Qt.displayName="DenseTableRow";const ze=S.forwardRef(({className:e,style:t,...n},a)=>d.jsx("th",{ref:a,className:Te("mono text-left uppercase font-medium whitespace-nowrap",e),style:{padding:"8px 12px",fontSize:9.5,letterSpacing:"0.09em",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"1px solid var(--border)",...t},...n}));ze.displayName="DenseTableHead";const Ee=S.forwardRef(({className:e,style:t,...n},a)=>d.jsx("td",{ref:a,className:Te("align-middle",e),style:{padding:"9px 12px",borderBottom:"1px solid var(--border-faint)",fontSize:12,...t},...n}));Ee.displayName="DenseTableCell";const Fr=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6},...t}));Fr.displayName="Panel";const Lj=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex items-center justify-between gap-3",e),style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},...t}));Lj.displayName="PanelHeader";const Uj=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("inline-flex items-center gap-2 font-semibold text-[12px]",e),style:{color:"var(--fg)"},...t}));Uj.displayName="PanelTitle";const iL=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te(e),style:{padding:"12px 14px"},...t}));iL.displayName="PanelBody";function Ms({children:e,right:t,className:n,style:a,...l}){return d.jsxs("div",{className:Te("mono flex items-center justify-between uppercase",n),style:{padding:"7px 14px",fontSize:9,letterSpacing:"0.12em",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"1px solid var(--border-faint)",...a},...l,children:[d.jsx("span",{children:e}),t]})}function ju({className:e,style:t,...n}){return d.jsx("span",{className:Te("mono uppercase",e),style:{fontSize:10,letterSpacing:"0.08em",color:"var(--fg-3)",...t},...n})}function Bg(){return De.get("/members")}function aL(e){return De.post("/members",e)}function lL(e,t){return De.patch(`/members/${encodeURIComponent(e)}`,t)}function sL(e){return De.delete(`/members/${encodeURIComponent(e)}`)}function Pg(){const{data:e}=qe({queryKey:["members","name-map"],queryFn:Bg,staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function oL(){const e=qr(),t=Pg(),{data:n,isLoading:a,error:l}=qe({queryKey:["admin-all-agents"],queryFn:()=>pD({limit:100})});return d.jsxs("div",{children:[d.jsx("p",{style:{fontSize:11.5,color:"var(--fg-3)",padding:"0 2px 10px"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),d.jsxs(Fr,{children:[d.jsxs(Ms,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)",fontSize:12},children:"Loading…"}):l?d.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)",fontSize:12},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)",fontSize:12},children:"No agents"}):d.jsxs(Si,{children:[d.jsx(wi,{children:d.jsxs(Qt,{children:[d.jsx(ze,{children:"Name"}),d.jsx(ze,{children:"Display"}),d.jsx(ze,{children:"Type"}),d.jsx(ze,{children:"Visibility"}),d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(ki,{children:n.items.map(o=>d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:500},children:o.name??o.uuid.slice(0,8)})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:o.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),d.jsx(Ee,{style:{fontSize:11.5,color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),d.jsx(Ee,{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:bi(o.createdAt)})]},o.uuid))})]})]})]})}const b1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,S1=bw,uL=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return S1(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=b1(y)||b1(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,...b}=y;return Object.entries(b).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,x]:h},[]);return S1(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},cL=uL("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm 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-white 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 rounded-md px-3 text-xs",xs:"h-7 rounded px-2.5 text-xs gap-1.5",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ve=S.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const u=a?qO:"button";return d.jsx(u,{className:Te(cL({variant:t,size:n,className:e})),ref:o,...l})});ve.displayName="Button";const vt=S.forwardRef(({className:e,type:t,...n},a)=>d.jsx("input",{type:t,className:Te("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm 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}));vt.displayName="Input";var dL="Label",Ij=S.forwardRef((e,t)=>d.jsx(Ci.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())}}));Ij.displayName=dL;var fL=Ij;const Je=S.forwardRef(({className:e,...t},n)=>d.jsx(fL,{ref:n,className:Te("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Je.displayName="Label";const Bj=Object.values(L5);function hL(e,t){const n=(e==null?void 0:e.trim())||t,a=n.split(/[\s._-]+/).filter(Boolean);if(a.length>=2){const l=a[0]??"",o=a[1]??"";return`${l[0]??""}${o[0]??""}`.toUpperCase()}return n.slice(0,2).toUpperCase()}function mL(){const e=Wn(),{memberId:t}=ji(),[n,a]=S.useState(!1),[l,o]=S.useState({username:"",displayName:"",role:"member"}),[u,f]=S.useState(null),[m,h]=S.useState(null),{data:y,isLoading:g,error:x}=qe({queryKey:["members"],queryFn:Bg}),b=yt({mutationFn:()=>aL({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:A=>{e.invalidateQueries({queryKey:["members"]}),f(A.password)}}),k=yt({mutationFn:sL,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(A){A.preventDefault(),b.mutate()}function _(A){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(A)}return d.jsxs(d.Fragment,{children:[d.jsxs(Fr,{children:[d.jsxs(Ms,{right:d.jsxs(On,{open:n,onOpenChange:A=>A?a(!0):j(),children:[d.jsx(dD,{asChild:!0,children:d.jsxs(ve,{size:"xs",className:"normal-case tracking-normal",children:[d.jsx(gl,{className:"h-3 w-3"}),"Add member"]})}),d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:u?"Member Created":"Create Member"})}),u?d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),d.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"1px solid var(--border-faint)"},children:[d.jsx("code",{className:"flex-1 text-sm mono",children:u}),d.jsx(ve,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(u),title:"Copy password",children:d.jsx(xg,{className:"h-4 w-4"})})]}),d.jsx(Dn,{children:d.jsx(ve,{onClick:j,children:"Done"})})]}):d.jsxs("form",{onSubmit:E,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"member-username",children:"Username"}),d.jsx(vt,{id:"member-username",type:"text",value:l.username,onChange:A=>o({...l,username:A.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"member-name",children:"Display Name"}),d.jsx(vt,{id:"member-name",value:l.displayName,onChange:A=>o({...l,displayName:A.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"member-role",children:"Role"}),d.jsx("select",{id:"member-role",value:l.role,onChange:A=>o({...l,role:A.target.value}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:Bj.map(A=>d.jsx("option",{value:A,children:A},A))})]}),b.error instanceof Error&&d.jsx("div",{className:"text-sm",style:{color:"var(--state-error)"},children:b.error.message}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:b.isPending,children:b.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)",fontSize:12},children:"Loading…"}):x?d.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)",fontSize:12},children:["Failed to load members: ",x instanceof Error?x.message:"Unknown error"]}):(y==null?void 0:y.length)===0?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)",fontSize:12},children:"No members"}):d.jsxs(Si,{children:[d.jsx(wi,{children:d.jsxs(Qt,{children:[d.jsx(ze,{style:{width:30}}),d.jsx(ze,{children:"Username"}),d.jsx(ze,{children:"Name"}),d.jsx(ze,{children:"Role"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:1}})]})}),d.jsx(ki,{children:y==null?void 0:y.map(A=>{const O=t===A.id;return d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono inline-flex items-center justify-center",style:{width:22,height:22,borderRadius:4,background:O?"var(--accent-bg)":"var(--bg-active)",border:"1px solid var(--border-strong)",fontSize:9.5,fontWeight:600,color:O?"var(--accent-dim)":"var(--fg-2)"},children:hL(A.displayName,A.username)})}),d.jsxs(Ee,{children:[d.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:500},children:A.username}),O&&d.jsx(ju,{style:{marginLeft:6},children:"you"})]}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:A.displayName}),d.jsx(Ee,{children:d.jsx(Wt,{tone:A.role==="admin"?"accent":"neutral",children:A.role})}),d.jsx(Ee,{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:bi(A.createdAt)}),d.jsx(Ee,{style:{whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-0.5 justify-end",children:[d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:A.id,username:A.username,displayName:A.displayName,role:A.role}),title:"Edit",children:d.jsx(Bd,{className:"h-3.5 w-3.5"})}),d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>_(A.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:d.jsx(au,{className:"h-3.5 w-3.5"})})]})})]},A.id)})})]})]}),d.jsx(pL,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function pL({target:e,onClose:t,onSaved:n}){const[a,l]=S.useState(""),[o,u]=S.useState("member"),[f,m]=S.useState(null);S.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=yt({mutationFn:async()=>{if(!e)throw new Error("No target");const x={};return a.trim()&&a!==e.displayName&&(x.displayName=a.trim()),o!==e.role&&(x.role=o),Object.keys(x).length===0?e:lL(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 d.jsx(On,{open:g,onOpenChange:x=>x?void 0:t(),children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Edit Member"})}),e&&d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{children:"Username"}),d.jsx(vt,{value:e.username,disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-xs",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"edit-member-display",children:"Display Name"}),d.jsx(vt,{id:"edit-member-display",value:a,onChange:x=>l(x.target.value),required:!0,maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"edit-member-role",children:"Role"}),d.jsx("select",{id:"edit-member-role",value:o,onChange:x=>u(x.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:Bj.map(x=>d.jsx("option",{value:x,children:x},x))}),d.jsx("p",{className:"text-xs",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&d.jsx("p",{className:"text-sm",style:{color:"var(--state-error)"},children:f}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),d.jsx(ve,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function gL(){return De.get("/admin/system/config")}function yL(e){return De.patch("/admin/system/config",e)}const Pj=[{key:ya.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:ya.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:ya.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:ya.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],w1=Pj.map(e=>e.key);function vL(){const e=Wn(),{data:t,isLoading:n}=qe({queryKey:["system-config"],queryFn:gL}),[a,l]=S.useState({}),[o,u]=S.useState(!1);S.useEffect(()=>{if(!t)return;const y={};for(const g of w1){const x=t[g]??gd[g]??"";y[g]=String(x)}l(y)},[t]);const f=yt({mutationFn:()=>{const y={};for(const[g,x]of Object.entries(a)){const b=x.trim();if(b==="")y[g]=gd[g]??0;else{const k=Number(b);y[g]=Number.isNaN(k)?b:k}}return yL(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}});function m(){const y={};for(const g of w1)y[g]=String(gd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return d.jsx("form",{onSubmit:h,children:d.jsxs(Fr,{children:[d.jsxs(Lj,{children:[d.jsx(Uj,{children:"System configuration"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&d.jsx("span",{className:"mono",style:{fontSize:10.5,color:"var(--accent-dim)"},children:"saved"}),d.jsx(ve,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),d.jsxs(ve,{type:"submit",size:"xs",disabled:f.isPending,children:[d.jsx(Id,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),d.jsxs("div",{style:{padding:"4px 16px 14px"},children:[n?d.jsx("div",{className:"py-6",style:{color:"var(--fg-3)",fontSize:12},children:"Loading…"}):Pj.map(y=>d.jsx(xL,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&d.jsx("div",{className:"text-sm pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})}function xL({field:e,value:t,onChange:n}){const a=String(gd[e.key]??"—");return d.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr 180px",padding:"14px 0",borderTop:"1px solid var(--border-faint)"},children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{style:{fontSize:12.5,fontWeight:500,color:"var(--fg)"},children:e.label}),d.jsx("span",{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:e.key})]}),d.jsx("div",{style:{fontSize:11,color:"var(--fg-3)",marginTop:2},children:e.description}),d.jsxs(ju,{style:{marginTop:4,display:"block"},children:["default"," ",d.jsx("span",{className:"mono",style:{color:"var(--fg-3)",textTransform:"none",letterSpacing:0},children:a})]})]}),d.jsxs("div",{style:{position:"relative"},children:[d.jsx("input",{value:t,onChange:l=>n(l.target.value),className:"w-full outline-none mono",style:{padding:`5px ${e.unit?56:10}px 5px 10px`,fontSize:12,background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,color:"var(--fg)"}}),e.unit&&d.jsx("span",{className:"mono",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",fontSize:10,color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const k1=[{key:"members",label:"Members"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function bL(){const{role:e}=ji(),t=yr(),n=qr();if(e===null)return d.jsx("div",{style:{padding:20,color:"var(--fg-3)",fontSize:12},children:"Loading…"});if(e!=="admin")return d.jsx(hg,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=k1.some(u=>u.key===a)?a:"members",o=u=>{n({hash:u},{replace:!0})};return d.jsxs("div",{className:"-m-6",children:[d.jsx(Jd,{title:"Admin",subtitle:"Organization-wide controls"}),d.jsx(Dj,{children:k1.map(u=>d.jsx(Mj,{active:l===u.key,onClick:()=>o(u.key),children:u.label},u.key))}),d.jsxs("div",{style:{padding:"16px 20px 28px"},children:[l==="members"&&d.jsx(mL,{}),l==="all-agents"&&d.jsx(oL,{}),l==="settings"&&d.jsx(vL,{})]})]})}function $j(){return De.get("/admin/adapter-mappings")}function SL(e){return De.post("/admin/adapter-mappings",e)}function wL(e){return De.delete(`/admin/adapter-mappings/${e}`)}function Fj(){return De.get("/admin/adapters/status")}function qj(){return De.get("/admin/adapters")}function kL(e){return De.post("/admin/adapters",e)}function jL(e,t){return De.patch(`/admin/adapters/${e}`,t)}function EL(e){return De.delete(`/admin/adapters/${e}`)}function CL(e){return De.get(`/admin/agents/${e}/config`)}function NL(e,t){return De.patch(`/admin/agents/${e}/config`,t)}function _L(e,t){return De.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function zL(e){return De.get(`/admin/agents/${e}/client-status`)}function AL({className:e,style:t,...n}){return d.jsx("div",{className:Te("flex items-center",e),style:{gap:6,fontSize:12,color:"var(--fg-3)",...t},...n})}function TL({onClick:e,children:t}){return d.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function RL(){return d.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function OL({children:e,mono:t}){return d.jsx("span",{className:t?"mono":void 0,style:{color:"var(--fg)",fontWeight:500},children:e})}function hl({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?d.jsxs("span",{className:Te("shrink-0",n),style:a,role:"img","aria-label":"working",children:[d.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),d.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"1px solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?d.jsx("span",{className:Te("shrink-0",n),style:{...a,border:"1.5px dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:d.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?d.jsx("span",{className:Te("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?d.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):d.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",border:"1px solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function DL(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function ml({state:e,className:t}){const n=e!==null&&DL(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return d.jsxs("span",{className:Te("mono inline-flex items-center gap-1.5 uppercase tracking-wider",t),style:{fontSize:10,letterSpacing:.06,color:a},children:[d.jsx(hl,{state:n,size:7}),n]})}function nd({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-sunken)",borderRadius:4},children:[d.jsx("div",{className:"mono uppercase",style:{fontSize:9,letterSpacing:"0.08em",color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono",style:{fontSize:15,fontWeight:600,color:n??"var(--fg)",marginTop:1},children:t})]})}function ML(e){const{agent:t}=e,[n,a]=S.useState(!1),l=t.displayName||t.name||t.uuid;return d.jsxs("section",{style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"1px solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center gap-2",style:{padding:"10px 14px"},children:[d.jsx(QA,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),d.jsx("h3",{style:{fontSize:12,fontWeight:600,color:"var(--state-error)"},children:"Danger zone"})]}),d.jsxs("div",{children:[t.status==="active"?d.jsx($m,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:d.jsx(ve,{variant:"outline",size:"xs",onClick:e.onSuspend,disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):d.jsx($m,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:d.jsx(ve,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),d.jsx($m,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:d.jsxs(ve,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[d.jsx(au,{className:"h-3 w-3"}),"Delete"]})})]}),d.jsx(LL,{open:n,onOpenChange:a,expected:l,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function $m(e){return d.jsxs("div",{className:"flex items-start justify-between gap-4",style:{padding:"10px 14px",borderTop:"1px solid color-mix(in oklch, var(--state-error) 14%, transparent)",fontSize:12},children:[d.jsxs("div",{children:[d.jsx("p",{style:{fontWeight:500,color:"var(--fg)"},children:e.title}),d.jsx("p",{style:{fontSize:11,color:"var(--fg-3)"},children:e.body})]}),d.jsx("div",{children:e.action})]})}function LL({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,u]=S.useState("");function f(m){m.preventDefault(),o===n&&a()}return d.jsx(On,{open:e,onOpenChange:m=>{t(m),m||u("")},children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsxs(Mn,{children:['Delete "',n,'"?']})}),d.jsxs("form",{onSubmit:f,className:"space-y-4",children:[d.jsxs("p",{className:"text-sm text-muted-foreground",children:["This action cannot be undone. Type ",d.jsx("span",{className:"font-mono font-medium text-gray-900",children:n})," ","to confirm."]}),d.jsx(vt,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(ve,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const UL={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-green-100 text-green-900"},modified:{label:"changed",tone:"bg-amber-100 text-amber-900"},deleted:{label:"will be removed on save",tone:"bg-red-100 text-red-900"}};function $g({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const u=UL[e],f=e==="deleted";return d.jsxs("div",{className:Te("flex items-center gap-2 rounded border px-3 py-2 text-sm",f?"bg-red-50 border-red-200 text-red-900 line-through decoration-red-300":"bg-white"),children:[d.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&d.jsx("span",{className:Te("text-xs rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?d.jsxs(ve,{size:"sm",variant:"ghost",onClick:a,children:[d.jsx(KA,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):d.jsx(IL,{onEdit:t,onDelete:n}))]})}function IL({onEdit:e,onDelete:t}){return d.jsxs("div",{className:"flex gap-1",children:[d.jsx(ve,{size:"sm",variant:"ghost",onClick:e,title:"Edit",children:"Edit"}),d.jsxs(ve,{size:"sm",variant:"ghost",onClick:t,title:"Delete",children:[d.jsx(pA,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function BL(e){const[t,n]=S.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("h3",{style:{fontSize:12,fontWeight:600,color:"var(--fg)"},children:["Environment Variables (",a,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No environment variables."}):e.items.map(l=>d.jsxs($g,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"font-mono font-medium",children:l.value.key}),d.jsx("span",{className:"font-mono text-xs text-muted-foreground truncate max-w-xs",children:l.value.sensitive?"••••••":l.value.value||d.jsx("em",{children:"(empty)"})}),l.value.sensitive&&d.jsx(wA,{className:"h-3 w-3 text-muted-foreground"})]},l.key))}),t&&d.jsx(PL,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function PL({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.key)??""),[f,m]=S.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=S.useState((n==null?void 0:n.sensitive)??!1),[g,x]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),x(null))},[e,n]);function b(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=$p),!h&&!n&&!f){x("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit environment variable":"Add environment variable"})}),d.jsxs("form",{onSubmit:b,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"env-key",children:"Key"}),d.jsx(vt,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&d.jsx("p",{className:"text-xs text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"env-value",children:"Value"}),d.jsx(vt,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:k=>y(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),g&&d.jsx("p",{className:"text-sm text-destructive",children:g}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function $L(e){const[t,n]=S.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("h3",{style:{fontSize:12,fontWeight:600,color:"var(--fg)"},children:["Git Repositories (",a,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??Nd(l.value.url);return d.jsxs($g,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"font-mono text-xs",children:l.value.url}),l.value.ref&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:["@ ",l.value.ref]}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&d.jsx(FL,{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 FL({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.url)??""),[f,m]=S.useState((n==null?void 0:n.ref)??""),[h,y]=S.useState((n==null?void 0:n.localPath)??""),[g,x]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),x(null))},[e,n]);function b(k){k.preventDefault();const j=o.trim();if(!j){x("URL is required.");return}const E=h.trim()||Nd(j);if(E&&a.has(E)){x(`Another repo already occupies local path "${E}".`);return}const _={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(_)}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit Git repository":"Add Git repository"})}),d.jsxs("form",{onSubmit:b,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"git-url",children:"URL"}),d.jsx(vt,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),d.jsx(vt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"git-path",children:"Local path (optional)"}),d.jsx(vt,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:Nd(o)||"repo-name",className:"font-mono"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&d.jsx("p",{className:"text-sm text-destructive",children:g}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function qL({agent:e,onSave:t}){const[n,a]=S.useState(!1),l=Ea(),o=Pg(),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 d.jsxs("section",{style:{background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx("h2",{style:{fontSize:12,fontWeight:600,color:"var(--fg)"},children:"Profile"}),e.status==="active"&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[d.jsx(Bd,{className:"h-3 w-3"})," Edit"]})]}),d.jsxs("div",{className:"px-4 py-3 text-sm space-y-1",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-mono",children:e.name??e.uuid}),d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsx("span",{children:e.displayName??d.jsx("span",{className:"text-muted-foreground italic",children:"no display name"})}),g&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsxs("span",{className:"text-muted-foreground",children:["delegate ",d.jsx("span",{className:"font-mono",children:g})]})]})]}),d.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[d.jsxs("span",{children:["owner ",d.jsx("span",{className:"text-gray-900",children:y??"—"})]}),m&&d.jsxs("span",{children:["role ",d.jsx("span",{className:"text-gray-900",children:m})]}),d.jsxs("span",{children:["type ",d.jsx(Wt,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),d.jsxs("span",{children:["visibility"," ",d.jsx(Wt,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&d.jsxs("span",{children:["domains"," ",d.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(x=>d.jsx(Wt,{tone:"outline",children:x},x))})]})]})]}),d.jsx(HL,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function HL({agent:e,open:t,onOpenChange:n,onSave:a}){var I;const{memberId:l,role:o}=ji(),[u,f]=S.useState(e.displayName??""),[m,h]=S.useState(e.delegateMention??""),[y,g]=S.useState(e.visibility),[x,b]=S.useState(!1),[k,j]=S.useState(null);S.useEffect(()=>{t&&(f(e.displayName??""),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const E=e.type==="human",_=o==="admin"||e.managerId===l,A=qe({queryKey:["agents-for-delegate"],queryFn:async()=>(await Cg({limit:100})).items.filter(R=>R.type==="personal_assistant"&&R.status==="active"),enabled:t&&E});async function O(B){B.preventDefault(),j(null),b(!0);try{const R={displayName:u||null,delegateMention:m||null};y!==e.visibility&&(R.visibility=y),await a(R),n(!1)}catch(R){j(R instanceof Error?R.message:String(R))}finally{b(!1)}}return d.jsx(On,{open:t,onOpenChange:n,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Edit Identity"})}),d.jsxs("form",{onSubmit:O,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{children:"Name (mention)"}),d.jsx(vt,{value:e.name??"",disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Name is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"id-display",children:"Display Name"}),d.jsx(vt,{id:"id-display",value:u,onChange:B=>f(B.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"id-visibility",children:"Visibility"}),d.jsxs("select",{id:"id-visibility",value:y,onChange:B=>g(B.target.value),disabled:!_,className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[d.jsx("option",{value:v1.PRIVATE,children:"Private — only the manager"}),d.jsx("option",{value:v1.ORGANIZATION,children:"Organization — all members"})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:_?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),E&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"id-delegate",children:"Delegate Mention"}),d.jsxs("select",{id:"id-delegate",value:m,onChange:B=>h(B.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"",children:"None"}),(I=A.data)==null?void 0:I.map(B=>d.jsx("option",{value:B.uuid,children:B.displayName?`${B.displayName} (${B.name??B.uuid})`:B.name??B.uuid},B.uuid))]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&d.jsx("p",{className:"text-sm text-destructive",children:k}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:x,children:"Cancel"}),d.jsx(ve,{type:"submit",disabled:x,children:x?"Saving…":"Save"})]})]})]})})}function ZL(e){const[t,n]=S.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("h3",{style:{fontSize:12,fontWeight:600,color:"var(--fg)"},children:["MCP Servers (",a,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>d.jsxs($g,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"text-xs rounded bg-gray-100 px-1.5 py-0.5 font-mono",children:l.value.transport}),d.jsx("span",{className:"font-medium font-mono",children:l.value.name}),d.jsx("span",{className:"text-xs text-muted-foreground truncate",children:VL(l.value)})]},l.key))}),t&&d.jsx(QL,{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 VL(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 QL({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=S.useState((n==null?void 0:n.name)??""),[h,y]=S.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,x]=S.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[b,k]=S.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((n==null?void 0:n.transport)==="stdio"?n.command:""),x((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(null))},[e,n]);function _(A){if(A.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const I=g.trim().split(/\s+/).filter(B=>B.length>0);O={name:f,transport:"stdio",command:h.trim(),...I.length?{args:I}:{}}}else{const I=b.trim();try{new URL(I)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:I}}l(O)}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit MCP server":"Add MCP server"})}),d.jsxs("form",{onSubmit:_,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-transport",children:"Transport"}),d.jsxs("select",{id:"mcp-transport",value:o,onChange:A=>u(A.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),d.jsx("option",{value:"http",children:"http"}),d.jsx("option",{value:"sse",children:"sse"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-name",children:"Name"}),d.jsx(vt,{id:"mcp-name",value:f,onChange:A=>m(A.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-command",children:"Command"}),d.jsx(vt,{id:"mcp-command",value:h,onChange:A=>y(A.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),d.jsx(vt,{id:"mcp-args",value:g,onChange:A=>x(A.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-url",children:"URL"}),d.jsx(vt,{id:"mcp-url",value:b,onChange:A=>k(A.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&d.jsx("p",{className:"text-sm text-destructive",children:j}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const j1=[{value:"claude-opus-4-6",label:"claude-opus-4-6",hint:"most capable"},{value:"claude-sonnet-4-6",label:"claude-sonnet-4-6",hint:"default"},{value:"claude-haiku-4-5",label:"claude-haiku-4-5",hint:"fastest"}];function GL({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const o=e!==t,u=!j1.some(f=>f.value===e)&&e!=="";return d.jsxs("section",{style:{background:"var(--bg-raised)",border:`1px solid ${o?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2",style:{fontSize:12,fontWeight:600,color:"var(--fg)"},children:["Model",o&&d.jsx("span",{className:"mono uppercase",style:{fontSize:10,letterSpacing:"0.06em",padding:"1px 6px",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),o&&d.jsx(ve,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),d.jsxs("div",{className:"px-4 py-3 space-y-2",children:[d.jsxs("select",{value:e,onChange:f=>n(f.target.value),disabled:l,className:"flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:[d.jsx("option",{value:"",children:"(agent default)"}),j1.map(f=>d.jsxs("option",{value:f.value,children:[f.label,f.hint?` — ${f.hint}`:""]},f.value)),u&&d.jsxs("option",{value:e,children:[e," — custom"]})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which Claude model powers this agent. Applies to new sessions immediately; active sessions switch on their next message."})]})]})}function KL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const YL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JL={};function E1(e,t){return(JL.jsx?XL:YL).test(e)}const WL=/[ \t\n\f\r]/g;function eU(e){return typeof e=="object"?e.type==="text"?C1(e.value):!1:C1(e)}function C1(e){return e.replace(WL,"")===""}class Eu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Eu.prototype.normal={};Eu.prototype.property={};Eu.prototype.space=void 0;function Hj(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Eu(n,a,t)}function qp(e){return e.toLowerCase()}class In{constructor(t,n){this.attribute=n,this.property=t}}In.prototype.attribute="";In.prototype.booleanish=!1;In.prototype.boolean=!1;In.prototype.commaOrSpaceSeparated=!1;In.prototype.commaSeparated=!1;In.prototype.defined=!1;In.prototype.mustUseProperty=!1;In.prototype.number=!1;In.prototype.overloadedBoolean=!1;In.prototype.property="";In.prototype.spaceSeparated=!1;In.prototype.space=void 0;let tU=0;const Pe=bl(),$t=bl(),Hp=bl(),he=bl(),bt=bl(),bs=bl(),Gn=bl();function bl(){return 2**++tU}const Zp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:$t,commaOrSpaceSeparated:Gn,commaSeparated:bs,number:he,overloadedBoolean:Hp,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),Fm=Object.keys(Zp);class Fg extends In{constructor(t,n,a,l){let o=-1;if(super(t,n),N1(this,"space",l),typeof a=="number")for(;++o<Fm.length;){const u=Fm[o];N1(this,Fm[o],(a&Zp[u])===Zp[u])}}}Fg.prototype.defined=!0;function N1(e,t,n){n&&(e[t]=n)}function qs(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new Fg(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[qp(a)]=a,n[qp(o.attribute)]=a}return new Eu(t,n,e.space)}const Zj=qs({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:bt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:he,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:bt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:$t,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Vj(e,t){return t in e?e[t]:t}function Qj(e,t){return Vj(e,t.toLowerCase())}const nU=qs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bs,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:bt,autoFocus:Pe,autoPlay:Pe,blocking:bt,capture:null,charSet:null,checked:Pe,cite:null,className:bt,cols:he,colSpan:null,content:null,contentEditable:$t,controls:Pe,controlsList:bt,coords:he|bs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:Hp,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:bt,height:he,hidden:Hp,high:he,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:bt,itemRef:bt,itemScope:Pe,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Pe,optimum:he,pattern:null,ping:bt,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:bt,required:Pe,reversed:Pe,rows:he,rowSpan:he,sandbox:bt,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Pe,useMap:null,value:$t,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:Qj}),rU=qs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Gn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:bt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Pe,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:bs,g2:bs,glyphName:bs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Gn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gn,rev:Gn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gn,requiredFeatures:Gn,requiredFonts:Gn,requiredFormats:Gn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Gn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Vj}),Gj=qs({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()}}),Kj=qs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qj}),Yj=qs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),iU={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"},aU=/[A-Z]/g,_1=/-[a-z]/g,lU=/^data[-\w.:]+$/i;function sU(e,t){const n=qp(t);let a=t,l=In;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&lU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(_1,uU);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!_1.test(o)){let u=o.replace(aU,oU);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=Fg}return new l(a,t)}function oU(e){return"-"+e.toLowerCase()}function uU(e){return e.charAt(1).toUpperCase()}const cU=Hj([Zj,nU,Gj,Kj,Yj],"html"),qg=Hj([Zj,rU,Gj,Kj,Yj],"svg");function dU(e){return e.join(" ").trim()}var cs={},qm,z1;function fU(){if(z1)return qm;z1=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=`
|
|
333
|
-
`,h="/",y="*",g="",x="comment",b="declaration";function k(E,_){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];_=_||{};var A=1,O=1;function I(de){var W=de.match(t);W&&(A+=W.length);var P=de.lastIndexOf(m);O=~P?de.length-P:O+de.length}function B(){var de={line:A,column:O};return function(W){return W.position=new R(de),ee(),W}}function R(de){this.start=de,this.end={line:A,column:O},this.source=_.source}R.prototype.content=E;function $(de){var W=new Error(_.source+":"+A+":"+O+": "+de);if(W.reason=de,W.filename=_.source,W.line=A,W.column=O,W.source=E,!_.silent)throw W}function Z(de){var W=de.exec(E);if(W){var P=W[0];return I(P),E=E.slice(P.length),W}}function ee(){Z(n)}function q(de){var W;for(de=de||[];W=ie();)W!==!1&&de.push(W);return de}function ie(){var de=B();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var W=2;g!=E.charAt(W)&&(y!=E.charAt(W)||h!=E.charAt(W+1));)++W;if(W+=2,g===E.charAt(W-1))return $("End of comment missing");var P=E.slice(2,W-2);return O+=2,I(P),E=E.slice(W),O+=2,de({type:x,comment:P})}}function re(){var de=B(),W=Z(a);if(W){if(ie(),!Z(l))return $("property missing ':'");var P=Z(o),V=de({type:b,property:j(W[0].replace(e,g)),value:P?j(P[0].replace(e,g)):g});return Z(u),V}}function pe(){var de=[];q(de);for(var W;W=re();)W!==!1&&(de.push(W),q(de));return de}return ee(),pe()}function j(E){return E?E.replace(f,g):g}return qm=k,qm}var A1;function hU(){if(A1)return cs;A1=1;var e=cs&&cs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(cs,"__esModule",{value:!0}),cs.default=n;const t=e(fU());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 cs}var Zo={},T1;function mU(){if(T1)return Zo;T1=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.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 Zo.camelCase=m,Zo}var Vo,R1;function pU(){if(R1)return Vo;R1=1;var e=Vo&&Vo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(hU()),n=mU();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,Vo=a,Vo}var gU=pU();const yU=Od(gU),Xj=Jj("end"),Hg=Jj("start");function Jj(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 vU(e){const t=Hg(e),n=Xj(e);if(t&&n)return{start:t,end:n}}function Wo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?O1(e.position):"start"in e||"end"in e?O1(e):"line"in e||"column"in e?Vp(e):""}function Vp(e){return D1(e&&e.line)+":"+D1(e&&e.column)}function O1(e){return Vp(e&&e.start)+"-"+Vp(e&&e.end)}function D1(e){return e&&typeof e=="number"?e:1}class pn 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=Wo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const Zg={}.hasOwnProperty,xU=new Map,bU=/[A-Z]/g,SU=new Set(["table","tbody","thead","tfoot","tr"]),wU=new Set(["td","th"]),Wj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kU(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=TU(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=AU(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"?qg:cU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=eE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function eE(e,t,n){if(t.type==="element")return jU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return EU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return NU(e,t,n);if(t.type==="mdxjsEsm")return CU(e,t);if(t.type==="root")return _U(e,t,n);if(t.type==="text")return zU(e,t)}function jU(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=qg,e.schema=l),e.ancestors.push(t);const o=nE(e,t.tagName,!1),u=RU(e,t);let f=Qg(e,t);return SU.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!eU(m):!0})),tE(e,u,o,t),Vg(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function EU(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)}du(e,t.position)}function CU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);du(e,t.position)}function NU(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=qg,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:nE(e,t.name,!0),u=OU(e,t),f=Qg(e,t);return tE(e,u,o,t),Vg(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function _U(e,t,n){const a={};return Vg(a,Qg(e,t)),e.create(t,e.Fragment,a,n)}function zU(e,t){return t.value}function tE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Vg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function AU(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 TU(e,t){return n;function n(a,l,o,u){const f=Array.isArray(o.children),m=Hg(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 RU(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Zg.call(t.properties,l)){const o=DU(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&wU.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 OU(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 du(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 du(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function Qg(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:xU;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=eE(e,o,u);f!==void 0&&n.push(f)}return n}function DU(e,t,n){const a=sU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?KL(n):dU(n)),a.property==="style"){let l=typeof n=="object"?n:MU(e,String(n));return e.stylePropertyNameCase==="css"&&(l=LU(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?iU[a.property]||a.property:a.attribute,n]}}function MU(e,t){try{return yU(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new pn("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=Wj+"#cannot-parse-style-attribute",l}}function nE(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=E1(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=E1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Zg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);du(e)}function du(e,t){const n=new pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Wj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function LU(e){const t={};let n;for(n in e)Zg.call(e,n)&&(t[UU(n)]=e[n]);return t}function UU(e){let t=e.replace(bU,IU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function IU(e){return"-"+e.toLowerCase()}const Hm={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"]},BU={};function Gg(e,t){const n=BU,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rE(e,a,l)}function rE(e,t,n){if(PU(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 M1(e.children,t,n)}return Array.isArray(e)?M1(e,t,n):""}function M1(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=rE(e[l],t,n);return a.join("")}function PU(e){return!!(e&&typeof e=="object")}const L1=document.createElement("i");function Kg(e){const t="&"+e+";";L1.innerHTML=t;const n=L1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xn(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 mr(e,t){return e.length>0?(Xn(e,e.length,0,t),e):t}const U1={}.hasOwnProperty;function iE(e){const t={};let n=-1;for(;++n<e.length;)$U(t,e[n]);return t}function $U(e,t){let n;for(n in t){const l=(U1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){U1.call(l,u)||(l[u]=[]);const f=o[u];FU(l[u],Array.isArray(f)?f:f?[f]:[])}}}function FU(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Xn(e,0,0,a)}function aE(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bn=_a(/[A-Za-z]/),mn=_a(/[\dA-Za-z]/),qU=_a(/[#-'*+\--9=?A-Z^-~]/);function zd(e){return e!==null&&(e<32||e===127)}const Qp=_a(/\d/),HU=_a(/[\dA-Fa-f]/),ZU=_a(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Qe(e){return e===-2||e===-1||e===32}const Wd=_a(new RegExp("\\p{P}|\\p{S}","u")),pl=_a(/\s/);function _a(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Hs(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&mn(e.charCodeAt(n+1))&&mn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(a,n),encodeURIComponent(u)),a=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function et(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Qe(m)?(e.enter(n),f(m)):t(m)}function f(m){return Qe(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const VU={tokenize:QU};function QU(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"),et(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 Ae(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const GU={tokenize:KU},I1={tokenize:YU};function KU(e){const t=this,n=[];let a=0,l,o,u;return f;function f(O){if(a<n.length){const I=n[a];return t.containerState=I[1],e.attempt(I[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const I=t.events.length;let B=I,R;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){R=t.events[B][1].end;break}_(a);let $=I;for(;$<t.events.length;)t.events[$][1].end={...R},$++;return Xn(t.events,B+1,0,t.events.slice(I)),t.events.length=$,h(O)}return f(O)}function h(O){if(a===n.length){if(!l)return x(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(I1,y,g)(O)}function y(O){return l&&A(),_(a),x(O)}function g(O){return t.parser.lazy[t.now().line]=a!==n.length,u=t.now().offset,k(O)}function x(O){return t.containerState={},e.attempt(I1,b,k)(O)}function b(O){return a++,n.push([t.currentConstruct,t.containerState]),x(O)}function k(O){if(O===null){l&&A(),_(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),_(0),e.consume(O);return}return Ae(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,I){const B=t.sliceStream(O);if(I&&B.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(B),t.parser.lazy[O.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<u&&(!l.events[R][1].end||l.events[R][1].end.offset>u))return;const $=t.events.length;let Z=$,ee,q;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(ee){q=t.events[Z][1].end;break}ee=!0}for(_(a),R=$;R<t.events.length;)t.events[R][1].end={...q},R++;Xn(t.events,Z+1,0,t.events.slice($)),t.events.length=R}}function _(O){let I=n.length;for(;I-- >O;){const B=n[I];t.containerState=B[1],B[0].exit.call(t,e)}n.length=O}function A(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function YU(e,t,n){return et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ls(e){if(e===null||xt(e)||pl(e))return 1;if(Wd(e))return 2}function ef(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 Gp={name:"attention",resolveAll:XU,tokenize:JU};function XU(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};B1(g,-m),B1(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=mr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=mr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=mr(h,ef(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=mr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=mr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,Xn(e,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 JU(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Ls(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=Ls(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 B1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const WU={name:"autolink",tokenize:eI};function eI(e,t,n){let a=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return bn(b)?(e.consume(b),u):b===64?n(b):h(b)}function u(b){return b===43||b===45||b===46||mn(b)?(a=1,f(b)):h(b)}function f(b){return b===58?(e.consume(b),a=0,m):(b===43||b===45||b===46||mn(b))&&a++<32?(e.consume(b),f):(a=0,h(b))}function m(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||zd(b)?n(b):(e.consume(b),m)}function h(b){return b===64?(e.consume(b),y):qU(b)?(e.consume(b),h):n(b)}function y(b){return mn(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),a=0,y):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):x(b)}function x(b){if((b===45||mn(b))&&a++<63){const k=b===45?x:g;return e.consume(b),k}return n(b)}}const Cu={partial:!0,tokenize:tI};function tI(e,t,n){return a;function a(o){return Qe(o)?et(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Ae(o)?t(o):n(o)}}const lE={continuation:{tokenize:rI},exit:iI,name:"blockQuote",tokenize:nI};function nI(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 Qe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function rI(e,t,n){const a=this;return l;function l(u){return Qe(u)?et(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(lE,t,n)(u)}}function iI(e){e.exit("blockQuote")}const sE={name:"characterEscape",tokenize:aI};function aI(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 ZU(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const oE={name:"characterReference",tokenize:lI};function lI(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=mn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=HU,y):(e.enter("characterReferenceValue"),o=7,u=Qp,y(g))}function y(g){if(g===59&&l){const x=e.exit("characterReferenceValue");return u===mn&&!Kg(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 P1={partial:!0,tokenize:oI},$1={concrete:!0,name:"codeFenced",tokenize:sI};function sI(e,t,n){const a=this,l={partial:!0,tokenize:B};let o=0,u=0,f;return m;function m(R){return h(R)}function h(R){const $=a.events[a.events.length-1];return o=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(R)}function y(R){return R===f?(u++,e.consume(R),y):u<3?n(R):(e.exit("codeFencedFenceSequence"),Qe(R)?et(e,g,"whitespace")(R):g(R))}function g(R){return R===null||Ae(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(P1,j,I)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(R))}function x(R){return R===null||Ae(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):Qe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,b,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),x)}function b(R){return R===null||Ae(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Ae(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===f?n(R):(e.consume(R),k)}function j(R){return e.attempt(l,I,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),_}function _(R){return o>0&&Qe(R)?et(e,A,"linePrefix",o+1)(R):A(R)}function A(R){return R===null||Ae(R)?e.check(P1,j,I)(R):(e.enter("codeFlowValue"),O(R))}function O(R){return R===null||Ae(R)?(e.exit("codeFlowValue"),A(R)):(e.consume(R),O)}function I(R){return e.exit("codeFenced"),t(R)}function B(R,$,Z){let ee=0;return q;function q(W){return R.enter("lineEnding"),R.consume(W),R.exit("lineEnding"),ie}function ie(W){return R.enter("codeFencedFence"),Qe(W)?et(R,re,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):re(W)}function re(W){return W===f?(R.enter("codeFencedFenceSequence"),pe(W)):Z(W)}function pe(W){return W===f?(ee++,R.consume(W),pe):ee>=u?(R.exit("codeFencedFenceSequence"),Qe(W)?et(R,de,"whitespace")(W):de(W)):Z(W)}function de(W){return W===null||Ae(W)?(R.exit("codeFencedFence"),$(W)):Z(W)}}}function oI(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 Zm={name:"codeIndented",tokenize:cI},uI={partial:!0,tokenize:dI};function cI(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),et(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):Ae(h)?e.attempt(uI,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Ae(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function dI(e,t,n){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?n(u):Ae(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):et(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):Ae(u)?l(u):n(u)}}const fI={name:"codeText",previous:mI,resolve:hI,tokenize:pI};function hI(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 mI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pI(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)):Ae(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||Ae(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 gI{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&&Qo(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),Qo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qo(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);Qo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qo(this.left,n.reverse())}}}function Qo(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 uE(e){const t={};let n=-1,a,l,o,u,f,m,h;const y=new gI(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,yI(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 Xn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function yI(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,b=n,k=0,j=0;const E=[j];for(;b;){for(;e.get(++l)[1]!==b;);o.push(l),b._tokenizer||(y=a.sliceStream(b),b.next||y.push(null),g&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=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,E.push(j),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):E.pop(),x=E.length;x--;){const _=f.slice(E[x],E[x+1]),A=o.pop();m.push([A,A+_.length-1]),e.splice(A,2,_)}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 vI={resolve:bI,tokenize:SI},xI={partial:!0,tokenize:wI};function bI(e){return uE(e),e}function SI(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):Ae(f)?e.check(xI,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 wI(e,t,n){const a=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),et(e,o,"linePrefix")}function o(u){if(u===null||Ae(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 cE(e,t,n,a,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(_){return _===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(_),e.exit(o),x):_===null||_===32||_===41||zd(_)?n(_):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(_))}function x(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Ae(_)?n(_):(e.consume(_),_===92?k:b)}function k(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function j(_){return!y&&(_===null||_===41||xt(_))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(_)):y<h&&_===40?(e.consume(_),y++,j):_===41?(e.consume(_),y--,j):_===null||_===32||_===40||zd(_)?n(_):(e.consume(_),_===92?E:j)}function E(_){return _===40||_===41||_===92?(e.consume(_),j):j(_)}}function dE(e,t,n,a,l,o){const u=this;let f=0,m;return h;function h(b){return e.enter(a),e.enter(l),e.consume(b),e.exit(l),e.enter(o),y}function y(b){return f>999||b===null||b===91||b===93&&!m||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(b):b===93?(e.exit(o),e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Ae(b)||f++>999?(e.exit("chunkString"),y(b)):(e.consume(b),m||(m=!Qe(b)),b===92?x:g)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,g):g(b)}}function fE(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):Ae(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),et(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===u||x===null||Ae(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 eu(e,t){let n;return a;function a(l){return Ae(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Qe(l)?et(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const kI={name:"definition",tokenize:EI},jI={partial:!0,tokenize:CI};function EI(e,t,n){const a=this;let l;return o;function o(b){return e.enter("definition"),u(b)}function u(b){return dE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return l=Cr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),m):n(b)}function m(b){return xt(b)?eu(e,h)(b):h(b)}function h(b){return cE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return e.attempt(jI,g,g)(b)}function g(b){return Qe(b)?et(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Ae(b)?(e.exit("definition"),a.parser.defined.push(l),t(b)):n(b)}}function CI(e,t,n){return a;function a(f){return xt(f)?eu(e,l)(f):n(f)}function l(f){return fE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Qe(f)?et(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Ae(f)?t(f):n(f)}}const NI={name:"hardBreakEscape",tokenize:_I};function _I(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Ae(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const zI={name:"headingAtx",resolve:AI,tokenize:TI};function AI(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"},Xn(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function TI(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||xt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Ae(y)?(e.exit("atxHeading"),t(y)):Qe(y)?et(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||xt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const RI=["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"],F1=["pre","script","style","textarea"],OI={concrete:!0,name:"htmlFlow",resolveTo:LI,tokenize:UI},DI={partial:!0,tokenize:BI},MI={partial:!0,tokenize:II};function LI(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 UI(e,t,n){const a=this;let l,o,u,f,m;return h;function h(C){return y(C)}function y(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),g}function g(C){return C===33?(e.consume(C),x):C===47?(e.consume(C),o=!0,j):C===63?(e.consume(C),l=3,a.interrupt?t:T):bn(C)?(e.consume(C),u=String.fromCharCode(C),E):n(C)}function x(C){return C===45?(e.consume(C),l=2,b):C===91?(e.consume(C),l=5,f=0,k):bn(C)?(e.consume(C),l=4,a.interrupt?t:T):n(C)}function b(C){return C===45?(e.consume(C),a.interrupt?t:T):n(C)}function k(C){const J="CDATA[";return C===J.charCodeAt(f++)?(e.consume(C),f===J.length?a.interrupt?t:re:k):n(C)}function j(C){return bn(C)?(e.consume(C),u=String.fromCharCode(C),E):n(C)}function E(C){if(C===null||C===47||C===62||xt(C)){const J=C===47,Y=u.toLowerCase();return!J&&!o&&F1.includes(Y)?(l=1,a.interrupt?t(C):re(C)):RI.includes(u.toLowerCase())?(l=6,J?(e.consume(C),_):a.interrupt?t(C):re(C)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(C):o?A(C):O(C))}return C===45||mn(C)?(e.consume(C),u+=String.fromCharCode(C),E):n(C)}function _(C){return C===62?(e.consume(C),a.interrupt?t:re):n(C)}function A(C){return Qe(C)?(e.consume(C),A):q(C)}function O(C){return C===47?(e.consume(C),q):C===58||C===95||bn(C)?(e.consume(C),I):Qe(C)?(e.consume(C),O):q(C)}function I(C){return C===45||C===46||C===58||C===95||mn(C)?(e.consume(C),I):B(C)}function B(C){return C===61?(e.consume(C),R):Qe(C)?(e.consume(C),B):O(C)}function R(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),m=C,$):Qe(C)?(e.consume(C),R):Z(C)}function $(C){return C===m?(e.consume(C),m=null,ee):C===null||Ae(C)?n(C):(e.consume(C),$)}function Z(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||xt(C)?B(C):(e.consume(C),Z)}function ee(C){return C===47||C===62||Qe(C)?O(C):n(C)}function q(C){return C===62?(e.consume(C),ie):n(C)}function ie(C){return C===null||Ae(C)?re(C):Qe(C)?(e.consume(C),ie):n(C)}function re(C){return C===45&&l===2?(e.consume(C),P):C===60&&l===1?(e.consume(C),V):C===62&&l===4?(e.consume(C),L):C===63&&l===3?(e.consume(C),T):C===93&&l===5?(e.consume(C),xe):Ae(C)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(DI,z,pe)(C)):C===null||Ae(C)?(e.exit("htmlFlowData"),pe(C)):(e.consume(C),re)}function pe(C){return e.check(MI,de,z)(C)}function de(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),W}function W(C){return C===null||Ae(C)?pe(C):(e.enter("htmlFlowData"),re(C))}function P(C){return C===45?(e.consume(C),T):re(C)}function V(C){return C===47?(e.consume(C),u="",ce):re(C)}function ce(C){if(C===62){const J=u.toLowerCase();return F1.includes(J)?(e.consume(C),L):re(C)}return bn(C)&&u.length<8?(e.consume(C),u+=String.fromCharCode(C),ce):re(C)}function xe(C){return C===93?(e.consume(C),T):re(C)}function T(C){return C===62?(e.consume(C),L):C===45&&l===2?(e.consume(C),T):re(C)}function L(C){return C===null||Ae(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),L)}function z(C){return e.exit("htmlFlow"),t(C)}}function II(e,t,n){const a=this;return l;function l(u){return Ae(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 BI(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Cu,t,n)}}const PI={name:"htmlText",tokenize:$I};function $I(e,t,n){const a=this;let l,o,u;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),B):T===63?(e.consume(T),O):bn(T)?(e.consume(T),Z):n(T)}function h(T){return T===45?(e.consume(T),y):T===91?(e.consume(T),o=0,k):bn(T)?(e.consume(T),A):n(T)}function y(T){return T===45?(e.consume(T),b):n(T)}function g(T){return T===null?n(T):T===45?(e.consume(T),x):Ae(T)?(u=g,V(T)):(e.consume(T),g)}function x(T){return T===45?(e.consume(T),b):g(T)}function b(T){return T===62?P(T):T===45?x(T):g(T)}function k(T){const L="CDATA[";return T===L.charCodeAt(o++)?(e.consume(T),o===L.length?j:k):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),E):Ae(T)?(u=j,V(T)):(e.consume(T),j)}function E(T){return T===93?(e.consume(T),_):j(T)}function _(T){return T===62?P(T):T===93?(e.consume(T),_):j(T)}function A(T){return T===null||T===62?P(T):Ae(T)?(u=A,V(T)):(e.consume(T),A)}function O(T){return T===null?n(T):T===63?(e.consume(T),I):Ae(T)?(u=O,V(T)):(e.consume(T),O)}function I(T){return T===62?P(T):O(T)}function B(T){return bn(T)?(e.consume(T),R):n(T)}function R(T){return T===45||mn(T)?(e.consume(T),R):$(T)}function $(T){return Ae(T)?(u=$,V(T)):Qe(T)?(e.consume(T),$):P(T)}function Z(T){return T===45||mn(T)?(e.consume(T),Z):T===47||T===62||xt(T)?ee(T):n(T)}function ee(T){return T===47?(e.consume(T),P):T===58||T===95||bn(T)?(e.consume(T),q):Ae(T)?(u=ee,V(T)):Qe(T)?(e.consume(T),ee):P(T)}function q(T){return T===45||T===46||T===58||T===95||mn(T)?(e.consume(T),q):ie(T)}function ie(T){return T===61?(e.consume(T),re):Ae(T)?(u=ie,V(T)):Qe(T)?(e.consume(T),ie):ee(T)}function re(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,pe):Ae(T)?(u=re,V(T)):Qe(T)?(e.consume(T),re):(e.consume(T),de)}function pe(T){return T===l?(e.consume(T),l=void 0,W):T===null?n(T):Ae(T)?(u=pe,V(T)):(e.consume(T),pe)}function de(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||xt(T)?ee(T):(e.consume(T),de)}function W(T){return T===47||T===62||xt(T)?ee(T):n(T)}function P(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function V(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ce}function ce(T){return Qe(T)?et(e,xe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):xe(T)}function xe(T){return e.enter("htmlTextData"),u(T)}}const Yg={name:"labelEnd",resolveAll:ZI,resolveTo:VI,tokenize:QI},FI={tokenize:GI},qI={tokenize:KI},HI={tokenize:YI};function ZI(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&&Xn(e,0,e.length,n),e}function VI(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=mr(f,e.slice(o+1,o+a+3)),f=mr(f,[["enter",y,t]]),f=mr(f,ef(t.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),t)),f=mr(f,[["exit",y,t],e[u-2],e[u-1],["exit",h,t]]),f=mr(f,e.slice(u+1)),f=mr(f,[["exit",m,t]]),Xn(e,o,e.length,f),e}function QI(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(Cr(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(FI,y,u?y:g)(x):x===91?e.attempt(qI,y,u?h:g)(x):u?y(x):g(x)}function h(x){return e.attempt(HI,y,g)(x)}function y(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function GI(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 xt(g)?eu(e,o)(g):o(g)}function o(g){return g===41?y(g):cE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return xt(g)?eu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?fE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return xt(g)?eu(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 KI(e,t,n){const a=this;return l;function l(f){return dE.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Cr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function YI(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 XI={name:"labelStartImage",resolveAll:Yg.resolveAll,tokenize:JI};function JI(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 WI={name:"labelStartLink",resolveAll:Yg.resolveAll,tokenize:e9};function e9(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 Vm={name:"lineEnding",tokenize:t9};function t9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),et(e,t,"linePrefix")}}const yd={name:"thematicBreak",tokenize:n9};function n9(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||Ae(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),Qe(h)?et(e,f,"whitespace")(h):f(h))}}const zn={continuation:{tokenize:l9},exit:o9,name:"list",tokenize:a9},r9={partial:!0,tokenize:u9},i9={partial:!0,tokenize:s9};function a9(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(b){const k=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Qp(b)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(yd,n,h)(b):h(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(b)}return n(b)}function m(b){return Qp(b)&&++u<10?(e.consume(b),m):(!a.interrupt||u<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(Cu,a.interrupt?n:y,e.attempt(r9,x,g))}function y(b){return a.containerState.initialBlankLine=!0,o++,x(b)}function g(b){return Qe(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):n(b)}function x(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function l9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Cu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,et(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Qe(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(i9,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,et(e,e.attempt(zn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function s9(e,t,n){const a=this;return et(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 o9(e){e.exit(this.containerState.type)}function u9(e,t,n){const a=this;return et(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!Qe(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const q1={name:"setextUnderline",resolveTo:c9,tokenize:d9};function c9(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 d9(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"),Qe(h)?et(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Ae(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const f9={tokenize:h9};function h9(e){const t=this,n=e.attempt(Cu,a,e.attempt(this.parser.constructs.flowInitial,l,et(e,e.attempt(this.parser.constructs.flow,l,e.attempt(vI,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 m9={resolveAll:mE()},p9=hE("string"),g9=hE("text");function hE(e){return{resolveAll:mE(e==="text"?y9: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 b=g[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function mE(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 y9(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 v9={42:zn,43:zn,45:zn,48:zn,49:zn,50:zn,51:zn,52:zn,53:zn,54:zn,55:zn,56:zn,57:zn,62:lE},x9={91:kI},b9={[-2]:Zm,[-1]:Zm,32:Zm},S9={35:zI,42:yd,45:[q1,yd],60:OI,61:q1,95:yd,96:$1,126:$1},w9={38:oE,92:sE},k9={[-5]:Vm,[-4]:Vm,[-3]:Vm,33:XI,38:oE,42:Gp,60:[WU,PI],91:WI,92:[NI,sE],93:Yg,95:Gp,96:fI},j9={null:[Gp,m9]},E9={null:[42,95]},C9={null:[]},N9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:E9,contentInitial:x9,disable:C9,document:v9,flow:S9,flowInitial:b9,insideSpan:j9,string:w9,text:k9},Symbol.toStringTag,{value:"Module"}));function _9(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:$(B),check:$(R),consume:A,enter:O,exit:I,interrupt:$(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(ie){return u=mr(u,ie),E(),u[u.length-1]!==null?[]:(Z(t,0),h.events=ef(o,h.events,h),h.events)}function x(ie,re){return A9(b(ie),re)}function b(ie){return z9(u,ie)}function k(){const{_bufferIndex:ie,_index:re,line:pe,column:de,offset:W}=a;return{_bufferIndex:ie,_index:re,line:pe,column:de,offset:W}}function j(ie){l[ie.line]=ie.column,q()}function E(){let ie;for(;a._index<u.length;){const re=u[a._index];if(typeof re=="string")for(ie=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ie&&a._bufferIndex<re.length;)_(re.charCodeAt(a._bufferIndex));else _(re)}}function _(ie){y=y(ie)}function A(ie){Ae(ie)?(a.line++,a.column=1,a.offset+=ie===-3?2:1,q()):ie!==-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=ie}function O(ie,re){const pe=re||{};return pe.type=ie,pe.start=k(),h.events.push(["enter",pe,h]),f.push(pe),pe}function I(ie){const re=f.pop();return re.end=k(),h.events.push(["exit",re,h]),re}function B(ie,re){Z(ie,re.from)}function R(ie,re){re.restore()}function $(ie,re){return pe;function pe(de,W,P){let V,ce,xe,T;return Array.isArray(de)?z(de):"tokenize"in de?z([de]):L(de);function L(ue){return ge;function ge(Me){const be=Me!==null&&ue[Me],Nt=Me!==null&&ue.null,en=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(Nt)?Nt:Nt?[Nt]:[]];return z(en)(Me)}}function z(ue){return V=ue,ce=0,ue.length===0?P:C(ue[ce])}function C(ue){return ge;function ge(Me){return T=ee(),xe=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?Y():ue.tokenize.call(re?Object.assign(Object.create(h),re):h,m,J,Y)(Me)}}function J(ue){return ie(xe,T),W}function Y(ue){return T.restore(),++ce<V.length?C(V[ce]):P}}}function Z(ie,re){ie.resolveAll&&!o.includes(ie)&&o.push(ie),ie.resolve&&Xn(h.events,re,h.events.length-re,ie.resolve(h.events.slice(re),h)),ie.resolveTo&&(h.events=ie.resolveTo(h.events,h))}function ee(){const ie=k(),re=h.previous,pe=h.currentConstruct,de=h.events.length,W=Array.from(f);return{from:de,restore:P};function P(){a=ie,h.previous=re,h.currentConstruct=pe,h.events.length=de,f=W,q()}}function q(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function z9(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 A9(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=`
|
|
334
|
-
`;break}case-3:{u=`\r
|
|
335
|
-
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,a.push(u)}return a.join("")}function T9(e){const a={constructs:iE([N9,...(e||{}).extensions||[]]),content:l(VU),defined:[],document:l(GU),flow:l(f9),lazy:{},string:l(p9),text:l(g9)};return a;function l(o){return u;function u(f){return _9(a,o,f)}}}function R9(e){for(;!uE(e););return e}const H1=/[\0\t\n\r]/g;function O9(){let e=1,t="",n=!0,a;return l;function l(o,u,f){const m=[];let h,y,g,x,b;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(H1.lastIndex=g,h=H1.exec(o),x=h&&h.index!==void 0?h.index:o.length,b=o.charCodeAt(x),!h){t=o.slice(g);break}if(b===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),b){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 D9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function M9(e){return e.replace(D9,L9)}function L9(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return aE(n.slice(o?2:1),o?16:10)}return Kg(n)||e}const pE={}.hasOwnProperty;function U9(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),I9(n)(R9(T9(n).document().write(O9()(e,t,!0))))}function I9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Zr),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:o(_i),blockQuote:o(Nt),characterEscape:ee,characterReference:ee,codeFenced:o(en),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(en,u),codeText:o(Bn,u),codeTextData:ee,data:ee,codeFlowValue:ee,definition:o(tr),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(tn),hardBreakEscape:o(ft),hardBreakTrailing:o(ft),htmlFlow:o(Gt,u),htmlFlowData:ee,htmlText:o(Gt,u),htmlTextData:ee,image:o(xr),label:u,link:o(Zr),listItem:o(za),listItemValue:x,listOrdered:o(Vr,g),listUnordered:o(Vr),paragraph:o(Aa),reference:C,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(_i),strong:o(Zs),thematicBreak:o(Vs)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:be,autolinkProtocol:Me,blockQuote:m(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:ue,characterReference:ge,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:q,codeIndented:m(_),codeText:m(W),codeTextData:q,data:q,definition:m(),definitionDestinationString:I,definitionLabelString:A,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(re),hardBreakTrailing:m(re),htmlFlow:m(pe),htmlFlowData:q,htmlText:m(de),htmlTextData:q,image:m(V),label:xe,labelText:ce,lineEnding:ie,link:m(P),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:J,resourceDestinationString:T,resourceTitleString:L,resource:z,setextHeading:m(Z),setextHeadingLineSequence:$,setextHeadingText:R,strong:m(),thematicBreak:m()}};gE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ne){let me={type:"root",children:[]};const Oe={stack:[me],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:y,data:n},$e=[];let nt=-1;for(;++nt<ne.length;)if(ne[nt][1].type==="listOrdered"||ne[nt][1].type==="listUnordered")if(ne[nt][0]==="enter")$e.push(nt);else{const cn=$e.pop();nt=l(ne,cn,nt)}for(nt=-1;++nt<ne.length;){const cn=t[ne[nt][0]];pE.call(cn,ne[nt][1].type)&&cn[ne[nt][1].type].call(Object.assign({sliceSerialize:ne[nt][2].sliceSerialize},Oe),ne[nt][1])}if(Oe.tokenStack.length>0){const cn=Oe.tokenStack[Oe.tokenStack.length-1];(cn[1]||Z1).call(Oe,void 0,cn[0])}for(me.position={start:ia(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ia(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)me=t.transforms[nt](me)||me;return me}function l(ne,me,Oe){let $e=me-1,nt=-1,cn=!1,br,rn,Dt,dn;for(;++$e<=Oe;){const ut=ne[$e];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?nt++:nt--,dn=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(br&&!dn&&!nt&&!Dt&&(Dt=$e),dn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dn=void 0}if(!nt&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||nt===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(br){let _r=$e;for(rn=void 0;_r--;){const Pn=ne[_r];if(Pn[1].type==="lineEnding"||Pn[1].type==="lineEndingBlank"){if(Pn[0]==="exit")continue;rn&&(ne[rn][1].type="lineEndingBlank",cn=!0),Pn[1].type="lineEnding",rn=_r}else if(!(Pn[1].type==="linePrefix"||Pn[1].type==="blockQuotePrefix"||Pn[1].type==="blockQuotePrefixWhitespace"||Pn[1].type==="blockQuoteMarker"||Pn[1].type==="listItemIndent"))break}Dt&&(!rn||Dt<rn)&&(br._spread=!0),br.end=Object.assign({},rn?ne[rn][1].start:ut[1].end),ne.splice(rn||$e,0,["exit",br,ut[2]]),$e++,Oe++}if(ut[1].type==="listItemPrefix"){const _r={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};br=_r,ne.splice($e,0,["enter",_r,ut[2]]),$e++,Oe++,Dt=void 0,dn=!0}}}return ne[me][1]._spread=cn,Oe}function o(ne,me){return Oe;function Oe($e){f.call(this,ne($e),$e),me&&me.call(this,$e)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ne,me,Oe){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([me,Oe||void 0]),ne.position={start:ia(me.start),end:void 0}}function m(ne){return me;function me(Oe){ne&&ne.call(this,Oe),h.call(this,Oe)}}function h(ne,me){const Oe=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==ne.type&&(me?me.call(this,ne,$e[0]):($e[1]||Z1).call(this,ne,$e[0]));else throw new Error("Cannot close `"+ne.type+"` ("+Wo({start:ne.start,end:ne.end})+"): it’s not open");Oe.position.end=ia(ne.end)}function y(){return Gg(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(ne){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.lang=ne}function k(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.meta=ne}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/(\r?\n|\r)$/g,"")}function A(ne){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=Cr(this.sliceSerialize(ne)).toLowerCase()}function O(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function I(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function B(ne){const me=this.stack[this.stack.length-1];if(!me.depth){const Oe=this.sliceSerialize(ne).length;me.depth=Oe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function $(ne){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ne){const Oe=this.stack[this.stack.length-1].children;let $e=Oe[Oe.length-1];(!$e||$e.type!=="text")&&($e=nn(),$e.position={start:ia(ne.start),end:void 0},Oe.push($e)),this.stack.push($e)}function q(ne){const me=this.stack.pop();me.value+=this.sliceSerialize(ne),me.position.end=ia(ne.end)}function ie(ne){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=me.children[me.children.length-1];Oe.position.end=ia(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(ee.call(this,ne),q.call(this,ne))}function re(){this.data.atHardBreak=!0}function pe(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function de(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function W(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function P(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ce(ne){const me=this.sliceSerialize(ne),Oe=this.stack[this.stack.length-2];Oe.label=M9(me),Oe.identifier=Cr(me).toLowerCase()}function xe(){const ne=this.stack[this.stack.length-1],me=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const $e=ne.children;Oe.children=$e}else Oe.alt=me}function T(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function L(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function J(ne){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=Cr(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function Y(ne){this.data.characterReferenceType=ne.type}function ue(ne){const me=this.sliceSerialize(ne),Oe=this.data.characterReferenceType;let $e;Oe?($e=aE(me,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Kg(me);const nt=this.stack[this.stack.length-1];nt.value+=$e}function ge(ne){const me=this.stack.pop();me.position.end=ia(ne.end)}function Me(ne){q.call(this,ne);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ne)}function be(ne){q.call(this,ne);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ne)}function Nt(){return{type:"blockquote",children:[]}}function en(){return{type:"code",lang:null,meta:null,value:""}}function Bn(){return{type:"inlineCode",value:""}}function tr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tn(){return{type:"emphasis",children:[]}}function _i(){return{type:"heading",depth:0,children:[]}}function ft(){return{type:"break"}}function Gt(){return{type:"html",value:""}}function xr(){return{type:"image",title:null,url:"",alt:null}}function Zr(){return{type:"link",title:null,url:"",children:[]}}function Vr(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function za(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function Aa(){return{type:"paragraph",children:[]}}function Zs(){return{type:"strong",children:[]}}function nn(){return{type:"text",value:""}}function Vs(){return{type:"thematicBreak"}}}function ia(e){return{line:e.line,column:e.column,offset:e.offset}}function gE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?gE(e,a):B9(e,a)}}function B9(e,t){let n;for(n in t)if(pE.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 Z1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wo({start:t.start,end:t.end})+") is still open")}function P9(e){const t=this;t.parser=n;function n(a){return U9(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function $9(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 F9(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
336
|
-
`}]}function q9(e,t){const n=t.value?t.value+`
|
|
337
|
-
`:"",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 H9(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z9(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V9(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Hs(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 Q9(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 G9(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yE(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 K9(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return yE(e,t);const l={src:Hs(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 Y9(e,t){const n={src:Hs(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 X9(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 J9(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return yE(e,t);const l={href:Hs(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 W9(e,t){const n={href:Hs(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 e8(e,t,n){const a=e.all(t),l=n?t8(n):vE(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:`
|
|
338
|
-
`}),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:`
|
|
339
|
-
`});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function t8(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=vE(n[a])}return t}function vE(e){const t=e.spread;return t??e.children.length>1}function n8(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 r8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function i8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function a8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l8(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=Hg(t.children[1]),m=Xj(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 s8(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={},b=u?u[m]:void 0;b&&(x.align=b);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 o8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const V1=9,Q1=32;function u8(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(G1(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(G1(t.slice(l),l>0,!1)),o.join("")}function G1(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===V1||o===Q1;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===V1||o===Q1;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function c8(e,t){const n={type:"text",value:u8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function d8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const f8={blockquote:$9,break:F9,code:q9,delete:H9,emphasis:Z9,footnoteReference:V9,heading:Q9,html:G9,imageReference:K9,image:Y9,inlineCode:X9,linkReference:J9,link:W9,listItem:e8,list:n8,paragraph:r8,root:i8,strong:a8,table:l8,tableCell:o8,tableRow:s8,text:c8,thematicBreak:d8,toml:rd,yaml:rd,definition:rd,footnoteDefinition:rd};function rd(){}const xE=-1,tf=0,tu=1,Ad=2,Xg=3,Jg=4,Wg=5,ey=6,bE=7,SE=8,K1=typeof self=="object"?self:globalThis,h8=(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 tf:case xE:return n(u,l);case tu:{const f=n([],l);for(const m of u)f.push(a(m));return f}case Ad:{const f=n({},l);for(const[m,h]of u)f[a(m)]=a(h);return f}case Xg:return n(new Date(u),l);case Jg:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case Wg:{const f=n(new Map,l);for(const[m,h]of u)f.set(a(m),a(h));return f}case ey:{const f=n(new Set,l);for(const m of u)f.add(a(m));return f}case bE:{const{name:f,message:m}=u;return n(new K1[f](m),l)}case SE: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 K1[o](u),l)};return a},Y1=e=>h8(new Map,e)(0),ds="",{toString:m8}={},{keys:p8}=Object,Go=e=>{const t=typeof e;if(t!=="object"||!e)return[tf,t];const n=m8.call(e).slice(8,-1);switch(n){case"Array":return[tu,ds];case"Object":return[Ad,ds];case"Date":return[Xg,ds];case"RegExp":return[Jg,ds];case"Map":return[Wg,ds];case"Set":return[ey,ds];case"DataView":return[tu,n]}return n.includes("Array")?[tu,n]:n.includes("Error")?[bE,n]:[Ad,n]},id=([e,t])=>e===tf&&(t==="function"||t==="symbol"),g8=(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]=Go(u);switch(f){case tf:{let y=u;switch(m){case"bigint":f=SE,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([xE],u)}return l([f,y],u)}case tu:{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 Ad:{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 p8(u))(e||!id(Go(u[x])))&&y.push([o(x),o(u[x])]);return g}case Xg:return l([f,u.toISOString()],u);case Jg:{const{source:y,flags:g}=u;return l([f,{source:y,flags:g}],u)}case Wg:{const y=[],g=l([f,y],u);for(const[x,b]of u)(e||!(id(Go(x))||id(Go(b))))&&y.push([o(x),o(b)]);return g}case ey:{const y=[],g=l([f,y],u);for(const x of u)(e||!id(Go(x)))&&y.push(o(x));return g}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},X1=(e,{json:t,lossy:n}={})=>{const a=[];return g8(!(t||n),!!t,new Map,a)(e),a},Td=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Y1(X1(e,t)):structuredClone(e):(e,t)=>Y1(X1(e,t));function y8(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 v8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function x8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||y8,a=e.options.footnoteBackLabel||v8,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=Hs(g.toLowerCase());let b=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++b<=j;){k.length>0&&k.push({type:"text",value:" "});let A=typeof n=="string"?n:n(m,b);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,b),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(y,!0)};e.patch(h,_),f.push(_)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Td(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
340
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
341
|
-
`}]}}const nf=(function(e){if(e==null)return k8;if(typeof e=="function")return rf(e);if(typeof e=="object")return Array.isArray(e)?b8(e):S8(e);if(typeof e=="string")return w8(e);throw new Error("Expected function, string, or object as test")});function b8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=nf(e[n]);return rf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function S8(e){const t=e;return rf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function w8(e){return rf(t);function t(n){return n&&n.type===e}}function rf(e){return t;function t(n,a,l){return!!(j8(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function k8(){return!0}function j8(e){return e!==null&&typeof e=="object"&&"type"in e}const wE=[],E8=!0,Kp=!1,C8="skip";function kE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=nf(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 b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(m.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=wE,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(b=N8(n(m,y)),b[0]===Kp))return b;if("children"in m&&m.children){const _=m;if(_.children&&b[0]!==C8)for(j=(a?_.children.length:-1)+u,E=y.concat(_);j>-1&&j<_.children.length;){const A=_.children[j];if(k=f(A,j,E)(),k[0]===Kp)return k;j=typeof k[1]=="number"?k[1]:j+u}}return b}}}function N8(e){return Array.isArray(e)?e:typeof e=="number"?[E8,e]:e==null?wE:[e]}function ty(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),kE(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 Yp={}.hasOwnProperty,_8={};function z8(e,t){const n=t||_8,a=new Map,l=new Map,o=new Map,u={...f8,...n.handlers},f={all:h,applyData:T8,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:A8,wrap:O8};return ty(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,b=f.handlers[x];if(Yp.call(f.handlers,x)&&b)return b(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in y){const{children:j,...E}=y,_=Td(E);return _.children=f.all(y),_}return Td(y)}return(f.options.unknownHandler||R8)(f,y,g)}function h(y){const g=[];if("children"in y){const x=y.children;let b=-1;for(;++b<x.length;){const k=f.one(x[b],y);if(k){if(b&&x[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=J1(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=J1(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function A8(e,t){e.position&&(t.position=vU(e))}function T8(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,Td(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function R8(e,t){const n=t.data||{},a="value"in t&&!(Yp.call(n,"hProperties")||Yp.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 O8(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
342
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
343
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
344
|
-
`}),n}function J1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function W1(e,t){const n=z8(e,t),a=n.one(e,void 0),l=x8(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
345
|
-
`},l),o}function D8(e,t){return e&&"run"in e?async function(n,a){const l=W1(n,{file:a,...t});await e.run(l,a)}:function(n,a){return W1(n,{file:a,...e||t})}}function eS(e){if(e)throw e}var Qm,tS;function M8(){if(tS)return Qm;tS=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 Qm=function m(){var h,y,g,x,b,k,j=arguments[0],E=1,_=arguments.length,A=!1;for(typeof j=="boolean"&&(A=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<_;++E)if(h=arguments[E],h!=null)for(y in h)g=f(j,y),x=f(h,y),j!==x&&(A&&x&&(o(x)||(b=l(x)))?(b?(b=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},u(j,{name:y,newValue:m(A,k,x)})):typeof x<"u"&&u(j,{name:y,newValue:x}));return j},Qm}var L8=M8();const Gm=Od(L8);function Xp(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 U8(){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?I8(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 I8(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 Mr={basename:B8,dirname:P8,extname:$8,join:F8,sep:"/"};function B8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Nu(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 P8(e){if(Nu(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 $8(e){Nu(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 F8(...e){let t=-1,n;for(;++t<e.length;)Nu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":q8(n)}function q8(e){Nu(e);const t=e.codePointAt(0)===47;let n=H8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function H8(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 Nu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Z8={cwd:V8};function V8(){return"/"}function Jp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Q8(e){if(typeof e=="string")e=new URL(e);else if(!Jp(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 G8(e)}function G8(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 Km=["history","path","basename","stem","extname","dirname"];class jE{constructor(t){let n;t?Jp(t)?n={path:t}:typeof t=="string"||K8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Z8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Km.length;){const o=Km[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)Km.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Mr.basename(this.path):void 0}set basename(t){Xm(t,"basename"),Ym(t,"basename"),this.path=Mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mr.dirname(this.path):void 0}set dirname(t){nS(this.basename,"dirname"),this.path=Mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mr.extname(this.path):void 0}set extname(t){if(Ym(t,"extname"),nS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Jp(t)&&(t=Q8(t)),Xm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mr.basename(this.path,this.extname):void 0}set stem(t){Xm(t,"stem"),Ym(t,"stem"),this.path=Mr.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 pn(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 Ym(e,t){if(e&&e.includes(Mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mr.sep+"`")}function Xm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function K8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Y8=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),X8={}.hasOwnProperty;class ny extends Y8{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=U8()}copy(){const t=new ny;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Gm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ep("data",this.frozen),this.namespace[t]=n,this):X8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ep("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=ad(t),a=this.parser||this.Parser;return Jm("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Jm("process",this.parser||this.Parser),Wm("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=ad(t),m=a.parse(f);a.run(m,f,function(y,g,x){if(y||!g||!x)return h(y);const b=g,k=a.stringify(b,x);eB(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(),Jm("processSync",this.parser||this.Parser),Wm("processSync",this.compiler||this.Compiler),this.process(t,l),iS("processSync","process",n),a;function l(o,u){n=!0,eS(o),a=u}}run(t,n,a){rS(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=ad(n);l.run(t,m,h);function h(y,g,x){const b=g||t;y?f(y):u?u(b):a(void 0,b,x)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),iS("runSync","run",a),l;function o(u,f){eS(u),l=f,a=!0}}stringify(t,n){this.freeze();const a=ad(n),l=this.compiler||this.Compiler;return Wm("stringify",l),rS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(ep("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=Gm(!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[b,...k]=y;const j=a[x][1];Xp(j)&&Xp(b)&&(b=Gm(!0,j,b)),a[x]=[h,b,...k]}}}}const J8=new ny().freeze();function Jm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ep(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 rS(e){if(!Xp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ad(e){return W8(e)?e:new jE(e)}function W8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eB(e){return typeof e=="string"||tB(e)}function tB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",aS=[],lS={allowDangerousHtml:!0},rB=/^(https?|ircs?|mailto|xmpp)$/i,iB=[{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 aB(e){const t=lB(e),n=sB(e);return oB(t.runSync(t.parse(n),n),e)}function lB(e){const t=e.rehypePlugins||aS,n=e.remarkPlugins||aS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lS}:lS;return J8().use(P9).use(n).use(D8,a).use(t)}function sB(e){const t=e.children||"",n=new jE;return typeof t=="string"&&(n.value=t),n}function oB(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||uB;for(const y of iB)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+nB+y.id,void 0);return ty(e,h),kU(e,{Fragment:d.Fragment,components:l,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.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 b;for(b in Hm)if(Object.hasOwn(Hm,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],j=Hm[b];(j===null||j.includes(y.tagName))&&(y.properties[b]=m(String(k||""),b,y))}}if(y.type==="element"){let b=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!b&&a&&typeof g=="number"&&(b=!a(y,g,x)),b&&x&&typeof g=="number")return f&&y.children?x.children.splice(g,1,...y.children):x.children.splice(g,1),g}}}function uB(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||rB.test(e.slice(0,t))?e:""}function cB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function EE(e,t,n){const l=nf((n||{}).ignore||[]),o=dB(t);let u=-1;for(;++u<o.length;)kE(e,"text",f);function f(h,y){let g=-1,x;for(;++g<y.length;){const b=y[g],k=x?x.children:void 0;if(l(b,k?k.indexOf(b):void 0,x))return;x=b}if(x)return m(h,y)}function m(h,y){const g=y[y.length-1],x=o[u][0],b=o[u][1];let k=0;const E=g.children.indexOf(h);let _=!1,A=[];x.lastIndex=0;let O=x.exec(h.value);for(;O;){const I=O.index,B={index:O.index,input:O.input,stack:[...y,h]};let R=b(...O,B);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?x.lastIndex=I+1:(k!==I&&A.push({type:"text",value:h.value.slice(k,I)}),Array.isArray(R)?A.push(...R):R&&A.push(R),k=I+O[0].length,_=!0),!x.global)break;O=x.exec(h.value)}return _?(k<h.value.length&&A.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...A)):A=[h],E+A.length}}function dB(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([fB(l[0]),hB(l[1])])}return t}function fB(e){return typeof e=="string"?new RegExp(cB(e),"g"):e}function hB(e){return typeof e=="function"?e:function(){return e}}function mB(e){EE(e,[/\r?\n|\r/g,pB])}function pB(){return{type:"break"}}function gB(){return function(e){mB(e)}}function sS(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 tp="phrasing",np=["autolink","link","image","label"];function yB(){return{transforms:[jB],enter:{literalAutolink:xB,literalAutolinkEmail:rp,literalAutolinkHttp:rp,literalAutolinkWww:rp},exit:{literalAutolink:kB,literalAutolinkEmail:wB,literalAutolinkHttp:bB,literalAutolinkWww:SB}}}function vB(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:tp,notInConstruct:np},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:tp,notInConstruct:np},{character:":",before:"[ps]",after:"\\/",inConstruct:tp,notInConstruct:np}]}}function xB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rp(e){this.config.enter.autolinkProtocol.call(this,e)}function bB(e){this.config.exit.autolinkProtocol.call(this,e)}function SB(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 wB(e){this.config.exit.autolinkEmail.call(this,e)}function kB(e){this.exit(e)}function jB(e){EE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,EB],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),CB]],{ignore:["link","linkReference"]})}function EB(e,t,n,a,l){let o="";if(!CE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!NB(n)))return!1;const u=_B(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 CB(e,t,n,a){return!CE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function NB(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 _B(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=sS(e,"(");let o=sS(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 CE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pl(n)||Wd(n))&&(!t||n!==47)}NE.peek=UB;function zB(){this.buffer()}function AB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function TB(){this.buffer()}function RB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function OB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function DB(e){this.exit(e)}function MB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LB(e){this.exit(e)}function UB(){return"["}function NE(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 IB(){return{enter:{gfmFootnoteCallString:zB,gfmFootnoteCall:AB,gfmFootnoteDefinitionLabelString:TB,gfmFootnoteDefinition:RB},exit:{gfmFootnoteCallString:OB,gfmFootnoteCall:DB,gfmFootnoteDefinitionLabelString:MB,gfmFootnoteDefinition:LB}}}function BB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:NE},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?`
|
|
346
|
-
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?_E:PB))),h(),m}}function PB(e,t,n){return t===0?e:_E(e,t,n)}function _E(e,t,n){return(n?"":" ")+e}const $B=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zE.peek=VB;function FB(){return{canContainEols:["delete"],enter:{strikethrough:HB},exit:{strikethrough:ZB}}}function qB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$B}],handlers:{delete:zE}}}function HB(e){this.enter({type:"delete",children:[]},e)}function ZB(e){this.exit(e)}function zE(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 VB(){return"~"}function QB(e){return e.length}function GB(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||QB,o=[],u=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],E=[];let _=-1;for(e[y].length>h&&(h=e[y].length);++_<e[y].length;){const A=KB(e[y][_]);if(n.alignDelimiters!==!1){const O=l(A);E[_]=O,(m[_]===void 0||O>m[_])&&(m[_]=O)}j.push(A)}u[y]=j,f[y]=E}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=oS(a[g]);else{const j=oS(a);for(;++g<h;)o[g]=j}g=-1;const x=[],b=[];for(;++g<h;){const j=o[g];let E="",_="";j===99?(E=":",_=":"):j===108?E=":":j===114&&(_=":");let A=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-_.length);const O=E+"-".repeat(A)+_;n.alignDelimiters!==!1&&(A=E.length+A+_.length,A>m[g]&&(m[g]=A),b[g]=A),x[g]=O}u.splice(1,0,x),f.splice(1,0,b),y=-1;const k=[];for(;++y<u.length;){const j=u[y],E=f[y];g=-1;const _=[];for(;++g<h;){const A=j[g]||"";let O="",I="";if(n.alignDelimiters!==!1){const B=m[g]-(E[g]||0),R=o[g];R===114?O=" ".repeat(B):R===99?B%2?(O=" ".repeat(B/2+.5),I=" ".repeat(B/2-.5)):(O=" ".repeat(B/2),I=O):I=" ".repeat(B)}n.delimiterStart!==!1&&!g&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||g)&&_.push(" "),n.alignDelimiters!==!1&&_.push(O),_.push(A),n.alignDelimiters!==!1&&_.push(I),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&_.push("|")}k.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return k.join(`
|
|
347
|
-
`)}function KB(e){return e==null?"":String(e)}function oS(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 YB(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()),XB);return l(),u}function XB(e,t,n){return">"+(n?"":" ")+e}function JB(e,t){return uS(e,t.inConstruct,!0)&&!uS(e,t.notInConstruct,!1)}function uS(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 cS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
348
|
-
`&&JB(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
349
|
-
`}function WB(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 eP(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 tP(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 nP(e,t,n,a){const l=tP(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(eP(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(o,rP);return g(),x}const f=n.createTracker(a),m=l.repeat(Math.max(WB(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${u}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
350
|
-
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
351
|
-
`),o&&(y+=f.move(o+`
|
|
352
|
-
`)),y+=f.move(m),h(),y}function rP(e,t,n){return(n?"":" ")+e}function ry(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 iP(e,t,n,a){const l=ry(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?" ":`
|
|
353
|
-
`,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),u(),h}function aP(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 fu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Rd(e,t,n){const a=Ls(e),l=Ls(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}}AE.peek=lP;function AE(e,t,n,a){const l=aP(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=Rd(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=fu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),x=Rd(a.after.charCodeAt(0),g,l);x.inside&&(m=m.slice(0,-1)+fu(g));const b=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},f+m+b}function lP(e,t,n){return n.options.emphasis||"*"}function sP(e,t){let n=!1;return ty(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Kp}),!!((!e.depth||e.depth<3)&&Gg(e)&&(t.options.setext||n))}function oP(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(sP(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...o.current(),before:`
|
|
354
|
-
`,after:`
|
|
355
|
-
`});return g(),y(),x+`
|
|
356
|
-
`+(l===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
357
|
-
`))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
358
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=fu(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}TE.peek=uP;function TE(e){return e.value||""}function uP(){return"<"}RE.peek=cP;function RE(e,t,n,a){const l=ry(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 cP(){return"!"}OE.peek=dP;function OE(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 dP(){return"!"}DE.peek=fP;function DE(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 fP(){return"`"}function ME(e,t){const n=Gg(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))}LE.peek=hP;function LE(e,t,n,a){const l=ry(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let f,m;if(ME(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 hP(e,t,n){return ME(e,n)?"<":"["}UE.peek=mP;function UE(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 mP(){return"["}function iy(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 pP(e){const t=iy(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 gP(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 IE(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 yP(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?gP(n):iy(n);const f=e.ordered?u==="."?")":".":pP(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),IE(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 vP(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 xP(e,t,n,a){const l=vP(n);let o=n.bulletCurrent||iy(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,b){return x?(b?"":" ".repeat(u))+g:(b?o:o+" ".repeat(u-o.length))+g}}function bP(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,a);return o(),l(),u}const SP=nf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function wP(e,t,n,a){return(e.children.some(function(u){return SP(u)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function kP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}BE.peek=jP;function BE(e,t,n,a){const l=kP(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=Rd(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=fu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),x=Rd(a.after.charCodeAt(0),g,l);x.inside&&(m=m.slice(0,-1)+fu(g));const b=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},f+m+b}function jP(e,t,n){return n.options.strong||"*"}function EP(e,t,n,a){return n.safe(e.value,a)}function CP(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 NP(e,t,n){const a=(IE(n)+(n.options.ruleSpaces?" ":"")).repeat(CP(n));return n.options.ruleSpaces?a.slice(0,-1):a}const PE={blockquote:YB,break:cS,code:nP,definition:iP,emphasis:AE,hardBreak:cS,heading:oP,html:TE,image:RE,imageReference:OE,inlineCode:DE,link:LE,linkReference:UE,list:yP,listItem:xP,paragraph:bP,root:wP,strong:BE,text:EP,thematicBreak:NP};function _P(){return{enter:{table:zP,tableData:dS,tableHeader:dS,tableRow:TP},exit:{codeText:RP,table:AP,tableData:ip,tableHeader:ip,tableRow:ip}}}function zP(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 AP(e){this.exit(e),this.data.inTable=void 0}function TP(e){this.enter({type:"tableRow",children:[]},e)}function ip(e){this.exit(e)}function dS(e){this.enter({type:"tableCell",children:[]},e)}function RP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,OP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function OP(e,t){return t==="|"?t:e}function DP(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
359
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:m,tableRow:f}};function u(b,k,j,E){return h(y(b,j,E),b.align)}function f(b,k,j,E){const _=g(b,j,E),A=h([_]);return A.slice(0,A.indexOf(`
|
|
360
|
-
`))}function m(b,k,j,E){const _=j.enter("tableCell"),A=j.enter("phrasing"),O=j.containerPhrasing(b,{...E,before:o,after:o});return A(),_(),O}function h(b,k){return GB(b,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(b,k,j){const E=b.children;let _=-1;const A=[],O=k.enter("table");for(;++_<E.length;)A[_]=g(E[_],k,j);return O(),A}function g(b,k,j){const E=b.children;let _=-1;const A=[],O=k.enter("tableRow");for(;++_<E.length;)A[_]=m(E[_],b,k,j);return O(),A}function x(b,k,j){let E=PE.inlineCode(b,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function MP(){return{exit:{taskListCheckValueChecked:fS,taskListCheckValueUnchecked:fS,paragraph:UP}}}function LP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:IP}}}function fS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function UP(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 IP(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=PE.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 BP(){return[yB(),IB(),FB(),_P(),MP()]}function PP(e){return{extensions:[vB(),BB(e),qB(),DP(e),LP()]}}const $P={tokenize:QP,partial:!0},$E={tokenize:GP,partial:!0},FE={tokenize:KP,partial:!0},qE={tokenize:YP,partial:!0},FP={tokenize:XP,partial:!0},HE={name:"wwwAutolink",tokenize:ZP,previous:VE},ZE={name:"protocolAutolink",tokenize:VP,previous:QE},Ni={name:"emailAutolink",tokenize:HP,previous:GE},Hr={};function qP(){return{text:Hr}}let Wa=48;for(;Wa<123;)Hr[Wa]=Ni,Wa++,Wa===58?Wa=65:Wa===91&&(Wa=97);Hr[43]=Ni;Hr[45]=Ni;Hr[46]=Ni;Hr[95]=Ni;Hr[72]=[Ni,ZE];Hr[104]=[Ni,ZE];Hr[87]=[Ni,HE];Hr[119]=[Ni,HE];function HP(e,t,n){const a=this;let l,o;return u;function u(g){return!Wp(g)||!GE.call(a,a.previous)||ay(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Wp(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(FP,y,h)(g):g===45||g===95||mn(g)?(o=!0,e.consume(g),m):y(g)}function h(g){return e.consume(g),l=!0,m}function y(g){return o&&l&&bn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function ZP(e,t,n){const a=this;return l;function l(u){return u!==87&&u!==119||!VE.call(a,a.previous)||ay(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($P,e.attempt($E,e.attempt(FE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function VP(e,t,n){const a=this;let l="",o=!1;return u;function u(g){return(g===72||g===104)&&QE.call(a,a.previous)&&!ay(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(bn(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||zd(g)||xt(g)||pl(g)||Wd(g)?n(g):e.attempt($E,e.attempt(FE,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function QP(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 GP(e,t,n){let a,l,o;return u;function u(h){return h===46||h===95?e.check(qE,m,f)(h):h===null||xt(h)||pl(h)||h!==45&&Wd(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 KP(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(qE,t,o)(u):u===null||xt(u)||pl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&a++,e.consume(u),l}}function YP(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||xt(f)||pl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||xt(f)||pl(f)?t(f):a(f)}function o(f){return bn(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),a):bn(f)?(e.consume(f),u):n(f)}}function XP(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return mn(o)?n(o):t(o)}}function VE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function QE(e){return!bn(e)}function GE(e){return!(e===47||Wp(e))}function Wp(e){return e===43||e===45||e===46||e===95||mn(e)}function ay(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 JP={tokenize:l$,partial:!0};function WP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:r$,continuation:{tokenize:i$},exit:a$}},text:{91:{name:"gfmFootnoteCall",tokenize:n$},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:e$,resolveTo:t$}}}}function e$(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=Cr(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 t$(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 n$(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||xt(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return l.includes(Cr(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return xt(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 r$(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||xt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Cr(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return xt(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),et(e,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return t(k)}}function i$(e,t,n){return e.check(Cu,t,e.attempt(JP,t,n))}function a$(e){e.exit("gfmFootnoteDefinition")}function l$(e,t,n){const a=this;return et(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 s$(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]],b=f.parser.constructs.insideSpan.null;b&&Xn(x,x.length,0,ef(b,u.slice(h+1,m),f)),Xn(x,x.length,0,[["exit",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",y,f]]),Xn(u,h-1,m-h+3,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"),b(k))}function b(k){const j=Ls(h);if(k===126)return g>1?m(k):(u.consume(k),g++,b);if(g<2&&!n)return m(k);const E=u.exit("strikethroughSequenceTemporary"),_=Ls(k);return E._open=!_||_===2&&!!j,E._close=!j||j===2&&!!_,f(k)}}}class o${constructor(){this.map=[]}add(t,n,a){u$(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 u$(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 c$(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 d$(){return{flow:{null:{name:"table",tokenize:f$,resolveAll:h$}}}}function f$(e,t,n){const a=this;let l=0,o=0,u;return f;function f(q){let ie=a.events.length-1;for(;ie>-1;){const de=a.events[ie][1].type;if(de==="lineEnding"||de==="linePrefix")ie--;else break}const re=ie>-1?a.events[ie][1].type:null,pe=re==="tableHead"||re==="tableRow"?R:m;return pe===R&&a.parser.lazy[a.now().line]?n(q):pe(q)}function m(q){return e.enter("tableHead"),e.enter("tableRow"),h(q)}function h(q){return q===124||(u=!0,o+=1),y(q)}function y(q){return q===null?n(q):Ae(q)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),b):n(q):Qe(q)?et(e,y,"whitespace")(q):(o+=1,u&&(u=!1,l+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),g(q)))}function g(q){return q===null||q===124||xt(q)?(e.exit("data"),y(q)):(e.consume(q),q===92?x:g)}function x(q){return q===92||q===124?(e.consume(q),g):g(q)}function b(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(q):(e.enter("tableDelimiterRow"),u=!1,Qe(q)?et(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):k(q))}function k(q){return q===45||q===58?E(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),j):B(q)}function j(q){return Qe(q)?et(e,E,"whitespace")(q):E(q)}function E(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),_):q===45?(o+=1,_(q)):q===null||Ae(q)?I(q):B(q)}function _(q){return q===45?(e.enter("tableDelimiterFiller"),A(q)):B(q)}function A(q){return q===45?(e.consume(q),A):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(q))}function O(q){return Qe(q)?et(e,I,"whitespace")(q):I(q)}function I(q){return q===124?k(q):q===null||Ae(q)?!u||l!==o?B(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(q)):B(q)}function B(q){return n(q)}function R(q){return e.enter("tableRow"),$(q)}function $(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),$):q===null||Ae(q)?(e.exit("tableRow"),t(q)):Qe(q)?et(e,$,"whitespace")(q):(e.enter("data"),Z(q))}function Z(q){return q===null||q===124||xt(q)?(e.exit("data"),$(q)):(e.consume(q),q===92?ee:Z)}function ee(q){return q===92||q===124?(e.consume(q),Z):Z(q)}}function h$(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 o$;for(;++n<e.length;){const b=e[n],k=b[1];b[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(hS(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=ld(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=ld(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=ld(x,t,o,l,n,g)):u[1]!==0&&(g=ld(x,t,u,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&hS(x,t,m,h,y),x.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=c$(t.events,n))}return e}function ld(e,t,n,a,l,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ms(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ms(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ms(t.events,n[2]),y=ms(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const x=t.events[n[2]],b=t.events[n[3]];if(x[1].end=Object.assign({},b[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({},ms(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function hS(e,t,n,a,l){const o=[],u=ms(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 ms(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const m$={name:"tasklistCheck",tokenize:g$};function p$(){return{text:{91:m$}}}function g$(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 xt(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 Ae(m)?t(m):Qe(m)?e.check({tokenize:y$},t,n)(m):n(m)}}function y$(e,t,n){return et(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function v$(e){return iE([qP(),WP(),s$(e),d$(),p$()])}const x$={};function b$(e){const t=this,n=e||x$,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(v$(n)),o.push(BP()),u.push(PP(n))}function KE({children:e,className:t}){return d.jsx("div",{className:Te("prose prose-sm max-w-none","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-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:d.jsx(aB,{remarkPlugins:[b$,gB],children:e})})}function S$({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,u]=S.useState(!1),f=S.useRef(null),m=e!==t;return S.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),d.jsxs("section",{style:{background:"var(--bg-raised)",border:`1px solid ${m?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2",style:{fontSize:12,fontWeight:600,color:"var(--fg)"},children:["System Prompt Append",m&&d.jsx("span",{className:"mono uppercase",style:{fontSize:10,letterSpacing:"0.06em",padding:"1px 6px",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),d.jsx("div",{className:"flex gap-2",children:!o&&!l&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[d.jsx(Bd,{className:"h-3 w-3"})," Edit"]})})]}),d.jsx("div",{className:"px-4 py-3",children:o?d.jsxs("div",{className:"space-y-2",children:[d.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{size:"xs",variant:"ghost",onClick:()=>{a(),u(!1)},disabled:!m,children:"Revert"}),d.jsx(ve,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):d.jsx("div",{className:"rounded bg-muted p-3 text-sm max-h-64 overflow-auto min-h-8",children:e?d.jsx(KE,{children:e}):d.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}const w$={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function k$(e){return!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage?null:d.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 border-t bg-yellow-50/95 px-6 py-3 backdrop-blur",children:d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[e.summary.anyDirty&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{"aria-hidden":!0,children:"🟡"}),d.jsxs("span",{className:"font-medium",children:[e.summary.dirtySections.length," section",e.summary.dirtySections.length===1?"":"s"," with unsaved changes"]}),d.jsx("span",{className:"text-muted-foreground",children:"·"}),d.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(t=>d.jsx("button",{type:"button",className:"rounded bg-white px-2 py-0.5 text-xs border hover:bg-amber-100",onClick:()=>e.onJumpTo(t),children:w$[t]},t))})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:e.saveHint}),e.conflictMessage&&d.jsx("p",{className:"text-xs text-amber-900 font-medium",children:e.conflictMessage}),e.errorMessage&&d.jsx("p",{className:"text-xs text-red-800 font-medium",children:e.errorMessage})]}),d.jsxs("div",{className:"flex gap-2",children:[e.conflictMessage&&d.jsx(ve,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),d.jsx(ve,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),d.jsx(ve,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?"Saving…":"Save"})]})]})})}function Er(e){return`agent-cfg-${e}`}function j$(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 E$(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function C$(e,t){return JSON.stringify(e)===JSON.stringify(t)}function ap(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function mS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:C$(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function lp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=E$(n,u),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:mS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:mS(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 N$(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:ap(e.payload.mcpServers,"mcp"),env:ap(e.payload.env,"env"),git:ap(e.payload.gitRepos,"git")}}function _$(e){const[t,n]=S.useState(null);S.useEffect(()=>{e&&t===null&&n(N$(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=S.useMemo(()=>{const O=[],I=Z=>Z.reduce((ee,q)=>q.status==="unchanged"?ee:ee+1,0),B=I(a.mcp),R=I(a.env),$=I(a.git);return u&&O.push("prompt"),f&&O.push("model"),B>0&&O.push("mcp"),R>0&&O.push("env"),$>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:u?1:0,model:f?1:0,mcp:B,env:R,git:$}}},[a,u,f]),h=S.useCallback(O=>{n(I=>I&&O(I))},[]),y=S.useCallback(O=>h(I=>({...I,promptAppend:O})),[h]),g=S.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),x=S.useCallback(O=>h(I=>({...I,model:O})),[h]),b=S.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=S.useMemo(()=>lp("mcp",h),[h]),j=S.useMemo(()=>lp("env",h),[h]),E=S.useMemo(()=>lp("git",h),[h]),_=S.useCallback(()=>{n(null)},[]),A=S.useCallback(()=>{if(!t||!e)return{};const O={};u&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const I=m.counts.mcp>0,B=m.counts.env>0,R=m.counts.git>0;return I&&(O.mcpServers=t.mcp.filter($=>$.status!=="deleted").map($=>$.value)),B&&(O.env=t.env.filter($=>$.status!=="deleted").map($=>{const Z=$.value;return Z.sensitive&&Z.value===$p?{key:Z.key,value:$p,sensitive:!0}:Z})),R&&(O.gitRepos=t.git.filter($=>$.status!=="deleted").map($=>$.value)),O},[t,e,u,f,m]);return{draft:a,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:x,revertModel:b,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:_,buildPayloadPatch:A}}const z$=Object.values(h5);function A$(e){const t=[{key:"identity",label:"Profile",anchor:"ad-identity"},{key:"bindings",label:"Bindings",anchor:"ad-bindings"}],n=e?[]:[{key:"prompt",label:"Prompt",anchor:Er("prompt")},{key:"model",label:"Model",anchor:Er("model")},{key:"mcp",label:"MCP tools",anchor:Er("mcp")},{key:"env",label:"Environment",anchor:Er("env")},{key:"git",label:"Git",anchor:Er("git")}],a=[{key:"danger",label:"Danger zone",anchor:"ad-danger"}],l=[{label:"Identity",items:t}];return n.length>0&&l.push({label:"Runtime",items:n}),l.push({label:"Danger zone",items:a}),l}function T$(){var Ta,Ra,Oa,zr,Da,Ai,_u,Qs,Sl,Ti,zu,Gs;const t=X_().uuid??"",n=qr(),a=Wn(),l=qe({queryKey:["agent",t],queryFn:()=>Mk(t),enabled:!!t}),o=qe({queryKey:["agent-config",t],queryFn:()=>CL(t),enabled:!!t&&((Ta=l.data)==null?void 0:Ta.type)!=="human"}),u=qe({queryKey:["agent-client-status",t],queryFn:()=>zL(t),enabled:!!t&&((Ra=l.data)==null?void 0:Ra.type)!=="human"}),f=qe({queryKey:["agent-sessions-active",t],queryFn:()=>$s(t,{state:"active"}),enabled:!!t&&((Oa=l.data)==null?void 0:Oa.type)!=="human"}),m=qe({queryKey:["adapters"],queryFn:qj}),h=qe({queryKey:["adapter-mappings"],queryFn:$j}),{data:y}=qe({queryKey:["adapter-statuses"],queryFn:Fj,refetchInterval:15e3}),g=((zr=m.data)==null?void 0:zr.filter(oe=>oe.agentId===t))??[],x=((Da=h.data)==null?void 0:Da.filter(oe=>oe.agentId===t))??[],b=_$(o.data),[k,j]=S.useState(null),[E,_]=S.useState(null),A=yt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const oe=b.buildPayloadPatch();return NL(t,{expectedVersion:o.data.version,payload:oe})},onSuccess:oe=>{a.setQueryData(["agent-config",t],oe),j(null),_(null)},onError:oe=>{if(oe instanceof Ud&&oe.status===409){_("Someone else saved a newer version while you were editing."),j(null);return}j(oe instanceof Error?oe.message:String(oe))}}),O=S.useCallback(()=>{_(null),j(null),a.invalidateQueries({queryKey:["agent-config",t]}),b.resetAll()},[a,t,b]),I=S.useCallback(oe=>{const He=document.getElementById(oe);He&&He.scrollIntoView({behavior:"smooth",block:"start"})},[]),B=yt({mutationFn:oe=>K0(t,oe),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),R=yt({mutationFn:()=>vD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),$=yt({mutationFn:()=>xD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),Z=yt({mutationFn:()=>yD(t),onSuccess:()=>n("/agents")}),ee=yt({mutationFn:()=>bD(t)}),[q,ie]=S.useState(!1),[re,pe]=S.useState(""),[de,W]=S.useState(null),P=qe({queryKey:["clients"],queryFn:$d,enabled:q}),V=yt({mutationFn:oe=>K0(t,{clientId:oe}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),ie(!1),pe(""),W(null)},onError:oe=>W(oe instanceof Error?oe.message:String(oe))}),[ce,xe]=S.useState(!1),[T,L]=S.useState(null),[z,C]=S.useState(sp),[J,Y]=S.useState(""),ue=yt({mutationFn:async()=>{const oe=pS(z);if(!oe)throw new Error("Credentials are required");return kL({platform:z.platform,agentId:t,credentials:oe,status:z.status})},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),me()}}),ge=yt({mutationFn:()=>{if(!T)throw new Error("No adapter selected");const oe={status:z.status},He=pS(z);return He&&(oe.credentials=He),jL(T,oe)},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),me()}}),Me=yt({mutationFn:EL,onSuccess:()=>a.invalidateQueries({queryKey:["adapters"]})}),be=yt({mutationFn:()=>SL({platform:z.platform,externalUserId:z.externalUserId,agentId:t,boundVia:"manual",displayName:z.displayName||void 0}),onSuccess:()=>{a.invalidateQueries({queryKey:["adapter-mappings"]}),me()}}),Nt=yt({mutationFn:wL,onSuccess:()=>a.invalidateQueries({queryKey:["adapter-mappings"]})}),[en,Bn]=S.useState(null),tr=yt({mutationFn:()=>_L(t,b.buildPayloadPatch()),onSuccess:oe=>{const He=oe.diff.length?oe.diff.map(Kt=>`${Kt.op} ${Kt.path}`).join(`
|
|
361
|
-
`):"(no changes)";Bn(He)},onError:oe=>Bn(`Dry run failed: ${oe instanceof Error?oe.message:String(oe)}`)});S.useEffect(()=>{if(!b.summary.anyDirty)return;const oe=He=>{He.preventDefault(),He.returnValue=""};return window.addEventListener("beforeunload",oe),()=>window.removeEventListener("beforeunload",oe)},[b.summary.anyDirty]);const tn=((Ai=l.data)==null?void 0:Ai.type)==="human",_i=S.useMemo(()=>A$(tn),[tn]);if(l.isLoading)return d.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:d.jsx("div",{className:"p-6",style:{color:"var(--fg-3)",fontSize:12},children:"Loading…"})});if(l.error)return d.jsxs("div",{className:"-m-6 p-6",style:{color:"var(--state-error)",fontSize:12},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const ft=l.data;if(!ft)return d.jsx("div",{className:"-m-6 p-6",style:{color:"var(--fg-3)",fontSize:12},children:"Agent not found"});const Gt=ft.type==="human",xr=u.data,Zr=((_u=f.data)==null?void 0:_u.length)??0,Vr=!Gt&&!(xr!=null&&xr.clientId),za=!Gt&&xr?!xr.online&&!!xr.clientId:!1,Aa=ft,Zs=Aa.runtimeState??null,nn=Aa.runtimeType??null,Vs=Aa.totalSessions??null,ne=ft.uuid.slice(0,8);function me(){xe(!1),L(null),C(sp),Y("")}function Oe(oe){L(oe.id),C({...sp,platform:oe.platform,status:oe.status}),xe(!0)}function $e(oe){if(oe.preventDefault(),Y(""),Gt){if(!z.externalUserId)return;be.mutate();return}if(z.platform==="feishu"){if(!T&&(!z.feishuAppId||!z.feishuAppSecret)){Y("App ID and App Secret are required");return}}else if(z.platform==="kael"){if(!T&&(!z.kaelUserId||!z.kaelProjectId)){Y("User ID and Project ID are required");return}}else{const He=z.credentialsJson.trim();if(!T&&!He){Y("Credentials are required");return}if(He)try{JSON.parse(He)}catch{Y("Invalid JSON");return}}T?ge.mutate():ue.mutate()}const nt=ue.error??ge.error??be.error,cn=ue.isPending||ge.isPending||be.isPending,br=j$({activeSessions:Zr,isUnclaimed:Vr,isOffline:za}),rn=b.draft.mcp.filter(oe=>oe.status!=="deleted"),Dt=b.draft.env.filter(oe=>oe.status!=="deleted"),dn=b.draft.git.filter(oe=>oe.status!=="deleted"),ut=oe=>new Set(rn.filter(He=>He.key!==oe).map(He=>He.value.name.toLowerCase())),_r=oe=>new Set(Dt.filter(He=>He.key!==oe).map(He=>He.value.key)),Pn=oe=>new Set(dn.filter(He=>He.key!==oe).map(He=>{const{value:Kt}=He;return Kt.localPath?Kt.localPath:((Kt.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),zi={sessions:Vs??"—",active:Zr,runtime:nn??(Gt?"human":"—"),model:((Sl=(Qs=o.data)==null?void 0:Qs.payload.model)==null?void 0:Sl.trim())||"—"};return d.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - 40px)"},children:[d.jsx("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"1px solid var(--border)",background:"var(--bg-raised)",padding:"12px 0"},children:_i.map(oe=>d.jsxs("div",{style:{marginBottom:12},children:[d.jsx(ju,{style:{display:"block",padding:"4px 16px"},children:oe.label}),oe.items.map(He=>d.jsx("button",{type:"button",onClick:()=>I(He.anchor),className:"block w-full text-left bg-transparent",style:{padding:"5px 16px 5px 14px",fontSize:12,color:"var(--fg-3)",border:"none",borderLeft:"2px solid transparent",cursor:"pointer"},onMouseEnter:Kt=>{Kt.currentTarget.style.color="var(--fg)",Kt.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:Kt=>{Kt.currentTarget.style.color="var(--fg-3)",Kt.currentTarget.style.background="transparent"},children:He.label},He.key))]},oe.label))}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[d.jsxs("div",{style:{padding:"14px 20px",borderBottom:"1px solid var(--border-faint)",background:"var(--bg-raised)"},children:[d.jsxs(AL,{style:{marginBottom:8},children:[d.jsx(TL,{onClick:()=>n("/agents"),children:"Agents"}),d.jsx(RL,{}),d.jsx(OL,{mono:!0,children:ft.name??ne})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:6,background:"var(--bg-active)",border:"1px solid var(--border-strong)"},children:d.jsx(wu,{width:18,height:20,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{style:{fontSize:16,fontWeight:600,letterSpacing:-.2},children:ft.displayName??ft.name??ne}),d.jsxs("span",{className:"mono",style:{fontSize:11,color:"var(--fg-4)"},children:["@",ft.name??ne]})]}),d.jsxs("div",{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:["agt_",ne," · ",ft.type,ft.visibility?` · ${ft.visibility}`:""]})]}),d.jsx(ml,{state:Zs}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx(ve,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${ft.uuid}`),children:"Open chat →"}),!Gt&&ft.status==="active"&&d.jsxs(ve,{variant:"outline",size:"xs",onClick:()=>{ee.reset(),ee.mutate()},disabled:ee.isPending,children:[d.jsx(DA,{className:"h-3 w-3"}),ee.isPending?"Testing…":"Test"]})]})]}),d.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[d.jsx(nd,{label:"sessions",value:zi.sessions}),d.jsx(nd,{label:"active",value:zi.active,accent:typeof zi.active=="number"&&zi.active>0?"var(--accent)":void 0}),d.jsx(nd,{label:"runtime",value:zi.runtime}),d.jsx(nd,{label:"model",value:zi.model})]})]}),d.jsxs("div",{className:"mx-auto",style:{padding:"14px 20px 28px",maxWidth:960,display:"flex",flexDirection:"column",gap:16},children:[(ee.data||ee.error)&&d.jsx(U$,{result:ee.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>ee.reset()}),Vr&&ft.status==="active"&&d.jsxs("div",{className:"flex items-center justify-between gap-3",style:{borderRadius:6,padding:"10px 14px",background:"color-mix(in oklch, var(--state-blocked) 10%, transparent)",border:"1px solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[d.jsxs("div",{style:{fontSize:12},children:[d.jsx("div",{style:{fontWeight:500},children:"No computer bound"}),d.jsx("div",{style:{color:"var(--fg-3)",fontSize:11},children:"Bind this agent to a computer so it can run. A computer will also claim it on first WebSocket connect."})]}),d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>ie(!0),children:[d.jsx(_p,{className:"h-3 w-3"}),"Bind computer"]})]}),d.jsx("div",{id:"ad-identity",children:d.jsx(qL,{agent:ft,onSave:async oe=>{await B.mutateAsync(oe)}})}),!Gt&&d.jsxs(R$,{loaded:!!o.data,loading:o.isLoading,error:o.error?String(o.error):null,version:((Ti=o.data)==null?void 0:Ti.version)??null,dirty:b.summary.anyDirty,children:[d.jsx("div",{id:Er("prompt"),children:d.jsx(S$,{value:b.draft.promptAppend,baseline:((zu=o.data)==null?void 0:zu.payload.prompt.append)??"",onChange:b.setPromptAppend,onRevert:b.revertPrompt,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("model"),children:d.jsx(GL,{value:b.draft.model,baseline:((Gs=o.data)==null?void 0:Gs.payload.model)??"",onChange:b.setModel,onRevert:b.revertModel,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("mcp"),children:d.jsx(ZL,{items:b.draft.mcp,otherNames:ut,onAdd:b.addMcp,onUpdate:b.updateMcp,onDelete:b.deleteMcp,onUndoDelete:b.undoDeleteMcp,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("env"),children:d.jsx(BL,{items:b.draft.env,otherKeys:_r,onAdd:b.addEnv,onUpdate:b.updateEnv,onDelete:b.deleteEnv,onUndoDelete:b.undoDeleteEnv,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("git"),children:d.jsx($L,{items:b.draft.git,otherPaths:Pn,onAdd:b.addGit,onUpdate:b.updateGit,onDelete:b.deleteGit,onUndoDelete:b.undoDeleteGit,disabled:ft.status!=="active"})}),en&&d.jsx("pre",{className:"whitespace-pre-wrap mono",style:{padding:8,borderRadius:4,background:"var(--bg-sunken)",border:"1px solid var(--border-faint)",fontSize:11,color:"var(--fg-2)"},children:en})]}),d.jsx("div",{id:"ad-bindings",children:d.jsxs(Fr,{children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("div",{className:"inline-flex items-center gap-2",style:{fontSize:12,fontWeight:600},children:[Gt?d.jsx(_p,{className:"h-3.5 w-3.5"}):d.jsx(sA,{className:"h-3.5 w-3.5"}),"Platform bindings"]}),d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>xe(!0),children:[d.jsx(gl,{className:"h-3 w-3"}),Gt?"Bind user":"Bind bot"]})]}),Gt?d.jsxs(Si,{children:[d.jsx(wi,{children:d.jsxs(Qt,{children:[d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"External user ID"}),d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Bound via"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:32}})]})}),d.jsx(ki,{children:x.length===0?d.jsx(Qt,{children:d.jsx(Ee,{colSpan:6,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):x.map(oe=>d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx(Wt,{children:oe.platform})}),d.jsx(Ee,{className:"mono",style:{fontSize:11},children:oe.externalUserId}),d.jsx(Ee,{children:oe.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:"outline",children:oe.boundVia??"—"})}),d.jsx(Ee,{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:bi(oe.createdAt)}),d.jsx(Ee,{children:d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{confirm("Remove this binding?")&&Nt.mutate(oe.id)},disabled:Nt.isPending,children:d.jsx(au,{className:"h-3.5 w-3.5"})})})]},oe.id))})]}):d.jsxs(Si,{children:[d.jsx(wi,{children:d.jsxs(Qt,{children:[d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Connection"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:64}})]})}),d.jsx(ki,{children:g.length===0?d.jsx(Qt,{children:d.jsx(Ee,{colSpan:5,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):g.map(oe=>{const He=y==null?void 0:y.find(wl=>wl.configId===oe.id),Kt=oe.platform==="kael"?oe.status==="active":!!(He!=null&&He.connected);return d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx(Wt,{children:oe.platform})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:oe.status==="active"?"accent":"outline",children:oe.status})}),d.jsx(Ee,{children:d.jsx(ml,{state:Kt?"idle":"offline"})}),d.jsx(Ee,{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:bi(oe.createdAt)}),d.jsx(Ee,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Oe(oe),title:"Edit",children:"…"}),d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{confirm("Remove this bot binding?")&&Me.mutate(oe.id)},disabled:Me.isPending,title:"Delete",children:d.jsx(au,{className:"h-3.5 w-3.5"})})]})})]},oe.id)})})]})]})}),d.jsx("div",{id:"ad-danger",children:d.jsx(ML,{agent:ft,suspendPending:R.isPending,reactivatePending:$.isPending,deletePending:Z.isPending,onSuspend:()=>{confirm("Suspend this agent? Runtime binds and HTTP calls will be refused.")&&R.mutate()},onReactivate:()=>$.mutate(),onDelete:()=>Z.mutate()})}),!Gt&&b.summary.anyDirty&&d.jsx("div",{style:{fontSize:11,color:"var(--fg-3)"},children:d.jsx("button",{type:"button",onClick:()=>tr.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:tr.isPending,children:tr.isPending?"Computing dry-run…":"Preview server-side diff"})})]}),!Gt&&d.jsx(k$,{summary:b.summary,saveHint:br,conflictMessage:E,errorMessage:k,saving:A.isPending,onSave:()=>A.mutate(),onDiscard:()=>{(!b.summary.anyDirty||confirm("Discard all unsaved changes?"))&&(b.resetAll(),j(null),_(null))},onReloadRemote:O,onJumpTo:oe=>I(Er(oe))})]}),d.jsx(On,{open:q,onOpenChange:oe=>{ie(oe),oe||(pe(""),W(null),V.reset())},children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Bind computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),P.isLoading?d.jsx("div",{className:"text-sm",style:{color:"var(--fg-3)"},children:"Loading computers…"}):P.error?d.jsxs("div",{className:"text-sm",style:{color:"var(--state-error)"},children:["Failed to load computers: ",P.error instanceof Error?P.error.message:"Unknown"]}):d.jsx(O$,{clients:P.data??[],selected:re,onSelect:pe}),de&&d.jsx("div",{className:"text-sm",style:{color:"var(--state-error)"},children:de})]}),d.jsxs(Dn,{children:[d.jsx(ve,{variant:"outline",onClick:()=>ie(!1),children:"Cancel"}),d.jsx(ve,{disabled:!re||V.isPending,onClick:()=>{W(null),V.mutate(re)},children:V.isPending?"Binding…":"Bind"})]})]})}),d.jsx(On,{open:ce,onOpenChange:oe=>oe?xe(!0):me(),children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:Gt?"Bind External User":T?"Edit Bot Binding":"Bind Bot"})}),d.jsxs("form",{onSubmit:$e,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"binding-platform",children:"Platform"}),d.jsx("select",{id:"binding-platform",value:z.platform,onChange:oe=>C({...z,platform:oe.target.value}),disabled:!!T,className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:z$.map(oe=>d.jsx("option",{value:oe,children:oe},oe))})]}),Gt?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"binding-ext-id",children:"External User ID"}),d.jsx(vt,{id:"binding-ext-id",value:z.externalUserId,onChange:oe=>C({...z,externalUserId:oe.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"binding-name",children:"Display Name (optional)"}),d.jsx(vt,{id:"binding-name",value:z.displayName,onChange:oe=>C({...z,displayName:oe.target.value})})]})]}):d.jsxs(d.Fragment,{children:[z.platform==="feishu"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"feishu-app-id",children:["App ID",T?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"feishu-app-id",value:z.feishuAppId,onChange:oe=>C({...z,feishuAppId:oe.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"feishu-app-secret",children:["App Secret",T?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:z.feishuAppSecret,onChange:oe=>C({...z,feishuAppSecret:oe.target.value}),placeholder:"••••••••"})]})]}):z.platform==="kael"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"kael-user-id",children:["User ID",T?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"kael-user-id",value:z.kaelUserId,onChange:oe=>C({...z,kaelUserId:oe.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"kael-project-id",children:["Project ID",T?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"kael-project-id",value:z.kaelProjectId,onChange:oe=>C({...z,kaelProjectId:oe.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!T&&d.jsx("p",{className:"text-sm",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"binding-creds",children:["Credentials (JSON)",T?" — leave empty to keep existing":""]}),d.jsx("textarea",{id:"binding-creds",value:z.credentialsJson,onChange:oe=>C({...z,credentialsJson:oe.target.value}),rows:4,className:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),J&&d.jsx("p",{className:"text-sm",style:{color:"var(--state-error)"},children:J}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"binding-status",children:"Status"}),d.jsxs("select",{id:"binding-status",value:z.status,onChange:oe=>C({...z,status:oe.target.value}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"active",children:"active"}),d.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),nt instanceof Error&&d.jsx("div",{className:"text-sm",style:{color:"var(--state-error)"},children:nt.message}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:cn,children:cn?"Saving...":T?"Update":"Create"})})]})]})})]})}function R$(e){return d.jsxs("section",{className:"space-y-3",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsx("h2",{style:{fontSize:13,fontWeight:600},children:"Behavior"}),e.version!=null&&d.jsxs("span",{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:["v",e.version]}),e.dirty&&d.jsx(ju,{style:{color:"var(--state-blocked)"},children:"draft"})]})}),e.loading&&d.jsx("div",{style:{fontSize:12,color:"var(--fg-3)"},children:"Loading configuration…"}),e.error&&d.jsxs("div",{style:{fontSize:12,color:"var(--state-error)"},children:["Failed to load configuration: ",e.error]}),e.loaded&&d.jsx("div",{className:"space-y-3",children:e.children})]})}const sp={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function pS(e){if(e.platform==="feishu"){if(!e.feishuAppId&&!e.feishuAppSecret)return null;if(!e.feishuAppId||!e.feishuAppSecret)throw new Error("Both App ID and App Secret are required");return{app_id:e.feishuAppId,app_secret:e.feishuAppSecret}}if(e.platform==="kael"){if(!e.kaelUserId&&!e.kaelProjectId)return null;if(!e.kaelUserId||!e.kaelProjectId)throw new Error("User ID and Project ID are required");return{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId}}const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function O$({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?d.jsxs("div",{className:"text-sm",style:{background:"var(--bg-sunken)",border:"1px solid var(--border-faint)",borderRadius:4,padding:"10px 12px",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",d.jsx("code",{className:"mono",style:{fontSize:11},children:"first-tree-hub client connect <url>"})," ","on the computer that should run this agent, then reopen this dialog."]}):d.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"1px solid var(--border)",borderRadius:4,margin:0,padding:0,listStyle:"none"},children:a.map(l=>{const o=l.id===t,u=l.status==="online"||l.status==="active";return d.jsx("li",{style:{borderTop:"1px solid var(--border-faint)"},children:d.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Te("w-full text-left flex items-center gap-3"),style:{padding:"8px 12px",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[d.jsx("span",{className:Te("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"block text-sm font-medium truncate",children:l.hostname??l.id}),d.jsxs("span",{className:"block mono truncate",style:{fontSize:10.5,color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),d.jsx("span",{style:{fontSize:11,color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const D$={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},M$={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},L$={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function U$({result:e,onDismiss:t}){const n=M$[e.status],a=L$[e.status],l=e.connection;return d.jsx("div",{style:{background:"var(--bg-raised)",border:"1px solid var(--border)",borderLeft:`3px solid ${n}`,borderRadius:6,padding:"12px 14px"},children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Wt,{tone:a,children:D$[e.status]}),e.responseTime!=null&&d.jsxs("span",{className:"mono",style:{fontSize:11,color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&d.jsx("p",{style:{fontSize:12,color:"var(--fg-3)"},children:e.message}),l&&d.jsxs("div",{style:{fontSize:11,color:"var(--fg-3)",borderTop:"1px solid var(--border-faint)",paddingTop:6,marginTop:2},children:[d.jsx("div",{children:l.runtimeState&&d.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?d.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):d.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&d.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&d.jsx("p",{className:"mono whitespace-pre-wrap",style:{background:"var(--bg-sunken)",border:"1px solid var(--border-faint)",borderRadius:4,padding:8,fontSize:11,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),d.jsx(ve,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function I$(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function B$({agent:e,open:t,onClose:n,onBound:a}){var g;const[l,o]=S.useState(!1),u=qe({queryKey:["connect-token",e.uuid],queryFn:()=>Mw(),enabled:t,staleTime:6e4}),f=qe({queryKey:["agent-poll",e.uuid],queryFn:()=>Mk(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});S.useEffect(()=>{const x=f.data;x!=null&&x.clientId&&a(x)},[f.data,a]);const m=((g=u.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${I$(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return d.jsx(On,{open:t,onOpenChange:x=>!x&&n(),children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Last step — connect your computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[d.jsx("code",{className:"flex-1 text-xs font-mono break-all select-all",children:h||"Generating command…"}),d.jsx(ve,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?d.jsx(Id,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):d.jsx(xg,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d.jsx(hl,{state:"working",size:8}),d.jsx("span",{children:"Waiting for your computer to connect…"})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),d.jsx(Dn,{children:d.jsx(ve,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const P$=/^[a-z0-9_-]+$/,sd=100;function $$(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 F$(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,100)}function q$({open:e,onOpenChange:t,onCreated:n}){const a=Wn(),[l,o]=S.useState(""),[u,f]=S.useState(!1),[m,h]=S.useState(""),[y,g]=S.useState(!1),[x,b]=S.useState("claude-code"),[k,j]=S.useState("form"),[E,_]=S.useState([]),[A,O]=S.useState(null),[I,B]=S.useState(!1),[R,$]=S.useState({});S.useEffect(()=>{e&&(o(""),f(!1),h(""),g(!1),b("claude-code"),j("form"),_([]),O(null),B(!1),$({}))},[e]);const Z=F$(l),ee=yt({mutationFn:async P=>{const V=m.trim()||l.trim()||"Untitled assistant";return gD({name:Z||void 0,type:"personal_assistant",displayName:V,clientId:P.clientId})},onSuccess:P=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),n(P,x)}}),ie={...S.useMemo(()=>{const P=ee.error;if(!P)return{};if(P instanceof Ud){const V=$$(P.issues);return Object.keys(V).length>0?V:P.status===409?{name:"That hub ID is already in use in this organization. Pick a different one."}:{_root:P.message}}return P instanceof Error?{_root:P.message}:{}},[ee.error]),...R};function re(){const P={};return Z?Z.length>sd?P.name=`Hub ID must be at most ${sd} characters (got ${Z.length}).`:P$.test(Z)||(P.name="Hub ID must contain only lowercase letters, digits, hyphens (-), and underscores (_)."):l.trim().length>0&&(P.name="Name must contain at least one letter or digit (e.g. a-z, 0-9)."),m.length>200&&(P.displayName=`Display name must be at most 200 characters (got ${m.length}).`),P}async function pe(P){var ce,xe;P.preventDefault();const V=re();if($(V),!(Object.keys(V).length>0)){if(x!=="claude-code"){ee.mutate({clientId:void 0});return}B(!0);try{const L=(await $d()).filter(C=>C.status==="connected");if(L.length===0){ee.mutate({clientId:void 0});return}if(L.length===1){ee.mutate({clientId:(ce=L[0])==null?void 0:ce.id});return}const z=[...L].sort((C,J)=>J.lastSeenAt.localeCompare(C.lastSeenAt));_(z),O(((xe=z[0])==null?void 0:xe.id)??null),j("pick-computer")}catch{ee.mutate({clientId:void 0})}finally{B(!1)}}}function de(){A&&ee.mutate({clientId:A})}const W=l.trim().length>0&&!ee.isPending&&!I;return k==="pick-computer"?d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Choose a computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-sm text-muted-foreground",children:["Multiple computers are online. Pick where ",d.jsx("span",{className:"font-medium",children:l})," should run:"]}),d.jsx("div",{className:"space-y-2",children:E.map(P=>{const V=A===P.id;return d.jsxs("label",{className:V?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[d.jsx("input",{type:"radio",name:"target-computer",checked:V,onChange:()=>O(P.id),className:"mt-1"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-medium truncate",children:P.hostname??P.id}),d.jsxs("div",{className:"text-xs text-muted-foreground",children:[P.os??"unknown OS"," · last seen ",new Date(P.lastSeenAt).toLocaleString()]})]})]},P.id)})}),ie.clientId&&d.jsx("p",{className:"text-sm text-destructive",children:ie.clientId}),ie._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:ie._root})]}),d.jsxs(Dn,{children:[d.jsx(ve,{variant:"outline",onClick:()=>j("form"),disabled:ee.isPending,children:"Back"}),d.jsx(ve,{onClick:de,disabled:!A||ee.isPending,children:ee.isPending?"Creating…":"Create"})]})]})}):d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"New Agent"})}),d.jsxs("form",{onSubmit:pe,className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"new-agent-name",children:"Name"}),d.jsx(vt,{id:"new-agent-name",value:l,onChange:P=>{const V=P.target.value;o(V),f(!0),y||h(V),R.name&&$(ce=>({...ce,name:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:sd,"aria-invalid":ie.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error"}),d.jsxs("p",{id:"new-agent-name-help",className:"text-xs text-muted-foreground",children:["Hub ID: lowercase letters, digits, hyphens (-), and underscores (_). Up to ",sd," characters. Permanent after creation — you can't rename the agent later."]}),u&&Z&&d.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID on hub: ",d.jsx("span",{className:"font-mono",children:Z})]}),ie.name&&d.jsx("p",{id:"new-agent-name-error",className:"text-xs text-destructive",children:ie.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"new-agent-display-name",children:"Display name"}),d.jsx(vt,{id:"new-agent-display-name",value:m,onChange:P=>{h(P.target.value),g(!0),R.displayName&&$(V=>({...V,displayName:void 0}))},placeholder:"How teammates see this agent",maxLength:200,"aria-invalid":ie.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),d.jsx("p",{id:"new-agent-display-name-help",className:"text-xs text-muted-foreground",children:"Shown in chats and lists. Defaults to the Name above; you can change it anytime later."}),ie.displayName&&d.jsx("p",{id:"new-agent-display-name-error",className:"text-xs text-destructive",children:ie.displayName})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{children:"Where it runs"}),d.jsxs("div",{className:"space-y-2",children:[d.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:[d.jsx("input",{type:"radio",name:"runtime",checked:x==="claude-code",onChange:()=>b("claude-code"),className:"mt-1"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-sm font-medium",children:"Claude Code"}),d.jsx("div",{className:"text-xs text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),d.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[d.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),d.jsxs("div",{children:[d.jsxs("div",{className:"text-sm font-medium",children:["Kael ",d.jsx("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:"— coming soon"})]}),d.jsx("div",{className:"text-xs text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),ie._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:ie._root}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:!W,children:I?"Checking computers…":ee.isPending?"Creating…":"Create"})})]})]})})}function od({active:e,count:t,warn:n,className:a,children:l,style:o,...u}){return d.jsxs("button",{type:"button",className:Te("mono inline-flex items-center gap-1",a),style:{fontSize:10,lineHeight:1.6,padding:"2px 7px",borderRadius:3,border:`1px solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...u,children:[l,t!==void 0&&d.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const H$=Object.values(g5);function gS(e){return[...e].sort((t,n)=>{const a=(t.name??t.displayName??"").toLowerCase(),l=(n.name??n.displayName??"").toLowerCase();return a.localeCompare(l)})}function Z$(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null,activeSessions:(n==null?void 0:n.activeSessions)??null,totalSessions:(n==null?void 0:n.totalSessions)??null}}function op(e,t,n){var l;let a=0;for(const o of e)((l=t.get(o.uuid))==null?void 0:l.runtimeState)===n&&a++;return a}function V$(){const e=qr(),{memberId:t}=ji(),[n,a]=S.useState(),[l,o]=S.useState(""),[u,f]=S.useState(!1),[m,h]=S.useState(null),[y,g]=S.useState("all"),[x,b]=S.useState(""),k=Ea(),j=Pg(),{data:E,isLoading:_,error:A}=qe({queryKey:["agents",n,l],queryFn:()=>Cg({limit:100,cursor:n,type:l||void 0})}),{data:O}=qe({queryKey:["activity"],queryFn:bu,refetchInterval:1e4}),I=S.useMemo(()=>{const V=new Map;for(const ce of(O==null?void 0:O.agents)??[])V.set(ce.agentId,ce);return V},[O==null?void 0:O.agents]),{myAgents:B,teamAgents:R}=S.useMemo(()=>{if(!(E!=null&&E.items))return{myAgents:[],teamAgents:[]};const V=[],ce=[];for(const xe of E.items)t&&xe.managerId===t?V.push(xe):ce.push(xe);return{myAgents:gS(V),teamAgents:gS(ce)}},[E,t]),$=(E==null?void 0:E.items.length)??0,Z=B.length,ee=R.length,q=S.useMemo(()=>((E==null?void 0:E.items)??[]).filter(V=>{var ce;return((ce=I.get(V.uuid))==null?void 0:ce.runtimeState)==="working"}).length,[E==null?void 0:E.items,I]),ie=S.useMemo(()=>((E==null?void 0:E.items)??[]).filter(V=>{var xe;const ce=(xe=I.get(V.uuid))==null?void 0:xe.runtimeState;return ce==="blocked"||ce==="error"}).length,[E==null?void 0:E.items,I]);function re(V){var xe;const ce=(xe=I.get(V.uuid))==null?void 0:xe.runtimeState;return y==="mine"?t!=null&&V.managerId===t:y==="running"?ce==="working":y==="attn"?ce==="blocked"||ce==="error":!0}function pe(V){if(!x.trim())return!0;const ce=x.toLowerCase(),xe=V.delegateMention?k(V.delegateMention):"",T=j(V.managerId);return(V.name??"").toLowerCase().includes(ce)||(V.displayName??"").toLowerCase().includes(ce)||xe.toLowerCase().includes(ce)||T.toLowerCase().includes(ce)}const de=B.filter(V=>re(V)&&pe(V)),W=R.filter(V=>re(V)&&pe(V));function P(V,ce){if(f(!1),V.clientId){e(`/?a=${V.uuid}`);return}if(ce==="claude-code"){h(V);return}e(`/?a=${V.uuid}`)}return d.jsxs("div",{className:"-m-6",children:[d.jsx(Jd,{title:"Agents",subtitle:$>0?d.jsxs(d.Fragment,{children:[$," total · ",Z," mine · ",ee," team"]}):null,right:d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(ve,{variant:"outline",size:"xs",children:"Import"}),d.jsxs(ve,{size:"xs",onClick:()=>f(!0),children:[d.jsx(gl,{className:"h-3 w-3"}),"New agent"]})]})}),d.jsxs("div",{style:{padding:"14px 20px 28px"},children:[d.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"8px 10px",background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6},children:[d.jsxs("div",{className:"relative",style:{width:240},children:[d.jsx(Pd,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),d.jsx("input",{value:x,onChange:V=>b(V.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none",style:{padding:"5px 10px 5px 28px",fontSize:12,background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,color:"var(--fg)"}})]}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(od,{active:y==="all",count:$,onClick:()=>g("all"),children:"all"}),d.jsx(od,{active:y==="mine",count:Z,onClick:()=>g("mine"),children:"mine"}),d.jsx(od,{active:y==="running",count:q,onClick:()=>g("running"),children:"running"}),d.jsx(od,{active:y==="attn",count:ie,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),d.jsx("div",{style:{flex:1}}),d.jsxs("select",{value:l,onChange:V=>{o(V.target.value),a(void 0)},className:"outline-none",style:{padding:"5px 10px",fontSize:11,background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,color:"var(--fg)"},children:[d.jsx("option",{value:"",children:"all types"}),H$.map(V=>d.jsx("option",{value:V,children:V},V))]}),d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-[11px]",children:[d.jsx(yA,{className:"h-3 w-3"})," Columns"]})]}),_?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):A?d.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",A instanceof Error?A.message:"Unknown error"]}):d.jsxs(d.Fragment,{children:[d.jsx(yS,{title:`My agents · ${de.length}`,agents:de,runtimeMap:I,resolveAgentName:k,resolveMemberName:j,navigate:e,emptyLabel:B.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:d.jsx(Q$,{items:[{state:"working",count:op(B,I,"working")},{state:"blocked",count:op(B,I,"blocked")},{state:"error",count:op(B,I,"error")}]}),className:"mb-4"}),R.length>0&&d.jsx(yS,{title:`Team agents · ${W.length}`,agents:W,runtimeMap:I,resolveAgentName:k,resolveMemberName:j,navigate:e,emptyLabel:"No agents match the current filter"})]}),(E==null?void 0:E.nextCursor)&&d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx(ve,{variant:"outline",size:"xs",onClick:()=>a(E.nextCursor??void 0),children:"Next page"})})]}),d.jsx(q$,{open:u,onOpenChange:f,onCreated:P}),m&&d.jsx(B$,{agent:m,open:m!==null,onClose:()=>{const V=m.uuid;h(null),e(`/?a=${V}`)},onBound:V=>{h(null),e(`/?a=${V.uuid}`)}})]})}function yS({title:e,agents:t,runtimeMap:n,resolveAgentName:a,resolveMemberName:l,navigate:o,emptyLabel:u,breakdown:f,className:m}){return d.jsxs(Fr,{className:m,children:[d.jsx(Ms,{right:f,children:e}),t.length===0?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)",fontSize:12},children:u}):d.jsxs(Si,{children:[d.jsx(wi,{children:d.jsxs(Qt,{children:[d.jsx(ze,{children:"Name"}),d.jsx(ze,{children:"Display"}),d.jsx(ze,{children:"Type"}),d.jsx(ze,{children:"Delegate"}),d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"Runtime"}),d.jsx(ze,{children:"Sessions"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(ki,{children:t.map(h=>d.jsx(G$,{agent:h,runtime:Z$(h,n),resolveAgentName:a,resolveMemberName:l,navigate:o},h.uuid))})]})]})}function Q$({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:d.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>d.jsxs("span",{className:"inline-flex items-center",children:[a>0&&d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 6px"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{fontSize:10.5,color:`var(--state-${n.state})`},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function G$({agent:e,runtime:t,resolveAgentName:n,resolveMemberName:a,navigate:l}){const{runtimeState:o,activeSessions:u,totalSessions:f}=t,m=o==="idle"||o==="working"||o==="blocked"||o==="error"||o==="offline";return d.jsxs(Qt,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:500},children:e.name})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:e.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),d.jsx(Ee,{className:"mono",style:{fontSize:11,color:e.delegateMention?"var(--accent-dim)":"var(--fg-4)"},children:e.delegateMention?n(e.delegateMention):"—"}),d.jsx(Ee,{style:{fontSize:11.5,color:"var(--fg-2)"},children:a(e.managerId)}),d.jsx(Ee,{children:o&&m?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(hl,{state:o,size:7}),d.jsx("span",{className:"mono",style:{fontSize:10.5,color:"var(--fg-3)"},children:o})]}):d.jsx("span",{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:"—"})}),d.jsx(Ee,{children:u===null&&f===null?d.jsx("span",{className:"mono",style:{fontSize:11,color:"var(--fg-4)"},children:"—"}):d.jsxs("span",{className:"mono tnum",style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--fg-2)"},children:u??0}),d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",f??0]})]})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:e.status==="active"?"accent":"outline",children:e.status})}),d.jsx(Ee,{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:bi(e.createdAt)})]})}function K$(){const{data:e}=qe({queryKey:["members","user-name-map"],queryFn:Bg,staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function Y$(){const[e,t]=S.useState(null),[n,a]=S.useState(!1),l=yt({mutationFn:Mw,onSuccess:u=>{t(u),a(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return d.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"8px 12px",background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6},children:[d.jsxs("span",{className:"inline-flex items-center gap-2",style:{color:"var(--fg-2)",fontSize:12},children:[d.jsx(HA,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?d.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis",style:{fontSize:11,padding:"5px 10px",background:"var(--bg-sunken)",border:"1px solid var(--border-faint)",borderRadius:4,color:"var(--fg-2)"},title:e.command,children:[e.command," ",d.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):d.jsx("span",{className:"mono",style:{fontSize:11,color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),d.jsxs(ve,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?d.jsx(Id,{className:"h-3 w-3"}):d.jsx(xg,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),d.jsx(ve,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function X$(){const e=Wn(),t=Ea(),n=K$(),{role:a}=ji(),l=a==="admin",[o,u]=S.useState(null),[f,m]=S.useState(null),[h,y]=S.useState(null),[g,x]=S.useState(null),{data:b}=qe({queryKey:["clients"],queryFn:$d,refetchInterval:1e4}),{data:k}=qe({queryKey:["activity"],queryFn:bu,refetchInterval:1e4}),j=yt({mutationFn:qT,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),E=yt({mutationFn:FT,onSuccess:()=>{y(null),x(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:B=>{B instanceof Ud?x(B.message):x(B instanceof Error?B.message:String(B))}}),_=S.useMemo(()=>{const B=new Map;for(const R of(k==null?void 0:k.agents)??[]){if(!R.clientId)continue;const $=B.get(R.clientId)??[];$.push(R),B.set(R.clientId,$)}return B},[k==null?void 0:k.agents]),A=B=>_.get(B)??[],O=(b??[]).filter(B=>B.status==="connected").length,I=(b??[]).reduce((B,R)=>B+R.agentCount,0);return d.jsxs("div",{className:"-m-6",children:[d.jsx(Jd,{title:"Computers",subtitle:b&&b.length>0?d.jsxs(d.Fragment,{children:[b.length," total · ",O," connected · ",I," agents bound"]}):null}),d.jsxs("div",{style:{padding:"14px 20px 28px"},children:[d.jsx(Y$,{}),h&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6,padding:24,boxShadow:"var(--shadow-md)"},children:[d.jsx("h3",{className:"text-base font-semibold mb-2",children:"Retire Computer"}),d.jsxs("p",{className:"text-sm mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",d.jsx("span",{style:{color:"var(--fg)",fontWeight:500},children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),A(h.id).length>0&&d.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"1px solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[d.jsx("div",{className:"text-xs font-medium mb-1",children:"Agents currently bound to this computer (delete them first):"}),d.jsx("ul",{className:"text-sm space-y-0.5",children:A(h.id).map(B=>d.jsx("li",{className:"font-medium",children:t(B.agentId)},B.agentId))})]}),g&&d.jsx("div",{className:"mb-3 p-2 rounded text-sm",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"1px solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:g}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{y(null),x(null)},children:"Cancel"}),d.jsx(ve,{variant:"destructive",size:"sm",onClick:()=>E.mutate(h.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),f&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"1px solid var(--border)",borderRadius:6,padding:24,boxShadow:"var(--shadow-md)"},children:[d.jsx("h3",{className:"text-base font-semibold mb-2",children:"Disconnect Computer"}),d.jsxs("p",{className:"text-sm mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",d.jsx("span",{style:{color:"var(--fg)",fontWeight:500},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),d.jsx("ul",{className:"mb-4 space-y-1",children:A(f.id).length===0?d.jsx("li",{className:"text-sm",style:{color:"var(--fg-3)"},children:"No bound agents"}):A(f.id).map(B=>d.jsxs("li",{className:"text-sm flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:t(B.agentId)}),d.jsx(ml,{state:B.runtimeState})]},B.agentId))}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),d.jsx(ve,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!b||b.length===0?d.jsx(Fr,{children:d.jsx("div",{className:"text-center py-10",style:{color:"var(--fg-3)",fontSize:12},children:"No computers. Use the button above to generate a connect command."})}):d.jsxs(Fr,{children:[d.jsxs(Ms,{right:d.jsx("span",{className:"mono",style:{color:"var(--fg-3)",textTransform:"none",letterSpacing:0},children:"click a row to expand"}),children:["Registered · ",b.length]}),d.jsxs(Si,{children:[d.jsx(wi,{children:d.jsxs(Qt,{children:[d.jsx(ze,{style:{width:16}}),d.jsx(ze,{children:"Hostname"}),l&&d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"OS"}),d.jsx(ze,{children:"SDK"}),d.jsx(ze,{children:"Agents"}),d.jsx(ze,{children:"Connected"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{})]})}),d.jsx(ki,{children:b.map(B=>{const R=o===B.id,$=A(B.id);return d.jsx(J$,{client:B,boundAgents:$,isExpanded:R,agentName:t,showOwner:l,ownerName:n,onToggle:()=>u(R?null:B.id),onDisconnect:()=>m(B),onRetire:()=>{x(null),y(B)}},B.id)})})]})]})]})]})}function J$({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return d.jsxs(d.Fragment,{children:[d.jsxs(Qt,{interactive:!0,selected:n,onClick:u,children:[d.jsx(Ee,{style:{width:16},children:d.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?d.jsx(cA,{className:"h-3.5 w-3.5"}):d.jsx(fA,{className:"h-3.5 w-3.5"})})}),d.jsx(Ee,{style:{fontWeight:500},children:e.hostname??"—"}),l&&d.jsx(Ee,{style:{color:"var(--fg-2)"},children:o(e.userId)}),d.jsx(Ee,{style:{color:"var(--fg-3)"},children:e.os??"—"}),d.jsx(Ee,{className:"mono",style:{fontSize:11,color:"var(--fg-3)"},children:e.sdkVersion??"—"}),d.jsx(Ee,{children:d.jsx("span",{className:"mono tnum",style:{fontSize:11.5},children:e.agentCount})}),d.jsx(Ee,{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:e.connectedAt?bi(e.connectedAt):"—"}),d.jsx(Ee,{children:d.jsx(ml,{state:y})}),d.jsx(Ee,{style:{width:1,whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-1 justify-end",children:[d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-[11px]",onClick:g=>{g.stopPropagation(),f()},children:[d.jsx(XA,{className:"h-3 w-3"})," Disconnect"]}),d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-[11px]",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[d.jsx(au,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&d.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[d.jsx(Ee,{}),d.jsxs(Ee,{colSpan:h-1,style:{padding:"10px 12px 14px"},children:[d.jsxs(ju,{style:{display:"block",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?d.jsx("div",{className:"text-sm",style:{color:"var(--fg-3)",fontSize:12},children:"No agents bound to this computer"}):d.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>d.jsxs("div",{className:"flex items-center gap-2.5",style:{fontSize:12},children:[d.jsx("span",{className:"mono",style:{fontWeight:500,minWidth:180},children:a(g.agentId)}),d.jsx(ml,{state:g.runtimeState}),g.activeSessions!==null&&d.jsxs("span",{className:"mono tnum",style:{fontSize:10.5,color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}const YE=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("rounded-xl border bg-card text-card-foreground shadow-sm",e),...t}));YE.displayName="Card";const XE=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));XE.displayName="CardHeader";const JE=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("font-semibold leading-none tracking-tight",e),...t}));JE.displayName="CardTitle";const WE=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));WE.displayName="CardDescription";const eC=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));eC.displayName="CardContent";const W$=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));W$.displayName="CardFooter";function eF(){const{isAuthenticated:e,login:t}=ji(),[n,a]=S.useState(""),[l,o]=S.useState(""),[u,f]=S.useState(null),[m,h]=S.useState(!1);if(e)return d.jsx(hg,{to:"/",replace:!0});const y=async g=>{g.preventDefault(),f(null),h(!0);try{await t(n,l)}catch(x){f(x instanceof Error?x.message:"Login failed")}finally{h(!1)}};return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:d.jsxs(YE,{className:"w-full max-w-sm",children:[d.jsxs(XE,{className:"text-center",children:[d.jsx(JE,{className:"text-2xl",children:"First Tree"}),d.jsx(WE,{children:"Sign in to your workspace"})]}),d.jsx(eC,{children:d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u&&d.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:u}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"username",children:"Username"}),d.jsx(vt,{id:"username",value:n,onChange:g=>a(g.target.value),required:!0,autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"password",children:"Password"}),d.jsx(vt,{id:"password",type:"password",value:l,onChange:g=>o(g.target.value),required:!0})]}),d.jsx(ve,{type:"submit",className:"w-full",disabled:m,children:m?"Signing in...":"Sign in"})]})})]})})}function tF(){const e=qr(),t=Ea(),{data:n,isLoading:a}=qe({queryKey:["adapters"],queryFn:qj}),{data:l,isLoading:o}=qe({queryKey:["adapter-mappings"],queryFn:$j}),{data:u}=qe({queryKey:["adapter-statuses"],queryFn:Fj,refetchInterval:15e3}),f=a||o,m=S.useMemo(()=>{const g=new Map;for(const x of u??[])g.set(x.configId,x);return g},[u]),{onlineBots:h,offlineBots:y}=S.useMemo(()=>{var b;let g=0,x=0;for(const k of n??[])(b=m.get(k.id))!=null&&b.connected?g++:x++;return{onlineBots:g,offlineBots:x}},[n,m]);return d.jsxs(d.Fragment,{children:[d.jsx("p",{style:{fontSize:11.5,color:"var(--fg-3)",padding:"0 2px 12px"},children:"Overview of platform bindings for agents you can manage. Configure each binding from the Agent detail page."}),d.jsxs(Fr,{className:"mb-3.5",children:[d.jsxs(Ms,{right:d.jsxs("span",{className:"inline-flex items-center",children:[d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),h," online"]}),d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 6px"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx("span",{"aria-hidden":!0,children:"○"}),y," offline"]})]}),children:["Bot bindings · ",(n==null?void 0:n.length)??0]}),f?d.jsx("div",{className:"text-center py-6",style:{color:"var(--fg-3)",fontSize:12},children:"Loading…"}):n!=null&&n.length?d.jsxs(Si,{children:[d.jsx(wi,{children:d.jsxs(Qt,{children:[d.jsx(ze,{children:"Agent"}),d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Connection"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{})]})}),d.jsx(ki,{children:n.map(g=>{var b;const x=((b=m.get(g.id))==null?void 0:b.connected)??!1;return d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:500},children:t(g.agentId)})}),d.jsx(Ee,{children:d.jsx(Wt,{children:g.platform})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:g.status==="active"?"accent":"outline",children:g.status})}),d.jsx(Ee,{children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",style:{fontSize:11},children:[d.jsx(hl,{state:x?"idle":"offline",size:7}),d.jsx("span",{style:{color:"var(--fg-3)"},children:x?"Online":"Offline"})]})}),d.jsx(Ee,{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:bi(g.createdAt)}),d.jsx(Ee,{style:{textAlign:"right",whiteSpace:"nowrap"},children:d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-[11px]",onClick:k=>{k.stopPropagation(),e(`/agents/${g.agentId}`)},children:[d.jsx(_p,{className:"h-3 w-3"}),"Manage"]})})]},g.id)})})]}):d.jsx("div",{className:"text-center py-6",style:{color:"var(--fg-3)",fontSize:12},children:"No bot bindings"})]}),d.jsxs(Fr,{children:[d.jsxs(Ms,{children:["User bindings · ",(l==null?void 0:l.length)??0]}),f?d.jsx("div",{className:"text-center py-6",style:{color:"var(--fg-3)",fontSize:12},children:"Loading…"}):l!=null&&l.length?d.jsxs(Si,{children:[d.jsx(wi,{children:d.jsxs(Qt,{children:[d.jsx(ze,{children:"Agent"}),d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"External user ID"}),d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Bound via"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(ki,{children:l.map(g=>d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:500,color:"var(--accent-dim)"},children:t(g.agentId)})}),d.jsx(Ee,{children:d.jsx(Wt,{children:g.platform})}),d.jsx(Ee,{children:d.jsx("span",{className:"mono",style:{fontSize:11,color:"var(--fg-2)"},children:g.externalUserId})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:g.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:"outline",children:g.boundVia??"—"})}),d.jsx(Ee,{className:"mono",style:{fontSize:10.5,color:"var(--fg-4)"},children:bi(g.createdAt)})]},g.id))})]}):d.jsx("div",{className:"text-center py-6",style:{color:"var(--fg-3)",fontSize:12},children:"No user bindings"})]})]})}function nF(){return d.jsxs("div",{className:"-m-6",children:[d.jsx(Jd,{title:"Settings",subtitle:"Per-member controls"}),d.jsx(Dj,{children:d.jsx(Mj,{active:!0,children:"Bindings"})}),d.jsx("div",{style:{padding:"16px 20px 28px"},children:d.jsx(tF,{})})]})}function rF(e){return De.get(`/admin/chats/${encodeURIComponent(e)}`)}function iF(e,t){return De.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function vS(e,t){return De.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function aF(e,t){return De.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function lF(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 sF(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function oF(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 De.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}function tC(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function uF(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=xS(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=xS(l.payload);return o?a.get(o)===l.seq:!0})}function xS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function af(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 nC(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function cF(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function bS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function dF({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?d.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?d.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):d.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function fF({agentId:e,chatId:t,session:n}){const a=Wn(),[,l]=gg(),[o,u]=S.useState(!1),[f,m]=S.useState(null),h=Lw(e,t),y=Tp(e),g=E=>{a.setQueryData(h,_=>_&&{..._,state:E}),a.setQueryData(y,_=>_&&_.map(A=>A.chatId===t?{...A,state:E}:A))},x=yt({mutationFn:()=>GT(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const E=a.getQueryData(h),_=a.getQueryData(y);return g("suspended"),{previousSession:E,previousList:_}},onError:(E,_,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(y,A.previousList)},onSuccess:E=>{g(E.state)}}),b=yt({mutationFn:()=>KT(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const E=a.getQueryData(h),_=a.getQueryData(y);return a.setQueryData(y,A=>A&&A.filter(O=>O.chatId!==t)),{previousSession:E,previousList:_}},onError:(E,_,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(y,A.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,_,A)=>{if(E.state!=="evicted"){A!=null&&A.previousList&&a.setQueryData(y,A.previousList),g(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),u(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"1px solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[k&&d.jsxs("button",{type:"button",onClick:()=>x.mutate(),disabled:x.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"var(--fg-2)",borderRadius:4},onMouseEnter:E=>E.currentTarget.style.background="var(--bg-hover)",onMouseLeave:E=>E.currentTarget.style.background="transparent",children:[d.jsx(TA,{className:"h-3 w-3"})," Suspend",d.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&d.jsxs("button",{type:"button",onClick:()=>{m(null),u(!0)},disabled:b.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:600,color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:4},onMouseEnter:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[d.jsx(PA,{className:"h-3 w-3"})," Terminate"]})]}),d.jsx(hF,{open:o,onOpenChange:E=>{b.isPending||u(E),E||m(null)},session:n,chatId:t,error:f,pending:b.isPending,onConfirm:()=>b.mutate()})]})}function hF(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:u,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return d.jsx(On,{open:t,onOpenChange:n,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Terminate session?"})}),d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Ending this session is permanent. It is removed from the workspace and cannot be resumed. Chat history is preserved; a new message will start a fresh session."}),d.jsxs("div",{className:"mono",style:{fontSize:11,padding:"8px 10px",borderRadius:4,background:"var(--bg-sunken)",border:"1px solid var(--border)",color:"var(--fg-2)",display:"grid",gap:4},children:[d.jsxs("span",{children:["chat: ",d.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&d.jsxs("span",{children:["last activity: ",nC(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&d.jsxs("span",{children:["messages: ",a.messageCount]})]}),u&&d.jsx("p",{className:"mono",style:{fontSize:11,color:"var(--state-error)"},children:u}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),d.jsx(ve,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function mF({event:e}){const t=HT(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 d.jsxs("div",{className:"mono flex items-center",style:{gap:8,fontSize:11,padding:"2px 8px",color:"var(--fg-3)"},children:[a?d.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):d.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),d.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?bS(t.args):void 0,children:[d.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",d.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?d.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",bS(t.args),")"]}):null,t.durationMs!==void 0&&!a?d.jsxs("span",{style:{color:"var(--fg-4)",marginLeft:6,fontSize:10,whiteSpace:"nowrap",flexShrink:0},children:["· ",cF(t.durationMs)]}):null]})]})}function pF({event:e,agentNameFn:t,agentId:n}){const a=VT(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"20px 1fr",columnGap:8,padding:"4px 0",opacity:.85},children:[d.jsx(rC,{name:l,isSelf:!1}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono",style:{fontSize:11,fontWeight:600,color:"var(--accent)"},children:l}),d.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:af(e.createdAt)}),d.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},children:"· streaming"})]}),d.jsx("div",{style:{fontSize:12.5,color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2,lineHeight:1.55},children:a.text})]})]})}function gF({event:e}){return d.jsxs("div",{className:"mono flex items-center",style:{gap:8,fontSize:11,padding:"2px 8px",color:"var(--fg-3)"},children:[d.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),d.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),d.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:af(e.createdAt)})]})}function yF({event:e}){const t=ZT(e.payload),n=af(e.createdAt);return d.jsxs("div",{style:{padding:"6px 10px",borderLeft:"2px solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 4px 4px 0"},children:[d.jsxs("div",{className:"mono uppercase",style:{fontSize:10,letterSpacing:.08,color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),d.jsx("div",{style:{marginTop:2,fontSize:11.5,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function rC({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return d.jsx("div",{className:"mono",style:{width:20,height:20,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",fontSize:9,fontWeight:700,flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"1px solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:d.jsx(wu,{width:9,height:10,style:{color:"var(--accent)"}})})}function vF({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"20px 1fr",columnGap:8,padding:"6px 0"},children:[d.jsx(rC,{name:a,isSelf:l}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:600,color:l?"var(--fg)":"var(--accent)"},children:a}),d.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:af(e.createdAt)}),d.jsx("span",{style:{marginLeft:"auto"},children:d.jsx(dF,{msg:e,myAgentId:t})})]}),d.jsx("div",{style:{fontSize:12.5,color:"var(--fg)",marginTop:2,lineHeight:1.55},children:e.format==="file"&&xF(e.content)?d.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:6,marginTop:4}}):e.format==="text"?d.jsx(KE,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):d.jsx("pre",{className:"mono",style:{fontSize:11,background:"var(--bg-sunken)",padding:8,borderRadius:4,overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function xF(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 bF({agentId:e,chatId:t}){var L;const n=Wn(),a=Ea(),{agentId:l}=ji(),[o,u]=S.useState(""),[f,m]=S.useState([]),[h,y]=S.useState(!1),[g,x]=S.useState(null),b=S.useRef(null),k=S.useRef(null),{data:j}=qe({queryKey:["chat-messages",t],queryFn:()=>oF(t,{limit:50}),refetchInterval:5e3}),{data:E}=qe({queryKey:["session-events",e,t],queryFn:()=>QT(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:_}=qe({queryKey:Lw(e,t),queryFn:()=>$s(e).then(z=>z.find(C=>C.chatId===t)??null),refetchInterval:5e3}),{data:A}=qe({queryKey:["chat-detail",t],queryFn:()=>rF(t),enabled:!!t}),O=yt({mutationFn:z=>vS(t,z),onSuccess:()=>{u(""),n.invalidateQueries({queryKey:["chat-messages",t]})}}),I=S.useCallback(z=>{const J=z.filter(ge=>ge.type.startsWith("image/"));if(J.length===0)return;const Y=J.find(ge=>ge.size>5242880);if(Y){x(`Image too large (${(Y.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const ue=J.map(ge=>({id:crypto.randomUUID(),file:ge,previewUrl:URL.createObjectURL(ge)}));m(ge=>[...ge,...ue]),x(null)},[]),B=S.useCallback(z=>{m(C=>{const J=C.find(Y=>Y.id===z);return J&&URL.revokeObjectURL(J.previewUrl),C.filter(Y=>Y.id!==z)})},[]),R=async()=>{const z=o.trim(),C=f;if(!(!z&&C.length===0)&&!h){if(C.length>0){y(!0),x(null);try{for(const J of C){const Y=await lF(J.file);await aF(t,{data:Y,mimeType:J.file.type,filename:J.file.name,size:J.file.size}),URL.revokeObjectURL(J.previewUrl)}m([]),z&&await vS(t,z),u(""),n.invalidateQueries({queryKey:["chat-messages",t]})}catch(J){x(J instanceof Error?J.message:"Failed to send image")}finally{y(!1)}return}O.mutate(z)}},[$,Z]=S.useState(!1),[ee,q]=S.useState(""),ie=S.useRef(null);S.useEffect(()=>{var z;$&&((z=ie.current)==null||z.focus())},[$]);const re=yt({mutationFn:z=>iF(t,z),onSuccess:()=>{Z(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),pe=()=>{const z=ee.trim();re.mutate(z.length>0?z:null)},de=S.useMemo(()=>{const z=(j==null?void 0:j.items)??[],C=uF((E==null?void 0:E.items)??[]),J=[...z.map(Y=>({kind:"message",at:Y.createdAt,key:`m-${Y.id}`,data:Y})),...C.map(Y=>({kind:"event",at:Y.createdAt,key:`e-${Y.id}`,data:Y}))];return J.sort((Y,ue)=>Y.at.localeCompare(ue.at)),J},[j,E]),W=de.length;S.useEffect(()=>{var z;W>0&&((z=k.current)==null||z.scrollIntoView({behavior:"smooth"}))},[W]);const P=A!=null&&A.participants?A.participants.map(z=>{const C=a(z.agentId);return`@${C.length>20?`${C.slice(0,17)}…`:C}`}).join(" "):`@${a(e)}`,V=a(e),ce=(_==null?void 0:_.runtimeState)??"idle",xe=tC((_==null?void 0:_.runtimeState)??null,e?"connected":null),T=(_==null?void 0:_.messageCount)??((L=j==null?void 0:j.items)==null?void 0:L.length)??0;return d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"10px 14px",borderBottom:"1px solid var(--border)"},children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center",style:{gap:8},children:[d.jsx(hl,{state:xe,size:8}),$?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:ie,value:ee,onChange:z=>q(z.target.value),onKeyDown:z=>{z.key==="Enter"?(z.preventDefault(),pe()):z.key==="Escape"&&(z.preventDefault(),Z(!1))},disabled:re.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none",style:{flex:1,minWidth:0,fontSize:13,fontWeight:600,color:"var(--fg)",background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,padding:"2px 6px"}}),d.jsx("button",{type:"button",onClick:pe,disabled:re.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:d.jsx(Id,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:()=>Z(!1),disabled:re.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:d.jsx(zp,{className:"h-3.5 w-3.5"})})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"truncate",style:{fontSize:13,fontWeight:600,color:"var(--fg)"},children:(A==null?void 0:A.topic)||(_==null?void 0:_.summary)||`Chat · ${t.slice(0,8)}`}),d.jsx("button",{type:"button",onClick:()=>{q((A==null?void 0:A.topic)??""),Z(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:z=>z.currentTarget.style.color="var(--fg-2)",onMouseLeave:z=>z.currentTarget.style.color="var(--fg-4)",children:d.jsx(Bd,{className:"h-3 w-3"})})]}),d.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)",padding:"1px 5px",border:"1px solid var(--border)",borderRadius:2},children:t})]}),d.jsxs("div",{className:"flex items-center",style:{fontSize:10.5,color:"var(--fg-3)",marginTop:4,gap:10},children:[d.jsx("span",{className:"mono",children:P}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["started ",nC((_==null?void 0:_.startedAt)??null)]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:[T," msgs"]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["runtime"," ",d.jsx("span",{className:"mono",style:{color:xe==="error"?"var(--state-error)":"var(--fg-2)"},children:ce})]})]})]}),d.jsx(fF,{agentId:e,chatId:t,session:_??null})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",style:{padding:"10px 14px"},children:[W===0&&d.jsxs("div",{className:"flex flex-col items-center",style:{color:"var(--fg-3)",fontSize:13,padding:"32px 0",gap:6},children:[d.jsx(vw,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),d.jsx("div",{className:"flex flex-col",style:{gap:4},children:de.map(z=>{if(z.kind==="event"){const C=z.data;switch(C.kind){case"tool_call":return d.jsx(mF,{event:C},z.key);case"assistant_text":return d.jsx(pF,{event:C,agentId:e,agentNameFn:a},z.key);case"thinking":return d.jsx(gF,{event:C},z.key);case"error":return d.jsx(yF,{event:C},z.key);default:return null}}return d.jsx(vF,{msg:z.data,myAgentId:l,agentNameFn:a},z.key)})}),d.jsx("div",{ref:k})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"10px 14px",borderTop:"1px solid var(--border)"},children:[d.jsxs("div",{style:{position:"relative",border:"1px solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:z=>z.preventDefault(),onDrop:z=>{z.preventDefault(),I(Array.from(z.dataTransfer.files))},children:[f.length>0&&d.jsx("div",{className:"flex items-center",style:{gap:6,padding:"6px 10px 0",overflowX:"auto"},children:f.map(z=>d.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"1px solid var(--border)",overflow:"hidden"},children:[d.jsx("img",{src:z.previewUrl,alt:z.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),d.jsx("button",{type:"button",onClick:()=>B(z.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"rgba(0,0,0,0.6)",border:"none",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:d.jsx(zp,{className:"h-2 w-2"})})]},z.id))}),d.jsx("textarea",{value:o,onChange:z=>u(z.target.value),onPaste:z=>{const C=Array.from(z.clipboardData.files);C.length>0&&(z.preventDefault(),I(C))},placeholder:`Message @${V} · / for commands · @ to mention`,rows:2,onKeyDown:z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),R())},disabled:O.isPending||h,className:"w-full outline-none",style:{padding:"9px 12px 30px",fontSize:12.5,background:"transparent",border:"none",resize:"none",fontFamily:"var(--font-sans)",color:"var(--fg)"}}),d.jsxs("div",{className:"flex items-center justify-between",style:{position:"absolute",bottom:6,left:10,right:10,fontSize:10,color:"var(--fg-4)"},children:[d.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[d.jsx("button",{type:"button",onClick:()=>{var z;return(z=b.current)==null?void 0:z.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:d.jsx(zA,{className:"h-3.5 w-3.5"})}),d.jsx("input",{ref:b,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:z=>{z.target.files&&(I(Array.from(z.target.files)),z.target.value="")}}),d.jsx("span",{children:"/suspend"}),d.jsx("span",{children:"/resume"}),d.jsx("span",{children:"/branch"}),d.jsx("span",{children:"/promote"})]}),d.jsxs("span",{className:"flex items-center",style:{gap:8},children:[h&&d.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--accent)"},children:"uploading…"}),d.jsxs("span",{children:[d.jsx("span",{className:"kbd",children:"⏎"})," send ",d.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),d.jsxs("button",{type:"button",onClick:R,disabled:O.isPending||h||!o.trim()&&f.length===0,className:Te("inline-flex items-center transition-colors",(O.isPending||h||!o.trim()&&f.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:600,color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"1px solid var(--accent)",borderRadius:5},children:[d.jsx(IA,{className:"h-3 w-3"})," Send"]})]})]})]}),(O.isError||g)&&d.jsx("p",{className:"mono",style:{fontSize:11,color:"var(--state-error)",padding:"6px 2px 0"},children:g??(O.error instanceof Error?O.error.message:"Failed to send")})]})]})}function SF(){return d.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:d.jsxs("div",{className:"text-center max-w-sm",children:[d.jsx(wu,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),d.jsx("div",{className:"text-sm font-medium mb-1",children:"Select a chat"}),d.jsx("div",{className:"text-xs text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function wF({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(bF,{agentId:e,chatId:t}):d.jsx(SF,{})}function iC(){const{data:e}=qe({queryKey:["clients"],queryFn:$d,staleTime:1e4,refetchInterval:1e4});return S.useMemo(()=>{const t=e??[],n=new Map;for(const a of t)n.set(a.id,a);return{resolve:a=>a?n.get(a)??null:null,clients:t,connectedClients:t.filter(a=>a.status==="connected")}},[e])}function eg({children:e}){return d.jsx("div",{className:"mono uppercase",style:{fontSize:11,letterSpacing:.1,color:"var(--fg-4)",marginBottom:8},children:e})}function aC({children:e}){return d.jsx("div",{className:"grid",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4,fontSize:13.5},children:e})}function Pr({label:e,children:t}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{color:"var(--fg-3)"},children:e}),d.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function SS(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function wS(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m`;const a=Math.floor(n/60);return a<24?`${a}h ${n%60}m`:`${Math.floor(a/24)}d ${a%24}h`}function up({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"6px 8px",background:"var(--bg-sunken)",borderRadius:4},children:[d.jsx("div",{className:"mono uppercase",style:{fontSize:11,color:"var(--fg-4)",letterSpacing:.08},children:e}),d.jsx("div",{className:"mono",style:{fontSize:15,fontWeight:600,color:n??"var(--fg)"},children:t})]})}function kF({notifications:e,agentId:t}){const[,n]=gg(),a=Wn(),l=yt({mutationFn:o=>Lk(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return d.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>d.jsx(Uk,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function lC({agentId:e}){var h;const t=Ea(),{resolve:n}=iC(),{data:a}=qe({queryKey:["activity"],queryFn:bu,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(y=>y.agentId===e),o=n(l==null?void 0:l.clientId),{data:u}=qe({queryKey:["notifications","agent",e],queryFn:()=>Up({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"1px solid var(--border-strong)"},children:d.jsx(wu,{width:14,height:16,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{style:{fontSize:15,fontWeight:600,color:"var(--fg)"},children:f}),d.jsx("div",{className:"mono truncate",style:{fontSize:12,color:"var(--fg-4)"},children:e})]}),d.jsx(ml,{state:m})]}),d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[d.jsx(up,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),d.jsx(up,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),d.jsx(up,{label:"uptime",value:wS((o==null?void 0:o.connectedAt)??null)})]})]}),d.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx(eg,{children:"Computer · runtime"}),d.jsxs(aC,{children:[d.jsx(Pr,{label:"host",children:d.jsx("span",{className:"mono",style:{fontSize:13},children:(o==null?void 0:o.hostname)??"—"})}),d.jsx(Pr,{label:"os",children:d.jsx("span",{className:"mono",style:{fontSize:13},children:(o==null?void 0:o.os)??"—"})}),d.jsx(Pr,{label:"runtime",children:d.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),d.jsx(Pr,{label:"sdk",children:d.jsx("span",{className:"mono",style:{fontSize:13},children:(o==null?void 0:o.sdkVersion)??"—"})}),d.jsx(Pr,{label:"connected",children:d.jsx("span",{className:"mono",style:{fontSize:13},children:wS((o==null?void 0:o.connectedAt)??null)})})]})]}),d.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},className:"flex flex-col",children:[d.jsx("a",{href:`/agents/${e}`,style:{fontSize:13,color:"var(--accent)"},className:"hover:underline",children:"Manage agent →"}),d.jsx("a",{href:"/clients",style:{fontSize:13,color:"var(--accent)",marginTop:4},className:"hover:underline",children:"Computers →"})]}),d.jsxs("div",{style:{padding:"12px 14px"},children:[d.jsx(eg,{children:"Notifications"}),!(u!=null&&u.items)||u.items.length===0?d.jsx("div",{className:"text-center",style:{fontSize:13,color:"var(--fg-3)",padding:"12px 0"},children:"No notifications for this agent"}):d.jsx(kF,{notifications:u.items,agentId:e})]})]})}function jF({agentId:e,chatId:t}){const{data:n}=qe({queryKey:["session",e,t],queryFn:()=>$s(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return d.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[d.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx(eg,{children:"Session"}),d.jsxs(aC,{children:[d.jsx(Pr,{label:"state",children:d.jsx(ml,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),d.jsx(Pr,{label:"chat",children:d.jsx("span",{className:"mono",style:{fontSize:12.5},children:t.slice(0,12)})}),d.jsx(Pr,{label:"started",children:SS((n==null?void 0:n.startedAt)??null)}),d.jsx(Pr,{label:"last",children:SS((n==null?void 0:n.lastActivityAt)??null)}),d.jsx(Pr,{label:"messages",children:d.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),d.jsx(lC,{agentId:e})]})}function EF({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(jF,{agentId:e,chatId:t}):e?d.jsx(lC,{agentId:e}):null}const CF=32;function NF({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return d.jsx("div",{className:Te("flex items-end gap-[2px]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:CF}).map((l,o)=>{const u=e[o]??{workingCount:0,errorMask:!1},f=u.workingCount===0?.08:u.workingCount/a,m=.25+f*.7,h=u.errorMask?"var(--state-error)":"var(--accent)";return d.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const _F={error:0,blocked:1,working:2,idle:3};function zF(e,t){return t?e?_F[e]??4:4:5}function AF(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function TF({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=Ea(),{resolve:o}=iC(),u=Wn(),f=nL(),[m,h]=S.useState(""),[y,g]=S.useState("all"),{data:x}=qe({queryKey:["activity"],queryFn:bu,refetchInterval:1e4}),{data:b}=qe({queryKey:e?Tp(e):["agent-sessions",null],queryFn:()=>e?$s(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),k=yt({mutationFn:R=>sF(R),onSuccess:(R,$)=>{u.invalidateQueries({queryKey:Tp($)}),a($,R.id)}}),{humans:j,agents:E,totalAll:_}=S.useMemo(()=>{const R=(x==null?void 0:x.agents)??[],$=m.trim().toLowerCase(),Z=R.filter(re=>{var W;if(!AF(re,y))return!1;if(!$)return!0;const pe=l(re.agentId).toLowerCase(),de=re.clientId?(((W=o(re.clientId))==null?void 0:W.hostname)??"").toLowerCase():"";return pe.includes($)||de.includes($)||re.agentId.toLowerCase().includes($)}),ee=re=>zF(re.runtimeState,re.clientId),q=[],ie=[];for(const re of Z)(re.type==="human"?q:ie).push(re);return q.sort((re,pe)=>ee(re)-ee(pe)),ie.sort((re,pe)=>ee(re)-ee(pe)),{humans:q,agents:ie,totalAll:R.length}},[x,m,y,l,o]),A=S.useMemo(()=>{const R=(x==null?void 0:x.agents)??[];return{working:R.filter($=>$.runtimeState==="working").length,blocked:R.filter($=>$.runtimeState==="blocked").length,error:R.filter($=>$.runtimeState==="error").length}},[x]),O=[{value:"all",label:"all",count:_},{value:"active",label:"active",count:A.working},{value:"attn",label:"attn",count:A.blocked+A.error,warn:A.blocked+A.error>0}],I=R=>{var re;const $=e===R.agentId,Z=tC(R.runtimeState,R.clientId),ee=R.clientId?((re=o(R.clientId))==null?void 0:re.hostname)??R.clientId.slice(0,8):null,q=R.activeSessions??0,ie=R.totalSessions??0;return d.jsxs("div",{style:{borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("button",{type:"button",onClick:()=>n($?null:R.agentId),className:Te("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"14px 1fr auto",columnGap:8,padding:"7px 10px 7px 12px",background:$?"var(--bg-active)":"transparent",borderLeft:`2px solid ${$?"var(--accent)":"transparent"}`},children:[d.jsx(hl,{state:Z,size:8}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"mono truncate",style:{fontSize:14,fontWeight:500,color:"var(--fg)",letterSpacing:-.1},children:l(R.agentId)}),R.type==="human"&&d.jsx("span",{className:"mono",style:{fontSize:11,padding:"1px 5px",borderRadius:2,textTransform:"uppercase",letterSpacing:.08,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),d.jsx("div",{className:"truncate",style:{fontSize:12.5,color:"var(--fg-3)"},children:Z==="offline"?"disconnected":ee||"—"})]}),d.jsx("div",{className:"flex flex-col items-end gap-0.5",children:ie>0&&d.jsxs("span",{className:"mono tnum",style:{fontSize:11,color:"var(--fg-3)"},children:[q,d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",ie]})]})})]}),$&&d.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!b||b.length===0)&&d.jsx("div",{style:{padding:"4px 10px 4px 28px",fontSize:12.5,color:"var(--fg-4)"},children:"No sessions yet"}),b==null?void 0:b.filter(pe=>pe.state!=="evicted").map(pe=>{const de=pe.state==="active"?"working":"idle";return d.jsxs("button",{type:"button",onClick:()=>a(R.agentId,pe.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"14px 1fr",columnGap:6,padding:"4px 10px 4px 28px",background:t===pe.chatId?"var(--bg-hover)":"transparent",color:pe.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:W=>{t!==pe.chatId&&(W.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:W=>{t!==pe.chatId&&(W.currentTarget.style.background="transparent")},children:[d.jsx(hl,{state:de,size:6}),d.jsx("span",{className:"truncate",style:{fontSize:13,color:pe.topic||pe.summary?"var(--fg-2)":"var(--fg-4)"},children:pe.topic||pe.summary||`Chat · ${pe.chatId.slice(0,8)}`})]},pe.chatId)}),d.jsxs("button",{type:"button",onClick:()=>k.mutate(R.agentId),disabled:k.isPending,className:"w-full flex items-center text-left transition-colors",style:{gap:6,padding:"4px 10px 4px 28px",fontSize:12.5,color:"var(--fg-3)"},onMouseEnter:pe=>{pe.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:pe=>{pe.currentTarget.style.background="transparent"},children:[d.jsx(gl,{className:"h-3 w-3"}),"New chat"]})]})]},R.agentId)},B=j.length+E.length;return d.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"1px solid var(--border)"},children:[d.jsxs("div",{className:"shrink-0",style:{padding:"10px 12px 8px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsx("div",{style:{marginBottom:8},children:d.jsxs("span",{className:"mono uppercase",style:{fontSize:12,color:"var(--fg-3)",letterSpacing:.08},children:[_," members"]})}),d.jsxs("div",{className:"relative",children:[d.jsx(Pd,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),d.jsx("input",{value:m,onChange:R=>h(R.target.value),placeholder:"Filter…",className:"w-full outline-none",style:{padding:"5px 8px 5px 26px",fontSize:14,background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,color:"var(--fg)"}})]}),d.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:O.map(R=>{const $=y===R.value;return d.jsxs("button",{type:"button",onClick:()=>g(R.value),className:"inline-flex items-center",style:{fontSize:12,padding:"3px 7px",borderRadius:3,gap:4,color:$?"var(--fg)":"var(--fg-3)",background:$?"var(--bg-active)":"transparent",border:`1px solid ${$?"var(--border-strong)":"var(--border)"}`},children:[R.label,d.jsx("span",{className:"mono",style:{color:R.warn&&R.count>0?"var(--state-error)":"var(--fg-4)"},children:R.count})]},R.value)})})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[d.jsxs("span",{className:"mono uppercase flex items-center gap-1.5",style:{fontSize:12,color:"var(--fg-3)",letterSpacing:.08},children:[d.jsx(RF,{}),"Pulse · 5m"]}),d.jsx("span",{className:"mono",style:{fontSize:12,color:"var(--fg-4)"},children:f.stale?"stale":"live"})]}),d.jsx(NF,{aggregated:f.aggregated,stale:f.stale}),d.jsxs("div",{className:"flex",style:{gap:10,marginTop:6,fontSize:12},children:[d.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:["●",A.working," working"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:["●",A.blocked," blocked"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:["●",A.error," error"]})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[B===0&&d.jsx("div",{className:"text-center",style:{padding:"24px 12px",fontSize:14,color:"var(--fg-3)"},children:m||y!=="all"?"No matches":"No agents"}),E.length>0&&d.jsxs("div",{children:[d.jsx(kS,{label:"Agents",count:E.length}),E.map(I)]}),j.length>0&&d.jsxs("div",{children:[d.jsx(kS,{label:"Humans",count:j.length}),j.map(I)]})]})]})}function kS({label:e,count:t}){return d.jsxs("div",{className:"mono uppercase sticky top-0 z-10",style:{padding:"5px 12px",fontSize:11,letterSpacing:.12,color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"1px solid var(--border-faint)"},children:[e," · ",t]})}function RF(){return d.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[d.jsx("title",{children:"pulse"}),d.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function OF(){const[e,t]=gg(),n=e.get("a"),a=e.get("c");Rj();const l=S.useCallback(f=>{t(f?{a:f}:{})},[t]),o=S.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:u}=qe({queryKey:["agent-sessions",n],queryFn:()=>n?$s(n):Promise.resolve([]),enabled:!!n&&!a});return S.useEffect(()=>{if(!n||a||!u||u.length===0)return;const f=[...u].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,a,u,t]),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(TF,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),d.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:d.jsx(wF,{selectedAgentId:n,selectedChatId:a})}),n&&d.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"1px solid var(--border)",background:"var(--bg-raised)"},children:d.jsx(EF,{selectedAgentId:n,selectedChatId:a})})]})}const DF=new e_({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function MF(){return d.jsx(t_,{client:DF,children:d.jsx(Kz,{children:d.jsx(Uz,{children:d.jsxs(fz,{children:[d.jsx(Dr,{path:"/login",element:d.jsx(eF,{})}),d.jsx(Dr,{element:d.jsx(Yz,{}),children:d.jsxs(Dr,{element:d.jsx(tL,{children:d.jsx(AD,{})}),children:[d.jsx(Dr,{index:!0,element:d.jsx(OF,{})}),d.jsx(Dr,{path:"agents",element:d.jsx(V$,{})}),d.jsx(Dr,{path:"agents/:uuid",element:d.jsx(T$,{})}),d.jsx(Dr,{path:"clients",element:d.jsx(X$,{})}),d.jsx(Dr,{path:"settings",element:d.jsx(nF,{})}),d.jsx(Dr,{path:"admin",element:d.jsx(bL,{})})]})})]})})})})}const sC=document.getElementById("root");if(!sC)throw new Error("Root element not found");z2.createRoot(sC).render(d.jsx(S.StrictMode,{children:d.jsx(MF,{})}));
|