@agent-team-foundation/first-tree-hub 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,310 +0,0 @@
1
- var Eb=e=>{throw TypeError(e)};var mh=(e,n,i)=>n.has(e)||Eb("Cannot "+i);var O=(e,n,i)=>(mh(e,n,"read from private field"),i?i.call(e):n.get(e)),we=(e,n,i)=>n.has(e)?Eb("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),de=(e,n,i,a)=>(mh(e,n,"write to private field"),a?a.call(e,i):n.set(e,i),i),Ie=(e,n,i)=>(mh(e,n,"access private method"),i);var nc=(e,n,i,a)=>({set _(s){de(e,n,s,i)},get _(){return O(e,n,a)}});function EN(e,n){for(var i=0;i<n.length;i++){const a=n[i];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const u=Object.getOwnPropertyDescriptor(a,s);u&&Object.defineProperty(e,s,u.get?u:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ph={exports:{}},ro={};/**
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 Cb;function CN(){if(Cb)return ro;Cb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,s,u){var c=null;if(u!==void 0&&(c=""+u),s.key!==void 0&&(c=""+s.key),"key"in s){u={};for(var d in s)d!=="key"&&(u[d]=s[d])}else u=s;return s=u.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:u}}return ro.Fragment=n,ro.jsx=i,ro.jsxs=i,ro}var Nb;function NN(){return Nb||(Nb=1,ph.exports=CN()),ph.exports}var h=NN(),gh={exports:{}},ze={};/**
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 _b;function _N(){if(_b)return ze;_b=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function S(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function k(R,Y,_){this.props=R,this.context=Y,this.refs=T,this.updater=_||j}k.prototype.isReactComponent={},k.prototype.setState=function(R,Y){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,Y,"setState")},k.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function P(){}P.prototype=k.prototype;function U(R,Y,_){this.props=R,this.context=Y,this.refs=T,this.updater=_||j}var H=U.prototype=new P;H.constructor=U,C(H,k.prototype),H.isPureReactComponent=!0;var K=Array.isArray;function L(){}var V={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function B(R,Y,_){var ue=_.ref;return{$$typeof:e,type:R,key:Y,ref:ue!==void 0?ue:null,props:_}}function ie(R,Y){return B(R.type,Y,R.props)}function se(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function le(R){var Y={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(_){return Y[_]})}var ke=/\/+/g;function fe(R,Y){return typeof R=="object"&&R!==null&&R.key!=null?le(""+R.key):Y.toString(36)}function ne(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(L,L):(R.status="pending",R.then(function(Y){R.status==="pending"&&(R.status="fulfilled",R.value=Y)},function(Y){R.status==="pending"&&(R.status="rejected",R.reason=Y)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function q(R,Y,_,ue,he){var ce=typeof R;(ce==="undefined"||ce==="boolean")&&(R=null);var Re=!1;if(R===null)Re=!0;else switch(ce){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(R.$$typeof){case e:case n:Re=!0;break;case y:return Re=R._init,q(Re(R._payload),Y,_,ue,he)}}if(Re)return he=he(R),Re=ue===""?"."+fe(R,0):ue,K(he)?(_="",Re!=null&&(_=Re.replace(ke,"$&/")+"/"),q(he,Y,_,"",function(Gt){return Gt})):he!=null&&(se(he)&&(he=ie(he,_+(he.key==null||R&&R.key===he.key?"":(""+he.key).replace(ke,"$&/")+"/")+Re)),Y.push(he)),1;Re=0;var We=ue===""?".":ue+":";if(K(R))for(var je=0;je<R.length;je++)ue=R[je],ce=We+fe(ue,je),Re+=q(ue,Y,_,ce,he);else if(je=S(R),typeof je=="function")for(R=je.call(R),je=0;!(ue=R.next()).done;)ue=ue.value,ce=We+fe(ue,je++),Re+=q(ue,Y,_,ce,he);else if(ce==="object"){if(typeof R.then=="function")return q(ne(R),Y,_,ue,he);throw Y=String(R),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Re}function re(R,Y,_){if(R==null)return R;var ue=[],he=0;return q(R,ue,"","",function(ce){return Y.call(_,ce,he++)}),ue}function me(R){if(R._status===-1){var Y=R._result;Y=Y(),Y.then(function(_){(R._status===0||R._status===-1)&&(R._status=1,R._result=_)},function(_){(R._status===0||R._status===-1)&&(R._status=2,R._result=_)}),R._status===-1&&(R._status=0,R._result=Y)}if(R._status===1)return R._result.default;throw R._result}var Ae=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=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(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},N={map:re,forEach:function(R,Y,_){re(R,function(){Y.apply(this,arguments)},_)},count:function(R){var Y=0;return re(R,function(){Y++}),Y},toArray:function(R){return re(R,function(Y){return Y})||[]},only:function(R){if(!se(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return ze.Activity=v,ze.Children=N,ze.Component=k,ze.Fragment=i,ze.Profiler=s,ze.PureComponent=U,ze.StrictMode=a,ze.Suspense=g,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,ze.__COMPILER_RUNTIME={__proto__:null,c:function(R){return V.H.useMemoCache(R)}},ze.cache=function(R){return function(){return R.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(R,Y,_){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ue=C({},R.props),he=R.key;if(Y!=null)for(ce in Y.key!==void 0&&(he=""+Y.key),Y)!D.call(Y,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&Y.ref===void 0||(ue[ce]=Y[ce]);var ce=arguments.length-2;if(ce===1)ue.children=_;else if(1<ce){for(var Re=Array(ce),We=0;We<ce;We++)Re[We]=arguments[We+2];ue.children=Re}return B(R.type,he,ue)},ze.createContext=function(R){return R={$$typeof:c,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:u,_context:R},R},ze.createElement=function(R,Y,_){var ue,he={},ce=null;if(Y!=null)for(ue in Y.key!==void 0&&(ce=""+Y.key),Y)D.call(Y,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(he[ue]=Y[ue]);var Re=arguments.length-2;if(Re===1)he.children=_;else if(1<Re){for(var We=Array(Re),je=0;je<Re;je++)We[je]=arguments[je+2];he.children=We}if(R&&R.defaultProps)for(ue in Re=R.defaultProps,Re)he[ue]===void 0&&(he[ue]=Re[ue]);return B(R,ce,he)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(R){return{$$typeof:d,render:R}},ze.isValidElement=se,ze.lazy=function(R){return{$$typeof:y,_payload:{_status:-1,_result:R},_init:me}},ze.memo=function(R,Y){return{$$typeof:p,type:R,compare:Y===void 0?null:Y}},ze.startTransition=function(R){var Y=V.T,_={};V.T=_;try{var ue=R(),he=V.S;he!==null&&he(_,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(L,Ae)}catch(ce){Ae(ce)}finally{Y!==null&&_.types!==null&&(Y.types=_.types),V.T=Y}},ze.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},ze.use=function(R){return V.H.use(R)},ze.useActionState=function(R,Y,_){return V.H.useActionState(R,Y,_)},ze.useCallback=function(R,Y){return V.H.useCallback(R,Y)},ze.useContext=function(R){return V.H.useContext(R)},ze.useDebugValue=function(){},ze.useDeferredValue=function(R,Y){return V.H.useDeferredValue(R,Y)},ze.useEffect=function(R,Y){return V.H.useEffect(R,Y)},ze.useEffectEvent=function(R){return V.H.useEffectEvent(R)},ze.useId=function(){return V.H.useId()},ze.useImperativeHandle=function(R,Y,_){return V.H.useImperativeHandle(R,Y,_)},ze.useInsertionEffect=function(R,Y){return V.H.useInsertionEffect(R,Y)},ze.useLayoutEffect=function(R,Y){return V.H.useLayoutEffect(R,Y)},ze.useMemo=function(R,Y){return V.H.useMemo(R,Y)},ze.useOptimistic=function(R,Y){return V.H.useOptimistic(R,Y)},ze.useReducer=function(R,Y,_){return V.H.useReducer(R,Y,_)},ze.useRef=function(R){return V.H.useRef(R)},ze.useState=function(R){return V.H.useState(R)},ze.useSyncExternalStore=function(R,Y,_){return V.H.useSyncExternalStore(R,Y,_)},ze.useTransition=function(){return V.H.useTransition()},ze.version="19.2.4",ze}var jb;function Om(){return jb||(jb=1,gh.exports=_N()),gh.exports}var w=Om();const jN=Lc(w),Rm=EN({__proto__:null,default:jN},[w]);var yh={exports:{}},io={},vh={exports:{}},bh={};/**
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 kb;function kN(){return kb||(kb=1,(function(e){function n(q,re){var me=q.length;q.push(re);e:for(;0<me;){var Ae=me-1>>>1,N=q[Ae];if(0<s(N,re))q[Ae]=re,q[me]=N,me=Ae;else break e}}function i(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var re=q[0],me=q.pop();if(me!==re){q[0]=me;e:for(var Ae=0,N=q.length,R=N>>>1;Ae<R;){var Y=2*(Ae+1)-1,_=q[Y],ue=Y+1,he=q[ue];if(0>s(_,me))ue<N&&0>s(he,_)?(q[Ae]=he,q[ue]=me,Ae=ue):(q[Ae]=_,q[Y]=me,Ae=Y);else if(ue<N&&0>s(he,me))q[Ae]=he,q[ue]=me,Ae=ue;else break e}}return re}function s(q,re){var me=q.sortIndex-re.sortIndex;return me!==0?me:q.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var g=[],p=[],y=1,v=null,x=3,S=!1,j=!1,C=!1,T=!1,k=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function H(q){for(var re=i(p);re!==null;){if(re.callback===null)a(p);else if(re.startTime<=q)a(p),re.sortIndex=re.expirationTime,n(g,re);else break;re=i(p)}}function K(q){if(C=!1,H(q),!j)if(i(g)!==null)j=!0,L||(L=!0,le());else{var re=i(p);re!==null&&ne(K,re.startTime-q)}}var L=!1,V=-1,D=5,B=-1;function ie(){return T?!0:!(e.unstable_now()-B<D)}function se(){if(T=!1,L){var q=e.unstable_now();B=q;var re=!0;try{e:{j=!1,C&&(C=!1,P(V),V=-1),S=!0;var me=x;try{t:{for(H(q),v=i(g);v!==null&&!(v.expirationTime>q&&ie());){var Ae=v.callback;if(typeof Ae=="function"){v.callback=null,x=v.priorityLevel;var N=Ae(v.expirationTime<=q);if(q=e.unstable_now(),typeof N=="function"){v.callback=N,H(q),re=!0;break t}v===i(g)&&a(g),H(q)}else a(g);v=i(g)}if(v!==null)re=!0;else{var R=i(p);R!==null&&ne(K,R.startTime-q),re=!1}}break e}finally{v=null,x=me,S=!1}re=void 0}}finally{re?le():L=!1}}}var le;if(typeof U=="function")le=function(){U(se)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,fe=ke.port2;ke.port1.onmessage=se,le=function(){fe.postMessage(null)}}else le=function(){k(se,0)};function ne(q,re){V=k(function(){q(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(q){switch(x){case 1:case 2:case 3:var re=3;break;default:re=x}var me=x;x=re;try{return q()}finally{x=me}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(q,re){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var me=x;x=q;try{return re()}finally{x=me}},e.unstable_scheduleCallback=function(q,re,me){var Ae=e.unstable_now();switch(typeof me=="object"&&me!==null?(me=me.delay,me=typeof me=="number"&&0<me?Ae+me:Ae):me=Ae,q){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=me+N,q={id:y++,callback:re,priorityLevel:q,startTime:me,expirationTime:N,sortIndex:-1},me>Ae?(q.sortIndex=me,n(p,q),i(g)===null&&q===i(p)&&(C?(P(V),V=-1):C=!0,ne(K,me-Ae))):(q.sortIndex=N,n(g,q),j||S||(j=!0,L||(L=!0,le()))),q},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(q){var re=x;return function(){var me=x;x=re;try{return q.apply(this,arguments)}finally{x=me}}}})(bh)),bh}var Tb;function TN(){return Tb||(Tb=1,vh.exports=kN()),vh.exports}var xh={exports:{}},un={};/**
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 Ab;function AN(){if(Ab)return un;Ab=1;var e=Om();function n(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function u(g,p,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:g,containerInfo:p,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,un.createPortal=function(g,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return u(g,p,null,y)},un.flushSync=function(g){var p=c.T,y=a.p;try{if(c.T=null,a.p=2,g)return g()}finally{c.T=p,a.p=y,a.d.f()}},un.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(g,p))},un.prefetchDNS=function(g){typeof g=="string"&&a.d.D(g)},un.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var y=p.as,v=d(y,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?a.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:S}):y==="script"&&a.d.X(g,{crossOrigin:v,integrity:x,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},un.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=d(p.as,p.crossOrigin);a.d.M(g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(g)},un.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,v=d(y,p.crossOrigin);a.d.L(g,y,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},un.preloadModule=function(g,p){if(typeof g=="string")if(p){var y=d(p.as,p.crossOrigin);a.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(g)},un.requestFormReset=function(g){a.d.r(g)},un.unstable_batchedUpdates=function(g,p){return g(p)},un.useFormState=function(g,p,y){return c.H.useFormState(g,p,y)},un.useFormStatus=function(){return c.H.useHostTransitionStatus()},un.version="19.2.4",un}var zb;function $0(){if(zb)return xh.exports;zb=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(n){console.error(n)}}return e(),xh.exports=AN(),xh.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 Ob;function zN(){if(Ob)return io;Ob=1;var e=TN(),n=Om(),i=$0();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var r=t,l=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(l=r.return),t=r.return;while(t)}return r.tag===3?l:null}function c(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function d(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function g(t){if(u(t)!==t)throw Error(a(188))}function p(t){var r=t.alternate;if(!r){if(r=u(t),r===null)throw Error(a(188));return r!==t?null:t}for(var l=t,o=r;;){var f=l.return;if(f===null)break;var m=f.alternate;if(m===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===l)return g(f),t;if(m===o)return g(f),r;m=m.sibling}throw Error(a(188))}if(l.return!==o.return)l=f,o=m;else{for(var b=!1,E=f.child;E;){if(E===l){b=!0,l=f,o=m;break}if(E===o){b=!0,o=f,l=m;break}E=E.sibling}if(!b){for(E=m.child;E;){if(E===l){b=!0,l=m,o=f;break}if(E===o){b=!0,o=m,l=f;break}E=E.sibling}if(!b)throw Error(a(189))}}if(l.alternate!==o)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?t:r}function y(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=y(t),r!==null)return r;t=t.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),U=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function le(t){return t===null||typeof t!="object"?null:(t=se&&t[se]||t["@@iterator"],typeof t=="function"?t:null)}var ke=Symbol.for("react.client.reference");function fe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ke?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case k:return"Profiler";case T:return"StrictMode";case K:return"Suspense";case L:return"SuspenseList";case B:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case j:return"Portal";case U:return t.displayName||"Context";case P:return(t._context.displayName||"Context")+".Consumer";case H:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case V:return r=t.displayName||null,r!==null?r:fe(t.type)||"Memo";case D:r=t._payload,t=t._init;try{return fe(t(r))}catch{}}return null}var ne=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},Ae=[],N=-1;function R(t){return{current:t}}function Y(t){0>N||(t.current=Ae[N],Ae[N]=null,N--)}function _(t,r){N++,Ae[N]=t.current,t.current=r}var ue=R(null),he=R(null),ce=R(null),Re=R(null);function We(t,r){switch(_(ce,r),_(he,t),_(ue,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Vv(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Vv(r),t=Qv(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Y(ue),_(ue,t)}function je(){Y(ue),Y(he),Y(ce)}function Gt(t){t.memoizedState!==null&&_(Re,t);var r=ue.current,l=Qv(r,t.type);r!==l&&(_(he,t),_(ue,l))}function Dt(t){he.current===t&&(Y(ue),Y(he)),Re.current===t&&(Y(Re),Ws._currentValue=me)}var Ue,Kt;function Ft(t){if(Ue===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);Ue=r&&r[1]||"",Kt=-1<l.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Ue+t+Kt}var ci=!1;function fi(t,r){if(!t||ci)return"";ci=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(r){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(Q){var $=Q}Reflect.construct(t,[],te)}else{try{te.call()}catch(Q){$=Q}t.call(te.prototype)}}else{try{throw Error()}catch(Q){$=Q}(te=t())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(Q){if(Q&&$&&typeof Q.stack=="string")return[Q.stack,$.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=o.DetermineComponentFrameRoot(),b=m[0],E=m[1];if(b&&E){var z=b.split(`
44
- `),F=E.split(`
45
- `);for(f=o=0;o<z.length&&!z[o].includes("DetermineComponentFrameRoot");)o++;for(;f<F.length&&!F[f].includes("DetermineComponentFrameRoot");)f++;if(o===z.length||f===F.length)for(o=z.length-1,f=F.length-1;1<=o&&0<=f&&z[o]!==F[f];)f--;for(;1<=o&&0<=f;o--,f--)if(z[o]!==F[f]){if(o!==1||f!==1)do if(o--,f--,0>f||z[o]!==F[f]){var G=`
46
- `+z[o].replace(" at new "," at ");return t.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",t.displayName)),G}while(1<=o&&0<=f);break}}}finally{ci=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Ft(l):""}function $a(t,r){switch(t.tag){case 26:case 27:case 5:return Ft(t.type);case 16:return Ft("Lazy");case 13:return t.child!==r&&r!==null?Ft("Suspense Fallback"):Ft("Suspense");case 19:return Ft("SuspenseList");case 0:case 15:return fi(t.type,!1);case 11:return fi(t.type.render,!1);case 1:return fi(t.type,!0);case 31:return Ft("Activity");default:return""}}function Va(t){try{var r="",l=null;do r+=$a(t,l),l=t,t=t.return;while(t);return r}catch(o){return`
47
- Error generating stack: `+o.message+`
48
- `+o.stack}}var Rr=Object.prototype.hasOwnProperty,Mr=e.unstable_scheduleCallback,Dr=e.unstable_cancelCallback,pr=e.unstable_shouldYield,Qa=e.unstable_requestPaint,$t=e.unstable_now,hn=e.unstable_getCurrentPriorityLevel,X=e.unstable_ImmediatePriority,oe=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,Ge=e.unstable_IdlePriority,W=e.log,dt=e.unstable_setDisableYieldValue,Ut=null,xt=null;function nn(t){if(typeof W=="function"&&dt(t),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(Ut,t)}catch{}}var ht=Math.clz32?Math.clz32:uE,di=Math.log,lr=Math.LN2;function uE(t){return t>>>=0,t===0?32:31-(di(t)/lr|0)|0}var qo=256,Po=262144,Ho=4194304;function oa(t){var r=t&42;if(r!==0)return r;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Zo(t,r,l){var o=t.pendingLanes;if(o===0)return 0;var f=0,m=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var E=o&134217727;return E!==0?(o=E&~m,o!==0?f=oa(o):(b&=E,b!==0?f=oa(b):l||(l=E&~t,l!==0&&(f=oa(l))))):(E=o&~m,E!==0?f=oa(E):b!==0?f=oa(b):l||(l=o&~t,l!==0&&(f=oa(l)))),f===0?0:r!==0&&r!==f&&(r&m)===0&&(m=f&-f,l=r&-r,m>=l||m===32&&(l&4194048)!==0)?r:f}function ds(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function cE(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 jp(){var t=Ho;return Ho<<=1,(Ho&62914560)===0&&(Ho=4194304),t}function tf(t){for(var r=[],l=0;31>l;l++)r.push(t);return r}function hs(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function fE(t,r,l,o,f,m){var b=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var E=t.entanglements,z=t.expirationTimes,F=t.hiddenUpdates;for(l=b&~l;0<l;){var G=31-ht(l),te=1<<G;E[G]=0,z[G]=-1;var $=F[G];if($!==null)for(F[G]=null,G=0;G<$.length;G++){var Q=$[G];Q!==null&&(Q.lane&=-536870913)}l&=~te}o!==0&&kp(t,o,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(b&~r))}function kp(t,r,l){t.pendingLanes|=r,t.suspendedLanes&=~r;var o=31-ht(r);t.entangledLanes|=r,t.entanglements[o]=t.entanglements[o]|1073741824|l&261930}function Tp(t,r){var l=t.entangledLanes|=r;for(t=t.entanglements;l;){var o=31-ht(l),f=1<<o;f&r|t[o]&r&&(t[o]|=r),l&=~f}}function Ap(t,r){var l=r&-r;return l=(l&42)!==0?1:nf(l),(l&(t.suspendedLanes|r))!==0?0:l}function nf(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function rf(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function zp(){var t=re.p;return t!==0?t:(t=window.event,t===void 0?32:gb(t.type))}function Op(t,r){var l=re.p;try{return re.p=t,r()}finally{re.p=l}}var hi=Math.random().toString(36).slice(2),rn="__reactFiber$"+hi,vn="__reactProps$"+hi,Ya="__reactContainer$"+hi,af="__reactEvents$"+hi,dE="__reactListeners$"+hi,hE="__reactHandles$"+hi,Rp="__reactResources$"+hi,ms="__reactMarker$"+hi;function lf(t){delete t[rn],delete t[vn],delete t[af],delete t[dE],delete t[hE]}function Ga(t){var r=t[rn];if(r)return r;for(var l=t.parentNode;l;){if(r=l[Ya]||l[rn]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(t=eb(t);t!==null;){if(l=t[rn])return l;t=eb(t)}return r}t=l,l=t.parentNode}return null}function Ka(t){if(t=t[rn]||t[Ya]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function ps(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function Xa(t){var r=t[Rp];return r||(r=t[Rp]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Xt(t){t[ms]=!0}var Mp=new Set,Dp={};function ua(t,r){Ja(t,r),Ja(t+"Capture",r)}function Ja(t,r){for(Dp[t]=r,t=0;t<r.length;t++)Mp.add(r[t])}var mE=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]*$"),Up={},Lp={};function pE(t){return Rr.call(Lp,t)?!0:Rr.call(Up,t)?!1:mE.test(t)?Lp[t]=!0:(Up[t]=!0,!1)}function Fo(t,r,l){if(pE(r))if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var o=r.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+l)}}function $o(t,r,l){if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+l)}}function Ur(t,r,l,o){if(o===null)t.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(r,l,""+o)}}function Hn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ip(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function gE(t,r,l){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,m=o.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(t,r,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function sf(t){if(!t._valueTracker){var r=Ip(t)?"checked":"value";t._valueTracker=gE(t,r,""+t[r])}}function Bp(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var l=r.getValue(),o="";return t&&(o=Ip(t)?t.checked?"true":"false":t.value),t=o,t!==l?(r.setValue(t),!0):!1}function Vo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var yE=/[\n"\\]/g;function Zn(t){return t.replace(yE,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function of(t,r,l,o,f,m,b,E){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),r!=null?b==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Hn(r)):t.value!==""+Hn(r)&&(t.value=""+Hn(r)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),r!=null?uf(t,b,Hn(r)):l!=null?uf(t,b,Hn(l)):o!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+Hn(E):t.removeAttribute("name")}function qp(t,r,l,o,f,m,b,E){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),r!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){sf(t);return}l=l!=null?""+Hn(l):"",r=r!=null?""+Hn(r):l,E||r===t.value||(t.value=r),t.defaultValue=r}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=E?t.checked:!!o,t.defaultChecked=!!o,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),sf(t)}function uf(t,r,l){r==="number"&&Vo(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Wa(t,r,l,o){if(t=t.options,r){r={};for(var f=0;f<l.length;f++)r["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=r.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&o&&(t[l].defaultSelected=!0)}else{for(l=""+Hn(l),r=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}r!==null||t[f].disabled||(r=t[f])}r!==null&&(r.selected=!0)}}function Pp(t,r,l){if(r!=null&&(r=""+Hn(r),r!==t.value&&(t.value=r),l==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=l!=null?""+Hn(l):""}function Hp(t,r,l,o){if(r==null){if(o!=null){if(l!=null)throw Error(a(92));if(ne(o)){if(1<o.length)throw Error(a(93));o=o[0]}l=o}l==null&&(l=""),r=l}l=Hn(r),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),sf(t)}function el(t,r){if(r){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=r;return}}t.textContent=r}var vE=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 Zp(t,r,l){var o=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":o?t.setProperty(r,l):typeof l!="number"||l===0||vE.has(r)?r==="float"?t.cssFloat=l:t[r]=(""+l).trim():t[r]=l+"px"}function Fp(t,r,l){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||r!=null&&r.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in r)o=r[f],r.hasOwnProperty(f)&&l[f]!==o&&Zp(t,f,o)}else for(var m in r)r.hasOwnProperty(m)&&Zp(t,m,r[m])}function cf(t){if(t.indexOf("-")===-1)return!1;switch(t){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 bE=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"]]),xE=/^[\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 Qo(t){return xE.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Lr(){}var ff=null;function df(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var tl=null,nl=null;function $p(t){var r=Ka(t);if(r&&(t=r.stateNode)){var l=t[vn]||null;e:switch(t=r.stateNode,r.type){case"input":if(of(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Zn(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var o=l[r];if(o!==t&&o.form===t.form){var f=o[vn]||null;if(!f)throw Error(a(90));of(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<l.length;r++)o=l[r],o.form===t.form&&Bp(o)}break e;case"textarea":Pp(t,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&Wa(t,!!l.multiple,r,!1)}}}var hf=!1;function Vp(t,r,l){if(hf)return t(r,l);hf=!0;try{var o=t(r);return o}finally{if(hf=!1,(tl!==null||nl!==null)&&(Mu(),tl&&(r=tl,t=nl,nl=tl=null,$p(r),t)))for(r=0;r<t.length;r++)$p(t[r])}}function gs(t,r){var l=t.stateNode;if(l===null)return null;var o=l[vn]||null;if(o===null)return null;l=o[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,r,typeof l));return l}var Ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mf=!1;if(Ir)try{var ys={};Object.defineProperty(ys,"passive",{get:function(){mf=!0}}),window.addEventListener("test",ys,ys),window.removeEventListener("test",ys,ys)}catch{mf=!1}var mi=null,pf=null,Yo=null;function Qp(){if(Yo)return Yo;var t,r=pf,l=r.length,o,f="value"in mi?mi.value:mi.textContent,m=f.length;for(t=0;t<l&&r[t]===f[t];t++);var b=l-t;for(o=1;o<=b&&r[l-o]===f[m-o];o++);return Yo=f.slice(t,1<o?1-o:void 0)}function Go(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Ko(){return!0}function Yp(){return!1}function bn(t){function r(l,o,f,m,b){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(l=t[E],this[E]=l?l(m):m[E]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ko:Yp,this.isPropagationStopped=Yp,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ko)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ko)},persist:function(){},isPersistent:Ko}),r}var ca={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xo=bn(ca),vs=v({},ca,{view:0,detail:0}),SE=bn(vs),gf,yf,bs,Jo=v({},vs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==bs&&(bs&&t.type==="mousemove"?(gf=t.screenX-bs.screenX,yf=t.screenY-bs.screenY):yf=gf=0,bs=t),gf)},movementY:function(t){return"movementY"in t?t.movementY:yf}}),Gp=bn(Jo),wE=v({},Jo,{dataTransfer:0}),EE=bn(wE),CE=v({},vs,{relatedTarget:0}),vf=bn(CE),NE=v({},ca,{animationName:0,elapsedTime:0,pseudoElement:0}),_E=bn(NE),jE=v({},ca,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),kE=bn(jE),TE=v({},ca,{data:0}),Kp=bn(TE),AE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zE={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"},OE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RE(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=OE[t])?!!r[t]:!1}function bf(){return RE}var ME=v({},vs,{key:function(t){if(t.key){var r=AE[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Go(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?zE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bf,charCode:function(t){return t.type==="keypress"?Go(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Go(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),DE=bn(ME),UE=v({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xp=bn(UE),LE=v({},vs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bf}),IE=bn(LE),BE=v({},ca,{propertyName:0,elapsedTime:0,pseudoElement:0}),qE=bn(BE),PE=v({},Jo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),HE=bn(PE),ZE=v({},ca,{newState:0,oldState:0}),FE=bn(ZE),$E=[9,13,27,32],xf=Ir&&"CompositionEvent"in window,xs=null;Ir&&"documentMode"in document&&(xs=document.documentMode);var VE=Ir&&"TextEvent"in window&&!xs,Jp=Ir&&(!xf||xs&&8<xs&&11>=xs),Wp=" ",eg=!1;function tg(t,r){switch(t){case"keyup":return $E.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ng(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var rl=!1;function QE(t,r){switch(t){case"compositionend":return ng(r);case"keypress":return r.which!==32?null:(eg=!0,Wp);case"textInput":return t=r.data,t===Wp&&eg?null:t;default:return null}}function YE(t,r){if(rl)return t==="compositionend"||!xf&&tg(t,r)?(t=Qp(),Yo=pf=mi=null,rl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Jp&&r.locale!=="ko"?null:r.data;default:return null}}var GE={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 rg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!GE[t.type]:r==="textarea"}function ig(t,r,l,o){tl?nl?nl.push(o):nl=[o]:tl=o,r=Pu(r,"onChange"),0<r.length&&(l=new Xo("onChange","change",null,l,o),t.push({event:l,listeners:r}))}var Ss=null,ws=null;function KE(t){qv(t,0)}function Wo(t){var r=ps(t);if(Bp(r))return t}function ag(t,r){if(t==="change")return r}var lg=!1;if(Ir){var Sf;if(Ir){var wf="oninput"in document;if(!wf){var sg=document.createElement("div");sg.setAttribute("oninput","return;"),wf=typeof sg.oninput=="function"}Sf=wf}else Sf=!1;lg=Sf&&(!document.documentMode||9<document.documentMode)}function og(){Ss&&(Ss.detachEvent("onpropertychange",ug),ws=Ss=null)}function ug(t){if(t.propertyName==="value"&&Wo(ws)){var r=[];ig(r,ws,t,df(t)),Vp(KE,r)}}function XE(t,r,l){t==="focusin"?(og(),Ss=r,ws=l,Ss.attachEvent("onpropertychange",ug)):t==="focusout"&&og()}function JE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Wo(ws)}function WE(t,r){if(t==="click")return Wo(r)}function eC(t,r){if(t==="input"||t==="change")return Wo(r)}function tC(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var zn=typeof Object.is=="function"?Object.is:tC;function Es(t,r){if(zn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var l=Object.keys(t),o=Object.keys(r);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!Rr.call(r,f)||!zn(t[f],r[f]))return!1}return!0}function cg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function fg(t,r){var l=cg(t);t=0;for(var o;l;){if(l.nodeType===3){if(o=t+l.textContent.length,t<=r&&o>=r)return{node:l,offset:r-t};t=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=cg(l)}}function dg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?dg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function hg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Vo(t.document);r instanceof t.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)t=r.contentWindow;else break;r=Vo(t.document)}return r}function Ef(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var nC=Ir&&"documentMode"in document&&11>=document.documentMode,il=null,Cf=null,Cs=null,Nf=!1;function mg(t,r,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Nf||il==null||il!==Vo(o)||(o=il,"selectionStart"in o&&Ef(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Cs&&Es(Cs,o)||(Cs=o,o=Pu(Cf,"onSelect"),0<o.length&&(r=new Xo("onSelect","select",null,r,l),t.push({event:r,listeners:o}),r.target=il)))}function fa(t,r){var l={};return l[t.toLowerCase()]=r.toLowerCase(),l["Webkit"+t]="webkit"+r,l["Moz"+t]="moz"+r,l}var al={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionrun:fa("Transition","TransitionRun"),transitionstart:fa("Transition","TransitionStart"),transitioncancel:fa("Transition","TransitionCancel"),transitionend:fa("Transition","TransitionEnd")},_f={},pg={};Ir&&(pg=document.createElement("div").style,"AnimationEvent"in window||(delete al.animationend.animation,delete al.animationiteration.animation,delete al.animationstart.animation),"TransitionEvent"in window||delete al.transitionend.transition);function da(t){if(_f[t])return _f[t];if(!al[t])return t;var r=al[t],l;for(l in r)if(r.hasOwnProperty(l)&&l in pg)return _f[t]=r[l];return t}var gg=da("animationend"),yg=da("animationiteration"),vg=da("animationstart"),rC=da("transitionrun"),iC=da("transitionstart"),aC=da("transitioncancel"),bg=da("transitionend"),xg=new Map,jf="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(" ");jf.push("scrollEnd");function sr(t,r){xg.set(t,r),ua(r,[t])}var eu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Fn=[],ll=0,kf=0;function tu(){for(var t=ll,r=kf=ll=0;r<t;){var l=Fn[r];Fn[r++]=null;var o=Fn[r];Fn[r++]=null;var f=Fn[r];Fn[r++]=null;var m=Fn[r];if(Fn[r++]=null,o!==null&&f!==null){var b=o.pending;b===null?f.next=f:(f.next=b.next,b.next=f),o.pending=f}m!==0&&Sg(l,f,m)}}function nu(t,r,l,o){Fn[ll++]=t,Fn[ll++]=r,Fn[ll++]=l,Fn[ll++]=o,kf|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Tf(t,r,l,o){return nu(t,r,l,o),ru(t)}function ha(t,r){return nu(t,null,null,r),ru(t)}function Sg(t,r,l){t.lanes|=l;var o=t.alternate;o!==null&&(o.lanes|=l);for(var f=!1,m=t.return;m!==null;)m.childLanes|=l,o=m.alternate,o!==null&&(o.childLanes|=l),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&r!==null&&(f=31-ht(l),t=m.hiddenUpdates,o=t[f],o===null?t[f]=[r]:o.push(r),r.lane=l|536870912),m):null}function ru(t){if(50<Vs)throw Vs=0,Id=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var sl={};function lC(t,r,l,o){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(t,r,l,o){return new lC(t,r,l,o)}function Af(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Br(t,r){var l=t.alternate;return l===null?(l=On(t.tag,r,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=r,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,r=t.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function wg(t,r){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,r=l.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function iu(t,r,l,o,f,m){var b=0;if(o=t,typeof t=="function")Af(t)&&(b=1);else if(typeof t=="string")b=fN(t,l,ue.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case B:return t=On(31,l,r,f),t.elementType=B,t.lanes=m,t;case C:return ma(l.children,f,m,r);case T:b=8,f|=24;break;case k:return t=On(12,l,r,f|2),t.elementType=k,t.lanes=m,t;case K:return t=On(13,l,r,f),t.elementType=K,t.lanes=m,t;case L:return t=On(19,l,r,f),t.elementType=L,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case U:b=10;break e;case P:b=9;break e;case H:b=11;break e;case V:b=14;break e;case D:b=16,o=null;break e}b=29,l=Error(a(130,t===null?"null":typeof t,"")),o=null}return r=On(b,l,r,f),r.elementType=t,r.type=o,r.lanes=m,r}function ma(t,r,l,o){return t=On(7,t,o,r),t.lanes=l,t}function zf(t,r,l){return t=On(6,t,null,r),t.lanes=l,t}function Eg(t){var r=On(18,null,null,0);return r.stateNode=t,r}function Of(t,r,l){return r=On(4,t.children!==null?t.children:[],t.key,r),r.lanes=l,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Cg=new WeakMap;function $n(t,r){if(typeof t=="object"&&t!==null){var l=Cg.get(t);return l!==void 0?l:(r={value:t,source:r,stack:Va(r)},Cg.set(t,r),r)}return{value:t,source:r,stack:Va(r)}}var ol=[],ul=0,au=null,Ns=0,Vn=[],Qn=0,pi=null,gr=1,yr="";function qr(t,r){ol[ul++]=Ns,ol[ul++]=au,au=t,Ns=r}function Ng(t,r,l){Vn[Qn++]=gr,Vn[Qn++]=yr,Vn[Qn++]=pi,pi=t;var o=gr;t=yr;var f=32-ht(o)-1;o&=~(1<<f),l+=1;var m=32-ht(r)+f;if(30<m){var b=f-f%5;m=(o&(1<<b)-1).toString(32),o>>=b,f-=b,gr=1<<32-ht(r)+f|l<<f|o,yr=m+t}else gr=1<<m|l<<f|o,yr=t}function Rf(t){t.return!==null&&(qr(t,1),Ng(t,1,0))}function Mf(t){for(;t===au;)au=ol[--ul],ol[ul]=null,Ns=ol[--ul],ol[ul]=null;for(;t===pi;)pi=Vn[--Qn],Vn[Qn]=null,yr=Vn[--Qn],Vn[Qn]=null,gr=Vn[--Qn],Vn[Qn]=null}function _g(t,r){Vn[Qn++]=gr,Vn[Qn++]=yr,Vn[Qn++]=pi,gr=r.id,yr=r.overflow,pi=t}var an=null,yt=null,Qe=!1,gi=null,Yn=!1,Df=Error(a(519));function yi(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _s($n(r,t)),Df}function jg(t){var r=t.stateNode,l=t.type,o=t.memoizedProps;switch(r[rn]=t,r[vn]=o,l){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(l=0;l<Ys.length;l++)Fe(Ys[l],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":Fe("invalid",r),qp(r,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Fe("invalid",r);break;case"textarea":Fe("invalid",r),Hp(r,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||o.suppressHydrationWarning===!0||Fv(r.textContent,l)?(o.popover!=null&&(Fe("beforetoggle",r),Fe("toggle",r)),o.onScroll!=null&&Fe("scroll",r),o.onScrollEnd!=null&&Fe("scrollend",r),o.onClick!=null&&(r.onclick=Lr),r=!0):r=!1,r||yi(t,!0)}function kg(t){for(an=t.return;an;)switch(an.tag){case 5:case 31:case 13:Yn=!1;return;case 27:case 3:Yn=!0;return;default:an=an.return}}function cl(t){if(t!==an)return!1;if(!Qe)return kg(t),Qe=!0,!1;var r=t.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Wd(t.type,t.memoizedProps)),l=!l),l&&yt&&yi(t),kg(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));yt=Wv(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));yt=Wv(t)}else r===27?(r=yt,zi(t.type)?(t=ih,ih=null,yt=t):yt=r):yt=an?Kn(t.stateNode.nextSibling):null;return!0}function pa(){yt=an=null,Qe=!1}function Uf(){var t=gi;return t!==null&&(En===null?En=t:En.push.apply(En,t),gi=null),t}function _s(t){gi===null?gi=[t]:gi.push(t)}var Lf=R(null),ga=null,Pr=null;function vi(t,r,l){_(Lf,r._currentValue),r._currentValue=l}function Hr(t){t._currentValue=Lf.current,Y(Lf)}function If(t,r,l){for(;t!==null;){var o=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,o!==null&&(o.childLanes|=r)):o!==null&&(o.childLanes&r)!==r&&(o.childLanes|=r),t===l)break;t=t.return}}function Bf(t,r,l,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var E=m;m=f;for(var z=0;z<r.length;z++)if(E.context===r[z]){m.lanes|=l,E=m.alternate,E!==null&&(E.lanes|=l),If(m.return,l,t),o||(b=null);break e}m=E.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(a(341));b.lanes|=l,m=b.alternate,m!==null&&(m.lanes|=l),If(b,l,t),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===t){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function fl(t,r,l,o){t=null;for(var f=r,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(a(387));if(b=b.memoizedProps,b!==null){var E=f.type;zn(f.pendingProps.value,b.value)||(t!==null?t.push(E):t=[E])}}else if(f===Re.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Ws):t=[Ws])}f=f.return}t!==null&&Bf(r,t,l,o),r.flags|=262144}function lu(t){for(t=t.firstContext;t!==null;){if(!zn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ya(t){ga=t,Pr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function ln(t){return Tg(ga,t)}function su(t,r){return ga===null&&ya(t),Tg(t,r)}function Tg(t,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},Pr===null){if(t===null)throw Error(a(308));Pr=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Pr=Pr.next=r;return l}var sC=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(l,o){t.push(o)}};this.abort=function(){r.aborted=!0,t.forEach(function(l){return l()})}},oC=e.unstable_scheduleCallback,uC=e.unstable_NormalPriority,Lt={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qf(){return{controller:new sC,data:new Map,refCount:0}}function js(t){t.refCount--,t.refCount===0&&oC(uC,function(){t.controller.abort()})}var ks=null,Pf=0,dl=0,hl=null;function cC(t,r){if(ks===null){var l=ks=[];Pf=0,dl=Fd(),hl={status:"pending",value:void 0,then:function(o){l.push(o)}}}return Pf++,r.then(Ag,Ag),r}function Ag(){if(--Pf===0&&ks!==null){hl!==null&&(hl.status="fulfilled");var t=ks;ks=null,dl=0,hl=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function fC(t,r){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){o.status="fulfilled",o.value=r;for(var f=0;f<l.length;f++)(0,l[f])(r)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var zg=q.S;q.S=function(t,r){mv=$t(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&cC(t,r),zg!==null&&zg(t,r)};var va=R(null);function Hf(){var t=va.current;return t!==null?t:mt.pooledCache}function ou(t,r){r===null?_(va,va.current):_(va,r.pool)}function Og(){var t=Hf();return t===null?null:{parent:Lt._currentValue,pool:t}}var ml=Error(a(460)),Zf=Error(a(474)),uu=Error(a(542)),cu={then:function(){}};function Rg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Mg(t,r,l){switch(l=t[l],l===void 0?t.push(r):l!==r&&(r.then(Lr,Lr),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Ug(t),t;default:if(typeof r.status=="string")r.then(Lr,Lr);else{if(t=mt,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(o){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=o}},function(o){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=o}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Ug(t),t}throw xa=r,ml}}function ba(t){try{var r=t._init;return r(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(xa=l,ml):l}}var xa=null;function Dg(){if(xa===null)throw Error(a(459));var t=xa;return xa=null,t}function Ug(t){if(t===ml||t===uu)throw Error(a(483))}var pl=null,Ts=0;function fu(t){var r=Ts;return Ts+=1,pl===null&&(pl=[]),Mg(pl,t,r)}function As(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function du(t,r){throw r.$$typeof===x?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Lg(t){function r(I,M){if(t){var Z=I.deletions;Z===null?(I.deletions=[M],I.flags|=16):Z.push(M)}}function l(I,M){if(!t)return null;for(;M!==null;)r(I,M),M=M.sibling;return null}function o(I){for(var M=new Map;I!==null;)I.key!==null?M.set(I.key,I):M.set(I.index,I),I=I.sibling;return M}function f(I,M){return I=Br(I,M),I.index=0,I.sibling=null,I}function m(I,M,Z){return I.index=Z,t?(Z=I.alternate,Z!==null?(Z=Z.index,Z<M?(I.flags|=67108866,M):Z):(I.flags|=67108866,M)):(I.flags|=1048576,M)}function b(I){return t&&I.alternate===null&&(I.flags|=67108866),I}function E(I,M,Z,J){return M===null||M.tag!==6?(M=zf(Z,I.mode,J),M.return=I,M):(M=f(M,Z),M.return=I,M)}function z(I,M,Z,J){var Ce=Z.type;return Ce===C?G(I,M,Z.props.children,J,Z.key):M!==null&&(M.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===D&&ba(Ce)===M.type)?(M=f(M,Z.props),As(M,Z),M.return=I,M):(M=iu(Z.type,Z.key,Z.props,null,I.mode,J),As(M,Z),M.return=I,M)}function F(I,M,Z,J){return M===null||M.tag!==4||M.stateNode.containerInfo!==Z.containerInfo||M.stateNode.implementation!==Z.implementation?(M=Of(Z,I.mode,J),M.return=I,M):(M=f(M,Z.children||[]),M.return=I,M)}function G(I,M,Z,J,Ce){return M===null||M.tag!==7?(M=ma(Z,I.mode,J,Ce),M.return=I,M):(M=f(M,Z),M.return=I,M)}function te(I,M,Z){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=zf(""+M,I.mode,Z),M.return=I,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return Z=iu(M.type,M.key,M.props,null,I.mode,Z),As(Z,M),Z.return=I,Z;case j:return M=Of(M,I.mode,Z),M.return=I,M;case D:return M=ba(M),te(I,M,Z)}if(ne(M)||le(M))return M=ma(M,I.mode,Z,null),M.return=I,M;if(typeof M.then=="function")return te(I,fu(M),Z);if(M.$$typeof===U)return te(I,su(I,M),Z);du(I,M)}return null}function $(I,M,Z,J){var Ce=M!==null?M.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Ce!==null?null:E(I,M,""+Z,J);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return Z.key===Ce?z(I,M,Z,J):null;case j:return Z.key===Ce?F(I,M,Z,J):null;case D:return Z=ba(Z),$(I,M,Z,J)}if(ne(Z)||le(Z))return Ce!==null?null:G(I,M,Z,J,null);if(typeof Z.then=="function")return $(I,M,fu(Z),J);if(Z.$$typeof===U)return $(I,M,su(I,Z),J);du(I,Z)}return null}function Q(I,M,Z,J,Ce){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return I=I.get(Z)||null,E(M,I,""+J,Ce);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case S:return I=I.get(J.key===null?Z:J.key)||null,z(M,I,J,Ce);case j:return I=I.get(J.key===null?Z:J.key)||null,F(M,I,J,Ce);case D:return J=ba(J),Q(I,M,Z,J,Ce)}if(ne(J)||le(J))return I=I.get(Z)||null,G(M,I,J,Ce,null);if(typeof J.then=="function")return Q(I,M,Z,fu(J),Ce);if(J.$$typeof===U)return Q(I,M,Z,su(M,J),Ce);du(M,J)}return null}function pe(I,M,Z,J){for(var Ce=null,Xe=null,be=M,Le=M=0,Ve=null;be!==null&&Le<Z.length;Le++){be.index>Le?(Ve=be,be=null):Ve=be.sibling;var Je=$(I,be,Z[Le],J);if(Je===null){be===null&&(be=Ve);break}t&&be&&Je.alternate===null&&r(I,be),M=m(Je,M,Le),Xe===null?Ce=Je:Xe.sibling=Je,Xe=Je,be=Ve}if(Le===Z.length)return l(I,be),Qe&&qr(I,Le),Ce;if(be===null){for(;Le<Z.length;Le++)be=te(I,Z[Le],J),be!==null&&(M=m(be,M,Le),Xe===null?Ce=be:Xe.sibling=be,Xe=be);return Qe&&qr(I,Le),Ce}for(be=o(be);Le<Z.length;Le++)Ve=Q(be,I,Le,Z[Le],J),Ve!==null&&(t&&Ve.alternate!==null&&be.delete(Ve.key===null?Le:Ve.key),M=m(Ve,M,Le),Xe===null?Ce=Ve:Xe.sibling=Ve,Xe=Ve);return t&&be.forEach(function(Ui){return r(I,Ui)}),Qe&&qr(I,Le),Ce}function _e(I,M,Z,J){if(Z==null)throw Error(a(151));for(var Ce=null,Xe=null,be=M,Le=M=0,Ve=null,Je=Z.next();be!==null&&!Je.done;Le++,Je=Z.next()){be.index>Le?(Ve=be,be=null):Ve=be.sibling;var Ui=$(I,be,Je.value,J);if(Ui===null){be===null&&(be=Ve);break}t&&be&&Ui.alternate===null&&r(I,be),M=m(Ui,M,Le),Xe===null?Ce=Ui:Xe.sibling=Ui,Xe=Ui,be=Ve}if(Je.done)return l(I,be),Qe&&qr(I,Le),Ce;if(be===null){for(;!Je.done;Le++,Je=Z.next())Je=te(I,Je.value,J),Je!==null&&(M=m(Je,M,Le),Xe===null?Ce=Je:Xe.sibling=Je,Xe=Je);return Qe&&qr(I,Le),Ce}for(be=o(be);!Je.done;Le++,Je=Z.next())Je=Q(be,I,Le,Je.value,J),Je!==null&&(t&&Je.alternate!==null&&be.delete(Je.key===null?Le:Je.key),M=m(Je,M,Le),Xe===null?Ce=Je:Xe.sibling=Je,Xe=Je);return t&&be.forEach(function(wN){return r(I,wN)}),Qe&&qr(I,Le),Ce}function ut(I,M,Z,J){if(typeof Z=="object"&&Z!==null&&Z.type===C&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:e:{for(var Ce=Z.key;M!==null;){if(M.key===Ce){if(Ce=Z.type,Ce===C){if(M.tag===7){l(I,M.sibling),J=f(M,Z.props.children),J.return=I,I=J;break e}}else if(M.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===D&&ba(Ce)===M.type){l(I,M.sibling),J=f(M,Z.props),As(J,Z),J.return=I,I=J;break e}l(I,M);break}else r(I,M);M=M.sibling}Z.type===C?(J=ma(Z.props.children,I.mode,J,Z.key),J.return=I,I=J):(J=iu(Z.type,Z.key,Z.props,null,I.mode,J),As(J,Z),J.return=I,I=J)}return b(I);case j:e:{for(Ce=Z.key;M!==null;){if(M.key===Ce)if(M.tag===4&&M.stateNode.containerInfo===Z.containerInfo&&M.stateNode.implementation===Z.implementation){l(I,M.sibling),J=f(M,Z.children||[]),J.return=I,I=J;break e}else{l(I,M);break}else r(I,M);M=M.sibling}J=Of(Z,I.mode,J),J.return=I,I=J}return b(I);case D:return Z=ba(Z),ut(I,M,Z,J)}if(ne(Z))return pe(I,M,Z,J);if(le(Z)){if(Ce=le(Z),typeof Ce!="function")throw Error(a(150));return Z=Ce.call(Z),_e(I,M,Z,J)}if(typeof Z.then=="function")return ut(I,M,fu(Z),J);if(Z.$$typeof===U)return ut(I,M,su(I,Z),J);du(I,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,M!==null&&M.tag===6?(l(I,M.sibling),J=f(M,Z),J.return=I,I=J):(l(I,M),J=zf(Z,I.mode,J),J.return=I,I=J),b(I)):l(I,M)}return function(I,M,Z,J){try{Ts=0;var Ce=ut(I,M,Z,J);return pl=null,Ce}catch(be){if(be===ml||be===uu)throw be;var Xe=On(29,be,null,I.mode);return Xe.lanes=J,Xe.return=I,Xe}finally{}}}var Sa=Lg(!0),Ig=Lg(!1),bi=!1;function Ff(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $f(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function xi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Si(t,r,l){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(et&2)!==0){var f=o.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),o.pending=r,r=ru(t),Sg(t,null,l),r}return nu(t,o,r,l),ru(t)}function zs(t,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var o=r.lanes;o&=t.pendingLanes,l|=o,r.lanes=l,Tp(t,l)}}function Vf(t,r){var l=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,l=l.next}while(l!==null);m===null?f=m=r:m=m.next=r}else f=m=r;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:o.shared,callbacks:o.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=r:t.next=r,l.lastBaseUpdate=r}var Qf=!1;function Os(){if(Qf){var t=hl;if(t!==null)throw t}}function Rs(t,r,l,o){Qf=!1;var f=t.updateQueue;bi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var z=E,F=z.next;z.next=null,b===null?m=F:b.next=F,b=z;var G=t.alternate;G!==null&&(G=G.updateQueue,E=G.lastBaseUpdate,E!==b&&(E===null?G.firstBaseUpdate=F:E.next=F,G.lastBaseUpdate=z))}if(m!==null){var te=f.baseState;b=0,G=F=z=null,E=m;do{var $=E.lane&-536870913,Q=$!==E.lane;if(Q?($e&$)===$:(o&$)===$){$!==0&&$===dl&&(Qf=!0),G!==null&&(G=G.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var pe=t,_e=E;$=r;var ut=l;switch(_e.tag){case 1:if(pe=_e.payload,typeof pe=="function"){te=pe.call(ut,te,$);break e}te=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=_e.payload,$=typeof pe=="function"?pe.call(ut,te,$):pe,$==null)break e;te=v({},te,$);break e;case 2:bi=!0}}$=E.callback,$!==null&&(t.flags|=64,Q&&(t.flags|=8192),Q=f.callbacks,Q===null?f.callbacks=[$]:Q.push($))}else Q={lane:$,tag:E.tag,payload:E.payload,callback:E.callback,next:null},G===null?(F=G=Q,z=te):G=G.next=Q,b|=$;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;Q=E,E=Q.next,Q.next=null,f.lastBaseUpdate=Q,f.shared.pending=null}}while(!0);G===null&&(z=te),f.baseState=z,f.firstBaseUpdate=F,f.lastBaseUpdate=G,m===null&&(f.shared.lanes=0),_i|=b,t.lanes=b,t.memoizedState=te}}function Bg(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function qg(t,r){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Bg(l[t],r)}var gl=R(null),hu=R(0);function Pg(t,r){t=Xr,_(hu,t),_(gl,r),Xr=t|r.baseLanes}function Yf(){_(hu,Xr),_(gl,gl.current)}function Gf(){Xr=hu.current,Y(gl),Y(hu)}var Rn=R(null),Gn=null;function wi(t){var r=t.alternate;_(Rt,Rt.current&1),_(Rn,t),Gn===null&&(r===null||gl.current!==null||r.memoizedState!==null)&&(Gn=t)}function Kf(t){_(Rt,Rt.current),_(Rn,t),Gn===null&&(Gn=t)}function Hg(t){t.tag===22?(_(Rt,Rt.current),_(Rn,t),Gn===null&&(Gn=t)):Ei()}function Ei(){_(Rt,Rt.current),_(Rn,Rn.current)}function Mn(t){Y(Rn),Gn===t&&(Gn=null),Y(Rt)}var Rt=R(0);function mu(t){for(var r=t;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||nh(l)||rh(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Zr=0,Me=null,st=null,It=null,pu=!1,yl=!1,wa=!1,gu=0,Ms=0,vl=null,dC=0;function kt(){throw Error(a(321))}function Xf(t,r){if(r===null)return!1;for(var l=0;l<r.length&&l<t.length;l++)if(!zn(t[l],r[l]))return!1;return!0}function Jf(t,r,l,o,f,m){return Zr=m,Me=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,q.H=t===null||t.memoizedState===null?Ny:hd,wa=!1,m=l(o,f),wa=!1,yl&&(m=Fg(r,l,o,f)),Zg(t),m}function Zg(t){q.H=Ls;var r=st!==null&&st.next!==null;if(Zr=0,It=st=Me=null,pu=!1,Ms=0,vl=null,r)throw Error(a(300));t===null||Bt||(t=t.dependencies,t!==null&&lu(t)&&(Bt=!0))}function Fg(t,r,l,o){Me=t;var f=0;do{if(yl&&(vl=null),Ms=0,yl=!1,25<=f)throw Error(a(301));if(f+=1,It=st=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}q.H=_y,m=r(l,o)}while(yl);return m}function hC(){var t=q.H,r=t.useState()[0];return r=typeof r.then=="function"?Ds(r):r,t=t.useState()[0],(st!==null?st.memoizedState:null)!==t&&(Me.flags|=1024),r}function Wf(){var t=gu!==0;return gu=0,t}function ed(t,r,l){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~l}function td(t){if(pu){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}pu=!1}Zr=0,It=st=Me=null,yl=!1,Ms=gu=0,vl=null}function mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?Me.memoizedState=It=t:It=It.next=t,It}function Mt(){if(st===null){var t=Me.alternate;t=t!==null?t.memoizedState:null}else t=st.next;var r=It===null?Me.memoizedState:It.next;if(r!==null)It=r,st=t;else{if(t===null)throw Me.alternate===null?Error(a(467)):Error(a(310));st=t,t={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},It===null?Me.memoizedState=It=t:It=It.next=t}return It}function yu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ds(t){var r=Ms;return Ms+=1,vl===null&&(vl=[]),t=Mg(vl,t,r),r=Me,(It===null?r.memoizedState:It.next)===null&&(r=r.alternate,q.H=r===null||r.memoizedState===null?Ny:hd),t}function vu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ds(t);if(t.$$typeof===U)return ln(t)}throw Error(a(438,String(t)))}function nd(t){var r=null,l=Me.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var o=Me.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(r={data:o.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=yu(),Me.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(t),o=0;o<t;o++)l[o]=ie;return r.index++,l}function Fr(t,r){return typeof r=="function"?r(t):r}function bu(t){var r=Mt();return rd(r,st,t)}function rd(t,r,l){var o=t.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=l;var f=t.baseQueue,m=o.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}r.baseQueue=f=m,o.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{r=f.next;var E=b=null,z=null,F=r,G=!1;do{var te=F.lane&-536870913;if(te!==F.lane?($e&te)===te:(Zr&te)===te){var $=F.revertLane;if($===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),te===dl&&(G=!0);else if((Zr&$)===$){F=F.next,$===dl&&(G=!0);continue}else te={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},z===null?(E=z=te,b=m):z=z.next=te,Me.lanes|=$,_i|=$;te=F.action,wa&&l(m,te),m=F.hasEagerState?F.eagerState:l(m,te)}else $={lane:te,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},z===null?(E=z=$,b=m):z=z.next=$,Me.lanes|=te,_i|=te;F=F.next}while(F!==null&&F!==r);if(z===null?b=m:z.next=E,!zn(m,t.memoizedState)&&(Bt=!0,G&&(l=hl,l!==null)))throw l;t.memoizedState=m,t.baseState=b,t.baseQueue=z,o.lastRenderedState=m}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function id(t){var r=Mt(),l=r.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var o=l.dispatch,f=l.pending,m=r.memoizedState;if(f!==null){l.pending=null;var b=f=f.next;do m=t(m,b.action),b=b.next;while(b!==f);zn(m,r.memoizedState)||(Bt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),l.lastRenderedState=m}return[m,o]}function $g(t,r,l){var o=Me,f=Mt(),m=Qe;if(m){if(l===void 0)throw Error(a(407));l=l()}else l=r();var b=!zn((st||f).memoizedState,l);if(b&&(f.memoizedState=l,Bt=!0),f=f.queue,sd(Yg.bind(null,o,f,t),[t]),f.getSnapshot!==r||b||It!==null&&It.memoizedState.tag&1){if(o.flags|=2048,bl(9,{destroy:void 0},Qg.bind(null,o,f,l,r),null),mt===null)throw Error(a(349));m||(Zr&127)!==0||Vg(o,r,l)}return l}function Vg(t,r,l){t.flags|=16384,t={getSnapshot:r,value:l},r=Me.updateQueue,r===null?(r=yu(),Me.updateQueue=r,r.stores=[t]):(l=r.stores,l===null?r.stores=[t]:l.push(t))}function Qg(t,r,l,o){r.value=l,r.getSnapshot=o,Gg(r)&&Kg(t)}function Yg(t,r,l){return l(function(){Gg(r)&&Kg(t)})}function Gg(t){var r=t.getSnapshot;t=t.value;try{var l=r();return!zn(t,l)}catch{return!0}}function Kg(t){var r=ha(t,2);r!==null&&Cn(r,t,2)}function ad(t){var r=mn();if(typeof t=="function"){var l=t;if(t=l(),wa){nn(!0);try{l()}finally{nn(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:t},r}function Xg(t,r,l,o){return t.baseState=l,rd(t,st,typeof o=="function"?o:Fr)}function mC(t,r,l,o,f){if(wu(t))throw Error(a(485));if(t=r.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};q.T!==null?l(!0):m.isTransition=!1,o(m),l=r.pending,l===null?(m.next=r.pending=m,Jg(r,m)):(m.next=l.next,r.pending=l.next=m)}}function Jg(t,r){var l=r.action,o=r.payload,f=t.state;if(r.isTransition){var m=q.T,b={};q.T=b;try{var E=l(f,o),z=q.S;z!==null&&z(b,E),Wg(t,r,E)}catch(F){ld(t,r,F)}finally{m!==null&&b.types!==null&&(m.types=b.types),q.T=m}}else try{m=l(f,o),Wg(t,r,m)}catch(F){ld(t,r,F)}}function Wg(t,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){ey(t,r,o)},function(o){return ld(t,r,o)}):ey(t,r,l)}function ey(t,r,l){r.status="fulfilled",r.value=l,ty(r),t.state=l,r=t.pending,r!==null&&(l=r.next,l===r?t.pending=null:(l=l.next,r.next=l,Jg(t,l)))}function ld(t,r,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do r.status="rejected",r.reason=l,ty(r),r=r.next;while(r!==o)}t.action=null}function ty(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function ny(t,r){return r}function ry(t,r){if(Qe){var l=mt.formState;if(l!==null){e:{var o=Me;if(Qe){if(yt){t:{for(var f=yt,m=Yn;f.nodeType!==8;){if(!m){f=null;break t}if(f=Kn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){yt=Kn(f.nextSibling),o=f.data==="F!";break e}}yi(o)}o=!1}o&&(r=l[0])}}return l=mn(),l.memoizedState=l.baseState=r,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ny,lastRenderedState:r},l.queue=o,l=wy.bind(null,Me,o),o.dispatch=l,o=ad(!1),m=dd.bind(null,Me,!1,o.queue),o=mn(),f={state:r,dispatch:null,action:t,pending:null},o.queue=f,l=mC.bind(null,Me,f,m,l),f.dispatch=l,o.memoizedState=t,[r,l,!1]}function iy(t){var r=Mt();return ay(r,st,t)}function ay(t,r,l){if(r=rd(t,r,ny)[0],t=bu(Fr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var o=Ds(r)}catch(b){throw b===ml?uu:b}else o=r;r=Mt();var f=r.queue,m=f.dispatch;return l!==r.memoizedState&&(Me.flags|=2048,bl(9,{destroy:void 0},pC.bind(null,f,l),null)),[o,m,t]}function pC(t,r){t.action=r}function ly(t){var r=Mt(),l=st;if(l!==null)return ay(r,l,t);Mt(),r=r.memoizedState,l=Mt();var o=l.queue.dispatch;return l.memoizedState=t,[r,o,!1]}function bl(t,r,l,o){return t={tag:t,create:l,deps:o,inst:r,next:null},r=Me.updateQueue,r===null&&(r=yu(),Me.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=t.next=t:(o=l.next,l.next=t,t.next=o,r.lastEffect=t),t}function sy(){return Mt().memoizedState}function xu(t,r,l,o){var f=mn();Me.flags|=t,f.memoizedState=bl(1|r,{destroy:void 0},l,o===void 0?null:o)}function Su(t,r,l,o){var f=Mt();o=o===void 0?null:o;var m=f.memoizedState.inst;st!==null&&o!==null&&Xf(o,st.memoizedState.deps)?f.memoizedState=bl(r,m,l,o):(Me.flags|=t,f.memoizedState=bl(1|r,m,l,o))}function oy(t,r){xu(8390656,8,t,r)}function sd(t,r){Su(2048,8,t,r)}function gC(t){Me.flags|=4;var r=Me.updateQueue;if(r===null)r=yu(),Me.updateQueue=r,r.events=[t];else{var l=r.events;l===null?r.events=[t]:l.push(t)}}function uy(t){var r=Mt().memoizedState;return gC({ref:r,nextImpl:t}),function(){if((et&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function cy(t,r){return Su(4,2,t,r)}function fy(t,r){return Su(4,4,t,r)}function dy(t,r){if(typeof r=="function"){t=t();var l=r(t);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function hy(t,r,l){l=l!=null?l.concat([t]):null,Su(4,4,dy.bind(null,r,t),l)}function od(){}function my(t,r){var l=Mt();r=r===void 0?null:r;var o=l.memoizedState;return r!==null&&Xf(r,o[1])?o[0]:(l.memoizedState=[t,r],t)}function py(t,r){var l=Mt();r=r===void 0?null:r;var o=l.memoizedState;if(r!==null&&Xf(r,o[1]))return o[0];if(o=t(),wa){nn(!0);try{t()}finally{nn(!1)}}return l.memoizedState=[o,r],o}function ud(t,r,l){return l===void 0||(Zr&1073741824)!==0&&($e&261930)===0?t.memoizedState=r:(t.memoizedState=l,t=gv(),Me.lanes|=t,_i|=t,l)}function gy(t,r,l,o){return zn(l,r)?l:gl.current!==null?(t=ud(t,l,o),zn(t,r)||(Bt=!0),t):(Zr&42)===0||(Zr&1073741824)!==0&&($e&261930)===0?(Bt=!0,t.memoizedState=l):(t=gv(),Me.lanes|=t,_i|=t,r)}function yy(t,r,l,o,f){var m=re.p;re.p=m!==0&&8>m?m:8;var b=q.T,E={};q.T=E,dd(t,!1,r,l);try{var z=f(),F=q.S;if(F!==null&&F(E,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var G=fC(z,o);Us(t,r,G,Ln(t))}else Us(t,r,o,Ln(t))}catch(te){Us(t,r,{then:function(){},status:"rejected",reason:te},Ln())}finally{re.p=m,b!==null&&E.types!==null&&(b.types=E.types),q.T=b}}function yC(){}function cd(t,r,l,o){if(t.tag!==5)throw Error(a(476));var f=vy(t).queue;yy(t,f,r,me,l===null?yC:function(){return by(t),l(o)})}function vy(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:me},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:l},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function by(t){var r=vy(t);r.next===null&&(r=t.alternate.memoizedState),Us(t,r.next.queue,{},Ln())}function fd(){return ln(Ws)}function xy(){return Mt().memoizedState}function Sy(){return Mt().memoizedState}function vC(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var l=Ln();t=xi(l);var o=Si(r,t,l);o!==null&&(Cn(o,r,l),zs(o,r,l)),r={cache:qf()},t.payload=r;return}r=r.return}}function bC(t,r,l){var o=Ln();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wu(t)?Ey(r,l):(l=Tf(t,r,l,o),l!==null&&(Cn(l,t,o),Cy(l,r,o)))}function wy(t,r,l){var o=Ln();Us(t,r,l,o)}function Us(t,r,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(wu(t))Ey(r,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var b=r.lastRenderedState,E=m(b,l);if(f.hasEagerState=!0,f.eagerState=E,zn(E,b))return nu(t,r,f,0),mt===null&&tu(),!1}catch{}finally{}if(l=Tf(t,r,f,o),l!==null)return Cn(l,t,o),Cy(l,r,o),!0}return!1}function dd(t,r,l,o){if(o={lane:2,revertLane:Fd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},wu(t)){if(r)throw Error(a(479))}else r=Tf(t,l,o,2),r!==null&&Cn(r,t,2)}function wu(t){var r=t.alternate;return t===Me||r!==null&&r===Me}function Ey(t,r){yl=pu=!0;var l=t.pending;l===null?r.next=r:(r.next=l.next,l.next=r),t.pending=r}function Cy(t,r,l){if((l&4194048)!==0){var o=r.lanes;o&=t.pendingLanes,l|=o,r.lanes=l,Tp(t,l)}}var Ls={readContext:ln,use:vu,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt};Ls.useEffectEvent=kt;var Ny={readContext:ln,use:vu,useCallback:function(t,r){return mn().memoizedState=[t,r===void 0?null:r],t},useContext:ln,useEffect:oy,useImperativeHandle:function(t,r,l){l=l!=null?l.concat([t]):null,xu(4194308,4,dy.bind(null,r,t),l)},useLayoutEffect:function(t,r){return xu(4194308,4,t,r)},useInsertionEffect:function(t,r){xu(4,2,t,r)},useMemo:function(t,r){var l=mn();r=r===void 0?null:r;var o=t();if(wa){nn(!0);try{t()}finally{nn(!1)}}return l.memoizedState=[o,r],o},useReducer:function(t,r,l){var o=mn();if(l!==void 0){var f=l(r);if(wa){nn(!0);try{l(r)}finally{nn(!1)}}}else f=r;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=bC.bind(null,Me,t),[o.memoizedState,t]},useRef:function(t){var r=mn();return t={current:t},r.memoizedState=t},useState:function(t){t=ad(t);var r=t.queue,l=wy.bind(null,Me,r);return r.dispatch=l,[t.memoizedState,l]},useDebugValue:od,useDeferredValue:function(t,r){var l=mn();return ud(l,t,r)},useTransition:function(){var t=ad(!1);return t=yy.bind(null,Me,t.queue,!0,!1),mn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,l){var o=Me,f=mn();if(Qe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),mt===null)throw Error(a(349));($e&127)!==0||Vg(o,r,l)}f.memoizedState=l;var m={value:l,getSnapshot:r};return f.queue=m,oy(Yg.bind(null,o,m,t),[t]),o.flags|=2048,bl(9,{destroy:void 0},Qg.bind(null,o,m,l,r),null),l},useId:function(){var t=mn(),r=mt.identifierPrefix;if(Qe){var l=yr,o=gr;l=(o&~(1<<32-ht(o)-1)).toString(32)+l,r="_"+r+"R_"+l,l=gu++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=dC++,r="_"+r+"r_"+l.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:fd,useFormState:ry,useActionState:ry,useOptimistic:function(t){var r=mn();r.memoizedState=r.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=dd.bind(null,Me,!0,l),l.dispatch=r,[t,r]},useMemoCache:nd,useCacheRefresh:function(){return mn().memoizedState=vC.bind(null,Me)},useEffectEvent:function(t){var r=mn(),l={impl:t};return r.memoizedState=l,function(){if((et&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},hd={readContext:ln,use:vu,useCallback:my,useContext:ln,useEffect:sd,useImperativeHandle:hy,useInsertionEffect:cy,useLayoutEffect:fy,useMemo:py,useReducer:bu,useRef:sy,useState:function(){return bu(Fr)},useDebugValue:od,useDeferredValue:function(t,r){var l=Mt();return gy(l,st.memoizedState,t,r)},useTransition:function(){var t=bu(Fr)[0],r=Mt().memoizedState;return[typeof t=="boolean"?t:Ds(t),r]},useSyncExternalStore:$g,useId:xy,useHostTransitionStatus:fd,useFormState:iy,useActionState:iy,useOptimistic:function(t,r){var l=Mt();return Xg(l,st,t,r)},useMemoCache:nd,useCacheRefresh:Sy};hd.useEffectEvent=uy;var _y={readContext:ln,use:vu,useCallback:my,useContext:ln,useEffect:sd,useImperativeHandle:hy,useInsertionEffect:cy,useLayoutEffect:fy,useMemo:py,useReducer:id,useRef:sy,useState:function(){return id(Fr)},useDebugValue:od,useDeferredValue:function(t,r){var l=Mt();return st===null?ud(l,t,r):gy(l,st.memoizedState,t,r)},useTransition:function(){var t=id(Fr)[0],r=Mt().memoizedState;return[typeof t=="boolean"?t:Ds(t),r]},useSyncExternalStore:$g,useId:xy,useHostTransitionStatus:fd,useFormState:ly,useActionState:ly,useOptimistic:function(t,r){var l=Mt();return st!==null?Xg(l,st,t,r):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:nd,useCacheRefresh:Sy};_y.useEffectEvent=uy;function md(t,r,l,o){r=t.memoizedState,l=l(o,r),l=l==null?r:v({},r,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var pd={enqueueSetState:function(t,r,l){t=t._reactInternals;var o=Ln(),f=xi(o);f.payload=r,l!=null&&(f.callback=l),r=Si(t,f,o),r!==null&&(Cn(r,t,o),zs(r,t,o))},enqueueReplaceState:function(t,r,l){t=t._reactInternals;var o=Ln(),f=xi(o);f.tag=1,f.payload=r,l!=null&&(f.callback=l),r=Si(t,f,o),r!==null&&(Cn(r,t,o),zs(r,t,o))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var l=Ln(),o=xi(l);o.tag=2,r!=null&&(o.callback=r),r=Si(t,o,l),r!==null&&(Cn(r,t,l),zs(r,t,l))}};function jy(t,r,l,o,f,m,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,m,b):r.prototype&&r.prototype.isPureReactComponent?!Es(l,o)||!Es(f,m):!0}function ky(t,r,l,o){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,o),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,o),r.state!==t&&pd.enqueueReplaceState(r,r.state,null)}function Ea(t,r){var l=r;if("ref"in r){l={};for(var o in r)o!=="ref"&&(l[o]=r[o])}if(t=t.defaultProps){l===r&&(l=v({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Ty(t){eu(t)}function Ay(t){console.error(t)}function zy(t){eu(t)}function Eu(t,r){try{var l=t.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(o){setTimeout(function(){throw o})}}function Oy(t,r,l){try{var o=t.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function gd(t,r,l){return l=xi(l),l.tag=3,l.payload={element:null},l.callback=function(){Eu(t,r)},l}function Ry(t){return t=xi(t),t.tag=3,t}function My(t,r,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var m=o.value;t.payload=function(){return f(m)},t.callback=function(){Oy(r,l,o)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(t.callback=function(){Oy(r,l,o),typeof f!="function"&&(ji===null?ji=new Set([this]):ji.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function xC(t,r,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(r=l.alternate,r!==null&&fl(r,l,f,!0),l=Rn.current,l!==null){switch(l.tag){case 31:case 13:return Gn===null?Du():l.alternate===null&&Tt===0&&(Tt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===cu?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([o]):r.add(o),Pd(t,o,f)),!1;case 22:return l.flags|=65536,o===cu?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([o]):l.add(o)),Pd(t,o,f)),!1}throw Error(a(435,l.tag))}return Pd(t,o,f),Du(),!1}if(Qe)return r=Rn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,o!==Df&&(t=Error(a(422),{cause:o}),_s($n(t,l)))):(o!==Df&&(r=Error(a(423),{cause:o}),_s($n(r,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=$n(o,l),f=gd(t.stateNode,o,f),Vf(t,f),Tt!==4&&(Tt=2)),!1;var m=Error(a(520),{cause:o});if(m=$n(m,l),$s===null?$s=[m]:$s.push(m),Tt!==4&&(Tt=2),r===null)return!0;o=$n(o,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=gd(l.stateNode,o,t),Vf(l,t),!1;case 1:if(r=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ji===null||!ji.has(m))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Ry(f),My(f,t,l,o),Vf(l,f),!1}l=l.return}while(l!==null);return!1}var yd=Error(a(461)),Bt=!1;function sn(t,r,l,o){r.child=t===null?Ig(r,null,l,o):Sa(r,t.child,l,o)}function Dy(t,r,l,o,f){l=l.render;var m=r.ref;if("ref"in o){var b={};for(var E in o)E!=="ref"&&(b[E]=o[E])}else b=o;return ya(r),o=Jf(t,r,l,b,m,f),E=Wf(),t!==null&&!Bt?(ed(t,r,f),$r(t,r,f)):(Qe&&E&&Rf(r),r.flags|=1,sn(t,r,o,f),r.child)}function Uy(t,r,l,o,f){if(t===null){var m=l.type;return typeof m=="function"&&!Af(m)&&m.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=m,Ly(t,r,m,o,f)):(t=iu(l.type,null,o,r,r.mode,f),t.ref=r.ref,t.return=r,r.child=t)}if(m=t.child,!Nd(t,f)){var b=m.memoizedProps;if(l=l.compare,l=l!==null?l:Es,l(b,o)&&t.ref===r.ref)return $r(t,r,f)}return r.flags|=1,t=Br(m,o),t.ref=r.ref,t.return=r,r.child=t}function Ly(t,r,l,o,f){if(t!==null){var m=t.memoizedProps;if(Es(m,o)&&t.ref===r.ref)if(Bt=!1,r.pendingProps=o=m,Nd(t,f))(t.flags&131072)!==0&&(Bt=!0);else return r.lanes=t.lanes,$r(t,r,f)}return vd(t,r,l,o,f)}function Iy(t,r,l,o){var f=o.children,m=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((r.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,t!==null){for(o=r.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~m}else o=0,r.child=null;return By(t,r,m,l,o)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&ou(r,m!==null?m.cachePool:null),m!==null?Pg(r,m):Yf(),Hg(r);else return o=r.lanes=536870912,By(t,r,m!==null?m.baseLanes|l:l,l,o)}else m!==null?(ou(r,m.cachePool),Pg(r,m),Ei(),r.memoizedState=null):(t!==null&&ou(r,null),Yf(),Ei());return sn(t,r,f,l),r.child}function Is(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function By(t,r,l,o,f){var m=Hf();return m=m===null?null:{parent:Lt._currentValue,pool:m},r.memoizedState={baseLanes:l,cachePool:m},t!==null&&ou(r,null),Yf(),Hg(r),t!==null&&fl(t,r,o,!0),r.childLanes=f,null}function Cu(t,r){return r=_u({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function qy(t,r,l){return Sa(r,t.child,null,l),t=Cu(r,r.pendingProps),t.flags|=2,Mn(r),r.memoizedState=null,t}function SC(t,r,l){var o=r.pendingProps,f=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(Qe){if(o.mode==="hidden")return t=Cu(r,o),r.lanes=536870912,Is(null,t);if(Kf(r),(t=yt)?(t=Jv(t,Yn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:pi!==null?{id:gr,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},l=Eg(t),l.return=r,r.child=l,an=r,yt=null)):t=null,t===null)throw yi(r);return r.lanes=536870912,null}return Cu(r,o)}var m=t.memoizedState;if(m!==null){var b=m.dehydrated;if(Kf(r),f)if(r.flags&256)r.flags&=-257,r=qy(t,r,l);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(Bt||fl(t,r,l,!1),f=(l&t.childLanes)!==0,Bt||f){if(o=mt,o!==null&&(b=Ap(o,l),b!==0&&b!==m.retryLane))throw m.retryLane=b,ha(t,b),Cn(o,t,b),yd;Du(),r=qy(t,r,l)}else t=m.treeContext,yt=Kn(b.nextSibling),an=r,Qe=!0,gi=null,Yn=!1,t!==null&&_g(r,t),r=Cu(r,o),r.flags|=4096;return r}return t=Br(t.child,{mode:o.mode,children:o.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Nu(t,r){var l=r.ref;if(l===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(r.flags|=4194816)}}function vd(t,r,l,o,f){return ya(r),l=Jf(t,r,l,o,void 0,f),o=Wf(),t!==null&&!Bt?(ed(t,r,f),$r(t,r,f)):(Qe&&o&&Rf(r),r.flags|=1,sn(t,r,l,f),r.child)}function Py(t,r,l,o,f,m){return ya(r),r.updateQueue=null,l=Fg(r,o,l,f),Zg(t),o=Wf(),t!==null&&!Bt?(ed(t,r,m),$r(t,r,m)):(Qe&&o&&Rf(r),r.flags|=1,sn(t,r,l,m),r.child)}function Hy(t,r,l,o,f){if(ya(r),r.stateNode===null){var m=sl,b=l.contextType;typeof b=="object"&&b!==null&&(m=ln(b)),m=new l(o,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=pd,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=o,m.state=r.memoizedState,m.refs={},Ff(r),b=l.contextType,m.context=typeof b=="object"&&b!==null?ln(b):sl,m.state=r.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(md(r,l,b,o),m.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&pd.enqueueReplaceState(m,m.state,null),Rs(r,o,m,f),Os(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),o=!0}else if(t===null){m=r.stateNode;var E=r.memoizedProps,z=Ea(l,E);m.props=z;var F=m.context,G=l.contextType;b=sl,typeof G=="object"&&G!==null&&(b=ln(G));var te=l.getDerivedStateFromProps;G=typeof te=="function"||typeof m.getSnapshotBeforeUpdate=="function",E=r.pendingProps!==E,G||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(E||F!==b)&&ky(r,m,o,b),bi=!1;var $=r.memoizedState;m.state=$,Rs(r,o,m,f),Os(),F=r.memoizedState,E||$!==F||bi?(typeof te=="function"&&(md(r,l,te,o),F=r.memoizedState),(z=bi||jy(r,l,z,o,$,F,b))?(G||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=o,r.memoizedState=F),m.props=o,m.state=F,m.context=b,o=z):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),o=!1)}else{m=r.stateNode,$f(t,r),b=r.memoizedProps,G=Ea(l,b),m.props=G,te=r.pendingProps,$=m.context,F=l.contextType,z=sl,typeof F=="object"&&F!==null&&(z=ln(F)),E=l.getDerivedStateFromProps,(F=typeof E=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==te||$!==z)&&ky(r,m,o,z),bi=!1,$=r.memoizedState,m.state=$,Rs(r,o,m,f),Os();var Q=r.memoizedState;b!==te||$!==Q||bi||t!==null&&t.dependencies!==null&&lu(t.dependencies)?(typeof E=="function"&&(md(r,l,E,o),Q=r.memoizedState),(G=bi||jy(r,l,G,o,$,Q,z)||t!==null&&t.dependencies!==null&&lu(t.dependencies))?(F||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(o,Q,z),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(o,Q,z)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&$===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&$===t.memoizedState||(r.flags|=1024),r.memoizedProps=o,r.memoizedState=Q),m.props=o,m.state=Q,m.context=z,o=G):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&$===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&$===t.memoizedState||(r.flags|=1024),o=!1)}return m=o,Nu(t,r),o=(r.flags&128)!==0,m||o?(m=r.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,t!==null&&o?(r.child=Sa(r,t.child,null,f),r.child=Sa(r,null,l,f)):sn(t,r,l,f),r.memoizedState=m.state,t=r.child):t=$r(t,r,f),t}function Zy(t,r,l,o){return pa(),r.flags|=256,sn(t,r,l,o),r.child}var bd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xd(t){return{baseLanes:t,cachePool:Og()}}function Sd(t,r,l){return t=t!==null?t.childLanes&~l:0,r&&(t|=Un),t}function Fy(t,r,l){var o=r.pendingProps,f=!1,m=(r.flags&128)!==0,b;if((b=m)||(b=t!==null&&t.memoizedState===null?!1:(Rt.current&2)!==0),b&&(f=!0,r.flags&=-129),b=(r.flags&32)!==0,r.flags&=-33,t===null){if(Qe){if(f?wi(r):Ei(),(t=yt)?(t=Jv(t,Yn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:pi!==null?{id:gr,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},l=Eg(t),l.return=r,r.child=l,an=r,yt=null)):t=null,t===null)throw yi(r);return rh(t)?r.lanes=32:r.lanes=536870912,null}var E=o.children;return o=o.fallback,f?(Ei(),f=r.mode,E=_u({mode:"hidden",children:E},f),o=ma(o,f,l,null),E.return=r,o.return=r,E.sibling=o,r.child=E,o=r.child,o.memoizedState=xd(l),o.childLanes=Sd(t,b,l),r.memoizedState=bd,Is(null,o)):(wi(r),wd(r,E))}var z=t.memoizedState;if(z!==null&&(E=z.dehydrated,E!==null)){if(m)r.flags&256?(wi(r),r.flags&=-257,r=Ed(t,r,l)):r.memoizedState!==null?(Ei(),r.child=t.child,r.flags|=128,r=null):(Ei(),E=o.fallback,f=r.mode,o=_u({mode:"visible",children:o.children},f),E=ma(E,f,l,null),E.flags|=2,o.return=r,E.return=r,o.sibling=E,r.child=o,Sa(r,t.child,null,l),o=r.child,o.memoizedState=xd(l),o.childLanes=Sd(t,b,l),r.memoizedState=bd,r=Is(null,o));else if(wi(r),rh(E)){if(b=E.nextSibling&&E.nextSibling.dataset,b)var F=b.dgst;b=F,o=Error(a(419)),o.stack="",o.digest=b,_s({value:o,source:null,stack:null}),r=Ed(t,r,l)}else if(Bt||fl(t,r,l,!1),b=(l&t.childLanes)!==0,Bt||b){if(b=mt,b!==null&&(o=Ap(b,l),o!==0&&o!==z.retryLane))throw z.retryLane=o,ha(t,o),Cn(b,t,o),yd;nh(E)||Du(),r=Ed(t,r,l)}else nh(E)?(r.flags|=192,r.child=t.child,r=null):(t=z.treeContext,yt=Kn(E.nextSibling),an=r,Qe=!0,gi=null,Yn=!1,t!==null&&_g(r,t),r=wd(r,o.children),r.flags|=4096);return r}return f?(Ei(),E=o.fallback,f=r.mode,z=t.child,F=z.sibling,o=Br(z,{mode:"hidden",children:o.children}),o.subtreeFlags=z.subtreeFlags&65011712,F!==null?E=Br(F,E):(E=ma(E,f,l,null),E.flags|=2),E.return=r,o.return=r,o.sibling=E,r.child=o,Is(null,o),o=r.child,E=t.child.memoizedState,E===null?E=xd(l):(f=E.cachePool,f!==null?(z=Lt._currentValue,f=f.parent!==z?{parent:z,pool:z}:f):f=Og(),E={baseLanes:E.baseLanes|l,cachePool:f}),o.memoizedState=E,o.childLanes=Sd(t,b,l),r.memoizedState=bd,Is(t.child,o)):(wi(r),l=t.child,t=l.sibling,l=Br(l,{mode:"visible",children:o.children}),l.return=r,l.sibling=null,t!==null&&(b=r.deletions,b===null?(r.deletions=[t],r.flags|=16):b.push(t)),r.child=l,r.memoizedState=null,l)}function wd(t,r){return r=_u({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function _u(t,r){return t=On(22,t,null,r),t.lanes=0,t}function Ed(t,r,l){return Sa(r,t.child,null,l),t=wd(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function $y(t,r,l){t.lanes|=r;var o=t.alternate;o!==null&&(o.lanes|=r),If(t.return,r,l)}function Cd(t,r,l,o,f,m){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:m}:(b.isBackwards=r,b.rendering=null,b.renderingStartTime=0,b.last=o,b.tail=l,b.tailMode=f,b.treeForkCount=m)}function Vy(t,r,l){var o=r.pendingProps,f=o.revealOrder,m=o.tail;o=o.children;var b=Rt.current,E=(b&2)!==0;if(E?(b=b&1|2,r.flags|=128):b&=1,_(Rt,b),sn(t,r,o,l),o=Qe?Ns:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$y(t,l,r);else if(t.tag===19)$y(t,l,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=r.child,f=null;l!==null;)t=l.alternate,t!==null&&mu(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=r.child,r.child=null):(f=l.sibling,l.sibling=null),Cd(r,!1,f,l,m,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=r.child,r.child=null;f!==null;){if(t=f.alternate,t!==null&&mu(t)===null){r.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}Cd(r,!0,l,null,m,o);break;case"together":Cd(r,!1,null,null,void 0,o);break;default:r.memoizedState=null}return r.child}function $r(t,r,l){if(t!==null&&(r.dependencies=t.dependencies),_i|=r.lanes,(l&r.childLanes)===0)if(t!==null){if(fl(t,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,l=Br(t,t.pendingProps),r.child=l,l.return=r;t.sibling!==null;)t=t.sibling,l=l.sibling=Br(t,t.pendingProps),l.return=r;l.sibling=null}return r.child}function Nd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&lu(t)))}function wC(t,r,l){switch(r.tag){case 3:We(r,r.stateNode.containerInfo),vi(r,Lt,t.memoizedState.cache),pa();break;case 27:case 5:Gt(r);break;case 4:We(r,r.stateNode.containerInfo);break;case 10:vi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Kf(r),null;break;case 13:var o=r.memoizedState;if(o!==null)return o.dehydrated!==null?(wi(r),r.flags|=128,null):(l&r.child.childLanes)!==0?Fy(t,r,l):(wi(r),t=$r(t,r,l),t!==null?t.sibling:null);wi(r);break;case 19:var f=(t.flags&128)!==0;if(o=(l&r.childLanes)!==0,o||(fl(t,r,l,!1),o=(l&r.childLanes)!==0),f){if(o)return Vy(t,r,l);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),_(Rt,Rt.current),o)break;return null;case 22:return r.lanes=0,Iy(t,r,l,r.pendingProps);case 24:vi(r,Lt,t.memoizedState.cache)}return $r(t,r,l)}function Qy(t,r,l){if(t!==null)if(t.memoizedProps!==r.pendingProps)Bt=!0;else{if(!Nd(t,l)&&(r.flags&128)===0)return Bt=!1,wC(t,r,l);Bt=(t.flags&131072)!==0}else Bt=!1,Qe&&(r.flags&1048576)!==0&&Ng(r,Ns,r.index);switch(r.lanes=0,r.tag){case 16:e:{var o=r.pendingProps;if(t=ba(r.elementType),r.type=t,typeof t=="function")Af(t)?(o=Ea(t,o),r.tag=1,r=Hy(null,r,t,o,l)):(r.tag=0,r=vd(null,r,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===H){r.tag=11,r=Dy(null,r,t,o,l);break e}else if(f===V){r.tag=14,r=Uy(null,r,t,o,l);break e}}throw r=fe(t)||t,Error(a(306,r,""))}}return r;case 0:return vd(t,r,r.type,r.pendingProps,l);case 1:return o=r.type,f=Ea(o,r.pendingProps),Hy(t,r,o,f,l);case 3:e:{if(We(r,r.stateNode.containerInfo),t===null)throw Error(a(387));o=r.pendingProps;var m=r.memoizedState;f=m.element,$f(t,r),Rs(r,o,null,l);var b=r.memoizedState;if(o=b.cache,vi(r,Lt,o),o!==m.cache&&Bf(r,[Lt],l,!0),Os(),o=b.element,m.isDehydrated)if(m={element:o,isDehydrated:!1,cache:b.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=Zy(t,r,o,l);break e}else if(o!==f){f=$n(Error(a(424)),r),_s(f),r=Zy(t,r,o,l);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(yt=Kn(t.firstChild),an=r,Qe=!0,gi=null,Yn=!0,l=Ig(r,null,o,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(pa(),o===f){r=$r(t,r,l);break e}sn(t,r,o,l)}r=r.child}return r;case 26:return Nu(t,r),t===null?(l=ib(r.type,null,r.pendingProps,null))?r.memoizedState=l:Qe||(l=r.type,t=r.pendingProps,o=Hu(ce.current).createElement(l),o[rn]=r,o[vn]=t,on(o,l,t),Xt(o),r.stateNode=o):r.memoizedState=ib(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Gt(r),t===null&&Qe&&(o=r.stateNode=tb(r.type,r.pendingProps,ce.current),an=r,Yn=!0,f=yt,zi(r.type)?(ih=f,yt=Kn(o.firstChild)):yt=f),sn(t,r,r.pendingProps.children,l),Nu(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Qe&&((f=o=yt)&&(o=JC(o,r.type,r.pendingProps,Yn),o!==null?(r.stateNode=o,an=r,yt=Kn(o.firstChild),Yn=!1,f=!0):f=!1),f||yi(r)),Gt(r),f=r.type,m=r.pendingProps,b=t!==null?t.memoizedProps:null,o=m.children,Wd(f,m)?o=null:b!==null&&Wd(f,b)&&(r.flags|=32),r.memoizedState!==null&&(f=Jf(t,r,hC,null,null,l),Ws._currentValue=f),Nu(t,r),sn(t,r,o,l),r.child;case 6:return t===null&&Qe&&((t=l=yt)&&(l=WC(l,r.pendingProps,Yn),l!==null?(r.stateNode=l,an=r,yt=null,t=!0):t=!1),t||yi(r)),null;case 13:return Fy(t,r,l);case 4:return We(r,r.stateNode.containerInfo),o=r.pendingProps,t===null?r.child=Sa(r,null,o,l):sn(t,r,o,l),r.child;case 11:return Dy(t,r,r.type,r.pendingProps,l);case 7:return sn(t,r,r.pendingProps,l),r.child;case 8:return sn(t,r,r.pendingProps.children,l),r.child;case 12:return sn(t,r,r.pendingProps.children,l),r.child;case 10:return o=r.pendingProps,vi(r,r.type,o.value),sn(t,r,o.children,l),r.child;case 9:return f=r.type._context,o=r.pendingProps.children,ya(r),f=ln(f),o=o(f),r.flags|=1,sn(t,r,o,l),r.child;case 14:return Uy(t,r,r.type,r.pendingProps,l);case 15:return Ly(t,r,r.type,r.pendingProps,l);case 19:return Vy(t,r,l);case 31:return SC(t,r,l);case 22:return Iy(t,r,l,r.pendingProps);case 24:return ya(r),o=ln(Lt),t===null?(f=Hf(),f===null&&(f=mt,m=qf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=l),f=m),r.memoizedState={parent:o,cache:f},Ff(r),vi(r,Lt,f)):((t.lanes&l)!==0&&($f(t,r),Rs(r,null,null,l),Os()),f=t.memoizedState,m=r.memoizedState,f.parent!==o?(f={parent:o,cache:o},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),vi(r,Lt,o)):(o=m.cache,vi(r,Lt,o),o!==f.cache&&Bf(r,[Lt],l,!0))),sn(t,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Vr(t){t.flags|=4}function _d(t,r,l,o,f){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(xv())t.flags|=8192;else throw xa=cu,Zf}else t.flags&=-16777217}function Yy(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ub(r))if(xv())t.flags|=8192;else throw xa=cu,Zf}function ju(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?jp():536870912,t.lanes|=r,El|=r)}function Bs(t,r){if(!Qe)switch(t.tailMode){case"hidden":r=t.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function vt(t){var r=t.alternate!==null&&t.alternate.child===t.child,l=0,o=0;if(r)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=l,r}function EC(t,r,l){var o=r.pendingProps;switch(Mf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(r),null;case 1:return vt(r),null;case 3:return l=r.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),Hr(Lt),je(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(cl(r)?Vr(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Uf())),vt(r),null;case 26:var f=r.type,m=r.memoizedState;return t===null?(Vr(r),m!==null?(vt(r),Yy(r,m)):(vt(r),_d(r,f,null,o,l))):m?m!==t.memoizedState?(Vr(r),vt(r),Yy(r,m)):(vt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==o&&Vr(r),vt(r),_d(r,f,t,o,l)),null;case 27:if(Dt(r),l=ce.current,f=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==o&&Vr(r);else{if(!o){if(r.stateNode===null)throw Error(a(166));return vt(r),null}t=ue.current,cl(r)?jg(r):(t=tb(f,o,l),r.stateNode=t,Vr(r))}return vt(r),null;case 5:if(Dt(r),f=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==o&&Vr(r);else{if(!o){if(r.stateNode===null)throw Error(a(166));return vt(r),null}if(m=ue.current,cl(r))jg(r);else{var b=Hu(ce.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof o.is=="string"?b.createElement("select",{is:o.is}):b.createElement("select"),o.multiple?m.multiple=!0:o.size&&(m.size=o.size);break;default:m=typeof o.is=="string"?b.createElement(f,{is:o.is}):b.createElement(f)}}m[rn]=r,m[vn]=o;e:for(b=r.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===r)break e;for(;b.sibling===null;){if(b.return===null||b.return===r)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}r.stateNode=m;e:switch(on(m,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Vr(r)}}return vt(r),_d(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,l),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==o&&Vr(r);else{if(typeof o!="string"&&r.stateNode===null)throw Error(a(166));if(t=ce.current,cl(r)){if(t=r.stateNode,l=r.memoizedProps,o=null,f=an,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[rn]=r,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||Fv(t.nodeValue,l)),t||yi(r,!0)}else t=Hu(t).createTextNode(o),t[rn]=r,r.stateNode=t}return vt(r),null;case 31:if(l=r.memoizedState,t===null||t.memoizedState!==null){if(o=cl(r),l!==null){if(t===null){if(!o)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[rn]=r}else pa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vt(r),t=!1}else l=Uf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return r.flags&256?(Mn(r),r):(Mn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return vt(r),null;case 13:if(o=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=cl(r),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(a(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[rn]=r}else pa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vt(r),f=!1}else f=Uf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(Mn(r),r):(Mn(r),null)}return Mn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=o!==null,t=t!==null&&t.memoizedState!==null,l&&(o=r.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==f&&(o.flags|=2048)),l!==t&&l&&(r.child.flags|=8192),ju(r,r.updateQueue),vt(r),null);case 4:return je(),t===null&&Yd(r.stateNode.containerInfo),vt(r),null;case 10:return Hr(r.type),vt(r),null;case 19:if(Y(Rt),o=r.memoizedState,o===null)return vt(r),null;if(f=(r.flags&128)!==0,m=o.rendering,m===null)if(f)Bs(o,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(m=mu(t),m!==null){for(r.flags|=128,Bs(o,!1),t=m.updateQueue,r.updateQueue=t,ju(r,t),r.subtreeFlags=0,t=l,l=r.child;l!==null;)wg(l,t),l=l.sibling;return _(Rt,Rt.current&1|2),Qe&&qr(r,o.treeForkCount),r.child}t=t.sibling}o.tail!==null&&$t()>Ou&&(r.flags|=128,f=!0,Bs(o,!1),r.lanes=4194304)}else{if(!f)if(t=mu(m),t!==null){if(r.flags|=128,f=!0,t=t.updateQueue,r.updateQueue=t,ju(r,t),Bs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!m.alternate&&!Qe)return vt(r),null}else 2*$t()-o.renderingStartTime>Ou&&l!==536870912&&(r.flags|=128,f=!0,Bs(o,!1),r.lanes=4194304);o.isBackwards?(m.sibling=r.child,r.child=m):(t=o.last,t!==null?t.sibling=m:r.child=m,o.last=m)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=$t(),t.sibling=null,l=Rt.current,_(Rt,f?l&1|2:l&1),Qe&&qr(r,o.treeForkCount),t):(vt(r),null);case 22:case 23:return Mn(r),Gf(),o=r.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(r.flags|=8192):o&&(r.flags|=8192),o?(l&536870912)!==0&&(r.flags&128)===0&&(vt(r),r.subtreeFlags&6&&(r.flags|=8192)):vt(r),l=r.updateQueue,l!==null&&ju(r,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==l&&(r.flags|=2048),t!==null&&Y(va),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Hr(Lt),vt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function CC(t,r){switch(Mf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Hr(Lt),je(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Dt(r),null;case 31:if(r.memoizedState!==null){if(Mn(r),r.alternate===null)throw Error(a(340));pa()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Mn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));pa()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Y(Rt),null;case 4:return je(),null;case 10:return Hr(r.type),null;case 22:case 23:return Mn(r),Gf(),t!==null&&Y(va),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Hr(Lt),null;case 25:return null;default:return null}}function Gy(t,r){switch(Mf(r),r.tag){case 3:Hr(Lt),je();break;case 26:case 27:case 5:Dt(r);break;case 4:je();break;case 31:r.memoizedState!==null&&Mn(r);break;case 13:Mn(r);break;case 19:Y(Rt);break;case 10:Hr(r.type);break;case 22:case 23:Mn(r),Gf(),t!==null&&Y(va);break;case 24:Hr(Lt)}}function qs(t,r){try{var l=r.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&t)===t){o=void 0;var m=l.create,b=l.inst;o=m(),b.destroy=o}l=l.next}while(l!==f)}}catch(E){at(r,r.return,E)}}function Ci(t,r,l){try{var o=r.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var m=f.next;o=m;do{if((o.tag&t)===t){var b=o.inst,E=b.destroy;if(E!==void 0){b.destroy=void 0,f=r;var z=l,F=E;try{F()}catch(G){at(f,z,G)}}}o=o.next}while(o!==m)}}catch(G){at(r,r.return,G)}}function Ky(t){var r=t.updateQueue;if(r!==null){var l=t.stateNode;try{qg(r,l)}catch(o){at(t,t.return,o)}}}function Xy(t,r,l){l.props=Ea(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){at(t,r,o)}}function Ps(t,r){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof l=="function"?t.refCleanup=l(o):l.current=o}}catch(f){at(t,r,f)}}function vr(t,r){var l=t.ref,o=t.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){at(t,r,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){at(t,r,f)}else l.current=null}function Jy(t){var r=t.type,l=t.memoizedProps,o=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){at(t,t.return,f)}}function jd(t,r,l){try{var o=t.stateNode;VC(o,t.type,l,r),o[vn]=r}catch(f){at(t,t.return,f)}}function Wy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&zi(t.type)||t.tag===4}function kd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&zi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Td(t,r,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(t),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=Lr));else if(o!==4&&(o===27&&zi(t.type)&&(l=t.stateNode,r=null),t=t.child,t!==null))for(Td(t,r,l),t=t.sibling;t!==null;)Td(t,r,l),t=t.sibling}function ku(t,r,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,r?l.insertBefore(t,r):l.appendChild(t);else if(o!==4&&(o===27&&zi(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(ku(t,r,l),t=t.sibling;t!==null;)ku(t,r,l),t=t.sibling}function ev(t){var r=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);on(r,o,l),r[rn]=t,r[vn]=l}catch(m){at(t,t.return,m)}}var Qr=!1,qt=!1,Ad=!1,tv=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function NC(t,r){if(t=t.containerInfo,Xd=Gu,t=hg(t),Ef(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,m=o.focusNode;o=o.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var b=0,E=-1,z=-1,F=0,G=0,te=t,$=null;t:for(;;){for(var Q;te!==l||f!==0&&te.nodeType!==3||(E=b+f),te!==m||o!==0&&te.nodeType!==3||(z=b+o),te.nodeType===3&&(b+=te.nodeValue.length),(Q=te.firstChild)!==null;)$=te,te=Q;for(;;){if(te===t)break t;if($===l&&++F===f&&(E=b),$===m&&++G===o&&(z=b),(Q=te.nextSibling)!==null)break;te=$,$=te.parentNode}te=Q}l=E===-1||z===-1?null:{start:E,end:z}}else l=null}l=l||{start:0,end:0}}else l=null;for(Jd={focusedElem:t,selectionRange:l},Gu=!1,Jt=r;Jt!==null;)if(r=Jt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Jt=t;else for(;Jt!==null;){switch(r=Jt,m=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,l=r,f=m.memoizedProps,m=m.memoizedState,o=l.stateNode;try{var pe=Ea(l.type,f);t=o.getSnapshotBeforeUpdate(pe,m),o.__reactInternalSnapshotBeforeUpdate=t}catch(_e){at(l,l.return,_e)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,l=t.nodeType,l===9)th(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":th(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=r.sibling,t!==null){t.return=r.return,Jt=t;break}Jt=r.return}}function nv(t,r,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Gr(t,l),o&4&&qs(5,l);break;case 1:if(Gr(t,l),o&4)if(t=l.stateNode,r===null)try{t.componentDidMount()}catch(b){at(l,l.return,b)}else{var f=Ea(l.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(f,r,t.__reactInternalSnapshotBeforeUpdate)}catch(b){at(l,l.return,b)}}o&64&&Ky(l),o&512&&Ps(l,l.return);break;case 3:if(Gr(t,l),o&64&&(t=l.updateQueue,t!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{qg(t,r)}catch(b){at(l,l.return,b)}}break;case 27:r===null&&o&4&&ev(l);case 26:case 5:Gr(t,l),r===null&&o&4&&Jy(l),o&512&&Ps(l,l.return);break;case 12:Gr(t,l);break;case 31:Gr(t,l),o&4&&av(t,l);break;case 13:Gr(t,l),o&4&&lv(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=MC.bind(null,l),eN(t,l))));break;case 22:if(o=l.memoizedState!==null||Qr,!o){r=r!==null&&r.memoizedState!==null||qt,f=Qr;var m=qt;Qr=o,(qt=r)&&!m?Kr(t,l,(l.subtreeFlags&8772)!==0):Gr(t,l),Qr=f,qt=m}break;case 30:break;default:Gr(t,l)}}function rv(t){var r=t.alternate;r!==null&&(t.alternate=null,rv(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&lf(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var St=null,xn=!1;function Yr(t,r,l){for(l=l.child;l!==null;)iv(t,r,l),l=l.sibling}function iv(t,r,l){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount(Ut,l)}catch{}switch(l.tag){case 26:qt||vr(l,r),Yr(t,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:qt||vr(l,r);var o=St,f=xn;zi(l.type)&&(St=l.stateNode,xn=!1),Yr(t,r,l),Ks(l.stateNode),St=o,xn=f;break;case 5:qt||vr(l,r);case 6:if(o=St,f=xn,St=null,Yr(t,r,l),St=o,xn=f,St!==null)if(xn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(l.stateNode)}catch(m){at(l,r,m)}else try{St.removeChild(l.stateNode)}catch(m){at(l,r,m)}break;case 18:St!==null&&(xn?(t=St,Kv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),zl(t)):Kv(St,l.stateNode));break;case 4:o=St,f=xn,St=l.stateNode.containerInfo,xn=!0,Yr(t,r,l),St=o,xn=f;break;case 0:case 11:case 14:case 15:Ci(2,l,r),qt||Ci(4,l,r),Yr(t,r,l);break;case 1:qt||(vr(l,r),o=l.stateNode,typeof o.componentWillUnmount=="function"&&Xy(l,r,o)),Yr(t,r,l);break;case 21:Yr(t,r,l);break;case 22:qt=(o=qt)||l.memoizedState!==null,Yr(t,r,l),qt=o;break;default:Yr(t,r,l)}}function av(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{zl(t)}catch(l){at(r,r.return,l)}}}function lv(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{zl(t)}catch(l){at(r,r.return,l)}}function _C(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new tv),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new tv),r;default:throw Error(a(435,t.tag))}}function Tu(t,r){var l=_C(t);r.forEach(function(o){if(!l.has(o)){l.add(o);var f=DC.bind(null,t,o);o.then(f,f)}})}function Sn(t,r){var l=r.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],m=t,b=r,E=b;e:for(;E!==null;){switch(E.tag){case 27:if(zi(E.type)){St=E.stateNode,xn=!1;break e}break;case 5:St=E.stateNode,xn=!1;break e;case 3:case 4:St=E.stateNode.containerInfo,xn=!0;break e}E=E.return}if(St===null)throw Error(a(160));iv(m,b,f),St=null,xn=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)sv(r,t),r=r.sibling}var or=null;function sv(t,r){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Sn(r,t),wn(t),o&4&&(Ci(3,t,t.return),qs(3,t),Ci(5,t,t.return));break;case 1:Sn(r,t),wn(t),o&512&&(qt||l===null||vr(l,l.return)),o&64&&Qr&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=or;if(Sn(r,t),wn(t),o&512&&(qt||l===null||vr(l,l.return)),o&4){var m=l!==null?l.memoizedState:null;if(o=t.memoizedState,l===null)if(o===null)if(t.stateNode===null){e:{o=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":m=f.getElementsByTagName("title")[0],(!m||m[ms]||m[rn]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(o),f.head.insertBefore(m,f.querySelector("head > title"))),on(m,o,l),m[rn]=t,Xt(m),o=m;break e;case"link":var b=sb("link","href",f).get(o+(l.href||""));if(b){for(var E=0;E<b.length;E++)if(m=b[E],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(E,1);break t}}m=f.createElement(o),on(m,o,l),f.head.appendChild(m);break;case"meta":if(b=sb("meta","content",f).get(o+(l.content||""))){for(E=0;E<b.length;E++)if(m=b[E],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(E,1);break t}}m=f.createElement(o),on(m,o,l),f.head.appendChild(m);break;default:throw Error(a(468,o))}m[rn]=t,Xt(m),o=m}t.stateNode=o}else ob(f,t.type,t.stateNode);else t.stateNode=lb(f,o,t.memoizedProps);else m!==o?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,o===null?ob(f,t.type,t.stateNode):lb(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&jd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Sn(r,t),wn(t),o&512&&(qt||l===null||vr(l,l.return)),l!==null&&o&4&&jd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Sn(r,t),wn(t),o&512&&(qt||l===null||vr(l,l.return)),t.flags&32){f=t.stateNode;try{el(f,"")}catch(pe){at(t,t.return,pe)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,jd(t,f,l!==null?l.memoizedProps:f)),o&1024&&(Ad=!0);break;case 6:if(Sn(r,t),wn(t),o&4){if(t.stateNode===null)throw Error(a(162));o=t.memoizedProps,l=t.stateNode;try{l.nodeValue=o}catch(pe){at(t,t.return,pe)}}break;case 3:if($u=null,f=or,or=Zu(r.containerInfo),Sn(r,t),or=f,wn(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{zl(r.containerInfo)}catch(pe){at(t,t.return,pe)}Ad&&(Ad=!1,ov(t));break;case 4:o=or,or=Zu(t.stateNode.containerInfo),Sn(r,t),wn(t),or=o;break;case 12:Sn(r,t),wn(t);break;case 31:Sn(r,t),wn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Tu(t,o)));break;case 13:Sn(r,t),wn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(zu=$t()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Tu(t,o)));break;case 22:f=t.memoizedState!==null;var z=l!==null&&l.memoizedState!==null,F=Qr,G=qt;if(Qr=F||f,qt=G||z,Sn(r,t),qt=G,Qr=F,wn(t),o&8192)e:for(r=t.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(l===null||z||Qr||qt||Ca(t)),l=null,r=t;;){if(r.tag===5||r.tag===26){if(l===null){z=l=r;try{if(m=z.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{E=z.stateNode;var te=z.memoizedProps.style,$=te!=null&&te.hasOwnProperty("display")?te.display:null;E.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(pe){at(z,z.return,pe)}}}else if(r.tag===6){if(l===null){z=r;try{z.stateNode.nodeValue=f?"":z.memoizedProps}catch(pe){at(z,z.return,pe)}}}else if(r.tag===18){if(l===null){z=r;try{var Q=z.stateNode;f?Xv(Q,!0):Xv(z.stateNode,!1)}catch(pe){at(z,z.return,pe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}o&4&&(o=t.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,Tu(t,l))));break;case 19:Sn(r,t),wn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Tu(t,o)));break;case 30:break;case 21:break;default:Sn(r,t),wn(t)}}function wn(t){var r=t.flags;if(r&2){try{for(var l,o=t.return;o!==null;){if(Wy(o)){l=o;break}o=o.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,m=kd(t);ku(t,m,f);break;case 5:var b=l.stateNode;l.flags&32&&(el(b,""),l.flags&=-33);var E=kd(t);ku(t,E,b);break;case 3:case 4:var z=l.stateNode.containerInfo,F=kd(t);Td(t,F,z);break;default:throw Error(a(161))}}catch(G){at(t,t.return,G)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function ov(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;ov(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Gr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)nv(t,r.alternate,r),r=r.sibling}function Ca(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Ci(4,r,r.return),Ca(r);break;case 1:vr(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&Xy(r,r.return,l),Ca(r);break;case 27:Ks(r.stateNode);case 26:case 5:vr(r,r.return),Ca(r);break;case 22:r.memoizedState===null&&Ca(r);break;case 30:Ca(r);break;default:Ca(r)}t=t.sibling}}function Kr(t,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var o=r.alternate,f=t,m=r,b=m.flags;switch(m.tag){case 0:case 11:case 15:Kr(f,m,l),qs(4,m);break;case 1:if(Kr(f,m,l),o=m,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(F){at(o,o.return,F)}if(o=m,f=o.updateQueue,f!==null){var E=o.stateNode;try{var z=f.shared.hiddenCallbacks;if(z!==null)for(f.shared.hiddenCallbacks=null,f=0;f<z.length;f++)Bg(z[f],E)}catch(F){at(o,o.return,F)}}l&&b&64&&Ky(m),Ps(m,m.return);break;case 27:ev(m);case 26:case 5:Kr(f,m,l),l&&o===null&&b&4&&Jy(m),Ps(m,m.return);break;case 12:Kr(f,m,l);break;case 31:Kr(f,m,l),l&&b&4&&av(f,m);break;case 13:Kr(f,m,l),l&&b&4&&lv(f,m);break;case 22:m.memoizedState===null&&Kr(f,m,l),Ps(m,m.return);break;case 30:break;default:Kr(f,m,l)}r=r.sibling}}function zd(t,r){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&js(l))}function Od(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&js(t))}function ur(t,r,l,o){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)uv(t,r,l,o),r=r.sibling}function uv(t,r,l,o){var f=r.flags;switch(r.tag){case 0:case 11:case 15:ur(t,r,l,o),f&2048&&qs(9,r);break;case 1:ur(t,r,l,o);break;case 3:ur(t,r,l,o),f&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&js(t)));break;case 12:if(f&2048){ur(t,r,l,o),t=r.stateNode;try{var m=r.memoizedProps,b=m.id,E=m.onPostCommit;typeof E=="function"&&E(b,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(z){at(r,r.return,z)}}else ur(t,r,l,o);break;case 31:ur(t,r,l,o);break;case 13:ur(t,r,l,o);break;case 23:break;case 22:m=r.stateNode,b=r.alternate,r.memoizedState!==null?m._visibility&2?ur(t,r,l,o):Hs(t,r):m._visibility&2?ur(t,r,l,o):(m._visibility|=2,xl(t,r,l,o,(r.subtreeFlags&10256)!==0||!1)),f&2048&&zd(b,r);break;case 24:ur(t,r,l,o),f&2048&&Od(r.alternate,r);break;default:ur(t,r,l,o)}}function xl(t,r,l,o,f){for(f=f&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var m=t,b=r,E=l,z=o,F=b.flags;switch(b.tag){case 0:case 11:case 15:xl(m,b,E,z,f),qs(8,b);break;case 23:break;case 22:var G=b.stateNode;b.memoizedState!==null?G._visibility&2?xl(m,b,E,z,f):Hs(m,b):(G._visibility|=2,xl(m,b,E,z,f)),f&&F&2048&&zd(b.alternate,b);break;case 24:xl(m,b,E,z,f),f&&F&2048&&Od(b.alternate,b);break;default:xl(m,b,E,z,f)}r=r.sibling}}function Hs(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=t,o=r,f=o.flags;switch(o.tag){case 22:Hs(l,o),f&2048&&zd(o.alternate,o);break;case 24:Hs(l,o),f&2048&&Od(o.alternate,o);break;default:Hs(l,o)}r=r.sibling}}var Zs=8192;function Sl(t,r,l){if(t.subtreeFlags&Zs)for(t=t.child;t!==null;)cv(t,r,l),t=t.sibling}function cv(t,r,l){switch(t.tag){case 26:Sl(t,r,l),t.flags&Zs&&t.memoizedState!==null&&dN(l,or,t.memoizedState,t.memoizedProps);break;case 5:Sl(t,r,l);break;case 3:case 4:var o=or;or=Zu(t.stateNode.containerInfo),Sl(t,r,l),or=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Zs,Zs=16777216,Sl(t,r,l),Zs=o):Sl(t,r,l));break;default:Sl(t,r,l)}}function fv(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Fs(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var o=r[l];Jt=o,hv(o,t)}fv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)dv(t),t=t.sibling}function dv(t){switch(t.tag){case 0:case 11:case 15:Fs(t),t.flags&2048&&Ci(9,t,t.return);break;case 3:Fs(t);break;case 12:Fs(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Au(t)):Fs(t);break;default:Fs(t)}}function Au(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var o=r[l];Jt=o,hv(o,t)}fv(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Ci(8,r,r.return),Au(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,Au(r));break;default:Au(r)}t=t.sibling}}function hv(t,r){for(;Jt!==null;){var l=Jt;switch(l.tag){case 0:case 11:case 15:Ci(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:js(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,Jt=o;else e:for(l=t;Jt!==null;){o=Jt;var f=o.sibling,m=o.return;if(rv(o),o===l){Jt=null;break e}if(f!==null){f.return=m,Jt=f;break e}Jt=m}}}var jC={getCacheForType:function(t){var r=ln(Lt),l=r.data.get(t);return l===void 0&&(l=t(),r.data.set(t,l)),l},cacheSignal:function(){return ln(Lt).controller.signal}},kC=typeof WeakMap=="function"?WeakMap:Map,et=0,mt=null,Ze=null,$e=0,it=0,Dn=null,Ni=!1,wl=!1,Rd=!1,Xr=0,Tt=0,_i=0,Na=0,Md=0,Un=0,El=0,$s=null,En=null,Dd=!1,zu=0,mv=0,Ou=1/0,Ru=null,ji=null,Vt=0,ki=null,Cl=null,Jr=0,Ud=0,Ld=null,pv=null,Vs=0,Id=null;function Ln(){return(et&2)!==0&&$e!==0?$e&-$e:q.T!==null?Fd():zp()}function gv(){if(Un===0)if(($e&536870912)===0||Qe){var t=Po;Po<<=1,(Po&3932160)===0&&(Po=262144),Un=t}else Un=536870912;return t=Rn.current,t!==null&&(t.flags|=32),Un}function Cn(t,r,l){(t===mt&&(it===2||it===9)||t.cancelPendingCommit!==null)&&(Nl(t,0),Ti(t,$e,Un,!1)),hs(t,l),((et&2)===0||t!==mt)&&(t===mt&&((et&2)===0&&(Na|=l),Tt===4&&Ti(t,$e,Un,!1)),br(t))}function yv(t,r,l){if((et&6)!==0)throw Error(a(327));var o=!l&&(r&127)===0&&(r&t.expiredLanes)===0||ds(t,r),f=o?zC(t,r):qd(t,r,!0),m=o;do{if(f===0){wl&&!o&&Ti(t,r,0,!1);break}else{if(l=t.current.alternate,m&&!TC(l)){f=qd(t,r,!1),m=!1;continue}if(f===2){if(m=r,t.errorRecoveryDisabledLanes&m)var b=0;else b=t.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){r=b;e:{var E=t;f=$s;var z=E.current.memoizedState.isDehydrated;if(z&&(Nl(E,b).flags|=256),b=qd(E,b,!1),b!==2){if(Rd&&!z){E.errorRecoveryDisabledLanes|=m,Na|=m,f=4;break e}m=En,En=f,m!==null&&(En===null?En=m:En.push.apply(En,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Nl(t,0),Ti(t,r,0,!0);break}e:{switch(o=t,m=f,m){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:Ti(o,r,Un,!Ni);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(f=zu+300-$t(),10<f)){if(Ti(o,r,Un,!Ni),Zo(o,0,!0)!==0)break e;Jr=r,o.timeoutHandle=Yv(vv.bind(null,o,l,En,Ru,Dd,r,Un,Na,El,Ni,m,"Throttled",-0,0),f);break e}vv(o,l,En,Ru,Dd,r,Un,Na,El,Ni,m,null,-0,0)}}break}while(!0);br(t)}function vv(t,r,l,o,f,m,b,E,z,F,G,te,$,Q){if(t.timeoutHandle=-1,te=r.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Lr},cv(r,m,te);var pe=(m&62914560)===m?zu-$t():(m&4194048)===m?mv-$t():0;if(pe=hN(te,pe),pe!==null){Jr=m,t.cancelPendingCommit=pe(_v.bind(null,t,r,m,l,o,f,b,E,z,G,te,null,$,Q)),Ti(t,m,b,!F);return}}_v(t,r,m,l,o,f,b,E,z)}function TC(t){for(var r=t;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var o=0;o<l.length;o++){var f=l[o],m=f.getSnapshot;f=f.value;try{if(!zn(m(),f))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ti(t,r,l,o){r&=~Md,r&=~Na,t.suspendedLanes|=r,t.pingedLanes&=~r,o&&(t.warmLanes|=r),o=t.expirationTimes;for(var f=r;0<f;){var m=31-ht(f),b=1<<m;o[m]=-1,f&=~b}l!==0&&kp(t,l,r)}function Mu(){return(et&6)===0?(Qs(0),!1):!0}function Bd(){if(Ze!==null){if(it===0)var t=Ze.return;else t=Ze,Pr=ga=null,td(t),pl=null,Ts=0,t=Ze;for(;t!==null;)Gy(t.alternate,t),t=t.return;Ze=null}}function Nl(t,r){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,GC(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Jr=0,Bd(),mt=t,Ze=l=Br(t.current,null),$e=r,it=0,Dn=null,Ni=!1,wl=ds(t,r),Rd=!1,El=Un=Md=Na=_i=Tt=0,En=$s=null,Dd=!1,(r&8)!==0&&(r|=r&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=r;0<o;){var f=31-ht(o),m=1<<f;r|=t[f],o&=~m}return Xr=r,tu(),l}function bv(t,r){Me=null,q.H=Ls,r===ml||r===uu?(r=Dg(),it=3):r===Zf?(r=Dg(),it=4):it=r===yd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Dn=r,Ze===null&&(Tt=1,Eu(t,$n(r,t.current)))}function xv(){var t=Rn.current;return t===null?!0:($e&4194048)===$e?Gn===null:($e&62914560)===$e||($e&536870912)!==0?t===Gn:!1}function Sv(){var t=q.H;return q.H=Ls,t===null?Ls:t}function wv(){var t=q.A;return q.A=jC,t}function Du(){Tt=4,Ni||($e&4194048)!==$e&&Rn.current!==null||(wl=!0),(_i&134217727)===0&&(Na&134217727)===0||mt===null||Ti(mt,$e,Un,!1)}function qd(t,r,l){var o=et;et|=2;var f=Sv(),m=wv();(mt!==t||$e!==r)&&(Ru=null,Nl(t,r)),r=!1;var b=Tt;e:do try{if(it!==0&&Ze!==null){var E=Ze,z=Dn;switch(it){case 8:Bd(),b=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(r=!0);var F=it;if(it=0,Dn=null,_l(t,E,z,F),l&&wl){b=0;break e}break;default:F=it,it=0,Dn=null,_l(t,E,z,F)}}AC(),b=Tt;break}catch(G){bv(t,G)}while(!0);return r&&t.shellSuspendCounter++,Pr=ga=null,et=o,q.H=f,q.A=m,Ze===null&&(mt=null,$e=0,tu()),b}function AC(){for(;Ze!==null;)Ev(Ze)}function zC(t,r){var l=et;et|=2;var o=Sv(),f=wv();mt!==t||$e!==r?(Ru=null,Ou=$t()+500,Nl(t,r)):wl=ds(t,r);e:do try{if(it!==0&&Ze!==null){r=Ze;var m=Dn;t:switch(it){case 1:it=0,Dn=null,_l(t,r,m,1);break;case 2:case 9:if(Rg(m)){it=0,Dn=null,Cv(r);break}r=function(){it!==2&&it!==9||mt!==t||(it=7),br(t)},m.then(r,r);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:Rg(m)?(it=0,Dn=null,Cv(r)):(it=0,Dn=null,_l(t,r,m,7));break;case 5:var b=null;switch(Ze.tag){case 26:b=Ze.memoizedState;case 5:case 27:var E=Ze;if(b?ub(b):E.stateNode.complete){it=0,Dn=null;var z=E.sibling;if(z!==null)Ze=z;else{var F=E.return;F!==null?(Ze=F,Uu(F)):Ze=null}break t}}it=0,Dn=null,_l(t,r,m,5);break;case 6:it=0,Dn=null,_l(t,r,m,6);break;case 8:Bd(),Tt=6;break e;default:throw Error(a(462))}}OC();break}catch(G){bv(t,G)}while(!0);return Pr=ga=null,q.H=o,q.A=f,et=l,Ze!==null?0:(mt=null,$e=0,tu(),Tt)}function OC(){for(;Ze!==null&&!pr();)Ev(Ze)}function Ev(t){var r=Qy(t.alternate,t,Xr);t.memoizedProps=t.pendingProps,r===null?Uu(t):Ze=r}function Cv(t){var r=t,l=r.alternate;switch(r.tag){case 15:case 0:r=Py(l,r,r.pendingProps,r.type,void 0,$e);break;case 11:r=Py(l,r,r.pendingProps,r.type.render,r.ref,$e);break;case 5:td(r);default:Gy(l,r),r=Ze=wg(r,Xr),r=Qy(l,r,Xr)}t.memoizedProps=t.pendingProps,r===null?Uu(t):Ze=r}function _l(t,r,l,o){Pr=ga=null,td(r),pl=null,Ts=0;var f=r.return;try{if(xC(t,f,r,l,$e)){Tt=1,Eu(t,$n(l,t.current)),Ze=null;return}}catch(m){if(f!==null)throw Ze=f,m;Tt=1,Eu(t,$n(l,t.current)),Ze=null;return}r.flags&32768?(Qe||o===1?t=!0:wl||($e&536870912)!==0?t=!1:(Ni=t=!0,(o===2||o===9||o===3||o===6)&&(o=Rn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Nv(r,t)):Uu(r)}function Uu(t){var r=t;do{if((r.flags&32768)!==0){Nv(r,Ni);return}t=r.return;var l=EC(r.alternate,r,Xr);if(l!==null){Ze=l;return}if(r=r.sibling,r!==null){Ze=r;return}Ze=r=t}while(r!==null);Tt===0&&(Tt=5)}function Nv(t,r){do{var l=CC(t.alternate,t);if(l!==null){l.flags&=32767,Ze=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(t=t.sibling,t!==null)){Ze=t;return}Ze=t=l}while(t!==null);Tt=6,Ze=null}function _v(t,r,l,o,f,m,b,E,z){t.cancelPendingCommit=null;do Lu();while(Vt!==0);if((et&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));if(m=r.lanes|r.childLanes,m|=kf,fE(t,l,m,b,E,z),t===mt&&(Ze=mt=null,$e=0),Cl=r,ki=t,Jr=l,Ud=m,Ld=f,pv=o,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,UC(Ne,function(){return zv(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||o){o=q.T,q.T=null,f=re.p,re.p=2,b=et,et|=4;try{NC(t,r,l)}finally{et=b,re.p=f,q.T=o}}Vt=1,jv(),kv(),Tv()}}function jv(){if(Vt===1){Vt=0;var t=ki,r=Cl,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=q.T,q.T=null;var o=re.p;re.p=2;var f=et;et|=4;try{sv(r,t);var m=Jd,b=hg(t.containerInfo),E=m.focusedElem,z=m.selectionRange;if(b!==E&&E&&E.ownerDocument&&dg(E.ownerDocument.documentElement,E)){if(z!==null&&Ef(E)){var F=z.start,G=z.end;if(G===void 0&&(G=F),"selectionStart"in E)E.selectionStart=F,E.selectionEnd=Math.min(G,E.value.length);else{var te=E.ownerDocument||document,$=te&&te.defaultView||window;if($.getSelection){var Q=$.getSelection(),pe=E.textContent.length,_e=Math.min(z.start,pe),ut=z.end===void 0?_e:Math.min(z.end,pe);!Q.extend&&_e>ut&&(b=ut,ut=_e,_e=b);var I=fg(E,_e),M=fg(E,ut);if(I&&M&&(Q.rangeCount!==1||Q.anchorNode!==I.node||Q.anchorOffset!==I.offset||Q.focusNode!==M.node||Q.focusOffset!==M.offset)){var Z=te.createRange();Z.setStart(I.node,I.offset),Q.removeAllRanges(),_e>ut?(Q.addRange(Z),Q.extend(M.node,M.offset)):(Z.setEnd(M.node,M.offset),Q.addRange(Z))}}}}for(te=[],Q=E;Q=Q.parentNode;)Q.nodeType===1&&te.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<te.length;E++){var J=te[E];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Gu=!!Xd,Jd=Xd=null}finally{et=f,re.p=o,q.T=l}}t.current=r,Vt=2}}function kv(){if(Vt===2){Vt=0;var t=ki,r=Cl,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=q.T,q.T=null;var o=re.p;re.p=2;var f=et;et|=4;try{nv(t,r.alternate,r)}finally{et=f,re.p=o,q.T=l}}Vt=3}}function Tv(){if(Vt===4||Vt===3){Vt=0,Qa();var t=ki,r=Cl,l=Jr,o=pv;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Vt=5:(Vt=0,Cl=ki=null,Av(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(ji=null),rf(l),r=r.stateNode,xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot(Ut,r,void 0,(r.current.flags&128)===128)}catch{}if(o!==null){r=q.T,f=re.p,re.p=2,q.T=null;try{for(var m=t.onRecoverableError,b=0;b<o.length;b++){var E=o[b];m(E.value,{componentStack:E.stack})}}finally{q.T=r,re.p=f}}(Jr&3)!==0&&Lu(),br(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===Id?Vs++:(Vs=0,Id=t):Vs=0,Qs(0)}}function Av(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,js(r)))}function Lu(){return jv(),kv(),Tv(),zv()}function zv(){if(Vt!==5)return!1;var t=ki,r=Ud;Ud=0;var l=rf(Jr),o=q.T,f=re.p;try{re.p=32>l?32:l,q.T=null,l=Ld,Ld=null;var m=ki,b=Jr;if(Vt=0,Cl=ki=null,Jr=0,(et&6)!==0)throw Error(a(331));var E=et;if(et|=4,dv(m.current),uv(m,m.current,b,l),et=E,Qs(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(Ut,m)}catch{}return!0}finally{re.p=f,q.T=o,Av(t,r)}}function Ov(t,r,l){r=$n(l,r),r=gd(t.stateNode,r,2),t=Si(t,r,2),t!==null&&(hs(t,2),br(t))}function at(t,r,l){if(t.tag===3)Ov(t,t,l);else for(;r!==null;){if(r.tag===3){Ov(r,t,l);break}else if(r.tag===1){var o=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ji===null||!ji.has(o))){t=$n(l,t),l=Ry(2),o=Si(r,l,2),o!==null&&(My(l,o,r,t),hs(o,2),br(o));break}}r=r.return}}function Pd(t,r,l){var o=t.pingCache;if(o===null){o=t.pingCache=new kC;var f=new Set;o.set(r,f)}else f=o.get(r),f===void 0&&(f=new Set,o.set(r,f));f.has(l)||(Rd=!0,f.add(l),t=RC.bind(null,t,r,l),r.then(t,t))}function RC(t,r,l){var o=t.pingCache;o!==null&&o.delete(r),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,mt===t&&($e&l)===l&&(Tt===4||Tt===3&&($e&62914560)===$e&&300>$t()-zu?(et&2)===0&&Nl(t,0):Md|=l,El===$e&&(El=0)),br(t)}function Rv(t,r){r===0&&(r=jp()),t=ha(t,r),t!==null&&(hs(t,r),br(t))}function MC(t){var r=t.memoizedState,l=0;r!==null&&(l=r.retryLane),Rv(t,l)}function DC(t,r){var l=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(r),Rv(t,l)}function UC(t,r){return Mr(t,r)}var Iu=null,jl=null,Hd=!1,Bu=!1,Zd=!1,Ai=0;function br(t){t!==jl&&t.next===null&&(jl===null?Iu=jl=t:jl=jl.next=t),Bu=!0,Hd||(Hd=!0,IC())}function Qs(t,r){if(!Zd&&Bu){Zd=!0;do for(var l=!1,o=Iu;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var m=0;else{var b=o.suspendedLanes,E=o.pingedLanes;m=(1<<31-ht(42|t)+1)-1,m&=f&~(b&~E),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,Lv(o,m))}else m=$e,m=Zo(o,o===mt?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(m&3)===0||ds(o,m)||(l=!0,Lv(o,m));o=o.next}while(l);Zd=!1}}function LC(){Mv()}function Mv(){Bu=Hd=!1;var t=0;Ai!==0&&YC()&&(t=Ai);for(var r=$t(),l=null,o=Iu;o!==null;){var f=o.next,m=Dv(o,r);m===0?(o.next=null,l===null?Iu=f:l.next=f,f===null&&(jl=l)):(l=o,(t!==0||(m&3)!==0)&&(Bu=!0)),o=f}Vt!==0&&Vt!==5||Qs(t),Ai!==0&&(Ai=0)}function Dv(t,r){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var b=31-ht(m),E=1<<b,z=f[b];z===-1?((E&l)===0||(E&o)!==0)&&(f[b]=cE(E,r)):z<=r&&(t.expiredLanes|=E),m&=~E}if(r=mt,l=$e,l=Zo(t,t===r?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,l===0||t===r&&(it===2||it===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Dr(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||ds(t,l)){if(r=l&-l,r===t.callbackPriority)return r;switch(o!==null&&Dr(o),rf(l)){case 2:case 8:l=oe;break;case 32:l=Ne;break;case 268435456:l=Ge;break;default:l=Ne}return o=Uv.bind(null,t),l=Mr(l,o),t.callbackPriority=r,t.callbackNode=l,r}return o!==null&&o!==null&&Dr(o),t.callbackPriority=2,t.callbackNode=null,2}function Uv(t,r){if(Vt!==0&&Vt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Lu()&&t.callbackNode!==l)return null;var o=$e;return o=Zo(t,t===mt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(yv(t,o,r),Dv(t,$t()),t.callbackNode!=null&&t.callbackNode===l?Uv.bind(null,t):null)}function Lv(t,r){if(Lu())return null;yv(t,r,!0)}function IC(){KC(function(){(et&6)!==0?Mr(X,LC):Mv()})}function Fd(){if(Ai===0){var t=dl;t===0&&(t=qo,qo<<=1,(qo&261888)===0&&(qo=256)),Ai=t}return Ai}function Iv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Qo(""+t)}function Bv(t,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,t.id&&l.setAttribute("form",t.id),r.parentNode.insertBefore(l,r),t=new FormData(t),l.parentNode.removeChild(l),t}function BC(t,r,l,o,f){if(r==="submit"&&l&&l.stateNode===f){var m=Iv((f[vn]||null).action),b=o.submitter;b&&(r=(r=b[vn]||null)?Iv(r.formAction):b.getAttribute("formAction"),r!==null&&(m=r,b=null));var E=new Xo("action","action",null,o,f);t.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ai!==0){var z=b?Bv(f,b):new FormData(f);cd(l,{pending:!0,data:z,method:f.method,action:m},null,z)}}else typeof m=="function"&&(E.preventDefault(),z=b?Bv(f,b):new FormData(f),cd(l,{pending:!0,data:z,method:f.method,action:m},m,z))},currentTarget:f}]})}}for(var $d=0;$d<jf.length;$d++){var Vd=jf[$d],qC=Vd.toLowerCase(),PC=Vd[0].toUpperCase()+Vd.slice(1);sr(qC,"on"+PC)}sr(gg,"onAnimationEnd"),sr(yg,"onAnimationIteration"),sr(vg,"onAnimationStart"),sr("dblclick","onDoubleClick"),sr("focusin","onFocus"),sr("focusout","onBlur"),sr(rC,"onTransitionRun"),sr(iC,"onTransitionStart"),sr(aC,"onTransitionCancel"),sr(bg,"onTransitionEnd"),Ja("onMouseEnter",["mouseout","mouseover"]),Ja("onMouseLeave",["mouseout","mouseover"]),Ja("onPointerEnter",["pointerout","pointerover"]),Ja("onPointerLeave",["pointerout","pointerover"]),ua("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ua("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ua("onBeforeInput",["compositionend","keypress","textInput","paste"]),ua("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ua("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ua("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ys="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(" "),HC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ys));function qv(t,r){r=(r&4)!==0;for(var l=0;l<t.length;l++){var o=t[l],f=o.event;o=o.listeners;e:{var m=void 0;if(r)for(var b=o.length-1;0<=b;b--){var E=o[b],z=E.instance,F=E.currentTarget;if(E=E.listener,z!==m&&f.isPropagationStopped())break e;m=E,f.currentTarget=F;try{m(f)}catch(G){eu(G)}f.currentTarget=null,m=z}else for(b=0;b<o.length;b++){if(E=o[b],z=E.instance,F=E.currentTarget,E=E.listener,z!==m&&f.isPropagationStopped())break e;m=E,f.currentTarget=F;try{m(f)}catch(G){eu(G)}f.currentTarget=null,m=z}}}}function Fe(t,r){var l=r[af];l===void 0&&(l=r[af]=new Set);var o=t+"__bubble";l.has(o)||(Pv(r,t,2,!1),l.add(o))}function Qd(t,r,l){var o=0;r&&(o|=4),Pv(l,t,o,r)}var qu="_reactListening"+Math.random().toString(36).slice(2);function Yd(t){if(!t[qu]){t[qu]=!0,Mp.forEach(function(l){l!=="selectionchange"&&(HC.has(l)||Qd(l,!1,t),Qd(l,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[qu]||(r[qu]=!0,Qd("selectionchange",!1,r))}}function Pv(t,r,l,o){switch(gb(r)){case 2:var f=gN;break;case 8:f=yN;break;default:f=uh}l=f.bind(null,r,l,t),f=void 0,!mf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(r,l,{capture:!0,passive:f}):t.addEventListener(r,l,!0):f!==void 0?t.addEventListener(r,l,{passive:f}):t.addEventListener(r,l,!1)}function Gd(t,r,l,o,f){var m=o;if((r&1)===0&&(r&2)===0&&o!==null)e:for(;;){if(o===null)return;var b=o.tag;if(b===3||b===4){var E=o.stateNode.containerInfo;if(E===f)break;if(b===4)for(b=o.return;b!==null;){var z=b.tag;if((z===3||z===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;E!==null;){if(b=Ga(E),b===null)return;if(z=b.tag,z===5||z===6||z===26||z===27){o=m=b;continue e}E=E.parentNode}}o=o.return}Vp(function(){var F=m,G=df(l),te=[];e:{var $=xg.get(t);if($!==void 0){var Q=Xo,pe=t;switch(t){case"keypress":if(Go(l)===0)break e;case"keydown":case"keyup":Q=DE;break;case"focusin":pe="focus",Q=vf;break;case"focusout":pe="blur",Q=vf;break;case"beforeblur":case"afterblur":Q=vf;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Gp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=EE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=IE;break;case gg:case yg:case vg:Q=_E;break;case bg:Q=qE;break;case"scroll":case"scrollend":Q=SE;break;case"wheel":Q=HE;break;case"copy":case"cut":case"paste":Q=kE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Xp;break;case"toggle":case"beforetoggle":Q=FE}var _e=(r&4)!==0,ut=!_e&&(t==="scroll"||t==="scrollend"),I=_e?$!==null?$+"Capture":null:$;_e=[];for(var M=F,Z;M!==null;){var J=M;if(Z=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||Z===null||I===null||(J=gs(M,I),J!=null&&_e.push(Gs(M,J,Z))),ut)break;M=M.return}0<_e.length&&($=new Q($,pe,null,l,G),te.push({event:$,listeners:_e}))}}if((r&7)===0){e:{if($=t==="mouseover"||t==="pointerover",Q=t==="mouseout"||t==="pointerout",$&&l!==ff&&(pe=l.relatedTarget||l.fromElement)&&(Ga(pe)||pe[Ya]))break e;if((Q||$)&&($=G.window===G?G:($=G.ownerDocument)?$.defaultView||$.parentWindow:window,Q?(pe=l.relatedTarget||l.toElement,Q=F,pe=pe?Ga(pe):null,pe!==null&&(ut=u(pe),_e=pe.tag,pe!==ut||_e!==5&&_e!==27&&_e!==6)&&(pe=null)):(Q=null,pe=F),Q!==pe)){if(_e=Gp,J="onMouseLeave",I="onMouseEnter",M="mouse",(t==="pointerout"||t==="pointerover")&&(_e=Xp,J="onPointerLeave",I="onPointerEnter",M="pointer"),ut=Q==null?$:ps(Q),Z=pe==null?$:ps(pe),$=new _e(J,M+"leave",Q,l,G),$.target=ut,$.relatedTarget=Z,J=null,Ga(G)===F&&(_e=new _e(I,M+"enter",pe,l,G),_e.target=Z,_e.relatedTarget=ut,J=_e),ut=J,Q&&pe)t:{for(_e=ZC,I=Q,M=pe,Z=0,J=I;J;J=_e(J))Z++;J=0;for(var Ce=M;Ce;Ce=_e(Ce))J++;for(;0<Z-J;)I=_e(I),Z--;for(;0<J-Z;)M=_e(M),J--;for(;Z--;){if(I===M||M!==null&&I===M.alternate){_e=I;break t}I=_e(I),M=_e(M)}_e=null}else _e=null;Q!==null&&Hv(te,$,Q,_e,!1),pe!==null&&ut!==null&&Hv(te,ut,pe,_e,!0)}}e:{if($=F?ps(F):window,Q=$.nodeName&&$.nodeName.toLowerCase(),Q==="select"||Q==="input"&&$.type==="file")var Xe=ag;else if(rg($))if(lg)Xe=eC;else{Xe=JE;var be=XE}else Q=$.nodeName,!Q||Q.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?F&&cf(F.elementType)&&(Xe=ag):Xe=WE;if(Xe&&(Xe=Xe(t,F))){ig(te,Xe,l,G);break e}be&&be(t,$,F),t==="focusout"&&F&&$.type==="number"&&F.memoizedProps.value!=null&&uf($,"number",$.value)}switch(be=F?ps(F):window,t){case"focusin":(rg(be)||be.contentEditable==="true")&&(il=be,Cf=F,Cs=null);break;case"focusout":Cs=Cf=il=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,mg(te,l,G);break;case"selectionchange":if(nC)break;case"keydown":case"keyup":mg(te,l,G)}var Le;if(xf)e:{switch(t){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else rl?tg(t,l)&&(Ve="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ve="onCompositionStart");Ve&&(Jp&&l.locale!=="ko"&&(rl||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&rl&&(Le=Qp()):(mi=G,pf="value"in mi?mi.value:mi.textContent,rl=!0)),be=Pu(F,Ve),0<be.length&&(Ve=new Kp(Ve,t,null,l,G),te.push({event:Ve,listeners:be}),Le?Ve.data=Le:(Le=ng(l),Le!==null&&(Ve.data=Le)))),(Le=VE?QE(t,l):YE(t,l))&&(Ve=Pu(F,"onBeforeInput"),0<Ve.length&&(be=new Kp("onBeforeInput","beforeinput",null,l,G),te.push({event:be,listeners:Ve}),be.data=Le)),BC(te,t,F,l,G)}qv(te,r)})}function Gs(t,r,l){return{instance:t,listener:r,currentTarget:l}}function Pu(t,r){for(var l=r+"Capture",o=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=gs(t,l),f!=null&&o.unshift(Gs(t,f,m)),f=gs(t,r),f!=null&&o.push(Gs(t,f,m))),t.tag===3)return o;t=t.return}return[]}function ZC(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Hv(t,r,l,o,f){for(var m=r._reactName,b=[];l!==null&&l!==o;){var E=l,z=E.alternate,F=E.stateNode;if(E=E.tag,z!==null&&z===o)break;E!==5&&E!==26&&E!==27||F===null||(z=F,f?(F=gs(l,m),F!=null&&b.unshift(Gs(l,F,z))):f||(F=gs(l,m),F!=null&&b.push(Gs(l,F,z)))),l=l.return}b.length!==0&&t.push({event:r,listeners:b})}var FC=/\r\n?/g,$C=/\u0000|\uFFFD/g;function Zv(t){return(typeof t=="string"?t:""+t).replace(FC,`
49
- `).replace($C,"")}function Fv(t,r){return r=Zv(r),Zv(t)===r}function ot(t,r,l,o,f,m){switch(l){case"children":typeof o=="string"?r==="body"||r==="textarea"&&o===""||el(t,o):(typeof o=="number"||typeof o=="bigint")&&r!=="body"&&el(t,""+o);break;case"className":$o(t,"class",o);break;case"tabIndex":$o(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":$o(t,l,o);break;case"style":Fp(t,o,m);break;case"data":if(r!=="object"){$o(t,"data",o);break}case"src":case"href":if(o===""&&(r!=="a"||l!=="href")){t.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=Qo(""+o),t.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(l,"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 m=="function"&&(l==="formAction"?(r!=="input"&&ot(t,r,"name",f.name,f,null),ot(t,r,"formEncType",f.formEncType,f,null),ot(t,r,"formMethod",f.formMethod,f,null),ot(t,r,"formTarget",f.formTarget,f,null)):(ot(t,r,"encType",f.encType,f,null),ot(t,r,"method",f.method,f,null),ot(t,r,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=Qo(""+o),t.setAttribute(l,o);break;case"onClick":o!=null&&(t.onclick=Lr);break;case"onScroll":o!=null&&Fe("scroll",t);break;case"onScrollEnd":o!=null&&Fe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}l=Qo(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""+o):t.removeAttribute(l);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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":o===!0?t.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,o):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(l,o):t.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(l):t.setAttribute(l,o);break;case"popover":Fe("beforetoggle",t),Fe("toggle",t),Fo(t,"popover",o);break;case"xlinkActuate":Ur(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Ur(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Ur(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Ur(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Ur(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Ur(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Ur(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Ur(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Ur(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Fo(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=bE.get(l)||l,Fo(t,l,o))}}function Kd(t,r,l,o,f,m){switch(l){case"style":Fp(t,o,m);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof o=="string"?el(t,o):(typeof o=="number"||typeof o=="bigint")&&el(t,""+o);break;case"onScroll":o!=null&&Fe("scroll",t);break;case"onScrollEnd":o!=null&&Fe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Lr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dp.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),r=l.slice(2,f?l.length-7:void 0),m=t[vn]||null,m=m!=null?m[l]:null,typeof m=="function"&&t.removeEventListener(r,m,f),typeof o=="function")){typeof m!="function"&&m!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(r,o,f);break e}l in t?t[l]=o:o===!0?t.setAttribute(l,""):Fo(t,l,o)}}}function on(t,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",t),Fe("load",t);var o=!1,f=!1,m;for(m in l)if(l.hasOwnProperty(m)){var b=l[m];if(b!=null)switch(m){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:ot(t,r,m,b,l,null)}}f&&ot(t,r,"srcSet",l.srcSet,l,null),o&&ot(t,r,"src",l.src,l,null);return;case"input":Fe("invalid",t);var E=m=b=f=null,z=null,F=null;for(o in l)if(l.hasOwnProperty(o)){var G=l[o];if(G!=null)switch(o){case"name":f=G;break;case"type":b=G;break;case"checked":z=G;break;case"defaultChecked":F=G;break;case"value":m=G;break;case"defaultValue":E=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(a(137,r));break;default:ot(t,r,o,G,l,null)}}qp(t,m,E,z,F,b,f,!1);return;case"select":Fe("invalid",t),o=b=m=null;for(f in l)if(l.hasOwnProperty(f)&&(E=l[f],E!=null))switch(f){case"value":m=E;break;case"defaultValue":b=E;break;case"multiple":o=E;default:ot(t,r,f,E,l,null)}r=m,l=b,t.multiple=!!o,r!=null?Wa(t,!!o,r,!1):l!=null&&Wa(t,!!o,l,!0);return;case"textarea":Fe("invalid",t),m=f=o=null;for(b in l)if(l.hasOwnProperty(b)&&(E=l[b],E!=null))switch(b){case"value":o=E;break;case"defaultValue":f=E;break;case"children":m=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(a(91));break;default:ot(t,r,b,E,l,null)}Hp(t,o,f,m);return;case"option":for(z in l)if(l.hasOwnProperty(z)&&(o=l[z],o!=null))switch(z){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ot(t,r,z,o,l,null)}return;case"dialog":Fe("beforetoggle",t),Fe("toggle",t),Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":Fe("load",t);break;case"video":case"audio":for(o=0;o<Ys.length;o++)Fe(Ys[o],t);break;case"image":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"embed":case"source":case"link":Fe("error",t),Fe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(o=l[F],o!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:ot(t,r,F,o,l,null)}return;default:if(cf(r)){for(G in l)l.hasOwnProperty(G)&&(o=l[G],o!==void 0&&Kd(t,r,G,o,l,void 0));return}}for(E in l)l.hasOwnProperty(E)&&(o=l[E],o!=null&&ot(t,r,E,o,l,null))}function VC(t,r,l,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,E=null,z=null,F=null,G=null;for(Q in l){var te=l[Q];if(l.hasOwnProperty(Q)&&te!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":z=te;default:o.hasOwnProperty(Q)||ot(t,r,Q,null,o,te)}}for(var $ in o){var Q=o[$];if(te=l[$],o.hasOwnProperty($)&&(Q!=null||te!=null))switch($){case"type":m=Q;break;case"name":f=Q;break;case"checked":F=Q;break;case"defaultChecked":G=Q;break;case"value":b=Q;break;case"defaultValue":E=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,r));break;default:Q!==te&&ot(t,r,$,Q,o,te)}}of(t,b,E,z,F,G,m,f);return;case"select":Q=b=E=$=null;for(m in l)if(z=l[m],l.hasOwnProperty(m)&&z!=null)switch(m){case"value":break;case"multiple":Q=z;default:o.hasOwnProperty(m)||ot(t,r,m,null,o,z)}for(f in o)if(m=o[f],z=l[f],o.hasOwnProperty(f)&&(m!=null||z!=null))switch(f){case"value":$=m;break;case"defaultValue":E=m;break;case"multiple":b=m;default:m!==z&&ot(t,r,f,m,o,z)}r=E,l=b,o=Q,$!=null?Wa(t,!!l,$,!1):!!o!=!!l&&(r!=null?Wa(t,!!l,r,!0):Wa(t,!!l,l?[]:"",!1));return;case"textarea":Q=$=null;for(E in l)if(f=l[E],l.hasOwnProperty(E)&&f!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:ot(t,r,E,null,o,f)}for(b in o)if(f=o[b],m=l[b],o.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":$=f;break;case"defaultValue":Q=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==m&&ot(t,r,b,f,o,m)}Pp(t,$,Q);return;case"option":for(var pe in l)if($=l[pe],l.hasOwnProperty(pe)&&$!=null&&!o.hasOwnProperty(pe))switch(pe){case"selected":t.selected=!1;break;default:ot(t,r,pe,null,o,$)}for(z in o)if($=o[z],Q=l[z],o.hasOwnProperty(z)&&$!==Q&&($!=null||Q!=null))switch(z){case"selected":t.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:ot(t,r,z,$,o,Q)}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 _e in l)$=l[_e],l.hasOwnProperty(_e)&&$!=null&&!o.hasOwnProperty(_e)&&ot(t,r,_e,null,o,$);for(F in o)if($=o[F],Q=l[F],o.hasOwnProperty(F)&&$!==Q&&($!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(a(137,r));break;default:ot(t,r,F,$,o,Q)}return;default:if(cf(r)){for(var ut in l)$=l[ut],l.hasOwnProperty(ut)&&$!==void 0&&!o.hasOwnProperty(ut)&&Kd(t,r,ut,void 0,o,$);for(G in o)$=o[G],Q=l[G],!o.hasOwnProperty(G)||$===Q||$===void 0&&Q===void 0||Kd(t,r,G,$,o,Q);return}}for(var I in l)$=l[I],l.hasOwnProperty(I)&&$!=null&&!o.hasOwnProperty(I)&&ot(t,r,I,null,o,$);for(te in o)$=o[te],Q=l[te],!o.hasOwnProperty(te)||$===Q||$==null&&Q==null||ot(t,r,te,$,o,Q)}function $v(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function QC(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],m=f.transferSize,b=f.initiatorType,E=f.duration;if(m&&E&&$v(b)){for(b=0,E=f.responseEnd,o+=1;o<l.length;o++){var z=l[o],F=z.startTime;if(F>E)break;var G=z.transferSize,te=z.initiatorType;G&&$v(te)&&(z=z.responseEnd,b+=G*(z<E?1:(E-F)/(z-F)))}if(--o,r+=8*(m+b)/(f.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Xd=null,Jd=null;function Hu(t){return t.nodeType===9?t:t.ownerDocument}function Vv(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qv(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Wd(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var eh=null;function YC(){var t=window.event;return t&&t.type==="popstate"?t===eh?!1:(eh=t,!0):(eh=null,!1)}var Yv=typeof setTimeout=="function"?setTimeout:void 0,GC=typeof clearTimeout=="function"?clearTimeout:void 0,Gv=typeof Promise=="function"?Promise:void 0,KC=typeof queueMicrotask=="function"?queueMicrotask:typeof Gv<"u"?function(t){return Gv.resolve(null).then(t).catch(XC)}:Yv;function XC(t){setTimeout(function(){throw t})}function zi(t){return t==="head"}function Kv(t,r){var l=r,o=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){t.removeChild(f),zl(r);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")Ks(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Ks(l);for(var m=l.firstChild;m;){var b=m.nextSibling,E=m.nodeName;m[ms]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=b}}else l==="body"&&Ks(t.ownerDocument.body);l=f}while(l);zl(r)}function Xv(t,r){var l=t;t=0;do{var o=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=o}while(l)}function th(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":th(l),lf(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function JC(t,r,l,o){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[ms])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Kn(t.nextSibling),t===null)break}return null}function WC(t,r,l){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Kn(t.nextSibling),t===null))return null;return t}function Jv(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Kn(t.nextSibling),t===null))return null;return t}function nh(t){return t.data==="$?"||t.data==="$~"}function rh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function eN(t,r){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||l.readyState!=="loading")r();else{var o=function(){r(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function Kn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var ih=null;function Wv(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(r===0)return Kn(t.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}t=t.nextSibling}return null}function eb(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return t;r--}else l!=="/$"&&l!=="/&"||r++}t=t.previousSibling}return null}function tb(t,r,l){switch(r=Hu(l),t){case"html":if(t=r.documentElement,!t)throw Error(a(452));return t;case"head":if(t=r.head,!t)throw Error(a(453));return t;case"body":if(t=r.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function Ks(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);lf(t)}var Xn=new Map,nb=new Set;function Zu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Wr=re.d;re.d={f:tN,r:nN,D:rN,C:iN,L:aN,m:lN,X:oN,S:sN,M:uN};function tN(){var t=Wr.f(),r=Mu();return t||r}function nN(t){var r=Ka(t);r!==null&&r.tag===5&&r.type==="form"?by(r):Wr.r(t)}var kl=typeof document>"u"?null:document;function rb(t,r,l){var o=kl;if(o&&typeof r=="string"&&r){var f=Zn(r);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),nb.has(f)||(nb.add(f),t={rel:t,crossOrigin:l,href:r},o.querySelector(f)===null&&(r=o.createElement("link"),on(r,"link",t),Xt(r),o.head.appendChild(r)))}}function rN(t){Wr.D(t),rb("dns-prefetch",t,null)}function iN(t,r){Wr.C(t,r),rb("preconnect",t,r)}function aN(t,r,l){Wr.L(t,r,l);var o=kl;if(o&&t&&r){var f='link[rel="preload"][as="'+Zn(r)+'"]';r==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Zn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Zn(l.imageSizes)+'"]')):f+='[href="'+Zn(t)+'"]';var m=f;switch(r){case"style":m=Tl(t);break;case"script":m=Al(t)}Xn.has(m)||(t=v({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:t,as:r},l),Xn.set(m,t),o.querySelector(f)!==null||r==="style"&&o.querySelector(Xs(m))||r==="script"&&o.querySelector(Js(m))||(r=o.createElement("link"),on(r,"link",t),Xt(r),o.head.appendChild(r)))}}function lN(t,r){Wr.m(t,r);var l=kl;if(l&&t){var o=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+Zn(o)+'"][href="'+Zn(t)+'"]',m=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Al(t)}if(!Xn.has(m)&&(t=v({rel:"modulepreload",href:t},r),Xn.set(m,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Js(m)))return}o=l.createElement("link"),on(o,"link",t),Xt(o),l.head.appendChild(o)}}}function sN(t,r,l){Wr.S(t,r,l);var o=kl;if(o&&t){var f=Xa(o).hoistableStyles,m=Tl(t);r=r||"default";var b=f.get(m);if(!b){var E={loading:0,preload:null};if(b=o.querySelector(Xs(m)))E.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":r},l),(l=Xn.get(m))&&ah(t,l);var z=b=o.createElement("link");Xt(z),on(z,"link",t),z._p=new Promise(function(F,G){z.onload=F,z.onerror=G}),z.addEventListener("load",function(){E.loading|=1}),z.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Fu(b,r,o)}b={type:"stylesheet",instance:b,count:1,state:E},f.set(m,b)}}}function oN(t,r){Wr.X(t,r);var l=kl;if(l&&t){var o=Xa(l).hoistableScripts,f=Al(t),m=o.get(f);m||(m=l.querySelector(Js(f)),m||(t=v({src:t,async:!0},r),(r=Xn.get(f))&&lh(t,r),m=l.createElement("script"),Xt(m),on(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(f,m))}}function uN(t,r){Wr.M(t,r);var l=kl;if(l&&t){var o=Xa(l).hoistableScripts,f=Al(t),m=o.get(f);m||(m=l.querySelector(Js(f)),m||(t=v({src:t,async:!0,type:"module"},r),(r=Xn.get(f))&&lh(t,r),m=l.createElement("script"),Xt(m),on(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(f,m))}}function ib(t,r,l,o){var f=(f=ce.current)?Zu(f):null;if(!f)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=Tl(l.href),l=Xa(f).hoistableStyles,o=l.get(r),o||(o={type:"style",instance:null,count:0,state:null},l.set(r,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Tl(l.href);var m=Xa(f).hoistableStyles,b=m.get(t);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,b),(m=f.querySelector(Xs(t)))&&!m._p&&(b.instance=m,b.state.loading=5),Xn.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Xn.set(t,l),m||cN(f,t,l,b.state))),r&&o===null)throw Error(a(528,""));return b}if(r&&o!==null)throw Error(a(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Al(l),l=Xa(f).hoistableScripts,o=l.get(r),o||(o={type:"script",instance:null,count:0,state:null},l.set(r,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Tl(t){return'href="'+Zn(t)+'"'}function Xs(t){return'link[rel="stylesheet"]['+t+"]"}function ab(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function cN(t,r,l,o){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?o.loading=1:(r=t.createElement("link"),o.preload=r,r.addEventListener("load",function(){return o.loading|=1}),r.addEventListener("error",function(){return o.loading|=2}),on(r,"link",l),Xt(r),t.head.appendChild(r))}function Al(t){return'[src="'+Zn(t)+'"]'}function Js(t){return"script[async]"+t}function lb(t,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var o=t.querySelector('style[data-href~="'+Zn(l.href)+'"]');if(o)return r.instance=o,Xt(o),o;var f=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Xt(o),on(o,"style",f),Fu(o,l.precedence,t),r.instance=o;case"stylesheet":f=Tl(l.href);var m=t.querySelector(Xs(f));if(m)return r.state.loading|=4,r.instance=m,Xt(m),m;o=ab(l),(f=Xn.get(f))&&ah(o,f),m=(t.ownerDocument||t).createElement("link"),Xt(m);var b=m;return b._p=new Promise(function(E,z){b.onload=E,b.onerror=z}),on(m,"link",o),r.state.loading|=4,Fu(m,l.precedence,t),r.instance=m;case"script":return m=Al(l.src),(f=t.querySelector(Js(m)))?(r.instance=f,Xt(f),f):(o=l,(f=Xn.get(m))&&(o=v({},l),lh(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Xt(f),on(f,"link",o),t.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(o=r.instance,r.state.loading|=4,Fu(o,l.precedence,t));return r.instance}function Fu(t,r,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,m=f,b=0;b<o.length;b++){var E=o[b];if(E.dataset.precedence===r)m=E;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(t,r.firstChild))}function ah(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function lh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var $u=null;function sb(t,r,l){if($u===null){var o=new Map,f=$u=new Map;f.set(l,o)}else f=$u,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(t))return o;for(o.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var m=l[f];if(!(m[ms]||m[rn]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(r)||"";b=t+b;var E=o.get(b);E?E.push(m):o.set(b,[m])}}return o}function ob(t,r,l){t=t.ownerDocument||t,t.head.insertBefore(l,r==="title"?t.querySelector("head > title"):null)}function fN(t,r,l){if(l===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ub(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function dN(t,r,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=Tl(o.href),m=r.querySelector(Xs(f));if(m){r=m._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Vu.bind(t),r.then(t,t)),l.state.loading|=4,l.instance=m,Xt(m);return}m=r.ownerDocument||r,o=ab(o),(f=Xn.get(f))&&ah(o,f),m=m.createElement("link"),Xt(m);var b=m;b._p=new Promise(function(E,z){b.onload=E,b.onerror=z}),on(m,"link",o),l.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Vu.bind(t),r.addEventListener("load",l),r.addEventListener("error",l))}}var sh=0;function hN(t,r){return t.stylesheets&&t.count===0&&Yu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&Yu(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+r);0<t.imgBytes&&sh===0&&(sh=62500*QC());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Yu(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>sh?50:800)+r);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Vu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Qu=null;function Yu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Qu=new Map,r.forEach(mN,t),Qu=null,Vu.call(t))}function mN(t,r){if(!(r.state.loading&4)){var l=Qu.get(t);if(l)var o=l.get(null);else{l=new Map,Qu.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),o=b)}o&&l.set(null,o)}f=r.instance,b=f.getAttribute("data-precedence"),m=l.get(b)||o,m===o&&l.set(null,f),l.set(b,f),this.count++,o=Vu.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),r.state.loading|=4}}var Ws={$$typeof:U,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function pN(t,r,l,o,f,m,b,E,z){this.tag=1,this.containerInfo=t,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=tf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tf(0),this.hiddenUpdates=tf(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function cb(t,r,l,o,f,m,b,E,z,F,G,te){return t=new pN(t,r,l,b,z,F,G,te,E),r=1,m===!0&&(r|=24),m=On(3,null,null,r),t.current=m,m.stateNode=t,r=qf(),r.refCount++,t.pooledCache=r,r.refCount++,m.memoizedState={element:o,isDehydrated:l,cache:r},Ff(m),t}function fb(t){return t?(t=sl,t):sl}function db(t,r,l,o,f,m){f=fb(f),o.context===null?o.context=f:o.pendingContext=f,o=xi(r),o.payload={element:l},m=m===void 0?null:m,m!==null&&(o.callback=m),l=Si(t,o,r),l!==null&&(Cn(l,t,r),zs(l,t,r))}function hb(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<r?l:r}}function oh(t,r){hb(t,r),(t=t.alternate)&&hb(t,r)}function mb(t){if(t.tag===13||t.tag===31){var r=ha(t,67108864);r!==null&&Cn(r,t,67108864),oh(t,67108864)}}function pb(t){if(t.tag===13||t.tag===31){var r=Ln();r=nf(r);var l=ha(t,r);l!==null&&Cn(l,t,r),oh(t,r)}}var Gu=!0;function gN(t,r,l,o){var f=q.T;q.T=null;var m=re.p;try{re.p=2,uh(t,r,l,o)}finally{re.p=m,q.T=f}}function yN(t,r,l,o){var f=q.T;q.T=null;var m=re.p;try{re.p=8,uh(t,r,l,o)}finally{re.p=m,q.T=f}}function uh(t,r,l,o){if(Gu){var f=ch(o);if(f===null)Gd(t,r,o,Ku,l),yb(t,o);else if(bN(f,t,r,l,o))o.stopPropagation();else if(yb(t,o),r&4&&-1<vN.indexOf(t)){for(;f!==null;){var m=Ka(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=oa(m.pendingLanes);if(b!==0){var E=m;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var z=1<<31-ht(b);E.entanglements[1]|=z,b&=~z}br(m),(et&6)===0&&(Ou=$t()+500,Qs(0))}}break;case 31:case 13:E=ha(m,2),E!==null&&Cn(E,m,2),Mu(),oh(m,2)}if(m=ch(o),m===null&&Gd(t,r,o,Ku,l),m===f)break;f=m}f!==null&&o.stopPropagation()}else Gd(t,r,o,null,l)}}function ch(t){return t=df(t),fh(t)}var Ku=null;function fh(t){if(Ku=null,t=Ga(t),t!==null){var r=u(t);if(r===null)t=null;else{var l=r.tag;if(l===13){if(t=c(r),t!==null)return t;t=null}else if(l===31){if(t=d(r),t!==null)return t;t=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Ku=t,null}function gb(t){switch(t){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(hn()){case X:return 2;case oe:return 8;case Ne:case Pe:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var dh=!1,Oi=null,Ri=null,Mi=null,eo=new Map,to=new Map,Di=[],vN="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 yb(t,r){switch(t){case"focusin":case"focusout":Oi=null;break;case"dragenter":case"dragleave":Ri=null;break;case"mouseover":case"mouseout":Mi=null;break;case"pointerover":case"pointerout":eo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":to.delete(r.pointerId)}}function no(t,r,l,o,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:r,domEventName:l,eventSystemFlags:o,nativeEvent:m,targetContainers:[f]},r!==null&&(r=Ka(r),r!==null&&mb(r)),t):(t.eventSystemFlags|=o,r=t.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),t)}function bN(t,r,l,o,f){switch(r){case"focusin":return Oi=no(Oi,t,r,l,o,f),!0;case"dragenter":return Ri=no(Ri,t,r,l,o,f),!0;case"mouseover":return Mi=no(Mi,t,r,l,o,f),!0;case"pointerover":var m=f.pointerId;return eo.set(m,no(eo.get(m)||null,t,r,l,o,f)),!0;case"gotpointercapture":return m=f.pointerId,to.set(m,no(to.get(m)||null,t,r,l,o,f)),!0}return!1}function vb(t){var r=Ga(t.target);if(r!==null){var l=u(r);if(l!==null){if(r=l.tag,r===13){if(r=c(l),r!==null){t.blockedOn=r,Op(t.priority,function(){pb(l)});return}}else if(r===31){if(r=d(l),r!==null){t.blockedOn=r,Op(t.priority,function(){pb(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var l=ch(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);ff=o,l.target.dispatchEvent(o),ff=null}else return r=Ka(l),r!==null&&mb(r),t.blockedOn=l,!1;r.shift()}return!0}function bb(t,r,l){Xu(t)&&l.delete(r)}function xN(){dh=!1,Oi!==null&&Xu(Oi)&&(Oi=null),Ri!==null&&Xu(Ri)&&(Ri=null),Mi!==null&&Xu(Mi)&&(Mi=null),eo.forEach(bb),to.forEach(bb)}function Ju(t,r){t.blockedOn===r&&(t.blockedOn=null,dh||(dh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,xN)))}var Wu=null;function xb(t){Wu!==t&&(Wu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wu===t&&(Wu=null);for(var r=0;r<t.length;r+=3){var l=t[r],o=t[r+1],f=t[r+2];if(typeof o!="function"){if(fh(o||l)===null)continue;break}var m=Ka(l);m!==null&&(t.splice(r,3),r-=3,cd(m,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function zl(t){function r(z){return Ju(z,t)}Oi!==null&&Ju(Oi,t),Ri!==null&&Ju(Ri,t),Mi!==null&&Ju(Mi,t),eo.forEach(r),to.forEach(r);for(var l=0;l<Di.length;l++){var o=Di[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Di.length&&(l=Di[0],l.blockedOn===null);)vb(l),l.blockedOn===null&&Di.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],m=l[o+1],b=f[vn]||null;if(typeof m=="function")b||xb(l);else if(b){var E=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[vn]||null)E=b.formAction;else if(fh(f)!==null)continue}else E=b.action;typeof E=="function"?l[o+1]=E:(l.splice(o,3),o-=3),xb(l)}}}function Sb(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function r(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),f!==null&&(f(),f=null)}}}function hh(t){this._internalRoot=t}ec.prototype.render=hh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,o=Ln();db(l,o,t,r,null,null)},ec.prototype.unmount=hh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;db(t.current,2,null,t,null,null),Mu(),r[Ya]=null}};function ec(t){this._internalRoot=t}ec.prototype.unstable_scheduleHydration=function(t){if(t){var r=zp();t={blockedOn:null,target:t,priority:r};for(var l=0;l<Di.length&&r!==0&&r<Di[l].priority;l++);Di.splice(l,0,t),l===0&&vb(t)}};var wb=n.version;if(wb!=="19.2.4")throw Error(a(527,wb,"19.2.4"));re.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=p(r),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var SN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tc.isDisabled&&tc.supportsFiber)try{Ut=tc.inject(SN),xt=tc}catch{}}return io.createRoot=function(t,r){if(!s(t))throw Error(a(299));var l=!1,o="",f=Ty,m=Ay,b=zy;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(b=r.onRecoverableError)),r=cb(t,1,!1,null,null,l,o,null,f,m,b,Sb),t[Ya]=r.current,Yd(t),new hh(r)},io.hydrateRoot=function(t,r,l){if(!s(t))throw Error(a(299));var o=!1,f="",m=Ty,b=Ay,E=zy,z=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(E=l.onRecoverableError),l.formState!==void 0&&(z=l.formState)),r=cb(t,1,!0,r,l??null,o,f,z,m,b,E,Sb),r.context=fb(null),l=r.current,o=Ln(),o=nf(o),f=xi(o),f.callback=null,Si(l,f,o),l=o,r.current.lanes=l,hs(r,l),br(r),t[Ya]=r.current,Yd(t),new ec(r)},io.version="19.2.4",io}var Rb;function ON(){if(Rb)return yh.exports;Rb=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(n){console.error(n)}}return e(),yh.exports=zN(),yh.exports}var RN=ON(),is=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(){}},ka,Zi,$l,M0,MN=(M0=class extends is{constructor(){super();we(this,ka);we(this,Zi);we(this,$l);de(this,$l,n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){O(this,Zi)||this.setEventListener(O(this,$l))}onUnsubscribe(){var n;this.hasListeners()||((n=O(this,Zi))==null||n.call(this),de(this,Zi,void 0))}setEventListener(n){var i;de(this,$l,n),(i=O(this,Zi))==null||i.call(this),de(this,Zi,n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(n){O(this,ka)!==n&&(de(this,ka,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(i=>{i(n)})}isFocused(){var n;return typeof O(this,ka)=="boolean"?O(this,ka):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ka=new WeakMap,Zi=new WeakMap,$l=new WeakMap,M0),Mm=new MN,DN={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},Fi,zm,D0,UN=(D0=class{constructor(){we(this,Fi,DN);we(this,zm,!1)}setTimeoutProvider(e){de(this,Fi,e)}setTimeout(e,n){return O(this,Fi).setTimeout(e,n)}clearTimeout(e){O(this,Fi).clearTimeout(e)}setInterval(e,n){return O(this,Fi).setInterval(e,n)}clearInterval(e){O(this,Fi).clearInterval(e)}},Fi=new WeakMap,zm=new WeakMap,D0),ja=new UN;function LN(e){setTimeout(e,0)}var IN=typeof window>"u"||"Deno"in globalThis;function yn(){}function BN(e,n){return typeof e=="function"?e(n):e}function Kh(e){return typeof e=="number"&&e>=0&&e!==1/0}function V0(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Wi(e,n){return typeof e=="function"?e(n):e}function Wn(e,n){return typeof e=="function"?e(n):e}function Mb(e,n){const{type:i="all",exact:a,fetchStatus:s,predicate:u,queryKey:c,stale:d}=e;if(c){if(a){if(n.queryHash!==Dm(c,n.options))return!1}else if(!bo(n.queryKey,c))return!1}if(i!=="all"){const g=n.isActive();if(i==="active"&&!g||i==="inactive"&&g)return!1}return!(typeof d=="boolean"&&n.isStale()!==d||s&&s!==n.state.fetchStatus||u&&!u(n))}function Db(e,n){const{exact:i,status:a,predicate:s,mutationKey:u}=e;if(u){if(!n.options.mutationKey)return!1;if(i){if(Ba(n.options.mutationKey)!==Ba(u))return!1}else if(!bo(n.options.mutationKey,u))return!1}return!(a&&n.state.status!==a||s&&!s(n))}function Dm(e,n){return((n==null?void 0:n.queryKeyHashFn)||Ba)(e)}function Ba(e){return JSON.stringify(e,(n,i)=>Xh(i)?Object.keys(i).sort().reduce((a,s)=>(a[s]=i[s],a),{}):i)}function bo(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(i=>bo(e[i],n[i])):!1}var qN=Object.prototype.hasOwnProperty;function Q0(e,n,i=0){if(e===n)return e;if(i>500)return n;const a=Ub(e)&&Ub(n);if(!a&&!(Xh(e)&&Xh(n)))return n;const u=(a?e:Object.keys(e)).length,c=a?n:Object.keys(n),d=c.length,g=a?new Array(d):{};let p=0;for(let y=0;y<d;y++){const v=a?y:c[y],x=e[v],S=n[v];if(x===S){g[v]=x,(a?y<u:qN.call(e,v))&&p++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){g[v]=S;continue}const j=Q0(x,S,i+1);g[v]=j,j===x&&p++}return u===d&&p===u?e:g}function Nc(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const i in e)if(e[i]!==n[i])return!1;return!0}function Ub(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xh(e){if(!Lb(e))return!1;const n=e.constructor;if(n===void 0)return!0;const i=n.prototype;return!(!Lb(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Lb(e){return Object.prototype.toString.call(e)==="[object Object]"}function PN(e){return new Promise(n=>{ja.setTimeout(n,e)})}function Jh(e,n,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,n):i.structuralSharing!==!1?Q0(e,n):n}function HN(e,n,i=0){const a=[...e,n];return i&&a.length>i?a.slice(1):a}function ZN(e,n,i=0){const a=[n,...e];return i&&a.length>i?a.slice(0,-1):a}var Um=Symbol();function Y0(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===Um?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Lm(e,n){return typeof e=="function"?e(...n):!!e}function FN(e,n,i){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),a||(a=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var xo=(()=>{let e=()=>IN;return{isServer(){return e()},setIsServer(n){e=n}}})();function Wh(){let e,n;const i=new Promise((s,u)=>{e=s,n=u});i.status="pending",i.catch(()=>{});function a(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},i.reject=s=>{a({status:"rejected",reason:s}),n(s)},i}var $N=LN;function VN(){let e=[],n=0,i=d=>{d()},a=d=>{d()},s=$N;const u=d=>{n?e.push(d):s(()=>{i(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{a(()=>{d.forEach(g=>{i(g)})})})};return{batch:d=>{let g;n++;try{g=d()}finally{n--,n||c()}return g},batchCalls:d=>(...g)=>{u(()=>{d(...g)})},schedule:u,setNotifyFunction:d=>{i=d},setBatchNotifyFunction:d=>{a=d},setScheduler:d=>{s=d}}}var Yt=VN(),Vl,$i,Ql,U0,QN=(U0=class extends is{constructor(){super();we(this,Vl,!0);we(this,$i);we(this,Ql);de(this,Ql,n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",a)}}})}onSubscribe(){O(this,$i)||this.setEventListener(O(this,Ql))}onUnsubscribe(){var n;this.hasListeners()||((n=O(this,$i))==null||n.call(this),de(this,$i,void 0))}setEventListener(n){var i;de(this,Ql,n),(i=O(this,$i))==null||i.call(this),de(this,$i,n(this.setOnline.bind(this)))}setOnline(n){O(this,Vl)!==n&&(de(this,Vl,n),this.listeners.forEach(a=>{a(n)}))}isOnline(){return O(this,Vl)}},Vl=new WeakMap,$i=new WeakMap,Ql=new WeakMap,U0),_c=new QN;function YN(e){return Math.min(1e3*2**e,3e4)}function G0(e){return(e??"online")==="online"?_c.isOnline():!0}var em=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function K0(e){let n=!1,i=0,a;const s=Wh(),u=()=>s.status!=="pending",c=C=>{var T;if(!u()){const k=new em(C);x(k),(T=e.onCancel)==null||T.call(e,k)}},d=()=>{n=!0},g=()=>{n=!1},p=()=>Mm.isFocused()&&(e.networkMode==="always"||_c.isOnline())&&e.canRun(),y=()=>G0(e.networkMode)&&e.canRun(),v=C=>{u()||(a==null||a(),s.resolve(C))},x=C=>{u()||(a==null||a(),s.reject(C))},S=()=>new Promise(C=>{var T;a=k=>{(u()||p())&&C(k)},(T=e.onPause)==null||T.call(e)}).then(()=>{var C;a=void 0,u()||(C=e.onContinue)==null||C.call(e)}),j=()=>{if(u())return;let C;const T=i===0?e.initialPromise:void 0;try{C=T??e.fn()}catch(k){C=Promise.reject(k)}Promise.resolve(C).then(v).catch(k=>{var L;if(u())return;const P=e.retry??(xo.isServer()?0:3),U=e.retryDelay??YN,H=typeof U=="function"?U(i,k):U,K=P===!0||typeof P=="number"&&i<P||typeof P=="function"&&P(i,k);if(n||!K){x(k);return}i++,(L=e.onFail)==null||L.call(e,i,k),PN(H).then(()=>p()?void 0:S()).then(()=>{n?x(k):j()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(a==null||a(),s),cancelRetry:d,continueRetry:g,canStart:y,start:()=>(y()?j():S().then(j),s)}}var Ta,L0,X0=(L0=class{constructor(){we(this,Ta)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kh(this.gcTime)&&de(this,Ta,ja.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xo.isServer()?1/0:300*1e3))}clearGcTimeout(){O(this,Ta)&&(ja.clearTimeout(O(this,Ta)),de(this,Ta,void 0))}},Ta=new WeakMap,L0),Aa,Yl,Jn,za,Wt,To,Oa,Bn,J0,ti,I0,GN=(I0=class extends X0{constructor(n){super();we(this,Bn);we(this,Aa);we(this,Yl);we(this,Jn);we(this,za);we(this,Wt);we(this,To);we(this,Oa);de(this,Oa,!1),de(this,To,n.defaultOptions),this.setOptions(n.options),this.observers=[],de(this,za,n.client),de(this,Jn,O(this,za).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,de(this,Aa,Bb(this.options)),this.state=n.state??O(this,Aa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=O(this,Wt))==null?void 0:n.promise}setOptions(n){if(this.options={...O(this,To),...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=Bb(this.options);i.data!==void 0&&(this.setState(Ib(i.data,i.dataUpdatedAt)),de(this,Aa,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&O(this,Jn).remove(this)}setData(n,i){const a=Jh(this.state.data,n,this.options);return Ie(this,Bn,ti).call(this,{data:a,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),a}setState(n,i){Ie(this,Bn,ti).call(this,{type:"setState",state:n,setStateOptions:i})}cancel(n){var a,s;const i=(a=O(this,Wt))==null?void 0:a.promise;return(s=O(this,Wt))==null||s.cancel(n),i?i.then(yn).catch(yn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return O(this,Aa)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>Wn(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Um||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Wi(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!V0(this.state.dataUpdatedAt,n)}onFocus(){var i;const n=this.observers.find(a=>a.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(i=O(this,Wt))==null||i.continue()}onOnline(){var i;const n=this.observers.find(a=>a.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(i=O(this,Wt))==null||i.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),O(this,Jn).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(i=>i!==n),this.observers.length||(O(this,Wt)&&(O(this,Oa)||Ie(this,Bn,J0).call(this)?O(this,Wt).cancel({revert:!0}):O(this,Wt).cancelRetry()),this.scheduleGc()),O(this,Jn).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ie(this,Bn,ti).call(this,{type:"invalidate"})}async fetch(n,i){var g,p,y,v,x,S,j,C,T,k,P,U;if(this.state.fetchStatus!=="idle"&&((g=O(this,Wt))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(O(this,Wt))return O(this,Wt).continueRetry(),O(this,Wt).promise}if(n&&this.setOptions(n),!this.options.queryFn){const H=this.observers.find(K=>K.options.queryFn);H&&this.setOptions(H.options)}const a=new AbortController,s=H=>{Object.defineProperty(H,"signal",{enumerable:!0,get:()=>(de(this,Oa,!0),a.signal)})},u=()=>{const H=Y0(this.options,i),L=(()=>{const V={client:O(this,za),queryKey:this.queryKey,meta:this.meta};return s(V),V})();return de(this,Oa,!1),this.options.persister?this.options.persister(H,L,this):H(L)},d=(()=>{const H={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:O(this,za),state:this.state,fetchFn:u};return s(H),H})();(p=this.options.behavior)==null||p.onFetch(d,this),de(this,Yl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=d.fetchOptions)==null?void 0:y.meta))&&Ie(this,Bn,ti).call(this,{type:"fetch",meta:(v=d.fetchOptions)==null?void 0:v.meta}),de(this,Wt,K0({initialPromise:i==null?void 0:i.initialPromise,fn:d.fetchFn,onCancel:H=>{H instanceof em&&H.revert&&this.setState({...O(this,Yl),fetchStatus:"idle"}),a.abort()},onFail:(H,K)=>{Ie(this,Bn,ti).call(this,{type:"failed",failureCount:H,error:K})},onPause:()=>{Ie(this,Bn,ti).call(this,{type:"pause"})},onContinue:()=>{Ie(this,Bn,ti).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const H=await O(this,Wt).start();if(H===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(H),(S=(x=O(this,Jn).config).onSuccess)==null||S.call(x,H,this),(C=(j=O(this,Jn).config).onSettled)==null||C.call(j,H,this.state.error,this),H}catch(H){if(H instanceof em){if(H.silent)return O(this,Wt).promise;if(H.revert){if(this.state.data===void 0)throw H;return this.state.data}}throw Ie(this,Bn,ti).call(this,{type:"error",error:H}),(k=(T=O(this,Jn).config).onError)==null||k.call(T,H,this),(U=(P=O(this,Jn).config).onSettled)==null||U.call(P,this.state.data,H,this),H}finally{this.scheduleGc()}}},Aa=new WeakMap,Yl=new WeakMap,Jn=new WeakMap,za=new WeakMap,Wt=new WeakMap,To=new WeakMap,Oa=new WeakMap,Bn=new WeakSet,J0=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ti=function(n){const i=a=>{switch(n.type){case"failed":return{...a,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...W0(a.data,this.options),fetchMeta:n.meta??null};case"success":const s={...a,...Ib(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return de(this,Yl,n.manual?s:void 0),s;case"error":const u=n.error;return{...a,error:u,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=i(this.state),Yt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),O(this,Jn).notify({query:this,type:"updated",action:n})})},I0);function W0(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:G0(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ib(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bb(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,i=n!==void 0,a=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:i?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var _n,Ye,Ao,gn,Ra,Gl,ni,Vi,zo,Kl,Xl,Ma,Da,Qi,Jl,rt,ho,tm,nm,rm,im,am,lm,sm,e1,B0,KN=(B0=class extends is{constructor(n,i){super();we(this,rt);we(this,_n);we(this,Ye);we(this,Ao);we(this,gn);we(this,Ra);we(this,Gl);we(this,ni);we(this,Vi);we(this,zo);we(this,Kl);we(this,Xl);we(this,Ma);we(this,Da);we(this,Qi);we(this,Jl,new Set);this.options=i,de(this,_n,n),de(this,Vi,null),de(this,ni,Wh()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(O(this,Ye).addObserver(this),qb(O(this,Ye),this.options)?Ie(this,rt,ho).call(this):this.updateResult(),Ie(this,rt,im).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return om(O(this,Ye),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return om(O(this,Ye),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ie(this,rt,am).call(this),Ie(this,rt,lm).call(this),O(this,Ye).removeObserver(this)}setOptions(n){const i=this.options,a=O(this,Ye);if(this.options=O(this,_n).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wn(this.options.enabled,O(this,Ye))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ie(this,rt,sm).call(this),O(this,Ye).setOptions(this.options),i._defaulted&&!Nc(this.options,i)&&O(this,_n).getQueryCache().notify({type:"observerOptionsUpdated",query:O(this,Ye),observer:this});const s=this.hasListeners();s&&Pb(O(this,Ye),a,this.options,i)&&Ie(this,rt,ho).call(this),this.updateResult(),s&&(O(this,Ye)!==a||Wn(this.options.enabled,O(this,Ye))!==Wn(i.enabled,O(this,Ye))||Wi(this.options.staleTime,O(this,Ye))!==Wi(i.staleTime,O(this,Ye)))&&Ie(this,rt,tm).call(this);const u=Ie(this,rt,nm).call(this);s&&(O(this,Ye)!==a||Wn(this.options.enabled,O(this,Ye))!==Wn(i.enabled,O(this,Ye))||u!==O(this,Qi))&&Ie(this,rt,rm).call(this,u)}getOptimisticResult(n){const i=O(this,_n).getQueryCache().build(O(this,_n),n),a=this.createResult(i,n);return JN(this,a)&&(de(this,gn,a),de(this,Gl,this.options),de(this,Ra,O(this,Ye).state)),a}getCurrentResult(){return O(this,gn)}trackResult(n,i){return new Proxy(n,{get:(a,s)=>(this.trackProp(s),i==null||i(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&O(this,ni).status==="pending"&&O(this,ni).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,s))})}trackProp(n){O(this,Jl).add(n)}getCurrentQuery(){return O(this,Ye)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const i=O(this,_n).defaultQueryOptions(n),a=O(this,_n).getQueryCache().build(O(this,_n),i);return a.fetch().then(()=>this.createResult(a,i))}fetch(n){return Ie(this,rt,ho).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),O(this,gn)))}createResult(n,i){var B;const a=O(this,Ye),s=this.options,u=O(this,gn),c=O(this,Ra),d=O(this,Gl),p=n!==a?n.state:O(this,Ao),{state:y}=n;let v={...y},x=!1,S;if(i._optimisticResults){const ie=this.hasListeners(),se=!ie&&qb(n,i),le=ie&&Pb(n,a,i,s);(se||le)&&(v={...v,...W0(y.data,n.options)}),i._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:j,errorUpdatedAt:C,status:T}=v;S=v.data;let k=!1;if(i.placeholderData!==void 0&&S===void 0&&T==="pending"){let ie;u!=null&&u.isPlaceholderData&&i.placeholderData===(d==null?void 0:d.placeholderData)?(ie=u.data,k=!0):ie=typeof i.placeholderData=="function"?i.placeholderData((B=O(this,Xl))==null?void 0:B.state.data,O(this,Xl)):i.placeholderData,ie!==void 0&&(T="success",S=Jh(u==null?void 0:u.data,ie,i),x=!0)}if(i.select&&S!==void 0&&!k)if(u&&S===(c==null?void 0:c.data)&&i.select===O(this,zo))S=O(this,Kl);else try{de(this,zo,i.select),S=i.select(S),S=Jh(u==null?void 0:u.data,S,i),de(this,Kl,S),de(this,Vi,null)}catch(ie){de(this,Vi,ie)}O(this,Vi)&&(j=O(this,Vi),S=O(this,Kl),C=Date.now(),T="error");const P=v.fetchStatus==="fetching",U=T==="pending",H=T==="error",K=U&&P,L=S!==void 0,D={status:T,fetchStatus:v.fetchStatus,isPending:U,isSuccess:T==="success",isError:H,isInitialLoading:K,isLoading:K,data:S,dataUpdatedAt:v.dataUpdatedAt,error:j,errorUpdatedAt:C,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:P,isRefetching:P&&!U,isLoadingError:H&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:H&&L,isStale:Im(n,i),refetch:this.refetch,promise:O(this,ni),isEnabled:Wn(i.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const ie=D.data!==void 0,se=D.status==="error"&&!ie,le=ne=>{se?ne.reject(D.error):ie&&ne.resolve(D.data)},ke=()=>{const ne=de(this,ni,D.promise=Wh());le(ne)},fe=O(this,ni);switch(fe.status){case"pending":n.queryHash===a.queryHash&&le(fe);break;case"fulfilled":(se||D.data!==fe.value)&&ke();break;case"rejected":(!se||D.error!==fe.reason)&&ke();break}}return D}updateResult(){const n=O(this,gn),i=this.createResult(O(this,Ye),this.options);if(de(this,Ra,O(this,Ye).state),de(this,Gl,this.options),O(this,Ra).data!==void 0&&de(this,Xl,O(this,Ye)),Nc(i,n))return;de(this,gn,i);const a=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,u=typeof s=="function"?s():s;if(u==="all"||!u&&!O(this,Jl).size)return!0;const c=new Set(u??O(this,Jl));return this.options.throwOnError&&c.add("error"),Object.keys(O(this,gn)).some(d=>{const g=d;return O(this,gn)[g]!==n[g]&&c.has(g)})};Ie(this,rt,e1).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ie(this,rt,im).call(this)}},_n=new WeakMap,Ye=new WeakMap,Ao=new WeakMap,gn=new WeakMap,Ra=new WeakMap,Gl=new WeakMap,ni=new WeakMap,Vi=new WeakMap,zo=new WeakMap,Kl=new WeakMap,Xl=new WeakMap,Ma=new WeakMap,Da=new WeakMap,Qi=new WeakMap,Jl=new WeakMap,rt=new WeakSet,ho=function(n){Ie(this,rt,sm).call(this);let i=O(this,Ye).fetch(this.options,n);return n!=null&&n.throwOnError||(i=i.catch(yn)),i},tm=function(){Ie(this,rt,am).call(this);const n=Wi(this.options.staleTime,O(this,Ye));if(xo.isServer()||O(this,gn).isStale||!Kh(n))return;const a=V0(O(this,gn).dataUpdatedAt,n)+1;de(this,Ma,ja.setTimeout(()=>{O(this,gn).isStale||this.updateResult()},a))},nm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(O(this,Ye)):this.options.refetchInterval)??!1},rm=function(n){Ie(this,rt,lm).call(this),de(this,Qi,n),!(xo.isServer()||Wn(this.options.enabled,O(this,Ye))===!1||!Kh(O(this,Qi))||O(this,Qi)===0)&&de(this,Da,ja.setInterval(()=>{(this.options.refetchIntervalInBackground||Mm.isFocused())&&Ie(this,rt,ho).call(this)},O(this,Qi)))},im=function(){Ie(this,rt,tm).call(this),Ie(this,rt,rm).call(this,Ie(this,rt,nm).call(this))},am=function(){O(this,Ma)&&(ja.clearTimeout(O(this,Ma)),de(this,Ma,void 0))},lm=function(){O(this,Da)&&(ja.clearInterval(O(this,Da)),de(this,Da,void 0))},sm=function(){const n=O(this,_n).getQueryCache().build(O(this,_n),this.options);if(n===O(this,Ye))return;const i=O(this,Ye);de(this,Ye,n),de(this,Ao,n.state),this.hasListeners()&&(i==null||i.removeObserver(this),n.addObserver(this))},e1=function(n){Yt.batch(()=>{n.listeners&&this.listeners.forEach(i=>{i(O(this,gn))}),O(this,_n).getQueryCache().notify({query:O(this,Ye),type:"observerResultsUpdated"})})},B0);function XN(e,n){return Wn(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function qb(e,n){return XN(e,n)||e.state.data!==void 0&&om(e,n,n.refetchOnMount)}function om(e,n,i){if(Wn(n.enabled,e)!==!1&&Wi(n.staleTime,e)!=="static"){const a=typeof i=="function"?i(e):i;return a==="always"||a!==!1&&Im(e,n)}return!1}function Pb(e,n,i,a){return(e!==n||Wn(a.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Im(e,i)}function Im(e,n){return Wn(n.enabled,e)!==!1&&e.isStaleByTime(Wi(n.staleTime,e))}function JN(e,n){return!Nc(e.getCurrentResult(),n)}function Hb(e){return{onFetch:(n,i)=>{var y,v,x,S,j;const a=n.options,s=(x=(v=(y=n.fetchOptions)==null?void 0:y.meta)==null?void 0:v.fetchMore)==null?void 0:x.direction,u=((S=n.state.data)==null?void 0:S.pages)||[],c=((j=n.state.data)==null?void 0:j.pageParams)||[];let d={pages:[],pageParams:[]},g=0;const p=async()=>{let C=!1;const T=U=>{FN(U,()=>n.signal,()=>C=!0)},k=Y0(n.options,n.fetchOptions),P=async(U,H,K)=>{if(C)return Promise.reject();if(H==null&&U.pages.length)return Promise.resolve(U);const V=(()=>{const se={client:n.client,queryKey:n.queryKey,pageParam:H,direction:K?"backward":"forward",meta:n.options.meta};return T(se),se})(),D=await k(V),{maxPages:B}=n.options,ie=K?ZN:HN;return{pages:ie(U.pages,D,B),pageParams:ie(U.pageParams,H,B)}};if(s&&u.length){const U=s==="backward",H=U?WN:Zb,K={pages:u,pageParams:c},L=H(a,K);d=await P(K,L,U)}else{const U=e??u.length;do{const H=g===0?c[0]??a.initialPageParam:Zb(a,d);if(g>0&&H==null)break;d=await P(d,H),g++}while(g<U)}return d};n.options.persister?n.fetchFn=()=>{var C,T;return(T=(C=n.options).persister)==null?void 0:T.call(C,p,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},i)}:n.fetchFn=p}}}function Zb(e,{pages:n,pageParams:i}){const a=n.length-1;return n.length>0?e.getNextPageParam(n[a],n,i[a],i):void 0}function WN(e,{pages:n,pageParams:i}){var a;return n.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,n[0],n,i[0],i):void 0}var Oo,Sr,cn,Ua,wr,qi,q0,e_=(q0=class extends X0{constructor(n){super();we(this,wr);we(this,Oo);we(this,Sr);we(this,cn);we(this,Ua);de(this,Oo,n.client),this.mutationId=n.mutationId,de(this,cn,n.mutationCache),de(this,Sr,[]),this.state=n.state||t1(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){O(this,Sr).includes(n)||(O(this,Sr).push(n),this.clearGcTimeout(),O(this,cn).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){de(this,Sr,O(this,Sr).filter(i=>i!==n)),this.scheduleGc(),O(this,cn).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){O(this,Sr).length||(this.state.status==="pending"?this.scheduleGc():O(this,cn).remove(this))}continue(){var n;return((n=O(this,Ua))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var c,d,g,p,y,v,x,S,j,C,T,k,P,U,H,K,L,V;const i=()=>{Ie(this,wr,qi).call(this,{type:"continue"})},a={client:O(this,Oo),meta:this.options.meta,mutationKey:this.options.mutationKey};de(this,Ua,K0({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(D,B)=>{Ie(this,wr,qi).call(this,{type:"failed",failureCount:D,error:B})},onPause:()=>{Ie(this,wr,qi).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>O(this,cn).canRun(this)}));const s=this.state.status==="pending",u=!O(this,Ua).canStart();try{if(s)i();else{Ie(this,wr,qi).call(this,{type:"pending",variables:n,isPaused:u}),O(this,cn).config.onMutate&&await O(this,cn).config.onMutate(n,this,a);const B=await((d=(c=this.options).onMutate)==null?void 0:d.call(c,n,a));B!==this.state.context&&Ie(this,wr,qi).call(this,{type:"pending",context:B,variables:n,isPaused:u})}const D=await O(this,Ua).start();return await((p=(g=O(this,cn).config).onSuccess)==null?void 0:p.call(g,D,n,this.state.context,this,a)),await((v=(y=this.options).onSuccess)==null?void 0:v.call(y,D,n,this.state.context,a)),await((S=(x=O(this,cn).config).onSettled)==null?void 0:S.call(x,D,null,this.state.variables,this.state.context,this,a)),await((C=(j=this.options).onSettled)==null?void 0:C.call(j,D,null,n,this.state.context,a)),Ie(this,wr,qi).call(this,{type:"success",data:D}),D}catch(D){try{await((k=(T=O(this,cn).config).onError)==null?void 0:k.call(T,D,n,this.state.context,this,a))}catch(B){Promise.reject(B)}try{await((U=(P=this.options).onError)==null?void 0:U.call(P,D,n,this.state.context,a))}catch(B){Promise.reject(B)}try{await((K=(H=O(this,cn).config).onSettled)==null?void 0:K.call(H,void 0,D,this.state.variables,this.state.context,this,a))}catch(B){Promise.reject(B)}try{await((V=(L=this.options).onSettled)==null?void 0:V.call(L,void 0,D,n,this.state.context,a))}catch(B){Promise.reject(B)}throw Ie(this,wr,qi).call(this,{type:"error",error:D}),D}finally{O(this,cn).runNext(this)}}},Oo=new WeakMap,Sr=new WeakMap,cn=new WeakMap,Ua=new WeakMap,wr=new WeakSet,qi=function(n){const i=a=>{switch(n.type){case"failed":return{...a,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...a,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:n.error,failureCount:a.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Yt.batch(()=>{O(this,Sr).forEach(a=>{a.onMutationUpdate(n)}),O(this,cn).notify({mutation:this,type:"updated",action:n})})},q0);function t1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ri,cr,Ro,P0,t_=(P0=class extends is{constructor(n={}){super();we(this,ri);we(this,cr);we(this,Ro);this.config=n,de(this,ri,new Set),de(this,cr,new Map),de(this,Ro,0)}build(n,i,a){const s=new e_({client:n,mutationCache:this,mutationId:++nc(this,Ro)._,options:n.defaultMutationOptions(i),state:a});return this.add(s),s}add(n){O(this,ri).add(n);const i=rc(n);if(typeof i=="string"){const a=O(this,cr).get(i);a?a.push(n):O(this,cr).set(i,[n])}this.notify({type:"added",mutation:n})}remove(n){if(O(this,ri).delete(n)){const i=rc(n);if(typeof i=="string"){const a=O(this,cr).get(i);if(a)if(a.length>1){const s=a.indexOf(n);s!==-1&&a.splice(s,1)}else a[0]===n&&O(this,cr).delete(i)}}this.notify({type:"removed",mutation:n})}canRun(n){const i=rc(n);if(typeof i=="string"){const a=O(this,cr).get(i),s=a==null?void 0:a.find(u=>u.state.status==="pending");return!s||s===n}else return!0}runNext(n){var a;const i=rc(n);if(typeof i=="string"){const s=(a=O(this,cr).get(i))==null?void 0:a.find(u=>u!==n&&u.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yt.batch(()=>{O(this,ri).forEach(n=>{this.notify({type:"removed",mutation:n})}),O(this,ri).clear(),O(this,cr).clear()})}getAll(){return Array.from(O(this,ri))}find(n){const i={exact:!0,...n};return this.getAll().find(a=>Db(i,a))}findAll(n={}){return this.getAll().filter(i=>Db(n,i))}notify(n){Yt.batch(()=>{this.listeners.forEach(i=>{i(n)})})}resumePausedMutations(){const n=this.getAll().filter(i=>i.state.isPaused);return Yt.batch(()=>Promise.all(n.map(i=>i.continue().catch(yn))))}},ri=new WeakMap,cr=new WeakMap,Ro=new WeakMap,P0);function rc(e){var n;return(n=e.options.scope)==null?void 0:n.id}var ii,Yi,jn,ai,si,bc,um,H0,n_=(H0=class extends is{constructor(i,a){super();we(this,si);we(this,ii);we(this,Yi);we(this,jn);we(this,ai);de(this,ii,i),this.setOptions(a),this.bindMethods(),Ie(this,si,bc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){var s;const a=this.options;this.options=O(this,ii).defaultMutationOptions(i),Nc(this.options,a)||O(this,ii).getMutationCache().notify({type:"observerOptionsUpdated",mutation:O(this,jn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&Ba(a.mutationKey)!==Ba(this.options.mutationKey)?this.reset():((s=O(this,jn))==null?void 0:s.state.status)==="pending"&&O(this,jn).setOptions(this.options)}onUnsubscribe(){var i;this.hasListeners()||(i=O(this,jn))==null||i.removeObserver(this)}onMutationUpdate(i){Ie(this,si,bc).call(this),Ie(this,si,um).call(this,i)}getCurrentResult(){return O(this,Yi)}reset(){var i;(i=O(this,jn))==null||i.removeObserver(this),de(this,jn,void 0),Ie(this,si,bc).call(this),Ie(this,si,um).call(this)}mutate(i,a){var s;return de(this,ai,a),(s=O(this,jn))==null||s.removeObserver(this),de(this,jn,O(this,ii).getMutationCache().build(O(this,ii),this.options)),O(this,jn).addObserver(this),O(this,jn).execute(i)}},ii=new WeakMap,Yi=new WeakMap,jn=new WeakMap,ai=new WeakMap,si=new WeakSet,bc=function(){var a;const i=((a=O(this,jn))==null?void 0:a.state)??t1();de(this,Yi,{...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset})},um=function(i){Yt.batch(()=>{var a,s,u,c,d,g,p,y;if(O(this,ai)&&this.hasListeners()){const v=O(this,Yi).variables,x=O(this,Yi).context,S={client:O(this,ii),meta:this.options.meta,mutationKey:this.options.mutationKey};if((i==null?void 0:i.type)==="success"){try{(s=(a=O(this,ai)).onSuccess)==null||s.call(a,i.data,v,x,S)}catch(j){Promise.reject(j)}try{(c=(u=O(this,ai)).onSettled)==null||c.call(u,i.data,null,v,x,S)}catch(j){Promise.reject(j)}}else if((i==null?void 0:i.type)==="error"){try{(g=(d=O(this,ai)).onError)==null||g.call(d,i.error,v,x,S)}catch(j){Promise.reject(j)}try{(y=(p=O(this,ai)).onSettled)==null||y.call(p,void 0,i.error,v,x,S)}catch(j){Promise.reject(j)}}}this.listeners.forEach(v=>{v(O(this,Yi))})})},H0),Er,Z0,r_=(Z0=class extends is{constructor(n={}){super();we(this,Er);this.config=n,de(this,Er,new Map)}build(n,i,a){const s=i.queryKey,u=i.queryHash??Dm(s,i);let c=this.get(u);return c||(c=new GN({client:n,queryKey:s,queryHash:u,options:n.defaultQueryOptions(i),state:a,defaultOptions:n.getQueryDefaults(s)}),this.add(c)),c}add(n){O(this,Er).has(n.queryHash)||(O(this,Er).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const i=O(this,Er).get(n.queryHash);i&&(n.destroy(),i===n&&O(this,Er).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Yt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return O(this,Er).get(n)}getAll(){return[...O(this,Er).values()]}find(n){const i={exact:!0,...n};return this.getAll().find(a=>Mb(i,a))}findAll(n={}){const i=this.getAll();return Object.keys(n).length>0?i.filter(a=>Mb(n,a)):i}notify(n){Yt.batch(()=>{this.listeners.forEach(i=>{i(n)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Er=new WeakMap,Z0),At,Gi,Ki,Wl,es,Xi,ts,ns,F0,i_=(F0=class{constructor(e={}){we(this,At);we(this,Gi);we(this,Ki);we(this,Wl);we(this,es);we(this,Xi);we(this,ts);we(this,ns);de(this,At,e.queryCache||new r_),de(this,Gi,e.mutationCache||new t_),de(this,Ki,e.defaultOptions||{}),de(this,Wl,new Map),de(this,es,new Map),de(this,Xi,0)}mount(){nc(this,Xi)._++,O(this,Xi)===1&&(de(this,ts,Mm.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,At).onFocus())})),de(this,ns,_c.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,At).onOnline())})))}unmount(){var e,n;nc(this,Xi)._--,O(this,Xi)===0&&((e=O(this,ts))==null||e.call(this),de(this,ts,void 0),(n=O(this,ns))==null||n.call(this),de(this,ns,void 0))}isFetching(e){return O(this,At).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,Gi).findAll({...e,status:"pending"}).length}getQueryData(e){var i;const n=this.defaultQueryOptions({queryKey:e});return(i=O(this,At).get(n.queryHash))==null?void 0:i.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),i=O(this,At).build(this,n),a=i.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Wi(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(a))}getQueriesData(e){return O(this,At).findAll(e).map(({queryKey:n,state:i})=>{const a=i.data;return[n,a]})}setQueryData(e,n,i){const a=this.defaultQueryOptions({queryKey:e}),s=O(this,At).get(a.queryHash),u=s==null?void 0:s.state.data,c=BN(n,u);if(c!==void 0)return O(this,At).build(this,a).setData(c,{...i,manual:!0})}setQueriesData(e,n,i){return Yt.batch(()=>O(this,At).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,n,i)]))}getQueryState(e){var i;const n=this.defaultQueryOptions({queryKey:e});return(i=O(this,At).get(n.queryHash))==null?void 0:i.state}removeQueries(e){const n=O(this,At);Yt.batch(()=>{n.findAll(e).forEach(i=>{n.remove(i)})})}resetQueries(e,n){const i=O(this,At);return Yt.batch(()=>(i.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const i={revert:!0,...n},a=Yt.batch(()=>O(this,At).findAll(e).map(s=>s.cancel(i)));return Promise.all(a).then(yn).catch(yn)}invalidateQueries(e,n={}){return Yt.batch(()=>(O(this,At).findAll(e).forEach(i=>{i.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"},n)))}refetchQueries(e,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},a=Yt.batch(()=>O(this,At).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(yn)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(a).then(yn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const i=O(this,At).build(this,n);return i.isStaleByTime(Wi(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yn).catch(yn)}fetchInfiniteQuery(e){return e.behavior=Hb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yn).catch(yn)}ensureInfiniteQueryData(e){return e.behavior=Hb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _c.isOnline()?O(this,Gi).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,At)}getMutationCache(){return O(this,Gi)}getDefaultOptions(){return O(this,Ki)}setDefaultOptions(e){de(this,Ki,e)}setQueryDefaults(e,n){O(this,Wl).set(Ba(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...O(this,Wl).values()],i={};return n.forEach(a=>{bo(e,a.queryKey)&&Object.assign(i,a.defaultOptions)}),i}setMutationDefaults(e,n){O(this,es).set(Ba(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...O(this,es).values()],i={};return n.forEach(a=>{bo(e,a.mutationKey)&&Object.assign(i,a.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const n={...O(this,Ki).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Dm(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Um&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,Ki).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,At).clear(),O(this,Gi).clear()}},At=new WeakMap,Gi=new WeakMap,Ki=new WeakMap,Wl=new WeakMap,es=new WeakMap,Xi=new WeakMap,ts=new WeakMap,ns=new WeakMap,F0),n1=w.createContext(void 0),nr=e=>{const n=w.useContext(n1);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},a_=({client:e,children:n})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(n1.Provider,{value:e,children:n})),r1=w.createContext(!1),l_=()=>w.useContext(r1);r1.Provider;function s_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o_=w.createContext(s_()),u_=()=>w.useContext(o_),c_=(e,n,i)=>{const a=i!=null&&i.state.error&&typeof e.throwOnError=="function"?Lm(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(n.isReset()||(e.retryOnMount=!1))},f_=e=>{w.useEffect(()=>{e.clearReset()},[e])},d_=({result:e,errorResetBoundary:n,throwOnError:i,query:a,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||Lm(i,[e.error,a])),h_=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>i(a(...s)):i(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},m_=(e,n)=>e.isLoading&&e.isFetching&&!n,p_=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,Fb=(e,n,i)=>n.fetchOptimistic(e).catch(()=>{i.clearReset()});function g_(e,n,i){var x,S,j,C;const a=l_(),s=u_(),u=nr(),c=u.defaultQueryOptions(e);(S=(x=u.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||S.call(x,c);const d=u.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",h_(c),c_(c,s,d),f_(s);const g=!u.getQueryCache().get(c.queryHash),[p]=w.useState(()=>new n(u,c)),y=p.getOptimisticResult(c),v=!a&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(T=>{const k=v?p.subscribe(Yt.batchCalls(T)):yn;return p.updateResult(),k},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),w.useEffect(()=>{p.setOptions(c)},[c,p]),p_(c,y))throw Fb(c,p,s);if(d_({result:y,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw y.error;if((C=(j=u.getDefaultOptions().queries)==null?void 0:j._experimental_afterQuery)==null||C.call(j,c,y),c.experimental_prefetchInRender&&!xo.isServer()&&m_(y,a)){const T=g?Fb(c,p,s):d==null?void 0:d.promise;T==null||T.catch(yn).finally(()=>{p.updateResult()})}return c.notifyOnChangeProps?y:p.trackResult(y)}function Ke(e,n){return g_(e,KN)}function bt(e,n){const i=nr(),[a]=w.useState(()=>new n_(i,e));w.useEffect(()=>{a.setOptions(e)},[a,e]);const s=w.useSyncExternalStore(w.useCallback(c=>a.subscribe(Yt.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=w.useCallback((c,d)=>{a.mutate(c,d).catch(yn)},[a]);if(s.error&&Lm(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:u,mutateAsync:s.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 $b="popstate";function Vb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function y_(e={}){function n(a,s){var p;let u=(p=s.state)==null?void 0:p.masked,{pathname:c,search:d,hash:g}=u||a.location;return cm("",{pathname:c,search:d,hash:g},s.state&&s.state.usr||null,s.state&&s.state.key||"default",u?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function i(a,s){return typeof s=="string"?s:So(s)}return b_(n,i,null,e)}function wt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function tr(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function v_(){return Math.random().toString(36).substring(2,10)}function Qb(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function cm(e,n,i=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?as(n):n,state:i,key:n&&n.key||a||v_(),unstable_mask:s}}function So({pathname:e="/",search:n="",hash:i=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function as(e){let n={};if(e){let i=e.indexOf("#");i>=0&&(n.hash=e.substring(i),e=e.substring(0,i));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function b_(e,n,i,a={}){let{window:s=document.defaultView,v5Compat:u=!1}=a,c=s.history,d="POP",g=null,p=y();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function y(){return(c.state||{idx:null}).idx}function v(){d="POP";let T=y(),k=T==null?null:T-p;p=T,g&&g({action:d,location:C.location,delta:k})}function x(T,k){d="PUSH";let P=Vb(T)?T:cm(C.location,T,k);p=y()+1;let U=Qb(P,p),H=C.createHref(P.unstable_mask||P);try{c.pushState(U,"",H)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;s.location.assign(H)}u&&g&&g({action:d,location:C.location,delta:1})}function S(T,k){d="REPLACE";let P=Vb(T)?T:cm(C.location,T,k);p=y();let U=Qb(P,p),H=C.createHref(P.unstable_mask||P);c.replaceState(U,"",H),u&&g&&g({action:d,location:C.location,delta:0})}function j(T){return x_(T)}let C={get action(){return d},get location(){return e(s,c)},listen(T){if(g)throw new Error("A history only accepts one active listener");return s.addEventListener($b,v),g=T,()=>{s.removeEventListener($b,v),g=null}},createHref(T){return n(s,T)},createURL:j,encodeLocation(T){let k=j(T);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:S,go(T){return c.go(T)}};return C}function x_(e,n=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),wt(i,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:So(e);return a=a.replace(/ $/,"%20"),!n&&a.startsWith("//")&&(a=i+a),new URL(a,i)}function i1(e,n,i="/"){return S_(e,n,i,!1)}function S_(e,n,i,a){let s=typeof n=="string"?as(n):n,u=oi(s.pathname||"/",i);if(u==null)return null;let c=a1(e);w_(c);let d=null;for(let g=0;d==null&&g<c.length;++g){let p=R_(u);d=z_(c[g],p,a)}return d}function a1(e,n=[],i=[],a="",s=!1){let u=(c,d,g=s,p)=>{let y={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&g)return;wt(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 v=kr([a,y.relativePath]),x=i.concat(y);c.children&&c.children.length>0&&(wt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),a1(c.children,n,x,v,g)),!(c.path==null&&!c.index)&&n.push({path:v,score:T_(v,c.index),routesMeta:x})};return e.forEach((c,d)=>{var g;if(c.path===""||!((g=c.path)!=null&&g.includes("?")))u(c,d);else for(let p of l1(c.path))u(c,d,!0,p)}),n}function l1(e){let n=e.split("/");if(n.length===0)return[];let[i,...a]=n,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(a.length===0)return s?[u,""]:[u];let c=l1(a.join("/")),d=[];return d.push(...c.map(g=>g===""?u:[u,g].join("/"))),s&&d.push(...c),d.map(g=>e.startsWith("/")&&g===""?"/":g)}function w_(e){e.sort((n,i)=>n.score!==i.score?i.score-n.score:A_(n.routesMeta.map(a=>a.childrenIndex),i.routesMeta.map(a=>a.childrenIndex)))}var E_=/^:[\w-]+$/,C_=3,N_=2,__=1,j_=10,k_=-2,Yb=e=>e==="*";function T_(e,n){let i=e.split("/"),a=i.length;return i.some(Yb)&&(a+=k_),n&&(a+=N_),i.filter(s=>!Yb(s)).reduce((s,u)=>s+(E_.test(u)?C_:u===""?__:j_),a)}function A_(e,n){return e.length===n.length&&e.slice(0,-1).every((a,s)=>a===n[s])?e[e.length-1]-n[n.length-1]:0}function z_(e,n,i=!1){let{routesMeta:a}=e,s={},u="/",c=[];for(let d=0;d<a.length;++d){let g=a[d],p=d===a.length-1,y=u==="/"?n:n.slice(u.length)||"/",v=jc({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},y),x=g.route;if(!v&&p&&i&&!a[a.length-1].route.index&&(v=jc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!v)return null;Object.assign(s,v.params),c.push({params:s,pathname:kr([u,v.pathname]),pathnameBase:L_(kr([u,v.pathnameBase])),route:x}),v.pathnameBase!=="/"&&(u=kr([u,v.pathnameBase]))}return c}function jc(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[i,a]=O_(e.path,e.caseSensitive,e.end),s=n.match(i);if(!s)return null;let u=s[0],c=u.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:a.reduce((p,{paramName:y,isOptional:v},x)=>{if(y==="*"){let j=d[x]||"";c=u.slice(0,u.length-j.length).replace(/(.)\/+$/,"$1")}const S=d[x];return v&&!S?p[y]=void 0:p[y]=(S||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:c,pattern:e}}function O_(e,n=!1,i=!0){tr(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,g,p,y)=>{if(a.push({paramName:d,isOptional:g!=null}),g){let v=y.charAt(p+c.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,n?void 0:"i"),a]}function R_(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return tr(!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 (${n}).`),e}}function oi(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,a=e.charAt(i);return a&&a!=="/"?null:e.slice(i)||"/"}var M_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function D_(e,n="/"){let{pathname:i,search:a="",hash:s=""}=typeof e=="string"?as(e):e,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=Gb(i.substring(1),"/"):u=Gb(i,n)):u=n,{pathname:u,search:I_(a),hash:B_(s)}}function Gb(e,n){let i=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function Sh(e,n,i,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U_(e){return e.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function Bm(e){let n=U_(e);return n.map((i,a)=>a===n.length-1?i.pathname:i.pathnameBase)}function Ic(e,n,i,a=!1){let s;typeof e=="string"?s=as(e):(s={...e},wt(!s.pathname||!s.pathname.includes("?"),Sh("?","pathname","search",s)),wt(!s.pathname||!s.pathname.includes("#"),Sh("#","pathname","hash",s)),wt(!s.search||!s.search.includes("#"),Sh("#","search","hash",s)));let u=e===""||s.pathname==="",c=u?"/":s.pathname,d;if(c==null)d=i;else{let v=n.length-1;if(!a&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}d=v>=0?n[v]:"/"}let g=D_(s,d),p=c&&c!=="/"&&c.endsWith("/"),y=(u||c===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(p||y)&&(g.pathname+="/"),g}var kr=e=>e.join("/").replace(/\/\/+/g,"/"),L_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),I_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,B_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,q_=class{constructor(e,n,i,a=!1){this.status=e,this.statusText=n||"",this.internal=a,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function P_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function H_(e){return e.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var s1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function o1(e,n){let i=e;if(typeof i!="string"||!M_.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let a=i,s=!1;if(s1)try{let u=new URL(window.location.href),c=i.startsWith("//")?new URL(u.protocol+i):new URL(i),d=oi(c.pathname,n);c.origin===u.origin&&d!=null?i=d+c.search+c.hash:s=!0}catch{tr(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var u1=["POST","PUT","PATCH","DELETE"];new Set(u1);var Z_=["GET",...u1];new Set(Z_);var ls=w.createContext(null);ls.displayName="DataRouter";var Bc=w.createContext(null);Bc.displayName="DataRouterState";var F_=w.createContext(!1),c1=w.createContext({isTransitioning:!1});c1.displayName="ViewTransition";var $_=w.createContext(new Map);$_.displayName="Fetchers";var V_=w.createContext(null);V_.displayName="Await";var Pn=w.createContext(null);Pn.displayName="Navigation";var Mo=w.createContext(null);Mo.displayName="Location";var rr=w.createContext({outlet:null,matches:[],isDataRoute:!1});rr.displayName="Route";var qm=w.createContext(null);qm.displayName="RouteError";var f1="REACT_ROUTER_ERROR",Q_="REDIRECT",Y_="ROUTE_ERROR_RESPONSE";function G_(e){if(e.startsWith(`${f1}:${Q_}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function K_(e){if(e.startsWith(`${f1}:${Y_}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new q_(n.status,n.statusText,n.data)}catch{}}function X_(e,{relative:n}={}){wt(ss(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:a}=w.useContext(Pn),{hash:s,pathname:u,search:c}=Do(e,{relative:n}),d=u;return i!=="/"&&(d=u==="/"?i:kr([i,u])),a.createHref({pathname:d,search:c,hash:s})}function ss(){return w.useContext(Mo)!=null}function ir(){return wt(ss(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Mo).location}var d1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function h1(e){w.useContext(Pn).static||w.useLayoutEffect(e)}function ra(){let{isDataRoute:e}=w.useContext(rr);return e?hj():J_()}function J_(){wt(ss(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(ls),{basename:n,navigator:i}=w.useContext(Pn),{matches:a}=w.useContext(rr),{pathname:s}=ir(),u=JSON.stringify(Bm(a)),c=w.useRef(!1);return h1(()=>{c.current=!0}),w.useCallback((g,p={})=>{if(tr(c.current,d1),!c.current)return;if(typeof g=="number"){i.go(g);return}let y=Ic(g,JSON.parse(u),s,p.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:kr([n,y.pathname])),(p.replace?i.replace:i.push)(y,p.state,p)},[n,i,u,s,e])}var W_=w.createContext(null);function ej(e){let n=w.useContext(rr).outlet;return w.useMemo(()=>n&&w.createElement(W_.Provider,{value:e},n),[n,e])}function tj(){let{matches:e}=w.useContext(rr),n=e[e.length-1];return n?n.params:{}}function Do(e,{relative:n}={}){let{matches:i}=w.useContext(rr),{pathname:a}=ir(),s=JSON.stringify(Bm(i));return w.useMemo(()=>Ic(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function nj(e,n){return m1(e,n)}function m1(e,n,i){var T;wt(ss(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=w.useContext(Pn),{matches:s}=w.useContext(rr),u=s[s.length-1],c=u?u.params:{},d=u?u.pathname:"/",g=u?u.pathnameBase:"/",p=u&&u.route;{let k=p&&p.path||"";g1(d,!p||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${k}">) 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="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let y=ir(),v;if(n){let k=typeof n=="string"?as(n):n;wt(g==="/"||((T=k.pathname)==null?void 0:T.startsWith(g)),`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 "${g}" but pathname "${k.pathname}" was given in the \`location\` prop.`),v=k}else v=y;let x=v.pathname||"/",S=x;if(g!=="/"){let k=g.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let j=i1(e,{pathname:S});tr(p||j!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),tr(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 C=sj(j&&j.map(k=>Object.assign({},k,{params:Object.assign({},c,k.params),pathname:kr([g,a.encodeLocation?a.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?g:kr([g,a.encodeLocation?a.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,i);return n&&C?w.createElement(Mo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},C):C}function rj(){let e=dj(),n=P_(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:u},"ErrorBoundary")," or"," ",w.createElement("code",{style:u},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},n),i?w.createElement("pre",{style:s},i):null,c)}var ij=w.createElement(rj,null),p1=class extends w.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):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 i=K_(e.digest);i&&(e=i)}let n=e!==void 0?w.createElement(rr.Provider,{value:this.props.routeContext},w.createElement(qm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(aj,{error:e},n):n}};p1.contextType=F_;var wh=new WeakMap;function aj({children:e,error:n}){let{basename:i}=w.useContext(Pn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=G_(n.digest);if(a){let s=wh.get(n);if(s)throw s;let u=o1(a.location,i);if(s1&&!wh.get(n))if(u.isExternal||a.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:a.replace}));throw wh.set(n,c),c}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function lj({routeContext:e,match:n,children:i}){let a=w.useContext(ls);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(rr.Provider,{value:e},i)}function sj(e,n=[],i){let a=i==null?void 0:i.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,u=a==null?void 0:a.errors;if(u!=null){let y=s.findIndex(v=>v.route.id&&(u==null?void 0:u[v.route.id])!==void 0);wt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),s=s.slice(0,Math.min(s.length,y+1))}let c=!1,d=-1;if(i&&a){c=a.renderFallback;for(let y=0;y<s.length;y++){let v=s[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(d=y),v.route.id){let{loaderData:x,errors:S}=a,j=v.route.loader&&!x.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||j){i.isStatic&&(c=!0),d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}}let g=i==null?void 0:i.onError,p=a&&g?(y,v)=>{var x,S;g(y,{location:a.location,params:((S=(x=a.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:H_(a.matches),errorInfo:v})}:void 0;return s.reduceRight((y,v,x)=>{let S,j=!1,C=null,T=null;a&&(S=u&&v.route.id?u[v.route.id]:void 0,C=v.route.errorElement||ij,c&&(d<0&&x===0?(g1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,T=null):d===x&&(j=!0,T=v.route.hydrateFallbackElement||null)));let k=n.concat(s.slice(0,x+1)),P=()=>{let U;return S?U=C:j?U=T:v.route.Component?U=w.createElement(v.route.Component,null):v.route.element?U=v.route.element:U=y,w.createElement(lj,{match:v,routeContext:{outlet:y,matches:k,isDataRoute:a!=null},children:U})};return a&&(v.route.ErrorBoundary||v.route.errorElement||x===0)?w.createElement(p1,{location:a.location,revalidation:a.revalidation,component:C,error:S,children:P(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:p}):P()},null)}function Pm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function oj(e){let n=w.useContext(ls);return wt(n,Pm(e)),n}function uj(e){let n=w.useContext(Bc);return wt(n,Pm(e)),n}function cj(e){let n=w.useContext(rr);return wt(n,Pm(e)),n}function Hm(e){let n=cj(e),i=n.matches[n.matches.length-1];return wt(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function fj(){return Hm("useRouteId")}function dj(){var a;let e=w.useContext(qm),n=uj("useRouteError"),i=Hm("useRouteError");return e!==void 0?e:(a=n.errors)==null?void 0:a[i]}function hj(){let{router:e}=oj("useNavigate"),n=Hm("useNavigate"),i=w.useRef(!1);return h1(()=>{i.current=!0}),w.useCallback(async(s,u={})=>{tr(i.current,d1),i.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:n,...u}))},[e,n])}var Kb={};function g1(e,n,i){!n&&!Kb[e]&&(Kb[e]=!0,tr(!1,i))}w.memo(mj);function mj({routes:e,future:n,state:i,isStatic:a,onError:s}){return m1(e,void 0,{state:i,isStatic:a,onError:s})}function y1({to:e,replace:n,state:i,relative:a}){wt(ss(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=w.useContext(Pn);tr(!s,"<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:u}=w.useContext(rr),{pathname:c}=ir(),d=ra(),g=Ic(e,Bm(u),c,a==="path"),p=JSON.stringify(g);return w.useEffect(()=>{d(JSON.parse(p),{replace:n,state:i,relative:a})},[d,p,a,n,i]),null}function fm(e){return ej(e.context)}function Pi(e){wt(!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 pj({basename:e="/",children:n=null,location:i,navigationType:a="POP",navigator:s,static:u=!1,unstable_useTransitions:c}){wt(!ss(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),g=w.useMemo(()=>({basename:d,navigator:s,static:u,unstable_useTransitions:c,future:{}}),[d,s,u,c]);typeof i=="string"&&(i=as(i));let{pathname:p="/",search:y="",hash:v="",state:x=null,key:S="default",unstable_mask:j}=i,C=w.useMemo(()=>{let T=oi(p,d);return T==null?null:{location:{pathname:T,search:y,hash:v,state:x,key:S,unstable_mask:j},navigationType:a}},[d,p,y,v,x,S,a,j]);return tr(C!=null,`<Router basename="${d}"> is not able to match the URL "${p}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:w.createElement(Pn.Provider,{value:g},w.createElement(Mo.Provider,{children:n,value:C}))}function gj({children:e,location:n}){return nj(dm(e),n)}function dm(e,n=[]){let i=[];return w.Children.forEach(e,(a,s)=>{if(!w.isValidElement(a))return;let u=[...n,s];if(a.type===w.Fragment){i.push.apply(i,dm(a.props.children,u));return}wt(a.type===Pi,`[${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>`),wt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let c={id:a.props.id||u.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=dm(a.props.children,u)),i.push(c)}),i}var xc="get",Sc="application/x-www-form-urlencoded";function qc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function yj(e){return qc(e)&&e.tagName.toLowerCase()==="button"}function vj(e){return qc(e)&&e.tagName.toLowerCase()==="form"}function bj(e){return qc(e)&&e.tagName.toLowerCase()==="input"}function xj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Sj(e,n){return e.button===0&&(!n||n==="_self")&&!xj(e)}function hm(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,i)=>{let a=e[i];return n.concat(Array.isArray(a)?a.map(s=>[i,s]):[[i,a]])},[]))}function wj(e,n){let i=hm(e);return n&&n.forEach((a,s)=>{i.has(s)||n.getAll(s).forEach(u=>{i.append(s,u)})}),i}var ic=null;function Ej(){if(ic===null)try{new FormData(document.createElement("form"),0),ic=!1}catch{ic=!0}return ic}var Cj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Eh(e){return e!=null&&!Cj.has(e)?(tr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sc}"`),null):e}function Nj(e,n){let i,a,s,u,c;if(vj(e)){let d=e.getAttribute("action");a=d?oi(d,n):null,i=e.getAttribute("method")||xc,s=Eh(e.getAttribute("enctype"))||Sc,u=new FormData(e)}else if(yj(e)||bj(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=e.getAttribute("formaction")||d.getAttribute("action");if(a=g?oi(g,n):null,i=e.getAttribute("formmethod")||d.getAttribute("method")||xc,s=Eh(e.getAttribute("formenctype"))||Eh(d.getAttribute("enctype"))||Sc,u=new FormData(d,e),!Ej()){let{name:p,type:y,value:v}=e;if(y==="image"){let x=p?`${p}.`:"";u.append(`${x}x`,"0"),u.append(`${x}y`,"0")}else p&&u.append(p,v)}}else{if(qc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=xc,a=null,s=Sc,c=e}return u&&s==="text/plain"&&(c=u,u=void 0),{action:a,method:i.toLowerCase(),encType:s,formData:u,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zm(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function _j(e,n,i,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:n&&oi(s.pathname,n)==="/"?s.pathname=`${n.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function jj(e,n){if(e.id in n)return n[e.id];try{let i=await import(e.module);return n[e.id]=i,i}catch(i){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function kj(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 Tj(e,n,i){let a=await Promise.all(e.map(async s=>{let u=n.routes[s.route.id];if(u){let c=await jj(u,i);return c.links?c.links():[]}return[]}));return Rj(a.flat(1).filter(kj).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Xb(e,n,i,a,s,u){let c=(g,p)=>i[p]?g.route.id!==i[p].route.id:!0,d=(g,p)=>{var y;return i[p].pathname!==g.pathname||((y=i[p].route.path)==null?void 0:y.endsWith("*"))&&i[p].params["*"]!==g.params["*"]};return u==="assets"?n.filter((g,p)=>c(g,p)||d(g,p)):u==="data"?n.filter((g,p)=>{var v;let y=a.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(c(g,p)||d(g,p))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Aj(e,n,{includeHydrateFallback:i}={}){return zj(e.map(a=>{let s=n.routes[a.route.id];if(!s)return[];let u=[s.module];return s.clientActionModule&&(u=u.concat(s.clientActionModule)),s.clientLoaderModule&&(u=u.concat(s.clientLoaderModule)),i&&s.hydrateFallbackModule&&(u=u.concat(s.hydrateFallbackModule)),s.imports&&(u=u.concat(s.imports)),u}).flat(1))}function zj(e){return[...new Set(e)]}function Oj(e){let n={},i=Object.keys(e).sort();for(let a of i)n[a]=e[a];return n}function Rj(e,n){let i=new Set;return new Set(n),e.reduce((a,s)=>{let u=JSON.stringify(Oj(s));return i.has(u)||(i.add(u),a.push({key:u,link:s})),a},[])}function v1(){let e=w.useContext(ls);return Zm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Mj(){let e=w.useContext(Bc);return Zm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Fm=w.createContext(void 0);Fm.displayName="FrameworkContext";function b1(){let e=w.useContext(Fm);return Zm(e,"You must render this element inside a <HydratedRouter> element"),e}function Dj(e,n){let i=w.useContext(Fm),[a,s]=w.useState(!1),[u,c]=w.useState(!1),{onFocus:d,onBlur:g,onMouseEnter:p,onMouseLeave:y,onTouchStart:v}=n,x=w.useRef(null);w.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=k=>{k.forEach(P=>{c(P.isIntersecting)})},T=new IntersectionObserver(C,{threshold:.5});return x.current&&T.observe(x.current),()=>{T.disconnect()}}},[e]),w.useEffect(()=>{if(a){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[a]);let S=()=>{s(!0)},j=()=>{s(!1),c(!1)};return i?e!=="intent"?[u,x,{}]:[u,x,{onFocus:ao(d,S),onBlur:ao(g,j),onMouseEnter:ao(p,S),onMouseLeave:ao(y,j),onTouchStart:ao(v,S)}]:[!1,x,{}]}function ao(e,n){return i=>{e&&e(i),i.defaultPrevented||n(i)}}function Uj({page:e,...n}){let{router:i}=v1(),a=w.useMemo(()=>i1(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?w.createElement(Ij,{page:e,matches:a,...n}):null}function Lj(e){let{manifest:n,routeModules:i}=b1(),[a,s]=w.useState([]);return w.useEffect(()=>{let u=!1;return Tj(e,n,i).then(c=>{u||s(c)}),()=>{u=!0}},[e,n,i]),a}function Ij({page:e,matches:n,...i}){let a=ir(),{future:s,manifest:u,routeModules:c}=b1(),{basename:d}=v1(),{loaderData:g,matches:p}=Mj(),y=w.useMemo(()=>Xb(e,n,p,u,a,"data"),[e,n,p,u,a]),v=w.useMemo(()=>Xb(e,n,p,u,a,"assets"),[e,n,p,u,a]),x=w.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let C=new Set,T=!1;if(n.forEach(P=>{var H;let U=u.routes[P.route.id];!U||!U.hasLoader||(!y.some(K=>K.route.id===P.route.id)&&P.route.id in g&&((H=c[P.route.id])!=null&&H.shouldRevalidate)||U.hasClientLoader?T=!0:C.add(P.route.id))}),C.size===0)return[];let k=_j(e,d,s.unstable_trailingSlashAwareDataRequests,"data");return T&&C.size>0&&k.searchParams.set("_routes",n.filter(P=>C.has(P.route.id)).map(P=>P.route.id).join(",")),[k.pathname+k.search]},[d,s.unstable_trailingSlashAwareDataRequests,g,a,u,y,n,e,c]),S=w.useMemo(()=>Aj(v,u),[v,u]),j=Lj(v);return w.createElement(w.Fragment,null,x.map(C=>w.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),S.map(C=>w.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),j.map(({key:C,link:T})=>w.createElement("link",{key:C,nonce:i.nonce,...T,crossOrigin:T.crossOrigin??i.crossOrigin})))}function Bj(...e){return n=>{e.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var qj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{qj&&(window.__reactRouterVersion="7.13.1")}catch{}function Pj({basename:e,children:n,unstable_useTransitions:i,window:a}){let s=w.useRef();s.current==null&&(s.current=y_({window:a,v5Compat:!0}));let u=s.current,[c,d]=w.useState({action:u.action,location:u.location}),g=w.useCallback(p=>{i===!1?d(p):w.startTransition(()=>d(p))},[i]);return w.useLayoutEffect(()=>u.listen(g),[u,g]),w.createElement(pj,{basename:e,children:n,location:c.location,navigationType:c.action,navigator:u,unstable_useTransitions:i})}var x1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,S1=w.forwardRef(function({onClick:n,discover:i="render",prefetch:a="none",relative:s,reloadDocument:u,replace:c,unstable_mask:d,state:g,target:p,to:y,preventScrollReset:v,viewTransition:x,unstable_defaultShouldRevalidate:S,...j},C){let{basename:T,navigator:k,unstable_useTransitions:P}=w.useContext(Pn),U=typeof y=="string"&&x1.test(y),H=o1(y,T);y=H.to;let K=X_(y,{relative:s}),L=ir(),V=null;if(d){let ne=Ic(d,[],L.unstable_mask?L.unstable_mask.pathname:"/",!0);T!=="/"&&(ne.pathname=ne.pathname==="/"?T:kr([T,ne.pathname])),V=k.createHref(ne)}let[D,B,ie]=Dj(a,j),se=Fj(y,{replace:c,unstable_mask:d,state:g,target:p,preventScrollReset:v,relative:s,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:P});function le(ne){n&&n(ne),ne.defaultPrevented||se(ne)}let ke=!(H.isExternal||u),fe=w.createElement("a",{...j,...ie,href:(ke?V:void 0)||H.absoluteURL||K,onClick:ke?le:n,ref:Bj(C,B),target:p,"data-discover":!U&&i==="render"?"true":void 0});return D&&!U?w.createElement(w.Fragment,null,fe,w.createElement(Uj,{page:K})):fe});S1.displayName="Link";var w1=w.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:a="",end:s=!1,style:u,to:c,viewTransition:d,children:g,...p},y){let v=Do(c,{relative:p.relative}),x=ir(),S=w.useContext(Bc),{navigator:j,basename:C}=w.useContext(Pn),T=S!=null&&Gj(v)&&d===!0,k=j.encodeLocation?j.encodeLocation(v).pathname:v.pathname,P=x.pathname,U=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(P=P.toLowerCase(),U=U?U.toLowerCase():null,k=k.toLowerCase()),U&&C&&(U=oi(U,C)||U);const H=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let K=P===k||!s&&P.startsWith(k)&&P.charAt(H)==="/",L=U!=null&&(U===k||!s&&U.startsWith(k)&&U.charAt(k.length)==="/"),V={isActive:K,isPending:L,isTransitioning:T},D=K?n:void 0,B;typeof a=="function"?B=a(V):B=[a,K?"active":null,L?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let ie=typeof u=="function"?u(V):u;return w.createElement(S1,{...p,"aria-current":D,className:B,ref:y,style:ie,to:c,viewTransition:d},typeof g=="function"?g(V):g)});w1.displayName="NavLink";var Hj=w.forwardRef(({discover:e="render",fetcherKey:n,navigate:i,reloadDocument:a,replace:s,state:u,method:c=xc,action:d,onSubmit:g,relative:p,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:x,...S},j)=>{let{unstable_useTransitions:C}=w.useContext(Pn),T=Qj(),k=Yj(d,{relative:p}),P=c.toLowerCase()==="get"?"get":"post",U=typeof d=="string"&&x1.test(d),H=K=>{if(g&&g(K),K.defaultPrevented)return;K.preventDefault();let L=K.nativeEvent.submitter,V=(L==null?void 0:L.getAttribute("formmethod"))||c,D=()=>T(L||K.currentTarget,{fetcherKey:n,method:V,navigate:i,replace:s,state:u,relative:p,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:x});C&&i!==!1?w.startTransition(()=>D()):D()};return w.createElement("form",{ref:j,method:P,action:k,onSubmit:a?g:H,...S,"data-discover":!U&&e==="render"?"true":void 0})});Hj.displayName="Form";function Zj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function E1(e){let n=w.useContext(ls);return wt(n,Zj(e)),n}function Fj(e,{target:n,replace:i,unstable_mask:a,state:s,preventScrollReset:u,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:g,unstable_useTransitions:p}={}){let y=ra(),v=ir(),x=Do(e,{relative:c});return w.useCallback(S=>{if(Sj(S,n)){S.preventDefault();let j=i!==void 0?i:So(v)===So(x),C=()=>y(e,{replace:j,unstable_mask:a,state:s,preventScrollReset:u,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:g});p?w.startTransition(()=>C()):C()}},[v,y,x,i,a,s,n,e,u,c,d,g,p])}function C1(e){tr(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 n=w.useRef(hm(e)),i=w.useRef(!1),a=ir(),s=w.useMemo(()=>wj(a.search,i.current?null:n.current),[a.search]),u=ra(),c=w.useCallback((d,g)=>{const p=hm(typeof d=="function"?d(new URLSearchParams(s)):d);i.current=!0,u("?"+p,g)},[u,s]);return[s,c]}var $j=0,Vj=()=>`__${String(++$j)}__`;function Qj(){let{router:e}=E1("useSubmit"),{basename:n}=w.useContext(Pn),i=fj(),a=e.fetch,s=e.navigate;return w.useCallback(async(u,c={})=>{let{action:d,method:g,encType:p,formData:y,body:v}=Nj(u,n);if(c.navigate===!1){let x=c.fetcherKey||Vj();await a(x,i,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:v,formMethod:c.method||g,formEncType:c.encType||p,flushSync:c.flushSync})}else await s(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:v,formMethod:c.method||g,formEncType:c.encType||p,replace:c.replace,state:c.state,fromRouteId:i,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,s,n,i])}function Yj(e,{relative:n}={}){let{basename:i}=w.useContext(Pn),a=w.useContext(rr);wt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),u={...Do(e||".",{relative:n})},c=ir();if(e==null){u.search=c.search;let d=new URLSearchParams(u.search),g=d.getAll("index");if(g.some(y=>y==="")){d.delete("index"),g.filter(v=>v).forEach(v=>d.append("index",v));let y=d.toString();u.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:kr([i,u.pathname])),So(u)}function Gj(e,{relative:n}={}){let i=w.useContext(c1);wt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=E1("useViewTransitionState"),s=Do(e,{relative:n});if(!i.isTransitioning)return!1;let u=oi(i.currentLocation.pathname,a)||i.currentLocation.pathname,c=oi(i.nextLocation.pathname,a)||i.nextLocation.pathname;return jc(s.pathname,c)!=null||jc(s.pathname,u)!=null}const Kj="/api/v1";async function Xj(e,n){const i=await fetch(`${Kj}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:n})});if(!i.ok){const a=await i.text();let s;try{s=JSON.parse(a).error??a}catch{s=a}throw new Error(s)}return await i.json()}const N1="/api/v1",$m="first-tree-hub:tokens";function Vm(){const e=localStorage.getItem($m);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function _1(e){localStorage.setItem($m,JSON.stringify(e))}function j1(){localStorage.removeItem($m)}class Jj extends Error{constructor(n,i){super(i),this.status=n,this.name="ApiError"}}let lo=null;async function Wj(e){return lo||(lo=(async()=>{try{const n=await fetch(`${N1}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!n.ok)return null;const i=await n.json(),a={accessToken:i.accessToken,refreshToken:i.refreshToken??e};return _1(a),a}catch{return null}finally{lo=null}})(),lo)}async function ac(e,n){const{method:i="GET",body:a}=n??{},s=d=>{const g={};return d&&(g.Authorization=`Bearer ${d}`),a!==void 0&&(g["Content-Type"]="application/json"),fetch(`${N1}${e}`,{method:i,headers:g,body:a!==void 0?JSON.stringify(a):void 0})},u=Vm();let c=await s(u==null?void 0:u.accessToken);if(c.status===401&&(u!=null&&u.refreshToken)){const d=await Wj(u.refreshToken);d&&(c=await s(d.accessToken))}if(!c.ok){c.status===401&&(j1(),window.dispatchEvent(new CustomEvent("auth:logout")));const d=await c.text();let g;try{g=JSON.parse(d).error??d}catch{g=d}throw new Jj(c.status,g)}if(c.status!==204)return await c.json()}const De={get:e=>ac(e),post:(e,n)=>ac(e,{method:"POST",body:n}),patch:(e,n)=>ac(e,{method:"PATCH",body:n}),delete:e=>ac(e,{method:"DELETE"})},k1=w.createContext(null);function ek({children:e}){const[n,i]=w.useState(()=>!!Vm()),[a,s]=w.useState(null),[u,c]=w.useState(null),[d,g]=w.useState(null),p=w.useCallback(()=>{j1(),i(!1),s(null),c(null),g(null)},[]),y=w.useCallback(async()=>{try{const x=await De.get("/me");s(x.member.role),c(x.member.id),g(x.member.agentId)}catch{}},[]),v=w.useCallback(async(x,S)=>{const j=await Xj(x,S);_1({accessToken:j.accessToken,refreshToken:j.refreshToken}),i(!0),await De.get("/me").then(C=>{s(C.member.role),c(C.member.id),g(C.member.agentId)}).catch(()=>{})},[]);return w.useEffect(()=>{n&&!a&&y()},[n,a,y]),w.useEffect(()=>{const x=()=>p();return window.addEventListener("auth:logout",x),()=>window.removeEventListener("auth:logout",x)},[p]),h.jsx(k1.Provider,{value:{isAuthenticated:n,role:a,memberId:u,agentId:d,login:v,logout:p},children:e})}function os(){const e=w.useContext(k1);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function tk(){const{isAuthenticated:e}=os();return e?h.jsx(fm,{}):h.jsx(y1,{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 T1=(...e)=>e.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).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 nk=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 rk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,a)=>a?a.toUpperCase():i.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 Jb=e=>{const n=rk(e);return n.charAt(0).toUpperCase()+n.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 ik={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 ak=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="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 lk=w.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:u,iconNode:c,...d},g)=>w.createElement("svg",{ref:g,...ik,width:n,height:n,stroke:e,strokeWidth:a?Number(i)*24/Number(n):i,className:T1("lucide",s),...!u&&!ak(d)&&{"aria-hidden":"true"},...d},[...c.map(([p,y])=>w.createElement(p,y)),...Array.isArray(u)?u:[u]]));/**
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 _t=(e,n)=>{const i=w.forwardRef(({className:a,...s},u)=>w.createElement(lk,{ref:u,iconNode:n,className:T1(`lucide-${nk(Jb(e))}`,`lucide-${e}`,a),...s}));return i.displayName=Jb(e),i};/**
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 sk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],A1=_t("arrow-left",sk);/**
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 ok=[["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"}]],uk=_t("bell",ok);/**
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 ck=[["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"}]],fk=_t("bot",ck);/**
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 dk=[["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"}]],hk=_t("cable",dk);/**
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 mk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],z1=_t("check",mk);/**
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 pk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gk=_t("chevron-down",pk);/**
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 yk=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],O1=_t("chevron-right",yk);/**
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 vk=[["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"}]],Pc=_t("copy",vk);/**
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 bk=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],xk=_t("key",bk);/**
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 Sk=[["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"}]],wk=_t("link-2",Sk);/**
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 Ek=[["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"}]],Ck=_t("log-out",Ek);/**
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 Nk=[["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"}]],_k=_t("message-square",Nk);/**
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 jk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],kk=_t("panel-right-close",jk);/**
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 Tk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],Ak=_t("panel-right-open",Tk);/**
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 zk=[["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"}]],Ch=_t("pencil",zk);/**
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 Ok=[["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"}]],Rk=_t("play",Ok);/**
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 Mk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wo=_t("plus",Mk);/**
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 Dk=[["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"}]],Uk=_t("send",Dk);/**
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 Lk=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Wb=_t("terminal",Lk);/**
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 Ik=[["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"}]],mo=_t("trash-2",Ik);/**
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 Bk=[["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"}]],qk=_t("triangle-alert",Bk);/**
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 Pk=[["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"}]],Hk=_t("unplug",Pk);/**
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 Zk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fk=_t("x",Zk);function R1(e){var n,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(n=0;n<s;n++)e[n]&&(i=R1(e[n]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function M1(){for(var e,n,i=0,a="",s=arguments.length;i<s;i++)(e=arguments[i])&&(n=R1(e))&&(a&&(a+=" "),a+=n);return a}const $k=(e,n)=>{const i=new Array(e.length+n.length);for(let a=0;a<e.length;a++)i[a]=e[a];for(let a=0;a<n.length;a++)i[e.length+a]=n[a];return i},Vk=(e,n)=>({classGroupId:e,validator:n}),D1=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),kc="-",ex=[],Qk="arbitrary..",Yk=e=>{const n=Kk(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Gk(c);const d=c.split(kc),g=d[0]===""&&d.length>1?1:0;return U1(d,g,n)},getConflictingClassGroupIds:(c,d)=>{if(d){const g=a[c],p=i[c];return g?p?$k(p,g):g:p||ex}return i[c]||ex}}},U1=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const s=e[n],u=i.nextPart.get(s);if(u){const p=U1(e,n+1,u);if(p)return p}const c=i.validators;if(c===null)return;const d=n===0?e.join(kc):e.slice(n).join(kc),g=c.length;for(let p=0;p<g;p++){const y=c[p];if(y.validator(d))return y.classGroupId}},Gk=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),a=n.slice(0,i);return a?Qk+a:void 0})(),Kk=e=>{const{theme:n,classGroups:i}=e;return Xk(i,n)},Xk=(e,n)=>{const i=D1();for(const a in e){const s=e[a];Qm(s,i,a,n)}return i},Qm=(e,n,i,a)=>{const s=e.length;for(let u=0;u<s;u++){const c=e[u];Jk(c,n,i,a)}},Jk=(e,n,i,a)=>{if(typeof e=="string"){Wk(e,n,i);return}if(typeof e=="function"){e2(e,n,i,a);return}t2(e,n,i,a)},Wk=(e,n,i)=>{const a=e===""?n:L1(n,e);a.classGroupId=i},e2=(e,n,i,a)=>{if(n2(e)){Qm(e(a),n,i,a);return}n.validators===null&&(n.validators=[]),n.validators.push(Vk(i,e))},t2=(e,n,i,a)=>{const s=Object.entries(e),u=s.length;for(let c=0;c<u;c++){const[d,g]=s[c];Qm(g,L1(n,d),i,a)}},L1=(e,n)=>{let i=e;const a=n.split(kc),s=a.length;for(let u=0;u<s;u++){const c=a[u];let d=i.nextPart.get(c);d||(d=D1(),i.nextPart.set(c,d)),i=d}return i},n2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,r2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),a=Object.create(null);const s=(u,c)=>{i[u]=c,n++,n>e&&(n=0,a=i,i=Object.create(null))};return{get(u){let c=i[u];if(c!==void 0)return c;if((c=a[u])!==void 0)return s(u,c),c},set(u,c){u in i?i[u]=c:s(u,c)}}},mm="!",tx=":",i2=[],nx=(e,n,i,a,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:a,isExternal:s}),a2=e=>{const{prefix:n,experimentalParseClassName:i}=e;let a=s=>{const u=[];let c=0,d=0,g=0,p;const y=s.length;for(let C=0;C<y;C++){const T=s[C];if(c===0&&d===0){if(T===tx){u.push(s.slice(g,C)),g=C+1;continue}if(T==="/"){p=C;continue}}T==="["?c++:T==="]"?c--:T==="("?d++:T===")"&&d--}const v=u.length===0?s:s.slice(g);let x=v,S=!1;v.endsWith(mm)?(x=v.slice(0,-1),S=!0):v.startsWith(mm)&&(x=v.slice(1),S=!0);const j=p&&p>g?p-g:void 0;return nx(u,S,x,j)};if(n){const s=n+tx,u=a;a=c=>c.startsWith(s)?u(c.slice(s.length)):nx(i2,!1,c,void 0,!0)}if(i){const s=a;a=u=>i({className:u,parseClassName:s})}return a},l2=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,a)=>{n.set(i,1e6+a)}),i=>{const a=[];let s=[];for(let u=0;u<i.length;u++){const c=i[u],d=c[0]==="[",g=n.has(c);d||g?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(c)):s.push(c)}return s.length>0&&(s.sort(),a.push(...s)),a}},s2=e=>({cache:r2(e.cacheSize),parseClassName:a2(e),sortModifiers:l2(e),...Yk(e)}),o2=/\s+/,u2=(e,n)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:u}=n,c=[],d=e.trim().split(o2);let g="";for(let p=d.length-1;p>=0;p-=1){const y=d[p],{isExternal:v,modifiers:x,hasImportantModifier:S,baseClassName:j,maybePostfixModifierPosition:C}=i(y);if(v){g=y+(g.length>0?" "+g:g);continue}let T=!!C,k=a(T?j.substring(0,C):j);if(!k){if(!T){g=y+(g.length>0?" "+g:g);continue}if(k=a(j),!k){g=y+(g.length>0?" "+g:g);continue}T=!1}const P=x.length===0?"":x.length===1?x[0]:u(x).join(":"),U=S?P+mm:P,H=U+k;if(c.indexOf(H)>-1)continue;c.push(H);const K=s(k,T);for(let L=0;L<K.length;++L){const V=K[L];c.push(U+V)}g=y+(g.length>0?" "+g:g)}return g},c2=(...e)=>{let n=0,i,a,s="";for(;n<e.length;)(i=e[n++])&&(a=I1(i))&&(s&&(s+=" "),s+=a);return s},I1=e=>{if(typeof e=="string")return e;let n,i="";for(let a=0;a<e.length;a++)e[a]&&(n=I1(e[a]))&&(i&&(i+=" "),i+=n);return i},f2=(e,...n)=>{let i,a,s,u;const c=g=>{const p=n.reduce((y,v)=>v(y),e());return i=s2(p),a=i.cache.get,s=i.cache.set,u=d,d(g)},d=g=>{const p=a(g);if(p)return p;const y=u2(g,i);return s(g,y),y};return u=c,(...g)=>u(c2(...g))},d2=[],Qt=e=>{const n=i=>i[e]||d2;return n.isThemeGetter=!0,n},B1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,q1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,m2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p2=/\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$/,g2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,y2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Li=e=>h2.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),Ii=e=>!!e&&Number.isInteger(Number(e)),Nh=e=>e.endsWith("%")&&He(e.slice(0,-1)),ei=e=>m2.test(e),P1=()=>!0,b2=e=>p2.test(e)&&!g2.test(e),Ym=()=>!1,x2=e=>y2.test(e),S2=e=>v2.test(e),w2=e=>!ye(e)&&!ve(e),E2=e=>ia(e,F1,Ym),ye=e=>B1.test(e),_a=e=>ia(e,$1,b2),rx=e=>ia(e,z2,He),C2=e=>ia(e,Q1,P1),N2=e=>ia(e,V1,Ym),ix=e=>ia(e,H1,Ym),_2=e=>ia(e,Z1,S2),lc=e=>ia(e,Y1,x2),ve=e=>q1.test(e),so=e=>Pa(e,$1),j2=e=>Pa(e,V1),ax=e=>Pa(e,H1),k2=e=>Pa(e,F1),T2=e=>Pa(e,Z1),sc=e=>Pa(e,Y1,!0),A2=e=>Pa(e,Q1,!0),ia=(e,n,i)=>{const a=B1.exec(e);return a?a[1]?n(a[1]):i(a[2]):!1},Pa=(e,n,i=!1)=>{const a=q1.exec(e);return a?a[1]?n(a[1]):i:!1},H1=e=>e==="position"||e==="percentage",Z1=e=>e==="image"||e==="url",F1=e=>e==="length"||e==="size"||e==="bg-size",$1=e=>e==="length",z2=e=>e==="number",V1=e=>e==="family-name",Q1=e=>e==="number"||e==="weight",Y1=e=>e==="shadow",O2=()=>{const e=Qt("color"),n=Qt("font"),i=Qt("text"),a=Qt("font-weight"),s=Qt("tracking"),u=Qt("leading"),c=Qt("breakpoint"),d=Qt("container"),g=Qt("spacing"),p=Qt("radius"),y=Qt("shadow"),v=Qt("inset-shadow"),x=Qt("text-shadow"),S=Qt("drop-shadow"),j=Qt("blur"),C=Qt("perspective"),T=Qt("aspect"),k=Qt("ease"),P=Qt("animate"),U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],K=()=>[...H(),ve,ye],L=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],D=()=>[ve,ye,g],B=()=>[Li,"full","auto",...D()],ie=()=>[Ii,"none","subgrid",ve,ye],se=()=>["auto",{span:["full",Ii,ve,ye]},Ii,ve,ye],le=()=>[Ii,"auto",ve,ye],ke=()=>["auto","min","max","fr",ve,ye],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...D()],re=()=>[Li,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],me=()=>[Li,"screen","full","dvw","lvw","svw","min","max","fit",...D()],Ae=()=>[Li,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],N=()=>[e,ve,ye],R=()=>[...H(),ax,ix,{position:[ve,ye]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",k2,E2,{size:[ve,ye]}],ue=()=>[Nh,so,_a],he=()=>["","none","full",p,ve,ye],ce=()=>["",He,so,_a],Re=()=>["solid","dashed","dotted","double"],We=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],je=()=>[He,Nh,ax,ix],Gt=()=>["","none",j,ve,ye],Dt=()=>["none",He,ve,ye],Ue=()=>["none",He,ve,ye],Kt=()=>[He,ve,ye],Ft=()=>[Li,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ei],breakpoint:[ei],color:[P1],container:[ei],"drop-shadow":[ei],ease:["in","out","in-out"],font:[w2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ei],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ei],shadow:[ei],spacing:["px",He],text:[ei],"text-shadow":[ei],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Li,ye,ve,T]}],container:["container"],columns:[{columns:[He,ye,ve,d]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:K()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Ii,"auto",ve,ye]}],basis:[{basis:[Li,"full","auto",d,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Li,"auto","initial","none",ye]}],grow:[{grow:["",He,ve,ye]}],shrink:[{shrink:["",He,ve,ye]}],order:[{order:[Ii,"first","last","none",ve,ye]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ke()}],"auto-rows":[{"auto-rows":ke()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],"inline-size":[{inline:["auto",...me()]}],"min-inline-size":[{"min-inline":["auto",...me()]}],"max-inline-size":[{"max-inline":["none",...me()]}],"block-size":[{block:["auto",...Ae()]}],"min-block-size":[{"min-block":["auto",...Ae()]}],"max-block-size":[{"max-block":["none",...Ae()]}],w:[{w:[d,"screen",...re()]}],"min-w":[{"min-w":[d,"screen","none",...re()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",i,so,_a]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,A2,C2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nh,ye]}],"font-family":[{font:[j2,N2,n]}],"font-features":[{"font-features":[ye]}],"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:[s,ve,ye]}],"line-clamp":[{"line-clamp":[He,"none",ve,rx]}],leading:[{leading:[u,...D()]}],"list-image":[{"list-image":["none",ve,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",ve,_a]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[He,"auto",ve,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,ye]}],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",ve,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ii,ve,ye],radial:["",ve,ye],conic:[Ii,ve,ye]},T2,_2]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Re(),"hidden","none"]}],"divide-style":[{divide:[...Re(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...Re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,ve,ye]}],"outline-w":[{outline:["",He,so,_a]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",y,sc,lc]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",v,sc,lc]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[He,_a]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",x,sc,lc]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[He,ve,ye]}],"mix-blend":[{"mix-blend":[...We(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":We()}],"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":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":je()}],"mask-image-linear-to-pos":[{"mask-linear-to":je()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":je()}],"mask-image-t-to-pos":[{"mask-t-to":je()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":je()}],"mask-image-r-to-pos":[{"mask-r-to":je()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":je()}],"mask-image-b-to-pos":[{"mask-b-to":je()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":je()}],"mask-image-l-to-pos":[{"mask-l-to":je()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":je()}],"mask-image-x-to-pos":[{"mask-x-to":je()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":je()}],"mask-image-y-to-pos":[{"mask-y-to":je()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[ve,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":je()}],"mask-image-radial-to-pos":[{"mask-radial-to":je()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":H()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":je()}],"mask-image-conic-to-pos":[{"mask-conic-to":je()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,ye]}],filter:[{filter:["","none",ve,ye]}],blur:[{blur:Gt()}],brightness:[{brightness:[He,ve,ye]}],contrast:[{contrast:[He,ve,ye]}],"drop-shadow":[{"drop-shadow":["","none",S,sc,lc]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",He,ve,ye]}],"hue-rotate":[{"hue-rotate":[He,ve,ye]}],invert:[{invert:["",He,ve,ye]}],saturate:[{saturate:[He,ve,ye]}],sepia:[{sepia:["",He,ve,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,ye]}],"backdrop-blur":[{"backdrop-blur":Gt()}],"backdrop-brightness":[{"backdrop-brightness":[He,ve,ye]}],"backdrop-contrast":[{"backdrop-contrast":[He,ve,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,ve,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,ve,ye]}],"backdrop-invert":[{"backdrop-invert":["",He,ve,ye]}],"backdrop-opacity":[{"backdrop-opacity":[He,ve,ye]}],"backdrop-saturate":[{"backdrop-saturate":[He,ve,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",He,ve,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",ve,ye]}],ease:[{ease:["linear","initial",k,ve,ye]}],delay:[{delay:[He,ve,ye]}],animate:[{animate:["none",P,ve,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ve,ye]}],"perspective-origin":[{"perspective-origin":K()}],rotate:[{rotate:Dt()}],"rotate-x":[{"rotate-x":Dt()}],"rotate-y":[{"rotate-y":Dt()}],"rotate-z":[{"rotate-z":Dt()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:Kt()}],"skew-x":[{"skew-x":Kt()}],"skew-y":[{"skew-y":Kt()}],transform:[{transform:[ve,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:K()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ft()}],"translate-x":[{"translate-x":Ft()}],"translate-y":[{"translate-y":Ft()}],"translate-z":[{"translate-z":Ft()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",ve,ye]}],"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":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",ve,ye]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[He,so,_a,rx]}],stroke:[{stroke:["none",...N()]}],"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"]}},R2=f2(O2);function Oe(...e){return R2(M1(e))}function fn(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 Eo(e){const n=new URLSearchParams;e!=null&&e.limit&&n.set("limit",String(e.limit)),e!=null&&e.cursor&&n.set("cursor",e.cursor),e!=null&&e.severity&&n.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&n.set("read",String(e.read)),e!=null&&e.agentId&&n.set("agentId",e.agentId);const i=n.toString();return De.get(`/admin/notifications${i?`?${i}`:""}`)}function G1(e){return De.post(`/admin/notifications/${e}/read`)}function M2(){return De.post("/admin/notifications/read-all")}function Gm(e){const n=new URLSearchParams;e!=null&&e.limit&&n.set("limit",String(e.limit)),e!=null&&e.cursor&&n.set("cursor",e.cursor),e!=null&&e.type&&n.set("type",e.type);const i=n.toString();return De.get(`/admin/agents${i?`?${i}`:""}`)}function D2(e){return De.get(`/admin/agents/${encodeURIComponent(e)}`)}function U2(e){return De.post("/admin/agents",e)}function lx(e,n){return De.patch(`/admin/agents/${encodeURIComponent(e)}`,n)}function L2(e){return De.delete(`/admin/agents/${encodeURIComponent(e)}`)}function I2(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function B2(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function q2(e,n){return De.post(`/admin/agents/${encodeURIComponent(e)}/provision`,{clientId:n})}function P2(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function hr(){const{data:e}=Ke({queryKey:["agents","name-map"],queryFn:()=>Gm({limit:100}),staleTime:3e4});return w.useMemo(()=>{const n=new Map;if(e!=null&&e.items)for(const i of e.items)n.set(i.uuid,i.name??i.displayName??i.uuid);return i=>i?n.get(i)??i:"—"},[e])}function H2(e){switch(e){case"high":return"bg-red-500";case"medium":return"bg-yellow-500";default:return"bg-gray-400"}}function Z2(e){const n=Date.now()-new Date(e).getTime(),i=Math.floor(n/6e4);if(i<1)return"just now";if(i<60)return`${i}m`;const a=Math.floor(i/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function F2(){var v;const[e,n]=w.useState(!1),i=w.useRef(null),a=ra(),s=hr(),{data:u}=Ke({queryKey:["notifications","bell"],queryFn:()=>Eo({limit:5}),refetchInterval:1e4}),{data:c}=Ke({queryKey:["notifications","unread-count"],queryFn:()=>Eo({read:!1,limit:100}),refetchInterval:1e4}),d=((v=c==null?void 0:c.items)==null?void 0:v.length)??0,g=d>0,p=w.useCallback(async x=>{x.read||G1(x.id).catch(()=>{}),n(!1),x.agentId&&x.chatId?a(`/?a=${x.agentId}&c=${x.chatId}`):x.agentId&&a(`/?a=${x.agentId}`)},[a]),y=w.useCallback(()=>{M2().catch(()=>{})},[]);return h.jsxs("div",{className:"relative",children:[h.jsxs("button",{type:"button",onClick:()=>n(!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:[h.jsx(uk,{className:"h-4 w-4"}),g&&h.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:d>99?"99+":d})]}),e&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>n(!1)}),h.jsxs("div",{ref:i,className:"absolute right-0 top-full mt-1 z-50 w-80 rounded-md border border-border bg-card shadow-lg",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[h.jsx("span",{className:"text-sm font-medium",children:"Notifications"}),g&&h.jsx("button",{type:"button",onClick:y,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all"})]}),h.jsx("div",{className:"max-h-80 overflow-y-auto",children:!(u!=null&&u.items)||u.items.length===0?h.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No notifications"}):u.items.map(x=>h.jsxs("button",{type:"button",onClick:()=>p(x),className:Oe("w-full flex items-start gap-2 px-3 py-2 text-left hover:bg-accent/50 transition-colors",!x.read&&"bg-accent/20"),children:[h.jsx("span",{className:Oe("mt-1.5 h-2 w-2 shrink-0 rounded-full",H2(x.severity))}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:Oe("text-sm truncate",!x.read&&"font-medium"),children:x.message}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.agentId?s(x.agentId):""," ",Z2(x.createdAt)]})]})]},x.id))})]})]})]})}const sx=[{to:"/",label:"Workspace",end:!0},{to:"/agents",label:"Agents",end:!1}],$2={to:"/admin",label:"Admin",end:!1};function V2(){const{role:e,logout:n}=os(),a=e==="admin"?[...sx,$2]:sx,s=ir(),u=s.pathname==="/"||s.search.includes("a=");return h.jsxs("div",{className:"flex flex-col h-screen bg-background",children:[h.jsxs("header",{className:"relative h-12 shrink-0 border-b border-border bg-card flex items-center px-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(fk,{className:"h-5 w-5 text-primary"}),h.jsx("span",{className:"font-semibold text-sm tracking-tight",children:"First Tree"})]}),h.jsx("nav",{className:"absolute inset-x-0 flex items-center justify-center gap-1 pointer-events-none",children:a.map(c=>h.jsx(w1,{to:c.to,end:c.end,className:({isActive:d})=>Oe("pointer-events-auto px-3 py-1.5 rounded-md text-sm font-medium transition-colors",d?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:c.label},c.to))}),h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[h.jsx(F2,{}),h.jsx("button",{type:"button",onClick:n,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:h.jsx(Ck,{className:"h-4 w-4"})})]})]}),u?h.jsx(fm,{}):h.jsx("main",{className:"flex-1 overflow-auto",children:h.jsx("div",{className:"p-6 max-w-5xl mx-auto",children:h.jsx(fm,{})})})]})}function K1(){return De.get("/admin/adapter-mappings")}function Q2(e){return De.post("/admin/adapter-mappings",e)}function Y2(e){return De.delete(`/admin/adapter-mappings/${e}`)}function X1(){return De.get("/admin/adapters/status")}function J1(){return De.get("/admin/adapters")}function G2(e){return De.post("/admin/adapters",e)}function K2(e,n){return De.patch(`/admin/adapters/${e}`,n)}function X2(e){return De.delete(`/admin/adapters/${e}`)}const ox=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ux=M1,W1=(e,n)=>i=>{var a;if((n==null?void 0:n.variants)==null)return ux(e,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:s,defaultVariants:u}=n,c=Object.keys(s).map(p=>{const y=i==null?void 0:i[p],v=u==null?void 0:u[p];if(y===null)return null;const x=ox(y)||ox(v);return s[p][x]}),d=i&&Object.entries(i).reduce((p,y)=>{let[v,x]=y;return x===void 0||(p[v]=x),p},{}),g=n==null||(a=n.compoundVariants)===null||a===void 0?void 0:a.reduce((p,y)=>{let{class:v,className:x,...S}=y;return Object.entries(S).every(j=>{let[C,T]=j;return Array.isArray(T)?T.includes({...u,...d}[C]):{...u,...d}[C]===T})?[...p,v,x]:p},[]);return ux(e,c,g,i==null?void 0:i.class,i==null?void 0:i.className)},J2=W1("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive/10 text-destructive",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ht({className:e,variant:n,...i}){return h.jsx("div",{className:Oe(J2({variant:n}),e),...i})}const fr=w.forwardRef(({className:e,...n},i)=>h.jsx("div",{ref:i,className:Oe("rounded-xl border bg-card text-card-foreground shadow-sm",e),...n}));fr.displayName="Card";const Cr=w.forwardRef(({className:e,...n},i)=>h.jsx("div",{ref:i,className:Oe("flex flex-col space-y-1.5 p-6",e),...n}));Cr.displayName="CardHeader";const Nr=w.forwardRef(({className:e,...n},i)=>h.jsx("div",{ref:i,className:Oe("font-semibold leading-none tracking-tight",e),...n}));Nr.displayName="CardTitle";const eS=w.forwardRef(({className:e,...n},i)=>h.jsx("div",{ref:i,className:Oe("text-sm text-muted-foreground",e),...n}));eS.displayName="CardDescription";const dr=w.forwardRef(({className:e,...n},i)=>h.jsx("div",{ref:i,className:Oe("p-6 pt-0",e),...n}));dr.displayName="CardContent";const W2=w.forwardRef(({className:e,...n},i)=>h.jsx("div",{ref:i,className:Oe("flex items-center p-6 pt-0",e),...n}));W2.displayName="CardFooter";const Tr=w.forwardRef(({className:e,...n},i)=>h.jsx("div",{className:"relative w-full overflow-auto",children:h.jsx("table",{ref:i,className:Oe("w-full caption-bottom text-sm",e),...n})}));Tr.displayName="Table";const Ar=w.forwardRef(({className:e,...n},i)=>h.jsx("thead",{ref:i,className:Oe("[&_tr]:border-b",e),...n}));Ar.displayName="TableHeader";const zr=w.forwardRef(({className:e,...n},i)=>h.jsx("tbody",{ref:i,className:Oe("[&_tr:last-child]:border-0",e),...n}));zr.displayName="TableBody";const nt=w.forwardRef(({className:e,...n},i)=>h.jsx("tr",{ref:i,className:Oe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n}));nt.displayName="TableRow";const Se=w.forwardRef(({className:e,...n},i)=>h.jsx("th",{ref:i,className:Oe("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n}));Se.displayName="TableHead";const xe=w.forwardRef(({className:e,...n},i)=>h.jsx("td",{ref:i,className:Oe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n}));xe.displayName="TableCell";function eT(){const e=ra(),n=hr(),{data:i,isLoading:a}=Ke({queryKey:["adapters"],queryFn:J1}),{data:s,isLoading:u}=Ke({queryKey:["adapter-mappings"],queryFn:K1}),{data:c}=Ke({queryKey:["adapter-statuses"],queryFn:X1,refetchInterval:15e3}),d=a||u;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-semibold",children:"Platform Bindings"}),h.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Overview of all platform bindings. Manage bindings from each Agent's detail page."})]}),h.jsxs(fr,{children:[h.jsx(Cr,{children:h.jsx(Nr,{children:"Bot Bindings"})}),h.jsx(dr,{children:h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{children:"Agent"}),h.jsx(Se,{children:"Platform"}),h.jsx(Se,{children:"Status"}),h.jsx(Se,{children:"Connection"}),h.jsx(Se,{children:"Created"})]})}),h.jsx(zr,{children:d?h.jsx(nt,{children:h.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):i!=null&&i.length?i.map(g=>{const p=c==null?void 0:c.find(y=>y.configId===g.id);return h.jsxs(nt,{className:"cursor-pointer",onClick:()=>e(`/agents/${g.agentId}`),children:[h.jsx(xe,{className:"font-mono text-sm",children:n(g.agentId)}),h.jsx(xe,{children:h.jsx(Ht,{variant:"secondary",children:g.platform})}),h.jsx(xe,{children:h.jsx(Ht,{variant:g.status==="active"?"default":"destructive",children:g.status})}),h.jsx(xe,{children:h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:Oe("inline-block h-2 w-2 rounded-full",p!=null&&p.connected?"bg-green-500":"bg-gray-300")}),h.jsx("span",{className:"text-xs text-muted-foreground",children:p!=null&&p.connected?"Online":"Offline"})]})}),h.jsx(xe,{className:"text-muted-foreground",children:fn(g.createdAt)})]},g.id)}):h.jsx(nt,{children:h.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No bot bindings"})})})]})})]}),h.jsxs(fr,{children:[h.jsx(Cr,{children:h.jsx(Nr,{children:"User Bindings"})}),h.jsx(dr,{children:h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{children:"Agent"}),h.jsx(Se,{children:"Platform"}),h.jsx(Se,{children:"External User ID"}),h.jsx(Se,{children:"Display Name"}),h.jsx(Se,{children:"Bound Via"}),h.jsx(Se,{children:"Created"})]})}),h.jsx(zr,{children:d?h.jsx(nt,{children:h.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):s!=null&&s.length?s.map(g=>h.jsxs(nt,{className:"cursor-pointer",onClick:()=>e(`/agents/${g.agentId}`),children:[h.jsx(xe,{className:"font-mono text-sm",children:n(g.agentId)}),h.jsx(xe,{children:h.jsx(Ht,{variant:"secondary",children:g.platform})}),h.jsx(xe,{className:"font-mono text-sm",children:g.externalUserId}),h.jsx(xe,{children:g.displayName??"—"}),h.jsx(xe,{children:h.jsx(Ht,{variant:"outline",children:g.boundVia??"—"})}),h.jsx(xe,{className:"text-muted-foreground",children:fn(g.createdAt)})]},g.id)):h.jsx(nt,{children:h.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No user bindings"})})})]})})]})]})}function Uo(){return De.get("/admin/agents/activity")}function Km(){return De.get("/admin/clients")}function tT(e){return De.post(`/admin/clients/${e}/disconnect`)}function nT(){return De.post("/connect-tokens")}function cx(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Xm(...e){return n=>{let i=!1;const a=e.map(s=>{const u=cx(s,n);return!i&&typeof u=="function"&&(i=!0),u});if(i)return()=>{for(let s=0;s<a.length;s++){const u=a[s];typeof u=="function"?u():cx(e[s],null)}}}}function Ha(...e){return w.useCallback(Xm(...e),e)}var rT=Symbol.for("react.lazy"),Tc=Rm[" use ".trim().toString()];function iT(e){return typeof e=="object"&&e!==null&&"then"in e}function tS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rT&&"_payload"in e&&iT(e._payload)}function nS(e){const n=lT(e),i=w.forwardRef((a,s)=>{let{children:u,...c}=a;tS(u)&&typeof Tc=="function"&&(u=Tc(u._payload));const d=w.Children.toArray(u),g=d.find(oT);if(g){const p=g.props.children,y=d.map(v=>v===g?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:v);return h.jsx(n,{...c,ref:s,children:w.isValidElement(p)?w.cloneElement(p,void 0,y):null})}return h.jsx(n,{...c,ref:s,children:u})});return i.displayName=`${e}.Slot`,i}var aT=nS("Slot");function lT(e){const n=w.forwardRef((i,a)=>{let{children:s,...u}=i;if(tS(s)&&typeof Tc=="function"&&(s=Tc(s._payload)),w.isValidElement(s)){const c=cT(s),d=uT(u,s.props);return s.type!==w.Fragment&&(d.ref=a?Xm(a,c):c),w.cloneElement(s,d)}return w.Children.count(s)>1?w.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var sT=Symbol("radix.slottable");function oT(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sT}function uT(e,n){const i={...n};for(const a in n){const s=e[a],u=n[a];/^on[A-Z]/.test(a)?s&&u?i[a]=(...d)=>{const g=u(...d);return s(...d),g}:s&&(i[a]=s):a==="style"?i[a]={...s,...u}:a==="className"&&(i[a]=[s,u].filter(Boolean).join(" "))}return{...e,...i}}function cT(e){var a,s;let n=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}const fT=W1("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",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),qe=w.forwardRef(({className:e,variant:n,size:i,asChild:a=!1,...s},u)=>{const c=a?aT:"button";return h.jsx(c,{className:Oe(fT({variant:n,size:i,className:e})),ref:u,...s})});qe.displayName="Button";function rS({state:e}){if(!e)return h.jsx("span",{className:"text-xs text-muted-foreground",children:"offline"});const n={idle:"text-green-600",working:"text-blue-600",blocked:"text-yellow-600",error:"text-red-600"};return h.jsx("span",{className:Oe("text-xs font-medium",n[e]??"text-muted-foreground"),children:e})}function dT(){const[e,n]=w.useState(null),[i,a]=w.useState(!1),s=bt({mutationFn:nT,onSuccess:c=>{n(c),a(!1)}}),u=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return e?h.jsxs("div",{className:"mb-4 p-3 border border-border rounded-lg bg-muted/30 space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[h.jsx(Wb,{className:"h-4 w-4 shrink-0"}),h.jsxs("span",{children:["Run this command in your terminal (expires in ",e.expiresIn/60," min):"]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 text-xs bg-background border border-border rounded px-3 py-2 font-mono break-all select-all",children:e.command}),h.jsxs(qe,{variant:"outline",size:"sm",onClick:u,className:"shrink-0",children:[i?h.jsx(z1,{className:"h-3 w-3 mr-1"}):h.jsx(Pc,{className:"h-3 w-3 mr-1"}),i?"Copied":"Copy"]})]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"This token is single-use. Generate a new one if it expires."})]}):h.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 border border-border rounded-lg bg-muted/30",children:[h.jsx(Wb,{className:"h-4 w-4 text-muted-foreground shrink-0"}),h.jsx("span",{className:"text-sm text-muted-foreground",children:"Connect a new client to this Hub"}),h.jsx(qe,{variant:"outline",size:"sm",onClick:()=>s.mutate(),disabled:s.isPending,children:s.isPending?"Generating...":"Generate Connect Command"})]})}function hT(){const e=nr(),n=hr(),[i,a]=w.useState(null),[s,u]=w.useState(null),{data:c}=Ke({queryKey:["clients"],queryFn:Km,refetchInterval:1e4}),{data:d}=Ke({queryKey:["activity"],queryFn:Uo,refetchInterval:1e4}),g=bt({mutationFn:tT,onSuccess:()=>{u(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),p=new Map;if(d!=null&&d.agents){for(const v of d.agents)if(v.clientId){const x=p.get(v.clientId)??[];x.push(v),p.set(v.clientId,x)}}const y=v=>p.get(v)??[];return h.jsxs("div",{children:[h.jsx(dT,{}),s&&h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:h.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 max-w-md w-full shadow-lg",children:[h.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Disconnect Client"}),h.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["This will disconnect"," ",h.jsx("span",{className:"font-medium text-foreground",children:s.hostname??s.id.slice(0,8)})," ","and affect all bound agents:"]}),h.jsx("ul",{className:"mb-4 space-y-1",children:y(s.id).length===0?h.jsx("li",{className:"text-sm text-muted-foreground",children:"No bound agents"}):y(s.id).map(v=>h.jsxs("li",{className:"text-sm flex items-center gap-2",children:[h.jsx("span",{className:"font-medium",children:n(v.agentId)}),h.jsx(rS,{state:v.runtimeState})]},v.agentId))}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(qe,{variant:"outline",size:"sm",onClick:()=>u(null),children:"Cancel"}),h.jsx(qe,{variant:"destructive",size:"sm",onClick:()=>g.mutate(s.id),disabled:g.isPending,children:g.isPending?"Disconnecting...":"Disconnect"})]})]})}),!c||c.length===0?h.jsx("div",{className:"text-center text-muted-foreground py-12",children:"No connected clients. Use the button above to generate a connect command."}):h.jsx("div",{className:"border rounded-lg overflow-hidden",children:h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{className:"w-8"}),h.jsx(Se,{children:"Hostname"}),h.jsx(Se,{children:"OS"}),h.jsx(Se,{children:"SDK"}),h.jsx(Se,{children:"Agents"}),h.jsx(Se,{children:"Connected"}),h.jsx(Se,{children:"Status"}),h.jsx(Se,{})]})}),h.jsx(zr,{children:c.map(v=>{const x=i===v.id,S=y(v.id);return h.jsx(mT,{client:v,boundAgents:S,isExpanded:x,agentName:n,onToggle:()=>a(x?null:v.id),onDisconnect:()=>u(v)},v.id)})})]})})]})}function mT({client:e,boundAgents:n,isExpanded:i,agentName:a,onToggle:s,onDisconnect:u}){return h.jsxs(h.Fragment,{children:[h.jsxs(nt,{className:"cursor-pointer hover:bg-accent/50",onClick:s,children:[h.jsx(xe,{className:"px-2",children:i?h.jsx(gk,{className:"h-4 w-4"}):h.jsx(O1,{className:"h-4 w-4"})}),h.jsx(xe,{className:"font-medium",children:e.hostname??"—"}),h.jsx(xe,{className:"text-muted-foreground",children:e.os??"—"}),h.jsx(xe,{className:"font-mono text-xs text-muted-foreground",children:e.sdkVersion??"—"}),h.jsx(xe,{children:e.agentCount}),h.jsx(xe,{className:"text-muted-foreground text-sm",children:e.connectedAt?fn(e.connectedAt):"—"}),h.jsx(xe,{children:h.jsx(Ht,{variant:e.status==="connected"?"default":"secondary",children:e.status})}),h.jsx(xe,{children:h.jsxs(qe,{variant:"outline",size:"sm",onClick:c=>{c.stopPropagation(),u()},children:[h.jsx(Hk,{className:"h-3 w-3 mr-1"}),"Disconnect"]})})]}),i&&h.jsx(nt,{children:h.jsxs(xe,{colSpan:8,className:"bg-muted/30 px-8 py-3",children:[h.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:["Bound Agents (",n.length,")"]}),n.length===0?h.jsx("div",{className:"text-sm text-muted-foreground",children:"No agents bound to this client"}):h.jsx("div",{className:"space-y-1",children:n.map(c=>h.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[h.jsx("span",{className:"font-medium",children:a(c.agentId)}),h.jsx(rS,{state:c.runtimeState}),h.jsx("span",{className:"text-xs text-muted-foreground",children:c.activeSessions!==null?`${c.activeSessions}/${c.totalSessions??0} sessions`:""})]},c.agentId))})]})})]})}function ee(e,n,i){function a(d,g){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),n(d,g);const p=c.prototype,y=Object.keys(p);for(let v=0;v<y.length;v++){const x=y[v];x in d||(d[x]=p[x].bind(d))}}const s=(i==null?void 0:i.Parent)??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function c(d){var g;const p=i!=null&&i.Parent?new u:this;a(p,d),(g=p._zod).deferred??(g.deferred=[]);for(const y of p._zod.deferred)y();return p}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>{var g,p;return i!=null&&i.Parent&&d instanceof i.Parent?!0:(p=(g=d==null?void 0:d._zod)==null?void 0:g.traits)==null?void 0:p.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class Bl extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class iS extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const aS={};function ta(e){return aS}function lS(e){const n=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>n.indexOf(+a)===-1).map(([a,s])=>s)}function pm(e,n){return typeof n=="bigint"?n.toString():n}function Jm(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Wm(e){return e==null}function ep(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function pT(e,n){const i=(e.toString().split(".")[1]||"").length,a=n.toString();let s=(a.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(a)){const g=a.match(/\d?e-(\d?)/);g!=null&&g[1]&&(s=Number.parseInt(g[1]))}const u=i>s?i:s,c=Number.parseInt(e.toFixed(u).replace(".","")),d=Number.parseInt(n.toFixed(u).replace(".",""));return c%d/10**u}const fx=Symbol("evaluating");function lt(e,n,i){let a;Object.defineProperty(e,n,{get(){if(a!==fx)return a===void 0&&(a=fx,a=i()),a},set(s){Object.defineProperty(e,n,{value:s})},configurable:!0})}function Za(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function aa(...e){const n={};for(const i of e){const a=Object.getOwnPropertyDescriptors(i);Object.assign(n,a)}return Object.defineProperties({},n)}function dx(e){return JSON.stringify(e)}function gT(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const sS="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ac(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const yT=Jm(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function rs(e){if(Ac(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(Ac(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function oS(e){return rs(e)?{...e}:Array.isArray(e)?[...e]:e}const vT=new Set(["string","number","symbol"]);function Hc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function la(e,n,i){const a=new e._zod.constr(n??e._zod.def);return(!n||i!=null&&i.parent)&&(a._zod.parent=e),a}function Ee(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if((n==null?void 0:n.message)!==void 0){if((n==null?void 0:n.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function bT(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const xT={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 ST(e,n){const i=e._zod.def,a=i.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=aa(e._zod.def,{get shape(){const c={};for(const d in n){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(c[d]=i.shape[d])}return Za(this,"shape",c),c},checks:[]});return la(e,u)}function wT(e,n){const i=e._zod.def,a=i.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=aa(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const d in n){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&delete c[d]}return Za(this,"shape",c),c},checks:[]});return la(e,u)}function ET(e,n){if(!rs(n))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const u=e._zod.def.shape;for(const c in n)if(Object.getOwnPropertyDescriptor(u,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=aa(e._zod.def,{get shape(){const u={...e._zod.def.shape,...n};return Za(this,"shape",u),u}});return la(e,s)}function CT(e,n){if(!rs(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=aa(e._zod.def,{get shape(){const a={...e._zod.def.shape,...n};return Za(this,"shape",a),a}});return la(e,i)}function NT(e,n){const i=aa(e._zod.def,{get shape(){const a={...e._zod.def.shape,...n._zod.def.shape};return Za(this,"shape",a),a},get catchall(){return n._zod.def.catchall},checks:[]});return la(e,i)}function _T(e,n,i){const s=n._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=aa(n._zod.def,{get shape(){const d=n._zod.def.shape,g={...d};if(i)for(const p in i){if(!(p in d))throw new Error(`Unrecognized key: "${p}"`);i[p]&&(g[p]=e?new e({type:"optional",innerType:d[p]}):d[p])}else for(const p in d)g[p]=e?new e({type:"optional",innerType:d[p]}):d[p];return Za(this,"shape",g),g},checks:[]});return la(n,c)}function jT(e,n,i){const a=aa(n._zod.def,{get shape(){const s=n._zod.def.shape,u={...s};if(i)for(const c in i){if(!(c in u))throw new Error(`Unrecognized key: "${c}"`);i[c]&&(u[c]=new e({type:"nonoptional",innerType:s[c]}))}else for(const c in s)u[c]=new e({type:"nonoptional",innerType:s[c]});return Za(this,"shape",u),u}});return la(n,a)}function Ll(e,n=0){var i;if(e.aborted===!0)return!0;for(let a=n;a<e.issues.length;a++)if(((i=e.issues[a])==null?void 0:i.continue)!==!0)return!0;return!1}function Il(e,n){return n.map(i=>{var a;return(a=i).path??(a.path=[]),i.path.unshift(e),i})}function oc(e){return typeof e=="string"?e:e==null?void 0:e.message}function na(e,n,i){var s,u,c,d,g,p;const a={...e,path:e.path??[]};if(!e.message){const y=oc((c=(u=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:u.error)==null?void 0:c.call(u,e))??oc((d=n==null?void 0:n.error)==null?void 0:d.call(n,e))??oc((g=i.customError)==null?void 0:g.call(i,e))??oc((p=i.localeError)==null?void 0:p.call(i,e))??"Invalid input";a.message=y}return delete a.inst,delete a.continue,n!=null&&n.reportInput||delete a.input,a}function tp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Co(...e){const[n,i,a]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:a}:{...n}}const uS=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,pm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cS=ee("$ZodError",uS),fS=ee("$ZodError",uS,{Parent:Error});function kT(e,n=i=>i.message){const i={},a=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(n(s))):a.push(n(s));return{formErrors:a,fieldErrors:i}}function TT(e,n=i=>i.message){const i={_errors:[]},a=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>a({issues:c}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)i._errors.push(n(u));else{let c=i,d=0;for(;d<u.path.length;){const g=u.path[d];d===u.path.length-1?(c[g]=c[g]||{_errors:[]},c[g]._errors.push(n(u))):c[g]=c[g]||{_errors:[]},c=c[g],d++}}};return a(e),i}const np=e=>(n,i,a,s)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},c=n._zod.run({value:i,issues:[]},u);if(c instanceof Promise)throw new Bl;if(c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(g=>na(g,u,ta())));throw sS(d,s==null?void 0:s.callee),d}return c.value},rp=e=>async(n,i,a,s)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let c=n._zod.run({value:i,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(g=>na(g,u,ta())));throw sS(d,s==null?void 0:s.callee),d}return c.value},Zc=e=>(n,i,a)=>{const s=a?{...a,async:!1}:{async:!1},u=n._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new Bl;return u.issues.length?{success:!1,error:new(e??cS)(u.issues.map(c=>na(c,s,ta())))}:{success:!0,data:u.value}},AT=Zc(fS),Fc=e=>async(n,i,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let u=n._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>na(c,s,ta())))}:{success:!0,data:u.value}},zT=Fc(fS),OT=e=>(n,i,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return np(e)(n,i,s)},RT=e=>(n,i,a)=>np(e)(n,i,a),MT=e=>async(n,i,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return rp(e)(n,i,s)},DT=e=>async(n,i,a)=>rp(e)(n,i,a),UT=e=>(n,i,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Zc(e)(n,i,s)},LT=e=>(n,i,a)=>Zc(e)(n,i,a),IT=e=>async(n,i,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Fc(e)(n,i,s)},BT=e=>async(n,i,a)=>Fc(e)(n,i,a),qT=/^[cC][^\s-]{8,}$/,PT=/^[0-9a-z]+$/,HT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ZT=/^[0-9a-vA-V]{20}$/,FT=/^[A-Za-z0-9]{27}$/,$T=/^[a-zA-Z0-9_-]{21}$/,VT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,QT=/^([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})$/,hx=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)$/,YT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,GT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function KT(){return new RegExp(GT,"u")}const XT=/^(?:(?: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])$/,JT=/^(([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}|:))$/,WT=/^((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])$/,eA=/^(([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])$/,tA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dS=/^[A-Za-z0-9_-]*$/,nA=/^\+[1-9]\d{6,14}$/,hS="(?:(?:\\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])))",rA=new RegExp(`^${hS}$`);function mS(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function iA(e){return new RegExp(`^${mS(e)}$`)}function aA(e){const n=mS({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${n}(?:${i.join("|")})`;return new RegExp(`^${hS}T(?:${a})$`)}const lA=e=>{const n=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},sA=/^-?\d+$/,pS=/^-?\d+(?:\.\d+)?$/,oA=/^(?:true|false)$/i,uA=/^[^A-Z]*$/,cA=/^[^a-z]*$/,Tn=ee("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),gS={number:"number",bigint:"bigint",object:"date"},yS=ee("$ZodCheckLessThan",(e,n)=>{Tn.init(e,n);const i=gS[typeof n.value];e._zod.onattach.push(a=>{const s=a._zod.bag,u=(n.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<u&&(n.inclusive?s.maximum=n.value:s.exclusiveMaximum=n.value)}),e._zod.check=a=>{(n.inclusive?a.value<=n.value:a.value<n.value)||a.issues.push({origin:i,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:a.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),vS=ee("$ZodCheckGreaterThan",(e,n)=>{Tn.init(e,n);const i=gS[typeof n.value];e._zod.onattach.push(a=>{const s=a._zod.bag,u=(n.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>u&&(n.inclusive?s.minimum=n.value:s.exclusiveMinimum=n.value)}),e._zod.check=a=>{(n.inclusive?a.value>=n.value:a.value>n.value)||a.issues.push({origin:i,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:a.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),fA=ee("$ZodCheckMultipleOf",(e,n)=>{Tn.init(e,n),e._zod.onattach.push(i=>{var a;(a=i._zod.bag).multipleOf??(a.multipleOf=n.value)}),e._zod.check=i=>{if(typeof i.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%n.value===BigInt(0):pT(i.value,n.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:n.value,input:i.value,inst:e,continue:!n.abort})}}),dA=ee("$ZodCheckNumberFormat",(e,n)=>{var c;Tn.init(e,n),n.format=n.format||"float64";const i=(c=n.format)==null?void 0:c.includes("int"),a=i?"int":"number",[s,u]=xT[n.format];e._zod.onattach.push(d=>{const g=d._zod.bag;g.format=n.format,g.minimum=s,g.maximum=u,i&&(g.pattern=sA)}),e._zod.check=d=>{const g=d.value;if(i){if(!Number.isInteger(g)){d.issues.push({expected:a,format:n.format,code:"invalid_type",continue:!1,input:g,inst:e});return}if(!Number.isSafeInteger(g)){g>0?d.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!n.abort}):d.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!n.abort});return}}g<s&&d.issues.push({origin:"number",input:g,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!n.abort}),g>u&&d.issues.push({origin:"number",input:g,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!n.abort})}}),hA=ee("$ZodCheckMaxLength",(e,n)=>{var i;Tn.init(e,n),(i=e._zod.def).when??(i.when=a=>{const s=a.value;return!Wm(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<s&&(a._zod.bag.maximum=n.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=n.maximum)return;const c=tp(s);a.issues.push({origin:c,code:"too_big",maximum:n.maximum,inclusive:!0,input:s,inst:e,continue:!n.abort})}}),mA=ee("$ZodCheckMinLength",(e,n)=>{var i;Tn.init(e,n),(i=e._zod.def).when??(i.when=a=>{const s=a.value;return!Wm(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>s&&(a._zod.bag.minimum=n.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=n.minimum)return;const c=tp(s);a.issues.push({origin:c,code:"too_small",minimum:n.minimum,inclusive:!0,input:s,inst:e,continue:!n.abort})}}),pA=ee("$ZodCheckLengthEquals",(e,n)=>{var i;Tn.init(e,n),(i=e._zod.def).when??(i.when=a=>{const s=a.value;return!Wm(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=n.length,s.maximum=n.length,s.length=n.length}),e._zod.check=a=>{const s=a.value,u=s.length;if(u===n.length)return;const c=tp(s),d=u>n.length;a.issues.push({origin:c,...d?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!n.abort})}}),$c=ee("$ZodCheckStringFormat",(e,n)=>{var i,a;Tn.init(e,n),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=n.format,n.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(n.pattern))}),n.pattern?(i=e._zod).check??(i.check=s=>{n.pattern.lastIndex=0,!n.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:n.format,input:s.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(a=e._zod).check??(a.check=()=>{})}),gA=ee("$ZodCheckRegex",(e,n)=>{$c.init(e,n),e._zod.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),yA=ee("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=uA),$c.init(e,n)}),vA=ee("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=cA),$c.init(e,n)}),bA=ee("$ZodCheckIncludes",(e,n)=>{Tn.init(e,n);const i=Hc(n.includes),a=new RegExp(typeof n.position=="number"?`^.{${n.position}}${i}`:i);n.pattern=a,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=s=>{s.value.includes(n.includes,n.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:s.value,inst:e,continue:!n.abort})}}),xA=ee("$ZodCheckStartsWith",(e,n)=>{Tn.init(e,n);const i=new RegExp(`^${Hc(n.prefix)}.*`);n.pattern??(n.pattern=i),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=a=>{a.value.startsWith(n.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:a.value,inst:e,continue:!n.abort})}}),SA=ee("$ZodCheckEndsWith",(e,n)=>{Tn.init(e,n);const i=new RegExp(`.*${Hc(n.suffix)}$`);n.pattern??(n.pattern=i),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=a=>{a.value.endsWith(n.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:a.value,inst:e,continue:!n.abort})}}),wA=ee("$ZodCheckOverwrite",(e,n)=>{Tn.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class EA{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const a=n.split(`
216
- `).filter(c=>c),s=Math.min(...a.map(c=>c.length-c.trimStart().length)),u=a.map(c=>c.slice(s)).map(c=>" ".repeat(this.indent*2)+c);for(const c of u)this.content.push(c)}compile(){const n=Function,i=this==null?void 0:this.args,s=[...((this==null?void 0:this.content)??[""]).map(u=>` ${u}`)];return new n(...i,s.join(`
217
- `))}}const CA={major:4,minor:3,patch:6},zt=ee("$ZodType",(e,n)=>{var s;var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=CA;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const u of a)for(const c of u._zod.onattach)c(e);if(a.length===0)(i=e._zod).deferred??(i.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const u=(d,g,p)=>{let y=Ll(d),v;for(const x of g){if(x._zod.def.when){if(!x._zod.def.when(d))continue}else if(y)continue;const S=d.issues.length,j=x._zod.check(d);if(j instanceof Promise&&(p==null?void 0:p.async)===!1)throw new Bl;if(v||j instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await j,d.issues.length!==S&&(y||(y=Ll(d,S)))});else{if(d.issues.length===S)continue;y||(y=Ll(d,S))}}return v?v.then(()=>d):d},c=(d,g,p)=>{if(Ll(d))return d.aborted=!0,d;const y=u(g,a,p);if(y instanceof Promise){if(p.async===!1)throw new Bl;return y.then(v=>e._zod.parse(v,p))}return e._zod.parse(y,p)};e._zod.run=(d,g)=>{if(g.skipChecks)return e._zod.parse(d,g);if(g.direction==="backward"){const y=e._zod.parse({value:d.value,issues:[]},{...g,skipChecks:!0});return y instanceof Promise?y.then(v=>c(v,d,g)):c(y,d,g)}const p=e._zod.parse(d,g);if(p instanceof Promise){if(g.async===!1)throw new Bl;return p.then(y=>u(y,a,g))}return u(p,a,g)}}lt(e,"~standard",()=>({validate:u=>{var c;try{const d=AT(e,u);return d.success?{value:d.data}:{issues:(c=d.error)==null?void 0:c.issues}}catch{return zT(e,u).then(g=>{var p;return g.success?{value:g.data}:{issues:(p=g.error)==null?void 0:p.issues}})}},vendor:"zod",version:1}))}),ip=ee("$ZodString",(e,n)=>{var i;zt.init(e,n),e._zod.pattern=[...((i=e==null?void 0:e._zod.bag)==null?void 0:i.patterns)??[]].pop()??lA(e._zod.bag),e._zod.parse=(a,s)=>{if(n.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=ee("$ZodStringFormat",(e,n)=>{$c.init(e,n),ip.init(e,n)}),NA=ee("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=QT),Ct.init(e,n)}),_A=ee("$ZodUUID",(e,n)=>{if(n.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(a===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=hx(a))}else n.pattern??(n.pattern=hx());Ct.init(e,n)}),jA=ee("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=YT),Ct.init(e,n)}),kA=ee("$ZodURL",(e,n)=>{Ct.init(e,n),e._zod.check=i=>{try{const a=i.value.trim(),s=new URL(a);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:i.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:i.value,inst:e,continue:!n.abort})),n.normalize?i.value=s.href:i.value=a;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!n.abort})}}}),TA=ee("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=KT()),Ct.init(e,n)}),AA=ee("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=$T),Ct.init(e,n)}),zA=ee("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=qT),Ct.init(e,n)}),OA=ee("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=PT),Ct.init(e,n)}),RA=ee("$ZodULID",(e,n)=>{n.pattern??(n.pattern=HT),Ct.init(e,n)}),MA=ee("$ZodXID",(e,n)=>{n.pattern??(n.pattern=ZT),Ct.init(e,n)}),DA=ee("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=FT),Ct.init(e,n)}),UA=ee("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=aA(n)),Ct.init(e,n)}),LA=ee("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=rA),Ct.init(e,n)}),IA=ee("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=iA(n)),Ct.init(e,n)}),BA=ee("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=VT),Ct.init(e,n)}),qA=ee("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=XT),Ct.init(e,n),e._zod.bag.format="ipv4"}),PA=ee("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=JT),Ct.init(e,n),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!n.abort})}}}),HA=ee("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=WT),Ct.init(e,n)}),ZA=ee("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=eA),Ct.init(e,n),e._zod.check=i=>{const a=i.value.split("/");try{if(a.length!==2)throw new Error;const[s,u]=a;if(!u)throw new Error;const c=Number(u);if(`${c}`!==u)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${s}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!n.abort})}}});function bS(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const FA=ee("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=tA),Ct.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{bS(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}});function $A(e){if(!dS.test(e))return!1;const n=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return bS(i)}const VA=ee("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=dS),Ct.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{$A(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),QA=ee("$ZodE164",(e,n)=>{n.pattern??(n.pattern=nA),Ct.init(e,n)});function YA(e,n=null){try{const i=e.split(".");if(i.length!==3)return!1;const[a]=i;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||n&&(!("alg"in s)||s.alg!==n))}catch{return!1}}const GA=ee("$ZodJWT",(e,n)=>{Ct.init(e,n),e._zod.check=i=>{YA(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),xS=ee("$ZodNumber",(e,n)=>{zt.init(e,n),e._zod.pattern=e._zod.bag.pattern??pS,e._zod.parse=(i,a)=>{if(n.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),KA=ee("$ZodNumberFormat",(e,n)=>{dA.init(e,n),xS.init(e,n)}),XA=ee("$ZodBoolean",(e,n)=>{zt.init(e,n),e._zod.pattern=oA,e._zod.parse=(i,a)=>{if(n.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),JA=ee("$ZodUnknown",(e,n)=>{zt.init(e,n),e._zod.parse=i=>i}),WA=ee("$ZodNever",(e,n)=>{zt.init(e,n),e._zod.parse=(i,a)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function mx(e,n,i){e.issues.length&&n.issues.push(...Il(i,e.issues)),n.value[i]=e.value}const ez=ee("$ZodArray",(e,n)=>{zt.init(e,n),e._zod.parse=(i,a)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let c=0;c<s.length;c++){const d=s[c],g=n.element._zod.run({value:d,issues:[]},a);g instanceof Promise?u.push(g.then(p=>mx(p,i,c))):mx(g,i,c)}return u.length?Promise.all(u).then(()=>i):i}});function zc(e,n,i,a,s){if(e.issues.length){if(s&&!(i in a))return;n.issues.push(...Il(i,e.issues))}e.value===void 0?i in a&&(n.value[i]=void 0):n.value[i]=e.value}function SS(e){var a,s,u,c;const n=Object.keys(e.shape);for(const d of n)if(!((c=(u=(s=(a=e.shape)==null?void 0:a[d])==null?void 0:s._zod)==null?void 0:u.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${d}": expected a Zod schema`);const i=bT(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function wS(e,n,i,a,s,u){const c=[],d=s.keySet,g=s.catchall._zod,p=g.def.type,y=g.optout==="optional";for(const v in n){if(d.has(v))continue;if(p==="never"){c.push(v);continue}const x=g.run({value:n[v],issues:[]},a);x instanceof Promise?e.push(x.then(S=>zc(S,i,v,n,y))):zc(x,i,v,n,y)}return c.length&&i.issues.push({code:"unrecognized_keys",keys:c,input:n,inst:u}),e.length?Promise.all(e).then(()=>i):i}const tz=ee("$ZodObject",(e,n)=>{zt.init(e,n);const i=Object.getOwnPropertyDescriptor(n,"shape");if(!(i!=null&&i.get)){const d=n.shape;Object.defineProperty(n,"shape",{get:()=>{const g={...d};return Object.defineProperty(n,"shape",{value:g}),g}})}const a=Jm(()=>SS(n));lt(e._zod,"propValues",()=>{const d=n.shape,g={};for(const p in d){const y=d[p]._zod;if(y.values){g[p]??(g[p]=new Set);for(const v of y.values)g[p].add(v)}}return g});const s=Ac,u=n.catchall;let c;e._zod.parse=(d,g)=>{c??(c=a.value);const p=d.value;if(!s(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d;d.value={};const y=[],v=c.shape;for(const x of c.keys){const S=v[x],j=S._zod.optout==="optional",C=S._zod.run({value:p[x],issues:[]},g);C instanceof Promise?y.push(C.then(T=>zc(T,d,x,p,j))):zc(C,d,x,p,j)}return u?wS(y,p,d,g,a.value,e):y.length?Promise.all(y).then(()=>d):d}}),nz=ee("$ZodObjectJIT",(e,n)=>{tz.init(e,n);const i=e._zod.parse,a=Jm(()=>SS(n)),s=x=>{var U;const S=new EA(["shape","payload","ctx"]),j=a.value,C=H=>{const K=dx(H);return`shape[${K}]._zod.run({ value: input[${K}], issues: [] }, ctx)`};S.write("const input = payload.value;");const T=Object.create(null);let k=0;for(const H of j.keys)T[H]=`key_${k++}`;S.write("const newResult = {};");for(const H of j.keys){const K=T[H],L=dx(H),V=x[H],D=((U=V==null?void 0:V._zod)==null?void 0:U.optout)==="optional";S.write(`const ${K} = ${C(H)};`),D?S.write(`
218
- if (${K}.issues.length) {
219
- if (${L} in input) {
220
- payload.issues = payload.issues.concat(${K}.issues.map(iss => ({
221
- ...iss,
222
- path: iss.path ? [${L}, ...iss.path] : [${L}]
223
- })));
224
- }
225
- }
226
-
227
- if (${K}.value === undefined) {
228
- if (${L} in input) {
229
- newResult[${L}] = undefined;
230
- }
231
- } else {
232
- newResult[${L}] = ${K}.value;
233
- }
234
-
235
- `):S.write(`
236
- if (${K}.issues.length) {
237
- payload.issues = payload.issues.concat(${K}.issues.map(iss => ({
238
- ...iss,
239
- path: iss.path ? [${L}, ...iss.path] : [${L}]
240
- })));
241
- }
242
-
243
- if (${K}.value === undefined) {
244
- if (${L} in input) {
245
- newResult[${L}] = undefined;
246
- }
247
- } else {
248
- newResult[${L}] = ${K}.value;
249
- }
250
-
251
- `)}S.write("payload.value = newResult;"),S.write("return payload;");const P=S.compile();return(H,K)=>P(x,H,K)};let u;const c=Ac,d=!aS.jitless,p=d&&yT.value,y=n.catchall;let v;e._zod.parse=(x,S)=>{v??(v=a.value);const j=x.value;return c(j)?d&&p&&(S==null?void 0:S.async)===!1&&S.jitless!==!0?(u||(u=s(n.shape)),x=u(x,S),y?wS([],j,x,S,v,e):x):i(x,S):(x.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),x)}});function px(e,n,i,a){for(const u of e)if(u.issues.length===0)return n.value=u.value,n;const s=e.filter(u=>!Ll(u));return s.length===1?(n.value=s[0].value,s[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:i,errors:e.map(u=>u.issues.map(c=>na(c,a,ta())))}),n)}const rz=ee("$ZodUnion",(e,n)=>{zt.init(e,n),lt(e._zod,"optin",()=>n.options.some(s=>s._zod.optin==="optional")?"optional":void 0),lt(e._zod,"optout",()=>n.options.some(s=>s._zod.optout==="optional")?"optional":void 0),lt(e._zod,"values",()=>{if(n.options.every(s=>s._zod.values))return new Set(n.options.flatMap(s=>Array.from(s._zod.values)))}),lt(e._zod,"pattern",()=>{if(n.options.every(s=>s._zod.pattern)){const s=n.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>ep(u.source)).join("|")})$`)}});const i=n.options.length===1,a=n.options[0]._zod.run;e._zod.parse=(s,u)=>{if(i)return a(s,u);let c=!1;const d=[];for(const g of n.options){const p=g._zod.run({value:s.value,issues:[]},u);if(p instanceof Promise)d.push(p),c=!0;else{if(p.issues.length===0)return p;d.push(p)}}return c?Promise.all(d).then(g=>px(g,s,e,u)):px(d,s,e,u)}}),iz=ee("$ZodIntersection",(e,n)=>{zt.init(e,n),e._zod.parse=(i,a)=>{const s=i.value,u=n.left._zod.run({value:s,issues:[]},a),c=n.right._zod.run({value:s,issues:[]},a);return u instanceof Promise||c instanceof Promise?Promise.all([u,c]).then(([g,p])=>gx(i,g,p)):gx(i,u,c)}});function gm(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(rs(e)&&rs(n)){const i=Object.keys(n),a=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...n};for(const u of a){const c=gm(e[u],n[u]);if(!c.valid)return{valid:!1,mergeErrorPath:[u,...c.mergeErrorPath]};s[u]=c.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let a=0;a<e.length;a++){const s=e[a],u=n[a],c=gm(s,u);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};i.push(c.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function gx(e,n,i){const a=new Map;let s;for(const d of n.issues)if(d.code==="unrecognized_keys"){s??(s=d);for(const g of d.keys)a.has(g)||a.set(g,{}),a.get(g).l=!0}else e.issues.push(d);for(const d of i.issues)if(d.code==="unrecognized_keys")for(const g of d.keys)a.has(g)||a.set(g,{}),a.get(g).r=!0;else e.issues.push(d);const u=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(u.length&&s&&e.issues.push({...s,keys:u}),Ll(e))return e;const c=gm(n.value,i.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const az=ee("$ZodRecord",(e,n)=>{zt.init(e,n),e._zod.parse=(i,a)=>{const s=i.value;if(!rs(s))return i.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),i;const u=[],c=n.keyType._zod.values;if(c){i.value={};const d=new Set;for(const p of c)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){d.add(typeof p=="number"?p.toString():p);const y=n.valueType._zod.run({value:s[p],issues:[]},a);y instanceof Promise?u.push(y.then(v=>{v.issues.length&&i.issues.push(...Il(p,v.issues)),i.value[p]=v.value})):(y.issues.length&&i.issues.push(...Il(p,y.issues)),i.value[p]=y.value)}let g;for(const p in s)d.has(p)||(g=g??[],g.push(p));g&&g.length>0&&i.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:g})}else{i.value={};for(const d of Reflect.ownKeys(s)){if(d==="__proto__")continue;let g=n.keyType._zod.run({value:d,issues:[]},a);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&pS.test(d)&&g.issues.length){const v=n.keyType._zod.run({value:Number(d),issues:[]},a);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(g=v)}if(g.issues.length){n.mode==="loose"?i.value[d]=s[d]:i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(v=>na(v,a,ta())),input:d,path:[d],inst:e});continue}const y=n.valueType._zod.run({value:s[d],issues:[]},a);y instanceof Promise?u.push(y.then(v=>{v.issues.length&&i.issues.push(...Il(d,v.issues)),i.value[g.value]=v.value})):(y.issues.length&&i.issues.push(...Il(d,y.issues)),i.value[g.value]=y.value)}}return u.length?Promise.all(u).then(()=>i):i}}),lz=ee("$ZodEnum",(e,n)=>{zt.init(e,n);const i=lS(n.entries),a=new Set(i);e._zod.values=a,e._zod.pattern=new RegExp(`^(${i.filter(s=>vT.has(typeof s)).map(s=>typeof s=="string"?Hc(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const c=s.value;return a.has(c)||s.issues.push({code:"invalid_value",values:i,input:c,inst:e}),s}}),sz=ee("$ZodTransform",(e,n)=>{zt.init(e,n),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new iS(e.constructor.name);const s=n.transform(i.value,i);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(i.value=c,i));if(s instanceof Promise)throw new Bl;return i.value=s,i}});function yx(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const ES=ee("$ZodOptional",(e,n)=>{zt.init(e,n),e._zod.optin="optional",e._zod.optout="optional",lt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),lt(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${ep(i.source)})?$`):void 0}),e._zod.parse=(i,a)=>{if(n.innerType._zod.optin==="optional"){const s=n.innerType._zod.run(i,a);return s instanceof Promise?s.then(u=>yx(u,i.value)):yx(s,i.value)}return i.value===void 0?i:n.innerType._zod.run(i,a)}}),oz=ee("$ZodExactOptional",(e,n)=>{ES.init(e,n),lt(e._zod,"values",()=>n.innerType._zod.values),lt(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(i,a)=>n.innerType._zod.run(i,a)}),uz=ee("$ZodNullable",(e,n)=>{zt.init(e,n),lt(e._zod,"optin",()=>n.innerType._zod.optin),lt(e._zod,"optout",()=>n.innerType._zod.optout),lt(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${ep(i.source)}|null)$`):void 0}),lt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(i,a)=>i.value===null?i:n.innerType._zod.run(i,a)}),cz=ee("$ZodDefault",(e,n)=>{zt.init(e,n),e._zod.optin="optional",lt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return n.innerType._zod.run(i,a);if(i.value===void 0)return i.value=n.defaultValue,i;const s=n.innerType._zod.run(i,a);return s instanceof Promise?s.then(u=>vx(u,n)):vx(s,n)}});function vx(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const fz=ee("$ZodPrefault",(e,n)=>{zt.init(e,n),e._zod.optin="optional",lt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,a)=>(a.direction==="backward"||i.value===void 0&&(i.value=n.defaultValue),n.innerType._zod.run(i,a))}),dz=ee("$ZodNonOptional",(e,n)=>{zt.init(e,n),lt(e._zod,"values",()=>{const i=n.innerType._zod.values;return i?new Set([...i].filter(a=>a!==void 0)):void 0}),e._zod.parse=(i,a)=>{const s=n.innerType._zod.run(i,a);return s instanceof Promise?s.then(u=>bx(u,e)):bx(s,e)}});function bx(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const hz=ee("$ZodCatch",(e,n)=>{zt.init(e,n),lt(e._zod,"optin",()=>n.innerType._zod.optin),lt(e._zod,"optout",()=>n.innerType._zod.optout),lt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return n.innerType._zod.run(i,a);const s=n.innerType._zod.run(i,a);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=n.catchValue({...i,error:{issues:u.issues.map(c=>na(c,a,ta()))},input:i.value}),i.issues=[]),i)):(i.value=s.value,s.issues.length&&(i.value=n.catchValue({...i,error:{issues:s.issues.map(u=>na(u,a,ta()))},input:i.value}),i.issues=[]),i)}}),mz=ee("$ZodPipe",(e,n)=>{zt.init(e,n),lt(e._zod,"values",()=>n.in._zod.values),lt(e._zod,"optin",()=>n.in._zod.optin),lt(e._zod,"optout",()=>n.out._zod.optout),lt(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(i,a)=>{if(a.direction==="backward"){const u=n.out._zod.run(i,a);return u instanceof Promise?u.then(c=>uc(c,n.in,a)):uc(u,n.in,a)}const s=n.in._zod.run(i,a);return s instanceof Promise?s.then(u=>uc(u,n.out,a)):uc(s,n.out,a)}});function uc(e,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}const pz=ee("$ZodReadonly",(e,n)=>{zt.init(e,n),lt(e._zod,"propValues",()=>n.innerType._zod.propValues),lt(e._zod,"values",()=>n.innerType._zod.values),lt(e._zod,"optin",()=>{var i,a;return(a=(i=n.innerType)==null?void 0:i._zod)==null?void 0:a.optin}),lt(e._zod,"optout",()=>{var i,a;return(a=(i=n.innerType)==null?void 0:i._zod)==null?void 0:a.optout}),e._zod.parse=(i,a)=>{if(a.direction==="backward")return n.innerType._zod.run(i,a);const s=n.innerType._zod.run(i,a);return s instanceof Promise?s.then(xx):xx(s)}});function xx(e){return e.value=Object.freeze(e.value),e}const gz=ee("$ZodCustom",(e,n)=>{Tn.init(e,n),zt.init(e,n),e._zod.parse=(i,a)=>i,e._zod.check=i=>{const a=i.value,s=n.fn(a);if(s instanceof Promise)return s.then(u=>Sx(u,i,a,e));Sx(s,i,a,e)}});function Sx(e,n,i,a){if(!e){const s={code:"custom",input:i,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),n.issues.push(Co(s))}}var wx;class yz{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...i){const a=i[0];return this._map.set(n,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const i=this._map.get(n);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(n),this}get(n){const i=n._zod.parent;if(i){const a={...this.get(i)??{}};delete a.id;const s={...a,...this._map.get(n)};return Object.keys(s).length?s:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function vz(){return new yz}(wx=globalThis).__zod_globalRegistry??(wx.__zod_globalRegistry=vz());const po=globalThis.__zod_globalRegistry;function bz(e,n){return new e({type:"string",...Ee(n)})}function xz(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(n)})}function Ex(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(n)})}function Sz(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(n)})}function wz(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(n)})}function Ez(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(n)})}function Cz(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(n)})}function Nz(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(n)})}function _z(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(n)})}function jz(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(n)})}function kz(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(n)})}function Tz(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(n)})}function Az(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(n)})}function zz(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(n)})}function Oz(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(n)})}function Rz(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(n)})}function Mz(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(n)})}function Dz(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(n)})}function Uz(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(n)})}function Lz(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(n)})}function Iz(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(n)})}function Bz(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(n)})}function qz(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(n)})}function Pz(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(n)})}function Hz(e,n){return new e({type:"string",format:"date",check:"string_format",...Ee(n)})}function Zz(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(n)})}function Fz(e,n){return new e({type:"string",format:"duration",check:"string_format",...Ee(n)})}function $z(e,n){return new e({type:"number",checks:[],...Ee(n)})}function Vz(e,n){return new e({type:"number",coerce:!0,checks:[],...Ee(n)})}function Qz(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(n)})}function Yz(e,n){return new e({type:"boolean",...Ee(n)})}function Gz(e){return new e({type:"unknown"})}function Kz(e,n){return new e({type:"never",...Ee(n)})}function Cx(e,n){return new yS({check:"less_than",...Ee(n),value:e,inclusive:!1})}function _h(e,n){return new yS({check:"less_than",...Ee(n),value:e,inclusive:!0})}function Nx(e,n){return new vS({check:"greater_than",...Ee(n),value:e,inclusive:!1})}function jh(e,n){return new vS({check:"greater_than",...Ee(n),value:e,inclusive:!0})}function _x(e,n){return new fA({check:"multiple_of",...Ee(n),value:e})}function CS(e,n){return new hA({check:"max_length",...Ee(n),maximum:e})}function Oc(e,n){return new mA({check:"min_length",...Ee(n),minimum:e})}function NS(e,n){return new pA({check:"length_equals",...Ee(n),length:e})}function Xz(e,n){return new gA({check:"string_format",format:"regex",...Ee(n),pattern:e})}function Jz(e){return new yA({check:"string_format",format:"lowercase",...Ee(e)})}function Wz(e){return new vA({check:"string_format",format:"uppercase",...Ee(e)})}function eO(e,n){return new bA({check:"string_format",format:"includes",...Ee(n),includes:e})}function tO(e,n){return new xA({check:"string_format",format:"starts_with",...Ee(n),prefix:e})}function nO(e,n){return new SA({check:"string_format",format:"ends_with",...Ee(n),suffix:e})}function us(e){return new wA({check:"overwrite",tx:e})}function rO(e){return us(n=>n.normalize(e))}function iO(){return us(e=>e.trim())}function aO(){return us(e=>e.toLowerCase())}function lO(){return us(e=>e.toUpperCase())}function sO(){return us(e=>gT(e))}function oO(e,n,i){return new e({type:"array",element:n,...Ee(i)})}function uO(e,n,i){return new e({type:"custom",check:"custom",fn:n,...Ee(i)})}function cO(e){const n=fO(i=>(i.addIssue=a=>{if(typeof a=="string")i.issues.push(Co(a,i.value,n._zod.def));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),i.issues.push(Co(s))}},e(i.value,i)));return n}function fO(e,n){const i=new Tn({check:"custom",...Ee(n)});return i._zod.check=e,i}function _S(e){let n=(e==null?void 0:e.target)??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??po,target:n,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 Zt(e,n,i={path:[],schemaPath:[]}){var y,v;var a;const s=e._zod.def,u=n.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const c={schema:{},count:1,cycle:void 0,path:i.path};n.seen.set(e,c);const d=(v=(y=e._zod).toJSONSchema)==null?void 0:v.call(y);if(d)c.schema=d;else{const x={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,c.schema,x);else{const j=c.schema,C=n.processors[s.type];if(!C)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);C(e,n,j,x)}const S=e._zod.parent;S&&(c.ref||(c.ref=S),Zt(S,n,x),n.seen.get(S).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(c.schema,g),n.io==="input"&&pn(e)&&(delete c.schema.examples,delete c.schema.default),n.io==="input"&&c.schema._prefault&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,n.seen.get(e).schema}function jS(e,n){var c,d,g,p;const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const y of e.seen.entries()){const v=(c=e.metadataRegistry.get(y[0]))==null?void 0:c.id;if(v){const x=a.get(v);if(x&&x!==y[0])throw new Error(`Duplicate schema id "${v}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(v,y[0])}}const s=y=>{var C;const v=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const T=(C=e.external.registry.get(y[0]))==null?void 0:C.id,k=e.external.uri??(U=>U);if(T)return{ref:k(T)};const P=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=P,{defId:P,ref:`${k("__shared")}#/${v}/${P}`}}if(y[1]===i)return{ref:"#"};const S=`#/${v}/`,j=y[1].schema.id??`__schema${e.counter++}`;return{defId:j,ref:S+j}},u=y=>{if(y[1].schema.$ref)return;const v=y[1],{ref:x,defId:S}=s(y);v.def={...v.schema},S&&(v.defId=S);const j=v.schema;for(const C in j)delete j[C];j.$ref=x};if(e.cycles==="throw")for(const y of e.seen.entries()){const v=y[1];if(v.cycle)throw new Error(`Cycle detected: #/${(d=v.cycle)==null?void 0:d.join("/")}/<root>
252
-
253
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const v=y[1];if(n===y[0]){u(y);continue}if(e.external){const S=(g=e.external.registry.get(y[0]))==null?void 0:g.id;if(n!==y[0]&&S){u(y);continue}}if((p=e.metadataRegistry.get(y[0]))==null?void 0:p.id){u(y);continue}if(v.cycle){u(y);continue}if(v.count>1&&e.reused==="ref"){u(y);continue}}}function kS(e,n){var c,d,g;const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=p=>{const y=e.seen.get(p);if(y.ref===null)return;const v=y.def??y.schema,x={...v},S=y.ref;if(y.ref=null,S){a(S);const C=e.seen.get(S),T=C.schema;if(T.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(T)):Object.assign(v,T),Object.assign(v,x),p._zod.parent===S)for(const P in v)P==="$ref"||P==="allOf"||P in x||delete v[P];if(T.$ref&&C.def)for(const P in v)P==="$ref"||P==="allOf"||P in C.def&&JSON.stringify(v[P])===JSON.stringify(C.def[P])&&delete v[P]}const j=p._zod.parent;if(j&&j!==S){a(j);const C=e.seen.get(j);if(C!=null&&C.schema.$ref&&(v.$ref=C.schema.$ref,C.def))for(const T in v)T==="$ref"||T==="allOf"||T in C.def&&JSON.stringify(v[T])===JSON.stringify(C.def[T])&&delete v[T]}e.override({zodSchema:p,jsonSchema:v,path:y.path??[]})};for(const p of[...e.seen.entries()].reverse())a(p[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const p=(d=e.external.registry.get(n))==null?void 0:d.id;if(!p)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(p)}Object.assign(s,i.def??i.schema);const u=((g=e.external)==null?void 0:g.defs)??{};for(const p of e.seen.entries()){const y=p[1];y.def&&y.defId&&(u[y.defId]=y.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const p=JSON.parse(JSON.stringify(s));return Object.defineProperty(p,"~standard",{value:{...n["~standard"],jsonSchema:{input:Rc(n,"input",e.processors),output:Rc(n,"output",e.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function pn(e,n){const i=n??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return pn(a.element,i);if(a.type==="set")return pn(a.valueType,i);if(a.type==="lazy")return pn(a.getter(),i);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return pn(a.innerType,i);if(a.type==="intersection")return pn(a.left,i)||pn(a.right,i);if(a.type==="record"||a.type==="map")return pn(a.keyType,i)||pn(a.valueType,i);if(a.type==="pipe")return pn(a.in,i)||pn(a.out,i);if(a.type==="object"){for(const s in a.shape)if(pn(a.shape[s],i))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(pn(s,i))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(pn(s,i))return!0;return!!(a.rest&&pn(a.rest,i))}return!1}const dO=(e,n={})=>i=>{const a=_S({...i,processors:n});return Zt(e,a),jS(a,e),kS(a,e)},Rc=(e,n,i={})=>a=>{const{libraryOptions:s,target:u}=a??{},c=_S({...s??{},target:u,io:n,processors:i});return Zt(e,c),jS(c,e),kS(c,e)},hO={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mO=(e,n,i,a)=>{const s=i;s.type="string";const{minimum:u,maximum:c,format:d,patterns:g,contentEncoding:p}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof c=="number"&&(s.maxLength=c),d&&(s.format=hO[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),p&&(s.contentEncoding=p),g&&g.size>0){const y=[...g];y.length===1?s.pattern=y[0].source:y.length>1&&(s.allOf=[...y.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},pO=(e,n,i,a)=>{const s=i,{minimum:u,maximum:c,format:d,multipleOf:g,exclusiveMaximum:p,exclusiveMinimum:y}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number",typeof y=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(s.minimum=y,s.exclusiveMinimum=!0):s.exclusiveMinimum=y),typeof u=="number"&&(s.minimum=u,typeof y=="number"&&n.target!=="draft-04"&&(y>=u?delete s.minimum:delete s.exclusiveMinimum)),typeof p=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(s.maximum=p,s.exclusiveMaximum=!0):s.exclusiveMaximum=p),typeof c=="number"&&(s.maximum=c,typeof p=="number"&&n.target!=="draft-04"&&(p<=c?delete s.maximum:delete s.exclusiveMaximum)),typeof g=="number"&&(s.multipleOf=g)},gO=(e,n,i,a)=>{i.type="boolean"},yO=(e,n,i,a)=>{i.not={}},vO=(e,n,i,a)=>{},bO=(e,n,i,a)=>{const s=e._zod.def,u=lS(s.entries);u.every(c=>typeof c=="number")&&(i.type="number"),u.every(c=>typeof c=="string")&&(i.type="string"),i.enum=u},xO=(e,n,i,a)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},SO=(e,n,i,a)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},wO=(e,n,i,a)=>{const s=i,u=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Zt(u.element,n,{...a,path:[...a.path,"items"]})},EO=(e,n,i,a)=>{var p;const s=i,u=e._zod.def;s.type="object",s.properties={};const c=u.shape;for(const y in c)s.properties[y]=Zt(c[y],n,{...a,path:[...a.path,"properties",y]});const d=new Set(Object.keys(c)),g=new Set([...d].filter(y=>{const v=u.shape[y]._zod;return n.io==="input"?v.optin===void 0:v.optout===void 0}));g.size>0&&(s.required=Array.from(g)),((p=u.catchall)==null?void 0:p._zod.def.type)==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Zt(u.catchall,n,{...a,path:[...a.path,"additionalProperties"]})):n.io==="output"&&(s.additionalProperties=!1)},CO=(e,n,i,a)=>{const s=e._zod.def,u=s.inclusive===!1,c=s.options.map((d,g)=>Zt(d,n,{...a,path:[...a.path,u?"oneOf":"anyOf",g]}));u?i.oneOf=c:i.anyOf=c},NO=(e,n,i,a)=>{const s=e._zod.def,u=Zt(s.left,n,{...a,path:[...a.path,"allOf",0]}),c=Zt(s.right,n,{...a,path:[...a.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,g=[...d(u)?u.allOf:[u],...d(c)?c.allOf:[c]];i.allOf=g},_O=(e,n,i,a)=>{const s=i,u=e._zod.def;s.type="object";const c=u.keyType,d=c._zod.bag,g=d==null?void 0:d.patterns;if(u.mode==="loose"&&g&&g.size>0){const y=Zt(u.valueType,n,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const v of g)s.patternProperties[v.source]=y}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(s.propertyNames=Zt(u.keyType,n,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Zt(u.valueType,n,{...a,path:[...a.path,"additionalProperties"]});const p=c._zod.values;if(p){const y=[...p].filter(v=>typeof v=="string"||typeof v=="number");y.length>0&&(s.required=y)}},jO=(e,n,i,a)=>{const s=e._zod.def,u=Zt(s.innerType,n,a),c=n.seen.get(e);n.target==="openapi-3.0"?(c.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},kO=(e,n,i,a)=>{const s=e._zod.def;Zt(s.innerType,n,a);const u=n.seen.get(e);u.ref=s.innerType},TO=(e,n,i,a)=>{const s=e._zod.def;Zt(s.innerType,n,a);const u=n.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},AO=(e,n,i,a)=>{const s=e._zod.def;Zt(s.innerType,n,a);const u=n.seen.get(e);u.ref=s.innerType,n.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},zO=(e,n,i,a)=>{const s=e._zod.def;Zt(s.innerType,n,a);const u=n.seen.get(e);u.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=c},OO=(e,n,i,a)=>{const s=e._zod.def,u=n.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Zt(u,n,a);const c=n.seen.get(e);c.ref=u},RO=(e,n,i,a)=>{const s=e._zod.def;Zt(s.innerType,n,a);const u=n.seen.get(e);u.ref=s.innerType,i.readOnly=!0},TS=(e,n,i,a)=>{const s=e._zod.def;Zt(s.innerType,n,a);const u=n.seen.get(e);u.ref=s.innerType},MO=ee("ZodISODateTime",(e,n)=>{UA.init(e,n),jt.init(e,n)});function DO(e){return Pz(MO,e)}const UO=ee("ZodISODate",(e,n)=>{LA.init(e,n),jt.init(e,n)});function LO(e){return Hz(UO,e)}const IO=ee("ZodISOTime",(e,n)=>{IA.init(e,n),jt.init(e,n)});function BO(e){return Zz(IO,e)}const qO=ee("ZodISODuration",(e,n)=>{BA.init(e,n),jt.init(e,n)});function PO(e){return Fz(qO,e)}const HO=(e,n)=>{cS.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>TT(e,i)},flatten:{value:i=>kT(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,pm,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,pm,2)}},isEmpty:{get(){return e.issues.length===0}}})},ar=ee("ZodError",HO,{Parent:Error}),ZO=np(ar),FO=rp(ar),$O=Zc(ar),VO=Fc(ar),QO=OT(ar),YO=RT(ar),GO=MT(ar),KO=DT(ar),XO=UT(ar),JO=LT(ar),WO=IT(ar),eR=BT(ar),Ot=ee("ZodType",(e,n)=>(zt.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:Rc(e,"input"),output:Rc(e,"output")}}),e.toJSONSchema=dO(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...i)=>e.clone(aa(n,{checks:[...n.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(i,a)=>la(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e)),e.parse=(i,a)=>ZO(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>$O(e,i,a),e.parseAsync=async(i,a)=>FO(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>VO(e,i,a),e.spa=e.safeParseAsync,e.encode=(i,a)=>QO(e,i,a),e.decode=(i,a)=>YO(e,i,a),e.encodeAsync=async(i,a)=>GO(e,i,a),e.decodeAsync=async(i,a)=>KO(e,i,a),e.safeEncode=(i,a)=>XO(e,i,a),e.safeDecode=(i,a)=>JO(e,i,a),e.safeEncodeAsync=async(i,a)=>WO(e,i,a),e.safeDecodeAsync=async(i,a)=>eR(e,i,a),e.refine=(i,a)=>e.check(QR(i,a)),e.superRefine=i=>e.check(YR(i)),e.overwrite=i=>e.check(us(i)),e.optional=()=>Tx(e),e.exactOptional=()=>MR(e),e.nullable=()=>Ax(e),e.nullish=()=>Tx(Ax(e)),e.nonoptional=i=>qR(e,i),e.array=()=>Lo(e),e.or=i=>jR([e,i]),e.and=i=>TR(e,i),e.transform=i=>zx(e,OR(i)),e.default=i=>LR(e,i),e.prefault=i=>BR(e,i),e.catch=i=>HR(e,i),e.pipe=i=>zx(e,i),e.readonly=()=>$R(e),e.describe=i=>{const a=e.clone();return po.add(a,{description:i}),a},Object.defineProperty(e,"description",{get(){var i;return(i=po.get(e))==null?void 0:i.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return po.get(e);const a=e.clone();return po.add(a,i[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),AS=ee("_ZodString",(e,n)=>{ip.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(a,s,u)=>mO(e,a,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...a)=>e.check(Xz(...a)),e.includes=(...a)=>e.check(eO(...a)),e.startsWith=(...a)=>e.check(tO(...a)),e.endsWith=(...a)=>e.check(nO(...a)),e.min=(...a)=>e.check(Oc(...a)),e.max=(...a)=>e.check(CS(...a)),e.length=(...a)=>e.check(NS(...a)),e.nonempty=(...a)=>e.check(Oc(1,...a)),e.lowercase=a=>e.check(Jz(a)),e.uppercase=a=>e.check(Wz(a)),e.trim=()=>e.check(iO()),e.normalize=(...a)=>e.check(rO(...a)),e.toLowerCase=()=>e.check(aO()),e.toUpperCase=()=>e.check(lO()),e.slugify=()=>e.check(sO())}),tR=ee("ZodString",(e,n)=>{ip.init(e,n),AS.init(e,n),e.email=i=>e.check(xz(nR,i)),e.url=i=>e.check(Nz(rR,i)),e.jwt=i=>e.check(qz(vR,i)),e.emoji=i=>e.check(_z(iR,i)),e.guid=i=>e.check(Ex(jx,i)),e.uuid=i=>e.check(Sz(cc,i)),e.uuidv4=i=>e.check(wz(cc,i)),e.uuidv6=i=>e.check(Ez(cc,i)),e.uuidv7=i=>e.check(Cz(cc,i)),e.nanoid=i=>e.check(jz(aR,i)),e.guid=i=>e.check(Ex(jx,i)),e.cuid=i=>e.check(kz(lR,i)),e.cuid2=i=>e.check(Tz(sR,i)),e.ulid=i=>e.check(Az(oR,i)),e.base64=i=>e.check(Lz(pR,i)),e.base64url=i=>e.check(Iz(gR,i)),e.xid=i=>e.check(zz(uR,i)),e.ksuid=i=>e.check(Oz(cR,i)),e.ipv4=i=>e.check(Rz(fR,i)),e.ipv6=i=>e.check(Mz(dR,i)),e.cidrv4=i=>e.check(Dz(hR,i)),e.cidrv6=i=>e.check(Uz(mR,i)),e.e164=i=>e.check(Bz(yR,i)),e.datetime=i=>e.check(DO(i)),e.date=i=>e.check(LO(i)),e.time=i=>e.check(BO(i)),e.duration=i=>e.check(PO(i))});function A(e){return bz(tR,e)}const jt=ee("ZodStringFormat",(e,n)=>{Ct.init(e,n),AS.init(e,n)}),nR=ee("ZodEmail",(e,n)=>{jA.init(e,n),jt.init(e,n)}),jx=ee("ZodGUID",(e,n)=>{NA.init(e,n),jt.init(e,n)}),cc=ee("ZodUUID",(e,n)=>{_A.init(e,n),jt.init(e,n)}),rR=ee("ZodURL",(e,n)=>{kA.init(e,n),jt.init(e,n)}),iR=ee("ZodEmoji",(e,n)=>{TA.init(e,n),jt.init(e,n)}),aR=ee("ZodNanoID",(e,n)=>{AA.init(e,n),jt.init(e,n)}),lR=ee("ZodCUID",(e,n)=>{zA.init(e,n),jt.init(e,n)}),sR=ee("ZodCUID2",(e,n)=>{OA.init(e,n),jt.init(e,n)}),oR=ee("ZodULID",(e,n)=>{RA.init(e,n),jt.init(e,n)}),uR=ee("ZodXID",(e,n)=>{MA.init(e,n),jt.init(e,n)}),cR=ee("ZodKSUID",(e,n)=>{DA.init(e,n),jt.init(e,n)}),fR=ee("ZodIPv4",(e,n)=>{qA.init(e,n),jt.init(e,n)}),dR=ee("ZodIPv6",(e,n)=>{PA.init(e,n),jt.init(e,n)}),hR=ee("ZodCIDRv4",(e,n)=>{HA.init(e,n),jt.init(e,n)}),mR=ee("ZodCIDRv6",(e,n)=>{ZA.init(e,n),jt.init(e,n)}),pR=ee("ZodBase64",(e,n)=>{FA.init(e,n),jt.init(e,n)}),gR=ee("ZodBase64URL",(e,n)=>{VA.init(e,n),jt.init(e,n)}),yR=ee("ZodE164",(e,n)=>{QA.init(e,n),jt.init(e,n)}),vR=ee("ZodJWT",(e,n)=>{GA.init(e,n),jt.init(e,n)}),ap=ee("ZodNumber",(e,n)=>{xS.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(a,s,u)=>pO(e,a,s),e.gt=(a,s)=>e.check(Nx(a,s)),e.gte=(a,s)=>e.check(jh(a,s)),e.min=(a,s)=>e.check(jh(a,s)),e.lt=(a,s)=>e.check(Cx(a,s)),e.lte=(a,s)=>e.check(_h(a,s)),e.max=(a,s)=>e.check(_h(a,s)),e.int=a=>e.check(kx(a)),e.safe=a=>e.check(kx(a)),e.positive=a=>e.check(Nx(0,a)),e.nonnegative=a=>e.check(jh(0,a)),e.negative=a=>e.check(Cx(0,a)),e.nonpositive=a=>e.check(_h(0,a)),e.multipleOf=(a,s)=>e.check(_x(a,s)),e.step=(a,s)=>e.check(_x(a,s)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function ct(e){return $z(ap,e)}const bR=ee("ZodNumberFormat",(e,n)=>{KA.init(e,n),ap.init(e,n)});function kx(e){return Qz(bR,e)}const xR=ee("ZodBoolean",(e,n)=>{XA.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>gO(e,i,a)});function Vc(e){return Yz(xR,e)}const SR=ee("ZodUnknown",(e,n)=>{JA.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>vO()});function Et(){return Gz(SR)}const wR=ee("ZodNever",(e,n)=>{WA.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>yO(e,i,a)});function ER(e){return Kz(wR,e)}const CR=ee("ZodArray",(e,n)=>{ez.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>wO(e,i,a,s),e.element=n.element,e.min=(i,a)=>e.check(Oc(i,a)),e.nonempty=i=>e.check(Oc(1,i)),e.max=(i,a)=>e.check(CS(i,a)),e.length=(i,a)=>e.check(NS(i,a)),e.unwrap=()=>e.element});function Lo(e,n){return oO(CR,e,n)}const NR=ee("ZodObject",(e,n)=>{nz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>EO(e,i,a,s),lt(e,"shape",()=>n.shape),e.keyof=()=>ft(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Et()}),e.loose=()=>e.clone({...e._zod.def,catchall:Et()}),e.strict=()=>e.clone({...e._zod.def,catchall:ER()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>ET(e,i),e.safeExtend=i=>CT(e,i),e.merge=i=>NT(e,i),e.pick=i=>ST(e,i),e.omit=i=>wT(e,i),e.partial=(...i)=>_T(zS,e,i[0]),e.required=(...i)=>jT(OS,e,i[0])});function ge(e,n){const i={type:"object",shape:e??{},...Ee(n)};return new NR(i)}const _R=ee("ZodUnion",(e,n)=>{rz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>CO(e,i,a,s),e.options=n.options});function jR(e,n){return new _R({type:"union",options:e,...Ee(n)})}const kR=ee("ZodIntersection",(e,n)=>{iz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>NO(e,i,a,s)});function TR(e,n){return new kR({type:"intersection",left:e,right:n})}const AR=ee("ZodRecord",(e,n)=>{az.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>_O(e,i,a,s),e.keyType=n.keyType,e.valueType=n.valueType});function tn(e,n,i){return new AR({type:"record",keyType:e,valueType:n,...Ee(i)})}const ym=ee("ZodEnum",(e,n)=>{lz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(a,s,u)=>bO(e,a,s),e.enum=n.entries,e.options=Object.values(n.entries);const i=new Set(Object.keys(n.entries));e.extract=(a,s)=>{const u={};for(const c of a)if(i.has(c))u[c]=n.entries[c];else throw new Error(`Key ${c} not found in enum`);return new ym({...n,checks:[],...Ee(s),entries:u})},e.exclude=(a,s)=>{const u={...n.entries};for(const c of a)if(i.has(c))delete u[c];else throw new Error(`Key ${c} not found in enum`);return new ym({...n,checks:[],...Ee(s),entries:u})}});function ft(e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new ym({type:"enum",entries:i,...Ee(n)})}const zR=ee("ZodTransform",(e,n)=>{sz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>SO(e,i),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new iS(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(Co(u,i.value,n));else{const c=u;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=i.value),c.inst??(c.inst=e),i.issues.push(Co(c))}};const s=n.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i)):(i.value=s,i)}});function OR(e){return new zR({type:"transform",transform:e})}const zS=ee("ZodOptional",(e,n)=>{ES.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>TS(e,i,a,s),e.unwrap=()=>e._zod.def.innerType});function Tx(e){return new zS({type:"optional",innerType:e})}const RR=ee("ZodExactOptional",(e,n)=>{oz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>TS(e,i,a,s),e.unwrap=()=>e._zod.def.innerType});function MR(e){return new RR({type:"optional",innerType:e})}const DR=ee("ZodNullable",(e,n)=>{uz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>jO(e,i,a,s),e.unwrap=()=>e._zod.def.innerType});function Ax(e){return new DR({type:"nullable",innerType:e})}const UR=ee("ZodDefault",(e,n)=>{cz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>TO(e,i,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function LR(e,n){return new UR({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():oS(n)}})}const IR=ee("ZodPrefault",(e,n)=>{fz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>AO(e,i,a,s),e.unwrap=()=>e._zod.def.innerType});function BR(e,n){return new IR({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():oS(n)}})}const OS=ee("ZodNonOptional",(e,n)=>{dz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>kO(e,i,a,s),e.unwrap=()=>e._zod.def.innerType});function qR(e,n){return new OS({type:"nonoptional",innerType:e,...Ee(n)})}const PR=ee("ZodCatch",(e,n)=>{hz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>zO(e,i,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function HR(e,n){return new PR({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const ZR=ee("ZodPipe",(e,n)=>{mz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>OO(e,i,a,s),e.in=n.in,e.out=n.out});function zx(e,n){return new ZR({type:"pipe",in:e,out:n})}const FR=ee("ZodReadonly",(e,n)=>{pz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>RO(e,i,a,s),e.unwrap=()=>e._zod.def.innerType});function $R(e){return new FR({type:"readonly",innerType:e})}const VR=ee("ZodCustom",(e,n)=>{gz.init(e,n),Ot.init(e,n),e._zod.processJSONSchema=(i,a,s)=>xO(e,i)});function QR(e,n={}){return uO(VR,e,n)}function YR(e){return cO(e)}function Qc(e){return Vz(ap,e)}const GR={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},RS=ft(["feishu","slack","kael"]),MS=ft(["active","inactive"]);ge({platform:RS,agentId:A().min(1),credentials:tn(A(),Et()),status:MS.default("active")});ge({agentId:A().min(1).optional(),credentials:tn(A(),Et()).optional(),status:MS.optional()});ge({id:ct(),platform:A(),agentId:A(),hasCredentials:Vc(),status:A(),createdAt:A(),updatedAt:A()});const KR=ft(["code","reverse_token","oauth","manual"]);ge({appId:A().min(1),appSecret:A().min(1)});ge({platform:RS,externalUserId:A().min(1),agentId:A().min(1),boundVia:KR.default("manual"),displayName:A().max(200).optional()});ge({id:ct(),platform:A(),externalUserId:A(),agentId:A(),boundVia:A().nullable(),displayName:A().nullable(),createdAt:A()});ge({feishuUserId:A().min(1),displayName:A().max(200).optional()});ge({configId:ct(),platform:A(),agentId:A(),appId:A(),connected:Vc(),lastActiveAt:A().nullable()});const DS=ft(["online","offline"]),US=ft(["idle","working","blocked","error"]),XR=ft(["active","suspended","evicted"]);ge({chatId:A().min(1),state:XR});ge({runtimeState:US});ge({token:A().min(1),runtimeType:A().max(50),runtimeVersion:A().max(50).optional()});ge({agentId:A(),status:DS,connectedAt:A().nullable(),lastSeenAt:A(),clientId:A().nullable().optional(),runtimeType:A().nullable().optional(),runtimeVersion:A().nullable().optional(),runtimeState:US.nullable().optional(),activeSessions:ct().int().nullable().optional(),totalSessions:ct().int().nullable().optional(),runtimeUpdatedAt:A().nullable().optional()});ge({total:ct().int(),running:ct().int(),byState:ge({idle:ct().int(),working:ct().int(),blocked:ct().int(),error:ct().int()}),clients:ct().int()});const LS={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Yc=ft(["human","personal_assistant","autonomous_agent"]),lp=ft(["private","organization"]),JR=ft(["admin-api","bootstrap","portal"]);ft(["active","suspended"]);ge({name:A().min(1).max(100).regex(/^[a-z0-9_-]+$/,"Only lowercase alphanumeric, hyphens, and underscores").optional(),type:Yc,displayName:A().max(200).optional(),delegateMention:A().max(100).optional(),profile:A().optional(),organizationId:A().max(100).optional(),source:JR.optional(),visibility:lp.optional(),metadata:tn(A(),Et()).optional(),managerId:A().optional()});ge({type:Yc.optional(),displayName:A().max(200).nullable().optional(),delegateMention:A().max(100).nullable().optional(),profile:A().nullable().optional(),visibility:lp.optional(),metadata:tn(A(),Et()).optional()});ge({uuid:A(),name:A().nullable(),organizationId:A(),type:Yc,displayName:A().nullable(),delegateMention:A().nullable(),profile:A().nullable(),inboxId:A(),status:A(),source:A().nullable().optional(),cloudUserId:A().nullable().optional(),visibility:lp,metadata:tn(A(),Et()),managerId:A().nullable(),presenceStatus:DS.optional(),createdAt:A(),updatedAt:A()});ge({name:A().max(100).optional(),type:Yc.optional(),displayName:A().max(200).optional(),delegateMention:A().max(100).optional(),profile:A().optional(),metadata:tn(A(),Et()).optional()});ge({exists:Vc(),status:ft(["active","suspended"]).nullable()});ge({repo:A().nullable(),branch:A().nullable()});ge({name:A().max(100).optional(),expiresAt:A().datetime().optional()});const WR=ge({id:A(),agentId:A(),name:A().nullable(),expiresAt:A().nullable(),revokedAt:A().nullable(),createdAt:A(),lastUsedAt:A().nullable()});WR.extend({token:A()});ge({username:A().min(1),password:A().min(1)});ge({accessToken:A(),refreshToken:A()});ge({refreshToken:A().min(1)});ge({token:A().min(1)});ge({token:A(),expiresIn:ct(),command:A()});const eM=ft(["direct","group","thread"]);ge({type:eM,topic:A().max(500).optional(),participantIds:Lo(A()).min(1),metadata:tn(A(),Et()).optional()});const tM=ge({agentId:A(),role:A(),mode:A(),joinedAt:A()}),nM=ge({id:A(),organizationId:A(),type:A(),topic:A().nullable(),lifecyclePolicy:A().nullable().optional(),metadata:tn(A(),Et()),createdAt:A(),updatedAt:A()});nM.extend({participants:Lo(tM)});ge({agentId:A().min(1),mode:ft(["full","mention_only"]).default("full")});ge({agentId:A().min(1)});const rM=ft(["connected","disconnected"]);ge({id:A(),status:rM,sdkVersion:A().max(50).nullable(),hostname:A().max(100).nullable(),os:A().max(50).nullable(),agentCount:ct().int().min(0),connectedAt:A().nullable(),lastSeenAt:A(),metadata:tn(A(),Et()).nullable()});ge({clientId:A().min(1).max(100),hostname:A().max(100).optional(),os:A().max(50).optional(),sdkVersion:A().max(50).optional()});ge({limit:Qc().int().min(1).max(100).default(20),cursor:A().optional()});const sp=ft(["hub_ui","cli","feishu","github","api"]),IS=ft(["text","markdown","card","reference","file","task"]);ge({format:IS.default("text"),content:Et(),metadata:tn(A(),Et()).optional(),inReplyTo:A().optional(),replyToInbox:A().optional(),replyToChat:A().optional(),source:sp.optional()});ge({format:IS.default("text"),content:Et(),metadata:tn(A(),Et()).optional(),replyToInbox:A().optional(),replyToChat:A().optional(),source:sp.optional()});const iM=ge({id:A(),chatId:A(),senderId:A(),format:A(),content:Et(),metadata:tn(A(),Et()),replyToInbox:A().nullable(),replyToChat:A().nullable(),inReplyTo:A().nullable(),source:sp.nullable(),createdAt:A()});ft(["pending","delivered","acked","failed"]);const aM=ge({id:ct(),inboxId:A(),messageId:A(),chatId:A().nullable(),status:A(),retryCount:ct(),createdAt:A(),deliveredAt:A().nullable(),ackedAt:A().nullable()});aM.extend({message:iM});ge({limit:Qc().int().min(1).max(50).default(10)});const lM={ADMIN:"admin",MEMBER:"member"},op=ft(["admin","member"]),sM=ge({id:A(),userId:A(),organizationId:A(),agentId:A(),role:op,createdAt:A()});ge({username:A().min(1).max(100),displayName:A().min(1).max(200),role:op.default("member")});ge({role:op.optional()});sM.extend({username:A(),displayName:A(),password:A()});const oM=ft(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),BS=ft(["high","medium","low"]);ge({id:A(),organizationId:A(),type:oM,severity:BS,agentId:A().nullable(),chatId:A().nullable(),message:A(),read:Vc(),createdAt:A()});ge({limit:Qc().int().min(1).max(100).default(20),cursor:A().optional(),severity:BS.optional(),read:ft(["true","false"]).transform(e=>e==="true").optional(),agentId:A().optional()});const qS=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ge({name:A().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!qS.test(e),"Name must not be a UUID format"),displayName:A().min(1).max(200),maxAgents:ct().int().min(0).default(0),maxMessagesPerMinute:ct().int().min(0).default(0),features:tn(A(),Et()).default({})});ge({name:A().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!qS.test(e),"Name must not be a UUID format").optional(),displayName:A().min(1).max(200).optional(),maxAgents:ct().int().min(0).optional(),maxMessagesPerMinute:ct().int().min(0).optional(),features:tn(A(),Et()).optional()});ge({id:A(),name:A(),displayName:A(),maxAgents:ct(),maxMessagesPerMinute:ct(),features:tn(A(),Et()),createdAt:A(),updatedAt:A()});ge({id:A(),agentId:A(),chatId:A(),content:A(),updatedAt:A()});ge({agentId:A(),chatId:A(),content:A().max(5e4)});const uM=ge({organizationId:A(),agentCount:ct(),chatCount:ct(),messageCount:ct()});ge({totalAgents:ct(),totalChats:ct(),totalMessages:ct(),byOrganization:Lo(uM)});ge({key:A(),value:Et(),updatedAt:A()});tn(A(),Et());const li={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},kh={[li.INBOX_TIMEOUT_SECONDS]:300,[li.MAX_RETRY_COUNT]:3,[li.POLLING_INTERVAL_SECONDS]:5,[li.PRESENCE_CLEANUP_SECONDS]:60},No=ft(["pending","assigned","working","completed","failed","cancelled"]),Ox=ft(["agent","admin"]),cM=ft(["assigned","status_changed","cancelled"]);ge({taskId:A(),event:cM,title:A(),body:A().default(""),status:No,fromStatus:No.optional(),originRef:A().nullable().optional()});const fM=ge({title:A().min(1).max(500),body:A().optional(),assigneeAgentId:A().optional(),originRef:A().max(500).optional(),metadata:tn(A(),Et()).optional()});fM.extend({organizationId:A().optional()});ge({status:ft(["working","completed","failed"]),result:A().optional()});ge({assigneeAgentId:A().nullable().optional(),status:No.optional(),result:A().optional()});ge({chatId:A().min(1)});const dM=ge({id:A(),organizationId:A(),title:A(),body:A(),status:No,assigneeAgentId:A().nullable(),createdByType:Ox,createdById:A(),originRef:A().nullable(),result:A().nullable(),metadata:tn(A(),Et()),createdAt:A(),updatedAt:A(),cancelledAt:A().nullable(),cancelledByType:Ox.nullable(),cancelledById:A().nullable()}),hM=ge({taskId:A(),chatId:A(),linkedByAgentId:A().nullable(),linkedAt:A()});dM.extend({chats:Lo(hM)});ge({status:No.optional(),assigneeAgentId:A().optional(),originRef:A().optional(),limit:Qc().int().min(1).max(100).default(20),cursor:A().optional()});const mM=ft(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);ge({taskId:A(),signal:mM,reason:A()});const pM=ft(["active","suspended"]);ge({id:A(),username:A(),displayName:A(),avatarUrl:A().nullable(),status:pM,createdAt:A(),updatedAt:A()});ge({username:A().min(1).max(100),displayName:A().min(1).max(200),password:A().min(8).max(200)});ge({displayName:A().min(1).max(200).optional(),password:A().min(8).max(200).optional()});function PS(){return De.get("/members")}function gM(e){return De.post("/members",e)}function yM(e){return De.delete(`/members/${encodeURIComponent(e)}`)}function ea(e,n,{checkForDefaultPrevented:i=!0}={}){return function(s){if(e==null||e(s),i===!1||!s.defaultPrevented)return n==null?void 0:n(s)}}function vM(e,n){const i=w.createContext(n),a=u=>{const{children:c,...d}=u,g=w.useMemo(()=>d,Object.values(d));return h.jsx(i.Provider,{value:g,children:c})};a.displayName=e+"Provider";function s(u){const c=w.useContext(i);if(c)return c;if(n!==void 0)return n;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[a,s]}function bM(e,n=[]){let i=[];function a(u,c){const d=w.createContext(c),g=i.length;i=[...i,c];const p=v=>{var k;const{scope:x,children:S,...j}=v,C=((k=x==null?void 0:x[e])==null?void 0:k[g])||d,T=w.useMemo(()=>j,Object.values(j));return h.jsx(C.Provider,{value:T,children:S})};p.displayName=u+"Provider";function y(v,x){var C;const S=((C=x==null?void 0:x[e])==null?void 0:C[g])||d,j=w.useContext(S);if(j)return j;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[p,y]}const s=()=>{const u=i.map(c=>w.createContext(c));return function(d){const g=(d==null?void 0:d[e])||u;return w.useMemo(()=>({[`__scope${e}`]:{...d,[e]:g}}),[d,g])}};return s.scopeName=e,[a,xM(s,...n)]}function xM(...e){const n=e[0];if(e.length===1)return n;const i=()=>{const a=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(u){const c=a.reduce((d,{useScope:g,scopeName:p})=>{const v=g(u)[`__scope${p}`];return{...d,...v}},{});return w.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return i.scopeName=n.scopeName,i}var _o=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},SM=Rm[" useId ".trim().toString()]||(()=>{}),wM=0;function Th(e){const[n,i]=w.useState(SM());return _o(()=>{i(a=>a??String(wM++))},[e]),e||(n?`radix-${n}`:"")}var EM=Rm[" useInsertionEffect ".trim().toString()]||_o;function CM({prop:e,defaultProp:n,onChange:i=()=>{},caller:a}){const[s,u,c]=NM({defaultProp:n,onChange:i}),d=e!==void 0,g=d?e:s;{const y=w.useRef(e!==void 0);w.useEffect(()=>{const v=y.current;v!==d&&console.warn(`${a} is changing from ${v?"controlled":"uncontrolled"} to ${d?"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=d},[d,a])}const p=w.useCallback(y=>{var v;if(d){const x=_M(y)?y(e):y;x!==e&&((v=c.current)==null||v.call(c,x))}else u(y)},[d,e,u,c]);return[g,p]}function NM({defaultProp:e,onChange:n}){const[i,a]=w.useState(e),s=w.useRef(i),u=w.useRef(n);return EM(()=>{u.current=n},[n]),w.useEffect(()=>{var c;s.current!==i&&((c=u.current)==null||c.call(u,i),s.current=i)},[i,s]),[i,a,u]}function _M(e){return typeof e=="function"}var HS=$0();const jM=Lc(HS);function ZS(e){const n=kM(e),i=w.forwardRef((a,s)=>{const{children:u,...c}=a,d=w.Children.toArray(u),g=d.find(AM);if(g){const p=g.props.children,y=d.map(v=>v===g?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:v);return h.jsx(n,{...c,ref:s,children:w.isValidElement(p)?w.cloneElement(p,void 0,y):null})}return h.jsx(n,{...c,ref:s,children:u})});return i.displayName=`${e}.Slot`,i}function kM(e){const n=w.forwardRef((i,a)=>{const{children:s,...u}=i;if(w.isValidElement(s)){const c=OM(s),d=zM(u,s.props);return s.type!==w.Fragment&&(d.ref=a?Xm(a,c):c),w.cloneElement(s,d)}return w.Children.count(s)>1?w.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var TM=Symbol("radix.slottable");function AM(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TM}function zM(e,n){const i={...n};for(const a in n){const s=e[a],u=n[a];/^on[A-Z]/.test(a)?s&&u?i[a]=(...d)=>{const g=u(...d);return s(...d),g}:s&&(i[a]=s):a==="style"?i[a]={...s,...u}:a==="className"&&(i[a]=[s,u].filter(Boolean).join(" "))}return{...e,...i}}function OM(e){var a,s;let n=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var RM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ui=RM.reduce((e,n)=>{const i=ZS(`Primitive.${n}`),a=w.forwardRef((s,u)=>{const{asChild:c,...d}=s,g=c?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(g,{...d,ref:u})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function MM(e,n){e&&HS.flushSync(()=>e.dispatchEvent(n))}function jo(e){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useMemo(()=>(...i)=>{var a;return(a=n.current)==null?void 0:a.call(n,...i)},[])}function DM(e,n=globalThis==null?void 0:globalThis.document){const i=jo(e);w.useEffect(()=>{const a=s=>{s.key==="Escape"&&i(s)};return n.addEventListener("keydown",a,{capture:!0}),()=>n.removeEventListener("keydown",a,{capture:!0})},[i,n])}var UM="DismissableLayer",vm="dismissableLayer.update",LM="dismissableLayer.pointerDownOutside",IM="dismissableLayer.focusOutside",Rx,FS=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$S=w.forwardRef((e,n)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:c,onDismiss:d,...g}=e,p=w.useContext(FS),[y,v]=w.useState(null),x=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=w.useState({}),j=Ha(n,V=>v(V)),C=Array.from(p.layers),[T]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=C.indexOf(T),P=y?C.indexOf(y):-1,U=p.layersWithOutsidePointerEventsDisabled.size>0,H=P>=k,K=PM(V=>{const D=V.target,B=[...p.branches].some(ie=>ie.contains(D));!H||B||(s==null||s(V),c==null||c(V),V.defaultPrevented||d==null||d())},x),L=HM(V=>{const D=V.target;[...p.branches].some(ie=>ie.contains(D))||(u==null||u(V),c==null||c(V),V.defaultPrevented||d==null||d())},x);return DM(V=>{P===p.layers.size-1&&(a==null||a(V),!V.defaultPrevented&&d&&(V.preventDefault(),d()))},x),w.useEffect(()=>{if(y)return i&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Rx=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),Mx(),()=>{i&&p.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Rx)}},[y,x,i,p]),w.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),Mx())},[y,p]),w.useEffect(()=>{const V=()=>S({});return document.addEventListener(vm,V),()=>document.removeEventListener(vm,V)},[]),h.jsx(ui.div,{...g,ref:j,style:{pointerEvents:U?H?"auto":"none":void 0,...e.style},onFocusCapture:ea(e.onFocusCapture,L.onFocusCapture),onBlurCapture:ea(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:ea(e.onPointerDownCapture,K.onPointerDownCapture)})});$S.displayName=UM;var BM="DismissableLayerBranch",qM=w.forwardRef((e,n)=>{const i=w.useContext(FS),a=w.useRef(null),s=Ha(n,a);return w.useEffect(()=>{const u=a.current;if(u)return i.branches.add(u),()=>{i.branches.delete(u)}},[i.branches]),h.jsx(ui.div,{...e,ref:s})});qM.displayName=BM;function PM(e,n=globalThis==null?void 0:globalThis.document){const i=jo(e),a=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const u=d=>{if(d.target&&!a.current){let g=function(){VS(LM,i,p,{discrete:!0})};const p={originalEvent:d};d.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=g,n.addEventListener("click",s.current,{once:!0})):g()}else n.removeEventListener("click",s.current);a.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",u),n.removeEventListener("click",s.current)}},[n,i]),{onPointerDownCapture:()=>a.current=!0}}function HM(e,n=globalThis==null?void 0:globalThis.document){const i=jo(e),a=w.useRef(!1);return w.useEffect(()=>{const s=u=>{u.target&&!a.current&&VS(IM,i,{originalEvent:u},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,i]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Mx(){const e=new CustomEvent(vm);document.dispatchEvent(e)}function VS(e,n,i,{discrete:a}){const s=i.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});n&&s.addEventListener(e,n,{once:!0}),a?MM(s,u):s.dispatchEvent(u)}var Ah="focusScope.autoFocusOnMount",zh="focusScope.autoFocusOnUnmount",Dx={bubbles:!1,cancelable:!0},ZM="FocusScope",QS=w.forwardRef((e,n)=>{const{loop:i=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:u,...c}=e,[d,g]=w.useState(null),p=jo(s),y=jo(u),v=w.useRef(null),x=Ha(n,C=>g(C)),S=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(a){let C=function(U){if(S.paused||!d)return;const H=U.target;d.contains(H)?v.current=H:Hi(v.current,{select:!0})},T=function(U){if(S.paused||!d)return;const H=U.relatedTarget;H!==null&&(d.contains(H)||Hi(v.current,{select:!0}))},k=function(U){if(document.activeElement===document.body)for(const K of U)K.removedNodes.length>0&&Hi(d)};document.addEventListener("focusin",C),document.addEventListener("focusout",T);const P=new MutationObserver(k);return d&&P.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",T),P.disconnect()}}},[a,d,S.paused]),w.useEffect(()=>{if(d){Lx.add(S);const C=document.activeElement;if(!d.contains(C)){const k=new CustomEvent(Ah,Dx);d.addEventListener(Ah,p),d.dispatchEvent(k),k.defaultPrevented||(FM(GM(YS(d)),{select:!0}),document.activeElement===C&&Hi(d))}return()=>{d.removeEventListener(Ah,p),setTimeout(()=>{const k=new CustomEvent(zh,Dx);d.addEventListener(zh,y),d.dispatchEvent(k),k.defaultPrevented||Hi(C??document.body,{select:!0}),d.removeEventListener(zh,y),Lx.remove(S)},0)}}},[d,p,y,S]);const j=w.useCallback(C=>{if(!i&&!a||S.paused)return;const T=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,k=document.activeElement;if(T&&k){const P=C.currentTarget,[U,H]=$M(P);U&&H?!C.shiftKey&&k===H?(C.preventDefault(),i&&Hi(U,{select:!0})):C.shiftKey&&k===U&&(C.preventDefault(),i&&Hi(H,{select:!0})):k===P&&C.preventDefault()}},[i,a,S.paused]);return h.jsx(ui.div,{tabIndex:-1,...c,ref:x,onKeyDown:j})});QS.displayName=ZM;function FM(e,{select:n=!1}={}){const i=document.activeElement;for(const a of e)if(Hi(a,{select:n}),document.activeElement!==i)return}function $M(e){const n=YS(e),i=Ux(n,e),a=Ux(n.reverse(),e);return[i,a]}function YS(e){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n}function Ux(e,n){for(const i of e)if(!VM(i,{upTo:n}))return i}function VM(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function QM(e){return e instanceof HTMLInputElement&&"select"in e}function Hi(e,{select:n=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&QM(e)&&n&&e.select()}}var Lx=YM();function YM(){let e=[];return{add(n){const i=e[0];n!==i&&(i==null||i.pause()),e=Ix(e,n),e.unshift(n)},remove(n){var i;e=Ix(e,n),(i=e[0])==null||i.resume()}}}function Ix(e,n){const i=[...e],a=i.indexOf(n);return a!==-1&&i.splice(a,1),i}function GM(e){return e.filter(n=>n.tagName!=="A")}var KM="Portal",GS=w.forwardRef((e,n)=>{var d;const{container:i,...a}=e,[s,u]=w.useState(!1);_o(()=>u(!0),[]);const c=i||s&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?jM.createPortal(h.jsx(ui.div,{...a,ref:n}),c):null});GS.displayName=KM;function XM(e,n){return w.useReducer((i,a)=>n[i][a]??i,e)}var Gc=e=>{const{present:n,children:i}=e,a=JM(n),s=typeof i=="function"?i({present:a.isPresent}):w.Children.only(i),u=Ha(a.ref,WM(s));return typeof i=="function"||a.isPresent?w.cloneElement(s,{ref:u}):null};Gc.displayName="Presence";function JM(e){const[n,i]=w.useState(),a=w.useRef(null),s=w.useRef(e),u=w.useRef("none"),c=e?"mounted":"unmounted",[d,g]=XM(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const p=fc(a.current);u.current=d==="mounted"?p:"none"},[d]),_o(()=>{const p=a.current,y=s.current;if(y!==e){const x=u.current,S=fc(p);e?g("MOUNT"):S==="none"||(p==null?void 0:p.display)==="none"?g("UNMOUNT"):g(y&&x!==S?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,g]),_o(()=>{if(n){let p;const y=n.ownerDocument.defaultView??window,v=S=>{const C=fc(a.current).includes(CSS.escape(S.animationName));if(S.target===n&&C&&(g("ANIMATION_END"),!s.current)){const T=n.style.animationFillMode;n.style.animationFillMode="forwards",p=y.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=T)})}},x=S=>{S.target===n&&(u.current=fc(a.current))};return n.addEventListener("animationstart",x),n.addEventListener("animationcancel",v),n.addEventListener("animationend",v),()=>{y.clearTimeout(p),n.removeEventListener("animationstart",x),n.removeEventListener("animationcancel",v),n.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[n,g]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:w.useCallback(p=>{a.current=p?getComputedStyle(p):null,i(p)},[])}}function fc(e){return(e==null?void 0:e.animationName)||"none"}function WM(e){var a,s;let n=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var Oh=0;function e4(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bx()),document.body.insertAdjacentElement("beforeend",e[1]??Bx()),Oh++,()=>{Oh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Oh--}},[])}function Bx(){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 _r=function(){return _r=Object.assign||function(n){for(var i,a=1,s=arguments.length;a<s;a++){i=arguments[a];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(n[u]=i[u])}return n},_r.apply(this,arguments)};function KS(e,n){var i={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(i[a[s]]=e[a[s]]);return i}function t4(e,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,u;a<s;a++)(u||!(a in n))&&(u||(u=Array.prototype.slice.call(n,0,a)),u[a]=n[a]);return e.concat(u||Array.prototype.slice.call(n))}var wc="right-scroll-bar-position",Ec="width-before-scroll-bar",n4="with-scroll-bars-hidden",r4="--removed-body-scroll-bar-size";function Rh(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function i4(e,n){var i=w.useState(function(){return{value:e,callback:n,facade:{get current(){return i.value},set current(a){var s=i.value;s!==a&&(i.value=a,i.callback(a,s))}}}})[0];return i.callback=n,i.facade}var a4=typeof window<"u"?w.useLayoutEffect:w.useEffect,qx=new WeakMap;function l4(e,n){var i=i4(null,function(a){return e.forEach(function(s){return Rh(s,a)})});return a4(function(){var a=qx.get(i);if(a){var s=new Set(a),u=new Set(e),c=i.current;s.forEach(function(d){u.has(d)||Rh(d,null)}),u.forEach(function(d){s.has(d)||Rh(d,c)})}qx.set(i,e)},[e]),i}function s4(e){return e}function o4(e,n){n===void 0&&(n=s4);var i=[],a=!1,s={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:e},useMedium:function(u){var c=n(u,a);return i.push(c),function(){i=i.filter(function(d){return d!==c})}},assignSyncMedium:function(u){for(a=!0;i.length;){var c=i;i=[],c.forEach(u)}i={push:function(d){return u(d)},filter:function(){return i}}},assignMedium:function(u){a=!0;var c=[];if(i.length){var d=i;i=[],d.forEach(u),c=i}var g=function(){var y=c;c=[],y.forEach(u)},p=function(){return Promise.resolve().then(g)};p(),i={push:function(y){c.push(y),p()},filter:function(y){return c=c.filter(y),i}}}};return s}function u4(e){e===void 0&&(e={});var n=o4(null);return n.options=_r({async:!0,ssr:!1},e),n}var XS=function(e){var n=e.sideCar,i=KS(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=n.read();if(!a)throw new Error("Sidecar medium not found");return w.createElement(a,_r({},i))};XS.isSideCarExport=!0;function c4(e,n){return e.useMedium(n),XS}var JS=u4(),Mh=function(){},Kc=w.forwardRef(function(e,n){var i=w.useRef(null),a=w.useState({onScrollCapture:Mh,onWheelCapture:Mh,onTouchMoveCapture:Mh}),s=a[0],u=a[1],c=e.forwardProps,d=e.children,g=e.className,p=e.removeScrollBar,y=e.enabled,v=e.shards,x=e.sideCar,S=e.noRelative,j=e.noIsolation,C=e.inert,T=e.allowPinchZoom,k=e.as,P=k===void 0?"div":k,U=e.gapMode,H=KS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),K=x,L=l4([i,n]),V=_r(_r({},H),s);return w.createElement(w.Fragment,null,y&&w.createElement(K,{sideCar:JS,removeScrollBar:p,shards:v,noRelative:S,noIsolation:j,inert:C,setCallbacks:u,allowPinchZoom:!!T,lockRef:i,gapMode:U}),c?w.cloneElement(w.Children.only(d),_r(_r({},V),{ref:L})):w.createElement(P,_r({},V,{className:g,ref:L}),d))});Kc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Kc.classNames={fullWidth:Ec,zeroRight:wc};var f4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function d4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=f4();return n&&e.setAttribute("nonce",n),e}function h4(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function m4(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var p4=function(){var e=0,n=null;return{add:function(i){e==0&&(n=d4())&&(h4(n,i),m4(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},g4=function(){var e=p4();return function(n,i){w.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&i])}},WS=function(){var e=g4(),n=function(i){var a=i.styles,s=i.dynamic;return e(a,s),null};return n},y4={left:0,top:0,right:0,gap:0},Dh=function(e){return parseInt(e||"",10)||0},v4=function(e){var n=window.getComputedStyle(document.body),i=n[e==="padding"?"paddingLeft":"marginLeft"],a=n[e==="padding"?"paddingTop":"marginTop"],s=n[e==="padding"?"paddingRight":"marginRight"];return[Dh(i),Dh(a),Dh(s)]},b4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return y4;var n=v4(e),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,a-i+n[2]-n[0])}},x4=WS(),ql="data-scroll-locked",S4=function(e,n,i,a){var s=e.left,u=e.top,c=e.right,d=e.gap;return i===void 0&&(i="margin"),`
254
- .`.concat(n4,` {
255
- overflow: hidden `).concat(a,`;
256
- padding-right: `).concat(d,"px ").concat(a,`;
257
- }
258
- body[`).concat(ql,`] {
259
- overflow: hidden `).concat(a,`;
260
- overscroll-behavior: contain;
261
- `).concat([n&&"position: relative ".concat(a,";"),i==="margin"&&`
262
- padding-left: `.concat(s,`px;
263
- padding-top: `).concat(u,`px;
264
- padding-right: `).concat(c,`px;
265
- margin-left:0;
266
- margin-top:0;
267
- margin-right: `).concat(d,"px ").concat(a,`;
268
- `),i==="padding"&&"padding-right: ".concat(d,"px ").concat(a,";")].filter(Boolean).join(""),`
269
- }
270
-
271
- .`).concat(wc,` {
272
- right: `).concat(d,"px ").concat(a,`;
273
- }
274
-
275
- .`).concat(Ec,` {
276
- margin-right: `).concat(d,"px ").concat(a,`;
277
- }
278
-
279
- .`).concat(wc," .").concat(wc,` {
280
- right: 0 `).concat(a,`;
281
- }
282
-
283
- .`).concat(Ec," .").concat(Ec,` {
284
- margin-right: 0 `).concat(a,`;
285
- }
286
-
287
- body[`).concat(ql,`] {
288
- `).concat(r4,": ").concat(d,`px;
289
- }
290
- `)},Px=function(){var e=parseInt(document.body.getAttribute(ql)||"0",10);return isFinite(e)?e:0},w4=function(){w.useEffect(function(){return document.body.setAttribute(ql,(Px()+1).toString()),function(){var e=Px()-1;e<=0?document.body.removeAttribute(ql):document.body.setAttribute(ql,e.toString())}},[])},E4=function(e){var n=e.noRelative,i=e.noImportant,a=e.gapMode,s=a===void 0?"margin":a;w4();var u=w.useMemo(function(){return b4(s)},[s]);return w.createElement(x4,{styles:S4(u,!n,s,i?"":"!important")})},bm=!1;if(typeof window<"u")try{var dc=Object.defineProperty({},"passive",{get:function(){return bm=!0,!0}});window.addEventListener("test",dc,dc),window.removeEventListener("test",dc,dc)}catch{bm=!1}var Ol=bm?{passive:!1}:!1,C4=function(e){return e.tagName==="TEXTAREA"},ew=function(e,n){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!C4(e)&&i[n]==="visible")},N4=function(e){return ew(e,"overflowY")},_4=function(e){return ew(e,"overflowX")},Hx=function(e,n){var i=n.ownerDocument,a=n;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var s=tw(e,a);if(s){var u=nw(e,a),c=u[1],d=u[2];if(c>d)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},j4=function(e){var n=e.scrollTop,i=e.scrollHeight,a=e.clientHeight;return[n,i,a]},k4=function(e){var n=e.scrollLeft,i=e.scrollWidth,a=e.clientWidth;return[n,i,a]},tw=function(e,n){return e==="v"?N4(n):_4(n)},nw=function(e,n){return e==="v"?j4(n):k4(n)},T4=function(e,n){return e==="h"&&n==="rtl"?-1:1},A4=function(e,n,i,a,s){var u=T4(e,window.getComputedStyle(n).direction),c=u*a,d=i.target,g=n.contains(d),p=!1,y=c>0,v=0,x=0;do{if(!d)break;var S=nw(e,d),j=S[0],C=S[1],T=S[2],k=C-T-u*j;(j||k)&&tw(e,d)&&(v+=k,x+=j);var P=d.parentNode;d=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!g&&d!==document.body||g&&(n.contains(d)||n===d));return(y&&Math.abs(v)<1||!y&&Math.abs(x)<1)&&(p=!0),p},hc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zx=function(e){return[e.deltaX,e.deltaY]},Fx=function(e){return e&&"current"in e?e.current:e},z4=function(e,n){return e[0]===n[0]&&e[1]===n[1]},O4=function(e){return`
291
- .block-interactivity-`.concat(e,` {pointer-events: none;}
292
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
293
- `)},R4=0,Rl=[];function M4(e){var n=w.useRef([]),i=w.useRef([0,0]),a=w.useRef(),s=w.useState(R4++)[0],u=w.useState(WS)[0],c=w.useRef(e);w.useEffect(function(){c.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=t4([e.lockRef.current],(e.shards||[]).map(Fx),!0).filter(Boolean);return C.forEach(function(T){return T.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=w.useCallback(function(C,T){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var k=hc(C),P=i.current,U="deltaX"in C?C.deltaX:P[0]-k[0],H="deltaY"in C?C.deltaY:P[1]-k[1],K,L=C.target,V=Math.abs(U)>Math.abs(H)?"h":"v";if("touches"in C&&V==="h"&&L.type==="range")return!1;var D=window.getSelection(),B=D&&D.anchorNode,ie=B?B===L||B.contains(L):!1;if(ie)return!1;var se=Hx(V,L);if(!se)return!0;if(se?K=V:(K=V==="v"?"h":"v",se=Hx(V,L)),!se)return!1;if(!a.current&&"changedTouches"in C&&(U||H)&&(a.current=K),!K)return!0;var le=a.current||K;return A4(le,T,C,le==="h"?U:H)},[]),g=w.useCallback(function(C){var T=C;if(!(!Rl.length||Rl[Rl.length-1]!==u)){var k="deltaY"in T?Zx(T):hc(T),P=n.current.filter(function(K){return K.name===T.type&&(K.target===T.target||T.target===K.shadowParent)&&z4(K.delta,k)})[0];if(P&&P.should){T.cancelable&&T.preventDefault();return}if(!P){var U=(c.current.shards||[]).map(Fx).filter(Boolean).filter(function(K){return K.contains(T.target)}),H=U.length>0?d(T,U[0]):!c.current.noIsolation;H&&T.cancelable&&T.preventDefault()}}},[]),p=w.useCallback(function(C,T,k,P){var U={name:C,delta:T,target:k,should:P,shadowParent:D4(k)};n.current.push(U),setTimeout(function(){n.current=n.current.filter(function(H){return H!==U})},1)},[]),y=w.useCallback(function(C){i.current=hc(C),a.current=void 0},[]),v=w.useCallback(function(C){p(C.type,Zx(C),C.target,d(C,e.lockRef.current))},[]),x=w.useCallback(function(C){p(C.type,hc(C),C.target,d(C,e.lockRef.current))},[]);w.useEffect(function(){return Rl.push(u),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",g,Ol),document.addEventListener("touchmove",g,Ol),document.addEventListener("touchstart",y,Ol),function(){Rl=Rl.filter(function(C){return C!==u}),document.removeEventListener("wheel",g,Ol),document.removeEventListener("touchmove",g,Ol),document.removeEventListener("touchstart",y,Ol)}},[]);var S=e.removeScrollBar,j=e.inert;return w.createElement(w.Fragment,null,j?w.createElement(u,{styles:O4(s)}):null,S?w.createElement(E4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function D4(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const U4=c4(JS,M4);var rw=w.forwardRef(function(e,n){return w.createElement(Kc,_r({},e,{ref:n,sideCar:U4}))});rw.classNames=Kc.classNames;var L4=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Ml=new WeakMap,mc=new WeakMap,pc={},Uh=0,iw=function(e){return e&&(e.host||iw(e.parentNode))},I4=function(e,n){return n.map(function(i){if(e.contains(i))return i;var a=iw(i);return a&&e.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},B4=function(e,n,i,a){var s=I4(n,Array.isArray(e)?e:[e]);pc[i]||(pc[i]=new WeakMap);var u=pc[i],c=[],d=new Set,g=new Set(s),p=function(v){!v||d.has(v)||(d.add(v),p(v.parentNode))};s.forEach(p);var y=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(x){if(d.has(x))y(x);else try{var S=x.getAttribute(a),j=S!==null&&S!=="false",C=(Ml.get(x)||0)+1,T=(u.get(x)||0)+1;Ml.set(x,C),u.set(x,T),c.push(x),C===1&&j&&mc.set(x,!0),T===1&&x.setAttribute(i,"true"),j||x.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",x,k)}})};return y(n),d.clear(),Uh++,function(){c.forEach(function(v){var x=Ml.get(v)-1,S=u.get(v)-1;Ml.set(v,x),u.set(v,S),x||(mc.has(v)||v.removeAttribute(a),mc.delete(v)),S||v.removeAttribute(i)}),Uh--,Uh||(Ml=new WeakMap,Ml=new WeakMap,mc=new WeakMap,pc={})}},q4=function(e,n,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),s=L4(e);return s?(a.push.apply(a,Array.from(s.querySelectorAll("[aria-live], script"))),B4(a,s,i,"aria-hidden")):function(){return null}},Xc="Dialog",[aw]=bM(Xc),[P4,mr]=aw(Xc),lw=e=>{const{__scopeDialog:n,children:i,open:a,defaultOpen:s,onOpenChange:u,modal:c=!0}=e,d=w.useRef(null),g=w.useRef(null),[p,y]=CM({prop:a,defaultProp:s??!1,onChange:u,caller:Xc});return h.jsx(P4,{scope:n,triggerRef:d,contentRef:g,contentId:Th(),titleId:Th(),descriptionId:Th(),open:p,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(v=>!v),[y]),modal:c,children:i})};lw.displayName=Xc;var sw="DialogTrigger",ow=w.forwardRef((e,n)=>{const{__scopeDialog:i,...a}=e,s=mr(sw,i),u=Ha(n,s.triggerRef);return h.jsx(ui.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":fp(s.open),...a,ref:u,onClick:ea(e.onClick,s.onOpenToggle)})});ow.displayName=sw;var up="DialogPortal",[H4,uw]=aw(up,{forceMount:void 0}),cw=e=>{const{__scopeDialog:n,forceMount:i,children:a,container:s}=e,u=mr(up,n);return h.jsx(H4,{scope:n,forceMount:i,children:w.Children.map(a,c=>h.jsx(Gc,{present:i||u.open,children:h.jsx(GS,{asChild:!0,container:s,children:c})}))})};cw.displayName=up;var Mc="DialogOverlay",fw=w.forwardRef((e,n)=>{const i=uw(Mc,e.__scopeDialog),{forceMount:a=i.forceMount,...s}=e,u=mr(Mc,e.__scopeDialog);return u.modal?h.jsx(Gc,{present:a||u.open,children:h.jsx(F4,{...s,ref:n})}):null});fw.displayName=Mc;var Z4=ZS("DialogOverlay.RemoveScroll"),F4=w.forwardRef((e,n)=>{const{__scopeDialog:i,...a}=e,s=mr(Mc,i);return h.jsx(rw,{as:Z4,allowPinchZoom:!0,shards:[s.contentRef],children:h.jsx(ui.div,{"data-state":fp(s.open),...a,ref:n,style:{pointerEvents:"auto",...a.style}})})}),qa="DialogContent",dw=w.forwardRef((e,n)=>{const i=uw(qa,e.__scopeDialog),{forceMount:a=i.forceMount,...s}=e,u=mr(qa,e.__scopeDialog);return h.jsx(Gc,{present:a||u.open,children:u.modal?h.jsx($4,{...s,ref:n}):h.jsx(V4,{...s,ref:n})})});dw.displayName=qa;var $4=w.forwardRef((e,n)=>{const i=mr(qa,e.__scopeDialog),a=w.useRef(null),s=Ha(n,i.contentRef,a);return w.useEffect(()=>{const u=a.current;if(u)return q4(u)},[]),h.jsx(hw,{...e,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ea(e.onCloseAutoFocus,u=>{var c;u.preventDefault(),(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ea(e.onPointerDownOutside,u=>{const c=u.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&u.preventDefault()}),onFocusOutside:ea(e.onFocusOutside,u=>u.preventDefault())})}),V4=w.forwardRef((e,n)=>{const i=mr(qa,e.__scopeDialog),a=w.useRef(!1),s=w.useRef(!1);return h.jsx(hw,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,u),u.defaultPrevented||(a.current||(d=i.triggerRef.current)==null||d.focus(),u.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:u=>{var g,p;(g=e.onInteractOutside)==null||g.call(e,u),u.defaultPrevented||(a.current=!0,u.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=u.target;((p=i.triggerRef.current)==null?void 0:p.contains(c))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.current&&u.preventDefault()}})}),hw=w.forwardRef((e,n)=>{const{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:u,...c}=e,d=mr(qa,i),g=w.useRef(null),p=Ha(n,g);return e4(),h.jsxs(h.Fragment,{children:[h.jsx(QS,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:u,children:h.jsx($S,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":fp(d.open),...c,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Q4,{titleId:d.titleId}),h.jsx(G4,{contentRef:g,descriptionId:d.descriptionId})]})]})}),cp="DialogTitle",mw=w.forwardRef((e,n)=>{const{__scopeDialog:i,...a}=e,s=mr(cp,i);return h.jsx(ui.h2,{id:s.titleId,...a,ref:n})});mw.displayName=cp;var pw="DialogDescription",gw=w.forwardRef((e,n)=>{const{__scopeDialog:i,...a}=e,s=mr(pw,i);return h.jsx(ui.p,{id:s.descriptionId,...a,ref:n})});gw.displayName=pw;var yw="DialogClose",vw=w.forwardRef((e,n)=>{const{__scopeDialog:i,...a}=e,s=mr(yw,i);return h.jsx(ui.button,{type:"button",...a,ref:n,onClick:ea(e.onClick,()=>s.onOpenChange(!1))})});vw.displayName=yw;function fp(e){return e?"open":"closed"}var bw="DialogTitleWarning",[jL,xw]=vM(bw,{contentName:qa,titleName:cp,docsSlug:"dialog"}),Q4=({titleId:e})=>{const n=xw(bw),i=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
294
-
295
- If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
296
-
297
- For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(i))},[i,e]),null},Y4="DialogDescriptionWarning",G4=({contentRef:e,descriptionId:n})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xw(Y4).contentName}}.`;return w.useEffect(()=>{var u;const s=(u=e.current)==null?void 0:u.getAttribute("aria-describedby");n&&s&&(document.getElementById(n)||console.warn(a))},[a,e,n]),null},K4=lw,X4=ow,J4=cw,W4=fw,eD=dw,tD=mw,nD=gw,rD=vw;const Pl=K4,iD=X4,aD=J4,Sw=w.forwardRef(({className:e,...n},i)=>h.jsx(W4,{ref:i,className:Oe("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),...n}));Sw.displayName="DialogOverlay";const La=w.forwardRef(({className:e,children:n,...i},a)=>h.jsxs(aD,{children:[h.jsx(Sw,{}),h.jsxs(eD,{ref:a,className:Oe("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),...i,children:[n,h.jsxs(rD,{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:[h.jsx(Fk,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));La.displayName="DialogContent";function Hl({className:e,...n}){return h.jsx("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...n})}function Ji({className:e,...n}){return h.jsx("div",{className:Oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n})}const Ia=w.forwardRef(({className:e,...n},i)=>h.jsx(tD,{ref:i,className:Oe("text-lg font-semibold leading-none tracking-tight",e),...n}));Ia.displayName="DialogTitle";const lD=w.forwardRef(({className:e,...n},i)=>h.jsx(nD,{ref:i,className:Oe("text-sm text-muted-foreground",e),...n}));lD.displayName="DialogDescription";const en=w.forwardRef(({className:e,type:n,...i},a)=>h.jsx("input",{type:n,className:Oe("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,...i}));en.displayName="Input";var sD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oD=sD.reduce((e,n)=>{const i=nS(`Primitive.${n}`),a=w.forwardRef((s,u)=>{const{asChild:c,...d}=s,g=c?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(g,{...d,ref:u})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{}),uD="Label",ww=w.forwardRef((e,n)=>h.jsx(oD.label,{...e,ref:n,onMouseDown:i=>{var s;i.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));ww.displayName=uD;var cD=ww;const Nt=w.forwardRef(({className:e,...n},i)=>h.jsx(cD,{ref:i,className:Oe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...n}));Nt.displayName="Label";const fD=Object.values(lM);function dD(){const e=nr(),[n,i]=w.useState(!1),[a,s]=w.useState({username:"",displayName:"",role:"member"}),[u,c]=w.useState(null),{data:d,isLoading:g,error:p}=Ke({queryKey:["members"],queryFn:PS}),y=bt({mutationFn:()=>gM({username:a.username,displayName:a.displayName,role:a.role}),onSuccess:C=>{e.invalidateQueries({queryKey:["members"]}),c(C.password)}}),v=bt({mutationFn:yM,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function x(){i(!1),s({username:"",displayName:"",role:"member"}),c(null)}function S(C){C.preventDefault(),y.mutate()}function j(C){window.confirm("Delete this member? Their human agent will also be deactivated.")&&v.mutate(C)}return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:"Members"}),h.jsxs(Pl,{open:n,onOpenChange:C=>C?i(!0):x(),children:[h.jsx(iD,{asChild:!0,children:h.jsxs(qe,{children:[h.jsx(wo,{className:"h-4 w-4 mr-2"}),"Add Member"]})}),h.jsxs(La,{children:[h.jsx(Hl,{children:h.jsx(Ia,{children:u?"Member Created":"Create Member"})}),u?h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Member created. Share the password below — it will only be shown once."}),h.jsxs("div",{className:"flex items-center gap-2 rounded-md border p-3 bg-muted",children:[h.jsx("code",{className:"flex-1 text-sm font-mono",children:u}),h.jsx(qe,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(u),title:"Copy password",children:h.jsx(Pc,{className:"h-4 w-4"})})]}),h.jsx(Ji,{children:h.jsx(qe,{onClick:x,children:"Done"})})]}):h.jsxs("form",{onSubmit:S,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"member-username",children:"Username"}),h.jsx(en,{id:"member-username",type:"text",value:a.username,onChange:C=>s({...a,username:C.target.value}),required:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"member-name",children:"Display Name"}),h.jsx(en,{id:"member-name",value:a.displayName,onChange:C=>s({...a,displayName:C.target.value}),required:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"member-role",children:"Role"}),h.jsx("select",{id:"member-role",value:a.role,onChange:C=>s({...a,role:C.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:fD.map(C=>h.jsx("option",{value:C,children:C},C))})]}),y.error instanceof Error&&h.jsx("div",{className:"text-sm text-destructive",children:y.error.message}),h.jsx(Ji,{children:h.jsx(qe,{type:"submit",disabled:y.isPending,children:y.isPending?"Creating...":"Create"})})]})]})]})]}),h.jsx("div",{className:"border rounded-lg",children:h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{children:"Username"}),h.jsx(Se,{children:"Name"}),h.jsx(Se,{children:"Role"}),h.jsx(Se,{children:"Created"}),h.jsx(Se,{className:"w-16"})]})}),h.jsx(zr,{children:g?h.jsx(nt,{children:h.jsx(xe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"Loading..."})}):p?h.jsx(nt,{children:h.jsxs(xe,{colSpan:5,className:"text-center py-8 text-destructive",children:["Failed to load members: ",p instanceof Error?p.message:"Unknown error"]})}):(d==null?void 0:d.length)===0?h.jsx(nt,{children:h.jsx(xe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"No members"})}):d==null?void 0:d.map(C=>h.jsxs(nt,{children:[h.jsx(xe,{className:"font-medium",children:C.username}),h.jsx(xe,{children:C.displayName}),h.jsx(xe,{children:h.jsx(Ht,{variant:C.role==="admin"?"default":"secondary",children:C.role})}),h.jsx(xe,{className:"text-muted-foreground",children:fn(C.createdAt)}),h.jsx(xe,{children:h.jsx(qe,{variant:"ghost",size:"icon",onClick:()=>j(C.id),disabled:v.isPending,title:"Delete",children:h.jsx(mo,{className:"h-4 w-4"})})})]},C.id))})]})})]})}function hD(){return De.get("/admin/system/config")}function mD(e){return De.patch("/admin/system/config",e)}const pD={[li.INBOX_TIMEOUT_SECONDS]:"Inbox Timeout (seconds)",[li.MAX_RETRY_COUNT]:"Max Retry Count",[li.POLLING_INTERVAL_SECONDS]:"Polling Interval (seconds)",[li.PRESENCE_CLEANUP_SECONDS]:"Presence Cleanup (seconds)"},$x=Object.values(li);function gD(){const e=nr(),{data:n,isLoading:i}=Ke({queryKey:["system-config"],queryFn:hD}),[a,s]=w.useState({}),[u,c]=w.useState(!1);w.useEffect(()=>{if(!n)return;const p={};for(const y of $x){const v=n[y]??kh[y]??"";p[y]=String(v)}s(p)},[n]);const d=bt({mutationFn:()=>{const p={};for(const[y,v]of Object.entries(a)){const x=v.trim();if(x==="")p[y]=kh[y]??0;else{const S=Number(x);p[y]=Number.isNaN(S)?x:S}}return mD(p)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),c(!0),setTimeout(()=>c(!1),2e3)}}),g=p=>{p.preventDefault(),d.mutate()};return i?h.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-semibold mb-6",children:"Settings"}),h.jsxs(fr,{children:[h.jsx(Cr,{children:h.jsx(Nr,{children:"System Configuration"})}),h.jsx(dr,{children:h.jsxs("form",{onSubmit:g,className:"space-y-4",children:[$x.map(p=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:p,children:pD[p]??p}),h.jsx(en,{id:p,value:a[p]??"",onChange:y=>s({...a,[p]:y.target.value})}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default: ",String(kh[p]??"—")]})]},p)),d.error instanceof Error&&h.jsx("div",{className:"text-sm text-destructive",children:d.error.message}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(qe,{type:"submit",disabled:d.isPending,children:d.isPending?"Saving...":"Save Changes"}),u&&h.jsx("span",{className:"text-sm text-green-600",children:"Saved!"})]})]})})]})]})}const Vx=[{key:"members",label:"Members"},{key:"clients",label:"Clients"},{key:"settings",label:"Settings"},{key:"bindings",label:"Bindings"}];function yD(){const e=ir(),n=ra(),i=e.hash.replace("#",""),a=Vx.some(u=>u.key===i)?i:"members",s=u=>{n({hash:u},{replace:!0})};return h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"Admin"}),h.jsx("div",{className:"flex gap-1 border-b border-border mb-6",children:Vx.map(u=>h.jsx("button",{type:"button",onClick:()=>s(u.key),className:Oe("px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",a===u.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:u.label},u.key))}),a==="members"&&h.jsx(dD,{}),a==="clients"&&h.jsx(hT,{}),a==="settings"&&h.jsx(gD,{}),a==="bindings"&&h.jsx(eT,{})]})}function vD(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const bD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SD={};function Qx(e,n){return(SD.jsx?xD:bD).test(e)}const wD=/[ \t\n\f\r]/g;function ED(e){return typeof e=="object"?e.type==="text"?Yx(e.value):!1:Yx(e)}function Yx(e){return e.replace(wD,"")===""}class Io{constructor(n,i,a){this.normal=i,this.property=n,a&&(this.space=a)}}Io.prototype.normal={};Io.prototype.property={};Io.prototype.space=void 0;function Ew(e,n){const i={},a={};for(const s of e)Object.assign(i,s.property),Object.assign(a,s.normal);return new Io(i,a,n)}function xm(e){return e.toLowerCase()}class An{constructor(n,i){this.attribute=i,this.property=n}}An.prototype.attribute="";An.prototype.booleanish=!1;An.prototype.boolean=!1;An.prototype.commaOrSpaceSeparated=!1;An.prototype.commaSeparated=!1;An.prototype.defined=!1;An.prototype.mustUseProperty=!1;An.prototype.number=!1;An.prototype.overloadedBoolean=!1;An.prototype.property="";An.prototype.spaceSeparated=!1;An.prototype.space=void 0;let CD=0;const Be=Fa(),Pt=Fa(),Sm=Fa(),ae=Fa(),pt=Fa(),Zl=Fa(),In=Fa();function Fa(){return 2**++CD}const wm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Pt,commaOrSpaceSeparated:In,commaSeparated:Zl,number:ae,overloadedBoolean:Sm,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),Lh=Object.keys(wm);class dp extends An{constructor(n,i,a,s){let u=-1;if(super(n,i),Gx(this,"space",s),typeof a=="number")for(;++u<Lh.length;){const c=Lh[u];Gx(this,Lh[u],(a&wm[c])===wm[c])}}}dp.prototype.defined=!0;function Gx(e,n,i){i&&(e[n]=i)}function cs(e){const n={},i={};for(const[a,s]of Object.entries(e.properties)){const u=new dp(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),n[a]=u,i[xm(a)]=a,i[xm(u.attribute)]=a}return new Io(n,i,e.space)}const Cw=cs({properties:{ariaActiveDescendant:null,ariaAtomic:Pt,ariaAutoComplete:null,ariaBusy:Pt,ariaChecked:Pt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:pt,ariaCurrent:null,ariaDescribedBy:pt,ariaDetails:null,ariaDisabled:Pt,ariaDropEffect:pt,ariaErrorMessage:null,ariaExpanded:Pt,ariaFlowTo:pt,ariaGrabbed:Pt,ariaHasPopup:null,ariaHidden:Pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pt,ariaLevel:ae,ariaLive:null,ariaModal:Pt,ariaMultiLine:Pt,ariaMultiSelectable:Pt,ariaOrientation:null,ariaOwns:pt,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:Pt,ariaReadOnly:Pt,ariaRelevant:null,ariaRequired:Pt,ariaRoleDescription:pt,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:Pt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Nw(e,n){return n in e?e[n]:n}function _w(e,n){return Nw(e,n.toLowerCase())}const ND=cs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zl,acceptCharset:pt,accessKey:pt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:pt,autoFocus:Be,autoPlay:Be,blocking:pt,capture:null,charSet:null,checked:Be,cite:null,className:pt,cols:ae,colSpan:null,content:null,contentEditable:Pt,controls:Be,controlsList:pt,coords:ae|Zl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Sm,draggable:Pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:pt,height:ae,hidden:Sm,high:ae,href:null,hrefLang:null,htmlFor:pt,httpEquiv:pt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:pt,itemRef:pt,itemScope:Be,itemType:pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,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:Be,optimum:ae,pattern:null,ping:pt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:pt,required:Be,reversed:Be,rows:ae,rowSpan:ae,sandbox:pt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:Pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:Pt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pt,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:Pt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Be,disableRemotePlayback:Be,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:_w}),_D=cs({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:In,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:pt,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:Zl,g2:Zl,glyphName:Zl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:In,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,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:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:In,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:In,rev:In,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:In,requiredFeatures:In,requiredFonts:In,requiredFormats:In,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:In,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:In,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:In,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Nw}),jw=cs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),kw=cs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_w}),Tw=cs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),jD={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"},kD=/[A-Z]/g,Kx=/-[a-z]/g,TD=/^data[-\w.:]+$/i;function AD(e,n){const i=xm(n);let a=n,s=An;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&TD.test(n)){if(n.charAt(4)==="-"){const u=n.slice(5).replace(Kx,OD);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=n.slice(4);if(!Kx.test(u)){let c=u.replace(kD,zD);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}s=dp}return new s(a,n)}function zD(e){return"-"+e.toLowerCase()}function OD(e){return e.charAt(1).toUpperCase()}const RD=Ew([Cw,ND,jw,kw,Tw],"html"),hp=Ew([Cw,_D,jw,kw,Tw],"svg");function MD(e){return e.join(" ").trim()}var Dl={},Ih,Xx;function DD(){if(Xx)return Ih;Xx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,g=`
298
- `,p="/",y="*",v="",x="comment",S="declaration";function j(T,k){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];k=k||{};var P=1,U=1;function H(fe){var ne=fe.match(n);ne&&(P+=ne.length);var q=fe.lastIndexOf(g);U=~q?fe.length-q:U+fe.length}function K(){var fe={line:P,column:U};return function(ne){return ne.position=new L(fe),B(),ne}}function L(fe){this.start=fe,this.end={line:P,column:U},this.source=k.source}L.prototype.content=T;function V(fe){var ne=new Error(k.source+":"+P+":"+U+": "+fe);if(ne.reason=fe,ne.filename=k.source,ne.line=P,ne.column=U,ne.source=T,!k.silent)throw ne}function D(fe){var ne=fe.exec(T);if(ne){var q=ne[0];return H(q),T=T.slice(q.length),ne}}function B(){D(i)}function ie(fe){var ne;for(fe=fe||[];ne=se();)ne!==!1&&fe.push(ne);return fe}function se(){var fe=K();if(!(p!=T.charAt(0)||y!=T.charAt(1))){for(var ne=2;v!=T.charAt(ne)&&(y!=T.charAt(ne)||p!=T.charAt(ne+1));)++ne;if(ne+=2,v===T.charAt(ne-1))return V("End of comment missing");var q=T.slice(2,ne-2);return U+=2,H(q),T=T.slice(ne),U+=2,fe({type:x,comment:q})}}function le(){var fe=K(),ne=D(a);if(ne){if(se(),!D(s))return V("property missing ':'");var q=D(u),re=fe({type:S,property:C(ne[0].replace(e,v)),value:q?C(q[0].replace(e,v)):v});return D(c),re}}function ke(){var fe=[];ie(fe);for(var ne;ne=le();)ne!==!1&&(fe.push(ne),ie(fe));return fe}return B(),ke()}function C(T){return T?T.replace(d,v):v}return Ih=j,Ih}var Jx;function UD(){if(Jx)return Dl;Jx=1;var e=Dl&&Dl.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.default=i;const n=e(DD());function i(a,s){let u=null;if(!a||typeof a!="string")return u;const c=(0,n.default)(a),d=typeof s=="function";return c.forEach(g=>{if(g.type!=="declaration")return;const{property:p,value:y}=g;d?s(p,y,g):y&&(u=u||{},u[p]=y)}),u}return Dl}var oo={},Wx;function LD(){if(Wx)return oo;Wx=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,u=function(p){return!p||i.test(p)||e.test(p)},c=function(p,y){return y.toUpperCase()},d=function(p,y){return"".concat(y,"-")},g=function(p,y){return y===void 0&&(y={}),u(p)?p:(p=p.toLowerCase(),y.reactCompat?p=p.replace(s,d):p=p.replace(a,d),p.replace(n,c))};return oo.camelCase=g,oo}var uo,e0;function ID(){if(e0)return uo;e0=1;var e=uo&&uo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(UD()),i=LD();function a(s,u){var c={};return!s||typeof s!="string"||(0,n.default)(s,function(d,g){d&&g&&(c[(0,i.camelCase)(d,u)]=g)}),c}return a.default=a,uo=a,uo}var BD=ID();const qD=Lc(BD),Aw=zw("end"),mp=zw("start");function zw(e){return n;function n(i){const a=i&&i.position&&i.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 PD(e){const n=mp(e),i=Aw(e);if(n&&i)return{start:n,end:i}}function go(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?t0(e.position):"start"in e||"end"in e?t0(e):"line"in e||"column"in e?Em(e):""}function Em(e){return n0(e&&e.line)+":"+n0(e&&e.column)}function t0(e){return Em(e&&e.start)+"-"+Em(e&&e.end)}function n0(e){return e&&typeof e=="number"?e:1}class dn extends Error{constructor(n,i,a){super(),typeof i=="string"&&(a=i,i=void 0);let s="",u={},c=!1;if(i&&("line"in i&&"column"in i?u={place:i}:"start"in i&&"end"in i?u={place:i}:"type"in i?u={ancestors:[i],place:i.position}:u={...i}),typeof n=="string"?s=n:!u.cause&&n&&(c=!0,s=n.message,u.cause=n),!u.ruleId&&!u.source&&typeof a=="string"){const g=a.indexOf(":");g===-1?u.ruleId=a:(u.source=a.slice(0,g),u.ruleId=a.slice(g+1))}if(!u.place&&u.ancestors&&u.ancestors){const g=u.ancestors[u.ancestors.length-1];g&&(u.place=g.position)}const d=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=go(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}dn.prototype.file="";dn.prototype.name="";dn.prototype.reason="";dn.prototype.message="";dn.prototype.stack="";dn.prototype.column=void 0;dn.prototype.line=void 0;dn.prototype.ancestors=void 0;dn.prototype.cause=void 0;dn.prototype.fatal=void 0;dn.prototype.place=void 0;dn.prototype.ruleId=void 0;dn.prototype.source=void 0;const pp={}.hasOwnProperty,HD=new Map,ZD=/[A-Z]/g,FD=new Set(["table","tbody","thead","tfoot","tr"]),$D=new Set(["td","th"]),Ow="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VD(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let a;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=e3(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=WD(i,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:a,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?hp:RD,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},u=Rw(s,e,void 0);return u&&typeof u!="string"?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}function Rw(e,n,i){if(n.type==="element")return QD(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return YD(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return KD(e,n,i);if(n.type==="mdxjsEsm")return GD(e,n);if(n.type==="root")return XD(e,n,i);if(n.type==="text")return JD(e,n)}function QD(e,n,i){const a=e.schema;let s=a;n.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=hp,e.schema=s),e.ancestors.push(n);const u=Dw(e,n.tagName,!1),c=t3(e,n);let d=yp(e,n);return FD.has(n.tagName)&&(d=d.filter(function(g){return typeof g=="string"?!ED(g):!0})),Mw(e,c,u,n),gp(c,d),e.ancestors.pop(),e.schema=a,e.create(n,u,c,i)}function YD(e,n){if(n.data&&n.data.estree&&e.evaluater){const a=n.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}ko(e,n.position)}function GD(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ko(e,n.position)}function KD(e,n,i){const a=e.schema;let s=a;n.name==="svg"&&a.space==="html"&&(s=hp,e.schema=s),e.ancestors.push(n);const u=n.name===null?e.Fragment:Dw(e,n.name,!0),c=n3(e,n),d=yp(e,n);return Mw(e,c,u,n),gp(c,d),e.ancestors.pop(),e.schema=a,e.create(n,u,c,i)}function XD(e,n,i){const a={};return gp(a,yp(e,n)),e.create(n,e.Fragment,a,i)}function JD(e,n){return n.value}function Mw(e,n,i,a){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=a)}function gp(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function WD(e,n,i){return a;function a(s,u,c,d){const p=Array.isArray(c.children)?i:n;return d?p(u,c,d):p(u,c)}}function e3(e,n){return i;function i(a,s,u,c){const d=Array.isArray(u.children),g=mp(a);return n(s,u,c,d,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function t3(e,n){const i={};let a,s;for(s in n.properties)if(s!=="children"&&pp.call(n.properties,s)){const u=r3(e,s,n.properties[s]);if(u){const[c,d]=u;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&$D.has(n.tagName)?a=d:i[c]=d}}if(a){const u=i.style||(i.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return i}function n3(e,n){const i={};for(const a of n.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const u=a.data.estree.body[0];u.type;const c=u.expression;c.type;const d=c.properties[0];d.type,Object.assign(i,e.evaluater.evaluateExpression(d.argument))}else ko(e,n.position);else{const s=a.name;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,u=e.evaluater.evaluateExpression(d.expression)}else ko(e,n.position);else u=a.value===null?!0:a.value;i[s]=u}return i}function yp(e,n){const i=[];let a=-1;const s=e.passKeys?new Map:HD;for(;++a<n.children.length;){const u=n.children[a];let c;if(e.passKeys){const g=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(g){const p=s.get(g)||0;c=g+"-"+p,s.set(g,p+1)}}const d=Rw(e,u,c);d!==void 0&&i.push(d)}return i}function r3(e,n,i){const a=AD(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=a.commaSeparated?vD(i):MD(i)),a.property==="style"){let s=typeof i=="object"?i:i3(e,String(i));return e.stylePropertyNameCase==="css"&&(s=a3(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?jD[a.property]||a.property:a.attribute,i]}}function i3(e,n){try{return qD(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const a=i,s=new dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Ow+"#cannot-parse-style-attribute",s}}function Dw(e,n,i){let a;if(!i)a={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let u=-1,c;for(;++u<s.length;){const d=Qx(s[u])?{type:"Identifier",name:s[u]}:{type:"Literal",value:s[u]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(u&&d.type==="Literal"),optional:!1}:d}a=c}else a=Qx(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(a.type==="Literal"){const s=a.value;return pp.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);ko(e)}function ko(e,n){const i=new dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Ow+"#cannot-handle-mdx-estrees-without-createevaluater",i}function a3(e){const n={};let i;for(i in e)pp.call(e,i)&&(n[l3(i)]=e[i]);return n}function l3(e){let n=e.replace(ZD,s3);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function s3(e){return"-"+e.toLowerCase()}const Bh={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"]},o3={};function u3(e,n){const i=o3,a=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return Uw(e,a,s)}function Uw(e,n,i){if(c3(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return r0(e.children,n,i)}return Array.isArray(e)?r0(e,n,i):""}function r0(e,n,i){const a=[];let s=-1;for(;++s<e.length;)a[s]=Uw(e[s],n,i);return a.join("")}function c3(e){return!!(e&&typeof e=="object")}const i0=document.createElement("i");function vp(e){const n="&"+e+";";i0.innerHTML=n;const i=i0.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function Or(e,n,i,a){const s=e.length;let u=0,c;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,i=i>0?i:0,a.length<1e4)c=Array.from(a),c.unshift(n,i),e.splice(...c);else for(i&&e.splice(n,i);u<a.length;)c=a.slice(u,u+1e4),c.unshift(n,0),e.splice(...c),u+=1e4,n+=1e4}function er(e,n){return e.length>0?(Or(e,e.length,0,n),e):n}const a0={}.hasOwnProperty;function f3(e){const n={};let i=-1;for(;++i<e.length;)d3(n,e[i]);return n}function d3(e,n){let i;for(i in n){const s=(a0.call(e,i)?e[i]:void 0)||(e[i]={}),u=n[i];let c;if(u)for(c in u){a0.call(s,c)||(s[c]=[]);const d=u[c];h3(s[c],Array.isArray(d)?d:d?[d]:[])}}}function h3(e,n){let i=-1;const a=[];for(;++i<n.length;)(n[i].add==="after"?e:a).push(n[i]);Or(e,0,0,a)}function Lw(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Fl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const jr=sa(/[A-Za-z]/),qn=sa(/[\dA-Za-z]/),m3=sa(/[#-'*+\--9=?A-Z^-~]/);function Cm(e){return e!==null&&(e<32||e===127)}const Nm=sa(/\d/),p3=sa(/[\dA-Fa-f]/),g3=sa(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function kn(e){return e!==null&&(e<0||e===32)}function tt(e){return e===-2||e===-1||e===32}const y3=sa(new RegExp("\\p{P}|\\p{S}","u")),v3=sa(/\s/);function sa(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function fs(e){const n=[];let i=-1,a=0,s=0;for(;++i<e.length;){const u=e.charCodeAt(i);let c="";if(u===37&&qn(e.charCodeAt(i+1))&&qn(e.charCodeAt(i+2)))s=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const d=e.charCodeAt(i+1);u<56320&&d>56319&&d<57344?(c=String.fromCharCode(u,d),s=1):c="�"}else c=String.fromCharCode(u);c&&(n.push(e.slice(a,i),encodeURIComponent(c)),a=i+s+1,c=""),s&&(i+=s,s=0)}return n.join("")+e.slice(a)}function gt(e,n,i,a){const s=a?a-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(g){return tt(g)?(e.enter(i),d(g)):n(g)}function d(g){return tt(g)&&u++<s?(e.consume(g),d):(e.exit(i),n(g))}}const b3={tokenize:x3};function x3(e){const n=e.attempt(this.parser.constructs.contentInitial,a,s);let i;return n;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),gt(e,n,"linePrefix")}function s(d){return e.enter("paragraph"),u(d)}function u(d){const g=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=g),i=g,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Te(d)?(e.consume(d),e.exit("chunkText"),u):(e.consume(d),c)}}const S3={tokenize:w3},l0={tokenize:E3};function w3(e){const n=this,i=[];let a=0,s,u,c;return d;function d(U){if(a<i.length){const H=i[a];return n.containerState=H[1],e.attempt(H[0].continuation,g,p)(U)}return p(U)}function g(U){if(a++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&P();const H=n.events.length;let K=H,L;for(;K--;)if(n.events[K][0]==="exit"&&n.events[K][1].type==="chunkFlow"){L=n.events[K][1].end;break}k(a);let V=H;for(;V<n.events.length;)n.events[V][1].end={...L},V++;return Or(n.events,K+1,0,n.events.slice(H)),n.events.length=V,p(U)}return d(U)}function p(U){if(a===i.length){if(!s)return x(U);if(s.currentConstruct&&s.currentConstruct.concrete)return j(U);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(l0,y,v)(U)}function y(U){return s&&P(),k(a),x(U)}function v(U){return n.parser.lazy[n.now().line]=a!==i.length,c=n.now().offset,j(U)}function x(U){return n.containerState={},e.attempt(l0,S,j)(U)}function S(U){return a++,i.push([n.currentConstruct,n.containerState]),x(U)}function j(U){if(U===null){s&&P(),k(0),e.consume(U);return}return s=s||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:u}),C(U)}function C(U){if(U===null){T(e.exit("chunkFlow"),!0),k(0),e.consume(U);return}return Te(U)?(e.consume(U),T(e.exit("chunkFlow")),a=0,n.interrupt=void 0,d):(e.consume(U),C)}function T(U,H){const K=n.sliceStream(U);if(H&&K.push(null),U.previous=u,u&&(u.next=U),u=U,s.defineSkip(U.start),s.write(K),n.parser.lazy[U.start.line]){let L=s.events.length;for(;L--;)if(s.events[L][1].start.offset<c&&(!s.events[L][1].end||s.events[L][1].end.offset>c))return;const V=n.events.length;let D=V,B,ie;for(;D--;)if(n.events[D][0]==="exit"&&n.events[D][1].type==="chunkFlow"){if(B){ie=n.events[D][1].end;break}B=!0}for(k(a),L=V;L<n.events.length;)n.events[L][1].end={...ie},L++;Or(n.events,D+1,0,n.events.slice(V)),n.events.length=L}}function k(U){let H=i.length;for(;H-- >U;){const K=i[H];n.containerState=K[1],K[0].exit.call(n,e)}i.length=U}function P(){s.write([null]),u=void 0,s=void 0,n.containerState._closeFlow=void 0}}function E3(e,n,i){return gt(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function s0(e){if(e===null||kn(e)||v3(e))return 1;if(y3(e))return 2}function bp(e,n,i){const a=[];let s=-1;for(;++s<e.length;){const u=e[s].resolveAll;u&&!a.includes(u)&&(n=u(n,i),a.push(u))}return n}const _m={name:"attention",resolveAll:C3,tokenize:N3};function C3(e,n){let i=-1,a,s,u,c,d,g,p,y;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(a=i;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&n.sliceSerialize(e[a][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[a][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;g=e[a][1].end.offset-e[a][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const v={...e[a][1].end},x={...e[i][1].start};o0(v,-g),o0(x,g),c={type:g>1?"strongSequence":"emphasisSequence",start:v,end:{...e[a][1].end}},d={type:g>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:x},u={type:g>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[i][1].start}},s={type:g>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[i][1].start={...d.end},p=[],e[a][1].end.offset-e[a][1].start.offset&&(p=er(p,[["enter",e[a][1],n],["exit",e[a][1],n]])),p=er(p,[["enter",s,n],["enter",c,n],["exit",c,n],["enter",u,n]]),p=er(p,bp(n.parser.constructs.insideSpan.null,e.slice(a+1,i),n)),p=er(p,[["exit",u,n],["enter",d,n],["exit",d,n],["exit",s,n]]),e[i][1].end.offset-e[i][1].start.offset?(y=2,p=er(p,[["enter",e[i][1],n],["exit",e[i][1],n]])):y=0,Or(e,a-1,i-a+3,p),i=a+p.length-y-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function N3(e,n){const i=this.parser.constructs.attentionMarkers.null,a=this.previous,s=s0(a);let u;return c;function c(g){return u=g,e.enter("attentionSequence"),d(g)}function d(g){if(g===u)return e.consume(g),d;const p=e.exit("attentionSequence"),y=s0(g),v=!y||y===2&&s||i.includes(g),x=!s||s===2&&y||i.includes(a);return p._open=!!(u===42?v:v&&(s||!x)),p._close=!!(u===42?x:x&&(y||!v)),n(g)}}function o0(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const _3={name:"autolink",tokenize:j3};function j3(e,n,i){let a=0;return s;function s(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(S){return jr(S)?(e.consume(S),c):S===64?i(S):p(S)}function c(S){return S===43||S===45||S===46||qn(S)?(a=1,d(S)):p(S)}function d(S){return S===58?(e.consume(S),a=0,g):(S===43||S===45||S===46||qn(S))&&a++<32?(e.consume(S),d):(a=0,p(S))}function g(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),n):S===null||S===32||S===60||Cm(S)?i(S):(e.consume(S),g)}function p(S){return S===64?(e.consume(S),y):m3(S)?(e.consume(S),p):i(S)}function y(S){return qn(S)?v(S):i(S)}function v(S){return S===46?(e.consume(S),a=0,y):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),n):x(S)}function x(S){if((S===45||qn(S))&&a++<63){const j=S===45?x:v;return e.consume(S),j}return i(S)}}const Jc={partial:!0,tokenize:k3};function k3(e,n,i){return a;function a(u){return tt(u)?gt(e,s,"linePrefix")(u):s(u)}function s(u){return u===null||Te(u)?n(u):i(u)}}const Iw={continuation:{tokenize:A3},exit:z3,name:"blockQuote",tokenize:T3};function T3(e,n,i){const a=this;return s;function s(c){if(c===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),u}return i(c)}function u(c){return tt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(c))}}function A3(e,n,i){const a=this;return s;function s(c){return tt(c)?gt(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return e.attempt(Iw,n,i)(c)}}function z3(e){e.exit("blockQuote")}const Bw={name:"characterEscape",tokenize:O3};function O3(e,n,i){return a;function a(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),s}function s(u){return g3(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(u)}}const qw={name:"characterReference",tokenize:R3};function R3(e,n,i){const a=this;let s=0,u,c;return d;function d(v){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),g}function g(v){return v===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(v),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),u=31,c=qn,y(v))}function p(v){return v===88||v===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(v),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,c=p3,y):(e.enter("characterReferenceValue"),u=7,c=Nm,y(v))}function y(v){if(v===59&&s){const x=e.exit("characterReferenceValue");return c===qn&&!vp(a.sliceSerialize(x))?i(v):(e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return c(v)&&s++<u?(e.consume(v),y):i(v)}}const u0={partial:!0,tokenize:D3},c0={concrete:!0,name:"codeFenced",tokenize:M3};function M3(e,n,i){const a=this,s={partial:!0,tokenize:K};let u=0,c=0,d;return g;function g(L){return p(L)}function p(L){const V=a.events[a.events.length-1];return u=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,d=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(L)}function y(L){return L===d?(c++,e.consume(L),y):c<3?i(L):(e.exit("codeFencedFenceSequence"),tt(L)?gt(e,v,"whitespace")(L):v(L))}function v(L){return L===null||Te(L)?(e.exit("codeFencedFence"),a.interrupt?n(L):e.check(u0,C,H)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(L))}function x(L){return L===null||Te(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),v(L)):tt(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),gt(e,S,"whitespace")(L)):L===96&&L===d?i(L):(e.consume(L),x)}function S(L){return L===null||Te(L)?v(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(L))}function j(L){return L===null||Te(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),v(L)):L===96&&L===d?i(L):(e.consume(L),j)}function C(L){return e.attempt(s,H,T)(L)}function T(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),k}function k(L){return u>0&&tt(L)?gt(e,P,"linePrefix",u+1)(L):P(L)}function P(L){return L===null||Te(L)?e.check(u0,C,H)(L):(e.enter("codeFlowValue"),U(L))}function U(L){return L===null||Te(L)?(e.exit("codeFlowValue"),P(L)):(e.consume(L),U)}function H(L){return e.exit("codeFenced"),n(L)}function K(L,V,D){let B=0;return ie;function ie(ne){return L.enter("lineEnding"),L.consume(ne),L.exit("lineEnding"),se}function se(ne){return L.enter("codeFencedFence"),tt(ne)?gt(L,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):le(ne)}function le(ne){return ne===d?(L.enter("codeFencedFenceSequence"),ke(ne)):D(ne)}function ke(ne){return ne===d?(B++,L.consume(ne),ke):B>=c?(L.exit("codeFencedFenceSequence"),tt(ne)?gt(L,fe,"whitespace")(ne):fe(ne)):D(ne)}function fe(ne){return ne===null||Te(ne)?(L.exit("codeFencedFence"),V(ne)):D(ne)}}}function D3(e,n,i){const a=this;return s;function s(c){return c===null?i(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return a.parser.lazy[a.now().line]?i(c):n(c)}}const qh={name:"codeIndented",tokenize:L3},U3={partial:!0,tokenize:I3};function L3(e,n,i){const a=this;return s;function s(p){return e.enter("codeIndented"),gt(e,u,"linePrefix",5)(p)}function u(p){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(p):i(p)}function c(p){return p===null?g(p):Te(p)?e.attempt(U3,c,g)(p):(e.enter("codeFlowValue"),d(p))}function d(p){return p===null||Te(p)?(e.exit("codeFlowValue"),c(p)):(e.consume(p),d)}function g(p){return e.exit("codeIndented"),n(p)}}function I3(e,n,i){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?i(c):Te(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):gt(e,u,"linePrefix",5)(c)}function u(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(c):Te(c)?s(c):i(c)}}const B3={name:"codeText",previous:P3,resolve:q3,tokenize:H3};function q3(e){let n=e.length-4,i=3,a,s;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(a=i;++a<n;)if(e[a][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(a=i-1,n++;++a<=n;)s===void 0?a!==n&&e[a][1].type!=="lineEnding"&&(s=a):(a===n||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),n-=a-s-2,a=s+2),s=void 0);return e}function P3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function H3(e,n,i){let a=0,s,u;return c;function c(v){return e.enter("codeText"),e.enter("codeTextSequence"),d(v)}function d(v){return v===96?(e.consume(v),a++,d):(e.exit("codeTextSequence"),g(v))}function g(v){return v===null?i(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),g):v===96?(u=e.enter("codeTextSequence"),s=0,y(v)):Te(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("codeTextData"),p(v))}function p(v){return v===null||v===32||v===96||Te(v)?(e.exit("codeTextData"),g(v)):(e.consume(v),p)}function y(v){return v===96?(e.consume(v),s++,y):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),n(v)):(u.type="codeTextData",p(v))}}class Z3{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const a=i??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(n,a):n>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(n,i,a){const s=i||0;this.setCursor(Math.trunc(n));const u=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&co(this.left,a),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),co(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),co(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);co(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);co(this.left,i.reverse())}}}function co(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function Pw(e){const n={};let i=-1,a,s,u,c,d,g,p;const y=new Z3(e);for(;++i<y.length;){for(;i in n;)i=n[i];if(a=y.get(i),i&&a[1].type==="chunkFlow"&&y.get(i-1)[1].type==="listItemPrefix"&&(g=a[1]._tokenizer.events,u=0,u<g.length&&g[u][1].type==="lineEndingBlank"&&(u+=2),u<g.length&&g[u][1].type==="content"))for(;++u<g.length&&g[u][1].type!=="content";)g[u][1].type==="chunkText"&&(g[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(n,F3(y,i)),i=n[i],p=!0);else if(a[1]._container){for(u=i,s=void 0;u--;)if(c=y.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(y.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(a[1].end={...y.get(s)[1].start},d=y.slice(s,i),d.unshift(a),y.splice(s,i-s+1,d))}}return Or(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!p}function F3(e,n){const i=e.get(n)[1],a=e.get(n)[2];let s=n-1;const u=[];let c=i._tokenizer;c||(c=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,g=[],p={};let y,v,x=-1,S=i,j=0,C=0;const T=[C];for(;S;){for(;e.get(++s)[1]!==S;);u.push(s),S._tokenizer||(y=a.sliceStream(S),S.next||y.push(null),v&&c.defineSkip(S.start),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),v=S,S=S.next}for(S=i;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(C=x+1,T.push(C),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(c.events=[],S?(S._tokenizer=void 0,S.previous=void 0):T.pop(),x=T.length;x--;){const k=d.slice(T[x],T[x+1]),P=u.pop();g.push([P,P+k.length-1]),e.splice(P,2,k)}for(g.reverse(),x=-1;++x<g.length;)p[j+g[x][0]]=j+g[x][1],j+=g[x][1]-g[x][0]-1;return p}const $3={resolve:Q3,tokenize:Y3},V3={partial:!0,tokenize:G3};function Q3(e){return Pw(e),e}function Y3(e,n){let i;return a;function a(d){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?u(d):Te(d)?e.check(V3,c,u)(d):(e.consume(d),s)}function u(d){return e.exit("chunkContent"),e.exit("content"),n(d)}function c(d){return e.consume(d),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function G3(e,n,i){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),gt(e,u,"linePrefix")}function u(c){if(c===null||Te(c))return i(c);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(c):e.interrupt(a.parser.constructs.flow,i,n)(c)}}function Hw(e,n,i,a,s,u,c,d,g){const p=g||Number.POSITIVE_INFINITY;let y=0;return v;function v(k){return k===60?(e.enter(a),e.enter(s),e.enter(u),e.consume(k),e.exit(u),x):k===null||k===32||k===41||Cm(k)?i(k):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),C(k))}function x(k){return k===62?(e.enter(u),e.consume(k),e.exit(u),e.exit(s),e.exit(a),n):(e.enter(d),e.enter("chunkString",{contentType:"string"}),S(k))}function S(k){return k===62?(e.exit("chunkString"),e.exit(d),x(k)):k===null||k===60||Te(k)?i(k):(e.consume(k),k===92?j:S)}function j(k){return k===60||k===62||k===92?(e.consume(k),S):S(k)}function C(k){return!y&&(k===null||k===41||kn(k))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),n(k)):y<p&&k===40?(e.consume(k),y++,C):k===41?(e.consume(k),y--,C):k===null||k===32||k===40||Cm(k)?i(k):(e.consume(k),k===92?T:C)}function T(k){return k===40||k===41||k===92?(e.consume(k),C):C(k)}}function Zw(e,n,i,a,s,u){const c=this;let d=0,g;return p;function p(S){return e.enter(a),e.enter(s),e.consume(S),e.exit(s),e.enter(u),y}function y(S){return d>999||S===null||S===91||S===93&&!g||S===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?i(S):S===93?(e.exit(u),e.enter(s),e.consume(S),e.exit(s),e.exit(a),n):Te(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===null||S===91||S===93||Te(S)||d++>999?(e.exit("chunkString"),y(S)):(e.consume(S),g||(g=!tt(S)),S===92?x:v)}function x(S){return S===91||S===92||S===93?(e.consume(S),d++,v):v(S)}}function Fw(e,n,i,a,s,u){let c;return d;function d(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),c=x===40?41:x,g):i(x)}function g(x){return x===c?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),n):(e.enter(u),p(x))}function p(x){return x===c?(e.exit(u),g(c)):x===null?i(x):Te(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),gt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===c||x===null||Te(x)?(e.exit("chunkString"),p(x)):(e.consume(x),x===92?v:y)}function v(x){return x===c||x===92?(e.consume(x),y):y(x)}}function yo(e,n){let i;return a;function a(s){return Te(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i=!0,a):tt(s)?gt(e,a,i?"linePrefix":"lineSuffix")(s):n(s)}}const K3={name:"definition",tokenize:J3},X3={partial:!0,tokenize:W3};function J3(e,n,i){const a=this;let s;return u;function u(S){return e.enter("definition"),c(S)}function c(S){return Zw.call(a,e,d,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function d(S){return s=Fl(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),g):i(S)}function g(S){return kn(S)?yo(e,p)(S):p(S)}function p(S){return Hw(e,y,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function y(S){return e.attempt(X3,v,v)(S)}function v(S){return tt(S)?gt(e,x,"whitespace")(S):x(S)}function x(S){return S===null||Te(S)?(e.exit("definition"),a.parser.defined.push(s),n(S)):i(S)}}function W3(e,n,i){return a;function a(d){return kn(d)?yo(e,s)(d):i(d)}function s(d){return Fw(e,u,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function u(d){return tt(d)?gt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Te(d)?n(d):i(d)}}const e6={name:"hardBreakEscape",tokenize:t6};function t6(e,n,i){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),s}function s(u){return Te(u)?(e.exit("hardBreakEscape"),n(u)):i(u)}}const n6={name:"headingAtx",resolve:r6,tokenize:i6};function r6(e,n){let i=e.length-2,a=3,s,u;return e[a][1].type==="whitespace"&&(a+=2),i-2>a&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(a===i-1||i-4>a&&e[i-2][1].type==="whitespace")&&(i-=a+1===i?2:4),i>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},u={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},Or(e,a,i-a+1,[["enter",s,n],["enter",u,n],["exit",u,n],["exit",s,n]])),e}function i6(e,n,i){let a=0;return s;function s(y){return e.enter("atxHeading"),u(y)}function u(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||kn(y)?(e.exit("atxHeadingSequence"),d(y)):i(y)}function d(y){return y===35?(e.enter("atxHeadingSequence"),g(y)):y===null||Te(y)?(e.exit("atxHeading"),n(y)):tt(y)?gt(e,d,"whitespace")(y):(e.enter("atxHeadingText"),p(y))}function g(y){return y===35?(e.consume(y),g):(e.exit("atxHeadingSequence"),d(y))}function p(y){return y===null||y===35||kn(y)?(e.exit("atxHeadingText"),d(y)):(e.consume(y),p)}}const a6=["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"],f0=["pre","script","style","textarea"],l6={concrete:!0,name:"htmlFlow",resolveTo:u6,tokenize:c6},s6={partial:!0,tokenize:d6},o6={partial:!0,tokenize:f6};function u6(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function c6(e,n,i){const a=this;let s,u,c,d,g;return p;function p(_){return y(_)}function y(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),v}function v(_){return _===33?(e.consume(_),x):_===47?(e.consume(_),u=!0,C):_===63?(e.consume(_),s=3,a.interrupt?n:N):jr(_)?(e.consume(_),c=String.fromCharCode(_),T):i(_)}function x(_){return _===45?(e.consume(_),s=2,S):_===91?(e.consume(_),s=5,d=0,j):jr(_)?(e.consume(_),s=4,a.interrupt?n:N):i(_)}function S(_){return _===45?(e.consume(_),a.interrupt?n:N):i(_)}function j(_){const ue="CDATA[";return _===ue.charCodeAt(d++)?(e.consume(_),d===ue.length?a.interrupt?n:le:j):i(_)}function C(_){return jr(_)?(e.consume(_),c=String.fromCharCode(_),T):i(_)}function T(_){if(_===null||_===47||_===62||kn(_)){const ue=_===47,he=c.toLowerCase();return!ue&&!u&&f0.includes(he)?(s=1,a.interrupt?n(_):le(_)):a6.includes(c.toLowerCase())?(s=6,ue?(e.consume(_),k):a.interrupt?n(_):le(_)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(_):u?P(_):U(_))}return _===45||qn(_)?(e.consume(_),c+=String.fromCharCode(_),T):i(_)}function k(_){return _===62?(e.consume(_),a.interrupt?n:le):i(_)}function P(_){return tt(_)?(e.consume(_),P):ie(_)}function U(_){return _===47?(e.consume(_),ie):_===58||_===95||jr(_)?(e.consume(_),H):tt(_)?(e.consume(_),U):ie(_)}function H(_){return _===45||_===46||_===58||_===95||qn(_)?(e.consume(_),H):K(_)}function K(_){return _===61?(e.consume(_),L):tt(_)?(e.consume(_),K):U(_)}function L(_){return _===null||_===60||_===61||_===62||_===96?i(_):_===34||_===39?(e.consume(_),g=_,V):tt(_)?(e.consume(_),L):D(_)}function V(_){return _===g?(e.consume(_),g=null,B):_===null||Te(_)?i(_):(e.consume(_),V)}function D(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||kn(_)?K(_):(e.consume(_),D)}function B(_){return _===47||_===62||tt(_)?U(_):i(_)}function ie(_){return _===62?(e.consume(_),se):i(_)}function se(_){return _===null||Te(_)?le(_):tt(_)?(e.consume(_),se):i(_)}function le(_){return _===45&&s===2?(e.consume(_),q):_===60&&s===1?(e.consume(_),re):_===62&&s===4?(e.consume(_),R):_===63&&s===3?(e.consume(_),N):_===93&&s===5?(e.consume(_),Ae):Te(_)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(s6,Y,ke)(_)):_===null||Te(_)?(e.exit("htmlFlowData"),ke(_)):(e.consume(_),le)}function ke(_){return e.check(o6,fe,Y)(_)}function fe(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ne}function ne(_){return _===null||Te(_)?ke(_):(e.enter("htmlFlowData"),le(_))}function q(_){return _===45?(e.consume(_),N):le(_)}function re(_){return _===47?(e.consume(_),c="",me):le(_)}function me(_){if(_===62){const ue=c.toLowerCase();return f0.includes(ue)?(e.consume(_),R):le(_)}return jr(_)&&c.length<8?(e.consume(_),c+=String.fromCharCode(_),me):le(_)}function Ae(_){return _===93?(e.consume(_),N):le(_)}function N(_){return _===62?(e.consume(_),R):_===45&&s===2?(e.consume(_),N):le(_)}function R(_){return _===null||Te(_)?(e.exit("htmlFlowData"),Y(_)):(e.consume(_),R)}function Y(_){return e.exit("htmlFlow"),n(_)}}function f6(e,n,i){const a=this;return s;function s(c){return Te(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):i(c)}function u(c){return a.parser.lazy[a.now().line]?i(c):n(c)}}function d6(e,n,i){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Jc,n,i)}}const h6={name:"htmlText",tokenize:m6};function m6(e,n,i){const a=this;let s,u,c;return d;function d(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),g}function g(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),K):N===63?(e.consume(N),U):jr(N)?(e.consume(N),D):i(N)}function p(N){return N===45?(e.consume(N),y):N===91?(e.consume(N),u=0,j):jr(N)?(e.consume(N),P):i(N)}function y(N){return N===45?(e.consume(N),S):i(N)}function v(N){return N===null?i(N):N===45?(e.consume(N),x):Te(N)?(c=v,re(N)):(e.consume(N),v)}function x(N){return N===45?(e.consume(N),S):v(N)}function S(N){return N===62?q(N):N===45?x(N):v(N)}function j(N){const R="CDATA[";return N===R.charCodeAt(u++)?(e.consume(N),u===R.length?C:j):i(N)}function C(N){return N===null?i(N):N===93?(e.consume(N),T):Te(N)?(c=C,re(N)):(e.consume(N),C)}function T(N){return N===93?(e.consume(N),k):C(N)}function k(N){return N===62?q(N):N===93?(e.consume(N),k):C(N)}function P(N){return N===null||N===62?q(N):Te(N)?(c=P,re(N)):(e.consume(N),P)}function U(N){return N===null?i(N):N===63?(e.consume(N),H):Te(N)?(c=U,re(N)):(e.consume(N),U)}function H(N){return N===62?q(N):U(N)}function K(N){return jr(N)?(e.consume(N),L):i(N)}function L(N){return N===45||qn(N)?(e.consume(N),L):V(N)}function V(N){return Te(N)?(c=V,re(N)):tt(N)?(e.consume(N),V):q(N)}function D(N){return N===45||qn(N)?(e.consume(N),D):N===47||N===62||kn(N)?B(N):i(N)}function B(N){return N===47?(e.consume(N),q):N===58||N===95||jr(N)?(e.consume(N),ie):Te(N)?(c=B,re(N)):tt(N)?(e.consume(N),B):q(N)}function ie(N){return N===45||N===46||N===58||N===95||qn(N)?(e.consume(N),ie):se(N)}function se(N){return N===61?(e.consume(N),le):Te(N)?(c=se,re(N)):tt(N)?(e.consume(N),se):B(N)}function le(N){return N===null||N===60||N===61||N===62||N===96?i(N):N===34||N===39?(e.consume(N),s=N,ke):Te(N)?(c=le,re(N)):tt(N)?(e.consume(N),le):(e.consume(N),fe)}function ke(N){return N===s?(e.consume(N),s=void 0,ne):N===null?i(N):Te(N)?(c=ke,re(N)):(e.consume(N),ke)}function fe(N){return N===null||N===34||N===39||N===60||N===61||N===96?i(N):N===47||N===62||kn(N)?B(N):(e.consume(N),fe)}function ne(N){return N===47||N===62||kn(N)?B(N):i(N)}function q(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),n):i(N)}function re(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),me}function me(N){return tt(N)?gt(e,Ae,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):Ae(N)}function Ae(N){return e.enter("htmlTextData"),c(N)}}const xp={name:"labelEnd",resolveAll:v6,resolveTo:b6,tokenize:x6},p6={tokenize:S6},g6={tokenize:w6},y6={tokenize:E6};function v6(e){let n=-1;const i=[];for(;++n<e.length;){const a=e[n][1];if(i.push(e[n]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",n+=s}}return e.length!==i.length&&Or(e,0,e.length,i),e}function b6(e,n){let i=e.length,a=0,s,u,c,d;for(;i--;)if(s=e[i][1],u){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(e[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(u=i,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(c=i);const g={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[u][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[u+a+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",g,n],["enter",p,n]],d=er(d,e.slice(u+1,u+a+3)),d=er(d,[["enter",y,n]]),d=er(d,bp(n.parser.constructs.insideSpan.null,e.slice(u+a+4,c-3),n)),d=er(d,[["exit",y,n],e[c-2],e[c-1],["exit",p,n]]),d=er(d,e.slice(c+1)),d=er(d,[["exit",g,n]]),Or(e,u,e.length,d),e}function x6(e,n,i){const a=this;let s=a.events.length,u,c;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){u=a.events[s][1];break}return d;function d(x){return u?u._inactive?v(x):(c=a.parser.defined.includes(Fl(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),g):i(x)}function g(x){return x===40?e.attempt(p6,y,c?y:v)(x):x===91?e.attempt(g6,y,c?p:v)(x):c?y(x):v(x)}function p(x){return e.attempt(y6,y,v)(x)}function y(x){return n(x)}function v(x){return u._balanced=!0,i(x)}}function S6(e,n,i){return a;function a(v){return e.enter("resource"),e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),s}function s(v){return kn(v)?yo(e,u)(v):u(v)}function u(v){return v===41?y(v):Hw(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(v)}function c(v){return kn(v)?yo(e,g)(v):y(v)}function d(v){return i(v)}function g(v){return v===34||v===39||v===40?Fw(e,p,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(v):y(v)}function p(v){return kn(v)?yo(e,y)(v):y(v)}function y(v){return v===41?(e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),e.exit("resource"),n):i(v)}}function w6(e,n,i){const a=this;return s;function s(d){return Zw.call(a,e,u,c,"reference","referenceMarker","referenceString")(d)}function u(d){return a.parser.defined.includes(Fl(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?n(d):i(d)}function c(d){return i(d)}}function E6(e,n,i){return a;function a(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),s}function s(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),n):i(u)}}const C6={name:"labelStartImage",resolveAll:xp.resolveAll,tokenize:N6};function N6(e,n,i){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),u}function u(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):i(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(d):n(d)}}const _6={name:"labelStartLink",resolveAll:xp.resolveAll,tokenize:j6};function j6(e,n,i){const a=this;return s;function s(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),u}function u(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(c):n(c)}}const Ph={name:"lineEnding",tokenize:k6};function k6(e,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),gt(e,n,"linePrefix")}}const Cc={name:"thematicBreak",tokenize:T6};function T6(e,n,i){let a=0,s;return u;function u(p){return e.enter("thematicBreak"),c(p)}function c(p){return s=p,d(p)}function d(p){return p===s?(e.enter("thematicBreakSequence"),g(p)):a>=3&&(p===null||Te(p))?(e.exit("thematicBreak"),n(p)):i(p)}function g(p){return p===s?(e.consume(p),a++,g):(e.exit("thematicBreakSequence"),tt(p)?gt(e,d,"whitespace")(p):d(p))}}const Nn={continuation:{tokenize:R6},exit:D6,name:"list",tokenize:O6},A6={partial:!0,tokenize:U6},z6={partial:!0,tokenize:M6};function O6(e,n,i){const a=this,s=a.events[a.events.length-1];let u=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return d;function d(S){const j=a.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!a.containerState.marker||S===a.containerState.marker:Nm(S)){if(a.containerState.type||(a.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(Cc,i,p)(S):p(S);if(!a.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(S)}return i(S)}function g(S){return Nm(S)&&++c<10?(e.consume(S),g):(!a.interrupt||c<2)&&(a.containerState.marker?S===a.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),p(S)):i(S)}function p(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||S,e.check(Jc,a.interrupt?i:y,e.attempt(A6,x,v))}function y(S){return a.containerState.initialBlankLine=!0,u++,x(S)}function v(S){return tt(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),x):i(S)}function x(S){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(S)}}function R6(e,n,i){const a=this;return a.containerState._closeFlow=void 0,e.check(Jc,s,u);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,gt(e,n,"listItemIndent",a.containerState.size+1)(d)}function u(d){return a.containerState.furtherBlankLines||!tt(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(z6,n,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,gt(e,e.attempt(Nn,n,i),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function M6(e,n,i){const a=this;return gt(e,s,"listItemIndent",a.containerState.size+1);function s(u){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?n(u):i(u)}}function D6(e){e.exit(this.containerState.type)}function U6(e,n,i){const a=this;return gt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(u){const c=a.events[a.events.length-1];return!tt(u)&&c&&c[1].type==="listItemPrefixWhitespace"?n(u):i(u)}}const d0={name:"setextUnderline",resolveTo:L6,tokenize:I6};function L6(e,n){let i=e.length,a,s,u;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){a=i;break}e[i][1].type==="paragraph"&&(s=i)}else e[i][1].type==="content"&&e.splice(i,1),!u&&e[i][1].type==="definition"&&(u=i);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",u?(e.splice(s,0,["enter",c,n]),e.splice(u+1,0,["exit",e[a][1],n]),e[a][1].end={...e[u][1].end}):e[a][1]=c,e.push(["exit",c,n]),e}function I6(e,n,i){const a=this;let s;return u;function u(p){let y=a.events.length,v;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){v=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||v)?(e.enter("setextHeadingLine"),s=p,c(p)):i(p)}function c(p){return e.enter("setextHeadingLineSequence"),d(p)}function d(p){return p===s?(e.consume(p),d):(e.exit("setextHeadingLineSequence"),tt(p)?gt(e,g,"lineSuffix")(p):g(p))}function g(p){return p===null||Te(p)?(e.exit("setextHeadingLine"),n(p)):i(p)}}const B6={tokenize:q6};function q6(e){const n=this,i=e.attempt(Jc,a,e.attempt(this.parser.constructs.flowInitial,s,gt(e,e.attempt(this.parser.constructs.flow,s,e.attempt($3,s)),"linePrefix")));return i;function a(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const P6={resolveAll:Vw()},H6=$w("string"),Z6=$w("text");function $w(e){return{resolveAll:Vw(e==="text"?F6:void 0),tokenize:n};function n(i){const a=this,s=this.parser.constructs[e],u=i.attempt(s,c,d);return c;function c(y){return p(y)?u(y):d(y)}function d(y){if(y===null){i.consume(y);return}return i.enter("data"),i.consume(y),g}function g(y){return p(y)?(i.exit("data"),u(y)):(i.consume(y),g)}function p(y){if(y===null)return!0;const v=s[y];let x=-1;if(v)for(;++x<v.length;){const S=v[x];if(!S.previous||S.previous.call(a,a.previous))return!0}return!1}}}function Vw(e){return n;function n(i,a){let s=-1,u;for(;++s<=i.length;)u===void 0?i[s]&&i[s][1].type==="data"&&(u=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==u+2&&(i[u][1].end=i[s-1][1].end,i.splice(u+2,s-u-2),s=u+2),u=void 0);return e?e(i,a):i}}function F6(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const a=e[i-1][1],s=n.sliceStream(a);let u=s.length,c=-1,d=0,g;for(;u--;){const p=s[u];if(typeof p=="string"){for(c=p.length;p.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(p===-2)g=!0,d++;else if(p!==-1){u++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(d=0),d){const p={type:i===e.length||g||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?c:a.start._bufferIndex+c,_index:a.start._index+u,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...p.start},a.start.offset===a.end.offset?Object.assign(a,p):(e.splice(i,0,["enter",p,n],["exit",p,n]),i+=2)}i++}return e}const $6={42:Nn,43:Nn,45:Nn,48:Nn,49:Nn,50:Nn,51:Nn,52:Nn,53:Nn,54:Nn,55:Nn,56:Nn,57:Nn,62:Iw},V6={91:K3},Q6={[-2]:qh,[-1]:qh,32:qh},Y6={35:n6,42:Cc,45:[d0,Cc],60:l6,61:d0,95:Cc,96:c0,126:c0},G6={38:qw,92:Bw},K6={[-5]:Ph,[-4]:Ph,[-3]:Ph,33:C6,38:qw,42:_m,60:[_3,h6],91:_6,92:[e6,Bw],93:xp,95:_m,96:B3},X6={null:[_m,P6]},J6={null:[42,95]},W6={null:[]},e5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:J6,contentInitial:V6,disable:W6,document:$6,flow:Y6,flowInitial:Q6,insideSpan:X6,string:G6,text:K6},Symbol.toStringTag,{value:"Module"}));function t5(e,n,i){let a={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},u=[];let c=[],d=[];const g={attempt:V(K),check:V(L),consume:P,enter:U,exit:H,interrupt:V(L,{interrupt:!0})},p={code:null,containerState:{},defineSkip:C,events:[],now:j,parser:e,previous:null,sliceSerialize:x,sliceStream:S,write:v};let y=n.tokenize.call(p,g);return n.resolveAll&&u.push(n),p;function v(se){return c=er(c,se),T(),c[c.length-1]!==null?[]:(D(n,0),p.events=bp(u,p.events,p),p.events)}function x(se,le){return r5(S(se),le)}function S(se){return n5(c,se)}function j(){const{_bufferIndex:se,_index:le,line:ke,column:fe,offset:ne}=a;return{_bufferIndex:se,_index:le,line:ke,column:fe,offset:ne}}function C(se){s[se.line]=se.column,ie()}function T(){let se;for(;a._index<c.length;){const le=c[a._index];if(typeof le=="string")for(se=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===se&&a._bufferIndex<le.length;)k(le.charCodeAt(a._bufferIndex));else k(le)}}function k(se){y=y(se)}function P(se){Te(se)?(a.line++,a.column=1,a.offset+=se===-3?2:1,ie()):se!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),p.previous=se}function U(se,le){const ke=le||{};return ke.type=se,ke.start=j(),p.events.push(["enter",ke,p]),d.push(ke),ke}function H(se){const le=d.pop();return le.end=j(),p.events.push(["exit",le,p]),le}function K(se,le){D(se,le.from)}function L(se,le){le.restore()}function V(se,le){return ke;function ke(fe,ne,q){let re,me,Ae,N;return Array.isArray(fe)?Y(fe):"tokenize"in fe?Y([fe]):R(fe);function R(ce){return Re;function Re(We){const je=We!==null&&ce[We],Gt=We!==null&&ce.null,Dt=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(Gt)?Gt:Gt?[Gt]:[]];return Y(Dt)(We)}}function Y(ce){return re=ce,me=0,ce.length===0?q:_(ce[me])}function _(ce){return Re;function Re(We){return N=B(),Ae=ce,ce.partial||(p.currentConstruct=ce),ce.name&&p.parser.constructs.disable.null.includes(ce.name)?he():ce.tokenize.call(le?Object.assign(Object.create(p),le):p,g,ue,he)(We)}}function ue(ce){return se(Ae,N),ne}function he(ce){return N.restore(),++me<re.length?_(re[me]):q}}}function D(se,le){se.resolveAll&&!u.includes(se)&&u.push(se),se.resolve&&Or(p.events,le,p.events.length-le,se.resolve(p.events.slice(le),p)),se.resolveTo&&(p.events=se.resolveTo(p.events,p))}function B(){const se=j(),le=p.previous,ke=p.currentConstruct,fe=p.events.length,ne=Array.from(d);return{from:fe,restore:q};function q(){a=se,p.previous=le,p.currentConstruct=ke,p.events.length=fe,d=ne,ie()}}function ie(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function n5(e,n){const i=n.start._index,a=n.start._bufferIndex,s=n.end._index,u=n.end._bufferIndex;let c;if(i===s)c=[e[i].slice(a,u)];else{if(c=e.slice(i,s),a>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}u>0&&c.push(e[s].slice(0,u))}return c}function r5(e,n){let i=-1;const a=[];let s;for(;++i<e.length;){const u=e[i];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
299
- `;break}case-3:{c=`\r
300
- `;break}case-2:{c=n?" ":" ";break}case-1:{if(!n&&s)continue;c=" ";break}default:c=String.fromCharCode(u)}s=u===-2,a.push(c)}return a.join("")}function i5(e){const a={constructs:f3([e5,...(e||{}).extensions||[]]),content:s(b3),defined:[],document:s(S3),flow:s(B6),lazy:{},string:s(H6),text:s(Z6)};return a;function s(u){return c;function c(d){return t5(a,u,d)}}}function a5(e){for(;!Pw(e););return e}const h0=/[\0\t\n\r]/g;function l5(){let e=1,n="",i=!0,a;return s;function s(u,c,d){const g=[];let p,y,v,x,S;for(u=n+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u)),v=0,n="",i&&(u.charCodeAt(0)===65279&&v++,i=void 0);v<u.length;){if(h0.lastIndex=v,p=h0.exec(u),x=p&&p.index!==void 0?p.index:u.length,S=u.charCodeAt(x),!p){n=u.slice(v);break}if(S===10&&v===x&&a)g.push(-3),a=void 0;else switch(a&&(g.push(-5),a=void 0),v<x&&(g.push(u.slice(v,x)),e+=x-v),S){case 0:{g.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,g.push(-2);e++<y;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:a=!0,e=1}v=x+1}return d&&(a&&g.push(-5),n&&g.push(n),g.push(null)),g}}const s5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function o5(e){return e.replace(s5,u5)}function u5(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),u=s===120||s===88;return Lw(i.slice(u?2:1),u?16:10)}return vp(i)||e}const Qw={}.hasOwnProperty;function c5(e,n,i){return n&&typeof n=="object"&&(i=n,n=void 0),f5(i)(a5(i5(i).document().write(l5()(e,n,!0))))}function f5(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Rr),autolinkProtocol:B,autolinkEmail:B,atxHeading:u(ci),blockQuote:u(Gt),characterEscape:B,characterReference:B,codeFenced:u(Dt),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(Dt,c),codeText:u(Ue,c),codeTextData:B,data:B,codeFlowValue:B,definition:u(Kt),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(Ft),hardBreakEscape:u(fi),hardBreakTrailing:u(fi),htmlFlow:u($a,c),htmlFlowData:B,htmlText:u($a,c),htmlTextData:B,image:u(Va),label:c,link:u(Rr),listItem:u(Dr),listItemValue:x,listOrdered:u(Mr,v),listUnordered:u(Mr),paragraph:u(pr),reference:_,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u(ci),strong:u(Qa),thematicBreak:u(hn)},exit:{atxHeading:g(),atxHeadingSequence:K,autolink:g(),autolinkEmail:je,autolinkProtocol:We,blockQuote:g(),characterEscapeValue:ie,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:ce,characterReference:Re,codeFenced:g(T),codeFencedFence:C,codeFencedFenceInfo:S,codeFencedFenceMeta:j,codeFlowValue:ie,codeIndented:g(k),codeText:g(ne),codeTextData:ie,data:ie,definition:g(),definitionDestinationString:H,definitionLabelString:P,definitionTitleString:U,emphasis:g(),hardBreakEscape:g(le),hardBreakTrailing:g(le),htmlFlow:g(ke),htmlFlowData:ie,htmlText:g(fe),htmlTextData:ie,image:g(re),label:Ae,labelText:me,lineEnding:se,link:g(q),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:ue,resourceDestinationString:N,resourceTitleString:R,resource:Y,setextHeading:g(D),setextHeadingLineSequence:V,setextHeadingText:L,strong:g(),thematicBreak:g()}};Yw(n,(e||{}).mdastExtensions||[]);const i={};return a;function a(X){let oe={type:"root",children:[]};const Ne={stack:[oe],tokenStack:[],config:n,enter:d,exit:p,buffer:c,resume:y,data:i},Pe=[];let Ge=-1;for(;++Ge<X.length;)if(X[Ge][1].type==="listOrdered"||X[Ge][1].type==="listUnordered")if(X[Ge][0]==="enter")Pe.push(Ge);else{const W=Pe.pop();Ge=s(X,W,Ge)}for(Ge=-1;++Ge<X.length;){const W=n[X[Ge][0]];Qw.call(W,X[Ge][1].type)&&W[X[Ge][1].type].call(Object.assign({sliceSerialize:X[Ge][2].sliceSerialize},Ne),X[Ge][1])}if(Ne.tokenStack.length>0){const W=Ne.tokenStack[Ne.tokenStack.length-1];(W[1]||m0).call(Ne,void 0,W[0])}for(oe.position={start:Bi(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:Bi(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<n.transforms.length;)oe=n.transforms[Ge](oe)||oe;return oe}function s(X,oe,Ne){let Pe=oe-1,Ge=-1,W=!1,dt,Ut,xt,nn;for(;++Pe<=Ne;){const ht=X[Pe];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?Ge++:Ge--,nn=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(dt&&!nn&&!Ge&&!xt&&(xt=Pe),nn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:nn=void 0}if(!Ge&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||Ge===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(dt){let di=Pe;for(Ut=void 0;di--;){const lr=X[di];if(lr[1].type==="lineEnding"||lr[1].type==="lineEndingBlank"){if(lr[0]==="exit")continue;Ut&&(X[Ut][1].type="lineEndingBlank",W=!0),lr[1].type="lineEnding",Ut=di}else if(!(lr[1].type==="linePrefix"||lr[1].type==="blockQuotePrefix"||lr[1].type==="blockQuotePrefixWhitespace"||lr[1].type==="blockQuoteMarker"||lr[1].type==="listItemIndent"))break}xt&&(!Ut||xt<Ut)&&(dt._spread=!0),dt.end=Object.assign({},Ut?X[Ut][1].start:ht[1].end),X.splice(Ut||Pe,0,["exit",dt,ht[2]]),Pe++,Ne++}if(ht[1].type==="listItemPrefix"){const di={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};dt=di,X.splice(Pe,0,["enter",di,ht[2]]),Pe++,Ne++,xt=void 0,nn=!0}}}return X[oe][1]._spread=W,Ne}function u(X,oe){return Ne;function Ne(Pe){d.call(this,X(Pe),Pe),oe&&oe.call(this,Pe)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(X,oe,Ne){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([oe,Ne||void 0]),X.position={start:Bi(oe.start),end:void 0}}function g(X){return oe;function oe(Ne){X&&X.call(this,Ne),p.call(this,Ne)}}function p(X,oe){const Ne=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==X.type&&(oe?oe.call(this,X,Pe[0]):(Pe[1]||m0).call(this,X,Pe[0]));else throw new Error("Cannot close `"+X.type+"` ("+go({start:X.start,end:X.end})+"): it’s not open");Ne.position.end=Bi(X.end)}function y(){return u3(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function x(X){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function S(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=X}function j(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=X}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X.replace(/(\r?\n|\r)$/g,"")}function P(X){const oe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=oe,Ne.identifier=Fl(this.sliceSerialize(X)).toLowerCase()}function U(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.title=X}function H(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.url=X}function K(X){const oe=this.stack[this.stack.length-1];if(!oe.depth){const Ne=this.sliceSerialize(X).length;oe.depth=Ne}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function V(X){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function B(X){const Ne=this.stack[this.stack.length-1].children;let Pe=Ne[Ne.length-1];(!Pe||Pe.type!=="text")&&(Pe=$t(),Pe.position={start:Bi(X.start),end:void 0},Ne.push(Pe)),this.stack.push(Pe)}function ie(X){const oe=this.stack.pop();oe.value+=this.sliceSerialize(X),oe.position.end=Bi(X.end)}function se(X){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=oe.children[oe.children.length-1];Ne.position.end=Bi(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(oe.type)&&(B.call(this,X),ie.call(this,X))}function le(){this.data.atHardBreak=!0}function ke(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X}function fe(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X}function ne(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X}function q(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=oe,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function re(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=oe,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function me(X){const oe=this.sliceSerialize(X),Ne=this.stack[this.stack.length-2];Ne.label=o5(oe),Ne.identifier=Fl(oe).toLowerCase()}function Ae(){const X=this.stack[this.stack.length-1],oe=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Pe=X.children;Ne.children=Pe}else Ne.alt=oe}function N(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.url=X}function R(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.title=X}function Y(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function ue(X){const oe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=oe,Ne.identifier=Fl(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function he(X){this.data.characterReferenceType=X.type}function ce(X){const oe=this.sliceSerialize(X),Ne=this.data.characterReferenceType;let Pe;Ne?(Pe=Lw(oe,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=vp(oe);const Ge=this.stack[this.stack.length-1];Ge.value+=Pe}function Re(X){const oe=this.stack.pop();oe.position.end=Bi(X.end)}function We(X){ie.call(this,X);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(X)}function je(X){ie.call(this,X);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(X)}function Gt(){return{type:"blockquote",children:[]}}function Dt(){return{type:"code",lang:null,meta:null,value:""}}function Ue(){return{type:"inlineCode",value:""}}function Kt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ft(){return{type:"emphasis",children:[]}}function ci(){return{type:"heading",depth:0,children:[]}}function fi(){return{type:"break"}}function $a(){return{type:"html",value:""}}function Va(){return{type:"image",title:null,url:"",alt:null}}function Rr(){return{type:"link",title:null,url:"",children:[]}}function Mr(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function Dr(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function pr(){return{type:"paragraph",children:[]}}function Qa(){return{type:"strong",children:[]}}function $t(){return{type:"text",value:""}}function hn(){return{type:"thematicBreak"}}}function Bi(e){return{line:e.line,column:e.column,offset:e.offset}}function Yw(e,n){let i=-1;for(;++i<n.length;){const a=n[i];Array.isArray(a)?Yw(e,a):d5(e,a)}}function d5(e,n){let i;for(i in n)if(Qw.call(n,i))switch(i){case"canContainEols":{const a=n[i];a&&e[i].push(...a);break}case"transforms":{const a=n[i];a&&e[i].push(...a);break}case"enter":case"exit":{const a=n[i];a&&Object.assign(e[i],a);break}}}function m0(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+go({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+go({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+go({start:n.start,end:n.end})+") is still open")}function h5(e){const n=this;n.parser=i;function i(a){return c5(a,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function m5(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function p5(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
301
- `}]}function g5(e,n){const i=n.value?n.value+`
302
- `:"",a={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:i}]};return n.meta&&(u.data={meta:n.meta}),e.patch(n,u),u=e.applyData(n,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(n,u),u}function y5(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function v5(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function b5(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(n.identifier).toUpperCase(),s=fs(a.toLowerCase()),u=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=u+1,d+=1,e.footnoteCounts.set(a,d);const g={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+s,id:i+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(n,g);const p={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(n,p),e.applyData(n,p)}function x5(e,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function S5(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function Gw(e,n){const i=n.referenceType;let a="]";if(i==="collapsed"?a+="[]":i==="full"&&(a+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+a}];const s=e.all(n),u=s[0];u&&u.type==="text"?u.value="["+u.value:s.unshift({type:"text",value:"["});const c=s[s.length-1];return c&&c.type==="text"?c.value+=a:s.push({type:"text",value:a}),s}function w5(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return Gw(e,n);const s={src:fs(a.url||""),alt:n.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const u={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,u),e.applyData(n,u)}function E5(e,n){const i={src:fs(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,a),e.applyData(n,a)}function C5(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const a={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,a),e.applyData(n,a)}function N5(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return Gw(e,n);const s={href:fs(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const u={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,u),e.applyData(n,u)}function _5(e,n){const i={href:fs(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function j5(e,n,i){const a=e.all(n),s=i?k5(i):Kw(n),u={},c=[];if(typeof n.checked=="boolean"){const y=a[0];let v;y&&y.type==="element"&&y.tagName==="p"?v=y:(v={type:"element",tagName:"p",properties:{},children:[]},a.unshift(v)),v.children.length>0&&v.children.unshift({type:"text",value:" "}),v.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const y=a[d];(s||d!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
303
- `}),y.type==="element"&&y.tagName==="p"&&!s?c.push(...y.children):c.push(y)}const g=a[a.length-1];g&&(s||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
304
- `});const p={type:"element",tagName:"li",properties:u,children:c};return e.patch(n,p),e.applyData(n,p)}function k5(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let a=-1;for(;!n&&++a<i.length;)n=Kw(i[a])}return n}function Kw(e){const n=e.spread;return n??e.children.length>1}function T5(e,n){const i={},a=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++s<a.length;){const c=a[s];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const u={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(a,!0)};return e.patch(n,u),e.applyData(n,u)}function A5(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function z5(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function O5(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function R5(e,n){const i=e.all(n),a=i.shift(),s=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(n.children[0],c),s.push(c)}if(i.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},d=mp(n.children[1]),g=Aw(n.children[n.children.length-1]);d&&g&&(c.position={start:d,end:g}),s.push(c)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,u),e.applyData(n,u)}function M5(e,n,i){const a=i?i.children:void 0,u=(a?a.indexOf(n):1)===0?"th":"td",c=i&&i.type==="table"?i.align:void 0,d=c?c.length:n.children.length;let g=-1;const p=[];for(;++g<d;){const v=n.children[g],x={},S=c?c[g]:void 0;S&&(x.align=S);let j={type:"element",tagName:u,properties:x,children:[]};v&&(j.children=e.all(v),e.patch(v,j),j=e.applyData(v,j)),p.push(j)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,y),e.applyData(n,y)}function D5(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const p0=9,g0=32;function U5(e){const n=String(e),i=/\r?\n|\r/g;let a=i.exec(n),s=0;const u=[];for(;a;)u.push(y0(n.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=i.exec(n);return u.push(y0(n.slice(s),s>0,!1)),u.join("")}function y0(e,n,i){let a=0,s=e.length;if(n){let u=e.codePointAt(a);for(;u===p0||u===g0;)a++,u=e.codePointAt(a)}if(i){let u=e.codePointAt(s-1);for(;u===p0||u===g0;)s--,u=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function L5(e,n){const i={type:"text",value:U5(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function I5(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const B5={blockquote:m5,break:p5,code:g5,delete:y5,emphasis:v5,footnoteReference:b5,heading:x5,html:S5,imageReference:w5,image:E5,inlineCode:C5,linkReference:N5,link:_5,listItem:j5,list:T5,paragraph:A5,root:z5,strong:O5,table:R5,tableCell:D5,tableRow:M5,text:L5,thematicBreak:I5,toml:gc,yaml:gc,definition:gc,footnoteDefinition:gc};function gc(){}const Xw=-1,Wc=0,vo=1,Dc=2,Sp=3,wp=4,Ep=5,Cp=6,Jw=7,Ww=8,v0=typeof self=="object"?self:globalThis,q5=(e,n)=>{const i=(s,u)=>(e.set(u,s),s),a=s=>{if(e.has(s))return e.get(s);const[u,c]=n[s];switch(u){case Wc:case Xw:return i(c,s);case vo:{const d=i([],s);for(const g of c)d.push(a(g));return d}case Dc:{const d=i({},s);for(const[g,p]of c)d[a(g)]=a(p);return d}case Sp:return i(new Date(c),s);case wp:{const{source:d,flags:g}=c;return i(new RegExp(d,g),s)}case Ep:{const d=i(new Map,s);for(const[g,p]of c)d.set(a(g),a(p));return d}case Cp:{const d=i(new Set,s);for(const g of c)d.add(a(g));return d}case Jw:{const{name:d,message:g}=c;return i(new v0[d](g),s)}case Ww:return i(BigInt(c),s);case"BigInt":return i(Object(BigInt(c)),s);case"ArrayBuffer":return i(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return i(new DataView(d),c)}}return i(new v0[u](c),s)};return a},b0=e=>q5(new Map,e)(0),Ul="",{toString:P5}={},{keys:H5}=Object,fo=e=>{const n=typeof e;if(n!=="object"||!e)return[Wc,n];const i=P5.call(e).slice(8,-1);switch(i){case"Array":return[vo,Ul];case"Object":return[Dc,Ul];case"Date":return[Sp,Ul];case"RegExp":return[wp,Ul];case"Map":return[Ep,Ul];case"Set":return[Cp,Ul];case"DataView":return[vo,i]}return i.includes("Array")?[vo,i]:i.includes("Error")?[Jw,i]:[Dc,i]},yc=([e,n])=>e===Wc&&(n==="function"||n==="symbol"),Z5=(e,n,i,a)=>{const s=(c,d)=>{const g=a.push(c)-1;return i.set(d,g),g},u=c=>{if(i.has(c))return i.get(c);let[d,g]=fo(c);switch(d){case Wc:{let y=c;switch(g){case"bigint":d=Ww,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);y=null;break;case"undefined":return s([Xw],c)}return s([d,y],c)}case vo:{if(g){let x=c;return g==="DataView"?x=new Uint8Array(c.buffer):g==="ArrayBuffer"&&(x=new Uint8Array(c)),s([g,[...x]],c)}const y=[],v=s([d,y],c);for(const x of c)y.push(u(x));return v}case Dc:{if(g)switch(g){case"BigInt":return s([g,c.toString()],c);case"Boolean":case"Number":case"String":return s([g,c.valueOf()],c)}if(n&&"toJSON"in c)return u(c.toJSON());const y=[],v=s([d,y],c);for(const x of H5(c))(e||!yc(fo(c[x])))&&y.push([u(x),u(c[x])]);return v}case Sp:return s([d,c.toISOString()],c);case wp:{const{source:y,flags:v}=c;return s([d,{source:y,flags:v}],c)}case Ep:{const y=[],v=s([d,y],c);for(const[x,S]of c)(e||!(yc(fo(x))||yc(fo(S))))&&y.push([u(x),u(S)]);return v}case Cp:{const y=[],v=s([d,y],c);for(const x of c)(e||!yc(fo(x)))&&y.push(u(x));return v}}const{message:p}=c;return s([d,{name:g,message:p}],c)};return u},x0=(e,{json:n,lossy:i}={})=>{const a=[];return Z5(!(n||i),!!n,new Map,a)(e),a},Uc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?b0(x0(e,n)):structuredClone(e):(e,n)=>b0(x0(e,n));function F5(e,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function $5(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function V5(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||F5,a=e.options.footnoteBackLabel||$5,s=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let g=-1;for(;++g<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[g]);if(!p)continue;const y=e.all(p),v=String(p.identifier).toUpperCase(),x=fs(v.toLowerCase());let S=0;const j=[],C=e.footnoteCounts.get(v);for(;C!==void 0&&++S<=C;){j.length>0&&j.push({type:"text",value:" "});let P=typeof i=="string"?i:i(g,S);typeof P=="string"&&(P={type:"text",value:P}),j.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(g,S),className:["data-footnote-backref"]},children:Array.isArray(P)?P:[P]})}const T=y[y.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const P=T.children[T.children.length-1];P&&P.type==="text"?P.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...j)}else y.push(...j);const k={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(y,!0)};e.patch(p,k),d.push(k)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Uc(c),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
305
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
306
- `}]}}const eE=(function(e){if(e==null)return K5;if(typeof e=="function")return ef(e);if(typeof e=="object")return Array.isArray(e)?Q5(e):Y5(e);if(typeof e=="string")return G5(e);throw new Error("Expected function, string, or object as test")});function Q5(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=eE(e[i]);return ef(a);function a(...s){let u=-1;for(;++u<n.length;)if(n[u].apply(this,s))return!0;return!1}}function Y5(e){const n=e;return ef(i);function i(a){const s=a;let u;for(u in e)if(s[u]!==n[u])return!1;return!0}}function G5(e){return ef(n);function n(i){return i&&i.type===e}}function ef(e){return n;function n(i,a,s){return!!(X5(i)&&e.call(this,i,typeof a=="number"?a:void 0,s||void 0))}}function K5(){return!0}function X5(e){return e!==null&&typeof e=="object"&&"type"in e}const tE=[],J5=!0,S0=!1,W5="skip";function eU(e,n,i,a){let s;typeof n=="function"&&typeof i!="function"?(a=i,i=n):s=n;const u=eE(s),c=a?-1:1;d(e,void 0,[])();function d(g,p,y){const v=g&&typeof g=="object"?g:{};if(typeof v.type=="string"){const S=typeof v.tagName=="string"?v.tagName:typeof v.name=="string"?v.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(g.type+(S?"<"+S+">":""))+")"})}return x;function x(){let S=tE,j,C,T;if((!n||u(g,p,y[y.length-1]||void 0))&&(S=tU(i(g,y)),S[0]===S0))return S;if("children"in g&&g.children){const k=g;if(k.children&&S[0]!==W5)for(C=(a?k.children.length:-1)+c,T=y.concat(k);C>-1&&C<k.children.length;){const P=k.children[C];if(j=d(P,C,T)(),j[0]===S0)return j;C=typeof j[1]=="number"?j[1]:C+c}}return S}}}function tU(e){return Array.isArray(e)?e:typeof e=="number"?[J5,e]:e==null?tE:[e]}function nE(e,n,i,a){let s,u,c;typeof n=="function"&&typeof i!="function"?(u=void 0,c=n,s=i):(u=n,c=i,s=a),eU(e,u,d,s);function d(g,p){const y=p[p.length-1],v=y?y.children.indexOf(g):void 0;return c(g,v,y)}}const jm={}.hasOwnProperty,nU={};function rU(e,n){const i=n||nU,a=new Map,s=new Map,u=new Map,c={...B5,...i.handlers},d={all:p,applyData:aU,definitionById:a,footnoteById:s,footnoteCounts:u,footnoteOrder:[],handlers:c,one:g,options:i,patch:iU,wrap:sU};return nE(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const v=y.type==="definition"?a:s,x=String(y.identifier).toUpperCase();v.has(x)||v.set(x,y)}}),d;function g(y,v){const x=y.type,S=d.handlers[x];if(jm.call(d.handlers,x)&&S)return S(d,y,v);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in y){const{children:C,...T}=y,k=Uc(T);return k.children=d.all(y),k}return Uc(y)}return(d.options.unknownHandler||lU)(d,y,v)}function p(y){const v=[];if("children"in y){const x=y.children;let S=-1;for(;++S<x.length;){const j=d.one(x[S],y);if(j){if(S&&x[S-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=w0(j.value)),!Array.isArray(j)&&j.type==="element")){const C=j.children[0];C&&C.type==="text"&&(C.value=w0(C.value))}Array.isArray(j)?v.push(...j):v.push(j)}}}return v}}function iU(e,n){e.position&&(n.position=PD(e))}function aU(e,n){let i=n;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,u=e.data.hProperties;if(typeof a=="string")if(i.type==="element")i.tagName=a;else{const c="children"in i?i.children:[i];i={type:"element",tagName:a,properties:{},children:c}}i.type==="element"&&u&&Object.assign(i.properties,Uc(u)),"children"in i&&i.children&&s!==null&&s!==void 0&&(i.children=s)}return i}function lU(e,n){const i=n.data||{},a="value"in n&&!(jm.call(i,"hProperties")||jm.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function sU(e,n){const i=[];let a=-1;for(n&&i.push({type:"text",value:`
307
- `});++a<e.length;)a&&i.push({type:"text",value:`
308
- `}),i.push(e[a]);return n&&e.length>0&&i.push({type:"text",value:`
309
- `}),i}function w0(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function E0(e,n){const i=rU(e,n),a=i.one(e,void 0),s=V5(i),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&u.children.push({type:"text",value:`
310
- `},s),u}function oU(e,n){return e&&"run"in e?async function(i,a){const s=E0(i,{file:a,...n});await e.run(s,a)}:function(i,a){return E0(i,{file:a,...e||n})}}function C0(e){if(e)throw e}var Hh,N0;function uU(){if(N0)return Hh;N0=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(p){return typeof Array.isArray=="function"?Array.isArray(p):n.call(p)==="[object Array]"},u=function(p){if(!p||n.call(p)!=="[object Object]")return!1;var y=e.call(p,"constructor"),v=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!v)return!1;var x;for(x in p);return typeof x>"u"||e.call(p,x)},c=function(p,y){i&&y.name==="__proto__"?i(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},d=function(p,y){if(y==="__proto__")if(e.call(p,y)){if(a)return a(p,y).value}else return;return p[y]};return Hh=function g(){var p,y,v,x,S,j,C=arguments[0],T=1,k=arguments.length,P=!1;for(typeof C=="boolean"&&(P=C,C=arguments[1]||{},T=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});T<k;++T)if(p=arguments[T],p!=null)for(y in p)v=d(C,y),x=d(p,y),C!==x&&(P&&x&&(u(x)||(S=s(x)))?(S?(S=!1,j=v&&s(v)?v:[]):j=v&&u(v)?v:{},c(C,{name:y,newValue:g(P,j,x)})):typeof x<"u"&&c(C,{name:y,newValue:x}));return C},Hh}var cU=uU();const Zh=Lc(cU);function km(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function fU(){const e=[],n={run:i,use:a};return n;function i(...s){let u=-1;const c=s.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...s);function d(g,...p){const y=e[++u];let v=-1;if(g){c(g);return}for(;++v<s.length;)(p[v]===null||p[v]===void 0)&&(p[v]=s[v]);s=p,y?dU(y,d)(...p):c(null,...p)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),n}}function dU(e,n){let i;return a;function a(...c){const d=e.length>c.length;let g;d&&c.push(s);try{g=e.apply(this,c)}catch(p){const y=p;if(d&&i)throw y;return s(y)}d||(g&&g.then&&typeof g.then=="function"?g.then(u,s):g instanceof Error?s(g):u(g))}function s(c,...d){i||(i=!0,n(c,...d))}function u(c){s(null,c)}}const xr={basename:hU,dirname:mU,extname:pU,join:gU,sep:"/"};function hU(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Bo(e);let i=0,a=-1,s=e.length,u;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(u){i=s+1;break}}else a<0&&(u=!0,a=s+1);return a<0?"":e.slice(i,a)}if(n===e)return"";let c=-1,d=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(u){i=s+1;break}}else c<0&&(u=!0,c=s+1),d>-1&&(e.codePointAt(s)===n.codePointAt(d--)?d<0&&(a=s):(d=-1,a=c));return i===a?a=c:a<0&&(a=e.length),e.slice(i,a)}function mU(e){if(Bo(e),e.length===0)return".";let n=-1,i=e.length,a;for(;--i;)if(e.codePointAt(i)===47){if(a){n=i;break}}else a||(a=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function pU(e){Bo(e);let n=e.length,i=-1,a=0,s=-1,u=0,c;for(;n--;){const d=e.codePointAt(n);if(d===47){if(c){a=n+1;break}continue}i<0&&(c=!0,i=n+1),d===46?s<0?s=n:u!==1&&(u=1):s>-1&&(u=-1)}return s<0||i<0||u===0||u===1&&s===i-1&&s===a+1?"":e.slice(s,i)}function gU(...e){let n=-1,i;for(;++n<e.length;)Bo(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":yU(i)}function yU(e){Bo(e);const n=e.codePointAt(0)===47;let i=vU(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function vU(e,n){let i="",a=0,s=-1,u=0,c=-1,d,g;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(s===c-1||u===1))if(s!==c-1&&u===2){if(i.length<2||a!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(g=i.lastIndexOf("/"),g!==i.length-1){g<0?(i="",a=0):(i=i.slice(0,g),a=i.length-1-i.lastIndexOf("/")),s=c,u=0;continue}}else if(i.length>0){i="",a=0,s=c,u=0;continue}}n&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(s+1,c):i=e.slice(s+1,c),a=c-s-1;s=c,u=0}else d===46&&u>-1?u++:u=-1}return i}function Bo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const bU={cwd:xU};function xU(){return"/"}function Tm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function SU(e){if(typeof e=="string")e=new URL(e);else if(!Tm(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return wU(e)}function wU(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 n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const a=n.codePointAt(i+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const Fh=["history","path","basename","stem","extname","dirname"];class rE{constructor(n){let i;n?Tm(n)?i={path:n}:typeof n=="string"||EU(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":bU.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Fh.length;){const u=Fh[a];u in i&&i[u]!==void 0&&i[u]!==null&&(this[u]=u==="history"?[...i[u]]:i[u])}let s;for(s in i)Fh.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?xr.basename(this.path):void 0}set basename(n){Vh(n,"basename"),$h(n,"basename"),this.path=xr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?xr.dirname(this.path):void 0}set dirname(n){_0(this.basename,"dirname"),this.path=xr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?xr.extname(this.path):void 0}set extname(n){if($h(n,"extname"),_0(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Tm(n)&&(n=SU(n)),Vh(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?xr.basename(this.path,this.extname):void 0}set stem(n){Vh(n,"stem"),$h(n,"stem"),this.path=xr.join(this.dirname||"",n+(this.extname||""))}fail(n,i,a){const s=this.message(n,i,a);throw s.fatal=!0,s}info(n,i,a){const s=this.message(n,i,a);return s.fatal=void 0,s}message(n,i,a){const s=new dn(n,i,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function $h(e,n){if(e&&e.includes(xr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+xr.sep+"`")}function Vh(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function _0(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function EU(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CU=(function(e){const a=this.constructor.prototype,s=a[e],u=function(){return s.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),NU={}.hasOwnProperty;class Np extends CU{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=fU()}copy(){const n=new Np;let i=-1;for(;++i<this.attachers.length;){const a=this.attachers[i];n.use(...a)}return n.data(Zh(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(Gh("data",this.frozen),this.namespace[n]=i,this):NU.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Gh("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=i.call(n,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=vc(n),a=this.parser||this.Parser;return Qh("parse",a),a(String(i),i)}process(n,i){const a=this;return this.freeze(),Qh("process",this.parser||this.Parser),Yh("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(u,c){const d=vc(n),g=a.parse(d);a.run(g,d,function(y,v,x){if(y||!v||!x)return p(y);const S=v,j=a.stringify(S,x);kU(j)?x.value=j:x.result=j,p(y,x)});function p(y,v){y||!v?c(y):u?u(v):i(void 0,v)}}}processSync(n){let i=!1,a;return this.freeze(),Qh("processSync",this.parser||this.Parser),Yh("processSync",this.compiler||this.Compiler),this.process(n,s),k0("processSync","process",i),a;function s(u,c){i=!0,C0(u),a=c}}run(n,i,a){j0(n),this.freeze();const s=this.transformers;return!a&&typeof i=="function"&&(a=i,i=void 0),a?u(void 0,a):new Promise(u);function u(c,d){const g=vc(i);s.run(n,g,p);function p(y,v,x){const S=v||n;y?d(y):c?c(S):a(void 0,S,x)}}}runSync(n,i){let a=!1,s;return this.run(n,i,u),k0("runSync","run",a),s;function u(c,d){C0(c),s=d,a=!0}}stringify(n,i){this.freeze();const a=vc(i),s=this.compiler||this.Compiler;return Yh("stringify",s),j0(n),s(n,a)}use(n,...i){const a=this.attachers,s=this.namespace;if(Gh("use",this.frozen),n!=null)if(typeof n=="function")g(n,i);else if(typeof n=="object")Array.isArray(n)?d(n):c(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function u(p){if(typeof p=="function")g(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[y,...v]=p;g(y,v)}else c(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function c(p){if(!("plugins"in p)&&!("settings"in p))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");d(p.plugins),p.settings&&(s.settings=Zh(!0,s.settings,p.settings))}function d(p){let y=-1;if(p!=null)if(Array.isArray(p))for(;++y<p.length;){const v=p[y];u(v)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function g(p,y){let v=-1,x=-1;for(;++v<a.length;)if(a[v][0]===p){x=v;break}if(x===-1)a.push([p,...y]);else if(y.length>0){let[S,...j]=y;const C=a[x][1];km(C)&&km(S)&&(S=Zh(!0,C,S)),a[x]=[p,S,...j]}}}}const _U=new Np().freeze();function Qh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Yh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gh(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function j0(e){if(!km(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function k0(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function vc(e){return jU(e)?e:new rE(e)}function jU(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kU(e){return typeof e=="string"||TU(e)}function TU(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const AU="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",T0=[],A0={allowDangerousHtml:!0},zU=/^(https?|ircs?|mailto|xmpp)$/i,OU=[{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 RU(e){const n=MU(e),i=DU(e);return UU(n.runSync(n.parse(i),i),e)}function MU(e){const n=e.rehypePlugins||T0,i=e.remarkPlugins||T0,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...A0}:A0;return _U().use(h5).use(i).use(oU,a).use(n)}function DU(e){const n=e.children||"",i=new rE;return typeof n=="string"&&(i.value=n),i}function UU(e,n){const i=n.allowedElements,a=n.allowElement,s=n.components,u=n.disallowedElements,c=n.skipHtml,d=n.unwrapDisallowed,g=n.urlTransform||LU;for(const y of OU)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+AU+y.id,void 0);return nE(e,p),VD(e,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function p(y,v,x){if(y.type==="raw"&&x&&typeof v=="number")return c?x.children.splice(v,1):x.children[v]={type:"text",value:y.value},v;if(y.type==="element"){let S;for(S in Bh)if(Object.hasOwn(Bh,S)&&Object.hasOwn(y.properties,S)){const j=y.properties[S],C=Bh[S];(C===null||C.includes(y.tagName))&&(y.properties[S]=g(String(j||""),S,y))}}if(y.type==="element"){let S=i?!i.includes(y.tagName):u?u.includes(y.tagName):!1;if(!S&&a&&typeof v=="number"&&(S=!a(y,v,x)),S&&x&&typeof v=="number")return d&&y.children?x.children.splice(v,1,...y.children):x.children.splice(v,1),v}}}function LU(e){const n=e.indexOf(":"),i=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return n===-1||s!==-1&&n>s||i!==-1&&n>i||a!==-1&&n>a||zU.test(e.slice(0,n))?e:""}function IU(e){return De.get(`/admin/agents/${encodeURIComponent(e)}/tokens`)}function Am(e,n){return De.post(`/admin/agents/${encodeURIComponent(e)}/tokens`,n)}function BU(e,n){return De.delete(`/admin/agents/${encodeURIComponent(e)}/tokens/${encodeURIComponent(n)}`)}const qU=Object.values(LS);function iE(e){var D;const{open:n,onOpenChange:i,onSubmit:a,isPending:s,error:u,mode:c}=e,d=c==="edit"?e.agent:void 0,[g,p]=w.useState(""),[y,v]=w.useState("personal_assistant"),[x,S]=w.useState(""),[j,C]=w.useState(""),[T,k]=w.useState(""),P=c==="create"&&y!=="human",U=Ke({queryKey:["clients-for-provision"],queryFn:Km,enabled:n&&P}),H=y==="human",K=Ke({queryKey:["agents-for-delegate"],queryFn:async()=>(await Gm({limit:100})).items.filter(ie=>ie.type==="personal_assistant"&&ie.status==="active"),enabled:n&&H});w.useEffect(()=>{n&&(d?(p(d.name??""),v(d.type),S(d.displayName??""),C(d.delegateMention??"")):(p(""),v("personal_assistant"),S(""),C(""),k("")))},[n,d]);const L=B=>{B.preventDefault(),a({name:c==="create"&&g?g:void 0,type:y,displayName:x||null,delegateMention:j||null,clientId:T||null})},V=c==="edit";return h.jsx(Pl,{open:n,onOpenChange:i,children:h.jsxs(La,{children:[h.jsx(Hl,{children:h.jsx(Ia,{children:V?"Edit Agent":"New Agent"})}),h.jsxs("form",{onSubmit:L,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"agent-name",children:"Name"}),V?h.jsx(en,{id:"agent-name",value:g,disabled:!0,className:"font-mono"}):h.jsx(en,{id:"agent-name",value:g,onChange:B=>p(B.target.value),placeholder:"Leave empty to auto-generate",pattern:"^[a-z0-9_-]*$",title:"Only lowercase alphanumeric, hyphens, and underscores",className:"font-mono"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"agent-type",children:"Type"}),h.jsx("select",{id:"agent-type",value:y,onChange:B=>{const ie=B.target.value;v(ie),ie!=="human"&&C("")},disabled:V,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:opacity-50",children:qU.map(B=>h.jsx("option",{value:B,children:B},B))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"agent-display-name",children:"Display Name"}),h.jsx(en,{id:"agent-display-name",value:x,onChange:B=>S(B.target.value),placeholder:"Optional",maxLength:200})]}),H&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"agent-delegate",children:"Delegate Mention"}),h.jsxs("select",{id:"agent-delegate",value:j,onChange:B=>C(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:[h.jsx("option",{value:"",children:"None"}),(D=K.data)==null?void 0:D.map(B=>h.jsx("option",{value:B.uuid,children:B.displayName?`${B.displayName} (${B.name??B.uuid})`:B.name??B.uuid},B.uuid))]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"The personal assistant that acts on behalf of this agent"})]}),P&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"agent-client",children:"Client"}),U.data&&U.data.length>0?h.jsxs("select",{id:"agent-client",value:T,onChange:B=>k(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:[h.jsx("option",{value:"",children:"No client (manual binding)"}),U.data.map(B=>h.jsx("option",{value:B.id,children:B.hostname??B.id.slice(0,12)},B.id))]}):h.jsx("p",{className:"text-xs text-muted-foreground",children:"No connected clients. Agent will be created without binding."})]}),u&&h.jsx("div",{className:"text-sm text-destructive",children:u.message}),h.jsx(Ji,{children:h.jsx(qe,{type:"submit",disabled:s,children:s?"Saving...":V?"Save":"Create"})})]})]})})}function aE(){const{data:e}=Ke({queryKey:["members","name-map"],queryFn:PS,staleTime:3e4});return w.useMemo(()=>{const n=new Map;if(e)for(const i of e)n.set(i.id,i.displayName||i.username);return i=>i?n.get(i)??i:"—"},[e])}const PU=Object.values(GR);function HU(){var X,oe,Ne,Pe,Ge;const n=tj().uuid??"",i=ra(),a=nr(),{memberId:s,role:u}=os(),c=hr(),d=aE(),g=Ke({queryKey:["agent",n],queryFn:()=>D2(n),enabled:!!n}),p=Ke({queryKey:["tokens",n],queryFn:()=>IU(n),enabled:!!n&&g.isSuccess&&((X=g.data)==null?void 0:X.type)!=="human"}),y=Ke({queryKey:["adapters"],queryFn:J1}),v=Ke({queryKey:["adapter-mappings"],queryFn:K1}),{data:x}=Ke({queryKey:["adapter-statuses"],queryFn:X1,refetchInterval:15e3}),S=((oe=y.data)==null?void 0:oe.filter(W=>W.agentId===n))??[],j=((Ne=v.data)==null?void 0:Ne.filter(W=>W.agentId===n))??[],[C,T]=w.useState(!1),[k,P]=w.useState(""),[U,H]=w.useState(null),[K,L]=w.useState(!1),[V,D]=w.useState(null),[B,ie]=w.useState({platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""}),[se,le]=w.useState(""),ke=bt({mutationFn:()=>I2(n),onSuccess:()=>a.invalidateQueries({queryKey:["agent",n]})}),fe=bt({mutationFn:()=>B2(n),onSuccess:()=>a.invalidateQueries({queryKey:["agent",n]})}),ne=bt({mutationFn:()=>L2(n),onSuccess:()=>i("/agents")}),q=bt({mutationFn:W=>Am(n,{name:W||void 0}),onSuccess:W=>{H(W.token),P(""),a.invalidateQueries({queryKey:["tokens",n]})}}),re=bt({mutationFn:W=>BU(n,W),onSuccess:()=>a.invalidateQueries({queryKey:["tokens",n]})}),me=bt({mutationFn:async()=>{let W=z0(B);if(!W)throw new Error("Credentials are required");if(B.platform==="kael"&&!W.agentToken){const dt=await Am(n,{name:"kael-hub-binding"});W={...W,agentToken:dt.token}}return G2({platform:B.platform,agentId:n,credentials:W,status:B.status})},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),a.invalidateQueries({queryKey:["tokens",n]}),Ft()}}),Ae=bt({mutationFn:()=>{if(!V)throw new Error("No adapter selected");const W={status:B.status},dt=z0(B);return dt&&(W.credentials=dt),K2(V,W)},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),Ft()}}),N=bt({mutationFn:X2,onSuccess:()=>a.invalidateQueries({queryKey:["adapters"]})}),R=bt({mutationFn:()=>Q2({platform:B.platform,externalUserId:B.externalUserId,agentId:n,boundVia:"manual",displayName:B.displayName||void 0}),onSuccess:()=>{a.invalidateQueries({queryKey:["adapter-mappings"]}),Ft()}}),Y=bt({mutationFn:Y2,onSuccess:()=>a.invalidateQueries({queryKey:["adapter-mappings"]})}),[_,ue]=w.useState(!1),he=bt({mutationFn:W=>lx(n,{displayName:W.displayName,delegateMention:W.delegateMention}),onSuccess:()=>{ue(!1),a.invalidateQueries({queryKey:["agent",n]}),a.invalidateQueries({queryKey:["agents"]})}}),ce=bt({mutationFn:()=>P2(n)}),[Re,We]=w.useState(!1),[je,Gt]=w.useState(""),Dt=bt({mutationFn:W=>lx(n,{profile:W||null}),onSuccess:()=>{We(!1),a.invalidateQueries({queryKey:["agent",n]})}}),Ue=g.data,Kt=(Ue==null?void 0:Ue.type)==="human";function Ft(){L(!1),D(null),ie({platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""}),le("")}function ci(W){D(W.id),ie({platform:W.platform,feishuAppId:"",feishuAppSecret:"",credentialsJson:"",status:W.status,externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""}),L(!0)}function fi(W){if(W.preventDefault(),le(""),Kt){if(!B.externalUserId)return;R.mutate();return}if(B.platform==="feishu"){if(!V&&(!B.feishuAppId||!B.feishuAppSecret)){le("App ID and App Secret are required");return}}else if(B.platform==="kael"){if(!V&&(!B.kaelUserId||!B.kaelProjectId)){le("User ID and Project ID are required");return}}else{const dt=B.credentialsJson.trim();if(!V&&!dt){le("Credentials are required");return}if(dt)try{JSON.parse(dt)}catch{le("Invalid JSON");return}}V?Ae.mutate():me.mutate()}if(g.isLoading)return h.jsx("div",{className:"text-muted-foreground",children:"Loading..."});if(g.error)return h.jsxs("div",{className:"text-destructive",children:["Failed to load agent: ",g.error instanceof Error?g.error.message:"Unknown error"]});if(!Ue)return h.jsx("div",{className:"text-muted-foreground",children:"Agent not found"});const $a=()=>{window.confirm("Are you sure you want to delete this agent? This cannot be undone.")&&ne.mutate()},Va=W=>{W.preventDefault(),q.mutate(k)},Rr=me.error??Ae.error??R.error,Mr=me.isPending||Ae.isPending||R.isPending,Dr=Ue.metadata,pr=Dr==null?void 0:Dr.tree,Qa=pr==null?void 0:pr.role,$t=pr==null?void 0:pr.domains,hn=u==="admin"||Ue.managerId===s;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx(qe,{variant:"ghost",size:"icon",onClick:()=>i("/agents"),children:h.jsx(A1,{className:"h-4 w-4"})}),h.jsxs("div",{className:"flex-1",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:Ue.displayName??Ue.name}),h.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:Ue.name})]}),hn&&Ue.status==="active"&&h.jsxs(qe,{variant:"outline",size:"sm",onClick:()=>ue(!0),children:[h.jsx(Ch,{className:"h-4 w-4 mr-2"}),"Edit"]}),hn&&!Kt&&Ue.status==="active"&&h.jsxs(qe,{variant:"outline",size:"sm",onClick:()=>{ce.reset(),ce.mutate()},disabled:ce.isPending,children:[h.jsx(Rk,{className:"h-4 w-4 mr-2"}),ce.isPending?"Testing...":"Test Connection"]}),hn&&Ue.status==="active"&&h.jsx(qe,{variant:"outline",size:"sm",onClick:()=>{window.confirm("Suspend this agent? All tokens will be revoked.")&&ke.mutate()},disabled:ke.isPending,children:ke.isPending?"Suspending...":"Suspend"}),hn&&Ue.status==="suspended"&&h.jsxs(h.Fragment,{children:[h.jsx(qe,{variant:"outline",size:"sm",onClick:()=>fe.mutate(),disabled:fe.isPending,children:fe.isPending?"Reactivating...":"Reactivate"}),h.jsxs(qe,{variant:"destructive",size:"sm",onClick:$a,children:[h.jsx(mo,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]}),(ce.data||ce.error)&&h.jsx($U,{result:ce.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>ce.reset()}),h.jsxs(fr,{children:[h.jsx(Cr,{children:h.jsx(Nr,{children:"Agent Info"})}),h.jsx(dr,{children:h.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Display Name"}),h.jsx("dd",{children:Ue.displayName??"—"})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Type"}),h.jsx("dd",{children:h.jsx(Ht,{variant:"secondary",children:Ue.type})})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Status"}),h.jsx("dd",{children:h.jsx(Ht,{variant:Ue.status==="active"?"default":"destructive",children:Ue.status})})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Inbox ID"}),h.jsx("dd",{className:"font-mono",children:Ue.inboxId})]}),Ue.delegateMention&&h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Delegate Mention"}),h.jsx("dd",{className:"font-mono",children:c(Ue.delegateMention)})]}),Ue.managerId&&h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Owner"}),h.jsx("dd",{children:d(Ue.managerId)})]}),Qa&&h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Role"}),h.jsx("dd",{children:Qa})]}),$t&&$t.length>0&&h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Domains"}),h.jsx("dd",{className:"flex flex-wrap gap-1",children:$t.map(W=>h.jsx(Ht,{variant:"outline",children:W},W))})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Created"}),h.jsx("dd",{children:fn(Ue.createdAt)})]})]})})]}),(()=>{const W=Ue,dt=W.runtimeState,Ut=W.runtimeType,xt=W.activeSessions,nn=W.clientId;return dt?h.jsxs(fr,{children:[h.jsx(Cr,{children:h.jsx(Nr,{children:"Runtime"})}),h.jsx(dr,{children:h.jsxs("dl",{className:"grid grid-cols-2 gap-4 text-sm",children:[h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Runtime Type"}),h.jsx("dd",{children:Ut??"—"})]}),h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"State"}),h.jsx("dd",{children:h.jsx(Ht,{variant:dt==="error"?"destructive":dt==="working"?"default":"secondary",children:dt})})]}),xt!==null&&h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Sessions"}),h.jsxs("dd",{children:[xt," active"]})]}),nn&&h.jsxs("div",{children:[h.jsx("dt",{className:"text-muted-foreground mb-1",children:"Client"}),h.jsx("dd",{className:"font-mono text-xs",children:nn})]})]})})]}):null})(),h.jsxs(fr,{children:[h.jsxs(Cr,{className:"flex flex-row items-center justify-between",children:[h.jsx(Nr,{children:"Profile"}),hn&&Ue.status==="active"&&h.jsxs(qe,{variant:"outline",size:"sm",onClick:()=>{Gt(Ue.profile??""),We(!0)},children:[h.jsx(Ch,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),h.jsx(dr,{children:Ue.profile?h.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none max-h-64 overflow-auto bg-muted rounded p-4",children:h.jsx(RU,{children:Ue.profile})}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No profile"})})]}),h.jsx(Pl,{open:Re,onOpenChange:We,children:h.jsxs(La,{children:[h.jsx(Hl,{children:h.jsx(Ia,{children:"Edit Profile"})}),h.jsxs("form",{onSubmit:W=>{W.preventDefault(),Dt.mutate(je)},className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"profile-editor",children:"Markdown"}),h.jsx("textarea",{id:"profile-editor",value:je,onChange:W=>Gt(W.target.value),rows:12,className:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm font-mono transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:"Agent self-description in markdown..."})]}),Dt.error instanceof Error&&h.jsx("div",{className:"text-sm text-destructive",children:Dt.error.message}),h.jsx(Ji,{children:h.jsx(qe,{type:"submit",disabled:Dt.isPending,children:Dt.isPending?"Saving...":"Save"})})]})]})}),h.jsxs(fr,{children:[h.jsxs(Cr,{className:"flex flex-row items-center justify-between",children:[h.jsxs(Nr,{className:"flex items-center gap-2",children:[Kt?h.jsx(wk,{className:"h-4 w-4"}):h.jsx(hk,{className:"h-4 w-4"}),"Platform Bindings"]}),h.jsxs(qe,{size:"sm",disabled:!hn,onClick:()=>L(!0),children:[h.jsx(wo,{className:"h-4 w-4 mr-2"}),Kt?"Bind User":"Bind Bot"]})]}),h.jsx(dr,{children:Kt?h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{children:"Platform"}),h.jsx(Se,{children:"External User ID"}),h.jsx(Se,{children:"Display Name"}),h.jsx(Se,{children:"Bound Via"}),h.jsx(Se,{children:"Created"}),h.jsx(Se,{className:"w-16"})]})}),h.jsx(zr,{children:j.length===0?h.jsx(nt,{children:h.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):j.map(W=>h.jsxs(nt,{children:[h.jsx(xe,{children:h.jsx(Ht,{variant:"secondary",children:W.platform})}),h.jsx(xe,{className:"font-mono text-sm",children:W.externalUserId}),h.jsx(xe,{children:W.displayName??"—"}),h.jsx(xe,{children:h.jsx(Ht,{variant:"outline",children:W.boundVia??"—"})}),h.jsx(xe,{className:"text-muted-foreground",children:fn(W.createdAt)}),h.jsx(xe,{children:h.jsx(qe,{variant:"ghost",size:"icon",onClick:()=>{window.confirm("Remove this binding?")&&Y.mutate(W.id)},disabled:!hn||Y.isPending,children:h.jsx(mo,{className:"h-4 w-4"})})})]},W.id))})]}):h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{children:"Platform"}),h.jsx(Se,{children:"Status"}),h.jsx(Se,{children:"Connection"}),h.jsx(Se,{children:"Created"}),h.jsx(Se,{className:"w-24"})]})}),h.jsx(zr,{children:S.length===0?h.jsx(nt,{children:h.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):S.map(W=>{const dt=x==null?void 0:x.find(xt=>xt.configId===W.id),Ut=W.platform==="kael"?W.status==="active":!!(dt!=null&&dt.connected);return h.jsxs(nt,{children:[h.jsx(xe,{children:h.jsx(Ht,{variant:"secondary",children:W.platform})}),h.jsx(xe,{children:h.jsx(Ht,{variant:W.status==="active"?"default":"destructive",children:W.status})}),h.jsx(xe,{children:h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:Oe("inline-block h-2 w-2 rounded-full",Ut?"bg-green-500":"bg-gray-300")}),h.jsx("span",{className:"text-xs text-muted-foreground",children:Ut?"Online":"Offline"})]})}),h.jsx(xe,{className:"text-muted-foreground",children:fn(W.createdAt)}),h.jsx(xe,{children:h.jsxs("div",{className:"flex gap-1",children:[h.jsx(qe,{variant:"ghost",size:"icon",disabled:!hn,onClick:()=>ci(W),title:"Edit",children:h.jsx(Ch,{className:"h-4 w-4"})}),h.jsx(qe,{variant:"ghost",size:"icon",onClick:()=>{window.confirm("Remove this bot binding?")&&N.mutate(W.id)},disabled:!hn||N.isPending,title:"Delete",children:h.jsx(mo,{className:"h-4 w-4"})})]})})]},W.id)})})]})})]}),!Kt&&h.jsxs(fr,{children:[h.jsxs(Cr,{className:"flex flex-row items-center justify-between",children:[h.jsxs(Nr,{className:"flex items-center gap-2",children:[h.jsx(xk,{className:"h-4 w-4"}),"Tokens"]}),h.jsxs(qe,{size:"sm",disabled:!hn,onClick:()=>{H(null),P(""),T(!0)},children:[h.jsx(wo,{className:"h-4 w-4 mr-2"}),"Create Token"]})]}),h.jsx(dr,{children:h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{children:"Name"}),h.jsx(Se,{children:"Created"}),h.jsx(Se,{children:"Last Used"}),h.jsx(Se,{children:"Expires"}),h.jsx(Se,{className:"w-20"})]})}),h.jsx(zr,{children:((Pe=p.data)==null?void 0:Pe.length)===0?h.jsx(nt,{children:h.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No tokens"})}):(Ge=p.data)==null?void 0:Ge.map(W=>h.jsxs(nt,{children:[h.jsx(xe,{children:W.name??"—"}),h.jsx(xe,{className:"text-muted-foreground",children:fn(W.createdAt)}),h.jsx(xe,{className:"text-muted-foreground",children:fn(W.lastUsedAt)}),h.jsx(xe,{className:"text-muted-foreground",children:W.revokedAt?h.jsx(Ht,{variant:"destructive",children:"Revoked"}):W.expiresAt?fn(W.expiresAt):"Never"}),h.jsx(xe,{children:!W.revokedAt&&h.jsx(qe,{variant:"ghost",size:"sm",onClick:()=>re.mutate(W.id),disabled:!hn||re.isPending,children:h.jsx(mo,{className:"h-4 w-4"})})})]},W.id))})]})})]}),h.jsx(Pl,{open:K,onOpenChange:W=>W?L(!0):Ft(),children:h.jsxs(La,{children:[h.jsx(Hl,{children:h.jsx(Ia,{children:Kt?"Bind External User":V?"Edit Bot Binding":"Bind Bot"})}),h.jsxs("form",{onSubmit:fi,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"binding-platform",children:"Platform"}),h.jsx("select",{id:"binding-platform",value:B.platform,onChange:W=>ie({...B,platform:W.target.value}),disabled:!!V,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:opacity-50",children:PU.map(W=>h.jsx("option",{value:W,children:W},W))})]}),Kt?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"binding-ext-id",children:"External User ID"}),h.jsx(en,{id:"binding-ext-id",value:B.externalUserId,onChange:W=>ie({...B,externalUserId:W.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"binding-name",children:"Display Name (optional)"}),h.jsx(en,{id:"binding-name",value:B.displayName,onChange:W=>ie({...B,displayName:W.target.value})})]})]}):h.jsxs(h.Fragment,{children:[B.platform==="feishu"?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(Nt,{htmlFor:"feishu-app-id",children:["App ID",V?" — leave empty to keep existing":""]}),h.jsx(en,{id:"feishu-app-id",value:B.feishuAppId,onChange:W=>ie({...B,feishuAppId:W.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(Nt,{htmlFor:"feishu-app-secret",children:["App Secret",V?" — leave empty to keep existing":""]}),h.jsx(en,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:B.feishuAppSecret,onChange:W=>ie({...B,feishuAppSecret:W.target.value}),placeholder:"••••••••"})]})]}):B.platform==="kael"?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(Nt,{htmlFor:"kael-user-id",children:["User ID",V?" — leave empty to keep existing":""]}),h.jsx(en,{id:"kael-user-id",value:B.kaelUserId,onChange:W=>ie({...B,kaelUserId:W.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(Nt,{htmlFor:"kael-project-id",children:["Project ID",V?" — leave empty to keep existing":""]}),h.jsx(en,{id:"kael-project-id",value:B.kaelProjectId,onChange:W=>ie({...B,kaelProjectId:W.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!V&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"Agent Token will be created automatically when you save."})]}):h.jsxs("div",{className:"space-y-2",children:[h.jsxs(Nt,{htmlFor:"binding-creds",children:["Credentials (JSON)",V?" — leave empty to keep existing":""]}),h.jsx("textarea",{id:"binding-creds",value:B.credentialsJson,onChange:W=>ie({...B,credentialsJson:W.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 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),se&&h.jsx("p",{className:"text-sm text-destructive",children:se}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"binding-status",children:"Status"}),h.jsxs("select",{id:"binding-status",value:B.status,onChange:W=>ie({...B,status:W.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:[h.jsx("option",{value:"active",children:"active"}),h.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),Rr instanceof Error&&h.jsx("div",{className:"text-sm text-destructive",children:Rr.message}),h.jsx(Ji,{children:h.jsx(qe,{type:"submit",disabled:Mr,children:Mr?"Saving...":V?"Update":"Create"})})]})]})}),Ue.status==="active"&&h.jsx(iE,{mode:"edit",agent:Ue,open:_,onOpenChange:ue,onSubmit:W=>he.mutate(W),isPending:he.isPending,error:he.error instanceof Error?he.error:null}),!Kt&&h.jsx(Pl,{open:C,onOpenChange:W=>{T(W),W||H(null)},children:h.jsxs(La,{children:[h.jsx(Hl,{children:h.jsx(Ia,{children:U?"Token Created":"Create Token"})}),U?h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy this token now. It will not be shown again."}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(en,{value:U,readOnly:!0,className:"font-mono text-xs"}),h.jsx(qe,{variant:"outline",size:"icon",onClick:()=>navigator.clipboard.writeText(U),children:h.jsx(Pc,{className:"h-4 w-4"})})]}),h.jsx(Ji,{children:h.jsx(qe,{onClick:()=>T(!1),children:"Done"})})]}):h.jsxs("form",{onSubmit:Va,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{children:"Name (optional)"}),h.jsx(en,{value:k,onChange:W=>P(W.target.value),placeholder:"e.g. production"})]}),q.error instanceof Error&&h.jsx("div",{className:"text-sm text-destructive",children:q.error.message}),h.jsx(Ji,{children:h.jsx(qe,{type:"submit",disabled:q.isPending,children:q.isPending?"Creating...":"Create"})})]})]})})]})}const ZU={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},FU={connected:{icon:"●",color:"text-green-500",label:"Connected"},stale:{icon:"◐",color:"text-yellow-500",label:"Stale"},disconnected:{icon:"○",color:"text-gray-400",label:"Disconnected"}};function $U({result:e,onDismiss:n}){const i={success:"border-l-green-500",timeout:"border-l-yellow-500",offline:"border-l-gray-400",stale:"border-l-yellow-500",error:"border-l-red-500"}[e.status],a=e.status==="success"?"default":e.status==="timeout"||e.status==="stale"?"secondary":"destructive",s=e.connection,u=s?FU[s.health]:null;return h.jsx(fr,{className:Oe("border-l-4",i),children:h.jsx(dr,{className:"pt-4",children:h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ht,{variant:a,children:ZU[e.status]}),e.responseTime!=null&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&h.jsx("p",{className:"text-sm text-muted-foreground",children:e.message}),s&&h.jsxs("div",{className:"text-xs space-y-1 border-t pt-2 mt-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[u&&h.jsxs("span",{className:u.color,children:[u.icon," ",u.label]}),s.runtimeState&&h.jsxs("span",{className:"text-muted-foreground",children:["runtime: ",s.runtimeState]})]}),s.client?h.jsxs("div",{className:"text-muted-foreground",children:["Client: ",s.client.hostname??s.client.id,s.client.os&&` (${s.client.os})`,s.client.sdkVersion&&` · SDK ${s.client.sdkVersion}`]}):h.jsx("div",{className:"text-muted-foreground",children:"No client bound"}),s.lastSeenAt&&h.jsxs("div",{className:"text-muted-foreground",children:["Last seen: ",new Date(s.lastSeenAt).toLocaleString()]})]}),e.responseContent&&h.jsx("p",{className:"text-sm mt-2 whitespace-pre-wrap bg-muted rounded p-2 max-h-40 overflow-auto",children:e.responseContent})]}),h.jsx(qe,{variant:"ghost",size:"sm",onClick:n,children:"Dismiss"})]})})})}function z0(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 n=e.credentialsJson.trim();return n?JSON.parse(n):null}const VU=Object.values(LS);function O0(e){return[...e].sort((n,i)=>{const a=(n.name??n.displayName??"").toLowerCase(),s=(i.name??i.displayName??"").toLowerCase();return a.localeCompare(s)})}function QU(){const e=ra(),n=nr(),{memberId:i}=os(),[a,s]=w.useState(),[u,c]=w.useState(""),[d,g]=w.useState(!1),[p,y]=w.useState(null),[v,x]=w.useState(!1),S=hr(),j=aE(),{data:C,isLoading:T,error:k}=Ke({queryKey:["agents",a,u],queryFn:()=>Gm({limit:100,cursor:a,type:u||void 0})}),{myAgents:P,teamAgents:U}=w.useMemo(()=>{if(!(C!=null&&C.items))return{myAgents:[],teamAgents:[]};const D=[],B=[];for(const ie of C.items)i&&ie.managerId===i?D.push(ie):B.push(ie);return{myAgents:O0(D),teamAgents:O0(B)}},[C,i]),H=bt({mutationFn:async D=>{const B=await U2({name:D.name,type:D.type,displayName:D.displayName??void 0,delegateMention:D.delegateMention??void 0});if(D.type==="human")return{agent:B,token:null,provisioned:!1};if(D.clientId)return await q2(B.uuid,D.clientId),{agent:B,token:null,provisioned:!0};const ie=await Am(B.uuid,{name:"default"});return{agent:B,token:ie.token,provisioned:!1}},onSuccess:({agent:D,token:B,provisioned:ie})=>{g(!1),n.invalidateQueries({queryKey:["agents"]}),n.invalidateQueries({queryKey:["activity"]}),ie?e(`/agents/${D.uuid}`):B?(y({agent:D,token:B,provisioned:!1}),x(!1)):e(`/agents/${D.uuid}`)}});function K(D){const ie=D.runtimeState,se={idle:"bg-green-500",working:"bg-blue-500",error:"bg-red-500"};return h.jsxs(nt,{className:"cursor-pointer",onClick:()=>e(`/agents/${D.uuid}`),children:[h.jsx(xe,{className:"font-mono text-sm",children:D.name}),h.jsx(xe,{children:D.displayName??"—"}),h.jsx(xe,{children:h.jsx(Ht,{variant:"secondary",children:D.type})}),h.jsx(xe,{className:"font-mono text-sm text-muted-foreground",children:D.delegateMention?S(D.delegateMention):"—"}),h.jsx(xe,{className:"text-sm text-muted-foreground",children:j(D.managerId)}),h.jsx(xe,{children:ie?h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:Oe("inline-block h-2 w-2 rounded-full",se[ie]??"bg-gray-300")}),h.jsx("span",{className:"text-xs text-muted-foreground",children:ie})]}):h.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-gray-300",title:"not running"})}),h.jsx(xe,{children:h.jsx(Ht,{variant:D.status==="active"?"default":"destructive",children:D.status})}),h.jsx(xe,{className:"text-muted-foreground",children:fn(D.createdAt)})]},D.uuid)}const L=p!=null&&p.token?`first-tree-hub agent add ${p.agent.name??p.agent.uuid} --token ${p.token}`:"",V=()=>{navigator.clipboard.writeText(L),x(!0),setTimeout(()=>x(!1),2e3)};return h.jsxs("div",{className:"space-y-8",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:"Agents"}),h.jsxs("select",{value:u,onChange:D=>{c(D.target.value),s(void 0)},className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[h.jsx("option",{value:"",children:"All types"}),VU.map(D=>h.jsx("option",{value:D,children:D},D))]})]}),T?h.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):k?h.jsxs("div",{className:"text-center py-8 text-destructive",children:["Failed to load agents: ",k instanceof Error?k.message:"Unknown error"]}):h.jsxs(h.Fragment,{children:[h.jsxs("section",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("h2",{className:"text-lg font-medium",children:"My Agents"}),h.jsxs(qe,{size:"sm",onClick:()=>g(!0),children:[h.jsx(wo,{className:"h-4 w-4 mr-2"}),"New Agent"]})]}),h.jsx("div",{className:"border rounded-lg",children:h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{children:"Name"}),h.jsx(Se,{children:"Display Name"}),h.jsx(Se,{children:"Type"}),h.jsx(Se,{children:"Delegate"}),h.jsx(Se,{children:"Owner"}),h.jsx(Se,{children:"Runtime"}),h.jsx(Se,{children:"Status"}),h.jsx(Se,{children:"Created"})]})}),h.jsx(zr,{children:P.length===0?h.jsx(nt,{children:h.jsx(xe,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"No agents yet — create one to get started"})}):P.map(D=>K(D))})]})})]}),U.length>0&&h.jsxs("section",{children:[h.jsx("h2",{className:"text-lg font-medium mb-3",children:"Team Agents"}),h.jsx("div",{className:"border rounded-lg",children:h.jsxs(Tr,{children:[h.jsx(Ar,{children:h.jsxs(nt,{children:[h.jsx(Se,{children:"Name"}),h.jsx(Se,{children:"Display Name"}),h.jsx(Se,{children:"Type"}),h.jsx(Se,{children:"Delegate"}),h.jsx(Se,{children:"Owner"}),h.jsx(Se,{children:"Runtime"}),h.jsx(Se,{children:"Status"}),h.jsx(Se,{children:"Created"})]})}),h.jsx(zr,{children:U.map(D=>K(D))})]})})]})]}),(C==null?void 0:C.nextCursor)&&h.jsx("div",{className:"flex justify-end",children:h.jsx(qe,{variant:"outline",onClick:()=>s(C.nextCursor??void 0),children:"Next Page"})}),h.jsx(iE,{mode:"create",open:d,onOpenChange:g,onSubmit:D=>H.mutate(D),isPending:H.isPending,error:H.error instanceof Error?H.error:null}),h.jsx(Pl,{open:p!==null,onOpenChange:D=>{if(!D){const B=p==null?void 0:p.agent.uuid;y(null),B&&e(`/agents/${B}`)}},children:h.jsxs(La,{children:[h.jsx(Hl,{children:h.jsx(Ia,{children:"Agent Created"})}),h.jsxs("div",{className:"space-y-3",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Run this command in your terminal to bind the agent to your client:"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 bg-muted rounded-md px-3 py-2 text-xs font-mono break-all select-all",children:L}),h.jsx(qe,{variant:"outline",size:"icon",className:"shrink-0",onClick:V,children:v?h.jsx(z1,{className:"h-4 w-4 text-green-600"}):h.jsx(Pc,{className:"h-4 w-4"})})]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Copy this token now. It will not be shown again."})]}),h.jsx(Ji,{children:h.jsx(qe,{onClick:()=>{const D=p==null?void 0:p.agent.uuid;y(null),D&&e(`/agents/${D}`)},children:"Done"})})]})})]})}function YU(){const{isAuthenticated:e,login:n}=os(),[i,a]=w.useState(""),[s,u]=w.useState(""),[c,d]=w.useState(null),[g,p]=w.useState(!1);if(e)return h.jsx(y1,{to:"/",replace:!0});const y=async v=>{v.preventDefault(),d(null),p(!0);try{await n(i,s)}catch(x){d(x instanceof Error?x.message:"Login failed")}finally{p(!1)}};return h.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:h.jsxs(fr,{className:"w-full max-w-sm",children:[h.jsxs(Cr,{className:"text-center",children:[h.jsx(Nr,{className:"text-2xl",children:"First Tree"}),h.jsx(eS,{children:"Sign in to your workspace"})]}),h.jsx(dr,{children:h.jsxs("form",{onSubmit:y,className:"space-y-4",children:[c&&h.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:c}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"username",children:"Username"}),h.jsx(en,{id:"username",value:i,onChange:v=>a(v.target.value),required:!0,autoFocus:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"password",children:"Password"}),h.jsx(en,{id:"password",type:"password",value:s,onChange:v=>u(v.target.value),required:!0})]}),h.jsx(qe,{type:"submit",className:"w-full",disabled:g,children:g?"Signing in...":"Sign in"})]})})]})})}function GU(e,n){return De.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:n})}function KU(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function XU(e,n){const i=new URLSearchParams;i.set("limit",String(n.limit)),n!=null&&n.cursor&&i.set("cursor",n.cursor);const a=i.toString();return De.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}function lE(){return De.get("/admin/overview")}function _p(e,n){const a=new URLSearchParams().toString();return De.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function JU(e,n){return De.post(`/admin/sessions/agents/${e}/${n}/suspend`)}function WU(e,n){return De.post(`/admin/sessions/agents/${e}/${n}/resume`)}function eL(e,n){return De.post(`/admin/sessions/agents/${e}/${n}/terminate`)}const tL=2e3,nL=3e4;function rL(e){const{onMessage:n,enabled:i=!0}={},a=nr(),s=w.useRef(null),u=w.useRef(0),c=w.useRef(null),d=w.useRef(!1),g=w.useRef(n);g.current=n;const p=w.useRef(a);p.current=a,w.useEffect(()=>{if(!i)return;d.current=!1;function y(){const v=Vm();if(!(v!=null&&v.accessToken))return;const S=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${v.accessToken}`,j=new WebSocket(S);s.current=j,j.onmessage=C=>{var T;try{const k=JSON.parse(C.data);(T=g.current)==null||T.call(g,k),k.type==="notification"?p.current.invalidateQueries({queryKey:["notifications"]}):k.type==="session:state"&&(p.current.invalidateQueries({queryKey:["activity"]}),p.current.invalidateQueries({queryKey:["sessions"]}))}catch{}},j.onopen=()=>{u.current=0},j.onclose=()=>{if(s.current=null,!d.current){u.current++;const C=Math.min(tL*2**(u.current-1),nL);c.current=setTimeout(()=>{c.current=null,d.current||y()},C)}}}return y(),()=>{d.current=!0,c.current&&(clearTimeout(c.current),c.current=null),s.current&&(s.current.close(1e3,"unmount"),s.current=null)}},[i])}function sE(){const{data:e}=Ke({queryKey:["clients"],queryFn:Km,staleTime:1e4,refetchInterval:1e4});return w.useMemo(()=>{const n=e??[],i=new Map;for(const a of n)i.set(a.id,a);return{resolve:a=>a?i.get(a)??null:null,clients:n,connectedClients:n.filter(a=>a.status==="connected")}},[e])}function iL(){const[e,n]=C1(),i=e.get("a"),a=e.get("c"),[s,u]=w.useState(!0);rL();const c=w.useCallback(p=>{n(p?{a:p}:{})},[n]),d=w.useCallback((p,y)=>{n({a:p,c:y})},[n]),g=w.useCallback(()=>{i&&n({a:i})},[i,n]);return h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsx(fL,{selectedAgentId:i,selectedChatId:a,onSelectAgent:c,onSelectChat:d}),h.jsx("div",{className:"flex-1 flex flex-col overflow-hidden border-x border-border",children:h.jsx(dL,{selectedAgentId:i,selectedChatId:a,onSelectChat:d,onClearChat:g})}),s?h.jsxs("div",{className:"w-80 shrink-0 flex flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:a?"Session":i?"Agent Info":"Dashboard"}),h.jsx("button",{type:"button",onClick:()=>u(!1),className:"text-muted-foreground hover:text-foreground",children:h.jsx(kk,{className:"h-4 w-4"})})]}),h.jsx(gL,{selectedAgentId:i,selectedChatId:a})]}):h.jsx("div",{className:"shrink-0 border-l border-border flex items-start pt-2 px-1",children:h.jsx("button",{type:"button",onClick:()=>u(!0),className:"text-muted-foreground hover:text-foreground p-1",children:h.jsx(Ak,{className:"h-4 w-4"})})})]})}const aL={error:0,blocked:1,working:2,idle:3};function R0(e,n){return n?e?aL[e]??4:4:5}const lL={idle:"bg-green-500",working:"bg-green-500 animate-pulse",blocked:"bg-yellow-500",error:"bg-red-500"};function sL({runtimeState:e,clientId:n}){if(!n||!e)return h.jsx("span",{className:"h-2 w-2 rounded-full bg-gray-400 shrink-0 mt-1.5"});const i=lL[e]??"bg-gray-400";return h.jsx("span",{className:`h-2 w-2 rounded-full ${i} shrink-0 mt-1.5`})}function oL({state:e}){if(!e)return h.jsx("span",{className:"text-xs text-muted-foreground",children:"offline"});const n={idle:"text-green-600",working:"text-blue-600",blocked:"text-yellow-600",error:"text-red-600"};return h.jsx("span",{className:Oe("text-xs font-medium",n[e]??"text-muted-foreground"),children:e})}function uL({state:e}){const n={active:"border-green-500/50 text-green-600 bg-green-500/10",suspended:"border-yellow-500/50 text-yellow-600 bg-yellow-500/10",evicted:"border-muted text-muted-foreground"};return h.jsx(Ht,{variant:"outline",className:Oe("text-xs",n[e]),children:e})}function cL({msg:e,myAgentId:n}){if(!n||e.senderId!==n)return null;const i=e.deliveryStatus??"sent";return i==="acked"?h.jsx("span",{className:"text-blue-500 text-xs ml-1",title:"Agent has started processing",children:"✓✓"}):i==="delivered"?h.jsx("span",{className:"text-muted-foreground text-xs ml-1",title:"Delivered to agent inbox",children:"✓✓"}):h.jsx("span",{className:"text-muted-foreground text-xs ml-1",title:"Sent",children:"✓"})}function fL({selectedAgentId:e,selectedChatId:n,onSelectAgent:i,onSelectChat:a}){const s=hr(),{resolve:u}=sE(),c=nr(),{data:d}=Ke({queryKey:["activity"],queryFn:Uo,refetchInterval:1e4}),g=[...(d==null?void 0:d.agents)??[]].sort((v,x)=>R0(v.runtimeState,v.clientId)-R0(x.runtimeState,x.clientId)),{data:p}=Ke({queryKey:["agent-sessions",e],queryFn:()=>e?_p(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),y=bt({mutationFn:v=>KU(v),onSuccess:(v,x)=>{c.invalidateQueries({queryKey:["agent-sessions",x]}),a(x,v.id)}});return h.jsxs("aside",{className:"w-60 shrink-0 flex flex-col overflow-y-auto bg-card",children:[h.jsx("div",{className:"px-3 py-2 border-b border-border",children:h.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Agents"})}),h.jsxs("div",{className:"flex-1 overflow-y-auto py-1",children:[g.length===0&&h.jsx("div",{className:"px-3 py-6 text-sm text-muted-foreground text-center",children:"No agents"}),g.map(v=>{var S;const x=e===v.agentId;return h.jsxs("div",{children:[h.jsxs("button",{type:"button",onClick:()=>i(x?null:v.agentId),className:Oe("w-full flex items-start gap-2 px-3 py-1.5 text-left transition-colors",x?"bg-accent":"hover:bg-accent/50"),children:[h.jsx(sL,{runtimeState:v.runtimeState,clientId:v.clientId}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-medium truncate flex-1",children:s(v.agentId)}),h.jsx(oL,{state:v.runtimeState})]}),h.jsx("span",{className:"text-xs text-muted-foreground truncate block",children:v.clientId?((S=u(v.clientId))==null?void 0:S.hostname)??v.clientId.slice(0,8):"disconnected"})]})]}),x&&h.jsxs("div",{className:"pl-5 pr-2 py-1 space-y-0.5",children:[(!p||p.length===0)&&h.jsx("div",{className:"text-xs text-muted-foreground py-1 pl-2",children:"No active sessions"}),p==null?void 0:p.map(j=>h.jsxs("button",{type:"button",onClick:()=>a(v.agentId,j.chatId),className:Oe("w-full flex items-center gap-1.5 px-2 py-1 rounded text-left text-xs transition-colors",n===j.chatId?"bg-primary/10 text-foreground":"text-muted-foreground hover:bg-accent/50"),children:[h.jsx(O1,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{className:"truncate flex-1",children:[j.chatId.slice(0,8),"..."]}),h.jsx("span",{className:Oe("h-1.5 w-1.5 rounded-full shrink-0",j.state==="active"&&"bg-green-500",j.state==="suspended"&&"bg-yellow-500",j.state==="evicted"&&"bg-gray-400"),title:j.state})]},j.chatId)),h.jsxs("button",{type:"button",onClick:()=>y.mutate(v.agentId),disabled:y.isPending,className:"w-full flex items-center gap-1.5 px-2 py-1 rounded text-xs text-muted-foreground hover:bg-accent/50 transition-colors",children:[h.jsx(wo,{className:"h-3 w-3"}),"New Chat"]})]})]},v.agentId)})]})]})}function dL({selectedAgentId:e,selectedChatId:n,onSelectChat:i,onClearChat:a}){return n&&e?h.jsx(pL,{agentId:e,chatId:n,onBack:a}):e?h.jsx(mL,{agentId:e,onSelectChat:i}):h.jsx(hL,{})}function hL(){const e=hr(),{data:n}=Ke({queryKey:["overview"],queryFn:lE,refetchInterval:3e4}),{data:i}=Ke({queryKey:["activity"],queryFn:Uo,refetchInterval:1e4}),{data:a}=Ke({queryKey:["notifications","feed"],queryFn:()=>Eo({limit:20}),refetchInterval:1e4});return h.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[h.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Activity"}),h.jsx("div",{className:"grid grid-cols-4 gap-3 mb-6",children:[{label:"Agents",value:(n==null?void 0:n.agents)??0},{label:"Online",value:(n==null?void 0:n.onlineAgents)??0},{label:"Working",value:(i==null?void 0:i.byState.working)??0},{label:"Blocked",value:(i==null?void 0:i.byState.blocked)??0}].map(s=>h.jsxs("div",{className:"rounded-lg border border-border p-3",children:[h.jsx("div",{className:"text-xs text-muted-foreground",children:s.label}),h.jsx("div",{className:"text-xl font-bold",children:s.value})]},s.label))}),h.jsxs("div",{className:"space-y-1",children:[(!(a!=null&&a.items)||a.items.length===0)&&h.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"No recent activity"}),a==null?void 0:a.items.map(s=>h.jsxs("div",{className:Oe("flex items-start gap-2 px-3 py-2 rounded-md text-sm",!s.read&&"bg-accent/20"),children:[h.jsx(qk,{className:Oe("h-4 w-4 mt-0.5 shrink-0",s.severity==="high"&&"text-red-500",s.severity==="medium"&&"text-yellow-500",s.severity==="low"&&"text-muted-foreground")}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"font-medium",children:s.agentId?e(s.agentId):""})," ",h.jsx("span",{className:"text-muted-foreground",children:s.message})]}),h.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:fn(s.createdAt)})]},s.id))]})]})}function mL({agentId:e,onSelectChat:n}){const i=hr(),{data:a}=Ke({queryKey:["agent-sessions-all",e],queryFn:()=>_p(e),refetchInterval:1e4}),s=(a==null?void 0:a.filter(d=>d.state==="active"))??[],u=(a==null?void 0:a.length)??0,c=(a==null?void 0:a.filter(d=>d.runtimeState==="error"))??[];return h.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[h.jsx("h2",{className:"text-lg font-semibold mb-1",children:i(e)}),h.jsx("p",{className:"text-sm text-muted-foreground mb-4 font-mono",children:e}),h.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-6",children:[h.jsxs("div",{className:"rounded-lg border border-border p-3",children:[h.jsx("div",{className:"text-xs text-muted-foreground",children:"Active"}),h.jsx("div",{className:"text-xl font-bold",children:s.length})]}),h.jsxs("div",{className:"rounded-lg border border-border p-3",children:[h.jsx("div",{className:"text-xs text-muted-foreground",children:"Total"}),h.jsx("div",{className:"text-xl font-bold",children:u})]}),h.jsxs("div",{className:"rounded-lg border border-border p-3",children:[h.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),h.jsx("div",{className:"text-xl font-bold text-red-600",children:c.length})]})]}),h.jsx("h3",{className:"text-sm font-medium mb-2",children:"All Sessions"}),h.jsx("div",{className:"border rounded-lg overflow-hidden",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[h.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Chat"}),h.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"State"}),h.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Messages"}),h.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Last Active"})]})}),h.jsxs("tbody",{children:[(!a||a.length===0)&&h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"px-3 py-6 text-center text-muted-foreground",children:"No sessions"})}),a==null?void 0:a.map(d=>h.jsxs("tr",{className:"border-b border-border last:border-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:()=>n(e,d.chatId),children:[h.jsxs("td",{className:"px-3 py-2 font-mono text-xs",children:[d.chatId.slice(0,12),"..."]}),h.jsx("td",{className:"px-3 py-2",children:h.jsx(uL,{state:d.state})}),h.jsx("td",{className:"px-3 py-2 text-muted-foreground text-xs",children:d.messageCount}),h.jsx("td",{className:"px-3 py-2 text-muted-foreground text-xs",children:fn(d.lastActivityAt)})]},d.chatId))]})]})})]})}function pL({agentId:e,chatId:n,onBack:i}){var S;const a=nr(),s=hr(),{agentId:u}=os(),[c,d]=w.useState(""),g=w.useRef(null),{data:p}=Ke({queryKey:["chat-messages",n],queryFn:()=>XU(n,{limit:50}),refetchInterval:5e3}),y=bt({mutationFn:j=>GU(n,j),onSuccess:()=>{d(""),a.invalidateQueries({queryKey:["chat-messages",n]})}}),v=()=>{const j=c.trim();j&&y.mutate(j)},x=((S=p==null?void 0:p.items)==null?void 0:S.length)??0;return w.useEffect(()=>{var j;x>0&&((j=g.current)==null||j.scrollIntoView({behavior:"smooth"}))},[x]),h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border shrink-0",children:[h.jsx("button",{type:"button",onClick:i,className:"text-muted-foreground hover:text-foreground",children:h.jsx(A1,{className:"h-4 w-4"})}),h.jsx("span",{className:"text-sm font-medium",children:s(e)}),h.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[n.slice(0,8),"..."]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:[(!(p!=null&&p.items)||p.items.length===0)&&h.jsxs("div",{className:"text-sm text-muted-foreground text-center py-8",children:[h.jsx(_k,{className:"h-8 w-8 mx-auto mb-2 opacity-30"}),"Send a message to start the conversation"]}),[...(p==null?void 0:p.items)??[]].reverse().map(j=>h.jsxs("div",{className:"rounded-md border border-border p-3",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-medium",children:s(j.senderId)}),j.source&&h.jsx(Ht,{variant:"outline",className:"text-[10px] opacity-70 px-1 py-0",children:j.source})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:fn(j.createdAt)}),h.jsx(cL,{msg:j,myAgentId:u})]})]}),h.jsx("div",{className:"text-sm",children:j.format==="text"?h.jsx("p",{className:"whitespace-pre-wrap",children:typeof j.content=="string"?j.content:JSON.stringify(j.content)}):h.jsx("pre",{className:"text-xs bg-muted p-2 rounded overflow-auto max-h-40",children:JSON.stringify(j.content,null,2)})})]},j.id)),h.jsx("div",{ref:g})]}),h.jsxs("div",{className:"shrink-0 border-t border-border p-3 flex gap-2",children:[h.jsx(en,{placeholder:"Type a message...",value:c,onChange:j=>d(j.target.value),onKeyDown:j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),v())},disabled:y.isPending}),h.jsx(qe,{size:"icon",onClick:v,disabled:y.isPending||!c.trim(),children:h.jsx(Uk,{className:"h-4 w-4"})})]}),y.isError&&h.jsx("p",{className:"text-destructive text-xs px-3 pb-2",children:y.error instanceof Error?y.error.message:"Failed to send"})]})}function gL({selectedAgentId:e,selectedChatId:n}){return n&&e?h.jsx(wL,{agentId:e,chatId:n}):e?h.jsx(SL,{agentId:e}):h.jsx(yL,{})}function yL(){const e=hr(),{data:n}=Ke({queryKey:["overview"],queryFn:lE,refetchInterval:3e4}),{data:i}=Ke({queryKey:["activity"],queryFn:Uo,refetchInterval:1e4}),{data:a}=Ke({queryKey:["notifications","context"],queryFn:()=>Eo({limit:5}),refetchInterval:3e4});return h.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[h.jsx("div",{className:"space-y-2",children:[{label:"Clients",value:(i==null?void 0:i.clients)??0},{label:"Agents",value:(n==null?void 0:n.agents)??0},{label:"Online",value:(n==null?void 0:n.onlineAgents)??0},{label:"Working",value:(i==null?void 0:i.byState.working)??0},{label:"Idle",value:(i==null?void 0:i.byState.idle)??0},{label:"Blocked",value:(i==null?void 0:i.byState.blocked)??0},{label:"Error",value:(i==null?void 0:i.byState.error)??0}].map(s=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:s.label}),h.jsx("span",{className:"font-medium",children:s.value})]},s.label))}),h.jsxs("div",{className:"border-t border-border pt-3",children:[h.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Notifications"}),!(a!=null&&a.items)||a.items.length===0?h.jsx("div",{className:"text-xs text-muted-foreground text-center py-3",children:"No notifications"}):h.jsx("div",{className:"space-y-2",children:a.items.map(s=>h.jsxs("div",{className:Oe("text-xs",!s.read&&"font-medium"),children:[h.jsx("span",{className:Oe(s.severity==="high"&&"text-red-500",s.severity==="medium"&&"text-yellow-500"),children:s.agentId?e(s.agentId):"System"})," ",h.jsx("span",{className:"text-muted-foreground",children:s.message})]},s.id))})]})]})}function vL(e){if(!e)return"—";const n=Date.now()-new Date(e).getTime(),i=Math.floor(n/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60);return a<24?`${a}h ${i%60}m`:`${Math.floor(a/24)}d ${a%24}h`}const bL={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 xL({notifications:e,agentId:n}){const[,i]=C1(),a=nr(),s=bt({mutationFn:u=>G1(u),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications","agent",n]})}});return h.jsx("div",{className:"space-y-1",children:e.map(u=>{const c=!!u.chatId,d=bL[u.type]??u.type;return h.jsxs("button",{type:"button",className:Oe("w-full flex items-start gap-1.5 px-2 py-1.5 rounded text-xs text-left transition-colors",!u.read&&"bg-accent/30",c&&"cursor-pointer hover:bg-accent/50"),onClick:()=>{u.read||s.mutate(u.id),c&&i({a:n,c:u.chatId})},children:[h.jsx("span",{className:Oe("h-1.5 w-1.5 rounded-full mt-1 shrink-0",u.read?"bg-transparent":"bg-primary")}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:Oe("font-medium",u.severity==="high"&&"text-red-500",u.severity==="medium"&&"text-yellow-600",u.severity==="low"&&"text-muted-foreground"),children:d}),h.jsx("span",{className:"text-muted-foreground ml-auto shrink-0",children:fn(u.createdAt)})]}),h.jsx("span",{className:"text-muted-foreground line-clamp-2",children:u.message})]})]},u.id)})})}function SL({agentId:e}){var d;const n=hr(),{resolve:i}=sE(),{data:a}=Ke({queryKey:["activity"],queryFn:Uo,refetchInterval:1e4}),s=(d=a==null?void 0:a.agents)==null?void 0:d.find(g=>g.agentId===e),u=i(s==null?void 0:s.clientId),{data:c}=Ke({queryKey:["notifications","agent",e],queryFn:()=>Eo({agentId:e,limit:5}),refetchInterval:3e4});return h.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[h.jsx("div",{className:"space-y-2",children:[{label:"Name",value:n(e)},{label:"Status",value:(s==null?void 0:s.runtimeState)??"offline"},{label:"Runtime",value:(s==null?void 0:s.runtimeType)??"—"},{label:"Active",value:String((s==null?void 0:s.activeSessions)??0)},{label:"Total",value:String((s==null?void 0:s.totalSessions)??0)}].map(g=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:g.label}),h.jsx("span",{className:"font-medium",children:g.value})]},g.label))}),h.jsxs("div",{className:"border-t border-border pt-3",children:[h.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Client"}),u?h.jsx("div",{className:"space-y-2",children:[{label:"Hostname",value:u.hostname??"—"},{label:"OS",value:u.os??"—"},{label:"SDK",value:u.sdkVersion??"—"},{label:"Connected",value:vL(u.connectedAt)}].map(g=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:g.label}),h.jsx("span",{className:"font-medium",children:g.value})]},g.label))}):h.jsx("div",{className:"text-xs text-muted-foreground",children:"disconnected"})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("a",{href:`/agents/${e}`,className:"text-xs text-primary hover:underline",children:"Manage Agent →"}),h.jsx("a",{href:"/admin#clients",className:"text-xs text-primary hover:underline",children:"Admin: Clients →"})]}),h.jsxs("div",{className:"border-t border-border pt-3",children:[h.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Notifications"}),!(c!=null&&c.items)||c.items.length===0?h.jsx("div",{className:"text-xs text-muted-foreground text-center py-3",children:"No notifications for this agent"}):h.jsx(xL,{notifications:c.items,agentId:e})]})]})}function wL({agentId:e,chatId:n}){const i=nr(),{data:a}=Ke({queryKey:["session",e,n],queryFn:()=>_p(e).then(x=>x.find(S=>S.chatId===n)??null),refetchInterval:5e3}),s=bt({mutationFn:()=>JU(e,n),onSuccess:()=>i.invalidateQueries({queryKey:["session",e,n]})}),u=bt({mutationFn:()=>WU(e,n),onSuccess:()=>i.invalidateQueries({queryKey:["session",e,n]})}),c=bt({mutationFn:()=>eL(e,n),onSuccess:()=>i.invalidateQueries({queryKey:["session",e,n]})}),d=(a==null?void 0:a.state)==="active",g=(a==null?void 0:a.state)==="suspended",p=(a==null?void 0:a.state)==="evicted",y=a!=null&&a.startedAt?new Date(a.startedAt):null,v=y?Math.floor((Date.now()-y.getTime())/6e4):null;return h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-3",children:[h.jsx("div",{className:"space-y-2 mb-3",children:[{label:"State",value:(a==null?void 0:a.state)??"—"},{label:"Runtime",value:(a==null?void 0:a.runtimeState)??"—"},{label:"Started",value:a!=null&&a.startedAt?fn(a.startedAt):"—"},{label:"Duration",value:v!==null?`${v} min`:"—"},{label:"Messages",value:String((a==null?void 0:a.messageCount)??0)}].map(x=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:x.label}),h.jsx("span",{className:"font-medium",children:x.value})]},x.label))}),h.jsxs("div",{className:"flex gap-2 mb-3",children:[d&&h.jsx(qe,{variant:"outline",size:"sm",onClick:()=>s.mutate(),disabled:s.isPending,children:"Suspend"}),g&&h.jsx(qe,{variant:"outline",size:"sm",onClick:()=>u.mutate(),disabled:u.isPending,children:"Resume"}),!p&&h.jsx(qe,{variant:"destructive",size:"sm",onClick:()=>{window.confirm("Terminate this session?")&&c.mutate()},disabled:c.isPending,children:"Terminate"})]}),h.jsxs("div",{className:"border-t border-border pt-3 flex-1 overflow-y-auto",children:[h.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Session Info"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Chat ID: ",h.jsxs("span",{className:"font-mono",children:[n.slice(0,12),"..."]})]})]})]})}const EL=new i_({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function CL(){return h.jsx(a_,{client:EL,children:h.jsx(ek,{children:h.jsx(Pj,{children:h.jsxs(gj,{children:[h.jsx(Pi,{path:"/login",element:h.jsx(YU,{})}),h.jsx(Pi,{element:h.jsx(tk,{}),children:h.jsxs(Pi,{element:h.jsx(V2,{}),children:[h.jsx(Pi,{index:!0,element:h.jsx(iL,{})}),h.jsx(Pi,{path:"agents",element:h.jsx(QU,{})}),h.jsx(Pi,{path:"agents/:uuid",element:h.jsx(HU,{})}),h.jsx(Pi,{path:"admin",element:h.jsx(yD,{})})]})})]})})})})}const oE=document.getElementById("root");if(!oE)throw new Error("Root element not found");RN.createRoot(oE).render(h.jsx(w.StrictMode,{children:h.jsx(CL,{})}));