@workerdeck/web 0.13.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,683 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-2lmB6qBE.js","assets/index-CXkKwxiP.css"])))=>i.map(i=>d[i]);
2
- function FM(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function Am(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dg={exports:{}},lc={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var kS;function $M(){if(kS)return lc;kS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return lc.Fragment=t,lc.jsx=n,lc.jsxs=n,lc}var NS;function VM(){return NS||(NS=1,Dg.exports=$M()),Dg.exports}var f=VM(),jg={exports:{}},gt={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var AS;function qM(){if(AS)return gt;AS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,C={};function S(P,$,L){this.props=P,this.context=$,this.refs=C,this.updater=L||E}S.prototype.isReactComponent={},S.prototype.setState=function(P,$){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,$,"setState")},S.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function k(){}k.prototype=S.prototype;function A(P,$,L){this.props=P,this.context=$,this.refs=C,this.updater=L||E}var R=A.prototype=new k;R.constructor=A,N(R,S.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function _(){}var O={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function H(P,$,L){var ae=L.ref;return{$$typeof:e,type:P,key:$,ref:ae!==void 0?ae:null,props:L}}function B(P,$){return H(P.type,$,P.props)}function K(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function X(P){var $={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(L){return $[L]})}var Z=/\/+/g;function te(P,$){return typeof P=="object"&&P!==null&&P.key!=null?X(""+P.key):$.toString(36)}function q(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(_,_):(P.status="pending",P.then(function($){P.status==="pending"&&(P.status="fulfilled",P.value=$)},function($){P.status==="pending"&&(P.status="rejected",P.reason=$)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function z(P,$,L,ae,re){var ce=typeof P;(ce==="undefined"||ce==="boolean")&&(P=null);var de=!1;if(P===null)de=!0;else switch(ce){case"bigint":case"string":case"number":de=!0;break;case"object":switch(P.$$typeof){case e:case t:de=!0;break;case p:return de=P._init,z(de(P._payload),$,L,ae,re)}}if(de)return re=re(P),de=ae===""?"."+te(P,0):ae,M(re)?(L="",de!=null&&(L=de.replace(Z,"$&/")+"/"),z(re,$,L,"",function(He){return He})):re!=null&&(K(re)&&(re=B(re,L+(re.key==null||P&&P.key===re.key?"":(""+re.key).replace(Z,"$&/")+"/")+de)),$.push(re)),1;de=0;var fe=ae===""?".":ae+":";if(M(P))for(var Se=0;Se<P.length;Se++)ae=P[Se],ce=fe+te(ae,Se),de+=z(ae,$,L,ce,re);else if(Se=x(P),typeof Se=="function")for(P=Se.call(P),Se=0;!(ae=P.next()).done;)ae=ae.value,ce=fe+te(ae,Se++),de+=z(ae,$,L,ce,re);else if(ce==="object"){if(typeof P.then=="function")return z(q(P),$,L,ae,re);throw $=String(P),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return de}function V(P,$,L){if(P==null)return P;var ae=[],re=0;return z(P,ae,"","",function(ce){return $.call(L,ce,re++)}),ae}function W(P){if(P._status===-1){var $=P._result;$=$(),$.then(function(L){(P._status===0||P._status===-1)&&(P._status=1,P._result=L)},function(L){(P._status===0||P._status===-1)&&(P._status=2,P._result=L)}),P._status===-1&&(P._status=0,P._result=$)}if(P._status===1)return P._result.default;throw P._result}var le=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},D={map:V,forEach:function(P,$,L){V(P,function(){$.apply(this,arguments)},L)},count:function(P){var $=0;return V(P,function(){$++}),$},toArray:function(P){return V(P,function($){return $})||[]},only:function(P){if(!K(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return gt.Activity=m,gt.Children=D,gt.Component=S,gt.Fragment=n,gt.Profiler=s,gt.PureComponent=A,gt.StrictMode=r,gt.Suspense=d,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,gt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return O.H.useMemoCache(P)}},gt.cache=function(P){return function(){return P.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(P,$,L){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var ae=N({},P.props),re=P.key;if($!=null)for(ce in $.key!==void 0&&(re=""+$.key),$)!j.call($,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&$.ref===void 0||(ae[ce]=$[ce]);var ce=arguments.length-2;if(ce===1)ae.children=L;else if(1<ce){for(var de=Array(ce),fe=0;fe<ce;fe++)de[fe]=arguments[fe+2];ae.children=de}return H(P.type,re,ae)},gt.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:a,_context:P},P},gt.createElement=function(P,$,L){var ae,re={},ce=null;if($!=null)for(ae in $.key!==void 0&&(ce=""+$.key),$)j.call($,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(re[ae]=$[ae]);var de=arguments.length-2;if(de===1)re.children=L;else if(1<de){for(var fe=Array(de),Se=0;Se<de;Se++)fe[Se]=arguments[Se+2];re.children=fe}if(P&&P.defaultProps)for(ae in de=P.defaultProps,de)re[ae]===void 0&&(re[ae]=de[ae]);return H(P,ce,re)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(P){return{$$typeof:u,render:P}},gt.isValidElement=K,gt.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:W}},gt.memo=function(P,$){return{$$typeof:h,type:P,compare:$===void 0?null:$}},gt.startTransition=function(P){var $=O.T,L={};O.T=L;try{var ae=P(),re=O.S;re!==null&&re(L,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(_,le)}catch(ce){le(ce)}finally{$!==null&&L.types!==null&&($.types=L.types),O.T=$}},gt.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},gt.use=function(P){return O.H.use(P)},gt.useActionState=function(P,$,L){return O.H.useActionState(P,$,L)},gt.useCallback=function(P,$){return O.H.useCallback(P,$)},gt.useContext=function(P){return O.H.useContext(P)},gt.useDebugValue=function(){},gt.useDeferredValue=function(P,$){return O.H.useDeferredValue(P,$)},gt.useEffect=function(P,$){return O.H.useEffect(P,$)},gt.useEffectEvent=function(P){return O.H.useEffectEvent(P)},gt.useId=function(){return O.H.useId()},gt.useImperativeHandle=function(P,$,L){return O.H.useImperativeHandle(P,$,L)},gt.useInsertionEffect=function(P,$){return O.H.useInsertionEffect(P,$)},gt.useLayoutEffect=function(P,$){return O.H.useLayoutEffect(P,$)},gt.useMemo=function(P,$){return O.H.useMemo(P,$)},gt.useOptimistic=function(P,$){return O.H.useOptimistic(P,$)},gt.useReducer=function(P,$,L){return O.H.useReducer(P,$,L)},gt.useRef=function(P){return O.H.useRef(P)},gt.useState=function(P){return O.H.useState(P)},gt.useSyncExternalStore=function(P,$,L){return O.H.useSyncExternalStore(P,$,L)},gt.useTransition=function(){return O.H.useTransition()},gt.version="19.2.7",gt}var _S;function bd(){return _S||(_S=1,jg.exports=qM()),jg.exports}var y=bd();const Fe=Am(y),YM=FM({__proto__:null,default:Fe},[y]);var Pg={exports:{}},uc={},Bg={exports:{}},zg={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var RS;function GM(){return RS||(RS=1,(function(e){function t(z,V){var W=z.length;z.push(V);e:for(;0<W;){var le=W-1>>>1,D=z[le];if(0<s(D,V))z[le]=V,z[W]=D,W=le;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var V=z[0],W=z.pop();if(W!==V){z[0]=W;e:for(var le=0,D=z.length,P=D>>>1;le<P;){var $=2*(le+1)-1,L=z[$],ae=$+1,re=z[ae];if(0>s(L,W))ae<D&&0>s(re,L)?(z[le]=re,z[ae]=W,le=ae):(z[le]=L,z[$]=W,le=$);else if(ae<D&&0>s(re,W))z[le]=re,z[ae]=W,le=ae;else break e}}return V}function s(z,V){var W=z.sortIndex-V.sortIndex;return W!==0?W:z.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],h=[],p=1,m=null,b=3,x=!1,E=!1,N=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(z){for(var V=n(h);V!==null;){if(V.callback===null)r(h);else if(V.startTime<=z)r(h),V.sortIndex=V.expirationTime,t(d,V);else break;V=n(h)}}function M(z){if(N=!1,R(z),!E)if(n(d)!==null)E=!0,_||(_=!0,X());else{var V=n(h);V!==null&&q(M,V.startTime-z)}}var _=!1,O=-1,j=5,H=-1;function B(){return C?!0:!(e.unstable_now()-H<j)}function K(){if(C=!1,_){var z=e.unstable_now();H=z;var V=!0;try{e:{E=!1,N&&(N=!1,k(O),O=-1),x=!0;var W=b;try{t:{for(R(z),m=n(d);m!==null&&!(m.expirationTime>z&&B());){var le=m.callback;if(typeof le=="function"){m.callback=null,b=m.priorityLevel;var D=le(m.expirationTime<=z);if(z=e.unstable_now(),typeof D=="function"){m.callback=D,R(z),V=!0;break t}m===n(d)&&r(d),R(z)}else r(d);m=n(d)}if(m!==null)V=!0;else{var P=n(h);P!==null&&q(M,P.startTime-z),V=!1}}break e}finally{m=null,b=W,x=!1}V=void 0}}finally{V?X():_=!1}}}var X;if(typeof A=="function")X=function(){A(K)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,te=Z.port2;Z.port1.onmessage=K,X=function(){te.postMessage(null)}}else X=function(){S(K,0)};function q(z,V){O=S(function(){z(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(z){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var W=b;b=V;try{return z()}finally{b=W}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,V){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var W=b;b=z;try{return V()}finally{b=W}},e.unstable_scheduleCallback=function(z,V,W){var le=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?le+W:le):W=le,z){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=W+D,z={id:p++,callback:V,priorityLevel:z,startTime:W,expirationTime:D,sortIndex:-1},W>le?(z.sortIndex=W,t(h,z),n(d)===null&&z===n(h)&&(N?(k(O),O=-1):N=!0,q(M,W-le))):(z.sortIndex=D,t(d,z),E||x||(E=!0,_||(_=!0,X()))),z},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(z){var V=b;return function(){var W=b;b=V;try{return z.apply(this,arguments)}finally{b=W}}}})(zg)),zg}var IS;function KM(){return IS||(IS=1,Bg.exports=GM()),Bg.exports}var Ug={exports:{}},nr={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var OS;function XM(){if(OS)return nr;OS=1;var e=bd();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(d,h,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:d,containerInfo:h,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,nr.createPortal=function(d,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return a(d,h,null,p)},nr.flushSync=function(d){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=h,r.p=p,r.d.f()}},nr.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},nr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},nr.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var p=h.as,m=u(p,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:x}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:b,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},nr.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=u(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},nr.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,m=u(p,h.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},nr.preloadModule=function(d,h){if(typeof d=="string")if(h){var p=u(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},nr.requestFormReset=function(d){r.d.r(d)},nr.unstable_batchedUpdates=function(d,h){return d(h)},nr.useFormState=function(d,h,p){return l.H.useFormState(d,h,p)},nr.useFormStatus=function(){return l.H.useHostTransitionStatus()},nr.version="19.2.7",nr}var MS;function Wk(){if(MS)return Ug.exports;MS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ug.exports=XM(),Ug.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var LS;function WM(){if(LS)return uc;LS=1;var e=KM(),t=bd(),n=Wk();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function d(i){if(a(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,g=o;;){var v=c.return;if(v===null)break;var T=v.alternate;if(T===null){if(g=v.return,g!==null){c=g;continue}break}if(v.child===T.child){for(T=v.child;T;){if(T===c)return d(v),i;if(T===g)return d(v),o;T=T.sibling}throw Error(r(188))}if(c.return!==g.return)c=v,g=T;else{for(var I=!1,U=v.child;U;){if(U===c){I=!0,c=v,g=T;break}if(U===g){I=!0,g=v,c=T;break}U=U.sibling}if(!I){for(U=T.child;U;){if(U===c){I=!0,c=T,g=v;break}if(U===g){I=!0,g=T,c=v;break}U=U.sibling}if(!I)throw Error(r(189))}}if(c.alternate!==g)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:o}function p(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=p(i),o!==null)return o;i=i.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function X(i){return i===null||typeof i!="object"?null:(i=K&&i[K]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Symbol.for("react.client.reference");function te(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Z?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case N:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case M:return"Suspense";case _:return"SuspenseList";case H:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case E:return"Portal";case A:return i.displayName||"Context";case k:return(i._context.displayName||"Context")+".Consumer";case R:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case O:return o=i.displayName||null,o!==null?o:te(i.type)||"Memo";case j:o=i._payload,i=i._init;try{return te(i(o))}catch{}}return null}var q=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},le=[],D=-1;function P(i){return{current:i}}function $(i){0>D||(i.current=le[D],le[D]=null,D--)}function L(i,o){D++,le[D]=i.current,i.current=o}var ae=P(null),re=P(null),ce=P(null),de=P(null);function fe(i,o){switch(L(ce,o),L(re,i),L(ae,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?XT(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=XT(o),i=WT(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(ae),L(ae,i)}function Se(){$(ae),$(re),$(ce)}function He(i){i.memoizedState!==null&&L(de,i);var o=ae.current,c=WT(o,i.type);o!==c&&(L(re,i),L(ae,c))}function Me(i){re.current===i&&($(ae),$(re)),de.current===i&&($(de),sc._currentValue=W)}var Ee,Oe;function Be(i){if(Ee===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Ee=o&&o[1]||"",Oe=-1<c.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Ee+i+Oe}var Ke=!1;function $e(i,o){if(!i||Ke)return"";Ke=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(Ce){var ye=Ce}Reflect.construct(i,[],Re)}else{try{Re.call()}catch(Ce){ye=Ce}i.call(Re.prototype)}}else{try{throw Error()}catch(Ce){ye=Ce}(Re=i())&&typeof Re.catch=="function"&&Re.catch(function(){})}}catch(Ce){if(Ce&&ye&&typeof Ce.stack=="string")return[Ce.stack,ye.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=g.DetermineComponentFrameRoot(),I=T[0],U=T[1];if(I&&U){var se=I.split(`
45
- `),be=U.split(`
46
- `);for(v=g=0;g<se.length&&!se[g].includes("DetermineComponentFrameRoot");)g++;for(;v<be.length&&!be[v].includes("DetermineComponentFrameRoot");)v++;if(g===se.length||v===be.length)for(g=se.length-1,v=be.length-1;1<=g&&0<=v&&se[g]!==be[v];)v--;for(;1<=g&&0<=v;g--,v--)if(se[g]!==be[v]){if(g!==1||v!==1)do if(g--,v--,0>v||se[g]!==be[v]){var Ne=`
47
- `+se[g].replace(" at new "," at ");return i.displayName&&Ne.includes("<anonymous>")&&(Ne=Ne.replace("<anonymous>",i.displayName)),Ne}while(1<=g&&0<=v);break}}}finally{Ke=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Be(c):""}function De(i,o){switch(i.tag){case 26:case 27:case 5:return Be(i.type);case 16:return Be("Lazy");case 13:return i.child!==o&&o!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return $e(i.type,!1);case 11:return $e(i.type.render,!1);case 1:return $e(i.type,!0);case 31:return Be("Activity");default:return""}}function ke(i){try{var o="",c=null;do o+=De(i,c),c=i,i=i.return;while(i);return o}catch(g){return`
48
- Error generating stack: `+g.message+`
49
- `+g.stack}}var ve=Object.prototype.hasOwnProperty,Ie=e.unstable_scheduleCallback,je=e.unstable_cancelCallback,ee=e.unstable_shouldYield,me=e.unstable_requestPaint,oe=e.unstable_now,ie=e.unstable_getCurrentPriorityLevel,G=e.unstable_ImmediatePriority,F=e.unstable_UserBlockingPriority,J=e.unstable_NormalPriority,Te=e.unstable_LowPriority,_e=e.unstable_IdlePriority,Ve=e.log,ot=e.unstable_setDisableYieldValue,tt=null,dt=null;function ut(i){if(typeof Ve=="function"&&ot(i),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(tt,i)}catch{}}var qe=Math.clz32?Math.clz32:lt,Rt=Math.log,jt=Math.LN2;function lt(i){return i>>>=0,i===0?32:31-(Rt(i)/jt|0)|0}var Lt=256,Zt=262144,$t=4194304;function Jt(i){var o=i&42;if(o!==0)return o;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Xe(i,o,c){var g=i.pendingLanes;if(g===0)return 0;var v=0,T=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var U=g&134217727;return U!==0?(g=U&~T,g!==0?v=Jt(g):(I&=U,I!==0?v=Jt(I):c||(c=U&~i,c!==0&&(v=Jt(c))))):(U=g&~T,U!==0?v=Jt(U):I!==0?v=Jt(I):c||(c=g&~i,c!==0&&(v=Jt(c)))),v===0?0:o!==0&&o!==v&&(o&T)===0&&(T=v&-v,c=o&-o,T>=c||T===32&&(c&4194048)!==0)?o:v}function yt(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Ht(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 en(){var i=$t;return $t<<=1,($t&62914560)===0&&($t=4194304),i}function Kn(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function vt(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ln(i,o,c,g,v,T){var I=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var U=i.entanglements,se=i.expirationTimes,be=i.hiddenUpdates;for(c=I&~c;0<c;){var Ne=31-qe(c),Re=1<<Ne;U[Ne]=0,se[Ne]=-1;var ye=be[Ne];if(ye!==null)for(be[Ne]=null,Ne=0;Ne<ye.length;Ne++){var Ce=ye[Ne];Ce!==null&&(Ce.lane&=-536870913)}c&=~Re}g!==0&&yr(i,g,0),T!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=T&~(I&~o))}function yr(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var g=31-qe(o);i.entangledLanes|=o,i.entanglements[g]=i.entanglements[g]|1073741824|c&261930}function bn(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var g=31-qe(c),v=1<<g;v&o|i[g]&o&&(i[g]|=o),c&=~v}}function Cn(i,o){var c=o&-o;return c=(c&42)!==0?1:ht(c),(c&(i.suspendedLanes|o))!==0?0:c}function ht(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function It(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function yn(){var i=V.p;return i!==0?i:(i=window.event,i===void 0?32:yS(i.type))}function Un(i,o){var c=V.p;try{return V.p=i,o()}finally{V.p=c}}var jn=Math.random().toString(36).slice(2),tn="__reactFiber$"+jn,Xn="__reactProps$"+jn,Rs="__reactContainer$"+jn,xu="__reactEvents$"+jn,Dd="__reactListeners$"+jn,OI="__reactHandles$"+jn,jv="__reactResources$"+jn,yu="__reactMarker$"+jn;function Np(i){delete i[tn],delete i[Xn],delete i[xu],delete i[Dd],delete i[OI]}function $o(i){var o=i[tn];if(o)return o;for(var c=i.parentNode;c;){if(o=c[Rs]||c[tn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=rS(i);i!==null;){if(c=i[tn])return c;i=rS(i)}return o}i=c,c=i.parentNode}return null}function Vo(i){if(i=i[tn]||i[Rs]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function vu(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function qo(i){var o=i[jv];return o||(o=i[jv]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Hn(i){i[yu]=!0}var Pv=new Set,Bv={};function Da(i,o){Yo(i,o),Yo(i+"Capture",o)}function Yo(i,o){for(Bv[i]=o,i=0;i<o.length;i++)Pv.add(o[i])}var MI=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]*$"),zv={},Uv={};function LI(i){return ve.call(Uv,i)?!0:ve.call(zv,i)?!1:MI.test(i)?Uv[i]=!0:(zv[i]=!0,!1)}function jd(i,o,c){if(LI(o))if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+c)}}function Pd(i,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+c)}}function Zs(i,o,c,g){if(g===null)i.removeAttribute(c);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(o,c,""+g)}}function Xr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Hv(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function DI(i,o,c){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var v=g.get,T=g.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return v.call(this)},set:function(I){c=""+I,T.call(this,I)}}),Object.defineProperty(i,o,{enumerable:g.enumerable}),{getValue:function(){return c},setValue:function(I){c=""+I},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Ap(i){if(!i._valueTracker){var o=Hv(i)?"checked":"value";i._valueTracker=DI(i,o,""+i[o])}}function Fv(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),g="";return i&&(g=Hv(i)?i.checked?"true":"false":i.value),i=g,i!==c?(o.setValue(i),!0):!1}function Bd(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var jI=/[\n"\\]/g;function Wr(i){return i.replace(jI,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function _p(i,o,c,g,v,T,I,U){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),o!=null?I==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Xr(o)):i.value!==""+Xr(o)&&(i.value=""+Xr(o)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),o!=null?Rp(i,I,Xr(o)):c!=null?Rp(i,I,Xr(c)):g!=null&&i.removeAttribute("value"),v==null&&T!=null&&(i.defaultChecked=!!T),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?i.name=""+Xr(U):i.removeAttribute("name")}function $v(i,o,c,g,v,T,I,U){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(i.type=T),o!=null||c!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){Ap(i);return}c=c!=null?""+Xr(c):"",o=o!=null?""+Xr(o):c,U||o===i.value||(i.value=o),i.defaultValue=o}g=g??v,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=U?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),Ap(i)}function Rp(i,o,c){o==="number"&&Bd(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function Go(i,o,c,g){if(i=i.options,o){o={};for(var v=0;v<c.length;v++)o["$"+c[v]]=!0;for(c=0;c<i.length;c++)v=o.hasOwnProperty("$"+i[c].value),i[c].selected!==v&&(i[c].selected=v),v&&g&&(i[c].defaultSelected=!0)}else{for(c=""+Xr(c),o=null,v=0;v<i.length;v++){if(i[v].value===c){i[v].selected=!0,g&&(i[v].defaultSelected=!0);return}o!==null||i[v].disabled||(o=i[v])}o!==null&&(o.selected=!0)}}function Vv(i,o,c){if(o!=null&&(o=""+Xr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+Xr(c):""}function qv(i,o,c,g){if(o==null){if(g!=null){if(c!=null)throw Error(r(92));if(q(g)){if(1<g.length)throw Error(r(93));g=g[0]}c=g}c==null&&(c=""),o=c}c=Xr(o),i.defaultValue=c,g=i.textContent,g===c&&g!==""&&g!==null&&(i.value=g),Ap(i)}function Ko(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var PI=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 Yv(i,o,c){var g=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?g?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":g?i.setProperty(o,c):typeof c!="number"||c===0||PI.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function Gv(i,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,c!=null){for(var g in c)!c.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var v in o)g=o[v],o.hasOwnProperty(v)&&c[v]!==g&&Yv(i,v,g)}else for(var T in o)o.hasOwnProperty(T)&&Yv(i,T,o[T])}function Ip(i){if(i.indexOf("-")===-1)return!1;switch(i){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 BI=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"]]),zI=/^[\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 zd(i){return zI.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Js(){}var Op=null;function Mp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Xo=null,Wo=null;function Kv(i){var o=Vo(i);if(o&&(i=o.stateNode)){var c=i[Xn]||null;e:switch(i=o.stateNode,o.type){case"input":if(_p(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Wr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var g=c[o];if(g!==i&&g.form===i.form){var v=g[Xn]||null;if(!v)throw Error(r(90));_p(g,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(o=0;o<c.length;o++)g=c[o],g.form===i.form&&Fv(g)}break e;case"textarea":Vv(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Go(i,!!c.multiple,o,!1)}}}var Lp=!1;function Xv(i,o,c){if(Lp)return i(o,c);Lp=!0;try{var g=i(o);return g}finally{if(Lp=!1,(Xo!==null||Wo!==null)&&(Nf(),Xo&&(o=Xo,i=Wo,Wo=Xo=null,Kv(o),i)))for(o=0;o<i.length;o++)Kv(i[o])}}function Eu(i,o){var c=i.stateNode;if(c===null)return null;var g=c[Xn]||null;if(g===null)return null;c=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var ei=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dp=!1;if(ei)try{var Tu={};Object.defineProperty(Tu,"passive",{get:function(){Dp=!0}}),window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{Dp=!1}var Pi=null,jp=null,Ud=null;function Wv(){if(Ud)return Ud;var i,o=jp,c=o.length,g,v="value"in Pi?Pi.value:Pi.textContent,T=v.length;for(i=0;i<c&&o[i]===v[i];i++);var I=c-i;for(g=1;g<=I&&o[c-g]===v[T-g];g++);return Ud=v.slice(i,1<g?1-g:void 0)}function Hd(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Fd(){return!0}function Qv(){return!1}function vr(i){function o(c,g,v,T,I){this._reactName=c,this._targetInst=v,this.type=g,this.nativeEvent=T,this.target=I,this.currentTarget=null;for(var U in i)i.hasOwnProperty(U)&&(c=i[U],this[U]=c?c(T):T[U]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Fd:Qv,this.isPropagationStopped=Qv,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Fd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Fd)},persist:function(){},isPersistent:Fd}),o}var ja={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$d=vr(ja),Su=m({},ja,{view:0,detail:0}),UI=vr(Su),Pp,Bp,Cu,Vd=m({},Su,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Up,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Cu&&(Cu&&i.type==="mousemove"?(Pp=i.screenX-Cu.screenX,Bp=i.screenY-Cu.screenY):Bp=Pp=0,Cu=i),Pp)},movementY:function(i){return"movementY"in i?i.movementY:Bp}}),Zv=vr(Vd),HI=m({},Vd,{dataTransfer:0}),FI=vr(HI),$I=m({},Su,{relatedTarget:0}),zp=vr($I),VI=m({},ja,{animationName:0,elapsedTime:0,pseudoElement:0}),qI=vr(VI),YI=m({},ja,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),GI=vr(YI),KI=m({},ja,{data:0}),Jv=vr(KI),XI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WI={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"},QI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZI(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=QI[i])?!!o[i]:!1}function Up(){return ZI}var JI=m({},Su,{key:function(i){if(i.key){var o=XI[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Hd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?WI[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Up,charCode:function(i){return i.type==="keypress"?Hd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Hd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),eO=vr(JI),tO=m({},Vd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eE=vr(tO),nO=m({},Su,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Up}),rO=vr(nO),sO=m({},ja,{propertyName:0,elapsedTime:0,pseudoElement:0}),iO=vr(sO),aO=m({},Vd,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),oO=vr(aO),lO=m({},ja,{newState:0,oldState:0}),uO=vr(lO),cO=[9,13,27,32],Hp=ei&&"CompositionEvent"in window,wu=null;ei&&"documentMode"in document&&(wu=document.documentMode);var dO=ei&&"TextEvent"in window&&!wu,tE=ei&&(!Hp||wu&&8<wu&&11>=wu),nE=" ",rE=!1;function sE(i,o){switch(i){case"keyup":return cO.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iE(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Qo=!1;function fO(i,o){switch(i){case"compositionend":return iE(o);case"keypress":return o.which!==32?null:(rE=!0,nE);case"textInput":return i=o.data,i===nE&&rE?null:i;default:return null}}function hO(i,o){if(Qo)return i==="compositionend"||!Hp&&sE(i,o)?(i=Wv(),Ud=jp=Pi=null,Qo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return tE&&o.locale!=="ko"?null:o.data;default:return null}}var mO={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 aE(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!mO[i.type]:o==="textarea"}function oE(i,o,c,g){Xo?Wo?Wo.push(g):Wo=[g]:Xo=g,o=Lf(o,"onChange"),0<o.length&&(c=new $d("onChange","change",null,c,g),i.push({event:c,listeners:o}))}var ku=null,Nu=null;function pO(i){$T(i,0)}function qd(i){var o=vu(i);if(Fv(o))return i}function lE(i,o){if(i==="change")return o}var uE=!1;if(ei){var Fp;if(ei){var $p="oninput"in document;if(!$p){var cE=document.createElement("div");cE.setAttribute("oninput","return;"),$p=typeof cE.oninput=="function"}Fp=$p}else Fp=!1;uE=Fp&&(!document.documentMode||9<document.documentMode)}function dE(){ku&&(ku.detachEvent("onpropertychange",fE),Nu=ku=null)}function fE(i){if(i.propertyName==="value"&&qd(Nu)){var o=[];oE(o,Nu,i,Mp(i)),Xv(pO,o)}}function gO(i,o,c){i==="focusin"?(dE(),ku=o,Nu=c,ku.attachEvent("onpropertychange",fE)):i==="focusout"&&dE()}function bO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return qd(Nu)}function xO(i,o){if(i==="click")return qd(o)}function yO(i,o){if(i==="input"||i==="change")return qd(o)}function vO(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Dr=typeof Object.is=="function"?Object.is:vO;function Au(i,o){if(Dr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),g=Object.keys(o);if(c.length!==g.length)return!1;for(g=0;g<c.length;g++){var v=c[g];if(!ve.call(o,v)||!Dr(i[v],o[v]))return!1}return!0}function hE(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function mE(i,o){var c=hE(i);i=0;for(var g;c;){if(c.nodeType===3){if(g=i+c.textContent.length,i<=o&&g>=o)return{node:c,offset:o-i};i=g}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=hE(c)}}function pE(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?pE(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function gE(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=Bd(i.document);o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)i=o.contentWindow;else break;o=Bd(i.document)}return o}function Vp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var EO=ei&&"documentMode"in document&&11>=document.documentMode,Zo=null,qp=null,_u=null,Yp=!1;function bE(i,o,c){var g=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Yp||Zo==null||Zo!==Bd(g)||(g=Zo,"selectionStart"in g&&Vp(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),_u&&Au(_u,g)||(_u=g,g=Lf(qp,"onSelect"),0<g.length&&(o=new $d("onSelect","select",null,o,c),i.push({event:o,listeners:g}),o.target=Zo)))}function Pa(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var Jo={animationend:Pa("Animation","AnimationEnd"),animationiteration:Pa("Animation","AnimationIteration"),animationstart:Pa("Animation","AnimationStart"),transitionrun:Pa("Transition","TransitionRun"),transitionstart:Pa("Transition","TransitionStart"),transitioncancel:Pa("Transition","TransitionCancel"),transitionend:Pa("Transition","TransitionEnd")},Gp={},xE={};ei&&(xE=document.createElement("div").style,"AnimationEvent"in window||(delete Jo.animationend.animation,delete Jo.animationiteration.animation,delete Jo.animationstart.animation),"TransitionEvent"in window||delete Jo.transitionend.transition);function Ba(i){if(Gp[i])return Gp[i];if(!Jo[i])return i;var o=Jo[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in xE)return Gp[i]=o[c];return i}var yE=Ba("animationend"),vE=Ba("animationiteration"),EE=Ba("animationstart"),TO=Ba("transitionrun"),SO=Ba("transitionstart"),CO=Ba("transitioncancel"),TE=Ba("transitionend"),SE=new Map,Kp="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(" ");Kp.push("scrollEnd");function gs(i,o){SE.set(i,o),Da(o,[i])}var Yd=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Qr=[],el=0,Xp=0;function Gd(){for(var i=el,o=Xp=el=0;o<i;){var c=Qr[o];Qr[o++]=null;var g=Qr[o];Qr[o++]=null;var v=Qr[o];Qr[o++]=null;var T=Qr[o];if(Qr[o++]=null,g!==null&&v!==null){var I=g.pending;I===null?v.next=v:(v.next=I.next,I.next=v),g.pending=v}T!==0&&CE(c,v,T)}}function Kd(i,o,c,g){Qr[el++]=i,Qr[el++]=o,Qr[el++]=c,Qr[el++]=g,Xp|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Wp(i,o,c,g){return Kd(i,o,c,g),Xd(i)}function za(i,o){return Kd(i,null,null,o),Xd(i)}function CE(i,o,c){i.lanes|=c;var g=i.alternate;g!==null&&(g.lanes|=c);for(var v=!1,T=i.return;T!==null;)T.childLanes|=c,g=T.alternate,g!==null&&(g.childLanes|=c),T.tag===22&&(i=T.stateNode,i===null||i._visibility&1||(v=!0)),i=T,T=T.return;return i.tag===3?(T=i.stateNode,v&&o!==null&&(v=31-qe(c),i=T.hiddenUpdates,g=i[v],g===null?i[v]=[o]:g.push(o),o.lane=c|536870912),T):null}function Xd(i){if(50<Qu)throw Qu=0,ig=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var tl={};function wO(i,o,c,g){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(i,o,c,g){return new wO(i,o,c,g)}function Qp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ti(i,o){var c=i.alternate;return c===null?(c=jr(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function wE(i,o){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,o=c.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Wd(i,o,c,g,v,T){var I=0;if(g=i,typeof i=="function")Qp(i)&&(I=1);else if(typeof i=="string")I=RM(i,c,ae.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case H:return i=jr(31,c,o,v),i.elementType=H,i.lanes=T,i;case N:return Ua(c.children,v,T,o);case C:I=8,v|=24;break;case S:return i=jr(12,c,o,v|2),i.elementType=S,i.lanes=T,i;case M:return i=jr(13,c,o,v),i.elementType=M,i.lanes=T,i;case _:return i=jr(19,c,o,v),i.elementType=_,i.lanes=T,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case A:I=10;break e;case k:I=9;break e;case R:I=11;break e;case O:I=14;break e;case j:I=16,g=null;break e}I=29,c=Error(r(130,i===null?"null":typeof i,"")),g=null}return o=jr(I,c,o,v),o.elementType=i,o.type=g,o.lanes=T,o}function Ua(i,o,c,g){return i=jr(7,i,g,o),i.lanes=c,i}function Zp(i,o,c){return i=jr(6,i,null,o),i.lanes=c,i}function kE(i){var o=jr(18,null,null,0);return o.stateNode=i,o}function Jp(i,o,c){return o=jr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var NE=new WeakMap;function Zr(i,o){if(typeof i=="object"&&i!==null){var c=NE.get(i);return c!==void 0?c:(o={value:i,source:o,stack:ke(o)},NE.set(i,o),o)}return{value:i,source:o,stack:ke(o)}}var nl=[],rl=0,Qd=null,Ru=0,Jr=[],es=0,Bi=null,Is=1,Os="";function ni(i,o){nl[rl++]=Ru,nl[rl++]=Qd,Qd=i,Ru=o}function AE(i,o,c){Jr[es++]=Is,Jr[es++]=Os,Jr[es++]=Bi,Bi=i;var g=Is;i=Os;var v=32-qe(g)-1;g&=~(1<<v),c+=1;var T=32-qe(o)+v;if(30<T){var I=v-v%5;T=(g&(1<<I)-1).toString(32),g>>=I,v-=I,Is=1<<32-qe(o)+v|c<<v|g,Os=T+i}else Is=1<<T|c<<v|g,Os=i}function e0(i){i.return!==null&&(ni(i,1),AE(i,1,0))}function t0(i){for(;i===Qd;)Qd=nl[--rl],nl[rl]=null,Ru=nl[--rl],nl[rl]=null;for(;i===Bi;)Bi=Jr[--es],Jr[es]=null,Os=Jr[--es],Jr[es]=null,Is=Jr[--es],Jr[es]=null}function _E(i,o){Jr[es++]=Is,Jr[es++]=Os,Jr[es++]=Bi,Is=o.id,Os=o.overflow,Bi=i}var Wn=null,un=null,Dt=!1,zi=null,ts=!1,n0=Error(r(519));function Ui(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Iu(Zr(o,i)),n0}function RE(i){var o=i.stateNode,c=i.type,g=i.memoizedProps;switch(o[tn]=i,o[Xn]=g,c){case"dialog":Nt("cancel",o),Nt("close",o);break;case"iframe":case"object":case"embed":Nt("load",o);break;case"video":case"audio":for(c=0;c<Ju.length;c++)Nt(Ju[c],o);break;case"source":Nt("error",o);break;case"img":case"image":case"link":Nt("error",o),Nt("load",o);break;case"details":Nt("toggle",o);break;case"input":Nt("invalid",o),$v(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Nt("invalid",o);break;case"textarea":Nt("invalid",o),qv(o,g.value,g.defaultValue,g.children)}c=g.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||g.suppressHydrationWarning===!0||GT(o.textContent,c)?(g.popover!=null&&(Nt("beforetoggle",o),Nt("toggle",o)),g.onScroll!=null&&Nt("scroll",o),g.onScrollEnd!=null&&Nt("scrollend",o),g.onClick!=null&&(o.onclick=Js),o=!0):o=!1,o||Ui(i,!0)}function IE(i){for(Wn=i.return;Wn;)switch(Wn.tag){case 5:case 31:case 13:ts=!1;return;case 27:case 3:ts=!0;return;default:Wn=Wn.return}}function sl(i){if(i!==Wn)return!1;if(!Dt)return IE(i),Dt=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||vg(i.type,i.memoizedProps)),c=!c),c&&un&&Ui(i),IE(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));un=nS(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));un=nS(i)}else o===27?(o=un,ea(i.type)?(i=wg,wg=null,un=i):un=o):un=Wn?rs(i.stateNode.nextSibling):null;return!0}function Ha(){un=Wn=null,Dt=!1}function r0(){var i=zi;return i!==null&&(Cr===null?Cr=i:Cr.push.apply(Cr,i),zi=null),i}function Iu(i){zi===null?zi=[i]:zi.push(i)}var s0=P(null),Fa=null,ri=null;function Hi(i,o,c){L(s0,o._currentValue),o._currentValue=c}function si(i){i._currentValue=s0.current,$(s0)}function i0(i,o,c){for(;i!==null;){var g=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),i===c)break;i=i.return}}function a0(i,o,c,g){var v=i.child;for(v!==null&&(v.return=i);v!==null;){var T=v.dependencies;if(T!==null){var I=v.child;T=T.firstContext;e:for(;T!==null;){var U=T;T=v;for(var se=0;se<o.length;se++)if(U.context===o[se]){T.lanes|=c,U=T.alternate,U!==null&&(U.lanes|=c),i0(T.return,c,i),g||(I=null);break e}T=U.next}}else if(v.tag===18){if(I=v.return,I===null)throw Error(r(341));I.lanes|=c,T=I.alternate,T!==null&&(T.lanes|=c),i0(I,c,i),I=null}else I=v.child;if(I!==null)I.return=v;else for(I=v;I!==null;){if(I===i){I=null;break}if(v=I.sibling,v!==null){v.return=I.return,I=v;break}I=I.return}v=I}}function il(i,o,c,g){i=null;for(var v=o,T=!1;v!==null;){if(!T){if((v.flags&524288)!==0)T=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var I=v.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var U=v.type;Dr(v.pendingProps.value,I.value)||(i!==null?i.push(U):i=[U])}}else if(v===de.current){if(I=v.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(sc):i=[sc])}v=v.return}i!==null&&a0(o,i,c,g),o.flags|=262144}function Zd(i){for(i=i.firstContext;i!==null;){if(!Dr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function $a(i){Fa=i,ri=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Qn(i){return OE(Fa,i)}function Jd(i,o){return Fa===null&&$a(i),OE(i,o)}function OE(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},ri===null){if(i===null)throw Error(r(308));ri=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else ri=ri.next=o;return c}var kO=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(c,g){i.push(g)}};this.abort=function(){o.aborted=!0,i.forEach(function(c){return c()})}},NO=e.unstable_scheduleCallback,AO=e.unstable_NormalPriority,_n={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function o0(){return{controller:new kO,data:new Map,refCount:0}}function Ou(i){i.refCount--,i.refCount===0&&NO(AO,function(){i.controller.abort()})}var Mu=null,l0=0,al=0,ol=null;function _O(i,o){if(Mu===null){var c=Mu=[];l0=0,al=dg(),ol={status:"pending",value:void 0,then:function(g){c.push(g)}}}return l0++,o.then(ME,ME),o}function ME(){if(--l0===0&&Mu!==null){ol!==null&&(ol.status="fulfilled");var i=Mu;Mu=null,al=0,ol=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function RO(i,o){var c=[],g={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return i.then(function(){g.status="fulfilled",g.value=o;for(var v=0;v<c.length;v++)(0,c[v])(o)},function(v){for(g.status="rejected",g.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),g}var LE=z.S;z.S=function(i,o){bT=oe(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&_O(i,o),LE!==null&&LE(i,o)};var Va=P(null);function u0(){var i=Va.current;return i!==null?i:nn.pooledCache}function ef(i,o){o===null?L(Va,Va.current):L(Va,o.pool)}function DE(){var i=u0();return i===null?null:{parent:_n._currentValue,pool:i}}var ll=Error(r(460)),c0=Error(r(474)),tf=Error(r(542)),nf={then:function(){}};function jE(i){return i=i.status,i==="fulfilled"||i==="rejected"}function PE(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Js,Js),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,zE(i),i;default:if(typeof o.status=="string")o.then(Js,Js);else{if(i=nn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(g){if(o.status==="pending"){var v=o;v.status="fulfilled",v.value=g}},function(g){if(o.status==="pending"){var v=o;v.status="rejected",v.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,zE(i),i}throw Ya=o,ll}}function qa(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ya=c,ll):c}}var Ya=null;function BE(){if(Ya===null)throw Error(r(459));var i=Ya;return Ya=null,i}function zE(i){if(i===ll||i===tf)throw Error(r(483))}var ul=null,Lu=0;function rf(i){var o=Lu;return Lu+=1,ul===null&&(ul=[]),PE(ul,i,o)}function Du(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function sf(i,o){throw o.$$typeof===b?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function UE(i){function o(he,ue){if(i){var ge=he.deletions;ge===null?(he.deletions=[ue],he.flags|=16):ge.push(ue)}}function c(he,ue){if(!i)return null;for(;ue!==null;)o(he,ue),ue=ue.sibling;return null}function g(he){for(var ue=new Map;he!==null;)he.key!==null?ue.set(he.key,he):ue.set(he.index,he),he=he.sibling;return ue}function v(he,ue){return he=ti(he,ue),he.index=0,he.sibling=null,he}function T(he,ue,ge){return he.index=ge,i?(ge=he.alternate,ge!==null?(ge=ge.index,ge<ue?(he.flags|=67108866,ue):ge):(he.flags|=67108866,ue)):(he.flags|=1048576,ue)}function I(he){return i&&he.alternate===null&&(he.flags|=67108866),he}function U(he,ue,ge,Ae){return ue===null||ue.tag!==6?(ue=Zp(ge,he.mode,Ae),ue.return=he,ue):(ue=v(ue,ge),ue.return=he,ue)}function se(he,ue,ge,Ae){var st=ge.type;return st===N?Ne(he,ue,ge.props.children,Ae,ge.key):ue!==null&&(ue.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===j&&qa(st)===ue.type)?(ue=v(ue,ge.props),Du(ue,ge),ue.return=he,ue):(ue=Wd(ge.type,ge.key,ge.props,null,he.mode,Ae),Du(ue,ge),ue.return=he,ue)}function be(he,ue,ge,Ae){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ge.containerInfo||ue.stateNode.implementation!==ge.implementation?(ue=Jp(ge,he.mode,Ae),ue.return=he,ue):(ue=v(ue,ge.children||[]),ue.return=he,ue)}function Ne(he,ue,ge,Ae,st){return ue===null||ue.tag!==7?(ue=Ua(ge,he.mode,Ae,st),ue.return=he,ue):(ue=v(ue,ge),ue.return=he,ue)}function Re(he,ue,ge){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=Zp(""+ue,he.mode,ge),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return ge=Wd(ue.type,ue.key,ue.props,null,he.mode,ge),Du(ge,ue),ge.return=he,ge;case E:return ue=Jp(ue,he.mode,ge),ue.return=he,ue;case j:return ue=qa(ue),Re(he,ue,ge)}if(q(ue)||X(ue))return ue=Ua(ue,he.mode,ge,null),ue.return=he,ue;if(typeof ue.then=="function")return Re(he,rf(ue),ge);if(ue.$$typeof===A)return Re(he,Jd(he,ue),ge);sf(he,ue)}return null}function ye(he,ue,ge,Ae){var st=ue!==null?ue.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return st!==null?null:U(he,ue,""+ge,Ae);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return ge.key===st?se(he,ue,ge,Ae):null;case E:return ge.key===st?be(he,ue,ge,Ae):null;case j:return ge=qa(ge),ye(he,ue,ge,Ae)}if(q(ge)||X(ge))return st!==null?null:Ne(he,ue,ge,Ae,null);if(typeof ge.then=="function")return ye(he,ue,rf(ge),Ae);if(ge.$$typeof===A)return ye(he,ue,Jd(he,ge),Ae);sf(he,ge)}return null}function Ce(he,ue,ge,Ae,st){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return he=he.get(ge)||null,U(ue,he,""+Ae,st);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case x:return he=he.get(Ae.key===null?ge:Ae.key)||null,se(ue,he,Ae,st);case E:return he=he.get(Ae.key===null?ge:Ae.key)||null,be(ue,he,Ae,st);case j:return Ae=qa(Ae),Ce(he,ue,ge,Ae,st)}if(q(Ae)||X(Ae))return he=he.get(ge)||null,Ne(ue,he,Ae,st,null);if(typeof Ae.then=="function")return Ce(he,ue,ge,rf(Ae),st);if(Ae.$$typeof===A)return Ce(he,ue,ge,Jd(ue,Ae),st);sf(ue,Ae)}return null}function Ze(he,ue,ge,Ae){for(var st=null,zt=null,et=ue,xt=ue=0,Mt=null;et!==null&&xt<ge.length;xt++){et.index>xt?(Mt=et,et=null):Mt=et.sibling;var Ut=ye(he,et,ge[xt],Ae);if(Ut===null){et===null&&(et=Mt);break}i&&et&&Ut.alternate===null&&o(he,et),ue=T(Ut,ue,xt),zt===null?st=Ut:zt.sibling=Ut,zt=Ut,et=Mt}if(xt===ge.length)return c(he,et),Dt&&ni(he,xt),st;if(et===null){for(;xt<ge.length;xt++)et=Re(he,ge[xt],Ae),et!==null&&(ue=T(et,ue,xt),zt===null?st=et:zt.sibling=et,zt=et);return Dt&&ni(he,xt),st}for(et=g(et);xt<ge.length;xt++)Mt=Ce(et,he,xt,ge[xt],Ae),Mt!==null&&(i&&Mt.alternate!==null&&et.delete(Mt.key===null?xt:Mt.key),ue=T(Mt,ue,xt),zt===null?st=Mt:zt.sibling=Mt,zt=Mt);return i&&et.forEach(function(ia){return o(he,ia)}),Dt&&ni(he,xt),st}function at(he,ue,ge,Ae){if(ge==null)throw Error(r(151));for(var st=null,zt=null,et=ue,xt=ue=0,Mt=null,Ut=ge.next();et!==null&&!Ut.done;xt++,Ut=ge.next()){et.index>xt?(Mt=et,et=null):Mt=et.sibling;var ia=ye(he,et,Ut.value,Ae);if(ia===null){et===null&&(et=Mt);break}i&&et&&ia.alternate===null&&o(he,et),ue=T(ia,ue,xt),zt===null?st=ia:zt.sibling=ia,zt=ia,et=Mt}if(Ut.done)return c(he,et),Dt&&ni(he,xt),st;if(et===null){for(;!Ut.done;xt++,Ut=ge.next())Ut=Re(he,Ut.value,Ae),Ut!==null&&(ue=T(Ut,ue,xt),zt===null?st=Ut:zt.sibling=Ut,zt=Ut);return Dt&&ni(he,xt),st}for(et=g(et);!Ut.done;xt++,Ut=ge.next())Ut=Ce(et,he,xt,Ut.value,Ae),Ut!==null&&(i&&Ut.alternate!==null&&et.delete(Ut.key===null?xt:Ut.key),ue=T(Ut,ue,xt),zt===null?st=Ut:zt.sibling=Ut,zt=Ut);return i&&et.forEach(function(HM){return o(he,HM)}),Dt&&ni(he,xt),st}function Xt(he,ue,ge,Ae){if(typeof ge=="object"&&ge!==null&&ge.type===N&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:e:{for(var st=ge.key;ue!==null;){if(ue.key===st){if(st=ge.type,st===N){if(ue.tag===7){c(he,ue.sibling),Ae=v(ue,ge.props.children),Ae.return=he,he=Ae;break e}}else if(ue.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===j&&qa(st)===ue.type){c(he,ue.sibling),Ae=v(ue,ge.props),Du(Ae,ge),Ae.return=he,he=Ae;break e}c(he,ue);break}else o(he,ue);ue=ue.sibling}ge.type===N?(Ae=Ua(ge.props.children,he.mode,Ae,ge.key),Ae.return=he,he=Ae):(Ae=Wd(ge.type,ge.key,ge.props,null,he.mode,Ae),Du(Ae,ge),Ae.return=he,he=Ae)}return I(he);case E:e:{for(st=ge.key;ue!==null;){if(ue.key===st)if(ue.tag===4&&ue.stateNode.containerInfo===ge.containerInfo&&ue.stateNode.implementation===ge.implementation){c(he,ue.sibling),Ae=v(ue,ge.children||[]),Ae.return=he,he=Ae;break e}else{c(he,ue);break}else o(he,ue);ue=ue.sibling}Ae=Jp(ge,he.mode,Ae),Ae.return=he,he=Ae}return I(he);case j:return ge=qa(ge),Xt(he,ue,ge,Ae)}if(q(ge))return Ze(he,ue,ge,Ae);if(X(ge)){if(st=X(ge),typeof st!="function")throw Error(r(150));return ge=st.call(ge),at(he,ue,ge,Ae)}if(typeof ge.then=="function")return Xt(he,ue,rf(ge),Ae);if(ge.$$typeof===A)return Xt(he,ue,Jd(he,ge),Ae);sf(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,ue!==null&&ue.tag===6?(c(he,ue.sibling),Ae=v(ue,ge),Ae.return=he,he=Ae):(c(he,ue),Ae=Zp(ge,he.mode,Ae),Ae.return=he,he=Ae),I(he)):c(he,ue)}return function(he,ue,ge,Ae){try{Lu=0;var st=Xt(he,ue,ge,Ae);return ul=null,st}catch(et){if(et===ll||et===tf)throw et;var zt=jr(29,et,null,he.mode);return zt.lanes=Ae,zt.return=he,zt}finally{}}}var Ga=UE(!0),HE=UE(!1),Fi=!1;function d0(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function f0(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function $i(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Vi(i,o,c){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(Ft&2)!==0){var v=g.pending;return v===null?o.next=o:(o.next=v.next,v.next=o),g.pending=o,o=Xd(i),CE(i,null,c),o}return Kd(i,g,o,c),Xd(i)}function ju(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var g=o.lanes;g&=i.pendingLanes,c|=g,o.lanes=c,bn(i,c)}}function h0(i,o){var c=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,c===g)){var v=null,T=null;if(c=c.firstBaseUpdate,c!==null){do{var I={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};T===null?v=T=I:T=T.next=I,c=c.next}while(c!==null);T===null?v=T=o:T=T.next=o}else v=T=o;c={baseState:g.baseState,firstBaseUpdate:v,lastBaseUpdate:T,shared:g.shared,callbacks:g.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}var m0=!1;function Pu(){if(m0){var i=ol;if(i!==null)throw i}}function Bu(i,o,c,g){m0=!1;var v=i.updateQueue;Fi=!1;var T=v.firstBaseUpdate,I=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var se=U,be=se.next;se.next=null,I===null?T=be:I.next=be,I=se;var Ne=i.alternate;Ne!==null&&(Ne=Ne.updateQueue,U=Ne.lastBaseUpdate,U!==I&&(U===null?Ne.firstBaseUpdate=be:U.next=be,Ne.lastBaseUpdate=se))}if(T!==null){var Re=v.baseState;I=0,Ne=be=se=null,U=T;do{var ye=U.lane&-536870913,Ce=ye!==U.lane;if(Ce?(Ot&ye)===ye:(g&ye)===ye){ye!==0&&ye===al&&(m0=!0),Ne!==null&&(Ne=Ne.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ze=i,at=U;ye=o;var Xt=c;switch(at.tag){case 1:if(Ze=at.payload,typeof Ze=="function"){Re=Ze.call(Xt,Re,ye);break e}Re=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=at.payload,ye=typeof Ze=="function"?Ze.call(Xt,Re,ye):Ze,ye==null)break e;Re=m({},Re,ye);break e;case 2:Fi=!0}}ye=U.callback,ye!==null&&(i.flags|=64,Ce&&(i.flags|=8192),Ce=v.callbacks,Ce===null?v.callbacks=[ye]:Ce.push(ye))}else Ce={lane:ye,tag:U.tag,payload:U.payload,callback:U.callback,next:null},Ne===null?(be=Ne=Ce,se=Re):Ne=Ne.next=Ce,I|=ye;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;Ce=U,U=Ce.next,Ce.next=null,v.lastBaseUpdate=Ce,v.shared.pending=null}}while(!0);Ne===null&&(se=Re),v.baseState=se,v.firstBaseUpdate=be,v.lastBaseUpdate=Ne,T===null&&(v.shared.lanes=0),Xi|=I,i.lanes=I,i.memoizedState=Re}}function FE(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function $E(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)FE(c[i],o)}var cl=P(null),af=P(0);function VE(i,o){i=hi,L(af,i),L(cl,o),hi=i|o.baseLanes}function p0(){L(af,hi),L(cl,cl.current)}function g0(){hi=af.current,$(cl),$(af)}var Pr=P(null),ns=null;function qi(i){var o=i.alternate;L(wn,wn.current&1),L(Pr,i),ns===null&&(o===null||cl.current!==null||o.memoizedState!==null)&&(ns=i)}function b0(i){L(wn,wn.current),L(Pr,i),ns===null&&(ns=i)}function qE(i){i.tag===22?(L(wn,wn.current),L(Pr,i),ns===null&&(ns=i)):Yi()}function Yi(){L(wn,wn.current),L(Pr,Pr.current)}function Br(i){$(Pr),ns===i&&(ns=null),$(wn)}var wn=P(0);function of(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Sg(c)||Cg(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ii=0,bt=null,Gt=null,Rn=null,lf=!1,dl=!1,Ka=!1,uf=0,zu=0,fl=null,IO=0;function vn(){throw Error(r(321))}function x0(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!Dr(i[c],o[c]))return!1;return!0}function y0(i,o,c,g,v,T){return ii=T,bt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,z.H=i===null||i.memoizedState===null?A2:L0,Ka=!1,T=c(g,v),Ka=!1,dl&&(T=GE(o,c,g,v)),YE(i),T}function YE(i){z.H=Fu;var o=Gt!==null&&Gt.next!==null;if(ii=0,Rn=Gt=bt=null,lf=!1,zu=0,fl=null,o)throw Error(r(300));i===null||In||(i=i.dependencies,i!==null&&Zd(i)&&(In=!0))}function GE(i,o,c,g){bt=i;var v=0;do{if(dl&&(fl=null),zu=0,dl=!1,25<=v)throw Error(r(301));if(v+=1,Rn=Gt=null,i.updateQueue!=null){var T=i.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}z.H=_2,T=o(c,g)}while(dl);return T}function OO(){var i=z.H,o=i.useState()[0];return o=typeof o.then=="function"?Uu(o):o,i=i.useState()[0],(Gt!==null?Gt.memoizedState:null)!==i&&(bt.flags|=1024),o}function v0(){var i=uf!==0;return uf=0,i}function E0(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function T0(i){if(lf){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}lf=!1}ii=0,Rn=Gt=bt=null,dl=!1,zu=uf=0,fl=null}function cr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rn===null?bt.memoizedState=Rn=i:Rn=Rn.next=i,Rn}function kn(){if(Gt===null){var i=bt.alternate;i=i!==null?i.memoizedState:null}else i=Gt.next;var o=Rn===null?bt.memoizedState:Rn.next;if(o!==null)Rn=o,Gt=i;else{if(i===null)throw bt.alternate===null?Error(r(467)):Error(r(310));Gt=i,i={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Rn===null?bt.memoizedState=Rn=i:Rn=Rn.next=i}return Rn}function cf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Uu(i){var o=zu;return zu+=1,fl===null&&(fl=[]),i=PE(fl,i,o),o=bt,(Rn===null?o.memoizedState:Rn.next)===null&&(o=o.alternate,z.H=o===null||o.memoizedState===null?A2:L0),i}function df(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Uu(i);if(i.$$typeof===A)return Qn(i)}throw Error(r(438,String(i)))}function S0(i){var o=null,c=bt.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var g=bt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(v){return v.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=cf(),bt.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),g=0;g<i;g++)c[g]=B;return o.index++,c}function ai(i,o){return typeof o=="function"?o(i):o}function ff(i){var o=kn();return C0(o,Gt,i)}function C0(i,o,c){var g=i.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=c;var v=i.baseQueue,T=g.pending;if(T!==null){if(v!==null){var I=v.next;v.next=T.next,T.next=I}o.baseQueue=v=T,g.pending=null}if(T=i.baseState,v===null)i.memoizedState=T;else{o=v.next;var U=I=null,se=null,be=o,Ne=!1;do{var Re=be.lane&-536870913;if(Re!==be.lane?(Ot&Re)===Re:(ii&Re)===Re){var ye=be.revertLane;if(ye===0)se!==null&&(se=se.next={lane:0,revertLane:0,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),Re===al&&(Ne=!0);else if((ii&ye)===ye){be=be.next,ye===al&&(Ne=!0);continue}else Re={lane:0,revertLane:be.revertLane,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},se===null?(U=se=Re,I=T):se=se.next=Re,bt.lanes|=ye,Xi|=ye;Re=be.action,Ka&&c(T,Re),T=be.hasEagerState?be.eagerState:c(T,Re)}else ye={lane:Re,revertLane:be.revertLane,gesture:be.gesture,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},se===null?(U=se=ye,I=T):se=se.next=ye,bt.lanes|=Re,Xi|=Re;be=be.next}while(be!==null&&be!==o);if(se===null?I=T:se.next=U,!Dr(T,i.memoizedState)&&(In=!0,Ne&&(c=ol,c!==null)))throw c;i.memoizedState=T,i.baseState=I,i.baseQueue=se,g.lastRenderedState=T}return v===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function w0(i){var o=kn(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var g=c.dispatch,v=c.pending,T=o.memoizedState;if(v!==null){c.pending=null;var I=v=v.next;do T=i(T,I.action),I=I.next;while(I!==v);Dr(T,o.memoizedState)||(In=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),c.lastRenderedState=T}return[T,g]}function KE(i,o,c){var g=bt,v=kn(),T=Dt;if(T){if(c===void 0)throw Error(r(407));c=c()}else c=o();var I=!Dr((Gt||v).memoizedState,c);if(I&&(v.memoizedState=c,In=!0),v=v.queue,A0(QE.bind(null,g,v,i),[i]),v.getSnapshot!==o||I||Rn!==null&&Rn.memoizedState.tag&1){if(g.flags|=2048,hl(9,{destroy:void 0},WE.bind(null,g,v,c,o),null),nn===null)throw Error(r(349));T||(ii&127)!==0||XE(g,o,c)}return c}function XE(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=bt.updateQueue,o===null?(o=cf(),bt.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function WE(i,o,c,g){o.value=c,o.getSnapshot=g,ZE(o)&&JE(i)}function QE(i,o,c){return c(function(){ZE(o)&&JE(i)})}function ZE(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!Dr(i,c)}catch{return!0}}function JE(i){var o=za(i,2);o!==null&&wr(o,i,2)}function k0(i){var o=cr();if(typeof i=="function"){var c=i;if(i=c(),Ka){ut(!0);try{c()}finally{ut(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:i},o}function e2(i,o,c,g){return i.baseState=c,C0(i,Gt,typeof g=="function"?g:ai)}function MO(i,o,c,g,v){if(pf(i))throw Error(r(485));if(i=o.action,i!==null){var T={payload:v,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){T.listeners.push(I)}};z.T!==null?c(!0):T.isTransition=!1,g(T),c=o.pending,c===null?(T.next=o.pending=T,t2(o,T)):(T.next=c.next,o.pending=c.next=T)}}function t2(i,o){var c=o.action,g=o.payload,v=i.state;if(o.isTransition){var T=z.T,I={};z.T=I;try{var U=c(v,g),se=z.S;se!==null&&se(I,U),n2(i,o,U)}catch(be){N0(i,o,be)}finally{T!==null&&I.types!==null&&(T.types=I.types),z.T=T}}else try{T=c(v,g),n2(i,o,T)}catch(be){N0(i,o,be)}}function n2(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(g){r2(i,o,g)},function(g){return N0(i,o,g)}):r2(i,o,c)}function r2(i,o,c){o.status="fulfilled",o.value=c,s2(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,t2(i,c)))}function N0(i,o,c){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=c,s2(o),o=o.next;while(o!==g)}i.action=null}function s2(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function i2(i,o){return o}function a2(i,o){if(Dt){var c=nn.formState;if(c!==null){e:{var g=bt;if(Dt){if(un){t:{for(var v=un,T=ts;v.nodeType!==8;){if(!T){v=null;break t}if(v=rs(v.nextSibling),v===null){v=null;break t}}T=v.data,v=T==="F!"||T==="F"?v:null}if(v){un=rs(v.nextSibling),g=v.data==="F!";break e}}Ui(g)}g=!1}g&&(o=c[0])}}return c=cr(),c.memoizedState=c.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i2,lastRenderedState:o},c.queue=g,c=w2.bind(null,bt,g),g.dispatch=c,g=k0(!1),T=M0.bind(null,bt,!1,g.queue),g=cr(),v={state:o,dispatch:null,action:i,pending:null},g.queue=v,c=MO.bind(null,bt,v,T,c),v.dispatch=c,g.memoizedState=i,[o,c,!1]}function o2(i){var o=kn();return l2(o,Gt,i)}function l2(i,o,c){if(o=C0(i,o,i2)[0],i=ff(ai)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=Uu(o)}catch(I){throw I===ll?tf:I}else g=o;o=kn();var v=o.queue,T=v.dispatch;return c!==o.memoizedState&&(bt.flags|=2048,hl(9,{destroy:void 0},LO.bind(null,v,c),null)),[g,T,i]}function LO(i,o){i.action=o}function u2(i){var o=kn(),c=Gt;if(c!==null)return l2(o,c,i);kn(),o=o.memoizedState,c=kn();var g=c.queue.dispatch;return c.memoizedState=i,[o,g,!1]}function hl(i,o,c,g){return i={tag:i,create:c,deps:g,inst:o,next:null},o=bt.updateQueue,o===null&&(o=cf(),bt.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=i.next=i:(g=c.next,c.next=i,i.next=g,o.lastEffect=i),i}function c2(){return kn().memoizedState}function hf(i,o,c,g){var v=cr();bt.flags|=i,v.memoizedState=hl(1|o,{destroy:void 0},c,g===void 0?null:g)}function mf(i,o,c,g){var v=kn();g=g===void 0?null:g;var T=v.memoizedState.inst;Gt!==null&&g!==null&&x0(g,Gt.memoizedState.deps)?v.memoizedState=hl(o,T,c,g):(bt.flags|=i,v.memoizedState=hl(1|o,T,c,g))}function d2(i,o){hf(8390656,8,i,o)}function A0(i,o){mf(2048,8,i,o)}function DO(i){bt.flags|=4;var o=bt.updateQueue;if(o===null)o=cf(),bt.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function f2(i){var o=kn().memoizedState;return DO({ref:o,nextImpl:i}),function(){if((Ft&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function h2(i,o){return mf(4,2,i,o)}function m2(i,o){return mf(4,4,i,o)}function p2(i,o){if(typeof o=="function"){i=i();var c=o(i);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function g2(i,o,c){c=c!=null?c.concat([i]):null,mf(4,4,p2.bind(null,o,i),c)}function _0(){}function b2(i,o){var c=kn();o=o===void 0?null:o;var g=c.memoizedState;return o!==null&&x0(o,g[1])?g[0]:(c.memoizedState=[i,o],i)}function x2(i,o){var c=kn();o=o===void 0?null:o;var g=c.memoizedState;if(o!==null&&x0(o,g[1]))return g[0];if(g=i(),Ka){ut(!0);try{i()}finally{ut(!1)}}return c.memoizedState=[g,o],g}function R0(i,o,c){return c===void 0||(ii&1073741824)!==0&&(Ot&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=yT(),bt.lanes|=i,Xi|=i,c)}function y2(i,o,c,g){return Dr(c,o)?c:cl.current!==null?(i=R0(i,c,g),Dr(i,o)||(In=!0),i):(ii&42)===0||(ii&1073741824)!==0&&(Ot&261930)===0?(In=!0,i.memoizedState=c):(i=yT(),bt.lanes|=i,Xi|=i,o)}function v2(i,o,c,g,v){var T=V.p;V.p=T!==0&&8>T?T:8;var I=z.T,U={};z.T=U,M0(i,!1,o,c);try{var se=v(),be=z.S;if(be!==null&&be(U,se),se!==null&&typeof se=="object"&&typeof se.then=="function"){var Ne=RO(se,g);Hu(i,o,Ne,Hr(i))}else Hu(i,o,g,Hr(i))}catch(Re){Hu(i,o,{then:function(){},status:"rejected",reason:Re},Hr())}finally{V.p=T,I!==null&&U.types!==null&&(I.types=U.types),z.T=I}}function jO(){}function I0(i,o,c,g){if(i.tag!==5)throw Error(r(476));var v=E2(i).queue;v2(i,v,o,W,c===null?jO:function(){return T2(i),c(g)})}function E2(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:W},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function T2(i){var o=E2(i);o.next===null&&(o=i.alternate.memoizedState),Hu(i,o.next.queue,{},Hr())}function O0(){return Qn(sc)}function S2(){return kn().memoizedState}function C2(){return kn().memoizedState}function PO(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=Hr();i=$i(c);var g=Vi(o,i,c);g!==null&&(wr(g,o,c),ju(g,o,c)),o={cache:o0()},i.payload=o;return}o=o.return}}function BO(i,o,c){var g=Hr();c={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},pf(i)?k2(o,c):(c=Wp(i,o,c,g),c!==null&&(wr(c,i,g),N2(c,o,g)))}function w2(i,o,c){var g=Hr();Hu(i,o,c,g)}function Hu(i,o,c,g){var v={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(pf(i))k2(o,v);else{var T=i.alternate;if(i.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var I=o.lastRenderedState,U=T(I,c);if(v.hasEagerState=!0,v.eagerState=U,Dr(U,I))return Kd(i,o,v,0),nn===null&&Gd(),!1}catch{}finally{}if(c=Wp(i,o,v,g),c!==null)return wr(c,i,g),N2(c,o,g),!0}return!1}function M0(i,o,c,g){if(g={lane:2,revertLane:dg(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},pf(i)){if(o)throw Error(r(479))}else o=Wp(i,c,g,2),o!==null&&wr(o,i,2)}function pf(i){var o=i.alternate;return i===bt||o!==null&&o===bt}function k2(i,o){dl=lf=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function N2(i,o,c){if((c&4194048)!==0){var g=o.lanes;g&=i.pendingLanes,c|=g,o.lanes=c,bn(i,c)}}var Fu={readContext:Qn,use:df,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useLayoutEffect:vn,useInsertionEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useSyncExternalStore:vn,useId:vn,useHostTransitionStatus:vn,useFormState:vn,useActionState:vn,useOptimistic:vn,useMemoCache:vn,useCacheRefresh:vn};Fu.useEffectEvent=vn;var A2={readContext:Qn,use:df,useCallback:function(i,o){return cr().memoizedState=[i,o===void 0?null:o],i},useContext:Qn,useEffect:d2,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,hf(4194308,4,p2.bind(null,o,i),c)},useLayoutEffect:function(i,o){return hf(4194308,4,i,o)},useInsertionEffect:function(i,o){hf(4,2,i,o)},useMemo:function(i,o){var c=cr();o=o===void 0?null:o;var g=i();if(Ka){ut(!0);try{i()}finally{ut(!1)}}return c.memoizedState=[g,o],g},useReducer:function(i,o,c){var g=cr();if(c!==void 0){var v=c(o);if(Ka){ut(!0);try{c(o)}finally{ut(!1)}}}else v=o;return g.memoizedState=g.baseState=v,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:v},g.queue=i,i=i.dispatch=BO.bind(null,bt,i),[g.memoizedState,i]},useRef:function(i){var o=cr();return i={current:i},o.memoizedState=i},useState:function(i){i=k0(i);var o=i.queue,c=w2.bind(null,bt,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:_0,useDeferredValue:function(i,o){var c=cr();return R0(c,i,o)},useTransition:function(){var i=k0(!1);return i=v2.bind(null,bt,i.queue,!0,!1),cr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var g=bt,v=cr();if(Dt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),nn===null)throw Error(r(349));(Ot&127)!==0||XE(g,o,c)}v.memoizedState=c;var T={value:c,getSnapshot:o};return v.queue=T,d2(QE.bind(null,g,T,i),[i]),g.flags|=2048,hl(9,{destroy:void 0},WE.bind(null,g,T,c,o),null),c},useId:function(){var i=cr(),o=nn.identifierPrefix;if(Dt){var c=Os,g=Is;c=(g&~(1<<32-qe(g)-1)).toString(32)+c,o="_"+o+"R_"+c,c=uf++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=IO++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:O0,useFormState:a2,useActionState:a2,useOptimistic:function(i){var o=cr();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=M0.bind(null,bt,!0,c),c.dispatch=o,[i,o]},useMemoCache:S0,useCacheRefresh:function(){return cr().memoizedState=PO.bind(null,bt)},useEffectEvent:function(i){var o=cr(),c={impl:i};return o.memoizedState=c,function(){if((Ft&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},L0={readContext:Qn,use:df,useCallback:b2,useContext:Qn,useEffect:A0,useImperativeHandle:g2,useInsertionEffect:h2,useLayoutEffect:m2,useMemo:x2,useReducer:ff,useRef:c2,useState:function(){return ff(ai)},useDebugValue:_0,useDeferredValue:function(i,o){var c=kn();return y2(c,Gt.memoizedState,i,o)},useTransition:function(){var i=ff(ai)[0],o=kn().memoizedState;return[typeof i=="boolean"?i:Uu(i),o]},useSyncExternalStore:KE,useId:S2,useHostTransitionStatus:O0,useFormState:o2,useActionState:o2,useOptimistic:function(i,o){var c=kn();return e2(c,Gt,i,o)},useMemoCache:S0,useCacheRefresh:C2};L0.useEffectEvent=f2;var _2={readContext:Qn,use:df,useCallback:b2,useContext:Qn,useEffect:A0,useImperativeHandle:g2,useInsertionEffect:h2,useLayoutEffect:m2,useMemo:x2,useReducer:w0,useRef:c2,useState:function(){return w0(ai)},useDebugValue:_0,useDeferredValue:function(i,o){var c=kn();return Gt===null?R0(c,i,o):y2(c,Gt.memoizedState,i,o)},useTransition:function(){var i=w0(ai)[0],o=kn().memoizedState;return[typeof i=="boolean"?i:Uu(i),o]},useSyncExternalStore:KE,useId:S2,useHostTransitionStatus:O0,useFormState:u2,useActionState:u2,useOptimistic:function(i,o){var c=kn();return Gt!==null?e2(c,Gt,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:S0,useCacheRefresh:C2};_2.useEffectEvent=f2;function D0(i,o,c,g){o=i.memoizedState,c=c(g,o),c=c==null?o:m({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var j0={enqueueSetState:function(i,o,c){i=i._reactInternals;var g=Hr(),v=$i(g);v.payload=o,c!=null&&(v.callback=c),o=Vi(i,v,g),o!==null&&(wr(o,i,g),ju(o,i,g))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var g=Hr(),v=$i(g);v.tag=1,v.payload=o,c!=null&&(v.callback=c),o=Vi(i,v,g),o!==null&&(wr(o,i,g),ju(o,i,g))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=Hr(),g=$i(c);g.tag=2,o!=null&&(g.callback=o),o=Vi(i,g,c),o!==null&&(wr(o,i,c),ju(o,i,c))}};function R2(i,o,c,g,v,T,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,T,I):o.prototype&&o.prototype.isPureReactComponent?!Au(c,g)||!Au(v,T):!0}function I2(i,o,c,g){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,g),o.state!==i&&j0.enqueueReplaceState(o,o.state,null)}function Xa(i,o){var c=o;if("ref"in o){c={};for(var g in o)g!=="ref"&&(c[g]=o[g])}if(i=i.defaultProps){c===o&&(c=m({},c));for(var v in i)c[v]===void 0&&(c[v]=i[v])}return c}function O2(i){Yd(i)}function M2(i){console.error(i)}function L2(i){Yd(i)}function gf(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function D2(i,o,c){try{var g=i.onCaughtError;g(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function P0(i,o,c){return c=$i(c),c.tag=3,c.payload={element:null},c.callback=function(){gf(i,o)},c}function j2(i){return i=$i(i),i.tag=3,i}function P2(i,o,c,g){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var T=g.value;i.payload=function(){return v(T)},i.callback=function(){D2(o,c,g)}}var I=c.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){D2(o,c,g),typeof v!="function"&&(Wi===null?Wi=new Set([this]):Wi.add(this));var U=g.stack;this.componentDidCatch(g.value,{componentStack:U!==null?U:""})})}function zO(i,o,c,g,v){if(c.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=c.alternate,o!==null&&il(o,c,v,!0),c=Pr.current,c!==null){switch(c.tag){case 31:case 13:return ns===null?Af():c.alternate===null&&En===0&&(En=3),c.flags&=-257,c.flags|=65536,c.lanes=v,g===nf?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([g]):o.add(g),lg(i,g,v)),!1;case 22:return c.flags|=65536,g===nf?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([g]):c.add(g)),lg(i,g,v)),!1}throw Error(r(435,c.tag))}return lg(i,g,v),Af(),!1}if(Dt)return o=Pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=v,g!==n0&&(i=Error(r(422),{cause:g}),Iu(Zr(i,c)))):(g!==n0&&(o=Error(r(423),{cause:g}),Iu(Zr(o,c))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,g=Zr(g,c),v=P0(i.stateNode,g,v),h0(i,v),En!==4&&(En=2)),!1;var T=Error(r(520),{cause:g});if(T=Zr(T,c),Wu===null?Wu=[T]:Wu.push(T),En!==4&&(En=2),o===null)return!0;g=Zr(g,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=v&-v,c.lanes|=i,i=P0(c.stateNode,g,i),h0(c,i),!1;case 1:if(o=c.type,T=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Wi===null||!Wi.has(T))))return c.flags|=65536,v&=-v,c.lanes|=v,v=j2(v),P2(v,i,c,g),h0(c,v),!1}c=c.return}while(c!==null);return!1}var B0=Error(r(461)),In=!1;function Zn(i,o,c,g){o.child=i===null?HE(o,null,c,g):Ga(o,i.child,c,g)}function B2(i,o,c,g,v){c=c.render;var T=o.ref;if("ref"in g){var I={};for(var U in g)U!=="ref"&&(I[U]=g[U])}else I=g;return $a(o),g=y0(i,o,c,I,T,v),U=v0(),i!==null&&!In?(E0(i,o,v),oi(i,o,v)):(Dt&&U&&e0(o),o.flags|=1,Zn(i,o,g,v),o.child)}function z2(i,o,c,g,v){if(i===null){var T=c.type;return typeof T=="function"&&!Qp(T)&&T.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=T,U2(i,o,T,g,v)):(i=Wd(c.type,null,g,o,o.mode,v),i.ref=o.ref,i.return=o,o.child=i)}if(T=i.child,!Y0(i,v)){var I=T.memoizedProps;if(c=c.compare,c=c!==null?c:Au,c(I,g)&&i.ref===o.ref)return oi(i,o,v)}return o.flags|=1,i=ti(T,g),i.ref=o.ref,i.return=o,o.child=i}function U2(i,o,c,g,v){if(i!==null){var T=i.memoizedProps;if(Au(T,g)&&i.ref===o.ref)if(In=!1,o.pendingProps=g=T,Y0(i,v))(i.flags&131072)!==0&&(In=!0);else return o.lanes=i.lanes,oi(i,o,v)}return z0(i,o,c,g,v)}function H2(i,o,c,g){var v=g.children,T=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(T=T!==null?T.baseLanes|c:c,i!==null){for(g=o.child=i.child,v=0;g!==null;)v=v|g.lanes|g.childLanes,g=g.sibling;g=v&~T}else g=0,o.child=null;return F2(i,o,T,c,g)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&ef(o,T!==null?T.cachePool:null),T!==null?VE(o,T):p0(),qE(o);else return g=o.lanes=536870912,F2(i,o,T!==null?T.baseLanes|c:c,c,g)}else T!==null?(ef(o,T.cachePool),VE(o,T),Yi(),o.memoizedState=null):(i!==null&&ef(o,null),p0(),Yi());return Zn(i,o,v,c),o.child}function $u(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function F2(i,o,c,g,v){var T=u0();return T=T===null?null:{parent:_n._currentValue,pool:T},o.memoizedState={baseLanes:c,cachePool:T},i!==null&&ef(o,null),p0(),qE(o),i!==null&&il(i,o,g,!0),o.childLanes=v,null}function bf(i,o){return o=yf({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function $2(i,o,c){return Ga(o,i.child,null,c),i=bf(o,o.pendingProps),i.flags|=2,Br(o),o.memoizedState=null,i}function UO(i,o,c){var g=o.pendingProps,v=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Dt){if(g.mode==="hidden")return i=bf(o,g),o.lanes=536870912,$u(null,i);if(b0(o),(i=un)?(i=tS(i,ts),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Bi!==null?{id:Is,overflow:Os}:null,retryLane:536870912,hydrationErrors:null},c=kE(i),c.return=o,o.child=c,Wn=o,un=null)):i=null,i===null)throw Ui(o);return o.lanes=536870912,null}return bf(o,g)}var T=i.memoizedState;if(T!==null){var I=T.dehydrated;if(b0(o),v)if(o.flags&256)o.flags&=-257,o=$2(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(In||il(i,o,c,!1),v=(c&i.childLanes)!==0,In||v){if(g=nn,g!==null&&(I=Cn(g,c),I!==0&&I!==T.retryLane))throw T.retryLane=I,za(i,I),wr(g,i,I),B0;Af(),o=$2(i,o,c)}else i=T.treeContext,un=rs(I.nextSibling),Wn=o,Dt=!0,zi=null,ts=!1,i!==null&&_E(o,i),o=bf(o,g),o.flags|=4096;return o}return i=ti(i.child,{mode:g.mode,children:g.children}),i.ref=o.ref,o.child=i,i.return=o,i}function xf(i,o){var c=o.ref;if(c===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(o.flags|=4194816)}}function z0(i,o,c,g,v){return $a(o),c=y0(i,o,c,g,void 0,v),g=v0(),i!==null&&!In?(E0(i,o,v),oi(i,o,v)):(Dt&&g&&e0(o),o.flags|=1,Zn(i,o,c,v),o.child)}function V2(i,o,c,g,v,T){return $a(o),o.updateQueue=null,c=GE(o,g,c,v),YE(i),g=v0(),i!==null&&!In?(E0(i,o,T),oi(i,o,T)):(Dt&&g&&e0(o),o.flags|=1,Zn(i,o,c,T),o.child)}function q2(i,o,c,g,v){if($a(o),o.stateNode===null){var T=tl,I=c.contextType;typeof I=="object"&&I!==null&&(T=Qn(I)),T=new c(g,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=j0,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=g,T.state=o.memoizedState,T.refs={},d0(o),I=c.contextType,T.context=typeof I=="object"&&I!==null?Qn(I):tl,T.state=o.memoizedState,I=c.getDerivedStateFromProps,typeof I=="function"&&(D0(o,c,I,g),T.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(I=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),I!==T.state&&j0.enqueueReplaceState(T,T.state,null),Bu(o,g,T,v),Pu(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(i===null){T=o.stateNode;var U=o.memoizedProps,se=Xa(c,U);T.props=se;var be=T.context,Ne=c.contextType;I=tl,typeof Ne=="object"&&Ne!==null&&(I=Qn(Ne));var Re=c.getDerivedStateFromProps;Ne=typeof Re=="function"||typeof T.getSnapshotBeforeUpdate=="function",U=o.pendingProps!==U,Ne||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(U||be!==I)&&I2(o,T,g,I),Fi=!1;var ye=o.memoizedState;T.state=ye,Bu(o,g,T,v),Pu(),be=o.memoizedState,U||ye!==be||Fi?(typeof Re=="function"&&(D0(o,c,Re,g),be=o.memoizedState),(se=Fi||R2(o,c,se,g,ye,be,I))?(Ne||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=be),T.props=g,T.state=be,T.context=I,g=se):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{T=o.stateNode,f0(i,o),I=o.memoizedProps,Ne=Xa(c,I),T.props=Ne,Re=o.pendingProps,ye=T.context,be=c.contextType,se=tl,typeof be=="object"&&be!==null&&(se=Qn(be)),U=c.getDerivedStateFromProps,(be=typeof U=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(I!==Re||ye!==se)&&I2(o,T,g,se),Fi=!1,ye=o.memoizedState,T.state=ye,Bu(o,g,T,v),Pu();var Ce=o.memoizedState;I!==Re||ye!==Ce||Fi||i!==null&&i.dependencies!==null&&Zd(i.dependencies)?(typeof U=="function"&&(D0(o,c,U,g),Ce=o.memoizedState),(Ne=Fi||R2(o,c,Ne,g,ye,Ce,se)||i!==null&&i.dependencies!==null&&Zd(i.dependencies))?(be||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,Ce,se),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,Ce,se)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||I===i.memoizedProps&&ye===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ye===i.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=Ce),T.props=g,T.state=Ce,T.context=se,g=Ne):(typeof T.componentDidUpdate!="function"||I===i.memoizedProps&&ye===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ye===i.memoizedState||(o.flags|=1024),g=!1)}return T=g,xf(i,o),g=(o.flags&128)!==0,T||g?(T=o.stateNode,c=g&&typeof c.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,i!==null&&g?(o.child=Ga(o,i.child,null,v),o.child=Ga(o,null,c,v)):Zn(i,o,c,v),o.memoizedState=T.state,i=o.child):i=oi(i,o,v),i}function Y2(i,o,c,g){return Ha(),o.flags|=256,Zn(i,o,c,g),o.child}var U0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function H0(i){return{baseLanes:i,cachePool:DE()}}function F0(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=Ur),i}function G2(i,o,c){var g=o.pendingProps,v=!1,T=(o.flags&128)!==0,I;if((I=T)||(I=i!==null&&i.memoizedState===null?!1:(wn.current&2)!==0),I&&(v=!0,o.flags&=-129),I=(o.flags&32)!==0,o.flags&=-33,i===null){if(Dt){if(v?qi(o):Yi(),(i=un)?(i=tS(i,ts),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Bi!==null?{id:Is,overflow:Os}:null,retryLane:536870912,hydrationErrors:null},c=kE(i),c.return=o,o.child=c,Wn=o,un=null)):i=null,i===null)throw Ui(o);return Cg(i)?o.lanes=32:o.lanes=536870912,null}var U=g.children;return g=g.fallback,v?(Yi(),v=o.mode,U=yf({mode:"hidden",children:U},v),g=Ua(g,v,c,null),U.return=o,g.return=o,U.sibling=g,o.child=U,g=o.child,g.memoizedState=H0(c),g.childLanes=F0(i,I,c),o.memoizedState=U0,$u(null,g)):(qi(o),$0(o,U))}var se=i.memoizedState;if(se!==null&&(U=se.dehydrated,U!==null)){if(T)o.flags&256?(qi(o),o.flags&=-257,o=V0(i,o,c)):o.memoizedState!==null?(Yi(),o.child=i.child,o.flags|=128,o=null):(Yi(),U=g.fallback,v=o.mode,g=yf({mode:"visible",children:g.children},v),U=Ua(U,v,c,null),U.flags|=2,g.return=o,U.return=o,g.sibling=U,o.child=g,Ga(o,i.child,null,c),g=o.child,g.memoizedState=H0(c),g.childLanes=F0(i,I,c),o.memoizedState=U0,o=$u(null,g));else if(qi(o),Cg(U)){if(I=U.nextSibling&&U.nextSibling.dataset,I)var be=I.dgst;I=be,g=Error(r(419)),g.stack="",g.digest=I,Iu({value:g,source:null,stack:null}),o=V0(i,o,c)}else if(In||il(i,o,c,!1),I=(c&i.childLanes)!==0,In||I){if(I=nn,I!==null&&(g=Cn(I,c),g!==0&&g!==se.retryLane))throw se.retryLane=g,za(i,g),wr(I,i,g),B0;Sg(U)||Af(),o=V0(i,o,c)}else Sg(U)?(o.flags|=192,o.child=i.child,o=null):(i=se.treeContext,un=rs(U.nextSibling),Wn=o,Dt=!0,zi=null,ts=!1,i!==null&&_E(o,i),o=$0(o,g.children),o.flags|=4096);return o}return v?(Yi(),U=g.fallback,v=o.mode,se=i.child,be=se.sibling,g=ti(se,{mode:"hidden",children:g.children}),g.subtreeFlags=se.subtreeFlags&65011712,be!==null?U=ti(be,U):(U=Ua(U,v,c,null),U.flags|=2),U.return=o,g.return=o,g.sibling=U,o.child=g,$u(null,g),g=o.child,U=i.child.memoizedState,U===null?U=H0(c):(v=U.cachePool,v!==null?(se=_n._currentValue,v=v.parent!==se?{parent:se,pool:se}:v):v=DE(),U={baseLanes:U.baseLanes|c,cachePool:v}),g.memoizedState=U,g.childLanes=F0(i,I,c),o.memoizedState=U0,$u(i.child,g)):(qi(o),c=i.child,i=c.sibling,c=ti(c,{mode:"visible",children:g.children}),c.return=o,c.sibling=null,i!==null&&(I=o.deletions,I===null?(o.deletions=[i],o.flags|=16):I.push(i)),o.child=c,o.memoizedState=null,c)}function $0(i,o){return o=yf({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function yf(i,o){return i=jr(22,i,null,o),i.lanes=0,i}function V0(i,o,c){return Ga(o,i.child,null,c),i=$0(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function K2(i,o,c){i.lanes|=o;var g=i.alternate;g!==null&&(g.lanes|=o),i0(i.return,o,c)}function q0(i,o,c,g,v,T){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:c,tailMode:v,treeForkCount:T}:(I.isBackwards=o,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=c,I.tailMode=v,I.treeForkCount=T)}function X2(i,o,c){var g=o.pendingProps,v=g.revealOrder,T=g.tail;g=g.children;var I=wn.current,U=(I&2)!==0;if(U?(I=I&1|2,o.flags|=128):I&=1,L(wn,I),Zn(i,o,g,c),g=Dt?Ru:0,!U&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&K2(i,c,o);else if(i.tag===19)K2(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(v){case"forwards":for(c=o.child,v=null;c!==null;)i=c.alternate,i!==null&&of(i)===null&&(v=c),c=c.sibling;c=v,c===null?(v=o.child,o.child=null):(v=c.sibling,c.sibling=null),q0(o,!1,v,c,T,g);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=o.child,o.child=null;v!==null;){if(i=v.alternate,i!==null&&of(i)===null){o.child=v;break}i=v.sibling,v.sibling=c,c=v,v=i}q0(o,!0,c,null,T,g);break;case"together":q0(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function oi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),Xi|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(il(i,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,c=ti(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=ti(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function Y0(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Zd(i)))}function HO(i,o,c){switch(o.tag){case 3:fe(o,o.stateNode.containerInfo),Hi(o,_n,i.memoizedState.cache),Ha();break;case 27:case 5:He(o);break;case 4:fe(o,o.stateNode.containerInfo);break;case 10:Hi(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,b0(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(qi(o),o.flags|=128,null):(c&o.child.childLanes)!==0?G2(i,o,c):(qi(o),i=oi(i,o,c),i!==null?i.sibling:null);qi(o);break;case 19:var v=(i.flags&128)!==0;if(g=(c&o.childLanes)!==0,g||(il(i,o,c,!1),g=(c&o.childLanes)!==0),v){if(g)return X2(i,o,c);o.flags|=128}if(v=o.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),L(wn,wn.current),g)break;return null;case 22:return o.lanes=0,H2(i,o,c,o.pendingProps);case 24:Hi(o,_n,i.memoizedState.cache)}return oi(i,o,c)}function W2(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)In=!0;else{if(!Y0(i,c)&&(o.flags&128)===0)return In=!1,HO(i,o,c);In=(i.flags&131072)!==0}else In=!1,Dt&&(o.flags&1048576)!==0&&AE(o,Ru,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(i=qa(o.elementType),o.type=i,typeof i=="function")Qp(i)?(g=Xa(i,g),o.tag=1,o=q2(null,o,i,g,c)):(o.tag=0,o=z0(null,o,i,g,c));else{if(i!=null){var v=i.$$typeof;if(v===R){o.tag=11,o=B2(null,o,i,g,c);break e}else if(v===O){o.tag=14,o=z2(null,o,i,g,c);break e}}throw o=te(i)||i,Error(r(306,o,""))}}return o;case 0:return z0(i,o,o.type,o.pendingProps,c);case 1:return g=o.type,v=Xa(g,o.pendingProps),q2(i,o,g,v,c);case 3:e:{if(fe(o,o.stateNode.containerInfo),i===null)throw Error(r(387));g=o.pendingProps;var T=o.memoizedState;v=T.element,f0(i,o),Bu(o,g,null,c);var I=o.memoizedState;if(g=I.cache,Hi(o,_n,g),g!==T.cache&&a0(o,[_n],c,!0),Pu(),g=I.element,T.isDehydrated)if(T={element:g,isDehydrated:!1,cache:I.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=Y2(i,o,g,c);break e}else if(g!==v){v=Zr(Error(r(424)),o),Iu(v),o=Y2(i,o,g,c);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(un=rs(i.firstChild),Wn=o,Dt=!0,zi=null,ts=!0,c=HE(o,null,g,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Ha(),g===v){o=oi(i,o,c);break e}Zn(i,o,g,c)}o=o.child}return o;case 26:return xf(i,o),i===null?(c=oS(o.type,null,o.pendingProps,null))?o.memoizedState=c:Dt||(c=o.type,i=o.pendingProps,g=Df(ce.current).createElement(c),g[tn]=o,g[Xn]=i,Jn(g,c,i),Hn(g),o.stateNode=g):o.memoizedState=oS(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return He(o),i===null&&Dt&&(g=o.stateNode=sS(o.type,o.pendingProps,ce.current),Wn=o,ts=!0,v=un,ea(o.type)?(wg=v,un=rs(g.firstChild)):un=v),Zn(i,o,o.pendingProps.children,c),xf(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Dt&&((v=g=un)&&(g=bM(g,o.type,o.pendingProps,ts),g!==null?(o.stateNode=g,Wn=o,un=rs(g.firstChild),ts=!1,v=!0):v=!1),v||Ui(o)),He(o),v=o.type,T=o.pendingProps,I=i!==null?i.memoizedProps:null,g=T.children,vg(v,T)?g=null:I!==null&&vg(v,I)&&(o.flags|=32),o.memoizedState!==null&&(v=y0(i,o,OO,null,null,c),sc._currentValue=v),xf(i,o),Zn(i,o,g,c),o.child;case 6:return i===null&&Dt&&((i=c=un)&&(c=xM(c,o.pendingProps,ts),c!==null?(o.stateNode=c,Wn=o,un=null,i=!0):i=!1),i||Ui(o)),null;case 13:return G2(i,o,c);case 4:return fe(o,o.stateNode.containerInfo),g=o.pendingProps,i===null?o.child=Ga(o,null,g,c):Zn(i,o,g,c),o.child;case 11:return B2(i,o,o.type,o.pendingProps,c);case 7:return Zn(i,o,o.pendingProps,c),o.child;case 8:return Zn(i,o,o.pendingProps.children,c),o.child;case 12:return Zn(i,o,o.pendingProps.children,c),o.child;case 10:return g=o.pendingProps,Hi(o,o.type,g.value),Zn(i,o,g.children,c),o.child;case 9:return v=o.type._context,g=o.pendingProps.children,$a(o),v=Qn(v),g=g(v),o.flags|=1,Zn(i,o,g,c),o.child;case 14:return z2(i,o,o.type,o.pendingProps,c);case 15:return U2(i,o,o.type,o.pendingProps,c);case 19:return X2(i,o,c);case 31:return UO(i,o,c);case 22:return H2(i,o,c,o.pendingProps);case 24:return $a(o),g=Qn(_n),i===null?(v=u0(),v===null&&(v=nn,T=o0(),v.pooledCache=T,T.refCount++,T!==null&&(v.pooledCacheLanes|=c),v=T),o.memoizedState={parent:g,cache:v},d0(o),Hi(o,_n,v)):((i.lanes&c)!==0&&(f0(i,o),Bu(o,null,null,c),Pu()),v=i.memoizedState,T=o.memoizedState,v.parent!==g?(v={parent:g,cache:g},o.memoizedState=v,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=v),Hi(o,_n,g)):(g=T.cache,Hi(o,_n,g),g!==v.cache&&a0(o,[_n],c,!0))),Zn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function li(i){i.flags|=4}function G0(i,o,c,g,v){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(v&335544128)===v)if(i.stateNode.complete)i.flags|=8192;else if(ST())i.flags|=8192;else throw Ya=nf,c0}else i.flags&=-16777217}function Q2(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!fS(o))if(ST())i.flags|=8192;else throw Ya=nf,c0}function vf(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?en():536870912,i.lanes|=o,bl|=o)}function Vu(i,o){if(!Dt)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function cn(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,g=0;if(o)for(var v=i.child;v!==null;)c|=v.lanes|v.childLanes,g|=v.subtreeFlags&65011712,g|=v.flags&65011712,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)c|=v.lanes|v.childLanes,g|=v.subtreeFlags,g|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=g,i.childLanes=c,o}function FO(i,o,c){var g=o.pendingProps;switch(t0(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(o),null;case 1:return cn(o),null;case 3:return c=o.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),si(_n),Se(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(sl(o)?li(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,r0())),cn(o),null;case 26:var v=o.type,T=o.memoizedState;return i===null?(li(o),T!==null?(cn(o),Q2(o,T)):(cn(o),G0(o,v,null,g,c))):T?T!==i.memoizedState?(li(o),cn(o),Q2(o,T)):(cn(o),o.flags&=-16777217):(i=i.memoizedProps,i!==g&&li(o),cn(o),G0(o,v,i,g,c)),null;case 27:if(Me(o),c=ce.current,v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==g&&li(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return cn(o),null}i=ae.current,sl(o)?RE(o):(i=sS(v,g,c),o.stateNode=i,li(o))}return cn(o),null;case 5:if(Me(o),v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==g&&li(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return cn(o),null}if(T=ae.current,sl(o))RE(o);else{var I=Df(ce.current);switch(T){case 1:T=I.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:T=I.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":T=I.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":T=I.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":T=I.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?T.multiple=!0:g.size&&(T.size=g.size);break;default:T=typeof g.is=="string"?I.createElement(v,{is:g.is}):I.createElement(v)}}T[tn]=o,T[Xn]=g;e:for(I=o.child;I!==null;){if(I.tag===5||I.tag===6)T.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===o)break e;for(;I.sibling===null;){if(I.return===null||I.return===o)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}o.stateNode=T;e:switch(Jn(T,v,g),v){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&li(o)}}return cn(o),G0(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==g&&li(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(i=ce.current,sl(o)){if(i=o.stateNode,c=o.memoizedProps,g=null,v=Wn,v!==null)switch(v.tag){case 27:case 5:g=v.memoizedProps}i[tn]=o,i=!!(i.nodeValue===c||g!==null&&g.suppressHydrationWarning===!0||GT(i.nodeValue,c)),i||Ui(o,!0)}else i=Df(i).createTextNode(g),i[tn]=o,o.stateNode=i}return cn(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(g=sl(o),c!==null){if(i===null){if(!g)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[tn]=o}else Ha(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;cn(o),i=!1}else c=r0(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(Br(o),o):(Br(o),null);if((o.flags&128)!==0)throw Error(r(558))}return cn(o),null;case 13:if(g=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=sl(o),g!==null&&g.dehydrated!==null){if(i===null){if(!v)throw Error(r(318));if(v=o.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[tn]=o}else Ha(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;cn(o),v=!1}else v=r0(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return o.flags&256?(Br(o),o):(Br(o),null)}return Br(o),(o.flags&128)!==0?(o.lanes=c,o):(c=g!==null,i=i!==null&&i.memoizedState!==null,c&&(g=o.child,v=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(v=g.alternate.memoizedState.cachePool.pool),T=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(T=g.memoizedState.cachePool.pool),T!==v&&(g.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),vf(o,o.updateQueue),cn(o),null);case 4:return Se(),i===null&&pg(o.stateNode.containerInfo),cn(o),null;case 10:return si(o.type),cn(o),null;case 19:if($(wn),g=o.memoizedState,g===null)return cn(o),null;if(v=(o.flags&128)!==0,T=g.rendering,T===null)if(v)Vu(g,!1);else{if(En!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(T=of(i),T!==null){for(o.flags|=128,Vu(g,!1),i=T.updateQueue,o.updateQueue=i,vf(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)wE(c,i),c=c.sibling;return L(wn,wn.current&1|2),Dt&&ni(o,g.treeForkCount),o.child}i=i.sibling}g.tail!==null&&oe()>wf&&(o.flags|=128,v=!0,Vu(g,!1),o.lanes=4194304)}else{if(!v)if(i=of(T),i!==null){if(o.flags|=128,v=!0,i=i.updateQueue,o.updateQueue=i,vf(o,i),Vu(g,!0),g.tail===null&&g.tailMode==="hidden"&&!T.alternate&&!Dt)return cn(o),null}else 2*oe()-g.renderingStartTime>wf&&c!==536870912&&(o.flags|=128,v=!0,Vu(g,!1),o.lanes=4194304);g.isBackwards?(T.sibling=o.child,o.child=T):(i=g.last,i!==null?i.sibling=T:o.child=T,g.last=T)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=oe(),i.sibling=null,c=wn.current,L(wn,v?c&1|2:c&1),Dt&&ni(o,g.treeForkCount),i):(cn(o),null);case 22:case 23:return Br(o),g0(),g=o.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(c&536870912)!==0&&(o.flags&128)===0&&(cn(o),o.subtreeFlags&6&&(o.flags|=8192)):cn(o),c=o.updateQueue,c!==null&&vf(o,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==c&&(o.flags|=2048),i!==null&&$(Va),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),si(_n),cn(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function $O(i,o){switch(t0(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return si(_n),Se(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return Me(o),null;case 31:if(o.memoizedState!==null){if(Br(o),o.alternate===null)throw Error(r(340));Ha()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(Br(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Ha()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return $(wn),null;case 4:return Se(),null;case 10:return si(o.type),null;case 22:case 23:return Br(o),g0(),i!==null&&$(Va),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return si(_n),null;case 25:return null;default:return null}}function Z2(i,o){switch(t0(o),o.tag){case 3:si(_n),Se();break;case 26:case 27:case 5:Me(o);break;case 4:Se();break;case 31:o.memoizedState!==null&&Br(o);break;case 13:Br(o);break;case 19:$(wn);break;case 10:si(o.type);break;case 22:case 23:Br(o),g0(),i!==null&&$(Va);break;case 24:si(_n)}}function qu(i,o){try{var c=o.updateQueue,g=c!==null?c.lastEffect:null;if(g!==null){var v=g.next;c=v;do{if((c.tag&i)===i){g=void 0;var T=c.create,I=c.inst;g=T(),I.destroy=g}c=c.next}while(c!==v)}}catch(U){qt(o,o.return,U)}}function Gi(i,o,c){try{var g=o.updateQueue,v=g!==null?g.lastEffect:null;if(v!==null){var T=v.next;g=T;do{if((g.tag&i)===i){var I=g.inst,U=I.destroy;if(U!==void 0){I.destroy=void 0,v=o;var se=c,be=U;try{be()}catch(Ne){qt(v,se,Ne)}}}g=g.next}while(g!==T)}}catch(Ne){qt(o,o.return,Ne)}}function J2(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{$E(o,c)}catch(g){qt(i,i.return,g)}}}function eT(i,o,c){c.props=Xa(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(g){qt(i,o,g)}}function Yu(i,o){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof c=="function"?i.refCleanup=c(g):c.current=g}}catch(v){qt(i,o,v)}}function Ms(i,o){var c=i.ref,g=i.refCleanup;if(c!==null)if(typeof g=="function")try{g()}catch(v){qt(i,o,v)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){qt(i,o,v)}else c.current=null}function tT(i){var o=i.type,c=i.memoizedProps,g=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&g.focus();break e;case"img":c.src?g.src=c.src:c.srcSet&&(g.srcset=c.srcSet)}}catch(v){qt(i,i.return,v)}}function K0(i,o,c){try{var g=i.stateNode;dM(g,i.type,c,o),g[Xn]=o}catch(v){qt(i,i.return,v)}}function nT(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ea(i.type)||i.tag===4}function X0(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||nT(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ea(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function W0(i,o,c){var g=i.tag;if(g===5||g===6)i=i.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(i),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Js));else if(g!==4&&(g===27&&ea(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(W0(i,o,c),i=i.sibling;i!==null;)W0(i,o,c),i=i.sibling}function Ef(i,o,c){var g=i.tag;if(g===5||g===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(g!==4&&(g===27&&ea(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Ef(i,o,c),i=i.sibling;i!==null;)Ef(i,o,c),i=i.sibling}function rT(i){var o=i.stateNode,c=i.memoizedProps;try{for(var g=i.type,v=o.attributes;v.length;)o.removeAttributeNode(v[0]);Jn(o,g,c),o[tn]=i,o[Xn]=c}catch(T){qt(i,i.return,T)}}var ui=!1,On=!1,Q0=!1,sT=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function VO(i,o){if(i=i.containerInfo,xg=Ff,i=gE(i),Vp(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var g=c.getSelection&&c.getSelection();if(g&&g.rangeCount!==0){c=g.anchorNode;var v=g.anchorOffset,T=g.focusNode;g=g.focusOffset;try{c.nodeType,T.nodeType}catch{c=null;break e}var I=0,U=-1,se=-1,be=0,Ne=0,Re=i,ye=null;t:for(;;){for(var Ce;Re!==c||v!==0&&Re.nodeType!==3||(U=I+v),Re!==T||g!==0&&Re.nodeType!==3||(se=I+g),Re.nodeType===3&&(I+=Re.nodeValue.length),(Ce=Re.firstChild)!==null;)ye=Re,Re=Ce;for(;;){if(Re===i)break t;if(ye===c&&++be===v&&(U=I),ye===T&&++Ne===g&&(se=I),(Ce=Re.nextSibling)!==null)break;Re=ye,ye=Re.parentNode}Re=Ce}c=U===-1||se===-1?null:{start:U,end:se}}else c=null}c=c||{start:0,end:0}}else c=null;for(yg={focusedElem:i,selectionRange:c},Ff=!1,Fn=o;Fn!==null;)if(o=Fn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Fn=i;else for(;Fn!==null;){switch(o=Fn,T=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)v=i[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&T!==null){i=void 0,c=o,v=T.memoizedProps,T=T.memoizedState,g=c.stateNode;try{var Ze=Xa(c.type,v);i=g.getSnapshotBeforeUpdate(Ze,T),g.__reactInternalSnapshotBeforeUpdate=i}catch(at){qt(c,c.return,at)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Tg(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Tg(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,Fn=i;break}Fn=o.return}}function iT(i,o,c){var g=c.flags;switch(c.tag){case 0:case 11:case 15:di(i,c),g&4&&qu(5,c);break;case 1:if(di(i,c),g&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(I){qt(c,c.return,I)}else{var v=Xa(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(v,o,i.__reactInternalSnapshotBeforeUpdate)}catch(I){qt(c,c.return,I)}}g&64&&J2(c),g&512&&Yu(c,c.return);break;case 3:if(di(i,c),g&64&&(i=c.updateQueue,i!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{$E(i,o)}catch(I){qt(c,c.return,I)}}break;case 27:o===null&&g&4&&rT(c);case 26:case 5:di(i,c),o===null&&g&4&&tT(c),g&512&&Yu(c,c.return);break;case 12:di(i,c);break;case 31:di(i,c),g&4&&lT(i,c);break;case 13:di(i,c),g&4&&uT(i,c),g&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=JO.bind(null,c),yM(i,c))));break;case 22:if(g=c.memoizedState!==null||ui,!g){o=o!==null&&o.memoizedState!==null||On,v=ui;var T=On;ui=g,(On=o)&&!T?fi(i,c,(c.subtreeFlags&8772)!==0):di(i,c),ui=v,On=T}break;case 30:break;default:di(i,c)}}function aT(i){var o=i.alternate;o!==null&&(i.alternate=null,aT(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&Np(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var hn=null,Er=!1;function ci(i,o,c){for(c=c.child;c!==null;)oT(i,o,c),c=c.sibling}function oT(i,o,c){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(tt,c)}catch{}switch(c.tag){case 26:On||Ms(c,o),ci(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:On||Ms(c,o);var g=hn,v=Er;ea(c.type)&&(hn=c.stateNode,Er=!1),ci(i,o,c),tc(c.stateNode),hn=g,Er=v;break;case 5:On||Ms(c,o);case 6:if(g=hn,v=Er,hn=null,ci(i,o,c),hn=g,Er=v,hn!==null)if(Er)try{(hn.nodeType===9?hn.body:hn.nodeName==="HTML"?hn.ownerDocument.body:hn).removeChild(c.stateNode)}catch(T){qt(c,o,T)}else try{hn.removeChild(c.stateNode)}catch(T){qt(c,o,T)}break;case 18:hn!==null&&(Er?(i=hn,JT(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),wl(i)):JT(hn,c.stateNode));break;case 4:g=hn,v=Er,hn=c.stateNode.containerInfo,Er=!0,ci(i,o,c),hn=g,Er=v;break;case 0:case 11:case 14:case 15:Gi(2,c,o),On||Gi(4,c,o),ci(i,o,c);break;case 1:On||(Ms(c,o),g=c.stateNode,typeof g.componentWillUnmount=="function"&&eT(c,o,g)),ci(i,o,c);break;case 21:ci(i,o,c);break;case 22:On=(g=On)||c.memoizedState!==null,ci(i,o,c),On=g;break;default:ci(i,o,c)}}function lT(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{wl(i)}catch(c){qt(o,o.return,c)}}}function uT(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{wl(i)}catch(c){qt(o,o.return,c)}}function qO(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new sT),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new sT),o;default:throw Error(r(435,i.tag))}}function Tf(i,o){var c=qO(i);o.forEach(function(g){if(!c.has(g)){c.add(g);var v=eM.bind(null,i,g);g.then(v,v)}})}function Tr(i,o){var c=o.deletions;if(c!==null)for(var g=0;g<c.length;g++){var v=c[g],T=i,I=o,U=I;e:for(;U!==null;){switch(U.tag){case 27:if(ea(U.type)){hn=U.stateNode,Er=!1;break e}break;case 5:hn=U.stateNode,Er=!1;break e;case 3:case 4:hn=U.stateNode.containerInfo,Er=!0;break e}U=U.return}if(hn===null)throw Error(r(160));oT(T,I,v),hn=null,Er=!1,T=v.alternate,T!==null&&(T.return=null),v.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)cT(o,i),o=o.sibling}var bs=null;function cT(i,o){var c=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Tr(o,i),Sr(i),g&4&&(Gi(3,i,i.return),qu(3,i),Gi(5,i,i.return));break;case 1:Tr(o,i),Sr(i),g&512&&(On||c===null||Ms(c,c.return)),g&64&&ui&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?g:c.concat(g))));break;case 26:var v=bs;if(Tr(o,i),Sr(i),g&512&&(On||c===null||Ms(c,c.return)),g&4){var T=c!==null?c.memoizedState:null;if(g=i.memoizedState,c===null)if(g===null)if(i.stateNode===null){e:{g=i.type,c=i.memoizedProps,v=v.ownerDocument||v;t:switch(g){case"title":T=v.getElementsByTagName("title")[0],(!T||T[yu]||T[tn]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=v.createElement(g),v.head.insertBefore(T,v.querySelector("head > title"))),Jn(T,g,c),T[tn]=i,Hn(T),g=T;break e;case"link":var I=cS("link","href",v).get(g+(c.href||""));if(I){for(var U=0;U<I.length;U++)if(T=I[U],T.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&T.getAttribute("rel")===(c.rel==null?null:c.rel)&&T.getAttribute("title")===(c.title==null?null:c.title)&&T.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){I.splice(U,1);break t}}T=v.createElement(g),Jn(T,g,c),v.head.appendChild(T);break;case"meta":if(I=cS("meta","content",v).get(g+(c.content||""))){for(U=0;U<I.length;U++)if(T=I[U],T.getAttribute("content")===(c.content==null?null:""+c.content)&&T.getAttribute("name")===(c.name==null?null:c.name)&&T.getAttribute("property")===(c.property==null?null:c.property)&&T.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&T.getAttribute("charset")===(c.charSet==null?null:c.charSet)){I.splice(U,1);break t}}T=v.createElement(g),Jn(T,g,c),v.head.appendChild(T);break;default:throw Error(r(468,g))}T[tn]=i,Hn(T),g=T}i.stateNode=g}else dS(v,i.type,i.stateNode);else i.stateNode=uS(v,g,i.memoizedProps);else T!==g?(T===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):T.count--,g===null?dS(v,i.type,i.stateNode):uS(v,g,i.memoizedProps)):g===null&&i.stateNode!==null&&K0(i,i.memoizedProps,c.memoizedProps)}break;case 27:Tr(o,i),Sr(i),g&512&&(On||c===null||Ms(c,c.return)),c!==null&&g&4&&K0(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Tr(o,i),Sr(i),g&512&&(On||c===null||Ms(c,c.return)),i.flags&32){v=i.stateNode;try{Ko(v,"")}catch(Ze){qt(i,i.return,Ze)}}g&4&&i.stateNode!=null&&(v=i.memoizedProps,K0(i,v,c!==null?c.memoizedProps:v)),g&1024&&(Q0=!0);break;case 6:if(Tr(o,i),Sr(i),g&4){if(i.stateNode===null)throw Error(r(162));g=i.memoizedProps,c=i.stateNode;try{c.nodeValue=g}catch(Ze){qt(i,i.return,Ze)}}break;case 3:if(Bf=null,v=bs,bs=jf(o.containerInfo),Tr(o,i),bs=v,Sr(i),g&4&&c!==null&&c.memoizedState.isDehydrated)try{wl(o.containerInfo)}catch(Ze){qt(i,i.return,Ze)}Q0&&(Q0=!1,dT(i));break;case 4:g=bs,bs=jf(i.stateNode.containerInfo),Tr(o,i),Sr(i),bs=g;break;case 12:Tr(o,i),Sr(i);break;case 31:Tr(o,i),Sr(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Tf(i,g)));break;case 13:Tr(o,i),Sr(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Cf=oe()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Tf(i,g)));break;case 22:v=i.memoizedState!==null;var se=c!==null&&c.memoizedState!==null,be=ui,Ne=On;if(ui=be||v,On=Ne||se,Tr(o,i),On=Ne,ui=be,Sr(i),g&8192)e:for(o=i.stateNode,o._visibility=v?o._visibility&-2:o._visibility|1,v&&(c===null||se||ui||On||Wa(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){se=c=o;try{if(T=se.stateNode,v)I=T.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{U=se.stateNode;var Re=se.memoizedProps.style,ye=Re!=null&&Re.hasOwnProperty("display")?Re.display:null;U.style.display=ye==null||typeof ye=="boolean"?"":(""+ye).trim()}}catch(Ze){qt(se,se.return,Ze)}}}else if(o.tag===6){if(c===null){se=o;try{se.stateNode.nodeValue=v?"":se.memoizedProps}catch(Ze){qt(se,se.return,Ze)}}}else if(o.tag===18){if(c===null){se=o;try{var Ce=se.stateNode;v?eS(Ce,!0):eS(se.stateNode,!1)}catch(Ze){qt(se,se.return,Ze)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=i.updateQueue,g!==null&&(c=g.retryQueue,c!==null&&(g.retryQueue=null,Tf(i,c))));break;case 19:Tr(o,i),Sr(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Tf(i,g)));break;case 30:break;case 21:break;default:Tr(o,i),Sr(i)}}function Sr(i){var o=i.flags;if(o&2){try{for(var c,g=i.return;g!==null;){if(nT(g)){c=g;break}g=g.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var v=c.stateNode,T=X0(i);Ef(i,T,v);break;case 5:var I=c.stateNode;c.flags&32&&(Ko(I,""),c.flags&=-33);var U=X0(i);Ef(i,U,I);break;case 3:case 4:var se=c.stateNode.containerInfo,be=X0(i);W0(i,be,se);break;default:throw Error(r(161))}}catch(Ne){qt(i,i.return,Ne)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function dT(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;dT(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function di(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)iT(i,o.alternate,o),o=o.sibling}function Wa(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Gi(4,o,o.return),Wa(o);break;case 1:Ms(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&eT(o,o.return,c),Wa(o);break;case 27:tc(o.stateNode);case 26:case 5:Ms(o,o.return),Wa(o);break;case 22:o.memoizedState===null&&Wa(o);break;case 30:Wa(o);break;default:Wa(o)}i=i.sibling}}function fi(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,v=i,T=o,I=T.flags;switch(T.tag){case 0:case 11:case 15:fi(v,T,c),qu(4,T);break;case 1:if(fi(v,T,c),g=T,v=g.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(be){qt(g,g.return,be)}if(g=T,v=g.updateQueue,v!==null){var U=g.stateNode;try{var se=v.shared.hiddenCallbacks;if(se!==null)for(v.shared.hiddenCallbacks=null,v=0;v<se.length;v++)FE(se[v],U)}catch(be){qt(g,g.return,be)}}c&&I&64&&J2(T),Yu(T,T.return);break;case 27:rT(T);case 26:case 5:fi(v,T,c),c&&g===null&&I&4&&tT(T),Yu(T,T.return);break;case 12:fi(v,T,c);break;case 31:fi(v,T,c),c&&I&4&&lT(v,T);break;case 13:fi(v,T,c),c&&I&4&&uT(v,T);break;case 22:T.memoizedState===null&&fi(v,T,c),Yu(T,T.return);break;case 30:break;default:fi(v,T,c)}o=o.sibling}}function Z0(i,o){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&Ou(c))}function J0(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Ou(i))}function xs(i,o,c,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)fT(i,o,c,g),o=o.sibling}function fT(i,o,c,g){var v=o.flags;switch(o.tag){case 0:case 11:case 15:xs(i,o,c,g),v&2048&&qu(9,o);break;case 1:xs(i,o,c,g);break;case 3:xs(i,o,c,g),v&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Ou(i)));break;case 12:if(v&2048){xs(i,o,c,g),i=o.stateNode;try{var T=o.memoizedProps,I=T.id,U=T.onPostCommit;typeof U=="function"&&U(I,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(se){qt(o,o.return,se)}}else xs(i,o,c,g);break;case 31:xs(i,o,c,g);break;case 13:xs(i,o,c,g);break;case 23:break;case 22:T=o.stateNode,I=o.alternate,o.memoizedState!==null?T._visibility&2?xs(i,o,c,g):Gu(i,o):T._visibility&2?xs(i,o,c,g):(T._visibility|=2,ml(i,o,c,g,(o.subtreeFlags&10256)!==0||!1)),v&2048&&Z0(I,o);break;case 24:xs(i,o,c,g),v&2048&&J0(o.alternate,o);break;default:xs(i,o,c,g)}}function ml(i,o,c,g,v){for(v=v&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=i,I=o,U=c,se=g,be=I.flags;switch(I.tag){case 0:case 11:case 15:ml(T,I,U,se,v),qu(8,I);break;case 23:break;case 22:var Ne=I.stateNode;I.memoizedState!==null?Ne._visibility&2?ml(T,I,U,se,v):Gu(T,I):(Ne._visibility|=2,ml(T,I,U,se,v)),v&&be&2048&&Z0(I.alternate,I);break;case 24:ml(T,I,U,se,v),v&&be&2048&&J0(I.alternate,I);break;default:ml(T,I,U,se,v)}o=o.sibling}}function Gu(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,g=o,v=g.flags;switch(g.tag){case 22:Gu(c,g),v&2048&&Z0(g.alternate,g);break;case 24:Gu(c,g),v&2048&&J0(g.alternate,g);break;default:Gu(c,g)}o=o.sibling}}var Ku=8192;function pl(i,o,c){if(i.subtreeFlags&Ku)for(i=i.child;i!==null;)hT(i,o,c),i=i.sibling}function hT(i,o,c){switch(i.tag){case 26:pl(i,o,c),i.flags&Ku&&i.memoizedState!==null&&IM(c,bs,i.memoizedState,i.memoizedProps);break;case 5:pl(i,o,c);break;case 3:case 4:var g=bs;bs=jf(i.stateNode.containerInfo),pl(i,o,c),bs=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=Ku,Ku=16777216,pl(i,o,c),Ku=g):pl(i,o,c));break;default:pl(i,o,c)}}function mT(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function Xu(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var g=o[c];Fn=g,gT(g,i)}mT(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)pT(i),i=i.sibling}function pT(i){switch(i.tag){case 0:case 11:case 15:Xu(i),i.flags&2048&&Gi(9,i,i.return);break;case 3:Xu(i);break;case 12:Xu(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Sf(i)):Xu(i);break;default:Xu(i)}}function Sf(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var g=o[c];Fn=g,gT(g,i)}mT(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Gi(8,o,o.return),Sf(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Sf(o));break;default:Sf(o)}i=i.sibling}}function gT(i,o){for(;Fn!==null;){var c=Fn;switch(c.tag){case 0:case 11:case 15:Gi(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var g=c.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Ou(c.memoizedState.cache)}if(g=c.child,g!==null)g.return=c,Fn=g;else e:for(c=i;Fn!==null;){g=Fn;var v=g.sibling,T=g.return;if(aT(g),g===c){Fn=null;break e}if(v!==null){v.return=T,Fn=v;break e}Fn=T}}}var YO={getCacheForType:function(i){var o=Qn(_n),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return Qn(_n).controller.signal}},GO=typeof WeakMap=="function"?WeakMap:Map,Ft=0,nn=null,kt=null,Ot=0,Vt=0,zr=null,Ki=!1,gl=!1,eg=!1,hi=0,En=0,Xi=0,Qa=0,tg=0,Ur=0,bl=0,Wu=null,Cr=null,ng=!1,Cf=0,bT=0,wf=1/0,kf=null,Wi=null,Pn=0,Qi=null,xl=null,mi=0,rg=0,sg=null,xT=null,Qu=0,ig=null;function Hr(){return(Ft&2)!==0&&Ot!==0?Ot&-Ot:z.T!==null?dg():yn()}function yT(){if(Ur===0)if((Ot&536870912)===0||Dt){var i=Zt;Zt<<=1,(Zt&3932160)===0&&(Zt=262144),Ur=i}else Ur=536870912;return i=Pr.current,i!==null&&(i.flags|=32),Ur}function wr(i,o,c){(i===nn&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)&&(yl(i,0),Zi(i,Ot,Ur,!1)),vt(i,c),((Ft&2)===0||i!==nn)&&(i===nn&&((Ft&2)===0&&(Qa|=c),En===4&&Zi(i,Ot,Ur,!1)),Ls(i))}function vT(i,o,c){if((Ft&6)!==0)throw Error(r(327));var g=!c&&(o&127)===0&&(o&i.expiredLanes)===0||yt(i,o),v=g?WO(i,o):og(i,o,!0),T=g;do{if(v===0){gl&&!g&&Zi(i,o,0,!1);break}else{if(c=i.current.alternate,T&&!KO(c)){v=og(i,o,!1),T=!1;continue}if(v===2){if(T=o,i.errorRecoveryDisabledLanes&T)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){o=I;e:{var U=i;v=Wu;var se=U.current.memoizedState.isDehydrated;if(se&&(yl(U,I).flags|=256),I=og(U,I,!1),I!==2){if(eg&&!se){U.errorRecoveryDisabledLanes|=T,Qa|=T,v=4;break e}T=Cr,Cr=v,T!==null&&(Cr===null?Cr=T:Cr.push.apply(Cr,T))}v=I}if(T=!1,v!==2)continue}}if(v===1){yl(i,0),Zi(i,o,0,!0);break}e:{switch(g=i,T=v,T){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Zi(g,o,Ur,!Ki);break e;case 2:Cr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(v=Cf+300-oe(),10<v)){if(Zi(g,o,Ur,!Ki),Xe(g,0,!0)!==0)break e;mi=o,g.timeoutHandle=QT(ET.bind(null,g,c,Cr,kf,ng,o,Ur,Qa,bl,Ki,T,"Throttled",-0,0),v);break e}ET(g,c,Cr,kf,ng,o,Ur,Qa,bl,Ki,T,null,-0,0)}}break}while(!0);Ls(i)}function ET(i,o,c,g,v,T,I,U,se,be,Ne,Re,ye,Ce){if(i.timeoutHandle=-1,Re=o.subtreeFlags,Re&8192||(Re&16785408)===16785408){Re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Js},hT(o,T,Re);var Ze=(T&62914560)===T?Cf-oe():(T&4194048)===T?bT-oe():0;if(Ze=OM(Re,Ze),Ze!==null){mi=T,i.cancelPendingCommit=Ze(_T.bind(null,i,o,T,c,g,v,I,U,se,Ne,Re,null,ye,Ce)),Zi(i,T,I,!be);return}}_T(i,o,T,c,g,v,I,U,se)}function KO(i){for(var o=i;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var g=0;g<c.length;g++){var v=c[g],T=v.getSnapshot;v=v.value;try{if(!Dr(T(),v))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Zi(i,o,c,g){o&=~tg,o&=~Qa,i.suspendedLanes|=o,i.pingedLanes&=~o,g&&(i.warmLanes|=o),g=i.expirationTimes;for(var v=o;0<v;){var T=31-qe(v),I=1<<T;g[T]=-1,v&=~I}c!==0&&yr(i,c,o)}function Nf(){return(Ft&6)===0?(Zu(0),!1):!0}function ag(){if(kt!==null){if(Vt===0)var i=kt.return;else i=kt,ri=Fa=null,T0(i),ul=null,Lu=0,i=kt;for(;i!==null;)Z2(i.alternate,i),i=i.return;kt=null}}function yl(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,mM(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),mi=0,ag(),nn=i,kt=c=ti(i.current,null),Ot=o,Vt=0,zr=null,Ki=!1,gl=yt(i,o),eg=!1,bl=Ur=tg=Qa=Xi=En=0,Cr=Wu=null,ng=!1,(o&8)!==0&&(o|=o&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=o;0<g;){var v=31-qe(g),T=1<<v;o|=i[v],g&=~T}return hi=o,Gd(),c}function TT(i,o){bt=null,z.H=Fu,o===ll||o===tf?(o=BE(),Vt=3):o===c0?(o=BE(),Vt=4):Vt=o===B0?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,zr=o,kt===null&&(En=1,gf(i,Zr(o,i.current)))}function ST(){var i=Pr.current;return i===null?!0:(Ot&4194048)===Ot?ns===null:(Ot&62914560)===Ot||(Ot&536870912)!==0?i===ns:!1}function CT(){var i=z.H;return z.H=Fu,i===null?Fu:i}function wT(){var i=z.A;return z.A=YO,i}function Af(){En=4,Ki||(Ot&4194048)!==Ot&&Pr.current!==null||(gl=!0),(Xi&134217727)===0&&(Qa&134217727)===0||nn===null||Zi(nn,Ot,Ur,!1)}function og(i,o,c){var g=Ft;Ft|=2;var v=CT(),T=wT();(nn!==i||Ot!==o)&&(kf=null,yl(i,o)),o=!1;var I=En;e:do try{if(Vt!==0&&kt!==null){var U=kt,se=zr;switch(Vt){case 8:ag(),I=6;break e;case 3:case 2:case 9:case 6:Pr.current===null&&(o=!0);var be=Vt;if(Vt=0,zr=null,vl(i,U,se,be),c&&gl){I=0;break e}break;default:be=Vt,Vt=0,zr=null,vl(i,U,se,be)}}XO(),I=En;break}catch(Ne){TT(i,Ne)}while(!0);return o&&i.shellSuspendCounter++,ri=Fa=null,Ft=g,z.H=v,z.A=T,kt===null&&(nn=null,Ot=0,Gd()),I}function XO(){for(;kt!==null;)kT(kt)}function WO(i,o){var c=Ft;Ft|=2;var g=CT(),v=wT();nn!==i||Ot!==o?(kf=null,wf=oe()+500,yl(i,o)):gl=yt(i,o);e:do try{if(Vt!==0&&kt!==null){o=kt;var T=zr;t:switch(Vt){case 1:Vt=0,zr=null,vl(i,o,T,1);break;case 2:case 9:if(jE(T)){Vt=0,zr=null,NT(o);break}o=function(){Vt!==2&&Vt!==9||nn!==i||(Vt=7),Ls(i)},T.then(o,o);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:jE(T)?(Vt=0,zr=null,NT(o)):(Vt=0,zr=null,vl(i,o,T,7));break;case 5:var I=null;switch(kt.tag){case 26:I=kt.memoizedState;case 5:case 27:var U=kt;if(I?fS(I):U.stateNode.complete){Vt=0,zr=null;var se=U.sibling;if(se!==null)kt=se;else{var be=U.return;be!==null?(kt=be,_f(be)):kt=null}break t}}Vt=0,zr=null,vl(i,o,T,5);break;case 6:Vt=0,zr=null,vl(i,o,T,6);break;case 8:ag(),En=6;break e;default:throw Error(r(462))}}QO();break}catch(Ne){TT(i,Ne)}while(!0);return ri=Fa=null,z.H=g,z.A=v,Ft=c,kt!==null?0:(nn=null,Ot=0,Gd(),En)}function QO(){for(;kt!==null&&!ee();)kT(kt)}function kT(i){var o=W2(i.alternate,i,hi);i.memoizedProps=i.pendingProps,o===null?_f(i):kt=o}function NT(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=V2(c,o,o.pendingProps,o.type,void 0,Ot);break;case 11:o=V2(c,o,o.pendingProps,o.type.render,o.ref,Ot);break;case 5:T0(o);default:Z2(c,o),o=kt=wE(o,hi),o=W2(c,o,hi)}i.memoizedProps=i.pendingProps,o===null?_f(i):kt=o}function vl(i,o,c,g){ri=Fa=null,T0(o),ul=null,Lu=0;var v=o.return;try{if(zO(i,v,o,c,Ot)){En=1,gf(i,Zr(c,i.current)),kt=null;return}}catch(T){if(v!==null)throw kt=v,T;En=1,gf(i,Zr(c,i.current)),kt=null;return}o.flags&32768?(Dt||g===1?i=!0:gl||(Ot&536870912)!==0?i=!1:(Ki=i=!0,(g===2||g===9||g===3||g===6)&&(g=Pr.current,g!==null&&g.tag===13&&(g.flags|=16384))),AT(o,i)):_f(o)}function _f(i){var o=i;do{if((o.flags&32768)!==0){AT(o,Ki);return}i=o.return;var c=FO(o.alternate,o,hi);if(c!==null){kt=c;return}if(o=o.sibling,o!==null){kt=o;return}kt=o=i}while(o!==null);En===0&&(En=5)}function AT(i,o){do{var c=$O(i.alternate,i);if(c!==null){c.flags&=32767,kt=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){kt=i;return}kt=i=c}while(i!==null);En=6,kt=null}function _T(i,o,c,g,v,T,I,U,se){i.cancelPendingCommit=null;do Rf();while(Pn!==0);if((Ft&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(T=o.lanes|o.childLanes,T|=Xp,ln(i,c,T,I,U,se),i===nn&&(kt=nn=null,Ot=0),xl=o,Qi=i,mi=c,rg=T,sg=v,xT=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,tM(J,function(){return LT(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=z.T,z.T=null,v=V.p,V.p=2,I=Ft,Ft|=4;try{VO(i,o,c)}finally{Ft=I,V.p=v,z.T=g}}Pn=1,RT(),IT(),OT()}}function RT(){if(Pn===1){Pn=0;var i=Qi,o=xl,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=z.T,z.T=null;var g=V.p;V.p=2;var v=Ft;Ft|=4;try{cT(o,i);var T=yg,I=gE(i.containerInfo),U=T.focusedElem,se=T.selectionRange;if(I!==U&&U&&U.ownerDocument&&pE(U.ownerDocument.documentElement,U)){if(se!==null&&Vp(U)){var be=se.start,Ne=se.end;if(Ne===void 0&&(Ne=be),"selectionStart"in U)U.selectionStart=be,U.selectionEnd=Math.min(Ne,U.value.length);else{var Re=U.ownerDocument||document,ye=Re&&Re.defaultView||window;if(ye.getSelection){var Ce=ye.getSelection(),Ze=U.textContent.length,at=Math.min(se.start,Ze),Xt=se.end===void 0?at:Math.min(se.end,Ze);!Ce.extend&&at>Xt&&(I=Xt,Xt=at,at=I);var he=mE(U,at),ue=mE(U,Xt);if(he&&ue&&(Ce.rangeCount!==1||Ce.anchorNode!==he.node||Ce.anchorOffset!==he.offset||Ce.focusNode!==ue.node||Ce.focusOffset!==ue.offset)){var ge=Re.createRange();ge.setStart(he.node,he.offset),Ce.removeAllRanges(),at>Xt?(Ce.addRange(ge),Ce.extend(ue.node,ue.offset)):(ge.setEnd(ue.node,ue.offset),Ce.addRange(ge))}}}}for(Re=[],Ce=U;Ce=Ce.parentNode;)Ce.nodeType===1&&Re.push({element:Ce,left:Ce.scrollLeft,top:Ce.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<Re.length;U++){var Ae=Re[U];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}Ff=!!xg,yg=xg=null}finally{Ft=v,V.p=g,z.T=c}}i.current=o,Pn=2}}function IT(){if(Pn===2){Pn=0;var i=Qi,o=xl,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=z.T,z.T=null;var g=V.p;V.p=2;var v=Ft;Ft|=4;try{iT(i,o.alternate,o)}finally{Ft=v,V.p=g,z.T=c}}Pn=3}}function OT(){if(Pn===4||Pn===3){Pn=0,me();var i=Qi,o=xl,c=mi,g=xT;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Pn=5:(Pn=0,xl=Qi=null,MT(i,i.pendingLanes));var v=i.pendingLanes;if(v===0&&(Wi=null),It(c),o=o.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(tt,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=z.T,v=V.p,V.p=2,z.T=null;try{for(var T=i.onRecoverableError,I=0;I<g.length;I++){var U=g[I];T(U.value,{componentStack:U.stack})}}finally{z.T=o,V.p=v}}(mi&3)!==0&&Rf(),Ls(i),v=i.pendingLanes,(c&261930)!==0&&(v&42)!==0?i===ig?Qu++:(Qu=0,ig=i):Qu=0,Zu(0)}}function MT(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,Ou(o)))}function Rf(){return RT(),IT(),OT(),LT()}function LT(){if(Pn!==5)return!1;var i=Qi,o=rg;rg=0;var c=It(mi),g=z.T,v=V.p;try{V.p=32>c?32:c,z.T=null,c=sg,sg=null;var T=Qi,I=mi;if(Pn=0,xl=Qi=null,mi=0,(Ft&6)!==0)throw Error(r(331));var U=Ft;if(Ft|=4,pT(T.current),fT(T,T.current,I,c),Ft=U,Zu(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(tt,T)}catch{}return!0}finally{V.p=v,z.T=g,MT(i,o)}}function DT(i,o,c){o=Zr(c,o),o=P0(i.stateNode,o,2),i=Vi(i,o,2),i!==null&&(vt(i,2),Ls(i))}function qt(i,o,c){if(i.tag===3)DT(i,i,c);else for(;o!==null;){if(o.tag===3){DT(o,i,c);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Wi===null||!Wi.has(g))){i=Zr(c,i),c=j2(2),g=Vi(o,c,2),g!==null&&(P2(c,g,o,i),vt(g,2),Ls(g));break}}o=o.return}}function lg(i,o,c){var g=i.pingCache;if(g===null){g=i.pingCache=new GO;var v=new Set;g.set(o,v)}else v=g.get(o),v===void 0&&(v=new Set,g.set(o,v));v.has(c)||(eg=!0,v.add(c),i=ZO.bind(null,i,o,c),o.then(i,i))}function ZO(i,o,c){var g=i.pingCache;g!==null&&g.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,nn===i&&(Ot&c)===c&&(En===4||En===3&&(Ot&62914560)===Ot&&300>oe()-Cf?(Ft&2)===0&&yl(i,0):tg|=c,bl===Ot&&(bl=0)),Ls(i)}function jT(i,o){o===0&&(o=en()),i=za(i,o),i!==null&&(vt(i,o),Ls(i))}function JO(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),jT(i,c)}function eM(i,o){var c=0;switch(i.tag){case 31:case 13:var g=i.stateNode,v=i.memoizedState;v!==null&&(c=v.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(o),jT(i,c)}function tM(i,o){return Ie(i,o)}var If=null,El=null,ug=!1,Of=!1,cg=!1,Ji=0;function Ls(i){i!==El&&i.next===null&&(El===null?If=El=i:El=El.next=i),Of=!0,ug||(ug=!0,rM())}function Zu(i,o){if(!cg&&Of){cg=!0;do for(var c=!1,g=If;g!==null;){if(i!==0){var v=g.pendingLanes;if(v===0)var T=0;else{var I=g.suspendedLanes,U=g.pingedLanes;T=(1<<31-qe(42|i)+1)-1,T&=v&~(I&~U),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(c=!0,UT(g,T))}else T=Ot,T=Xe(g,g===nn?T:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(T&3)===0||yt(g,T)||(c=!0,UT(g,T));g=g.next}while(c);cg=!1}}function nM(){PT()}function PT(){Of=ug=!1;var i=0;Ji!==0&&hM()&&(i=Ji);for(var o=oe(),c=null,g=If;g!==null;){var v=g.next,T=BT(g,o);T===0?(g.next=null,c===null?If=v:c.next=v,v===null&&(El=c)):(c=g,(i!==0||(T&3)!==0)&&(Of=!0)),g=v}Pn!==0&&Pn!==5||Zu(i),Ji!==0&&(Ji=0)}function BT(i,o){for(var c=i.suspendedLanes,g=i.pingedLanes,v=i.expirationTimes,T=i.pendingLanes&-62914561;0<T;){var I=31-qe(T),U=1<<I,se=v[I];se===-1?((U&c)===0||(U&g)!==0)&&(v[I]=Ht(U,o)):se<=o&&(i.expiredLanes|=U),T&=~U}if(o=nn,c=Ot,c=Xe(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,c===0||i===o&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&je(g),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||yt(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(g!==null&&je(g),It(c)){case 2:case 8:c=F;break;case 32:c=J;break;case 268435456:c=_e;break;default:c=J}return g=zT.bind(null,i),c=Ie(c,g),i.callbackPriority=o,i.callbackNode=c,o}return g!==null&&g!==null&&je(g),i.callbackPriority=2,i.callbackNode=null,2}function zT(i,o){if(Pn!==0&&Pn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(Rf()&&i.callbackNode!==c)return null;var g=Ot;return g=Xe(i,i===nn?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(vT(i,g,o),BT(i,oe()),i.callbackNode!=null&&i.callbackNode===c?zT.bind(null,i):null)}function UT(i,o){if(Rf())return null;vT(i,o,!0)}function rM(){pM(function(){(Ft&6)!==0?Ie(G,nM):PT()})}function dg(){if(Ji===0){var i=al;i===0&&(i=Lt,Lt<<=1,(Lt&261888)===0&&(Lt=256)),Ji=i}return Ji}function HT(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:zd(""+i)}function FT(i,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,i.id&&c.setAttribute("form",i.id),o.parentNode.insertBefore(c,o),i=new FormData(i),c.parentNode.removeChild(c),i}function sM(i,o,c,g,v){if(o==="submit"&&c&&c.stateNode===v){var T=HT((v[Xn]||null).action),I=g.submitter;I&&(o=(o=I[Xn]||null)?HT(o.formAction):I.getAttribute("formAction"),o!==null&&(T=o,I=null));var U=new $d("action","action",null,g,v);i.push({event:U,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ji!==0){var se=I?FT(v,I):new FormData(v);I0(c,{pending:!0,data:se,method:v.method,action:T},null,se)}}else typeof T=="function"&&(U.preventDefault(),se=I?FT(v,I):new FormData(v),I0(c,{pending:!0,data:se,method:v.method,action:T},T,se))},currentTarget:v}]})}}for(var fg=0;fg<Kp.length;fg++){var hg=Kp[fg],iM=hg.toLowerCase(),aM=hg[0].toUpperCase()+hg.slice(1);gs(iM,"on"+aM)}gs(yE,"onAnimationEnd"),gs(vE,"onAnimationIteration"),gs(EE,"onAnimationStart"),gs("dblclick","onDoubleClick"),gs("focusin","onFocus"),gs("focusout","onBlur"),gs(TO,"onTransitionRun"),gs(SO,"onTransitionStart"),gs(CO,"onTransitionCancel"),gs(TE,"onTransitionEnd"),Yo("onMouseEnter",["mouseout","mouseover"]),Yo("onMouseLeave",["mouseout","mouseover"]),Yo("onPointerEnter",["pointerout","pointerover"]),Yo("onPointerLeave",["pointerout","pointerover"]),Da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Da("onBeforeInput",["compositionend","keypress","textInput","paste"]),Da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ju="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(" "),oM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ju));function $T(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var g=i[c],v=g.event;g=g.listeners;e:{var T=void 0;if(o)for(var I=g.length-1;0<=I;I--){var U=g[I],se=U.instance,be=U.currentTarget;if(U=U.listener,se!==T&&v.isPropagationStopped())break e;T=U,v.currentTarget=be;try{T(v)}catch(Ne){Yd(Ne)}v.currentTarget=null,T=se}else for(I=0;I<g.length;I++){if(U=g[I],se=U.instance,be=U.currentTarget,U=U.listener,se!==T&&v.isPropagationStopped())break e;T=U,v.currentTarget=be;try{T(v)}catch(Ne){Yd(Ne)}v.currentTarget=null,T=se}}}}function Nt(i,o){var c=o[xu];c===void 0&&(c=o[xu]=new Set);var g=i+"__bubble";c.has(g)||(VT(o,i,2,!1),c.add(g))}function mg(i,o,c){var g=0;o&&(g|=4),VT(c,i,g,o)}var Mf="_reactListening"+Math.random().toString(36).slice(2);function pg(i){if(!i[Mf]){i[Mf]=!0,Pv.forEach(function(c){c!=="selectionchange"&&(oM.has(c)||mg(c,!1,i),mg(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Mf]||(o[Mf]=!0,mg("selectionchange",!1,o))}}function VT(i,o,c,g){switch(yS(o)){case 2:var v=DM;break;case 8:v=jM;break;default:v=Rg}c=v.bind(null,o,c,i),v=void 0,!Dp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(v=!0),g?v!==void 0?i.addEventListener(o,c,{capture:!0,passive:v}):i.addEventListener(o,c,!0):v!==void 0?i.addEventListener(o,c,{passive:v}):i.addEventListener(o,c,!1)}function gg(i,o,c,g,v){var T=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var U=g.stateNode.containerInfo;if(U===v)break;if(I===4)for(I=g.return;I!==null;){var se=I.tag;if((se===3||se===4)&&I.stateNode.containerInfo===v)return;I=I.return}for(;U!==null;){if(I=$o(U),I===null)return;if(se=I.tag,se===5||se===6||se===26||se===27){g=T=I;continue e}U=U.parentNode}}g=g.return}Xv(function(){var be=T,Ne=Mp(c),Re=[];e:{var ye=SE.get(i);if(ye!==void 0){var Ce=$d,Ze=i;switch(i){case"keypress":if(Hd(c)===0)break e;case"keydown":case"keyup":Ce=eO;break;case"focusin":Ze="focus",Ce=zp;break;case"focusout":Ze="blur",Ce=zp;break;case"beforeblur":case"afterblur":Ce=zp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ce=Zv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ce=FI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ce=rO;break;case yE:case vE:case EE:Ce=qI;break;case TE:Ce=iO;break;case"scroll":case"scrollend":Ce=UI;break;case"wheel":Ce=oO;break;case"copy":case"cut":case"paste":Ce=GI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ce=eE;break;case"toggle":case"beforetoggle":Ce=uO}var at=(o&4)!==0,Xt=!at&&(i==="scroll"||i==="scrollend"),he=at?ye!==null?ye+"Capture":null:ye;at=[];for(var ue=be,ge;ue!==null;){var Ae=ue;if(ge=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||ge===null||he===null||(Ae=Eu(ue,he),Ae!=null&&at.push(ec(ue,Ae,ge))),Xt)break;ue=ue.return}0<at.length&&(ye=new Ce(ye,Ze,null,c,Ne),Re.push({event:ye,listeners:at}))}}if((o&7)===0){e:{if(ye=i==="mouseover"||i==="pointerover",Ce=i==="mouseout"||i==="pointerout",ye&&c!==Op&&(Ze=c.relatedTarget||c.fromElement)&&($o(Ze)||Ze[Rs]))break e;if((Ce||ye)&&(ye=Ne.window===Ne?Ne:(ye=Ne.ownerDocument)?ye.defaultView||ye.parentWindow:window,Ce?(Ze=c.relatedTarget||c.toElement,Ce=be,Ze=Ze?$o(Ze):null,Ze!==null&&(Xt=a(Ze),at=Ze.tag,Ze!==Xt||at!==5&&at!==27&&at!==6)&&(Ze=null)):(Ce=null,Ze=be),Ce!==Ze)){if(at=Zv,Ae="onMouseLeave",he="onMouseEnter",ue="mouse",(i==="pointerout"||i==="pointerover")&&(at=eE,Ae="onPointerLeave",he="onPointerEnter",ue="pointer"),Xt=Ce==null?ye:vu(Ce),ge=Ze==null?ye:vu(Ze),ye=new at(Ae,ue+"leave",Ce,c,Ne),ye.target=Xt,ye.relatedTarget=ge,Ae=null,$o(Ne)===be&&(at=new at(he,ue+"enter",Ze,c,Ne),at.target=ge,at.relatedTarget=Xt,Ae=at),Xt=Ae,Ce&&Ze)t:{for(at=lM,he=Ce,ue=Ze,ge=0,Ae=he;Ae;Ae=at(Ae))ge++;Ae=0;for(var st=ue;st;st=at(st))Ae++;for(;0<ge-Ae;)he=at(he),ge--;for(;0<Ae-ge;)ue=at(ue),Ae--;for(;ge--;){if(he===ue||ue!==null&&he===ue.alternate){at=he;break t}he=at(he),ue=at(ue)}at=null}else at=null;Ce!==null&&qT(Re,ye,Ce,at,!1),Ze!==null&&Xt!==null&&qT(Re,Xt,Ze,at,!0)}}e:{if(ye=be?vu(be):window,Ce=ye.nodeName&&ye.nodeName.toLowerCase(),Ce==="select"||Ce==="input"&&ye.type==="file")var zt=lE;else if(aE(ye))if(uE)zt=yO;else{zt=bO;var et=gO}else Ce=ye.nodeName,!Ce||Ce.toLowerCase()!=="input"||ye.type!=="checkbox"&&ye.type!=="radio"?be&&Ip(be.elementType)&&(zt=lE):zt=xO;if(zt&&(zt=zt(i,be))){oE(Re,zt,c,Ne);break e}et&&et(i,ye,be),i==="focusout"&&be&&ye.type==="number"&&be.memoizedProps.value!=null&&Rp(ye,"number",ye.value)}switch(et=be?vu(be):window,i){case"focusin":(aE(et)||et.contentEditable==="true")&&(Zo=et,qp=be,_u=null);break;case"focusout":_u=qp=Zo=null;break;case"mousedown":Yp=!0;break;case"contextmenu":case"mouseup":case"dragend":Yp=!1,bE(Re,c,Ne);break;case"selectionchange":if(EO)break;case"keydown":case"keyup":bE(Re,c,Ne)}var xt;if(Hp)e:{switch(i){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else Qo?sE(i,c)&&(Mt="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Mt="onCompositionStart");Mt&&(tE&&c.locale!=="ko"&&(Qo||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&Qo&&(xt=Wv()):(Pi=Ne,jp="value"in Pi?Pi.value:Pi.textContent,Qo=!0)),et=Lf(be,Mt),0<et.length&&(Mt=new Jv(Mt,i,null,c,Ne),Re.push({event:Mt,listeners:et}),xt?Mt.data=xt:(xt=iE(c),xt!==null&&(Mt.data=xt)))),(xt=dO?fO(i,c):hO(i,c))&&(Mt=Lf(be,"onBeforeInput"),0<Mt.length&&(et=new Jv("onBeforeInput","beforeinput",null,c,Ne),Re.push({event:et,listeners:Mt}),et.data=xt)),sM(Re,i,be,c,Ne)}$T(Re,o)})}function ec(i,o,c){return{instance:i,listener:o,currentTarget:c}}function Lf(i,o){for(var c=o+"Capture",g=[];i!==null;){var v=i,T=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||T===null||(v=Eu(i,c),v!=null&&g.unshift(ec(i,v,T)),v=Eu(i,o),v!=null&&g.push(ec(i,v,T))),i.tag===3)return g;i=i.return}return[]}function lM(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function qT(i,o,c,g,v){for(var T=o._reactName,I=[];c!==null&&c!==g;){var U=c,se=U.alternate,be=U.stateNode;if(U=U.tag,se!==null&&se===g)break;U!==5&&U!==26&&U!==27||be===null||(se=be,v?(be=Eu(c,T),be!=null&&I.unshift(ec(c,be,se))):v||(be=Eu(c,T),be!=null&&I.push(ec(c,be,se)))),c=c.return}I.length!==0&&i.push({event:o,listeners:I})}var uM=/\r\n?/g,cM=/\u0000|\uFFFD/g;function YT(i){return(typeof i=="string"?i:""+i).replace(uM,`
50
- `).replace(cM,"")}function GT(i,o){return o=YT(o),YT(i)===o}function Kt(i,o,c,g,v,T){switch(c){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||Ko(i,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&Ko(i,""+g);break;case"className":Pd(i,"class",g);break;case"tabIndex":Pd(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Pd(i,c,g);break;case"style":Gv(i,g,T);break;case"data":if(o!=="object"){Pd(i,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||c!=="href")){i.removeAttribute(c);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=zd(""+g),i.setAttribute(c,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(c,"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 T=="function"&&(c==="formAction"?(o!=="input"&&Kt(i,o,"name",v.name,v,null),Kt(i,o,"formEncType",v.formEncType,v,null),Kt(i,o,"formMethod",v.formMethod,v,null),Kt(i,o,"formTarget",v.formTarget,v,null)):(Kt(i,o,"encType",v.encType,v,null),Kt(i,o,"method",v.method,v,null),Kt(i,o,"target",v.target,v,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=zd(""+g),i.setAttribute(c,g);break;case"onClick":g!=null&&(i.onclick=Js);break;case"onScroll":g!=null&&Nt("scroll",i);break;case"onScrollEnd":g!=null&&Nt("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(c=g.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}c=zd(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(c,""+g):i.removeAttribute(c);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":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":g===!0?i.setAttribute(c,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(c,g):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(c,g):i.removeAttribute(c);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(c):i.setAttribute(c,g);break;case"popover":Nt("beforetoggle",i),Nt("toggle",i),jd(i,"popover",g);break;case"xlinkActuate":Zs(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Zs(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Zs(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Zs(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Zs(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Zs(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Zs(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Zs(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Zs(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":jd(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=BI.get(c)||c,jd(i,c,g))}}function bg(i,o,c,g,v,T){switch(c){case"style":Gv(i,g,T);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(c=g.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof g=="string"?Ko(i,g):(typeof g=="number"||typeof g=="bigint")&&Ko(i,""+g);break;case"onScroll":g!=null&&Nt("scroll",i);break;case"onScrollEnd":g!=null&&Nt("scrollend",i);break;case"onClick":g!=null&&(i.onclick=Js);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bv.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),o=c.slice(2,v?c.length-7:void 0),T=i[Xn]||null,T=T!=null?T[c]:null,typeof T=="function"&&i.removeEventListener(o,T,v),typeof g=="function")){typeof T!="function"&&T!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,g,v);break e}c in i?i[c]=g:g===!0?i.setAttribute(c,""):jd(i,c,g)}}}function Jn(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Nt("error",i),Nt("load",i);var g=!1,v=!1,T;for(T in c)if(c.hasOwnProperty(T)){var I=c[T];if(I!=null)switch(T){case"src":g=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Kt(i,o,T,I,c,null)}}v&&Kt(i,o,"srcSet",c.srcSet,c,null),g&&Kt(i,o,"src",c.src,c,null);return;case"input":Nt("invalid",i);var U=T=I=v=null,se=null,be=null;for(g in c)if(c.hasOwnProperty(g)){var Ne=c[g];if(Ne!=null)switch(g){case"name":v=Ne;break;case"type":I=Ne;break;case"checked":se=Ne;break;case"defaultChecked":be=Ne;break;case"value":T=Ne;break;case"defaultValue":U=Ne;break;case"children":case"dangerouslySetInnerHTML":if(Ne!=null)throw Error(r(137,o));break;default:Kt(i,o,g,Ne,c,null)}}$v(i,T,U,se,be,I,v,!1);return;case"select":Nt("invalid",i),g=I=T=null;for(v in c)if(c.hasOwnProperty(v)&&(U=c[v],U!=null))switch(v){case"value":T=U;break;case"defaultValue":I=U;break;case"multiple":g=U;default:Kt(i,o,v,U,c,null)}o=T,c=I,i.multiple=!!g,o!=null?Go(i,!!g,o,!1):c!=null&&Go(i,!!g,c,!0);return;case"textarea":Nt("invalid",i),T=v=g=null;for(I in c)if(c.hasOwnProperty(I)&&(U=c[I],U!=null))switch(I){case"value":g=U;break;case"defaultValue":v=U;break;case"children":T=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(91));break;default:Kt(i,o,I,U,c,null)}qv(i,g,v,T);return;case"option":for(se in c)if(c.hasOwnProperty(se)&&(g=c[se],g!=null))switch(se){case"selected":i.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Kt(i,o,se,g,c,null)}return;case"dialog":Nt("beforetoggle",i),Nt("toggle",i),Nt("cancel",i),Nt("close",i);break;case"iframe":case"object":Nt("load",i);break;case"video":case"audio":for(g=0;g<Ju.length;g++)Nt(Ju[g],i);break;case"image":Nt("error",i),Nt("load",i);break;case"details":Nt("toggle",i);break;case"embed":case"source":case"link":Nt("error",i),Nt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(be in c)if(c.hasOwnProperty(be)&&(g=c[be],g!=null))switch(be){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Kt(i,o,be,g,c,null)}return;default:if(Ip(o)){for(Ne in c)c.hasOwnProperty(Ne)&&(g=c[Ne],g!==void 0&&bg(i,o,Ne,g,c,void 0));return}}for(U in c)c.hasOwnProperty(U)&&(g=c[U],g!=null&&Kt(i,o,U,g,c,null))}function dM(i,o,c,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,T=null,I=null,U=null,se=null,be=null,Ne=null;for(Ce in c){var Re=c[Ce];if(c.hasOwnProperty(Ce)&&Re!=null)switch(Ce){case"checked":break;case"value":break;case"defaultValue":se=Re;default:g.hasOwnProperty(Ce)||Kt(i,o,Ce,null,g,Re)}}for(var ye in g){var Ce=g[ye];if(Re=c[ye],g.hasOwnProperty(ye)&&(Ce!=null||Re!=null))switch(ye){case"type":T=Ce;break;case"name":v=Ce;break;case"checked":be=Ce;break;case"defaultChecked":Ne=Ce;break;case"value":I=Ce;break;case"defaultValue":U=Ce;break;case"children":case"dangerouslySetInnerHTML":if(Ce!=null)throw Error(r(137,o));break;default:Ce!==Re&&Kt(i,o,ye,Ce,g,Re)}}_p(i,I,U,se,be,Ne,T,v);return;case"select":Ce=I=U=ye=null;for(T in c)if(se=c[T],c.hasOwnProperty(T)&&se!=null)switch(T){case"value":break;case"multiple":Ce=se;default:g.hasOwnProperty(T)||Kt(i,o,T,null,g,se)}for(v in g)if(T=g[v],se=c[v],g.hasOwnProperty(v)&&(T!=null||se!=null))switch(v){case"value":ye=T;break;case"defaultValue":U=T;break;case"multiple":I=T;default:T!==se&&Kt(i,o,v,T,g,se)}o=U,c=I,g=Ce,ye!=null?Go(i,!!c,ye,!1):!!g!=!!c&&(o!=null?Go(i,!!c,o,!0):Go(i,!!c,c?[]:"",!1));return;case"textarea":Ce=ye=null;for(U in c)if(v=c[U],c.hasOwnProperty(U)&&v!=null&&!g.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Kt(i,o,U,null,g,v)}for(I in g)if(v=g[I],T=c[I],g.hasOwnProperty(I)&&(v!=null||T!=null))switch(I){case"value":ye=v;break;case"defaultValue":Ce=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==T&&Kt(i,o,I,v,g,T)}Vv(i,ye,Ce);return;case"option":for(var Ze in c)if(ye=c[Ze],c.hasOwnProperty(Ze)&&ye!=null&&!g.hasOwnProperty(Ze))switch(Ze){case"selected":i.selected=!1;break;default:Kt(i,o,Ze,null,g,ye)}for(se in g)if(ye=g[se],Ce=c[se],g.hasOwnProperty(se)&&ye!==Ce&&(ye!=null||Ce!=null))switch(se){case"selected":i.selected=ye&&typeof ye!="function"&&typeof ye!="symbol";break;default:Kt(i,o,se,ye,g,Ce)}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 at in c)ye=c[at],c.hasOwnProperty(at)&&ye!=null&&!g.hasOwnProperty(at)&&Kt(i,o,at,null,g,ye);for(be in g)if(ye=g[be],Ce=c[be],g.hasOwnProperty(be)&&ye!==Ce&&(ye!=null||Ce!=null))switch(be){case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,o));break;default:Kt(i,o,be,ye,g,Ce)}return;default:if(Ip(o)){for(var Xt in c)ye=c[Xt],c.hasOwnProperty(Xt)&&ye!==void 0&&!g.hasOwnProperty(Xt)&&bg(i,o,Xt,void 0,g,ye);for(Ne in g)ye=g[Ne],Ce=c[Ne],!g.hasOwnProperty(Ne)||ye===Ce||ye===void 0&&Ce===void 0||bg(i,o,Ne,ye,g,Ce);return}}for(var he in c)ye=c[he],c.hasOwnProperty(he)&&ye!=null&&!g.hasOwnProperty(he)&&Kt(i,o,he,null,g,ye);for(Re in g)ye=g[Re],Ce=c[Re],!g.hasOwnProperty(Re)||ye===Ce||ye==null&&Ce==null||Kt(i,o,Re,ye,g,Ce)}function KT(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fM(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,c=performance.getEntriesByType("resource"),g=0;g<c.length;g++){var v=c[g],T=v.transferSize,I=v.initiatorType,U=v.duration;if(T&&U&&KT(I)){for(I=0,U=v.responseEnd,g+=1;g<c.length;g++){var se=c[g],be=se.startTime;if(be>U)break;var Ne=se.transferSize,Re=se.initiatorType;Ne&&KT(Re)&&(se=se.responseEnd,I+=Ne*(se<U?1:(U-be)/(se-be)))}if(--g,o+=8*(T+I)/(v.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var xg=null,yg=null;function Df(i){return i.nodeType===9?i:i.ownerDocument}function XT(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function WT(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function vg(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Eg=null;function hM(){var i=window.event;return i&&i.type==="popstate"?i===Eg?!1:(Eg=i,!0):(Eg=null,!1)}var QT=typeof setTimeout=="function"?setTimeout:void 0,mM=typeof clearTimeout=="function"?clearTimeout:void 0,ZT=typeof Promise=="function"?Promise:void 0,pM=typeof queueMicrotask=="function"?queueMicrotask:typeof ZT<"u"?function(i){return ZT.resolve(null).then(i).catch(gM)}:QT;function gM(i){setTimeout(function(){throw i})}function ea(i){return i==="head"}function JT(i,o){var c=o,g=0;do{var v=c.nextSibling;if(i.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(g===0){i.removeChild(v),wl(o);return}g--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")g++;else if(c==="html")tc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,tc(c);for(var T=c.firstChild;T;){var I=T.nextSibling,U=T.nodeName;T[yu]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&T.rel.toLowerCase()==="stylesheet"||c.removeChild(T),T=I}}else c==="body"&&tc(i.ownerDocument.body);c=v}while(c);wl(o)}function eS(i,o){var c=i;i=0;do{var g=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),g&&g.nodeType===8)if(c=g.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=g}while(c)}function Tg(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Tg(c),Np(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function bM(i,o,c,g){for(;i.nodeType===1;){var v=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[yu])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(T=i.getAttribute("rel"),T==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(T!==v.rel||i.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||i.getAttribute("title")!==(v.title==null?null:v.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(T=i.getAttribute("src"),(T!==(v.src==null?null:v.src)||i.getAttribute("type")!==(v.type==null?null:v.type)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&T&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var T=v.name==null?null:""+v.name;if(v.type==="hidden"&&i.getAttribute("name")===T)return i}else return i;if(i=rs(i.nextSibling),i===null)break}return null}function xM(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=rs(i.nextSibling),i===null))return null;return i}function tS(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=rs(i.nextSibling),i===null))return null;return i}function Sg(i){return i.data==="$?"||i.data==="$~"}function Cg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function yM(i,o){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||c.readyState!=="loading")o();else{var g=function(){o(),c.removeEventListener("DOMContentLoaded",g)};c.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function rs(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var wg=null;function nS(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return rs(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function rS(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return i;o--}else c!=="/$"&&c!=="/&"||o++}i=i.previousSibling}return null}function sS(i,o,c){switch(o=Df(c),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function tc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Np(i)}var ss=new Map,iS=new Set;function jf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var pi=V.d;V.d={f:vM,r:EM,D:TM,C:SM,L:CM,m:wM,X:NM,S:kM,M:AM};function vM(){var i=pi.f(),o=Nf();return i||o}function EM(i){var o=Vo(i);o!==null&&o.tag===5&&o.type==="form"?T2(o):pi.r(i)}var Tl=typeof document>"u"?null:document;function aS(i,o,c){var g=Tl;if(g&&typeof o=="string"&&o){var v=Wr(o);v='link[rel="'+i+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),iS.has(v)||(iS.add(v),i={rel:i,crossOrigin:c,href:o},g.querySelector(v)===null&&(o=g.createElement("link"),Jn(o,"link",i),Hn(o),g.head.appendChild(o)))}}function TM(i){pi.D(i),aS("dns-prefetch",i,null)}function SM(i,o){pi.C(i,o),aS("preconnect",i,o)}function CM(i,o,c){pi.L(i,o,c);var g=Tl;if(g&&i&&o){var v='link[rel="preload"][as="'+Wr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+Wr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+Wr(c.imageSizes)+'"]')):v+='[href="'+Wr(i)+'"]';var T=v;switch(o){case"style":T=Sl(i);break;case"script":T=Cl(i)}ss.has(T)||(i=m({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),ss.set(T,i),g.querySelector(v)!==null||o==="style"&&g.querySelector(nc(T))||o==="script"&&g.querySelector(rc(T))||(o=g.createElement("link"),Jn(o,"link",i),Hn(o),g.head.appendChild(o)))}}function wM(i,o){pi.m(i,o);var c=Tl;if(c&&i){var g=o&&typeof o.as=="string"?o.as:"script",v='link[rel="modulepreload"][as="'+Wr(g)+'"][href="'+Wr(i)+'"]',T=v;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Cl(i)}if(!ss.has(T)&&(i=m({rel:"modulepreload",href:i},o),ss.set(T,i),c.querySelector(v)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(rc(T)))return}g=c.createElement("link"),Jn(g,"link",i),Hn(g),c.head.appendChild(g)}}}function kM(i,o,c){pi.S(i,o,c);var g=Tl;if(g&&i){var v=qo(g).hoistableStyles,T=Sl(i);o=o||"default";var I=v.get(T);if(!I){var U={loading:0,preload:null};if(I=g.querySelector(nc(T)))U.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},c),(c=ss.get(T))&&kg(i,c);var se=I=g.createElement("link");Hn(se),Jn(se,"link",i),se._p=new Promise(function(be,Ne){se.onload=be,se.onerror=Ne}),se.addEventListener("load",function(){U.loading|=1}),se.addEventListener("error",function(){U.loading|=2}),U.loading|=4,Pf(I,o,g)}I={type:"stylesheet",instance:I,count:1,state:U},v.set(T,I)}}}function NM(i,o){pi.X(i,o);var c=Tl;if(c&&i){var g=qo(c).hoistableScripts,v=Cl(i),T=g.get(v);T||(T=c.querySelector(rc(v)),T||(i=m({src:i,async:!0},o),(o=ss.get(v))&&Ng(i,o),T=c.createElement("script"),Hn(T),Jn(T,"link",i),c.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},g.set(v,T))}}function AM(i,o){pi.M(i,o);var c=Tl;if(c&&i){var g=qo(c).hoistableScripts,v=Cl(i),T=g.get(v);T||(T=c.querySelector(rc(v)),T||(i=m({src:i,async:!0,type:"module"},o),(o=ss.get(v))&&Ng(i,o),T=c.createElement("script"),Hn(T),Jn(T,"link",i),c.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},g.set(v,T))}}function oS(i,o,c,g){var v=(v=ce.current)?jf(v):null;if(!v)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Sl(c.href),c=qo(v).hoistableStyles,g=c.get(o),g||(g={type:"style",instance:null,count:0,state:null},c.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Sl(c.href);var T=qo(v).hoistableStyles,I=T.get(i);if(I||(v=v.ownerDocument||v,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(i,I),(T=v.querySelector(nc(i)))&&!T._p&&(I.instance=T,I.state.loading=5),ss.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ss.set(i,c),T||_M(v,i,c,I.state))),o&&g===null)throw Error(r(528,""));return I}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Cl(c),c=qo(v).hoistableScripts,g=c.get(o),g||(g={type:"script",instance:null,count:0,state:null},c.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Sl(i){return'href="'+Wr(i)+'"'}function nc(i){return'link[rel="stylesheet"]['+i+"]"}function lS(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function _M(i,o,c,g){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=i.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),Jn(o,"link",c),Hn(o),i.head.appendChild(o))}function Cl(i){return'[src="'+Wr(i)+'"]'}function rc(i){return"script[async]"+i}function uS(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var g=i.querySelector('style[data-href~="'+Wr(c.href)+'"]');if(g)return o.instance=g,Hn(g),g;var v=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Hn(g),Jn(g,"style",v),Pf(g,c.precedence,i),o.instance=g;case"stylesheet":v=Sl(c.href);var T=i.querySelector(nc(v));if(T)return o.state.loading|=4,o.instance=T,Hn(T),T;g=lS(c),(v=ss.get(v))&&kg(g,v),T=(i.ownerDocument||i).createElement("link"),Hn(T);var I=T;return I._p=new Promise(function(U,se){I.onload=U,I.onerror=se}),Jn(T,"link",g),o.state.loading|=4,Pf(T,c.precedence,i),o.instance=T;case"script":return T=Cl(c.src),(v=i.querySelector(rc(T)))?(o.instance=v,Hn(v),v):(g=c,(v=ss.get(T))&&(g=m({},c),Ng(g,v)),i=i.ownerDocument||i,v=i.createElement("script"),Hn(v),Jn(v,"link",g),i.head.appendChild(v),o.instance=v);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,Pf(g,c.precedence,i));return o.instance}function Pf(i,o,c){for(var g=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=g.length?g[g.length-1]:null,T=v,I=0;I<g.length;I++){var U=g[I];if(U.dataset.precedence===o)T=U;else if(T!==v)break}T?T.parentNode.insertBefore(i,T.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function kg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function Ng(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Bf=null;function cS(i,o,c){if(Bf===null){var g=new Map,v=Bf=new Map;v.set(c,g)}else v=Bf,g=v.get(c),g||(g=new Map,v.set(c,g));if(g.has(i))return g;for(g.set(i,null),c=c.getElementsByTagName(i),v=0;v<c.length;v++){var T=c[v];if(!(T[yu]||T[tn]||i==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var I=T.getAttribute(o)||"";I=i+I;var U=g.get(I);U?U.push(T):g.set(I,[T])}}return g}function dS(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function RM(i,o,c){if(c===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function fS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function IM(i,o,c,g){if(c.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=Sl(g.href),T=o.querySelector(nc(v));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=zf.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=T,Hn(T);return}T=o.ownerDocument||o,g=lS(g),(v=ss.get(v))&&kg(g,v),T=T.createElement("link"),Hn(T);var I=T;I._p=new Promise(function(U,se){I.onload=U,I.onerror=se}),Jn(T,"link",g),c.instance=T}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=zf.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var Ag=0;function OM(i,o){return i.stylesheets&&i.count===0&&Hf(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var g=setTimeout(function(){if(i.stylesheets&&Hf(i,i.stylesheets),i.unsuspend){var T=i.unsuspend;i.unsuspend=null,T()}},6e4+o);0<i.imgBytes&&Ag===0&&(Ag=62500*fM());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Hf(i,i.stylesheets),i.unsuspend)){var T=i.unsuspend;i.unsuspend=null,T()}},(i.imgBytes>Ag?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(v)}}:null}function zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hf(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Uf=null;function Hf(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Uf=new Map,o.forEach(MM,i),Uf=null,zf.call(i))}function MM(i,o){if(!(o.state.loading&4)){var c=Uf.get(i);if(c)var g=c.get(null);else{c=new Map,Uf.set(i,c);for(var v=i.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<v.length;T++){var I=v[T];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(c.set(I.dataset.precedence,I),g=I)}g&&c.set(null,g)}v=o.instance,I=v.getAttribute("data-precedence"),T=c.get(I)||g,T===g&&c.set(null,v),c.set(I,v),this.count++,g=zf.bind(this),v.addEventListener("load",g),v.addEventListener("error",g),T?T.parentNode.insertBefore(v,T.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(v,i.firstChild)),o.state.loading|=4}}var sc={$$typeof:A,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function LM(i,o,c,g,v,T,I,U,se){this.tag=1,this.containerInfo=i,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=Kn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kn(0),this.hiddenUpdates=Kn(null),this.identifierPrefix=g,this.onUncaughtError=v,this.onCaughtError=T,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=se,this.incompleteTransitions=new Map}function hS(i,o,c,g,v,T,I,U,se,be,Ne,Re){return i=new LM(i,o,c,I,se,be,Ne,Re,U),o=1,T===!0&&(o|=24),T=jr(3,null,null,o),i.current=T,T.stateNode=i,o=o0(),o.refCount++,i.pooledCache=o,o.refCount++,T.memoizedState={element:g,isDehydrated:c,cache:o},d0(T),i}function mS(i){return i?(i=tl,i):tl}function pS(i,o,c,g,v,T){v=mS(v),g.context===null?g.context=v:g.pendingContext=v,g=$i(o),g.payload={element:c},T=T===void 0?null:T,T!==null&&(g.callback=T),c=Vi(i,g,o),c!==null&&(wr(c,i,o),ju(c,i,o))}function gS(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function _g(i,o){gS(i,o),(i=i.alternate)&&gS(i,o)}function bS(i){if(i.tag===13||i.tag===31){var o=za(i,67108864);o!==null&&wr(o,i,67108864),_g(i,67108864)}}function xS(i){if(i.tag===13||i.tag===31){var o=Hr();o=ht(o);var c=za(i,o);c!==null&&wr(c,i,o),_g(i,o)}}var Ff=!0;function DM(i,o,c,g){var v=z.T;z.T=null;var T=V.p;try{V.p=2,Rg(i,o,c,g)}finally{V.p=T,z.T=v}}function jM(i,o,c,g){var v=z.T;z.T=null;var T=V.p;try{V.p=8,Rg(i,o,c,g)}finally{V.p=T,z.T=v}}function Rg(i,o,c,g){if(Ff){var v=Ig(g);if(v===null)gg(i,o,g,$f,c),vS(i,g);else if(BM(v,i,o,c,g))g.stopPropagation();else if(vS(i,g),o&4&&-1<PM.indexOf(i)){for(;v!==null;){var T=Vo(v);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var I=Jt(T.pendingLanes);if(I!==0){var U=T;for(U.pendingLanes|=2,U.entangledLanes|=2;I;){var se=1<<31-qe(I);U.entanglements[1]|=se,I&=~se}Ls(T),(Ft&6)===0&&(wf=oe()+500,Zu(0))}}break;case 31:case 13:U=za(T,2),U!==null&&wr(U,T,2),Nf(),_g(T,2)}if(T=Ig(g),T===null&&gg(i,o,g,$f,c),T===v)break;v=T}v!==null&&g.stopPropagation()}else gg(i,o,g,null,c)}}function Ig(i){return i=Mp(i),Og(i)}var $f=null;function Og(i){if($f=null,i=$o(i),i!==null){var o=a(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=l(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return $f=i,null}function yS(i){switch(i){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(ie()){case G:return 2;case F:return 8;case J:case Te:return 32;case _e:return 268435456;default:return 32}default:return 32}}var Mg=!1,ta=null,na=null,ra=null,ic=new Map,ac=new Map,sa=[],PM="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 vS(i,o){switch(i){case"focusin":case"focusout":ta=null;break;case"dragenter":case"dragleave":na=null;break;case"mouseover":case"mouseout":ra=null;break;case"pointerover":case"pointerout":ic.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ac.delete(o.pointerId)}}function oc(i,o,c,g,v,T){return i===null||i.nativeEvent!==T?(i={blockedOn:o,domEventName:c,eventSystemFlags:g,nativeEvent:T,targetContainers:[v]},o!==null&&(o=Vo(o),o!==null&&bS(o)),i):(i.eventSystemFlags|=g,o=i.targetContainers,v!==null&&o.indexOf(v)===-1&&o.push(v),i)}function BM(i,o,c,g,v){switch(o){case"focusin":return ta=oc(ta,i,o,c,g,v),!0;case"dragenter":return na=oc(na,i,o,c,g,v),!0;case"mouseover":return ra=oc(ra,i,o,c,g,v),!0;case"pointerover":var T=v.pointerId;return ic.set(T,oc(ic.get(T)||null,i,o,c,g,v)),!0;case"gotpointercapture":return T=v.pointerId,ac.set(T,oc(ac.get(T)||null,i,o,c,g,v)),!0}return!1}function ES(i){var o=$o(i.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){i.blockedOn=o,Un(i.priority,function(){xS(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,Un(i.priority,function(){xS(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Vf(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=Ig(i.nativeEvent);if(c===null){c=i.nativeEvent;var g=new c.constructor(c.type,c);Op=g,c.target.dispatchEvent(g),Op=null}else return o=Vo(c),o!==null&&bS(o),i.blockedOn=c,!1;o.shift()}return!0}function TS(i,o,c){Vf(i)&&c.delete(o)}function zM(){Mg=!1,ta!==null&&Vf(ta)&&(ta=null),na!==null&&Vf(na)&&(na=null),ra!==null&&Vf(ra)&&(ra=null),ic.forEach(TS),ac.forEach(TS)}function qf(i,o){i.blockedOn===o&&(i.blockedOn=null,Mg||(Mg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,zM)))}var Yf=null;function SS(i){Yf!==i&&(Yf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Yf===i&&(Yf=null);for(var o=0;o<i.length;o+=3){var c=i[o],g=i[o+1],v=i[o+2];if(typeof g!="function"){if(Og(g||c)===null)continue;break}var T=Vo(c);T!==null&&(i.splice(o,3),o-=3,I0(T,{pending:!0,data:v,method:c.method,action:g},g,v))}}))}function wl(i){function o(se){return qf(se,i)}ta!==null&&qf(ta,i),na!==null&&qf(na,i),ra!==null&&qf(ra,i),ic.forEach(o),ac.forEach(o);for(var c=0;c<sa.length;c++){var g=sa[c];g.blockedOn===i&&(g.blockedOn=null)}for(;0<sa.length&&(c=sa[0],c.blockedOn===null);)ES(c),c.blockedOn===null&&sa.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(g=0;g<c.length;g+=3){var v=c[g],T=c[g+1],I=v[Xn]||null;if(typeof T=="function")I||SS(c);else if(I){var U=null;if(T&&T.hasAttribute("formAction")){if(v=T,I=T[Xn]||null)U=I.formAction;else if(Og(v)!==null)continue}else U=I.action;typeof U=="function"?c[g+1]=U:(c.splice(g,3),g-=3),SS(c)}}}function CS(){function i(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(I){return v=I})},focusReset:"manual",scroll:"manual"})}function o(){v!==null&&(v(),v=null),g||setTimeout(c,20)}function c(){if(!g&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,v=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),v!==null&&(v(),v=null)}}}function Lg(i){this._internalRoot=i}Gf.prototype.render=Lg.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,g=Hr();pS(c,g,i,o,null,null)},Gf.prototype.unmount=Lg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;pS(i.current,2,null,i,null,null),Nf(),o[Rs]=null}};function Gf(i){this._internalRoot=i}Gf.prototype.unstable_scheduleHydration=function(i){if(i){var o=yn();i={blockedOn:null,target:i,priority:o};for(var c=0;c<sa.length&&o!==0&&o<sa[c].priority;c++);sa.splice(c,0,i),c===0&&ES(i)}};var wS=t.version;if(wS!=="19.2.7")throw Error(r(527,wS,"19.2.7"));V.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var UM={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kf.isDisabled&&Kf.supportsFiber)try{tt=Kf.inject(UM),dt=Kf}catch{}}return uc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,g="",v=O2,T=M2,I=L2;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(I=o.onRecoverableError)),o=hS(i,1,!1,null,null,c,g,null,v,T,I,CS),i[Rs]=o.current,pg(i),new Lg(o)},uc.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var g=!1,v="",T=O2,I=M2,U=L2,se=null;return c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(T=c.onUncaughtError),c.onCaughtError!==void 0&&(I=c.onCaughtError),c.onRecoverableError!==void 0&&(U=c.onRecoverableError),c.formState!==void 0&&(se=c.formState)),o=hS(i,1,!0,o,c??null,g,v,se,T,I,U,CS),o.context=mS(null),c=o.current,g=Hr(),g=ht(g),v=$i(g),v.callback=null,Vi(c,v,g),c=g,o.current.lanes=c,vt(o,c),Ls(o),i[Rs]=o.current,pg(i),new Gf(o)},uc.version="19.2.7",uc}var DS;function QM(){if(DS)return Pg.exports;DS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Pg.exports=WM(),Pg.exports}var ZM=QM();const Qk="workerdeck.theme";function kx(){try{const e=localStorage.getItem(Qk);if(e==="light"||e==="dark")return e}catch{}return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Zk(e=kx()){document.documentElement.setAttribute("data-theme",e)}function JM(e){try{localStorage.setItem(Qk,e)}catch{}Zk(e)}function eL(){const e=kx()==="dark"?"light":"dark";return JM(e),e}var Nc=typeof window<"u"?y.useLayoutEffect:y.useEffect;function Hg(e){const t=y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function tL(e,t,n={},r={}){y.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([a])=>{t(a)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function nL(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}const Jk=!1;function Jc(e){return e[e.length-1]}function rL(e){return typeof e=="function"}function lo(e,t){return rL(e)?e(t):e}const eN=Object.prototype.hasOwnProperty,jS=Object.prototype.propertyIsEnumerable;function tN(e){for(const t in e)if(eN.call(e,t))return!0;return!1}const sL=()=>Object.create(null),Za=(e,t)=>uo(e,t,sL);function uo(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,a=zS(e)&&zS(s);if(!a&&!(qh(e)&&qh(s)))return s;const l=a?e:PS(e);if(!l)return s;const u=a?s:PS(s);if(!u)return s;const d=l.length,h=u.length,p=a?new Array(h):n();let m=0;for(let b=0;b<h;b++){const x=a?b:u[b],E=e[x],N=s[x];if(E===N){p[x]=E,(a?b<d:eN.call(e,x))&&m++;continue}if(E===null||N===null||typeof E!="object"||typeof N!="object"){p[x]=N;continue}const C=uo(E,N,n,r+1);p[x]=C,C===E&&m++}return d===h&&m===d?e:p}function PS(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!jS.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!jS.call(e,s))return!1;r.push(s)}return r}function qh(e){if(!BS(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!BS(n)||!n.hasOwnProperty("isPrototypeOf"))}function BS(e){return Object.prototype.toString.call(e)==="[object Object]"}function zS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function po(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!po(e[r],t[r],n))return!1;return!0}if(qh(e)&&qh(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!po(e[l],t[l],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&s++;let a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>s||!po(e[l],t[l],n)))return!1;return s===a}return!1}function ql(e){let t,n;const r=new Promise((s,a)=>{t=s,n=a});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function ed(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const iL=/[\x00-\x1f\x7f"<>`{}]/g;function aL(e){return e.replace(iL,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function US(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return aL(t)}const oL=["http:","https:","mailto:","tel:"];function Yh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function cc(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=US(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+US(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function lL(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function uL(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Si(){throw new Error("Invariant failed")}function td(e){const t=new Map;let n,r;const s=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const l=t.get(a);if(l)return s(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(a);if(u)u.value=l,s(u);else{const d={key:a,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}const ga=4,nN=5;function cL(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function rN(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,a=e.substring(t,s);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(a==="$"){const u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const l=cL(a);if(l){const[u,d]=l,h=a.charCodeAt(u+1);if(h===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const p=u+3,m=d;if(p<m)return n[0]=3,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=s,n}}else if(h===36){const p=u+1,m=u+2;return m===d?(n[0]=2,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=s,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function _m(e,t,n,r,s,a,l){l?.(n);let u=r;{const d=n.fullPath??n.from,h=d.length,p=n.options?.caseSensitive??e,m=n.options?.params?.parse??n.options?.parseParams;for(;u<h;){const x=rN(d,u,t);let E;const N=u,C=x[5];switch(u=C+1,a++,x[0]){case 0:{const S=d.substring(x[2],x[3]);if(p){const k=s.static?.get(S);if(k)E=k;else{s.static??=new Map;const A=co(n.fullPath??n.from);A.parent=s,A.depth=a,E=A,s.static.set(S,A)}}else{const k=S.toLowerCase(),A=s.staticInsensitive?.get(k);if(A)E=A;else{s.staticInsensitive??=new Map;const R=co(n.fullPath??n.from);R.parent=s,R.depth=a,E=R,s.staticInsensitive.set(k,R)}}break}case 1:{const S=d.substring(N,x[1]),k=d.substring(x[4],C),A=p&&!!(S||k),R=S?A?S:S.toLowerCase():void 0,M=k?A?k:k.toLowerCase():void 0,_=!m&&s.dynamic?.find(O=>!O.parse&&O.caseSensitive===A&&O.prefix===R&&O.suffix===M);if(_)E=_;else{const O=$g(1,n.fullPath??n.from,A,R,M);E=O,O.depth=a,O.parent=s,s.dynamic??=[],s.dynamic.push(O)}break}case 3:{const S=d.substring(N,x[1]),k=d.substring(x[4],C),A=p&&!!(S||k),R=S?A?S:S.toLowerCase():void 0,M=k?A?k:k.toLowerCase():void 0,_=!m&&s.optional?.find(O=>!O.parse&&O.caseSensitive===A&&O.prefix===R&&O.suffix===M);if(_)E=_;else{const O=$g(3,n.fullPath??n.from,A,R,M);E=O,O.parent=s,O.depth=a,s.optional??=[],s.optional.push(O)}break}case 2:{const S=d.substring(N,x[1]),k=d.substring(x[4],C),A=p&&!!(S||k),R=S?A?S:S.toLowerCase():void 0,M=k?A?k:k.toLowerCase():void 0,_=$g(2,n.fullPath??n.from,A,R,M);E=_,_.parent=s,_.depth=a,s.wildcard??=[],s.wildcard.push(_)}}s=E}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=co(n.fullPath??n.from);x.kind=nN,x.parent=s,a++,x.depth=a,s.pathless??=[],s.pathless.push(x),s=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&d.endsWith("/")){const x=co(n.fullPath??n.from);x.kind=ga,x.parent=s,a++,x.depth=a,s.index=x,s=x}s.parse=m??null,s.priority=n.options?.params?.priority??0,b&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)_m(e,t,d,u,s,a,l)}function Fg(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ma(e){if(e.pathless)for(const t of e.pathless)ma(t);if(e.static)for(const t of e.static.values())ma(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ma(t);if(e.dynamic?.length){e.dynamic.sort(Fg);for(const t of e.dynamic)ma(t)}if(e.optional?.length){e.optional.sort(Fg);for(const t of e.optional)ma(t)}if(e.wildcard?.length){e.wildcard.sort(Fg);for(const t of e.wildcard)ma(t)}}function co(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function $g(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:s}}function dL(e,t){const n=co("/"),r=new Uint16Array(6);for(const s of e)_m(!1,r,s,1,n,0);ma(n),t.masksTree=n,t.flatCache=td(1e3)}function fL(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Nx(e,t.masksTree);return t.flatCache.set(e,r),r}function hL(e,t,n,r,s){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=s.singleCache.get(a);return l||(l=co("/"),_m(t,new Uint16Array(6),{from:e},1,l,0),s.singleCache.set(a,l)),Nx(r,l,n)}function mL(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||="/";let a;try{a=Nx(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=iN(a.route)),t.matchCache.set(r,a),a}function pL(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function gL(e,t=!1,n){const r=co(e.fullPath),s=new Uint16Array(6),a={},l={};let u=0;return _m(t,s,e,1,r,0,d=>{if(n?.(d,u),d.id in a&&Si(),a[d.id]=d,u!==0&&d.path){const h=pL(d.fullPath);(!l[h]||d.fullPath.endsWith("/"))&&(l[h]=d)}u++}),ma(r),{processedTree:{segmentTree:r,singleCache:td(1e3),matchCache:td(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Nx(e,t,n=!1){const r=e.split("/"),s=xL(e,r,t,n);if(!s)return null;const[a]=sN(e,r,s);return{route:s.node.route,rawParams:a}}function sN(e,t,n){const r=bL(n.node);let s=null;const a=Object.create(null);let l=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,h=n.extract?.segment??0;for(;u<r.length;l++,u++,d++,h++){const p=r[u];if(p.kind===ga)break;if(p.kind===nN){h--,l--,d--;continue}const m=t[l],b=d;if(m&&(d+=m.length),p.kind===1){s??=n.node.fullPath.split("/");const x=s[h],E=p.prefix?.length??0;if(x.charCodeAt(E)===123){const N=p.suffix?.length??0,C=x.substring(E+2,x.length-N-1),S=m.substring(E,m.length-N);a[C]=decodeURIComponent(S)}else{const N=x.substring(1);a[N]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<u){l--,d=b-1;continue}s??=n.node.fullPath.split("/");const x=s[h],E=p.prefix?.length??0,N=p.suffix?.length??0,C=x.substring(E+3,x.length-N-1),S=p.suffix||p.prefix?m.substring(E,m.length-N):m;S&&(a[C]=decodeURIComponent(S))}else if(p.kind===2){const x=p,E=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),N=decodeURIComponent(E);a["*"]=N,a._splat=N;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:u,path:d,segment:h}]}function iN(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function bL(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function xL(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Jc(t),a=s&&e!=="/",l=t.length-(s?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,h=null;for(;u.length;){const p=u.pop(),{node:m,index:b,skipped:x,depth:E,statics:N,dynamics:C,optionals:S}=p;let{extract:k,rawParams:A}=p;if(m.kind===2&&m.route&&!Wf(h,p))continue;if(m.parse){if(!HS(e,t,p))continue;A=p.rawParams,k=p.extract}r&&m.route&&m.kind!==ga&&Wf(d,p)&&(d=p);const R=b===l;if(R&&(m.route&&(!a||m.kind===ga||m.kind===2)&&Wf(h,p)&&(h=p),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const M=R?void 0:t[b];let _;if(R&&m.index){const O={node:m.index,index:b,skipped:x,depth:E+1,statics:N,dynamics:C,optionals:S,extract:k,rawParams:A};let j=!0;if(m.index.parse&&(HS(e,t,O)||(j=!1)),j){if(!C&&!S&&!x&&yL(N,l))return O;Wf(h,O)&&(h=O)}}if(m.wildcard)for(let O=m.wildcard.length-1;O>=0;O--){const j=m.wildcard[O],{prefix:H,suffix:B}=j;if(!(H&&(R||!(j.caseSensitive?M:_??=M.toLowerCase()).startsWith(H)))){if(B){if(R)continue;const K=t.slice(b).join("/").slice(-B.length);if((j.caseSensitive?K:K.toLowerCase())!==B)continue}u.push({node:j,index:l,skipped:x,depth:E+1,statics:N,dynamics:C,optionals:S,extract:k,rawParams:A})}}if(m.optional){const O=x|1<<E,j=E+1;for(let H=m.optional.length-1;H>=0;H--){const B=m.optional[H];u.push({node:B,index:b,skipped:O,depth:j,statics:N,dynamics:C,optionals:S,extract:k,rawParams:A})}if(!R)for(let H=m.optional.length-1;H>=0;H--){const B=m.optional[H],{prefix:K,suffix:X}=B;if(K||X){const Z=B.caseSensitive?M:_??=M.toLowerCase();if(K&&!Z.startsWith(K)||X&&!Z.endsWith(X))continue}u.push({node:B,index:b+1,skipped:x,depth:j,statics:N,dynamics:C,optionals:S+Xf(l,b),extract:k,rawParams:A})}}if(!R&&m.dynamic&&M)for(let O=m.dynamic.length-1;O>=0;O--){const j=m.dynamic[O],{prefix:H,suffix:B}=j;if(H||B){const K=j.caseSensitive?M:_??=M.toLowerCase();if(H&&!K.startsWith(H)||B&&!K.endsWith(B))continue}u.push({node:j,index:b+1,skipped:x,depth:E+1,statics:N,dynamics:C+Xf(l,b),optionals:S,extract:k,rawParams:A})}if(!R&&m.staticInsensitive){const O=m.staticInsensitive.get(_??=M.toLowerCase());O&&u.push({node:O,index:b+1,skipped:x,depth:E+1,statics:N+Xf(l,b),dynamics:C,optionals:S,extract:k,rawParams:A})}if(!R&&m.static){const O=m.static.get(M);O&&u.push({node:O,index:b+1,skipped:x,depth:E+1,statics:N+Xf(l,b),dynamics:C,optionals:S,extract:k,rawParams:A})}if(m.pathless){const O=E+1;for(let j=m.pathless.length-1;j>=0;j--){const H=m.pathless[j];u.push({node:H,index:b,skipped:x,depth:O,statics:N,dynamics:C,optionals:S,extract:k,rawParams:A})}}}if(h)return h;if(r&&d){let p=d.index;for(let b=0;b<d.index;b++)p+=t[b].length;const m=p===e.length?"/":e.slice(p);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(m),d}return null}function Xf(e,t){return 2**(e-t-1)}function yL(e,t){return e===2**(t-1)-1}function HS(e,t,n){let r,s;try{[r,s]=sN(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=s,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Wf(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ga)>(e.node.kind===ga)||t.node.kind===ga==(e.node.kind===ga)&&t.depth>e.depth))):!0}function Ih(e){return Ax(e.filter(t=>t!==void 0).join("/"))}function Ax(e){return e.replace(/\/{2,}/g,"/")}function aN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ti(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function oN(e){return Ti(aN(e))}function Gh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function vL(e,t,n){return Gh(e,n)===Gh(t,n)}function EL({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),a=!s&&t===".";let l;if(r){l=s?t:a?e:e+"\0"+t;const h=r.get(l);if(h)return h}let u;if(a)u=e.split("/");else if(s)u=t.split("/");else{for(u=e.split("/");u.length>1&&Jc(u)==="";)u.pop();const h=t.split("/");for(let p=0,m=h.length;p<m;p++){const b=h[p];b===""?p?p===m-1&&u.push(b):u=[b]:b===".."?u.pop():b==="."||u.push(b)}}u.length>1&&(Jc(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));const d=Ax(u.join("/"))||"/";return l&&r&&r.set(l,d),d}function TL(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,a=>t.get(a)??a)}function Vg(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>$S(s,n)).join("/"):$S(r,n)}function FS({path:e,params:t,decoder:n,...r}){let s=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:s};const l=e.length;let u=0,d,h="";for(;u<l;){const p=u;d=rN(e,p,d);const m=d[5];if(u=m+1,p===m)continue;const b=d[0];if(b===0){h+="/"+e.substring(p,m);continue}if(b===2){const x=t._splat;a._splat=x,a["*"]=x;const E=e.substring(p,d[1]),N=e.substring(d[4],m);if(!x){s=!0,(E||N)&&(h+="/"+E+N);continue}const C=Vg("_splat",t,n);h+="/"+E+C+N;continue}if(b===1){const x=e.substring(d[2],d[3]);!s&&!(x in t)&&(s=!0),a[x]=t[x];const E=e.substring(p,d[1]),N=e.substring(d[4],m),C=Vg(x,t,n)??"undefined";h+="/"+E+C+N;continue}if(b===3){const x=e.substring(d[2],d[3]),E=t[x];if(E==null)continue;a[x]=E;const N=e.substring(p,d[1]),C=e.substring(d[4],m),S=Vg(x,t,n)??"";h+="/"+N+S+C;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:a,interpolatedPath:h||"/",isMissingParams:s}}function $S(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function ar(e){return e?.isNotFound===!0}function SL(){try{return sessionStorage}catch{return}}const CL="tsr-scroll-restoration-v1_3",lN=SL();function wL(){try{return JSON.parse(lN?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function kL(){try{lN?.setItem(CL,JSON.stringify(Ol))}catch{}}const Ol=wL(),VS="data-scroll-restoration-id",NL=e=>e.state.__TSR_key||e.href;function AL(e){const t=e.getAttribute(VS);if(t)return`[${VS}="${t}"]`;let n="",r=e,s;for(;s=r.parentNode;){let a=1,l=r;for(;l=l.previousElementSibling;)a++;const u=`${r.localName}:nth-child(${a})`;n=n?`${u} > ${n}`:u,r=s}return n}let Qf=!1;const Oh="window";function ib(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function qS(e){const t=new Set;for(const n of e){if(n===Oh)continue;const r=ib(n);r&&t.add(r)}return t}function _L(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||NL,a=new Set,l=u=>{const d=Ol[u]||={};for(const h of a)h===document?d[Oh]={scrollX,scrollY}:h.isConnected&&(d[AL(h)]={scrollX:h.scrollLeft,scrollY:h.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Qf=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u=>{Qf||a.add(u.target)},!0),e.subscribe("onBeforeLoad",u=>{u.fromLocation&&l(s(u.fromLocation)),a.clear()}),addEventListener("pagehide",()=>{l(s(e.stores.resolvedLocation.get()??e.stores.location.get())),kL()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",u=>{const d=e.options.scrollRestorationBehavior,h=e.options.scrollToTopSelectors,p=r.next,m=r.hash;let b;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const x=s(u.toLocation),E=u.fromLocation&&s(u.fromLocation);if(r.restoring&&E&&E!==x){const N=Ol[E];if(N){let C=Ol[x];for(const S in N){if(S===Oh){if(p)continue}else{const k=ib(S);if(!k||p&&h&&(b??=qS(h),b.has(k)))continue}C||(C=Ol[x]={}),C[S]??=N[S]}}}Qf=!0;try{const N=u.toLocation.hash,C=u.toLocation.state.__hashScrollIntoViewOptions??!0;let S=!1;if(p){!N&&h&&(b??=qS(h));const k=N&&C&&m,A=r.restoring?Ol[x]:void 0;if(A)for(const R in A){const{scrollX:M,scrollY:_}=A[R];if(R===Oh){if(k)continue;scrollTo({top:_,left:M,behavior:d}),S=!0}else{const O=ib(R);O&&(O.scrollLeft=M,O.scrollTop=_,b?.delete(O))}}if(!N){const R={top:0,left:0,behavior:d};if(S||scrollTo(R),b)for(const M of b)M.scrollTo(R)}}!S&&N&&C&&document.getElementById(N)?.scrollIntoView(C)}finally{Qf=!1}}))}function RL(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function qg(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function IL(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const a=n[r];a==null?n[r]=qg(s):Array.isArray(a)?a.push(qg(s)):n[r]=[a,qg(s)]}return n}const OL=LL(JSON.parse),ML=DL(JSON.stringify,JSON.parse);function LL(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=IL(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function DL(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const a=RL(s,r);return a?`?${a}`:""}}const go="__root__";function Rm(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Rr(e){return e instanceof Response&&!!e.options}function jL(e){return{input:({url:t})=>{for(const n of e)t=ab(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=uN(e[n],t);return t}}}function PL(e){const t=oN(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),s=`${r}/`;return{input:({url:a})=>{const l=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return l===r?a.pathname="/":l.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=Ih(["/",t,a.pathname]),a)}}function ab(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function uN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function BL(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:a}=t,l=new Map,u=new Map,d=new Map,h=n(e.status),p=n(e.loadedAt),m=n(e.isLoading),b=n(e.isTransitioning),x=n(e.location),E=n(e.resolvedLocation),N=n(e.statusCode),C=n(e.redirect),S=n([]),k=n([]),A=n([]),R=r(()=>Yg(l,S.get())),M=r(()=>Yg(u,k.get())),_=r(()=>Yg(d,A.get())),O=r(()=>S.get()[0]),j=r(()=>S.get().some(V=>l.get(V)?.get().status==="pending")),H=r(()=>({locationHref:x.get().href,resolvedLocationHref:E.get()?.href,status:h.get()})),B=r(()=>({status:h.get(),loadedAt:p.get(),isLoading:m.get(),isTransitioning:b.get(),matches:R.get(),location:x.get(),resolvedLocation:E.get(),statusCode:N.get(),redirect:C.get()})),K=td(64);function X(V){let W=K.get(V);return W||(W=r(()=>{const le=S.get();for(const D of le){const P=l.get(D);if(P&&P.routeId===V)return P.get()}}),K.set(V,W)),W}const Z={status:h,loadedAt:p,isLoading:m,isTransitioning:b,location:x,resolvedLocation:E,statusCode:N,redirect:C,matchesId:S,pendingIds:k,cachedIds:A,matches:R,pendingMatches:M,cachedMatches:_,firstId:O,hasPending:j,matchRouteDeps:H,matchStores:l,pendingMatchStores:u,cachedMatchStores:d,__store:B,getRouteMatchStore:X,setMatches:te,setPending:q,setCached:z};te(e.matches),a?.(Z);function te(V){Gg(V,l,S,n,s)}function q(V){Gg(V,u,k,n,s)}function z(V){Gg(V,d,A,n,s)}return Z}function Yg(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function Gg(e,t,n,r,s){const a=e.map(u=>u.id),l=new Set(a);s(()=>{for(const u of t.keys())l.has(u)||t.delete(u);for(const u of e){const d=t.get(u.id);if(!d){const h=r(u);h.routeId=u.routeId,t.set(u.id,h);continue}d.routeId=u.routeId,d.get()!==u&&d.set(u)}uL(n.get(),a)||n.set(a)})}const ob=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},zL=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Im=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),bo=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let a=0;a<=s;a++){const l=e.matches[a];if(!l)continue;const u=e.router.getMatch(l.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},YS=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),s=r>=0?r:0;let a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=s);for(let l=a;l>=0;l--){const u=e.matches[l];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return l}return n?a:s},ba=(e,t,n)=>{if(!(!Rr(n)&&!ar(n)))throw Rr(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Rr(n)?"redirected":ar(n)?"notFound":r.status==="pending"?"success":r.status,context:bo(e,t.index),isFetching:!1,error:n})),ar(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Rr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},cN=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},GS=(e,t,n)=>{const r=bo(e,n);e.updateMatch(t,s=>({...s,context:r}))},dc=(e,t,n)=>{const{id:r,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,ba(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(l){n=l,ba(e,e.router.getMatch(r),n)}e.updateMatch(r,l=>(l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,l._nonReactive.loadPromise?.resolve(),{...l,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Rr(n)&&!ar(n)&&(e.serialError??=n)},dN=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Im(e,t)&&(n.options.loader||n.options.beforeLoad||hN(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{ob(e)},s);r._nonReactive.pendingTimeout=a}},UL=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;dN(e,t,n,r);const s=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&ba(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},HL=(e,t,n,r)=>{const s=e.router.getMatch(t);let a=s._nonReactive.loadPromise;s._nonReactive.loadPromise=ql(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:u}=s;l&&dc(e,n,l),u&&dc(e,n,u),dN(e,t,r,s);const d=new AbortController;let h=!1;const p=()=>{h||(h=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d})))},m=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{p(),m()});return}s._nonReactive.beforeLoadPromise=ql();const b={...bo(e,n,!1),...s.__routeContext},{search:x,params:E,cause:N}=s,C=Im(e,t),S={search:x,abortController:d,params:E,preload:C,context:b,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":N,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},k=R=>{if(R===void 0){e.router.batch(()=>{p(),m()});return}(Rr(R)||ar(R))&&(p(),dc(e,n,R)),e.router.batch(()=>{p(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),m()})};let A;try{if(A=r.options.beforeLoad(S),ed(A))return p(),A.catch(R=>{dc(e,n,R)}).then(k)}catch(R){p(),dc(e,n,R)}k(A)},FL=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],a=()=>u(),l=()=>HL(e,n,t,s),u=()=>{if(cN(e,n))return;const d=UL(e,n,s);return ed(d)?d.then(l):l()};return a()},$L=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([a,l,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:l,styles:a?.styles}))},fN=(e,t,n,r,s)=>{const a=t[r-1],{params:l,loaderDeps:u,abortController:d,cause:h}=e.router.getMatch(n),p=bo(e,r),m=Im(e,n);return{params:l,deps:u,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:m?"preload":h,route:s,...e.router.options.additionalContext}},KS=async(e,t,n,r,s)=>{try{const a=e.router.getMatch(n);try{(!(Jk??e.router.isServer)||a.ssr===!0)&&nd(s);const l=s.options.loader,u=typeof l=="function"?l:l?.handler,d=u?.(fN(e,t,n,r,s)),h=!!u&&ed(d);if((h||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),u){const m=h?await d:d;ba(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,b=>({...b,loaderData:m}))}s._lazyPromise&&await s._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:bo(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:bo(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,ar(l)&&await s.options.notFoundComponent?.preload?.(),ba(e,e.router.getMatch(n),l);try{s.options.onError?.(l)}catch(h){u=h,ba(e,e.router.getMatch(n),h)}!Rr(u)&&!ar(u)&&await nd(s,["errorComponent"]),e.updateMatch(n,h=>({...h,error:u,context:bo(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),ba(e,l,a)}},VL=async(e,t,n)=>{async function r(x,E,N,C,S){const k=Date.now()-E.updatedAt,A=x?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,R=S.options.shouldReload,M=typeof R=="function"?R(fN(e,t,s,n,S)):R,{status:_,invalid:O}=C,j=k>=A&&(!!e.forceStaleReload||C.cause==="enter"||N!==void 0&&N!==C.id);l=_==="success"&&(O||(M??j)),x&&S.options.preload===!1||(l&&!e.sync&&p?(u=!0,(async()=>{try{await KS(e,t,s,n,S);const H=e.router.getMatch(s);H._nonReactive.loaderPromise?.resolve(),H._nonReactive.loadPromise?.resolve(),H._nonReactive.loaderPromise=void 0,H._nonReactive.loadPromise=void 0}catch(H){Rr(H)&&await e.router.navigate(H.options)}})()):_!=="success"||l?await KS(e,t,s,n,S):GS(e,s,n))}const{id:s,routeId:a}=e.matches[n];let l=!1,u=!1;const d=e.router.looseRoutesById[a],h=d.options.loader,p=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(cN(e,s)){if(!e.router.getMatch(s))return e.matches[n];GS(e,s,n)}else{const x=e.router.getMatch(s),E=e.router.stores.matchesId.get()[n],N=(E&&e.router.stores.matchStores.get(E)||null)?.routeId===a?E:e.router.stores.matches.get().find(S=>S.routeId===a)?.id,C=Im(e,s);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&p)return x;await x._nonReactive.loaderPromise;const S=e.router.getMatch(s),k=S._nonReactive.error||S.error;k&&ba(e,S,k),S.status==="pending"&&await r(C,x,N,S,d)}else{const S=C&&!e.router.stores.matchStores.has(s),k=e.router.getMatch(s);k._nonReactive.loaderPromise=ql(),S!==k.preload&&e.updateMatch(s,A=>({...A,preload:S})),await r(C,x,N,k,d)}}const m=e.router.getMatch(s);u||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const b=u?m.isFetching:!1;return b!==m.isFetching||m.invalid!==!1?(e.updateMatch(s,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(s)):m};async function XS(e){const t=e,n=[];zL(t.router)&&ob(t);let r;for(let b=0;b<t.matches.length;b++){try{const x=FL(t,b);ed(x)&&await x}catch(x){if(Rr(x))throw x;if(ar(x))r=x;else if(!t.preload)throw x;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?YS(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,s):s;let u,d;for(let b=0;b<l;b++)n.push(VL(t,n,b));try{await Promise.all(n)}catch{const b=await Promise.allSettled(n);for(const x of b){if(x.status!=="rejected")continue;const E=x.reason;if(Rr(E))throw E;ar(E)?u??=E:d??=E}if(d!==void 0)throw d}const h=u??(r&&!t.preload?r:void 0);let p=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!h&&r&&t.preload)return t.matches;if(h){const b=YS(t,h);b===void 0&&Si();const x=t.matches[b],E=t.router.looseRoutesById[x.routeId],N=t.router.options?.defaultNotFoundComponent;!E.options.notFoundComponent&&N&&(E.options.notFoundComponent=N),h.routeId=x.routeId;const C=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,S=>({...S,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),p=b,await nd(E,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await nd(b,["errorComponent"])}for(let b=0;b<=p;b++){const{id:x,routeId:E}=t.matches[b],N=t.router.looseRoutesById[E];try{const C=$L(t,x,N);if(C){const S=await C;t.updateMatch(x,k=>({...k,...S}))}}catch(C){console.error(`Error executing head for route ${E}:`,C)}}const m=ob(t);if(ed(m)&&await m,h)throw h;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function WS(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function nd(e,t=Mh){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Mh?(()=>{if(e._componentsPromise===void 0){const r=WS(e,Mh);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():WS(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function hN(e){for(const t of Mh)if(e.options[t]?.preload)return!0;return!1}const Mh=["component","errorComponent","pendingComponent","notFoundComponent"];var va="__TSR_index",QS="popstate",ZS="beforeunload";function qL(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},s=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const h=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&h.length&&p)for(const m of h){const b=rd(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:b,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const h=t.state[va];u=JS(h+1,u),a({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const h=t.state[va];u=JS(h,u),a({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{a({task:()=>{e.go(l),s({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[va]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function JS(e,t){t||(t={});const n=_x();return{...t,key:n,__TSR_key:n,[va]:e}}function mN(e){const t=e?.window??(typeof document<"u"?window:void 0),n=t.history.pushState,r=t.history.replaceState;let s=[];const a=()=>s,l=j=>s=j,u=e?.createHref??(j=>j),d=e?.parseLocation??(()=>rd(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const j=_x();t.history.replaceState({[va]:0,key:j,__TSR_key:j},"")}let h=d(),p,m=!1,b=!1,x=!1,E=!1;const N=()=>h;let C,S;const k=()=>{C&&(O._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),O._ignoreSubscribers=!1,C=void 0,S=void 0,p=void 0)},A=(j,H,B)=>{const K=u(H);S||(p=h),h=rd(H,B),C={href:K,state:B,isPush:C?.isPush||j==="push"},S||(S=Promise.resolve().then(()=>k()))},R=j=>{h=d(),O.notify({type:j})},M=async()=>{if(b){b=!1;return}const j=d(),H=j.state[va]-h.state[va],B=H===1,K=H===-1,X=!B&&!K||m;m=!1;const Z=X?"GO":K?"BACK":"FORWARD",te=X?{type:"GO",index:H}:{type:K?"BACK":"FORWARD"};if(x)x=!1;else{const q=a();if(typeof document<"u"&&q.length){for(const z of q)if(await z.blockerFn({currentLocation:h,nextLocation:j,action:Z})){b=!0,t.history.go(1),O.notify(te);return}}}h=d(),O.notify(te)},_=j=>{if(E){E=!1;return}let H=!1;const B=a();if(typeof document<"u"&&B.length)for(const K of B){const X=K.enableBeforeUnload??!0;if(X===!0){H=!0;break}if(typeof X=="function"&&X()===!0){H=!0;break}}if(H)return j.preventDefault(),j.returnValue=""},O=qL({getLocation:N,getLength:()=>t.history.length,pushState:(j,H)=>A("push",j,H),replaceState:(j,H)=>A("replace",j,H),back:j=>(j&&(x=!0),E=!0,t.history.back()),forward:j=>{j&&(x=!0),E=!0,t.history.forward()},go:j=>{m=!0,t.history.go(j)},createHref:j=>u(j),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ZS,_,{capture:!0}),t.removeEventListener(QS,M)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(ZS,_,{capture:!0}),t.addEventListener(QS,M),t.history.pushState=function(...j){const H=n.apply(t.history,j);return O._ignoreSubscribers||R("PUSH"),H},t.history.replaceState=function(...j){const H=r.apply(t.history,j);return O._ignoreSubscribers||R("REPLACE"),H},O}function YL(e){const t=typeof document<"u"?window:void 0;return mN({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",s=t.location.search,a=n.slice(1);return rd(`${r}${s}${a.length===0?"":`#${a.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function GL(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function rd(e,t){const n=GL(e),r=n.indexOf("#"),s=n.indexOf("?"),a=_x();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[va]:0,key:a,__TSR_key:a}}}function _x(){return(Math.random()+1).toString(36).substring(7)}function zl(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var KL=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,s=this.basepath??r?.basepath??"/",a=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=TL(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=mN()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=td(1e3),p=this.buildRouteTree(),this.setRoutes(p)}if(!this.stores&&this.latestLocation){const p=this.getStoreConfig(this);this.batch=p.batch,this.stores=BL(WL(this.latestLocation),p),_L(this)}let u=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(a||s!==d||l!==h){this.basepath=d;const p=[],m=oN(d);m&&m!=="/"&&p.push(PL({basepath:d})),h&&p.push(h),this.rewrite=p.length===0?void 0:p.length===1?p[0]:jL(p),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=gL(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&dL(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:d,search:h,hash:p,href:m,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const S=this.options.parseSearch(h),k=this.options.stringifySearch(S);return{href:d+k+p,publicHref:d+k+p,pathname:cc(d).path,external:!1,searchStr:k,search:Za(r?.search,S),hash:cc(p.slice(1)).path,state:uo(r?.state,b)}}const x=new URL(m,this.origin),E=ab(this.rewrite,x),N=this.options.parseSearch(E.search),C=this.options.stringifySearch(N);return E.search=C,{href:E.href.replace(E.origin,""),publicHref:m,pathname:cc(E.pathname).path,external:!!this.rewrite&&E.origin!==this.origin,searchStr:C,search:Za(r?.search,N),hash:cc(E.hash.slice(1)).path,state:uo(r?.state,b)}},a=s(n),{__tempLocation:l,__tempKey:u}=a.state;if(l&&(!u||u===this.tempLocationKey)){const d=s(l);return d.state.key=a.state.key,d.state.__TSR_key=a.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:a}}return a},this.resolvePathWithBase=(n,r)=>EL({base:n,to:r.includes("//")?Ax(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>QL({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(a={})=>{const l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.pathname:a.from??u.fullPath,h=a.to?`${a.to}`:void 0,p=u.search,m=Object.assign(Object.create(null),u.params),b=h?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),x=h?this.resolvePathWithBase(b,h):b,E=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?m:Object.assign(m,lo(a.params,m)),N=this.routesByPath[Ti(x)];let C;if(N)C=this.getRouteBranch(N);else if(x.includes("$"))C=[];else{const K=this.getMatchedRoutes(x);C=K.matchedRoutes,this.options.notFoundRoute&&(!K.foundRoute||K.foundRoute.path!=="/"&&K.routeParams["**"])&&(C=[...C,this.options.notFoundRoute])}if(C.length&&tN(E))for(const K of C){const X=K.options.params?.stringify??K.options.stringifyParams;if(X)try{Object.assign(E,X(E))}catch{}}const S=n.leaveParams?x:cc(FS({path:x,params:E,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let k=p;if(n._includeValidateSearch&&this.options.search?.strict){const K={};C.forEach(X=>{if(X.options.validateSearch)try{Object.assign(K,Lh(X.options.validateSearch,{...K,...k}))}catch{}}),k=K}k=ZL({search:k,dest:a,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),k=Za(p,k);const A=this.options.stringifySearch(k),R=a.hash===!0?l.hash:a.hash?lo(a.hash,l.hash):void 0,M=R?`#${R}`:"";let _=a.state===!0?l.state:a.state?lo(a.state,l.state):{};_=uo(l.state,_);const O=`${S}${A}${M}`;let j,H,B=!1;if(this.rewrite){const K=new URL(O,this.origin),X=uN(this.rewrite,K);j=K.href.replace(K.origin,""),X.origin!==this.origin?(H=X.href,B=!0):H=X.pathname+X.search+X.hash}else j=lL(O),H=j;return{publicHref:H,href:j,pathname:S,search:k,searchStr:A,state:_,hash:R??"",external:B,unmaskOnReload:a.unmaskOnReload}},s=(a={},l)=>{const u=r(a);let d=l?r(l):void 0;if(!d){const h=Object.create(null);if(this.options.routeMasks){const p=fL(u.pathname,this.processedTree);if(p){Object.assign(h,p.rawParams);const{from:m,params:b,...x}=p.route,E=b===!1||b===null?Object.create(null):(b??!0)===!0?h:Object.assign(h,lo(b,h));l={from:n.from,...x,params:E},d=r(l)}}}return d&&(u.maskedLocation=d),u};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{let a;const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(m=>{s.state[m]=this.latestLocation.state[m]});const p=po(s.state,this.latestLocation.state);return h.forEach(m=>{delete s.state[m]}),p},u=Ti(this.latestLocation.href)===Ti(s.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=ql(()=>{d?.resolve(),d=void 0}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:p,...m}=s;h&&(m={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,a=s.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this._scroll.next=s.resetScroll??!0,this.history.subscribers.size||this.load(a?{action:{type:a}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:a,ignoreBlocker:l,href:u,...d}={})=>{if(u){const m=this.history.location.state.__TSR_index,b=rd(u,{__TSR_index:n?m:m+1}),x=new URL(b.pathname,this.origin);d.to=ab(this.rewrite,x).pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const p=this.commitLocation({...h,viewTransition:a,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:l});return queueMicrotask(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:a,...l})=>{let u=!1;if(s)try{new URL(`${s}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(n!==void 0||!s){const h=this.buildLocation({to:n,...l});s=s??h.publicHref,a=a??h.publicHref}const d=!u&&a?a:s;if(Yh(d,this.protocolAllowlist))return;if(!l.ignoreBlocker){const h=this.history.getBlockers?.()??[];for(const p of h)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}l.replace?window.location.replace(d):window.location.href=d;return}return this.buildAndCommitLocation({...l,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(a=>a.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let s,a,l;const u=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const p=this.latestLocation,m=zl(p,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...m}),this.emit({type:"onBeforeLoad",...m}),await XS({router:this,sync:n?.sync,forceStaleReload:u.href===p.href,matches:this.stores.pendingMatches.get(),location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=null,x=null,E=null,N=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),S=C.length,k=this.stores.matches.get();b=S?k.filter(M=>!this.stores.pendingMatchStores.has(M.id)):null;const A=new Set;for(const M of this.stores.pendingMatchStores.values())M.routeId&&A.add(M.routeId);const R=new Set;for(const M of this.stores.matchStores.values())M.routeId&&R.add(M.routeId);x=S?k.filter(M=>!A.has(M.routeId)):null,E=S?C.filter(M=>!R.has(M.routeId)):null,N=S?C.filter(M=>R.has(M.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),S&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...b.filter(M=>M.status!=="error"&&M.status!=="notFound"&&M.status!=="redirected")]),this.clearExpiredCache())});for(const[C,S]of[[x,"onLeave"],[E,"onEnter"],[N,"onStay"]])if(C)for(const k of C)this.looseRoutesById[k.routeId].options[S]?.(k)})})}})}catch(p){Rr(p)?(s=p,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):ar(p)&&(a=p);const m=s?s.status:a?404:this.stores.matches.get().some(b=>b.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(m),this.stores.redirect.set(s)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(h=>h.status==="error")&&(d=500),d!==void 0&&this.stores.statusCode.set(d)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(zl(a,l)):r.types;if(u===!1){n();return}s={update:n,types:u}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const a=this.stores.matchStores.get(n);if(a){a.set(r);return}const l=this.stores.cachedMatchStores.get(n);if(l){const u=r(l.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(d=>d.filter(h=>h!==n)):l.set(u)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(s);n.options.href=a,n.headers.set("Location",a)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const a=s.pathname+s.search+s.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}if(n.options.href&&!n.options._builtLocation&&Yh(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const l=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=l};this.clearCache({filter:r})},this.loadRouteChunk=nd,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const a=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...a,...this.stores.cachedIds.get()]),u=s.filter(d=>!l.has(d.id));if(u.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...u])}try{return s=await XS({router:this,matches:s,location:r,preload:!0,updateMatch:(d,h)=>{a.has(d)?s=s.map(p=>p.id===d?h(p):p):this.updateMatch(d,h)}}),s}catch(d){if(Rr(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});ar(d)||console.error(d);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(s);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const l=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=hL(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!u||n.params&&!po(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?po(l.search,a.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??ML,parseSearch:e.parseSearch??OL,protocolAllowlist:e.protocolAllowlist??oL}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=iN(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s}=n;let{matchedRoutes:a}=n,l=!1;(r?r.path!=="/"&&s["**"]:Ti(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const u=l?e8(this.options.notFoundMode,a):void 0,d=new Array(a.length),h=new Map;for(const p of this.stores.matchStores.values())p.routeId&&h.set(p.routeId,p.get());for(let p=0;p<a.length;p++){const m=a[p],b=d[p-1];let x,E,N;{const X=b?.search??e.search,Z=b?._strictSearch??void 0;try{const te=Lh(m.options.validateSearch,{...X})??void 0;x={...X,...te},E={...Z,...te},N=void 0}catch(te){let q=te;if(te instanceof Kh||(q=new Kh(te.message,{cause:te})),t?.throwOnError)throw q;x=X,E={},N=q}}const C=m.options.loaderDeps?.({search:x})??"",S=C?JSON.stringify(C):"",{interpolatedPath:k,usedParams:A}=FS({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),R=m.id+k+S,M=this.getMatch(R),_=h.get(m.id),O=M?._strictParams??A;let j;if(!M)try{eC(m,O)}catch(X){if(ar(X)||Rr(X)?j=X:j=new XL(X.message,{cause:X}),t?.throwOnError)throw j}Object.assign(s,O);const H=_?"stay":"enter";let B;if(M)B={...M,cause:H,params:_?.params??s,_strictParams:O,search:Za(_?_.search:M.search,x),_strictSearch:E};else{const X=m.options.loader||m.options.beforeLoad||m.lazyFn||hN(m)?"pending":"success";B={id:R,ssr:m.options.ssr,index:p,routeId:m.id,params:_?.params??s,_strictParams:O,pathname:k,updatedAt:Date.now(),search:_?Za(_.search,x):x,_strictSearch:E,searchError:void 0,status:X,isFetching:!1,error:void 0,paramsError:j,__routeContext:void 0,_nonReactive:{loadPromise:ql()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:H,loaderDeps:_?uo(_.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t?.preload||(B.globalNotFound=u===m.id),B.searchError=N;const K=this.getParentContext(b);B.context={...K,...B.__routeContext,...B.__beforeLoadContext},d[p]=B}for(let p=0;p<d.length;p++){const m=d[p],b=this.looseRoutesById[m.routeId],x=this.getMatch(m.id),E=h.get(m.routeId);if(m.params=E?Za(E.params,s):s,!x){const N=d[p-1],C=this.getParentContext(N);if(b.options.context){const S={deps:m.loaderDeps,params:m.params,context:C??{},location:e,navigate:k=>this.navigate({...k,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:b.id};m.__routeContext=b.options.context(S)??void 0}m.context={...C,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const t=Jc(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];const{matchedRoutes:r,routeParams:s}=this.getMatchedRoutes(e.pathname),a=Jc(r),l={...e.search};for(const m of r)try{Object.assign(l,Lh(m.options.validateSearch,l))}catch{}const u=t&&this.stores.matchStores.get(t)?.get(),d=u&&u.routeId===a.id&&u.pathname===e.pathname;let h;if(d)h=u.params;else{const m=Object.assign(Object.create(null),s);for(const b of r)try{eC(b,m)}catch{}h=m}const p={matchedRoutes:r,fullPath:a.fullPath,search:l,params:h};return this.lightweightCache.set(e,[t,p]),p}},Kh=class extends Error{},XL=class extends Error{};function WL(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Lh(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Kh("Async validation not supported");if(n.issues)throw new Kh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function QL({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=Ti(e);let a;const l=mL(s,n,!0);return l&&(a=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[t.__root__],routeParams:r,foundRoute:a}}function ZL({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return JL(n)(e,t,r??!1)}function JL(e){let t,n;const r=[];for(const a of e){const l=a.options;if("search"in l)l.search?.middlewares&&r.push(...l.search.middlewares);else if(l.preSearchFilters||l.postSearchFilters){const d=({search:h,next:p})=>{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((b,x)=>x(b),h):h);return l.postSearchFilters?l.postSearchFilters.reduce((b,x)=>x(b),m):m};r.push(d)}const u=l.validateSearch;if(u){const d=({search:h,next:p,meta:m})=>{const b=p(h);if(n)try{const x=Lh(u,b);if(m&&x)for(const E in x)E in b||(m.defaulted||=new Map).set(E,x[E]);return{...b,...x}}catch{}return b};r.push(d)}}const s=(a,l,u)=>{if(a>=r.length){if(!t.search)return{};if(t.search===!0)return l;const h=lo(t.search,l);return u&&(u.explicit=h),h}const d=(h,p)=>{if(p){const m=u||{};return{search:s(a+1,h,m),meta:m}}return s(a+1,h,u)};return r[a]({search:l,next:d,meta:u})};return function(l,u,d){return t=u,n=d,s(0,l)}}function e8(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return go}function eC(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const t8="Error preloading route! ☝️";var pN=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=go:this.parentRoute||Si();let s=r?go:n?.path;s&&s!=="/"&&(s=aN(s));const a=n?.id||s;let l=r?go:Ih([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);s==="__root__"&&(s="/"),l!=="__root__"&&(l=Ih(["/",l]));const u=l==="__root__"?"/":Ih([this.parentRoute.fullPath,s]);this._path=s,this._id=l,this._fullPath=u,this._to=Ti(u)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Rm({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},n8=class extends pN{constructor(e){super(e)}};function Rx(e){const t=e.errorComponent??Ix;return f.jsx(r8,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}var r8=class extends y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Ix({error:e}){const[t,n]=y.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function s8({children:e,fallback:t=null}){return gN()?f.jsx(Fe.Fragment,{children:e}):f.jsx(Fe.Fragment,{children:t})}function gN(){return Fe.useSyncExternalStore(i8,()=>!0,()=>!1)}function i8(){return()=>{}}var bN=y.createContext(null);function Gr(e){return y.useContext(bN)}var Om=y.createContext(void 0),a8=y.createContext(void 0),pn=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(pn||{});function o8({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:a,checkDirty:l,shallowPropagate:u};function r(h,p,m){const b=p.depsTail;if(b!==void 0&&b.dep===h)return;const x=b!==void 0?b.nextDep:p.deps;if(x!==void 0&&x.dep===h){x.version=m,p.depsTail=x;return}const E=h.subsTail;if(E!==void 0&&E.version===m&&E.sub===p)return;const N=p.depsTail=h.subsTail={version:m,dep:h,sub:p,prevDep:b,nextDep:x,prevSub:E,nextSub:void 0};x!==void 0&&(x.prevDep=N),b!==void 0?b.nextDep=N:p.deps=N,E!==void 0?E.nextSub=N:h.subs=N}function s(h,p=h.sub){const m=h.dep,b=h.prevDep,x=h.nextDep,E=h.nextSub,N=h.prevSub;return x!==void 0?x.prevDep=b:p.depsTail=b,b!==void 0?b.nextDep=x:p.deps=x,E!==void 0?E.prevSub=N:m.subsTail=N,N!==void 0?N.nextSub=E:(m.subs=E)===void 0&&n(m),x}function a(h){let p=h.nextSub,m;e:do{const b=h.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(h,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const E=b.subs;if(E!==void 0){const N=(h=E).nextSub;N!==void 0&&(m={value:p,prev:m},p=N);continue}}if((h=p)!==void 0){p=h.nextSub;continue}for(;m!==void 0;)if(h=m.value,m=m.prev,h!==void 0){p=h.nextSub;continue e}break}while(!0)}function l(h,p){let m,b=0,x=!1;e:do{const E=h.dep,N=E.flags;if(p.flags&16)x=!0;else if((N&17)===17){if(e(E)){const C=E.subs;C.nextSub!==void 0&&u(C),x=!0}}else if((N&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(m={value:h,prev:m}),h=E.deps,p=E,++b;continue}if(!x){const C=h.nextDep;if(C!==void 0){h=C;continue}}for(;b--;){const C=p.subs,S=C.nextSub!==void 0;if(S?(h=m.value,m=m.prev):h=C,x){if(e(p)){S&&u(C),p=h.sub;continue}x=!1}else p.flags&=-33;p=h.sub;const k=h.nextDep;if(k!==void 0){h=k;continue e}}return x}while(!0)}function u(h){do{const p=h.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((h=h.nextSub)!==void 0)}function d(h,p){let m=p.depsTail;for(;m!==void 0;){if(m===h)return!0;m=m.prevDep}return!1}}function l8(e,t,n){const r=typeof e=="object",s=r?e:void 0;return{next:(r?e.next:e)?.bind(s),error:(r?e.error:t)?.bind(s),complete:(r?e.complete:n)?.bind(s)}}const lb=[];let Dh=0;const{link:tC,unlink:u8,propagate:c8,checkDirty:xN,shallowPropagate:nC}=o8({update(e){return e._update()},notify(e){lb[ub++]=e,e.flags&=~pn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=pn.Mutable|pn.Dirty,Xh(e))}});let Zf=0,ub=0,zs,cb=0;function yN(e){try{++cb,e()}finally{--cb||vN()}}function Xh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=u8(n,e)}function vN(){if(!(cb>0)){for(;Zf<ub;){const e=lb[Zf];lb[Zf++]=void 0,e.notify()}Zf=0,ub=0}}function rC(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?pn.None:pn.Mutable,get(){return zs!==void 0&&tC(s,zs,Dh),s._snapshot},subscribe(a){const l=l8(a),u={current:!1},d=d8(()=>{s.get(),u.current?l.next?.(s._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=zs,u=t?.compare??Object.is;if(n)zs=s,++Dh,s.depsTail=void 0;else if(a===void 0)return!1;n&&(s.flags=pn.Mutable|pn.RecursedCheck);try{const d=s._snapshot,h=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!u(d,h)?(s._snapshot=h,!0):!1}finally{zs=l,n&&(s.flags&=~pn.RecursedCheck),Xh(s)}}};return n?(s.flags=pn.Mutable|pn.Dirty,s.get=function(){const a=s.flags;if(a&pn.Dirty||a&pn.Pending&&xN(s.deps,s)){if(s._update()){const l=s.subs;l!==void 0&&nC(l)}}else a&pn.Pending&&(s.flags=a&~pn.Pending);return zs!==void 0&&tC(s,zs,Dh),s._snapshot}):s.set=function(a){if(s._update(a)){const l=s.subs;l!==void 0&&(c8(l),nC(l),vN())}},s}function d8(e){const t=()=>{const r=zs;zs=n,++Dh,n.depsTail=void 0,n.flags=pn.Watching|pn.RecursedCheck;try{return e()}finally{zs=r,n.flags&=~pn.RecursedCheck,Xh(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:pn.Watching|pn.RecursedCheck,notify(){const r=this.flags;r&pn.Dirty||r&pn.Pending&&xN(this.deps,this)?t():this.flags=pn.Watching},stop(){this.flags=pn.None,this.depsTail=void 0,Xh(this)}};return t(),n}var Kg={exports:{}},Xg={},Wg={exports:{}},Qg={};/**
51
- * @license React
52
- * use-sync-external-store-shim.production.js
53
- *
54
- * Copyright (c) Meta Platforms, Inc. and affiliates.
55
- *
56
- * This source code is licensed under the MIT license found in the
57
- * LICENSE file in the root directory of this source tree.
58
- */var sC;function f8(){if(sC)return Qg;sC=1;var e=bd();function t(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(m,b){var x=b(),E=r({inst:{value:x,getSnapshot:b}}),N=E[0].inst,C=E[1];return a(function(){N.value=x,N.getSnapshot=b,d(N)&&C({inst:N})},[m,x,b]),s(function(){return d(N)&&C({inst:N}),m(function(){d(N)&&C({inst:N})})},[m]),l(x),x}function d(m){var b=m.getSnapshot;m=m.value;try{var x=b();return!n(m,x)}catch{return!0}}function h(m,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Qg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Qg}var iC;function EN(){return iC||(iC=1,Wg.exports=f8()),Wg.exports}/**
59
- * @license React
60
- * use-sync-external-store-shim/with-selector.production.js
61
- *
62
- * Copyright (c) Meta Platforms, Inc. and affiliates.
63
- *
64
- * This source code is licensed under the MIT license found in the
65
- * LICENSE file in the root directory of this source tree.
66
- */var aC;function h8(){if(aC)return Xg;aC=1;var e=bd(),t=EN();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Xg.useSyncExternalStoreWithSelector=function(h,p,m,b,x){var E=a(null);if(E.current===null){var N={hasValue:!1,value:null};E.current=N}else N=E.current;E=u(function(){function S(_){if(!k){if(k=!0,A=_,_=b(_),x!==void 0&&N.hasValue){var O=N.value;if(x(O,_))return R=O}return R=_}if(O=R,r(A,_))return O;var j=b(_);return x!==void 0&&x(O,j)?(A=_,O):(A=_,R=j)}var k=!1,A,R,M=m===void 0?null:m;return[function(){return S(p())},M===null?void 0:function(){return S(M())}]},[p,m,b,x]);var C=s(h,E[0],E[1]);return l(function(){N.hasValue=!0,N.value=C},[C]),d(C),C},Xg}var oC;function m8(){return oC||(oC=1,Kg.exports=h8()),Kg.exports}var TN=m8();function p8(e,t){return e===t}function gr(e,t,n=p8){const r=y.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(l);return u},[e]),s=y.useCallback(()=>e?.get(),[e]);return TN.useSyncExternalStoreWithSelector(r,s,s,t,n)}var Zg={get(){},subscribe(){return{unsubscribe(){}}}};function SN(e,t){const n=y.useRef();return r=>{const s=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=uo(n.current,s):s}}function Io(e){const t=Gr(),n=y.useContext(e.from?a8:Om),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),s=SN(e,t),a=gr(r??Zg,l=>l?s(l):Zg);if(a!==Zg)return a;(e.shouldThrow??!0)&&Si()}function CN(e){return Io({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function wN(e){const{select:t,...n}=e;return Io({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function iu(e){return Io({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function kN(e){return Io({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ks(e){const t=Gr();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function NN(e){return Io({...e,select:t=>e.select?e.select(t.context):t.context})}var or=Wk();const g8=Am(or);function b8(e,t){const n=Gr(),r=nL(t),{activeProps:s,inactiveProps:a,activeOptions:l,to:u,preload:d,preloadDelay:h,preloadIntentProximity:p,hashScrollIntoView:m,replace:b,startTransition:x,resetScroll:E,viewTransition:N,children:C,target:S,disabled:k,style:A,className:R,onClick:M,onBlur:_,onFocus:O,onMouseEnter:j,onMouseLeave:H,onTouchStart:B,ignoreBlocker:K,params:X,search:Z,hash:te,state:q,mask:z,reloadDocument:V,unsafeRelative:W,from:le,_fromLocation:D,...P}=e,$=gN(),L=y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ae=gr(n.stores.location,ie=>ie,(ie,G)=>ie.href===G.href),re=y.useMemo(()=>{const ie={_fromLocation:ae,...L};return n.buildLocation(ie)},[n,ae,L]),ce=re.maskedLocation?re.maskedLocation.publicHref:re.publicHref,de=re.maskedLocation?re.maskedLocation.external:re.external,fe=y.useMemo(()=>S8(ce,de,n.history,k),[k,de,ce,n.history]),Se=y.useMemo(()=>{if(fe?.external)return Yh(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!C8(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Yh(u,n.protocolAllowlist)?void 0:u}catch{}},[u,fe,n.protocolAllowlist]),He=y.useMemo(()=>{if(Se)return!1;if(l?.exact){if(!vL(ae.pathname,re.pathname,n.basepath))return!1}else{const ie=Gh(ae.pathname,n.basepath),G=Gh(re.pathname,n.basepath);if(!(ie.startsWith(G)&&(ie.length===G.length||ie[G.length]==="/")))return!1}return(l?.includeSearch??!0)&&!po(ae.search,re.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?$&&ae.hash===re.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,ae,Se,$,re.hash,re.pathname,re.search,n.basepath]),Me=He?lo(s,{})??x8:Jg,Ee=He?Jg:lo(a,{})??Jg,Oe=[R,Me.className,Ee.className].filter(Boolean).join(" "),Be=(A||Me.style||Ee.style)&&{...A,...Me.style,...Ee.style},[Ke,$e]=y.useState(!1),De=y.useRef(!1),ke=e.reloadDocument||Se?!1:d??n.options.defaultPreload,ve=h??n.options.defaultPreloadDelay??0,Ie=y.useCallback(()=>{n.preloadRoute({...L,_builtLocation:re}).catch(ie=>{console.warn(ie),console.warn(t8)})},[n,L,re]);tL(r,y.useCallback(ie=>{ie?.isIntersecting&&Ie()},[Ie]),T8,{disabled:!!k||ke!=="viewport"}),y.useEffect(()=>{De.current||!k&&ke==="render"&&(Ie(),De.current=!0)},[k,Ie,ke]);const je=ie=>{const G=ie.currentTarget.getAttribute("target"),F=S!==void 0?S:G;if(!k&&!w8(ie)&&!ie.defaultPrevented&&(!F||F==="_self")&&ie.button===0){ie.preventDefault(),or.flushSync(()=>{$e(!0)});const J=n.subscribe("onResolved",()=>{J(),$e(!1)});n.navigate({...L,replace:b,resetScroll:E,hashScrollIntoView:m,startTransition:x,viewTransition:N,ignoreBlocker:K})}};if(Se)return{...P,ref:r,href:Se,...C&&{children:C},...S&&{target:S},...k&&{disabled:k},...A&&{style:A},...R&&{className:R},...M&&{onClick:M},..._&&{onBlur:_},...O&&{onFocus:O},...j&&{onMouseEnter:j},...H&&{onMouseLeave:H},...B&&{onTouchStart:B}};const ee=ie=>{if(k||ke!=="intent")return;if(!ve){Ie();return}const G=ie.currentTarget;if(fc.has(G))return;const F=setTimeout(()=>{fc.delete(G),Ie()},ve);fc.set(G,F)},me=ie=>{k||ke!=="intent"||Ie()},oe=ie=>{if(k||!ke||!ve)return;const G=ie.currentTarget,F=fc.get(G);F&&(clearTimeout(F),fc.delete(G))};return{...P,...Me,...Ee,href:fe?.href,ref:r,onClick:kl([M,je]),onBlur:kl([_,oe]),onFocus:kl([O,ee]),onMouseEnter:kl([j,ee]),onMouseLeave:kl([H,oe]),onTouchStart:kl([B,me]),disabled:!!k,target:S,...Be&&{style:Be},...Oe&&{className:Oe},...k&&y8,...He&&v8,...$&&Ke&&E8}}var Jg={},x8={className:"active"},y8={role:"link","aria-disabled":!0},v8={"data-status":"active","aria-current":"page"},E8={"data-transitioning":"transitioning"},fc=new WeakMap,T8={rootMargin:"100px"},kl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function S8(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function C8(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Mm=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...a}=b8(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return y.createElement("a",d,l)}return y.createElement(n,a,l)});function w8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var k8=class extends pN{constructor(e){super(e),this.useMatch=t=>Io({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>NN({...t,from:this.id}),this.useSearch=t=>kN({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>iu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>wN({...t,from:this.id}),this.useLoaderData=t=>CN({...t,from:this.id}),this.useNavigate=()=>ks({from:this.fullPath}),this.Link=Fe.forwardRef((t,n)=>f.jsx(Mm,{ref:n,from:this.fullPath,...t}))}};function Ns(e){return new k8(e)}var N8=class extends n8{constructor(e){super(e),this.useMatch=t=>Io({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>NN({...t,from:this.id}),this.useSearch=t=>kN({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>iu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>wN({...t,from:this.id}),this.useLoaderData=t=>CN({...t,from:this.id}),this.useNavigate=()=>ks({from:this.fullPath}),this.Link=Fe.forwardRef((t,n)=>f.jsx(Mm,{ref:n,from:this.fullPath,...t}))}};function A8(e){return new N8(e)}function _8(e){const t=Gr(),n=`not-found-${gr(t.stores.location,r=>r.pathname)}-${gr(t.stores.status,r=>r)}`;return f.jsx(Rx,{getResetKey:()=>n,onCatch:(r,s)=>{if(ar(r))e.onCatch?.(r,s);else throw r},errorComponent:({error:r})=>{if(ar(r))return e.fallback?.(r);throw r},children:e.children})}function R8(){return f.jsx("p",{children:"Not Found"})}function Ml(e){return f.jsx(f.Fragment,{children:e.children})}function AN(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(R8,{})}function I8(e){return null}function O8(){return I8(Gr()),null}var M8=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,L8=(e,t)=>e[0]===t[0]&&e[1]===t[1],_N=y.memo(function({matchId:t}){const n=Gr(),r=n.stores.matchStores.get(t);r||Si();const s=gr(n.stores.loadedAt,l=>l),a=gr(r,l=>l,M8);return f.jsx(D8,{router:n,matchId:t,resetKey:s,matchState:y.useMemo(()=>{const l=a.routeId,u=n.routesById[l].parentRoute?.id;return{routeId:l,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:u}},[a._displayPending,a.routeId,a.ssr,n.routesById])})});function D8({router:e,matchId:t,resetKey:n,matchState:r}){const s=e.routesById[r.routeId],a=s.options.pendingComponent??e.options.defaultPendingComponent,l=a?f.jsx(a,{}):null,u=s.options.errorComponent??e.options.defaultErrorComponent,d=s.options.onCatch??e.options.defaultOnCatch,h=s.isRoot?s.options.notFoundComponent??e.options.notFoundRoute?.options.component:s.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!s.isRoot||s.options.wrapInSuspense||p)&&(s.options.wrapInSuspense??a??(s.options.errorComponent?.preload||p))?y.Suspense:Ml,b=u?Rx:Ml,x=h?_8:Ml;return f.jsxs(s.isRoot?s.options.shellComponent??Ml:Ml,{children:[f.jsx(Om.Provider,{value:t,children:f.jsx(m,{fallback:l,children:f.jsx(b,{getResetKey:()=>n,errorComponent:u||Ix,onCatch:(E,N)=>{if(ar(E))throw E.routeId??=r.routeId,E;d?.(E,N)},children:f.jsx(x,{fallback:E=>{if(E.routeId??=r.routeId,!h||E.routeId&&E.routeId!==r.routeId||!E.routeId&&!s.isRoot)throw E;return y.createElement(h,E)},children:p||r._displayPending?f.jsx(s8,{fallback:l,children:f.jsx(lC,{matchId:t})}):f.jsx(lC,{matchId:t})})})})}),r.parentRouteId===go?f.jsxs(f.Fragment,{children:[f.jsx(j8,{}),e.options.scrollRestoration&&Jk?f.jsx(O8,{}):null]}):null]})}function j8(){const e=Gr(),t=y.useRef();return Nc(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...zl(e.stores.location.get(),r??n)}),t.current=n},[gr(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var lC=y.memo(function({matchId:t}){const n=Gr(),r=(p,m)=>n.getMatch(p.id)?._nonReactive[m]??p._nonReactive[m],s=n.stores.matchStores.get(t);s||Si();const a=gr(s,p=>p),l=a.routeId,u=n.routesById[l],d=y.useMemo(()=>{const p=(n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:l,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return p?JSON.stringify(p):void 0},[l,a.loaderDeps,a._strictParams,a._strictSearch,n.options.defaultRemountDeps,n.routesById]),h=y.useMemo(()=>{const p=u.options.component??n.options.defaultComponent;return p?f.jsx(p,{},d):f.jsx(RN,{})},[d,u.options.component,n.options.defaultComponent]);if(a._displayPending)throw r(a,"displayPendingPromise");if(a._forcePending)throw r(a,"minPendingPromise");if(a.status==="pending"){const p=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(p){const m=n.getMatch(a.id);if(m&&!m._nonReactive.minPendingPromise){const b=ql();m._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw r(a,"loadPromise")}if(a.status==="notFound")return ar(a.error)||Si(),AN(n,u,a.error);if(a.status==="redirected")throw Rr(a.error)||Si(),r(a,"loadPromise");if(a.status==="error")throw a.error;return h}),RN=y.memo(function(){const t=Gr(),n=y.useContext(Om);let r,s=!1,a;{const h=n?t.stores.matchStores.get(n):void 0;[r,s]=gr(h,p=>[p?.routeId,p?.globalNotFound??!1],L8),a=gr(t.stores.matchesId,p=>p[p.findIndex(m=>m===n)+1])}const l=r?t.routesById[r]:void 0,u=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(s)return l||Si(),AN(t,l,void 0);if(!a)return null;const d=f.jsx(_N,{matchId:a});return r===go?f.jsx(y.Suspense,{fallback:u,children:d}):d});function P8(){const e=Gr(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),s=gr(e.stores.isLoading,m=>m),a=gr(e.stores.hasPending,m=>m),l=Hg(s),u=s||n||a,d=Hg(u),h=s||a,p=Hg(h);return e.startTransition=m=>{r(!0),y.startTransition(()=>{m(),r(!1)})},y.useEffect(()=>{const m=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ti(e.latestLocation.publicHref)!==Ti(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{m()}},[e,e.history]),Nc(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),Nc(()=>{l&&!s&&e.emit({type:"onLoad",...zl(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,s]),Nc(()=>{p&&!h&&e.emit({type:"onBeforeRouteMount",...zl(e.stores.location.get(),e.stores.resolvedLocation.get())})},[h,p,e]),Nc(()=>{if(d&&!u){const m=zl(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...m}),yN(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[u,d,e]),null}function B8(){const e=Gr(),t=e.routesById[go].options.pendingComponent??e.options.defaultPendingComponent,n=t?f.jsx(t,{}):null,r=f.jsxs(typeof document<"u"&&e.ssr?Ml:y.Suspense,{fallback:n,children:[f.jsx(P8,{}),f.jsx(z8,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:r}):r}function z8(){const e=Gr(),t=gr(e.stores.firstId,s=>s),n=gr(e.stores.loadedAt,s=>s),r=t?f.jsx(_N,{matchId:t}):null;return f.jsx(Om.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(Rx,{getResetKey:()=>n,errorComponent:Ix,onCatch:void 0,children:r})})}var U8=e=>({createMutableStore:rC,createReadonlyStore:rC,batch:yN}),H8=e=>new F8(e),F8=class extends KL{constructor(e){super(e,U8)}};function $8({router:e,children:t,...n}){tN(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=f.jsx(bN.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function V8({router:e,...t}){return f.jsx($8,{router:e,...t,children:f.jsx(B8,{})})}function xd(e){const t=Gr({warn:e?.router===void 0}),n=e?.router||t;return gr(n.stores.__store,SN(e,n))}function IN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=IN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lm(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=IN(e))&&(r&&(r+=" "),r+=t);return r}const uC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cC=Lm,ON=(e,t)=>n=>{var r;if(t?.variants==null)return cC(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(h=>{const p=n?.[h],m=a?.[h];if(p===null)return null;const b=uC(p)||uC(m);return s[h][b]}),u=n&&Object.entries(n).reduce((h,p)=>{let[m,b]=p;return b===void 0||(h[m]=b),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:m,className:b,...x}=p;return Object.entries(x).every(E=>{let[N,C]=E;return Array.isArray(C)?C.includes({...a,...u}[N]):{...a,...u}[N]===C})?[...h,m,b]:h},[]);return cC(e,l,d,n?.class,n?.className)},q8=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Y8=(e,t)=>({classGroupId:e,validator:t}),MN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wh="-",dC=[],G8="arbitrary..",K8=e=>{const t=W8(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return X8(l);const u=l.split(Wh),d=u[0]===""&&u.length>1?1:0;return LN(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],h=n[l];return d?h?q8(h,d):d:h||dC}return n[l]||dC}}},LN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const h=LN(e,t+1,a);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(Wh):e.slice(t).join(Wh),d=l.length;for(let h=0;h<d;h++){const p=l[h];if(p.validator(u))return p.classGroupId}},X8=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?G8+r:void 0})(),W8=e=>{const{theme:t,classGroups:n}=e;return Q8(n,t)},Q8=(e,t)=>{const n=MN();for(const r in e){const s=e[r];Ox(s,n,r,t)}return n},Ox=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];Z8(l,t,n,r)}},Z8=(e,t,n,r)=>{if(typeof e=="string"){J8(e,t,n);return}if(typeof e=="function"){eD(e,t,n,r);return}tD(e,t,n,r)},J8=(e,t,n)=>{const r=e===""?t:DN(t,e);r.classGroupId=n},eD=(e,t,n,r)=>{if(nD(e)){Ox(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Y8(n,e))},tD=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[u,d]=s[l];Ox(d,DN(t,u),n,r)}},DN=(e,t)=>{let n=e;const r=t.split(Wh),s=r.length;for(let a=0;a<s;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=MN(),n.nextPart.set(l,u)),n=u}return n},nD=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,rD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return s(a,l),l},set(a,l){a in n?n[a]=l:s(a,l)}}},db="!",fC=":",sD=[],hC=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),iD=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,u=0,d=0,h;const p=s.length;for(let N=0;N<p;N++){const C=s[N];if(l===0&&u===0){if(C===fC){a.push(s.slice(d,N)),d=N+1;continue}if(C==="/"){h=N;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const m=a.length===0?s:s.slice(d);let b=m,x=!1;m.endsWith(db)?(b=m.slice(0,-1),x=!0):m.startsWith(db)&&(b=m.slice(1),x=!0);const E=h&&h>d?h-d:void 0;return hC(a,x,b,E)};if(t){const s=t+fC,a=r;r=l=>l.startsWith(s)?a(l.slice(s.length)):hC(sD,!1,l,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},aD=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",d=t.has(l);u||d?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},oD=e=>({cache:rD(e.cacheSize),parseClassName:iD(e),sortModifiers:aD(e),postfixLookupClassGroupIds:lD(e),...K8(e)}),lD=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},uD=/\s+/,cD=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a,postfixLookupClassGroupIds:l}=t,u=[],d=e.trim().split(uD);let h="";for(let p=d.length-1;p>=0;p-=1){const m=d[p],{isExternal:b,modifiers:x,hasImportantModifier:E,baseClassName:N,maybePostfixModifierPosition:C}=n(m);if(b){h=m+(h.length>0?" "+h:h);continue}let S=!!C,k;if(S){const O=N.substring(0,C);k=r(O);const j=k&&l[k]?r(N):void 0;j&&j!==k&&(k=j,S=!1)}else k=r(N);if(!k){if(!S){h=m+(h.length>0?" "+h:h);continue}if(k=r(N),!k){h=m+(h.length>0?" "+h:h);continue}S=!1}const A=x.length===0?"":x.length===1?x[0]:a(x).join(":"),R=E?A+db:A,M=R+k;if(u.indexOf(M)>-1)continue;u.push(M);const _=s(k,S);for(let O=0;O<_.length;++O){const j=_[O];u.push(R+j)}h=m+(h.length>0?" "+h:h)}return h},dD=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=jN(n))&&(s&&(s+=" "),s+=r);return s},jN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=jN(e[r]))&&(n&&(n+=" "),n+=t);return n},fb=(e,...t)=>{let n,r,s,a;const l=d=>{const h=t.reduce((p,m)=>m(p),e());return n=oD(h),r=n.cache.get,s=n.cache.set,a=u,u(d)},u=d=>{const h=r(d);if(h)return h;const p=cD(d,n);return s(d,p),p};return a=l,(...d)=>a(dD(...d))},fD=[],Bn=e=>{const t=n=>n[e]||fD;return t.isThemeGetter=!0,t},PN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,BN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,mD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pD=/\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$/,gD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,aa=e=>hD.test(e),Et=e=>!!e&&!Number.isNaN(Number(e)),Ds=e=>!!e&&Number.isInteger(Number(e)),e1=e=>e.endsWith("%")&&Et(e.slice(0,-1)),gi=e=>mD.test(e),zN=()=>!0,yD=e=>pD.test(e)&&!gD.test(e),Mx=()=>!1,vD=e=>bD.test(e),ED=e=>xD.test(e),TD=e=>!We(e)&&!Qe(e),SD=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),CD=e=>ka(e,FN,Mx),We=e=>PN.test(e),Ja=e=>ka(e,$N,yD),mC=e=>ka(e,OD,Et),wD=e=>ka(e,qN,zN),kD=e=>ka(e,VN,Mx),pC=e=>ka(e,UN,Mx),ND=e=>ka(e,HN,ED),Jf=e=>ka(e,YN,vD),Qe=e=>BN.test(e),hc=e=>Oo(e,$N),AD=e=>Oo(e,VN),gC=e=>Oo(e,UN),_D=e=>Oo(e,FN),RD=e=>Oo(e,HN),eh=e=>Oo(e,YN,!0),ID=e=>Oo(e,qN,!0),ka=(e,t,n)=>{const r=PN.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Oo=(e,t,n=!1)=>{const r=BN.exec(e);return r?r[1]?t(r[1]):n:!1},UN=e=>e==="position"||e==="percentage",HN=e=>e==="image"||e==="url",FN=e=>e==="length"||e==="size"||e==="bg-size",$N=e=>e==="length",OD=e=>e==="number",VN=e=>e==="family-name",qN=e=>e==="number"||e==="weight",YN=e=>e==="shadow",hb=()=>{const e=Bn("color"),t=Bn("font"),n=Bn("text"),r=Bn("font-weight"),s=Bn("tracking"),a=Bn("leading"),l=Bn("breakpoint"),u=Bn("container"),d=Bn("spacing"),h=Bn("radius"),p=Bn("shadow"),m=Bn("inset-shadow"),b=Bn("text-shadow"),x=Bn("drop-shadow"),E=Bn("blur"),N=Bn("perspective"),C=Bn("aspect"),S=Bn("ease"),k=Bn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...R(),Qe,We],_=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],j=()=>[Qe,We,d],H=()=>[aa,"full","auto",...j()],B=()=>[Ds,"none","subgrid",Qe,We],K=()=>["auto",{span:["full",Ds,Qe,We]},Ds,Qe,We],X=()=>[Ds,"auto",Qe,We],Z=()=>["auto","min","max","fr",Qe,We],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...j()],V=()=>[aa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],W=()=>[aa,"screen","full","dvw","lvw","svw","min","max","fit",...j()],le=()=>[aa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],D=()=>[e,Qe,We],P=()=>[...R(),gC,pC,{position:[Qe,We]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",_D,CD,{size:[Qe,We]}],ae=()=>[e1,hc,Ja],re=()=>["","none","full",h,Qe,We],ce=()=>["",Et,hc,Ja],de=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>[Et,e1,gC,pC],He=()=>["","none",E,Qe,We],Me=()=>["none",Et,Qe,We],Ee=()=>["none",Et,Qe,We],Oe=()=>[Et,Qe,We],Be=()=>[aa,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gi],breakpoint:[gi],color:[zN],container:[gi],"drop-shadow":[gi],ease:["in","out","in-out"],font:[TD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gi],shadow:[gi],spacing:["px",Et],text:[gi],"text-shadow":[gi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",aa,We,Qe,C]}],container:["container"],"container-type":[{"@container":["","normal","size",Qe,We]}],"container-named":[SD],columns:[{columns:[Et,We,Qe,u]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:M()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[Ds,"auto",Qe,We]}],basis:[{basis:[aa,"full","auto",u,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Et,aa,"auto","initial","none",We]}],grow:[{grow:["",Et,Qe,We]}],shrink:[{shrink:["",Et,Qe,We]}],order:[{order:[Ds,"first","last","none",Qe,We]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...le()]}],"min-block-size":[{"min-block":["auto",...le()]}],"max-block-size":[{"max-block":["none",...le()]}],w:[{w:[u,"screen",...V()]}],"min-w":[{"min-w":[u,"screen","none",...V()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,hc,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ID,wD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",e1,We]}],"font-family":[{font:[AD,kD,t]}],"font-features":[{"font-features":[We]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Qe,We]}],"line-clamp":[{"line-clamp":[Et,"none",Qe,mC]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",Qe,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Qe,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Et,"from-font","auto",Qe,Ja]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[Et,"auto",Qe,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[Ds,Qe,We]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe,We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Qe,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ds,Qe,We],radial:["",Qe,We],conic:[Ds,Qe,We]},RD,ND]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"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:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Et,Qe,We]}],"outline-w":[{outline:["",Et,hc,Ja]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",p,eh,Jf]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",m,eh,Jf]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[Et,Ja]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",b,eh,Jf]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[Et,Qe,We]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"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":[Et]}],"mask-image-linear-from-pos":[{"mask-linear-from":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Qe,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Et]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Qe,We]}],filter:[{filter:["","none",Qe,We]}],blur:[{blur:He()}],brightness:[{brightness:[Et,Qe,We]}],contrast:[{contrast:[Et,Qe,We]}],"drop-shadow":[{"drop-shadow":["","none",x,eh,Jf]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",Et,Qe,We]}],"hue-rotate":[{"hue-rotate":[Et,Qe,We]}],invert:[{invert:["",Et,Qe,We]}],saturate:[{saturate:[Et,Qe,We]}],sepia:[{sepia:["",Et,Qe,We]}],"backdrop-filter":[{"backdrop-filter":["","none",Qe,We]}],"backdrop-blur":[{"backdrop-blur":He()}],"backdrop-brightness":[{"backdrop-brightness":[Et,Qe,We]}],"backdrop-contrast":[{"backdrop-contrast":[Et,Qe,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Et,Qe,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Et,Qe,We]}],"backdrop-invert":[{"backdrop-invert":["",Et,Qe,We]}],"backdrop-opacity":[{"backdrop-opacity":[Et,Qe,We]}],"backdrop-saturate":[{"backdrop-saturate":[Et,Qe,We]}],"backdrop-sepia":[{"backdrop-sepia":["",Et,Qe,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Qe,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Et,"initial",Qe,We]}],ease:[{ease:["linear","initial",S,Qe,We]}],delay:[{delay:[Et,Qe,We]}],animate:[{animate:["none",k,Qe,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,Qe,We]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:Oe()}],"skew-x":[{"skew-x":Oe()}],"skew-y":[{"skew-y":Oe()}],transform:[{transform:[Qe,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],zoom:[{zoom:[Ds,Qe,We]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",Qe,We]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",Qe,We]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[Et,hc,Ja,mC]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},MD=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(Ll(e,"cacheSize",t),Ll(e,"prefix",n),Ll(e,"experimentalParseClassName",r),th(e.theme,a.theme),th(e.classGroups,a.classGroups),th(e.conflictingClassGroups,a.conflictingClassGroups),th(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Ll(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),Ll(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),nh(e.theme,s.theme),nh(e.classGroups,s.classGroups),nh(e.conflictingClassGroups,s.conflictingClassGroups),nh(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),mb(e,s,"postfixLookupClassGroups"),mb(e,s,"orderSensitiveModifiers"),e),Ll=(e,t,n)=>{n!==void 0&&(e[t]=n)},th=(e,t)=>{if(t)for(const n in t)Ll(e,n,t[n])},nh=(e,t)=>{if(t)for(const n in t)mb(e,t,n)},mb=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},LD=(e,...t)=>typeof e=="function"?fb(hb,e,...t):fb(()=>MD(hb(),e),...t),GN=fb(hb),DD=LD({extend:{classGroups:{"font-size":[{text:["display-xl","display-lg","display-md","display-sm","heading-1","heading-2","heading-3","body","body-sm","label","code"]}]}}});function xe(...e){return DD(Lm(e))}const jD=ON("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 focus-visible:ring-offset-bg disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-accent-hover",outline:"border-border bg-surface hover:border-border-strong hover:bg-surface-hover",secondary:"bg-secondary text-secondary-foreground hover:bg-surface-hover",ghost:"text-fg-2 hover:bg-surface-hover hover:text-foreground",destructive:"text-danger hover:bg-danger-bg",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-3",xs:"h-6 gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 px-2.5 text-xs",lg:"h-9 gap-1.5 px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}}),Je=y.forwardRef(({className:e,variant:t="default",size:n="default",type:r="button",...s},a)=>f.jsx("button",{ref:a,type:r,"data-slot":"button",className:xe(jD({variant:t,size:n,className:e})),...s}));Je.displayName="Button";const PD=ON("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-label font-medium whitespace-nowrap",{variants:{variant:{neutral:"border-border bg-surface text-fg-2",accent:"border-transparent bg-accent-bg text-fg-1",success:"border-transparent bg-success-bg text-success",warning:"border-transparent bg-warning-bg text-warning",danger:"border-transparent bg-danger-bg text-danger",info:"border-transparent bg-info-bg text-info"},mono:{true:"font-mono text-code",false:""}},defaultVariants:{variant:"neutral",mono:!1}});function gn({className:e,variant:t="neutral",mono:n,dot:r,children:s,...a}){return f.jsxs("span",{"data-slot":"badge",className:xe(PD({variant:t,mono:n,className:e})),...a,children:[r?f.jsx("span",{"aria-hidden":!0,className:"size-1.5 rounded-full bg-current"}):null,s]})}function Ci({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:xe("rounded-lg border border-border bg-surface",e),...t})}function wi({className:e,...t}){return f.jsx("div",{className:xe("flex items-start justify-between gap-3 px-4 pt-3.5 pb-3",e),...t})}function ki({className:e,...t}){return f.jsx("h3",{className:xe("text-heading-3 font-semibold text-text",e),...t})}function Ni({className:e,...t}){return f.jsx("div",{className:xe("px-4 pb-4",e),...t})}const Yt=y.forwardRef(({className:e,...t},n)=>f.jsx("input",{ref:n,"data-slot":"input",className:xe("h-8 w-full rounded-md border border-border bg-bg px-2.5 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));Yt.displayName="Input";const KN=y.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{ref:n,"data-slot":"textarea",className:xe("w-full resize-none rounded-md border border-border bg-bg px-2.5 py-2 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));KN.displayName="Textarea";const XN={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},WN={...XN,position:"fixed",top:0,left:0},BD={...XN,position:"absolute"},bC={};function br(e,t){const n=y.useRef(bC);return n.current===bC&&(n.current=e(t)),n}function Eo(e,t,n,r){const s=br(QN).current;return UD(s,e,t,n,r)&&ZN(s,[e,t,n,r]),s.callback}function zD(e){const t=br(QN).current;return HD(t,e)&&ZN(t,e),t.callback}function QN(){return{callback:null,cleanup:null,refs:[]}}function UD(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function HD(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function ZN(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const l=a(n);typeof l=="function"&&(r[s]=l);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const l=r[s];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}function Lx(e){const t=y.useRef(!0);t.current&&(t.current=!1,e())}function FD(e){const[t,n]=y.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function $D(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function xC({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=y.useRef(e!==void 0),[a,l]=y.useState(t),u=s?e:a,d=y.useCallback(h=>{s||l(h)},[]);return[u,d]}const VD=()=>{},Ye=typeof document<"u"?y.useLayoutEffect:VD,Dx={...YM},t1=Dx.useInsertionEffect,qD=t1&&t1!==Dx.useLayoutEffect?t1:e=>e();function nt(e){const t=br(YD).current;return t.next=e,qD(t.effect),t.trampoline}function YD(){const e={next:void 0,callback:GD,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function GD(){}function Tn(e){const t=br(KD,e).current;return t.next=e,Ye(t.effect),t}function KD(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function XD(e,t){return function(r,...s){const a=new URL(e);return a.searchParams.set("code",r.toString()),s.forEach(l=>a.searchParams.append("args[]",l)),`${t} error #${r}; visit ${a} for the full message.`}}const Dn=XD("https://base-ui.com/production-error","Base UI"),ze=(e,t,n,r,s,a,...l)=>{if(l.length>0)throw new Error(Dn(1));let u;if(e)u=e;else throw new Error("Missing arguments");return u};var JN=EN();const WD=parseInt(y.version,10);function jx(e){return WD>=e}const pb=[];let gb;function QD(){return gb}function ZD(e){pb.push(e)}function Px(e){const t=(n,r)=>{const s=br(JD).current;let a;try{gb=s;for(const l of pb)l.before(s);a=e(n,r);for(const l of pb)l.after(s);s.didInitialize=!0}finally{gb=void 0}return a};return t.displayName=e.displayName||e.name,t}function eA(e){return y.forwardRef(Px(e))}function JD(){return{didInitialize:!1}}const ej=jx(19),tj=ej?rj:sj;function ft(e,t,n,r,s){return tj(e,t,n,r,s)}function nj(e,t,n,r,s){const a=y.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return JN.useSyncExternalStore(e.subscribe,a,a)}ZD({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),JN.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function rj(e,t,n,r,s){const a=QD();if(!a)return nj(e,t,n,r,s);const l=a.syncIndex;a.syncIndex+=1;let u;return a.didInitialize?(u=a.syncHooks[l],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(a.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},a.syncHooks.push(u)),u.value}function sj(e,t,n,r,s){return TN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,s))}class tA{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return ft(this,t,n,r,s)}}function Vn(){}const Yl=Object.freeze([]),fn=Object.freeze({});class Dm extends tA{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){y.useDebugValue(t);const r=this;Ye(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;Ye(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);Ye(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){y.useDebugValue(t);const r=this,s=n!==void 0;Ye(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const a=this.selectors[t];return a(this.state,n,r,s)}useState(t,n,r,s){return y.useDebugValue(t),ft(this,this.selectors[t],n,r,s)}useContextCallback(t,n){y.useDebugValue(t);const r=nt(n??Vn);this.context[t]=r}useStateSetter(t){const n=y.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(a=>{const l=r(a);if(!Object.is(s,l)){const u=s;s=l,n(l,u,this)}})}}function jm(){return typeof window<"u"}function tr(e){return Bx(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Li(e){var t;return(t=(Bx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bx(e){return jm()?e instanceof Node||e instanceof on(e).Node:!1}function St(e){return jm()?e instanceof Element||e instanceof on(e).Element:!1}function dn(e){return jm()?e instanceof HTMLElement||e instanceof on(e).HTMLElement:!1}function Gl(e){return!jm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof on(e).ShadowRoot}function Mo(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=qr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function ij(e){return/^(table|td|th)$/.test(tr(e))}function Pm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const aj=/transform|translate|scale|rotate|perspective|filter/,oj=/paint|layout|strict|content/,eo=e=>!!e&&e!=="none";let n1;function zx(e){const t=St(e)?qr(e):e;return eo(t.transform)||eo(t.translate)||eo(t.scale)||eo(t.rotate)||eo(t.perspective)||!Ux()&&(eo(t.backdropFilter)||eo(t.filter))||aj.test(t.willChange||"")||oj.test(t.contain||"")}function lj(e){let t=Ii(e);for(;dn(t)&&!Ai(t);){if(zx(t))return t;if(Pm(t))return null;t=Ii(t)}return null}function Ux(){return n1==null&&(n1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),n1}function Ai(e){return/^(html|body|#document)$/.test(tr(e))}function qr(e){return on(e).getComputedStyle(e)}function Bm(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ii(e){if(tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gl(e)&&e.host||Li(e);return Gl(t)?t.host:t}function nA(e){const t=Ii(e);return Ai(t)?(e.ownerDocument||e).body:dn(t)&&Mo(t)?t:nA(t)}function sd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=nA(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=on(s);if(a){const u=bb(l);return t.concat(l,l.visualViewport||[],Mo(s)?s:[],u&&n?sd(u):[])}else return t.concat(s,sd(s,[],n))}function bb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vs(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function At(e){return e?.ownerDocument||document}function Tt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const uj=[];function Hx(e){y.useEffect(e,uj)}const rh=null;class cj{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)n[s]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const sh=new cj;class Hs{static create(){return new Hs}static request(t){return sh.request(t)}static cancel(t){return sh.cancel(t)}currentId=rh;request(t){this.cancel(),this.currentId=sh.request(()=>{this.currentId=rh,t()})}cancel=()=>{this.currentId!==rh&&(sh.cancel(this.currentId),this.currentId=rh)};disposeEffect=()=>this.cancel}function Kl(){const e=br(Hs.create).current;return Hx(e.disposeEffect),e}const mc=0;class Ts{static create(){return new Ts}currentId=mc;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=mc,n()},t)}isStarted(){return this.currentId!==mc}clear=()=>{this.currentId!==mc&&(clearTimeout(this.currentId),this.currentId=mc)};disposeEffect=()=>this.clear}function Gn(){const e=br(Ts.create).current;return Hx(e.disposeEffect),e}function dj(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:fj,platform:hj,maxTouchPoints:mj}=dj(),zm=fj.toLowerCase(),id=hj.toLowerCase(),Um=/^i(os$|p)/.test(id)||id==="macintel"&&mj>1,yC="android",xb=id===yC||zm.includes(yC),Fx=!Um&&id.startsWith("mac");id.startsWith("win");const pj=Fx||Um,Na=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Na&&zm.includes("firefox");!Na&&zm.includes("chrom");const gj=pj,$x=/jsdom|happydom/.test(zm);function Us(e){e.preventDefault(),e.stopPropagation()}function bj(e){return"nativeEvent"in e}function Vx(e){return e.pointerType===""&&e.isTrusted?!0:xb&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function rA(e){return $x?!1:!xb&&e.width===0&&e.height===0||xb&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function To(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function xj(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const yb="data-base-ui-focusable",sA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Hm="ArrowLeft",Fm="ArrowRight",iA="ArrowUp",qx="ArrowDown";function _r(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function rt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Gl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function pr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Qh(e,t){if(!St(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(rt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function r1(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function yj(e){return e.matches("html,body")}function $m(e){return dn(e)&&e.matches(sA)}function vj(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${sA}`)!=null}function vb(e){return e?e.getAttribute("role")==="combobox"&&$m(e):!1}function Ej(e){if(!e||$x)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Zh(e){return e?e.hasAttribute(yb)?e:e.querySelector(`[${yb}]`)||e:null}function Tj(e,t){return t!=null&&!To(t)?0:typeof e=="function"?e():e}function Xl(e,t,n){const r=Tj(e,n);return typeof r=="number"?r:r?.[t]}function vC(e){return typeof e=="function"?e():e}function aA(e,t){return t||e==="click"||e==="mousedown"}function Sj(e){return e?.includes("mouse")&&e!=="mousedown"}const au="none",ou="trigger-press",qn="trigger-hover",Ul="trigger-focus",Vm="outside-press",Pc="item-press",Cj="close-press",So="focus-out",qm="escape-key",Eb="list-navigation",oA="cancel-open",Ac="sibling-open",wj="disabled",Yx="imperative-action",kj="window-resize";function mt(e,t,n,r){let s=!1,a=!1;const l=fn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:n,...l}}const lA=y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ts,currentIdRef:{current:null},currentContextRef:{current:null}});function Nj(e,t){e.current=t.current}function Aj(e){const{children:t,delay:n,timeoutMs:r=0}=e,s=y.useRef(n),a=y.useRef(n),l=y.useRef(null),u=y.useRef(null),d=Gn();return Ye(()=>{if(a.current=n,!l.current){s.current=n;return}s.current={open:Xl(s.current,"open"),close:Xl(n,"close")}},[n,l,s,a]),f.jsx(lA.Provider,{value:y.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:a,currentIdRef:l,timeoutMs:r,currentContextRef:u,timeout:d}),[r,d]),children:t})}function _j(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),a=y.useContext(lA),{currentIdRef:l,delayRef:u,timeoutMs:d,initialDelayRef:h,currentContextRef:p,hasProvider:m,timeout:b}=a,[x,E]=y.useState(!1),N=y.useRef(n),C=y.useRef(!1);return Ye(()=>{N.current=n},[n]),Ye(()=>()=>{C.current=!0},[]),Ye(()=>{function S(){C.current||E(!1),p.current?.setIsInstantPhase(!1),l.current=null,p.current=null,u.current=h.current,b.clear()}if(l.current&&!n&&l.current===s){if(E(!1),d){const k=s;return b.start(d,()=>{r.select("open")||l.current&&l.current!==k||S()}),()=>{(N.current||l.current!==k)&&b.clear()}}S()}},[n,s,l,u,d,h,p,b,r]),Ye(()=>{if(!n)return;const S=p.current,k=l.current;b.clear(),p.current={onOpenChange:r.setOpen,setIsInstantPhase:E},l.current=s,u.current={open:0,close:Xl(h.current,"close")},k!==null&&k!==s?(E(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,mt(au))):(E(!1),S?.setIsInstantPhase(!1))},[n,s,r,l,u,h,p,b]),Ye(()=>()=>{if(l.current===s){if(p.current=null,!N.current)return;l.current=null,Nj(u,h),b.clear()}},[p,l,u,s,h,b]),y.useMemo(()=>({hasProvider:m,delayRef:u,isInstantPhase:x}),[m,u,x])}const Wl=y.forwardRef(function(t,n){const[r,s]=y.useState();Ye(()=>{gj&&Na&&s("button")},[]);const a={tabIndex:0,role:r};return f.jsx("span",{...t,ref:n,style:WN,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})}),Rj=["top","right","bottom","left"],Ql=Math.min,_i=Math.max,Jh=Math.round,ih=Math.floor,Ri=e=>({x:e,y:e}),Ij={left:"right",right:"left",bottom:"top",top:"bottom"};function uA(e,t,n){return _i(e,Ql(t,n))}function Oi(e,t){return typeof e=="function"?e(t):e}function $r(e){return e.split("-")[0]}function Aa(e){return e.split("-")[1]}function Gx(e){return e==="x"?"y":"x"}function Kx(e){return e==="y"?"height":"width"}function ls(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Xx(e){return Gx(ls(e))}function Oj(e,t,n){n===void 0&&(n=!1);const r=Aa(e),s=Xx(e),a=Kx(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=em(l)),[l,em(l)]}function Mj(e){const t=em(e);return[Tb(e),t,Tb(t)]}function Tb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const EC=["left","right"],TC=["right","left"],Lj=["top","bottom"],Dj=["bottom","top"];function jj(e,t,n){switch(e){case"top":case"bottom":return n?t?TC:EC:t?EC:TC;case"left":case"right":return t?Lj:Dj;default:return[]}}function Pj(e,t,n,r){const s=Aa(e);let a=jj($r(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(Tb)))),a}function em(e){const t=$r(e);return Ij[t]+e.slice(t.length)}function Bj(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function cA(e){return typeof e!="number"?Bj(e):{top:e,right:e,bottom:e,left:e}}function ad(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function SC(e,t){return t<0||t>=e.length}function s1(e,t){return jl(e.current,{disabledIndices:t})}function CC(e,t){return jl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function jl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let a=t;do a+=n?-s:s;while(a>=0&&a<=e.length-1&&dA(e,a,r));return a}function dA(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const s=e[t];return s?Ym(s)?!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!0:!1}function zj(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Ym(e,t=e?qr(e):null){return!e||!e.isConnected||!t||zj(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Uj='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Hj(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Gl(n)?n.host:null}function Sb(e){for(const t of Array.from(e.children))if(tr(t)==="summary")return t;return null}function Fj(e,t){const n=Sb(t);return!!n&&(e===n||rt(n,e))}function fA(e){const t=e?tr(e):"";return e!=null&&e.matches(Uj)&&(t!=="summary"||e.parentElement!=null&&tr(e.parentElement)==="details"&&Sb(e.parentElement)===e)&&(t!=="details"||Sb(e)==null)&&(t!=="input"||e.type!=="hidden")}function hA(e){if(!fA(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Hj(t)){const n=t!==e,r=tr(t)==="slot";if(t.hasAttribute("inert")||n&&tr(t)==="details"&&!t.open&&!Fj(e,t)||t.hasAttribute("hidden")||!r&&!$j(t,n))return!1}return!0}function $j(e,t){const n=qr(e);return t?n.display!=="none":Ym(e,n)}function mA(e){const t=e.tabIndex;if(t<0){const n=tr(e);if(n==="details"||n==="audio"||n==="video"||dn(e)&&e.isContentEditable)return 0}return t}function i1(e){if(tr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Vj(e,t){const n=i1(e);if(!n)return!0;const r=t.find(s=>{const a=i1(s);return a?.name===n.name&&a.form===n.form&&a.checked});return r?r===n:t.find(s=>{const a=i1(s);return a?.name===n.name&&a.form===n.form})===n}function pA(e){if(dn(e)&&tr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return dn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function gA(e,t){pA(e).forEach(n=>{fA(n)&&t.push(n),gA(n,t)})}function bA(e,t,n){pA(e).forEach(r=>{dn(r)&&r.matches(t)&&n.push(r),bA(r,t,n)})}function Wx(e){return hA(e)&&mA(e)>=0}function xA(e){const t=[];return gA(e,t),t.filter(hA)}function yd(e){const t=xA(e);return t.filter(n=>mA(n)>=0&&Vj(n,t))}function yA(e,t){const n=yd(e),r=n.length;if(r===0)return;const s=_r(At(e)),a=n.indexOf(s),l=a===-1?t===1?0:r-1:a+t;return n[l]}function Qx(e){return yA(At(e).body,1)||e}function vA(e){return yA(At(e).body,-1)||e}function EA(e,t){if(!e)return null;const n=yd(At(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const a=(s+t+r)%r;return n[a]}function qj(e){return EA(e,1)}function Yj(e){return EA(e,-1)}function Hl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!rt(n,r)}function Gj(e){yd(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function wC(e){const t=[];bA(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ta(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Ta(e,s.id,n)])}function kC(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(a=>a.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function od(e){return`data-base-ui-${e}`}let ah=0;function jh(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(ah);function a(){s&&!s()||e?.focus({preventScroll:n})}if(r)return a(),Vn;const l=requestAnimationFrame(a);return ah=l,()=>{ah===l&&(cancelAnimationFrame(l),ah=0)}}const a1={inert:new WeakMap,"aria-hidden":new WeakMap},NC="data-base-ui-inert",Cb={inert:new WeakSet,"aria-hidden":new WeakSet};let pc=new WeakMap,o1=0;function Kj(e){return Cb[e]}function TA(e){return e?Gl(e)?e.host:TA(e.parentNode):null}const AC=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=TA(n);return e.contains(r)?r:null}).filter(n=>n!=null),_C=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},RC=(e,t,n)=>{const r=[],s=a=>{!a||n.has(a)||Array.from(a.children).forEach(l=>{tr(l)!=="script"&&(t.has(l)?s(l):r.push(l))})};return s(e),r};function Xj(e,t,n,r,{mark:s=!0}){let a=null;r?a="inert":n&&(a="aria-hidden");let l=null,u=null;const d=AC(t,e),h=s?RC(t,_C(d),new Set(d)):[],p=[],m=[];if(a){const b=a1[a],x=Kj(a);u=x,l=b;const E=AC(t,Array.from(t.querySelectorAll("[aria-live]"))),N=d.concat(E);RC(t,_C(N),new Set(N)).forEach(S=>{const k=S.getAttribute(a),A=k!==null&&k!=="false",R=(b.get(S)||0)+1;b.set(S,R),p.push(S),R===1&&A&&x.add(S),A||S.setAttribute(a,a==="inert"?"":"true")})}return s&&h.forEach(b=>{const x=(pc.get(b)||0)+1;pc.set(b,x),m.push(b),x===1&&b.setAttribute(NC,"")}),o1+=1,()=>{l&&p.forEach(b=>{const E=(l.get(b)||0)-1;l.set(b,E),E||(!u?.has(b)&&a&&b.removeAttribute(a),u?.delete(b))}),s&&m.forEach(b=>{const x=(pc.get(b)||0)-1;pc.set(b,x),x||b.removeAttribute(NC)}),o1-=1,o1||(a1.inert=new WeakMap,a1["aria-hidden"]=new WeakMap,Cb.inert=new WeakSet,Cb["aria-hidden"]=new WeakSet,pc=new WeakMap)}}function IC(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,a=At(e[0]).body;return Xj(e,a,n,r,{mark:s})}let OC=0;function Wj(e,t="mui"){const[n,r]=y.useState(e),s=e||n;return y.useEffect(()=>{n==null&&(OC+=1,r(`${t}-${OC}`))},[n,t]),s}const MC=Dx.useId;function Co(e,t){if(MC!==void 0){const n=MC();return e??(t?`${t}-${n}`:n)}return Wj(e,t)}function LC(e){if(!y.isValidElement(e))return null;const t=e,n=t.props;return(jx(19)?n?.ref:t.ref)??null}function wb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Qj(e,t){const n={};for(const r in e){const s=e[r];if(t?.hasOwnProperty(r)){const a=t[r](s);a!=null&&Object.assign(n,a);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function Zj(e,t){return typeof e=="function"?e(t):e}function Jj(e,t){return typeof e=="function"?e(t):e}const Zx={};function Ir(e,t,n,r,s){if(!n&&!r&&!s&&!e)return tm(t);let a=tm(e);return t&&(a=_c(a,t)),n&&(a=_c(a,n)),r&&(a=_c(a,r)),s&&(a=_c(a,s)),a}function e9(e){if(e.length===0)return Zx;if(e.length===1)return tm(e[0]);let t=tm(e[0]);for(let n=1;n<e.length;n+=1)t=_c(t,e[n]);return t}function tm(e){return Jx(e)?{...CA(e,Zx)}:t9(e)}function _c(e,t){return Jx(t)?CA(t,e):n9(e,t)}function t9(e){const t={...e};for(const n in t){const r=t[n];SA(n,r)&&(t[n]=wA(r))}return t}function n9(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=wb(e.style,r);break}case"className":{e[n]=kA(e.className,r);break}default:SA(n,r)?e[n]=r9(e[n],r):e[n]=r}}return e}function SA(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function Jx(e){return typeof e=="function"}function CA(e,t){return Jx(e)?e(t):e??Zx}function r9(e,t){return t?e?(...n)=>{const r=n[0];if(NA(r)){const a=r;nm(a);const l=t(...n);return a.baseUIHandlerPrevented||e?.(...n),l}const s=t(...n);return e?.(...n),s}:wA(t):e}function wA(e){return e&&((...t)=>{const n=t[0];return NA(n)&&nm(n),e(...t)})}function nm(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function kA(e,t){return t?e?t+" "+e:t:e}function NA(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function An(e,t,n={}){const r=t.render,s=s9(t,n);if(n.enabled===!1)return null;const a=n.state??fn;return o9(e,r,s,a)}function s9(e,t={}){const{className:n,style:r,render:s}=e,{state:a=fn,ref:l,props:u,stateAttributesMapping:d,enabled:h=!0}=t,p=h?Zj(n,a):void 0,m=h?Jj(r,a):void 0,b=h?Qj(a,d):fn,x=h&&u?i9(u):void 0,E=h?wb(b,x)??{}:fn;return typeof document<"u"&&(h?Array.isArray(l)?E.ref=zD([E.ref,LC(s),...l]):E.ref=Eo(E.ref,LC(s),l):Eo(null,null)),h?(p!==void 0&&(E.className=kA(E.className,p)),m!==void 0&&(E.style=wb(E.style,m)),E):fn}function i9(e){return Array.isArray(e)?e9(e):Ir(void 0,e)}const a9=Symbol.for("react.lazy");function o9(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Ir(n,t.props);s.ref=n.ref;let a=t;return a?.$$typeof===a9&&(a=y.Children.toArray(t)[0]),y.cloneElement(a,s)}if(e&&typeof e=="string")return l9(e,n);throw new Error(Dn(8))}function l9(e,t){return e==="button"?y.createElement("button",{type:"button",...t,key:t.key}):e==="img"?y.createElement("img",{alt:"",...t,key:t.key}):y.createElement(e,t)}const u9=500,c9=500,d9={style:{transition:"none"}},AA="data-base-ui-click-trigger",_A={fallbackAxisSide:"none"},RA={fallbackAxisSide:"end"},f9={clipPath:"inset(50%)",position:"fixed",top:0,left:0},IA=y.createContext(null),OA=()=>y.useContext(IA),h9=od("portal");function MA(e={}){const{ref:t,container:n,componentProps:r=fn,elementProps:s}=e,a=Co(),u=OA()?.portalNode,[d,h]=y.useState(null),[p,m]=y.useState(null),b=nt(C=>{C!==null&&m(C)}),x=y.useRef(null);Ye(()=>{if(n===null){x.current&&(x.current=null,m(null),h(null));return}if(a==null)return;const C=(n&&(Bx(n)?n:n.current))??u??document.body;if(C==null){x.current&&(x.current=null,m(null),h(null));return}x.current!==C&&(x.current=C,m(null),h(C))},[n,u,a]);const E=An("div",r,{ref:[t,b],props:[{id:a,[h9]:""},s]});return{portalNode:p,portalSubtree:d&&E?or.createPortal(E,d):null}}const ey=y.forwardRef(function(t,n){const{render:r,className:s,style:a,children:l,container:u,renderGuards:d,...h}=t,{portalNode:p,portalSubtree:m}=MA({container:u,ref:n,componentProps:t,elementProps:h}),b=y.useRef(null),x=y.useRef(null),E=y.useRef(null),N=y.useRef(null),[C,S]=y.useState(null),k=y.useRef(!1),A=C?.modal,R=C?.open,M=typeof d=="boolean"?d:!!C&&!C.modal&&C.open&&!!p;y.useEffect(()=>{if(!p||A)return;function O(j){p&&j.relatedTarget&&Hl(j)&&(j.type==="focusin"?k.current&&(wC(p),k.current=!1):(Gj(p),k.current=!0))}return Vs(Tt(p,"focusin",O,!0),Tt(p,"focusout",O,!0))},[p,A]),Ye(()=>{!p||R!==!0||!k.current||(wC(p),k.current=!1)},[R,p]);const _=y.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:x,beforeInsideRef:E,afterInsideRef:N,portalNode:p,setFocusManagerState:S}),[p]);return f.jsxs(y.Fragment,{children:[m,f.jsxs(IA.Provider,{value:_,children:[M&&p&&f.jsx(Wl,{"data-type":"outside",ref:b,onFocus:O=>{if(Hl(O,p))E.current?.focus();else{const j=C?C.domReference:null;vA(j)?.focus()}}}),M&&p&&f.jsx("span",{"aria-owns":p.id,style:f9}),p&&or.createPortal(l,p),M&&p&&f.jsx(Wl,{"data-type":"outside",ref:x,onFocus:O=>{if(Hl(O,p))N.current?.focus();else{const j=C?C.domReference:null;Qx(j)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,mt(So,O.nativeEvent))}}})]})]})});function LA(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class ty{nodesRef={current:[]};events=LA();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const DA=y.createContext(null),jA=y.createContext(null),_a=()=>y.useContext(DA)?.id||null,Ra=e=>{const t=y.useContext(jA);return e??t};function PA(e){const t=Co(),n=Ra(e),r=_a();return Ye(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function m9(e){const{children:t,id:n}=e,r=_a();return f.jsx(DA.Provider,{value:y.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function p9(e){const{children:t,externalTree:n}=e,r=br(()=>n??new ty).current;return f.jsx(jA.Provider,{value:r,children:t})}function bi(e){return e==null?e:"current"in e?e.current:e}function g9(e,t){const n=on(pr(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const DC=20;let xa=[];function ny(){xa=xa.filter(e=>e.deref()?.isConnected)}function jC(e){ny(),e&&tr(e)!=="body"&&(xa.push(new WeakRef(e)),xa.length>DC&&(xa=xa.slice(-DC)))}function PC(){return ny(),xa[xa.length-1]?.deref()}function b9(e){return e?Wx(e)?e:yd(e)[0]||e:null}function BC(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=xA(e).filter(s=>{const a=s.getAttribute("data-tabindex")||"";return Wx(s)||s.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ry(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:d=!0,openInteractionType:h="",nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:b,externalTree:x,getInsideElements:E}=e,N="rootStore"in t?t.rootStore:t,C=N.useState("open"),S=N.useState("domReferenceElement"),k=N.useState("floatingElement"),{events:A,dataRef:R}=N.context,M=nt(()=>R.current.floatingContext?.nodeId),_=s===!1,O=vb(S)&&_,j=Tn(s),H=Tn(a),B=Tn(h),K=Tn(C),X=Ra(x),Z=OA(),te=y.useRef(!1),q=y.useRef(!1),z=y.useRef(!1),V=y.useRef(null),W=y.useRef(""),le=y.useRef(""),D=y.useRef(null),P=y.useRef(null),$=Eo(D,b,Z?.beforeInsideRef),L=Eo(P,Z?.afterInsideRef),ae=Gn(),re=Gn(),ce=Kl(),de=Z!=null,fe=Zh(k),Se=nt((Ee=fe)=>Ee?yd(Ee):[]),He=nt(()=>E?.().filter(Ee=>Ee!=null)??[]);y.useEffect(()=>{if(r||!u)return;function Ee(Be){Be.key==="Tab"&&rt(fe,_r(At(fe)))&&Se().length===0&&!O&&Us(Be)}const Oe=At(fe);return Tt(Oe,"keydown",Ee)},[r,fe,u,O,Se]),y.useEffect(()=>{if(r||!C)return;const Ee=At(fe);function Oe(){z.current=!1}function Be($e){const De=pr($e),ke=He(),ve=rt(k,De)||rt(S,De)||rt(Z?.portalNode,De)||ke.some(Ie=>Ie===De||rt(Ie,De));z.current=!ve,le.current=$e.pointerType||"keyboard",De?.closest(`[${AA}]`)&&(q.current=!0,re.start(0,()=>{q.current=!1}))}function Ke(){le.current="keyboard"}return Vs(Tt(Ee,"pointerdown",Be,!0),Tt(Ee,"pointerup",Oe,!0),Tt(Ee,"pointercancel",Oe,!0),Tt(Ee,"keydown",Ke,!0),Oe)},[r,k,S,fe,C,Z,re,He]),y.useEffect(()=>{if(r||!d)return;const Ee=At(fe);function Oe(){q.current=!0,re.start(0,()=>{q.current=!1})}function Be(ke){const ve=pr(ke);Wx(ve)&&(V.current=ve)}function Ke(ke){const ve=ke.relatedTarget,Ie=ke.currentTarget,je=pr(ke);u&&ve==null&&je!=null&&rt(k,je)&&jC(je),queueMicrotask(()=>{const ee=M(),me=N.context.triggerElements,oe=He(),ie=ve?.hasAttribute(od("focus-guard"))&&[D.current,P.current,Z?.beforeInsideRef.current,Z?.afterInsideRef.current,Z?.beforeOutsideRef.current,Z?.afterOutsideRef.current,bi(m),bi(p)].includes(ve),G=!(rt(S,ve)||rt(k,ve)||rt(ve,k)||rt(Z?.portalNode,ve)||oe.some(F=>F===ve||rt(F,ve))||ve!=null&&me.hasElement(ve)||me.hasMatchingElement(F=>rt(F,ve))||ie||X&&(Ta(X.nodesRef.current,ee).find(F=>rt(F.context?.elements.floating,ve)||rt(F.context?.elements.domReference,ve))||kC(X.nodesRef.current,ee).find(F=>[F.context?.elements.floating,Zh(F.context?.elements.floating)].includes(ve)||F.context?.elements.domReference===ve)));if(Ie===S&&fe&&BC(fe),l&&Ie!==S&&!Ym(je)&&_r(Ee)===Ee.body){if(dn(fe)&&(fe.focus(),l==="popup")){ce.request(()=>{fe.focus()});return}const F=Se(),J=V.current,Te=(J&&F.includes(J)?J:null)||F[F.length-1]||fe;dn(Te)&&Te.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(O||!u)&&ve&&G&&!q.current&&(O||ve!==PC())&&(te.current=!0,N.setOpen(!1,mt(So,ke)))})}function $e(){z.current||(R.current.insideReactTree=!0,ae.start(0,()=>{R.current.insideReactTree=!1}))}const De=dn(S)?S:null;if(!(!k&&!De))return Vs(De&&Tt(De,"focusout",Ke),De&&Tt(De,"pointerdown",Oe),k&&Tt(k,"focusin",Be),k&&Tt(k,"focusout",Ke),k&&Z&&Tt(k,"focusout",$e,!0))},[r,S,k,fe,u,X,Z,N,d,l,Se,O,M,R,ae,re,ce,p,m,He]),y.useEffect(()=>{if(r||!k||!C)return;const Ee=Array.from(Z?.portalNode?.querySelectorAll(`[${od("portal")}]`)||[]),Be=(X?kC(X.nodesRef.current,M()):[]).find(Ie=>vb(Ie.context?.elements.domReference||null))?.context?.elements.domReference,$e=[...[k,...Ee,D.current,P.current,Z?.beforeOutsideRef.current,Z?.afterOutsideRef.current,...He()],Be,bi(m),bi(p),O?S:null].filter(Ie=>Ie!=null),De=IC($e,{ariaHidden:u||O,mark:!1}),ke=[k,...Ee].filter(Ie=>Ie!=null),ve=IC(ke);return()=>{ve(),De()}},[C,r,S,k,u,Z,O,X,M,p,m,He]),Ye(()=>{if(!C||r||!dn(fe))return;const Ee=At(fe),Oe=_r(Ee);queueMicrotask(()=>{const Be=j.current,Ke=typeof Be=="function"?Be(B.current||""):Be;if(Ke===void 0||Ke===!1||rt(fe,Oe))return;let De=null;const ke=()=>(De==null&&(De=Se(fe)),De[0]||fe);let ve;Ke===!0||Ke===null?ve=ke():ve=bi(Ke),ve=ve||ke();const Ie=rt(fe,_r(Ee));jh(ve,{preventScroll:ve===fe,shouldFocus(){if(!K.current)return!1;if(Ie)return!0;const je=_r(Ee);return!(je!==ve&&rt(fe,je))}})})},[r,C,fe,Se,j,B,K]),Ye(()=>{if(r||!fe)return;const Ee=At(fe),Oe=_r(Ee),Be=B.current==null;jC(Oe);function Ke(De){if(De.open||(W.current=g9(De.nativeEvent,le.current)),De.reason===qn&&De.nativeEvent.type==="mouseleave"&&(te.current=!0),De.reason===Vm)if(De.nested)te.current=!1;else if(Vx(De.nativeEvent)||rA(De.nativeEvent))te.current=!1;else{let ke=!1;At(fe).createElement("div").focus({get preventScroll(){return ke=!0,!1}}),ke?te.current=!1:te.current=!0}}A.on("openchange",Ke);function $e(){const De=H.current;let ke=typeof De=="function"?De(W.current):De;if(ke===void 0||ke===!1)return null;ke===null&&(ke=!0);const ve=S?.isConnected?S:null,Ie=Oe?.isConnected&&tr(Oe)!=="body"?Oe:null;let je=Be?Ie||ve:ve||Ie;return je||(je=PC()||null),typeof ke=="boolean"?je:bi(ke)||je||null}return()=>{A.off("openchange",Ke);const De=_r(Ee),ke=He(),ve=rt(k,De)||ke.some(ee=>ee===De||rt(ee,De))||X&&Ta(X.nodesRef.current,M(),!1).some(ee=>rt(ee.context?.elements.floating,De)),Ie=H.current,je=$e();queueMicrotask(()=>{const ee=b9(je),me=typeof Ie!="boolean";Ie&&!te.current&&dn(ee)&&(!(!me&&ee!==De&&De!==Ee.body)||ve)&&ee.focus({preventScroll:!0}),te.current=!1})}},[r,k,fe,H,B,A,X,S,M,He]),Ye(()=>{if(!Na||C||!k)return;const Ee=_r(At(k));!dn(Ee)||!$m(Ee)||rt(k,Ee)&&Ee.blur()},[C,k]),Ye(()=>{if(!(r||!Z))return Z.setFocusManagerState({modal:u,closeOnFocusOut:d,open:C,onOpenChange:N.setOpen,domReference:S}),()=>{Z.setFocusManagerState(null)}},[r,Z,u,C,N,d,S]),Ye(()=>{if(!(r||!fe))return BC(fe),()=>{queueMicrotask(ny)}},[r,fe]);const Me=!r&&(u?!O:!0)&&(de||u);return f.jsxs(y.Fragment,{children:[Me&&f.jsx(Wl,{"data-type":"inside",ref:$,onFocus:Ee=>{if(u){const Oe=Se();jh(Oe[Oe.length-1])}else Z?.portalNode&&(te.current=!1,Hl(Ee,Z.portalNode)?Qx(S)?.focus():bi(m??Z.beforeOutsideRef)?.focus())}}),n,Me&&f.jsx(Wl,{"data-type":"inside",ref:L,onFocus:Ee=>{u?jh(Se()[0]):Z?.portalNode&&(d&&(te.current=!0),Hl(Ee,Z.portalNode)?vA(S)?.focus():bi(p??Z.afterOutsideRef)?.focus())}})]})}function sy(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:u=0,reason:d=ou}=t,h="rootStore"in e?e.rootStore:e,p=h.context.dataRef,m=y.useRef(void 0),b=Kl(),x=Gn(),E=y.useMemo(()=>{function N(S,k,A,R){const M=mt(d,k,A);S&&R==="touch"&&u>0?x.start(u,()=>{h.setOpen(!0,M)}):h.setOpen(S,M)}function C(S,k,A){const R=p.current.openEvent,M=h.select("domReferenceElement")!==k;return S&&M||!S||!s?!0:R&&l?!A(R.type):!1}return{onPointerDown(S){m.current=S.pointerType},onMouseDown(S){const k=m.current,A=S.nativeEvent,R=h.select("open");if(S.button!==0||r==="click"||To(k,!0)&&a)return;const M=C(R,S.currentTarget,j=>j==="click"||j==="mousedown"),_=pr(A);if($m(_)){N(M,A,_,k);return}const O=S.currentTarget;b.request(()=>{N(M,A,O,k)})},onClick(S){if(r==="mousedown-only")return;const k=m.current;if(r==="mousedown"&&k){m.current=void 0;return}if(To(k,!0)&&a)return;const A=h.select("open"),R=C(A,S.currentTarget,M=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");N(R,S.nativeEvent,S.currentTarget,k)},onKeyDown(){m.current=void 0}}},[p,r,a,d,h,l,s,b,x,u]);return y.useMemo(()=>n?{reference:E}:fn,[n,E])}function x9(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){const a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",u=t.axis==="y"||t.axis==="both",d=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let h=a.width,p=a.height,m=a.x,b=a.y;return n==null&&t.x&&l&&(n=a.x-t.x),r==null&&t.y&&u&&(r=a.y-t.y),m-=n||0,b-=r||0,h=0,p=0,!s||d?(h=t.axis==="y"?a.width:0,p=t.axis==="x"?a.height:0,m=l&&t.x!=null?t.x:m,b=u&&t.y!=null?t.y:b):s&&!d&&(p=t.axis==="x"?a.height:p,h=t.axis==="y"?a.width:h),s=!0,{width:h,height:p,x:m,y:b,top:b,right:m+h,bottom:b+p,left:m}}}}function zC(e){return e!=null&&e.clientX!=null}function y9(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,a=s.useState("open"),l=s.useState("floatingElement"),u=s.useState("domReferenceElement"),d=s.context.dataRef,h=y.useRef(!1),p=y.useRef(null),[m,b]=y.useState(),[x,E]=y.useState([]),N=nt(R=>{s.set("positionReference",R)}),C=nt((R,M,_)=>{h.current||d.current.openEvent&&!zC(d.current.openEvent)||s.set("positionReference",x9(_??u,{x:R,y:M,axis:r,dataRef:d,pointerType:m}))}),S=nt(R=>{a?p.current||(C(R.clientX,R.clientY,R.currentTarget),E([])):C(R.clientX,R.clientY,R.currentTarget)}),k=To(m)?l:a;y.useEffect(()=>{if(!n){N(u);return}if(!k)return;function R(){p.current?.(),p.current=null}const M=on(l);function _(O){const j=pr(O);rt(l,j)?R():C(O.clientX,O.clientY)}return!d.current.openEvent||zC(d.current.openEvent)?p.current=Tt(M,"mousemove",_):N(u),R},[k,n,l,d,u,s,C,N,x]),y.useEffect(()=>()=>{s.set("positionReference",null)},[s]),y.useEffect(()=>{n&&!l&&(h.current=!1)},[n,l]),y.useEffect(()=>{!n&&a&&(h.current=!0)},[n,a]);const A=y.useMemo(()=>{function R(M){b(M.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:S,onMouseEnter:S}},[S]);return y.useMemo(()=>n?{reference:A,trigger:A}:{},[n,A])}function v9(){return!1}function E9(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Gm(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:a="sloppy",referencePress:l=v9,bubbles:u,externalTree:d}=t,h="rootStore"in e?e.rootStore:e,p=h.useState("open"),m=h.useState("floatingElement"),{dataRef:b}=h.context,x=Ra(d),E=nt(typeof s=="function"?s:()=>!1),N=typeof s=="function"?E:s,C=N!==!1,S=nt(()=>a),{escapeKey:k,outsidePress:A}=E9(u),R=y.useRef(!1),M=y.useRef(!1),_=y.useRef(!1),O=y.useRef(!1),j=y.useRef(""),H=y.useRef(null),B=Gn(),K=Gn(),X=nt(()=>{K.clear(),b.current.insideReactTree=!1}),Z=nt($=>{const L=b.current.floatingContext?.nodeId;return(x?Ta(x.nodesRef.current,L):[]).some(re=>re.context?.open&&!re.context.dataRef.current[$])}),te=nt($=>r1($,h.select("floatingElement"))||r1($,h.select("domReferenceElement"))),q=nt($=>{l()&&h.setOpen(!1,mt(ou,$.nativeEvent))}),z=nt($=>{if(!p||!n||!r||$.key!=="Escape"||O.current||!k&&Z("__escapeKeyBubbles"))return;const L=bj($)?$.nativeEvent:$,ae=mt(qm,L);h.setOpen(!1,ae),ae.isCanceled||$.preventDefault(),!k&&!ae.isPropagationAllowed&&$.stopPropagation()}),V=nt(()=>{b.current.insideReactTree=!0,K.start(0,X)}),W=nt($=>{if(!p||!n||$.button!==0)return;const L=pr($.nativeEvent);rt(h.select("floatingElement"),L)&&(R.current||(R.current=!0,M.current=!1))}),le=nt($=>{!p||!n||($.defaultPrevented||$.nativeEvent.defaultPrevented)&&R.current&&(M.current=!0)});y.useEffect(()=>{if(!p||!n)return;b.current.__escapeKeyBubbles=k,b.current.__outsidePressBubbles=A;const $=new Ts,L=new Ts;function ae(){$.clear(),O.current=!0}function re(){$.start(Na?5:0,()=>{O.current=!1})}function ce(){_.current=!0,L.start(0,()=>{_.current=!1})}function de(){R.current=!1,M.current=!1}function fe(){const oe=j.current,ie=oe==="pen"||!oe?"mouse":oe,G=S(),F=typeof G=="function"?G():G;return typeof F=="string"?F:F[ie]}function Se(oe){const ie=fe();return ie==="intentional"&&oe.type!=="click"||ie==="sloppy"&&oe.type==="click"}function He(oe){const ie=b.current.floatingContext?.nodeId,G=x&&Ta(x.nodesRef.current,ie).some(F=>r1(oe,F.context?.elements.floating));return te(oe)||G}function Me(oe){if(Se(oe)){oe.type!=="click"&&!te(oe)&&(L.clear(),_.current=!1),X();return}if(b.current.insideReactTree){X();return}const ie=pr(oe),G=`[${od("inert")}]`,F=St(ie)?ie.getRootNode():null,J=Array.from((Gl(F)?F:At(h.select("floatingElement"))).querySelectorAll(G)),Te=h.context.triggerElements;if(ie&&(Te.hasElement(ie)||Te.hasMatchingElement(Ve=>rt(Ve,ie))))return;let _e=St(ie)?ie:null;for(;_e&&!Ai(_e);){const Ve=Ii(_e);if(Ai(Ve)||!St(Ve))break;_e=Ve}if(!(J.length&&St(ie)&&!yj(ie)&&!rt(ie,h.select("floatingElement"))&&J.every(Ve=>!rt(_e,Ve)))){if(dn(ie)&&!("touches"in oe)){const Ve=Ai(ie),ot=qr(ie),tt=/auto|scroll/,dt=Ve||tt.test(ot.overflowX),ut=Ve||tt.test(ot.overflowY),qe=dt&&ie.clientWidth>0&&ie.scrollWidth>ie.clientWidth,Rt=ut&&ie.clientHeight>0&&ie.scrollHeight>ie.clientHeight,jt=ot.direction==="rtl",lt=Rt&&(jt?oe.offsetX<=ie.offsetWidth-ie.clientWidth:oe.offsetX>ie.clientWidth),Lt=qe&&oe.offsetY>ie.clientHeight;if(lt||Lt)return}if(!He(oe)){if(fe()==="intentional"&&_.current){L.clear(),_.current=!1;return}typeof N=="function"&&!N(oe)||Z("__outsidePressBubbles")||(h.setOpen(!1,mt(Vm,oe)),X())}}}function Ee(oe){fe()!=="sloppy"||oe.pointerType==="touch"||!h.select("open")||!n||te(oe)||Me(oe)}function Oe(oe){if(fe()!=="sloppy"||!h.select("open")||!n||te(oe))return;const ie=oe.touches[0];ie&&(H.current={startTime:Date.now(),startX:ie.clientX,startY:ie.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1e3,()=>{H.current&&(H.current.dismissOnTouchEnd=!1,H.current.dismissOnMouseDown=!1)}))}function Be(oe,ie){const G=pr(oe);if(!G)return;const F=Tt(G,oe.type,()=>{ie(oe),F()})}function Ke(oe){j.current="touch",Be(oe,Oe)}function $e(oe){B.clear(),oe.type==="pointerdown"&&(j.current=oe.pointerType),!(oe.type==="mousedown"&&H.current&&!H.current.dismissOnMouseDown)&&Be(oe,ie=>{ie.type==="pointerdown"?Ee(ie):Me(ie)})}function De(oe){if(!R.current)return;const ie=M.current;if(de(),fe()==="intentional"){if(oe.type==="pointercancel"){ie&&ce();return}if(!He(oe)){if(ie){ce();return}typeof N=="function"&&!N(oe)||(L.clear(),_.current=!0,X())}}}function ke(oe){if(fe()!=="sloppy"||!H.current||te(oe))return;const ie=oe.touches[0];if(!ie)return;const G=Math.abs(ie.clientX-H.current.startX),F=Math.abs(ie.clientY-H.current.startY),J=Math.sqrt(G*G+F*F);J>5&&(H.current.dismissOnTouchEnd=!0),J>10&&(Me(oe),B.clear(),H.current=null)}function ve(oe){Be(oe,ke)}function Ie(oe){fe()!=="sloppy"||!H.current||te(oe)||(H.current.dismissOnTouchEnd&&Me(oe),B.clear(),H.current=null)}function je(oe){Be(oe,Ie)}const ee=At(m),me=Vs(r&&Vs(Tt(ee,"keydown",z),Tt(ee,"compositionstart",ae),Tt(ee,"compositionend",re)),C&&Vs(Tt(ee,"click",$e,!0),Tt(ee,"pointerdown",$e,!0),Tt(ee,"pointerup",De,!0),Tt(ee,"pointercancel",De,!0),Tt(ee,"mousedown",$e,!0),Tt(ee,"mouseup",De,!0),Tt(ee,"touchstart",Ke,!0),Tt(ee,"touchmove",ve,!0),Tt(ee,"touchend",je,!0)));return()=>{me(),$.clear(),L.clear(),de(),_.current=!1}},[b,m,r,C,N,p,n,k,A,z,X,S,Z,te,x,h,B]),y.useEffect(X,[N,X]);const D=y.useMemo(()=>({onKeyDown:z,onPointerDown:q,onClick:q}),[z,q]),P=y.useMemo(()=>({onKeyDown:z,onPointerDown:le,onMouseDown:le,onClickCapture:V,onMouseDownCapture($){V(),W($)},onPointerDownCapture($){V(),W($)},onMouseUpCapture:V,onTouchEndCapture:V,onTouchMoveCapture:V}),[z,V,W,le]);return y.useMemo(()=>n?{reference:D,floating:P,trigger:D}:{},[n,D,P])}function UC(e,t,n){let{reference:r,floating:s}=e;const a=ls(t),l=Xx(t),u=Kx(l),d=$r(t),h=a==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,b=r[u]/2-s[u]/2;let x;switch(d){case"top":x={x:p,y:r.y-s.height};break;case"bottom":x={x:p,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-s.width,y:m};break;default:x={x:r.x,y:r.y}}const E=Aa(t);return E&&(x[l]+=b*(E==="end"?1:-1)*(n&&h?-1:1)),x}async function T9(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:b=!1,padding:x=0}=Oi(t,e),E=cA(x),C=u[b?m==="floating"?"reference":"floating":m],S=ad(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:d})),k=m==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),R=await(a.isElement==null?void 0:a.isElement(A))&&await(a.getScale==null?void 0:a.getScale(A))||{x:1,y:1},M=ad(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:k,offsetParent:A,strategy:d}):k);return{top:(S.top-M.top+E.top)/R.y,bottom:(M.bottom-S.bottom+E.bottom)/R.y,left:(S.left-M.left+E.left)/R.x,right:(M.right-S.right+E.right)/R.x}}const S9=50,C9=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:T9},d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=UC(h,r,d),b=r,x=0;const E={};for(let N=0;N<a.length;N++){const C=a[N];if(!C)continue;const{name:S,fn:k}=C,{x:A,y:R,data:M,reset:_}=await k({x:p,y:m,initialPlacement:r,placement:b,strategy:s,middlewareData:E,rects:h,platform:u,elements:{reference:e,floating:t}});p=A??p,m=R??m,E[S]={...E[S],...M},_&&x<S9&&(x++,typeof _=="object"&&(_.placement&&(b=_.placement),_.rects&&(h=_.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):_.rects),{x:p,y:m}=UC(h,b,d)),N=-1)}return{x:p,y:m,placement:b,strategy:s,middlewareData:E}},w9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:l,initialPlacement:u,platform:d,elements:h}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:N=!0,...C}=Oi(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const S=$r(s),k=ls(u),A=$r(u)===u,R=await(d.isRTL==null?void 0:d.isRTL(h.floating)),M=b||(A||!N?[em(u)]:Mj(u)),_=E!=="none";!b&&_&&M.push(...Pj(u,N,E,R));const O=[u,...M],j=await d.detectOverflow(t,C),H=[];let B=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&H.push(j[S]),m){const te=Oj(s,l,R);H.push(j[te[0]],j[te[1]])}if(B=[...B,{placement:s,overflows:H}],!H.every(te=>te<=0)){var K,X;const te=(((K=a.flip)==null?void 0:K.index)||0)+1,q=O[te];if(q&&(!(m==="alignment"?k!==ls(q):!1)||B.every(W=>ls(W.placement)===k?W.overflows[0]>0:!0)))return{data:{index:te,overflows:B},reset:{placement:q}};let z=(X=B.filter(V=>V.overflows[0]<=0).sort((V,W)=>V.overflows[1]-W.overflows[1])[0])==null?void 0:X.placement;if(!z)switch(x){case"bestFit":{var Z;const V=(Z=B.filter(W=>{if(_){const le=ls(W.placement);return le===k||le==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(le=>le>0).reduce((le,D)=>le+D,0)]).sort((W,le)=>W[1]-le[1])[0])==null?void 0:Z[0];V&&(z=V);break}case"initialPlacement":z=u;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function HC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function FC(e){return Rj.some(t=>e[t]>=0)}const k9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=Oi(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),u=HC(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:FC(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),u=HC(l,n.floating);return{data:{escapedOffsets:u,escaped:FC(u)}}}default:return{}}}}},BA=new Set(["left","top"]);async function N9(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=$r(n),u=Aa(n),d=ls(n)==="y",h=BA.has(l)?-1:1,p=a&&d?-1:1,m=Oi(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:E}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof E=="number"&&(x=u==="end"?E*-1:E),d?{x:x*p,y:b*h}:{x:b*h,y:x*p}}const A9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:l,middlewareData:u}=t,d=await N9(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:l}}}}},_9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:k=>{let{x:A,y:R}=k;return{x:A,y:R}}},...h}=Oi(e,t),p={x:n,y:r},m=await a.detectOverflow(t,h),b=ls(s),x=Gx(b);let E=p[x],N=p[b];const C=(k,A)=>uA(A+m[k==="y"?"top":"left"],A,A-m[k==="y"?"bottom":"right"]);l&&(E=C(x,E)),u&&(N=C(b,N));const S=d.fn({...t,[x]:E,[b]:N});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[x]:l,[b]:u}}}}}},R9=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:a,placement:l,rects:u,middlewareData:d}=t,{offset:h=0,mainAxis:p=!0,crossAxis:m=!0}=Oi(e,t),b={x:s,y:a},x=ls(l),E=Gx(x);let N=b[E],C=b[x];const S=Oi(h,t),k=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(p){const M=E==="y"?"height":"width",_=u.reference[E]-u.floating[M]+k.mainAxis,O=u.reference[E]+u.reference[M]-k.mainAxis;N<_?N=_:N>O&&(N=O)}if(m){var A,R;const M=E==="y"?"width":"height",_=BA.has($r(l)),O=u.reference[x]-u.floating[M]+(_&&((A=d.offset)==null?void 0:A[x])||0)+(_?0:k.crossAxis),j=u.reference[x]+u.reference[M]+(_?0:((R=d.offset)==null?void 0:R[x])||0)-(_?k.crossAxis:0);C<O?C=O:C>j&&(C=j)}return{[E]:N,[x]:C}}}},I9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:a}=t,{apply:l=()=>{},...u}=Oi(e,t),d=await s.detectOverflow(t,u),h=$r(n),p=Aa(n),m=ls(n)==="y",{width:b,height:x}=r.floating;let E,N;h==="top"||h==="bottom"?(E=h,N=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(N=h,E=p==="end"?"top":"bottom");const C=x-d.top-d.bottom,S=b-d.left-d.right,k=Ql(x-d[E],C),A=Ql(b-d[N],S),R=t.middlewareData.shift,M=!R;let _=k,O=A;R!=null&&R.enabled.x&&(O=S),R!=null&&R.enabled.y&&(_=C),M&&!p&&(m?O=b-2*_i(d.left,d.right):_=x-2*_i(d.top,d.bottom)),await l({...t,availableWidth:O,availableHeight:_});const j=await s.getDimensions(a.floating);return b!==j.width||x!==j.height?{reset:{rects:!0}}:{}}}};function zA(e){const t=qr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=dn(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=Jh(n)!==a||Jh(r)!==l;return u&&(n=a,r=l),{width:n,height:r,$:u}}function iy(e){return St(e)?e:e.contextElement}function Fl(e){const t=iy(e);if(!dn(t))return Ri(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=zA(t);let l=(a?Jh(n.width):n.width)/r,u=(a?Jh(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const O9=Ri(0);function UA(e){const t=on(e);return!Ux()||!t.visualViewport?O9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M9(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===on(e)}function wo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=iy(e);let l=Ri(1);t&&(r?St(r)&&(l=Fl(r)):l=Fl(e));const u=M9(a,n,r)?UA(a):Ri(0);let d=(s.left+u.x)/l.x,h=(s.top+u.y)/l.y,p=s.width/l.x,m=s.height/l.y;if(a&&r){const b=on(a),x=St(r)?on(r):r;let E=b,N=bb(E);for(;N&&x!==E;){const C=Fl(N),S=N.getBoundingClientRect(),k=qr(N),A=S.left+(N.clientLeft+parseFloat(k.paddingLeft))*C.x,R=S.top+(N.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,h*=C.y,p*=C.x,m*=C.y,d+=A,h+=R,E=on(N),N=bb(E)}}return ad({width:p,height:m,x:d,y:h})}function Km(e,t){const n=Bm(e).scrollLeft;return t?t.left+n:wo(Li(e)).left+n}function HA(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Km(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function L9(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=Li(r),u=t?Pm(t.floating):!1;if(r===l||u&&a)return n;let d={scrollLeft:0,scrollTop:0},h=Ri(1);const p=Ri(0),m=dn(r);if((m||!a)&&((tr(r)!=="body"||Mo(l))&&(d=Bm(r)),m)){const x=wo(r);h=Fl(r),p.x=x.x+r.clientLeft,p.y=x.y+r.clientTop}const b=l&&!m&&!a?HA(l,d):Ri(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+p.x+b.x,y:n.y*h.y-d.scrollTop*h.y+p.y+b.y}}function D9(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function j9(e){const t=Bm(e),n=e.ownerDocument.body,r=_i(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=_i(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-t.scrollLeft+Km(e);const l=-t.scrollTop;return qr(n).direction==="rtl"&&(a+=_i(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:a,y:l}}const P9=25;function B9(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=on(e),a=Li(e),l=s.visualViewport;let u=a.clientWidth,d=a.clientHeight,h=0,p=0;if(l){const b=!Ux()||t==="fixed";r?b||(h=-l.offsetLeft,p=-l.offsetTop):(u=l.width,d=l.height,b&&(h=l.offsetLeft,p=l.offsetTop))}if(Km(a)<=0){const b=a.ownerDocument,x=b.body,E=getComputedStyle(x),N=b.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(a.clientWidth-x.clientWidth-N),S=getComputedStyle(a).scrollbarGutter==="stable both-edges"?C/2:C;S<=P9&&(u-=S)}return{width:u,height:d,x:h,y:p}}function z9(e,t){const n=wo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Fl(e),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=s*a.x,h=r*a.y;return{width:l,height:u,x:d,y:h}}function $C(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=B9(e,n,t);else if(t==="document")r=j9(Li(e));else if(St(t))r=z9(t,n);else{const s=UA(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ad(r)}function U9(e,t){const n=t.get(e);if(n)return n;let r=sd(e,[],!1).filter(u=>St(u)&&tr(u)!=="body"),s=null;const a=qr(e).position==="fixed";let l=a?Ii(e):e;for(;St(l)&&!Ai(l);){const u=qr(l),d=zx(l),h=s?s.position:a?"fixed":"";!d&&(h==="fixed"||h==="absolute"&&u.position==="static")?r=r.filter(m=>m!==l):s=u,l=Ii(l)}return t.set(e,r),r}function H9(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Pm(t)?[]:U9(t,this._c):[].concat(n),r],u=$C(t,l[0],s);let d=u.top,h=u.right,p=u.bottom,m=u.left;for(let b=1;b<l.length;b++){const x=$C(t,l[b],s);d=_i(x.top,d),h=Ql(x.right,h),p=Ql(x.bottom,p),m=_i(x.left,m)}return{width:h-m,height:p-d,x:m,y:d}}function F9(e){const{width:t,height:n}=zA(e);return{width:t,height:n}}function $9(e,t,n){const r=dn(t),s=Li(t),a=n==="fixed",l=wo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=Ri(0);if((r||!a)&&((tr(t)!=="body"||Mo(s))&&(u=Bm(t)),r)){const b=wo(t,!0,a,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}!r&&s&&(d.x=Km(s));const h=s&&!r&&!a?HA(s,u):Ri(0),p=l.left+u.scrollLeft-d.x-h.x,m=l.top+u.scrollTop-d.y-h.y;return{x:p,y:m,width:l.width,height:l.height}}function l1(e){return qr(e).position==="static"}function VC(e,t){if(!dn(e)||qr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Li(e)===n&&(n=n.ownerDocument.body),n}function FA(e,t){const n=on(e);if(Pm(e))return n;if(!dn(e)){let s=Ii(e);for(;s&&!Ai(s);){if(St(s)&&!l1(s))return s;s=Ii(s)}return n}let r=VC(e,t);for(;r&&ij(r)&&l1(r);)r=VC(r,t);return r&&Ai(r)&&l1(r)&&!zx(r)?n:r||lj(e)||n}const V9=async function(e){const t=this.getOffsetParent||FA,n=this.getDimensions,r=await n(e.floating);return{reference:$9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function q9(e){return qr(e).direction==="rtl"}const $A={convertOffsetParentRelativeRectToViewportRelativeRect:L9,getDocumentElement:Li,getClippingRect:H9,getOffsetParent:FA,getElementRects:V9,getClientRects:D9,getDimensions:F9,getScale:Fl,isElement:St,isRTL:q9};function VA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Y9(e,t,n){let r=null,s;const a=Li(e);function l(){var p;clearTimeout(s),(p=r)==null||p.disconnect(),r=null}function u(p,m){p===void 0&&(p=!1),m===void 0&&(m=1),l();const b=e.getBoundingClientRect(),{left:x,top:E,width:N,height:C}=b;if(p||t(),!N||!C)return;const S=ih(E),k=ih(a.clientWidth-(x+N)),A=ih(a.clientHeight-(E+C)),R=ih(x),_={rootMargin:-S+"px "+-k+"px "+-A+"px "+-R+"px",threshold:_i(0,Ql(1,m))||1};let O=!0;function j(H){const B=H[0].intersectionRatio;if(!VA(b,e.getBoundingClientRect()))return u();if(B!==m){if(!O)return u();B?u(!1,B):s=setTimeout(()=>{u(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(j,{..._,root:a.ownerDocument})}catch{r=new IntersectionObserver(j,_)}r.observe(e)}const d=on(e),h=()=>u(n);return d.addEventListener("resize",h),u(!0),()=>{d.removeEventListener("resize",h),l()}}function qC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=iy(e),p=s||a?[...h?sd(h):[],...t?sd(t):[]]:[];p.forEach(S=>{s&&S.addEventListener("scroll",n),a&&S.addEventListener("resize",n)});const m=h&&u?Y9(h,n,a):null;let b=-1,x=null;l&&(x=new ResizeObserver(S=>{let[k]=S;k&&k.target===h&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(t)})),n()}),h&&!d&&x.observe(h),t&&x.observe(t));let E,N=d?wo(e):null;d&&C();function C(){const S=wo(e);N&&!VA(N,S)&&n(),N=S,E=requestAnimationFrame(C)}return n(),()=>{var S;p.forEach(k=>{s&&k.removeEventListener("scroll",n),a&&k.removeEventListener("resize",n)}),m?.(),(S=x)==null||S.disconnect(),x=null,d&&cancelAnimationFrame(E)}}const G9=A9,K9=_9,X9=w9,W9=I9,Q9=k9,Z9=R9,J9=(e,t,n)=>{const r=new Map,s=n??{},a={...$A,...s.platform,_c:r};return C9(e,t,{...s,platform:a})};var eP=typeof document<"u",tP=function(){},Ph=eP?y.useLayoutEffect:tP;function rm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!rm(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!rm(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function qA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function YC(e,t){const n=qA(e);return Math.round(t*n)/n}function u1(e){const t=y.useRef(e);return Ph(()=>{t.current=e}),t}function nP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:h}=e,[p,m]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=y.useState(r);rm(b,r)||x(r);const[E,N]=y.useState(null),[C,S]=y.useState(null),k=y.useCallback(W=>{W!==_.current&&(_.current=W,N(W))},[]),A=y.useCallback(W=>{W!==O.current&&(O.current=W,S(W))},[]),R=a||E,M=l||C,_=y.useRef(null),O=y.useRef(null),j=y.useRef(p),H=d!=null,B=u1(d),K=u1(s),X=u1(h),Z=y.useCallback(()=>{if(!_.current||!O.current)return;const W={placement:t,strategy:n,middleware:b};K.current&&(W.platform=K.current),J9(_.current,O.current,W).then(le=>{const D={...le,isPositioned:X.current!==!1};te.current&&!rm(j.current,D)&&(j.current=D,or.flushSync(()=>{m(D)}))})},[b,t,n,K,X]);Ph(()=>{h===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(W=>({...W,isPositioned:!1})))},[h]);const te=y.useRef(!1);Ph(()=>(te.current=!0,()=>{te.current=!1}),[]),Ph(()=>{if(R&&(_.current=R),M&&(O.current=M),R&&M){if(B.current)return B.current(R,M,Z);Z()}},[R,M,Z,B,H]);const q=y.useMemo(()=>({reference:_,floating:O,setReference:k,setFloating:A}),[k,A]),z=y.useMemo(()=>({reference:R,floating:M}),[R,M]),V=y.useMemo(()=>{const W={position:n,left:0,top:0};if(!z.floating)return W;const le=YC(z.floating,p.x),D=YC(z.floating,p.y);return u?{...W,transform:"translate("+le+"px, "+D+"px)",...qA(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:le,top:D}},[n,u,z.floating,p.x,p.y]);return y.useMemo(()=>({...p,update:Z,refs:q,elements:z,floatingStyles:V}),[p,Z,q,z,V])}const rP=(e,t)=>{const n=G9(e);return{name:n.name,fn:n.fn,options:[e,t]}},sP=(e,t)=>{const n=K9(e);return{name:n.name,fn:n.fn,options:[e,t]}},iP=(e,t)=>({fn:Z9(e).fn,options:[e,t]}),aP=(e,t)=>{const n=X9(e);return{name:n.name,fn:n.fn,options:[e,t]}},oP=(e,t)=>{const n=W9(e);return{name:n.name,fn:n.fn,options:[e,t]}},lP=(e,t)=>{const n=Q9(e);return{name:n.name,fn:n.fn,options:[e,t]}},uP={open:ze(e=>e.open),transitionStatus:ze(e=>e.transitionStatus),domReferenceElement:ze(e=>e.domReferenceElement),referenceElement:ze(e=>e.positionReference??e.referenceElement),floatingElement:ze(e=>e.floatingElement),floatingId:ze(e=>e.floatingId)};class Xm extends Dm{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:LA(),nested:r,triggerElements:a},uP),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&xj(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function YA(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:a,onOpenChange:l}=e,u=t.useState("open"),d=t.useState("activeTriggerElement"),h=t.useState(n?"popupElement":"positionerElement"),p=t.context.triggerElements,m=l,b=y.useRef(null);r===void 0&&b.current===null&&(b.current=new Xm({open:u,transitionStatus:void 0,referenceElement:d,floatingElement:h,triggerElements:p,onOpenChange:m,floatingId:s,syncOnly:!0,nested:a}));const x=r??b.current;return t.useSyncedValue("floatingId",s),Ye(()=>{const E={open:u,floatingId:s,referenceElement:d,floatingElement:h};St(d)&&(E.domReferenceElement=d),x.state.positionReference===x.state.referenceElement&&(E.positionReference=d),x.update(E)},[u,s,d,h,x]),x.context.onOpenChange=m,x.context.nested=a,x}function ay(e,t=!1,n=!1){const[r,s]=y.useState(e&&t?"idle":void 0),[a,l]=y.useState(e);return e&&!a&&(l(!0),s("starting")),!e&&a&&r!=="ending"&&!n&&s("ending"),!e&&!a&&r==="ending"&&s(void 0),Ye(()=>{if(!e&&a&&r!=="ending"&&n){const u=Hs.request(()=>{s("ending")});return()=>{Hs.cancel(u)}}},[e,a,r,n]),Ye(()=>{if(!e||t)return;const u=Hs.request(()=>{s(void 0)});return()=>{Hs.cancel(u)}},[t,e]),Ye(()=>{if(!e||!t)return;e&&a&&r!=="idle"&&s("starting");const u=Hs.request(()=>{s("idle")});return()=>{Hs.cancel(u)}},[t,e,a,r]),{mounted:a,setMounted:l,transitionStatus:r}}let ld=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const cP={[ld.startingStyle]:""},dP={[ld.endingStyle]:""},lu={transitionStatus(e){return e==="starting"?cP:e==="ending"?dP:null}};function GA(e,t=!1,n=!0){const r=Kl();return nt((s,a=null)=>{r.cancel();const l=bi(e);if(l==null)return;const u=l,d=()=>{or.flushSync(s)};if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function h(){Promise.all(u.getAnimations().map(p=>p.finished)).then(()=>{a?.aborted||d()}).catch(()=>{if(n){a?.aborted||d();return}const p=u.getAnimations();!a?.aborted&&p.length>0&&p.some(m=>m.pending||m.playState!=="finished")&&h()})}if(t){const p=ld.startingStyle;if(!u.hasAttribute(p)){r.request(h);return}const m=new MutationObserver(()=>{u.hasAttribute(p)||(m.disconnect(),h())});m.observe(u,{attributes:!0,attributeFilter:[p]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(h)})}function Lo(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,a=nt(s),l=GA(r,n,!1);y.useEffect(()=>{if(!t)return;const u=new AbortController;return l(a,u.signal),()=>{u.abort()}},[t,n,a,l])}const Wm={tabIndex:-1,[yb]:""};function fP(e){return t=>t==="touch"?e.current:!0}function KA(e,t,n=!1){const r=Co(),s=_a()!=null,a=y.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,s));const l=e??a.current;return YA({popupStore:l,treatPopupAsFloatingElement:n,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:s,onOpenChange:l.setOpen}),{store:l,internalStore:a.current}}function hP(e,t){const n=y.useRef(null),r=y.useRef(null);return y.useCallback(s=>{if(e===void 0)return;let a=!1;if(n.current!==null){const l=n.current,u=r.current,d=t.context.triggerElements.getById(l);u&&d===u&&(t.context.triggerElements.delete(l),a=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),a=!0),a){const l=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==l&&t.set("triggerCount",l)}},[t,e])}function oy(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function XA(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function mP(e,t,n,r={}){const s=n.reason,a=s===qn,l=t&&s===Ul,u=!t&&(s===ou||s===qm),d=XA(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const h=()=>{const p={...r.extraState,open:t};l?p.instantType="focus":u?p.instantType="dismiss":a&&(p.instantType=void 0),oy(p,t,n.trigger,d()),e.update(p)};a?or.flushSync(h):h()}function WA(e,t,n,r){Lx(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function ly(e,t,n,r){const s=n.useState("isMountedByTrigger",e),a=hP(e,n),l=nt(u=>{if(a(u),!u)return;const d=n.select("open"),h=n.select("activeTriggerId");if(h===e){n.update({activeTriggerElement:u,...d?r:null});return}h==null&&d&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})});return Ye(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function uy(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),s=e.useState("triggerCount");Ye(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,l={};e.state.triggerCount!==a&&(l.triggerCount=a);const u=e.select("activeTriggerId");let d=null;if(u){const h=e.context.triggerElements.getById(u);h?h!==e.state.activeTriggerElement&&(l.activeTriggerElement=h):d=u}if(!d&&!u&&a===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[p,m]=h.value;l.activeTriggerId=p,l.activeTriggerElement=m}}(l.triggerCount!==void 0||l.activeTriggerId!==void 0||l.activeTriggerElement!==void 0)&&e.update(l),d&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){const h=mt(au);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,n])}function cy(e,t,n){const{mounted:r,setMounted:s,transitionStatus:a}=ay(e),l=t.useState("preventUnmountingOnClose"),u=e?!1:l;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:u});const d=nt(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Lo({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:a}}function dy(e,t){e.useSyncedValues(t),Ye(()=>()=>{e.update({activeTriggerProps:fn,inactiveTriggerProps:fn,popupProps:fn})},[e])}function pP(e,t){Ye(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Ye(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class vd{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function gP(){return new Xm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new vd,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function fy(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:gP(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:fn,inactiveTriggerProps:fn,popupProps:fn}}function QA(e,t,n=!1){return new Xm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const Bc=ze(e=>e.triggerIdProp??e.activeTriggerId),hy=ze(e=>e.openProp??e.open),GC=ze(e=>(e.popupElement?.id??e.floatingId)||void 0);function ZA(e,t){return t!==void 0&&hy(e)&&Bc(e)===t}function bP(e,t){return ZA(e,t)?!0:t!==void 0&&hy(e)&&Bc(e)==null&&e.triggerCount===1}const my={open:hy,mounted:ze(e=>e.mounted),transitionStatus:ze(e=>e.transitionStatus),floatingRootContext:ze(e=>e.floatingRootContext),triggerCount:ze(e=>e.triggerCount),preventUnmountingOnClose:ze(e=>e.preventUnmountingOnClose),payload:ze(e=>e.payload),activeTriggerId:Bc,activeTriggerElement:ze(e=>e.mounted?e.activeTriggerElement:null),popupId:GC,isTriggerActive:ze((e,t)=>t!==void 0&&Bc(e)===t),isOpenedByTrigger:ze((e,t)=>ZA(e,t)),isMountedByTrigger:ze((e,t)=>t!==void 0&&Bc(e)===t&&e.mounted),triggerProps:ze((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:ze((e,t)=>bP(e,t)?GC(e):void 0),popupProps:ze(e=>e.popupProps),popupElement:ze(e=>e.popupElement),positionerElement:ze(e=>e.positionerElement)};function JA(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,s=Co(),a=_a()!=null,l=br(()=>new Xm({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new vd,floatingId:s,syncOnly:!1,nested:a})).current;return Ye(()=>{const u={open:t,floatingId:s};r.reference!==void 0&&(u.referenceElement=r.reference,u.domReferenceElement=St(r.reference)?r.reference:null),r.floating!==void 0&&(u.floatingElement=r.floating),l.update(u)},[t,s,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l}function xP(e={}){const{nodeId:t,externalTree:n}=e,r=JA(e),s=e.rootContext||r,a=s.useState("referenceElement"),l=s.useState("floatingElement"),u=s.useState("domReferenceElement"),d=s.useState("open"),h=s.useState("floatingId"),[p,m]=y.useState(null),[b,x]=y.useState(void 0),[E,N]=y.useState(void 0),C=y.useRef(null),S=Ra(n),k=y.useMemo(()=>({reference:a,floating:l,domReference:u}),[a,l,u]),A=nP({...e,elements:{...k,...p&&{reference:p}}}),R=St(b)?b:null,M=E===void 0?s.state.floatingElement:E;s.useSyncedValue("referenceElement",b??null),s.useSyncedValue("domReferenceElement",b===void 0?u:R),s.useSyncedValue("floatingElement",M);const _=y.useCallback(X=>{const Z=St(X)?{getBoundingClientRect:()=>X.getBoundingClientRect(),getClientRects:()=>X.getClientRects(),contextElement:X}:X;m(Z),A.refs.setReference(Z)},[A.refs]),O=y.useCallback(X=>{(St(X)||X===null)&&(C.current=X,x(X)),(St(A.refs.reference.current)||A.refs.reference.current===null||X!==null&&!St(X))&&A.refs.setReference(X)},[A.refs,x]),j=y.useCallback(X=>{N(X),A.refs.setFloating(X)},[A.refs]),H=y.useMemo(()=>({...A.refs,setReference:O,setFloating:j,setPositionReference:_,domReference:C}),[A.refs,O,j,_]),B=y.useMemo(()=>({...A.elements,domReference:u}),[A.elements,u]),K=y.useMemo(()=>({...A,dataRef:s.context.dataRef,open:d,onOpenChange:s.setOpen,events:s.context.events,floatingId:h,refs:H,elements:B,nodeId:t,rootStore:s}),[A,H,B,t,s,d,h]);return Ye(()=>{u&&(C.current=u)},[u]),Ye(()=>{s.context.dataRef.current.floatingContext=K;const X=S?.nodesRef.current.find(Z=>Z.id===t);X&&(X.context=K)}),y.useMemo(()=>({...A,context:K,refs:H,elements:B,rootStore:s}),[A,H,B,K,s])}const c1=Fx&&Na;function e_(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:a,dataRef:l}=s.context,u=y.useRef(!1),d=y.useRef(null),h=y.useRef(!0),p=Gn();y.useEffect(()=>{const b=s.select("domReferenceElement");if(!n)return;const x=on(b);function E(){const S=s.select("domReferenceElement");!s.select("open")&&dn(S)&&S===_r(At(S))&&(u.current=!0)}function N(){h.current=!0}function C(){h.current=!1}return Vs(Tt(x,"blur",E),c1&&Tt(x,"keydown",N,!0),c1&&Tt(x,"pointerdown",C,!0))},[s,n]),y.useEffect(()=>{if(!n)return;function b(x){if(x.reason===ou||x.reason===qm){const E=s.select("domReferenceElement");St(E)&&(d.current=E,u.current=!0)}}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,n,s]);const m=y.useMemo(()=>{function b(){u.current=!1,d.current=null}return{onMouseLeave(){b()},onFocus(x){const E=x.currentTarget;if(u.current){if(d.current===E)return;b()}const N=pr(x.nativeEvent);if(St(N)){if(c1&&!x.relatedTarget){if(!h.current&&!$m(N))return}else if(!Ej(N))return}const C=Qh(x.relatedTarget,s.context.triggerElements),{nativeEvent:S,currentTarget:k}=x,A=typeof r=="function"?r():r;if(s.select("open")&&C||A===0||A===void 0){s.setOpen(!0,mt(Ul,S,k));return}p.start(A,()=>{u.current||s.setOpen(!0,mt(Ul,S,k))})},onBlur(x){b();const E=x.relatedTarget,N=x.nativeEvent,C=St(E)&&E.hasAttribute(od("focus-guard"))&&E.getAttribute("data-type")==="outside";p.start(0,()=>{const S=s.select("domReferenceElement"),k=_r(At(S));!E&&k===S||rt(l.current.floatingContext?.refs.floating.current,k)||rt(S,k)||C||Qh(E??k,s.context.triggerElements)||s.setOpen(!1,mt(Ul,N))})}}},[l,r,s,p]);return y.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}class py{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Ts,this.restTimeout=new Ts,this.handleCloseOptions=void 0}static create(){return new py}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const sm=new WeakMap;function im(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&sm.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),sm.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function t_(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,a=sm.get(n);a&&a!==e&&im(a),im(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,sm.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function gy(e){const t=e.context.dataRef.current,n=br(()=>t.hoverInteractionState??py.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),Hx(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function n_(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,a="rootStore"in e?e.rootStore:e,l=a.useState("open"),u=a.useState("floatingElement"),d=a.useState("domReferenceElement"),{dataRef:h}=a.context,p=Ra(),m=_a(),b=gy(a),x=Gn(),E=nt(()=>aA(h.current.openEvent?.type,b.interactedInside)),N=nt(()=>Sj(h.current.openEvent?.type)),C=nt(()=>{im(b)});Ye(()=>{l||(b.pointerType=void 0,b.restTimeoutPending=!1,b.interactedInside=!1,C())},[l,b,C]),y.useEffect(()=>C,[C]),Ye(()=>{if(n&&l&&b.handleCloseOptions?.blockPointerEvents&&N()&&St(d)&&u){const S=d,k=u,A=At(u),R=p?.nodesRef.current.find(j=>j.id===m)?.context?.elements.floating;R&&(R.style.pointerEvents="");const M=b.pointerEventsScopeElement!==k?b.pointerEventsScopeElement:null,_=R!==k?R:null,O=b.handleCloseOptions?.getScope?.()??M??_??S.closest("[data-rootownerid]")??A.body;return t_(b,{scopeElement:O,referenceElement:S,floatingElement:k}),()=>{C()}}},[n,l,d,u,b,N,p,m,C]),y.useEffect(()=>{if(!n)return;function S(){return!!(p&&m&&Ta(p.nodesRef.current,m).length>0)}function k(j){const H=Xl(r,"close",b.pointerType),B=()=>{a.setOpen(!1,mt(qn,j)),p?.events.emit("floating.closed",j)};H?b.openChangeTimeout.start(H,B):(b.openChangeTimeout.clear(),B())}function A(j){const H=pr(j);if(!vj(H)){b.interactedInside=!1;return}b.interactedInside=H?.closest("[aria-haspopup]")!=null}function R(){b.openChangeTimeout.clear(),x.clear(),p?.events.off("floating.closed",_),C()}function M(j){if(S()&&p){p.events.on("floating.closed",_);return}if(Qh(j.relatedTarget,a.context.triggerElements))return;const H=h.current.floatingContext?.nodeId??s,B=j.relatedTarget;if(!(p&&H&&St(B)&&Ta(p.nodesRef.current,H,!1).some(X=>rt(X.context?.elements.floating,B)))){if(b.handler){b.handler(j);return}C(),N()&&!E()&&k(j)}}function _(j){!p||!m||S()||x.start(0,()=>{p.events.off("floating.closed",_),a.setOpen(!1,mt(qn,j)),p.events.emit("floating.closed",j)})}const O=u;return Vs(O&&Tt(O,"mouseenter",R),O&&Tt(O,"mouseleave",M),O&&Tt(O,"pointerdown",A,!0),()=>{p?.events.off("floating.closed",_)})},[n,u,a,h,r,s,N,E,C,b,p,m,x])}const yP={current:null};function r_(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:a=!1,restMs:l=0,move:u=!0,triggerElementRef:d=yP,externalTree:h,isActiveTrigger:p=!0,getHandleCloseContext:m,isClosing:b,shouldOpen:x}=t,E="rootStore"in e?e.rootStore:e,{dataRef:N,events:C}=E.context,S=Ra(h),k=gy(E),A=y.useRef(!1),R=Tn(s),M=Tn(r),_=Tn(l),O=Tn(n),j=Tn(x),H=Tn(b),B=nt(()=>aA(N.current.openEvent?.type,k.interactedInside)),K=nt(()=>j.current?.()!==!1),X=nt((q,z,V)=>{const W=E.context.triggerElements;if(W.hasElement(z))return!q||!rt(q,z);if(!St(V))return!1;const le=V;return W.hasMatchingElement(D=>rt(D,le))&&(!q||!rt(q,le))}),Z=nt(()=>{if(!k.handler)return;At(E.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0}),te=nt(()=>{im(k)});return p&&(k.handleCloseOptions=R.current?.__options),y.useEffect(()=>Z,[Z]),y.useEffect(()=>{if(!n)return;function q(z){z.open?A.current=!1:(A.current=z.reason===qn,Z(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return C.on("openchange",q),()=>{C.off("openchange",q)}},[n,C,k,Z]),y.useEffect(()=>{if(!n)return;function q(le,D=!0){const P=Xl(M.current,"close",k.pointerType);P?k.openChangeTimeout.start(P,()=>{E.setOpen(!1,mt(qn,le)),S?.events.emit("floating.closed",le)}):D&&(k.openChangeTimeout.clear(),E.setOpen(!1,mt(qn,le)),S?.events.emit("floating.closed",le))}const z=d.current??(p?E.select("domReferenceElement"):null);if(!St(z))return;function V(le){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,a&&!To(k.pointerType))return;const D=vC(_.current),P=Xl(M.current,"open",k.pointerType),$=pr(le),L=le.currentTarget??null,ae=E.select("domReferenceElement");let re=L;if(St($)&&!E.context.triggerElements.hasElement($)){for(const Be of E.context.triggerElements.elements())if(rt(Be,$)){re=Be;break}}St(L)&&St(ae)&&!E.context.triggerElements.hasElement(L)&&rt(L,ae)&&(re=ae);const ce=re==null?!1:X(ae,re,$),de=E.select("open"),fe=H.current?.()??E.select("transitionStatus")==="ending",Se=!de&&fe&&A.current,He=!ce&&St(re)&&St(ae)&&rt(ae,re)&&Se,Me=D>0&&!P,Ee=ce&&(de||Se)||He,Oe=!de||ce;if(Ee){K()&&E.setOpen(!0,mt(qn,le,re));return}Me||(P?k.openChangeTimeout.start(P,()=>{Oe&&K()&&E.setOpen(!0,mt(qn,le,re))}):Oe&&K()&&E.setOpen(!0,mt(qn,le,re)))}function W(le){if(B()){te();return}Z();const D=E.select("domReferenceElement"),P=At(D);k.restTimeout.clear(),k.restTimeoutPending=!1;const $=N.current.floatingContext??m?.();if(Qh(le.relatedTarget,E.context.triggerElements))return;if(R.current&&$){E.select("open")||k.openChangeTimeout.clear();const ae=d.current;k.handler=R.current({...$,tree:S,x:le.clientX,y:le.clientY,onClose(){te(),Z(),O.current&&!B()&&ae===E.select("domReferenceElement")&&q(le,!0)}}),P.addEventListener("mousemove",k.handler),k.handler(le);return}(k.pointerType==="touch"?!rt(E.select("floatingElement"),le.relatedTarget):!0)&&q(le)}return u?Vs(Tt(z,"mousemove",V,{once:!0}),Tt(z,"mouseenter",V),Tt(z,"mouseleave",W)):Vs(Tt(z,"mouseenter",V),Tt(z,"mouseleave",W))},[Z,te,N,M,E,n,R,k,p,X,B,a,u,_,d,S,O,m,H,K]),y.useMemo(()=>{if(!n)return;function q(z){k.pointerType=z.pointerType}return{onPointerDown:q,onPointerEnter:q,onMouseMove(z){const{nativeEvent:V}=z,W=z.currentTarget,le=E.select("domReferenceElement"),D=E.select("open"),P=X(le,W,z.target);if(a&&!To(k.pointerType))return;if(D&&P&&k.handleCloseOptions?.blockPointerEvents){const ae=E.select("floatingElement");if(ae){const re=k.handleCloseOptions?.getScope?.()??W.ownerDocument.body;t_(k,{scopeElement:re,referenceElement:W,floatingElement:ae})}}const $=vC(_.current);if(D&&!P||$===0||!P&&k.restTimeoutPending&&z.movementX**2+z.movementY**2<2)return;k.restTimeout.clear();function L(){if(k.restTimeoutPending=!1,B())return;const ae=E.select("open");!k.blockMouseMove&&(!ae||P)&&K()&&E.setOpen(!0,mt(qn,V,W))}k.pointerType==="touch"?or.flushSync(()=>{L()}):P&&D?L():(k.restTimeoutPending=!0,k.restTimeout.start($,L))}}},[n,k,B,X,a,E,_,K])}const vP="Escape";function Qm(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function oh(e,t){return Qm(t,e===iA||e===qx,e===Hm||e===Fm)}function d1(e,t,n){return Qm(t,e===qx,n?e===Hm:e===Fm)||e==="Enter"||e===" "||e===""}function EP(e,t,n){return Qm(t,n?e===Hm:e===Fm,e===qx)}function TP(e,t,n,r){const s=n?e===Fm:e===Hm,a=e===iA;return t==="both"||t==="horizontal"&&r?e===vP:Qm(t,s,a)}function s_(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:a=!0,selectedIndex:l=null,allowEscape:u=!1,loopFocus:d=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:b="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:E=!0,disabledIndices:N=void 0,orientation:C="vertical",parentOrientation:S,id:k,resetOnPointerLeave:A=!0,externalTree:R,grid:M}=t,_=M!=null,O="rootStore"in e?e.rootStore:e,j=O.useState("open"),H=O.useState("floatingElement"),B=O.useState("domReferenceElement"),K=O.context.dataRef,X=Zh(H),Z=vb(B),te=Tn(X),q=_a(),z=Ra(R),V=y.useRef(b),W=y.useRef(l??-1),le=y.useRef(null),D=y.useRef(!0),P=nt(oe=>{s(W.current===-1?null:W.current,oe)}),$=y.useRef(!!H),L=y.useRef(j),ae=y.useRef(!1),re=y.useRef(!1),ce=y.useRef(null),de=Tn(N),fe=Tn(j),Se=Tn(l),He=Tn(A),Me=Kl(),Ee=Kl(),Oe=nt(()=>{function oe(J){m?z?.events.emit("virtualfocus",J):ce.current=jh(J,{sync:ae.current,preventScroll:!0})}const ie=n.current[W.current],G=re.current;ie&&oe(ie),(ae.current?J=>J():J=>Me.request(J))(()=>{const J=n.current[W.current]||ie;if(!J)return;ie||oe(J),ve&&(G||!D.current)&&J.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Ye(()=>{K.current.orientation=C},[K,C]),Ye(()=>{a&&(j&&H?(W.current=l??-1,V.current&&l!=null&&(re.current=!0,P())):$.current&&(W.current=-1,P()))},[a,j,H,l,P]),Ye(()=>{if(a){if(!j){ae.current=!1;return}if(H)if(r==null){if(ae.current=!1,Se.current!=null)return;if($.current&&(W.current=-1,Oe()),(!L.current||!$.current)&&V.current&&(le.current!=null||V.current===!0&&le.current==null)){let oe=0;const ie=()=>{n.current[0]==null?(oe<2&&(oe?F=>Ee.request(F):queueMicrotask)(ie),oe+=1):(W.current=le.current==null||d1(le.current,C,p)||h?s1(n):CC(n),le.current=null,P())};ie()}}else SC(n.current,r)||(W.current=r,Oe(),re.current=!1)}},[a,j,H,r,Se,h,n,C,p,P,Oe,Ee]),Ye(()=>{if(!a||H||!z||m||!$.current)return;const oe=z.nodesRef.current,ie=oe.find(J=>J.id===q)?.context?.elements.floating,G=_r(At(B??ie??null)),F=oe.some(J=>J.context&&rt(J.context.elements.floating,G));ie&&!F&&D.current&&ie.focus({preventScroll:!0})},[a,H,B,z,q,m]),Ye(()=>{L.current=j,$.current=!!H}),Ye(()=>{j||(le.current=null,V.current=b)},[j,b]);const Be=r!=null,Ke=nt(oe=>{if(!fe.current)return;const ie=n.current.indexOf(oe.currentTarget);ie!==-1&&(W.current!==ie||r!==ie)&&(W.current=ie,P(oe))}),$e=nt(()=>S??z?.nodesRef.current.find(oe=>oe.id===q)?.context?.dataRef?.current.orientation),De=nt(()=>s1(n,de.current)),ke=nt(oe=>{if(D.current=!1,ae.current=!0,oe.which===229||!fe.current&&oe.currentTarget===te.current)return;if(h&&TP(oe.key,C,p,_)){oh(oe.key,$e())||Us(oe),O.setOpen(!1,mt(Eb,oe.nativeEvent)),dn(B)&&(m?z?.events.emit("virtualfocus",B):B.focus());return}const ie=W.current,G=s1(n,N),F=CC(n,N);if(Z||(oe.key==="Home"&&(Us(oe),W.current=G,P(oe)),oe.key==="End"&&(Us(oe),W.current=F,P(oe))),M!=null){const J=M(oe,W.current,n,C,d,p,N,G,F);if(J!=null&&(W.current=J,P(oe)),C==="both")return}if(oh(oe.key,C)){if(Us(oe),j&&!m&&_r(oe.currentTarget.ownerDocument)===oe.currentTarget){W.current=d1(oe.key,C,p)?G:F,P(oe);return}d1(oe.key,C,p)?d?ie>=F?u&&ie!==n.current.length?W.current=-1:(ae.current=!1,W.current=G):W.current=jl(n.current,{startingIndex:ie,disabledIndices:N}):W.current=Math.min(F,jl(n.current,{startingIndex:ie,disabledIndices:N})):d?ie<=G?u&&ie!==-1?W.current=n.current.length:(ae.current=!1,W.current=F):W.current=jl(n.current,{startingIndex:ie,decrement:!0,disabledIndices:N}):W.current=Math.max(G,jl(n.current,{startingIndex:ie,decrement:!0,disabledIndices:N})),SC(n.current,W.current)&&(W.current=-1),P(oe)}}),ve=y.useMemo(()=>({onFocus(ie){ae.current=!0,Ke(ie)},onClick:({currentTarget:ie})=>ie.focus({preventScroll:!0}),onMouseMove(ie){ae.current=!0,re.current=!1,x&&Ke(ie)},onPointerLeave(ie){if(!fe.current||!D.current||ie.pointerType==="touch")return;ae.current=!0;const G=ie.relatedTarget;if(!(!x||n.current.includes(G))&&He.current&&(ce.current?.(),ce.current=null,W.current=-1,P(ie),!m)){const F=te.current,J=_r(At(F));F&&rt(F,J)&&F.focus({preventScroll:!0})}}}),[Ke,fe,te,x,n,P,He,m]),Ie=y.useMemo(()=>m&&j&&Be&&{"aria-activedescendant":`${k}-${r}`},[m,j,Be,k,r]),je=y.useMemo(()=>({"aria-orientation":C==="both"?void 0:C,...Z?{}:Ie,onKeyDown(oe){if(oe.key==="Tab"&&oe.shiftKey&&j&&!m){const ie=pr(oe.nativeEvent);if(ie&&!rt(te.current,ie))return;Us(oe),O.setOpen(!1,mt(So,oe.nativeEvent)),dn(B)&&B.focus();return}ke(oe)},onPointerMove(){D.current=!0}}),[Ie,ke,te,C,Z,O,j,m,B]),ee=y.useMemo(()=>{function oe(F){O.setOpen(!0,mt(Eb,F.nativeEvent,F.currentTarget))}function ie(F){b==="auto"&&Vx(F.nativeEvent)&&(V.current=!m)}function G(F){V.current=b,b==="auto"&&rA(F.nativeEvent)&&(V.current=!0)}return{onKeyDown(F){const J=O.select("open");D.current=!1;const Te=F.key.startsWith("Arrow"),_e=EP(F.key,$e(),p),Ve=oh(F.key,C),ot=(h?_e:Ve)||F.key==="Enter"||F.key.trim()==="";if(m&&J)return ke(F);if(!(!J&&!E&&Te)){if(ot){const tt=oh(F.key,$e());le.current=h&&tt?null:F.key}if(h){_e&&(Us(F),J?(W.current=De(),P(F)):oe(F));return}Ve&&(Se.current!=null&&(W.current=Se.current),Us(F),!J&&E?oe(F):ke(F),J&&P(F))}},onFocus(F){O.select("open")&&!m&&(W.current=-1,P(F))},onPointerDown:G,onPointerEnter:G,onMouseDown:ie,onClick:ie}},[ke,b,De,h,P,O,E,C,$e,p,Se,m]),me=y.useMemo(()=>({...Ie,...ee}),[Ie,ee]);return y.useMemo(()=>a?{reference:me,floating:je,item:ve,trigger:ee}:{},[a,me,je,ee,ve])}function i_(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:a,disabledIndices:l,onTyping:u,enabled:d=!0,resetMs:h=750,selectedIndex:p=null}=t,m="rootStore"in e?e.rootStore:e,b=m.useState("open"),x=Gn(),E=y.useRef(""),N=y.useRef(p??s??-1),C=y.useRef(null),S=nt(R=>{function M(te){const q=r?.current[te];return!q||Ym(q)}function _(te){return M(te)?l==null||!dA(Yl,te,l):!1}function O(te,q,z=0){if(te.length===0)return-1;const V=(z%te.length+te.length)%te.length,W=q.toLowerCase();for(let le=0;le<te.length;le+=1){const D=(V+le)%te.length;if(!(!te[D]?.toLowerCase().startsWith(W)||!_(D)))return D}return-1}const j=n.current;if(E.current.length>0&&R.key===" "&&(Us(R),u?.(!0)),E.current.length>0&&E.current[0]!==" "&&O(j,E.current)===-1&&R.key!==" "&&u?.(!1),j==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;b&&R.key!==" "&&(Us(R),u?.(!0));const H=E.current==="";H&&(N.current=p??s??-1),j.every((te,q)=>te&&_(q)?te[0]?.toLowerCase()!==te[1]?.toLowerCase():!0)&&E.current===R.key&&(E.current="",N.current=C.current),E.current+=R.key,x.start(h,()=>{E.current="",N.current=C.current,u?.(!1)});const X=((H?p??s??-1:N.current)??0)+1,Z=O(j,E.current,X);Z!==-1?(a?.(Z),C.current=Z):R.key!==" "&&(E.current="",u?.(!1))}),k=nt(R=>{const M=R.relatedTarget,_=m.select("domReferenceElement"),O=m.select("floatingElement");rt(_,M)||rt(O,M)||(x.clear(),E.current="",N.current=C.current,u?.(!1))});Ye(()=>{!b&&p!==null||(x.clear(),C.current=null,E.current!==""&&(E.current=""))},[b,p,x]),Ye(()=>{b&&E.current===""&&(N.current=p??s??-1)},[b,p,s]);const A=y.useMemo(()=>({onKeyDown:S,onBlur:k}),[S,k]);return y.useMemo(()=>d?{reference:A,floating:A}:{},[d,A])}const KC=.1,SP=KC*KC,Wt=.5;function lh(e,t,n,r,s,a){return r>=t!=a>=t&&e<=(s-n)*(t-r)/(a-r)+n}function uh(e,t,n,r,s,a,l,u,d,h){let p=!1;return lh(e,t,n,r,s,a)&&(p=!p),lh(e,t,s,a,l,u)&&(p=!p),lh(e,t,l,u,d,h)&&(p=!p),lh(e,t,d,h,n,r)&&(p=!p),p}function CP(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function ch(e,t,n,r,s,a){const l=Math.min(n,s),u=Math.max(n,s),d=Math.min(r,a),h=Math.max(r,a);return e>=l&&e<=u&&t>=d&&t<=h}function a_(e={}){const{blockPointerEvents:t=!1}=e,n=new Ts,r=({x:s,y:a,placement:l,elements:u,onClose:d,nodeId:h,tree:p})=>{const m=l?.split("-")[0];let b=!1,x=null,E=null,N=typeof performance<"u"?performance.now():0;function C(k,A){const R=performance.now(),M=R-N;if(x===null||E===null||M===0)return x=k,E=A,N=R,!1;const _=k-x,O=A-E,j=_*_+O*O,H=M*M*SP;return x=k,E=A,N=R,j<H}function S(){n.clear(),d()}return function(A){n.clear();const R=u.domReference,M=u.floating;if(!R||!M||m==null||s==null||a==null)return;const{clientX:_,clientY:O}=A,j=pr(A),H=A.type==="mouseleave",B=rt(M,j),K=rt(R,j);if(B&&(b=!0,!H))return;if(K&&(b=!1,!H)){b=!0;return}if(H&&St(A.relatedTarget)&&rt(M,A.relatedTarget))return;function X(){return!!(p&&Ta(p.nodesRef.current,h).length>0)}function Z(){X()||S()}if(X())return;const te=R.getBoundingClientRect(),q=M.getBoundingClientRect(),z=s>q.right-q.width/2,V=a>q.bottom-q.height/2,W=q.width>te.width,le=q.height>te.height,D=(W?te:q).left,P=(W?te:q).right,$=(le?te:q).top,L=(le?te:q).bottom;if(m==="top"&&a>=te.bottom-1||m==="bottom"&&a<=te.top+1||m==="left"&&s>=te.right-1||m==="right"&&s<=te.left+1){Z();return}let ae=!1;switch(m){case"top":ae=ch(_,O,D,te.top+1,P,q.bottom-1);break;case"bottom":ae=ch(_,O,D,q.top+1,P,te.bottom-1);break;case"left":ae=ch(_,O,q.right-1,L,te.left+1,$);break;case"right":ae=ch(_,O,te.right-1,L,q.left+1,$);break}if(ae)return;if(b&&!CP(_,O,te)){Z();return}if(!H&&C(_,O)){Z();return}let re=!1;switch(m){case"top":{const ce=W?Wt/2:Wt*4,de=W||z?s+ce:s-ce,fe=W?s-ce:z?s+ce:s-ce,Se=a+Wt+1,He=z||W?q.bottom-Wt:q.top,Me=z?W?q.bottom-Wt:q.top:q.bottom-Wt;re=uh(_,O,de,Se,fe,Se,q.left,He,q.right,Me);break}case"bottom":{const ce=W?Wt/2:Wt*4,de=W||z?s+ce:s-ce,fe=W?s-ce:z?s+ce:s-ce,Se=a-Wt,He=z||W?q.top+Wt:q.bottom,Me=z?W?q.top+Wt:q.bottom:q.top+Wt;re=uh(_,O,de,Se,fe,Se,q.left,He,q.right,Me);break}case"left":{const ce=le?Wt/2:Wt*4,de=le||V?a+ce:a-ce,fe=le?a-ce:V?a+ce:a-ce,Se=s+Wt+1,He=V||le?q.right-Wt:q.left,Me=V?le?q.right-Wt:q.left:q.right-Wt;re=uh(_,O,He,q.top,Me,q.bottom,Se,de,Se,fe);break}case"right":{const ce=le?Wt/2:Wt*4,de=le||V?a+ce:a-ce,fe=le?a-ce:V?a+ce:a-ce,Se=s-Wt,He=V||le?q.left+Wt:q.right,Me=V?le?q.left+Wt:q.right:q.left+Wt;re=uh(_,O,Se,de,Se,fe,He,q.top,Me,q.bottom);break}}re?b||n.start(40,Z):Z()}};return r.__options={...e,blockPointerEvents:t},r}const o_=y.createContext(null),l_=y.createContext(null);function Ia(){const e=y.useContext(o_);if(e===null)throw new Error(Dn(60));return e}function u_(){const e=y.useContext(l_);if(e===null)throw new Error(Dn(61));return e}let XC=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const wP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Rc={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},kP={disabled:!1,...Rc},NP={valid(e){return e===null?null:e?{[XC.valid]:""}:{[XC.invalid]:""}}},AP={invalid:void 0,name:void 0,validityData:{state:wP,errors:[],error:"",value:"",initialValue:null},setValidityData:Vn,disabled:void 0,touched:Rc.touched,setTouched:Vn,dirty:Rc.dirty,setDirty:Vn,filled:Rc.filled,setFilled:Vn,focused:Rc.focused,setFocused:Vn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:kP,markedDirtyRef:{current:!1},registerFieldControl:Vn,validation:{getValidationProps:(e,t=fn)=>t,inputRef:{current:null},registerInput:Vn,commit:async()=>{},change:Vn}},_P=y.createContext(AP);function by(e=!0){const t=y.useContext(_P);if(t.setValidityData===Vn&&!e)throw new Error(Dn(28));return t}function RP(e,t,n,r,s=!0,a){const{registerFieldControl:l}=by(),u=y.useRef(null);u.current||(u.current=Symbol()),Ye(()=>{const d=u.current;return!d||!s?void 0:(l(d,{controlRef:e,getValue:r,id:t,name:a,value:n}),()=>{l(d,void 0)})},[e,s,r,t,a,l,n])}function Do(e){return Co(e,"base-ui")}const IP=y.createContext({controlId:void 0,registerControlId:Vn,labelId:void 0,setLabelId:Vn,messageIds:[],setMessageIds:Vn,getDescriptionProps:e=>e});function c_(){return y.useContext(IP)}function d_(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:a}=c_(),l=Do(t),u=n?s:void 0,d=br(()=>Symbol("labelable-control")),h=y.useRef(!1),p=y.useRef(t!=null),m=nt(()=>{!h.current||a===Vn||(h.current=!1,a(d.current,void 0))});return Ye(()=>{if(a===Vn)return;let b;if(n){const x=r?.current;St(x)&&x.closest("label")!=null?b=t??null:b=u??l}else if(t!=null)p.current=!0,b=t;else if(p.current)b=l;else{m();return}if(b===void 0){m();return}h.current=!0,a(d.current,b)},[t,r,u,a,n,l,d,m]),y.useEffect(()=>m,[m]),s??l}const OP=(e,t)=>Object.is(e,t);function ko(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function MP(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:ko(t,r,n))}function zc(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:ko(r,t,n))}function LP(e,t,n){return e.filter(r=>!ko(t,r,n))}function kb(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function f_(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function DP(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(f_(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function h_(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return kb(e)}function so(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?kb(e.value):kb(e)}function m_(e,t,n){function r(){return h_(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const s=t,a=f_(s)?s.flatMap(l=>l.items):s;if(e==null||typeof e!="object"){const l=a.find(u=>u.value===e);return l&&l.label!=null?l.label:r()}if("value"in e){const l=a.find(u=>u&&u.value===e.value);if(l&&l.label!=null)return l.label}}return r()}function jP(e,t,n){return e.reduce((r,s,a)=>(a>0&&r.push(", "),r.push(f.jsx(y.Fragment,{children:m_(s,t,n)},a)),r),[])}const ct={id:ze(e=>e.id),labelId:ze(e=>e.labelId),modal:ze(e=>e.modal),multiple:ze(e=>e.multiple),items:ze(e=>e.items),itemToStringLabel:ze(e=>e.itemToStringLabel),itemToStringValue:ze(e=>e.itemToStringValue),isItemEqualToValue:ze(e=>e.isItemEqualToValue),value:ze(e=>e.value),hasSelectedValue:ze(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:so(t,r)!==""}),hasNullItemLabel:ze((e,t)=>t?DP(e.items):!1),open:ze(e=>e.open),mounted:ze(e=>e.mounted),forceMount:ze(e=>e.forceMount),transitionStatus:ze(e=>e.transitionStatus),openMethod:ze(e=>e.openMethod),activeIndex:ze(e=>e.activeIndex),selectedIndex:ze(e=>e.selectedIndex),isActive:ze((e,t)=>e.activeIndex===t),isSelected:ze((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>ko(t,s,n)):ko(t,r,n)}),isSelectedByFocus:ze((e,t)=>e.selectedIndex===t),popupProps:ze(e=>e.popupProps),triggerProps:ze(e=>e.triggerProps),triggerElement:ze(e=>e.triggerElement),positionerElement:ze(e=>e.positionerElement),listElement:ze(e=>e.listElement),popupSide:ze(e=>e.popupSide),scrollUpArrowVisible:ze(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:ze(e=>e.scrollDownArrowVisible),hasScrollArrows:ze(e=>e.hasScrollArrows)},PP=y.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Vn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function BP(){return y.useContext(PP)}function zP(e,t,n=(r,s)=>r===s){return e.length===t.length&&e.every((r,s)=>n(r,t[s]))}function p_(e,t){const n=y.useRef(e),r=nt(t);Ye(()=>{n.current!==e&&r(n.current)},[e,r]),Ye(()=>{n.current=e},[e])}function UP(e){const t=y.useRef(""),n=y.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:y.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function g_(e,t){const n=nt((a,l)=>{(typeof e=="function"?e():e)||t(l||(Um?"touch":""))}),{onClick:r,onPointerDown:s}=UP(n);return y.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function b_(e){const[t,n]=y.useState(null),r=g_(e,n);return p_(e,s=>{s&&!e&&n(null)}),y.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Ic(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const xi=1;function x_(e,t){return Math.max(0,e-t)}function HP(e,t){if(t<=0)return 0;const n=Ic(e,0,t),r=n,s=t-n,a=r<=xi,l=s<=xi;return a&&l?r<=s?0:t:a?0:l?t:n}function FP(e){const{id:t,value:n,defaultValue:r=null,onValueChange:s,open:a,defaultOpen:l=!1,onOpenChange:u,name:d,form:h,autoComplete:p,disabled:m=!1,readOnly:b=!1,required:x=!1,modal:E=!0,actionsRef:N,inputRef:C,onOpenChangeComplete:S,items:k,multiple:A=!1,itemToStringLabel:R,itemToStringValue:M,isItemEqualToValue:_=OP,highlightItemOnHover:O=!0,children:j}=e,{clearErrors:H}=BP(),{setDirty:B,setTouched:K,setFocused:X,validityData:Z,setFilled:te,name:q,disabled:z,validation:V,validationMode:W}=by(),le=d_({id:t}),D=z||m,P=q??d,[$,L]=xC({controlled:n,default:A?r??Yl:r,name:"Select",state:"value"}),[ae,re]=xC({controlled:a,default:l,name:"Select",state:"open"}),ce=y.useRef([]),de=y.useRef([]),fe=y.useRef(null),Se=y.useRef(null),He=y.useRef(0),Me=y.useRef(null),Ee=y.useRef([]),Oe=y.useRef(!1),Be=y.useRef(null),Ke=y.useRef(null),$e=y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),De=y.useRef(!1),{mounted:ke,setMounted:ve,transitionStatus:Ie}=ay(ae),{openMethod:je,triggerProps:ee}=b_(ae),me=br(()=>new tA({id:le,labelId:void 0,modal:E,multiple:A,itemToStringLabel:R,itemToStringValue:M,isItemEqualToValue:_,value:$,open:ae,mounted:ke,transitionStatus:Ie,items:k,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,oe=ft(me,ct.activeIndex),ie=ft(me,ct.selectedIndex),G=ft(me,ct.triggerElement),F=ft(me,ct.positionerElement),J=FD(je),Te=je??J??null,_e=y.useMemo(()=>A?"":so($,M),[A,$,M]),Ve=y.useMemo(()=>A&&Array.isArray($)?$.map(ht=>so(ht,M)):so($,M),[A,$,M]),ot=Tn(me.state.triggerElement),tt=nt(()=>Ve);RP(ot,le,$,tt,!D,d);const dt=y.useRef($),ut=A?Array.isArray($)&&$.length>0:$!=null&&so($,M)!=="";Ye(()=>{$!==dt.current&&me.set("forceMount",!0)},[me,$]),Ye(()=>{te(ut)},[ut,te]),Ye(function(){const It=Ee.current;let yn;if(A){const Un=Array.isArray($)?$:[];if(Un.length===0)yn=null;else{const jn=Un[Un.length-1],tn=zc(It,jn,_);yn=tn===-1?null:tn}}else{const Un=zc(It,$,_);yn=Un===-1?null:Un}yn===null&&(Ke.current=null),!ae&&me.set("selectedIndex",yn)},[ut,A,ae,$,Ee,_,me,Ke]);function qe(ht){const It=Z.initialValue;return Array.isArray(ht)&&Array.isArray(It)?!zP(ht,It,(yn,Un)=>ko(yn,Un,_)):ht!==It}p_($,()=>{H(P),B(qe($)),V.change($)});const Rt=nt((ht,It)=>{u?.(ht,It),!It.isCanceled&&(re(ht),!ht&&(It.reason===So||It.reason===Vm)&&(K(!0),X(!1),W==="onBlur"&&V.commit($)))}),jt=nt(()=>{ve(!1),me.update({activeIndex:null,openMethod:null}),S?.(!1)});Lo({enabled:!N,open:ae,ref:fe,onComplete(){ae||jt()}}),y.useImperativeHandle(N,()=>({unmount:jt}),[jt]);const lt=nt((ht,It)=>{s?.(ht,It),!It.isCanceled&&L(ht)}),Lt=nt(()=>{const ht=me.state.listElement||fe.current;if(!ht)return;const It=x_(ht.scrollHeight,ht.clientHeight),yn=HP(ht.scrollTop,It),Un=yn>0,jn=yn<It;me.state.scrollUpArrowVisible!==Un&&me.set("scrollUpArrowVisible",Un),me.state.scrollDownArrowVisible!==jn&&me.set("scrollDownArrowVisible",jn)}),Zt=JA({open:ae,onOpenChange:Rt,elements:{reference:G,floating:F}}),$t=sy(Zt,{enabled:!b&&!D,event:"mousedown"}),Jt=Gm(Zt),Xe=s_(Zt,{enabled:!b&&!D,listRef:ce,activeIndex:oe,selectedIndex:ie,disabledIndices:Yl,onNavigate(ht){ht===null&&!ae||me.set("activeIndex",ht)},focusItemOnHover:O}),yt=i_(Zt,{enabled:!b&&!D&&(ae||!A),listRef:de,activeIndex:oe,selectedIndex:ie,disabledIndices:ht=>$D(ce.current[ht]),onMatch(ht){ae?me.set("activeIndex",ht):lt(Ee.current[ht],mt("none"))},onTyping(ht){Oe.current=ht}}),Ht=y.useMemo(()=>{const ht=Ir(yt.reference,Xe.reference,Jt.reference,$t.reference,ee);return le&&(ht.id=le),ht},[$t.reference,yt.reference,Xe.reference,Jt.reference,ee,le]),en=y.useMemo(()=>Ir(Wm,yt.floating,Xe.floating,Jt.floating),[yt.floating,Xe.floating,Jt.floating]),Kn=Xe.item??fn;Lx(()=>{me.update({popupProps:en,triggerProps:Ht})}),Ye(()=>{me.update({id:le,modal:E,multiple:A,value:$,open:ae,mounted:ke,transitionStatus:Ie,popupProps:en,triggerProps:Ht,items:k,itemToStringLabel:R,itemToStringValue:M,isItemEqualToValue:_,openMethod:Te})},[me,le,E,A,$,ae,ke,Ie,en,Ht,k,R,M,_,Te]);const vt=y.useMemo(()=>({store:me,name:P,required:x,disabled:D,readOnly:b,multiple:A,highlightItemOnHover:O,setValue:lt,setOpen:Rt,listRef:ce,popupRef:fe,scrollHandlerRef:Se,handleScrollArrowVisibility:Lt,scrollArrowsMountedCountRef:He,itemProps:Kn,valueRef:Me,valuesRef:Ee,labelsRef:de,typingRef:Oe,selectionRef:$e,firstItemTextRef:Be,selectedItemTextRef:Ke,validation:V,onOpenChangeComplete:S,alignItemWithTriggerActiveRef:De,initialValueRef:dt}),[me,P,x,D,b,A,O,lt,Rt,Kn,V,S,Lt]),ln=Eo(C,V.inputRef),yr=A&&Array.isArray($)&&$.length>0,bn=A?void 0:P,Cn=y.useMemo(()=>!A||!Array.isArray($)||!P?null:$.map(ht=>{const It=so(ht,M);return f.jsx("input",{type:"hidden",form:h,name:P,value:It,disabled:D},It)}),[A,$,h,P,M,D]);return f.jsx(o_.Provider,{value:vt,children:f.jsxs(l_.Provider,{value:Zt,children:[j,f.jsx("input",{...V.getValidationProps(D,{onFocus(){me.state.triggerElement?.focus({focusVisible:!0})},onChange(ht){if(ht.nativeEvent.defaultPrevented||D||b)return;const It=ht.currentTarget.value,yn=mt(au,ht.nativeEvent);function Un(){if(A)return;const jn=It.toLowerCase();let tn=Ee.current.findIndex(Rs=>so(Rs,M).toLowerCase()===jn||h_(Rs,R).toLowerCase()===jn);tn===-1&&(tn=Ee.current.findIndex((Rs,xu)=>{const Dd=de.current[xu];return Dd!=null&&Dd.toLowerCase()===jn}));const Xn=tn===-1?void 0:Ee.current[tn];Xn!=null&&lt(Xn,yn)}me.set("forceMount",!0),queueMicrotask(Un)}}),id:le&&bn==null?`${le}-hidden-input`:void 0,form:h,name:bn,autoComplete:p,value:_e,disabled:D,required:x&&!yr,readOnly:b,ref:ln,style:P?BD:WN,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Cn]})})}function $P(e,t){return e??t}let fo=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ld.startingStyle]="startingStyle",e[e.endingStyle=ld.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),am=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const VP={[am.popupOpen]:""},qP={[am.popupOpen]:"",[am.pressed]:""},YP={[fo.open]:""},GP={[fo.closed]:""},KP={[fo.anchorHidden]:""},xy={open(e){return e?VP:null}},Nb={open(e){return e?qP:null}},uu={open(e){return e?YP:GP},anchorHidden(e){return e?KP:null}};function y_(e){const t=e.getBoundingClientRect(),n=on(e);if($x)return t;const r=n.getComputedStyle(e,"::before"),s=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||s.content!=="none"))return t;const l=parseFloat(r.width)||0,u=parseFloat(r.height)||0,d=parseFloat(s.width)||0,h=parseFloat(s.height)||0,p=Math.max(t.width,l,d),m=Math.max(t.height,u,h),b=p-t.width,x=m-t.height;return{left:t.left-b/2,right:t.right+b/2,top:t.top-x/2,bottom:t.bottom+x/2}}const XP=y.createContext(void 0);function yy(e=!1){const t=y.useContext(XP);if(t===void 0&&!e)throw new Error(Dn(16));return t}function WP(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,l=r&&t!==!1,u=r&&t===!1;return{props:y.useMemo(()=>{const h={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return r||(h.tabIndex=s,!a&&n&&(h.tabIndex=t?s:-1)),(a&&(t||l)||!a&&n)&&(h["aria-disabled"]=n),a&&(!t||u)&&(h.disabled=n),h},[r,n,t,l,u,a,s])}}function cu(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:a}=e,l=y.useRef(null),u=yy(!0),d=a??u!==void 0,{props:h}=WP({focusableWhenDisabled:n,disabled:t,composite:d,tabIndex:r,isNativeButton:s}),p=y.useCallback(()=>{const x=l.current;f1(x)&&d&&t&&h.disabled===void 0&&x.disabled&&(x.disabled=!1)},[t,h.disabled,d]);Ye(p,[p]);const m=y.useCallback((x={})=>{const{onClick:E,onMouseDown:N,onKeyUp:C,onKeyDown:S,onPointerDown:k,...A}=x;return Ir({onClick(R){if(t){R.preventDefault();return}E?.(R)},onMouseDown(R){t||N?.(R)},onKeyDown(R){if(t||(nm(R),S?.(R),R.baseUIHandlerPrevented))return;const M=R.target===R.currentTarget,_=R.currentTarget,O=f1(_),j=!s&&QP(_),H=M&&(s?O:!j),B=R.key==="Enter",K=R.key===" ",X=_.getAttribute("role"),Z=X?.startsWith("menuitem")||X==="option"||X==="gridcell";if(M&&d&&K){if(R.defaultPrevented&&Z)return;R.preventDefault(),j||s&&O?(_.click(),R.preventBaseUIHandler()):H&&(E?.(R),R.preventBaseUIHandler());return}H&&(!s&&(K||B)&&R.preventDefault(),!s&&B&&E?.(R))},onKeyUp(R){if(!t){if(nm(R),C?.(R),R.target===R.currentTarget&&s&&d&&f1(R.currentTarget)&&R.key===" "){R.preventDefault();return}R.baseUIHandlerPrevented||R.target===R.currentTarget&&!s&&!d&&R.key===" "&&E?.(R)}},onPointerDown(R){if(t){R.preventDefault();return}k?.(R)}},s?{type:"button"}:{role:"button"},h,A)},[t,h,d,s]),b=nt(x=>{l.current=x,p()});return{getButtonProps:m,buttonRef:b}}function f1(e){return dn(e)&&e.tagName==="BUTTON"}function QP(e){return!!(e?.tagName==="A"&&e?.href)}const dh=2,ZP=400,JP={...Nb,...NP,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},e7=y.forwardRef(function(t,n){const{render:r,className:s,id:a,disabled:l=!1,nativeButton:u=!0,style:d,...h}=t,{setTouched:p,setFocused:m,validationMode:b,state:x,disabled:E}=by(),{labelId:N}=c_(),{store:C,setOpen:S,selectionRef:k,validation:A,readOnly:R,required:M,alignItemWithTriggerActiveRef:_,disabled:O}=Ia(),j=E||O||l,H=ft(C,ct.open),B=ft(C,ct.mounted),K=ft(C,ct.value),X=ft(C,ct.triggerProps),Z=ft(C,ct.positionerElement),te=ft(C,ct.listElement),q=ft(C,ct.popupSide),z=ft(C,ct.id),V=ft(C,ct.labelId),W=ft(C,ct.hasSelectedValue),le=B&&Z?q:null,D=a??z,P=$P(N,V);d_({id:D});const $=Tn(Z),L=y.useRef(null),{getButtonProps:ae,buttonRef:re}=cu({disabled:j,native:u}),ce=nt(Oe=>{C.set("triggerElement",Oe)}),de=Gn(),fe=Gn(),Se=Gn();y.useEffect(()=>{if(H)return Se.start(ZP,()=>{k.current.allowUnselectedMouseUp=!0,k.current.allowSelectedMouseUp=!0}),()=>{Se.clear()};k.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},fe.clear()},[H,k,fe,Se]);const He=Ir(X,{id:D,role:"combobox","aria-expanded":H?"true":"false","aria-haspopup":"listbox","aria-controls":H?te?.id??Zh(Z)?.id:void 0,"aria-labelledby":P,"aria-readonly":R||void 0,"aria-required":M||void 0,tabIndex:j?-1:0,onFocus(Oe){m(!0),H&&_.current&&S(!1,mt(au,Oe.nativeEvent)),de.start(0,()=>{C.set("forceMount",!0)})},onBlur(Oe){rt(Z,Oe.relatedTarget)||(p(!0),m(!1),b==="onBlur"&&A.commit(K))},onMouseDown(Oe){if(H)return;const Be=At(Oe.currentTarget);function Ke($e){if(!L.current)return;const De=$e.target;if(rt(L.current,De)||rt($.current,De))return;const ke=y_(L.current);$e.clientX>=ke.left-dh&&$e.clientX<=ke.right+dh&&$e.clientY>=ke.top-dh&&$e.clientY<=ke.bottom+dh||S(!1,mt(oA,$e))}fe.start(0,()=>{Be.addEventListener("mouseup",Ke,{once:!0})})}},h,ae),Me=A.getValidationProps(j,He);Me.role="combobox";const Ee={...x,open:H,disabled:j,value:K,readOnly:R,popupSide:le,placeholder:!W};return An("button",t,{ref:[n,L,re,ce],state:Ee,stateAttributesMapping:JP,props:Me})}),t7={value:()=>null},n7=y.forwardRef(function(t,n){const{className:r,render:s,children:a,placeholder:l,style:u,...d}=t,{store:h,valueRef:p}=Ia(),m=ft(h,ct.value),b=ft(h,ct.items),x=ft(h,ct.itemToStringLabel),E=ft(h,ct.hasSelectedValue),N=!E&&l!=null&&a==null,C=ft(h,ct.hasNullItemLabel,N),S={value:m,placeholder:!E};let k=null;return typeof a=="function"?k=a(m):a!=null?k=a:!E&&l!=null&&!C?k=l:Array.isArray(m)?k=jP(m,b,x):k=m_(m,b,x),An("span",t,{state:S,ref:[n,p],props:[{children:k},d],stateAttributesMapping:t7})}),r7=y.forwardRef(function(t,n){const{render:r,className:s,style:a,...l}=t,{store:u}=Ia(),h={open:ft(u,ct.open)};return An("span",t,{state:h,ref:n,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:xy})}),s7=y.createContext(void 0),i7=y.forwardRef(function(t,n){const{store:r}=Ia(),s=ft(r,ct.mounted),a=ft(r,ct.forceMount);return s||a?f.jsx(s7.Provider,{value:!0,children:f.jsx(ey,{ref:n,...t})}):null});function vy(e){return jx(19)?e:e?"true":void 0}const v_=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function a7(){return y.useContext(v_)}function E_(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,a=nt(s),l=y.useRef(0),u=br(l7).current,d=br(o7).current,[h,p]=y.useState(0),m=y.useRef(h),b=nt((S,k)=>{d.set(S,k??null),m.current+=1,p(m.current)}),x=nt(S=>{d.delete(S),m.current+=1,p(m.current)}),E=y.useMemo(()=>{const S=new Map;return Array.from(d.keys()).filter(A=>A.isConnected).sort(u7).forEach((A,R)=>{const M=d.get(A)??{};S.set(A,{...M,index:R})}),S},[d,h]);Ye(()=>{if(typeof MutationObserver!="function"||E.size===0)return;const S=new MutationObserver(k=>{const A=new Set,R=M=>A.has(M)?A.delete(M):A.add(M);k.forEach(M=>{M.removedNodes.forEach(R),M.addedNodes.forEach(R)}),A.size===0&&(m.current+=1,p(m.current))});return E.forEach((k,A)=>{A.parentElement&&S.observe(A.parentElement,{childList:!0})}),()=>{S.disconnect()}},[E]),Ye(()=>{m.current===h&&(n.current.length!==E.size&&(n.current.length=E.size),r&&r.current.length!==E.size&&(r.current.length=E.size),l.current=E.size),a(E)},[a,E,n,r,h]),Ye(()=>()=>{n.current=[]},[n]),Ye(()=>()=>{r&&(r.current=[])},[r]);const N=nt(S=>(u.add(S),()=>{u.delete(S)}));Ye(()=>{u.forEach(S=>S(E))},[u,E]);const C=y.useMemo(()=>({register:b,unregister:x,subscribeMapChange:N,elementsRef:n,labelsRef:r,nextIndexRef:l}),[b,x,N,n,r,l]);return f.jsx(v_.Provider,{value:C,children:t})}function o7(){return new Map}function l7(){return new Set}function u7(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const c7=y.createContext(void 0);function Ey(){return y.useContext(c7)?.direction??"ltr"}const d7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:h,padding:p=0,offsetParent:m="real"}=Oi(e,t)||{};if(h==null)return{};const b=cA(p),x={x:n,y:r},E=Xx(s),N=Kx(E),C=await l.getDimensions(h),S=E==="y",k=S?"top":"left",A=S?"bottom":"right",R=S?"clientHeight":"clientWidth",M=a.reference[N]+a.reference[E]-x[E]-a.floating[N],_=x[E]-a.reference[E],O=m==="real"?await l.getOffsetParent?.(h):u.floating;let j=u.floating[R]||a.floating[N];(!j||!await l.isElement?.(O))&&(j=u.floating[R]||a.floating[N]);const H=M/2-_/2,B=j/2-C[N]/2-1,K=Math.min(b[k],B),X=Math.min(b[A],B),Z=K,te=j-C[N]-X,q=j/2-C[N]/2+H,z=uA(Z,q,te),V=!d.arrow&&Aa(s)!=null&&q!==z&&a.reference[N]/2-(q<Z?K:X)-C[N]/2<0,W=V?q<Z?q-Z:q-te:0;return{[E]:x[E]+W,data:{[E]:z,centerOffset:q-z-W,...V&&{alignmentOffset:W}},reset:V}}}),f7=(e,t)=>({...d7(e),options:[e,t]}),h7=lP().fn,m7={name:"hide",async fn(e){const{width:t,height:n,x:r,y:s}=e.rects.reference,a=t===0&&n===0&&r===0&&s===0;return{data:{referenceHidden:(await h7(e)).data?.referenceHidden||a}}}},Bh={sideX:"left",sideY:"top"},T_={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:s},platform:a,strategy:l,placement:u}=e,d=on(s),h=d.getComputedStyle(s);if(!(h.transitionDuration!=="0s"&&h.transitionDuration!==""))return{x:t,y:n,data:Bh};const m=await a.getOffsetParent?.(s);let b={width:0,height:0};if(l==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(m===d){const k=At(s);b={width:k.documentElement.clientWidth,height:k.documentElement.clientHeight}}else await a.isElement?.(m)&&(b=await a.getDimensions(m));const x=$r(u);let E=t,N=n;x==="left"&&(E=b.width-(t+r.width)),x==="top"&&(N=b.height-(n+r.height));const C=x==="left"?"right":Bh.sideX,S=x==="top"?"bottom":Bh.sideY;return{x:E,y:N,data:{sideX:C,sideY:S}}}};function S_(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function WC(e,t,n){const{rects:r,placement:s}=e;return{side:S_(t,$r(s),n),align:Aa(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ty(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:h=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:b,keepMounted:x=!1,floatingRootContext:E,mounted:N,collisionAvoidance:C,shiftCrossAxis:S=!1,nodeId:k,adaptiveOrigin:A,lazyFlip:R=!1,externalTree:M}=e,[_,O]=y.useState(null);!N&&_!==null&&O(null);const j=C.side||"flip",H=C.align||"flip",B=C.fallbackAxisSide||"end",K=typeof t=="function"?t:void 0,X=nt(K),Z=K?X:t,te=Tn(t),q=Tn(N),V=Ey()==="rtl",W=_||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":V?"left":"right","inline-start":V?"right":"left"}[r],le=a==="center"?W:`${W}-${a}`;let D=d;const P=1,$=r==="bottom"?P:0,L=r==="top"?P:0,ae=r==="right"?P:0,re=r==="left"?P:0;typeof D=="number"?D={top:D+$,right:D+re,bottom:D+L,left:D+ae}:D&&(D={top:(D.top||0)+$,right:(D.right||0)+re,bottom:(D.bottom||0)+L,left:(D.left||0)+ae});const ce={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:D},de=y.useRef(null),fe=Tn(s),Se=Tn(l),He=typeof s!="function"?s:0,Me=typeof l!="function"?l:0,Ee=[];b&&Ee.push(b),Ee.push(rP(lt=>{const Lt=WC(lt,r,V),Zt=typeof fe.current=="function"?fe.current(Lt):fe.current,$t=typeof Se.current=="function"?Se.current(Lt):Se.current;return{mainAxis:Zt,crossAxis:$t,alignmentAxis:$t}},[He,Me,V,r]));const Oe=H==="none"&&j!=="shift",Be=!Oe&&(h||S||j==="shift"),Ke=j==="none"?null:aP({...ce,padding:{top:D.top+P,right:D.right+P,bottom:D.bottom+P,left:D.left+P},mainAxis:!S&&j==="flip",crossAxis:H==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),$e=Oe?null:sP(lt=>{const Lt=At(lt.elements.floating).documentElement;return{...ce,rootBoundary:S?{x:0,y:0,width:Lt.clientWidth,height:Lt.clientHeight}:void 0,mainAxis:H!=="none",crossAxis:Be,limiter:h||S?void 0:iP(Zt=>{if(!de.current)return{};const{width:$t,height:Jt}=de.current.getBoundingClientRect(),Xe=ls($r(Zt.placement)),yt=Xe==="y"?$t:Jt,Ht=Xe==="y"?D.left+D.right:D.top+D.bottom;return{offset:yt/2+Ht/2}})}},[ce,h,S,D,H]);j==="shift"||H==="shift"||a==="center"?Ee.push($e,Ke):Ee.push(Ke,$e),Ee.push(oP({...ce,apply({elements:{floating:lt},availableWidth:Lt,availableHeight:Zt,rects:$t}){if(!q.current)return;const Jt=lt.style;Jt.setProperty("--available-width",`${Lt}px`),Jt.setProperty("--available-height",`${Zt}px`);const Xe=on(lt).devicePixelRatio||1,{x:yt,y:Ht,width:en,height:Kn}=$t.reference,vt=(Math.round((yt+en)*Xe)-Math.round(yt*Xe))/Xe,ln=(Math.round((Ht+Kn)*Xe)-Math.round(Ht*Xe))/Xe;Jt.setProperty("--anchor-width",`${vt}px`),Jt.setProperty("--anchor-height",`${ln}px`)}}),f7(lt=>({element:de.current||At(lt.elements.floating).createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(lt){const{elements:Lt,middlewareData:Zt,placement:$t,rects:Jt,y:Xe}=lt,yt=$r($t),Ht=ls(yt),en=de.current,Kn=Zt.arrow?.x||0,vt=Zt.arrow?.y||0,ln=en?.clientWidth||0,yr=en?.clientHeight||0,bn=Kn+ln/2,Cn=vt+yr/2,ht=Math.abs(Zt.shift?.y||0),It=Jt.reference.height/2,yn=typeof s=="function"?s(WC(lt,r,V)):s,Un=ht>yn,jn={top:`${bn}px calc(100% + ${yn}px)`,bottom:`${bn}px ${-yn}px`,left:`calc(100% + ${yn}px) ${Cn}px`,right:`${-yn}px ${Cn}px`}[yt],tn=`${bn}px ${Jt.reference.y+It-Xe}px`;return Lt.floating.style.setProperty("--transform-origin",Be&&Ht==="y"&&Un?tn:jn),{}}},m7,A),Ye(()=>{!N&&E&&E.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[N,E]);const De=y.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:ke,elements:ve,x:Ie,y:je,middlewareData:ee,update:me,placement:oe,context:ie,isPositioned:G,floatingStyles:F}=xP({rootContext:E,open:x?N:void 0,placement:le,middleware:Ee,strategy:n,whileElementsMounted:x?void 0:(...lt)=>qC(...lt,De),nodeId:k,externalTree:M}),{sideX:J,sideY:Te}=ee.adaptiveOrigin||Bh,_e=G?n:"fixed",Ve=y.useMemo(()=>{const lt=A?{position:_e,[J]:Ie,[Te]:je}:{position:_e,...F};return G||(lt.opacity=0),lt},[A,_e,J,Ie,Te,je,F,G]),ot=y.useRef(null);Ye(()=>{if(!N)return;const lt=te.current,Lt=typeof lt=="function"?lt():lt,$t=(QC(Lt)?Lt.current:Lt)||null||null;$t!==ot.current&&(ke.setPositionReference($t),ot.current=$t)},[N,ke,Z,te]),y.useEffect(()=>{if(!N)return;const lt=te.current;typeof lt!="function"&&QC(lt)&&lt.current!==ot.current&&(ke.setPositionReference(lt.current),ot.current=lt.current)},[N,ke,Z,te]),y.useEffect(()=>{if(x&&N&&ve.reference&&ve.floating)return qC(ve.reference,ve.floating,me,De)},[x,N,ve,me,De]);const tt=$r(oe),dt=S_(r,tt,V),ut=Aa(oe)||"center",qe=!!ee.hide?.referenceHidden;Ye(()=>{R&&N&&G&&O(tt)},[R,N,G,tt]);const Rt=y.useMemo(()=>({position:"absolute",top:ee.arrow?.y,left:ee.arrow?.x}),[ee.arrow]),jt=ee.arrow?.centerOffset!==0;return y.useMemo(()=>({positionerStyles:Ve,arrowStyles:Rt,arrowRef:de,arrowUncentered:jt,side:dt,align:ut,physicalSide:tt,anchorHidden:qe,refs:ke,context:ie,isPositioned:G,update:me}),[Ve,Rt,de,jt,dt,ut,tt,qe,ke,ie,G,me])}function QC(e){return e!=null&&"current"in e}const C_=y.createContext(void 0);function p7(){const e=y.useContext(C_);if(!e)throw new Error(Dn(59));return e}const Sy=y.forwardRef(function(t,n){const{cutout:r,...s}=t;let a;if(r){const l=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return f.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function om(e,t){e&&Object.assign(e.style,t)}const g7={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function Zm(e){return e==="starting"?d9:fn}function Cy(e,t,{styles:n,transitionStatus:r,props:s,refs:a,hidden:l,inert:u=!1}){const d={...n};return u&&(d.pointerEvents="none"),An("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:l,style:d},Zm(r),s],stateAttributesMapping:uu})}let ZC={},JC={},ew="";function b7(e){if(typeof document>"u")return!1;const t=At(e);return on(t).innerWidth-t.documentElement.clientWidth>0}function x7(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=At(e),r=n.documentElement,s=n.body,a=Mo(r)?r:s,l=a.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const h=a.offsetWidth;return a.style.overflowY=l,r.style.scrollbarGutter=u,d===h}function y7(e){const t=At(e),n=t.documentElement,r=t.body,s=Mo(n)?n:r,a={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,a)}}function v7(e){const t=At(e),n=t.documentElement,r=t.body,s=on(n);let a=0,l=0,u=!1;const d=Hs.create();if(Na&&(s.visualViewport?.scale??1)!==1)return()=>{};function h(){const x=s.getComputedStyle(n),E=s.getComputedStyle(r),S=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,ZC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ew=n.style.scrollBehavior,JC={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const k=n.scrollHeight>n.clientHeight,A=n.scrollWidth>n.clientWidth,R=x.overflowY==="scroll"||E.overflowY==="scroll",M=x.overflowX==="scroll"||E.overflowX==="scroll",_=Math.max(0,s.innerWidth-r.clientWidth),O=Math.max(0,s.innerHeight-r.clientHeight),j=parseFloat(E.marginTop)+parseFloat(E.marginBottom),H=parseFloat(E.marginLeft)+parseFloat(E.marginRight),B=Mo(n)?n:r;if(u=x7(e),u){n.style.scrollbarGutter=S,B.style.overflowY="hidden",B.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(k||R)&&(n.style.overflowY="scroll"),(A||M)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:j||O?`calc(100dvh - ${j+O}px)`:"100dvh",width:H||_?`calc(100vw - ${H+_}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function p(){Object.assign(n.style,ZC),Object.assign(r.style,JC),u||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ew)}function m(){p(),d.request(h)}h();const b=Tt(s,"resize",m);return()=>{d.cancel(),p(),typeof s.removeEventListener=="function"&&b()}}class E7{lockCount=0;restore=null;timeoutLock=Ts.create();timeoutUnlock=Ts.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=At(t).documentElement,s=on(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=Vn;return}const a=Um||!b7(t);this.restore=a?y7(t):v7(t)}}const T7=new E7;function w_(e=!0,t=null){Ye(()=>{if(e)return T7.acquire(t)},[e,t])}const S7=20;function k_(e,t,n,r){const[s,a]=y.useState(!1);Ye(()=>{if(!e||!t||n==null){a(!1);return}const l=At(n).documentElement.clientWidth,u=n.offsetWidth;a(l>0&&u>0&&u>=l-S7)},[e,t,n]),w_(e&&(!t||s),r)}const C7={position:"fixed"},w7=y.forwardRef(function(t,n){const{anchor:r,positionMethod:s="absolute",className:a,render:l,side:u="bottom",align:d="center",sideOffset:h=0,alignOffset:p=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:E=!1,disableAnchorTracking:N,alignItemWithTrigger:C=!0,collisionAvoidance:S=_A,style:k,...A}=t,{store:R,listRef:M,labelsRef:_,alignItemWithTriggerActiveRef:O,selectedItemTextRef:j,valuesRef:H,initialValueRef:B,popupRef:K,setValue:X}=Ia(),Z=u_(),te=ft(R,ct.open),q=ft(R,ct.mounted),z=ft(R,ct.modal),V=ft(R,ct.value),W=ft(R,ct.openMethod),le=ft(R,ct.positionerElement),D=ft(R,ct.triggerElement),P=ft(R,ct.isItemEqualToValue),$=ft(R,ct.transitionStatus),L=y.useRef(null),ae=y.useRef(null),[re,ce]=y.useState(C),de=q&&re&&W!=="touch";!q&&re!==C&&ce(C),Ye(()=>{q||(ct.scrollUpArrowVisible(R.state)&&R.set("scrollUpArrowVisible",!1),ct.scrollDownArrowVisible(R.state)&&R.set("scrollDownArrowVisible",!1))},[R,q]),y.useImperativeHandle(O,()=>de),k_((de||z)&&te,W==="touch",le,D);const fe=Ty({anchor:r,floatingRootContext:Z,positionMethod:s,mounted:q,side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:x,collisionBoundary:m,collisionPadding:b,sticky:E,disableAnchorTracking:N??de,collisionAvoidance:S,keepMounted:!0}),Se=de?"none":fe.side,He=de?C7:fe.positionerStyles,Me={open:te,side:Se,align:fe.align,anchorHidden:fe.anchorHidden};Ye(()=>{R.set("popupSide",fe.side)},[R,fe.side]);const Ee=nt(De=>{R.set("positionerElement",De)}),Oe=Cy(t,Me,{styles:He,transitionStatus:$,props:A,refs:[n,Ee],hidden:!q,inert:!te}),Be=y.useRef(0),Ke=nt(De=>{if(De.size===0&&Be.current===0||H.current.length===0)return;const ke=Be.current;if(Be.current=De.size,De.size===ke)return;const ve=mt(au);if(ke!==0&&!R.state.multiple&&V!==null&&zc(H.current,V,P)===-1){const je=B.current,me=je!=null&&zc(H.current,je,P)!==-1?je:null;X(me,ve),me===null&&(R.set("selectedIndex",null),j.current=null)}if(ke!==0&&R.state.multiple&&Array.isArray(V)){const Ie=ee=>zc(H.current,ee,P)!==-1,je=V.filter(ee=>Ie(ee));(je.length!==V.length||je.some(ee=>!MP(V,ee,P)))&&(X(je,ve),je.length===0&&(R.set("selectedIndex",null),j.current=null))}if(te&&de){R.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ie={height:""};om(le,Ie),om(K.current,Ie)}}),$e=y.useMemo(()=>({...fe,side:Se,alignItemWithTriggerActive:de,setControlledAlignItemWithTrigger:ce,scrollUpArrowRef:L,scrollDownArrowRef:ae}),[fe,Se,de,ce]);return f.jsx(E_,{elementsRef:M,labelsRef:_,onMapChange:Ke,children:f.jsxs(C_.Provider,{value:$e,children:[q&&z&&f.jsx(Sy,{inert:vy(!te),cutout:D}),Oe]})})}),fh="base-ui-disable-scrollbar",tw={className:fh,getElement(e){return f.jsx("style",{nonce:e,href:fh,precedence:"base-ui:low",children:`.${fh}{scrollbar-width:none}.${fh}::-webkit-scrollbar{display:none}`})}},k7=y.createContext(void 0);function N_(e){return y.useContext(k7)}const N7="ArrowUp",A7="ArrowDown",_7="ArrowLeft",R7="ArrowRight",I7="Home",O7="End",M7=new Set([_7,R7]),L7=new Set([N7,A7]),D7=new Set([...M7,...L7]),wy=new Set([...D7,I7,O7]),j7=y.createContext(void 0),P7={disableStyleElements:!1};function B7(){return y.useContext(j7)??P7}const z7={...uu,...lu},U7=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,...u}=t,{store:d,popupRef:h,onOpenChangeComplete:p,setOpen:m,valueRef:b,firstItemTextRef:x,selectedItemTextRef:E,multiple:N,handleScrollArrowVisibility:C,scrollHandlerRef:S,listRef:k,highlightItemOnHover:A}=Ia(),{side:R,align:M,alignItemWithTriggerActive:_,isPositioned:O,setControlledAlignItemWithTrigger:j}=p7(),H=N_()!=null,B=u_(),K=Ey(),{nonce:X,disableStyleElements:Z}=B7(),te=ft(d,ct.id),q=ft(d,ct.open),z=ft(d,ct.openMethod),V=ft(d,ct.mounted),W=ft(d,ct.popupProps),le=ft(d,ct.transitionStatus),D=ft(d,ct.triggerElement),P=ft(d,ct.positionerElement),$=ft(d,ct.listElement),L=y.useRef(!1),ae=y.useRef(!1),re=y.useRef({}),ce=Kl(),de=nt(Me=>{if(!P||!h.current||!ae.current)return;if(L.current||!_){C();return}const Ee=P.style.top==="0px",Oe=P.style.bottom==="0px";if(!Ee&&!Oe){C();return}const Be=rw(P),Ke=Oc(P.getBoundingClientRect().height,"y",Be),$e=At(P),De=on(P),ke=De.getComputedStyle(P),ve=parseFloat(ke.marginTop),Ie=parseFloat(ke.marginBottom),je=nw(De.getComputedStyle(h.current)),ee=Math.min($e.documentElement.clientHeight-ve-Ie,je),me=Me.scrollTop,oe=hh(Me);let ie=0,G=null,F=!1,J=!1;const Te=tt=>{P.style.height=`${tt}px`},_e=(tt,dt)=>{const ut=Ic(tt,0,ee-Ke);ut>0&&Te(Ke+ut),Me.scrollTop=dt,ee-(Ke+ut)<=xi&&(L.current=!0),C()},Ve=Ee?oe-me:me,ot=Math.min(Ke+Ve,ee);if(ie=ot,Ve<=xi){_e(Ve,Ee?oe:0);return}if(ee-ot>xi)Ee?J=!0:G=0;else if(F=!0,Oe&&me<oe){const tt=Ke+Ve-ee;G=me-(Ve-tt)}if(ie=Math.ceil(ie),ie!==0&&Te(ie),J||G!=null){const tt=hh(Me),dt=J?tt:Ic(G,0,tt);Math.abs(Me.scrollTop-dt)>xi&&(Me.scrollTop=dt)}(F||ie>=ee-xi)&&(L.current=!0),C()});y.useImperativeHandle(S,()=>de,[de]),Lo({open:q,ref:h,onComplete(){q&&p?.(!0)}});const fe={open:q,transitionStatus:le,side:R,align:M};Ye(()=>{!P||!h.current||Object.keys(re.current).length||(re.current={top:P.style.top||"0",left:P.style.left||"0",right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[h,P]),Ye(()=>{q||_||(ae.current=!1,L.current=!1,om(P,re.current))},[q,_,P,h]),Ye(()=>{const Me=h.current;if(!q||!D||!P||!Me||_&&!O||d.state.transitionStatus==="ending")return;if(!_){ae.current=!0,ce.request(C),Me.style.removeProperty("--transform-origin");return}const Ee=H7(Me);Me.style.removeProperty("--transform-origin");try{let Oe=E.current;Oe?.isConnected||(Oe=!ct.hasSelectedValue(d.state)&&x.current?.isConnected?x.current:null);const Be=b.current,Ke=on(P),$e=Ke.getComputedStyle(P),De=Ke.getComputedStyle(Me),ke=At(D),ve=rw(D),Ie=mh(D.getBoundingClientRect(),ve),je=mh(P.getBoundingClientRect(),ve),ee=Ie.height,me=$||Me,oe=me.scrollHeight,ie=parseFloat(De.borderBottomWidth),G=parseFloat($e.marginTop)||10,F=parseFloat($e.marginBottom)||10,J=parseFloat($e.minHeight)||100,Te=nw(De),_e=5,Ve=5,ot=20,tt=ke.documentElement.clientHeight-G-F,dt=ke.documentElement.clientWidth,ut=tt-Ie.bottom+ee;let qe,Rt=K==="rtl"?Ie.right-je.width:Ie.left,jt=0;if(Oe&&Be){const vt=mh(Be.getBoundingClientRect(),ve);qe=mh(Oe.getBoundingClientRect(),ve),Rt=je.left+(K==="rtl"?vt.right-qe.right:vt.left-qe.left);const ln=vt.top-Ie.top+vt.height/2;jt=qe.top-je.top+qe.height/2-ln}const lt=ut+jt+F+ie;let Lt=Math.min(tt,lt);const Zt=tt-G-F,$t=lt-Lt,Jt=dt-Ve;P.style.left=`${Ic(Rt,_e,Jt-je.width)}px`,P.style.height=`${Lt}px`,P.style.maxHeight="none",P.style.marginTop=`${G}px`,P.style.marginBottom=`${F}px`,Me.style.height="100%";const Xe=hh(me),yt=$t>=Xe-xi;yt&&(Lt=Math.min(tt,je.height)-($t-Xe));const Ht=Ie.top<ot||Ie.bottom>tt-ot||Math.ceil(Lt)+xi<Math.min(oe,J),en=(Ke.visualViewport?.scale??1)!==1&&Na;if(Ht||en){ae.current=!0,om(P,re.current),j(!1);return}const Kn=Math.max(J,Lt);if(yt){const vt=Math.max(0,tt-lt);P.style.top=je.height>=Zt?"0":`${vt}px`,P.style.height=`${Lt}px`,me.scrollTop=hh(me)}else P.style.bottom="0",me.scrollTop=$t;if(qe){const vt=je.top,ln=je.height,yr=qe.top+qe.height/2,bn=ln>0?(yr-vt)/ln*100:50,Cn=Ic(bn,0,100);Me.style.setProperty("--transform-origin",`50% ${Cn}%`)}(Kn===tt||Lt>=Te)&&(L.current=!0),C(),A&&d.state.selectedIndex===null&&d.state.activeIndex===null&&k.current[0]!=null&&d.set("activeIndex",0),ae.current=!0}finally{Ee()}},[d,q,P,D,b,x,E,h,C,_,j,ce,$,k,A,K,O]),y.useEffect(()=>{if(!_||!P||!q)return;const Me=on(P);function Ee(Oe){m(!1,mt(kj,Oe))}return Tt(Me,"resize",Ee)},[m,_,P,q]);const Se={...$?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":N||void 0,id:`${te}-list`},onKeyDown(Me){H&&wy.has(Me.key)&&Me.stopPropagation()},onScroll(Me){$||de(Me.currentTarget)},..._&&{style:$?{height:"100%"}:g7}},He=An("div",t,{ref:[n,h],state:fe,stateAttributesMapping:z7,props:[W,Se,Zm(le),{className:!$&&_?tw.className:void 0},u]});return f.jsxs(y.Fragment,{children:[!Z&&tw.getElement(X),f.jsx(ry,{context:B,modal:!1,disabled:!V,openInteractionType:z,returnFocus:l,restoreFocus:!0,children:He})]})});function nw(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function hh(e){return x_(e.scrollHeight,e.clientHeight)}function rw(e){return $A.getScale(e)}function Oc(e,t,n){return e/n[t]}function mh(e,t){return ad({x:Oc(e.x,"x",t),y:Oc(e.y,"y",t),width:Oc(e.width,"x",t),height:Oc(e.height,"y",t)})}const sw=[["transform","none"],["scale","1"],["translate","0 0"]];function H7(e){const{style:t}=e,n={};for(const[r,s]of sw)n[r]=t.getPropertyValue(r),t.setProperty(r,s,"important");return()=>{for(const[r]of sw){const s=n[r];s?t.setProperty(r,s):t.removeProperty(r)}}}let A_=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function ky(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:s,index:a}=e,{register:l,unregister:u,subscribeMapChange:d,elementsRef:h,labelsRef:p,nextIndexRef:m}=a7(),b=y.useRef(-1),[x,E]=y.useState(a??(s===A_.GuessFromOrder?()=>{if(b.current===-1){const S=m.current;m.current+=1,b.current=S}return b.current}:-1)),N=y.useRef(null),C=y.useCallback(S=>{if(N.current=S,x!==-1&&S!==null&&(h.current[x]=S,p)){const k=t!==void 0;p.current[x]=k?t:r?.current?.textContent??S.textContent}},[x,h,p,t,r]);return Ye(()=>{if(a!=null)return;const S=N.current;if(S)return l(S,n),()=>{u(S)}},[a,l,u,n]),Ye(()=>{if(a==null)return d(S=>{const k=N.current?S.get(N.current)?.index:null;k!=null&&E(k)})},[a,d,E]),{ref:C,index:x}}const __=y.createContext(void 0);function Ny(){const e=y.useContext(__);if(!e)throw new Error(Dn(57));return e}const F7=y.memo(y.forwardRef(function(t,n){const{render:r,className:s,style:a,value:l=null,label:u,disabled:d=!1,nativeButton:h=!1,...p}=t,m=y.useRef(null),b=ky({label:u,textRef:m,indexGuessBehavior:A_.GuessFromOrder}),{store:x,itemProps:E,setOpen:N,setValue:C,selectionRef:S,typingRef:k,valuesRef:A,multiple:R,selectedItemTextRef:M,disabled:_,readOnly:O}=Ia(),j=ft(x,ct.isActive,b.index),H=ft(x,ct.open),B=ft(x,ct.isSelected,l),K=ft(x,ct.isSelectedByFocus,b.index),X=ft(x,ct.isItemEqualToValue),Z=b.index,te=Z!==-1,q=y.useRef(null);Ye(()=>{if(!te)return;const de=A.current;return de[Z]=l,()=>{delete de[Z]}},[te,Z,l,A]),Ye(()=>{if(!te)return;const de=x.state.value;let fe=de;R&&Array.isArray(de)&&(fe=de.length>0?de[de.length-1]:void 0),fe!==void 0&&ko(l,fe,X)&&(x.set("selectedIndex",Z),m.current&&(M.current=m.current))},[te,Z,R,X,x,l,M]);const z=y.useRef(null),V=y.useRef("mouse"),W=y.useRef(!1),{getButtonProps:le,buttonRef:D}=cu({disabled:d,focusableWhenDisabled:!0,native:h,composite:!0}),P={disabled:d,selected:B,highlighted:j};function $(de){if(_||O)return;const fe=x.state.value;if(R){const Se=Array.isArray(fe)?fe:[],He=B?LP(Se,l,X):[...Se,l];C(He,mt(Pc,de))}else C(l,mt(Pc,de)),N(!1,mt(Pc,de))}function L(){S.current.dragY=0}const ae={role:"option","aria-selected":B,tabIndex:H&&j?0:-1,onKeyDown(de){z.current=de.key,x.set("activeIndex",Z),de.key===" "&&k.current&&de.preventDefault()},onClick(de){const fe=de.type==="click"&&V.current!=="touch",Se=de.nativeEvent.pointerType,He=fe&&Vx(de.nativeEvent)&&(Se!==void 0||j),Me=fe&&!He&&!W.current;W.current=!1,!(de.type==="keydown"&&z.current===null)&&(d||de.type==="keydown"&&z.current===" "&&k.current||Me||(z.current=null,$(de.nativeEvent)))},onPointerEnter(de){V.current=de.pointerType},onPointerMove(de){if(de.pointerType==="mouse"&&de.buttons===1){const fe=S.current;fe.dragY+=de.movementY,fe.dragY**2>=64&&(fe.allowUnselectedMouseUp=!0)}},onPointerDown(de){V.current=de.pointerType,W.current=!0,L()},onMouseUp(){if(L(),d||V.current==="touch"||W.current)return;const de=!S.current.allowSelectedMouseUp&&B,fe=!S.current.allowUnselectedMouseUp&&!B;de||fe||(W.current=!0,q.current?.click(),W.current=!1)}},re=An("div",t,{ref:[D,n,b.ref,q],state:P,props:[E,ae,p,le]}),ce=y.useMemo(()=>({selected:B,index:Z,textRef:m,selectedByFocus:K,hasRegistered:te}),[B,Z,m,K,te]);return f.jsx(__.Provider,{value:ce,children:re})})),$7=y.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:s}=Ny();return r||s?f.jsx(V7,{...t,ref:n}):null}),V7=y.memo(y.forwardRef((e,t)=>{const{render:n,className:r,style:s,keepMounted:a,...l}=e,{selected:u}=Ny(),d=y.useRef(null),{transitionStatus:h,setMounted:p}=ay(u),b=An("span",e,{ref:[t,d],state:{selected:u,transitionStatus:h},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:lu});return Lo({open:u,ref:d,onComplete(){u||p(!1)}}),b})),q7=y.memo(y.forwardRef(function(t,n){const{index:r,textRef:s,selectedByFocus:a,hasRegistered:l}=Ny(),{firstItemTextRef:u,selectedItemTextRef:d}=Ia(),{render:h,className:p,style:m,...b}=t,x=y.useCallback(N=>{N&&(l&&r===0&&(u.current=N),l&&a&&(d.current=N))},[u,d,r,a,l]);return An("div",t,{ref:[x,n,s],props:b})}));/**
67
- * @license lucide-react v1.25.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const R_=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
72
- * @license lucide-react v1.25.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const Y7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
77
- * @license lucide-react v1.25.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const G7=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
82
- * @license lucide-react v1.25.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const iw=e=>{const t=G7(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
87
- * @license lucide-react v1.25.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */var h1={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"};/**
92
- * @license lucide-react v1.25.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const K7=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},X7=y.createContext({}),W7=()=>y.useContext(X7),Q7=y.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...u},d)=>{const{size:h=24,strokeWidth:p=2,absoluteStrokeWidth:m=!1,color:b="currentColor",className:x=""}=W7()??{},E=r??m?Number(n??p)*24/Number(t??h):n??p;return y.createElement("svg",{ref:d,...h1,width:t??h??h1.width,height:t??h??h1.height,stroke:e??b,strokeWidth:E,className:R_("lucide",x,s),...!a&&!K7(u)&&{"aria-hidden":"true"},...u},[...l.map(([N,C])=>y.createElement(N,C)),...Array.isArray(a)?a:[a]])});/**
97
- * @license lucide-react v1.25.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const Ge=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(Q7,{ref:a,iconNode:t,className:R_(`lucide-${Y7(iw(e))}`,`lucide-${e}`,r),...s}));return n.displayName=iw(e),n};/**
102
- * @license lucide-react v1.25.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const Z7=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],J7=Ge("arrow-down",Z7);/**
107
- * @license lucide-react v1.25.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const eB=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],tB=Ge("arrow-up",eB);/**
112
- * @license lucide-react v1.25.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const nB=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],rB=Ge("at-sign",nB);/**
117
- * @license lucide-react v1.25.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const sB=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["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"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],iB=Ge("bell-ring",sB);/**
122
- * @license lucide-react v1.25.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const aB=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],oB=Ge("brain",aB);/**
127
- * @license lucide-react v1.25.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const lB=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],uB=Ge("calendar-clock",lB);/**
132
- * @license lucide-react v1.25.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const cB=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],dB=Ge("chart-pie",cB);/**
137
- * @license lucide-react v1.25.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const fB=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],I_=Ge("check",fB);/**
142
- * @license lucide-react v1.25.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const hB=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],O_=Ge("chevron-down",hB);/**
147
- * @license lucide-react v1.25.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const mB=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],lm=Ge("chevron-left",mB);/**
152
- * @license lucide-react v1.25.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const pB=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ed=Ge("chevron-right",pB);/**
157
- * @license lucide-react v1.25.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const gB=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],bB=Ge("chevrons-up-down",gB);/**
162
- * @license lucide-react v1.25.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const xB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],yB=Ge("circle-alert",xB);/**
167
- * @license lucide-react v1.25.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const vB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]],EB=Ge("circle-arrow-down",vB);/**
172
- * @license lucide-react v1.25.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const TB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],SB=Ge("circle-pause",TB);/**
177
- * @license lucide-react v1.25.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const CB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],wB=Ge("circle-slash",CB);/**
182
- * @license lucide-react v1.25.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const kB=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],NB=Ge("clipboard-list",kB);/**
187
- * @license lucide-react v1.25.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const AB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],aw=Ge("clock",AB);/**
192
- * @license lucide-react v1.25.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const _B=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],M_=Ge("code",_B);/**
197
- * @license lucide-react v1.25.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const RB=[["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"}]],IB=Ge("copy",RB);/**
202
- * @license lucide-react v1.25.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const OB=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],L_=Ge("download",OB);/**
207
- * @license lucide-react v1.25.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const MB=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],LB=Ge("ellipsis",MB);/**
212
- * @license lucide-react v1.25.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const DB=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],jB=Ge("file-diff",DB);/**
217
- * @license lucide-react v1.25.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const PB=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],BB=Ge("file-exclamation-point",PB);/**
222
- * @license lucide-react v1.25.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const zB=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ay=Ge("file-text",zB);/**
227
- * @license lucide-react v1.25.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const UB=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Jm=Ge("file",UB);/**
232
- * @license lucide-react v1.25.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const HB=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],FB=Ge("folder-open",HB);/**
237
- * @license lucide-react v1.25.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const $B=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],VB=Ge("folder-search",$B);/**
242
- * @license lucide-react v1.25.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const qB=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],YB=Ge("folder-tree",qB);/**
247
- * @license lucide-react v1.25.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const GB=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],D_=Ge("folder",GB);/**
252
- * @license lucide-react v1.25.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const KB=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],XB=Ge("funnel",KB);/**
257
- * @license lucide-react v1.25.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const WB=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],QB=Ge("gauge",WB);/**
262
- * @license lucide-react v1.25.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const ZB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ow=Ge("globe",ZB);/**
267
- * @license lucide-react v1.25.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const JB=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],j_=Ge("hand",JB);/**
272
- * @license lucide-react v1.25.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const ez=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],tz=Ge("history",ez);/**
277
- * @license lucide-react v1.25.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const nz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],rz=Ge("image",nz);/**
282
- * @license lucide-react v1.25.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const sz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],iz=Ge("info",sz);/**
287
- * @license lucide-react v1.25.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const az=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],P_=Ge("link-2",az);/**
292
- * @license lucide-react v1.25.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const oz=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],B_=Ge("list-checks",oz);/**
297
- * @license lucide-react v1.25.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const lz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],uz=Ge("loader-circle",lz);/**
302
- * @license lucide-react v1.25.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const cz=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],z_=Ge("message-circle-question-mark",cz);/**
307
- * @license lucide-react v1.25.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const dz=[["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"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],fz=Ge("message-square-text",dz);/**
312
- * @license lucide-react v1.25.0 - ISC
313
- *
314
- * This source code is licensed under the ISC license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */const hz=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],U_=Ge("moon",hz);/**
317
- * @license lucide-react v1.25.0 - ISC
318
- *
319
- * This source code is licensed under the ISC license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */const mz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],_y=Ge("panel-left-close",mz);/**
322
- * @license lucide-react v1.25.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */const pz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Ry=Ge("panel-left-open",pz);/**
327
- * @license lucide-react v1.25.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const gz=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],bz=Ge("paperclip",gz);/**
332
- * @license lucide-react v1.25.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const xz=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["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"}]],yz=Ge("pencil-line",xz);/**
337
- * @license lucide-react v1.25.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const vz=[["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"}]],Ez=Ge("pencil",vz);/**
342
- * @license lucide-react v1.25.0 - ISC
343
- *
344
- * This source code is licensed under the ISC license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */const Tz=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Iy=Ge("plug",Tz);/**
347
- * @license lucide-react v1.25.0 - ISC
348
- *
349
- * This source code is licensed under the ISC license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */const Sz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jo=Ge("plus",Sz);/**
352
- * @license lucide-react v1.25.0 - ISC
353
- *
354
- * This source code is licensed under the ISC license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */const Cz=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],wz=Ge("power-off",Cz);/**
357
- * @license lucide-react v1.25.0 - ISC
358
- *
359
- * This source code is licensed under the ISC license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */const kz=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Nz=Ge("power",kz);/**
362
- * @license lucide-react v1.25.0 - ISC
363
- *
364
- * This source code is licensed under the ISC license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */const Az=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],_z=Ge("puzzle",Az);/**
367
- * @license lucide-react v1.25.0 - ISC
368
- *
369
- * This source code is licensed under the ISC license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */const Rz=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ep=Ge("refresh-cw",Rz);/**
372
- * @license lucide-react v1.25.0 - ISC
373
- *
374
- * This source code is licensed under the ISC license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */const Iz=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Oz=Ge("rotate-ccw",Iz);/**
377
- * @license lucide-react v1.25.0 - ISC
378
- *
379
- * This source code is licensed under the ISC license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */const Mz=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Oy=Ge("rotate-cw",Mz);/**
382
- * @license lucide-react v1.25.0 - ISC
383
- *
384
- * This source code is licensed under the ISC license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */const Lz=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Dz=Ge("save",Lz);/**
387
- * @license lucide-react v1.25.0 - ISC
388
- *
389
- * This source code is licensed under the ISC license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */const jz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tp=Ge("search",jz);/**
392
- * @license lucide-react v1.25.0 - ISC
393
- *
394
- * This source code is licensed under the ISC license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */const Pz=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Bz=Ge("settings",Pz);/**
397
- * @license lucide-react v1.25.0 - ISC
398
- *
399
- * This source code is licensed under the ISC license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */const zz=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Uz=Ge("shield-check",zz);/**
402
- * @license lucide-react v1.25.0 - ISC
403
- *
404
- * This source code is licensed under the ISC license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */const Hz=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],np=Ge("sparkles",Hz);/**
407
- * @license lucide-react v1.25.0 - ISC
408
- *
409
- * This source code is licensed under the ISC license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */const Fz=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],$z=Ge("square-check-big",Fz);/**
412
- * @license lucide-react v1.25.0 - ISC
413
- *
414
- * This source code is licensed under the ISC license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */const Vz=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],qz=Ge("square-pen",Vz);/**
417
- * @license lucide-react v1.25.0 - ISC
418
- *
419
- * This source code is licensed under the ISC license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */const Yz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],Gz=Ge("square-slash",Yz);/**
422
- * @license lucide-react v1.25.0 - ISC
423
- *
424
- * This source code is licensed under the ISC license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */const Kz=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Xz=Ge("square-terminal",Kz);/**
427
- * @license lucide-react v1.25.0 - ISC
428
- *
429
- * This source code is licensed under the ISC license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */const Wz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Qz=Ge("square",Wz);/**
432
- * @license lucide-react v1.25.0 - ISC
433
- *
434
- * This source code is licensed under the ISC license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */const Zz=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Jz=Ge("sun",Zz);/**
437
- * @license lucide-react v1.25.0 - ISC
438
- *
439
- * This source code is licensed under the ISC license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */const eU=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ab=Ge("terminal",eU);/**
442
- * @license lucide-react v1.25.0 - ISC
443
- *
444
- * This source code is licensed under the ISC license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */const tU=[["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"}]],Td=Ge("trash-2",tU);/**
447
- * @license lucide-react v1.25.0 - ISC
448
- *
449
- * This source code is licensed under the ISC license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */const nU=[["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"}]],$l=Ge("triangle-alert",nU);/**
452
- * @license lucide-react v1.25.0 - ISC
453
- *
454
- * This source code is licensed under the ISC license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */const rU=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],My=Ge("users-round",rU);/**
457
- * @license lucide-react v1.25.0 - ISC
458
- *
459
- * This source code is licensed under the ISC license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */const sU=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],iU=Ge("wifi-off",sU);/**
462
- * @license lucide-react v1.25.0 - ISC
463
- *
464
- * This source code is licensed under the ISC license.
465
- * See the LICENSE file in the root directory of this source tree.
466
- */const aU=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],oU=Ge("wrench",aU);/**
467
- * @license lucide-react v1.25.0 - ISC
468
- *
469
- * This source code is licensed under the ISC license.
470
- * See the LICENSE file in the root directory of this source tree.
471
- */const lU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ss=Ge("x",lU);/**
472
- * @license lucide-react v1.25.0 - ISC
473
- *
474
- * This source code is licensed under the ISC license.
475
- * See the LICENSE file in the root directory of this source tree.
476
- */const uU=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],cU=Ge("zap",uU),Ys=FP,Gs=n7,Cs=q7,Ks=({className:e,children:t,...n})=>f.jsxs(e7,{"data-slot":"select-trigger",className:xe("inline-flex h-7 items-center justify-between gap-1.5 rounded-md border border-border bg-bg px-2 text-body-sm text-text","transition-colors outline-none hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","data-popup-open:border-border-strong disabled:pointer-events-none disabled:opacity-50",e),...n,children:[t,f.jsx(r7,{className:"text-fg-4",children:f.jsx(bB,{className:"size-3.5"})})]}),Xs=({className:e,align:t="start",alignItemWithTrigger:n=!1,side:r="bottom",sideOffset:s=6,...a})=>f.jsx(i7,{children:f.jsx(w7,{align:t,alignItemWithTrigger:n,side:r,sideOffset:s,className:"isolate z-80 outline-none",children:f.jsx(U7,{"data-slot":"select-content",className:xe("max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto","rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none",e),...a})})}),ws=({className:e,children:t,...n})=>f.jsxs(F7,{"data-slot":"select-item",className:xe("flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1.5 text-body-sm text-text outline-none select-none","data-highlighted:bg-surface-hover",e),...n,children:[f.jsx("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:t}),f.jsx($7,{className:"mt-0.5 text-fg-1",children:f.jsx(I_,{className:"size-3.5"})})]});function dU(e){const{store:t,actionsRef:n}=e,r=t.useState("open");pP(t,r),uy(t);const{forceUnmount:s}=cy(r,t),a=y.useCallback(()=>{t.setOpen(!1,mt(Yx))},[t]);y.useImperativeHandle(n,()=>({unmount:s,close:a}),[s,a])}function fU({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),a=e.useState("modal"),l=e.useState("popupElement"),u=e.useState("floatingRootContext"),[d,h]=y.useState(0),[p,m]=y.useState(0),b=d===0,x=Gm(u,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(S){if(!e.context.outsidePressEnabledRef.current||"button"in S&&S.button!==0||"touches"in S&&S.touches.length!==1)return!1;const k=pr(S);return b&&!s?a&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===k||e.context.backdropRef.current===k||rt(k,l)&&!k?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:b});w_(r&&a===!0,l),e.useContextCallback("onNestedDialogOpen",(S,k)=>{h(S),m(k)}),e.useContextCallback("onNestedDialogClose",()=>{h(0),m(0)}),y.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(d+1,p+(n?1:0)),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[n,r,d,p,t]);const E=x.reference??fn,N=x.trigger??fn,C=x.floating??fn;return dy(e,{activeTriggerProps:E,inactiveTriggerProps:N,popupProps:C,nestedOpenDialogCount:d,nestedOpenDrawerCount:p}),null}const H_=y.createContext(!1),F_=y.createContext(void 0);function Oa(e){const t=y.useContext(F_);if(e===!1&&t===void 0)throw new Error(Dn(27));return t}const hU={...my,modal:ze(e=>e.modal),nested:ze(e=>e.nested),nestedOpenDialogCount:ze(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:ze(e=>e.nestedOpenDrawerCount),disablePointerDismissal:ze(e=>e.disablePointerDismissal),openMethod:ze(e=>e.openMethod),descriptionElementId:ze(e=>e.descriptionElementId),titleElementId:ze(e=>e.titleElementId),viewportElement:ze(e=>e.viewportElement),role:ze(e=>e.role)};class Ly extends Dm{constructor(t,n,r=!1){const s=new vd,a=mU(t);a.floatingRootContext=QA(s,n,r),super(a,{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:s,onOpenChange:void 0,onOpenChangeComplete:void 0},hU)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};oy(r,t,n.trigger),this.update(r)};static useStore(t,n){return KA(t,(s,a)=>new Ly(n,s,a),!0).store}}function mU(e={}){return{...fy(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function $_(e,t="dialog"){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:a,onOpenChangeComplete:l,disablePointerDismissal:u=!1,modal:d=!0,actionsRef:h,handle:p,triggerId:m,defaultTriggerId:b=null}=e,x=t==="drawer",E=t==="alert-dialog",N=E?!0:d,C=E||u,S=E?"alertdialog":"dialog",k=Oa(!0),R={modal:N,disablePointerDismissal:C,nested:!!k,role:S},M=Ly.useStore(p?.store,{open:s,openProp:r,activeTriggerId:b,triggerIdProp:m,...R});Lx(()=>{const K=r===void 0&&M.state.open===!1&&s===!0?{open:!0,activeTriggerId:b}:null;E?M.update(K?{...R,...K}:R):K&&M.update(K)}),M.useControlledProp("openProp",r),M.useControlledProp("triggerIdProp",m),M.useSyncedValues(R),M.useContextCallback("onOpenChange",a),M.useContextCallback("onOpenChangeComplete",l);const _=M.useState("open"),O=M.useState("mounted"),j=M.useState("payload");dU({store:M,actionsRef:h});const H=_||O,B=y.useMemo(()=>({store:M}),[M]);return f.jsx(H_.Provider,{value:!1,children:f.jsxs(F_.Provider,{value:B,children:[H&&f.jsx(fU,{store:M,parentContext:k?.store.context,isDrawer:x}),typeof n=="function"?n({payload:j}):n]})})}function pU(e){return $_(e,"alert-dialog")}const gU={...uu,...lu},V_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,forceRender:l=!1,...u}=t,{store:d}=Oa(),h=d.useState("open"),p=d.useState("nested"),m=d.useState("mounted"),b=d.useState("transitionStatus");return An("div",t,{state:{open:h,transitionStatus:b},ref:[d.context.backdropRef,n],stateAttributesMapping:gU,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:l||!p})}),q_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,...d}=t,{store:h}=Oa(),p=h.useState("open"),{getButtonProps:m,buttonRef:b}=cu({disabled:l,native:u}),x={disabled:l};function E(N){p&&h.setOpen(!1,mt(Cj,N.nativeEvent))}return An("button",t,{state:x,ref:[n,b],props:[{onClick:E},d,m]})}),Y_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:l,...u}=t,{store:d}=Oa(),h=Do(l);return d.useSyncedValueWithCleanup("descriptionElementId",h),An("p",t,{ref:n,props:[{id:h},u]})});let bU=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),xU=(function(e){return e[e.open=fo.open]="open",e[e.closed=fo.closed]="closed",e[e.startingStyle=fo.startingStyle]="startingStyle",e[e.endingStyle=fo.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const G_=y.createContext(void 0);function yU(){const e=y.useContext(G_);if(e===void 0)throw new Error(Dn(26));return e}const vU={...uu,...lu,nestedDialogOpen(e){return e?{[xU.nestedDialogOpen]:""}:null}},K_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,initialFocus:u,...d}=t,{store:h}=Oa(),p=h.useState("descriptionElementId"),m=h.useState("disablePointerDismissal"),b=h.useState("floatingRootContext"),x=h.useState("popupProps"),E=h.useState("modal"),N=h.useState("mounted"),C=h.useState("nested"),S=h.useState("nestedOpenDialogCount"),k=h.useState("open"),A=h.useState("openMethod"),R=h.useState("titleElementId"),M=h.useState("transitionStatus"),_=h.useState("role"),O=b.useState("floatingId"),j=d.id??O;yU(),Lo({open:k,ref:h.context.popupRef,onComplete(){k&&h.context.onOpenChangeComplete?.(!0)}});const H=u===void 0?fP(h.context.popupRef):u,B=S>0,K=h.useStateSetter("popupElement"),Z=An("div",t,{state:{open:k,nested:C,transitionStatus:M,nestedDialogOpen:B},props:[x,{id:j,"aria-labelledby":R??void 0,"aria-describedby":p??void 0,role:_,...Wm,hidden:!N,onKeyDown(te){wy.has(te.key)&&te.stopPropagation()},style:{[bU.nestedDialogs]:S}},d],ref:[n,h.context.popupRef,K],stateAttributesMapping:vU});return f.jsx(ry,{context:b,openInteractionType:A,disabled:!N,closeOnFocusOut:!m,initialFocus:H,returnFocus:l,modal:E!==!1,restoreFocus:"popup",children:Z})}),X_=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=Oa(),l=a.useState("mounted"),u=a.useState("modal"),d=a.useState("open");return l||r?f.jsx(G_.Provider,{value:r,children:f.jsxs(ey,{ref:n,...s,children:[l&&u===!0&&f.jsx(Sy,{ref:a.context.internalBackdropRef,inert:vy(!d)}),t.children]})}):null}),W_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:l,...u}=t,{store:d}=Oa(),h=Do(l);return d.useSyncedValueWithCleanup("titleElementId",h),An("h2",t,{ref:n,props:[{id:h},u]})}),EU=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,id:d,payload:h,handle:p,...m}=t,b=Oa(!0),x=p?.store??b?.store;if(!x)throw new Error(Dn(79));const E=Do(d),N=x.useState("floatingRootContext"),C=x.useState("isOpenedByTrigger",E),S=x.useState("triggerPopupId",E),k=y.useRef(null),{registerTrigger:A,isMountedByThisTrigger:R}=ly(E,k,x,{payload:h}),{getButtonProps:M,buttonRef:_}=cu({disabled:l,native:u}),O=sy(N,{enabled:N!=null}),j=g_(()=>x.select("open"),K=>{x.set("openMethod",K)}),H={disabled:l,open:C},B=x.useState("triggerProps",R);return An("button",t,{state:H,ref:[_,n,A,k],props:[O.reference,B,j,{[AA]:"",id:E,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":S},m,M],stateAttributesMapping:xy})}),TU=EU,SU=pU,CU=TU,wU=q_,kU=({className:e,children:t,...n})=>f.jsxs(X_,{children:[f.jsx(V_,{className:xe("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),f.jsx(K_,{"data-slot":"alert-dialog-content",className:xe("fixed top-1/2 left-1/2 z-70 w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2","rounded-lg border border-border bg-surface p-5 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...n,children:t})]}),NU=({className:e,...t})=>f.jsx(W_,{className:xe("text-heading-3 font-semibold text-text",e),...t}),AU=({className:e,...t})=>f.jsx(Y_,{className:xe("mt-1.5 text-body-sm text-muted-foreground",e),...t}),Q_=y.createContext(void 0);function Z_(e){const t=y.useContext(Q_);if(t===void 0&&!e)throw new Error(Dn(33));return t}const J_=y.createContext(void 0);function Po(e){const t=y.useContext(J_);if(t===void 0&&!e)throw new Error(Dn(36));return t}const _U=y.createContext(void 0);function rp(e=!0){const t=y.useContext(_U);if(t===void 0&&!e)throw new Error(Dn(25));return t}function RU(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:s,store:a,typingRef:l,itemRef:u,itemMetadata:d}=e,{events:h}=a.useState("floatingTreeRoot"),p=a.useState("open"),m=rp(!0),b=m!==void 0;return y.useMemo(()=>({id:r,role:"menuitem",tabIndex:p&&n?0:-1,onKeyDown(x){x.key===" "&&l?.current&&x.preventDefault()},onMouseMove(x){s&&h.emit("itemhover",{nodeId:s,target:x.currentTarget})},onClick(x){t&&h.emit("close",{domEvent:x,reason:Pc})},onMouseUp(x){if(m){const E=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,b&&E&&Math.abs(x.clientX-E.x)<=1&&Math.abs(x.clientY-E.y)<=1||b&&!Fx&&x.button===2)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!b||x.button===2)&&(!d||d.type==="regular-item")&&u.current.click()}}),[t,n,r,h,s,p,a,l,u,m,b,d])}const IU={type:"regular-item"};function OU(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:s,store:a,typingRef:l=a.context.typingRef,nativeButton:u,itemMetadata:d,nodeId:h}=e,p=a.useState("disabled"),m=n||p,b=y.useRef(null),{getButtonProps:x,buttonRef:E}=cu({disabled:m,focusableWhenDisabled:!0,native:u,composite:!0}),N=RU({closeOnClick:t,highlighted:r,id:s,nodeId:h,store:a,typingRef:l,itemRef:b,itemMetadata:d}),C=y.useCallback(k=>Ir(N,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()}},k,x),[N,x,d]),S=Eo(b,E);return y.useMemo(()=>({getItemProps:C,itemRef:S}),[C,S])}const MU=y.forwardRef(function(t,n){const{render:r,className:s,id:a,label:l,nativeButton:u=!1,disabled:d=!1,closeOnClick:h=!0,style:p,...m}=t,b=ky({label:l}),x=Z_(!0),E=Do(a),{store:N}=Po(),C=N.useState("isActive",b.index),S=N.useState("itemProps"),{getItemProps:k,itemRef:A}=OU({closeOnClick:h,disabled:d,highlighted:C,id:E,store:N,nativeButton:u,nodeId:x?.context.nodeId,itemMetadata:IU});return An("div",t,{state:{disabled:d,highlighted:C},props:[S,m,k],ref:[A,n,b.ref]})}),LU={...uu,...lu},DU=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,...u}=t,{store:d}=Po(),{side:h,align:p}=Z_(),m=N_()!=null,b=d.useState("open"),x=d.useState("transitionStatus"),E=d.useState("popupProps"),N=d.useState("mounted"),C=d.useState("instantType"),S=d.useState("activeTriggerElement"),k=d.useState("parent"),A=d.useState("lastOpenChangeReason"),R=d.useState("rootId"),M=d.useState("floatingRootContext"),_=d.useState("floatingTreeRoot"),O=d.useState("closeDelay"),j=d.useState("activeTriggerElement"),H=d.useState("hoverEnabled"),B=d.useState("disabled"),K=d.useState("openMethod"),X=k.type==="context-menu";Lo({open:b,ref:d.context.popupRef,onComplete(){b&&d.context.onOpenChangeComplete?.(!0)}}),y.useEffect(()=>{function V(W){d.setOpen(!1,mt(W.reason,W.domEvent))}return _.events.on("close",V),()=>{_.events.off("close",V)}},[_.events,d]),n_(M,{enabled:H&&!B&&!X&&k.type!=="menubar",closeDelay:O});const Z=y.useCallback(V=>{d.set("popupElement",V)},[d]),te={transitionStatus:x,side:h,align:p,open:b,nested:k.type==="menu",instant:C},q=An("div",t,{state:te,ref:[n,d.context.popupRef,Z],stateAttributesMapping:LU,props:[E,{onKeyDown(V){m&&wy.has(V.key)&&V.stopPropagation()}},Zm(x),u,{"data-rootownerid":R}]});let z=k.type===void 0||X;return(S||k.type==="menubar"&&A!==Vm)&&(z=!0),f.jsx(ry,{context:M,openInteractionType:K,modal:X,disabled:!N,returnFocus:l===void 0?z:l,initialFocus:k.type!=="menu",restoreFocus:!0,externalTree:k.type!=="menubar"?_:void 0,previousFocusableElement:j,nextFocusableElement:k.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:k.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:q})}),eR=y.createContext(void 0);function jU(){const e=y.useContext(eR);if(e===void 0)throw new Error(Dn(32));return e}const PU=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=Po();return a.useState("mounted")||r?f.jsx(eR.Provider,{value:r,children:f.jsx(ey,{ref:n,...s})}):null}),BU=y.forwardRef(function(t,n){const{anchor:r,positionMethod:s="absolute",className:a,render:l,side:u,align:d,sideOffset:h=0,alignOffset:p=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:E=!1,disableAnchorTracking:N=!1,collisionAvoidance:C=_A,style:S,...k}=t,{store:A}=Po(),R=jU(),M=rp(!0),_=A.useState("parent"),O=A.useState("floatingRootContext"),j=A.useState("floatingTreeRoot"),H=A.useState("mounted"),B=A.useState("open"),K=A.useState("modal"),X=A.useState("openMethod"),Z=A.useState("activeTriggerElement"),te=A.useState("transitionStatus"),q=A.useState("positionerElement"),z=A.useState("instantType"),V=A.useState("hasViewport"),W=A.useState("lastOpenChangeReason"),le=A.useState("floatingNodeId"),D=A.useState("floatingParentNodeId"),P=O.useState("domReferenceElement"),$=y.useRef(null),L=GA(q,!1,!1);let ae=r,re=h,ce=p,de=d,fe=C;_.type==="context-menu"&&(ae=r??_.context?.anchor,de=de??"start",!u&&de!=="center"&&(ce=t.alignOffset??2,re=t.sideOffset??-5));let Se=u,He=de;_.type==="menu"?(Se=Se??"inline-end",He=He??"start",fe=t.collisionAvoidance??RA):_.type==="menubar"&&(Se=Se??(_.context.orientation==="vertical"?"inline-end":"bottom"),He=He??"start");const Me=_.type==="context-menu",Ee=Ty({anchor:ae,floatingRootContext:O,positionMethod:M?"fixed":s,mounted:H,side:Se,sideOffset:re,align:He,alignOffset:ce,arrowPadding:Me?0:x,collisionBoundary:m,collisionPadding:b,sticky:E,nodeId:le,keepMounted:R,disableAnchorTracking:N,collisionAvoidance:fe,shiftCrossAxis:Me&&!("side"in fe&&fe.side==="flip"),externalTree:j,adaptiveOrigin:V?T_:void 0});y.useEffect(()=>{function Ie(je){je.open&&(je.parentNodeId===le&&A.set("hoverEnabled",!1),je.nodeId!==le&&je.parentNodeId===A.select("floatingParentNodeId")&&A.setOpen(!1,mt(Ac)))}return j.events.on("menuopenchange",Ie),()=>{j.events.off("menuopenchange",Ie)}},[A,j.events,le]),y.useEffect(()=>{if(A.select("floatingParentNodeId")==null)return;function Ie(je){if(je.open||je.nodeId!==A.select("floatingParentNodeId"))return;const ee=je.reason??Ac;A.setOpen(!1,mt(ee))}return j.events.on("menuopenchange",Ie),()=>{j.events.off("menuopenchange",Ie)}},[j.events,A]);const Oe=Gn();y.useEffect(()=>{B||Oe.clear()},[B,Oe]),y.useEffect(()=>{function Ie(je){if(!(!B||je.nodeId!==A.select("floatingParentNodeId")))if(je.target&&Z&&Z!==je.target){const ee=A.select("closeDelay");ee>0?Oe.isStarted()||Oe.start(ee,()=>{A.setOpen(!1,mt(Ac))}):A.setOpen(!1,mt(Ac))}else Oe.clear()}return j.events.on("itemhover",Ie),()=>{j.events.off("itemhover",Ie)}},[j.events,B,Z,A,Oe]),y.useEffect(()=>{const Ie={open:B,nodeId:le,parentNodeId:D,reason:A.select("lastOpenChangeReason")};j.events.emit("menuopenchange",Ie)},[j.events,B,A,le,D]),Ye(()=>{const Ie=P,je=$.current;if(Ie&&($.current=Ie),je&&Ie&&Ie!==je){A.set("instantType",void 0);const ee=new AbortController;return L(()=>{A.set("instantType","trigger-change")},ee.signal),()=>{ee.abort()}}},[P,L,A]);const Be={open:B,side:Ee.side,align:Ee.align,anchorHidden:Ee.anchorHidden,nested:_.type==="menu",instant:z},Ke=_.type==="menubar"&&_.context.modal;k_(B&&(Ke||K&&W!==qn),X==="touch",q,Z);const De=Cy(t,Be,{styles:Ee.positionerStyles,transitionStatus:te,props:k,refs:[n,A.useStateSetter("positionerElement")],hidden:!H,inert:!B}),ke=H&&_.type!=="menu"&&(_.type!=="menubar"&&K&&W!==qn||_.type==="menubar"&&_.context.modal);let ve=null;return _.type==="menubar"?ve=_.context.contentElement:_.type===void 0&&(ve=Z),f.jsxs(Q_.Provider,{value:Ee,children:[ke&&f.jsx(Sy,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:vy(!B),cutout:ve}),f.jsx(m9,{id:le,children:f.jsx(E_,{elementsRef:A.context.itemDomElements,labelsRef:A.context.itemLabels,children:De})})]})}),zU=y.createContext(null);function tR(e){return y.useContext(zU)}const UU={...my,disabled:ze(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:ze(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:ze(e=>e.openMethod),allowMouseEnter:ze(e=>e.allowMouseEnter),highlightItemOnHover:ze(e=>e.highlightItemOnHover),stickIfOpen:ze(e=>e.stickIfOpen),parent:ze(e=>e.parent),rootId:ze(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:ze(e=>e.activeIndex),isActive:ze((e,t)=>e.activeIndex===t),hoverEnabled:ze(e=>e.hoverEnabled),instantType:ze(e=>e.instantType),lastOpenChangeReason:ze(e=>e.openChangeReason),floatingTreeRoot:ze(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:ze(e=>e.floatingNodeId),floatingParentNodeId:ze(e=>e.floatingParentNodeId),itemProps:ze(e=>e.itemProps),closeDelay:ze(e=>e.closeDelay),hasViewport:ze(e=>e.hasViewport),keyboardEventRelay:ze(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Dy extends Dm{constructor(t){super({...HU(),...t},{positionerRef:y.createRef(),popupRef:y.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:y.createRef(),beforeContentFocusGuardRef:y.createRef(),onOpenChangeComplete:void 0,triggerElements:new vd},UU),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),s=n.store.select("floatingTreeRoot"),a=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const l=n.store.select("rootId"),u=n.store.select("floatingTreeRoot"),d=n.store.select("keyboardEventRelay");r===l&&s===u&&a===d||(r=l,s=u,a=d,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const r=br(()=>new Dy(n)).current;return t??r}unsubscribeParentListener=null}function HU(){return{...fy(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ty,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:fn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const FU=y.createContext(void 0);function $U(){return y.useContext(FU)}const VU=Px(function(t){const{children:n,open:r,onOpenChange:s,onOpenChangeComplete:a,defaultOpen:l=!1,disabled:u=!1,modal:d,loopFocus:h=!0,orientation:p="vertical",actionsRef:m,closeParentOnEsc:b=!1,handle:x,triggerId:E,defaultTriggerId:N=null,highlightItemOnHover:C=!0}=t,S=rp(!0),k=Po(!0),A=tR(!0),R=$U(),M=y.useMemo(()=>R&&k?{type:"menu",store:k.store}:A?{type:"menubar",context:A}:S&&!k?{type:"context-menu",context:S}:{type:void 0},[S,k,A,R]),_=Dy.useStore(x?.store,{open:l,openProp:r,activeTriggerId:N,triggerIdProp:E,parent:M});WA(_,r,l,N),_.useControlledProp("openProp",r),_.useControlledProp("triggerIdProp",E),_.useContextCallback("onOpenChangeComplete",a);const O=Co(),j=Co(),H=_.useState("floatingTreeRoot"),B=PA(H),K=_a(),X=_.useState("open"),Z=_.useState("activeTriggerElement"),te=_.useState("positionerElement"),q=_.useState("hoverEnabled"),z=_.useState("disabled"),V=_.useState("lastOpenChangeReason"),W=_.useState("parent"),le=_.useState("activeIndex"),D=_.useState("payload"),P=_.useState("floatingParentNodeId"),$=y.useRef(null),L=y.useRef(W.type!=="context-menu"),ae=Gn(),re=y.useRef(!0),ce=Gn(),de=P!=null,{openMethod:fe,triggerProps:Se}=b_(X);_.useSyncedValues({disabled:u,highlightItemOnHover:C,modal:W.type===void 0?d:void 0,openMethod:fe,rootId:O}),uy(_);const{forceUnmount:He}=cy(X,_,()=>{_.update({allowMouseEnter:!1,stickIfOpen:!0})});Ye(()=>{S&&!k?_.update({parent:{type:"context-menu",context:S},floatingNodeId:B,floatingParentNodeId:K}):k&&_.update({floatingNodeId:B,floatingParentNodeId:K})},[S,k,B,K,_]),y.useEffect(()=>{if(X||($.current=null),W.type==="context-menu"){if(!X){ae.clear(),L.current=!1;return}ae.start(500,()=>{L.current=!0})}},[ae,X,W.type]),Ye(()=>{!X&&!q&&_.set("hoverEnabled",!0)},[X,q,_]);const Me=nt((J,Te)=>{const _e=Te.reason;if(X===J&&Te.trigger===Z&&V===_e)return;const Ve=XA(Te);if(!J&&Te.trigger==null&&(Te.trigger=Z??void 0),s?.(J,Te),Te.isCanceled)return;_.state.floatingRootContext.dispatchOpenChange(J,Te);const ot=Te.event;if(J===!1&&ot?.type==="click"&&ot.pointerType==="touch"&&!re.current)return;J&&_e===Ul?(re.current=!1,ce.start(300,()=>{re.current=!0})):(re.current=!0,ce.clear());const tt=(_e===ou||_e===Pc)&&ot.detail===0&&ot?.isTrusted,dt=!J&&(_e===qm||_e==null),ut={open:J,openChangeReason:_e};$.current=Te.event??null,oy(ut,J,Te.trigger,Ve()),_.update(ut),W.type==="menubar"&&(_e===Ul||_e===So||_e===qn||_e===Eb||_e===Ac)?_.set("instantType","group"):tt||dt?_.set("instantType",tt?"click":"dismiss"):_.set("instantType",void 0)}),Ee=YA({popupStore:_,floatingId:j,nested:K!=null,onOpenChange:Me}),Oe=Ee.context.events;y.useEffect(()=>{const J=({open:Te,eventDetails:_e})=>Me(Te,_e);return Oe.on("setOpen",J),()=>{Oe?.off("setOpen",J)}},[Oe,Me]);const Be=y.useCallback(()=>{_.setOpen(!1,mt(Yx))},[_]);y.useImperativeHandle(m,()=>({unmount:He,close:Be}),[He,Be]);let Ke;W.type==="context-menu"&&(Ke=W.context),y.useImperativeHandle(Ke?.positionerRef,()=>te,[te]),y.useImperativeHandle(Ke?.actionsRef,()=>({setOpen:Me}),[Me]);const $e=Gm(Ee,{enabled:!z,bubbles:{escapeKey:b&&W.type==="menu"},outsidePress(){return W.type!=="context-menu"||$.current?.type==="contextmenu"?!0:L.current},externalTree:de?H:void 0}),De=Ey(),ke=y.useCallback(J=>{_.select("activeIndex")!==J&&_.set("activeIndex",J)},[_]),ve=s_(Ee,{enabled:!z,listRef:_.context.itemDomElements,activeIndex:le,nested:W.type!==void 0,loopFocus:h,orientation:p,parentOrientation:W.type==="menubar"?W.context.orientation:void 0,rtl:De==="rtl",disabledIndices:Yl,onNavigate:ke,openOnArrowKeyDown:W.type!=="context-menu",externalTree:de?H:void 0,focusItemOnHover:C}),Ie=y.useCallback(J=>{_.context.typingRef.current=J},[_]),je=i_(Ee,{enabled:!z,listRef:_.context.itemLabels,elementsRef:_.context.itemDomElements,activeIndex:le,resetMs:u9,onMatch:J=>{X&&J!==le&&_.set("activeIndex",J)},onTyping:Ie}),ee=y.useMemo(()=>{const J=Ir(je.reference,ve.reference,$e.reference,{onMouseMove(){_.set("allowMouseEnter",!0)}},Se);return J["aria-haspopup"]="menu",J["aria-expanded"]=X,J},[_,je.reference,ve.reference,$e.reference,Se,X]),me=y.useMemo(()=>{const J=Ir(ve.trigger,$e.trigger,Se);return J["aria-haspopup"]="menu",J["aria-expanded"]=!1,J},[ve.trigger,$e.trigger,Se]),oe=y.useMemo(()=>Ir(Wm,{id:j,role:"menu","aria-labelledby":Z?.id,onMouseMove(){_.set("allowMouseEnter",!0),W.type==="menu"&&_.set("hoverEnabled",!1)},onClick(){_.select("hoverEnabled")&&_.set("hoverEnabled",!1)},onKeyDown(J){const Te=_.select("keyboardEventRelay");Te&&!J.isPropagationStopped()&&Te(J)}},je.floating,ve.floating,$e.floating),[Z,j,W.type,_,je.floating,ve.floating,$e.floating]),ie=ve.item??fn;dy(_,{floatingRootContext:Ee,activeTriggerProps:ee,inactiveTriggerProps:me,popupProps:oe,itemProps:ie});const G=y.useMemo(()=>({store:_,parent:M}),[_,M]),F=f.jsx(J_.Provider,{value:G,children:typeof n=="function"?n({payload:D}):n});return W.type===void 0||W.type==="context-menu"?f.jsx(p9,{externalTree:H,children:F}):F});function qU(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=yy(),{ref:s,index:a}=ky(e),l=n===a,u=y.useRef(null),d=Eo(s,u);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(a)},onMouseMove(){const p=u.current;if(!t||!p)return;const m=p.hasAttribute("disabled")||p.ariaDisabled==="true";!l&&!m&&p.focus()}},compositeRef:d,index:a}}function YU(e){const{render:t,className:n,style:r,state:s=fn,props:a=Yl,refs:l=Yl,metadata:u,stateAttributesMapping:d,tag:h="div",...p}=e,{compositeProps:m,compositeRef:b}=qU({metadata:u});return An(h,e,{state:s,ref:[...l,b],props:[m,...a,p],stateAttributesMapping:d})}function nR(e){if(dn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Ai(e))return nR(Ii(e))}function GU(e,t){const n=y.useRef(null);function r(a){or.flushSync(()=>{e.setOpen(!1,mt(So,a.nativeEvent,a.currentTarget))}),Yj(n.current)?.focus()}function s(a){const l=e.select("positionerElement");if(l&&Hl(a,l))e.context.beforeContentFocusGuardRef.current?.focus();else{or.flushSync(()=>{e.setOpen(!1,mt(So,a.nativeEvent,a.currentTarget))});let u=qj(e.context.triggerFocusTargetRef.current||t.current);for(;u!==null&&rt(l,u);){const d=u;if(u=Qx(u),u===d)break}u?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function KU(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,s=y.useRef(!1);return y.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(s.current=!0,At(a.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:a=>{s.current&&(s.current=!1,a.preventBaseUIHandler())}}:fn,[t,n,r])}const ph=2,XU=eA(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,id:d,openOnHover:h,delay:p=100,closeDelay:m=0,handle:b,payload:x,...E}=t,N=Po(!0),C=b?.store??N?.store;if(!C)throw new Error(Dn(85));const S=Do(d),k=C.useState("isTriggerActive",S),A=C.useState("floatingRootContext"),R=C.useState("isOpenedByTrigger",S),M=C.useState("triggerPopupId",S),_=y.useRef(null),O=QU(),j=yy(!0),H=Ra(),B=y.useMemo(()=>H??new ty,[H]),K=PA(B),X=_a(),{registerTrigger:Z,isMountedByThisTrigger:te}=ly(S,_,C,{payload:x,closeDelay:m,parent:O,floatingTreeRoot:B,floatingNodeId:K,floatingParentNodeId:X,keyboardEventRelay:j?.relayKeyboardEvent}),q=O.type==="menubar",z=C.useState("disabled"),V=l||z||q&&O.context.disabled,{getButtonProps:W,buttonRef:le}=cu({disabled:V,native:u});y.useEffect(()=>{!R&&O.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,R,O.type]);const D=y.useRef(null),P=Gn(),$=nt(ve=>{if(!D.current)return;P.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Ie=ve.target;if(rt(D.current,Ie)||rt(C.select("positionerElement"),Ie)||Ie===D.current||Ie!=null&&nR(Ie)===C.select("rootId"))return;const je=y_(D.current);ve.clientX>=je.left-ph&&ve.clientX<=je.right+ph&&ve.clientY>=je.top-ph&&ve.clientY<=je.bottom+ph||B.events.emit("close",{domEvent:ve,reason:oA})});y.useEffect(()=>{R&&C.select("lastOpenChangeReason")===qn&&At(D.current).addEventListener("mouseup",$,{once:!0})},[R,$,C]);const L=q&&O.context.hasSubmenuOpen,re=r_(A,{enabled:(h??L)&&!V&&O.type!=="context-menu"&&(!q||L&&!te),handleClose:a_({blockPointerEvents:!q}),mouseOnly:!0,move:!1,restMs:O.type===void 0?p:void 0,delay:{close:m},triggerElementRef:_,externalTree:B,isActiveTrigger:k,isClosing:()=>C.select("transitionStatus")==="ending"}),ce=WU(R,C.select("lastOpenChangeReason")),de=sy(A,{enabled:!V&&O.type!=="context-menu",event:R&&q?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:O.type===void 0?ce:!1}),fe=e_(A,{enabled:!V&&L}),Se=KU({open:R,enabled:q,mouseDownAction:"open"}),He=y.useMemo(()=>Ir(fe.reference,de.reference),[fe.reference,de.reference]),Me=C.useState("triggerProps",te),{preFocusGuardRef:Ee,handlePreFocusGuardFocus:Oe,handleFocusTargetFocus:Be}=GU(C,_),Ke={disabled:V,open:R},$e=[D,n,le,Z,_],De=[He,re??fn,Me,{"aria-haspopup":"menu","aria-controls":M,id:S,onMouseDown:ve=>{if(C.select("open"))return;P.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),At(ve.currentTarget).addEventListener("mouseup",$,{once:!0})}},q?{role:"menuitem"}:{},Se,E,W],ke=An("button",t,{enabled:!q,stateAttributesMapping:Nb,state:Ke,ref:$e,props:De});return q?f.jsx(YU,{tag:"button",render:r,className:s,style:a,state:Ke,refs:$e,props:De,stateAttributesMapping:Nb}):R?f.jsxs(y.Fragment,{children:[f.jsx(Wl,{ref:Ee,onFocus:Oe},`${S}-pre-focus-guard`),f.jsx(y.Fragment,{children:ke},S),f.jsx(Wl,{ref:C.context.triggerFocusTargetRef,onFocus:Be},`${S}-post-focus-guard`)]}):f.jsx(y.Fragment,{children:ke},S)});function WU(e,t){const n=Gn(),[r,s]=y.useState(!1);return Ye(()=>{e&&t==="trigger-hover"?(s(!0),n.start(c9,()=>{s(!1)})):e||(n.clear(),s(!1))},[e,t,n]),r}function QU(){const e=rp(!0),t=Po(!0),n=tR();return y.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const ZU=VU,JU=XU,eH=({className:e,align:t="end",side:n="bottom",sideOffset:r=6,...s})=>f.jsx(PU,{children:f.jsx(BU,{align:t,side:n,sideOffset:r,className:"isolate z-80 outline-none",children:f.jsx(DU,{"data-slot":"menu-content",className:xe("min-w-48 rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...s})})}),Nl=({className:e,destructive:t,...n})=>f.jsx(MU,{"data-slot":"menu-item",className:xe("flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-sm outline-none select-none","data-highlighted:bg-surface-hover",t?"text-danger":"text-text",e),...n});function tH(e){const t=y.useContext(H_)?"drawer":"dialog";return $_(e,t)}const ds=tH,fs=({className:e,children:t,size:n="md",...r})=>f.jsxs(X_,{children:[f.jsx(V_,{className:xe("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),f.jsx(K_,{"data-slot":"dialog-content",className:xe("fixed top-1/2 left-1/2 z-70 flex max-h-[min(42rem,calc(100dvh-3rem))] -translate-x-1/2 -translate-y-1/2 flex-col",n==="sm"&&"w-[min(24rem,calc(100vw-2rem))]",n==="md"&&"w-[min(32rem,calc(100vw-2rem))]",n==="lg"&&"w-[min(46rem,calc(100vw-2rem))]","rounded-lg border border-border bg-surface shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...r,children:t})]}),hs=({title:e,description:t,actions:n})=>f.jsxs("div",{className:"flex items-start gap-2 border-b border-border px-4 py-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx(W_,{className:"truncate text-body-sm font-semibold text-text",children:e}),t?f.jsx(Y_,{className:"mt-0.5 text-label text-fg-4",children:t}):null]}),n,f.jsx(q_,{"aria-label":"Close",className:"-mr-1 flex size-6 shrink-0 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1",children:f.jsx(Ss,{className:"size-3.5"})})]}),ms=({className:e,...t})=>f.jsx("div",{className:xe("min-h-0 flex-1 overflow-y-auto p-4",e),...t}),sr=({label:e,children:t,mono:n})=>f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label text-fg-3",children:e}),f.jsx("span",{className:xe("min-w-0 truncate text-right text-body-sm text-fg-1",n&&"font-mono text-label"),children:t})]}),rR=y.createContext(void 0);function sp(e){const t=y.useContext(rR);if(t===void 0&&!e)throw new Error(Dn(72));return t}const nH={...my,disabled:ze(e=>e.disabled),instantType:ze(e=>e.instantType),isInstantPhase:ze(e=>e.isInstantPhase),trackCursorAxis:ze(e=>e.trackCursorAxis),disableHoverablePopup:ze(e=>e.disableHoverablePopup),lastOpenChangeReason:ze(e=>e.openChangeReason),closeOnClick:ze(e=>e.closeOnClick),closeDelay:ze(e=>e.closeDelay),hasViewport:ze(e=>e.hasViewport)};class jy extends Dm{constructor(t,n,r=!1){const s=new vd,a={...rH(),...t};a.floatingRootContext=QA(s,n,r),super(a,{popupRef:y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:s},nH)}setOpen=(t,n)=>{mP(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,mt(ou,t))}static useStore(t,n){return KA(t,(s,a)=>new jy(n,s,a)).store}}function rH(){return{...fy(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const sH=Px(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:a=!1,trackCursorAxis:l="none",actionsRef:u,onOpenChange:d,onOpenChangeComplete:h,handle:p,triggerId:m,defaultTriggerId:b=null,children:x}=t,E=jy.useStore(p?.store,{open:r,openProp:s,activeTriggerId:b,triggerIdProp:m});WA(E,s,r,b),E.useControlledProp("openProp",s),E.useControlledProp("triggerIdProp",m),E.useContextCallback("onOpenChange",d),E.useContextCallback("onOpenChangeComplete",h);const N=E.useState("open"),C=!n&&N,S=E.useState("activeTriggerId"),k=E.useState("mounted"),A=E.useState("payload");E.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:a}),E.useSyncedValue("disabled",n),uy(E,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:R,transitionStatus:M}=cy(C,E),_=E.useState("isInstantPhase"),O=E.useState("instantType"),j=E.useState("lastOpenChangeReason"),H=y.useRef(null);Ye(()=>{N&&n&&E.setOpen(!1,mt(wj))},[N,n,E]),Ye(()=>{M==="ending"&&j===au||M!=="ending"&&_?(O!=="delay"&&(H.current=O),E.set("instantType","delay")):H.current!==null&&(E.set("instantType",H.current),H.current=null)},[M,_,j,O,E]),Ye(()=>{C&&S==null&&E.set("payload",void 0)},[E,S,C]);const B=y.useCallback(()=>{E.setOpen(!1,mt(Yx))},[E]);y.useImperativeHandle(u,()=>({unmount:R,close:B}),[R,B]);const K=C||k||!n&&l!=="none";return f.jsxs(rR.Provider,{value:E,children:[K&&f.jsx(iH,{store:E,disabled:n,trackCursorAxis:l}),typeof x=="function"?x({payload:A}):x]})});function iH({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=Gm(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=y9(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=y.useMemo(()=>Ir(a.reference,s.reference),[a.reference,s.reference]),u=y.useMemo(()=>Ir(a.trigger,s.trigger),[a.trigger,s.trigger]),d=y.useMemo(()=>Ir(Wm,a.floating,s.floating),[a.floating,s.floating]);return dy(e,{activeTriggerProps:l,inactiveTriggerProps:u,popupProps:d}),null}const sR=y.createContext(void 0);function aH(){return y.useContext(sR)}let oH=(function(e){return e[e.popupOpen=am.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const lH=600,iR="data-base-ui-tooltip-trigger";function lw(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(St(s))return s}}const t=e.target;return St(t)?t:null}function uH(e){let t=e;for(;t;){if(t.hasAttribute(iR))return t;const n=t.parentElement;if(n){t=n;continue}const r=t.getRootNode();t="host"in r&&St(r.host)?r.host:null}return null}const cH=eA(function(t,n){const{render:r,className:s,style:a,handle:l,payload:u,disabled:d,delay:h,closeOnClick:p=!0,closeDelay:m,id:b,...x}=t,E=sp(!0),N=l?.store??E;if(!N)throw new Error(Dn(82));const C=Do(b),S=N.useState("isTriggerActive",C),k=N.useState("isOpenedByTrigger",C),A=N.useState("floatingRootContext"),R=y.useRef(null),M=h??lH,_=m??0,{registerTrigger:O,isMountedByThisTrigger:j}=ly(C,R,N,{payload:u,closeOnClick:p,closeDelay:_}),H=aH(),{delayRef:B,isInstantPhase:K,hasProvider:X}=_j(A,{open:k}),Z=gy(A);N.useSyncedValue("isInstantPhase",K);const te=N.useState("disabled"),q=d??te,z=Tn(q),V=N.useState("trackCursorAxis"),W=N.useState("disableHoverablePopup"),le=y.useRef(!1),D=Gn(),P=y.useRef(void 0);function $(){const Ee=H?.delay,Oe=typeof B.current=="object"?B.current.open:void 0;let Be=M;return X&&(Oe!==0?Be=h??Ee??M:Be=0),Be}function L(Ee){const Oe=R.current;if(!Oe||!Ee)return!1;const Be=uH(Ee);return Be!==null&&Be!==Oe&&rt(Oe,Be)}function ae(Ee){const Oe=L(Ee);return le.current=Oe,Oe&&(Z.openChangeTimeout.clear(),Z.restTimeout.clear(),Z.restTimeoutPending=!1,D.clear()),Oe}const re=r_(A,{enabled:!q,mouseOnly:!0,move:!1,handleClose:!W&&V!=="both"?a_():null,restMs:$,delay(){const Ee=typeof B.current=="object"?B.current.close:void 0;let Oe=_;return m==null&&X&&(Oe=Ee),{close:Oe}},triggerElementRef:R,isActiveTrigger:S,isClosing:()=>N.select("transitionStatus")==="ending",shouldOpen(){return!le.current}}),ce=e_(A,{enabled:!q}).reference,de=Ee=>{const Oe=le.current,Be=lw(Ee),Ke=ae(Be),$e=R.current,De=$e&&Be&&rt($e,Be);if(Ke&&N.select("open")&&N.select("lastOpenChangeReason")===qn){N.setOpen(!1,mt(qn,Ee));return}if(Oe&&!Ke&&De&&!z.current&&!N.select("open")&&$e&&To(P.current)){const ke=()=>{!le.current&&!z.current&&!N.select("open")&&N.setOpen(!0,mt(qn,Ee,$e))},ve=$();ve===0?(D.clear(),ke()):D.start(ve,ke)}},fe=N.useState("triggerProps",j);return An("button",t,{state:{open:k},ref:[n,O,R],props:[re,ce,j||V!=="none"?fe:void 0,{onMouseOver(Ee){de(Ee.nativeEvent)},onFocus(Ee){L(lw(Ee.nativeEvent))&&Ee.preventBaseUIHandler()},onMouseLeave(){le.current=!1,D.clear(),P.current=void 0},onPointerEnter(Ee){P.current=Ee.pointerType},onPointerDown(Ee){P.current=Ee.pointerType,N.set("closeOnClick",p),p&&!N.select("open")&&N.cancelPendingOpen(Ee.nativeEvent)},onClick(Ee){p&&!N.select("open")&&N.cancelPendingOpen(Ee.nativeEvent)},id:C,[oH.triggerDisabled]:q?"":void 0,[iR]:q?void 0:""},x],stateAttributesMapping:xy})}),aR=y.createContext(void 0);function dH(){const e=y.useContext(aR);if(e===void 0)throw new Error(Dn(70));return e}const fH=y.forwardRef(function(t,n){const{children:r,container:s,className:a,render:l,style:u,...d}=t,{portalNode:h,portalSubtree:p}=MA({container:s,ref:n,componentProps:t,elementProps:d});return!p&&!h?null:f.jsxs(y.Fragment,{children:[p,h&&or.createPortal(r,h)]})}),hH=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return sp().useState("mounted")||r?f.jsx(aR.Provider,{value:r,children:f.jsx(fH,{ref:n,...s})}):null}),oR=y.createContext(void 0);function mH(){const e=y.useContext(oR);if(e===void 0)throw new Error(Dn(71));return e}const pH=y.forwardRef(function(t,n){const{render:r,className:s,anchor:a,positionMethod:l="absolute",side:u="top",align:d="center",sideOffset:h=0,alignOffset:p=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:E=!1,disableAnchorTracking:N=!1,collisionAvoidance:C=RA,style:S,...k}=t,A=sp(),R=dH(),M=A.useState("open"),_=A.useState("mounted"),O=A.useState("trackCursorAxis"),j=A.useState("disableHoverablePopup"),H=A.useState("floatingRootContext"),B=A.useState("instantType"),K=A.useState("transitionStatus"),X=A.useState("hasViewport"),Z=Ty({anchor:a,positionMethod:l,floatingRootContext:H,mounted:_,side:u,sideOffset:h,align:d,alignOffset:p,collisionBoundary:m,collisionPadding:b,sticky:E,arrowPadding:x,disableAnchorTracking:N,keepMounted:R,collisionAvoidance:C,adaptiveOrigin:X?T_:void 0}),te=y.useMemo(()=>({open:M,side:Z.side,align:Z.align,anchorHidden:Z.anchorHidden,instant:O!=="none"?"tracking-cursor":B}),[M,Z.side,Z.align,Z.anchorHidden,O,B]),q=Cy(t,te,{styles:Z.positionerStyles,transitionStatus:K,props:k,refs:[n,A.useStateSetter("positionerElement")],hidden:!_,inert:!M||O==="both"||j});return f.jsx(oR.Provider,{value:Z,children:q})}),gH={...uu,...lu},bH=y.forwardRef(function(t,n){const{render:r,className:s,style:a,...l}=t,u=sp(),{side:d,align:h}=mH(),p=u.useState("open"),m=u.useState("instantType"),b=u.useState("transitionStatus"),x=u.useState("popupProps"),E=u.useState("floatingRootContext"),N=u.useState("disabled"),C=u.useState("closeDelay");Lo({open:p,ref:u.context.popupRef,onComplete(){p&&u.context.onOpenChangeComplete?.(!0)}}),n_(E,{enabled:!N,closeDelay:C});const S=u.useStateSetter("popupElement");return An("div",t,{state:{open:p,side:d,align:h,instant:m,transitionStatus:b},ref:[n,u.context.popupRef,S],props:[x,Zm(b),l],stateAttributesMapping:gH})}),xH=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,a=y.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),l=y.useMemo(()=>({open:n,close:r}),[n,r]);return f.jsx(sR.Provider,{value:a,children:f.jsx(Aj,{delay:l,timeoutMs:s,children:t.children})})},yH=xH,vH=({className:e,side:t="top",sideOffset:n=6,...r})=>f.jsx(hH,{children:f.jsx(pH,{side:t,sideOffset:n,className:"isolate z-90",children:f.jsx(bH,{"data-slot":"tooltip-content",className:xe("rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none",e),...r})})});function Py({content:e,render:t,side:n,children:r}){return f.jsxs(sH,{children:[f.jsx(cH,{render:t??f.jsx("span",{className:"inline-flex"}),children:r}),f.jsx(vH,{side:n,children:e})]})}function EH(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const TH=e=>{switch(e){case"success":return wH;case"info":return NH;case"warning":return kH;case"error":return AH;default:return null}},SH=Array(12).fill(0),CH=({visible:e,className:t})=>Fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Fe.createElement("div",{className:"sonner-spinner"},SH.map((n,r)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),wH=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),kH=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),NH=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),AH=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),_H=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),RH=()=>{const[e,t]=Fe.useState(document.hidden);return Fe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let _b=1;class IH{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,a=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:_b++,l=this.toasts.find(d=>d.id===a),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(d=>d.id===a?(this.publish({...d,...t,id:a,title:r}),{...d,...t,id:a,dismissible:u,title:r}):d):this.addToast({title:r,...s,dismissible:u,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,l;const u=s.then(async h=>{if(l=["resolve",h],Fe.isValidElement(h))a=!1,this.create({id:r,type:"default",message:h});else if(MH(h)&&!h.ok){a=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,E=typeof m=="object"&&!Fe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:b,...E})}else if(h instanceof Error){a=!1;const m=typeof n.error=="function"?await n.error(h):n.error,b=typeof n.description=="function"?await n.description(h):n.description,E=typeof m=="object"&&!Fe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:b,...E})}else if(n.success!==void 0){a=!1;const m=typeof n.success=="function"?await n.success(h):n.success,b=typeof n.description=="function"?await n.description(h):n.description,E=typeof m=="object"&&!Fe.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:b,...E})}}).catch(async h=>{if(l=["reject",h],n.error!==void 0){a=!1;const p=typeof n.error=="function"?await n.error(h):n.error,m=typeof n.description=="function"?await n.description(h):n.description,x=typeof p=="object"&&!Fe.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((h,p)=>u.then(()=>l[0]==="reject"?p(l[1]):h(l[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||_b++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ar=new IH,OH=(e,t)=>{const n=t?.id||_b++;return Ar.addToast({title:e,...t,id:n}),n},MH=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",LH=OH,DH=()=>Ar.toasts,jH=()=>Ar.getActiveToasts(),an=Object.assign(LH,{success:Ar.success,info:Ar.info,warning:Ar.warning,error:Ar.error,custom:Ar.custom,message:Ar.message,promise:Ar.promise,dismiss:Ar.dismiss,loading:Ar.loading},{getHistory:DH,getToasts:jH});EH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function gh(e){return e.label!==void 0}const PH=3,BH="24px",zH="16px",uw=4e3,UH=356,HH=14,FH=45,$H=200;function js(...e){return e.filter(Boolean).join(" ")}function VH(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const qH=e=>{var t,n,r,s,a,l,u,d,h;const{invert:p,toast:m,unstyled:b,interacting:x,setHeights:E,visibleToasts:N,heights:C,index:S,toasts:k,expanded:A,removeToast:R,defaultRichColors:M,closeButton:_,style:O,cancelButtonStyle:j,actionButtonStyle:H,className:B="",descriptionClassName:K="",duration:X,position:Z,gap:te,expandByDefault:q,classNames:z,icons:V,closeButtonAriaLabel:W="Close toast"}=e,[le,D]=Fe.useState(null),[P,$]=Fe.useState(null),[L,ae]=Fe.useState(!1),[re,ce]=Fe.useState(!1),[de,fe]=Fe.useState(!1),[Se,He]=Fe.useState(!1),[Me,Ee]=Fe.useState(!1),[Oe,Be]=Fe.useState(0),[Ke,$e]=Fe.useState(0),De=Fe.useRef(m.duration||X||uw),ke=Fe.useRef(null),ve=Fe.useRef(null),Ie=S===0,je=S+1<=N,ee=m.type,me=m.dismissible!==!1,oe=m.className||"",ie=m.descriptionClassName||"",G=Fe.useMemo(()=>C.findIndex(Xe=>Xe.toastId===m.id)||0,[C,m.id]),F=Fe.useMemo(()=>{var Xe;return(Xe=m.closeButton)!=null?Xe:_},[m.closeButton,_]),J=Fe.useMemo(()=>m.duration||X||uw,[m.duration,X]),Te=Fe.useRef(0),_e=Fe.useRef(0),Ve=Fe.useRef(0),ot=Fe.useRef(null),[tt,dt]=Z.split("-"),ut=Fe.useMemo(()=>C.reduce((Xe,yt,Ht)=>Ht>=G?Xe:Xe+yt.height,0),[C,G]),qe=RH(),Rt=m.invert||p,jt=ee==="loading";_e.current=Fe.useMemo(()=>G*te+ut,[G,ut]),Fe.useEffect(()=>{De.current=J},[J]),Fe.useEffect(()=>{ae(!0)},[]),Fe.useEffect(()=>{const Xe=ve.current;if(Xe){const yt=Xe.getBoundingClientRect().height;return $e(yt),E(Ht=>[{toastId:m.id,height:yt,position:m.position},...Ht]),()=>E(Ht=>Ht.filter(en=>en.toastId!==m.id))}},[E,m.id]),Fe.useLayoutEffect(()=>{if(!L)return;const Xe=ve.current,yt=Xe.style.height;Xe.style.height="auto";const Ht=Xe.getBoundingClientRect().height;Xe.style.height=yt,$e(Ht),E(en=>en.find(vt=>vt.toastId===m.id)?en.map(vt=>vt.toastId===m.id?{...vt,height:Ht}:vt):[{toastId:m.id,height:Ht,position:m.position},...en])},[L,m.title,m.description,E,m.id,m.jsx,m.action,m.cancel]);const lt=Fe.useCallback(()=>{ce(!0),Be(_e.current),E(Xe=>Xe.filter(yt=>yt.toastId!==m.id)),setTimeout(()=>{R(m)},$H)},[m,R,E,_e]);Fe.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Xe;return A||x||qe?(()=>{if(Ve.current<Te.current){const en=new Date().getTime()-Te.current;De.current=De.current-en}Ve.current=new Date().getTime()})():(()=>{De.current!==1/0&&(Te.current=new Date().getTime(),Xe=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),lt()},De.current))})(),()=>clearTimeout(Xe)},[A,x,m,ee,qe,lt]),Fe.useEffect(()=>{m.delete&&(lt(),m.onDismiss==null||m.onDismiss.call(m,m))},[lt,m.delete]);function Lt(){var Xe;if(V?.loading){var yt;return Fe.createElement("div",{className:js(z?.loader,m==null||(yt=m.classNames)==null?void 0:yt.loader,"sonner-loader"),"data-visible":ee==="loading"},V.loading)}return Fe.createElement(CH,{className:js(z?.loader,m==null||(Xe=m.classNames)==null?void 0:Xe.loader),visible:ee==="loading"})}const Zt=m.icon||V?.[ee]||TH(ee);var $t,Jt;return Fe.createElement("li",{tabIndex:0,ref:ve,className:js(B,oe,z?.toast,m==null||(t=m.classNames)==null?void 0:t.toast,z?.default,z?.[ee],m==null||(n=m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":($t=m.richColors)!=null?$t:M,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":L,"data-promise":!!m.promise,"data-swiped":Me,"data-removed":re,"data-visible":je,"data-y-position":tt,"data-x-position":dt,"data-index":S,"data-front":Ie,"data-swiping":de,"data-dismissible":me,"data-type":ee,"data-invert":Rt,"data-swipe-out":Se,"data-swipe-direction":P,"data-expanded":!!(A||q&&L),"data-testid":m.testId,style:{"--index":S,"--toasts-before":S,"--z-index":k.length-S,"--offset":`${re?Oe:_e.current}px`,"--initial-height":q?"auto":`${Ke}px`,...O,...m.style},onDragEnd:()=>{fe(!1),D(null),ot.current=null},onPointerDown:Xe=>{Xe.button!==2&&(jt||!me||(ke.current=new Date,Be(_e.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(fe(!0),ot.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,yt,Ht;if(Se||!me)return;ot.current=null;const en=Number(((Xe=ve.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Kn=Number(((yt=ve.current)==null?void 0:yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),vt=new Date().getTime()-((Ht=ke.current)==null?void 0:Ht.getTime()),ln=le==="x"?en:Kn,yr=Math.abs(ln)/vt;if(Math.abs(ln)>=FH||yr>.11){Be(_e.current),m.onDismiss==null||m.onDismiss.call(m,m),$(le==="x"?en>0?"right":"left":Kn>0?"down":"up"),lt(),He(!0);return}else{var bn,Cn;(bn=ve.current)==null||bn.style.setProperty("--swipe-amount-x","0px"),(Cn=ve.current)==null||Cn.style.setProperty("--swipe-amount-y","0px")}Ee(!1),fe(!1),D(null)},onPointerMove:Xe=>{var yt,Ht,en;if(!ot.current||!me||((yt=window.getSelection())==null?void 0:yt.toString().length)>0)return;const vt=Xe.clientY-ot.current.y,ln=Xe.clientX-ot.current.x;var yr;const bn=(yr=e.swipeDirections)!=null?yr:VH(Z);!le&&(Math.abs(ln)>1||Math.abs(vt)>1)&&D(Math.abs(ln)>Math.abs(vt)?"x":"y");let Cn={x:0,y:0};const ht=It=>1/(1.5+Math.abs(It)/20);if(le==="y"){if(bn.includes("top")||bn.includes("bottom"))if(bn.includes("top")&&vt<0||bn.includes("bottom")&&vt>0)Cn.y=vt;else{const It=vt*ht(vt);Cn.y=Math.abs(It)<Math.abs(vt)?It:vt}}else if(le==="x"&&(bn.includes("left")||bn.includes("right")))if(bn.includes("left")&&ln<0||bn.includes("right")&&ln>0)Cn.x=ln;else{const It=ln*ht(ln);Cn.x=Math.abs(It)<Math.abs(ln)?It:ln}(Math.abs(Cn.x)>0||Math.abs(Cn.y)>0)&&Ee(!0),(Ht=ve.current)==null||Ht.style.setProperty("--swipe-amount-x",`${Cn.x}px`),(en=ve.current)==null||en.style.setProperty("--swipe-amount-y",`${Cn.y}px`)}},F&&!m.jsx&&ee!=="loading"?Fe.createElement("button",{"aria-label":W,"data-disabled":jt,"data-close-button":!0,onClick:jt||!me?()=>{}:()=>{lt(),m.onDismiss==null||m.onDismiss.call(m,m)},className:js(z?.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(Jt=V?.close)!=null?Jt:_H):null,(ee||m.icon||m.promise)&&m.icon!==null&&(V?.[ee]!==null||m.icon)?Fe.createElement("div",{"data-icon":"",className:js(z?.icon,m==null||(s=m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Lt():null,m.type!=="loading"?Zt:null):null,Fe.createElement("div",{"data-content":"",className:js(z?.content,m==null||(a=m.classNames)==null?void 0:a.content)},Fe.createElement("div",{"data-title":"",className:js(z?.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?Fe.createElement("div",{"data-description":"",className:js(K,ie,z?.description,m==null||(u=m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),Fe.isValidElement(m.cancel)?m.cancel:m.cancel&&gh(m.cancel)?Fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||j,onClick:Xe=>{gh(m.cancel)&&me&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Xe),lt())},className:js(z?.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,Fe.isValidElement(m.action)?m.action:m.action&&gh(m.action)?Fe.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:Xe=>{gh(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Xe),!Xe.defaultPrevented&&lt())},className:js(z?.actionButton,m==null||(h=m.classNames)==null?void 0:h.actionButton)},m.action.label):null)};function cw(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function YH(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,l=a?"--mobile-offset":"--offset",u=a?zH:BH;function d(h){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${l}-${h}`]=u:n[`${l}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):d(u)}),n}const GH=Fe.forwardRef(function(t,n){const{id:r,invert:s,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:h,offset:p,mobileOffset:m,theme:b="light",richColors:x,duration:E,style:N,visibleToasts:C=PH,toastOptions:S,dir:k=cw(),gap:A=HH,icons:R,containerAriaLabel:M="Notifications"}=t,[_,O]=Fe.useState([]),j=Fe.useMemo(()=>r?_.filter(L=>L.toasterId===r):_.filter(L=>!L.toasterId),[_,r]),H=Fe.useMemo(()=>Array.from(new Set([a].concat(j.filter(L=>L.position).map(L=>L.position)))),[j,a]),[B,K]=Fe.useState([]),[X,Z]=Fe.useState(!1),[te,q]=Fe.useState(!1),[z,V]=Fe.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Fe.useRef(null),le=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Fe.useRef(null),P=Fe.useRef(!1),$=Fe.useCallback(L=>{O(ae=>{var re;return(re=ae.find(ce=>ce.id===L.id))!=null&&re.delete||Ar.dismiss(L.id),ae.filter(({id:ce})=>ce!==L.id)})},[]);return Fe.useEffect(()=>Ar.subscribe(L=>{if(L.dismiss){requestAnimationFrame(()=>{O(ae=>ae.map(re=>re.id===L.id?{...re,delete:!0}:re))});return}setTimeout(()=>{g8.flushSync(()=>{O(ae=>{const re=ae.findIndex(ce=>ce.id===L.id);return re!==-1?[...ae.slice(0,re),{...ae[re],...L},...ae.slice(re+1)]:[L,...ae]})})})}),[_]),Fe.useEffect(()=>{if(b!=="system"){V(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:ae})=>{V(ae?"dark":"light")})}catch{L.addListener(({matches:re})=>{try{V(re?"dark":"light")}catch(ce){console.error(ce)}})}},[b]),Fe.useEffect(()=>{_.length<=1&&Z(!1)},[_]),Fe.useEffect(()=>{const L=ae=>{var re;if(l.every(fe=>ae[fe]||ae.code===fe)){var de;Z(!0),(de=W.current)==null||de.focus()}ae.code==="Escape"&&(document.activeElement===W.current||(re=W.current)!=null&&re.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[l]),Fe.useEffect(()=>{if(W.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,P.current=!1)}},[W.current]),Fe.createElement("section",{ref:n,"aria-label":`${M} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((L,ae)=>{var re;const[ce,de]=L.split("-");return j.length?Fe.createElement("ol",{key:L,dir:k==="auto"?cw():k,tabIndex:-1,ref:W,className:h,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":ce,"data-x-position":de,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${UH}px`,"--gap":`${A}px`,...N,...YH(p,m)},onBlur:fe=>{P.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(P.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||P.current||(P.current=!0,D.current=fe.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{te||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},j.filter(fe=>!fe.position&&ae===0||fe.position===L).map((fe,Se)=>{var He,Me;return Fe.createElement(qH,{key:fe.id,icons:R,index:Se,toast:fe,defaultRichColors:x,duration:(He=S?.duration)!=null?He:E,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:s,visibleToasts:C,closeButton:(Me=S?.closeButton)!=null?Me:d,interacting:te,position:L,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:$,toasts:j.filter(Ee=>Ee.position==fe.position),heights:B.filter(Ee=>Ee.position==fe.position),setHeights:K,expandByDefault:u,gap:A,expanded:X,swipeDirections:t.swipeDirections})})):null}))});function KH(){return f.jsx(GH,{position:"bottom-right",toastOptions:{style:{background:"var(--surface)",color:"var(--text)",border:"1px solid var(--border)",boxShadow:"var(--shadow-md)",fontFamily:"var(--cw-font-sans)",fontSize:"var(--text-body-sm)"}}})}async function XH(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return WH(e)}function WH(e){if(typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.opacity="0",document.body.appendChild(t);const n=document.activeElement;try{return t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t),n instanceof HTMLElement&&n.focus()}}function ud({value:e,glyph:t,className:n,variant:r="ghost",size:s="icon-sm",...a}){const[l,u]=y.useState(!1);return f.jsx(Je,{variant:r,size:s,"aria-label":"Copy",className:xe("text-fg-3",n),onClick:()=>{XH(e).then(d=>{d&&(u(!0),setTimeout(()=>u(!1),1500))})},...a,children:t?f.jsx("span",{className:xe("font-mono text-body-sm leading-5",l&&"text-success"),children:l?"✓":"⧉"}):l?f.jsx(I_,{className:"size-3.5 text-success"}):f.jsx(IB,{className:"size-3.5"})})}function xn({className:e}){return f.jsx(uz,{"aria-label":"Loading",className:xe("size-4 animate-spin text-fg-3",e)})}function lR({code:e,label:t,copyable:n=!0,variant:r="panel",className:s}){const a=r==="plain",l=t!==void 0||n;return a?f.jsxs("div",{"data-slot":"code-block","data-variant":"plain",className:xe("min-w-0",s),children:[l?f.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[f.jsx("span",{className:"truncate text-label leading-5 text-fg-4",children:t}),n?f.jsx(ud,{glyph:!0,value:e,className:"size-5 shrink-0 rounded-sm"}):null]}):null,f.jsx("pre",{className:"max-h-64 overflow-auto bg-code-bg px-2 font-mono text-label leading-5 whitespace-pre-wrap text-fg-2",children:e})]}):f.jsxs("div",{"data-slot":"code-block",className:xe("overflow-hidden rounded-md border border-border bg-code-bg",s),children:[l?f.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border px-2.5",children:[f.jsx("span",{className:"font-mono text-label text-fg-3",children:t}),n?f.jsx(ud,{value:e}):null]}):null,f.jsx("pre",{className:"max-h-64 overflow-auto px-3 py-2 font-mono text-label whitespace-pre-wrap text-fg-2",children:e})]})}function Rb({orientation:e,value:t,onValueChange:n,min:r,max:s,step:a=16,inverted:l,"aria-label":u,className:d}){const h=y.useRef(null),p=e==="vertical",m=y.useCallback(C=>Math.min(s,Math.max(r,C)),[r,s]),b=C=>{C.button===0&&(C.preventDefault(),C.currentTarget.setPointerCapture(C.pointerId),h.current={origin:p?C.clientX:C.clientY,start:t})},x=C=>{const S=h.current;if(!S)return;const k=(p?C.clientX:C.clientY)-S.origin;n(m(S.start+(l?-k:k)))},E=C=>{h.current&&(h.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId))},N=C=>{const S=p?"ArrowRight":"ArrowDown",k=p?"ArrowLeft":"ArrowUp",A=l?-1:1;if(C.key===S)n(m(t+a*A));else if(C.key===k)n(m(t-a*A));else if(C.key==="Home")n(r);else if(C.key==="End")n(s);else return;C.preventDefault()};return f.jsx("div",{"data-slot":"splitter",role:"separator",tabIndex:0,"aria-label":u,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":s,onPointerDown:b,onPointerMove:x,onPointerUp:E,onPointerCancel:E,onKeyDown:N,className:xe("group relative shrink-0 touch-none bg-border transition-colors","hover:bg-border-strong focus-visible:bg-accent focus-visible:outline-none",p?"w-px cursor-col-resize":"h-px cursor-row-resize",d),children:f.jsx("span",{"aria-hidden":!0,className:xe("absolute",p?"-inset-x-[3px] inset-y-0":"-inset-y-[3px] inset-x-0")})})}function uR({value:e,size:t=13,strokeWidth:n=2,className:r}){const s=Math.min(100,Math.max(0,e)),a=(t-n)/2,l=2*Math.PI*a;return f.jsxs("svg",{"data-slot":"progress-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":`${Math.round(s)}%`,className:xe("shrink-0 -rotate-90",r),children:[f.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:n}),f.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:l*(1-s/100)})]})}function zn(e){return e.map(t=>t.type==="text"?t.text:`${t.trigger}${t.displayText}`).join("")}function QH(e){return e?[{type:"text",text:e}]:[]}function ZH(e,t){if(t<=0)return[];const n=[];let r=0;for(const s of e){const a=s.type==="text"?s.text.length:s.trigger.length+s.displayText.length;if(r+a<=t){n.push(s),r+=a;continue}if(s.type==="text"){let l=t-r;if(l>0){const u=s.text.charCodeAt(l-1);u>=55296&&u<=56319&&(l-=1),l>0&&n.push({type:"text",text:s.text.slice(0,l)})}}break}return n}function Uc(e){return e===" "||e===`
477
- `||e===" "}function cR(e){const t=new Map;for(const n of e)t.has(n.char)||t.set(n.char,n);return t}function um(e,t,n){if(t===0)return!0;const r=e[t-1];return n==="start"?r===`
478
- `:Uc(r)}function JH(e,t,n){if(!e||t===0||n.length===0)return null;const r=cR(n);for(let s=t-1;s>=0;s--){const a=e[s];if(Uc(a)){if(s+1<t){const u=e[s+1],d=r.get(u);if(d&&um(e,s+1,d.position))return{config:d,startOffset:s+1,query:e.slice(s+2,t)}}return null}const l=r.get(a);if(l&&um(e,s,l.position))return{config:l,startOffset:s,query:e.slice(s+1,t)}}return null}function m1(e,t,n){const r=t.startOffset,s=r+1+t.query.length,a=[];let l=0;for(const m of e)if(m.type==="chip"){const b=`${m.trigger}${m.displayText}`,x=l,E=l+b.length;(E<=r||x>=s)&&a.push(m),l=E}else{const b=l,x=l+m.text.length;if(x<=r)a.push(m);else if(b>=s)a.push(m);else{const E=m.text.slice(0,Math.max(0,r-b)),N=m.text.slice(Math.min(m.text.length,s-b));E&&a.push({type:"text",text:E});const C={type:"chip",trigger:t.config.char,value:n.value,displayText:n.displayText,...n.data!==void 0?{data:n.data}:{},...n.autoResolved?{autoResolved:!0}:{}};a.push(C),N?a.push({type:"text",text:" "+N.replace(/^\s/,"")}):a.push({type:"text",text:" "})}l=x}const u=Bo(a);let d=-1,h=0;for(const m of u)m.type==="text"?h+=m.text.length:(h+=m.trigger.length+m.displayText.length,m.value===n.value&&m.displayText===n.displayText&&m.trigger===t.config.char&&(d=h));const p=d===-1?h:d+1;return{segments:u,cursorOffset:p}}function eF(e,t,n){const r=t.startOffset,s=r+1+t.query.length,a=[];let l=0,u=r+n.length;for(const p of e){if(p.type==="chip"){const x=l+`${p.trigger}${p.displayText}`.length;(x<=r||l>=s)&&a.push(p),l=x;continue}const m=l,b=l+p.text.length;if(b<=r||m>=s)a.push(p);else{const x=p.text.slice(0,Math.max(0,r-m)),E=p.text.slice(Math.min(p.text.length,s-m));x&&a.push({type:"text",text:x}),a.push({type:"text",text:n}),E&&a.push({type:"text",text:E})}l=b}const d=Bo(a),h=zn(d).length;return u>h&&(u=h),{segments:d,cursorOffset:u}}function tF(e,t){if(t<0||t>=e.length||e[t].type!=="chip")return e;const n=[...e.slice(0,t),...e.slice(t+1)];return Bo(n)}function nF(e,t){if(t<0||t>=e.length)return null;const n=e[t];if(n.type!=="chip"||!n.autoResolved)return null;const r=`${n.trigger}${n.displayText}`,s=[...e.slice(0,t),{type:"text",text:r},...e.slice(t+1)];return{segments:Bo(s),revertedText:r}}function rF(e,t){const n=t.filter(a=>a.resolveOnSpace);if(n.length===0)return e;const r=cR(n),s=[];for(const a of e){if(a.type==="chip"){s.push(a);continue}const l=sF(a.text,r);s.push(...l)}return Bo(s)}function sF(e,t){if(!e)return[];const n=[];let r=0;for(;r<e.length;){const s=e[r];if(t.has(s)&&(r===0||Uc(e[r-1]))){const u=t.get(s);if(u&&um(e,r,u.position)){let d=r+1;for(;d<e.length&&!Uc(e[d]);)d++;const h=e.slice(r+1,d);if(h.length>0){const p=u.onSelect?.({value:h,label:h})||h;n.push({type:"chip",trigger:s,value:h,displayText:p,autoResolved:!0}),r=d;continue}}}const a=r;for(r++;r<e.length&&!(t.has(e[r])&&Uc(e[r-1]));)r++;n.push({type:"text",text:e.slice(a,r)})}return n}function hr(e,t,n,r){const s=[];let a=0,l=!1;for(const u of e)if(u.type==="chip"){const d=`${u.trigger}${u.displayText}`,h=a,p=a+d.length;!l&&t===n&&h===t&&(s.push({type:"text",text:r}),l=!0),(p<=t||h>=n)&&s.push(u),a=p}else{const d=a,h=a+u.text.length,p=t===n?h<t:h<=t,m=t===n?d>n:d>=n;if(p)s.push(u);else if(m)s.push(u);else{const b=u.text.slice(0,Math.max(0,t-d)),x=u.text.slice(Math.min(u.text.length,n-d));b&&s.push({type:"text",text:b}),!l&&d<=t&&(s.push({type:"text",text:r}),l=!0),x&&s.push({type:"text",text:x})}a=h}return!l&&r&&s.push({type:"text",text:r}),Bo(s)}function iF(e,t,n,r){if(t===n)return null;const s=zn(e),a=r.length,l=t>=a&&s.slice(t-a,t)===r,u=n+a<=s.length&&s.slice(n,n+a)===r;let d=l&&u;if(d&&a===1){const m=t>a?s[t-a-1]:"",b=n+a<s.length?s[n+a]:"";(m===r||b===r)&&(d=!1)}if(d){const m=hr(e,n,n+a,"");return{segments:hr(m,t-a,t,""),selectionStart:t-a,selectionEnd:n-a}}const h=hr(e,n,n,r);return{segments:hr(h,t,t,r),selectionStart:t+a,selectionEnd:n+a}}function aF(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],s=t[n];if(r.type!==s.type)return!1;if(r.type==="text"){if(s.type!=="text"||r.text!==s.text)return!1}else if(s.type!=="chip"||r.trigger!==s.trigger||r.value!==s.value||r.displayText!==s.displayText||r.autoResolved!==s.autoResolved)return!1}return!0}function Bo(e){const t=[];for(const n of e){if(n.type==="text"&&n.text==="")continue;const r=t[t.length-1];n.type==="text"&&r?.type==="text"?t[t.length-1]={type:"text",text:r.text+n.text}:t.push(n)}return t}function ip(e){const t=e.match(/^(\s*)([•\-*]) /);if(t)return{kind:"bullet",indent:Math.floor(t[1].length/2),marker:t[2],prefixLen:t[0].length};const n=e.match(/^(\s*)(\d+)\. /);if(n){const r=n[1].length;return{kind:"numbered",indent:Math.floor(n[1].length/2),number:parseInt(n[2],10),numberStart:r,numberEnd:r+n[2].length,prefixLen:n[0].length}}return null}function Zl(e,t){const n=e.lastIndexOf(`
479
- `,t-1)+1,r=e.indexOf(`
480
- `,t),s=e.slice(n,r===-1?e.length:r),a=ip(s);return a?{lineStart:n,prefix:s.slice(0,a.prefixLen),indent:a.indent,listType:a.kind,...a.kind==="bullet"?{marker:a.marker}:{number:a.number},contentStart:n+a.prefixLen}:null}function oF(e,t){const n=zn(e),r=n.lastIndexOf(`
481
- `,t-1)+1,s=n.slice(r,t),a=s.match(/^(\s*)[-*] $/);if(!a)return null;const u=`${a[1]}• `,d=r,h=r+s.length;return{segments:hr(e,d,h,u),cursorOffset:r+u.length}}function lF(e,t){const n=zn(e),r=Zl(n,t);if(!r)return null;const s=n.indexOf(`
482
- `,t);if(n.slice(r.contentStart,s===-1?n.length:s).trim()==="")return r.indent>0?{segments:hr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:hr(e,r.lineStart,r.lineStart+r.prefix.length,""),cursorOffset:r.lineStart};const l=" ".repeat(r.indent);let u;if(r.listType==="bullet")u=`${l}${r.marker??"•"} `;else{const p=(r.number??1)+1;u=`${l}${p}. `}const d=`
483
- ${u}`;return{segments:hr(e,t,t,d),cursorOffset:t+d.length}}function uF(e,t){if(t===0)return null;const n=e.lastIndexOf(`
484
- `,t-2)+1,r=ip(e.slice(n,t-1));return r?r.indent:null}function cF(e,t){const n=zn(e),r=Zl(n,t);if(!r)return null;const s=uF(n,r.lineStart),a=s===null?0:s+1;return r.indent>=a?null:{segments:hr(e,r.lineStart,r.lineStart," "),cursorOffset:t+2}}function dF(e,t){const n=zn(e),r=Zl(n,t);return!r||r.indent===0?null:{segments:hr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}}function fF(e,t){const n=zn(e),r=Zl(n,t);return!r||t>r.contentStart?null:{segments:hr(e,r.lineStart,r.contentStart," ".repeat(r.indent)),cursorOffset:r.lineStart+r.indent*2}}const hF=/^\s*```/;function dR(e,t){return t?e.replace(/^(\s*)- /,"$1• "):e.replace(/^(\s*)• /,"$1- ")}function fR(e){const t=new Set;let n=-1;return e.forEach((r,s)=>{if(hF.test(r))if(n===-1)n=s;else{for(let a=n;a<=s;a++)t.add(a);n=-1}}),t}function mF(e,t){const n=e.split(`
485
- `),r=fR(n);return n.map((s,a)=>r.has(a)?s:dR(s,t)).join(`
486
- `)}function dw(e,t){const n=[];e.forEach(u=>{u.type==="text"&&n.push(...u.text.split(`
487
- `))});const r=fR(n);let s=0,a=!1;const l=e.map(u=>{if(u.type!=="text")return u;const d=u.text.split(`
488
- `).map(h=>{const p=r.has(s)?h:dR(h,t);return s++,p}).join(`
489
- `);return d===u.text?u:(a=!0,{...u,text:d})});return a?l:e}function hR(e){let t=null,n=0,r=0,s=0,a=!0;for(const l of e.split(`
490
- `)){const u=ip(l);if(u?.kind==="numbered"&&u.indent===t){if(a=a&&u.number===r+1,r=u.number,s++,s>=2&&(n===1||a))return!0}else u?.kind==="numbered"?(t=u.indent,n=u.number,r=u.number,s=1,a=!0):(t=null,s=0)}return!1}function mR(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};const t=new Map,n=[],r=e.split(`
491
- `);let s="",a=0;const l=(u,d)=>{for(const h of t.keys())(d?h>=u:h>u)&&t.delete(h)};for(let u=0;u<r.length;u++){const d=r[u],h=ip(d);if(!h)t.clear(),s+=d;else if(h.kind==="bullet")l(h.indent,!0),s+=d;else{const p=h.indent;l(p,!1);const m=t.get(p),b=m===void 0?1:m+1;t.set(p,b);const x=String(b);x===String(h.number)?s+=d:(n.push({oldStart:a+h.numberStart,oldEnd:a+h.numberEnd,newText:x}),s+=d.slice(0,h.numberStart)+x+d.slice(h.numberEnd))}u<r.length-1&&(s+=`
492
- `),a+=d.length+1}return n.length===0?{text:e,edits:n}:{text:s,edits:n}}function fw(e,t){let n=0;for(const r of t)if(r.oldEnd<=e)n+=r.newText.length-(r.oldEnd-r.oldStart);else{if(r.oldStart>=e)break;return r.oldStart+n+Math.min(e-r.oldStart,r.newText.length)}return e+n}function hw(e){const{edits:t}=mR(zn(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let r=t.length-1;r>=0;r--){const s=t[r];n=hr(n,s.oldStart,s.oldEnd,s.newText)}return{segments:n,edits:t}}function Mi(e){return e instanceof HTMLElement}function er(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function cm(e){return e instanceof HTMLBRElement}function Sd(e){return e instanceof Text}function Ib(e){return er(e)&&e.dataset.chipAutoResolved==="true"}function pF(e){return e instanceof HTMLAnchorElement&&e.dataset.url==="true"}function gF(e){try{return JSON.parse(e)}catch{return}}function zh(e){try{return JSON.stringify(e)}catch{return}}function pR(e){if(er(e))return e.dataset.chipTrigger}function bF(e){if(er(e))return e.dataset.chipValue}function gR(e){if(er(e))return e.dataset.chipDisplay??e.textContent??void 0}function xF(e){if(!er(e))return;const t=e.dataset.chipData;if(t)return gF(t)}function bR(e){const t=e.dataset.chipTrigger??"",n=e.dataset.chipDisplay??e.textContent??"";return t.length+n.length}function dm(e){if(!er(e))return null;const t=pR(e),n=bF(e),r=gR(e);if(!t||n===void 0||!r)return null;const s=xF(e),a=Ib(e);return{type:"chip",trigger:t,value:n,displayText:r,...s!==void 0?{data:s}:{},...a?{autoResolved:!0}:{}}}function Uh(e,t){const n=e.childNodes;for(let r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function yF(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??"")!=="":cm(e)?!e.dataset.sentinel:er(e)?dm(e)!==null:Mi(e)?(e.textContent??"")!=="":!1}function p1(e,t){let n=0;for(let r=0;r<t;r++)yF(e.childNodes[r])&&n++;return n}function Ob(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function vF(e,t){const n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement("br")),e.replaceChild(n,t)}function Mb(e){let t=!1;const n=new Set(["DIV","P","SECTION","ARTICLE","BLOCKQUOTE"]);for(let r=e.childNodes.length-1;r>=0;r--){const s=e.childNodes[r];if(!(s instanceof HTMLElement)||s.dataset.chipTrigger!==void 0||s instanceof HTMLBRElement)continue;const a=s.tagName;if(n.has(a))vF(e,s),t=!0;else if(a==="FONT"||a==="B"||a==="I"||a==="U"||a==="STRONG"||a==="EM"||a==="A"||a==="SPAN"){const l=s.textContent??"";l?e.replaceChild(document.createTextNode(l),s):e.removeChild(s),t=!0}}return e.normalize(),t}const mw=/https?:\/\/[^\s),]+/g;function EF(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Sd(s)&&s.textContent&&n.push(s)}for(const r of n){const s=r.textContent??"";mw.lastIndex=0;const a=[];let l;for(;(l=mw.exec(s))!==null;){let m=l[0];for(;m.length>0&&/[.;:!?]$/.test(m);)m=m.slice(0,-1);m.length>0&&a.push({url:m,index:l.index})}if(a.length===0)continue;const u=r.parentNode;if(!u)continue;const d=[];for(const{url:m,index:b}of a)try{const x=new URL(m);(x.protocol==="http:"||x.protocol==="https:")&&d.push({url:m,href:x.href,index:b})}catch{}if(d.length===0)continue;t=!0;const h=document.createDocumentFragment();let p=0;for(const{url:m,href:b,index:x}of d){x>p&&h.appendChild(document.createTextNode(s.slice(p,x)));const E=document.createElement("a");E.href=b,E.target="_blank",E.rel="noopener noreferrer",E.dataset.url="true",E.className="text-accent hover:text-accent-hover underline cursor-pointer",E.textContent=m,h.appendChild(E),p=x+m.length}p<s.length&&h.appendChild(document.createTextNode(s.slice(p))),u.replaceChild(h,r)}return t}const pw=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g;function TF(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Sd(s)&&s.textContent&&n.push(s)}for(const r of n){const s=r.textContent??"";pw.lastIndex=0;const a=[];let l;for(;(l=pw.exec(s))!==null;)l[1]&&l[2]?a.push({fullMatch:l[0],marker:l[1],content:l[2],index:l.index,className:"font-bold italic"}):l[3]&&l[4]?a.push({fullMatch:l[0],marker:l[3],content:l[4],index:l.index,className:"font-bold"}):l[5]&&l[6]&&a.push({fullMatch:l[0],marker:l[5],content:l[6],index:l.index,className:"italic"});if(a.length===0)continue;t=!0;const u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const{fullMatch:p,marker:m,content:b,index:x,className:E}of a){x>h&&d.appendChild(document.createTextNode(s.slice(h,x)));const N=document.createElement("span");N.dataset.md="true";const C=document.createElement("span");C.className="prompt-area-md-marker",C.textContent=m;const S=document.createElement("span");S.className=E,S.textContent=b;const k=document.createElement("span");k.className="prompt-area-md-marker",k.textContent=m,N.appendChild(C),N.appendChild(S),N.appendChild(k),d.appendChild(N),h=x+p.length}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}const gw=/(^|\n)([ \t]*)•/g;function SF(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Sd(s)&&s.textContent?.includes("•")&&n.push(s)}for(const r of n){const s=r.textContent??"";gw.lastIndex=0;const a=[];let l;for(;(l=gw.exec(s))!==null;)a.push(l.index+l[1].length+l[2].length);if(a.length===0)continue;t=!0;const u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const p of a){p>h&&d.appendChild(document.createTextNode(s.slice(h,p)));const m=document.createElement("span");m.dataset.md="true",m.className="prompt-area-list-bullet",m.textContent="•",d.appendChild(m),h=p+1}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}const bw=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function CF(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Sd(s)&&n.push(s)}for(const r of n){const s=r.textContent??"";bw.lastIndex=0;const a=[];let l;for(;(l=bw.exec(s))!==null;){const p=l.index+l[1].length;a.push({start:p,end:p+l[2].length})}if(a.length===0)continue;t=!0;const u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const{start:p,end:m}of a){p>h&&d.appendChild(document.createTextNode(s.slice(h,p)));const b=s.slice(p,m),x=Math.floor(b.length/2),E=document.createElement("span");E.dataset.md="true",E.className="prompt-area-list-indent",E.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${x})`,E.textContent=b,d.appendChild(E),h=m}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}function xw(e,t){t&&(CF(e),SF(e)),EF(e),t&&TF(e)}function $s(){const e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function wF(e){const t=$s();if(!t||!e.contains(t.startContainer))return null;const n=t.startContainer;if(n===e)return{nodeIndex:t.startOffset,offset:0};const r=Ob(e,n);return r?{nodeIndex:Uh(e,r),offset:t.startOffset}:null}function kF(e,t){const n=window.getSelection();if(!n)return;const r=e.childNodes;if(r.length===0)return;const s=document.createRange();if(t.nodeIndex>=r.length){const a=r[r.length-1];a.nodeType===Node.TEXT_NODE?s.setStart(a,(a.textContent??"").length):s.setStartAfter(a)}else{const a=r[t.nodeIndex];if(a.nodeType===Node.TEXT_NODE){const l=(a.textContent??"").length;s.setStart(a,Math.min(t.offset,l))}else s.setStartAfter(a)}s.collapse(!0),n.removeAllRanges(),n.addRange(s)}function oa(e){const t=$s();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),fm(n)}function NF(e,t){const n=cd(e,t);if(!n)return null;const r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function rr(e,t){const n=window.getSelection();if(!n)return;const r=cd(e,t);if(r){const a=document.createRange();a.setStart(r.node,r.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}const s=document.createRange();s.selectNodeContents(e),s.collapse(!1),n.removeAllRanges(),n.addRange(s)}function fm(e){const t=e.cloneContents();let n=0;const r=s=>{if(s.nodeType===Node.TEXT_NODE)n+=(s.textContent??"").length;else if(er(s))n+=bR(s);else if(Mi(s)&&s.tagName==="BR"){if(s.dataset.sentinel)return;n+=1}else Mi(s)&&s.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function bh(e){const t=$s();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=fm(n);if(t.collapsed)return{start:r,end:r};const s=document.createRange();s.selectNodeContents(e),s.setEnd(t.endContainer,t.endOffset);const a=fm(s);return{start:r,end:a}}function yw(e,t,n){const r=window.getSelection();if(!r)return;if(t===n){rr(e,t);return}const s=cd(e,t),a=cd(e,n);if(!s||!a)return;const l=document.createRange();l.setStart(s.node,s.offset),l.setEnd(a.node,a.offset),r.removeAllRanges(),r.addRange(l)}function cd(e,t){let n=t;for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];if(s.nodeType===Node.TEXT_NODE){const a=(s.textContent??"").length;if(n<=a)return{node:s,offset:n};n-=a}else if(er(s)){const a=bR(s);if(n<=a)return{node:e,offset:r+1};n-=a}else if(cm(s)){if(s.dataset.sentinel)continue;if(n<=1)return{node:e,offset:r+1};n-=1}else if(Mi(s)){const a=(s.textContent??"").length;if(n<=a){const l=cd(s,n);if(l)return l}n-=a}}return{node:e,offset:e.childNodes.length}}function AF(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xR(e,t){const n=r=>{r.nodeType===Node.TEXT_NODE?t.onText(r.textContent??""):er(r)?t.onChip(r):Mi(r)&&r.tagName==="BR"?t.onBreak():r.childNodes.forEach(n)};e.childNodes.forEach(n)}function _F(e){let t="";return xR(e,{onText:n=>{t+=n},onChip:n=>{t+=(pR(n)??"")+(gR(n)??"")},onBreak:()=>{t+=`
493
- `}}),t}function RF(e){const t=[];return xR(e,{onText:n=>{n&&t.push({type:"text",text:n})},onChip:n=>{const r=dm(n);r&&t.push(r)},onBreak:()=>{t.push({type:"text",text:`
494
- `})}}),t}function IF(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return null;const n=[];for(const r of t){if(!AF(r))return null;if(r.type==="text"&&typeof r.text=="string")n.push({type:"text",text:r.text});else if(r.type==="chip"&&typeof r.trigger=="string"&&typeof r.value=="string"&&typeof r.displayText=="string"){const s={type:"chip",trigger:r.trigger,value:r.value,displayText:r.displayText,...r.data!==void 0?{data:r.data}:{},...r.autoResolved?{autoResolved:!0}:{}};n.push(s)}else return null}return n}catch{return null}}function OF(e,t,n){const r=$s();if(!r)return[...e,...t];const s=document.createRange();s.selectNodeContents(n),s.setEnd(r.startContainer,r.startOffset);const a=fm(s),l=[];let u=0,d=!1;const h=()=>{d||(l.push(...t),d=!0)};for(const p of e){if(p.type==="chip"){const b=p.trigger.length+p.displayText.length;u>=a&&h(),l.push(p),u+=b;continue}const m=u+p.text.length;if(m<=a)l.push(p);else if(u>=a)h(),l.push(p);else{const b=a-u,x=p.text.slice(0,b),E=p.text.slice(b);x&&l.push({type:"text",text:x}),h(),E&&l.push({type:"text",text:E})}u=m}return h(),Bo(l)}function g1(e,t){const n=new RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,"i").exec(e);return n?n[1].trim().toLowerCase():""}function MF(e){if(e==="bold"||e==="bolder")return!0;const t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function LF(e){const t=e.tagName,n=e.getAttribute("style")??"",r=g1(n,"font-weight"),s=r?MF(r):t==="B"||t==="STRONG",a=g1(n,"font-style"),l=a?a==="italic"||a==="oblique":t==="I"||t==="EM",u=g1(n,"text-decoration"),d=t==="S"||t==="DEL"||t==="STRIKE"||u.includes("line-through"),h=(d?"~~":"")+(s?"**":"")+(l?"*":""),p=(l?"*":"")+(s?"**":"")+(d?"~~":"");return{prefix:h,suffix:p}}function DF(e){return e.replace(/\s+/g," ")}function jF(e){return e.replace(/\*/g,"\\*")}function PF(e){const t=e.querySelector("code"),n=`${e.className} ${t?.className??""}`,r=/(?:language|lang)-([\w-]+)/.exec(n);return r?r[1]:e.getAttribute("lang")??t?.getAttribute("lang")??""}function BF(e){const t=PF(e),n=(e.textContent??"").replace(/\n$/,"");return`
495
-
496
- \`\`\`${t}
497
- ${n}
498
- \`\`\`
499
-
500
- `}function zF(e){const t=e.textContent??"";return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function yR(e){return/^(https?:|mailto:)/i.test(e)}function UF(e,t){const n=e.getAttribute("href")??"",r=yi(e,t).trim();return yR(n)?!r||r===n?n:`[${r}](${n})`:r}function HF(e){const t=e.getAttribute("src")??"";return!t||!yR(t)?"":`![${e.getAttribute("alt")??""}](${t})`}function FF(e,t){return`
501
-
502
- ${yi(e,t).trim().split(`
503
- `).map(s=>s?`> ${s}`:">").join(`
504
- `)}
505
-
506
- `}function vR(e,t){const n=e.tagName==="OL",r=Number.parseInt(e.getAttribute("start")??"",10);let s=Number.isNaN(r)?1:r;const a=" ".repeat(t),l=[];for(const u of Array.from(e.childNodes)){if(!Mi(u)||u.tagName!=="LI")continue;const d=n?`${s}. `:"- ";s++;let h="",p="";for(const m of Array.from(u.childNodes))Mi(m)&&(m.tagName==="UL"||m.tagName==="OL")?p+=`
507
- ${vR(m,t+1)}`:h+=ER(m,t);l.push(`${a}${d}${h.trim()}${p}`)}return l.join(`
508
- `)}function $F(e,t){const n=Array.from(e.querySelectorAll("tr"));if(n.length===0)return"";const r=n.map(u=>Array.from(u.children).filter(d=>d.tagName==="TD"||d.tagName==="TH").map(d=>yi(d,t).replace(/\n+/g," ").replace(/\|/g,"\\|").trim())),s=r[0],a=s.map(()=>"---"),l=u=>`| ${u.join(" | ")} |`;return[l(s),l(a),...r.slice(1).map(l)].join(`
509
- `)}function yi(e,t){let n="";return e.childNodes.forEach(r=>{n+=ER(r,t)}),n}function ER(e,t){if(Sd(e))return jF(DF(e.textContent??""));if(!Mi(e))return"";const n=e.tagName;switch(n){case"SCRIPT":case"STYLE":case"NOSCRIPT":case"HEAD":case"TITLE":return"";case"BR":return`
510
- `;case"HR":return`
511
-
512
- ---
513
-
514
- `;case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":return`
515
-
516
- ${"#".repeat(Number(n[1]))} ${yi(e,t).trim()}
517
-
518
- `;case"P":return`
519
-
520
- ${yi(e,t).trim()}
521
-
522
- `;case"DIV":return`
523
- ${yi(e,t).trim()}
524
- `;case"BLOCKQUOTE":return FF(e,t);case"UL":case"OL":return`
525
-
526
- ${vR(e,t)}
527
-
528
- `;case"LI":return`${yi(e,t).trim()}
529
- `;case"PRE":return BF(e);case"CODE":return zF(e);case"A":return UF(e,t);case"IMG":return HF(e);case"TABLE":return`
530
-
531
- ${$F(e,t)}
532
-
533
- `;default:{const{prefix:r,suffix:s}=LF(e);return r+yi(e,t)+s}}}function VF(e){return e.replace(/[ \t]+\n/g,`
534
- `).replace(/\n[ \t]*\n[ \t\n]*/g,`
535
-
536
- `).trim()}function qF(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html");return t.body?VF(yi(t.body,0)):""}const YF=100,TR=150;function GF(e){const{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:s,runTriggerDetection:a,dismissTrigger:l,triggers:u,markdownEnabled:d,normalizeBullets:h,onPaste:p,onUndo:m,onRedo:b,onChipAdd:x,onImagePaste:E,onRawPaste:N}=e,C=y.useRef(!1),S=y.useRef({undoStack:[],redoStack:[]}),k=y.useCallback(Z=>{const te=S.current;te.undoStack.push(Z),te.undoStack.length>YF&&te.undoStack.shift(),te.redoStack=[]},[]),A=y.useCallback(()=>{S.current={undoStack:[],redoStack:[]}},[]),R=y.useCallback(Z=>{if(N?.(Z),Z.defaultPrevented)return;Z.preventDefault();const te=t.current;if(!te)return;const q=Array.from(Z.clipboardData.files).find(re=>re.type.startsWith("image/"))??(Array.from(Z.clipboardData.items).find(ce=>ce.type.startsWith("image/"))?.getAsFile()??null);if(q){E?.(q);return}const z=n();k(z);const V=Z.clipboardData.getData("text/prompt-area-segments");if(V){const re=IF(V);if(re&&re.length>0){const ce=$s();if(!ce)return;ce.deleteContents();const de=n(),fe=OF(de,re,te);r(fe),s(fe),p?.({segments:fe,source:"internal"});for(const Se of re)Se.type==="chip"&&x?.(Se);a();return}}let W="";if(d)if(W=Z.clipboardData.getData("text/markdown"),W)W=W.replace(/\\([()])/g,"$1");else{const re=Z.clipboardData.getData("text/html");if(re)try{W=qF(re)}catch{W=""}}if(W||(W=Z.clipboardData.getData("text/plain")),!W)return;d&&h&&(W=mF(W,!0)),d&&hR(W)&&(W=mR(W).text);const le=$s();if(!le)return;le.deleteContents();const D=W.split(`
537
- `),P=document.createDocumentFragment();for(let re=0;re<D.length;re++)D[re]&&P.appendChild(document.createTextNode(D[re])),re<D.length-1&&P.appendChild(document.createElement("br"));le.insertNode(P),le.collapse(!1);const $=window.getSelection();$?.removeAllRanges(),$?.addRange(le),Mb(te);const L=n(),ae=rF(L,u);if(ae!==L){r(ae),s(ae);for(const re of ae)re.type==="chip"&&!L.some(ce=>ce.type==="chip"&&ce.trigger===re.trigger&&ce.value===re.value&&ce.displayText===re.displayText)&&x?.(re)}else r(L);p?.({segments:ae,source:"external"}),a()},[t,n,r,k,a,s,u,d,h,p,x,E,N]),M=y.useCallback(Z=>{Z.preventDefault();const te=$s();if(!te)return;const q=te.cloneContents(),z=_F(q);Z.clipboardData.setData("text/plain",z);const V=RF(q);if(V.some(le=>le.type==="chip")){const le=zh(V);le&&Z.clipboardData.setData("text/prompt-area-segments",le)}},[]),_=y.useCallback(Z=>{M(Z);const te=$s();if(!te)return;const q=n();k(q),te.deleteContents();const z=t.current;z&&Mb(z);const V=n();r(V),a()},[M,t,n,r,k,a]),O=y.useCallback(Z=>{Z.preventDefault()},[]),j=y.useCallback(Z=>{Z.preventDefault()},[]),H=y.useCallback(()=>{C.current=!0},[]),B=y.useCallback(()=>{C.current=!1,a()},[a]),K=y.useCallback(()=>{setTimeout(()=>{const Z=t.current;if(!Z)return;const te=document.activeElement;te&&Z.parentElement?.contains(te)||l()},TR)},[t,l]),X=y.useCallback(Z=>{if(!(Z.metaKey||Z.ctrlKey)||Z.key!=="z")return!1;Z.preventDefault();const q=S.current;if(Z.shiftKey){if(q.redoStack.length===0)return!0;const z=q.redoStack.pop();if(!z)return!0;const V=n();q.undoStack.push(V),r(z),s(z),b?.(z)}else{if(q.undoStack.length===0)return!0;const z=q.undoStack.pop();if(!z)return!0;const V=n();q.redoStack.push(V),r(z),s(z),m?.(z)}return!0},[n,r,s,m,b]);return{handlePaste:R,handleCopy:M,handleCut:_,handleDrop:O,handleDragOver:j,handleCompositionStart:H,handleCompositionEnd:B,handleBlur:K,handleKeyDownForUndoRedo:X,pushUndo:k,resetUndoHistory:A,isComposing:C}}function KF(){const[e,t]=y.useState([]),[n,r]=y.useState(!1),[s,a]=y.useState(null),l=y.useRef(0),u=y.useRef(null),d=y.useRef(null),h=y.useCallback(()=>{u.current?.abort(),d.current&&clearTimeout(d.current),t([]),r(!1),a(null)},[]),p=y.useCallback((m,b)=>{if(!b.onSearch)return;u.current?.abort(),d.current&&clearTimeout(d.current),r(!0),a(null),l.current++;const x=l.current,E=new AbortController;u.current=E;const{onSearch:N,onSearchError:C,searchDebounceMs:S}=b,k=()=>{const A=N(m,{signal:E.signal});A instanceof Promise?A.then(R=>{E.signal.aborted||l.current!==x||(t(R),r(!1))},R=>{E.signal.aborted||l.current!==x||R instanceof DOMException&&R.name==="AbortError"||(a(R instanceof Error?R.message:"Search failed"),r(!1),C?.(R))}):(t(A),r(!1))};S&&S>0&&m.length>0?d.current=setTimeout(k,S):k()},[]);return y.useEffect(()=>()=>{u.current?.abort(),d.current&&clearTimeout(d.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:s,search:p,reset:h}}const XF=300;function WF({value:e,onChange:t,triggers:n=[],disabled:r=!1,onSubmit:s,onEscape:a,onChipClick:l,onChipAdd:u,onChipDelete:d,onLinkClick:h,onPaste:p,onRawPaste:m,onUndo:b,onRedo:x,onImagePaste:E,markdown:N=!0,normalizeBullets:C=!0,submitOnEnter:S=!0,maxLength:k}){const A=y.useRef(null),[R,M]=y.useState(null),[_,O]=y.useState(0),[j,H]=y.useState(null),B=y.useRef(null),K=y.useRef(null),X=y.useRef(null),{suggestions:Z,suggestionsLoading:te,suggestionsError:q,search:z,reset:V}=KF(),W=y.useRef(!1),le=y.useRef([]),D=y.useRef(null),P=y.useRef(null),$=y.useCallback(()=>{const ee=A.current;if(!ee)return[];const me=[];let oe=!1,ie=!1;for(let G=0;G<ee.childNodes.length;G++){const F=ee.childNodes[G];if(F.nodeType===Node.TEXT_NODE){const J=F.textContent??"";J&&(me.push({type:"text",text:J}),oe=!0)}else if(er(F)){const J=dm(F);J&&(me.push(J),oe=!0)}else if(cm(F)){if(F.dataset.sentinel){ie=!0;continue}me.push({type:"text",text:`
538
- `})}else if(Mi(F)){const J=F.textContent??"";J&&(me.push({type:"text",text:J}),oe=!0)}}return!oe&&!ie?[]:me},[]),L=y.useCallback(ee=>{const me=A.current;if(!me)return;W.current=!0;const oe=wF(me);for(;me.firstChild;)me.removeChild(me.firstChild);for(const ie of ee)if(ie.type==="text"){const G=ie.text.split(`
539
- `);for(let F=0;F<G.length;F++)G[F]&&me.appendChild(document.createTextNode(G[F])),F<G.length-1&&me.appendChild(document.createElement("br"))}else{const G=document.createElement("span");if(G.contentEditable="false",G.dataset.chipTrigger=ie.trigger,G.dataset.chipValue=ie.value,G.dataset.chipDisplay=ie.displayText,ie.data!==void 0){const Te=zh(ie.data);Te&&(G.dataset.chipData=Te)}ie.autoResolved&&(G.dataset.chipAutoResolved="true");const F=n.find(Te=>Te.char===ie.trigger),J=F?.chipStyle??"pill";G.dataset.chipStyle=J,G.className=xe("prompt-area-chip",J==="inline"&&"prompt-area-chip--inline",F?.chipClassName),G.textContent=`${ie.trigger}${ie.displayText}`,G.setAttribute("role","button"),G.setAttribute("tabindex","-1"),me.appendChild(G)}if(me.lastChild&&cm(me.lastChild)){const ie=document.createElement("br");ie.dataset.sentinel="true",me.appendChild(ie)}xw(me,N),oe&&kF(me,oe),le.current=ee,W.current=!1},[n,N]),ae=y.useCallback((ee,me)=>oe=>{const ie=m1(ee,me,{value:oe.value,displayText:oe.displayText,data:oe.data});t(ie.segments),L(ie.segments),u?.({type:"chip",trigger:me.config.char,value:oe.value,displayText:oe.displayText,...oe.data!==void 0?{data:oe.data}:{}});const G=A.current;G&&rr(G,ie.cursorOffset)},[t,L,u]),re=y.useCallback(()=>{const ee=A.current;if(!ee)return;const me=$(),oe=zn(me),ie=oa(ee);if(ie===null)return;const G=JH(oe,ie,n);if(B.current=null,K.current=null,G){M(G),O(0);const F=NF(ee,G.startOffset);if(F){const J=F.getBoundingClientRect();(J.height>0||J.left>0||J.top>0)&&H(J)}G.config.mode==="dropdown"&&G.config.onSearch&&z(G.query,G.config),G.config.mode==="callback"&&G.config.onActivate&&G.config.onActivate({text:oe,cursorPosition:ie,insertChip:ae(me,G)})}else M(null),V()},[n,$,ae,V,z]),ce=y.useCallback(()=>{B.current=null,K.current=null,M(null),O(0),V()},[V]),de=GF({editorRef:A,readSegmentsFromDOM:$,onChange:t,renderSegmentsToDOM:L,runTriggerDetection:re,dismissTrigger:ce,triggers:n,markdownEnabled:N,normalizeBullets:C,onPaste:p,onRawPaste:m,onUndo:b,onRedo:x,onChipAdd:u,onImagePaste:E});y.useEffect(()=>{if(!W.current&&!aF(e,le.current)){if(N&&C){const ee=dw(e,!0);if(ee!==e){t(ee);return}}L(e)}},[e,L,N,C,t]);const fe=y.useRef(N);y.useEffect(()=>{if(fe.current===N)return;fe.current=N;const ee=C?dw(e,N):e;ee!==e?t(ee):L(e)},[N,C,L,e,t]),y.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const Se=y.useCallback(()=>{if(W.current)return;if(de.isComposing.current){const F=$();le.current=F,t(F);return}const ee=A.current,me=ee?oa(ee):null;ee&&Mb(ee);const oe=$();if(k!=null&&ee&&zn(oe).length>k){const F=oa(ee),J=ZH(oe,k);le.current=J,t(J),L(J),rr(ee,F!=null?Math.min(F,k):k),re();return}if(N&&C&&ee&&me!==null){const F=oF(oe,me);if(F){le.current=F.segments,t(F.segments),L(F.segments),rr(ee,F.cursorOffset),re();return}}let ie=oe,G=null;if(N&&me!==null&&hR(zn(oe))){const F=hw(oe);F.edits.length>0&&(ie=F.segments,G=fw(me,F.edits))}P.current||(P.current=le.current),le.current=ie,t(ie),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{P.current&&(de.pushUndo(P.current),P.current=null),D.current=null},XF),ee&&(G!==null?(L(ie),rr(ee,G)):(xw(ee,N),me!==null&&rr(ee,me))),re()},[t,$,re,L,N,C,k,de]),He=y.useCallback(ee=>{const me=ee.target;if(!(me instanceof Node))return;const oe=A.current;if(!oe)return;let ie=me;for(;ie&&ie!==oe;){if(pF(ie)){if(ee.metaKey||ee.ctrlKey){ee.preventDefault(),h?.(ie.href),window.open(ie.href,"_blank","noopener,noreferrer");return}break}if(er(ie)){const G=ie.getBoundingClientRect(),F=document.createElement("span");F.className="prompt-area-chip-ripple";const J=Math.max(G.width,G.height);F.style.width=`${J}px`,F.style.height=`${J}px`,F.style.left=`${ee.clientX-G.left-J/2}px`,F.style.top=`${ee.clientY-G.top-J/2}px`,ie.appendChild(F),F.addEventListener("animationend",()=>F.remove());const Te=dm(ie);if(Te){const _e=n.find(ot=>ot.char===Te.trigger),Ve=X.current===ie;if(X.current=null,!r&&!Ve&&_e?.reopenOnChipClick&&_e.mode==="dropdown"&&_e.onSearch){const ot=Uh(oe,ie);B.current={chip:Te,segIndex:p1(oe,ot)},K.current=ie,M({config:_e,startOffset:0,query:""}),O(0),H(G),z("",_e)}l?.(Te)}return}ie=ie.parentNode}},[l,h,n,z,r]),Me=y.useCallback(ee=>{const me=ee.target,oe=A.current;if(!oe||!(me instanceof Node)){X.current=null;return}let ie=me;for(;ie&&ie!==oe;){if(er(ie)){X.current=K.current===ie?ie:null;return}ie=ie.parentNode}X.current=null},[]),Ee=y.useCallback((ee,me)=>{const oe=$(),ie=Uh(ee,me);if(ie===-1)return!1;const G=p1(ee,ie),F=oe[G],J=tF(oe,G);return t(J),L(J),F?.type==="chip"&&d?.(F),!0},[$,t,L,d]),Oe=y.useCallback((ee,me)=>{const oe=$(),ie=Uh(ee,me);if(ie===-1)return!1;const G=p1(ee,ie),F=oe[G],J=nF(oe,G);if(!J)return!1;let Te=0;for(let _e=0;_e<G;_e++){const Ve=oe[_e];Ve.type==="text"?Te+=Ve.text.length:Te+=Ve.trigger.length+Ve.displayText.length}return Te+=J.revertedText.length,t(J.segments),L(J.segments),rr(ee,Te),F?.type==="chip"&&d?.(F),!0},[$,t,L,d]),Be=y.useCallback(()=>{const ee=A.current;if(!ee)return!1;const me=$s();if(!me||!me.collapsed)return!1;const oe=me.startContainer,ie=me.startOffset;if(oe===ee&&ie>0){const G=ee.childNodes[ie-1];if(G&&er(G))return Ib(G)?Oe(ee,G):Ee(ee,G)}if(oe.nodeType===Node.TEXT_NODE&&ie===0){const G=Ob(ee,oe);if(!G)return!1;let F=G.previousSibling;for(;F&&F.nodeType===Node.TEXT_NODE&&F.textContent==="";)F=F.previousSibling;if(F&&er(F))return Ib(F)?Oe(ee,F):Ee(ee,F)}return!1},[Ee,Oe]),Ke=y.useCallback(()=>{const ee=A.current;if(!ee)return!1;const me=$s();if(!me||!me.collapsed)return!1;const oe=me.startContainer,ie=me.startOffset;if(oe===ee&&ie<ee.childNodes.length){const G=ee.childNodes[ie];if(G&&er(G))return Ee(ee,G)}if(oe.nodeType===Node.TEXT_NODE&&ie===(oe.textContent??"").length){const G=Ob(ee,oe);if(!G)return!1;let F=G.nextSibling;for(;F&&F.nodeType===Node.TEXT_NODE&&F.textContent==="";)F=F.nextSibling;if(F&&er(F))return Ee(ee,F)}return!1},[Ee]),$e=y.useCallback(ee=>{const me=$(),oe=ee.query,ie={value:oe,label:oe},G=ee.config.onSelect?.(ie)??oe,F={value:oe,displayText:G||oe,autoResolved:!0},J=m1(me,ee,F);t(J.segments),L(J.segments),u?.({type:"chip",trigger:ee.config.char,...F});const Te=A.current;Te&&rr(Te,J.cursorOffset),ce()},[$,t,L,ce,u]),De=y.useCallback(ee=>{if(!R)return;const me=$(),oe=R.config.insertAsText?.(ee);if(oe!==void 0){const _e=eF(me,R,oe);de.pushUndo(me),t(_e.segments),L(_e.segments);const Ve=A.current;Ve&&rr(Ve,_e.cursorOffset),ce(),setTimeout(()=>{A.current?.focus()},0);return}const ie=R.config.onSelect?.(ee)??ee.label,G={value:ee.value,displayText:ie||ee.label,data:ee.data},F=B.current;if(F){const _e=A.current;if(_e&&!r){const Ve=me[F.segIndex],tt=Ve?.type==="chip"&&Ve.trigger===F.chip.trigger&&Ve.value===F.chip.value?F.segIndex:(()=>{const ut=[];return me.forEach((qe,Rt)=>{qe.type==="chip"&&qe.trigger===F.chip.trigger&&qe.value===F.chip.value&&ut.push(Rt)}),ut.length===1?ut[0]:-1})(),dt=tt!==-1?me[tt]:void 0;if(dt?.type==="chip"){const ut={type:"chip",trigger:R.config.char,...G};let qe=me.map((Zt,$t)=>$t===tt?ut:Zt);const Rt=qe[tt+1],jt=!Rt||Rt.type!=="text"||Rt.text.length===0;jt&&(qe=[...qe.slice(0,tt+1),{type:"text",text:" "},...qe.slice(tt+1)]),de.pushUndo(me),t(qe),L(qe),dt.value===ut.value&&dt.displayText===ut.displayText&&zh(dt.data)===zh(ut.data)||(d?.(dt),u?.(ut));const Lt=zn(qe.slice(0,tt+1)).length+(jt?1:0);rr(_e,Lt)}}ce(),setTimeout(()=>{A.current?.focus()},0);return}const J=m1(me,R,G);t(J.segments),L(J.segments),u?.({type:"chip",trigger:R.config.char,...G});const Te=A.current;Te&&rr(Te,J.cursorOffset),ce(),setTimeout(()=>{A.current?.focus()},0)},[R,$,t,L,ce,u,d,de,r]),ke=De;y.useEffect(()=>{const ee=B.current;if(!ee||!R?.config.reopenOnChipClick)return;const me=Z.findIndex(oe=>oe.value===ee.chip.value);me>0&&O(me)},[Z,R]);const ve=y.useCallback(ee=>{const me=(F,J)=>{let{segments:Te,cursorOffset:_e}=J;if(N){const Ve=hw(Te);Te=Ve.segments,_e=fw(_e,Ve.edits)}le.current=Te,t(Te),L(Te),rr(F,_e)},oe=F=>{if(!N)return!1;const J=$(),Te=oa(F);if(Te===null)return!1;const _e=zn(J);if(!Zl(_e,Te))return!1;const Ve=lF(J,Te);return Ve&&me(F,Ve),!0};if((ee.metaKey||ee.ctrlKey)&&ee.key==="z"&&P.current&&(D.current&&(clearTimeout(D.current),D.current=null),de.pushUndo(P.current),P.current=null),de.handleKeyDownForUndoRedo(ee))return;if(N&&(ee.metaKey||ee.ctrlKey)&&!ee.shiftKey&&(ee.key==="b"||ee.key==="i")){ee.preventDefault();const F=A.current;if(!F)return;const J=bh(F);if(!J||J.start===J.end)return;const Te=ee.key==="b"?"**":"*",_e=$();de.pushUndo(_e);const Ve=iF(_e,J.start,J.end,Te);if(!Ve)return;le.current=Ve.segments,t(Ve.segments),L(Ve.segments),yw(F,Ve.selectionStart,Ve.selectionEnd);return}if(!ee.metaKey&&!ee.ctrlKey&&!ee.altKey&&!ee.nativeEvent.isComposing&&ee.key.length===1){const F=n.find(Te=>Te.mode==="launch"&&Te.char===ee.key),J=A.current;if(F?.onActivate&&J){const Te=oa(J);if(Te!==null){const _e=$(),Ve=zn(_e);if(um(Ve,Te,F.position)){ee.preventDefault(),F.onActivate({text:Ve,cursorPosition:Te,insertChip:ae(hr(_e,Te,Te,F.char),{config:F,startOffset:Te,query:""})});return}}}}if(R&&R.config.mode==="dropdown"&&(Z.length>0||te||q!==null||!!R.config.emptyMessage)){if(ee.key==="ArrowDown"){ee.preventDefault(),Z.length>0&&O(F=>Math.min(F+1,Z.length-1));return}if(ee.key==="ArrowUp"){ee.preventDefault(),Z.length>0&&O(F=>Math.max(F-1,0));return}if(ee.key==="Enter"||ee.key==="Tab"){ee.preventDefault();const F=Z[_];F&&De(F);return}if(ee.key==="Escape"){ee.preventDefault(),ce();return}}if(ee.key===" "&&R&&R.config.resolveOnSpace&&R.query.trim().length>0){ee.preventDefault(),$e(R);return}if(N&&ee.key==="Tab"&&!R){const F=A.current;if(F){const J=$(),Te=zn(J),_e=oa(F);if(_e!==null&&Zl(Te,_e)){ee.preventDefault();const ot=ee.shiftKey?dF(J,_e):cF(J,_e);ot&&me(F,ot);return}}}const G=F=>{const J=bh(F);if(!J)return;const Te=$();de.pushUndo(Te);const _e=hr(Te,J.start,J.end,`
540
- `);me(F,{segments:_e,cursorOffset:J.start+1})};if(ee.key==="Enter"&&ee.shiftKey&&!ee.nativeEvent.isComposing){ee.preventDefault();const F=A.current;F&&!oe(F)&&G(F);return}if(ee.key==="Enter"&&!ee.shiftKey&&!ee.nativeEvent.isComposing){const F=A.current;if(F&&oe(F)){ee.preventDefault();return}if(S){ee.preventDefault(),s?.($());return}ee.preventDefault(),F&&G(F);return}if(ee.key==="Escape"&&a){a();return}if((ee.key==="Backspace"||ee.key==="Delete")&&!ee.nativeEvent.isComposing){const F=A.current;if(F){const J=bh(F);if(J&&J.start!==J.end){ee.preventDefault();const Te=$();de.pushUndo(Te);const _e=hr(Te,J.start,J.end,"");me(F,{segments:_e,cursorOffset:J.start}),re();return}}}if(ee.key==="Backspace"){const F=A.current;if(F){const J=$(),Te=oa(F);if(N&&Te!==null){const _e=fF(J,Te);if(_e){ee.preventDefault(),me(F,_e),re();return}}}if(Be()){ee.preventDefault(),re();return}}if(ee.key==="Delete"&&Ke()){ee.preventDefault(),re();return}},[R,Z,te,q,_,s,S,a,$,t,L,N,ce,Be,Ke,$e,re,De,de,n,ae]),Ie=y.useMemo(()=>({focus:()=>A.current?.focus(),blur:()=>A.current?.blur(),insertChip:ee=>{const me=$(),oe={type:"chip",...ee},ie=[...me,oe,{type:"text",text:" "}];t(ie),L(ie),u?.(oe)},getPlainText:()=>zn($()),clear:()=>{t([]);const ee=A.current;if(ee)for(;ee.firstChild;)ee.removeChild(ee.firstChild);de.resetUndoHistory(),D.current&&(clearTimeout(D.current),D.current=null),P.current=null},setText:ee=>{de.pushUndo($());const me=QH(ee);t(me),L(me);const oe=A.current;oe&&rr(oe,ee.length)},appendText:ee=>{const me=$();de.pushUndo(me);const oe=me[me.length-1],ie=oe?.type==="text"?[...me.slice(0,-1),{type:"text",text:oe.text+ee}]:[...me,{type:"text",text:ee}];t(ie),L(ie);const G=A.current;G&&rr(G,zn(ie).length)},getCursorPosition:()=>{const ee=A.current;return ee?oa(ee):null},setCursorPosition:ee=>{const me=A.current;me&&rr(me,ee)},setCursorToEnd:()=>{const ee=A.current;ee&&rr(ee,zn($()).length)},getSelection:()=>{const ee=A.current;return ee?bh(ee):null},setSelection:(ee,me)=>{const oe=A.current;oe&&yw(oe,ee,me)}}),[$,t,L,u,de]),je=y.useMemo(()=>({onPaste:de.handlePaste,onCopy:de.handleCopy,onCut:de.handleCut,onDrop:de.handleDrop,onDragOver:de.handleDragOver,onCompositionStart:de.handleCompositionStart,onCompositionEnd:de.handleCompositionEnd,onBlur:de.handleBlur}),[de.handlePaste,de.handleCopy,de.handleCut,de.handleDrop,de.handleDragOver,de.handleCompositionStart,de.handleCompositionEnd,de.handleBlur]);return{editorRef:A,activeTrigger:R,suggestions:Z,suggestionsLoading:te,suggestionsError:q,selectedSuggestionIndex:_,handleInput:Se,handleKeyDown:ve,handleClick:He,handleMouseDown:Me,selectSuggestion:ke,dismissTrigger:ce,handle:Ie,triggerRect:j,eventHandlers:je}}const vw=240;function QF({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:s,onSelect:a,onDismiss:l,triggerRect:u,triggerChar:d}){const h=y.useRef(null),p=y.useRef(null);if(y.useEffect(()=>{p.current?.scrollIntoView({block:"nearest"})},[s]),y.useEffect(()=>{const C=S=>{const k=S.target;h.current&&k instanceof Node&&!h.current.contains(k)&&l()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[l]),!u||e.length===0&&!t&&!n&&!r)return null;const m=Math.min(320,window.innerWidth-16),b=Math.min(u.left,window.innerWidth-m-8),x=window.innerHeight-u.bottom,E=x<vw&&u.top>x,N={position:"fixed",left:`${Math.max(8,b)}px`,zIndex:50,maxWidth:`${m}px`,maxHeight:`${vw}px`,...E?{bottom:`${window.innerHeight-u.top+4}px`}:{top:`${u.bottom+4}px`}};return f.jsx("div",{ref:h,className:xe("min-w-[200px] overflow-y-auto","bg-surface rounded-xl border p-2 shadow-md","animate-in fade-in-0 zoom-in-95"),style:N,role:"listbox","aria-label":`${d} suggestions`,children:t?f.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:"Loading suggestions..."}):n?f.jsx("div",{role:"option","aria-selected":!1,className:"text-destructive px-3 py-2 text-sm",children:n}):e.length===0&&r?f.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:r}):e.map((C,S)=>f.jsxs("button",{ref:S===s?p:void 0,type:"button",role:"option","aria-selected":S===s,className:xe("text-foreground flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-sm","hover:bg-surface-hover cursor-pointer transition-colors",S===s&&"bg-surface-hover"),onMouseDown:k=>{k.preventDefault(),a(C)},children:[C.icon&&f.jsx("span",{className:"mt-0.5 shrink-0",children:C.icon}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-medium",children:C.label}),C.description&&f.jsx("div",{className:"text-muted-foreground truncate text-xs",children:C.description})]})]},C.value))})}function ZF({texts:e,interval:t=3e3}){const[n,r]=y.useState(0);return y.useEffect(()=>{if(e.length<=1)return;const s=setInterval(()=>{r(a=>(a+1)%e.length)},t);return()=>clearInterval(s)},[e.length,t]),f.jsx("div",{className:"pointer-events-none absolute top-0 left-0 overflow-hidden select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:f.jsx("div",{className:"animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out",children:e[n]},n)})}function SR({onClick:e,label:t,className:n}){return f.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),e()},className:xe("absolute top-0.5 right-0.5 grid h-3.5 w-3.5 cursor-pointer place-items-center","rounded-full bg-black/60 text-white hover:bg-black/80 dark:bg-white/60 dark:text-black dark:hover:bg-white/80","transition-colors",n),"aria-label":t,children:f.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[f.jsx("line",{x1:"2.75",y1:"2.75",x2:"7.25",y2:"7.25"}),f.jsx("line",{x1:"7.25",y1:"2.75",x2:"2.75",y2:"7.25"})]})})}function JF({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:f.jsx("div",{className:xe("flex flex-wrap gap-2",r),role:"list","aria-label":"Attached images",children:e.map(s=>f.jsxs("div",{role:"listitem",className:xe("border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border",n&&"cursor-pointer"),onClick:()=>n?.(s),children:[f.jsx("img",{src:s.url,alt:s.alt??"Attached image",className:"h-full w-full object-cover"}),s.loading&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:f.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),t&&f.jsx(SR,{onClick:()=>t(s),label:`Remove ${s.alt??"image"}`})]},s.id))})}function Cd({className:e,children:t}){return f.jsx("svg",{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","aria-hidden":"true",className:e,children:t})}const ap=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}),f.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"})]}),e$=({className:e})=>f.jsx(Cd,{className:e,children:ap}),t$=({className:e})=>f.jsxs(Cd,{className:e,children:[ap,f.jsx("path",{d:"M10 9H8"}),f.jsx("path",{d:"M16 13H8"}),f.jsx("path",{d:"M16 17H8"})]}),n$=({className:e})=>f.jsxs(Cd,{className:e,children:[ap,f.jsx("path",{d:"M8 13h2"}),f.jsx("path",{d:"M14 13h2"}),f.jsx("path",{d:"M8 17h2"}),f.jsx("path",{d:"M14 17h2"})]}),r$=({className:e})=>f.jsxs(Cd,{className:e,children:[ap,f.jsx("path",{d:"M10 12.5 8 15l2 2.5"}),f.jsx("path",{d:"m14 12.5 2 2.5-2 2.5"})]}),s$=({className:e})=>f.jsxs(Cd,{className:e,children:[f.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),f.jsx("circle",{cx:"9",cy:"9",r:"2"}),f.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),xh=3;function i$(e){return e?e==="application/pdf"?"pdf":e.includes("spreadsheet")||e==="text/csv"?"spreadsheet":e.startsWith("text/")||e.includes("javascript")||e.includes("json")||e.includes("xml")?"code":e.startsWith("image/")?"image":"default":"default"}const a$={pdf:t$,spreadsheet:n$,code:r$,image:s$,default:e$};function o$(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function l$(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function Ew({file:e,compact:t,onRemove:n,onClick:r}){const s=l$(e.name),a=e.size!=null?o$(e.size):null,l=[s,a].filter(Boolean).join(" · ");return f.jsxs("div",{role:"listitem",className:xe("border-border relative flex flex-shrink-0 items-center gap-2 overflow-hidden rounded-lg border transition-colors","hover:bg-surface-hover",t?"h-10 w-36 px-2":"h-14 w-48 px-3",r&&"cursor-pointer"),onClick:()=>r?.(e),children:[(()=>{const u=a$[i$(e.type)];return f.jsx(u,{className:xe("text-muted-foreground flex-shrink-0",t?"h-4 w-4":"h-5 w-5")})})(),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:xe("truncate font-medium",t?"text-xs":"text-sm"),title:e.name,children:e.name}),!t&&l&&f.jsx("div",{className:"text-muted-foreground truncate text-xs",children:l})]}),e.loading&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:f.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),n&&f.jsx(SR,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function u$({files:e,onRemove:t,onClick:n,className:r}){const[s,a]=y.useState(!1),l=y.useRef(null),u=y.useRef(null);if(y.useEffect(()=>{if(!s)return;const b=x=>{const E=x.target;E instanceof Node&&l.current&&!l.current.contains(E)&&!u.current?.contains(E)&&a(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]),e.length===0)return null;const d=e.length>xh,h=d,p=e.length-xh,m=e.slice(0,xh);return f.jsxs("div",{className:xe("relative",r),children:[f.jsxs("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"Attached files",children:[(d?m:e).map(b=>f.jsx(Ew,{file:b,compact:h,onRemove:t,onClick:n},b.id)),d&&f.jsx("div",{role:"listitem",children:f.jsx("button",{ref:u,type:"button",onClick:()=>a(b=>!b),className:xe("border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors",h?"h-10 px-3 text-xs":"h-14 px-4 text-sm"),children:s?"Show less":`+${p} more`})})]}),s&&f.jsx("div",{ref:l,className:xe("bg-surface border-border absolute bottom-full left-0 z-10 mb-2 max-h-48 overflow-y-auto rounded-lg border p-2 shadow-lg"),children:f.jsx("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"More attached files",children:e.slice(xh).map(b=>f.jsx(Ew,{file:b,compact:h,onRemove:t,onClick:n},b.id))})})]})}function Tw({value:e,onChange:t,triggers:n,placeholder:r,className:s,disabled:a=!1,markdown:l,normalizeBullets:u,onSubmit:d,onEscape:h,onChipClick:p,onChipAdd:m,onChipDelete:b,onLinkClick:x,onPaste:E,onUndo:N,onRedo:C,minHeight:S=80,maxHeight:k,autoFocus:A=!1,autoGrow:R=!1,"aria-label":M,"data-test-id":_,images:O=[],imagePosition:j="above",onImagePaste:H,onImageRemove:B,onImageClick:K,files:X=[],filePosition:Z="above",onFileRemove:te,onFileClick:q,onKeyDown:z,onBlur:V,onRawPaste:W,submitOnEnter:le,spellCheck:D,maxLength:P,"aria-describedby":$,ref:L}){const{editorRef:ae,activeTrigger:re,suggestions:ce,suggestionsLoading:de,suggestionsError:fe,selectedSuggestionIndex:Se,handleInput:He,handleKeyDown:Me,handleClick:Ee,handleMouseDown:Oe,selectSuggestion:Be,dismissTrigger:Ke,handle:$e,triggerRect:De,eventHandlers:ke}=WF({value:e,onChange:t,triggers:n,disabled:a,onSubmit:d,onEscape:h,onChipClick:p,onChipAdd:m,onChipDelete:b,onLinkClick:x,onPaste:E,onRawPaste:W,onUndo:N,onRedo:C,onImagePaste:H,markdown:l,normalizeBullets:u,submitOnEnter:le,maxLength:P});y.useImperativeHandle(L,()=>$e,[$e]),y.useEffect(()=>{A&&ae.current?.focus()},[A,ae]);const[ve,Ie]=y.useState(!1),[je,ee]=y.useState(void 0),me=y.useCallback(()=>{const qe=ae.current;if(!qe)return;qe.style.height="auto";const Rt=qe.scrollHeight;qe.style.height=`${Rt}px`,ee(Rt)},[ae]),oe=y.useCallback(()=>{R&&(Ie(!0),me())},[R,me]),ie=y.useCallback(()=>{ke.onBlur(),R&&setTimeout(()=>{const qe=ae.current;if(!qe)return;const Rt=document.activeElement;Rt&&qe.parentElement?.contains(Rt)||(Ie(!1),ee(void 0))},TR)},[ke,R,ae]),G=y.useCallback(()=>{He(),R&&ve&&me()},[He,R,ve,me]);y.useEffect(()=>{R&&ve&&requestAnimationFrame(()=>me())},[e,R,ve,me]);const[F,J]=y.useState(!1),Te=y.useRef(null);y.useEffect(()=>{if(!R)return;const qe=()=>{if(ve){J(!1);return}const jt=ae.current;jt&&J(jt.scrollHeight>jt.clientHeight)},Rt=ve?0:160;return Te.current=setTimeout(qe,Rt),()=>{Te.current!==null&&clearTimeout(Te.current)}},[R,ve,e,ae]);const _e=y.useMemo(()=>{if(!R){const qe={minHeight:`${S}px`};return k&&(qe.maxHeight=`${k}px`,qe.overflowY="auto"),qe}return{height:ve&&je?`${je}px`:`${S}px`,minHeight:`${S}px`,maxHeight:k?`${k}px`:"70dvh",overflowY:ve?"auto":"hidden",transition:"height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)"}},[R,S,k,ve,je]),Ve=y.useCallback(qe=>{z?.(qe),!qe.defaultPrevented&&Me(qe)},[z,Me]),ot=y.useCallback(qe=>{V?.(qe),ie()},[V,ie]),tt=e.length===0||e.length===1&&e[0].type==="text"&&e[0].text==="",dt=O.length>0?f.jsx(JF,{images:O,onRemove:B,onClick:K,className:j==="above"?"pb-2":"pt-2"}):null,ut=X.length>0?f.jsx(u$,{files:X,onRemove:te,onClick:q,className:Z==="above"?"pb-2":"pt-2"}):null;return f.jsxs("div",{className:xe("prompt-area-container relative text-sm leading-relaxed",s),children:[j==="above"&&dt,Z==="above"&&ut,f.jsxs("div",{className:"relative",children:[f.jsx("div",{ref:ae,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-label":M??"Text input","aria-multiline":"true","aria-disabled":a||void 0,"aria-describedby":$,"data-test-id":_,spellCheck:D,className:xe("prompt-area-editor","w-full min-w-0 break-words whitespace-pre-wrap outline-none",a&&"cursor-not-allowed opacity-50"),style:_e,onFocus:oe,onInput:R?G:He,onKeyDown:Ve,onMouseDown:Oe,onClick:Ee,onPaste:ke.onPaste,onCopy:ke.onCopy,onCut:ke.onCut,onDrop:ke.onDrop,onDragOver:ke.onDragOver,onCompositionStart:ke.onCompositionStart,onCompositionEnd:ke.onCompositionEnd,onBlur:ot}),R&&F&&!ve&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer",style:{height:"32px"},onClick:()=>ae.current?.focus(),children:f.jsx("div",{className:"h-full w-full",style:{background:"linear-gradient(to bottom, transparent, color-mix(in srgb, var(--prompt-area-surface, var(--background)) 80%, transparent), var(--prompt-area-surface, var(--background)))"}})}),tt&&r&&(Array.isArray(r)?f.jsx(ZF,{texts:r}):f.jsx("div",{className:"pointer-events-none absolute top-0 left-0 select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:r}))]}),Z==="below"&&ut,j==="below"&&dt,re&&re.config.mode==="dropdown"&&f.jsx(QF,{suggestions:ce,loading:de,error:fe,emptyMessage:re.config.emptyMessage,selectedIndex:Se,onSelect:Be,onDismiss:Ke,triggerRect:De,triggerChar:re.config.char})]})}function c$(e={}){const{initialValue:t=[]}=e,[n,r]=y.useState(t),s=y.useRef(null),a=y.useMemo(()=>zn(n),[n]),l=y.useMemo(()=>n.length===0?!0:n.every(E=>E.type==="text"&&E.text.trim()===""),[n]),u=y.useMemo(()=>n.some(E=>E.type==="chip"),[n]),d=y.useMemo(()=>n.filter(E=>E.type==="chip"),[n]),h=y.useMemo(()=>({ref:s,value:n,onChange:r}),[n]),p=y.useCallback(()=>{s.current?s.current.clear():r([])},[]),m=y.useCallback(()=>s.current?.focus(),[]),b=y.useCallback(()=>s.current?.blur(),[]),x=y.useCallback(E=>s.current?.insertChip(E),[]);return{bind:h,plainText:a,isEmpty:l,hasChips:u,chips:d,clear:p,focus:m,blur:b,insertChip:x}}function d$(e={}){const{char:t="@",...n}=e;return{char:t,position:"any",mode:"dropdown",chipStyle:"pill",accessibilityLabel:"mention",...n}}function Sw(e={}){const{char:t="/",position:n="any",...r}=e;return{char:t,position:n,mode:"dropdown",chipStyle:"inline",accessibilityLabel:"command",...r}}const CR=["attention","working","idle","ended"],wR={attention:"Needs attention",working:"Working",idle:"Idle",ended:"Ended"};function kR(e){return e.pendingPermissionCount>0||e.status==="awaiting_approval"?"attention":e.status==="running"||e.status==="starting"?"working":e.status==="failed"||e.status==="closed"?"ended":"idle"}const Lb={search:"",gateways:[],adapters:[],states:[],scoped:!0,groupBy:"state",sortBy:"recent"};function f$(e){return[...new Set(e.map(t=>t.adapter))].sort()}function Jl(e){return e.title??e.id.slice(0,8)}function h$(e,t){return t?Jl(e.info).toLowerCase().includes(t)||e.info.cwd.toLowerCase().includes(t)||e.hostName.toLowerCase().includes(t)||e.adapter.toLowerCase().includes(t)||e.info.id.startsWith(t):!0}function Cw(e){return e.replace(/\\/g,"/").replace(/\/+$/,"")}function m$(e,t){const n=Cw(e),r=Cw(t);return r===n||r.startsWith(`${n}/`)}function p$(e,t){return t.roots.some(n=>(n.hostId?n.hostId.toLowerCase()===e.hostId.toLowerCase():e.local)&&m$(n.path,e.info.cwd))}function NR(e,t){return e.scoped&&t!==void 0}function AR(e,t,n){const r=t.search.trim().toLowerCase(),s=NR(t,n)?n:void 0;return e.filter(a=>(t.gateways.length===0||t.gateways.includes(a.hostId))&&(t.adapters.length===0||t.adapters.includes(a.adapter))&&(t.states.length===0||t.states.includes(a.state))&&(!s||p$(a,s))&&h$(a,r))}function g$(e,t){return t==="gateway"?e.hostId:t==="adapter"?e.adapter:e.state}function _R(e,t){return t==="gateway"?e.hostName:t==="adapter"?e.adapter:wR[e.state]}function Db(e,t){return t==="state"?String(CR.indexOf(e.state)):_R(e,t).toLowerCase()}const b1=(e,t)=>(t.info.lastActivityAt??t.info.createdAt)-(e.info.lastActivityAt??e.info.createdAt);function b$(e,t,n){return n==="recent"?b1(e,t):n==="name"?Jl(e.info).localeCompare(Jl(t.info),void 0,{sensitivity:"base"})||b1(e,t):Db(e,n).localeCompare(Db(t,n))||b1(e,t)}function x$(e,t){const n=[...e].sort((a,l)=>b$(a,l,t.sortBy));if(t.groupBy==="none")return n.length?[{key:"all",rows:n}]:[];const r=t.groupBy,s=new Map;for(const a of n){const l=g$(a,r),u=s.get(l);u?u.rows.push(a):s.set(l,{key:l,label:_R(a,r),rank:Db(a,r),rows:[a]})}return[...s.values()].sort((a,l)=>a.rank.localeCompare(l.rank))}function y$(e,t,n,r){if(n>=r)return;const s=[];t&&NR(e,t)&&s.push(t.label);const a=(e.gateways.length?1:0)+(e.adapters.length?1:0)+(e.states.length?1:0);return a>0&&s.push(`${a} filter${a===1?"":"s"}`),e.search.trim()&&s.push("search"),{shown:n,total:r,causes:s}}function v$(e){return e.search.trim().length>0||e.gateways.length>0||e.adapters.length>0||e.states.length>0}function ww(e){return{...Lb,scoped:!1,groupBy:e.groupBy,sortBy:e.sortBy}}const E$=720*60*60*1e3,T$=6e4,x1=(e,t)=>`${e}:${t}`;class S${#t;#n;constructor(t){this.#t=t,this.#n={...t.read()}}get(t,n){return this.#n[x1(t,n)]}all(){return this.#n}mark(t,n,r,s=Date.now()){const a=x1(t,n),l=this.#n[a],u={itemCount:Math.max(l?.itemCount??0,r.itemCount??0),activity:Math.max(l?.activity??0,r.activity??0),turns:Math.max(l?.turns??0,r.turns??0),seenAt:s};return l&&l.itemCount===u.itemCount&&l.activity===u.activity&&l.turns===u.turns&&u.seenAt-l.seenAt<T$?!1:(this.#n[a]=u,this.#t.write(this.#r(s)),!0)}forget(t,n){const r=x1(t,n);r in this.#n&&(delete this.#n[r],this.#t.write(this.#n))}#r(t){const n=t-E$;for(const[r,s]of Object.entries(this.#n))s.seenAt<n&&delete this.#n[r];return this.#n}}function C$(e,t){return e?t.activityCount!==void 0?Math.max(0,t.activityCount-e.activity):Math.max(0,(t.turns??0)-e.turns):0}const RR=7,wd={claude:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions","plan","dontAsk","auto"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!0,sessionMcpServers:!0,slashCommands:!0,skillsList:!1,settingSources:!0,budgets:!0,attachments:["image","pdf","text"],reasoningEfforts:["low","medium","high","xhigh","max"],vfs:!1,streaming:"token"},codex:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!0,settingSources:!1,budgets:!1,attachments:["image","text"],reasoningEfforts:["minimal","low","medium","high","xhigh"],vfs:!1,streaming:"token"},provider:{interactiveApprovals:!1,permissionModes:["default","bypassPermissions","dontAsk"],defaultPermissionMode:"default",resume:!1,resumeBackfill:!1,listSessions:!1,contextUsage:!1,rateLimits:!1,mcpStatus:!1,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!1,settingSources:!1,budgets:!1,attachments:["image","pdf","text"],vfs:!0,streaming:"token"}};wd.provider.permissionModes;const w$={status:"starting",capabilities:wd.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},y1="streaming",yh="streaming-thinking";function k$(e){return e===void 0?"":typeof e=="string"?e:e.map(t=>typeof t.text=="string"?t.text:"").filter(Boolean).join(`
541
- `)}function kw(e){return typeof e=="string"?[{type:"text",text:e}]:e}function N$(e){if(e.type==="text")return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}const A$=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/;function to(e,t){const n=e.findIndex(s=>s.id===t.id&&s.kind===t.kind);if(n===-1)return[...e,t];const r=[...e];return r[n]=t,r}function _$(e,t){const n=t.engine??e.engine;return{...e,status:e.lastSeq===0?t.status:e.status,model:e.model??t.model,permissionMode:e.permissionMode??t.permissionMode,cwd:e.cwd??t.cwd,sdkSessionId:e.sdkSessionId??t.sdkSessionId,engine:n,capabilities:t.capabilities??wd[n??"claude"],session:t}}function R$(e){const t=Object.entries(e.rateLimits??{}).filter(([,s])=>s.utilization!==void 0).map(([s,a])=>({key:s,info:a})),n=["five_hour","seven_day"].flatMap(s=>t.filter(a=>a.key===s)),r=t.filter(s=>s.key.startsWith("seven_day_")).sort((s,a)=>s.key.localeCompare(a.key));return[...n,...r]}function I$(e,t){if(t.seq<=e.lastSeq)return e;const n={...e,lastSeq:t.seq};switch(t.type){case"system_init":return{...n,model:t.model,cwd:t.cwd,sdkSessionId:t.sdkSessionId,permissionMode:t.permissionMode};case"status_changed":return{...n,status:t.status,statusDetail:t.detail};case"capabilities":return{...n,models:t.models,commands:t.commands,defaultModel:t.defaultModel??n.defaultModel};case"skills":return{...n,skills:t.skills};case"file_produced":return{...n,producedFiles:{...n.producedFiles,[t.path]:{fileId:t.fileId,...t.mediaType?{mediaType:t.mediaType}:{},...t.bytes!==void 0?{bytes:t.bytes}:{}}}};case"model_changed":return t.model===void 0?n:{...n,model:t.model};case"permission_mode_changed":return{...n,permissionMode:t.mode};case"context_usage":return{...n,contextUsage:t.usage};case"rate_limit":{const r=t.info.rateLimitType;return r?{...n,rateLimits:{...n.rateLimits,[r]:t.info},rateLimitsUpdatedAt:t.ts}:n}case"plan_info":return{...n,subscriptionType:t.subscriptionType};case"user_message":{let r=n.items;for(const s of kw(t.message.content))if(s.type==="tool_result"){const a=s,l=a.is_error===!0;r=r.map(u=>u.kind==="tool_call"&&u.id===a.tool_use_id?{...u,status:l?"failed":"settled",result:{text:k$(a.content),isError:l}}:u)}else if(s.type==="text"&&!t.synthetic){const a=s.text,l=A$.exec(a.trim());l?r=to(r,{kind:"notice",id:t.uuid??`user-${t.seq}`,level:l[1]==="stderr"?"error":"info",text:l[2].trim()}):r=to(r,{kind:"user",id:t.uuid??`user-${t.seq}`,text:a,attachments:t.attachments})}return{...n,items:r}}case"assistant_message":{let r=n.items.find(l=>l.kind==="thinking"&&l.id===yh)?.text??"",s=n.items.filter(l=>!(l.kind==="assistant_text"&&l.id===y1)&&!(l.kind==="thinking"&&l.id===yh));return kw(t.message.content).forEach((l,u)=>{const d=`${t.uuid}-${u}`;if(l.type==="text")s=to(s,{kind:"assistant_text",id:d,text:l.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(l.type==="thinking"){const h=l.thinking||r;if(r="",h.trim()==="")return;s=to(s,{kind:"thinking",id:d,text:h,parentToolUseId:t.parentToolUseId})}else if(l.type==="tool_use"){const h=l;s=to(s,{kind:"tool_call",id:h.id,name:h.name,input:h.input,parentToolUseId:t.parentToolUseId,status:"running"})}}),{...n,items:s}}case"stream_delta":{const r=t.event;if(r.type!=="content_block_delta")return n;if(r.delta?.type==="text_delta"){const s=n.items.find(l=>l.kind==="assistant_text"&&l.id===y1),a={kind:"assistant_text",id:y1,text:(s?.text??"")+(r.delta.text??""),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:to(n.items,a)}}if(r.delta?.type==="thinking_delta"){const s=n.items.find(l=>l.kind==="thinking"&&l.id===yh),a={kind:"thinking",id:yh,text:(s?.text??"")+(r.delta.thinking??""),parentToolUseId:t.parentToolUseId};return{...n,items:to(n.items,a)}}return n}case"turn_result":return{...n,totalCostUsd:t.totalCostUsd,items:[...n.items,{kind:"turn_result",id:`turn-${t.seq}`,subtype:t.subtype,isError:t.isError,durationMs:t.durationMs,totalCostUsd:t.totalCostUsd,errors:t.errors}]};case"permission_requested":return{...n,pendingApprovals:[...n.pendingApprovals,t.request]};case"permission_resolved":return{...n,pendingApprovals:n.pendingApprovals.filter(r=>r.id!==t.requestId)};case"execution_dispatched":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:t.deferred?"deferred":"pending",executionId:t.executionId,backend:t.backend}:r)};case"execution_result":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"settled",executionId:t.executionId,result:{text:N$(t.output),isError:!1},logs:t.logs??r.logs}:r)};case"execution_failed":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"failed",executionId:t.executionId,result:{text:`${t.reason}: ${t.error}`,isError:!0},logs:t.logs??r.logs}:r)};case"file_delivered":return{...n,items:[...n.items,{kind:"file_delivered",id:`file-${t.seq}`,path:t.path,bytes:t.bytes,description:t.description}]};case"session_error":return{...n,items:[...n.items,{kind:"notice",id:`err-${t.seq}`,level:"error",text:t.message}]};case"session_closed":return{...n,items:[...n.items,{kind:"notice",id:`closed-${t.seq}`,level:"info",text:`Session closed (${t.reason})`}]};case"sdk_event":default:return n}}function O$(e,t){return t.type==="attached"?_$(e,t.session):I$(e,t)}const M$=3;function L$(e,t,n){const[r,s]=y.useReducer(O$,w$),[a,l]=y.useState("reconnecting"),[u,d]=y.useState(),[h,p]=y.useState(),m=y.useRef(null),b=y.useRef(n?.onProtocolError);b.current=n?.onProtocolError,y.useEffect(()=>{if(!t)return;const C=e.attach(t);m.current=C,p(C);const S=C.on("event",_=>s(_)),k=C.on("attached",_=>{s(_),d(_.protocolVersion===RR?void 0:_.protocolVersion)}),A=C.on("connectionChange",_=>l(_?"live":"reconnecting")),R=C.on("reconnectAttempt",_=>l(_>=M$?"offline":"reconnecting")),M=C.on("protocolError",_=>{b.current?.(_)});return()=>{S(),k(),A(),R(),M(),C.detach(),m.current=null,p(void 0),l("reconnecting"),d(void 0)}},[e,t]);const x=D$(e,t,r),E=a==="live",N=y.useCallback(()=>m.current?.reconnectNow(),[]);return y.useMemo(()=>({state:r,connected:E,connection:a,protocolMismatch:u,models:x,effectiveModel:r.model??r.defaultModel,handle:h,send:(C,S)=>m.current?.send(C,S),approve:(C,S)=>m.current?.approve(C,S),deny:(C,S,k)=>m.current?.deny(C,S,k),interrupt:()=>m.current?.interrupt(),setPermissionMode:C=>m.current?.setPermissionMode(C),setModel:C=>m.current?.setModel(C),closeSession:()=>m.current?.closeSession(),reconnectNow:N}),[r,E,a,u,x,h,N])}function D$(e,t,n){const[r,s]=y.useState([]),a=n.session?.profile,l=n.models,u=!!l?.length;return y.useEffect(()=>s([]),[t]),y.useEffect(()=>{if(!a||u)return;let d=!1;return e.listProfiles().then(h=>{d||s(h.profiles.find(p=>p.name===a)?.models??[])}).catch(()=>{}),()=>{d=!0}},[e,a,u]),u?l:r}function j$(e){const t=e.split(";")[0].trim().toLowerCase();if(t.startsWith("image/"))return"image";if(t==="application/pdf")return"pdf";if(t.startsWith("text/")||P$.has(t))return"text"}const P$=new Set(["application/json","application/xml","application/yaml","application/x-yaml","application/toml","application/javascript","application/typescript","application/x-sh","application/sql"]),Nw=1568;function B$(e,t,{capabilities:n,engine:r}){const[s,a]=y.useState([]),[l,u]=y.useState(),d=y.useRef(0),h=y.useRef(new Map),p=y.useRef([]);p.current=s.flatMap(A=>A.previewUrl?[A.previewUrl]:[]);const m=n.attachments;y.useEffect(()=>()=>{for(const A of p.current)URL.revokeObjectURL(A)},[]);const b=y.useCallback((A,R)=>{a(M=>M.map(_=>_.key===A?{..._,...R}:_))},[]),x=y.useCallback((A,R)=>{t&&(b(A,{status:"uploading",error:void 0}),(async()=>{try{const M=await H$(R),_=await e.uploadAttachment(t,{name:R.name,mediaType:M.mediaType,data:M.body});b(A,{status:"ready",id:_.id,bytes:_.bytes??R.size})}catch(M){b(A,{status:"failed",error:M instanceof Error?M.message:"Upload failed"})}})())},[e,b,t]),E=y.useCallback(A=>{const R=[],M=[];for(const _ of A){const O=_.type||"application/octet-stream",j=j$(O);if(j&&!m.includes(j)){u(`The ${r??"claude"} engine does not take ${j} attachments.`);continue}const H=`att-${++d.current}`;R.push({key:H,name:_.name,mediaType:O,bytes:_.size,previewUrl:j==="image"?URL.createObjectURL(_):void 0,status:"uploading"}),M.push({key:H,file:_})}if(R.length!==0){a(_=>[..._,...R]),h.current=new Map([...h.current,...M.map(({key:_,file:O})=>[_,O])]);for(const{key:_,file:O}of M)x(_,O)}},[m,r,x]),N=y.useCallback(A=>{a(R=>{for(const M of R)A.includes(M.key)&&M.previewUrl&&URL.revokeObjectURL(M.previewUrl);return R.filter(M=>!A.includes(M.key))});for(const R of A)h.current.delete(R)},[]),C=y.useCallback(A=>N([A]),[N]),S=y.useCallback(()=>{a(A=>{for(const R of A)R.previewUrl&&URL.revokeObjectURL(R.previewUrl);return[]}),h.current.clear()},[]),k=y.useCallback(A=>{const R=h.current.get(A);R&&x(A,R)},[x]);return y.useMemo(()=>({items:s,readyIds:s.flatMap(A=>A.id?[A.id]:[]),uploading:s.some(A=>A.status==="uploading"),hasFailure:s.some(A=>A.status==="failed"),accept:z$(m),disabled:m.length===0||!t,add:E,retry:k,remove:C,clear:S,error:l,dismissError:()=>u(void 0)}),[s,m,t,E,k,C,S,l])}function z$(e){if(e.length===0)return"";const t=[];return e.includes("image")&&t.push("image/*"),e.includes("pdf")&&t.push("application/pdf"),e.includes("text")&&t.push("text/*",".md",".json",".yaml",".yml",".toml"),e.length===3?"":t.join(",")}const U$=globalThis;async function H$(e){const t=e.type||"application/octet-stream",{createImageBitmap:n,document:r}=U$;if(!n||!r||!t.startsWith("image/"))return{body:e,mediaType:t};if(t==="image/gif")return{body:e,mediaType:t};try{const s=await n(e),a=Math.max(s.width,s.height);if(a<=Nw)return s.close(),{body:e,mediaType:t};const l=Nw/a,u=r.createElement("canvas");u.width=Math.round(s.width*l),u.height=Math.round(s.height*l);const d=u.getContext("2d");if(!d)return s.close(),{body:e,mediaType:t};d.drawImage(s,0,0,u.width,u.height),s.close();const h=await new Promise(p=>u.toBlob(p,"image/jpeg",.85));return h?{body:h,mediaType:"image/jpeg"}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}const F$=/^[A-Za-z0-9\-_.:]+$/,$$=new Set([".",",",";",":","!","?",")","]","}",'"',"'"]);function V$(e){const t=[],n=/\S+/g;let r;for(;(r=n.exec(e))!==null;){const s=r[0],a=s[0]==="@"?"file":s[0]==="/"?"command":void 0;if(!a)continue;let l=r.index+s.length;for(;l>r.index&&$$.has(e[l-1]);)l--;const u=e.slice(r.index+1,l);u&&(a==="command"&&!F$.test(u)||t.push({kind:a,start:r.index,end:l,text:e.slice(r.index,l)}))}return t}function By(e){let t=e.baseUrl.trim();for(;t.endsWith("/");)t=t.slice(0,-1);if(t!==""){t.includes("://")||(t="http://"+t),t.endsWith("/v1")||(t+="/v1");try{new URL(t)}catch{return}return t}}function q$(e){const t=By(e);if(!t)return!1;try{const{hostname:n}=new URL(t);return n==="127.0.0.1"||n==="localhost"||n==="::1"||n==="[::1]"}catch{return!1}}function Y$(e){const{baseUrl:t,key:n}=e;if(n==="")return{};const r=t.replace(/^http/,"ws"),s=a=>`${a}${a.includes("?")?"&":"?"}key=${encodeURIComponent(n)}`;return{headers:{authorization:`Bearer ${n}`},buildWsUrl:(a,l)=>s(`${r}/sessions/${encodeURIComponent(a)}/ws?afterSeq=${l}`),buildQueueWsUrl:()=>s(`${r}/queue/ws`)}}class ho extends Error{status;constructor(t,n){super(t),this.name="WorkerDeckError",this.status=n}}class G${sessionId;#t;#n;#r;#e=new Map;#s;#u=!1;#o=0;#i=[];#c;constructor(t,n,r={}){this.#t=t,this.sessionId=n,this.#n={reconnect:!0,...r},this.#s=r.afterSeq??0,this.#c=setTimeout(()=>this.#d(),0)}get lastSeq(){return this.#s}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}send(t,n){this.#a({type:"user_message",text:t,attachmentIds:n?.length?n:void 0})}approve(t,n){this.#a({type:"permission_decision",requestId:t,behavior:"allow",updatedInput:n})}deny(t,n,r){this.#a({type:"permission_decision",requestId:t,behavior:"deny",message:n,interrupt:r})}interrupt(){this.#a({type:"interrupt"})}setPermissionMode(t){this.#a({type:"set_permission_mode",mode:t})}setModel(t){this.#a({type:"set_model",model:t})}sendToolCallResult(t,n,r){this.#a({type:"tool_call_result",executionId:t,output:n,logs:r})}sendToolCallError(t,n,r,s){this.#a({type:"tool_call_error",executionId:t,reason:n,error:r,logs:s})}closeSession(){this.#a({type:"close"}),this.detach()}reconnectNow(){this.#u||this.#r&&this.#r.readyState===1||(clearTimeout(this.#c),this.#o=0,this.#d())}detach(){this.#u=!0,clearTimeout(this.#c),this.#r?.close(),this.#r=void 0}#l(t,n){const r=this.#e.get(t);if(r)for(const s of r)try{s(n)}catch{}}#a(t){const n=JSON.stringify(t);this.#r&&this.#r.readyState===1?this.#r.send(n):this.#i.push(n)}#d(){if(this.#u)return;const t=this.#t.openSocket(this.sessionId,this.#s);this.#r=t,t.onopen=()=>{this.#o=0,this.#l("connectionChange",!0);for(const n of this.#i.splice(0))t.send(n)},t.onmessage=n=>{const r=JSON.parse(String(n.data));if(r.type==="attached")this.#l("attached",r);else if(r.type==="event"){if(r.event.seq<=this.#s)return;this.#s=r.event.seq,this.#l("event",r.event)}else r.type==="tool_call_request"?this.#l("toolCallRequest",r):r.type==="tool_call_canceled"?this.#l("toolCallCanceled",{executionId:r.executionId,reason:r.reason}):r.type==="protocol_error"&&this.#l("protocolError",r.message)},t.onclose=()=>{if(this.#l("connectionChange",!1),this.#u||!this.#n.reconnect)return;const n=Math.min(500*2**this.#o++,1e4);this.#l("reconnectAttempt",this.#o),this.#c=setTimeout(()=>this.#d(),n)},t.onerror=()=>{}}}class K${#t;#n;#r;#e=new Map;#s=!1;#u=0;#o;constructor(t,n={}){this.#t=t,this.#n=n.reconnect??!0,this.#o=setTimeout(()=>this.#c(),0)}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}detach(){this.#s=!0,clearTimeout(this.#o),this.#r?.close(),this.#r=void 0}#i(t,n){const r=this.#e.get(t);if(r)for(const s of r)try{s(n)}catch{}}#c(){if(this.#s)return;const t=this.#t.openQueueSocket();this.#r=t,t.onopen=()=>{this.#u=0,this.#i("connectionChange",!0)},t.onmessage=n=>{const r=JSON.parse(String(n.data));r.type==="queue_attached"?(this.#i("attached",r.stats),this.#i("stats",r.stats)):r.type==="job_event"?this.#i("event",r.event):r.type==="queue_stats"&&this.#i("stats",r.stats)},t.onclose=()=>{if(this.#i("connectionChange",!1),this.#s||!this.#n)return;const n=Math.min(500*2**this.#u++,1e4);this.#o=setTimeout(()=>this.#c(),n)},t.onerror=()=>{}}}class X${#t;#n;#r;constructor(t){this.#t=t,this.#n=t.fetchImpl??fetch.bind(globalThis),this.#r=t.WebSocketImpl??WebSocket}async createSession(t){return(await this.#e("POST","/sessions",t)).session}async listSessions(){return(await this.#e("GET","/sessions")).sessions}async getSession(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}`)).session}async updateSession(t,n){return(await this.#e("PATCH",`/sessions/${encodeURIComponent(t)}`,n)).session}async deleteSession(t){return(await this.#e("DELETE",`/sessions/${encodeURIComponent(t)}`)).session}async listSessionFiles(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/files`)).files}async fetchSessionFile(t,n){const r=await this.#n(this.sessionFileUrl(t,n),{headers:this.#t.headers});if(!r.ok){const s=await r.json().catch(()=>({}));throw new ho(s.error??`GET file failed with ${r.status}`,r.status)}return await r.text()}async uploadAttachment(t,n){const r=`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments?name=${encodeURIComponent(n.name)}`,s=await this.#n(r,{method:"POST",headers:{...this.#t.headers,"content-type":n.mediaType},body:n.data});if(!s.ok){const a=await s.json().catch(()=>({}));throw new ho(a.error??`upload failed with ${s.status}`,s.status)}return(await s.json()).attachment}attachmentUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`}producedFileUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/produced/${encodeURIComponent(n)}`}async readProducedFile(t,n){const r=await this.#n(this.producedFileUrl(t,n),{headers:{...this.#t.headers}});if(!r.ok){const s=await r.json().catch(()=>({}));throw new ho(s.error??`produced file request failed with ${r.status}`,r.status)}return await r.blob()}async listMcpServers(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/mcp`)).servers}async mcpServerAction(t,n,r){return(await this.#e("POST",`/sessions/${encodeURIComponent(t)}/mcp/${encodeURIComponent(n)}`,{action:r})).servers}sessionFileUrl(t,n){const r=n.split("/").filter(Boolean).map(encodeURIComponent).join("/");return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/files/${r}`}async resolvePermission(t,n,r){await this.#e("POST",`/sessions/${encodeURIComponent(t)}/permissions/${encodeURIComponent(n)}`,r)}async submitExecutionResult(t,n){return await this.#e("POST",`/executions/${encodeURIComponent(t)}/result`,n)}async listProfiles(){return await this.#e("GET","/profiles")}async getProfile(t){return await this.#e("GET",`/profiles/${encodeURIComponent(t)}`)}async createProfile(t){return(await this.#e("POST","/profiles",t)).profile}async updateProfile(t,n){return(await this.#e("PATCH",`/profiles/${encodeURIComponent(t)}`,n)).profile}async deleteProfile(t){await this.#e("DELETE",`/profiles/${encodeURIComponent(t)}`)}async listSdkSessions(t){const n=new URLSearchParams;t?.dir&&n.set("dir",t.dir),t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.offset!==void 0&&n.set("offset",String(t.offset)),t?.profile&&n.set("profile",t.profile);const r=n.size>0?`?${n.toString()}`:"";return(await this.#e("GET",`/sdk-sessions${r}`)).sdkSessions}async listHostRoots(){return await this.#e("GET","/fs/roots")}async listHostDir(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/list${n}`)}async findHostFiles(t,n="",r){const s=new URLSearchParams({path:t,q:n});return r!==void 0&&s.set("limit",String(r)),await this.#e("GET",`/fs/find?${s.toString()}`)}async readHostFile(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/read${n}`)}async writeHostFile(t){return await this.#e("PUT","/fs/write",t)}async createJob(t){return(await this.#e("POST","/jobs",t)).job}async listJobs(){return(await this.#e("GET","/jobs")).jobs}async getJob(t){return(await this.#e("GET",`/jobs/${encodeURIComponent(t)}`)).job}async cancelJob(t){return(await this.#e("DELETE",`/jobs/${encodeURIComponent(t)}`)).job}async queueStats(){return(await this.#e("GET","/queue")).stats}attach(t,n){return new G$(this,t,n)}attachQueue(t){return new K$(this,t)}openSocket(t,n){const r=this.#t.buildWsUrl?.(t,n)??`${this.#t.baseUrl.replace(/^http/,"ws")}/sessions/${encodeURIComponent(t)}/ws?afterSeq=${n}`;return new this.#r(r)}openQueueSocket(){const t=this.#t.buildQueueWsUrl?.()??`${this.#t.baseUrl.replace(/^http/,"ws")}/queue/ws`;return new this.#r(t)}async#e(t,n,r){const s=await this.#n(`${this.#t.baseUrl}${n}`,{method:t,headers:{...r!==void 0?{"content-type":"application/json"}:{},...this.#t.headers},body:r!==void 0?JSON.stringify(r):void 0}),a=await s.json().catch(()=>({}));if(!s.ok)throw new ho(a.error??`${t} ${n} failed with ${s.status}`,s.status);return a}}function W$(e,t,n){const r=[],s=(a,l)=>{const u=t.get(a);if(u)for(const d of u.entries){if(d.type!=="dir"){r.push({entry:d,depth:l});continue}const h=n.has(d.path),p=t.get(d.path);r.push({entry:d,depth:l,expanded:h,loading:h&&!p,truncated:h?p?.truncated:void 0}),h&&p&&s(d.path,l+1)}};return s(e,0),r}function Q$(e,t){const n=e.endsWith("/")?e.slice(0,-1):e;if(t===n||!t.startsWith(`${n}/`))return[];const r=t.slice(n.length+1).split("/"),s=[];let a=n;for(const l of r.slice(0,-1))a=`${a}/${l}`,s.push(a);return s}function IR(e,t){const[n,r]=y.useState(!1),s=y.useRef(t);y.useEffect(()=>{s.current!==t&&(s.current=t,r(!1))},[t]);const a=y.useCallback(async(l,u)=>{if(!t||n)return[];try{const d=await e.findHostFiles(t,l,u?.limit??8);return u?.signal?.aborted?[]:d.matches}catch(d){return d instanceof ho&&d.status===404&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function Z$(e){const[t,n]=y.useState({available:!1,canWrite:!1});return y.useEffect(()=>{let r=!1;return e.listHostRoots().then(s=>{r||n({available:!0,canWrite:s.canWrite})}).catch(()=>{r||n({available:!1,canWrite:!1})}),()=>{r=!0}},[e]),t}function J$(e,t){const[n,r]=y.useState(()=>new Map),[s,a]=y.useState(()=>new Set),[l,u]=y.useState(!1),[d,h]=y.useState(),p=y.useRef(t);y.useEffect(()=>{p.current!==t&&(p.current=t,r(new Map),a(new Set),u(!1),h(void 0))},[t]);const m=y.useRef(!0);y.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]);const b=y.useRef(new Set),x=y.useCallback((k,{force:A=!1}={})=>{l||!A&&b.current.has(k)||(b.current.add(k),e.listHostDir(k).then(R=>{m.current&&r(M=>{const _=new Map(M);return _.set(k,{entries:R.entries,truncated:R.truncated}),_})}).catch(R=>{if(m.current){if(b.current.delete(k),R instanceof ho&&R.status===404){u(!0);return}h(R instanceof Error?R.message:"Could not read that directory")}}))},[e,l]);y.useEffect(()=>{t&&x(t)},[t,x]);const E=y.useCallback(k=>{a(A=>{const R=new Set(A);return R.has(k)?R.delete(k):R.add(k),R}),x(k)},[x]),N=y.useCallback(k=>{if(!t)return;const A=Q$(t,k);if(A.length!==0){for(const R of A)x(R);a(R=>{const M=new Set(R);for(const _ of A)M.add(_);return M})}},[t,x]),C=y.useCallback(k=>{const A=k??t;A&&(h(void 0),x(A,{force:!0}))},[t,x]),S=y.useMemo(()=>t?W$(t,n,s):[],[t,n,s]);return{available:!!t&&!l,root:t,rows:S,loading:!!t&&!l&&!n.has(t)&&!d,error:d,toggle:E,reveal:N,refresh:C}}function OR(e,t){const[n,r]=y.useState(),[s,a]=y.useState(!!t),[l,u]=y.useState();return y.useEffect(()=>{if(!t){r(void 0),a(!1),u(void 0);return}let d=!1;return a(!0),u(void 0),r(void 0),e.getSession(t).then(h=>{d||(r(h),a(!1))}).catch(h=>{d||(u(h instanceof Error?h.message:"Session not found"),a(!1))}),()=>{d=!0}},[e,t]),{info:n,loading:s,error:l}}function dd(e){return e.draft!==void 0&&e.draft!==e.content}function jb(e){return e.draft??e.content??""}const MR={files:[]};function eV(e,t){switch(t.type){case"open":{if(e.files.some(r=>r.path===t.path))return e.activePath===t.path?e:{...e,activePath:t.path};const n={path:t.path,name:Aw(t.path),status:"loading"};return{files:[...e.files,n],activePath:t.path}}case"close":{const n=e.files.findIndex(a=>a.path===t.path);if(n===-1)return e;const r=e.files.filter(a=>a.path!==t.path);if(e.activePath!==t.path)return{...e,files:r};const s=r[n]??r[n-1];return{files:r,activePath:s?.path}}case"closeAll":return MR;case"activate":return e.files.some(n=>n.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case"loaded":return la(e,t.path,()=>({path:t.path,name:Aw(t.path),status:t.encoding==="utf8"?"ready":"binary",content:t.encoding==="utf8"?t.content:void 0,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt}));case"failed":return la(e,t.path,n=>({...n,status:"error",error:t.error}));case"edit":return la(e,t.path,n=>n.status==="ready"?{...n,draft:t.content}:n);case"revert":return la(e,t.path,n=>({...n,draft:void 0,saveError:void 0,conflict:!1}));case"saveStart":return la(e,t.path,n=>({...n,saving:!0,saveError:void 0,conflict:!1}));case"saved":return la(e,t.path,n=>({...n,saving:!1,saveError:void 0,conflict:!1,content:t.content,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt,draft:n.draft===t.content?void 0:n.draft}));case"saveFailed":return la(e,t.path,n=>({...n,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case"dismissConflict":return la(e,t.path,n=>({...n,conflict:!1,saveError:void 0}))}}function la(e,t,n){const r=e.files.findIndex(u=>u.path===t);if(r===-1)return e;const s=e.files[r],a=n(s);if(a===s)return e;const l=e.files.slice();return l[r]=a,{...e,files:l}}function Aw(e){const t=e.endsWith("/")?e.slice(0,-1):e;return t.slice(t.lastIndexOf("/")+1)||t||e}function tV(e){const[t,n]=y.useReducer(eV,MR),r=y.useRef(new Set),s=y.useRef(!0);y.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]);const a=y.useRef(t);y.useEffect(()=>{a.current=t},[t]);const u=t.files.filter(_=>_.status==="loading").map(_=>_.path).join(`
542
- `),d=y.useCallback(_=>e.readHostFile(_).then(O=>{if(s.current)return n({type:"loaded",path:_,content:O.content,encoding:O.encoding,bytes:O.bytes,hash:O.hash,modifiedAt:O.modifiedAt}),O}),[e]);y.useEffect(()=>{for(const _ of u?u.split(`
543
- `):[])r.current.has(_)||(r.current.add(_),d(_).catch(O=>{s.current&&n({type:"failed",path:_,error:O instanceof Error?O.message:"Could not read that file"})}))},[d,u]);const h=y.useCallback(_=>n({type:"open",path:_}),[]),p=y.useCallback(_=>{r.current.delete(_),n({type:"close",path:_})},[]),m=y.useCallback(()=>{r.current.clear(),n({type:"closeAll"})},[]),b=y.useCallback(_=>n({type:"activate",path:_}),[]),x=y.useCallback((_,O)=>n({type:"edit",path:_,content:O}),[]),E=y.useCallback(_=>n({type:"revert",path:_}),[]),N=y.useCallback(_=>n({type:"dismissConflict",path:_}),[]),C=y.useCallback(_=>{r.current.add(_),d(_).catch(O=>{s.current&&n({type:"failed",path:_,error:O instanceof Error?O.message:"Could not re-read that file"})})},[d]),S=y.useCallback(async(_,O,j)=>{try{const H=await e.writeHostFile({path:_,content:O,expectedHash:j});if(!s.current)return;n({type:"saved",path:_,content:O,bytes:H.bytes,hash:H.hash,modifiedAt:H.modifiedAt})}catch(H){if(!s.current)return;const B=H instanceof ho&&H.status===409;n({type:"saveFailed",path:_,conflict:B,error:B?"This file changed on disk since you opened it.":H instanceof Error?H.message:"Could not save that file"})}},[e]),k=y.useCallback(async _=>{const O=a.current.files.find(j=>j.path===_);!O||O.saving||!dd(O)||(n({type:"saveStart",path:_}),await S(_,jb(O),O.hash))},[S]),A=y.useCallback(async _=>{const O=a.current.files.find(H=>H.path===_);if(!O||O.saving)return;const j=jb(O);n({type:"saveStart",path:_});try{const H=await e.readHostFile(_);if(!s.current)return;await S(_,j,H.hash)}catch(H){if(!s.current)return;n({type:"saveFailed",path:_,error:H instanceof Error?H.message:"Could not save that file"})}},[e,S]),R=y.useMemo(()=>t.files.find(_=>_.path===t.activePath),[t.files,t.activePath]),M=y.useMemo(()=>t.files.some(dd),[t.files]);return{...t,active:R,hasUnsaved:M,open:h,close:p,closeAll:m,activate:b,edit:x,save:k,revert:E,reload:C,overwrite:A,dismissConflict:N}}const nV="modulepreload",rV=function(e){return"/"+e},_w={},eu=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");s=l(n.map(h=>{if(h=rV(h),h in _w)return;_w[h]=!0;const p=h.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":nV,p||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),p)return new Promise((x,E)=>{b.addEventListener("load",x),b.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&a(u.reason);return t().catch(a)})};function sV(e,t={}){const n=new Map;let r,s=!1;const a=p=>t.onExecution?.(p),l=(p,m,b,x)=>{e.sendToolCallError(p.executionId,m,b),a({executionId:p.executionId,toolName:p.toolName,status:"failed",reason:m,startedAt:x,endedAt:Date.now()})},u=async p=>{const m=Date.now();if(!(t.tools??["eval_script"]).includes(p.toolName)){l(p,"unsupported_tool",`this client does not execute '${p.toolName}'`,m);return}const x=p.input?.script;if(typeof x!="string"){l(p,"invalid_input","expected a string `script` input",m);return}const E=new AbortController;n.set(p.executionId,E),a({executionId:p.executionId,toolName:p.toolName,status:"running",startedAt:m});try{const N=await eu(()=>import("./index-GWtMSMyW.js"),[]),C=N.createVfs(p.vfsSeed),S=Math.min(p.limits?.timeoutMs??Number.POSITIVE_INFINITY,t.timeoutMs??5e3),k=Math.min(p.limits?.memoryLimitBytes??Number.POSITIVE_INFINITY,t.memoryLimitBytes??64*1024*1024),A=t.execute?await t.execute({script:x,vfs:C,timeoutMs:S,memoryLimitBytes:k,signal:E.signal}):await(async()=>(r??=(t.loadEngine??iV)(),N.runScript(await r,{script:x,vfs:C,timeoutMs:S,memoryLimitBytes:k,signal:E.signal,fetchText:t.fetchText})))();if(s||!n.has(p.executionId))return;const R=A.logs.map(M=>`[${M.level}] ${M.text}`);A.ok?(e.sendToolCallResult(p.executionId,{type:"json",value:A.value},R),a({executionId:p.executionId,toolName:p.toolName,status:"settled",startedAt:m,endedAt:Date.now()})):(e.sendToolCallError(p.executionId,A.reason,A.error,R),a({executionId:p.executionId,toolName:p.toolName,status:"failed",reason:A.reason,startedAt:m,endedAt:Date.now()}))}catch(N){if(s||!n.has(p.executionId))return;l(p,"host_error",N instanceof Error?N.message:String(N),m)}finally{n.delete(p.executionId)}},d=e.on("toolCallRequest",p=>void u(p)),h=e.on("toolCallCanceled",({executionId:p,reason:m})=>{const b=n.get(p);b&&(b.abort(),n.delete(p),a({executionId:p,toolName:"",status:"canceled",reason:m,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{s=!0,d(),h();for(const p of n.values())p.abort();n.clear()}}}async function iV(){const[e,t]=await Promise.all([eu(()=>import("./index-GWtMSMyW.js"),[]),eu(()=>import("./index-mQ7Bo0Tq.js"),[])]);return e.loadEngine(t)}function aV(e,t={}){const[n,r]=y.useState([]),s=y.useRef(t);return s.current=t,y.useEffect(()=>{if(!e||t.enabled===!1)return;const a=sV(e,{get tools(){return s.current.tools},get timeoutMs(){return s.current.timeoutMs},get memoryLimitBytes(){return s.current.memoryLimitBytes},get loadEngine(){return s.current.loadEngine},get execute(){return s.current.execute},get fetchText(){return s.current.fetchText},onExecution:l=>{s.current.onExecution?.(l);const u=s.current.historyLimit??50;r(d=>[...d.filter(h=>h.executionId!==l.executionId),l].slice(-u))}});return()=>a.dispose()},[e,t.enabled]),{executions:n}}function oV(e,t){const n=Math.max(0,Math.min(t,e.items.length)),r=e.items.slice(n),s=new Map;let a=0,l=0,u=0,d=0,h=0;for(const b of r)switch(b.kind){case"turn_result":a+=1,b.isError&&(h+=1);break;case"assistant_text":l+=1;break;case"tool_call":u+=1,s.set(b.name,(s.get(b.name)??0)+1),(b.status==="failed"||b.result?.isError)&&(h+=1);break;case"file_delivered":d+=1;break;case"notice":b.level==="error"&&(h+=1);break}const p=[...s.entries()].sort((b,x)=>x[1]-b[1]||b[0].localeCompare(x[0])).map(([b])=>b),m=e.pendingApprovals?.length??0;return{turns:a,replies:l,tools:u,toolNames:p,files:d,errors:h,pending:m,any:a+l+u+d+h+m>0}}function lV(e){if(!e.any)return;const t=[];if(e.turns>0?t.push(Al(e.turns,"turn")):e.replies>0&&t.push(Al(e.replies,"reply","replies")),e.tools>0){const n=e.toolNames.slice(0,3).join(", "),r=e.toolNames.length-3;t.push(`${Al(e.tools,"tool call")}${n?` (${n}${r>0?`, +${r}`:""})`:""}`)}return e.files>0&&t.push(Al(e.files,"file")),e.errors>0&&t.push(Al(e.errors,"error")),e.pending>0&&t.push(`${Al(e.pending,"approval")} waiting`),t.join(" · ")}function Al(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}const LR=y.createContext("cards");function DR({value:e,children:t}){return f.jsx(LR.Provider,{value:e,children:t})}function uV(){return y.useContext(LR)}function Kr(){return uV()==="lines"}const cV=y.createContext("comfortable");function dV({value:e,children:t}){return f.jsx(cV.Provider,{value:e,children:t})}const fV={cards:{comfortable:{className:"pt-4",px:16},compact:{className:"pt-2",px:8}},lines:{comfortable:{className:"pt-4",px:16},compact:{px:0}}};function Or({children:e,className:t}){return f.jsx("span",{"aria-hidden":!0,className:xe("w-3.5 shrink-0 select-none text-center font-mono text-label leading-5 text-fg-4",t),children:e})}const hV="text-body-sm leading-5";function Sa(e){return e===void 0||Number.isNaN(e)?"—":e===0?"$0.00":e<.01?"<$0.01":`$${e.toFixed(2)}`}function Pb(e){if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function us(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function No(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function Bb(e,t=Date.now()){const n=e-t;if(n<=0)return"now";const r=Math.ceil(n/6e4);if(r<1)return"<1m";if(r<60)return`${r}m`;const s=Math.floor(r/1440);return s>=1?`${s}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function du(e,t=Date.now()){if(!e)return"—";const n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return"just now";const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function mV(e){if(e==="five_hour")return"5-hour session";if(e==="seven_day")return"Weekly";if(e==="seven_day_oauth_apps")return"Weekly · apps";const t=n=>n.replace(/\b\w/g,r=>r.toUpperCase());return e.startsWith("seven_day_")?`Weekly · ${t(e.slice(10).replaceAll("_"," "))}`:t(e.replaceAll("_"," "))}function pV(e){if(e==="five_hour")return 5*3600;if(e.startsWith("seven_day"))return 7*86400}function gV(e,t=Date.now()){const n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n} sec${n===1?"":"s"} ago`;if(n<3600){const s=Math.floor(n/60);return`${s} min${s===1?"":"s"} ago`}const r=Math.floor(n/3600);return`${r} hour${r===1?"":"s"} ago`}function zb(e,t=80){if(e==null)return"";if(typeof e=="object"){const r=e,s=r.command??r.file_path??r.path??r.url??r.pattern??r.query??r.description;if(typeof s=="string")return s.length>t?s.slice(0,t-1)+"…":s}const n=JSON.stringify(e)??"";return n.length>t?n.slice(0,t-1)+"…":n}const bV={gpt:{name:"GPT",joiner:"-"},deepseek:{name:"DeepSeek"},glm:{name:"GLM"},qwen:{name:"Qwen"},kimi:{name:"Kimi"},llama:{name:"Llama"},mistral:{name:"Mistral"},grok:{name:"Grok"}};function xV(e){if(!e)return;const n=(e.split("[")[0]??e).toLowerCase().split("-").filter(Boolean);n[0]==="claude"&&n.shift();const r=n.shift();if(!r)return e;const s=bV[r],a=s?.name??(/^o\d+$/.test(r)?r:`${r.charAt(0).toUpperCase()}${r.slice(1)}`),l=[],u=[];for(const h of n)/^\d{8}$/.test(h)||(/^\d+(\.\d+)?$/.test(h)?l.push(h):u.push(`${h.charAt(0).toUpperCase()}${h.slice(1)}`));return[l.length>0?`${a}${s?.joiner??" "}${l.join(".")}`:a,...u].join(" ")}const yV=e=>e.replace(/\s*\(MCP\)$/i,"");function jR(e){const t=e.defaultPrompt?.trim()||`$${e.name}`;return/\s$/.test(t)?t:t+" "}function Rw(e,t){const n=e.toLowerCase(),r=t.map(s=>s.toLowerCase());return r.some(s=>s.startsWith(n))?2:r.some(s=>s.includes(n))?1:0}function vV({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:s="Message the agent…",commands:a,skills:l,onSearchFiles:u,attachments:d,toolbar:h,layout:p="stacked",className:m,ref:b}){const x=p==="inline",E=Kr(),{bind:N,plainText:C,isEmpty:S,clear:k,focus:A}=c$(),R=y.useRef(null),[M,_]=y.useState(!1);y.useImperativeHandle(b,()=>({insertText:V=>{const W=C.length>0&&!/\s$/.test(C)?" ":"";N.ref.current?.appendText(W+V),A()},focus:A}),[N.ref,C,A]);const O=y.useMemo(()=>{const V=[],W=(l??[]).filter(le=>le.enabled);if(a&&a.length>0){const le=new Set,D=a.flatMap(P=>{const $=yV(P.name);return le.has($)?[]:(le.add($),[{...P,name:$}])});V.push(Sw({onSearch:P=>{const $=[];for(const L of D){const ae=Rw(P,[L.name,...L.aliases??[],...L.name.split(":")]);ae!==0&&$.push({score:ae,suggestion:{value:L.name,label:`/${L.name}${L.argumentHint?` ${L.argumentHint}`:""}`,description:L.description}})}return $.sort((L,ae)=>ae.score-L.score),$.map(({suggestion:L})=>L)},onSelect:P=>P.value,chipClassName:"font-mono"}))}return W.length>0&&V.push(Sw({char:"$",accessibilityLabel:"skill",onSearch:le=>{const D=[];for(const P of W){const $=Rw(le,[P.name,...P.name.split(/[-:_]/)]);if($===0)continue;const L=P.shortDescription??P.description;D.push({score:$,suggestion:{value:P.name,label:P.displayName??P.name,description:L?`Skill · ${L}`:"Skill · inserts a message you can edit",icon:f.jsx(np,{className:"size-3.5 text-fg-3"})}})}return D.sort((P,$)=>$.score-P.score),D.map(({suggestion:P})=>P)},insertAsText:le=>{const D=W.find(P=>P.name===le.value);return D?jR(D):`$${le.value} `}})),u&&V.push(d$({searchDebounceMs:150,onSearch:async(le,D)=>(await u(le,D)).map($=>({value:$.relative,label:$.relative,description:$.path})),onSelect:le=>le.value,chipStyle:"inline",chipClassName:"font-mono",emptyMessage:"No matching files"})),V.length>0?V:void 0},[a,l,u]),j=d?.items??[],H=!r&&(!S||j.length>0)&&!d?.uploading&&!d?.hasFailure,B=()=>{H&&(e(C.trim(),d?.readyIds??[]),d?.clear(),k(),A())},K=V=>{V&&V.length>0&&d?.add(V)},X=d&&!d.disabled?f.jsx("input",{ref:R,type:"file",multiple:!0,accept:d.accept||void 0,className:"hidden",onChange:V=>{K(V.target.files),V.target.value=""}}):null,te=!!d&&!d.disabled?f.jsxs(f.Fragment,{children:[X,x?f.jsx(Iw,{label:"Attach files",disabled:r,onClick:()=>R.current?.click(),children:"+"}):f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Attach files",disabled:r,onClick:()=>R.current?.click(),children:f.jsx(bz,{className:"size-4"})})]}):null,q=n&&!H,z=x?f.jsx(Iw,{label:q?"Interrupt":"Send",disabled:!q&&!H,onClick:q?t:B,className:q?"text-warning":H?"text-accent":void 0,children:q?"■":"↵"}):q?f.jsx(Je,{variant:"outline",size:"icon-sm","aria-label":"Interrupt",className:"rounded-full",onClick:t,children:f.jsx(Qz,{className:"size-3"})}):f.jsx(Je,{size:"icon-sm","aria-label":"Send",className:"rounded-full",disabled:!H,onClick:B,children:f.jsx(tB,{className:"size-4"})});return f.jsxs("div",{"data-slot":"composer",className:xe("px-3 pb-3",m),children:[f.jsxs("div",{onDragOver:V=>{d&&!d.disabled&&(V.preventDefault(),_(!0))},onDragLeave:()=>_(!1),onDrop:V=>{!d||d.disabled||(V.preventDefault(),_(!1),K(V.dataTransfer.files))},className:xe("mx-auto w-full max-w-[var(--wd-content-max-w,48rem)] overflow-hidden border border-border bg-bg","transition-colors",E?"rounded-sm focus-within:border-accent":xe("rounded-lg shadow-(--shadow-xs)","focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30"),M&&(E?"border-accent":"border-ring ring-2 ring-ring/30"),r&&"opacity-60"),children:[j.length>0&&d?f.jsx(EV,{attachments:d}):null,x?f.jsxs("div",{className:"flex items-end gap-1 p-1",children:[te,f.jsx(Tw,{...N,triggers:O,onSubmit:B,disabled:r,placeholder:r?"Session ended":s,minHeight:20,maxHeight:192,"aria-label":"Message the agent",className:"min-w-0 flex-1 py-0.5 text-body-sm text-text",onImagePaste:V=>d?.add([V])}),z]}):f.jsxs(f.Fragment,{children:[f.jsx(Tw,{...N,triggers:O,onSubmit:B,disabled:r,placeholder:r?"Session ended":s,minHeight:28,maxHeight:192,"aria-label":"Message the agent",className:"px-3 pt-2.5 pb-1 text-body-sm text-text",onImagePaste:V=>d?.add([V])}),f.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[te,h]}),z]})]})]}),d?.error?f.jsxs("div",{className:"mx-auto mt-1 flex w-full max-w-[var(--wd-content-max-w,48rem)] items-center gap-2 text-label text-danger",children:[f.jsx($l,{className:"size-3 shrink-0"}),f.jsx("span",{className:"min-w-0 flex-1",children:d.error}),f.jsx("button",{type:"button",onClick:d.dismissError,"aria-label":"Dismiss",className:"shrink-0 opacity-70 hover:opacity-100",children:f.jsx(Ss,{className:"size-3"})})]}):null]})}function Iw({label:e,disabled:t,onClick:n,className:r,children:s}){return f.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:n,className:xe("flex size-6 shrink-0 items-center justify-center rounded-sm font-mono text-body-sm leading-none","text-fg-3 transition-colors outline-none select-none","hover:bg-surface-hover hover:text-fg-1 focus-visible:bg-surface-hover focus-visible:text-fg-1","active:bg-accent-bg disabled:pointer-events-none disabled:opacity-40",r),children:s})}function EV({attachments:e}){return f.jsx("div",{className:"flex gap-2 overflow-x-auto border-b border-border px-2 py-2",children:e.items.map(t=>f.jsx(TV,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function TV({item:e,onRetry:t,onRemove:n}){const r=e.status==="failed";return f.jsxs("div",{className:"group relative shrink-0",title:r?`${e.name} — ${e.error}`:`${e.name} · ${No(e.bytes)}`,children:[f.jsx("div",{className:xe("flex size-14 items-center justify-center overflow-hidden rounded-md border border-border bg-surface",r&&"border-danger/50"),children:e.previewUrl?f.jsx("img",{src:e.previewUrl,alt:e.name,className:"size-full object-cover"}):f.jsxs("div",{className:"flex flex-col items-center gap-0.5 text-fg-3",children:[f.jsx(Ay,{className:"size-4"}),f.jsx("span",{className:"max-w-12 truncate text-[9px] font-semibold uppercase",children:SV(e.name)})]})}),e.status==="uploading"?f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md bg-black/35",children:f.jsx(xn,{className:"size-4 text-white"})}):null,r?f.jsx("button",{type:"button",onClick:t,"aria-label":`Retry ${e.name}`,className:"absolute inset-0 flex items-center justify-center rounded-md bg-black/45 text-warning",children:f.jsx(Oy,{className:"size-4"})}):null,f.jsx("button",{type:"button",onClick:n,"aria-label":`Remove ${e.name}`,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full border border-border bg-surface text-fg-3 shadow-(--shadow-xs) hover:text-fg-1",children:f.jsx(Ss,{className:"size-2.5"})})]})}const SV=e=>{const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toUpperCase():"FILE"},CV=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0,wV=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function kV({usage:e,open:t,onOpenChange:n}){return f.jsx(ds,{open:t,onOpenChange:n,children:f.jsxs(fs,{children:[f.jsx(hs,{title:"Context",description:e?.model}),f.jsx(ms,{children:e?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Used"}),f.jsxs("span",{className:"font-mono text-body-sm text-fg-1",children:[us(e.totalTokens)," / ",us(e.maxTokens)," ·"," ",e.percentage.toFixed(0),"%"]})]}),f.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-border",children:f.jsx("div",{className:xe("h-full rounded-full",wV(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?f.jsxs("div",{className:"mt-5",children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Breakdown"}),f.jsx("div",{className:"mt-2 flex flex-col gap-3",children:e.categories.map(r=>{const s=r.tokens/Math.max(e.maxTokens,1)*100,a=CV(r.color);return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:a?{backgroundColor:a}:void 0}),f.jsx("span",{className:"truncate text-body-sm text-fg-1",children:r.name})]}),f.jsx("span",{className:"shrink-0 font-mono text-label text-fg-3",children:us(r.tokens)})]}),f.jsx("div",{className:"mt-1 h-1 overflow-hidden rounded-full bg-border",children:f.jsx("div",{className:"h-full rounded-full bg-fg-4",style:{width:`${Math.min(100,s)}%`,backgroundColor:a}})})]},r.name)})})]}):null]}):f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"No reading yet — the context window is measured after a turn completes."})})]})})}function NV({client:e,cwd:t,open:n,onOpenChange:r}){const[s,a]=y.useState(t),[l,u]=y.useState([]),[d,h]=y.useState(!1),[p,m]=y.useState(""),[b,x]=y.useState(),[E,N]=y.useState(),[C,S]=y.useState(!1),[k,A]=y.useState(),R=y.useCallback(async j=>{S(!0),A(void 0);try{const H=await e.listHostDir(j);a(H.path),u(H.entries),h(H.truncated??!1)}catch(H){A(H instanceof Error?H.message:"Could not read that directory")}finally{S(!1)}},[e]);y.useEffect(()=>{n&&(N(void 0),m(""),x(void 0),A(void 0),t&&R(t))},[n,t,R]),y.useEffect(()=>{if(!n||!t)return;const j=p.trim();if(!j){x(void 0);return}const H=setTimeout(()=>{e.findHostFiles(t,j,40).then(B=>x(B.matches)).catch(()=>x([]))},150);return()=>clearTimeout(H)},[e,t,p,n]);const M=async j=>{S(!0),A(void 0);try{const H=await e.readHostFile(j);N({path:H.path,bytes:H.bytes,content:H.encoding==="utf8"?H.content:"(binary file — not shown)"})}catch(H){A(H instanceof Error?H.message:"Could not read that file")}finally{S(!1)}},_=s&&t&&s!==t?s.slice(0,s.lastIndexOf("/"))||"/":void 0,O=b??l;return f.jsx(ds,{open:n,onOpenChange:r,children:f.jsxs(fs,{size:"lg",children:[f.jsx(hs,{title:E?E.path.split("/").pop():"Files",description:E?E.path:s,actions:E?f.jsxs(Je,{variant:"ghost",size:"xs",onClick:()=>N(void 0),children:[f.jsx(lm,{className:"size-3.5"}),"Back"]}):_?f.jsxs(Je,{variant:"ghost",size:"xs",onClick:()=>void R(_),children:[f.jsx(lm,{className:"size-3.5"}),"Up"]}):null}),f.jsxs(ms,{className:"flex flex-col gap-3",children:[k?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:k}):null,E?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"text-label text-fg-4",children:No(E.bytes)}),f.jsx(lR,{code:E.content,label:E.path.split("/").pop()})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative",children:[f.jsx(tp,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Yt,{value:p,onChange:j=>m(j.target.value),placeholder:"Search this project…",className:"pl-7",spellCheck:!1})]}),C&&O.length===0?f.jsx("div",{className:"py-6 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})}):O.length===0?f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:b?"No matching files.":"This directory is empty."}):f.jsx("ul",{className:"flex flex-col",children:b?b.map(j=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>void M(j.path),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[f.jsx(Jm,{className:"size-3.5 shrink-0 text-fg-4"}),f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:j.relative})]})},j.path)):l.map(j=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>j.type==="dir"?void R(j.path):void M(j.path),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[f.jsx(AV,{type:j.type}),f.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:[j.name,j.type==="dir"?"/":""]}),j.bytes!==void 0?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:No(j.bytes)}):null]})},j.path))}),d&&!b?f.jsx("p",{className:"text-label text-fg-4",children:"More entries than the server will return — use the search box."}):null]})]})]})})}function AV({type:e}){return e==="dir"?f.jsx(D_,{className:"size-3.5 shrink-0 text-accent"}):e==="symlink"?f.jsx(P_,{className:"size-3.5 shrink-0 text-fg-4"}):f.jsx(Jm,{className:"size-3.5 shrink-0 text-fg-4"})}const PR={connected:"success",failed:"danger","needs-auth":"warning",pending:"info",disabled:"neutral"};function _V({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:s=!0}){const[a,l]=y.useState(),[u,d]=y.useState(),[h,p]=y.useState(!1),[m,b]=y.useState(),[x,E]=y.useState(),[N,C]=y.useState(),S=y.useCallback(async()=>{if(t){p(!0),d(void 0);try{l(await e.listMcpServers(t))}catch(_){d(_ instanceof Error?_.message:"Could not read MCP status")}finally{p(!1)}}},[e,t]);y.useEffect(()=>{n&&(E(void 0),C(void 0),S())},[n,S]);const k=async(_,O)=>{if(t){b(_),d(void 0);try{l(await e.mcpServerAction(t,_,O))}catch(j){d(j instanceof Error?j.message:`Could not ${O} ${_}`)}finally{b(void 0)}}},A=a?.find(_=>_.name===x),R=A?.tools?.find(_=>_.name===N),M=R?.name??A?.name??"MCP servers";return f.jsx(ds,{open:n,onOpenChange:r,children:f.jsxs(fs,{children:[f.jsx(hs,{title:M,description:R?`${A?.name} tool`:A?A.serverInfo?.name:void 0,actions:x?f.jsxs(Je,{variant:"ghost",size:"xs",onClick:()=>N?C(void 0):E(void 0),children:[f.jsx(lm,{className:"size-3.5"}),"Back"]}):f.jsxs(Je,{variant:"ghost",size:"xs",onClick:()=>void S(),disabled:h,children:[h?f.jsx(xn,{className:"size-3 text-current"}):f.jsx(Oy,{className:"size-3"}),"Refresh"]})}),f.jsxs(ms,{children:[u?f.jsx("div",{className:"mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:u}):null,R?f.jsx(OV,{tool:R}):A?f.jsx(IV,{server:A,busy:m===A.name,canManage:s,onAct:_=>void k(A.name,_),onSelectTool:C}):u&&!a?null:f.jsx(RV,{servers:a,loading:h,onSelect:E})]})]})})}function RV({servers:e,loading:t,onSelect:n}){if(t&&!e)return f.jsx("div",{className:"py-6 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})});if(!e?.length)return f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"No MCP servers configured for this session."});const r=[...new Set(e.map(s=>s.scope??"other"))];return f.jsx("div",{className:"flex flex-col gap-4",children:r.map(s=>f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3 capitalize",children:s}),f.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(a=>(a.scope??"other")===s).map(a=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>n(a.name),className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-fg-1",children:a.name}),a.tools?.length?f.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[a.tools.length," tools"]}):null,f.jsx(gn,{variant:PR[a.status]??"neutral",dot:!0,className:"shrink-0",children:a.status}),f.jsx(Ed,{className:"size-3.5 shrink-0 text-fg-4"})]})},a.name))})]},s))})}function IV({server:e,busy:t,canManage:n,onAct:r,onSelectTool:s}){const a=e.status==="disabled";return f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("div",{children:[f.jsx(sr,{label:"Status",children:f.jsx(gn,{variant:PR[e.status]??"neutral",dot:!0,children:e.status})}),e.transport?f.jsx(sr,{label:"Transport",children:e.transport}):null,e.scope?f.jsx(sr,{label:"Scope",children:e.scope}):null,e.serverInfo?f.jsxs(sr,{label:"Server",children:[e.serverInfo.name," ",e.serverInfo.version]}):null,e.command?f.jsx(sr,{label:"Command",mono:!0,children:[e.command,...e.args??[]].join(" ")}):null,e.url?f.jsx(sr,{label:"URL",mono:!0,children:e.url}):null]}),e.error?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger",children:e.error}):null,n?f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(Je,{variant:"outline",size:"sm",disabled:t,onClick:()=>r("reconnect"),children:[t?f.jsx(xn,{className:"size-3 text-current"}):f.jsx(Oy,{className:"size-3"}),"Reconnect"]}),f.jsxs(Je,{variant:"outline",size:"sm",disabled:t,onClick:()=>r(a?"enable":"disable"),children:[a?f.jsx(Nz,{className:"size-3"}):f.jsx(wz,{className:"size-3"}),a?"Enable":"Disable"]})]}):null,f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Tools"}),e.tools?.length?f.jsx("ul",{className:"mt-1 flex flex-col",children:e.tools.map(l=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>s(l.name),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:l.name}),f.jsx(Ed,{className:"size-3.5 shrink-0 text-fg-4"})]})},l.name))}):f.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:e.status==="connected"?"This server exposes no tools.":"Tools are listed once the server connects."})]})]})}function OV({tool:e}){const t=e.annotations;return f.jsxs("div",{className:"flex flex-col gap-3",children:[e.description?f.jsx("p",{className:"text-body-sm whitespace-pre-wrap text-fg-2",children:e.description}):f.jsx("p",{className:"text-body-sm text-fg-4",children:"This tool carries no description."}),t?f.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.readOnly?f.jsx(gn,{variant:"success",children:"read-only"}):null,t.destructive?f.jsx(gn,{variant:"danger",children:"destructive"}):null,t.openWorld?f.jsx(gn,{variant:"warning",children:"open world"}):null]}):null,e.inputSchema!==void 0?f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Parameters"}),f.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2",children:MV(e.inputSchema)})]}):f.jsx("p",{className:xe("text-label text-fg-4"),children:"Parameters aren’t available: this engine names and describes each tool but reports no input schema."})]})}function MV(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const BR={user:"Personal",repo:"This project",system:"System",admin:"Managed"};function LV({skills:e,open:t,onOpenChange:n,onUse:r}){const[s,a]=y.useState(),l=e?.find(u=>u.name===s);return f.jsx(ds,{open:t,onOpenChange:u=>{u||a(void 0),n(u)},children:f.jsxs(fs,{children:[f.jsx(hs,{title:l?l.displayName??l.name:"Skills",description:l?l.name!==(l.displayName??l.name)?l.name:void 0:"Capabilities the agent can choose to use. Not commands — the model picks them from their descriptions.",actions:l?f.jsxs(Je,{variant:"ghost",size:"xs",onClick:()=>a(void 0),children:[f.jsx(lm,{className:"size-3.5"}),"Back"]}):void 0}),f.jsx(ms,{children:l?f.jsx(jV,{skill:l,onUse:r,onUsed:()=>n(!1)}):f.jsx(DV,{skills:e,onSelect:a})})]})})}function DV({skills:e,onSelect:t}){if(!e)return f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"Skills are listed once the session connects — send a message first."});if(e.length===0)return f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"This session found no skills."});const n=[...new Set(e.map(r=>r.scope??"other"))];return f.jsx("div",{className:"flex flex-col gap-4",children:n.map(r=>f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:BR[r]??r}),f.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(s=>(s.scope??"other")===r).map(s=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>t(s.name),className:"flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[f.jsxs("span",{className:"min-w-0 flex-1",children:[f.jsx("span",{className:"block truncate text-body-sm text-fg-1",children:s.displayName??s.name}),s.shortDescription??s.description?f.jsx("span",{className:"block truncate text-label text-fg-4",children:s.shortDescription??s.description}):null]}),s.enabled?null:f.jsx(gn,{variant:"neutral",className:"mt-0.5 shrink-0",children:"off"}),f.jsx(Ed,{className:"mt-0.5 size-3.5 shrink-0 text-fg-4"})]})},s.name))})]},r))})}function jV({skill:e,onUse:t,onUsed:n}){return f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("div",{children:[e.scope?f.jsx(sr,{label:"Scope",children:BR[e.scope]??e.scope}):null,f.jsx(sr,{label:"Status",children:f.jsx(gn,{variant:e.enabled?"success":"neutral",dot:!0,children:e.enabled?"enabled":"disabled"})})]}),e.description?f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Description"}),f.jsx("p",{className:"mt-1 text-body-sm whitespace-pre-wrap text-fg-2",children:e.description})]}):f.jsx("p",{className:"text-body-sm text-fg-4",children:"This skill carries no description."}),t&&e.enabled?f.jsxs("div",{children:[f.jsx(Je,{variant:"outline",size:"sm",onClick:()=>{t(e),n()},children:"Use this skill"}),f.jsx("p",{className:"mt-1.5 text-label text-fg-4",children:"Writes an opening message into the composer for you to edit — it isn’t sent, and there is no command that runs a skill directly."})]}):null]})}const Ub=e=>e==="default",v1=e=>e.replace(/\[.*\]$/,"");function Ow(e){const t=e.toLowerCase().split("-");return t[0]==="claude"&&t.shift(),t[0]??""}function PV(e,t){if(t===e.value||t===e.resolvedModel)return!0;const n=v1(t);if(e.resolvedModel)return n===v1(e.resolvedModel);const r=Ow(n);return r!==""&&r===Ow(v1(e.value))}function BV(e,t){if(t)return e.filter(n=>!Ub(n.value)).find(n=>PV(n,t))}function zR({models:e,model:t,onModelChange:n,variant:r="toolbar",disabled:s,className:a}){const l=BV(e,t)??(t?void 0:e.find(u=>Ub(u.value)));return f.jsxs(Ys,{items:e.map(u=>({value:u.value,label:u.displayName})),value:l?.value??null,onValueChange:u=>{typeof u!="string"||u===l?.value||n(Ub(u)?void 0:u)},disabled:s,children:[f.jsx(Ks,{"aria-label":"Model",className:xe(r==="toolbar"&&"h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover",a),children:f.jsx("span",{className:xe("truncate",r==="toolbar"&&"font-mono text-label"),children:f.jsx(Gs,{placeholder:t??"model"})})}),f.jsx(Xs,{className:"min-w-72",children:e.map(u=>f.jsxs(ws,{value:u.value,children:[f.jsx(Cs,{children:f.jsx("span",{className:"font-medium",children:u.displayName})}),u.description?f.jsx("span",{className:"text-label text-fg-4",children:u.description}):null]},u.value))})]})}const tu=[{value:"default",label:"Manual",shortLabel:"Manual",description:"Always ask before making changes",icon:j_},{value:"acceptEdits",label:"Accept edits",shortLabel:"Edits",description:"Automatically accept all file edits",icon:M_},{value:"plan",label:"Plan",shortLabel:"Plan",description:"Create a plan before making changes",icon:NB},{value:"auto",label:"Auto",shortLabel:"Auto",description:"Claude handles permission decisions",icon:cU},{value:"dontAsk",label:"Don't ask",shortLabel:"Don't ask",description:"Never ask — deny anything not pre-approved",icon:Uz},{value:"bypassPermissions",label:"Bypass permissions",shortLabel:"Bypass",description:"Skip every approval — the agent is unsupervised",icon:$l,dangerous:!0}],zV=e=>tu.find(t=>t.value===e);function UV(e,t){return(e?tu.filter(r=>e.includes(r.value)):tu).map(r=>({value:r.value,label:r.label,description:r.value==="bypassPermissions"&&t===!1?"Only available to a session started in this mode":r.description,dangerous:r.dangerous,disabled:r.value==="bypassPermissions"&&t===!1}))}function op({mode:e,onModeChange:t,modes:n,canBypass:r,variant:s="toolbar",disabled:a,className:l}){const u=e==="bypassPermissions",d=n?tu.filter(p=>n.includes(p.value)):tu,h=p=>p.value==="bypassPermissions"&&r===!1;return f.jsxs(Ys,{items:d.map(p=>({value:p.value,label:p.label})),value:e??null,onValueChange:p=>{typeof p=="string"&&p!==e&&t(p)},disabled:a,children:[f.jsx(Ks,{"aria-label":"Permission mode",className:xe(s==="toolbar"&&"h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover",u?"text-danger":s==="toolbar"?"text-fg-3":void 0,l),children:f.jsx("span",{className:xe("truncate",s==="toolbar"&&"text-label"),children:f.jsx(Gs,{placeholder:"permissions"})})}),f.jsx(Xs,{className:"min-w-64",children:d.map(p=>{const m=h(p);return f.jsxs(ws,{value:p.value,disabled:m,children:[f.jsx(Cs,{children:f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(p.icon,{className:xe("size-3.5 shrink-0",p.dangerous?"text-danger":"text-fg-3")}),f.jsx("span",{className:xe("font-medium",p.dangerous&&"text-danger"),children:p.label})]})}),f.jsx("span",{className:xe("pl-5.5 text-label",m?"text-fg-4":p.dangerous?"text-danger/80":"text-fg-4"),children:m?"Only available to a session started in this mode":p.description})]},p.value)})})]})}function UR(e){switch(e){case"Bash":case"BashOutput":case"KillShell":return Ab;case"Read":return Ay;case"Write":return qz;case"Edit":case"MultiEdit":case"NotebookEdit":return yz;case"Glob":return VB;case"Grep":return tp;case"WebFetch":return EB;case"WebSearch":return ow;case"Task":case"Agent":return My;case"TodoWrite":return $z;case"Skill":return np;case"AskUserQuestion":return z_;case"CodexCommand":return Ab;case"CodexFileChange":return jB;case"CodexWebSearch":return ow;case"CodexImageGeneration":case"CodexImageView":return rz;default:return e.startsWith("mcp__")?_z:oU}}function HV(e){switch(e){case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":case"Update":case"CodexFileChange":return!0;default:return!1}}const lp=(function(e){if(e==null)return qV;if(typeof e=="function")return up(e);if(typeof e=="object")return Array.isArray(e)?FV(e):$V(e);if(typeof e=="string")return VV(e);throw new Error("Expected function, string, or object as test")});function FV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=lp(e[n]);return up(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function $V(e){const t=e;return up(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function VV(e){return up(t);function t(n){return n&&n.type===e}}function up(e){return t;function t(n,r,s){return!!(YV(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function qV(){return!0}function YV(e){return e!==null&&typeof e=="object"&&"type"in e}const HR=[],Mc=!0,Hb=!1,Pl="skip";function zy(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=lp(s),l=r?-1:1;u(e,void 0,[])();function u(d,h,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const x=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=HR,E,N,C;if((!t||a(d,h,p[p.length-1]||void 0))&&(x=GV(n(d,p)),x[0]===Hb))return x;if("children"in d&&d.children){const S=d;if(S.children&&x[0]!==Pl)for(N=(r?S.children.length:-1)+l,C=p.concat(S);N>-1&&N<S.children.length;){const k=S.children[N];if(E=u(k,N,C)(),E[0]===Hb)return E;N=typeof E[1]=="number"?E[1]:N+l}}return x}}}function GV(e){return Array.isArray(e)?e:typeof e=="number"?[Mc,e]:e==null?HR:[e]}function qs(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),zy(e,a,u,s);function u(d,h){const p=h[h.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const nu={indicator:"indicator",textOnly:"text-only",remove:"remove"};function KV({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:s=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:l="text-gray-500",linkBlockPolicy:u=nu.indicator,imageBlockPolicy:d=nu.indicator}){const h=t.length&&!t.every(m=>m==="*"),p=n.length&&!n.every(m=>m==="*");if(!e&&(h||p))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return m=>{const b=eq(e,t,n,r,s,a,l,u,d);FR(m),qs(m,b)}}function Mw(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function XV(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const WV=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),QV=new Set(["javascript:","data:","file:","vbscript:"]);function Lw(e,t,n,r=!1,s=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!s)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return s&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const l=Mw(e,n);if(!l||QV.has(l.protocol)||!(WV.has(l.protocol)||a.includes(l.protocol)||a.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;const d=XV(e);return l&&t.some(h=>{const p=Mw(h,n);return!p||p.origin!==l.origin?!1:l.href.startsWith(p.href)})?d?l.pathname+l.search+l.hash:l.href:t.includes("*")?l.protocol!=="https:"&&l.protocol!=="http:"?null:d?l.pathname+l.search+l.hash:l.href:null}function FR(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)FR(t)}}const E1=Symbol("node-seen");function ZV(e,t,n){return t===nu.remove?{type:"remove"}:t===nu.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function JV(e,t,n){if(t===nu.remove)return{type:"remove"};if(t===nu.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const eq=(e,t,n,r,s,a,l,u,d)=>{const h=(p,m,b)=>{if(p.type!=="element"||p[E1])return Mc;if(p.tagName==="a"){const x=Lw(p.properties.href,t,e,!1,!1,s);if(x===null){if(p[E1]=!0,qs(p,h),b&&typeof m=="number"){const E=ZV(p,u,l);if(E.type==="remove")return b.children.splice(m,1),[Pl,m];b.children[m]=E.element}return Pl}else return p.properties.href=x,p.properties.target="_blank",p.properties.rel="noopener noreferrer",Mc}if(p.tagName==="img"){const x=Lw(p.properties.src,n,e,r,!0,s);if(x===null){if(p[E1]=!0,qs(p,h),b&&typeof m=="number"){const E=JV(p,d,a);if(E.type==="remove")return b.children.splice(m,1),[Pl,m];b.children[m]=E.element}return Pl}else return p.properties.src=x,Mc}return Mc};return h},$R=-1,cp=0,Hc=1,hm=2,Uy=3,Hy=4,Fy=5,$y=6,VR=7,qR=8,YR=typeof self=="object"?self:globalThis,Dw=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new YR[e](t)},tq=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case cp:case $R:return n(l,s);case Hc:{const u=n([],s);for(const d of l)u.push(r(d));return u}case hm:{const u=n({},s);for(const[d,h]of l)u[r(d)]=r(h);return u}case Uy:return n(new Date(l),s);case Hy:{const{source:u,flags:d}=l;return n(new RegExp(u,d),s)}case Fy:{const u=n(new Map,s);for(const[d,h]of l)u.set(r(d),r(h));return u}case $y:{const u=n(new Set,s);for(const d of l)u.add(r(d));return u}case VR:{const{name:u,message:d}=l;return n(typeof YR[u]=="function"?Dw(u,d):new Error(d),s)}case qR:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(Dw(a,l),s)};return r},jw=e=>tq(new Map,e)(0),io="",{toString:nq}={},{keys:rq}=Object,gc=e=>{const t=typeof e;if(t!=="object"||!e)return[cp,t];const n=nq.call(e).slice(8,-1);switch(n){case"Array":return[Hc,io];case"Object":return[hm,io];case"Date":return[Uy,io];case"RegExp":return[Hy,io];case"Map":return[Fy,io];case"Set":return[$y,io];case"DataView":return[Hc,n]}return n.includes("Array")?[Hc,n]:e instanceof Error?[VR,e.name||"Error"]:[hm,n]},vh=([e,t])=>e===cp&&(t==="function"||t==="symbol"),sq=(e,t,n,r)=>{const s=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=gc(l);switch(u){case cp:{let p=l;switch(d){case"bigint":u=qR,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return s([$R],l)}return s([u,p],l)}case Hc:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),s([d,[...b]],l)}const p=[],m=s([u,p],l);for(const b of l)p.push(a(b));return m}case hm:{if(d)switch(d){case"BigInt":return s([d,l.toString()],l);case"Boolean":case"Number":case"String":return s([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=s([u,p],l);for(const b of rq(l))(e||!vh(gc(l[b])))&&p.push([a(b),a(l[b])]);return m}case Uy:return s([u,isNaN(l.getTime())?io:l.toISOString()],l);case Hy:{const{source:p,flags:m}=l;return s([u,{source:p,flags:m}],l)}case Fy:{const p=[],m=s([u,p],l);for(const[b,x]of l)(e||!(vh(gc(b))||vh(gc(x))))&&p.push([a(b),a(x)]);return m}case $y:{const p=[],m=s([u,p],l);for(const b of l)(e||!vh(gc(b)))&&p.push(a(b));return m}}const{message:h}=l;return s([u,{name:d,message:h}],l)};return a},Pw=(e,{json:t,lossy:n}={})=>{const r=[];return sq(!(t||n),!!t,new Map,r)(e),r},Ao=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?jw(Pw(e,t)):structuredClone(e):(e,t)=>jw(Pw(e,t));class kd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}kd.prototype.normal={};kd.prototype.property={};kd.prototype.space=void 0;function GR(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new kd(n,r,t)}function fd(e){return e.toLowerCase()}class Lr{constructor(t,n){this.attribute=n,this.property=t}}Lr.prototype.attribute="";Lr.prototype.booleanish=!1;Lr.prototype.boolean=!1;Lr.prototype.commaOrSpaceSeparated=!1;Lr.prototype.commaSeparated=!1;Lr.prototype.defined=!1;Lr.prototype.mustUseProperty=!1;Lr.prototype.number=!1;Lr.prototype.overloadedBoolean=!1;Lr.prototype.property="";Lr.prototype.spaceSeparated=!1;Lr.prototype.space=void 0;let iq=0;const pt=zo(),Ln=zo(),Fb=zo(),Ue=zo(),rn=zo(),xo=zo(),Fr=zo();function zo(){return 2**++iq}const $b=Object.freeze(Object.defineProperty({__proto__:null,boolean:pt,booleanish:Ln,commaOrSpaceSeparated:Fr,commaSeparated:xo,number:Ue,overloadedBoolean:Fb,spaceSeparated:rn},Symbol.toStringTag,{value:"Module"})),T1=Object.keys($b);class Vy extends Lr{constructor(t,n,r,s){let a=-1;if(super(t,n),Bw(this,"space",s),typeof r=="number")for(;++a<T1.length;){const l=T1[a];Bw(this,T1[a],(r&$b[l])===$b[l])}}}Vy.prototype.defined=!0;function Bw(e,t,n){n&&(e[t]=n)}function fu(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new Vy(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[fd(r)]=r,n[fd(a.attribute)]=r}return new kd(t,n,e.space)}const KR=fu({properties:{ariaActiveDescendant:null,ariaAtomic:Ln,ariaAutoComplete:null,ariaBusy:Ln,ariaChecked:Ln,ariaColCount:Ue,ariaColIndex:Ue,ariaColSpan:Ue,ariaControls:rn,ariaCurrent:null,ariaDescribedBy:rn,ariaDetails:null,ariaDisabled:Ln,ariaDropEffect:rn,ariaErrorMessage:null,ariaExpanded:Ln,ariaFlowTo:rn,ariaGrabbed:Ln,ariaHasPopup:null,ariaHidden:Ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rn,ariaLevel:Ue,ariaLive:null,ariaModal:Ln,ariaMultiLine:Ln,ariaMultiSelectable:Ln,ariaOrientation:null,ariaOwns:rn,ariaPlaceholder:null,ariaPosInSet:Ue,ariaPressed:Ln,ariaReadOnly:Ln,ariaRelevant:null,ariaRequired:Ln,ariaRoleDescription:rn,ariaRowCount:Ue,ariaRowIndex:Ue,ariaRowSpan:Ue,ariaSelected:Ln,ariaSetSize:Ue,ariaSort:null,ariaValueMax:Ue,ariaValueMin:Ue,ariaValueNow:Ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function XR(e,t){return t in e?e[t]:t}function WR(e,t){return XR(e,t.toLowerCase())}const aq=fu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xo,acceptCharset:rn,accessKey:rn,action:null,allow:null,allowFullScreen:pt,allowPaymentRequest:pt,allowUserMedia:pt,alpha:pt,alt:null,as:null,async:pt,autoCapitalize:null,autoComplete:rn,autoFocus:pt,autoPlay:pt,blocking:rn,capture:null,charSet:null,checked:pt,cite:null,className:rn,closedBy:null,colorSpace:null,cols:Ue,colSpan:Ue,command:null,commandFor:null,content:null,contentEditable:Ln,controls:pt,controlsList:rn,coords:Ue|xo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pt,defer:pt,dir:null,dirName:null,disabled:pt,download:Fb,draggable:Ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pt,formTarget:null,headers:rn,height:Ue,hidden:Fb,high:Ue,href:null,hrefLang:null,htmlFor:rn,httpEquiv:rn,id:null,imageSizes:null,imageSrcSet:null,inert:pt,inputMode:null,integrity:null,is:null,isMap:pt,itemId:null,itemProp:rn,itemRef:rn,itemScope:pt,itemType:rn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pt,low:Ue,manifest:null,max:null,maxLength:Ue,media:null,method:null,min:null,minLength:Ue,multiple:pt,muted:pt,name:null,nonce:null,noModule:pt,noValidate:pt,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:pt,optimum:Ue,pattern:null,ping:rn,placeholder:null,playsInline:pt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pt,referrerPolicy:null,rel:rn,required:pt,reversed:pt,rows:Ue,rowSpan:Ue,sandbox:rn,scope:null,scoped:pt,seamless:pt,selected:pt,shadowRootClonable:pt,shadowRootCustomElementRegistry:pt,shadowRootDelegatesFocus:pt,shadowRootMode:null,shadowRootSerializable:pt,shape:null,size:Ue,sizes:null,slot:null,span:Ue,spellCheck:Ln,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ue,step:null,style:null,tabIndex:Ue,target:null,title:null,translate:null,type:null,typeMustMatch:pt,useMap:null,value:Ln,width:Ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rn,axis:null,background:null,bgColor:null,border:Ue,borderColor:null,bottomMargin:Ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pt,declare:pt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ue,leftMargin:Ue,link:null,longDesc:null,lowSrc:null,marginHeight:Ue,marginWidth:Ue,noResize:pt,noHref:pt,noShade:pt,noWrap:pt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ue,rules:null,scheme:null,scrolling:Ln,standby:null,summary:null,text:null,topMargin:Ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:pt,disablePictureInPicture:pt,disableRemotePlayback:pt,exportParts:xo,part:rn,prefix:null,property:null,results:Ue,security:null,unselectable:null},space:"html",transform:WR}),oq=fu({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",maskType:"mask-type",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:Fr,accentHeight:Ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ue,amplitude:Ue,arabicForm:null,ascent:Ue,attributeName:null,attributeType:null,azimuth:Ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ue,by:null,calcMode:null,capHeight:Ue,className:rn,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:Ue,diffuseConstant:Ue,direction:null,display:null,dur:null,divisor:Ue,dominantBaseline:null,download:pt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ue,enableBackground:null,end:null,event:null,exponent:Ue,externalResourcesRequired:null,fill:null,fillOpacity:Ue,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:xo,g2:xo,glyphName:xo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ue,horizOriginX:Ue,horizOriginY:Ue,id:null,ideographic:Ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ue,k:Ue,k1:Ue,k2:Ue,k3:Ue,k4:Ue,kernelMatrix:Fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ue,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:Ue,overlineThickness:Ue,paintOrder:null,panose1:null,path:null,pathLength:Ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ue,pointsAtY:Ue,pointsAtZ:Ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fr,rev:Fr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fr,requiredFeatures:Fr,requiredFonts:Fr,requiredFormats:Fr,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:Ue,specularExponent:Ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ue,strikethroughThickness:Ue,string:null,stroke:null,strokeDashArray:Fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ue,strokeOpacity:Ue,strokeWidth:null,style:null,surfaceScale:Ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fr,tabIndex:Ue,tableValues:null,target:null,targetX:Ue,targetY:Ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ue,underlineThickness:Ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ue,values:null,vAlphabetic:Ue,vMathematical:Ue,vectorEffect:null,vHanging:Ue,vIdeographic:Ue,version:null,vertAdvY:Ue,vertOriginX:Ue,vertOriginY:Ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:XR}),QR=fu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ZR=fu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:WR}),JR=fu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lq={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"},uq=/[A-Z]/g,zw=/-[a-z]/g,cq=/^data[-\w.:]+$/i;function dp(e,t){const n=fd(t);let r=t,s=Lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cq.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(zw,fq);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!zw.test(a)){let l=a.replace(uq,dq);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Vy}return new s(r,t)}function dq(e){return"-"+e.toLowerCase()}function fq(e){return e.charAt(1).toUpperCase()}const Nd=GR([KR,aq,QR,ZR,JR],"html"),Ma=GR([KR,oq,QR,ZR,JR],"svg");function Uw(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const l=n.slice(s,r).trim();(l||!a)&&t.push(l),s=r+1,r=n.indexOf(",",s)}return t}function e4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Hw=/[#.]/g;function hq(e,t){const n=e||"",r={};let s=0,a,l;for(;s<n.length;){Hw.lastIndex=s;const u=Hw.exec(n),d=n.slice(s,u?u.index:n.length);d&&(a?a==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,s+=d.length),u&&(a=u[0],s++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function Fw(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function t4(e){return e.join(" ").trim()}function n4(e,t,n){const r=n?bq(n):void 0;function s(a,l,...u){let d;if(a==null){d={type:"root",children:[]};const h=l;u.unshift(h)}else{d=hq(a,t);const h=d.tagName.toLowerCase(),p=r?r.get(h):void 0;if(d.tagName=p||h,mq(l))u.unshift(l);else for(const[m,b]of Object.entries(l))pq(e,d.properties,m,b)}for(const h of u)Vb(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return s}function mq(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const a=s;for(const l of a)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function pq(e,t,n,r){const s=dp(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?s.spaceSeparated?a=Fw(r):s.commaSeparated?a=Uw(r):s.commaOrSpaceSeparated?a=Fw(Uw(r).join(" ")):a=$w(s,s.property,r):Array.isArray(r)?a=[...r]:a=s.property==="style"?gq(r):String(r);if(Array.isArray(a)){const l=[];for(const u of a)l.push($w(s,s.property,u));a=l}s.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[s.property]=a}}function Vb(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Vb(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Vb(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function $w(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||fd(n)===fd(t)))return!0}return n}function gq(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function bq(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const xq=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],yq=n4(Nd,"div"),vq=n4(Ma,"g",xq);function Eq(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let l=0;for(;;){let u=n[l];if(u===void 0){const d=Vw(t,n[l-1]);u=d===-1?t.length+1:d+1,n[l]=u}if(u>a)return{line:l+1,column:a-(l>0?n[l-1]:0)+1,offset:a};l++}}}function s(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const u=n[n.length-1],d=Vw(t,u),h=d===-1?t.length+1:d+1;if(u===h)break;n.push(h)}const l=(a.line>1?n[a.line-2]:0)+a.column-1;if(l<n[a.line-1])return l}}}function Vw(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
544
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const mo={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},r4={}.hasOwnProperty,Tq=Object.prototype;function Sq(e,t){const n=t||{};return qy({file:n.file||void 0,location:!1,schema:n.space==="svg"?Ma:Nd,verbose:n.verbose||!1},e)}function qy(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Hh(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:s4(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),l=Eq(a),u=l.toPoint(0),d=l.toPoint(a.length);n.position={start:u,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Hh(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Hh(e,r,n),n}default:return n=Cq(e,t),n}}function s4(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=qy(e,t[n]);r.push(s)}return r}function Cq(e,t){const n=e.schema;e.schema=t.namespaceURI===mo.svg?Ma:Nd;let r=-1;const s={};for(;++r<t.attrs.length;){const u=t.attrs[r],d=(u.prefix?u.prefix+":":"")+u.name;r4.call(Tq,d)||(s[d]=u.value)}const l=(e.schema.space==="svg"?vq:yq)(t.tagName,s,s4(e,t.childNodes));if(Hh(e,t,l),l.tagName==="template"){const u=t,d=u.sourceCodeLocation,h=d&&d.startTag&&Bl(d.startTag),p=d&&d.endTag&&Bl(d.endTag),m=qy(e,u.content);h&&p&&e.file&&(m.position={start:h.end,end:p.start}),l.content=m}return e.schema=n,l}function Hh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=wq(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function wq(e,t,n){const r=Bl(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const a={};let l;if(n.attrs)for(l in n.attrs)r4.call(n.attrs,l)&&(a[dp(e.schema,l).property]=Bl(n.attrs[l]));n.startTag;const u=Bl(n.startTag),d=n.endTag?Bl(n.endTag):void 0,h={opening:u};d&&(h.closing=d),h.properties=a,t.data={position:h}}}return r}function Bl(e){const t=qw({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=qw({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function qw(e){return e.line&&e.column?e:void 0}const Yw={}.hasOwnProperty;function i4(e,t){const n=t||{};function r(s,...a){let l=r.invalid;const u=r.handlers;if(s&&Yw.call(s,e)){const d=String(s[e]);l=Yw.call(u,d)?u[d]:r.unknown}if(l)return l.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const kq={},Nq={}.hasOwnProperty,a4=i4("type",{handlers:{root:_q,element:Lq,text:Oq,comment:Mq,doctype:Iq}});function Aq(e,t){const r=(t||kq).space;return a4(e,r==="svg"?Ma:Nd)}function _q(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Yy(e.children,n,t),hu(e,n),n}function Rq(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Yy(e.children,n,t),hu(e,n),n}function Iq(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return hu(e,t),t}function Oq(e){const t={nodeName:"#text",value:e.value,parentNode:null};return hu(e,t),t}function Mq(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return hu(e,t),t}function Lq(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Ma);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&Nq.call(e.properties,a)){const d=Dq(r,a,e.properties[a]);d&&s.push(d)}}const l=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:mo[l],childNodes:[],parentNode:null};return u.childNodes=Yy(e.children,u,r),hu(e,u),e.tagName==="template"&&e.content&&(u.content=Rq(e.content,r)),u}function Dq(e,t,n){const r=dp(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?e4(n):t4(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=s.name.indexOf(":");a<0?s.prefix="":(s.name=s.name.slice(a+1),s.prefix=r.attribute.slice(0,a)),s.namespace=mo[r.space]}return s}function Yy(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=a4(e[r],n);a.parentNode=t,s.push(a)}return s}function hu(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const jq=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Pq=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),mn="�";var Y;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(Y||(Y={}));const kr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function o4(e){return e>=55296&&e<=57343}function Bq(e){return e>=56320&&e<=57343}function zq(e,t){return(e-55296)*1024+9216+t}function l4(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function u4(e){return e>=64976&&e<=65007||Pq.has(e)}var we;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(we||(we={}));const Uq=65536;class Hq{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Uq,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:a}=this,l=s+n,u=a+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:u,endOffset:u}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(Bq(n))return this.pos++,this._addGap(),zq(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Y.EOF;return this._err(we.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Y.EOF;const r=this.html.charCodeAt(n);return r===Y.CARRIAGE_RETURN?Y.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Y.EOF;let t=this.html.charCodeAt(this.pos);return t===Y.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Y.LINE_FEED):t===Y.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,o4(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===Y.LINE_FEED||t===Y.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){l4(t)?this._err(we.controlCharacterInInputStream):u4(t)&&this._err(we.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Ct;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Ct||(Ct={}));function c4(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const Fq=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),$q=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Vq(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=$q.get(e))!==null&&t!==void 0?t:e}var Yn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Yn||(Yn={}));const qq=32;var ya;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ya||(ya={}));function qb(e){return e>=Yn.ZERO&&e<=Yn.NINE}function Yq(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_F||e>=Yn.LOWER_A&&e<=Yn.LOWER_F}function Gq(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_Z||e>=Yn.LOWER_A&&e<=Yn.LOWER_Z||qb(e)}function Kq(e){return e===Yn.EQUALS||Gq(e)}var $n;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})($n||($n={}));var vi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vi||(vi={}));class Xq{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=$n.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vi.Strict}startEntity(t){this.decodeMode=t,this.state=$n.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case $n.EntityStart:return t.charCodeAt(n)===Yn.NUM?(this.state=$n.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=$n.NamedEntity,this.stateNamedEntity(t,n));case $n.NumericStart:return this.stateNumericStart(t,n);case $n.NumericDecimal:return this.stateNumericDecimal(t,n);case $n.NumericHex:return this.stateNumericHex(t,n);case $n.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|qq)===Yn.LOWER_X?(this.state=$n.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=$n.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(t.substr(n,a),s),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(qb(s)||Yq(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(qb(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Yn.SEMI)this.consumed+=1;else if(this.decodeMode===vi.Strict)return 0;return this.emitCodePoint(Vq(this.result),this.consumed),this.errors&&(t!==Yn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&ya.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=Wq(r,s,this.treeIndex+Math.max(1,a),l),this.treeIndex<0)return this.result===0||this.decodeMode===vi.Attribute&&(a===0||Kq(l))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&ya.VALUE_LENGTH)>>14,a!==0){if(l===Yn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==vi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&ya.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~ya.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case $n.NamedEntity:return this.result!==0&&(this.decodeMode!==vi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $n.NumericDecimal:return this.emitNumericEntity(0,2);case $n.NumericHex:return this.emitNumericEntity(0,3);case $n.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $n.EntityStart:return 0}}}function Wq(e,t,n,r){const s=(t&ya.BRANCH_LENGTH)>>7,a=t&ya.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=s?-1:e[n+d]-1}let l=n,u=l+s-1;for(;l<=u;){const d=l+u>>>1,h=e[d];if(h<r)l=d+1;else if(h>r)u=d-1;else return e[d+s]}return-1}var Le;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Le||(Le={}));var yo;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(yo||(yo={}));var is;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(is||(is={}));var pe;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(pe||(pe={}));var w;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(w||(w={}));const Qq=new Map([[pe.A,w.A],[pe.ADDRESS,w.ADDRESS],[pe.ANNOTATION_XML,w.ANNOTATION_XML],[pe.APPLET,w.APPLET],[pe.AREA,w.AREA],[pe.ARTICLE,w.ARTICLE],[pe.ASIDE,w.ASIDE],[pe.B,w.B],[pe.BASE,w.BASE],[pe.BASEFONT,w.BASEFONT],[pe.BGSOUND,w.BGSOUND],[pe.BIG,w.BIG],[pe.BLOCKQUOTE,w.BLOCKQUOTE],[pe.BODY,w.BODY],[pe.BR,w.BR],[pe.BUTTON,w.BUTTON],[pe.CAPTION,w.CAPTION],[pe.CENTER,w.CENTER],[pe.CODE,w.CODE],[pe.COL,w.COL],[pe.COLGROUP,w.COLGROUP],[pe.DD,w.DD],[pe.DESC,w.DESC],[pe.DETAILS,w.DETAILS],[pe.DIALOG,w.DIALOG],[pe.DIR,w.DIR],[pe.DIV,w.DIV],[pe.DL,w.DL],[pe.DT,w.DT],[pe.EM,w.EM],[pe.EMBED,w.EMBED],[pe.FIELDSET,w.FIELDSET],[pe.FIGCAPTION,w.FIGCAPTION],[pe.FIGURE,w.FIGURE],[pe.FONT,w.FONT],[pe.FOOTER,w.FOOTER],[pe.FOREIGN_OBJECT,w.FOREIGN_OBJECT],[pe.FORM,w.FORM],[pe.FRAME,w.FRAME],[pe.FRAMESET,w.FRAMESET],[pe.H1,w.H1],[pe.H2,w.H2],[pe.H3,w.H3],[pe.H4,w.H4],[pe.H5,w.H5],[pe.H6,w.H6],[pe.HEAD,w.HEAD],[pe.HEADER,w.HEADER],[pe.HGROUP,w.HGROUP],[pe.HR,w.HR],[pe.HTML,w.HTML],[pe.I,w.I],[pe.IMG,w.IMG],[pe.IMAGE,w.IMAGE],[pe.INPUT,w.INPUT],[pe.IFRAME,w.IFRAME],[pe.KEYGEN,w.KEYGEN],[pe.LABEL,w.LABEL],[pe.LI,w.LI],[pe.LINK,w.LINK],[pe.LISTING,w.LISTING],[pe.MAIN,w.MAIN],[pe.MALIGNMARK,w.MALIGNMARK],[pe.MARQUEE,w.MARQUEE],[pe.MATH,w.MATH],[pe.MENU,w.MENU],[pe.META,w.META],[pe.MGLYPH,w.MGLYPH],[pe.MI,w.MI],[pe.MO,w.MO],[pe.MN,w.MN],[pe.MS,w.MS],[pe.MTEXT,w.MTEXT],[pe.NAV,w.NAV],[pe.NOBR,w.NOBR],[pe.NOFRAMES,w.NOFRAMES],[pe.NOEMBED,w.NOEMBED],[pe.NOSCRIPT,w.NOSCRIPT],[pe.OBJECT,w.OBJECT],[pe.OL,w.OL],[pe.OPTGROUP,w.OPTGROUP],[pe.OPTION,w.OPTION],[pe.P,w.P],[pe.PARAM,w.PARAM],[pe.PLAINTEXT,w.PLAINTEXT],[pe.PRE,w.PRE],[pe.RB,w.RB],[pe.RP,w.RP],[pe.RT,w.RT],[pe.RTC,w.RTC],[pe.RUBY,w.RUBY],[pe.S,w.S],[pe.SCRIPT,w.SCRIPT],[pe.SEARCH,w.SEARCH],[pe.SECTION,w.SECTION],[pe.SELECT,w.SELECT],[pe.SOURCE,w.SOURCE],[pe.SMALL,w.SMALL],[pe.SPAN,w.SPAN],[pe.STRIKE,w.STRIKE],[pe.STRONG,w.STRONG],[pe.STYLE,w.STYLE],[pe.SUB,w.SUB],[pe.SUMMARY,w.SUMMARY],[pe.SUP,w.SUP],[pe.TABLE,w.TABLE],[pe.TBODY,w.TBODY],[pe.TEMPLATE,w.TEMPLATE],[pe.TEXTAREA,w.TEXTAREA],[pe.TFOOT,w.TFOOT],[pe.TD,w.TD],[pe.TH,w.TH],[pe.THEAD,w.THEAD],[pe.TITLE,w.TITLE],[pe.TR,w.TR],[pe.TRACK,w.TRACK],[pe.TT,w.TT],[pe.U,w.U],[pe.UL,w.UL],[pe.SVG,w.SVG],[pe.VAR,w.VAR],[pe.WBR,w.WBR],[pe.XMP,w.XMP]]);function mu(e){var t;return(t=Qq.get(e))!==null&&t!==void 0?t:w.UNKNOWN}const Pe=w,Zq={[Le.HTML]:new Set([Pe.ADDRESS,Pe.APPLET,Pe.AREA,Pe.ARTICLE,Pe.ASIDE,Pe.BASE,Pe.BASEFONT,Pe.BGSOUND,Pe.BLOCKQUOTE,Pe.BODY,Pe.BR,Pe.BUTTON,Pe.CAPTION,Pe.CENTER,Pe.COL,Pe.COLGROUP,Pe.DD,Pe.DETAILS,Pe.DIR,Pe.DIV,Pe.DL,Pe.DT,Pe.EMBED,Pe.FIELDSET,Pe.FIGCAPTION,Pe.FIGURE,Pe.FOOTER,Pe.FORM,Pe.FRAME,Pe.FRAMESET,Pe.H1,Pe.H2,Pe.H3,Pe.H4,Pe.H5,Pe.H6,Pe.HEAD,Pe.HEADER,Pe.HGROUP,Pe.HR,Pe.HTML,Pe.IFRAME,Pe.IMG,Pe.INPUT,Pe.LI,Pe.LINK,Pe.LISTING,Pe.MAIN,Pe.MARQUEE,Pe.MENU,Pe.META,Pe.NAV,Pe.NOEMBED,Pe.NOFRAMES,Pe.NOSCRIPT,Pe.OBJECT,Pe.OL,Pe.P,Pe.PARAM,Pe.PLAINTEXT,Pe.PRE,Pe.SCRIPT,Pe.SECTION,Pe.SELECT,Pe.SOURCE,Pe.STYLE,Pe.SUMMARY,Pe.TABLE,Pe.TBODY,Pe.TD,Pe.TEMPLATE,Pe.TEXTAREA,Pe.TFOOT,Pe.TH,Pe.THEAD,Pe.TITLE,Pe.TR,Pe.TRACK,Pe.UL,Pe.WBR,Pe.XMP]),[Le.MATHML]:new Set([Pe.MI,Pe.MO,Pe.MN,Pe.MS,Pe.MTEXT,Pe.ANNOTATION_XML]),[Le.SVG]:new Set([Pe.TITLE,Pe.FOREIGN_OBJECT,Pe.DESC]),[Le.XLINK]:new Set,[Le.XML]:new Set,[Le.XMLNS]:new Set},Yb=new Set([Pe.H1,Pe.H2,Pe.H3,Pe.H4,Pe.H5,Pe.H6]);pe.STYLE,pe.SCRIPT,pe.XMP,pe.IFRAME,pe.NOEMBED,pe.NOFRAMES,pe.PLAINTEXT;var Q;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Q||(Q={}));const Nn={DATA:Q.DATA,RCDATA:Q.RCDATA,RAWTEXT:Q.RAWTEXT,SCRIPT_DATA:Q.SCRIPT_DATA,PLAINTEXT:Q.PLAINTEXT,CDATA_SECTION:Q.CDATA_SECTION};function Jq(e){return e>=Y.DIGIT_0&&e<=Y.DIGIT_9}function Lc(e){return e>=Y.LATIN_CAPITAL_A&&e<=Y.LATIN_CAPITAL_Z}function eY(e){return e>=Y.LATIN_SMALL_A&&e<=Y.LATIN_SMALL_Z}function fa(e){return eY(e)||Lc(e)}function Gw(e){return fa(e)||Jq(e)}function Eh(e){return e+32}function d4(e){return e===Y.SPACE||e===Y.LINE_FEED||e===Y.TABULATION||e===Y.FORM_FEED}function Kw(e){return d4(e)||e===Y.SOLIDUS||e===Y.GREATER_THAN_SIGN}function tY(e){return e===Y.NULL?we.nullCharacterReference:e>1114111?we.characterReferenceOutsideUnicodeRange:o4(e)?we.surrogateCharacterReference:u4(e)?we.noncharacterCharacterReference:l4(e)||e===Y.CARRIAGE_RETURN?we.controlCharacterReference:null}class nY{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Q.DATA,this.returnState=Q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Hq(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Xq(Fq,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(we.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(we.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=tY(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Ct.START_TAG,tagName:"",tagID:w.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ct.END_TAG,tagName:"",tagID:w.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Ct.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Ct.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(c4(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(we.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=mu(t.tagName),t.type===Ct.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(we.endTagWithAttributes),t.selfClosing&&this._err(we.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Ct.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ct.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ct.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Ct.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=d4(t)?Ct.WHITESPACE_CHARACTER:t===Y.NULL?Ct.NULL_CHARACTER:Ct.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ct.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vi.Attribute:vi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Q.DATA:{this._stateData(t);break}case Q.RCDATA:{this._stateRcdata(t);break}case Q.RAWTEXT:{this._stateRawtext(t);break}case Q.SCRIPT_DATA:{this._stateScriptData(t);break}case Q.PLAINTEXT:{this._statePlaintext(t);break}case Q.TAG_OPEN:{this._stateTagOpen(t);break}case Q.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Q.TAG_NAME:{this._stateTagName(t);break}case Q.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Q.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Q.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Q.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Q.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Q.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Q.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Q.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Q.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Q.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Q.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Q.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Q.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Q.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Q.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Q.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Q.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Q.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Q.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Q.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Q.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Q.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Q.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Q.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Q.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Q.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Q.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Q.COMMENT_START:{this._stateCommentStart(t);break}case Q.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Q.COMMENT:{this._stateComment(t);break}case Q.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Q.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Q.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Q.COMMENT_END:{this._stateCommentEnd(t);break}case Q.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Q.DOCTYPE:{this._stateDoctype(t);break}case Q.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Q.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Q.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Q.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Q.CDATA_SECTION:{this._stateCdataSection(t);break}case Q.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Q.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Q.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Q.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=Q.TAG_OPEN;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitCodePoint(t);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case Y.AMPERSAND:{this._startCharacterReference();break}case Y.LESS_THAN_SIGN:{this.state=Q.RCDATA_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(mn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=Q.RAWTEXT_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(mn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=Q.SCRIPT_DATA_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(mn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(mn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(fa(t))this._createStartTagToken(),this.state=Q.TAG_NAME,this._stateTagName(t);else switch(t){case Y.EXCLAMATION_MARK:{this.state=Q.MARKUP_DECLARATION_OPEN;break}case Y.SOLIDUS:{this.state=Q.END_TAG_OPEN;break}case Y.QUESTION_MARK:{this._err(we.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(t);break}case Y.EOF:{this._err(we.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(we.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Q.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(fa(t))this._createEndTagToken(),this.state=Q.TAG_NAME,this._stateTagName(t);else switch(t){case Y.GREATER_THAN_SIGN:{this._err(we.missingEndTagName),this.state=Q.DATA;break}case Y.EOF:{this._err(we.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(we.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Q.BEFORE_ATTRIBUTE_NAME;break}case Y.SOLIDUS:{this.state=Q.SELF_CLOSING_START_TAG;break}case Y.GREATER_THAN_SIGN:{this.state=Q.DATA,this.emitCurrentTagToken();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.tagName+=mn;break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Lc(t)?Eh(t):t)}}_stateRcdataLessThanSign(t){t===Y.SOLIDUS?this.state=Q.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=Q.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){fa(t)?(this.state=Q.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=Q.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Q.BEFORE_ATTRIBUTE_NAME,!1;case Y.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Q.SELF_CLOSING_START_TAG,!1;case Y.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Q.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Q.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===Y.SOLIDUS?this.state=Q.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=Q.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){fa(t)?(this.state=Q.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=Q.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Q.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case Y.SOLIDUS:{this.state=Q.SCRIPT_DATA_END_TAG_OPEN;break}case Y.EXCLAMATION_MARK:{this.state=Q.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=Q.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){fa(t)?(this.state=Q.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=Q.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Q.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===Y.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=Q.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===Y.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=Q.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(mn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(mn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case Y.HYPHEN_MINUS:{this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.GREATER_THAN_SIGN:{this.state=Q.SCRIPT_DATA,this._emitChars(">");break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(mn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===Y.SOLIDUS?this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:fa(t)?(this._emitChars("<"),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){fa(t)?(this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(kr.SCRIPT,!1)&&Kw(this.preprocessor.peek(kr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<kr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(mn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(mn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case Y.HYPHEN_MINUS:{this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.GREATER_THAN_SIGN:{this.state=Q.SCRIPT_DATA,this._emitChars(">");break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(mn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===Y.SOLIDUS?(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(kr.SCRIPT,!1)&&Kw(this.preprocessor.peek(kr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<kr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.SOLIDUS:case Y.GREATER_THAN_SIGN:case Y.EOF:{this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case Y.EQUALS_SIGN:{this._err(we.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=Q.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:case Y.SOLIDUS:case Y.GREATER_THAN_SIGN:case Y.EOF:{this._leaveAttrName(),this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case Y.EQUALS_SIGN:{this._leaveAttrName(),this.state=Q.BEFORE_ATTRIBUTE_VALUE;break}case Y.QUOTATION_MARK:case Y.APOSTROPHE:case Y.LESS_THAN_SIGN:{this._err(we.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.name+=mn;break}default:this.currentAttr.name+=String.fromCodePoint(Lc(t)?Eh(t):t)}}_stateAfterAttributeName(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.SOLIDUS:{this.state=Q.SELF_CLOSING_START_TAG;break}case Y.EQUALS_SIGN:{this.state=Q.BEFORE_ATTRIBUTE_VALUE;break}case Y.GREATER_THAN_SIGN:{this.state=Q.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.QUOTATION_MARK:{this.state=Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this.state=Q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingAttributeValue),this.state=Q.DATA,this.emitCurrentTagToken();break}default:this.state=Q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case Y.QUOTATION_MARK:{this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case Y.APOSTROPHE:{this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case Y.QUOTATION_MARK:case Y.APOSTROPHE:case Y.LESS_THAN_SIGN:case Y.EQUALS_SIGN:case Y.GRAVE_ACCENT:{this._err(we.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break}case Y.SOLIDUS:{this._leaveAttrValue(),this.state=Q.SELF_CLOSING_START_TAG;break}case Y.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._err(we.missingWhitespaceBetweenAttributes),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case Y.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=Q.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._err(we.unexpectedSolidusInTag),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.state=Q.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.data+=mn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(kr.DASH_DASH,!0)?(this._createCommentToken(kr.DASH_DASH.length+1),this.state=Q.COMMENT_START):this._consumeSequenceIfMatch(kr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(kr.DOCTYPE.length+1),this.state=Q.DOCTYPE):this._consumeSequenceIfMatch(kr.CDATA_START,!0)?this.inForeignNode?this.state=Q.CDATA_SECTION:(this._err(we.cdataInHtmlContent),this._createCommentToken(kr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=Q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(we.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case Y.HYPHEN_MINUS:{this.state=Q.COMMENT_START_DASH;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptClosingOfEmptyComment),this.state=Q.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=Q.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=Q.COMMENT_END;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptClosingOfEmptyComment),this.state=Q.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Q.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=Q.COMMENT_END_DASH;break}case Y.LESS_THAN_SIGN:{n.data+="<",this.state=Q.COMMENT_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.data+=mn;break}case Y.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case Y.EXCLAMATION_MARK:{n.data+="!",this.state=Q.COMMENT_LESS_THAN_SIGN_BANG;break}case Y.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=Q.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===Y.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Q.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===Y.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Q.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==Y.GREATER_THAN_SIGN&&t!==Y.EOF&&this._err(we.nestedComment),this.state=Q.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=Q.COMMENT_END;break}case Y.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Q.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.state=Q.DATA,this.emitCurrentComment(n);break}case Y.EXCLAMATION_MARK:{this.state=Q.COMMENT_END_BANG;break}case Y.HYPHEN_MINUS:{n.data+="-";break}case Y.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=Q.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{n.data+="--!",this.state=Q.COMMENT_END_DASH;break}case Y.GREATER_THAN_SIGN:{this._err(we.incorrectlyClosedComment),this.state=Q.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=Q.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Q.BEFORE_DOCTYPE_NAME;break}case Y.GREATER_THAN_SIGN:{this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case Y.EOF:{this._err(we.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingWhitespaceBeforeDoctypeName),this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Lc(t))this._createDoctypeToken(String.fromCharCode(Eh(t))),this.state=Q.DOCTYPE_NAME;else switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.NULL:{this._err(we.unexpectedNullCharacter),this._createDoctypeToken(mn),this.state=Q.DOCTYPE_NAME;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Q.DATA;break}case Y.EOF:{this._err(we.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=Q.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Q.AFTER_DOCTYPE_NAME;break}case Y.GREATER_THAN_SIGN:{this.state=Q.DATA,this.emitCurrentDoctype(n);break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.name+=mn;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Lc(t)?Eh(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.GREATER_THAN_SIGN:{this.state=Q.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(kr.PUBLIC,!1)?this.state=Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(kr.SYSTEM,!1)?this.state=Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(we.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.QUOTATION_MARK:{this._err(we.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(we.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.QUOTATION_MARK:{n.publicId="",this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.publicId="",this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case Y.QUOTATION_MARK:{this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.publicId+=mn;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Q.DATA;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case Y.APOSTROPHE:{this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.publicId+=mn;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Q.DATA;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case Y.GREATER_THAN_SIGN:{this.state=Q.DATA,this.emitCurrentDoctype(n);break}case Y.QUOTATION_MARK:{this._err(we.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(we.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Q.DATA;break}case Y.QUOTATION_MARK:{n.systemId="",this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.systemId="",this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.QUOTATION_MARK:{this._err(we.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(we.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.QUOTATION_MARK:{n.systemId="",this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.systemId="",this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case Y.QUOTATION_MARK:{this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.systemId+=mn;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Q.DATA;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case Y.APOSTROPHE:{this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.systemId+=mn;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Q.DATA;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:break;case Y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Q.DATA;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Q.DATA;break}case Y.NULL:{this._err(we.unexpectedNullCharacter);break}case Y.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case Y.RIGHT_SQUARE_BRACKET:{this.state=Q.CDATA_SECTION_BRACKET;break}case Y.EOF:{this._err(we.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===Y.RIGHT_SQUARE_BRACKET?this.state=Q.CDATA_SECTION_END:(this._emitChars("]"),this.state=Q.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case Y.GREATER_THAN_SIGN:{this.state=Q.DATA;break}case Y.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=Q.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(Y.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Gw(this.preprocessor.peek(1))?Q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Gw(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===Y.SEMICOLON&&this._err(we.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const f4=new Set([w.DD,w.DT,w.LI,w.OPTGROUP,w.OPTION,w.P,w.RB,w.RP,w.RT,w.RTC]),Xw=new Set([...f4,w.CAPTION,w.COLGROUP,w.TBODY,w.TD,w.TFOOT,w.TH,w.THEAD,w.TR]),mm=new Set([w.APPLET,w.CAPTION,w.HTML,w.MARQUEE,w.OBJECT,w.TABLE,w.TD,w.TEMPLATE,w.TH]),rY=new Set([...mm,w.OL,w.UL]),sY=new Set([...mm,w.BUTTON]),Ww=new Set([w.ANNOTATION_XML,w.MI,w.MN,w.MO,w.MS,w.MTEXT]),Qw=new Set([w.DESC,w.FOREIGN_OBJECT,w.TITLE]),iY=new Set([w.TR,w.TEMPLATE,w.HTML]),aY=new Set([w.TBODY,w.TFOOT,w.THEAD,w.TEMPLATE,w.HTML]),oY=new Set([w.TABLE,w.TEMPLATE,w.HTML]),lY=new Set([w.TD,w.TH]);class uY{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=w.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===w.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Le.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Le.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Yb,Le.HTML)}popUntilTableCellPopped(){this.popUntilPopped(lY,Le.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(oY,Le.HTML)}clearBackToTableBodyContext(){this.clearBackTo(aY,Le.HTML)}clearBackToTableRowContext(){this.clearBackTo(iY,Le.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===w.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===w.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Le.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Le.SVG:{if(Qw.has(s))return!1;break}case Le.MATHML:{if(Ww.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,mm)}hasInListItemScope(t){return this.hasInDynamicScope(t,rY)}hasInButtonScope(t){return this.hasInDynamicScope(t,sY)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Le.HTML:{if(Yb.has(n))return!0;if(mm.has(n))return!1;break}case Le.SVG:{if(Qw.has(n))return!1;break}case Le.MATHML:{if(Ww.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Le.HTML)switch(this.tagIDs[n]){case t:return!0;case w.TABLE:case w.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Le.HTML)switch(this.tagIDs[t]){case w.TBODY:case w.THEAD:case w.TFOOT:return!0;case w.TABLE:case w.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Le.HTML)switch(this.tagIDs[n]){case t:return!0;case w.OPTION:case w.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&f4.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Xw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Xw.has(this.currentTagId);)this.pop()}}const S1=3;var Fs;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Fs||(Fs={}));const Zw={type:Fs.Marker};class cY{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const d=this.entries[u];if(d.type===Fs.Marker)break;const{element:h}=d;if(this.treeAdapter.getTagName(h)===a&&this.treeAdapter.getNamespaceURI(h)===l){const p=this.treeAdapter.getAttrList(h);p.length===s&&r.push({idx:u,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<S1)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<S1)return;const s=new Map(n.map(l=>[l.name,l.value]));let a=0;for(let l=0;l<r.length;l++){const u=r[l];u.attrs.every(d=>s.get(d.name)===d.value)&&(a+=1,a>=S1&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Zw)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Fs.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Fs.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Zw);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Fs.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Fs.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Fs.Element&&n.element===t)}}const ha={createDocument(){return{nodeName:"#document",mode:is.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};ha.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(ha.isTextNode(n)){n.value+=t;return}}ha.appendChild(e,ha.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ha.isTextNode(r)?r.value+=t:ha.insertBefore(e,ha.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},h4="html",dY="about:legacy-compat",fY="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",m4=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],hY=[...m4,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],mY=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),p4=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],pY=[...p4,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Jw(e,t){return t.some(n=>e.startsWith(n))}function gY(e){return e.name===h4&&e.publicId===null&&(e.systemId===null||e.systemId===dY)}function bY(e){if(e.name!==h4)return is.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===fY)return is.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),mY.has(n))return is.QUIRKS;let r=t===null?hY:m4;if(Jw(n,r))return is.QUIRKS;if(r=t===null?p4:pY,Jw(n,r))return is.LIMITED_QUIRKS}return is.NO_QUIRKS}const e3={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},xY="definitionurl",yY="definitionURL",vY=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),EY=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Le.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Le.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Le.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Le.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Le.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Le.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Le.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Le.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Le.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Le.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Le.XMLNS}]]),TY=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),SY=new Set([w.B,w.BIG,w.BLOCKQUOTE,w.BODY,w.BR,w.CENTER,w.CODE,w.DD,w.DIV,w.DL,w.DT,w.EM,w.EMBED,w.H1,w.H2,w.H3,w.H4,w.H5,w.H6,w.HEAD,w.HR,w.I,w.IMG,w.LI,w.LISTING,w.MENU,w.META,w.NOBR,w.OL,w.P,w.PRE,w.RUBY,w.S,w.SMALL,w.SPAN,w.STRONG,w.STRIKE,w.SUB,w.SUP,w.TABLE,w.TT,w.U,w.UL,w.VAR]);function CY(e){const t=e.tagID;return t===w.FONT&&e.attrs.some(({name:r})=>r===yo.COLOR||r===yo.SIZE||r===yo.FACE)||SY.has(t)}function g4(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===xY){e.attrs[t].name=yY;break}}function b4(e){for(let t=0;t<e.attrs.length;t++){const n=vY.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Gy(e){for(let t=0;t<e.attrs.length;t++){const n=EY.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function wY(e){const t=TY.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=mu(e.tagName))}function kY(e,t){return t===Le.MATHML&&(e===w.MI||e===w.MO||e===w.MN||e===w.MS||e===w.MTEXT)}function NY(e,t,n){if(t===Le.MATHML&&e===w.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===yo.ENCODING){const s=n[r].value.toLowerCase();return s===e3.TEXT_HTML||s===e3.APPLICATION_XML}}return t===Le.SVG&&(e===w.FOREIGN_OBJECT||e===w.DESC||e===w.TITLE)}function AY(e,t,n,r){return(!r||r===Le.HTML)&&NY(e,t,n)||(!r||r===Le.MATHML)&&kY(e,t)}const _Y="hidden",RY=8,IY=3;var ne;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(ne||(ne={}));const OY={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},x4=new Set([w.TABLE,w.TBODY,w.TFOOT,w.THEAD,w.TR]),t3={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ha,onParseError:null};class n3{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=ne.INITIAL,this.originalInsertionMode=ne.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...t3,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new nY(this.options,this),this.activeFormattingElements=new cY(this.treeAdapter),this.fragmentContextID=r?mu(this.treeAdapter.getTagName(r)):w.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new uY(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...t3,...n};t??(t=r.treeAdapter.createElement(pe.TEMPLATE,Le.HTML,[]));const s=r.treeAdapter.createElement("documentmock",Le.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===w.TEMPLATE&&a.tmplInsertionModeStack.unshift(ne.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const a=(s=t.location)!==null&&s!==void 0?s:OY,l={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(l)}onItemPush(t,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let a,l;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,l=this.fragmentContextID):{current:a,currentTagId:l}=this.openElements,this._setContextModes(a,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Le.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Le.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=ne.TEXT}switchToPlaintextParsing(){this.insertionMode=ne.TEXT,this.originalInsertionMode=ne.IN_BODY,this.tokenizer.state=Nn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===pe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Le.HTML))switch(this.fragmentContextID){case w.TITLE:case w.TEXTAREA:{this.tokenizer.state=Nn.RCDATA;break}case w.STYLE:case w.XMP:case w.IFRAME:case w.NOEMBED:case w.NOFRAMES:case w.NOSCRIPT:{this.tokenizer.state=Nn.RAWTEXT;break}case w.SCRIPT:{this.tokenizer.state=Nn.SCRIPT_DATA;break}case w.PLAINTEXT:{this.tokenizer.state=Nn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Le.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Le.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(pe.HTML,Le.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,w.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,l=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:h,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:h,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),a=n.type===Ct.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===w.SVG&&this.treeAdapter.getTagName(n)===pe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Le.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===w.MGLYPH||t.tagID===w.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Le.HTML)}_processToken(t){switch(t.type){case Ct.CHARACTER:{this.onCharacter(t);break}case Ct.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ct.COMMENT:{this.onComment(t);break}case Ct.DOCTYPE:{this.onDoctype(t);break}case Ct.START_TAG:{this._processStartTag(t);break}case Ct.END_TAG:{this.onEndTag(t);break}case Ct.EOF:{this.onEof(t);break}case Ct.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return AY(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Fs.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=ne.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(w.P),this.openElements.popUntilTagNamePopped(w.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case w.TR:{this.insertionMode=ne.IN_ROW;return}case w.TBODY:case w.THEAD:case w.TFOOT:{this.insertionMode=ne.IN_TABLE_BODY;return}case w.CAPTION:{this.insertionMode=ne.IN_CAPTION;return}case w.COLGROUP:{this.insertionMode=ne.IN_COLUMN_GROUP;return}case w.TABLE:{this.insertionMode=ne.IN_TABLE;return}case w.BODY:{this.insertionMode=ne.IN_BODY;return}case w.FRAMESET:{this.insertionMode=ne.IN_FRAMESET;return}case w.SELECT:{this._resetInsertionModeForSelect(t);return}case w.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case w.HTML:{this.insertionMode=this.headElement?ne.AFTER_HEAD:ne.BEFORE_HEAD;return}case w.TD:case w.TH:{if(t>0){this.insertionMode=ne.IN_CELL;return}break}case w.HEAD:{if(t>0){this.insertionMode=ne.IN_HEAD;return}break}}this.insertionMode=ne.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===w.TEMPLATE)break;if(r===w.TABLE){this.insertionMode=ne.IN_SELECT_IN_TABLE;return}}this.insertionMode=ne.IN_SELECT}_isElementCausesFosterParenting(t){return x4.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case w.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Le.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case w.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return Zq[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){lK(this,t);return}switch(this.insertionMode){case ne.INITIAL:{bc(this,t);break}case ne.BEFORE_HTML:{Fc(this,t);break}case ne.BEFORE_HEAD:{$c(this,t);break}case ne.IN_HEAD:{Vc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{qc(this,t);break}case ne.AFTER_HEAD:{Yc(this,t);break}case ne.IN_BODY:case ne.IN_CAPTION:case ne.IN_CELL:case ne.IN_TEMPLATE:{v4(this,t);break}case ne.TEXT:case ne.IN_SELECT:case ne.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case ne.IN_TABLE:case ne.IN_TABLE_BODY:case ne.IN_ROW:{C1(this,t);break}case ne.IN_TABLE_TEXT:{k4(this,t);break}case ne.IN_COLUMN_GROUP:{pm(this,t);break}case ne.AFTER_BODY:{gm(this,t);break}case ne.AFTER_AFTER_BODY:{Fh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){oK(this,t);return}switch(this.insertionMode){case ne.INITIAL:{bc(this,t);break}case ne.BEFORE_HTML:{Fc(this,t);break}case ne.BEFORE_HEAD:{$c(this,t);break}case ne.IN_HEAD:{Vc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{qc(this,t);break}case ne.AFTER_HEAD:{Yc(this,t);break}case ne.TEXT:{this._insertCharacters(t);break}case ne.IN_TABLE:case ne.IN_TABLE_BODY:case ne.IN_ROW:{C1(this,t);break}case ne.IN_COLUMN_GROUP:{pm(this,t);break}case ne.AFTER_BODY:{gm(this,t);break}case ne.AFTER_AFTER_BODY:{Fh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Gb(this,t);return}switch(this.insertionMode){case ne.INITIAL:case ne.BEFORE_HTML:case ne.BEFORE_HEAD:case ne.IN_HEAD:case ne.IN_HEAD_NO_SCRIPT:case ne.AFTER_HEAD:case ne.IN_BODY:case ne.IN_TABLE:case ne.IN_CAPTION:case ne.IN_COLUMN_GROUP:case ne.IN_TABLE_BODY:case ne.IN_ROW:case ne.IN_CELL:case ne.IN_SELECT:case ne.IN_SELECT_IN_TABLE:case ne.IN_TEMPLATE:case ne.IN_FRAMESET:case ne.AFTER_FRAMESET:{Gb(this,t);break}case ne.IN_TABLE_TEXT:{xc(this,t);break}case ne.AFTER_BODY:{zY(this,t);break}case ne.AFTER_AFTER_BODY:case ne.AFTER_AFTER_FRAMESET:{UY(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case ne.INITIAL:{HY(this,t);break}case ne.BEFORE_HEAD:case ne.IN_HEAD:case ne.IN_HEAD_NO_SCRIPT:case ne.AFTER_HEAD:{this._err(t,we.misplacedDoctype);break}case ne.IN_TABLE_TEXT:{xc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,we.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?uK(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case ne.INITIAL:{bc(this,t);break}case ne.BEFORE_HTML:{FY(this,t);break}case ne.BEFORE_HEAD:{VY(this,t);break}case ne.IN_HEAD:{As(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{GY(this,t);break}case ne.AFTER_HEAD:{XY(this,t);break}case ne.IN_BODY:{lr(this,t);break}case ne.IN_TABLE:{ru(this,t);break}case ne.IN_TABLE_TEXT:{xc(this,t);break}case ne.IN_CAPTION:{qG(this,t);break}case ne.IN_COLUMN_GROUP:{Wy(this,t);break}case ne.IN_TABLE_BODY:{mp(this,t);break}case ne.IN_ROW:{pp(this,t);break}case ne.IN_CELL:{KG(this,t);break}case ne.IN_SELECT:{_4(this,t);break}case ne.IN_SELECT_IN_TABLE:{WG(this,t);break}case ne.IN_TEMPLATE:{ZG(this,t);break}case ne.AFTER_BODY:{eK(this,t);break}case ne.IN_FRAMESET:{tK(this,t);break}case ne.AFTER_FRAMESET:{rK(this,t);break}case ne.AFTER_AFTER_BODY:{iK(this,t);break}case ne.AFTER_AFTER_FRAMESET:{aK(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?cK(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case ne.INITIAL:{bc(this,t);break}case ne.BEFORE_HTML:{$Y(this,t);break}case ne.BEFORE_HEAD:{qY(this,t);break}case ne.IN_HEAD:{YY(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{KY(this,t);break}case ne.AFTER_HEAD:{WY(this,t);break}case ne.IN_BODY:{hp(this,t);break}case ne.TEXT:{DG(this,t);break}case ne.IN_TABLE:{hd(this,t);break}case ne.IN_TABLE_TEXT:{xc(this,t);break}case ne.IN_CAPTION:{YG(this,t);break}case ne.IN_COLUMN_GROUP:{GG(this,t);break}case ne.IN_TABLE_BODY:{Kb(this,t);break}case ne.IN_ROW:{A4(this,t);break}case ne.IN_CELL:{XG(this,t);break}case ne.IN_SELECT:{R4(this,t);break}case ne.IN_SELECT_IN_TABLE:{QG(this,t);break}case ne.IN_TEMPLATE:{JG(this,t);break}case ne.AFTER_BODY:{O4(this,t);break}case ne.IN_FRAMESET:{nK(this,t);break}case ne.AFTER_FRAMESET:{sK(this,t);break}case ne.AFTER_AFTER_BODY:{Fh(this,t);break}}}onEof(t){switch(this.insertionMode){case ne.INITIAL:{bc(this,t);break}case ne.BEFORE_HTML:{Fc(this,t);break}case ne.BEFORE_HEAD:{$c(this,t);break}case ne.IN_HEAD:{Vc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{qc(this,t);break}case ne.AFTER_HEAD:{Yc(this,t);break}case ne.IN_BODY:case ne.IN_TABLE:case ne.IN_CAPTION:case ne.IN_COLUMN_GROUP:case ne.IN_TABLE_BODY:case ne.IN_ROW:case ne.IN_CELL:case ne.IN_SELECT:case ne.IN_SELECT_IN_TABLE:{C4(this,t);break}case ne.TEXT:{jG(this,t);break}case ne.IN_TABLE_TEXT:{xc(this,t);break}case ne.IN_TEMPLATE:{I4(this,t);break}case ne.AFTER_BODY:case ne.IN_FRAMESET:case ne.AFTER_FRAMESET:case ne.AFTER_AFTER_BODY:case ne.AFTER_AFTER_FRAMESET:{Xy(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===Y.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case ne.IN_HEAD:case ne.IN_HEAD_NO_SCRIPT:case ne.AFTER_HEAD:case ne.TEXT:case ne.IN_COLUMN_GROUP:case ne.IN_SELECT:case ne.IN_SELECT_IN_TABLE:case ne.IN_FRAMESET:case ne.AFTER_FRAMESET:{this._insertCharacters(t);break}case ne.IN_BODY:case ne.IN_CAPTION:case ne.IN_CELL:case ne.IN_TEMPLATE:case ne.AFTER_BODY:case ne.AFTER_AFTER_BODY:case ne.AFTER_AFTER_FRAMESET:{y4(this,t);break}case ne.IN_TABLE:case ne.IN_TABLE_BODY:case ne.IN_ROW:{C1(this,t);break}case ne.IN_TABLE_TEXT:{w4(this,t);break}}}}function MY(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):S4(e,t),n}function LY(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function DY(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let a=0,l=s;l!==n;a++,l=s){s=e.openElements.getCommonAncestor(l);const u=e.activeFormattingElements.getElementEntry(l),d=u&&a>=IY;!u||d?(d&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(l)):(l=jY(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function jY(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function PY(e,t,n){const r=e.treeAdapter.getTagName(t),s=mu(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===w.TEMPLATE&&a===Le.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function BY(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,s.tagID)}function Ky(e,t){for(let n=0;n<RY;n++){const r=MY(e,t);if(!r)break;const s=LY(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=DY(e,s,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),l&&PY(e,l,a),BY(e,s,r)}}function Gb(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function zY(e,t){e._appendCommentNode(t,e.openElements.items[0])}function UY(e,t){e._appendCommentNode(t,e.document)}function Xy(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(a);l&&!l.endTag&&e._setEndLocation(a,t)}}}}function HY(e,t){e._setDocumentType(t);const n=t.forceQuirks?is.QUIRKS:bY(t);gY(t)||e._err(t,we.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=ne.BEFORE_HTML}function bc(e,t){e._err(t,we.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,is.QUIRKS),e.insertionMode=ne.BEFORE_HTML,e._processToken(t)}function FY(e,t){t.tagID===w.HTML?(e._insertElement(t,Le.HTML),e.insertionMode=ne.BEFORE_HEAD):Fc(e,t)}function $Y(e,t){const n=t.tagID;(n===w.HTML||n===w.HEAD||n===w.BODY||n===w.BR)&&Fc(e,t)}function Fc(e,t){e._insertFakeRootElement(),e.insertionMode=ne.BEFORE_HEAD,e._processToken(t)}function VY(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.HEAD:{e._insertElement(t,Le.HTML),e.headElement=e.openElements.current,e.insertionMode=ne.IN_HEAD;break}default:$c(e,t)}}function qY(e,t){const n=t.tagID;n===w.HEAD||n===w.BODY||n===w.HTML||n===w.BR?$c(e,t):e._err(t,we.endTagWithoutMatchingOpenElement)}function $c(e,t){e._insertFakeElement(pe.HEAD,w.HEAD),e.headElement=e.openElements.current,e.insertionMode=ne.IN_HEAD,e._processToken(t)}function As(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.TITLE:{e._switchToTextParsing(t,Nn.RCDATA);break}case w.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Nn.RAWTEXT):(e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_HEAD_NO_SCRIPT);break}case w.NOFRAMES:case w.STYLE:{e._switchToTextParsing(t,Nn.RAWTEXT);break}case w.SCRIPT:{e._switchToTextParsing(t,Nn.SCRIPT_DATA);break}case w.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=ne.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(ne.IN_TEMPLATE);break}case w.HEAD:{e._err(t,we.misplacedStartTagForHeadElement);break}default:Vc(e,t)}}function YY(e,t){switch(t.tagID){case w.HEAD:{e.openElements.pop(),e.insertionMode=ne.AFTER_HEAD;break}case w.BODY:case w.BR:case w.HTML:{Vc(e,t);break}case w.TEMPLATE:{Uo(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function Uo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==w.TEMPLATE&&e._err(t,we.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(w.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,we.endTagWithoutMatchingOpenElement)}function Vc(e,t){e.openElements.pop(),e.insertionMode=ne.AFTER_HEAD,e._processToken(t)}function GY(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.BASEFONT:case w.BGSOUND:case w.HEAD:case w.LINK:case w.META:case w.NOFRAMES:case w.STYLE:{As(e,t);break}case w.NOSCRIPT:{e._err(t,we.nestedNoscriptInHead);break}default:qc(e,t)}}function KY(e,t){switch(t.tagID){case w.NOSCRIPT:{e.openElements.pop(),e.insertionMode=ne.IN_HEAD;break}case w.BR:{qc(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function qc(e,t){const n=t.type===Ct.EOF?we.openElementsLeftAfterEof:we.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=ne.IN_HEAD,e._processToken(t)}function XY(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.BODY:{e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=ne.IN_BODY;break}case w.FRAMESET:{e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_FRAMESET;break}case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:case w.NOFRAMES:case w.SCRIPT:case w.STYLE:case w.TEMPLATE:case w.TITLE:{e._err(t,we.abandonedHeadElementChild),e.openElements.push(e.headElement,w.HEAD),As(e,t),e.openElements.remove(e.headElement);break}case w.HEAD:{e._err(t,we.misplacedStartTagForHeadElement);break}default:Yc(e,t)}}function WY(e,t){switch(t.tagID){case w.BODY:case w.HTML:case w.BR:{Yc(e,t);break}case w.TEMPLATE:{Uo(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function Yc(e,t){e._insertFakeElement(pe.BODY,w.BODY),e.insertionMode=ne.IN_BODY,fp(e,t)}function fp(e,t){switch(t.type){case Ct.CHARACTER:{v4(e,t);break}case Ct.WHITESPACE_CHARACTER:{y4(e,t);break}case Ct.COMMENT:{Gb(e,t);break}case Ct.START_TAG:{lr(e,t);break}case Ct.END_TAG:{hp(e,t);break}case Ct.EOF:{C4(e,t);break}}}function y4(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function v4(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function QY(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ZY(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function JY(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_FRAMESET)}function eG(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML)}function tG(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Yb.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Le.HTML)}function nG(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function rG(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),n||(e.formElement=e.openElements.current))}function sG(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===w.LI&&s===w.LI||(n===w.DD||n===w.DT)&&(s===w.DD||s===w.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==w.ADDRESS&&s!==w.DIV&&s!==w.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML)}function iG(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.tokenizer.state=Nn.PLAINTEXT}function aG(e,t){e.openElements.hasInScope(w.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.framesetOk=!1}function oG(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(pe.A);n&&(Ky(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function lG(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uG(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(w.NOBR)&&(Ky(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function cG(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function dG(e,t){e.treeAdapter.getDocumentMode(e.document)!==is.QUIRKS&&e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=ne.IN_TABLE}function E4(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Le.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function T4(e){const t=c4(e,yo.TYPE);return t!=null&&t.toLowerCase()===_Y}function fG(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Le.HTML),T4(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function hG(e,t){e._appendElement(t,Le.HTML),t.ackSelfClosing=!0}function mG(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._appendElement(t,Le.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function pG(e,t){t.tagName=pe.IMG,t.tagID=w.IMG,E4(e,t)}function gG(e,t){e._insertElement(t,Le.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Nn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=ne.TEXT}function bG(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Nn.RAWTEXT)}function xG(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Nn.RAWTEXT)}function r3(e,t){e._switchToTextParsing(t,Nn.RAWTEXT)}function yG(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===ne.IN_TABLE||e.insertionMode===ne.IN_CAPTION||e.insertionMode===ne.IN_TABLE_BODY||e.insertionMode===ne.IN_ROW||e.insertionMode===ne.IN_CELL?ne.IN_SELECT_IN_TABLE:ne.IN_SELECT}function vG(e,t){e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML)}function EG(e,t){e.openElements.hasInScope(w.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Le.HTML)}function TG(e,t){e.openElements.hasInScope(w.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(w.RTC),e._insertElement(t,Le.HTML)}function SG(e,t){e._reconstructActiveFormattingElements(),g4(t),Gy(t),t.selfClosing?e._appendElement(t,Le.MATHML):e._insertElement(t,Le.MATHML),t.ackSelfClosing=!0}function CG(e,t){e._reconstructActiveFormattingElements(),b4(t),Gy(t),t.selfClosing?e._appendElement(t,Le.SVG):e._insertElement(t,Le.SVG),t.ackSelfClosing=!0}function s3(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML)}function lr(e,t){switch(t.tagID){case w.I:case w.S:case w.B:case w.U:case w.EM:case w.TT:case w.BIG:case w.CODE:case w.FONT:case w.SMALL:case w.STRIKE:case w.STRONG:{lG(e,t);break}case w.A:{oG(e,t);break}case w.H1:case w.H2:case w.H3:case w.H4:case w.H5:case w.H6:{tG(e,t);break}case w.P:case w.DL:case w.OL:case w.UL:case w.DIV:case w.DIR:case w.NAV:case w.MAIN:case w.MENU:case w.ASIDE:case w.CENTER:case w.FIGURE:case w.FOOTER:case w.HEADER:case w.HGROUP:case w.DIALOG:case w.DETAILS:case w.ADDRESS:case w.ARTICLE:case w.SEARCH:case w.SECTION:case w.SUMMARY:case w.FIELDSET:case w.BLOCKQUOTE:case w.FIGCAPTION:{eG(e,t);break}case w.LI:case w.DD:case w.DT:{sG(e,t);break}case w.BR:case w.IMG:case w.WBR:case w.AREA:case w.EMBED:case w.KEYGEN:{E4(e,t);break}case w.HR:{mG(e,t);break}case w.RB:case w.RTC:{EG(e,t);break}case w.RT:case w.RP:{TG(e,t);break}case w.PRE:case w.LISTING:{nG(e,t);break}case w.XMP:{bG(e,t);break}case w.SVG:{CG(e,t);break}case w.HTML:{QY(e,t);break}case w.BASE:case w.LINK:case w.META:case w.STYLE:case w.TITLE:case w.SCRIPT:case w.BGSOUND:case w.BASEFONT:case w.TEMPLATE:{As(e,t);break}case w.BODY:{ZY(e,t);break}case w.FORM:{rG(e,t);break}case w.NOBR:{uG(e,t);break}case w.MATH:{SG(e,t);break}case w.TABLE:{dG(e,t);break}case w.INPUT:{fG(e,t);break}case w.PARAM:case w.TRACK:case w.SOURCE:{hG(e,t);break}case w.IMAGE:{pG(e,t);break}case w.BUTTON:{aG(e,t);break}case w.APPLET:case w.OBJECT:case w.MARQUEE:{cG(e,t);break}case w.IFRAME:{xG(e,t);break}case w.SELECT:{yG(e,t);break}case w.OPTION:case w.OPTGROUP:{vG(e,t);break}case w.NOEMBED:case w.NOFRAMES:{r3(e,t);break}case w.FRAMESET:{JY(e,t);break}case w.TEXTAREA:{gG(e,t);break}case w.NOSCRIPT:{e.options.scriptingEnabled?r3(e,t):s3(e,t);break}case w.PLAINTEXT:{iG(e,t);break}case w.COL:case w.TH:case w.TD:case w.TR:case w.HEAD:case w.FRAME:case w.TBODY:case w.TFOOT:case w.THEAD:case w.CAPTION:case w.COLGROUP:break;default:s3(e,t)}}function wG(e,t){if(e.openElements.hasInScope(w.BODY)&&(e.insertionMode=ne.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function kG(e,t){e.openElements.hasInScope(w.BODY)&&(e.insertionMode=ne.AFTER_BODY,O4(e,t))}function NG(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function AG(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(w.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(w.FORM):n&&e.openElements.remove(n))}function _G(e){e.openElements.hasInButtonScope(w.P)||e._insertFakeElement(pe.P,w.P),e._closePElement()}function RG(e){e.openElements.hasInListItemScope(w.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(w.LI),e.openElements.popUntilTagNamePopped(w.LI))}function IG(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function OG(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function MG(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function LG(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(pe.BR,w.BR),e.openElements.pop(),e.framesetOk=!1}function S4(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s],l=e.openElements.tagIDs[s];if(r===l&&(r!==w.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,l))break}}function hp(e,t){switch(t.tagID){case w.A:case w.B:case w.I:case w.S:case w.U:case w.EM:case w.TT:case w.BIG:case w.CODE:case w.FONT:case w.NOBR:case w.SMALL:case w.STRIKE:case w.STRONG:{Ky(e,t);break}case w.P:{_G(e);break}case w.DL:case w.UL:case w.OL:case w.DIR:case w.DIV:case w.NAV:case w.PRE:case w.MAIN:case w.MENU:case w.ASIDE:case w.BUTTON:case w.CENTER:case w.FIGURE:case w.FOOTER:case w.HEADER:case w.HGROUP:case w.DIALOG:case w.ADDRESS:case w.ARTICLE:case w.DETAILS:case w.SEARCH:case w.SECTION:case w.SUMMARY:case w.LISTING:case w.FIELDSET:case w.BLOCKQUOTE:case w.FIGCAPTION:{NG(e,t);break}case w.LI:{RG(e);break}case w.DD:case w.DT:{IG(e,t);break}case w.H1:case w.H2:case w.H3:case w.H4:case w.H5:case w.H6:{OG(e);break}case w.BR:{LG(e);break}case w.BODY:{wG(e,t);break}case w.HTML:{kG(e,t);break}case w.FORM:{AG(e);break}case w.APPLET:case w.OBJECT:case w.MARQUEE:{MG(e,t);break}case w.TEMPLATE:{Uo(e,t);break}default:S4(e,t)}}function C4(e,t){e.tmplInsertionModeStack.length>0?I4(e,t):Xy(e,t)}function DG(e,t){var n;t.tagID===w.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function jG(e,t){e._err(t,we.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function C1(e,t){if(e.openElements.currentTagId!==void 0&&x4.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=ne.IN_TABLE_TEXT,t.type){case Ct.CHARACTER:{k4(e,t);break}case Ct.WHITESPACE_CHARACTER:{w4(e,t);break}}else Ad(e,t)}function PG(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_CAPTION}function BG(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_COLUMN_GROUP}function zG(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.COLGROUP,w.COLGROUP),e.insertionMode=ne.IN_COLUMN_GROUP,Wy(e,t)}function UG(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_TABLE_BODY}function HG(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.TBODY,w.TBODY),e.insertionMode=ne.IN_TABLE_BODY,mp(e,t)}function FG(e,t){e.openElements.hasInTableScope(w.TABLE)&&(e.openElements.popUntilTagNamePopped(w.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function $G(e,t){T4(t)?e._appendElement(t,Le.HTML):Ad(e,t),t.ackSelfClosing=!0}function VG(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Le.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ru(e,t){switch(t.tagID){case w.TD:case w.TH:case w.TR:{HG(e,t);break}case w.STYLE:case w.SCRIPT:case w.TEMPLATE:{As(e,t);break}case w.COL:{zG(e,t);break}case w.FORM:{VG(e,t);break}case w.TABLE:{FG(e,t);break}case w.TBODY:case w.TFOOT:case w.THEAD:{UG(e,t);break}case w.INPUT:{$G(e,t);break}case w.CAPTION:{PG(e,t);break}case w.COLGROUP:{BG(e,t);break}default:Ad(e,t)}}function hd(e,t){switch(t.tagID){case w.TABLE:{e.openElements.hasInTableScope(w.TABLE)&&(e.openElements.popUntilTagNamePopped(w.TABLE),e._resetInsertionMode());break}case w.TEMPLATE:{Uo(e,t);break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TBODY:case w.TD:case w.TFOOT:case w.TH:case w.THEAD:case w.TR:break;default:Ad(e,t)}}function Ad(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,fp(e,t),e.fosterParentingEnabled=n}function w4(e,t){e.pendingCharacterTokens.push(t)}function k4(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function xc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Ad(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const N4=new Set([w.CAPTION,w.COL,w.COLGROUP,w.TBODY,w.TD,w.TFOOT,w.TH,w.THEAD,w.TR]);function qG(e,t){const n=t.tagID;N4.has(n)?e.openElements.hasInTableScope(w.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_TABLE,ru(e,t)):lr(e,t)}function YG(e,t){const n=t.tagID;switch(n){case w.CAPTION:case w.TABLE:{e.openElements.hasInTableScope(w.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_TABLE,n===w.TABLE&&hd(e,t));break}case w.BODY:case w.COL:case w.COLGROUP:case w.HTML:case w.TBODY:case w.TD:case w.TFOOT:case w.TH:case w.THEAD:case w.TR:break;default:hp(e,t)}}function Wy(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.COL:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.TEMPLATE:{As(e,t);break}default:pm(e,t)}}function GG(e,t){switch(t.tagID){case w.COLGROUP:{e.openElements.currentTagId===w.COLGROUP&&(e.openElements.pop(),e.insertionMode=ne.IN_TABLE);break}case w.TEMPLATE:{Uo(e,t);break}case w.COL:break;default:pm(e,t)}}function pm(e,t){e.openElements.currentTagId===w.COLGROUP&&(e.openElements.pop(),e.insertionMode=ne.IN_TABLE,e._processToken(t))}function mp(e,t){switch(t.tagID){case w.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_ROW;break}case w.TH:case w.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(pe.TR,w.TR),e.insertionMode=ne.IN_ROW,pp(e,t);break}case w.CAPTION:case w.COL:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE,ru(e,t));break}default:ru(e,t)}}function Kb(e,t){const n=t.tagID;switch(t.tagID){case w.TBODY:case w.TFOOT:case w.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE);break}case w.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE,hd(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TD:case w.TH:case w.TR:break;default:hd(e,t)}}function pp(e,t){switch(t.tagID){case w.TH:case w.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_CELL,e.activeFormattingElements.insertMarker();break}case w.CAPTION:case w.COL:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:case w.TR:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,mp(e,t));break}default:ru(e,t)}}function A4(e,t){switch(t.tagID){case w.TR:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY);break}case w.TABLE:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,Kb(e,t));break}case w.TBODY:case w.TFOOT:case w.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(w.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,Kb(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TD:case w.TH:break;default:hd(e,t)}}function KG(e,t){const n=t.tagID;N4.has(n)?(e.openElements.hasInTableScope(w.TD)||e.openElements.hasInTableScope(w.TH))&&(e._closeTableCell(),pp(e,t)):lr(e,t)}function XG(e,t){const n=t.tagID;switch(n){case w.TD:case w.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_ROW);break}case w.TABLE:case w.TBODY:case w.TFOOT:case w.THEAD:case w.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),A4(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:break;default:hp(e,t)}}function _4(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.OPTION:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e._insertElement(t,Le.HTML);break}case w.OPTGROUP:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Le.HTML);break}case w.HR:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.INPUT:case w.KEYGEN:case w.TEXTAREA:case w.SELECT:{e.openElements.hasInSelectScope(w.SELECT)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),t.tagID!==w.SELECT&&e._processStartTag(t));break}case w.SCRIPT:case w.TEMPLATE:{As(e,t);break}}}function R4(e,t){switch(t.tagID){case w.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===w.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===w.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop();break}case w.OPTION:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop();break}case w.SELECT:{e.openElements.hasInSelectScope(w.SELECT)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode());break}case w.TEMPLATE:{Uo(e,t);break}}}function WG(e,t){const n=t.tagID;n===w.CAPTION||n===w.TABLE||n===w.TBODY||n===w.TFOOT||n===w.THEAD||n===w.TR||n===w.TD||n===w.TH?(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),e._processStartTag(t)):_4(e,t)}function QG(e,t){const n=t.tagID;n===w.CAPTION||n===w.TABLE||n===w.TBODY||n===w.TFOOT||n===w.THEAD||n===w.TR||n===w.TD||n===w.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),e.onEndTag(t)):R4(e,t)}function ZG(e,t){switch(t.tagID){case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:case w.NOFRAMES:case w.SCRIPT:case w.STYLE:case w.TEMPLATE:case w.TITLE:{As(e,t);break}case w.CAPTION:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:{e.tmplInsertionModeStack[0]=ne.IN_TABLE,e.insertionMode=ne.IN_TABLE,ru(e,t);break}case w.COL:{e.tmplInsertionModeStack[0]=ne.IN_COLUMN_GROUP,e.insertionMode=ne.IN_COLUMN_GROUP,Wy(e,t);break}case w.TR:{e.tmplInsertionModeStack[0]=ne.IN_TABLE_BODY,e.insertionMode=ne.IN_TABLE_BODY,mp(e,t);break}case w.TD:case w.TH:{e.tmplInsertionModeStack[0]=ne.IN_ROW,e.insertionMode=ne.IN_ROW,pp(e,t);break}default:e.tmplInsertionModeStack[0]=ne.IN_BODY,e.insertionMode=ne.IN_BODY,lr(e,t)}}function JG(e,t){t.tagID===w.TEMPLATE&&Uo(e,t)}function I4(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(w.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Xy(e,t)}function eK(e,t){t.tagID===w.HTML?lr(e,t):gm(e,t)}function O4(e,t){var n;if(t.tagID===w.HTML){if(e.fragmentContext||(e.insertionMode=ne.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===w.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else gm(e,t)}function gm(e,t){e.insertionMode=ne.IN_BODY,fp(e,t)}function tK(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.FRAMESET:{e._insertElement(t,Le.HTML);break}case w.FRAME:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.NOFRAMES:{As(e,t);break}}}function nK(e,t){t.tagID===w.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==w.FRAMESET&&(e.insertionMode=ne.AFTER_FRAMESET))}function rK(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.NOFRAMES:{As(e,t);break}}}function sK(e,t){t.tagID===w.HTML&&(e.insertionMode=ne.AFTER_AFTER_FRAMESET)}function iK(e,t){t.tagID===w.HTML?lr(e,t):Fh(e,t)}function Fh(e,t){e.insertionMode=ne.IN_BODY,fp(e,t)}function aK(e,t){switch(t.tagID){case w.HTML:{lr(e,t);break}case w.NOFRAMES:{As(e,t);break}}}function oK(e,t){t.chars=mn,e._insertCharacters(t)}function lK(e,t){e._insertCharacters(t),e.framesetOk=!1}function M4(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Le.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function uK(e,t){if(CY(t))M4(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Le.MATHML?g4(t):r===Le.SVG&&(wY(t),b4(t)),Gy(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function cK(e,t){if(t.tagID===w.P||t.tagID===w.BR){M4(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Le.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}pe.AREA,pe.BASE,pe.BASEFONT,pe.BGSOUND,pe.BR,pe.COL,pe.EMBED,pe.FRAME,pe.HR,pe.IMG,pe.INPUT,pe.KEYGEN,pe.LINK,pe.META,pe.PARAM,pe.SOURCE,pe.TRACK,pe.WBR;const gp=L4("end"),Ws=L4("start");function L4(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function D4(e){const t=Ws(e),n=gp(e);if(t&&n)return{start:t,end:n}}const dK=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,fK=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),i3={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function j4(e,t){const n=TK(e),r=i4("type",{handlers:{root:hK,element:mK,text:pK,comment:B4,doctype:gK,raw:xK},unknown:yK}),s={parser:n?new n3(i3):n3.getFragmentParser(void 0,i3),handle(u){r(u,s)},stitches:!1,options:t||{}};r(e,s),pu(s,Ws());const a=n?s.parser.document:s.parser.getFragment(),l=Sq(a,{file:s.options.file});return s.stitches&&qs(l,"comment",function(u,d,h){const p=u;if(p.value.stitch&&h&&d!==void 0){const m=h.children;return m[d]=p.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function P4(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function hK(e,t){P4(e.children,t)}function mK(e,t){vK(e,t),P4(e.children,t),EK(e,t)}function pK(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Ct.CHARACTER,chars:e.value,location:_d(e)};pu(t,Ws(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function gK(e,t){const n={type:Ct.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:_d(e)};pu(t,Ws(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function bK(e,t){t.stitches=!0;const n=SK(e);if("children"in e&&"children"in n){const r=j4({type:"root",children:e.children},t.options);n.children=r.children}B4({type:"comment",value:{stitch:n}},t)}function B4(e,t){const n=e.value,r={type:Ct.COMMENT,data:n,location:_d(e)};pu(t,Ws(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function xK(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,z4(t,Ws(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(dK,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function yK(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))bK(n,t);else{let r="";throw fK.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function pu(e,t){z4(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Nn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function z4(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function vK(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Nn.PLAINTEXT)return;pu(t,Ws(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:mo.html;s===mo.html&&n==="svg"&&(s=mo.svg);const a=Aq({...e,children:[]},{space:s===mo.svg?"svg":"html"}),l={type:Ct.START_TAG,tagName:n,tagID:mu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:_d(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function EK(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&jq.includes(n)||t.parser.tokenizer.state===Nn.PLAINTEXT)return;pu(t,gp(e));const r={type:Ct.END_TAG,tagName:n,tagID:mu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:_d(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Nn.RCDATA||t.parser.tokenizer.state===Nn.RAWTEXT||t.parser.tokenizer.state===Nn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Nn.DATA)}function TK(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function _d(e){const t=Ws(e)||{line:void 0,column:void 0,offset:void 0},n=gp(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function SK(e){return"children"in e?Ao({...e,children:[]}):Ao(e)}function Xb(e){return function(t,n){return j4(t,{...e,file:n})}}const no=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ao={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...no,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...no],h2:[["className","sr-only"]],img:[...no,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...no,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...no],table:[...no],ul:[...no,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},pa={}.hasOwnProperty;function CK(e,t){let n={type:"root",children:[]};const r={schema:t?{...ao,...t}:ao,stack:[]},s=U4(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function U4(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return wK(e,n);case"doctype":return kK(e,n);case"element":return NK(e,n);case"root":return AK(e,n);case"text":return _K(e,n)}}}function wK(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Rd(a,t),a}}function kK(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Rd(n,t),n}}function NK(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=H4(e,t.children),s=RK(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&pa.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let d=-1;for(a=!1;++d<u.length;)e.stack.includes(u[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const l={type:"element",tagName:n,properties:s,children:r};return Rd(l,t),l}function AK(e,t){const r={type:"root",children:H4(e,t.children)};return Rd(r,t),r}function _K(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Rd(r,t),r}function H4(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=U4(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function RK(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&pa.call(r,n)?r[n]:void 0,l=r&&pa.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},d={};let h;for(h in u)if(pa.call(u,h)){const p=u[h];let m=a3(e,o3(a,h),h,p);m==null&&(m=a3(e,o3(l,h),h,p)),m!=null&&(d[h]=m)}if(s&&pa.call(s,n)){const p=s[n];for(h in p)pa.call(p,h)&&!pa.call(d,h)&&(d[h]=p[h])}return d}function a3(e,t,n,r){return t?Array.isArray(r)?IK(e,t,n,r):F4(e,t,n,r):void 0}function IK(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const l=F4(e,t,n,r[s]);(typeof l=="number"||typeof l=="string")&&a.push(l)}return a}function F4(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&OK(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,a=0;for(;++a<t.length;){const l=t[a];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){s=!0;break}}else if(l===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function OK(e,t,n){const r=e.schema.protocols&&pa.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),a=s.indexOf(":"),l=s.indexOf("?"),u=s.indexOf("#"),d=s.indexOf("/");if(a<0||d>-1&&a>d||l>-1&&a>l||u>-1&&a>u)return!0;let h=-1;for(;++h<r.length;){const p=r[h];if(a===p.length&&s.slice(0,p.length)===p)return!0}return!1}function Rd(e,t){const n=D4(t);t.data&&(e.data=Ao(t.data)),n&&(e.position=n)}function o3(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],a=typeof s=="string"?s:s[0];if(a===t)return s;a==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function $4(e){return function(t){return CK(t,e)}}function l3(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}const fr=La(/[A-Za-z]/),ir=La(/[\dA-Za-z]/),MK=La(/[#-'*+\--9=?A-Z^-~]/);function bm(e){return e!==null&&(e<32||e===127)}const Wb=La(/\d/),LK=La(/[\dA-Fa-f]/),DK=La(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function sn(e){return e!==null&&(e<0||e===32)}function _t(e){return e===-2||e===-1||e===32}const bp=La(/\p{P}|\p{S}/u),_o=La(/\s/);function La(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function jK(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function PK(e,t,n){const s=lp((n||{}).ignore||[]),a=BK(t);let l=-1;for(;++l<a.length;)zy(e,"text",u);function u(h,p){let m=-1,b;for(;++m<p.length;){const x=p[m],E=b?b.children:void 0;if(s(x,E?E.indexOf(x):void 0,b))return;b=x}if(b)return d(h,p)}function d(h,p){const m=p[p.length-1],b=a[l][0],x=a[l][1];let E=0;const C=m.children.indexOf(h);let S=!1,k=[];b.lastIndex=0;let A=b.exec(h.value);for(;A;){const R=A.index,M={index:A.index,input:A.input,stack:[...p,h]};let _=x(...A,M);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?b.lastIndex=R+1:(E!==R&&k.push({type:"text",value:h.value.slice(E,R)}),Array.isArray(_)?k.push(..._):_&&k.push(_),E=R+A[0].length,S=!0),!b.global)break;A=b.exec(h.value)}return S?(E<h.value.length&&k.push({type:"text",value:h.value.slice(E)}),m.children.splice(C,1,...k)):k=[h],C+k.length}}function BK(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([zK(s[0]),UK(s[1])])}return t}function zK(e){return typeof e=="string"?new RegExp(jK(e),"g"):e}function UK(e){return typeof e=="function"?e:function(){return e}}const w1="phrasing",k1=["autolink","link","image","label"];function HK(){return{transforms:[KK],enter:{literalAutolink:$K,literalAutolinkEmail:N1,literalAutolinkHttp:N1,literalAutolinkWww:N1},exit:{literalAutolink:GK,literalAutolinkEmail:YK,literalAutolinkHttp:VK,literalAutolinkWww:qK}}}function FK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:w1,notInConstruct:k1},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:w1,notInConstruct:k1},{character:":",before:"[ps]",after:"\\/",inConstruct:w1,notInConstruct:k1}]}}function $K(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function N1(e){this.config.enter.autolinkProtocol.call(this,e)}function VK(e){this.config.exit.autolinkProtocol.call(this,e)}function qK(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function YK(e){this.config.exit.autolinkEmail.call(this,e)}function GK(e){this.exit(e)}function KK(e){PK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,XK],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,WK]],{ignore:["link","linkReference"]})}function XK(e,t,n,r,s){let a="";if(!V4(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!QK(n)))return!1;const l=ZK(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function WK(e,t,n,r){return!V4(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function QK(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ZK(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=l3(e,"(");let a=l3(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function V4(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||_o(n)||bp(n))&&(!t||n!==47)}function Es(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}q4.peek=oX;function JK(){this.buffer()}function eX(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function tX(){this.buffer()}function nX(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rX(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Es(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sX(e){this.exit(e)}function iX(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Es(this.sliceSerialize(e)).toLowerCase(),n.label=t}function aX(e){this.exit(e)}function oX(){return"["}function q4(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),l(),a+=s.move("]"),a}function lX(){return{enter:{gfmFootnoteCallString:JK,gfmFootnoteCall:eX,gfmFootnoteDefinitionLabelString:tX,gfmFootnoteDefinition:nX},exit:{gfmFootnoteCallString:rX,gfmFootnoteCall:sX,gfmFootnoteDefinitionLabelString:iX,gfmFootnoteDefinition:aX}}}function uX(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:q4},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const u=a.createTracker(l);let d=u.move("[^");const h=a.enter("footnoteDefinition"),p=a.enter("label");return d+=u.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),d+=u.move((t?`
545
- `:" ")+a.indentLines(a.containerFlow(r,u.current()),t?Y4:cX))),h(),d}}function cX(e,t,n){return t===0?e:Y4(e,t,n)}function Y4(e,t,n){return(n?"":" ")+e}const dX=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];G4.peek=gX;function fX(){return{canContainEols:["delete"],enter:{strikethrough:mX},exit:{strikethrough:pX}}}function hX(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dX}],handlers:{delete:G4}}}function mX(e){this.enter({type:"delete",children:[]},e)}function pX(e){this.exit(e)}function G4(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function gX(){return"~"}function bX(e){return e.length}function xX(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||bX,a=[],l=[],u=[],d=[];let h=0,p=-1;for(;++p<e.length;){const N=[],C=[];let S=-1;for(e[p].length>h&&(h=e[p].length);++S<e[p].length;){const k=yX(e[p][S]);if(n.alignDelimiters!==!1){const A=s(k);C[S]=A,(d[S]===void 0||A>d[S])&&(d[S]=A)}N.push(k)}l[p]=N,u[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<h;)a[m]=u3(r[m]);else{const N=u3(r);for(;++m<h;)a[m]=N}m=-1;const b=[],x=[];for(;++m<h;){const N=a[m];let C="",S="";N===99?(C=":",S=":"):N===108?C=":":N===114&&(S=":");let k=n.alignDelimiters===!1?1:Math.max(1,d[m]-C.length-S.length);const A=C+"-".repeat(k)+S;n.alignDelimiters!==!1&&(k=C.length+k+S.length,k>d[m]&&(d[m]=k),x[m]=k),b[m]=A}l.splice(1,0,b),u.splice(1,0,x),p=-1;const E=[];for(;++p<l.length;){const N=l[p],C=u[p];m=-1;const S=[];for(;++m<h;){const k=N[m]||"";let A="",R="";if(n.alignDelimiters!==!1){const M=d[m]-(C[m]||0),_=a[m];_===114?A=" ".repeat(M):_===99?M%2?(A=" ".repeat(M/2+.5),R=" ".repeat(M/2-.5)):(A=" ".repeat(M/2),R=A):R=" ".repeat(M)}n.delimiterStart!==!1&&!m&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||m)&&S.push(" "),n.alignDelimiters!==!1&&S.push(A),S.push(k),n.alignDelimiters!==!1&&S.push(R),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&S.push("|")}E.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return E.join(`
546
- `)}function yX(e){return e==null?"":String(e)}function u3(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function vX(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),EX);return s(),l}function EX(e,t,n){return">"+(n?"":" ")+e}function TX(e,t){return c3(e,t.inConstruct,!0)&&!c3(e,t.notInConstruct,!1)}function c3(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function d3(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
547
- `&&TX(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
548
- `}function SX(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function CX(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function wX(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function kX(e,t,n,r){const s=wX(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(CX(e,n)){const m=n.enter("codeIndented"),b=n.indentLines(a,NX);return m(),b}const u=n.createTracker(r),d=s.repeat(Math.max(SX(a,s)+1,3)),h=n.enter("codeFenced");let p=u.move(d);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:`
549
- `,encode:["`"],...u.current()})),m()}return p+=u.move(`
550
- `),a&&(p+=u.move(a+`
551
- `)),p+=u.move(d),h(),p}function NX(e,t,n){return(n?"":" ")+e}function Qy(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function AX(e,t,n,r){const s=Qy(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
552
- `,...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),l(),h}function _X(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function md(e){return"&#x"+e.toString(16).toUpperCase()+";"}function su(e){if(e===null||sn(e)||_o(e))return 1;if(bp(e))return 2}function xm(e,t,n){const r=su(e),s=su(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}K4.peek=RX;function K4(e,t,n,r){const s=_X(n),a=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),p=xm(r.before.charCodeAt(r.before.length-1),h,s);p.inside&&(d=md(h)+d.slice(1));const m=d.charCodeAt(d.length-1),b=xm(r.after.charCodeAt(0),m,s);b.inside&&(d=d.slice(0,-1)+md(m));const x=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},u+d+x}function RX(e,t,n){return n.options.emphasis||"*"}const IX={};function Zy(e,t){const n=IX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return X4(e,r,s)}function X4(e,t,n){if(OX(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return f3(e.children,t,n)}return Array.isArray(e)?f3(e,t,n):""}function f3(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=X4(e[s],t,n);return r.join("")}function OX(e){return!!(e&&typeof e=="object")}function MX(e,t){let n=!1;return qs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Hb}),!!((!e.depth||e.depth<3)&&Zy(e)&&(t.options.setext||n))}function LX(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(MX(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),b=n.containerPhrasing(e,{...a.current(),before:`
553
- `,after:`
554
- `});return m(),p(),b+`
555
- `+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
556
- `))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
557
- `,...a.current()});return/^[\t ]/.test(h)&&(h=md(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),u(),h}W4.peek=DX;function W4(e){return e.value||""}function DX(){return"<"}Q4.peek=jX;function Q4(e,t,n,r){const s=Qy(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),h+=d.move(")"),l(),h}function jX(){return"!"}Z4.peek=PX;function Z4(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");const h=n.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=p,a(),s==="full"||!h||h!==m?d+=u.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function PX(){return"!"}J4.peek=BX;function J4(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],u=n.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return s+r+s}function BX(){return"`"}function e6(e,t){const n=Zy(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}t6.peek=zX;function t6(e,t,n,r){const s=Qy(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,d;if(e6(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),u(),n.stack=p,m}u=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),h+=l.move(" "+s),h+=l.move(n.safe(e.title,{before:h,after:s,...l.current()})),h+=l.move(s),d()),h+=l.move(")"),u(),h}function zX(e,t,n){return e6(e,n)?"<":"["}n6.peek=UX;function n6(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=p,a(),s==="full"||!h||h!==m?d+=u.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function UX(){return"["}function Jy(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function HX(e){const t=Jy(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function FX(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function r6(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function $X(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?FX(n):Jy(n);const u=e.ordered?l==="."?")":".":HX(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),r6(n)===l&&p){let m=-1;for(;++m<e.children.length;){const b=e.children[m];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=u),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),h}function VX(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function qX(e,t,n,r){const s=VX(n);let a=n.bulletCurrent||Jy(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(l-a.length)),u.shift(l);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,u.current()),p);return d(),h;function p(m,b,x){return b?(x?"":" ".repeat(l))+m:(x?a:a+" ".repeat(l-a.length))+m}}function YX(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const GX=lp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KX(e,t,n,r){return(e.children.some(function(l){return GX(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function XX(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}s6.peek=WX;function s6(e,t,n,r){const s=XX(n),a=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),p=xm(r.before.charCodeAt(r.before.length-1),h,s);p.inside&&(d=md(h)+d.slice(1));const m=d.charCodeAt(d.length-1),b=xm(r.after.charCodeAt(0),m,s);b.inside&&(d=d.slice(0,-1)+md(m));const x=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},u+d+x}function WX(e,t,n){return n.options.strong||"*"}function QX(e,t,n,r){return n.safe(e.value,r)}function ZX(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function JX(e,t,n){const r=(r6(n)+(n.options.ruleSpaces?" ":"")).repeat(ZX(n));return n.options.ruleSpaces?r.slice(0,-1):r}const i6={blockquote:vX,break:d3,code:kX,definition:AX,emphasis:K4,hardBreak:d3,heading:LX,html:W4,image:Q4,imageReference:Z4,inlineCode:J4,link:t6,linkReference:n6,list:$X,listItem:qX,paragraph:YX,root:KX,strong:s6,text:QX,thematicBreak:JX},h3=document.createElement("i");function ev(e){const t="&"+e+";";h3.innerHTML=t;const n=h3.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function a6(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const eW=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tW(e){return e.replace(eW,nW)}function nW(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return a6(n.slice(a?2:1),a?16:10)}return ev(n)||e}function rW(){return{enter:{table:sW,tableData:m3,tableHeader:m3,tableRow:aW},exit:{codeText:oW,table:iW,tableData:A1,tableHeader:A1,tableRow:A1}}}function sW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function iW(e){this.exit(e),this.data.inTable=void 0}function aW(e){this.enter({type:"tableRow",children:[]},e)}function A1(e){this.exit(e)}function m3(e){this.enter({type:"tableCell",children:[]},e)}function oW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lW(e,t){return t==="|"?t:e}function uW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
558
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:d,tableRow:u}};function l(x,E,N,C){return h(p(x,N,C),x.align)}function u(x,E,N,C){const S=m(x,N,C),k=h([S]);return k.slice(0,k.indexOf(`
559
- `))}function d(x,E,N,C){const S=N.enter("tableCell"),k=N.enter("phrasing"),A=N.containerPhrasing(x,{...C,before:a,after:a});return k(),S(),A}function h(x,E){return xX(x,{align:E,alignDelimiters:r,padding:n,stringLength:s})}function p(x,E,N){const C=x.children;let S=-1;const k=[],A=E.enter("table");for(;++S<C.length;)k[S]=m(C[S],E,N);return A(),k}function m(x,E,N){const C=x.children;let S=-1;const k=[],A=E.enter("tableRow");for(;++S<C.length;)k[S]=d(C[S],x,E,N);return A(),k}function b(x,E,N){let C=i6.inlineCode(x,E,N);return N.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function cW(){return{exit:{taskListCheckValueChecked:p3,taskListCheckValueUnchecked:p3,paragraph:fW}}}function dW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hW}}}function p3(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fW(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,l;for(;++a<s.length;){const u=s[a];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function hW(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(l);let d=i6.listItem(e,t,n,{...r,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(p){return p+l}}function mW(){return[HK(),lX(),fX(),rW(),cW()]}function pW(e){return{extensions:[FK(),uX(e),hX(),uW(e),dW()]}}function Vr(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function as(e,t){return e.length>0?(Vr(e,e.length,0,t),e):t}const g3={}.hasOwnProperty;function o6(e){const t={};let n=-1;for(;++n<e.length;)gW(t,e[n]);return t}function gW(e,t){let n;for(n in t){const s=(g3.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){g3.call(s,l)||(s[l]=[]);const u=a[l];bW(s[l],Array.isArray(u)?u:u?[u]:[])}}}function bW(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Vr(e,0,0,r)}const xW={tokenize:CW,partial:!0},l6={tokenize:wW,partial:!0},u6={tokenize:kW,partial:!0},c6={tokenize:NW,partial:!0},yW={tokenize:AW,partial:!0},d6={name:"wwwAutolink",tokenize:TW,previous:h6},f6={name:"protocolAutolink",tokenize:SW,previous:m6},Di={name:"emailAutolink",tokenize:EW,previous:p6},Qs={};function vW(){return{text:Qs}}let ro=48;for(;ro<123;)Qs[ro]=Di,ro++,ro===58?ro=65:ro===91&&(ro=97);Qs[43]=Di;Qs[45]=Di;Qs[46]=Di;Qs[95]=Di;Qs[72]=[Di,f6];Qs[104]=[Di,f6];Qs[87]=[Di,d6];Qs[119]=[Di,d6];function EW(e,t,n){const r=this;let s,a;return l;function l(m){return!Qb(m)||!p6.call(r,r.previous)||tv(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return Qb(m)?(e.consume(m),u):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(yW,p,h)(m):m===45||m===95||ir(m)?(a=!0,e.consume(m),d):p(m)}function h(m){return e.consume(m),s=!0,d}function p(m){return a&&s&&fr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function TW(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!h6.call(r,r.previous)||tv(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(xW,e.attempt(l6,e.attempt(u6,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function SW(e,t,n){const r=this;let s="",a=!1;return l;function l(m){return(m===72||m===104)&&m6.call(r,r.previous)&&!tv(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),u):n(m)}function u(m){if(fr(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),u;if(m===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?h:(a=!0,d)):n(m)}function h(m){return m===null||bm(m)||sn(m)||_o(m)||bp(m)?n(m):e.attempt(l6,e.attempt(u6,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function CW(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function wW(e,t,n){let r,s,a;return l;function l(h){return h===46||h===95?e.check(c6,d,u)(h):h===null||sn(h)||_o(h)||h!==45&&bp(h)?d(h):(a=!0,e.consume(h),l)}function u(h){return h===95?r=!0:(s=r,r=void 0),e.consume(h),l}function d(h){return s||r||!a?n(h):t(h)}}function kW(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(c6,t,a)(l):l===null||sn(l)||_o(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function NW(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),a):u===93?(e.consume(u),s):u===60||u===null||sn(u)||_o(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||sn(u)||_o(u)?t(u):r(u)}function a(u){return fr(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):fr(u)?(e.consume(u),l):n(u)}}function AW(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return ir(a)?n(a):t(a)}}function h6(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||sn(e)}function m6(e){return!fr(e)}function p6(e){return!(e===47||Qb(e))}function Qb(e){return e===43||e===45||e===46||e===95||ir(e)}function tv(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function gu(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&ir(e.charCodeAt(n+1))&&ir(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function xp(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Zb={name:"attention",resolveAll:_W,tokenize:RW};function _W(e,t){let n=-1,r,s,a,l,u,d,h,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},b={...e[n][1].start};b3(m,-d),b3(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=as(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=as(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=as(h,xp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=as(h,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=as(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Vr(e,r-1,n-r+3,h),n=r+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function RW(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=su(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const h=e.exit("attentionSequence"),p=su(d),m=!p||p===2&&s||n.includes(d),b=!s||s===2&&p||n.includes(r);return h._open=!!(a===42?m:m&&(s||!b)),h._close=!!(a===42?b:b&&(p||!m)),t(d)}}function b3(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const IW={name:"autolink",tokenize:OW};function OW(e,t,n){let r=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(x){return fr(x)?(e.consume(x),l):x===64?n(x):h(x)}function l(x){return x===43||x===45||x===46||ir(x)?(r=1,u(x)):h(x)}function u(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||ir(x))&&r++<32?(e.consume(x),u):(r=0,h(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||bm(x)?n(x):(e.consume(x),d)}function h(x){return x===64?(e.consume(x),p):MK(x)?(e.consume(x),h):n(x)}function p(x){return ir(x)?m(x):n(x)}function m(x){return x===46?(e.consume(x),r=0,p):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):b(x)}function b(x){if((x===45||ir(x))&&r++<63){const E=x===45?b:m;return e.consume(x),E}return n(x)}}function Pt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return _t(d)?(e.enter(n),u(d)):t(d)}function u(d){return _t(d)&&a++<s?(e.consume(d),u):(e.exit(n),t(d))}}const Id={partial:!0,tokenize:MW};function MW(e,t,n){return r;function r(a){return _t(a)?Pt(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||it(a)?t(a):n(a)}}const g6={continuation:{tokenize:DW},exit:jW,name:"blockQuote",tokenize:LW};function LW(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return _t(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function DW(e,t,n){const r=this;return s;function s(l){return _t(l)?Pt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(g6,t,n)(l)}}function jW(e){e.exit("blockQuote")}const b6={name:"characterEscape",tokenize:PW};function PW(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return DK(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const x6={name:"characterReference",tokenize:BW};function BW(e,t,n){const r=this;let s=0,a,l;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=ir,p(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=LK,p):(e.enter("characterReferenceValue"),a=7,l=Wb,p(m))}function p(m){if(m===59&&s){const b=e.exit("characterReferenceValue");return l===ir&&!ev(r.sliceSerialize(b))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&s++<a?(e.consume(m),p):n(m)}}const x3={partial:!0,tokenize:UW},y3={concrete:!0,name:"codeFenced",tokenize:zW};function zW(e,t,n){const r=this,s={partial:!0,tokenize:M};let a=0,l=0,u;return d;function d(_){return h(_)}function h(_){const O=r.events[r.events.length-1];return a=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,u=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(_)}function p(_){return _===u?(l++,e.consume(_),p):l<3?n(_):(e.exit("codeFencedFenceSequence"),_t(_)?Pt(e,m,"whitespace")(_):m(_))}function m(_){return _===null||it(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(x3,N,R)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===null||it(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(_)):_t(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pt(e,x,"whitespace")(_)):_===96&&_===u?n(_):(e.consume(_),b)}function x(_){return _===null||it(_)?m(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(_))}function E(_){return _===null||it(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(_)):_===96&&_===u?n(_):(e.consume(_),E)}function N(_){return e.attempt(s,R,C)(_)}function C(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),S}function S(_){return a>0&&_t(_)?Pt(e,k,"linePrefix",a+1)(_):k(_)}function k(_){return _===null||it(_)?e.check(x3,N,R)(_):(e.enter("codeFlowValue"),A(_))}function A(_){return _===null||it(_)?(e.exit("codeFlowValue"),k(_)):(e.consume(_),A)}function R(_){return e.exit("codeFenced"),t(_)}function M(_,O,j){let H=0;return B;function B(q){return _.enter("lineEnding"),_.consume(q),_.exit("lineEnding"),K}function K(q){return _.enter("codeFencedFence"),_t(q)?Pt(_,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):X(q)}function X(q){return q===u?(_.enter("codeFencedFenceSequence"),Z(q)):j(q)}function Z(q){return q===u?(H++,_.consume(q),Z):H>=l?(_.exit("codeFencedFenceSequence"),_t(q)?Pt(_,te,"whitespace")(q):te(q)):j(q)}function te(q){return q===null||it(q)?(_.exit("codeFencedFence"),O(q)):j(q)}}}function UW(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const _1={name:"codeIndented",tokenize:FW},HW={partial:!0,tokenize:$W};function FW(e,t,n){const r=this;return s;function s(h){return e.enter("codeIndented"),Pt(e,a,"linePrefix",5)(h)}function a(h){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):it(h)?e.attempt(HW,l,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||it(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function $W(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Pt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):it(l)?s(l):n(l)}}const VW={name:"codeText",previous:YW,resolve:qW,tokenize:GW};function qW(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function YW(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function GW(e,t,n){let r=0,s,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),s=0,p(m)):it(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||it(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),h)}function p(m){return m===96?(e.consume(m),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",h(m))}}class KW{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&yc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),yc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);yc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);yc(this.left,n.reverse())}}}function yc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function y6(e){const t={};let n=-1,r,s,a,l,u,d,h;const p=new KW(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,XW(p,n)),n=t[n],h=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},u=p.slice(s,n),u.unshift(r),p.splice(s,n-s+1,u))}}return Vr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function XW(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],h={};let p,m,b=-1,x=n,E=0,N=0;const C=[N];for(;x;){for(;e.get(++s)[1]!==x;);a.push(s),x._tokenizer||(p=r.sliceStream(x),x.next||p.push(null),m&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=n;++b<u.length;)u[b][0]==="exit"&&u[b-1][0]==="enter"&&u[b][1].type===u[b-1][1].type&&u[b][1].start.line!==u[b][1].end.line&&(N=b+1,C.push(N),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):C.pop(),b=C.length;b--;){const S=u.slice(C[b],C[b+1]),k=a.pop();d.push([k,k+S.length-1]),e.splice(k,2,S)}for(d.reverse(),b=-1;++b<d.length;)h[E+d[b][0]]=E+d[b][1],E+=d[b][1]-d[b][0]-1;return h}const WW={resolve:ZW,tokenize:JW},QW={partial:!0,tokenize:eQ};function ZW(e){return y6(e),e}function JW(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?a(u):it(u)?e.check(QW,l,a)(u):(e.consume(u),s)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function eQ(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Pt(e,a,"linePrefix")}function a(l){if(l===null||it(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function v6(e,t,n,r,s,a,l,u,d){const h=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(S){return S===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(S),e.exit(a),b):S===null||S===32||S===41||bm(S)?n(S):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),N(S))}function b(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(e.exit("chunkString"),e.exit(u),b(S)):S===null||S===60||it(S)?n(S):(e.consume(S),S===92?E:x)}function E(S){return S===60||S===62||S===92?(e.consume(S),x):x(S)}function N(S){return!p&&(S===null||S===41||sn(S))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(S)):p<h&&S===40?(e.consume(S),p++,N):S===41?(e.consume(S),p--,N):S===null||S===32||S===40||bm(S)?n(S):(e.consume(S),S===92?C:N)}function C(S){return S===40||S===41||S===92?(e.consume(S),N):N(S)}}function E6(e,t,n,r,s,a){const l=this;let u=0,d;return h;function h(x){return e.enter(r),e.enter(s),e.consume(x),e.exit(s),e.enter(a),p}function p(x){return u>999||x===null||x===91||x===93&&!d||x===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(e.exit(a),e.enter(s),e.consume(x),e.exit(s),e.exit(r),t):it(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||it(x)||u++>999?(e.exit("chunkString"),p(x)):(e.consume(x),d||(d=!_t(x)),x===92?b:m)}function b(x){return x===91||x===92||x===93?(e.consume(x),u++,m):m(x)}}function T6(e,t,n,r,s,a){let l;return u;function u(b){return b===34||b===39||b===40?(e.enter(r),e.enter(s),e.consume(b),e.exit(s),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):(e.enter(a),h(b))}function h(b){return b===l?(e.exit(a),d(l)):b===null?n(b):it(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Pt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===l||b===null||it(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?m:p)}function m(b){return b===l||b===92?(e.consume(b),p):p(b)}}function Gc(e,t){let n;return r;function r(s){return it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):_t(s)?Pt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const tQ={name:"definition",tokenize:rQ},nQ={partial:!0,tokenize:sQ};function rQ(e,t,n){const r=this;let s;return a;function a(x){return e.enter("definition"),l(x)}function l(x){return E6.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return s=Es(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return sn(x)?Gc(e,h)(x):h(x)}function h(x){return v6(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function p(x){return e.attempt(nQ,m,m)(x)}function m(x){return _t(x)?Pt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||it(x)?(e.exit("definition"),r.parser.defined.push(s),t(x)):n(x)}}function sQ(e,t,n){return r;function r(u){return sn(u)?Gc(e,s)(u):n(u)}function s(u){return T6(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return _t(u)?Pt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||it(u)?t(u):n(u)}}const iQ={name:"hardBreakEscape",tokenize:aQ};function aQ(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return it(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const oQ={name:"headingAtx",resolve:lQ,tokenize:uQ};function lQ(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Vr(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function uQ(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||sn(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||it(p)?(e.exit("atxHeading"),t(p)):_t(p)?Pt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),u(p))}function h(p){return p===null||p===35||sn(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),h)}}const cQ=["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"],v3=["pre","script","style","textarea"],dQ={concrete:!0,name:"htmlFlow",resolveTo:mQ,tokenize:pQ},fQ={partial:!0,tokenize:bQ},hQ={partial:!0,tokenize:gQ};function mQ(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function pQ(e,t,n){const r=this;let s,a,l,u,d;return h;function h(L){return p(L)}function p(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),m}function m(L){return L===33?(e.consume(L),b):L===47?(e.consume(L),a=!0,N):L===63?(e.consume(L),s=3,r.interrupt?t:D):fr(L)?(e.consume(L),l=String.fromCharCode(L),C):n(L)}function b(L){return L===45?(e.consume(L),s=2,x):L===91?(e.consume(L),s=5,u=0,E):fr(L)?(e.consume(L),s=4,r.interrupt?t:D):n(L)}function x(L){return L===45?(e.consume(L),r.interrupt?t:D):n(L)}function E(L){const ae="CDATA[";return L===ae.charCodeAt(u++)?(e.consume(L),u===ae.length?r.interrupt?t:X:E):n(L)}function N(L){return fr(L)?(e.consume(L),l=String.fromCharCode(L),C):n(L)}function C(L){if(L===null||L===47||L===62||sn(L)){const ae=L===47,re=l.toLowerCase();return!ae&&!a&&v3.includes(re)?(s=1,r.interrupt?t(L):X(L)):cQ.includes(l.toLowerCase())?(s=6,ae?(e.consume(L),S):r.interrupt?t(L):X(L)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):a?k(L):A(L))}return L===45||ir(L)?(e.consume(L),l+=String.fromCharCode(L),C):n(L)}function S(L){return L===62?(e.consume(L),r.interrupt?t:X):n(L)}function k(L){return _t(L)?(e.consume(L),k):B(L)}function A(L){return L===47?(e.consume(L),B):L===58||L===95||fr(L)?(e.consume(L),R):_t(L)?(e.consume(L),A):B(L)}function R(L){return L===45||L===46||L===58||L===95||ir(L)?(e.consume(L),R):M(L)}function M(L){return L===61?(e.consume(L),_):_t(L)?(e.consume(L),M):A(L)}function _(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),d=L,O):_t(L)?(e.consume(L),_):j(L)}function O(L){return L===d?(e.consume(L),d=null,H):L===null||it(L)?n(L):(e.consume(L),O)}function j(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||sn(L)?M(L):(e.consume(L),j)}function H(L){return L===47||L===62||_t(L)?A(L):n(L)}function B(L){return L===62?(e.consume(L),K):n(L)}function K(L){return L===null||it(L)?X(L):_t(L)?(e.consume(L),K):n(L)}function X(L){return L===45&&s===2?(e.consume(L),z):L===60&&s===1?(e.consume(L),V):L===62&&s===4?(e.consume(L),P):L===63&&s===3?(e.consume(L),D):L===93&&s===5?(e.consume(L),le):it(L)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(fQ,$,Z)(L)):L===null||it(L)?(e.exit("htmlFlowData"),Z(L)):(e.consume(L),X)}function Z(L){return e.check(hQ,te,$)(L)}function te(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),q}function q(L){return L===null||it(L)?Z(L):(e.enter("htmlFlowData"),X(L))}function z(L){return L===45?(e.consume(L),D):X(L)}function V(L){return L===47?(e.consume(L),l="",W):X(L)}function W(L){if(L===62){const ae=l.toLowerCase();return v3.includes(ae)?(e.consume(L),P):X(L)}return fr(L)&&l.length<8?(e.consume(L),l+=String.fromCharCode(L),W):X(L)}function le(L){return L===93?(e.consume(L),D):X(L)}function D(L){return L===62?(e.consume(L),P):L===45&&s===2?(e.consume(L),D):X(L)}function P(L){return L===null||it(L)?(e.exit("htmlFlowData"),$(L)):(e.consume(L),P)}function $(L){return e.exit("htmlFlow"),t(L)}}function gQ(e,t,n){const r=this;return s;function s(l){return it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function bQ(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Id,t,n)}}const xQ={name:"htmlText",tokenize:yQ};function yQ(e,t,n){const r=this;let s,a,l;return u;function u(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),M):D===63?(e.consume(D),A):fr(D)?(e.consume(D),j):n(D)}function h(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),a=0,E):fr(D)?(e.consume(D),k):n(D)}function p(D){return D===45?(e.consume(D),x):n(D)}function m(D){return D===null?n(D):D===45?(e.consume(D),b):it(D)?(l=m,V(D)):(e.consume(D),m)}function b(D){return D===45?(e.consume(D),x):m(D)}function x(D){return D===62?z(D):D===45?b(D):m(D)}function E(D){const P="CDATA[";return D===P.charCodeAt(a++)?(e.consume(D),a===P.length?N:E):n(D)}function N(D){return D===null?n(D):D===93?(e.consume(D),C):it(D)?(l=N,V(D)):(e.consume(D),N)}function C(D){return D===93?(e.consume(D),S):N(D)}function S(D){return D===62?z(D):D===93?(e.consume(D),S):N(D)}function k(D){return D===null||D===62?z(D):it(D)?(l=k,V(D)):(e.consume(D),k)}function A(D){return D===null?n(D):D===63?(e.consume(D),R):it(D)?(l=A,V(D)):(e.consume(D),A)}function R(D){return D===62?z(D):A(D)}function M(D){return fr(D)?(e.consume(D),_):n(D)}function _(D){return D===45||ir(D)?(e.consume(D),_):O(D)}function O(D){return it(D)?(l=O,V(D)):_t(D)?(e.consume(D),O):z(D)}function j(D){return D===45||ir(D)?(e.consume(D),j):D===47||D===62||sn(D)?H(D):n(D)}function H(D){return D===47?(e.consume(D),z):D===58||D===95||fr(D)?(e.consume(D),B):it(D)?(l=H,V(D)):_t(D)?(e.consume(D),H):z(D)}function B(D){return D===45||D===46||D===58||D===95||ir(D)?(e.consume(D),B):K(D)}function K(D){return D===61?(e.consume(D),X):it(D)?(l=K,V(D)):_t(D)?(e.consume(D),K):H(D)}function X(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),s=D,Z):it(D)?(l=X,V(D)):_t(D)?(e.consume(D),X):(e.consume(D),te)}function Z(D){return D===s?(e.consume(D),s=void 0,q):D===null?n(D):it(D)?(l=Z,V(D)):(e.consume(D),Z)}function te(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||sn(D)?H(D):(e.consume(D),te)}function q(D){return D===47||D===62||sn(D)?H(D):n(D)}function z(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function V(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return _t(D)?Pt(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):le(D)}function le(D){return e.enter("htmlTextData"),l(D)}}const nv={name:"labelEnd",resolveAll:SQ,resolveTo:CQ,tokenize:wQ},vQ={tokenize:kQ},EQ={tokenize:NQ},TQ={tokenize:AQ};function SQ(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Vr(e,0,e.length,n),e}function CQ(e,t){let n=e.length,r=0,s,a,l,u;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=as(u,e.slice(a+1,a+r+3)),u=as(u,[["enter",p,t]]),u=as(u,xp(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=as(u,[["exit",p,t],e[l-2],e[l-1],["exit",h,t]]),u=as(u,e.slice(l+1)),u=as(u,[["exit",d,t]]),Vr(e,a,e.length,u),e}function wQ(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return u;function u(b){return a?a._inactive?m(b):(l=r.parser.defined.includes(Es(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(vQ,p,l?p:m)(b):b===91?e.attempt(EQ,p,l?h:m)(b):l?p(b):m(b)}function h(b){return e.attempt(TQ,p,m)(b)}function p(b){return t(b)}function m(b){return a._balanced=!0,n(b)}}function kQ(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return sn(m)?Gc(e,a)(m):a(m)}function a(m){return m===41?p(m):v6(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return sn(m)?Gc(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?T6(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function h(m){return sn(m)?Gc(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function NQ(e,t,n){const r=this;return s;function s(u){return E6.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Es(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function AQ(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const _Q={name:"labelStartImage",resolveAll:nv.resolveAll,tokenize:RQ};function RQ(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const IQ={name:"labelStartLink",resolveAll:nv.resolveAll,tokenize:OQ};function OQ(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const R1={name:"lineEnding",tokenize:MQ};function MQ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Pt(e,t,"linePrefix")}}const $h={name:"thematicBreak",tokenize:LQ};function LQ(e,t,n){let r=0,s;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,u(h)}function u(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||it(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),_t(h)?Pt(e,u,"whitespace")(h):u(h))}}const Nr={continuation:{tokenize:BQ},exit:UQ,name:"list",tokenize:PQ},DQ={partial:!0,tokenize:HQ},jQ={partial:!0,tokenize:zQ};function PQ(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(x){const E=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:Wb(x)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check($h,n,h)(x):h(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return Wb(x)&&++l<10?(e.consume(x),d):(!r.interrupt||l<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(Id,r.interrupt?n:p,e.attempt(DQ,b,m))}function p(x){return r.containerState.initialBlankLine=!0,a++,b(x)}function m(x){return _t(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):n(x)}function b(x){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function BQ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Id,s,a);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Pt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!_t(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(jQ,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Pt(e,e.attempt(Nr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function zQ(e,t,n){const r=this;return Pt(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function UQ(e){e.exit(this.containerState.type)}function HQ(e,t,n){const r=this;return Pt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!_t(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const E3={name:"setextUnderline",resolveTo:FQ,tokenize:$Q};function FQ(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function $Q(e,t,n){const r=this;let s;return a;function a(h){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===s?(e.consume(h),u):(e.exit("setextHeadingLineSequence"),_t(h)?Pt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||it(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const VQ={tokenize:ZQ,partial:!0};function qQ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:XQ,continuation:{tokenize:WQ},exit:QQ}},text:{91:{name:"gfmFootnoteCall",tokenize:KQ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:YQ,resolveTo:GQ}}}}function YQ(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!l||!l._balanced)return n(d);const h=Es(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function GQ(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function KQ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(a>999||m===93&&!l||m===null||m===91||sn(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(Es(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return sn(m)||(l=!0),a++,e.consume(m),m===92?p:h}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,h):h(m)}}function XQ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,u;return d;function d(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(E)}function p(E){if(l>999||E===93&&!u||E===null||E===91||sn(E))return n(E);if(E===93){e.exit("chunkString");const N=e.exit("gfmFootnoteDefinitionLabelString");return a=Es(r.sliceSerialize(N)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return sn(E)||(u=!0),l++,e.consume(E),E===92?m:p}function m(E){return E===91||E===92||E===93?(e.consume(E),l++,p):p(E)}function b(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),s.includes(a)||s.push(a),Pt(e,x,"gfmFootnoteDefinitionWhitespace")):n(E)}function x(E){return t(E)}}function WQ(e,t,n){return e.check(Id,t,e.attempt(VQ,t,n))}function QQ(e){e.exit("gfmFootnoteDefinition")}function ZQ(e,t,n){const r=this;return Pt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function JQ(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",p,u],["enter",l[h][1],u],["exit",l[h][1],u],["enter",m,u]],x=u.parser.constructs.insideSpan.null;x&&Vr(b,b.length,0,xp(x,l.slice(h+1,d),u)),Vr(b,b.length,0,[["exit",m,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",p,u]]),Vr(l,h-1,d-h+3,b),d=h+b.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,u,d){const h=this.previous,p=this.events;let m=0;return b;function b(E){return h===126&&p[p.length-1][1].type!=="characterEscape"?d(E):(l.enter("strikethroughSequenceTemporary"),x(E))}function x(E){const N=su(h);if(E===126)return m>1?d(E):(l.consume(E),m++,x);if(m<2&&!n)return d(E);const C=l.exit("strikethroughSequenceTemporary"),S=su(E);return C._open=!S||S===2&&!!N,C._close=!N||N===2&&!!S,u(E)}}}class eZ{constructor(){this.map=[]}add(t,n,r){tZ(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function tZ(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function nZ(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function rZ(){return{flow:{null:{name:"table",tokenize:sZ,resolveAll:iZ}}}}function sZ(e,t,n){const r=this;let s=0,a=0,l;return u;function u(B){let K=r.events.length-1;for(;K>-1;){const te=r.events[K][1].type;if(te==="lineEnding"||te==="linePrefix")K--;else break}const X=K>-1?r.events[K][1].type:null,Z=X==="tableHead"||X==="tableRow"?_:d;return Z===_&&r.parser.lazy[r.now().line]?n(B):Z(B)}function d(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(l=!0,a+=1),p(B)}function p(B){return B===null?n(B):it(B)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),x):n(B):_t(B)?Pt(e,p,"whitespace")(B):(a+=1,l&&(l=!1,s+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(B)))}function m(B){return B===null||B===124||sn(B)?(e.exit("data"),p(B)):(e.consume(B),B===92?b:m)}function b(B){return B===92||B===124?(e.consume(B),m):m(B)}function x(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),l=!1,_t(B)?Pt(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):E(B))}function E(B){return B===45||B===58?C(B):B===124?(l=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),N):M(B)}function N(B){return _t(B)?Pt(e,C,"whitespace")(B):C(B)}function C(B){return B===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),S):B===45?(a+=1,S(B)):B===null||it(B)?R(B):M(B)}function S(B){return B===45?(e.enter("tableDelimiterFiller"),k(B)):M(B)}function k(B){return B===45?(e.consume(B),k):B===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(B))}function A(B){return _t(B)?Pt(e,R,"whitespace")(B):R(B)}function R(B){return B===124?E(B):B===null||it(B)?!l||s!==a?M(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):M(B)}function M(B){return n(B)}function _(B){return e.enter("tableRow"),O(B)}function O(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),O):B===null||it(B)?(e.exit("tableRow"),t(B)):_t(B)?Pt(e,O,"whitespace")(B):(e.enter("data"),j(B))}function j(B){return B===null||B===124||sn(B)?(e.exit("data"),O(B)):(e.consume(B),B===92?H:j)}function H(B){return B===92||B===124?(e.consume(B),j):j(B)}}function iZ(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,h,p,m;const b=new eZ;for(;++n<e.length;){const x=e[n],E=x[1];x[0]==="enter"?E.type==="tableHead"?(u=!1,d!==0&&(T3(b,t,d,h,p),p=void 0,d=0),h={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},b.add(n,0,[["enter",h,t]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,p={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},b.add(n,0,[["enter",p,t]])),s=E.type==="tableDelimiterRow"?2:p?3:1):s&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=Th(b,t,a,s,void 0,m),a=[0,0,0,0]),l[2]=n)):E.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],m=Th(b,t,a,s,void 0,m)),a=l,l=[a[1],n,0,0])):E.type==="tableHead"?(u=!0,d=n):E.type==="tableRow"||E.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],m=Th(b,t,a,s,n,m)):l[1]!==0&&(m=Th(b,t,l,s,n,m)),s=0):s&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&T3(b,t,d,h,p),b.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=nZ(t.events,n))}return e}function Th(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Dl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Dl(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=Dl(t.events,n[2]),p=Dl(t.events,n[3]),m={type:u,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const b=t.events[n[2]],x=t.events[n[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const E=n[2]+1,N=n[3]-n[2]-1;e.add(E,N,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(a.end=Object.assign({},Dl(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function T3(e,t,n,r,s){const a=[],l=Dl(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Dl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const aZ={name:"tasklistCheck",tokenize:lZ};function oZ(){return{text:{91:aZ}}}function lZ(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return sn(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(d)}function u(d){return it(d)?t(d):_t(d)?e.check({tokenize:uZ},t,n)(d):n(d)}}function uZ(e,t,n){return Pt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function cZ(e){return o6([vW(),qQ(),JQ(e),rZ(),oZ()])}const dZ={};function fZ(e){const t=this,n=e||dZ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(cZ(n)),a.push(mW()),l.push(pW(n))}var hZ=Object.defineProperty,mZ=Object.defineProperties,pZ=Object.getOwnPropertyDescriptors,S3=Object.getOwnPropertySymbols,gZ=Object.prototype.hasOwnProperty,bZ=Object.prototype.propertyIsEnumerable,C3=(e,t,n)=>t in e?hZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S6=(e,t)=>{for(var n in t||(t={}))gZ.call(t,n)&&C3(e,n,t[n]);if(S3)for(var n of S3(t))bZ.call(t,n)&&C3(e,n,t[n]);return e},C6=(e,t)=>mZ(e,pZ(t)),xr=(e,t)=>{let n=!1,r=!1;for(let s=0;s<t;s+=1){if(e[s]==="\\"&&s+1<e.length&&e[s+1]==="`"){s+=1;continue}if(e.substring(s,s+3)==="```"){r=!r,s+=2;continue}!r&&e[s]==="`"&&(n=!n)}return n||r},xZ=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",s=t>1&&e.substring(t-2,t+1)==="```";return n||r||s},yZ=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!xZ(e,n)&&(t+=1)}return t},Ca=(e,t)=>{let n=!1,r=!1,s=-1;for(let a=0;a<e.length;a+=1){if(e[a]==="\\"&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(s<t&&t<a)return!0;n=!1,s=-1}else n=!0,s=a}return!1},vZ=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,EZ=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(vZ,(t,n,r,s)=>xr(e,s)?t:`${n}\\>${r}`),TZ=/(\*\*)([^*]*\*?)$/,SZ=/(__)([^_]*?)$/,CZ=/(\*\*\*)([^*]*?)$/,wZ=/(\*)([^*]*?)$/,kZ=/(_)([^_]*?)$/,NZ=/(`)([^`]*?)$/,AZ=/(~~)([^~]*?)$/,Ho=/^[\s_~*`]*$/,w6=/^[\s]*[-*+][\s]+$/,_Z=/[\p{L}\p{N}_]/u,RZ=/^```[^`\n]*```?$/,IZ=/^\*{4,}$/,OZ=/(__)([^_]+)_$/,MZ=/(~~)([^~]+)~$/,w3=/~~/g,wa=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:_Z.test(e)},LZ=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},k6=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},yp=(e,t)=>{let n=!1,r=!1;for(let s=0;s<e.length&&s<t;s+=1){if(e[s]==="\\"&&e[s+1]==="$"){s+=1;continue}e[s]==="$"&&(e[s+1]==="$"?(r=!r,s+=1,n=!1):r||(n=!n))}return n||r},DZ=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
560
- `)return!1}return!1},N6=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?DZ(e,t):!1;if(e[n]===`
561
- `)return!1}return!1},jZ=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
562
- `)return!1}return!1},rv=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
563
- `){r=d+1;break}let s=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
564
- `){s=d;break}let a=e.substring(r,s),l=0,u=!1;for(let d of a)if(d===n)l+=1;else if(d!==" "&&d!==" "){u=!0;break}return l>=3&&!u},PZ=(e,t,n,r)=>n==="\\"||e.includes("$")&&yp(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&wa(n)&&wa(r)||(!n||n===" "||n===" "||n===`
565
- `)&&(!r||r===" "||r===" "||r===`
566
- `)),A6=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="*")continue;let a=s>0?e[s-1]:"",l=s<r-1?e[s+1]:"";PZ(e,s,a,l)||(t+=1)}return t},BZ=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&yp(e,t)||N6(e,t)||jZ(e,t)||n==="_"||r==="_"||n&&r&&wa(n)&&wa(r)),zZ=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="_")continue;let a=s>0?e[s-1]:"",l=s<r-1?e[s+1]:"";BZ(e,s,a,l)||(t+=1)}return t},UZ=e=>{let t=0,n=0,r=!1;for(let s=0;s<e.length;s+=1){if(e[s]==="`"&&s+2<e.length&&e[s+1]==="`"&&e[s+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,s+=2;continue}r||(e[s]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},sv=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},k3=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},HZ=(e,t,n)=>{if(!t||Ho.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
567
- `),s=r===-1?0:r+1,a=e.substring(s,n);return w6.test(a)&&t.includes(`
568
- `)?!0:rv(e,n,"*")},FZ=e=>{let t=e.match(TZ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return xr(e,r)||Ca(e,r)||HZ(e,n,r)?e:sv(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},$Z=(e,t,n)=>{if(!t||Ho.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
569
- `),s=r===-1?0:r+1,a=e.substring(s,n);return w6.test(a)&&t.includes(`
570
- `)?!0:rv(e,n,"_")},VZ=e=>{let t=e.match(SZ);if(!t){let s=e.match(OZ);if(s){let a=e.lastIndexOf(s[1]);if(!(xr(e,a)||Ca(e,a))&&k3(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return xr(e,r)||Ca(e,r)||$Z(e,n,r)?e:k3(e)%2===1?`${e}__`:e},qZ=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!yp(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
571
- `)&&(!s||s===" "||s===" "||s===`
572
- `)||r&&s&&wa(r)&&wa(s))continue;return n}}return-1},YZ=e=>{if(!e.match(wZ))return e;let t=qZ(e);if(t===-1||xr(e,t)||Ca(e,t))return e;let n=e.substring(t+1);return!n||Ho.test(n)?e:A6(e)%2===1?`${e}*`:e},_6=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!yp(e,n)&&!N6(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if(r&&s&&wa(r)&&wa(s))continue;return n}}return-1},GZ=e=>{let t=e.length;for(;t>0&&e[t-1]===`
573
- `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},KZ=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(sv(t)%2!==1)return null;let n=t.indexOf("**"),r=_6(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},XZ=e=>{if(!e.match(kZ))return e;let t=_6(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||Ho.test(n)||xr(e,t)||Ca(e,t))return e;if(zZ(e)%2===1){let r=KZ(e);return r!==null?r:GZ(e)}return e},WZ=e=>{let t=sv(e),n=A6(e);return t%2===0&&n%2===0},QZ=(e,t,n)=>!t||Ho.test(t)||xr(e,n)||Ca(e,n)?!0:rv(e,n,"*"),ZZ=e=>{if(IZ.test(e))return e;let t=e.match(CZ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return QZ(e,n,r)?e:UZ(e)%2===1?WZ(e)?e:`${e}***`:e},JZ=/<[a-zA-Z/][^>]*$/,eJ=e=>{let t=e.match(JZ);return!t||t.index===void 0||xr(e,t.index)?e:e.substring(0,t.index).trimEnd()},tJ=e=>!e.match(RZ)||e.includes(`
574
- `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,nJ=e=>(e.match(/```/g)||[]).length%2===1,rJ=e=>{let t=tJ(e);if(t!==null)return t;let n=e.match(NZ);if(n&&!nJ(e)){let r=n[2];if(!r||Ho.test(r))return e;if(yZ(e)%2===1)return`${e}\``}return e},R6=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",sJ=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!R6(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},iJ=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!R6(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},aJ=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
575
- `,t)!==-1&&!e.endsWith(`
576
- `)?`${e}
577
- $$`:`${e}$$`},oJ=e=>sJ(e)%2===0?e:aJ(e),lJ=e=>iJ(e)%2===1?`${e}$`:e,uJ=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=LZ(e,t);if(r===-1||xr(e,r))return null;let s=r>0&&e[r-1]==="!",a=s?r-1:r,l=e.substring(0,a);if(s)return l;let u=e.substring(r+1,t);return n==="text-only"?`${l}${u}`:`${l}[${u}](streamdown:incomplete-link)`},N3=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!xr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=k6(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let s=e.indexOf(")",r+2);s!==-1&&(n=s)}}return t},cJ=(e,t,n)=>{let r=t>0&&e[t-1]==="!",s=r?t-1:t;if(!e.substring(t+1).includes("]")){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let l=N3(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}if(k6(e,t)===-1){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let l=N3(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}return null},I6=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!xr(e,n)){let r=uJ(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!xr(e,r)){let s=cJ(e,r,t);if(s!==null)return s}return e},dJ=/^-{1,2}$/,fJ=/^[\s]*-{1,2}[\s]+$/,hJ=/^={1,2}$/,mJ=/^[\s]*={1,2}[\s]+$/,pJ=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
578
- `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(dJ.test(s)&&!n.match(fJ)){let a=r.split(`
579
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}if(hJ.test(s)&&!n.match(mJ)){let a=r.split(`
580
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}return e},gJ=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),bJ=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(gJ,(t,n)=>xr(e,n)?t:"\\~"),xJ=e=>{var t,n;let r=e.match(AZ);if(r){let s=r[2];if(!s||Ho.test(s))return e;let a=e.lastIndexOf(r[1]);if(xr(e,a)||Ca(e,a))return e;if(((t=e.match(w3))==null?void 0:t.length)%2===1)return`${e}~~`}else{let s=e.match(MZ);if(s){let a=e.lastIndexOf(s[0].slice(0,2));if(xr(e,a)||Ca(e,a))return e;if(((n=e.match(w3))==null?void 0:n.length)%2===1)return`${e}~`}}return e},I1=e=>e!==!1,yJ=e=>e===!0,dr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},vJ=[{handler:{name:"singleTilde",handle:bJ,priority:dr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:EZ,priority:dr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:eJ,priority:dr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:pJ,priority:dr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:I6,priority:dr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:ZZ,priority:dr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:FZ,priority:dr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:VZ,priority:dr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:YZ,priority:dr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:XZ,priority:dr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:rJ,priority:dr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:xJ,priority:dr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:oJ,priority:dr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:lJ,priority:dr.INLINE_KATEX},optionKey:"inlineKatex"}],EJ=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return vJ.filter(({handler:r,optionKey:s})=>r.name==="links"?I1(e?.links)||I1(e?.images):r.name==="inlineKatex"?yJ(e?.inlineKatex):I1(e?.[s])).map(({handler:r,earlyReturn:s})=>r.name==="links"?{handler:C6(S6({},r),{handle:a=>I6(a,n)}),earlyReturn:n==="protocol"?s:void 0}:{handler:r,earlyReturn:s})},TJ=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=EJ(t),a=((n=t?.handlers)!=null?n:[]).map(u=>{var d;return{handler:C6(S6({},u),{priority:(d=u.priority)!=null?d:dr.DEFAULT}),earlyReturn:void 0}}),l=[...s,...a].sort((u,d)=>{var h,p;return((h=u.handler.priority)!=null?h:0)-((p=d.handler.priority)!=null?p:0)});for(let{handler:u,earlyReturn:d}of l)if(r=u.handle(r),d!=null&&d(r))return r;return r},SJ=TJ;const CJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kJ={};function A3(e,t){return(kJ.jsx?wJ:CJ).test(e)}const NJ=/[ \t\n\f\r]/g;function AJ(e){return typeof e=="object"?e.type==="text"?_3(e.value):!1:_3(e)}function _3(e){return e.replace(NJ,"")===""}var _l={},O1,R3;function _J(){if(R3)return O1;R3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
581
- `,h="/",p="*",m="",b="comment",x="declaration";function E(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var k=1,A=1;function R(te){var q=te.match(t);q&&(k+=q.length);var z=te.lastIndexOf(d);A=~z?te.length-z:A+te.length}function M(){var te={line:k,column:A};return function(q){return q.position=new _(te),H(),q}}function _(te){this.start=te,this.end={line:k,column:A},this.source=S.source}_.prototype.content=C;function O(te){var q=new Error(S.source+":"+k+":"+A+": "+te);if(q.reason=te,q.filename=S.source,q.line=k,q.column=A,q.source=C,!S.silent)throw q}function j(te){var q=te.exec(C);if(q){var z=q[0];return R(z),C=C.slice(z.length),q}}function H(){j(n)}function B(te){var q;for(te=te||[];q=K();)q!==!1&&te.push(q);return te}function K(){var te=M();if(!(h!=C.charAt(0)||p!=C.charAt(1))){for(var q=2;m!=C.charAt(q)&&(p!=C.charAt(q)||h!=C.charAt(q+1));)++q;if(q+=2,m===C.charAt(q-1))return O("End of comment missing");var z=C.slice(2,q-2);return A+=2,R(z),C=C.slice(q),A+=2,te({type:b,comment:z})}}function X(){var te=M(),q=j(r);if(q){if(K(),!j(s))return O("property missing ':'");var z=j(a),V=te({type:x,property:N(q[0].replace(e,m)),value:z?N(z[0].replace(e,m)):m});return j(l),V}}function Z(){var te=[];B(te);for(var q;q=X();)q!==!1&&(te.push(q),B(te));return te}return H(),Z()}function N(C){return C?C.replace(u,m):m}return O1=E,O1}var I3;function RJ(){if(I3)return _l;I3=1;var e=_l&&_l.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_l,"__esModule",{value:!0}),_l.default=n;const t=e(_J());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:p}=d;u?s(h,p,d):p&&(a=a||{},a[h]=p)}),a}return _l}var vc={},O3;function IJ(){if(O3)return vc;O3=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,p){return p.toUpperCase()},u=function(h,p){return"".concat(p,"-")},d=function(h,p){return p===void 0&&(p={}),a(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,u):h=h.replace(r,u),h.replace(t,l))};return vc.camelCase=d,vc}var Ec,M3;function OJ(){if(M3)return Ec;M3=1;var e=Ec&&Ec.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(RJ()),n=IJ();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,Ec=r,Ec}var MJ=OJ();const LJ=Am(MJ);function Kc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?L3(e.position):"start"in e||"end"in e?L3(e):"line"in e||"column"in e?Jb(e):""}function Jb(e){return D3(e&&e.line)+":"+D3(e&&e.column)}function L3(e){return Jb(e&&e.start)+"-"+Jb(e&&e.end)}function D3(e){return e&&typeof e=="number"?e:1}class ur extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=Kc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ur.prototype.file="";ur.prototype.name="";ur.prototype.reason="";ur.prototype.message="";ur.prototype.stack="";ur.prototype.column=void 0;ur.prototype.line=void 0;ur.prototype.ancestors=void 0;ur.prototype.cause=void 0;ur.prototype.fatal=void 0;ur.prototype.place=void 0;ur.prototype.ruleId=void 0;ur.prototype.source=void 0;const iv={}.hasOwnProperty,DJ=new Map,jJ=/[A-Z]/g,PJ=new Set(["table","tbody","thead","tfoot","tr"]),BJ=new Set(["td","th"]),O6="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zJ(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=GJ(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=YJ(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ma:Nd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=M6(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function M6(e,t,n){if(t.type==="element")return UJ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return HJ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $J(e,t,n);if(t.type==="mdxjsEsm")return FJ(e,t);if(t.type==="root")return VJ(e,t,n);if(t.type==="text")return qJ(e,t)}function UJ(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ma,e.schema=s),e.ancestors.push(t);const a=D6(e,t.tagName,!1),l=KJ(e,t);let u=ov(e,t);return PJ.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!AJ(d):!0})),L6(e,l,a,t),av(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function HJ(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pd(e,t.position)}function FJ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pd(e,t.position)}function $J(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ma,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:D6(e,t.name,!0),l=XJ(e,t),u=ov(e,t);return L6(e,l,a,t),av(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function VJ(e,t,n){const r={};return av(r,ov(e,t)),e.create(t,e.Fragment,r,n)}function qJ(e,t){return t.value}function L6(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function av(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function YJ(e,t,n){return r;function r(s,a,l,u){const h=Array.isArray(l.children)?n:t;return u?h(a,l,u):h(a,l)}}function GJ(e,t){return n;function n(r,s,a,l){const u=Array.isArray(a.children),d=Ws(r);return t(s,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function KJ(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&iv.call(t.properties,s)){const a=WJ(e,s,t.properties[s]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&BJ.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function XJ(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else pd(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else pd(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function ov(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:DJ;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const h=s.get(d)||0;l=d+"-"+h,s.set(d,h+1)}}const u=M6(e,a,l);u!==void 0&&n.push(u)}return n}function WJ(e,t,n){const r=dp(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?e4(n):t4(n)),r.property==="style"){let s=typeof n=="object"?n:QJ(e,String(n));return e.stylePropertyNameCase==="css"&&(s=ZJ(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?lq[r.property]||r.property:r.attribute,n]}}function QJ(e,t){try{return LJ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new ur("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=O6+"#cannot-parse-style-attribute",s}}function D6(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const u=A3(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=A3(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return iv.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);pd(e)}function pd(e,t){const n=new ur("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=O6+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ZJ(e){const t={};let n;for(n in e)iv.call(e,n)&&(t[JJ(n)]=e[n]);return t}function JJ(e){let t=e.replace(jJ,eee);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function eee(e){return"-"+e.toLowerCase()}const M1={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"]},tee={tokenize:nee};function nee(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Pt(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return it(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const ree={tokenize:see},j3={tokenize:iee};function see(e){const t=this,n=[];let r=0,s,a,l;return u;function u(A){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,d,h)(A)}return h(A)}function d(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&k();const R=t.events.length;let M=R,_;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){_=t.events[M][1].end;break}S(r);let O=R;for(;O<t.events.length;)t.events[O][1].end={..._},O++;return Vr(t.events,M+1,0,t.events.slice(R)),t.events.length=O,h(A)}return u(A)}function h(A){if(r===n.length){if(!s)return b(A);if(s.currentConstruct&&s.currentConstruct.concrete)return E(A);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(j3,p,m)(A)}function p(A){return s&&k(),S(r),b(A)}function m(A){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,E(A)}function b(A){return t.containerState={},e.attempt(j3,x,E)(A)}function x(A){return r++,n.push([t.currentConstruct,t.containerState]),b(A)}function E(A){if(A===null){s&&k(),S(0),e.consume(A);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),N(A)}function N(A){if(A===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(A);return}return it(A)?(e.consume(A),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(A),N)}function C(A,R){const M=t.sliceStream(A);if(R&&M.push(null),A.previous=a,a&&(a.next=A),a=A,s.defineSkip(A.start),s.write(M),t.parser.lazy[A.start.line]){let _=s.events.length;for(;_--;)if(s.events[_][1].start.offset<l&&(!s.events[_][1].end||s.events[_][1].end.offset>l))return;const O=t.events.length;let j=O,H,B;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(H){B=t.events[j][1].end;break}H=!0}for(S(r),_=O;_<t.events.length;)t.events[_][1].end={...B},_++;Vr(t.events,j+1,0,t.events.slice(O)),t.events.length=_}}function S(A){let R=n.length;for(;R-- >A;){const M=n[R];t.containerState=M[1],M[0].exit.call(t,e)}n.length=A}function k(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function iee(e,t,n){return Pt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const aee={tokenize:oee};function oee(e){const t=this,n=e.attempt(Id,r,e.attempt(this.parser.constructs.flowInitial,s,Pt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(WW,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const lee={resolveAll:P6()},uee=j6("string"),cee=j6("text");function j6(e){return{resolveAll:P6(e==="text"?dee:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,u);return l;function l(p){return h(p)?a(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return h(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function h(p){if(p===null)return!0;const m=s[p];let b=-1;if(m)for(;++b<m.length;){const x=m[b];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function P6(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function dee(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,l=-1,u=0,d;for(;a--;){const h=s[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(h===-2)d=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const h={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const fee={42:Nr,43:Nr,45:Nr,48:Nr,49:Nr,50:Nr,51:Nr,52:Nr,53:Nr,54:Nr,55:Nr,56:Nr,57:Nr,62:g6},hee={91:tQ},mee={[-2]:_1,[-1]:_1,32:_1},pee={35:oQ,42:$h,45:[E3,$h],60:dQ,61:E3,95:$h,96:y3,126:y3},gee={38:x6,92:b6},bee={[-5]:R1,[-4]:R1,[-3]:R1,33:_Q,38:x6,42:Zb,60:[IW,xQ],91:IQ,92:[iQ,b6],93:nv,95:Zb,96:VW},xee={null:[Zb,lee]},yee={null:[42,95]},vee={null:[]},Eee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:yee,contentInitial:hee,disable:vee,document:fee,flow:pee,flowInitial:mee,insideSpan:xee,string:gee,text:bee},Symbol.toStringTag,{value:"Module"}));function Tee(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let l=[],u=[];const d={attempt:O(M),check:O(_),consume:k,enter:A,exit:R,interrupt:O(_,{interrupt:!0})},h={code:null,containerState:{},defineSkip:N,events:[],now:E,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:m};let p=t.tokenize.call(h,d);return t.resolveAll&&a.push(t),h;function m(K){return l=as(l,K),C(),l[l.length-1]!==null?[]:(j(t,0),h.events=xp(a,h.events,h),h.events)}function b(K,X){return Cee(x(K),X)}function x(K){return See(l,K)}function E(){const{_bufferIndex:K,_index:X,line:Z,column:te,offset:q}=r;return{_bufferIndex:K,_index:X,line:Z,column:te,offset:q}}function N(K){s[K.line]=K.column,B()}function C(){let K;for(;r._index<l.length;){const X=l[r._index];if(typeof X=="string")for(K=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===K&&r._bufferIndex<X.length;)S(X.charCodeAt(r._bufferIndex));else S(X)}}function S(K){p=p(K)}function k(K){it(K)?(r.line++,r.column=1,r.offset+=K===-3?2:1,B()):K!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=K}function A(K,X){const Z=X||{};return Z.type=K,Z.start=E(),h.events.push(["enter",Z,h]),u.push(Z),Z}function R(K){const X=u.pop();return X.end=E(),h.events.push(["exit",X,h]),X}function M(K,X){j(K,X.from)}function _(K,X){X.restore()}function O(K,X){return Z;function Z(te,q,z){let V,W,le,D;return Array.isArray(te)?$(te):"tokenize"in te?$([te]):P(te);function P(ce){return de;function de(fe){const Se=fe!==null&&ce[fe],He=fe!==null&&ce.null,Me=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(He)?He:He?[He]:[]];return $(Me)(fe)}}function $(ce){return V=ce,W=0,ce.length===0?z:L(ce[W])}function L(ce){return de;function de(fe){return D=H(),le=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?re():ce.tokenize.call(X?Object.assign(Object.create(h),X):h,d,ae,re)(fe)}}function ae(ce){return K(le,D),q}function re(ce){return D.restore(),++W<V.length?L(V[W]):z}}}function j(K,X){K.resolveAll&&!a.includes(K)&&a.push(K),K.resolve&&Vr(h.events,X,h.events.length-X,K.resolve(h.events.slice(X),h)),K.resolveTo&&(h.events=K.resolveTo(h.events,h))}function H(){const K=E(),X=h.previous,Z=h.currentConstruct,te=h.events.length,q=Array.from(u);return{from:te,restore:z};function z(){r=K,h.previous=X,h.currentConstruct=Z,h.events.length=te,u=q,B()}}function B(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function See(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function Cee(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
582
- `;break}case-3:{l=`\r
583
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function wee(e){const r={constructs:o6([Eee,...(e||{}).extensions||[]]),content:s(tee),defined:[],document:s(ree),flow:s(aee),lazy:{},string:s(uee),text:s(cee)};return r;function s(a){return l;function l(u){return Tee(r,a,u)}}}function kee(e){for(;!y6(e););return e}const P3=/[\0\t\n\r]/g;function Nee(){let e=1,t="",n=!0,r;return s;function s(a,l,u){const d=[];let h,p,m,b,x;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(P3.lastIndex=m,h=P3.exec(a),b=h&&h.index!==void 0?h.index:a.length,x=a.charCodeAt(b),!h){t=a.slice(m);break}if(x===10&&m===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<b&&(d.push(a.slice(m,b)),e+=b-m),x){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=b+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const B6={}.hasOwnProperty;function Aee(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),_ee(n)(kee(wee(n).document().write(Nee()(e,t,!0))))}function _ee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ve),autolinkProtocol:H,autolinkEmail:H,atxHeading:a(Ke),blockQuote:a(He),characterEscape:H,characterReference:H,codeFenced:a(Me),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Me,l),codeText:a(Ee,l),codeTextData:H,data:H,codeFlowValue:H,definition:a(Oe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Be),hardBreakEscape:a($e),hardBreakTrailing:a($e),htmlFlow:a(De,l),htmlFlowData:H,htmlText:a(De,l),htmlTextData:H,image:a(ke),label:l,link:a(ve),listItem:a(je),listItemValue:b,listOrdered:a(Ie,m),listUnordered:a(Ie),paragraph:a(ee),reference:L,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ke),strong:a(me),thematicBreak:a(ie)},exit:{atxHeading:d(),atxHeadingSequence:M,autolink:d(),autolinkEmail:Se,autolinkProtocol:fe,blockQuote:d(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ce,characterReference:de,codeFenced:d(C),codeFencedFence:N,codeFencedFenceInfo:x,codeFencedFenceMeta:E,codeFlowValue:B,codeIndented:d(S),codeText:d(q),codeTextData:B,data:B,definition:d(),definitionDestinationString:R,definitionLabelString:k,definitionTitleString:A,emphasis:d(),hardBreakEscape:d(X),hardBreakTrailing:d(X),htmlFlow:d(Z),htmlFlowData:B,htmlText:d(te),htmlTextData:B,image:d(V),label:le,labelText:W,lineEnding:K,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ae,resourceDestinationString:D,resourceTitleString:P,resource:$,setextHeading:d(j),setextHeadingLineSequence:O,setextHeadingText:_,strong:d(),thematicBreak:d()}};z6(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let F={type:"root",children:[]};const J={stack:[F],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:p,data:n},Te=[];let _e=-1;for(;++_e<G.length;)if(G[_e][1].type==="listOrdered"||G[_e][1].type==="listUnordered")if(G[_e][0]==="enter")Te.push(_e);else{const Ve=Te.pop();_e=s(G,Ve,_e)}for(_e=-1;++_e<G.length;){const Ve=t[G[_e][0]];B6.call(Ve,G[_e][1].type)&&Ve[G[_e][1].type].call(Object.assign({sliceSerialize:G[_e][2].sliceSerialize},J),G[_e][1])}if(J.tokenStack.length>0){const Ve=J.tokenStack[J.tokenStack.length-1];(Ve[1]||B3).call(J,void 0,Ve[0])}for(F.position={start:ua(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:ua(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)F=t.transforms[_e](F)||F;return F}function s(G,F,J){let Te=F-1,_e=-1,Ve=!1,ot,tt,dt,ut;for(;++Te<=J;){const qe=G[Te];switch(qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{qe[0]==="enter"?_e++:_e--,ut=void 0;break}case"lineEndingBlank":{qe[0]==="enter"&&(ot&&!ut&&!_e&&!dt&&(dt=Te),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!_e&&qe[0]==="enter"&&qe[1].type==="listItemPrefix"||_e===-1&&qe[0]==="exit"&&(qe[1].type==="listUnordered"||qe[1].type==="listOrdered")){if(ot){let Rt=Te;for(tt=void 0;Rt--;){const jt=G[Rt];if(jt[1].type==="lineEnding"||jt[1].type==="lineEndingBlank"){if(jt[0]==="exit")continue;tt&&(G[tt][1].type="lineEndingBlank",Ve=!0),jt[1].type="lineEnding",tt=Rt}else if(!(jt[1].type==="linePrefix"||jt[1].type==="blockQuotePrefix"||jt[1].type==="blockQuotePrefixWhitespace"||jt[1].type==="blockQuoteMarker"||jt[1].type==="listItemIndent"))break}dt&&(!tt||dt<tt)&&(ot._spread=!0),ot.end=Object.assign({},tt?G[tt][1].start:qe[1].end),G.splice(tt||Te,0,["exit",ot,qe[2]]),Te++,J++}if(qe[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},qe[1].start),end:void 0};ot=Rt,G.splice(Te,0,["enter",Rt,qe[2]]),Te++,J++,dt=void 0,ut=!0}}}return G[F][1]._spread=Ve,J}function a(G,F){return J;function J(Te){u.call(this,G(Te),Te),F&&F.call(this,Te)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(G,F,J){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([F,J||void 0]),G.position={start:ua(F.start),end:void 0}}function d(G){return F;function F(J){G&&G.call(this,J),h.call(this,J)}}function h(G,F){const J=this.stack.pop(),Te=this.tokenStack.pop();if(Te)Te[0].type!==G.type&&(F?F.call(this,G,Te[0]):(Te[1]||B3).call(this,G,Te[0]));else throw new Error("Cannot close `"+G.type+"` ("+Kc({start:G.start,end:G.end})+"): it’s not open");J.position.end=ua(G.end)}function p(){return Zy(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function b(G){if(this.data.expectingFirstListItemValue){const F=this.stack[this.stack.length-2];F.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function x(){const G=this.resume(),F=this.stack[this.stack.length-1];F.lang=G}function E(){const G=this.resume(),F=this.stack[this.stack.length-1];F.meta=G}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const G=this.resume(),F=this.stack[this.stack.length-1];F.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const G=this.resume(),F=this.stack[this.stack.length-1];F.value=G.replace(/(\r?\n|\r)$/g,"")}function k(G){const F=this.resume(),J=this.stack[this.stack.length-1];J.label=F,J.identifier=Es(this.sliceSerialize(G)).toLowerCase()}function A(){const G=this.resume(),F=this.stack[this.stack.length-1];F.title=G}function R(){const G=this.resume(),F=this.stack[this.stack.length-1];F.url=G}function M(G){const F=this.stack[this.stack.length-1];if(!F.depth){const J=this.sliceSerialize(G).length;F.depth=J}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function O(G){const F=this.stack[this.stack.length-1];F.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function H(G){const J=this.stack[this.stack.length-1].children;let Te=J[J.length-1];(!Te||Te.type!=="text")&&(Te=oe(),Te.position={start:ua(G.start),end:void 0},J.push(Te)),this.stack.push(Te)}function B(G){const F=this.stack.pop();F.value+=this.sliceSerialize(G),F.position.end=ua(G.end)}function K(G){const F=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=F.children[F.children.length-1];J.position.end=ua(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(F.type)&&(H.call(this,G),B.call(this,G))}function X(){this.data.atHardBreak=!0}function Z(){const G=this.resume(),F=this.stack[this.stack.length-1];F.value=G}function te(){const G=this.resume(),F=this.stack[this.stack.length-1];F.value=G}function q(){const G=this.resume(),F=this.stack[this.stack.length-1];F.value=G}function z(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=F,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function V(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=F,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function W(G){const F=this.sliceSerialize(G),J=this.stack[this.stack.length-2];J.label=tW(F),J.identifier=Es(F).toLowerCase()}function le(){const G=this.stack[this.stack.length-1],F=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const Te=G.children;J.children=Te}else J.alt=F}function D(){const G=this.resume(),F=this.stack[this.stack.length-1];F.url=G}function P(){const G=this.resume(),F=this.stack[this.stack.length-1];F.title=G}function $(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ae(G){const F=this.resume(),J=this.stack[this.stack.length-1];J.label=F,J.identifier=Es(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function re(G){this.data.characterReferenceType=G.type}function ce(G){const F=this.sliceSerialize(G),J=this.data.characterReferenceType;let Te;J?(Te=a6(F,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=ev(F);const _e=this.stack[this.stack.length-1];_e.value+=Te}function de(G){const F=this.stack.pop();F.position.end=ua(G.end)}function fe(G){B.call(this,G);const F=this.stack[this.stack.length-1];F.url=this.sliceSerialize(G)}function Se(G){B.call(this,G);const F=this.stack[this.stack.length-1];F.url="mailto:"+this.sliceSerialize(G)}function He(){return{type:"blockquote",children:[]}}function Me(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function De(){return{type:"html",value:""}}function ke(){return{type:"image",title:null,url:"",alt:null}}function ve(){return{type:"link",title:null,url:"",children:[]}}function Ie(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function je(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function ee(){return{type:"paragraph",children:[]}}function me(){return{type:"strong",children:[]}}function oe(){return{type:"text",value:""}}function ie(){return{type:"thematicBreak"}}}function ua(e){return{line:e.line,column:e.column,offset:e.offset}}function z6(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?z6(e,r):Ree(e,r)}}function Ree(e,t){let n;for(n in t)if(B6.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function B3(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Kc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Kc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Kc({start:t.start,end:t.end})+") is still open")}function Iee(e){const t=this;t.parser=n;function n(r){return Aee(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Oee(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Mee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
584
- `}]}function Lee(e,t){const n=t.value?t.value+`
585
- `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Dee(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pee(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=gu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function Bee(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zee(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function U6(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function Uee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return U6(e,t);const s={src:gu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function Hee(e,t){const n={src:gu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Fee(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function $ee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return U6(e,t);const s={href:gu(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Vee(e,t){const n={href:gu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function qee(e,t,n){const r=e.all(t),s=n?Yee(n):H6(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(s||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
586
- `}),p.type==="element"&&p.tagName==="p"&&!s?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
587
- `});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function Yee(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=H6(n[r])}return t}function H6(e){const t=e.spread;return t??e.children.length>1}function Gee(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Kee(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xee(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Wee(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qee(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Ws(t.children[1]),d=gp(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function Zee(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<u;){const m=t.children[d],b={},x=l?l[d]:void 0;x&&(b.align=x);let E={type:"element",tagName:a,properties:b,children:[]};m&&(E.children=e.all(m),e.patch(m,E),E=e.applyData(m,E)),h.push(E)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function Jee(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const z3=9,U3=32;function ete(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(H3(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(H3(t.slice(s),s>0,!1)),a.join("")}function H3(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===z3||a===U3;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===z3||a===U3;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function tte(e,t){const n={type:"text",value:ete(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nte(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rte={blockquote:Oee,break:Mee,code:Lee,delete:Dee,emphasis:jee,footnoteReference:Pee,heading:Bee,html:zee,imageReference:Uee,image:Hee,inlineCode:Fee,linkReference:$ee,link:Vee,listItem:qee,list:Gee,paragraph:Kee,root:Xee,strong:Wee,table:Qee,tableCell:Jee,tableRow:Zee,text:tte,thematicBreak:nte,toml:Sh,yaml:Sh,definition:Sh,footnoteDefinition:Sh};function Sh(){}function ste(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function ite(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ate(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ste,r=e.options.footnoteBackLabel||ite,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const p=e.all(h),m=String(h.identifier).toUpperCase(),b=gu(m.toLowerCase());let x=0;const E=[],N=e.footnoteCounts.get(m);for(;N!==void 0&&++x<=N;){E.length>0&&E.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,x);typeof k=="string"&&(k={type:"text",value:k}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,x),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const k=C.children[C.children.length-1];k&&k.type==="text"?k.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...E)}else p.push(...E);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(p,!0)};e.patch(h,S),u.push(S)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Ao(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
588
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
589
- `}]}}const ex={}.hasOwnProperty,ote={};function lte(e,t){const n=t||ote,r=new Map,s=new Map,a=new Map,l={...rte,...n.handlers},u={all:h,applyData:cte,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:ute,wrap:fte};return qs(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:s,b=String(p.identifier).toUpperCase();m.has(b)||m.set(b,p)}}),u;function d(p,m){const b=p.type,x=u.handlers[b];if(ex.call(u.handlers,b)&&x)return x(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(b)){if("children"in p){const{children:N,...C}=p,S=Ao(C);return S.children=u.all(p),S}return Ao(p)}return(u.options.unknownHandler||dte)(u,p,m)}function h(p){const m=[];if("children"in p){const b=p.children;let x=-1;for(;++x<b.length;){const E=u.one(b[x],p);if(E){if(x&&b[x-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=F3(E.value)),!Array.isArray(E)&&E.type==="element")){const N=E.children[0];N&&N.type==="text"&&(N.value=F3(N.value))}Array.isArray(E)?m.push(...E):m.push(E)}}}return m}}function ute(e,t){e.position&&(t.position=D4(e))}function cte(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Ao(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function dte(e,t){const n=t.data||{},r="value"in t&&!(ex.call(n,"hProperties")||ex.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fte(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
590
- `});++r<e.length;)r&&n.push({type:"text",value:`
591
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
592
- `}),n}function F3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function $3(e,t){const n=lte(e,t),r=n.one(e,void 0),s=ate(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
593
- `},s),a}function hte(e,t){return e&&"run"in e?async function(n,r){const s=$3(n,{file:r,...t});await e.run(s,r)}:function(n,r){return $3(n,{file:r,...e||t})}}function V3(e){if(e)throw e}var L1,q3;function mte(){if(q3)return L1;q3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!m)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},l=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},u=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(r)return r(h,p).value}else return;return h[p]};return L1=function d(){var h,p,m,b,x,E,N=arguments[0],C=1,S=arguments.length,k=!1;for(typeof N=="boolean"&&(k=N,N=arguments[1]||{},C=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});C<S;++C)if(h=arguments[C],h!=null)for(p in h)m=u(N,p),b=u(h,p),N!==b&&(k&&b&&(a(b)||(x=s(b)))?(x?(x=!1,E=m&&s(m)?m:[]):E=m&&a(m)?m:{},l(N,{name:p,newValue:d(k,E,b)})):typeof b<"u"&&l(N,{name:p,newValue:b}));return N},L1}var pte=mte();const D1=Am(pte);function tx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function gte(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(d,...h){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<s.length;)(h[m]===null||h[m]===void 0)&&(h[m]=s[m]);s=h,p?bte(p,u)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function bte(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(s);try{d=e.apply(this,l)}catch(h){const p=h;if(u&&n)throw p;return s(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(l,...u){n||(n=!0,t(l,...u))}function a(l){s(null,l)}}const Bs={basename:xte,dirname:yte,extname:vte,join:Ete,sep:"/"};function xte(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Od(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function yte(e){if(Od(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function vte(e){Od(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function Ete(...e){let t=-1,n;for(;++t<e.length;)Od(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Tte(n)}function Tte(e){Od(e);const t=e.codePointAt(0)===47;let n=Ste(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ste(e,t){let n="",r=0,s=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function Od(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Cte={cwd:wte};function wte(){return"/"}function nx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function kte(e){if(typeof e=="string")e=new URL(e);else if(!nx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Nte(e)}function Nte(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const j1=["history","path","basename","stem","extname","dirname"];class Ate{constructor(t){let n;t?nx(t)?n={path:t}:typeof t=="string"||_te(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Cte.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<j1.length;){const a=j1[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)j1.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Bs.basename(this.path):void 0}set basename(t){B1(t,"basename"),P1(t,"basename"),this.path=Bs.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Bs.dirname(this.path):void 0}set dirname(t){Y3(this.basename,"dirname"),this.path=Bs.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Bs.extname(this.path):void 0}set extname(t){if(P1(t,"extname"),Y3(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Bs.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){nx(t)&&(t=kte(t)),B1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Bs.basename(this.path,this.extname):void 0}set stem(t){B1(t,"stem"),P1(t,"stem"),this.path=Bs.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new ur(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function P1(e,t){if(e&&e.includes(Bs.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Bs.sep+"`")}function B1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Y3(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _te(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Rte=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Ite={}.hasOwnProperty;class lv extends Rte{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=gte()}copy(){const t=new lv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(D1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(H1("data",this.frozen),this.namespace[t]=n,this):Ite.call(this.namespace,t)&&this.namespace[t]||void 0:t?(H1("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ch(t),r=this.parser||this.Parser;return z1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),z1("process",this.parser||this.Parser),U1("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const u=Ch(t),d=r.parse(u);r.run(d,u,function(p,m,b){if(p||!m||!b)return h(p);const x=m,E=r.stringify(x,b);Lte(E)?b.value=E:b.result=E,h(p,b)});function h(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),z1("processSync",this.parser||this.Parser),U1("processSync",this.compiler||this.Compiler),this.process(t,s),K3("processSync","process",n),r;function s(a,l){n=!0,V3(a),r=l}}run(t,n,r){G3(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const d=Ch(n);s.run(t,d,h);function h(p,m,b){const x=m||t;p?u(p):l?l(x):r(void 0,x,b)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),K3("runSync","run",r),s;function a(l,u){V3(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=Ch(n),s=this.compiler||this.Compiler;return U1("stringify",s),G3(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(H1("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...m]=h;d(p,m)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(h.plugins),h.settings&&(s.settings=D1(!0,s.settings,h.settings))}function u(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const m=h[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,p){let m=-1,b=-1;for(;++m<r.length;)if(r[m][0]===h){b=m;break}if(b===-1)r.push([h,...p]);else if(p.length>0){let[x,...E]=p;const N=r[b][1];tx(N)&&tx(x)&&(x=D1(!0,N,x)),r[b]=[h,x,...E]}}}}const Ote=new lv().freeze();function z1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function U1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function H1(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function G3(e){if(!tx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function K3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ch(e){return Mte(e)?e:new Ate(e)}function Mte(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Lte(e){return typeof e=="string"||Dte(e)}function Dte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function uv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Fo=uv();function F6(e){Fo=e}var oo={exec:()=>null};function Bt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(mr.caret,"$1"),n=n.replace(s,l),r},getRegex:()=>new RegExp(n,t)};return r}var jte=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),mr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Pte=/^(?:[ \t]*(?:\n|$))+/,Bte=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,zte=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Md=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ute=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,cv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,$6=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,V6=Bt($6).replace(/bull/g,cv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Hte=Bt($6).replace(/bull/g,cv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),dv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fte=/^[^\n]+/,fv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$te=Bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vte=Bt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,cv).getRegex(),vp="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",hv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,qte=Bt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",hv).replace("tag",vp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q6=Bt(dv).replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vp).getRegex(),Yte=Bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",q6).getRegex(),mv={blockquote:Yte,code:Bte,def:$te,fences:zte,heading:Ute,hr:Md,html:qte,lheading:V6,list:Vte,newline:Pte,paragraph:q6,table:oo,text:Fte},X3=Bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vp).getRegex(),Gte={...mv,lheading:Hte,table:X3,paragraph:Bt(dv).replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",X3).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vp).getRegex()},Kte={...mv,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",hv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:oo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(dv).replace("hr",Md).replace("heading",` *#{1,6} *[^
594
- ]`).replace("lheading",V6).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xte=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wte=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Y6=/^( {2,}|\\)\n(?!\s*$)/,Qte=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bu=/[\p{P}\p{S}]/u,Ep=/[\s\p{P}\p{S}]/u,pv=/[^\s\p{P}\p{S}]/u,Zte=Bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ep).getRegex(),G6=/(?!~)[\p{P}\p{S}]/u,Jte=/(?!~)[\s\p{P}\p{S}]/u,ene=/(?:[^\s\p{P}\p{S}]|~)/u,tne=Bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",jte?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),K6=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,nne=Bt(K6,"u").replace(/punct/g,bu).getRegex(),rne=Bt(K6,"u").replace(/punct/g,G6).getRegex(),X6="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",sne=Bt(X6,"gu").replace(/notPunctSpace/g,pv).replace(/punctSpace/g,Ep).replace(/punct/g,bu).getRegex(),ine=Bt(X6,"gu").replace(/notPunctSpace/g,ene).replace(/punctSpace/g,Jte).replace(/punct/g,G6).getRegex(),ane=Bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,pv).replace(/punctSpace/g,Ep).replace(/punct/g,bu).getRegex(),one=Bt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,bu).getRegex(),lne="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",une=Bt(lne,"gu").replace(/notPunctSpace/g,pv).replace(/punctSpace/g,Ep).replace(/punct/g,bu).getRegex(),cne=Bt(/\\(punct)/,"gu").replace(/punct/g,bu).getRegex(),dne=Bt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fne=Bt(hv).replace("(?:-->|$)","-->").getRegex(),hne=Bt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fne).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ym=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,mne=Bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ym).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),W6=Bt(/^!?\[(label)\]\[(ref)\]/).replace("label",ym).replace("ref",fv).getRegex(),Q6=Bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",fv).getRegex(),pne=Bt("reflink|nolink(?!\\()","g").replace("reflink",W6).replace("nolink",Q6).getRegex(),W3=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gv={_backpedal:oo,anyPunctuation:cne,autolink:dne,blockSkip:tne,br:Y6,code:Wte,del:oo,delLDelim:oo,delRDelim:oo,emStrongLDelim:nne,emStrongRDelimAst:sne,emStrongRDelimUnd:ane,escape:Xte,link:mne,nolink:Q6,punctuation:Zte,reflink:W6,reflinkSearch:pne,tag:hne,text:Qte,url:oo},gne={...gv,link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",ym).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ym).getRegex()},rx={...gv,emStrongRDelimAst:ine,emStrongLDelim:rne,delLDelim:one,delRDelim:une,url:Bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",W3).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Bt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",W3).getRegex()},bne={...rx,br:Bt(Y6).replace("{2,}","*").getRegex(),text:Bt(rx.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},wh={normal:mv,gfm:Gte,pedantic:Kte},Tc={normal:gv,gfm:rx,breaks:bne,pedantic:gne},xne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Q3=e=>xne[e];function Ps(e,t){if(t){if(mr.escapeTest.test(e))return e.replace(mr.escapeReplace,Q3)}else if(mr.escapeTestNoEncode.test(e))return e.replace(mr.escapeReplaceNoEncode,Q3);return e}function Z3(e){try{e=encodeURI(e).replace(mr.percentDecode,"%")}catch{return null}return e}function J3(e,t){let n=e.replace(mr.findPipe,(a,l,u)=>{let d=!1,h=l;for(;--h>=0&&u[h]==="\\";)d=!d;return d?"|":" |"}),r=n.split(mr.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(mr.slashPipe,"|");return r}function Sc(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function yne(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function vne(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let a=4-n%4;r+=" ".repeat(a),n+=a}else r+=s,n++;return r}function ek(e,t,n,r,s){let a=t.href,l=t.title||null,u=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:l,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Ene(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
595
- `).map(a=>{let l=a.match(n.other.beginningSpace);if(l===null)return a;let[u]=l;return u.length>=s.length?a.slice(s.length):a}).join(`
596
- `)}var vm=class{options;rules;lexer;constructor(e){this.options=e||Fo}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Sc(n,`
597
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Ene(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Sc(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Sc(t[0],`
598
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Sc(t[0],`
599
- `).split(`
600
- `),r="",s="",a=[];for(;n.length>0;){let l=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),l=!0;else if(!l)u.push(n[d]);else break;n=n.slice(d);let h=u.join(`
601
- `),p=h.replace(this.rules.other.blockquoteSetextReplace,`
602
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
603
- ${h}`:h,s=s?`${s}
604
- ${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=m,n.length===0)break;let b=a.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let x=b,E=x.raw+`
605
- `+n.join(`
606
- `),N=this.blockquote(E);a[a.length-1]=N,r=r.substring(0,r.length-x.raw.length)+N.raw,s=s.substring(0,s.length-x.text.length)+N.text;break}else if(b?.type==="list"){let x=b,E=x.raw+`
607
- `+n.join(`
608
- `),N=this.list(E);a[a.length-1]=N,r=r.substring(0,r.length-b.raw.length)+N.raw,s=s.substring(0,s.length-x.raw.length)+N.raw,n=E.substring(a.at(-1).raw.length).split(`
609
- `);continue}}return{type:"blockquote",raw:r,tokens:a,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),l=!1;for(;e;){let d=!1,h="",p="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;h=t[0],e=e.substring(h.length);let m=vne(t[2].split(`
610
- `,1)[0],t[1].length),b=e.split(`
611
- `,1)[0],x=!m.trim(),E=0;if(this.options.pedantic?(E=2,p=m.trimStart()):x?E=t[1].length+1:(E=m.search(this.rules.other.nonSpaceChar),E=E>4?1:E,p=m.slice(E),E+=t[1].length),x&&this.rules.other.blankLine.test(b)&&(h+=b+`
612
- `,e=e.substring(b.length+1),d=!0),!d){let N=this.rules.other.nextBulletRegex(E),C=this.rules.other.hrRegex(E),S=this.rules.other.fencesBeginRegex(E),k=this.rules.other.headingBeginRegex(E),A=this.rules.other.htmlBeginRegex(E),R=this.rules.other.blockquoteBeginRegex(E);for(;e;){let M=e.split(`
613
- `,1)[0],_;if(b=M,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),_=b):_=b.replace(this.rules.other.tabCharGlobal," "),S.test(b)||k.test(b)||A.test(b)||R.test(b)||N.test(b)||C.test(b))break;if(_.search(this.rules.other.nonSpaceChar)>=E||!b.trim())p+=`
614
- `+_.slice(E);else{if(x||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(m)||k.test(m)||C.test(m))break;p+=`
615
- `+b}x=!b.trim(),h+=M+`
616
- `,e=e.substring(M.length+1),m=_.slice(E)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),s.raw+=h}let u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let d of s.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),d.tokens[0]?.type==="text"||d.tokens[0]?.type==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let p={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=p.checked,s.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!s.loose){let h=d.tokens.filter(m=>m.type==="space"),p=h.length>0&&h.some(m=>this.rules.other.anyLine.test(m.raw));s.loose=p}}if(s.loose)for(let d of s.items){d.loose=!0;for(let h of d.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=J3(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
617
- `):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<n.length;l++)a.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:a.align[l]});for(let l of s)a.rows.push(J3(l,a.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[d]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
618
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Sc(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=yne(t[2],"()");if(a===-2)return;if(a>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],s=a[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),ek(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return ek(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,l,u=s,d=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+s);(r=h.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){d+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+d);let p=[...r[0]][0].length,m=e.slice(0,s+r.index+p+l);if(Math.min(s,l)%2){let x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}let b=m.slice(2,-2);return{type:"strong",raw:m,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,l,u=s,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(l=[...a].length,l!==s))continue;if(r[3]||r[4]){u+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u);let h=[...r[0]][0].length,p=e.slice(0,s+r.index+h+l),m=p.slice(s,-s);return{type:"del",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},os=class sx{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Fo,this.options.tokenizer=this.options.tokenizer||new vm,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:mr,block:wh.normal,inline:Tc.normal};this.options.pedantic?(n.block=wh.pedantic,n.inline=Tc.pedantic):this.options.gfm&&(n.block=wh.gfm,this.options.breaks?n.inline=Tc.breaks:n.inline=Tc.gfm),this.tokenizer.rules=n}static get rules(){return{block:wh,inline:Tc}}static lex(t,n){return new sx(n).lex(t)}static lexInline(t,n){return new sx(n).inlineTokens(t)}lex(t){t=t.replace(mr.carriageReturn,`
619
- `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(mr.tabCharGlobal," ").replace(mr.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(l=>(s=l.call({lexer:this},t,n))?(t=t.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let l=n.at(-1);s.raw.length===1&&l!==void 0?l.raw+=`
620
- `:n.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
621
- `)?"":`
622
- `)+s.raw,l.text+=`
623
- `+s.text,this.inlineQueue.at(-1).src=l.text):n.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
624
- `)?"":`
625
- `)+s.raw,l.text+=`
626
- `+s.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),n.push(s);continue}let a=t;if(this.options.extensions?.startBlock){let l=1/0,u=t.slice(1),d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},u),typeof d=="number"&&d>=0&&(l=Math.min(l,d))}),l<1/0&&l>=0&&(a=t.substring(0,l+1))}if(this.state.top&&(s=this.tokenizer.paragraph(a))){let l=n.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
627
- `)?"":`
628
- `)+s.raw,l.text+=`
629
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(s),r=a.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
630
- `)?"":`
631
- `)+s.raw,l.text+=`
632
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(s);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)a=s[2]?s[2].length:0,r=r.slice(0,s.index+a)+"["+"a".repeat(s[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let l=!1,u="";for(;t;){l||(u=""),l=!1;let d;if(this.options.extensions?.inline?.some(p=>(d=p.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let p=n.at(-1);d.type==="text"&&p?.type==="text"?(p.raw+=d.raw,p.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,u)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t,r,u)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let h=t;if(this.options.extensions?.startInline){let p=1/0,m=t.slice(1),b;this.options.extensions.startInline.forEach(x=>{b=x.call({lexer:this},m),typeof b=="number"&&b>=0&&(p=Math.min(p,b))}),p<1/0&&p>=0&&(h=t.substring(0,p+1))}if(d=this.tokenizer.inlineText(h)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(u=d.raw.slice(-1)),l=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=d.raw,p.text+=d.text):n.push(d);continue}if(t){let p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Em=class{options;parser;constructor(t){this.options=t||Fo}space(t){return""}code({text:t,lang:n,escaped:r}){let s=(n||"").match(mr.notSpaceStart)?.[0],a=t.replace(mr.endingNewline,"")+`
633
- `;return s?'<pre><code class="language-'+Ps(s)+'">'+(r?a:Ps(a,!0))+`</code></pre>
634
- `:"<pre><code>"+(r?a:Ps(a,!0))+`</code></pre>
635
- `}blockquote({tokens:t}){return`<blockquote>
636
- ${this.parser.parse(t)}</blockquote>
637
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
638
- `}hr(t){return`<hr>
639
- `}list(t){let n=t.ordered,r=t.start,s="";for(let u=0;u<t.items.length;u++){let d=t.items[u];s+=this.listitem(d)}let a=n?"ol":"ul",l=n&&r!==1?' start="'+r+'"':"";return"<"+a+l+`>
640
- `+s+"</"+a+`>
641
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
642
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
643
- `}table(t){let n="",r="";for(let a=0;a<t.header.length;a++)r+=this.tablecell(t.header[a]);n+=this.tablerow({text:r});let s="";for(let a=0;a<t.rows.length;a++){let l=t.rows[a];r="";for(let u=0;u<l.length;u++)r+=this.tablecell(l[u]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
644
- <thead>
645
- `+n+`</thead>
646
- `+s+`</table>
647
- `}tablerow({text:t}){return`<tr>
648
- ${t}</tr>
649
- `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
650
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ps(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let s=this.parser.parseInline(r),a=Z3(t);if(a===null)return s;t=a;let l='<a href="'+t+'"';return n&&(l+=' title="'+Ps(n)+'"'),l+=">"+s+"</a>",l}image({href:t,title:n,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let a=Z3(t);if(a===null)return Ps(r);t=a;let l=`<img src="${t}" alt="${Ps(r)}"`;return n&&(l+=` title="${Ps(n)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ps(t.text)}},bv=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},vs=class ix{options;renderer;textRenderer;constructor(t){this.options=t||Fo,this.options.renderer=this.options.renderer||new Em,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new bv}static parse(t,n){return new ix(n).parse(t)}static parseInline(t,n){return new ix(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let s=t[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=u||"";continue}}let a=s;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<t.length;s++){let a=t[s];if(this.options.extensions?.renderers?.[a.type]){let u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Dc=class{options;block;constructor(e){this.options=e||Fo}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?os.lex:os.lexInline}provideParser(e=this.block){return e?vs.parse:vs.parseInline}},Tne=class{defaults=uv();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=vs;Renderer=Em;TextRenderer=bv;Lexer=os;Tokenizer=vm;Hooks=Dc;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let s of t)switch(r=r.concat(n.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(let l of a.rows)for(let u of l)r=r.concat(this.walkTokens(u.tokens,n));break}case"list":{let a=s;r=r.concat(this.walkTokens(a.items,n));break}default:{let a=s;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let u=a[l].flat(1/0);r=r.concat(this.walkTokens(u,n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=n.renderers[a.name];l?n.renderers[a.name]=function(...u){let d=a.renderer.apply(this,u);return d===!1&&(d=l.apply(this,u)),d}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=n[a.level];l?l.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),s.extensions=n),r.renderer){let a=this.defaults.renderer||new Em(this.defaults);for(let l in r.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let u=l,d=r.renderer[u],h=a[u];a[u]=(...p)=>{let m=d.apply(a,p);return m===!1&&(m=h.apply(a,p)),m||""}}s.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new vm(this.defaults);for(let l in r.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let u=l,d=r.tokenizer[u],h=a[u];a[u]=(...p)=>{let m=d.apply(a,p);return m===!1&&(m=h.apply(a,p)),m}}s.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new Dc;for(let l in r.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let u=l,d=r.hooks[u],h=a[u];Dc.passThroughHooks.has(l)?a[u]=p=>{if(this.defaults.async&&Dc.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await d.call(a,p);return h.call(a,b)})();let m=d.call(a,p);return h.call(a,m)}:a[u]=(...p)=>{if(this.defaults.async)return(async()=>{let b=await d.apply(a,p);return b===!1&&(b=await h.apply(a,p)),b})();let m=d.apply(a,p);return m===!1&&(m=h.apply(a,p)),m}}s.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,l=r.walkTokens;s.walkTokens=function(u){let d=[];return d.push(l.call(this,u)),a&&(d=d.concat(a.call(this,u))),d}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return os.lex(t,n??this.defaults)}parser(t,n){return vs.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let s={...r},a={...this.defaults,...s},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let u=a.hooks?await a.hooks.preprocess(n):n,d=await(a.hooks?await a.hooks.provideLexer(t):t?os.lex:os.lexInline)(u,a),h=a.hooks?await a.hooks.processAllTokens(d):d;a.walkTokens&&await Promise.all(this.walkTokens(h,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?vs.parse:vs.parseInline)(h,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let u=(a.hooks?a.hooks.provideLexer(t):t?os.lex:os.lexInline)(n,a);a.hooks&&(u=a.hooks.processAllTokens(u)),a.walkTokens&&this.walkTokens(u,a.walkTokens);let d=(a.hooks?a.hooks.provideParser(t):t?vs.parse:vs.parseInline)(u,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(u){return l(u)}}}onError(t,n){return r=>{if(r.message+=`
651
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Ps(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}},Ro=new Tne;function Qt(e,t){return Ro.parse(e,t)}Qt.options=Qt.setOptions=function(e){return Ro.setOptions(e),Qt.defaults=Ro.defaults,F6(Qt.defaults),Qt};Qt.getDefaults=uv;Qt.defaults=Fo;Qt.use=function(...e){return Ro.use(...e),Qt.defaults=Ro.defaults,F6(Qt.defaults),Qt};Qt.walkTokens=function(e,t){return Ro.walkTokens(e,t)};Qt.parseInline=Ro.parseInline;Qt.Parser=vs;Qt.parser=vs.parse;Qt.Renderer=Em;Qt.TextRenderer=bv;Qt.Lexer=os;Qt.lexer=os.lex;Qt.Tokenizer=vm;Qt.Hooks=Dc;Qt.parse=Qt;Qt.options;Qt.setOptions;Qt.use;Qt.walkTokens;Qt.parseInline;vs.parse;os.lex;var Sne=300,Cne="300px",wne=500;function kne(e={}){let{immediate:t=!1,debounceDelay:n=Sne,rootMargin:r=Cne,idleTimeout:s=wne}=e,[a,l]=y.useState(!1),u=y.useRef(null),d=y.useRef(null),h=y.useRef(null),p=y.useMemo(()=>x=>{let E=Date.now();return window.setTimeout(()=>{x({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-E))})},1)},[]),m=y.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(x,E)=>window.requestIdleCallback(x,E):p,[p]),b=y.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?x=>window.cancelIdleCallback(x):x=>{clearTimeout(x)},[]);return y.useEffect(()=>{if(t){l(!0);return}let x=u.current;if(!x)return;d.current&&(clearTimeout(d.current),d.current=null),h.current&&(b(h.current),h.current=null);let E=()=>{d.current&&(clearTimeout(d.current),d.current=null),h.current&&(b(h.current),h.current=null)},N=A=>{h.current=m(R=>{R.timeRemaining()>0||R.didTimeout?(l(!0),A.disconnect()):h.current=m(()=>{l(!0),A.disconnect()},{timeout:s/2})},{timeout:s})},C=A=>{E(),d.current=window.setTimeout(()=>{var R,M;let _=A.takeRecords();(_.length===0||(M=(R=_.at(-1))==null?void 0:R.isIntersecting)!=null&&M)&&N(A)},n)},S=(A,R)=>{A.isIntersecting?C(R):E()},k=new IntersectionObserver(A=>{for(let R of A)S(R,k)},{rootMargin:r,threshold:0});return k.observe(x),()=>{d.current&&clearTimeout(d.current),h.current&&b(h.current),k.disconnect()}},[t,n,r,s,b,m]),{shouldRender:a,containerRef:u}}var Z6=/\s/,Nne=/^\s+$/,Ane=new Set(["code","pre","svg","math","annotation"]),_ne=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",Rne=e=>e.some(t=>_ne(t)&&Ane.has(t.tagName)),Ine=e=>{let t=[],n="",r=!1;for(let s of e){let a=Z6.test(s);a!==r&&n&&(t.push(n),n=""),n+=s,r=a}return n&&t.push(n),t},One=e=>{let t=[],n="";for(let r of e)Z6.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},Mne=(e,t,n,r,s,a)=>{let l=`--sd-animation:sd-${t};--sd-duration:${s?0:n}ms;--sd-easing:${r}`;return a&&(l+=`;--sd-delay:${a}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:l},children:[{type:"text",value:e}]}},Lne=(e,t,n,r,s)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(Rne(t))return Pl;let l=a,u=l.children.indexOf(e);if(u===-1)return;let d=e.value;if(!d.trim()){s.count+=d.length;return}let h=n.sep==="char"?One(d):Ine(d),p=r.prevContentLength,m=h.map(b=>{let x=s.count;if(s.count+=b.length,Nne.test(b))return{type:"text",value:b};let E=p>0&&x<p,N=E?0:s.newIndex++*n.stagger;return Mne(b,n.animation,n.duration,n.easing,E,N)});return l.children.splice(u,1,...m),u+m.length},Dne=0;function ax(e){var t,n,r,s,a;let l={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(s=e?.sep)!=null?s:"word",stagger:(a=e?.stagger)!=null?a:40},u={prevContentLength:0,lastRenderCharCount:0},d=Dne++,h=()=>p=>{let m={count:0,newIndex:0};zy(p,"text",(b,x)=>Lne(b,x,l,u,m)),u.lastRenderCharCount=m.count,u.prevContentLength=0};return Object.defineProperty(h,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:h,setPrevContentLength(p){u.prevContentLength=p},getLastRenderCharCount(){let p=u.lastRenderCharCount;return u.lastRenderCharCount=0,p}}}ax();var J6=y.createContext(!1),jne=()=>y.useContext(J6),xv=(...e)=>GN(Lm(e)),Pne=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},Bne=e=>e?(...t)=>Pne(e,GN(Lm(t))):xv,Vl=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",s=typeof t=="string"?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(s),l=document.createElement("a");l.href=a,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)},ox=y.createContext(xv),wt=()=>y.useContext(ox),zne=xv("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),Une=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let s=n.slice(0,r).trim(),a=n.slice(r+1).trim();s&&a&&(t[s]=a)}}return t},Hne=y.memo(({children:e,result:t,language:n,className:r,startLine:s,lineNumbers:a=!0,...l})=>{let u=wt(),d=y.useMemo(()=>u(zne),[u]),h=y.useMemo(()=>{let p={};return t.bg&&(p["--sdm-bg"]=t.bg),t.fg&&(p["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(p,Une(t.rootStyle)),p},[t.bg,t.fg,t.rootStyle]);return f.jsx("div",{className:u(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...l,children:f.jsx("pre",{className:u(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:h,children:f.jsx("code",{className:a?u("[counter-increment:line_0] [counter-reset:line]"):void 0,style:a&&s&&s>1?{counterReset:`line ${s-1}`}:void 0,children:t.tokens.map((p,m)=>f.jsx("span",{className:a?d:void 0,children:p.length===0||p.length===1&&p[0].content===""?`
652
- `:p.map((b,x)=>{let E={},N=!!b.bgColor;if(b.color&&(E["--sdm-c"]=b.color),b.bgColor&&(E["--sdm-tbg"]=b.bgColor),b.htmlStyle)for(let[C,S]of Object.entries(b.htmlStyle))C==="color"?E["--sdm-c"]=S:C==="background-color"?(E["--sdm-tbg"]=S,N=!0):E[C]=S;return f.jsx("span",{className:u("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",N&&"bg-[var(--sdm-tbg)]",N&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:E,...b.htmlAttrs,children:b.content},x)})},m))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Fne=({className:e,language:t,style:n,isIncomplete:r,...s})=>{let a=wt();return f.jsx("div",{className:a("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...s})},e5=y.createContext({code:""}),t5=()=>y.useContext(e5),$ne=({language:e})=>{let t=wt();return f.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:f.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},Vne=e=>{let t=e.length;for(;t>0&&e[t-1]===`
653
- `;)t--;return e.slice(0,t)},qne=y.lazy(()=>eu(()=>import("./highlighted-body-OFNGDK62-CYqINlGG.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),Yne=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,startLine:a,lineNumbers:l,...u})=>{let d=wt(),h=y.useMemo(()=>Vne(e),[e]),p=y.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:h.split(`
654
- `).map(m=>[{content:m,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[h]);return f.jsx(e5.Provider,{value:{code:e},children:f.jsxs(Fne,{isIncomplete:s,language:t,children:[f.jsx($ne,{language:t}),r?f.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsx("div",{className:d("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,f.jsx(y.Suspense,{fallback:f.jsx(Hne,{className:n,language:t,lineNumbers:l,result:p,startLine:a,...u}),children:f.jsx(qne,{className:n,code:h,language:t,lineNumbers:l,raw:p,startLine:a,...u})})]})})},Gne=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),Kne=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),Xne=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),Wne=e=>f.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Qne=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),Zne=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),Jne=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),ere=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),tre=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),nre=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),jc={CheckIcon:Gne,CopyIcon:Kne,DownloadIcon:Xne,ExternalLinkIcon:ere,Loader2Icon:Wne,Maximize2Icon:Qne,RotateCcwIcon:Zne,XIcon:Jne,ZoomInIcon:tre,ZoomOutIcon:nre},n5=y.createContext(jc),rre=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>e[s]===t[s])},tk=({icons:e,children:t})=>{let n=y.useRef(e),r=y.useRef(e?{...jc,...e}:jc);rre(n.current,e)||(n.current=e,r.current=e?{...jc,...e}:jc);let s=r.current;return f.jsx(n5.Provider,{value:s,children:t})},_s=()=>y.useContext(n5),r5={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},lx=y.createContext(r5),ji=()=>y.useContext(lx),nk=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:a,...l})=>{let u=wt(),[d,h]=y.useState(!1),p=y.useRef(0),{code:m}=t5(),{isAnimating:b}=y.useContext(Yr),x=ji(),E=a??m,N=async()=>{var k;if(typeof window>"u"||!((k=navigator?.clipboard)!=null&&k.writeText)){t?.(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(E),h(!0),e?.(),p.current=window.setTimeout(()=>h(!1),n))}catch(A){t?.(A)}};y.useEffect(()=>()=>{window.clearTimeout(p.current)},[]);let C=_s(),S=d?C.CheckIcon:C.CopyIcon;return f.jsx("button",{className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-copy-button",disabled:b,onClick:N,title:x.copyCode,type:"button",...l,children:r??f.jsx(S,{size:14})})},rk={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},sre=({onDownload:e,onError:t,language:n,children:r,className:s,code:a,...l})=>{let u=wt(),{code:d}=t5(),{isAnimating:h}=y.useContext(Yr),p=ji(),m=_s(),b=a??d,x=`file.${n&&n in rk?rk[n]:"txt"}`,E="text/plain",N=()=>{try{Vl(x,b,E),e?.()}catch(C){t?.(C)}};return f.jsx("button",{className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-download-button",disabled:h,onClick:N,title:p.downloadFile,type:"button",...l,children:r??f.jsx(m.DownloadIcon,{size:14})})},sk=()=>{let{Loader2Icon:e}=_s(),t=wt();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},ire=/\.[^/.]+$/,are=({node:e,className:t,src:n,alt:r,onLoad:s,onError:a,...l})=>{let{DownloadIcon:u}=_s(),d=wt(),h=y.useRef(null),[p,m]=y.useState(!1),[b,x]=y.useState(!1),E=ji(),N=l.width!=null||l.height!=null,C=(p||N)&&!b,S=b&&!N;y.useEffect(()=>{let M=h.current;if(M!=null&&M.complete){let _=M.naturalWidth>0;m(_),x(!_)}},[]);let k=y.useCallback(M=>{m(!0),x(!1),s?.(M)},[s]),A=y.useCallback(M=>{m(!1),x(!0),a?.(M)},[a]),R=async()=>{if(n)try{let M=await(await fetch(n)).blob(),_=new URL(n,window.location.origin).pathname.split("/").pop()||"",O=_.split(".").pop(),j=_.includes(".")&&O!==void 0&&O.length<=4,H="";if(j)H=_;else{let B=M.type,K="png";B.includes("jpeg")||B.includes("jpg")?K="jpg":B.includes("png")?K="png":B.includes("svg")?K="svg":B.includes("gif")?K="gif":B.includes("webp")&&(K="webp"),H=`${(r||_||"image").replace(ire,"")}.${K}`}Vl(H,M,M.type)}catch{window.open(n,"_blank")}};return n?f.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:A,onLoad:k,ref:h,src:n,...l}),S&&f.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:E.imageNotAvailable}),f.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),C&&f.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:R,title:E.downloadImage,type:"button",children:f.jsx(u,{size:14})})]}):null},Xc=0,yv=()=>{Xc+=1,Xc===1&&(document.body.style.overflow="hidden")},vv=()=>{Xc=Math.max(0,Xc-1),Xc===0&&(document.body.style.overflow="")},ore=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:s,CopyIcon:a,ExternalLinkIcon:l,XIcon:u}=_s(),d=wt(),[h,p]=y.useState(!1),m=ji(),b=y.useCallback(async()=>{try{await navigator.clipboard.writeText(e),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},[e]),x=y.useCallback(()=>{r(),n()},[r,n]);return y.useEffect(()=>{if(t){yv();let E=N=>{N.key==="Escape"&&n()};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),vv()}}},[t,n]),t?f.jsx("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:E=>{E.key==="Escape"&&n()},role:"button",tabIndex:0,children:f.jsxs("div",{className:d("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[f.jsx("button",{className:d("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:m.close,type:"button",children:f.jsx(u,{size:16})}),f.jsxs("div",{className:d("flex flex-col gap-2"),children:[f.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(l,{size:20}),f.jsx("span",{children:m.openExternalLink})]}),f.jsx("p",{className:d("text-muted-foreground text-sm"),children:m.externalLinkWarning})]}),f.jsx("div",{className:d("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),f.jsxs("div",{className:d("flex gap-2"),children:[f.jsx("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:b,type:"button",children:h?f.jsxs(f.Fragment,{children:[f.jsx(s,{size:14}),f.jsx("span",{children:m.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(a,{size:14}),f.jsx("span",{children:m.copyLink})]})}),f.jsxs("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:x,type:"button",children:[f.jsx(l,{size:14}),f.jsx("span",{children:m.openLink})]})]})]})}):null},ux=y.createContext(null),Ev=()=>y.useContext(ux),Moe=()=>{var e;let t=Ev();return(e=t?.code)!=null?e:null},Tv=()=>{var e;let t=Ev();return(e=t?.mermaid)!=null?e:null},lre=e=>{var t;let n=Ev();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},ure=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((s,a)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),u=new Image;u.crossOrigin="anonymous",u.onload=()=>{let d=document.createElement("canvas"),h=u.width*r,p=u.height*r;d.width=h,d.height=p;let m=d.getContext("2d");if(!m){a(new Error("Failed to create 2D canvas context for PNG export"));return}m.drawImage(u,0,0,h,p),d.toBlob(b=>{if(!b){a(new Error("Failed to create PNG blob"));return}s(b)},"image/png")},u.onerror=()=>a(new Error("Failed to load SVG image")),u.src=l})},cre=({chart:e,children:t,className:n,onDownload:r,config:s,onError:a})=>{let l=wt(),[u,d]=y.useState(!1),h=y.useRef(null),{isAnimating:p}=y.useContext(Yr),m=_s(),b=Tv(),x=ji(),E=async N=>{try{if(N==="mmd"){Vl("diagram.mmd",e,"text/plain"),d(!1),r?.(N);return}if(!b){a?.(new Error("Mermaid plugin not available"));return}let C=b.getMermaid(s),S=e.split("").reduce((R,M)=>(R<<5)-R+M.charCodeAt(0)|0,0),k=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:A}=await C.render(k,e);if(!A){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(N==="svg"){Vl("diagram.svg",A,"image/svg+xml"),d(!1),r?.(N);return}if(N==="png"){let R=await ure(A);Vl("diagram.png",R,"image/png"),r?.(N),d(!1);return}}catch(C){a?.(C)}};return y.useEffect(()=>{let N=C=>{let S=C.composedPath();h.current&&!S.includes(h.current)&&d(!1)};return document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[]),f.jsxs("div",{className:l("relative"),ref:h,children:[f.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:p,onClick:()=>d(!u),title:x.downloadDiagram,type:"button",children:t??f.jsx(m.DownloadIcon,{size:14})}),u?f.jsxs("div",{className:l("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("svg"),title:x.downloadDiagramAsSvg,type:"button",children:x.mermaidFormatSvg}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("png"),title:x.downloadDiagramAsPng,type:"button",children:x.mermaidFormatPng}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("mmd"),title:x.downloadDiagramAsMmd,type:"button",children:x.mermaidFormatMmd})]}):null]})},dre=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...a})=>{let{Maximize2Icon:l,XIcon:u}=_s(),d=wt(),[h,p]=y.useState(!1),{isAnimating:m,controls:b}=y.useContext(Yr),x=ji(),E=(()=>{if(typeof b=="boolean")return b;let C=b.mermaid;return C===!1?!1:C===!0||C===void 0?!0:C.panZoom!==!1})(),N=()=>{p(!h)};return y.useEffect(()=>{if(h){yv();let C=S=>{S.key==="Escape"&&p(!1)};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C),vv()}}},[h]),y.useEffect(()=>{h?n?.():r&&r()},[h,n,r]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),disabled:m,onClick:N,title:x.viewFullscreen,type:"button",...a,children:f.jsx(l,{size:14})}),h?or.createPortal(f.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:N,onKeyDown:C=>{C.key==="Escape"&&N()},role:"button",tabIndex:0,children:[f.jsx("button",{className:d("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:N,title:x.exitFullscreen,type:"button",children:f.jsx(u,{size:20})}),f.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),role:"presentation",children:f.jsx(B5,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:E})})]}),document.body):null]})},s5=e=>{var t,n;let r=[],s=[],a=e.querySelectorAll("thead th");for(let u of a)r.push(((t=u.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let u of l){let d=[],h=u.querySelectorAll("td");for(let p of h)d.push(((n=p.textContent)==null?void 0:n.trim())||"");s.push(d)}return{headers:r,rows:s}},i5=e=>{let{headers:t,rows:n}=e,r=u=>{let d=!1,h=!1;for(let p of u){if(p==='"'){d=!0,h=!0;break}(p===","||p===`
655
- `)&&(d=!0)}return d?h?`"${u.replace(/"/g,'""')}"`:`"${u}"`:u},s=t.length>0?n.length+1:n.length,a=new Array(s),l=0;t.length>0&&(a[l]=t.map(r).join(","),l+=1);for(let u of n)a[l]=u.map(r).join(","),l+=1;return a.join(`
656
- `)},fre=e=>{let{headers:t,rows:n}=e,r=u=>{let d=!1;for(let p of u)if(p===" "||p===`
657
- `||p==="\r"){d=!0;break}if(!d)return u;let h=[];for(let p of u)p===" "?h.push("\\t"):p===`
658
- `?h.push("\\n"):p==="\r"?h.push("\\r"):h.push(p);return h.join("")},s=t.length>0?n.length+1:n.length,a=new Array(s),l=0;t.length>0&&(a[l]=t.map(r).join(" "),l+=1);for(let u of n)a[l]=u.map(r).join(" "),l+=1;return a.join(`
659
- `)},F1=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},cx=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),s=0,a=t.map(u=>F1(u));r[s]=`| ${a.join(" | ")} |`,s+=1;let l=new Array(t.length);for(let u=0;u<t.length;u+=1)l[u]="---";r[s]=`| ${l.join(" | ")} |`,s+=1;for(let u of n)if(u.length<t.length){let d=new Array(t.length);for(let h=0;h<t.length;h+=1)d[h]=h<u.length?F1(u[h]):"";r[s]=`| ${d.join(" | ")} |`,s+=1}else{let d=u.map(h=>F1(h));r[s]=`| ${d.join(" | ")} |`,s+=1}return r.join(`
660
- `)},a5=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let a=wt(),[l,u]=y.useState(!1),[d,h]=y.useState(!1),p=y.useRef(null),m=y.useRef(0),{isAnimating:b}=y.useContext(Yr),x=ji(),E=async S=>{var k,A;if(typeof window>"u"||!((k=navigator?.clipboard)!=null&&k.write)){r?.(new Error("Clipboard API not available"));return}try{let R=(A=p.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),M=R?.querySelector("table");if(!M){r?.(new Error("Table not found"));return}let _=s5(M),O=({csv:i5,tsv:fre,md:cx}[S]||cx)(_),j=new ClipboardItem({"text/plain":new Blob([O],{type:"text/plain"}),"text/html":new Blob([M.outerHTML],{type:"text/html"})});await navigator.clipboard.write([j]),h(!0),u(!1),n?.(S),m.current=window.setTimeout(()=>h(!1),s)}catch(R){r?.(R)}};y.useEffect(()=>{let S=k=>{let A=k.composedPath();p.current&&!A.includes(p.current)&&u(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(m.current)}},[]);let N=_s(),C=d?N.CheckIcon:N.CopyIcon;return f.jsxs("div",{className:a("relative"),ref:p,children:[f.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:b,onClick:()=>u(!l),title:x.copyTable,type:"button",children:e??f.jsx(C,{height:14,width:14})}),l?f.jsxs("div",{className:a("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("md"),title:x.copyTableAsMarkdown,type:"button",children:x.tableFormatMarkdown}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("csv"),title:x.copyTableAsCsv,type:"button",children:x.tableFormatCsv}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("tsv"),title:x.copyTableAsTsv,type:"button",children:x.tableFormatTsv})]}):null]})},o5=({children:e,className:t,onDownload:n,onError:r})=>{let s=wt(),[a,l]=y.useState(!1),u=y.useRef(null),{isAnimating:d}=y.useContext(Yr),h=ji(),p=_s(),m=b=>{var x;try{let E=(x=u.current)==null?void 0:x.closest('[data-streamdown="table-wrapper"]'),N=E?.querySelector("table");if(!N){r?.(new Error("Table not found"));return}let C=s5(N),S=b==="csv"?i5(C):cx(C);Vl(`table.${b==="csv"?"csv":"md"}`,S,b==="csv"?"text/csv":"text/markdown"),l(!1),n?.(b)}catch(E){r?.(E)}};return y.useEffect(()=>{let b=x=>{let E=x.composedPath();u.current&&!E.includes(u.current)&&l(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]),f.jsxs("div",{className:s("relative"),ref:u,children:[f.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>l(!a),title:h.downloadTable,type:"button",children:e??f.jsx(p.DownloadIcon,{size:14})}),a?f.jsxs("div",{className:s("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("csv"),title:h.downloadTableAsCsv,type:"button",children:h.tableFormatCsv}),f.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("markdown"),title:h.downloadTableAsMarkdown,type:"button",children:h.tableFormatMarkdown})]}):null]})},hre=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:s,XIcon:a}=_s(),l=wt(),[u,d]=y.useState(!1),{isAnimating:h}=y.useContext(Yr),p=ji(),m=()=>{d(!0)},b=()=>{d(!1)};return y.useEffect(()=>{if(u){yv();let x=E=>{E.key==="Escape"&&d(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),vv()}}},[u]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:m,title:p.viewFullscreen,type:"button",children:f.jsx(s,{size:14})}),u?or.createPortal(f.jsx("div",{"aria-label":p.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:b,onKeyDown:x=>{x.key==="Escape"&&b()},role:"dialog",children:f.jsxs("div",{className:l("flex h-full flex-col"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:l("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(a5,{}):null,r?f.jsx(o5,{}):null,f.jsx("button",{className:l("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:b,title:p.exitFullscreen,type:"button",children:f.jsx(a,{size:20})})]}),f.jsx("div",{className:l("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:l("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},mre=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:s=!0,showFullscreen:a=!0,...l})=>{let u=wt(),d=n&&r,h=n&&s,p=n&&a,m=d||h||p;return f.jsxs("div",{className:u("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[m?f.jsxs("div",{className:u("flex items-center justify-end gap-1"),children:[d?f.jsx(a5,{}):null,h?f.jsx(o5,{}):null,p?f.jsx(hre,{showCopy:d,showDownload:h,children:e}):null]}):null,f.jsx("div",{className:u("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:f.jsx("table",{className:u("w-full divide-y divide-border",t),"data-streamdown":"table",...l,children:e})})]})},pre=/startLine=(\d+)/,gre=/\bnoLineNumbers\b/,bre=y.lazy(()=>eu(()=>Promise.resolve().then(()=>Roe),void 0).then(e=>({default:e.Mermaid}))),xre=/language-([^\s]+)/;function Tp(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,s=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&s?.line===a?.line&&s?.column===a?.column}function Sn(e,t){return e.className===t.className&&Tp(e.node,t.node)}var dx=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,$1=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},ik=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},kh=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Sv=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("ol",{className:s("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Sn(e,t));Sv.displayName="MarkdownOl";var l5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&Tp(e.node,t.node));l5.displayName="MarkdownLi";var u5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("ul",{className:s("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Sn(e,t));u5.displayName="MarkdownUl";var c5=y.memo(({className:e,node:t,...n})=>{let r=wt();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Sn(e,t));c5.displayName="MarkdownHr";var d5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("span",{className:s("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Sn(e,t));d5.displayName="MarkdownStrong";var yre=({children:e,className:t,href:n,node:r,...s})=>{let a=wt(),{linkSafety:l}=y.useContext(Yr),[u,d]=y.useState(!1),h=n==="streamdown:incomplete-link",p=y.useCallback(async E=>{if(!(!(l!=null&&l.enabled&&n)||h)){if(E.preventDefault(),l.onLinkCheck&&await l.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[l,n,h]),m=y.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),b=y.useCallback(()=>{d(!1)},[]),x={url:n??"",isOpen:u,onClose:b,onConfirm:m};return l!=null&&l.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",onClick:p,type:"button",children:e}),l.renderModal?l.renderModal(x):f.jsx(ore,{...x})]}):f.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...s,children:e})},f5=y.memo(yre,(e,t)=>Sn(e,t)&&e.href===t.href);f5.displayName="MarkdownA";var h5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h1",{className:s("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Sn(e,t));h5.displayName="MarkdownH1";var m5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h2",{className:s("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Sn(e,t));m5.displayName="MarkdownH2";var p5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h3",{className:s("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Sn(e,t));p5.displayName="MarkdownH3";var g5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h4",{className:s("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Sn(e,t));g5.displayName="MarkdownH4";var b5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h5",{className:s("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Sn(e,t));b5.displayName="MarkdownH5";var x5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h6",{className:s("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Sn(e,t));x5.displayName="MarkdownH6";var y5=y.memo(({children:e,className:t,node:n,...r})=>{let{controls:s}=y.useContext(Yr),a=dx(s,"table"),l=$1(s,"copy"),u=$1(s,"download"),d=$1(s,"fullscreen");return f.jsx(mre,{className:t,showControls:a,showCopy:l,showDownload:u,showFullscreen:d,...r,children:e})},(e,t)=>Sn(e,t));y5.displayName="MarkdownTable";var v5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("thead",{className:s("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Sn(e,t));v5.displayName="MarkdownThead";var E5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("tbody",{className:s("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Sn(e,t));E5.displayName="MarkdownTbody";var T5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("tr",{className:s("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Sn(e,t));T5.displayName="MarkdownTr";var S5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("th",{className:s("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>Sn(e,t));S5.displayName="MarkdownTh";var C5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("td",{className:s("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Sn(e,t));C5.displayName="MarkdownTd";var w5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("blockquote",{className:s("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>Sn(e,t));w5.displayName="MarkdownBlockquote";var k5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("sup",{className:s("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Sn(e,t));k5.displayName="MarkdownSup";var N5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("sub",{className:s("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Sn(e,t));N5.displayName="MarkdownSub";var A5=y.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let s=l=>{var u,d;if(!y.isValidElement(l))return!1;let h=Array.isArray(l.props.children)?l.props.children:[l.props.children],p=!1,m=!1;for(let b of h)if(b){if(typeof b=="string")b.trim()!==""&&(p=!0);else if(y.isValidElement(b))if(((u=b.props)==null?void 0:u["data-footnote-backref"])!==void 0)m=!0;else{let x=Array.isArray(b.props.children)?b.props.children:[b.props.children];for(let E of x){if(typeof E=="string"&&E.trim()!==""){p=!0;break}if(y.isValidElement(E)&&((d=E.props)==null?void 0:d["data-footnote-backref"])===void 0){p=!0;break}}}}return m&&!p},a=Array.isArray(e)?e.map(l=>{if(!y.isValidElement(l))return l;if(l.type===Sv){let u=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(d=>!s(d));return u.length===0?null:{...l,props:{...l.props,children:u}}}return l}):e;return(Array.isArray(a)?a.some(l=>l!==null):a!==null)?f.jsx("section",{className:t,...r,children:a}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>Sn(e,t));A5.displayName="MarkdownSection";var vre=({node:e,className:t,children:n,...r})=>{var s,a;let l=wt(),u=!("data-block"in r),{mermaid:d,controls:h,lineNumbers:p}=y.useContext(Yr),m=Tv(),b=jne(),x=t?.match(xre),E=(s=x?.at(1))!=null?s:"",N=lre(E);if(u)return f.jsx("code",{className:l("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let C=(a=e?.properties)==null?void 0:a.metastring,S=C?.match(pre),k=S?Number.parseInt(S[1],10):void 0,A=k!==void 0&&k>=1?k:void 0,R=!(C&&gre.test(C))&&p!==!1,M="";if(y.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?M=n.props.children:typeof n=="string"&&(M=n),N){let H=N.component;return f.jsx(y.Suspense,{fallback:f.jsx(sk,{}),children:f.jsx(H,{code:M,isIncomplete:b,language:E,meta:C})})}if(E==="mermaid"&&m){let H=dx(h,"mermaid"),B=kh(h,"download"),K=kh(h,"copy"),X=kh(h,"fullscreen"),Z=kh(h,"panZoom"),te=H&&(B||K||X);return f.jsx(y.Suspense,{fallback:f.jsx(sk,{}),children:f.jsxs("div",{className:l("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[f.jsx("div",{className:l("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:l("ml-1 font-mono lowercase"),children:"mermaid"})}),te?f.jsx("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsxs("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[B?f.jsx(cre,{chart:M,config:d?.config}):null,K?f.jsx(nk,{code:M}):null,X?f.jsx(dre,{chart:M,config:d?.config}):null]})}):null,f.jsx("div",{className:l("rounded-md border border-border bg-background"),children:f.jsx(bre,{chart:M,config:d?.config,showControls:Z})})]})})}let _=dx(h,"code"),O=ik(h,"download"),j=ik(h,"copy");return f.jsx(Yne,{className:t,code:M,isIncomplete:b,language:E,lineNumbers:R,startLine:A,children:_?f.jsxs(f.Fragment,{children:[O?f.jsx(sre,{code:M,language:E}):null,j?f.jsx(nk,{}):null]}):null})},_5=y.memo(vre,(e,t)=>e.className===t.className&&Tp(e.node,t.node));_5.displayName="MarkdownCode";var R5=y.memo(are,(e,t)=>e.className===t.className&&Tp(e.node,t.node));R5.displayName="MarkdownImg";var I5=y.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(r.length===1&&y.isValidElement(r[0])){let s=r[0].props.node,a=s?.tagName;if(a==="img")return f.jsx(f.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>Sn(e,t));I5.displayName="MarkdownParagraph";var Ere={ol:Sv,li:l5,ul:u5,hr:c5,strong:d5,a:f5,h1:h5,h2:m5,h3:p5,h4:g5,h5:b5,h6:x5,table:y5,thead:v5,tbody:E5,tr:T5,th:S5,td:C5,blockquote:w5,code:_5,img:R5,pre:({children:e})=>y.isValidElement(e)?y.cloneElement(e,{"data-block":"true"}):e,sup:k5,sub:N5,p:I5,section:A5},Tre=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Sre=/\p{L}/u;function ak(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(Tre.test(n))return"rtl";if(Sre.test(n))return"ltr"}return"ltr"}var Cre=/^[ \t]{0,3}(`{3,}|~{3,})/,wre=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,ok=e=>{let t=e.split(`
661
- `),n=null,r=0;for(let s of t){let a=Cre.exec(s);if(n===null){if(a){let l=a[1];n=l[0],r=l.length}}else if(a){let l=a[1],u=l[0],d=l.length;u===n&&d>=r&&(n=null,r=0)}}return n!==null},kre=e=>{let t=e.split(`
662
- `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&wre.test(r))return!0}return!1},Nre=()=>e=>{qs(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},lk=[],uk={allowDangerousHtml:!0},Nh=new WeakMap,Are=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,s=e.remarkRehypeOptions;if(!(n||r||s)){let p="default";return this.keyCache.set(e,p),p}let a=p=>{if(!p||p.length===0)return"";let m="";for(let b=0;b<p.length;b+=1){let x=p[b];if(b>0&&(m+=","),Array.isArray(x)){let[E,N]=x;if(typeof E=="function"){let C=Nh.get(E);C||(C=E.name,Nh.set(E,C)),m+=C}else m+=String(E);m+=":",m+=JSON.stringify(N)}else if(typeof x=="function"){let E=Nh.get(x);E||(E=x.name,Nh.set(x,E)),m+=E}else m+=String(x)}return m},l=a(n),u=a(r),d=s?JSON.stringify(s):"",h=`${u}::${l}::${d}`;return this.keyCache.set(e,h),h}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},ck=new Are,O5=e=>{let t=_re(e),n=e.children||"",r=t.runSync(t.parse(n),n);return jre(r,e)},_re=e=>{let t=ck.get(e);if(t)return t;let n=Ire(e);return ck.set(e,n),n},Rre=e=>e.some(t=>Array.isArray(t)?t[0]===Xb:t===Xb),Ire=e=>{let t=e.rehypePlugins||lk,n=e.remarkPlugins||lk,r=Rre(t)?n:[...n,Nre],s=e.remarkRehypeOptions?{...uk,...e.remarkRehypeOptions}:uk;return Ote().use(Iee).use(r).use(hte,s).use(t)},Ore=e=>e,Mre=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},Lre=(e,t)=>{var n;for(let r in M1)if(Object.hasOwn(M1,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],a=M1[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(s||""),r,e))!=null?n:void 0)}},Dre=(e,t,n,r,s,a)=>{let l=!1;return r?l=!r.includes(e.tagName):s&&(l=s.includes(e.tagName)),!l&&a&&typeof t=="number"&&(l=!a(e,t,n)),l},jre=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:s,skipHtml:a,unwrapDisallowed:l,urlTransform:u}=t;if(n||r||s||a||u){let d=u||Ore;qs(e,(h,p,m)=>{if(h.type==="raw"&&m&&typeof p=="number")return Mre(m,p,a,h.value),p;if(h.type==="element"&&(Lre(h,d),Dre(h,p,m,r,s,n)&&m&&typeof p=="number"))return l&&h.children?m.children.splice(p,1,...h.children):m.children.splice(p,1),p})}return zJ(e,{Fragment:f.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0})},Pre=/\[\^[\w-]{1,200}\](?!:)/,Bre=/\[\^[\w-]{1,200}\]:/,zre=/<(\w+)[\s>]/,Ure=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),dk=new Map,fk=new Map,Hre=e=>{let t=e.toLowerCase(),n=dk.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return dk.set(t,r),r},Fre=e=>{let t=e.toLowerCase(),n=fk.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return fk.set(t,r),r},hk=(e,t)=>{if(Ure.has(t.toLowerCase()))return 0;let n=e.match(Hre(t));if(!n)return 0;let r=0;for(let s of n)s.trimEnd().endsWith("/>")||(r+=1);return r},mk=(e,t)=>{let n=e.match(Fre(t));return n?n.length:0},$re=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},Vre=e=>{let t=Pre.test(e),n=Bre.test(e);if(t||n)return[e];let r=os.lex(e,{gfm:!0}),s=[],a=[],l=!1;for(let u of r){let d=u.raw,h=s.length;if(a.length>0){s[h-1]+=d;let p=a.at(-1),m=hk(d,p),b=mk(d,p);for(let x=0;x<m;x+=1)a.push(p);for(let x=0;x<b;x+=1)a.length>0&&a.at(-1)===p&&a.pop();continue}if(u.type==="html"&&u.block){let p=d.match(zre);if(p){let m=p[1],b=hk(d,m),x=mk(d,m);b>x&&a.push(m)}}if(h>0&&!l){let p=s[h-1];if($re(p)%2===1){s[h-1]=p+d;continue}}s.push(d),u.type!=="space"&&(l=u.type==="code")}return s},qre=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(a,l,u,d)=>{if(!u.includes(`
663
-
664
- `))return l+u+d;let h=u.replace(/\n\n/g,`
665
- <!---->
666
- `),p=(h.startsWith(`
667
- `)?"":`
668
- `)+h+(h.endsWith(`
669
- `)?"":`
670
- `);return`${l}${p}${d}
671
-
672
- `})}return n},Yre=/([\\`*_~[\]|])/g,Gre=e=>e.replace(Yre,"\\$1"),Kre=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(a,l,u,d)=>{let h=Gre(u).replace(/\n\n/g,"&#10;&#10;");return l+h+d})}return n},M5=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(M5).join(""):"",Xre=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));qs(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let s=M5(r);r.children=s?[{type:"text",value:s}]:[]}})},Wre=()=>e=>{qs(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},Qre=/^[ \t]*<[\w!/?-]/,Zre=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,Jre=e=>typeof e!="string"||e.length===0||!Qre.test(e)?e:e.replace(Zre,"$1"),pk,gk,bk,xk,Vh={...ao,protocols:{...ao.protocols,href:[...(gk=(pk=ao.protocols)==null?void 0:pk.href)!=null?gk:[],"tel"]},attributes:{...ao.attributes,code:[...(xk=(bk=ao.attributes)==null?void 0:bk.code)!=null?xk:[],"metastring"]}},fx={raw:Xb,sanitize:[$4,Vh],harden:[KV,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},ese={gfm:[fZ,{}],codeMeta:Wre},yk=Object.values(fx),tse=Object.values(ese),nse={block:" ▋",circle:" ●"},L5=["github-light","github-dark"],D5={enabled:!0},rse={shikiTheme:L5,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:D5},Yr=y.createContext(rse),j5=y.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:s,dir:a,animatePlugin:l,...u})=>{if(l){let p=l.getLastRenderCharCount();l.setPrevContentLength(p)}let d=typeof e=="string"&&n?Jre(e):e,h=f.jsx(O5,{...u,children:d});return f.jsx(J6.Provider,{value:s,children:a?f.jsx("div",{dir:a,style:{display:"contents"},children:h}):h})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(s=>{var a,l;return((a=e.components)==null?void 0:a[s])!==((l=t.components)==null?void 0:l[s])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});j5.displayName="Block";var P5=y.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:s=!1,components:a,rehypePlugins:l=yk,remarkPlugins:u=tse,className:d,shikiTheme:h=L5,mermaid:p,controls:m=!0,isAnimating:b=!1,animated:x,BlockComponent:E=j5,parseMarkdownIntoBlocksFn:N=Vre,caret:C,plugins:S,remend:k,linkSafety:A=D5,lineNumbers:R=!0,allowedTags:M,literalTagContent:_,translations:O,icons:j,prefix:H,onAnimationStart:B,onAnimationEnd:K,...X})=>{let Z=y.useId(),[te,q]=y.useTransition(),z=y.useMemo(()=>Bne(H),[H]),V=y.useRef(null),W=y.useRef(B),le=y.useRef(K);W.current=B,le.current=K,y.useEffect(()=>{var ke,ve,Ie;if(t==="static")return;let je=V.current;if(V.current=b,je===null){b&&((ke=W.current)==null||ke.call(W));return}b&&!je?(ve=W.current)==null||ve.call(W):!b&&je&&((Ie=le.current)==null||Ie.call(le))},[b,t]);let D=y.useMemo(()=>M?Object.keys(M):[],[M]),P=y.useMemo(()=>{if(typeof e!="string")return"";let ke=t==="streaming"&&r?SJ(e,k):e;return _&&_.length>0&&(ke=Kre(ke,_)),D.length>0&&(ke=qre(ke,D)),ke},[e,t,r,k,D,_]),$=y.useMemo(()=>N(P),[P,N]),[L,ae]=y.useState($);y.useEffect(()=>{t==="streaming"&&!Se?q(()=>{ae($)}):ae($)},[$,t]);let re=t==="streaming"?L:$,ce=y.useMemo(()=>n==="auto"?re.map(ak):void 0,[re,n]),de=y.useMemo(()=>re.map((ke,ve)=>`${Z}-${ve}`),[re.length,Z]),fe=y.useMemo(()=>x===!0?"true":x?JSON.stringify(x):"",[x]),Se=y.useMemo(()=>fe?fe==="true"?ax():ax(x):null,[fe]),He=y.useMemo(()=>{var ke,ve;return{shikiTheme:(ve=(ke=S?.code)==null?void 0:ke.getThemes())!=null?ve:h,controls:m,isAnimating:b,lineNumbers:R,mode:t,mermaid:p,linkSafety:A}},[h,m,b,R,t,p,A,S?.code]),Me=y.useMemo(()=>O?JSON.stringify(O):"",[O]),Ee=y.useMemo(()=>({...r5,...O}),[Me]),Oe=y.useMemo(()=>{let{inlineCode:ke,...ve}=a??{},Ie={...Ere,...ve};if(ke){let je=Ie.code;Ie.code=ee=>"data-block"in ee?je?y.createElement(je,ee):null:y.createElement(ke,ee)}return Ie},[a]),Be=y.useMemo(()=>{let ke=[];return S!=null&&S.cjk&&(ke=[...ke,...S.cjk.remarkPluginsBefore]),ke=[...ke,...u],S!=null&&S.cjk&&(ke=[...ke,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(ke=[...ke,S.math.remarkPlugin]),ke},[u,S?.math,S?.cjk]),Ke=y.useMemo(()=>{var ke;let ve=l;if(M&&Object.keys(M).length>0&&l===yk){let Ie={...Vh,tagNames:[...(ke=Vh.tagNames)!=null?ke:[],...Object.keys(M)],attributes:{...Vh.attributes,...M}};ve=[fx.raw,[$4,Ie],fx.harden]}return _&&_.length>0&&(ve=[...ve,[Xre,_]]),S!=null&&S.math&&(ve=[...ve,S.math.rehypePlugin]),Se&&b&&(ve=[...ve,Se.rehypePlugin]),ve},[l,S?.math,Se,b,M,_]),$e=y.useMemo(()=>{if(!b||re.length===0)return!1;let ke=re.at(-1);return ok(ke)||kre(ke)},[b,re]),De=y.useMemo(()=>C&&b&&!$e?{"--streamdown-caret":`"${nse[C]}"`}:void 0,[C,b,$e]);return t==="static"?f.jsx(lx.Provider,{value:Ee,children:f.jsx(ux.Provider,{value:S??null,children:f.jsx(Yr.Provider,{value:He,children:f.jsx(tk,{icons:j,children:f.jsx(ox.Provider,{value:z,children:f.jsx("div",{className:z("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?ak(P):n,children:f.jsx(O5,{components:Oe,rehypePlugins:Ke,remarkPlugins:Be,...X,children:P})})})})})})}):f.jsx(lx.Provider,{value:Ee,children:f.jsx(ux.Provider,{value:S??null,children:f.jsx(Yr.Provider,{value:He,children:f.jsx(tk,{icons:j,children:f.jsx(ox.Provider,{value:z,children:f.jsxs("div",{className:z("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",C&&!$e?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:De,children:[re.length===0&&C&&b&&f.jsx("span",{}),re.map((ke,ve)=>{var Ie;let je=ve===re.length-1,ee=b&&je&&ok(ke);return f.jsx(E,{animatePlugin:Se,components:Oe,content:ke,dir:(Ie=ce?.[ve])!=null?Ie:n!=="auto"?n:void 0,index:ve,isIncomplete:ee,rehypePlugins:Ke,remarkPlugins:Be,shouldNormalizeHtmlIndentation:s,shouldParseIncompleteMarkdown:r,...X},de[ve])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);P5.displayName="Streamdown";var sse=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:s=.1,showControls:a=!0,initialZoom:l=1,fullscreen:u=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:h,ZoomOutIcon:p}=_s(),m=wt(),b=y.useRef(null),x=y.useRef(null),[E,N]=y.useState(l),[C,S]=y.useState({x:0,y:0}),[k,A]=y.useState(!1),[R,M]=y.useState({x:0,y:0}),[_,O]=y.useState({x:0,y:0}),j=y.useCallback(z=>{N(V=>Math.max(n,Math.min(r,V+z)))},[n,r]),H=y.useCallback(()=>{j(s)},[j,s]),B=y.useCallback(()=>{j(-s)},[j,s]),K=y.useCallback(()=>{N(l),S({x:0,y:0})},[l]),X=y.useCallback(z=>{z.preventDefault();let V=z.deltaY>0?-s:s;j(V)},[j,s]),Z=y.useCallback(z=>{if(z.button!==0||z.isPrimary===!1)return;A(!0),M({x:z.clientX,y:z.clientY}),O(C);let V=z.currentTarget;V instanceof HTMLElement&&V.setPointerCapture(z.pointerId)},[C]),te=y.useCallback(z=>{if(!k)return;z.preventDefault();let V=z.clientX-R.x,W=z.clientY-R.y;S({x:_.x+V,y:_.y+W})},[k,R,_]),q=y.useCallback(z=>{A(!1);let V=z.currentTarget;V instanceof HTMLElement&&V.releasePointerCapture(z.pointerId)},[]);return y.useEffect(()=>{let z=b.current;if(z)return z.addEventListener("wheel",X,{passive:!1}),()=>{z.removeEventListener("wheel",X)}},[X]),y.useEffect(()=>{let z=x.current;if(z&&k)return document.body.style.userSelect="none",z.addEventListener("pointermove",te,{passive:!1}),z.addEventListener("pointerup",q),z.addEventListener("pointercancel",q),()=>{document.body.style.userSelect="",z.removeEventListener("pointermove",te),z.removeEventListener("pointerup",q),z.removeEventListener("pointercancel",q)}},[k,te,q]),f.jsxs("div",{className:m("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:b,style:{cursor:k?"grabbing":"grab"},children:[a?f.jsxs("div",{className:m("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",u?"bottom-4 left-4":"bottom-2 left-2"),children:[f.jsx("button",{className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:E>=r,onClick:H,title:"Zoom in",type:"button",children:f.jsx(h,{size:16})}),f.jsx("button",{className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:E<=n,onClick:B,title:"Zoom out",type:"button",children:f.jsx(p,{size:16})}),f.jsx("button",{className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:K,title:"Reset zoom and pan",type:"button",children:f.jsx(d,{size:16})})]}):null,f.jsx("div",{className:m("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:Z,ref:x,role:"application",style:{transform:`translate(${C.x}px, ${C.y}px) scale(${E})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},B5=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let a=wt(),[l,u]=y.useState(null),[d,h]=y.useState(!1),[p,m]=y.useState(""),[b,x]=y.useState(""),[E,N]=y.useState(0),{mermaid:C}=y.useContext(Yr),S=Tv(),k=C?.errorComponent,{shouldRender:A,containerRef:R}=kne({immediate:r});if(y.useEffect(()=>{if(A){if(!S){u("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{u(null),h(!0);let _=S.getMermaid(n),O=e.split("").reduce((B,K)=>(B<<5)-B+K.charCodeAt(0)|0,0),j=`mermaid-${Math.abs(O)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:H}=await _.render(j,e);m(H),x(H)}catch(_){if(!(b||p)){let O=_ instanceof Error?_.message:"Failed to render Mermaid chart";u(O)}}finally{h(!1)}})()}},[e,n,E,A,S]),!(A||p||b))return f.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:R});if(d&&!p&&!b)return f.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:R,children:f.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(l&&!p&&!b){let _=()=>N(O=>O+1);return k?f.jsx("div",{ref:R,children:f.jsx(k,{chart:e,error:l,retry:_})}):f.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:R,children:[f.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",l]}),f.jsxs("details",{className:a("mt-2"),children:[f.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let M=p||b;return f.jsx("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:R,children:f.jsx(sse,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:f.jsx("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:M},role:"img"})})})};const ise=["text-body-sm leading-5","[&_*]:leading-5","[&_p]:my-0! [&_pre]:my-0! [&_blockquote]:my-0! [&_table]:my-0!","[&_h1]:my-0! [&_h2]:my-0! [&_h3]:my-0! [&_h4]:my-0! [&_h5]:my-0! [&_h6]:my-0!","[&>*+*]:mt-5","[&_ul]:my-0! [&_ol]:my-0! [&_li]:my-0! [&_li>p]:my-0!","[&_li+li]:mt-0! [&_ul_ul]:mt-0! [&_ul_ol]:mt-0! [&_ol_ul]:mt-0! [&_ol_ol]:mt-0!","[&_li]:py-0! [&_ul]:py-0! [&_ol]:py-0!","[&_ul]:list-outside! [&_ol]:list-outside!","[&_ul]:pl-[2ch]! [&_ol]:pl-[3ch]! [&_li]:pl-0!","[&_h1]:text-body-sm [&_h2]:text-body-sm [&_h3]:text-body-sm","[&_h4]:text-body-sm [&_h5]:text-body-sm [&_h6]:text-body-sm","[&_h1]:font-semibold [&_h2]:font-semibold [&_h3]:font-semibold","[&_h4]:font-semibold [&_h5]:font-semibold [&_h6]:font-semibold","[&_blockquote]:border-l [&_blockquote]:border-border [&_blockquote]:pl-2","[&_:not(pre)>code]:rounded-none [&_:not(pre)>code]:px-1! [&_:not(pre)>code]:py-0!","[&_:not(pre)>code]:text-body-sm [&_:not(pre)>code]:leading-5! [&_:not(pre)>code]:text-fg-1","[&_th]:py-0! [&_td]:py-0!","[&_[data-streamdown=code-block]]:my-0! [&_[data-streamdown=code-block]]:gap-0!","[&_[data-streamdown=code-block]]:rounded-none! [&_[data-streamdown=code-block]]:border-0!","[&_[data-streamdown=code-block]]:bg-transparent! [&_[data-streamdown=code-block]]:p-0!","[&_[data-streamdown=code-block]]:relative!","[&_[data-streamdown=code-block-header]]:hidden!","[&_div:has(>[data-streamdown=code-block-actions])]:absolute! [&_div:has(>[data-streamdown=code-block-actions])]:top-0!","[&_div:has(>[data-streamdown=code-block-actions])]:right-0! [&_div:has(>[data-streamdown=code-block-actions])]:mt-0!","[&_div:has(>[data-streamdown=code-block-actions])]:h-5! [&_div:has(>[data-streamdown=code-block-actions])]:opacity-0!","[&_div:has(>[data-streamdown=code-block-actions])]:transition-opacity","[&_[data-streamdown=code-block]:hover_div:has(>[data-streamdown=code-block-actions])]:opacity-100!","[&_[data-streamdown=code-block]:focus-within_div:has(>[data-streamdown=code-block-actions])]:opacity-100!","[&_[data-streamdown=code-block-actions]]:rounded-none! [&_[data-streamdown=code-block-actions]]:border-0!","[&_[data-streamdown=code-block-actions]]:bg-code-bg! [&_[data-streamdown=code-block-actions]]:px-1!","[&_[data-streamdown=code-block-actions]]:py-0! [&_[data-streamdown=code-block-actions]]:gap-1!","[&_[data-streamdown=code-block-actions]]:backdrop-blur-none!","[&_[data-streamdown=code-block-body]]:rounded-none! [&_[data-streamdown=code-block-body]]:border-0!","[&_[data-streamdown=code-block-body]]:bg-code-bg! [&_[data-streamdown=code-block-body]]:px-2!","[&_[data-streamdown=code-block-body]]:py-0! [&_[data-streamdown=code-block-body]]:text-body-sm!","[&_[data-streamdown=code-block-copy-button]]:p-0! [&_[data-streamdown=code-block-download-button]]:p-0!","[&_[data-streamdown=table-wrapper]]:rounded-none! [&_[data-streamdown=table-wrapper]]:border-0!","[&_[data-streamdown=table-wrapper]]:my-0! [&_[data-streamdown=table-wrapper]]:bg-transparent!","[&_[data-streamdown=table-wrapper]]:relative! [&_[data-streamdown=table-wrapper]]:gap-0!","[&_[data-streamdown=table-wrapper]]:p-0!","[&_[data-streamdown=table-wrapper]>div:not(:has(table))]:absolute! [&_[data-streamdown=table-wrapper]>div:not(:has(table))]:top-0!","[&_[data-streamdown=table-wrapper]>div:not(:has(table))]:right-0! [&_[data-streamdown=table-wrapper]>div:not(:has(table))]:z-10!","[&_[data-streamdown=table-wrapper]>div:not(:has(table))]:opacity-0! [&_[data-streamdown=table-wrapper]>div:not(:has(table))]:bg-code-bg!","[&_[data-streamdown=table-wrapper]>div:not(:has(table))]:px-1! [&_[data-streamdown=table-wrapper]>div:not(:has(table))]:transition-opacity","[&_[data-streamdown=table-wrapper]:hover>div:not(:has(table))]:opacity-100!","[&_[data-streamdown=table-wrapper]:focus-within>div:not(:has(table))]:opacity-100!","[&_[data-streamdown=table-wrapper]>div:has(table)]:rounded-none! [&_[data-streamdown=table-wrapper]>div:has(table)]:border-0!","[&_[data-streamdown=table-wrapper]>div:has(table)]:bg-transparent!"].join(" "),V1=e=>function({className:n}){return f.jsx("span",{"aria-hidden":!0,className:xe("font-mono text-body-sm leading-5",n),children:e})},ase={DownloadIcon:V1("⤓"),CopyIcon:V1("⧉"),CheckIcon:V1("✓")},Cv=y.memo(function({children:t,streaming:n,className:r}){const s=Kr();return f.jsx(P5,{mode:n?"streaming":"static",parseIncompleteMarkdown:n,shikiTheme:["github-light","github-dark"],icons:s?ase:void 0,className:xe("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",s&&ise,r),children:t})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className),Ea="pl-[calc(0.875rem+0.5rem)]",ose={check:["[ ]","[x]"],radio:["( )","(•)"]};function z5({options:e,focused:t,onFocus:n,onChoose:r,active:s=!0,label:a,className:l}){const u=y.useRef([]);y.useEffect(()=>{s&&u.current[t]?.focus()},[s,t]);const d=h=>{e.length>0&&n((t+h+e.length)%e.length)};return f.jsx("div",{role:"group","aria-label":a,className:xe("flex flex-col",l),onKeyDown:h=>{if(h.key==="ArrowDown"){d(1),h.preventDefault();return}if(h.key==="ArrowUp"){d(-1),h.preventDefault();return}const p=Number(h.key);Number.isInteger(p)&&p>=1&&p<=Math.min(e.length,9)&&(n(p-1),r(p-1),h.preventDefault())},children:e.map((h,p)=>{const m=p===t;return f.jsxs("div",{className:"flex flex-col",children:[f.jsxs("button",{ref:b=>{u.current[p]=b},type:"button",tabIndex:m?0:-1,"aria-pressed":h.checked,onFocus:()=>n(p),onClick:()=>r(p),className:xe("flex w-full items-baseline gap-2 text-left outline-none",m?"bg-surface-hover":"hover:bg-surface-hover/60"),children:[f.jsx(Or,{className:m?"text-fg-1":void 0,children:m?"❯":" "}),f.jsx("span",{className:"shrink-0 font-mono text-label leading-5 text-fg-4",children:p+1}),h.checked!==void 0?f.jsx("span",{className:xe("shrink-0 font-mono text-label leading-5",h.checked?"text-accent":"text-fg-4"),children:ose[h.marker??"check"][h.checked?1:0]}):null,f.jsxs("span",{className:xe("min-w-0 flex-1 text-body-sm leading-5",h.danger?"text-danger":"text-fg-1"),children:[h.label,h.description?f.jsxs("span",{className:"text-fg-4",children:[" — ",h.description]}):null]})]}),h.detail?f.jsx("div",{className:Ea,children:h.detail}):null]},h.key)})})}function U5({children:e}){return f.jsx("div",{className:xe(Ea,"text-label leading-5 text-fg-4"),children:e})}function H5({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:s}){return f.jsxs("div",{className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-fg-3",children:"›"}),f.jsx("input",{autoFocus:!0,value:e,placeholder:s,onChange:a=>t(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),n()),a.key==="Escape"&&(a.stopPropagation(),r())},className:"min-w-0 flex-1 border-b border-border bg-transparent text-body-sm leading-5 text-fg-1 outline-none placeholder:text-fg-4 focus:border-accent"})]})}function wv({code:e,label:t,language:n,className:r}){return f.jsxs("div",{className:xe("min-w-0",r),children:[f.jsx("span",{className:"block truncate text-label leading-5 text-fg-4",children:t}),f.jsx(Cv,{children:lse(e,n)})]})}function lse(e,t){const n=Math.max(0,...[...e.matchAll(/`+/g)].map(s=>s[0].length)),r="`".repeat(Math.max(3,n+1));return`${r}${t??""}
673
- ${e}
674
- ${r}`}function use({request:e,onApprove:t,onDeny:n,className:r}){const s=Kr(),[a,l]=y.useState(!1),[u,d]=y.useState(!1),[h,p]=y.useState(""),[m,b]=y.useState(0),x=S=>{const k=h.trim();n(e.id,k||void 0,S||void 0),p(""),d(!1)},E=zb(e.input),N=UR(e.toolName),C=e.title??e.displayName??"Permission needed";if(s){const S=[{key:"allow",label:"Allow"},{key:"deny",label:"Deny",description:"the turn continues",detail:u?f.jsx(H5,{value:h,onChange:p,onSubmit:()=>x(!1),onCancel:()=>d(!1),placeholder:"Reason (optional) — the agent reads this and can try something else"}):void 0},{key:"stop",label:"Deny & stop",description:"interrupt the turn",danger:!0}];return f.jsxs("div",{"data-slot":"permission-prompt",className:xe("w-full",r),onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),x(!1))},children:[f.jsxs("div",{className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-warning",children:"!"}),f.jsx("span",{className:"min-w-0 flex-1 text-body-sm leading-5 font-medium text-fg-1",children:C})]}),e.description?f.jsx("div",{className:xe(Ea,"text-label leading-5 text-fg-3"),children:e.description}):null,e.decisionReason?f.jsx("div",{className:xe(Ea,"text-label leading-5 text-fg-4"),children:e.decisionReason}):null,f.jsxs("button",{type:"button",onClick:()=>l(k=>!k),className:"flex w-full items-baseline gap-2 text-left outline-none hover:bg-surface-hover/60",children:[f.jsx(Or,{className:"text-fg-4",children:"⎿"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate text-label leading-5 text-fg-4",children:[f.jsx("span",{className:"font-medium text-fg-2",children:e.toolName}),E?`(${E})`:null]})]}),a?f.jsx("div",{className:Ea,children:f.jsx(wv,{code:JSON.stringify(e.input,null,2),language:"json",label:"Input"})}):null,f.jsx(z5,{label:C,options:S,focused:m,onFocus:b,active:!u,onChoose:k=>{k===0?t(e.id):k===1?d(!0):x(!0)}}),f.jsx(U5,{children:"↑↓ move · 1–3 choose · esc deny"})]})}return f.jsxs("div",{"data-slot":"permission-prompt",className:xe("rounded-lg border border-warning/40 bg-warning-bg p-3",r),children:[f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx(j_,{className:"mt-0.5 size-4 shrink-0 text-warning"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-body-sm font-medium text-fg-1",children:e.title??e.displayName??"Permission needed"}),e.description?f.jsx("div",{className:"mt-0.5 text-label text-fg-3",children:e.description}):null,e.decisionReason?f.jsx("div",{className:"mt-0.5 text-label text-fg-4",children:e.decisionReason}):null,f.jsxs("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[f.jsx(N,{className:"size-3 shrink-0 text-fg-3"}),f.jsx("span",{className:"shrink-0 font-mono text-label font-medium text-fg-2",children:e.toolName}),E?f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",children:E}):null]}),f.jsxs("button",{type:"button",className:"mt-1 font-mono text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>l(S=>!S),children:[a?"Hide":"Show"," ",e.toolName," input"]}),a?f.jsx("pre",{className:"mt-1.5 max-h-48 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:JSON.stringify(e.input,null,2)}):null]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-1.5",children:[f.jsx(Je,{size:"sm",onClick:()=>t(e.id),children:"Allow"}),f.jsx(Je,{size:"sm",variant:"outline",onClick:()=>d(S=>!S),children:"Deny"}),f.jsx(Je,{size:"sm",variant:"outline",onClick:()=>x(!0),children:"Deny & stop"})]})]}),u?f.jsxs("div",{className:"mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5",children:[f.jsx(Yt,{autoFocus:!0,value:h,onChange:S=>p(S.target.value),onKeyDown:S=>{S.key==="Enter"&&x(!1),S.key==="Escape"&&d(!1)},placeholder:"Reason (optional) — the agent reads this and can try something else",className:"h-7 flex-1"}),f.jsx(Je,{size:"sm",variant:"outline",onClick:()=>d(!1),children:"Cancel"}),f.jsx(Je,{size:"sm",variant:"destructive",onClick:()=>x(!1),children:"Deny"})]}):null]})}const vk=[{value:"auto",label:"Auto-answer",description:"pick each question’s recommended option"},{value:"ask",label:"Ask",description:"wait for a watcher or webhook controller to answer"},{value:"deny",label:"Disabled",description:"the agent is told to decide on its own"}];function F5(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(n=>{const r=n;if(typeof r.question!="string"||!Array.isArray(r.options))return[];const s=r.options.filter(a=>typeof a?.label=="string");return s.length===0?[]:[{question:r.question,header:typeof r.header=="string"?r.header:"",options:s,multiSelect:r.multiSelect===!0}]})}const cse=e=>e.some(t=>t.multiSelect===!0),Rl={labels:[],other:"",otherActive:!1};function Ek(e){const t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(", ")}function dse({request:e,onAnswer:t,onDismiss:n,className:r}){const s=Kr(),a=F5(e.input),[l,u]=y.useState(()=>a.map(()=>Rl)),[d,h]=y.useState(()=>a.map(()=>0)),[p,m]=y.useState(0),b=(C,S)=>{u(k=>k.map((A,R)=>R===C?{...A,...S}:A))},x=(C,S,k)=>{const A=l[C]??Rl;k?b(C,{labels:A.labels.includes(S)?A.labels.filter(R=>R!==S):[...A.labels,S]}):b(C,{labels:A.labels[0]===S?[]:[S],otherActive:!1})},E=a.every((C,S)=>Ek(l[S]??Rl)!==""),N=()=>{const C={};a.forEach((S,k)=>{C[S.question]=Ek(l[k]??Rl)}),t(e.id,{...e.input,answers:C})};if(s){const C=()=>n(e.id,"Question dismissed by user");return f.jsxs("div",{"data-slot":"question-prompt",className:xe("flex w-full flex-col gap-2",r),onKeyDown:S=>{if(S.key==="Escape"){S.preventDefault(),C();return}S.key==="Enter"&&(S.metaKey||S.ctrlKey)&&E&&(S.preventDefault(),N())},children:[a.map((S,k)=>{const A=l[k]??Rl,R=d[k]??0,M=S.multiSelect===!0,_=[...S.options.map((O,j)=>{const H=A.labels.includes(O.label);return{key:O.label,label:O.label,description:O.description,detail:O.preview&&(H||R===j)?f.jsx(wv,{code:O.preview,label:"Preview"}):void 0,checked:H,marker:M?"check":"radio"}}),{key:"__other",label:"Other…",checked:A.otherActive,marker:M?"check":"radio",detail:A.otherActive?f.jsx(H5,{value:A.other,onChange:O=>b(k,{other:O}),onSubmit:()=>{E&&N()},onCancel:()=>b(k,{otherActive:!1,other:""}),placeholder:"Type your own answer"}):void 0}];return f.jsxs("div",{className:"flex flex-col",children:[f.jsxs("div",{className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-fg-3",children:"?"}),f.jsxs("span",{className:"min-w-0 flex-1 text-body-sm leading-5 text-fg-1",children:[S.header?f.jsxs("span",{className:"text-fg-4",children:[S.header," · "]}):null,f.jsx("span",{className:"font-medium",children:S.question})]})]}),f.jsx(z5,{label:S.question,options:_,focused:R,active:p===k&&!A.otherActive,onFocus:O=>{m(k),h(j=>j.map((H,B)=>B===k?O:H))},onChoose:O=>{if(O===S.options.length){b(k,{otherActive:!A.otherActive});return}const j=S.options[O];j&&x(k,j.label,M)}})]},k)}),f.jsx("div",{className:xe(Ea,"flex flex-col"),children:f.jsx("button",{type:"button",disabled:!E,onClick:N,className:"w-fit text-body-sm leading-5 text-accent underline-offset-2 outline-none hover:underline disabled:text-fg-4 disabled:no-underline",children:"⏎ Answer"})}),f.jsxs(U5,{children:["↑↓ move · ",cse(a)?"space/1–9 toggle":"1–9 choose"," · ⌘⏎ answer · esc dismiss"]})]})}return f.jsx("div",{"data-slot":"question-prompt",className:xe("rounded-lg border border-info/40 bg-info-bg p-3",r),children:f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx(z_,{className:"mt-0.5 size-4 shrink-0 text-info"}),f.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[a.map((C,S)=>{const k=l[S]??Rl;return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[C.header?f.jsx(gn,{variant:"info",children:C.header}):null,f.jsx("span",{className:"text-body-sm font-medium text-fg-1",children:C.question})]}),f.jsxs("div",{className:"flex flex-col gap-1",children:[C.options.map(A=>{const R=k.labels.includes(A.label);return f.jsxs("button",{type:"button",onClick:()=>x(S,A.label,C.multiSelect===!0),className:xe("rounded-md border px-2.5 py-1.5 text-left transition-colors",R?"border-info bg-bg":"border-border bg-bg/50 hover:border-border-strong hover:bg-bg"),children:[f.jsx("span",{className:"block text-body-sm font-medium text-fg-1",children:A.label}),A.description?f.jsx("span",{className:"block text-label text-fg-4",children:A.description}):null,R&&A.preview?f.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:A.preview}):null]},A.label)}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",onClick:()=>b(S,{otherActive:!k.otherActive}),className:xe("shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors",k.otherActive?"border-info bg-bg text-fg-1":"border-border bg-bg/50 text-fg-3 hover:border-border-strong hover:bg-bg"),children:"Other…"}),k.otherActive?f.jsx(Yt,{autoFocus:!0,value:k.other,onChange:A=>b(S,{other:A.target.value}),placeholder:"Type your own answer",className:"flex-1"}):null]})]})]},S)}),f.jsx("div",{children:f.jsx(Je,{size:"sm",onClick:N,disabled:!E,children:"Answer"})})]}),f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss question",className:"shrink-0",onClick:()=>n(e.id,"Question dismissed by user"),children:f.jsx(Ss,{className:"size-3.5"})})]})})}function fse({state:e,client:t,sessionId:n,open:r,onOpenChange:s}){const a=e.session,l=e.permissionMode?zV(e.permissionMode):void 0;return f.jsx(ds,{open:r,onOpenChange:s,children:f.jsxs(fs,{children:[f.jsx(hs,{title:"Session info",description:a?.title}),f.jsx(ms,{children:f.jsxs("div",{className:"flex flex-col divide-y divide-border",children:[f.jsxs("div",{className:"pb-2",children:[f.jsx(sr,{label:"Engine",children:e.engine??"claude"}),a?.profile?f.jsx(sr,{label:"Profile",children:a.profile}):null,e.model?f.jsx(sr,{label:"Model",mono:!0,children:e.model}):null,l?f.jsx(sr,{label:"Permission mode",children:l.label}):null,a?.apiKeySource?f.jsx(sr,{label:"Credentials",children:a.apiKeySource}):null]}),f.jsxs("div",{className:"py-2",children:[e.cwd?f.jsx(q1,{label:"Working directory",value:e.cwd}):null,e.sdkSessionId?f.jsx(q1,{label:"Engine session id",value:e.sdkSessionId}):null,a?f.jsx(q1,{label:"Gateway session id",value:a.id}):null]}),f.jsxs("div",{className:"py-2",children:[a?.createdAt?f.jsx(sr,{label:"Started",children:du(a.createdAt)}):null,a?.numTurns!==void 0?f.jsx(sr,{label:"Turns",children:a.numTurns}):null,f.jsx(sr,{label:"Cost",mono:!0,children:Sa(e.totalCostUsd)})]}),e.capabilities.vfs?f.jsx(hse,{client:t,sessionId:n,open:r}):null]})})]})})}function q1({label:e,value:t}){return f.jsxs("div",{className:"flex items-start justify-between gap-2 py-1.5",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-label text-fg-3",children:e}),f.jsx("div",{className:"mt-0.5 font-mono text-label break-all text-fg-1",children:t})]}),f.jsx(ud,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function hse({client:e,sessionId:t,open:n}){const[r,s]=y.useState(),[a,l]=y.useState(!1);return y.useEffect(()=>{if(!n||!t)return;let u=!1;return l(!0),e.listSessionFiles(t).then(d=>{u||s(d)}).catch(()=>{u||s([])}).finally(()=>{u||l(!1)}),()=>{u=!0}},[e,t,n]),f.jsxs("div",{className:"pt-3",children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Files"}),a?f.jsx("div",{className:"py-3 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})}):r?.length?f.jsx("ul",{className:"mt-1 flex flex-col",children:r.map(u=>f.jsx("li",{children:f.jsxs("a",{href:t?e.sessionFileUrl(t,u.path):void 0,className:"flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover",children:[f.jsx(L_,{className:"size-3.5 shrink-0 text-fg-4"}),f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:u.path}),f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:No(u.bytes)})]})},u.path))}):f.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:"Nothing delivered yet."})]})}const mse={starting:{label:"Starting",variant:"info",busy:!0},running:{label:"Running",variant:"info",busy:!0},awaiting_approval:{label:"Needs approval",variant:"warning",busy:!0},idle:{label:"Idle",variant:"success",busy:!1},parked:{label:"Parked",variant:"accent",busy:!1},failed:{label:"Failed",variant:"danger",busy:!1},closed:{label:"Closed",variant:"neutral",busy:!1}};function pse(e=3e4){const[t,n]=y.useState(()=>Date.now());return y.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}const $5=e=>e>=95?"text-danger":e>=80?"text-warning":"text-fg-3",gse=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0;function bse({usage:e}){return f.jsx(Py,{content:f.jsxs("div",{className:"flex min-w-44 flex-col gap-1 py-0.5",children:[e.categories.map(t=>f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:gse(t.color)?{backgroundColor:t.color}:void 0}),f.jsx("span",{className:"flex-1",children:t.name}),f.jsx("span",{className:"font-mono text-fg-3",children:us(t.tokens)})]},t.name)),f.jsxs("div",{className:"mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1",children:[f.jsx("span",{children:"Total"}),f.jsxs("span",{className:"font-mono text-fg-3",children:[us(e.totalTokens)," / ",us(e.maxTokens)," (",e.percentage.toFixed(0),"%)"]})]})]}),children:f.jsxs("span",{className:xe("inline-flex cursor-default items-center gap-1 font-mono text-label",$5(e.percentage)),children:["Ctx ",us(e.totalTokens)]})})}function Tk({label:e,info:t,now:n}){const r=t.utilization,s=t.resetsAt!==void 0?t.resetsAt*1e3:void 0;return f.jsx(Py,{content:f.jsxs("div",{className:"flex min-w-36 flex-col gap-1 py-0.5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("span",{children:[e," usage"]}),f.jsx("span",{className:"font-mono text-fg-3",children:r!==void 0?`${r.toFixed(1)}%`:"—"})]}),s!==void 0?f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("span",{children:"Resets in"}),f.jsx("span",{className:"font-mono text-fg-3",children:Bb(s,n)})]}):null,t.isUsingOverage?f.jsx("div",{className:"text-warning",children:"Using overage"}):null,t.status==="rejected"?f.jsx("div",{className:"text-danger",children:"Limit reached"}):null]}),children:f.jsxs("span",{className:xe("inline-flex cursor-default items-center gap-1 font-mono text-label",t.status==="rejected"?"text-danger":$5(r??0)),children:[f.jsx(uR,{value:r??0}),e,r!==void 0?` ${r.toFixed(0)}%`:"",s!==void 0?f.jsxs("span",{className:"text-fg-4",children:["· ",Bb(s,n)]}):null]})})}function Y1({onClick:e,hint:t,children:n}){return e?f.jsx("button",{type:"button",onClick:e,"aria-label":t,className:"rounded-md px-1 py-0.5 transition-colors outline-none hover:bg-surface-hover focus-visible:bg-surface-hover",children:n}):f.jsx(f.Fragment,{children:n})}function xse({state:e,connected:t,connection:n,onOpenStatus:r,onOpenContext:s,onOpenUsage:a,actions:l,placement:u="top",className:d}){const h=mse[e.status],p=pse(),m=e.rateLimits?.five_hour,b=e.rateLimits?.seven_day,x=n??(t===!1?"reconnecting":"live");return f.jsxs("div",{"data-slot":"status-bar",className:xe("flex items-center gap-2 border-border bg-surface px-3 py-1.5",u==="bottom"?"border-t":"border-b",d),children:[f.jsx(Y1,{onClick:r,hint:"Session info",children:x==="live"?f.jsxs(gn,{variant:h.variant,dot:!h.busy,children:[h.busy?f.jsx(xn,{className:"size-3 text-current"}):null,h.label]}):f.jsxs(gn,{variant:x==="offline"?"danger":"warning",dot:!1,children:[x==="offline"?f.jsx(iU,{className:"size-3 text-current"}):f.jsx(ep,{className:"size-3 animate-spin text-current"}),x==="offline"?"Offline":"Reconnecting…"]})}),e.capabilities.contextUsage&&e.contextUsage?f.jsx(Y1,{onClick:s,hint:"Context breakdown",children:f.jsx(bse,{usage:e.contextUsage})}):null,m||b?f.jsx(Y1,{onClick:a,hint:"Plan usage",children:f.jsxs("span",{className:"inline-flex items-center gap-2",children:[m?f.jsx(Tk,{label:"Session",info:m,now:p}):null,b?f.jsx(Tk,{label:"Weekly",info:b,now:p}):null]})}):null,f.jsx("span",{className:"flex-1"}),f.jsx("span",{className:"font-mono text-label text-fg-3",children:Sa(e.totalCostUsd)}),l]})}function yse(e,t,n){const r=new Array(e);return new Proxy(r,{get(s,a,l){if(typeof a=="string"){const u=a.charCodeAt(0);if(u>=48&&u<=57){const d=+a;if(Number.isInteger(d)&&d>=0&&d<e){let h=s[d];if(!h){const p=t[d*2];h=s[d]={index:d,key:n(d),start:p,size:t[d*2+1],end:p+t[d*2+1],lane:0}}return h}}if(a==="length")return e}return Reflect.get(s,a,l)}})}function Il(e,t,n){let r=n.initialDeps??[],s,a=!0;function l(){const u=e();return(u.length!==r.length||u.some((h,p)=>r[p]!==h))&&(r=u,s=t(...u),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(s),a=!1),s}return l.updateDeps=u=>{r=u},l}function Sk(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const vse=(e,t)=>Math.abs(e-t)<1.01,Ese=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}};let Cc;const G1=()=>{if(Cc!==void 0)return Cc;if(typeof navigator>"u")return Cc=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Cc=!0;const e=navigator.maxTouchPoints;return Cc=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Ck=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Tse=e=>e,Sse=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=new Array(r);for(let a=0;a<r;a++)s[a]=t+a;return s},Cse=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=l=>{const{width:u,height:d}=l;t({width:Math.round(u),height:Math.round(d)})};if(s(Ck(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(l=>{const u=()=>{const d=l[0];if(d?.borderBoxSize){const h=d.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(Ck(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},Tm={passive:!0},wse=typeof window>"u"?!0:"onscrollend"in window,kse=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const a=e.options.useScrollendEvent&&wse;let l=0;const u=a?null:Ese(s,()=>t(l,!1),e.options.isScrollingResetDelay),d=m=>()=>{l=n(r),u?.(),t(l,m)},h=d(!0),p=d(!1);return r.addEventListener("scroll",h,Tm),a&&r.addEventListener("scrollend",p,Tm),()=>{r.removeEventListener("scroll",h),a&&r.removeEventListener("scrollend",p)}},Nse=(e,t)=>kse(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),Ase=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),s=n.options.getItemKey(r);return n.itemSizeCache.get(s)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),s=n.options.getItemKey(r),a=n.itemSizeCache.get(s);if(a!==void 0)return a}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},_se=(e,{adjustments:t=0,behavior:n},r)=>{var s,a;(a=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},Rse=_se;class Ise{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{const l=()=>{const u=a.target,d=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);for(const[h,p]of this.elementsCache)if(p===u){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(u,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var a;return(a=r())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=r())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var r,s;const a={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Tse,rangeExtractor:Sse,onChange:()=>{},measureElement:Ase,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const b in n){const x=n[b];x!==void 0&&(a[b]=x)}const l=this.options;let u=null,d=null,h=!1;if(l!==void 0&&l.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const b=l.count,x=a.count,E=this.getMeasurements(),N=b>0?((r=E[0])==null?void 0:r.key)??l.getItemKey(0):null,C=b>0?((s=E[b-1])==null?void 0:s.key)??l.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(a.getItemKey(0)!==N||a.getItemKey(x-1)!==C)){h=!0;const A=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??E[0]:null;A&&(u=[A.key,this.getScrollOffset()-A.start]);const R=a.followOnAppend===!0?"auto":a.followOnAppend||null;R&&x>b&&this.isAtEnd(l.scrollEndThreshold)&&(b===0||a.getItemKey(x-1)!==C)&&(d=R)}}this.options=a,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let p=!1,m=0;if(u&&this.scrollOffset!==null){const[b,x]=u,E=this.getMeasurements(),{count:N,getItemKey:C}=this.options;let S=0;for(;S<N&&C(S)!==b;)S++;if(S<N){const k=E[S];if(k){const A=Math.max(0,k.start+x);A!==this.scrollOffset&&(m=A-this.scrollOffset,this.scrollOffset=A,p=!0)}}}(p||d)&&(this.pendingScrollAnchor=[p?u[0]:null,p?u[1]:0,d,m])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Il(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,l)=>{if(l&&this._intendedScrollOffset===null&&a===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(a-this._intendedScrollOffset)<1.5&&(a=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const u=this.getScrollOffset();this.scrollDirection=l?u===a?this.scrollDirection:u<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const a=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},u=()=>{this._iosTouching=!1,!(!G1()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,Tm),a.addEventListener("touchend",u,Tm),this.unsubs.push(()=>{a.removeEventListener("touchstart",l),a.removeEventListener("touchend",u),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[a,l,u,d]=s;a!==null&&!u&&(G1()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?d!==0&&(this._iosDeferredAdjustment+=d):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),u&&this.scrollToEnd({behavior:u})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Il(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,s,a,l,u,d,h)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:l,lanes:u,laneAssignmentMode:d,gap:h}),{key:!1}),this.getMeasurements=Il(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:l,lanes:u,laneAssignmentMode:d,gap:h},p)=>{const m=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const S of this.laneAssignments.keys())S>=n&&this.laneAssignments.delete(S);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(S=>{this.itemSizeCache.set(S.key,S.size)}));const b=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),u===1){const S=n*2;let k=this._flatMeasurements;if(!k||k.length<S){const M=new Float64Array(S);k&&b>0&&M.set(k.subarray(0,b*2)),k=M,this._flatMeasurements=k}let A;if(b===0)A=r+s;else{const M=b-1;A=k[M*2]+k[M*2+1]+h}for(let M=b;M<n;M++){const _=a(M),O=m.get(_),j=typeof O=="number"?O:this.options.estimateSize(M);k[M*2]=A,k[M*2+1]=j,A+=j+h}const R=yse(n,k,a);return this.measurementsCache=R,R}const x=this.measurementsCache.slice(0,b),E=new Array(u).fill(void 0),N=new Float64Array(u);let C=0;for(let S=0;S<b;S++){const k=x[S];k&&(E[k.lane]===void 0&&C++,E[k.lane]=S,N[k.lane]=k.end)}for(let S=b;S<n;S++){const k=a(S),A=this.laneAssignments.get(S);let R,M;const _=d==="estimate"||m.has(k);if(A!==void 0&&this.options.lanes>1){R=A;const B=E[R],K=B!==void 0?x[B]:void 0;M=K?K.end+h:r+s}else if(C===u){let B=0,K=N[0],X=E[0];for(let Z=1;Z<u;Z++){const te=N[Z];(te<K||te===K&&E[Z]<X)&&(B=Z,K=te,X=E[Z])}R=B,M=K+h,_&&this.laneAssignments.set(S,R)}else R=S%this.options.lanes,M=r+s,_&&this.laneAssignments.set(S,R);const O=m.get(k),j=typeof O=="number"?O:this.options.estimateSize(S),H=M+j;x[S]={index:S,start:M,size:j,end:H,key:k,lane:R},E[R]===void 0&&C++,E[R]=S,N[R]=H}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Il(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,a)=>n.length===0||r===0?(this.range=null,null):(this.range=Mse(n,r,s,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Il(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,a,l)=>a===null||l===null?[]:n({startIndex:a,endIndex:l,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,s-a),u=Math.min(this.options.count-1,s+a);return n>=l&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((l,u)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(u))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s,a;if(n<0||n>=this.options.count)return;let l,u,d;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)d=this.options.getItemKey(n),u=h[n*2],l=h[n*2+1];else{const b=this.measurementsCache[n];if(!b)return;d=b.key,u=b.start,l=b.size}const p=this.itemSizeCache.get(d)??l,m=r-p;if(m!==0){const b=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=b?this.getTotalSize():0,E=this.getScrollOffset()+this.scrollAdjustments,C=!this.itemSizeCache.has(d)?u<E:u+p<=E&&this.scrollDirection!=="backward",S=((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:d,start:u,size:l,end:u+l,lane:0},m,this):C);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(d,r),this.itemSizeCacheVersion++;let k=!1;b?k=this.applyScrollAdjustment(this.getTotalSize()-x):S&&(k=this.applyScrollAdjustment(m)),this.notify(k)}},this.getVirtualItems=Il(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let a=0,l=n.length;a<l;a++){const u=n[a],d=r[u];s.push(d)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,a=this.options.lanes===1&&s!=null,l=V5(0,r.length-1,a?u=>s[u*2]:u=>Sk(r[u]).start,n);return Sk(r[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),l=this.getScrollOffset();r==="auto"&&(r=n>=l+a?"end":"start"),r==="center"?n+=(s-a)/2:r==="end"&&(n-=a);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),a=this.getScrollOffset(),l=this.measurementsCache[n];if(!l)return;if(r==="auto")if(l.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(l.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const u=r==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,r,l.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const a=this.getOffsetForAlignment(n,r),l=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,r);if(!a)return;const[l,u]=a,d=this.now();this.scrollState={index:n,align:u,behavior:s,startedAt:d,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const a=r.length-1,l=this._flatMeasurements;l!=null?s=l[a*2]+l[a*2+1]:s=((n=r[a])==null?void 0:n.end)??0}else{const a=Array(this.options.lanes).fill(null);let l=r.length-1;for(;l>=0&&a.some(u=>u===null);){const u=r[l];a[u.lane]===null&&(a[u.lane]=u.end),l--}s=Math.max(...a.filter(u=>u!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:G1()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,a=1,l=s!==this.scrollState.lastTargetOffset;if(!l&&vse(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const u=this.getSize()||600,d=Math.abs(s-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&d>u;this.scrollState.lastTargetOffset=s,h||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const V5=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,a=n(s);if(a<r)e=s+1;else if(a>r)t=s-1;else return s}return e>0?e-1:0};function Ose(e,t,n){let r=0;for(;r<=t;){const s=(r+t)/2|0,a=e[s*2];if(a<n)r=s+1;else if(a>n)t=s-1;else return s}return r>0?r-1:0}function Mse(e,t,n,r,s){const a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&s!==null){const h=Ose(s,a,n);let p=h;const m=n+t;for(;p<a&&s[p*2]+s[p*2+1]<m;)p++;return{startIndex:h,endIndex:p}}let u=V5(0,a,h=>e[h].start,n),d=u;if(r===1)for(;d<a&&e[d].end<n+t;)d++;else if(r>1){const h=Array(r).fill(0);for(;d<a&&h.some(m=>m<n+t);){const m=e[d];h[m.lane]=m.end,d++}const p=Array(r).fill(n+t);for(;u>=0&&p.some(m=>m>=n);){const m=e[u];p[m.lane]=m.start,u--}u=Math.max(0,u-u%r),d=Math.min(a,d+(r-1-d%r))}return{startIndex:u,endIndex:d}}const K1=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Lse({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=y.useReducer(p=>p+1,0)[1],a=y.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;const l=p=>{const m=a.current;if(!m.enabled||!m.container)return;const b=p.getTotalSize();if(b!==m.lastSize){m.lastSize=b;const x=p.options.horizontal?"width":"height";m.container.style[x]=`${b}px`}},u=p=>{const m=a.current;if(!m.enabled||!m.container)return;l(p);const b=!!p.options.horizontal,x=m.mode==="transform",E=b?"left":"top",N=p.options.scrollMargin,C=p.getVirtualItems();for(const S of C){const k=S.start-N,A=p.elementsCache.get(S.key);A&&m.lastPositions.get(A)!==k&&(m.lastPositions.set(A,k),x?A.style.transform=b?`translate3d(${k}px, 0, 0)`:`translate3d(0, ${k}px, 0)`:A.style[E]=`${k}px`)}},d={...r,onChange:(p,m)=>{var b;const x=a.current;let E=!0;if(x.enabled){u(p);const N=p.range,C=x.prevRange;E=!C||C.isScrolling!==p.isScrolling||C.startIndex!==N?.startIndex||C.endIndex!==N?.endIndex,E&&(x.prevRange=N?{startIndex:N.startIndex,endIndex:N.endIndex,isScrolling:p.isScrolling}:null)}E&&(e&&m?or.flushSync(s):s()),(b=r.onChange)==null||b.call(r,p,m)}},[h]=y.useState(()=>{const p=new Ise(d);return Object.assign(p,{containerRef:m=>{const b=a.current;if(b.container=m,b.lastSize=null,m&&b.enabled){const x=p.getTotalSize();b.lastSize=x;const E=p.options.horizontal?"width":"height";m.style[E]=`${x}px`}}})});return h.setOptions(d),K1(()=>h._didMount(),[]),K1(()=>(l(h),h._willUpdate())),K1(()=>{u(h)}),h}function Dse(e){return Lse({observeElementRect:Cse,observeElementOffset:Nse,scrollToFn:Rse,...e})}/*!---------------------------------------------------------------------------------------------
675
- * Copyright (c) StackBlitz. All rights reserved.
676
- * Licensed under the MIT License. See License.txt in the project root for license information.
677
- *--------------------------------------------------------------------------------------------*/const jse={damping:.7,stiffness:.05,mass:1.25},Pse=70,Bse=1e3/60,zse=350;let Sp=!1;globalThis.document?.addEventListener("mousedown",()=>{Sp=!0});globalThis.document?.addEventListener("mouseup",()=>{Sp=!1});globalThis.document?.addEventListener("click",()=>{Sp=!1});const Use=(e={})=>{const[t,n]=y.useState(!1),[r,s]=y.useState(e.initial!==!1),[a,l]=y.useState(!1),u=y.useRef(null);u.current=e;const d=y.useCallback(()=>{if(!Sp)return!1;const k=window.getSelection();if(!k||!k.rangeCount)return!1;const A=k.getRangeAt(0);return A.commonAncestorContainer.contains(C.current)||C.current?.contains(A.commonAncestorContainer)},[]),h=y.useCallback(k=>{m.isAtBottom=k,s(k)},[]),p=y.useCallback(k=>{m.escapedFromLock=k,n(k)},[]),m=y.useMemo(()=>{let k;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return C.current?.scrollTop??0},set scrollTop(A){if(C.current){const{scrollBehavior:R}=getComputedStyle(C.current);R!=="auto"&&(C.current.style.scrollBehavior="auto"),C.current.scrollTop=A,m.ignoreScrollToTop=C.current.scrollTop,R!=="auto"&&(C.current.style.scrollBehavior=R)}},get targetScrollTop(){return!C.current||!S.current?0:C.current.scrollHeight-1-C.current.clientHeight},get calculatedTargetScrollTop(){if(!C.current||!S.current)return 0;const{targetScrollTop:A}=this;if(!e.targetScrollTop)return A;if(k?.targetScrollTop===A)return k.calculatedScrollTop;const R=Math.max(Math.min(e.targetScrollTop(A,{scrollElement:C.current,contentElement:S.current}),A),0);return k={targetScrollTop:A,calculatedScrollTop:R},requestAnimationFrame(()=>{k=void 0}),R},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Pse}}},[]),b=y.useCallback((k={})=>{typeof k=="string"&&(k={animation:k}),k.preserveScrollPosition||h(!0);const A=Date.now()+(Number(k.wait)||0),R=W1(u.current,k.animation),{ignoreEscapes:M=!1}=k;let _,O=m.calculatedTargetScrollTop;k.duration instanceof Promise?k.duration.finally(()=>{_=Date.now()}):_=A+(k.duration??0);const j=async()=>{const H=new Promise(requestAnimationFrame).then(()=>{if(!m.isAtBottom)return m.animation=void 0,!1;const{scrollTop:B}=m,K=performance.now(),X=(K-(m.lastTick??K))/Bse;if(m.animation||(m.animation={behavior:R,promise:H,ignoreEscapes:M}),m.animation.behavior===R&&(m.lastTick=K),d()||A>Date.now())return j();if(B<Math.min(O,m.calculatedTargetScrollTop)){if(m.animation?.behavior===R){if(R==="instant")return m.scrollTop=m.calculatedTargetScrollTop,j();m.velocity=(R.damping*m.velocity+R.stiffness*m.scrollDifference)/R.mass,m.accumulated+=m.velocity*X,m.scrollTop+=m.accumulated,m.scrollTop!==B&&(m.accumulated=0)}return j()}return _>Date.now()?(O=m.calculatedTargetScrollTop,j()):(m.animation=void 0,m.scrollTop<m.calculatedTargetScrollTop?b({animation:W1(u.current,u.current.resize),ignoreEscapes:M,duration:Math.max(0,_-Date.now())||void 0}):m.isAtBottom)});return H.then(B=>(requestAnimationFrame(()=>{m.animation||(m.lastTick=void 0,m.velocity=0)}),B))};return k.wait!==!0&&(m.animation=void 0),m.animation?.behavior===R?m.animation.promise:j()},[h,d,m]),x=y.useCallback(()=>{p(!0),h(!1)},[p,h]),E=y.useCallback(({target:k})=>{if(k!==C.current)return;const{scrollTop:A,ignoreScrollToTop:R}=m;let{lastScrollTop:M=A}=m;m.lastScrollTop=A,m.ignoreScrollToTop=void 0,R&&R>A&&(M=R),l(m.isNearBottom),setTimeout(()=>{if(m.resizeDifference||A===R)return;if(d()){p(!0),h(!1);return}const _=A>M,O=A<M;if(m.animation?.ignoreEscapes){m.scrollTop=M;return}O&&(p(!0),h(!1)),_&&p(!1),!m.escapedFromLock&&m.isNearBottom&&h(!0)},1)},[p,h,d,m]),N=y.useCallback(({target:k,deltaY:A})=>{let R=k;for(;!["scroll","auto"].includes(getComputedStyle(R).overflow);){if(!R.parentElement)return;R=R.parentElement}R===C.current&&A<0&&C.current.scrollHeight>C.current.clientHeight&&!m.animation?.ignoreEscapes&&(p(!0),h(!1))},[p,h,m]),C=wk(k=>{C.current?.removeEventListener("scroll",E),C.current?.removeEventListener("wheel",N),k?.addEventListener("scroll",E,{passive:!0}),k?.addEventListener("wheel",N,{passive:!0})},[]),S=wk(k=>{if(m.resizeObserver?.disconnect(),m.resizeObserver=void 0,!k)return;let A;m.resizeObserver=new ResizeObserver(([R])=>{const{height:M}=R.contentRect,_=M-(A??M);if(m.resizeDifference=_,m.scrollTop>m.targetScrollTop&&(m.scrollTop=m.targetScrollTop),l(m.isNearBottom),_>=0){const O=W1(u.current,A?u.current.resize:u.current.initial);b({animation:O,wait:!0,preserveScrollPosition:!0,duration:O==="instant"?void 0:zse})}else m.isNearBottom&&(p(!1),h(!0));A=M,requestAnimationFrame(()=>{setTimeout(()=>{m.resizeDifference===_&&(m.resizeDifference=0)},1)})}),m.resizeObserver?.observe(k)},[]);return{contentRef:S,scrollRef:C,scrollToBottom:b,stopScroll:x,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:m}};function wk(e,t){const n=y.useCallback(r=>(n.current=r,e(r)),t);return n}const X1=new Map;function W1(...e){const t={...jse};let n=!1;for(const s of e){if(s==="instant"){n=!0;continue}typeof s=="object"&&(n=!1,t.damping=s.damping??t.damping,t.stiffness=s.stiffness??t.stiffness,t.mass=s.mass??t.mass)}const r=JSON.stringify(t);return X1.has(r)||X1.set(r,Object.freeze(t)),n?"instant":X1.get(r)}/*!---------------------------------------------------------------------------------------------
678
- * Copyright (c) StackBlitz. All rights reserved.
679
- * Licensed under the MIT License. See License.txt in the project root for license information.
680
- *--------------------------------------------------------------------------------------------*/const q5=y.createContext(null),Hse=typeof window<"u"?y.useLayoutEffect:y.useEffect;function Sm({instance:e,children:t,resize:n,initial:r,mass:s,damping:a,stiffness:l,targetScrollTop:u,contextRef:d,...h}){const p=y.useRef(null),m=y.useCallback((M,_)=>(R?.targetScrollTop??u)?.(M,_)??M,[u]),b=Use({mass:s,damping:a,stiffness:l,resize:n,initial:r,targetScrollTop:m}),{scrollRef:x,contentRef:E,scrollToBottom:N,stopScroll:C,isAtBottom:S,escapedFromLock:k,state:A}=e??b,R=y.useMemo(()=>({scrollToBottom:N,stopScroll:C,scrollRef:x,isAtBottom:S,escapedFromLock:k,contentRef:E,state:A,get targetScrollTop(){return p.current},set targetScrollTop(M){p.current=M}}),[N,S,E,x,C,k,A]);return y.useImperativeHandle(d,()=>R,[R]),Hse(()=>{x.current&&getComputedStyle(x.current).overflow==="visible"&&(x.current.style.overflow="auto")},[]),y.createElement(q5.Provider,{value:R},y.createElement("div",{...h},typeof t=="function"?t(R):t))}(function(e){function t({children:n,scrollClassName:r,...s}){const a=kv();return y.createElement("div",{ref:a.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},y.createElement("div",{...s,ref:a.contentRef},typeof n=="function"?n(a):n))}e.Content=t})(Sm||(Sm={}));function kv(){const e=y.useContext(q5);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}function Fse({className:e,children:t,resize:n="smooth",...r}){return f.jsx(Sm,{"data-slot":"conversation",className:xe("relative flex-1 overflow-y-auto",e),initial:"instant",resize:n,role:"log",...r,children:t})}function $se({className:e,children:t,...n}){return f.jsx(Sm.Content,{"data-slot":"conversation-content",className:xe("mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] flex-col gap-4 px-4 py-4",e),...n,children:t})}function Vse({className:e}){const{isAtBottom:t,scrollToBottom:n}=kv();return t?null:f.jsx(Je,{variant:"outline",size:"icon","aria-label":"Scroll to bottom","data-slot":"conversation-scroll-button",className:xe("absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)",e),onClick:()=>void n(),children:f.jsx(J7,{className:"size-4"})})}function qse({item:e,href:t,className:n}){const r=Kr(),s=e.path.split("/").pop()||e.path;return r?f.jsxs("div",{"data-slot":"file-delivered",className:xe("flex w-full items-baseline gap-2",n),children:[f.jsx(Or,{className:"text-fg-4",children:"◇"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate text-body-sm leading-5",children:[f.jsx("span",{className:"font-medium text-fg-1",children:s}),f.jsxs("span",{className:"text-fg-4",children:[" · ",No(e.bytes),e.description?` · ${e.description}`:""]})]}),t?f.jsx("a",{href:t,download:s,className:"shrink-0 text-label text-fg-3 underline-offset-2 hover:text-fg-1 hover:underline",children:"download"}):null]}):f.jsxs("div",{"data-slot":"file-delivered",className:xe("flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5",n),children:[f.jsx(Ay,{className:"size-4 shrink-0 text-fg-3"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-mono text-body-sm font-medium text-fg-1",children:s}),f.jsxs("div",{className:"truncate text-label text-fg-4",children:[No(e.bytes),e.description?` · ${e.description}`:""]})]}),t?f.jsxs("a",{href:t,download:s,className:xe("flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5","text-body-sm text-fg-2 transition-colors hover:bg-surface-hover"),children:[f.jsx(L_,{className:"size-3.5"}),"Download"]}):null]})}const Cm=["⋄","◇","◈","◆"],Yse=150,Gse=Cm[Cm.length-1];function Kse(){const[e,t]=y.useState(!1);return y.useEffect(()=>{const n=window.matchMedia?.("(prefers-reduced-motion: reduce)");if(!n)return;t(n.matches);const r=()=>t(n.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}function Y5(e){const t=Kse(),n=e&&!t,[r,s]=y.useState(0);return y.useEffect(()=>{if(!n)return;const a=setInterval(()=>s(l=>l+1),Yse);return()=>clearInterval(a)},[n]),n?Cm[r%Cm.length]:Gse}const Q1=["Working","Thinking","Churning","Pondering","Whirring","Computing","Percolating","Tinkering","Deliberating","Simmering","Crunching","Noodling"],Xse=4e3;function Wse({label:e,startedAt:t,tokens:n,className:r}){const s=Kr(),a=Y5(s);if(!s)return f.jsxs("div",{"data-slot":"loader",className:xe("flex items-center gap-2 py-1 text-body-sm text-fg-4",r),children:[f.jsx("span",{className:"flex items-center gap-1",children:[0,1,2].map(h=>f.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-fg-4",style:{animationDelay:`${h*160}ms`}},h))}),e?f.jsx("span",{children:e}):null]});const l=t===void 0?void 0:Date.now()-t,u=e??Q1[Math.floor((l??0)/Xse)%Q1.length]??Q1[0],d=[l!==void 0?Pb(l):void 0,n!==void 0?`↓ ${us(n)}`:void 0].filter(Boolean);return f.jsxs("div",{"data-slot":"loader",className:xe("flex items-baseline gap-2",r),children:[f.jsx(Or,{className:s?"text-fg-3":"text-accent",children:a}),f.jsxs("span",{className:"min-w-0 flex-1 text-body-sm leading-5 text-fg-3",children:[u,"…"," ",d.length?f.jsxs("span",{className:"text-label text-fg-4",children:["(",d.join(" · "),")"]}):null]})]})}function kk({from:e,className:t,children:n,...r}){const s=Kr();return f.jsx("div",{"data-slot":"message","data-from":e,className:xe("flex w-full",s?xe("flex-row gap-2",e==="user"&&"-mx-1 rounded-sm bg-surface px-1"):"flex-col items-start gap-1",t),...r,children:s?f.jsxs(f.Fragment,{children:[f.jsx(Or,{className:e==="user"?"text-fg-2":"text-fg-3",children:e==="user"?"❯":"●"}),f.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:n})]}):n})}function Nk({className:e,...t}){const n=Kr();return f.jsx("div",{"data-slot":"message-content",className:xe("min-w-0",n?xe("w-full text-fg-1",hV,"in-data-[from=user]:whitespace-pre-wrap"):xe("text-body-sm leading-6 text-fg-1","in-data-[from=user]:max-w-[85%] in-data-[from=user]:rounded-lg in-data-[from=user]:rounded-bl-sm","in-data-[from=user]:bg-accent-bg in-data-[from=user]:px-3 in-data-[from=user]:py-2","in-data-[from=user]:whitespace-pre-wrap","in-data-[from=assistant]:w-full"),e),...t})}function Qse({text:e,className:t}){const n=V$(e);if(n.length===0)return f.jsx("span",{className:t,children:e});const r=[];let s=0;for(const[a,l]of n.entries())l.start>s&&r.push(e.slice(s,l.start)),r.push(f.jsx("span",{className:xe("font-mono",l.kind==="file"?"text-accent":"text-info"),children:l.text},`${l.start}-${a}`)),s=l.end;return s<e.length&&r.push(e.slice(s)),f.jsx("span",{className:t,children:r.map((a,l)=>f.jsx(y.Fragment,{children:a},l))})}function Zse({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){const s=Kr(),[a,l]=y.useState(n??t),u=y.useRef(!1);y.useEffect(()=>{if(!u.current)if(t)l(!0);else{const h=setTimeout(()=>l(!1),600);return()=>clearTimeout(h)}},[t]);const d=e.trim()!=="";return!d&&!t?null:f.jsxs("div",{"data-slot":"reasoning","data-streaming":t||void 0,className:xe("w-full",r),children:[f.jsxs("button",{type:"button",disabled:!d,onClick:()=>{u.current=!0,l(h=>!h)},className:xe("flex items-baseline text-label text-fg-3 transition-colors outline-none disabled:cursor-default hover:text-fg-1 disabled:hover:text-fg-3",s?"w-full gap-2":"items-center gap-1.5"),children:[s?f.jsx(Or,{className:"text-fg-4",children:"✻"}):f.jsx(oB,{className:"size-3.5"}),f.jsx("span",{className:xe(s&&"leading-5"),children:t?"Thinking…":"Thought process"}),d&&!s?f.jsx(O_,{className:xe("size-3.5 transition-transform",a&&"rotate-180")}):null]}),a&&d?f.jsx("div",{className:xe("border-l border-border text-body-sm text-fg-3 [&_*]:text-fg-3",s?"ml-[0.4375rem] mt-0.5 pl-2 leading-5":"mt-2 border-l-2 pl-3"),children:f.jsx(Cv,{streaming:t,children:e})}):null]})}function Jse({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:s}){const a=[{icon:fz,text:"Tell the agent what to do."},...t?[{icon:Gz,text:"Type / for the CLI’s slash commands."}]:[],...n?[{icon:np,text:"Type $ to draft a message for one of the agent’s skills."}]:[],...r?[{icon:rB,text:"Type @ to search this project’s files."}]:[]];return f.jsxs("div",{className:xe("flex flex-col items-center gap-4 py-10",s),children:[f.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3",children:f.jsx(Ab,{className:"size-5"})}),e?f.jsx("p",{className:"max-w-full truncate font-mono text-label text-fg-4",children:e}):null,f.jsx("ul",{className:"w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface",children:a.map(l=>f.jsxs("li",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[f.jsx(l.icon,{className:"size-4 shrink-0 text-fg-4"}),f.jsx("span",{className:"text-body-sm text-fg-3",children:l.text})]},l.text))})]})}const Ak=2e3,eie=new Set(["CodexImageGeneration","CodexImageView"]),tie=e=>{if(!eie.has(e.name))return;const t=e.input,n=t?.savedPath??t?.path;return typeof n=="string"?n:void 0},nie={running:{label:"Running",variant:"info",busy:!0},pending:{label:"Executing",variant:"info",busy:!0},deferred:{label:"Deferred",variant:"accent",busy:!1},settled:{label:"Done",variant:"success",busy:!1},failed:{label:"Error",variant:"danger",busy:!1}},rie={running:"text-info",pending:"text-info",deferred:"text-accent",settled:"text-fg-4",failed:"text-danger"},sie={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",jsonc:"json",md:"md",mdx:"md",css:"css",scss:"scss",html:"html",xml:"xml",yml:"yaml",yaml:"yaml",toml:"toml",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",hpp:"cpp",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",sql:"sql",graphql:"graphql",dockerfile:"dockerfile",diff:"diff",patch:"diff"};function iie(e){if(e.name==="Bash"||e.name==="CodexCommand")return"bash";if(e.name==="CodexFileChange")return"diff";const t=e.input,n=t?.file_path??t?.path;if(typeof n!="string")return;const r=n.slice(n.lastIndexOf(".")+1).toLowerCase();return sie[r]}function aie({item:e,hostImage:t,className:n}){const r=Kr(),[s,a]=y.useState(!1),[l,u]=y.useState(!1),d=tie(e),h=e.status??(e.result===void 0?"running":"settled"),p=nie[h],m=h==="failed"||e.result?.isError===!0,b=Y5(r&&p.busy),x=UR(e.name),E=e.result?.text??"",N=!l&&E.length>Ak,C=N?E.slice(0,Ak):E,S=r?"plain":"panel",k=r?uie:lie,A=s?f.jsxs("div",{className:xe("flex flex-col",r?"gap-1 py-1":"gap-2 border-t border-border p-2.5"),children:[f.jsx(k,{code:JSON.stringify(e.input,null,2),language:"json",label:"Parameters",variant:S}),e.logs?.length?f.jsx(k,{code:e.logs.join(`
681
- `),label:"Logs",variant:S}):null,e.result!==void 0?f.jsxs("div",{children:[f.jsx(k,{code:C||"(empty result)",language:iie(e),label:m?"Error":"Result",variant:S,className:xe(m&&(r?"[&_pre]:text-danger":"border-danger/40 [&_pre]:text-danger"))}),N?f.jsxs("button",{type:"button",className:"mt-1 text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>u(!0),children:["Show all ",E.length.toLocaleString()," chars"]}):null]}):null]}):null,R=d&&t?f.jsx(cie,{path:d,load:t,lines:r}):null;return r?f.jsxs("div",{"data-slot":"tool-call","data-state":h,className:xe("w-full",n),children:[f.jsxs("button",{type:"button",onClick:()=>a(M=>!M),className:"flex w-full items-baseline gap-2 text-left outline-none",children:[f.jsx(Or,{className:h==="settled"&&!m&&HV(e.name)?"text-success":rie[h],children:p.busy?b:"●"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate text-body-sm leading-5 text-fg-3",children:[f.jsx("span",{className:"font-medium text-fg-1",children:e.name}),f.jsxs("span",{className:"text-fg-4",children:["(",zb(e.input),")"]})]}),e.backend&&e.backend!=="server"?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:e.backend}):null,h==="deferred"?f.jsx(aw,{className:"size-3 shrink-0 self-center text-fg-4"}):null,m&&!p.busy?f.jsx("span",{className:"shrink-0 text-label text-danger",children:"error"}):null]}),!s&&E?f.jsxs("div",{className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-fg-4",children:"⎿"}),f.jsx("span",{className:xe("min-w-0 flex-1 truncate text-label leading-5",m?"text-danger":"text-fg-4"),children:oie(E)})]}):null,R,A?f.jsx("div",{className:Ea,children:A}):null]}):f.jsxs("div",{"data-slot":"tool-call","data-state":h,className:xe("w-full overflow-hidden rounded-lg border border-border bg-surface",n),children:[f.jsxs("button",{type:"button",onClick:()=>a(M=>!M),className:xe("flex w-full items-center gap-2 px-3 py-2 text-left transition-colors outline-none","hover:bg-surface-hover focus-visible:bg-surface-hover"),children:[f.jsx(x,{className:"size-3.5 shrink-0 text-fg-3"}),f.jsx("span",{className:"shrink-0 font-mono text-body-sm font-medium text-fg-1",children:e.name}),e.backend&&e.backend!=="server"?f.jsx(gn,{variant:"neutral",className:"shrink-0",children:e.backend}):null,f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:zb(e.input)}),f.jsxs(gn,{variant:p.variant,dot:!p.busy,className:"shrink-0 gap-1",children:[p.busy?f.jsx(xn,{className:"size-3 text-current"}):null,h==="deferred"?f.jsx(aw,{className:"size-3 text-current"}):null,p.label]}),f.jsx(O_,{className:xe("size-3.5 shrink-0 text-fg-4 transition-transform",s&&"rotate-180")})]}),R,A]})}function oie(e){const t=e.split(`
682
- `).find(s=>s.trim()!=="")??"",n=e.trimEnd().split(`
683
- `).length-1,r=t.trim();return n>0?`${r} (+${n} lines)`:r}function lie({code:e,label:t,variant:n,className:r}){return f.jsx(lR,{code:e,label:t,variant:n,className:r})}function uie({code:e,label:t,language:n,className:r}){return f.jsx(wv,{code:e,label:t,language:n,className:r})}function cie({path:e,load:t,lines:n}){const[r,s]=y.useState();return y.useEffect(()=>{let a=!1;return s(void 0),t(e).then(l=>{a||s(l)}).catch(()=>{}),()=>{a=!0}},[e,t]),r?f.jsx("div",{className:xe(n?xe("py-1",Ea):"border-t border-border p-2.5"),children:f.jsx("img",{src:r,alt:e.split("/").pop()??"Generated image",className:"max-h-96 w-auto max-w-full rounded-md border border-border"})}):null}function die({item:e}){return Kr()?f.jsxs("div",{"data-slot":"turn-result",className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-fg-4",children:"·"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("span",{className:xe("text-label leading-5",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",Pb(e.durationMs)," ·"," ",Sa(e.totalCostUsd)]}),e.errors?.length?f.jsx("ul",{className:"flex flex-col",children:e.errors.map((n,r)=>f.jsx("li",{className:"text-label leading-5 break-words text-danger",children:n},r))}):null]})]}):f.jsxs("div",{"data-slot":"turn-result",className:"py-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"h-px flex-1 bg-border"}),f.jsxs("span",{className:xe("font-mono text-label",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",Pb(e.durationMs)," ·"," ",Sa(e.totalCostUsd)]}),f.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.errors?.length?f.jsx("ul",{className:"mt-1 flex flex-col gap-0.5 text-center",children:e.errors.map((n,r)=>f.jsx("li",{className:"text-label break-words text-danger",children:n},r))}):null]})}function fie({item:e}){return Kr()?f.jsxs("div",{"data-slot":"notice",className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:e.level==="error"?"text-danger":"text-fg-4",children:"!"}),f.jsx("span",{className:xe("min-w-0 flex-1 text-body-sm leading-5",e.level==="error"?"text-danger":"text-fg-3"),children:e.text})]}):f.jsx("div",{"data-slot":"notice",className:xe("rounded-md border px-3 py-2 text-body-sm",e.level==="error"?"border-transparent bg-danger-bg text-danger":"border-border bg-surface text-fg-3"),children:e.text})}function hie({item:e,fileUrl:t,attachmentUrl:n,hostImage:r}){switch(e.kind){case"user":return f.jsxs(kk,{from:"user",children:[e.attachments?.length?f.jsx(xie,{attachments:e.attachments,attachmentUrl:n}):null,e.text?f.jsx(Nk,{children:f.jsx(Qse,{text:e.text})}):null]});case"assistant_text":return f.jsx(kk,{from:"assistant",children:f.jsx(Nk,{children:f.jsx(Cv,{streaming:e.streaming,children:e.text})})});case"thinking":return f.jsx(Zse,{isStreaming:e.id==="streaming-thinking",children:e.text});case"tool_call":return f.jsx(aie,{item:e,hostImage:r});case"turn_result":return f.jsx(die,{item:e});case"notice":return f.jsx(fie,{item:e});case"file_delivered":return f.jsx(qse,{item:e,href:t?.(e.path)});default:return null}}function mie({line:e,since:t}){const n=Kr(),r=t===void 0?void 0:du(t),s=r?`${e} · last here ${r}`:e;return n?f.jsxs("div",{"data-slot":"recap",className:"flex items-baseline gap-2 py-0.5",children:[f.jsx(Or,{className:"text-fg-3",children:"※"}),f.jsxs("span",{className:"min-w-0 flex-1 text-label leading-5 text-fg-3",children:[f.jsx("span",{className:"text-fg-2",children:"recap:"})," ",s]})]}):f.jsxs("div",{"data-slot":"recap",className:"flex items-center gap-2 py-1",children:[f.jsx("div",{className:"h-px flex-1 bg-border"}),f.jsxs("span",{className:"font-mono text-label text-fg-3",children:["※ recap: ",s]}),f.jsx("div",{className:"h-px flex-1 bg-border"})]})}function pie(e,t,n=400){const[r,s]=y.useState(!1);return y.useEffect(()=>{if(r||e===0)return;const a=setTimeout(()=>s(!0),n);return()=>clearTimeout(a)},[e,r,n]),r&&(t==="running"||t==="starting")}function gie(e){const t=e==="running"||e==="starting",[n,r]=y.useState(void 0);return y.useEffect(()=>{r(s=>t?s??Date.now():void 0)},[t]),t?n:void 0}function bie(e){if(e.status!=="running"&&e.status!=="starting")return!1;const t=e.items.at(-1);return t?t.kind==="assistant_text"&&t.streaming||t.kind==="thinking"&&t.id==="streaming-thinking"?!1:t.kind!=="turn_result"||e.status==="running":!0}function xie({attachments:e,attachmentUrl:t}){return f.jsx("div",{className:"mb-1 flex flex-wrap justify-start gap-1.5",children:e.map(n=>{const r=t?.(n.id);return n.mediaType.startsWith("image/")&&r?f.jsx("img",{src:r,alt:n.name,className:"size-20 rounded-md border border-border object-cover"},n.id):f.jsx("span",{className:"rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3",children:n.name},n.id)})})}function yie(e,t){if("parentToolUseId"in e&&e.parentToolUseId!=null)return t?"ml-3.5 border-l border-border pl-2":"border-l-2 border-border pl-3"}function vie({rows:e,boundary:t,since:n,lines:r,gap:s,fileUrl:a,attachmentUrl:l,hostImage:u,jumpToRecapRef:d}){const h=kv(),[p,m]=y.useState(null);y.useEffect(()=>{m(h.scrollRef.current)},[h.scrollRef]);const b=Dse({count:e.length,getScrollElement:()=>(p&&b.scrollElement!==p&&(b.scrollOffset=p.scrollTop),p),estimateSize:()=>(r?32:100)+s.px,overscan:8,getItemKey:E=>e[E].key,useFlushSync:!0});b.shouldAdjustScrollPositionOnItemSizeChange=(E,N,C)=>{if(h.state.isAtBottom)return!1;const S=(C.scrollOffset??0)+C.scrollAdjustments;return C.itemSizeCache.has(E.key)?E.end<=S&&C.scrollDirection!=="backward":E.start<S};const x=y.useRef(void 0);return y.useEffect(()=>()=>clearTimeout(x.current),[]),y.useEffect(()=>{if(d)return d.current=()=>{const E=e.findIndex(C=>C.key==="recap");if(E<0)return;h.stopScroll(),clearTimeout(x.current);const N=C=>{const S=p?.querySelector('[data-slot="recap"]');if(S){S.scrollIntoView({behavior:"smooth",block:"center"});return}C>=6||(b.scrollToIndex(E,{align:"center",behavior:"smooth"}),x.current=setTimeout(()=>N(C+1),300))};N(0)},()=>{d.current=null}}),f.jsx("div",{"data-slot":"transcript-rows",className:"relative w-full",style:{height:b.getTotalSize()},children:b.getVirtualItems().map(E=>{const N=e[E.index];return f.jsx("div",{ref:b.measureElement,"data-index":E.index,className:xe("absolute inset-x-0 top-0",E.index>0&&s.className),style:{transform:`translateY(${E.start}px)`},children:"item"in N?f.jsx("div",{className:xe(r&&"-mx-1 rounded-sm px-1 py-0.5 transition-colors hover:bg-surface-hover",t!==void 0&&N.index<t&&"opacity-45",yie(N.item,r)),children:f.jsx(hie,{item:N.item,fileUrl:a,attachmentUrl:l,hostImage:u})}):f.jsx(mie,{line:N.line,since:n})},N.key)})})}function Eie({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:s,variant:a="cards",density:l="comfortable",catchUp:u,jumpToRecapRef:d,className:h}){const p=a==="lines",m=fV[a][l],b=gie(e.status),x=pie(e.items.length,e.status),E=u&&u.from>0&&u.from<e.items.length?u.from:void 0,N=y.useMemo(()=>E===void 0?void 0:lV(oV(e,E)),[e,E]),C=y.useMemo(()=>{const S=[];for(const[k,A]of e.items.entries())k===E&&N&&S.push({key:"recap",line:N}),S.push({key:`${A.kind}:${A.id}`,item:A,index:k});return S},[e.items,E,N]);return f.jsx(DR,{value:a,children:f.jsxs(Fse,{className:h,resize:x?"smooth":"instant",children:[f.jsxs($se,{className:xe(p&&"gap-0 px-2 py-1.5"),children:[e.items.length===0&&e.status!=="starting"?f.jsx(Jse,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(S=>S.enabled),canBrowseFiles:r}):f.jsx(vie,{rows:C,boundary:E,since:u?.since,lines:p,gap:m,fileUrl:t,attachmentUrl:n,hostImage:s,jumpToRecapRef:d}),bie(e)?f.jsx(Wse,{label:e.status==="starting"?"Starting session…":void 0,startedAt:b,tokens:e.contextUsage?.totalTokens,className:xe(p&&"py-0.5")}):null]}),f.jsx(Vse,{})]})})}function Tie(e){const[t,n]=y.useState(()=>Date.now());return y.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(r)},[e]),t}const Sie=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function Cie({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,updatedAt:s,open:a,onOpenChange:l}){const u=Tie(a);return f.jsx(ds,{open:a,onOpenChange:l,children:f.jsxs(fs,{children:[f.jsx(hs,{title:"Usage",description:n==="claude"?"Claude Code":n,actions:t?f.jsx(gn,{variant:"accent",className:"mt-0.5 shrink-0 capitalize",children:t}):null}),f.jsxs(ms,{children:[e.length===0?f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:n==="claude"?"This session reports no plan windows — API-key sessions have none, and a subscription session reports them once a turn has run.":`Plan windows are a claude.ai subscription thing; this session runs on the ${n} engine.`}):f.jsx("div",{className:"flex flex-col gap-5",children:e.map(({key:d,info:h})=>f.jsx(wie,{windowKey:d,info:h,now:u},d))}),f.jsxs("div",{className:"mt-5 flex items-baseline justify-between gap-4 border-t border-border pt-3",children:[f.jsx("span",{className:"text-label text-fg-3",children:"This session has cost"}),f.jsx("span",{className:"font-mono text-body-sm text-fg-1",children:Sa(r)})]}),s?f.jsxs("p",{className:"mt-2 text-label text-fg-4",children:["Updated ",gV(s,u)]}):null]})]})})}function wie({windowKey:e,info:t,now:n}){const r=t.utilization??0,s=t.resetsAt!==void 0?t.resetsAt*1e3:void 0,a=pV(e),l=s!==void 0?(s-n)/1e3:void 0,u=a!==void 0&&l!==void 0&&l>0&&l<a?(a-l)/a:void 0;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[f.jsx("span",{className:"truncate text-body-sm text-fg-1",children:mV(e)}),f.jsxs("span",{className:xe("shrink-0 font-mono text-body-sm font-medium",t.status==="rejected"?"text-danger":"text-fg-1"),children:[r.toFixed(0),"% used"]})]}),f.jsxs("div",{className:"relative mt-2 h-2 rounded-full bg-border",children:[f.jsx("div",{className:xe("h-full rounded-full",Sie(r)),style:{width:`${Math.min(100,Math.max(2,r))}%`}}),u!==void 0?f.jsx("span",{"aria-hidden":!0,title:"Spent evenly, usage would be here by now",className:"absolute -top-1 h-4 w-0.5 -translate-x-1/2 rounded-full bg-fg-1",style:{left:`${Math.min(100,Math.max(0,u*100))}%`}}):null]}),f.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-label text-fg-4",children:[s!==void 0?f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx(Oz,{className:"size-3"})," Resets in ",Bb(s,n)]}):null,t.isUsingOverage?f.jsx("span",{className:"text-warning",children:"overage"}):null,t.status==="rejected"?f.jsx("span",{className:"text-danger",children:"limit reached"}):null]})]})}const kie=["button","a","input","textarea","select","summary","img",'[contenteditable="true"]','[role="button"]','[role="menuitem"]','[role="checkbox"]','[role="radio"]','[role="tab"]'].join(",");function Nie({client:e,sessionId:t,header:n,panelSurface:r="internal",statusSurface:s="internal",statusPlacement:a="top",onOpenPanel:l,onVitals:u,transcriptVariant:d="cards",transcriptDensity:h="comfortable",controlsSurface:p="internal",onControls:m,focusComposerOnClick:b=!1,unseen:x,readOnly:E=!1,className:N}){const C=r==="external",S=s==="external",k=p==="external",[A,R]=y.useState(void 0),[M,_]=y.useState(),{state:O,connection:j,protocolMismatch:H,models:B,effectiveModel:K,handle:X,send:Z,approve:te,deny:q,interrupt:z,setModel:V,setPermissionMode:W,reconnectNow:le}=L$(e,t,{onProtocolError:R});y.useEffect(()=>R(void 0),[t]);const[D,P]=y.useState(!1);y.useEffect(()=>{P(!1)},[t]);const[$]=y.useState(x),L=D?void 0:$,ae=L?Math.max(0,O.items.length-L.itemCount):0,re=y.useCallback(J=>{C?l?.(J):_(J)},[C,l]);y.useEffect(()=>{const J=()=>{document.visibilityState==="visible"&&le()};return document.addEventListener("visibilitychange",J),()=>document.removeEventListener("visibilitychange",J)},[le]),aV(X);const ce=O.capabilities,de=y.useRef(u);de.current=u;const fe=K??O.model,Se=y.useMemo(()=>UV(ce.permissionModes,O.session?.canBypassPermissions),[ce.permissionModes,O.session?.canBypassPermissions]);y.useEffect(()=>{de.current?.({status:O.status,connection:j,engine:O.engine,capabilities:O.capabilities,model:fe,models:B,permissionMode:O.permissionMode,permissionModes:Se,cwd:O.cwd,contextUsage:O.contextUsage,rateLimits:O.rateLimits,itemCount:O.items.length})},[O.status,j,O.engine,O.capabilities,fe,B,O.permissionMode,Se,O.cwd,O.contextUsage,O.rateLimits,O.items.length]);const He=y.useRef(m);He.current=m;const Me=y.useRef({setModel:V,setPermissionMode:W,interrupt:z});Me.current={setModel:V,setPermissionMode:W,interrupt:z};const Ee=y.useRef({setModel:J=>Me.current.setModel(J),setPermissionMode:J=>Me.current.setPermissionMode(J),interrupt:()=>Me.current.interrupt(),focusComposer:()=>ve.current?.focus()});y.useEffect(()=>{const J=He.current;return J?.(Ee.current),()=>J?.(void 0)},[t]);const Oe=O.status==="running"||O.status==="awaiting_approval",Be=O.status==="failed"||O.status==="closed",Ke=B$(e,t,{capabilities:ce,engine:O.engine}),$e=IR(e,O.cwd),De=y.useMemo(()=>R$(O),[O]),ke=Aie(e,t,O.producedFiles),ve=y.useRef(null),Ie=y.useRef(null),je=y.useMemo(()=>{if(O.commands)return O.commands.some(J=>J.name==="model")?O.commands:[{name:"model",description:"Switch the model for this session",argumentHint:"<model>"},...O.commands]},[O.commands]),ee=(J,Te)=>{if(Te.length===0){const _e=/^\/model\s+(\S+)$/.exec(J);if(_e){V(_e[1]);return}if(ce.mcpStatus&&J.trim()==="/mcp"){re("mcp");return}}P(!0),Z(J,Te)},me=f.jsxs(ZU,{children:[f.jsx(JU,{render:f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Session actions",children:f.jsx(LB,{className:"size-4"})})}),f.jsxs(eH,{children:[ce.contextUsage?f.jsxs(Nl,{onClick:()=>re("context"),children:[f.jsx(dB,{className:"size-3.5 text-fg-3"})," Context"]}):null,ce.rateLimits?f.jsxs(Nl,{onClick:()=>re("usage"),children:[f.jsx(QB,{className:"size-3.5 text-fg-3"})," Usage"]}):null,f.jsxs(Nl,{onClick:()=>re("info"),children:[f.jsx(iz,{className:"size-3.5 text-fg-3"})," Session info"]}),ce.mcpStatus?f.jsxs(Nl,{onClick:()=>re("mcp"),children:[f.jsx(Iy,{className:"size-3.5 text-fg-3"})," MCP servers"]}):null,ce.skillsList?f.jsxs(Nl,{onClick:()=>re("skills"),children:[f.jsx(np,{className:"size-3.5 text-fg-3"})," Skills"]}):null,$e.available?f.jsxs(Nl,{onClick:()=>re("files"),children:[f.jsx(YB,{className:"size-3.5 text-fg-3"})," Project files"]}):null]})]}),oe=C?null:me,ie=typeof n=="function",G=S?null:f.jsx(xse,{state:O,connection:j,placement:a,onOpenStatus:C&&!l?void 0:()=>re("info"),onOpenContext:C&&!l?void 0:()=>re("context"),onOpenUsage:C&&!l?void 0:()=>re("usage"),actions:ie?void 0:oe}),F=J=>{!b||E||J.target?.closest(kie)||window.getSelection()?.isCollapsed!==!1&&ve.current?.focus()};return f.jsx(DR,{value:d,children:f.jsx(dV,{value:h,children:f.jsxs("div",{"data-slot":"session-panel",onClick:F,className:xe("flex h-full min-h-0 flex-col overflow-hidden bg-bg",N),children:[ie?n({actions:oe}):n,a==="top"?G:null,H!==void 0?f.jsxs(_k,{level:"warning",children:["Server speaks protocol v",H,", this build renders v",RR,". Some events may not render."]}):null,A?f.jsx(_k,{level:"error",onDismiss:()=>R(void 0),children:A}):null,f.jsx(Eie,{state:O,fileUrl:t?J=>e.sessionFileUrl(t,J):void 0,attachmentUrl:t?J=>e.attachmentUrl(t,J):void 0,canBrowseFiles:$e.available,hostImage:ke,variant:d,density:h,catchUp:L&&ae>0?{from:L.itemCount,since:L.since}:void 0,jumpToRecapRef:Ie}),L&&ae>0?f.jsx("div",{className:"px-3 pb-1",children:f.jsxs("div",{"data-slot":"catch-up",className:"mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] items-center gap-2 text-label text-fg-3",children:[f.jsx("span",{"aria-hidden":!0,className:xe("select-none",d==="lines"?"text-fg-3":"text-accent"),children:"※"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[ae," new ",ae===1?"row":"rows",L.since!==void 0?" since you were last here":""]}),f.jsx("button",{type:"button",onClick:()=>Ie.current?.(),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"jump"}),f.jsx("button",{type:"button",onClick:()=>P(!0),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"dismiss"})]})}):null,!E&&ce.interactiveApprovals&&O.pendingApprovals.length>0?f.jsx("div",{className:"px-3 pb-2",children:f.jsx("div",{className:"mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] flex-col gap-2",children:O.pendingApprovals.map(J=>J.toolName==="AskUserQuestion"&&F5(J.input).length>0?f.jsx(dse,{request:J,onAnswer:te,onDismiss:Te=>q(Te,"Question dismissed by user")},J.id):f.jsx(use,{request:J,onApprove:te,onDeny:q},J.id))})}):null,E?null:f.jsx(vV,{ref:ve,onSend:ee,onInterrupt:z,busy:Oe,disabled:Be||!t,commands:ce.slashCommands?je:void 0,skills:ce.skillsList?O.skills:void 0,attachments:Ke,onSearchFiles:$e.available?(J,Te)=>$e.search(J,{...Te,limit:8}):void 0,layout:k?"inline":"stacked",toolbar:k?void 0:f.jsxs(f.Fragment,{children:[B.length?f.jsx(zR,{models:B,model:K,onModelChange:V,disabled:Be}):null,O.permissionMode?f.jsx(op,{mode:O.permissionMode,onModeChange:W,modes:ce.permissionModes,canBypass:O.session?.canBypassPermissions,disabled:Be}):null]})}),a==="bottom"?G:null,C?null:f.jsxs(f.Fragment,{children:[f.jsx(fse,{state:O,client:e,sessionId:t,open:M==="info",onOpenChange:J=>_(J?"info":void 0)}),f.jsx(kV,{usage:O.contextUsage,open:M==="context",onOpenChange:J=>_(J?"context":void 0)}),f.jsx(Cie,{rateLimits:De,subscriptionType:O.subscriptionType,engine:O.engine??"claude",totalCostUsd:O.totalCostUsd,updatedAt:O.rateLimitsUpdatedAt,open:M==="usage",onOpenChange:J=>_(J?"usage":void 0)}),f.jsx(_V,{client:e,sessionId:t,canManageServers:ce.mcpServerActions,open:M==="mcp",onOpenChange:J=>_(J?"mcp":void 0)}),f.jsx(LV,{skills:O.skills,open:M==="skills",onOpenChange:J=>_(J?"skills":void 0),onUse:J=>ve.current?.insertText(jR(J))}),f.jsx(NV,{client:e,cwd:O.cwd,open:M==="files",onOpenChange:J=>_(J?"files":void 0)})]})]})})})}function Aie(e,t,n){const r=y.useRef(new Map),s=y.useRef([]);return y.useEffect(()=>()=>{for(const a of s.current)URL.revokeObjectURL(a);s.current=[]},[]),y.useCallback(a=>{const l=n?.[a],u=l?`produced:${l.fileId}`:`fs:${a}`,d=r.current.get(u);if(d)return d;const h=l&&t?e.readProducedFile(t,l.fileId).then(p=>{if(p.size===0)return;const m=URL.createObjectURL(p);return s.current.push(m),m}).catch(()=>{}):e.readHostFile(a).then(p=>{if(p.encoding!=="base64")return;const m=a.slice(a.lastIndexOf(".")+1).toLowerCase(),b=_ie[m];return b?`data:${b};base64,${p.content}`:void 0}).catch(()=>{});return r.current.set(u,h),h},[e,t,n])}const _ie={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function _k({level:e,onDismiss:t,children:n}){return f.jsx("div",{className:"px-3 pt-2",children:f.jsxs("div",{role:"alert",className:xe("mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] items-start gap-2 rounded-md border px-3 py-2 text-body-sm",e==="error"?"border-danger/40 bg-danger-bg text-danger":"border-warning/40 bg-warning-bg text-warning"),children:[f.jsx($l,{className:"mt-0.5 size-3.5 shrink-0"}),f.jsx("span",{className:"min-w-0 flex-1 break-words",children:n}),t?f.jsx("button",{type:"button",onClick:t,"aria-label":"Dismiss",className:"shrink-0 opacity-70 transition-opacity hover:opacity-100",children:f.jsx(Ss,{className:"size-3.5"})}):null]})})}function G5(e){return xe("px-2 py-1.5 hover:bg-row-hover",e?"mr-1 ml-0 rounded-r-md border-l-4 border-l-accent":"mx-1 rounded-md")}function Rie({rows:e,config:t,onConfigChange:n,scope:r,activeId:s,onSelect:a,onDelete:l,onRename:u,emptyState:d,showControls:h=!0,className:p}){const m=y.useMemo(()=>AR(e,t,r),[e,t,r]),b=y.useMemo(()=>x$(m,t),[m,t]),x=y$(t,r,m.length,e.length),E=y.useMemo(()=>f$(e),[e]),N=y.useMemo(()=>{const S=new Map;for(const k of e)S.set(k.hostId,k.hostName);return[...S].map(([k,A])=>({id:k,name:A}))},[e]),C=S=>n({...t,...S});return f.jsxs("div",{"data-slot":"session-browser",className:xe("flex flex-col gap-3",p),children:[f.jsxs("div",{className:xe("flex flex-col gap-1.5 px-2",!h&&"hidden"),children:[f.jsxs("div",{className:"relative",children:[f.jsx(tp,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Yt,{value:t.search,onChange:S=>C({search:S.target.value}),placeholder:"Search sessions","aria-label":"Search sessions",className:"pl-8"})]}),f.jsx(wc,{label:"State",children:f.jsx(Z1,{label:"State",value:t.states,options:CR.map(S=>({value:S,label:wR[S]})),onChange:S=>C({states:S})})}),E.length>1?f.jsx(wc,{label:"Engine",children:f.jsx(Z1,{label:"Engine",value:t.adapters,options:E.map(S=>({value:S,label:S})),onChange:S=>C({adapters:S})})}):null,N.length>1?f.jsx(wc,{label:"Gateway",children:f.jsx(Z1,{label:"Gateway",value:t.gateways,options:N.map(S=>({value:S.id,label:S.name})),onChange:S=>C({gateways:S})})}):null,f.jsx(wc,{label:"Group",children:f.jsx(Ik,{label:"Group",value:t.groupBy,options:[{value:"none",label:"No grouping"},{value:"state",label:"By state"},{value:"adapter",label:"By engine"},...N.length>1?[{value:"gateway",label:"By gateway"}]:[]],onChange:S=>C({groupBy:S})})}),f.jsx(wc,{label:"Sort",children:f.jsx(Ik,{label:"Sort",value:t.sortBy,options:[{value:"recent",label:"Recent"},{value:"name",label:"Name"},{value:"state",label:"State"},...N.length>1?[{value:"gateway",label:"Gateway"}]:[]],onChange:S=>C({sortBy:S})})})]}),x?f.jsxs("div",{className:"flex items-center gap-2 px-3 text-label text-fg-4",children:[f.jsxs("span",{children:[x.shown," of ",x.total,x.causes.length?` · ${x.causes.join(" · ")}`:null]}),f.jsx("button",{type:"button",className:"text-fg-3 underline underline-offset-2 hover:text-fg-1",onClick:()=>n(ww(t)),children:"Show all"})]}):null,e.length===0?d??f.jsx(Rk,{children:"No sessions yet."}):m.length===0?f.jsx(Rk,{children:v$(t)?f.jsxs(f.Fragment,{children:["No sessions match."," ",f.jsx("button",{type:"button",className:"underline underline-offset-2 hover:text-fg-1",onClick:()=>n(ww(t)),children:"Clear filters"})]}):"No sessions here."}):f.jsx("div",{className:"flex flex-col gap-4",children:b.map(S=>f.jsxs("div",{className:"flex flex-col gap-1",children:[t.groupBy!=="none"&&S.label?f.jsxs("div",{className:"flex items-baseline gap-2 px-3 text-label font-medium text-fg-4",children:[f.jsx("span",{className:"uppercase tracking-wide",children:S.label}),f.jsx("span",{className:"text-fg-4/70",children:S.rows.length})]}):null,S.rows.map(k=>f.jsx(Iie,{row:k,active:k.info.id===s,showGateway:N.length>1,onSelect:a,onDelete:l,onRename:u},`${k.hostId}:${k.info.id}`))]},S.key))})]})}function Rk({children:e}){return f.jsx("div",{className:"px-3 py-6 text-center text-body-sm text-fg-4",children:e})}function Iie({row:e,active:t,showGateway:n,onSelect:r,onDelete:s,onRename:a}){const{info:l}=e,[u,d]=y.useState(!1),h=l.cwd.split("/").filter(Boolean).pop()??l.cwd,p=[n?e.hostName:void 0,xV(l.model),h,l.profile?`@${l.profile}`:void 0,Sa(l.totalCostUsd)].filter(Boolean);return f.jsxs("div",{"data-slot":"session-row","data-active":t||void 0,className:xe("group flex cursor-pointer flex-col gap-0.5 text-left transition-colors",G5(t===!0)),children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[u&&a?f.jsx(Oie,{initial:l.title??"",onCommit:m=>{d(!1),a(e,m)},onCancel:()=>d(!1)}):f.jsx("button",{type:"button",onClick:()=>r?.(e),className:xe("min-w-0 flex-1 truncate text-left text-body-sm outline-none",t?"font-medium text-fg-1":"text-fg-2"),children:Jl(l)}),e.unseen>0?f.jsx("span",{title:`${e.unseen} new`,className:"shrink-0 rounded-full bg-accent px-1.5 text-label text-accent-fg",children:e.unseen}):null,f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:du(l.lastActivityAt??l.createdAt)}),f.jsx(K5,{row:e})]}),f.jsxs("div",{className:"flex items-center gap-1 text-label text-fg-4",children:[f.jsx("button",{type:"button",onClick:()=>!u&&r?.(e),className:"min-w-0 flex-1 truncate text-left font-mono outline-none",children:p.join(" · ")}),a&&!u?f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Rename session",className:"size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>d(!0),children:f.jsx(Ez,{className:"size-3 text-fg-3"})}):null,s?f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Close session",className:"size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>s(e),children:f.jsx(Td,{className:"size-3 text-fg-3"})}):null]})]})}function K5({row:e}){const{info:t}=e;if(t.pendingPermissionCount>0||t.status==="awaiting_approval")return f.jsx(iB,{className:"size-3.5 shrink-0 animate-pulse text-warning"});if(t.status==="running"||t.status==="starting")return f.jsx(xn,{className:"size-3.5 shrink-0 text-info"});switch(t.status){case"failed":return f.jsx(yB,{className:"size-3.5 shrink-0 text-danger"});case"closed":return f.jsx(wB,{className:"size-3.5 shrink-0 text-fg-4"});case"parked":return f.jsx(SB,{className:"size-3.5 shrink-0 text-fg-3"});default:return f.jsx(U_,{className:"size-3.5 shrink-0 text-fg-4"})}}function Oie({initial:e,onCommit:t,onCancel:n}){const[r,s]=y.useState(e),a=y.useRef(null);return y.useEffect(()=>{a.current?.select()},[]),f.jsx("input",{ref:a,value:r,autoFocus:!0,"aria-label":"Session name",onClick:l=>l.stopPropagation(),onChange:l=>s(l.target.value),onBlur:()=>document.hasFocus()?t(r.trim()):void 0,onKeyDown:l=>{l.key==="Enter"?t(r.trim()):l.key==="Escape"&&n(),l.stopPropagation()},className:"-my-0.5 min-w-0 flex-1 rounded-sm border border-ring bg-bg px-1 py-0.5 text-body-sm font-medium text-fg-1 outline-none"})}function wc({label:e,children:t}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{"aria-hidden":!0,className:"w-14 shrink-0 truncate text-label text-fg-3",children:e}),f.jsx("div",{className:"min-w-0 flex-1",children:t})]})}function Z1({label:e,value:t,options:n,onChange:r}){return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Ys,{multiple:!0,value:t,onValueChange:s=>r(s),children:[f.jsx(Ks,{"aria-label":e,className:"min-w-0 flex-1",children:f.jsx(Gs,{children:t.length===0?"All":t.length===1?n.find(s=>s.value===t[0])?.label??"All":`${t.length} selected`})}),f.jsx(Xs,{children:n.map(s=>f.jsx(ws,{value:s.value,children:f.jsx(Cs,{children:s.label})},s.value))})]}),t.length>0?f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":`Clear ${e}`,onClick:()=>r([]),children:f.jsx(Ss,{className:"size-3 text-fg-4"})}):null]})}function Ik({label:e,value:t,options:n,onChange:r}){return f.jsxs(Ys,{value:t,onValueChange:s=>r(s),children:[f.jsx(Ks,{"aria-label":e,className:"w-full min-w-0",children:f.jsx(Gs,{children:n.find(s=>s.value===t)?.label??e})}),f.jsx(Xs,{children:n.map(s=>f.jsx(ws,{value:s.value,children:f.jsx(Cs,{children:s.label})},s.value))})]})}const Mie={claude:{title:"Claude",d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"},codex:{title:"OpenAI",d:"M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"},gemini:{title:"Gemini",d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"},deepseek:{title:"DeepSeek",d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"},moonshot:{title:"Moonshot",d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"}};function Lie(e,t){if(e==="claude")return"claude";if(e==="codex")return"codex";const n=t?.toLowerCase()??"";if(n){if(n.includes("gemini"))return"gemini";if(n.includes("deepseek"))return"deepseek";if(n.includes("moonshot")||n.includes("kimi"))return"moonshot";if(n.includes("claude"))return"claude";if(n.startsWith("gpt")||n.startsWith("o1")||n.startsWith("o3")||n.includes("openai"))return"codex"}}function X5({engine:e,model:t,className:n}){const r=Mie[Lie(e,t)??""];return r?f.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",role:"img","aria-label":r.title,className:xe("size-3 shrink-0 text-fg-3",n),children:[f.jsx("title",{children:r.title}),f.jsx("path",{d:r.d})]}):f.jsx("span",{"aria-hidden":!0,title:e,className:xe("shrink-0 text-fg-3",n),children:"·"})}const W5=[{value:"default",displayName:"Default (recommended)",description:"The CLI's configured default model"},{value:"fable",displayName:"Fable",description:"Fable 5 · Most capable for your hardest and longest-running tasks"},{value:"opus",displayName:"Opus",description:"Opus 5 with 1M context · Best for everyday, complex tasks"},{value:"sonnet",displayName:"Sonnet",description:"Sonnet 5 · Efficient for routine tasks"},{value:"haiku",displayName:"Haiku",description:"Haiku 4.5 · Fastest for quick answers"}],hx={session:"workerdeck.default-session-model",job:"workerdeck.default-job-model"};function Q5(e){return localStorage.getItem(hx[e])??""}function Die(e,t){const n=t.trim();n?localStorage.setItem(hx[e],n):localStorage.removeItem(hx[e])}const Z5={session:"workerdeck.default-session-permission-mode",job:"workerdeck.default-job-permission-mode"},jie={session:"default",job:"acceptEdits"};function J5(e){const t=localStorage.getItem(Z5[e]);return tu.some(r=>r.value===t)?t:jie[e]}function Pie(e,t){localStorage.setItem(Z5[e],t)}const eI="workerdeck.transcript-density";function Nv(){return localStorage.getItem(eI)==="compact"?"compact":"comfortable"}function Bie(e){localStorage.setItem(eI,e)}const tI="workerdeck.transcript-variant";function Av(){return localStorage.getItem(tI)==="lines"?"lines":"cards"}function zie(e){localStorage.setItem(tI,e)}function nI({value:e,onChange:t,models:n=W5,className:r}){return f.jsx(zR,{variant:"form",models:n,model:e||void 0,onModelChange:s=>t(s??""),className:r})}function rI(){const[e,t]=y.useState(kx());return f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Toggle theme",onClick:()=>t(eL()),children:e==="dark"?f.jsx(Jz,{className:"size-4"}):f.jsx(U_,{className:"size-4"})})}function Ok({kind:e,label:t}){const[n,r]=y.useState(()=>Q5(e)),[s,a]=y.useState(()=>J5(e));return f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-2",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:t}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(op,{variant:"form",mode:s,onModeChange:l=>{a(l),Pie(e,l)},className:"min-w-40"}),f.jsx(nI,{value:n,onChange:l=>{r(l),Die(e,l)},className:"min-w-44"})]})]})}function Uie(){const[e,t]=y.useState(Nv),n=[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}];return f.jsxs(Ys,{value:e,onValueChange:r=>{const s=r;t(s),Bie(s)},children:[f.jsx(Ks,{"aria-label":"Transcript density",className:"min-w-40",children:f.jsx(Gs,{children:n.find(r=>r.value===e)?.label})}),f.jsx(Xs,{children:n.map(r=>f.jsx(ws,{value:r.value,children:f.jsx(Cs,{children:r.label})},r.value))})]})}function Hie(){const[e,t]=y.useState(Av),n=[{value:"cards",label:"Cards"},{value:"lines",label:"Lines"}];return f.jsxs(Ys,{value:e,onValueChange:r=>{const s=r;t(s),zie(s)},children:[f.jsx(Ks,{"aria-label":"Transcript style",className:"min-w-40",children:f.jsx(Gs,{children:n.find(r=>r.value===e)?.label})}),f.jsx(Xs,{children:n.map(r=>f.jsx(ws,{value:r.value,children:f.jsx(Cs,{children:r.label})},r.value))})]})}function Fie({open:e,onOpenChange:t}){return f.jsx(ds,{open:e,onOpenChange:t,children:f.jsxs(fs,{size:"lg",children:[f.jsx(hs,{title:"Settings",description:"Client-side preferences. Server policy (auth, cwd roots, API-key requirements) is configured where the worker runs."}),f.jsx(ms,{children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Appearance"})}),f.jsxs(Ni,{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Theme"}),f.jsx(rI,{})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Transcript style"}),f.jsx(Hie,{})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Transcript density"}),f.jsx(Uie,{})]}),f.jsx("p",{className:"text-label text-fg-4",children:"Cards is the chat shape; Lines is the terminal one — full-width rows behind a gutter glyph, no boxes. Comfortable leaves a blank line between messages, the way the CLI does; Compact fits more of a long session on screen. Both take effect on the next session you open."})]})]}),f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Defaults"})}),f.jsxs(Ni,{className:"flex flex-col gap-3",children:[f.jsx(Ok,{kind:"session",label:"New session"}),f.jsx(Ok,{kind:"job",label:"Queue job"}),f.jsx("p",{className:"text-label text-fg-4",children:'Pre-fills the permission mode and model on the new-session and schedule-job forms (still editable per run). "Default (recommended)" leaves the model to the CLI. This list is the Claude aliases, so a profile running another engine will fall back to its own default rather than the choice made here.'})]})]}),f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Worker server"})}),f.jsxs(Ni,{className:"flex flex-col gap-1 text-body-sm text-fg-2",children:[f.jsxs("div",{children:["Endpoint: ",f.jsxs("code",{className:"font-mono text-code",children:[location.origin,"/v1"]})," (dev proxy → ",f.jsx("code",{className:"font-mono text-code",children:"WORKER_URL"}),", default"," ",f.jsx("code",{className:"font-mono text-code",children:"http://127.0.0.1:8787"}),")"]}),f.jsx("div",{className:"text-label text-fg-4",children:"Anthropic credentials are resolved by the SDK from the server operator’s environment — this app never handles them."})]})]})]})})]})})}const $ie="0.13.0",Vie=$ie;function sI({className:e}){return f.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[f.jsx("path",{d:"M12 3 20.5 7.75 12 12.5 3.5 7.75Z"}),f.jsx("path",{d:"M3.5 12.25 12 17l8.5-4.75"}),f.jsx("path",{d:"M3.5 16.5 12 21.25l8.5-4.75"}),f.jsx("path",{d:"M12 6.15 14.85 7.75 12 9.35 9.15 7.75Z",fill:"#2fbf71",stroke:"none"})]})}const iI="workerdeck.hosts.v1",mx=e=>`workerdeck.host.${e}.key`,aI="gateway";let cs={hosts:[],ready:!1};const px=new Set;function _v(e){cs=e,gx.clear();for(const t of px)t()}function Rv(){try{const e=localStorage.getItem(iI),t=e?JSON.parse(e):[];return Array.isArray(t)?t.map(({implicit:n,...r})=>r):[]}catch{return[]}}function oI(e){try{localStorage.setItem(iI,JSON.stringify(e.filter(t=>!t.implicit)))}catch{}}function qie(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=[...e].map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function lI(e){try{return localStorage.getItem(mx(e))??""}catch{return""}}function uI(e,t){try{t===""?localStorage.removeItem(mx(e)):localStorage.setItem(mx(e),t)}catch{}}const gx=new Map;function gd(e){const t=gx.get(e);if(t)return t;const n=cs.hosts.find(a=>a.id===e);if(!n)return;const r=By(n);if(r===void 0)return;const s=new X$({baseUrl:r,...n.implicit?{}:Y$({baseUrl:r,key:lI(n.id)})});return gx.set(e,s),s}function Cp(){return cs.hosts.find(e=>e.implicit)??cs.hosts[0]}function Yie(){const e=Cp();return e?gd(e.id):void 0}function cI(e){return q$(e)}function Gie(e,t){const n=Rv(),r=n.some(s=>s.id===e.id)?n.map(s=>s.id===e.id?e:s):[...n,e];oI(r),uI(e.id,t),_v({...cs,hosts:[...cs.hosts.filter(s=>s.implicit),...r]})}function Kie(e){const t=Rv().filter(n=>n.id!==e);oI(t),uI(e,""),_v({...cs,hosts:[...cs.hosts.filter(n=>n.implicit),...t]})}async function Xie(){try{const e=await fetch(`${location.origin}/auth/status`,{headers:{accept:"application/json"}});if(!e.ok||!e.headers.get("content-type")?.includes("application/json"))return!1;const t=await e.json();return typeof t=="object"&&t!==null&&"enabled"in t}catch{return!1}}let Mk=!1;function dI(){if(Mk)return;Mk=!0;const e=Rv();cs={hosts:e,ready:!1},Xie().then(t=>{_v({hosts:t?[{id:aI,name:"This gateway",baseUrl:location.origin,implicit:!0},...e]:e,ready:!0})})}function fI(e){return dI(),px.add(e),()=>px.delete(e)}function Iv(){return y.useSyncExternalStore(fI,()=>cs,()=>cs)}function Wie(){return dI(),cs.hosts}function Qie(e){return fI(e)}function hI({host:e,submitLabel:t="Save",onSaved:n,actions:r}){const[s,a]=y.useState(e.name),[l,u]=y.useState(e.baseUrl),[d,h]=y.useState(()=>lI(e.id)),p=()=>{if(By({baseUrl:l})===void 0){an.error("That address is not a URL");return}if(!s.trim()){an.error("Give the gateway a name");return}const m={id:e.id,name:s.trim(),baseUrl:l.trim()};Gie(m,d),n(m)};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Name"}),f.jsx(Yt,{value:s,onChange:m=>a(m.target.value),placeholder:"Mac mini"})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Address"}),f.jsx(Yt,{value:l,onChange:m=>u(m.target.value),placeholder:"http://toby.ts.net:8787",spellCheck:!1,className:"font-mono"})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Auth key"}),f.jsx(Yt,{type:"password",value:d,onChange:m=>h(m.target.value),placeholder:"Leave empty for an unauthenticated gateway",spellCheck:!1}),f.jsx("span",{className:"text-label text-fg-4",children:"Stored in this browser’s local storage, and sent on the WebSocket URL when attaching. Use a gateway you control, over a network you trust."})]}),f.jsxs("div",{className:"mt-1 flex justify-end gap-2",children:[r,f.jsx(Je,{onClick:p,children:t})]})]})}function Zie({open:e,onOpenChange:t,onCreated:n}){const[r,s]=y.useState(()=>Lk());return f.jsx(ds,{open:e,onOpenChange:a=>{a&&s(Lk()),t(a)},children:f.jsxs(fs,{children:[f.jsx(hs,{title:"Add gateway",description:"A workerdeck gateway you run — typically over Tailscale."}),f.jsx(ms,{children:f.jsx(hI,{host:r,submitLabel:"Add gateway",onSaved:n,actions:f.jsx(Je,{variant:"outline",onClick:()=>t(!1),children:"Cancel"})})})]})})}function Lk(){return{id:qie(),name:"",baseUrl:""}}function mI({host:e,onClose:t,onRemoved:n}){return f.jsx(ds,{open:!0,onOpenChange:r=>!r&&t(),children:f.jsxs(fs,{children:[f.jsx(hs,{title:`Remove ${e.name}?`,description:"Its auth key is deleted from this browser. The gateway itself keeps running."}),f.jsx(ms,{children:f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(Je,{variant:"outline",onClick:t,children:"Cancel"}),f.jsx(Je,{variant:"destructive",onClick:()=>{Kie(e.id),n()},children:"Remove"})]})})]})})}const pI=240,gI=520,Dk=300,bI=e=>e==="sessions"?"workerdeck.sessions-sidebar-width":`workerdeck.${e}-sidebar-width`,xI=e=>e==="sessions"?"workerdeck.sessions-sidebar-collapsed":`workerdeck.${e}-sidebar-collapsed`;function Jie(e){try{const t=Number(localStorage.getItem(bI(e)));return t?Math.min(gI,Math.max(pI,t)):Dk}catch{return Dk}}function eae(e,t){try{localStorage.setItem(bI(e),String(t))}catch{}}function tae(e){try{return localStorage.getItem(xI(e))==="1"}catch{return!1}}function nae(e,t){try{localStorage.setItem(xI(e),t?"1":"0")}catch{}}const yI="workerdeck.sessions-filters-shown";function rae(){try{return localStorage.getItem(yI)==="1"}catch{return!1}}function sae(e){try{localStorage.setItem(yI,e?"1":"0")}catch{}}function wp({section:e,title:t,badge:n,actions:r,children:s,rail:a,railActions:l}){const[u,d]=y.useState(()=>Jie(e)),[h,p]=y.useState(()=>tae(e)),m=b=>{p(b),nae(e,b)};return h?f.jsxs("div",{className:"flex min-h-0 w-11 shrink-0 flex-col items-center gap-1 border-r border-border bg-sidebar py-1.5",children:[f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":`Expand ${t.toLowerCase()}`,onClick:()=>m(!1),children:f.jsx(Ry,{className:"size-4"})}),l,a?f.jsx("div",{className:"flex min-h-0 w-full flex-1 flex-col items-center gap-0.5 overflow-y-auto pt-1",children:a}):null]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:{width:u},className:"flex min-h-0 shrink-0 flex-col border-r border-border bg-sidebar",children:[f.jsxs("header",{className:"flex h-9 shrink-0 items-center gap-1 pr-1 pl-3",children:[f.jsx("span",{className:"truncate text-label font-medium tracking-wide text-fg-3 uppercase",children:t}),n,f.jsx("span",{className:"flex-1"}),f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":`Collapse ${t.toLowerCase()}`,onClick:()=>m(!0),children:f.jsx(_y,{className:"size-3.5"})}),r]}),s]}),f.jsx(Rb,{orientation:"vertical",value:u,onValueChange:b=>{d(b),eae(e,b)},min:pI,max:gI,"aria-label":`Resize ${t.toLowerCase()} sidebar`})]})}function kp({children:e,className:t}){return f.jsx("div",{className:xe("min-h-0 flex-1 overflow-y-auto pb-2",t),children:e})}function Wc({children:e}){return f.jsx("p",{className:"px-3 py-6 text-center text-label text-fg-4",children:e})}function Ov({title:e,status:t,description:n,actions:r,active:s,onSelect:a,onDoubleClick:l}){return f.jsxs("div",{"data-slot":"sidebar-row","data-active":s||void 0,onDoubleClick:l,className:xe("group flex cursor-pointer flex-col gap-0.5 text-left transition-colors",G5(s===!0)),children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("button",{type:"button",onClick:a,className:xe("min-w-0 flex-1 truncate text-left text-body-sm outline-none",s?"font-medium text-fg-1":"text-fg-2"),children:e}),t]}),f.jsxs("div",{className:"flex items-center gap-1 text-label text-fg-4",children:[f.jsx("button",{type:"button",onClick:a,tabIndex:-1,className:"flex min-w-0 flex-1 items-center gap-1.5 truncate text-left font-mono outline-none",children:n}),r]})]})}function vI({label:e,onClick:t,children:n}){return f.jsx("button",{type:"button","aria-label":e,title:e,onClick:r=>{r.stopPropagation(),t()},className:"flex size-5 shrink-0 items-center justify-center rounded text-fg-3 opacity-0 transition-opacity outline-none hover:bg-surface-hover hover:text-fg-1 group-hover:opacity-100",children:n})}const jk="workerdeck.watermarks.v1",bx=new Set;let xx=0;const iae={read:()=>{try{const e=localStorage.getItem(jk);return e?JSON.parse(e):void 0}catch{return}},write:e=>{try{localStorage.setItem(jk,JSON.stringify(e))}catch{}xx+=1;for(const t of bx)t()}},wm=new S$(iae);function aae(e){return bx.add(e),()=>bx.delete(e)}function oae(){return y.useSyncExternalStore(aae,()=>xx,()=>xx),{unseenFor:y.useCallback((t,n)=>C$(wm.get(t,n.id),{activityCount:n.activityCount,turns:n.numTurns}),[]),watermarks:wm}}function lae(e,t){const n=wm.get(e,t);return n?{itemCount:n.itemCount,since:n.seenAt}:void 0}function uae(e,t){const n=y.useRef({});return y.useCallback(r=>{!t||document.hidden||(n.current={...n.current,...r},wm.mark(e,t,n.current))},[e,t])}const cae=5e3,dae=1200,fae=700;let Qc={snapshots:[],loaded:!1};const yx=new Set;function hae(e){Qc=e;for(const t of yx)t()}let J1,EI=0,eb;function Zc(){return J1??=(async()=>{EI=Date.now();try{const e=Wie(),t=new Map(Qc.snapshots.map(r=>[r.host.id,r])),n=await Promise.all(e.map(async r=>{const s=gd(r.id);if(!s)return{host:r,sessions:[],error:"unusable address"};try{return{host:r,sessions:await s.listSessions()}}catch(a){return{host:r,sessions:t.get(r.id)?.sessions??[],error:a instanceof Error?a.message:String(a)}}}));hae({snapshots:n,loaded:!0})}finally{J1=void 0}})(),J1}function mae(){if(eb!==void 0)return;const e=Math.max(0,fae-(Date.now()-EI));eb=setTimeout(()=>{eb=void 0,Zc()},e)}function pae(e){return yx.add(e),()=>yx.delete(e)}let Ah,Pk;function gae(e){const t=e?dae:cae;Ah!==void 0&&Pk===t||(Ah!==void 0&&clearInterval(Ah),Pk=t,Ah=setInterval(()=>void Zc(),t))}function Ld(){const e=y.useSyncExternalStore(pae,()=>Qc,()=>Qc);y.useEffect(()=>Qie(()=>void Zc()),[]);const t=e.snapshots.some(n=>n.sessions.some(r=>{const s=kR(r);return s==="working"||s==="attention"}));return y.useEffect(()=>{gae(t),Qc.loaded||Zc()},[t]),{...e,refresh:Zc}}function bae(e){const{unseenFor:t}=oae();return y.useMemo(()=>e.flatMap(({host:n,sessions:r})=>r.map(s=>({hostId:n.id,hostName:n.name,local:cI(n),adapter:s.engine??"claude",state:kR(s),info:s,unseen:t(n.id,s)}))),[e,t])}function xae(){const e=ks(),t=xd({select:m=>m.location.pathname.match(/^\/gateways\/(.+)$/)?.[1]}),{hosts:n,ready:r}=Iv(),{snapshots:s}=Ld(),[a,l]=y.useState(!1),[u,d]=y.useState(),h=s.filter(m=>m.error===void 0).length,p=f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Add gateway",onClick:()=>l(!0),children:f.jsx(jo,{className:"size-4"})});return f.jsxs(f.Fragment,{children:[f.jsx(wp,{section:"gateways",title:"Gateways",badge:r&&n.length>0?f.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[h,"/",n.length]}):void 0,actions:p,railActions:p,children:f.jsxs(kp,{children:[r&&n.length===0?f.jsxs(Wc,{children:["No gateways yet. Add one with ",f.jsx("strong",{className:"text-fg-3",children:"+"}),"."]}):null,n.map(m=>{const b=s.find(E=>E.host.id===m.id),x=b===void 0?"pending":b.error?"error":"ok";return f.jsx(Ov,{active:m.id===t,onSelect:()=>void e({to:"/gateways/$hostId",params:{hostId:m.id}}),title:m.name,status:f.jsxs(f.Fragment,{children:[m.implicit?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:"this page"}):null,f.jsx("span",{"aria-hidden":!0,title:b?.error??(x==="ok"?"Connected":"Connecting…"),className:xe("size-1.5 shrink-0 rounded-full",x==="ok"?"bg-success":x==="error"?"bg-danger":"bg-fg-4")})]}),description:m.baseUrl,actions:m.implicit?null:f.jsx(vI,{label:`Remove ${m.name}`,onClick:()=>d(m),children:f.jsx(Td,{className:"size-3"})})},m.id)})]})}),u?f.jsx(mI,{host:u,onClose:()=>d(void 0),onRemoved:()=>{const m=u.id===t;d(void 0),m&&e({to:"/gateways"})}}):null,f.jsx(Zie,{open:a,onOpenChange:l,onCreated:m=>{l(!1),e({to:"/gateways/$hostId",params:{hostId:m.id}})}})]})}function yae({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Profile"}),f.jsxs(Ys,{items:e.map(s=>({value:s.name,label:s.name})),value:t,onValueChange:s=>n(s),children:[f.jsx(Ks,{className:r,children:f.jsx(Gs,{})}),f.jsx(Xs,{children:e.map(s=>f.jsx(ws,{value:s.name,children:f.jsx(Cs,{children:f.jsxs("span",{className:s.available===!1?"text-fg-4":void 0,title:s.unavailableReason,children:[s.description?`${s.name} — ${s.description}`:s.name,s.available===!1?" (unavailable)":""]})})},s.name))})]})]})}function Mr(){return Yie()}function vae(e,t,n){const r=e?.capabilities??wd[e?.engine??"claude"],s=r.permissionModes.includes(t)?t:r.defaultPermissionMode;let a,l;if(e?.models?.length)a=e.models,l=e.defaultModel;else if(e?.engine==="provider"){const h=e.provider;a=(h?.models?.length?h.models:h?.model?[h.model]:[]).map(m=>({value:m,displayName:m})),l=h?.model}else a=W5.filter(h=>h.value!=="default");const u=a.find(h=>h.value===n||h.resolvedModel===n),d=u||n===""?n:"";return{capabilities:r,modes:r.permissionModes,models:[{value:"default",displayName:"Profile default",description:l??"the profile's configured model"},...a],mode:s,model:d,reasoningEfforts:(u?u.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}const vx={profiles:[]};let Ex,tb;const Tx=new Set;async function Bk(){const e=await(Mr()?.listProfiles().catch(()=>vx)??Promise.resolve(vx));Ex=e;for(const t of Tx)t(e);return e}function Mv(){const[e,t]=y.useState(Ex??vx);y.useEffect(()=>(Tx.add(t),Ex||(tb??=Bk()),()=>{Tx.delete(t)}),[]);const n=y.useCallback(async()=>{tb=Bk(),await tb},[]);return{...e,refresh:n}}function Eae(){return Mv().profiles}const zk="workerdeck.last-profile";function Tae(){const e=Eae(),[t,n]=y.useState(()=>localStorage.getItem(zk)??""),r=e.some(l=>l.name===t)?t:e[0]?.name??"",s=e.find(l=>l.name===r);return{profiles:e,profile:r,selected:s,select:l=>{n(l),localStorage.setItem(zk,l)}}}const Sx="workerdeck.last-cwd";function Sae(e){const[t,n]=y.useState([]);return y.useEffect(()=>{Mr()?.listHostRoots().then(r=>n(r.roots.map(s=>s.path))).catch(()=>n([]))},[]),y.useMemo(()=>{const r=localStorage.getItem(Sx),s=[...r?[r]:[],...[...e].sort((a,l)=>(l.lastActivityAt??l.createdAt)-(a.lastActivityAt??a.createdAt)).map(a=>a.cwd),...t];return[...new Set(s)].slice(0,12)},[e,t])}function TI(e){const[t,n]=y.useState(()=>localStorage.getItem(Sx)??""),[r,s]=y.useState(""),[a,l]=y.useState(()=>J5(e)),[u,d]=y.useState(()=>Q5(e)),[h,p]=y.useState(""),{profiles:m,profile:b,selected:x,select:E}=Tae(),N=vae(x,a,u);return{cwd:t,setCwd:n,prompt:r,setPrompt:s,mode:a,setMode:l,model:u,setModel:d,effort:h,setEffort:p,profiles:m,profile:b,selectProfile:E,engine:N,sessionFields:k=>({cwd:t.trim(),profile:b||void 0,prompt:k.prompt,permissionMode:N.mode,model:N.model.trim()||void 0,resume:k.resume,reasoningEffort:h&&N.reasoningEfforts.includes(h)?h:void 0,...N.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:k.allowBypass||void 0}:{}}),rememberCwd:k=>localStorage.setItem(Sx,t.trim()||k)}}function SI({form:e,sessions:t,promptLabel:n,promptPlaceholder:r="e.g. /verify-content 42, or a task description",extras:s,actions:a,onProfileChange:l}){const u=Sae(t),d=y.useId(),{engine:h}=e;return f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),f.jsx(Yt,{value:e.cwd,list:d,onChange:p=>e.setCwd(p.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"}),f.jsx("datalist",{id:d,children:u.map(p=>f.jsx("option",{value:p},p))})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:n}),f.jsx(KN,{value:e.prompt,onChange:p=>e.setPrompt(p.target.value),rows:2,placeholder:r})]}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(yae,{profiles:e.profiles,value:e.profile,onChange:p=>{e.selectProfile(p),l?.(p)},className:"min-w-32"}),f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),f.jsx(op,{variant:"form",mode:h.mode,onModeChange:e.setMode,modes:h.modes,className:"min-w-44"})]}),s,f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),f.jsx(nI,{value:h.model,onChange:e.setModel,models:h.models,className:"min-w-40"})]}),h.reasoningEfforts.length>0?f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),f.jsxs(Ys,{items:[{value:"default",label:"Default"},...h.reasoningEfforts.map(p=>({value:p,label:p}))],value:e.effort||"default",onValueChange:p=>e.setEffort(p==="default"?"":String(p)),children:[f.jsx(Ks,{className:"min-w-28",children:f.jsx(Gs,{})}),f.jsx(Xs,{children:["default",...h.reasoningEfforts].map(p=>f.jsx(ws,{value:p,children:f.jsx(Cs,{children:p})},p))})]})]}):null,a]})]})}const Cae=15e3;let Ei={jobs:[],stats:void 0,enabled:!0,live:!1,error:void 0};const Cx=new Set;function vo(e){Ei={...Ei,...e};for(const t of Cx)t()}let nb;function km(){return nb??=(async()=>{try{const e=Mr();if(!e)return;const[t,n]=await Promise.all([e.listJobs(),e.queueStats()]);vo({jobs:t,stats:n,enabled:!0,error:void 0})}catch(e){const t=e instanceof Error?e.message:String(e);/not configured/i.test(t)?vo({enabled:!1,error:void 0}):vo({error:t})}finally{nb=void 0}})(),nb}let wx=0,rb,Nm;function wae(e){return Cx.add(e),++wx===1&&(km(),rb=setInterval(()=>void km(),Cae)),()=>{Cx.delete(e),--wx===0&&(clearInterval(rb),rb=void 0,Nm?.(),Nm=void 0,vo({live:!1}))}}function kae(){if(Nm||!Ei.enabled||Ei.stats===void 0||wx===0)return;const e=Mr();if(!e)return;const t=e.attachQueue(),n=[t.on("attached",()=>void km()),t.on("stats",r=>vo({stats:r})),t.on("connectionChange",r=>vo({live:r})),t.on("event",r=>{vo({jobs:Ei.jobs.some(s=>s.id===r.job.id)?Ei.jobs.map(s=>s.id===r.job.id?r.job:s):[...Ei.jobs,r.job]})})];Nm=()=>{for(const r of n)r();t.detach()}}function Lv(){const e=y.useSyncExternalStore(wae,()=>Ei,()=>Ei);return y.useEffect(kae,[e.enabled,e.stats]),{...e,refresh:km}}function Nae({stats:e}){const t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return f.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-5 gap-y-2 rounded-md border border-border bg-surface px-3 py-2 text-body-sm text-fg-2",children:[f.jsxs("span",{children:["Running ",f.jsxs("span",{className:"font-mono text-fg-1",children:[e.running,"/",e.maxConcurrency]})]}),f.jsxs("span",{children:["Queued ",f.jsx("span",{className:"font-mono text-fg-1",children:e.queued})]}),e.parked>0?f.jsxs("span",{children:["Parked ",f.jsx("span",{className:"font-mono text-fg-1",children:e.parked})]}):null,f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t!==void 0?f.jsx(uR,{value:t,className:t>=95?"text-danger":t>=80?"text-warning":"text-fg-3"}):null,"Daily tokens"," ",f.jsxs("span",{className:"font-mono text-fg-1",children:[us(e.dailyTokensUsed),e.dailyTokenLimit!==void 0?` / ${us(e.dailyTokenLimit)}`:""]})]}),e.sessionTokenLimit!==void 0?f.jsxs("span",{children:["Per-job cap ",f.jsx("span",{className:"font-mono text-fg-1",children:us(e.sessionTokenLimit)})]}):null,e.paused?f.jsx(gn,{variant:"warning",dot:!0,children:"Paused — daily budget exhausted"}):null]})}function Aae({onScheduled:e}){const{snapshots:t}=Ld(),n=t.find(k=>k.host.id===Cp()?.id)?.sessions??[],r=TI("job"),[s,a]=y.useState("auto"),[l,u]=y.useState(!1),[d,h]=y.useState(""),[p,m]=y.useState(""),[b,x]=y.useState(""),[E,N]=y.useState(!1),{engine:C}=r,S=async()=>{if(!r.cwd.trim()||!r.prompt.trim()){an.error("Working directory and prompt are required");return}const k=d.trim()?Number(d.trim()):void 0;if(k!==void 0&&(!Number.isFinite(k)||k<=0)){an.error("Max tokens must be a positive number");return}const A=p.trim()?Number(p.trim()):void 0;if(A!==void 0&&(!Number.isInteger(A)||A<1)){an.error("Attempts must be a whole number of at least 1");return}N(!0);try{r.rememberCwd(r.cwd.trim()),await Mr().createJob({session:{...r.sessionFields({allowBypass:l}),prompt:r.prompt.trim(),questionBehavior:C.capabilities.interactiveApprovals?s:void 0},maxTokens:k,attempts:A,webhook:b.trim()?{url:b.trim()}:void 0}),r.setPrompt(""),an.success("Job scheduled"),e()}catch(R){an.error(R instanceof Error?R.message:"Failed to schedule job")}finally{N(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(SI,{form:r,sessions:n,promptLabel:"Prompt (the task — runs unattended)",extras:C.capabilities.interactiveApprovals?f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Questions"}),f.jsxs(Ys,{items:vk.map(k=>({value:k.value,label:k.label})),value:s,onValueChange:k=>a(k),children:[f.jsx(Ks,{className:"min-w-36",children:f.jsx(Gs,{})}),f.jsx(Xs,{children:vk.map(k=>f.jsx(ws,{value:k.value,children:f.jsx(Cs,{children:`${k.label} — ${k.description}`})},k.value))})]})]}):null,actions:f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Max tokens (optional)"}),f.jsx(Yt,{value:d,onChange:k=>h(k.target.value),placeholder:"per-job cap",inputMode:"numeric",className:"min-w-28 font-mono"})]}),f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Attempts (optional)"}),f.jsx(Yt,{value:p,onChange:k=>m(k.target.value),placeholder:"1",inputMode:"numeric",className:"min-w-20 font-mono"})]}),f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Webhook URL (optional)"}),f.jsx(Yt,{value:b,onChange:k=>x(k.target.value),placeholder:"https://…/hook",spellCheck:!1,className:"min-w-44 font-mono"})]}),f.jsxs(Je,{className:"ml-auto",onClick:()=>void S(),disabled:E,children:[E?f.jsx(xn,{className:"size-3.5 text-current"}):f.jsx(jo,{className:"size-4"}),"Schedule"]})]})}),C.capabilities.settingSources?f.jsxs("label",{className:"flex w-fit cursor-pointer items-center gap-2 text-body-sm text-fg-2",title:"Spawns the CLI with --dangerously-skip-permissions available, so the mode can be switched on while watching the run. The job still starts in the mode selected above.",children:[f.jsx("input",{type:"checkbox",checked:l,onChange:k=>u(k.target.checked),className:"size-3.5 accent-(--color-fg-1)"}),"Allow switching to ",f.jsx("code",{className:"font-mono",children:"bypassPermissions"})," mid-run",f.jsx("span",{className:"text-label text-fg-4",children:"(dangerous)"})]}):null,f.jsxs("p",{className:"text-label text-fg-4",children:["Unattended runs still surface permission prompts — the job's page is read-only, so answer them from the session itself, or pick a mode that doesn't ask. Unanswered prompts deny after the server's timeout. With Questions set to Ask, webhook deliveries carry the full question so a controller can answer via"," ",f.jsx("code",{className:"font-mono",children:"POST /sessions/:id/permissions/:requestId"}),"."]})]})}function _ae({open:e,onOpenChange:t,onScheduled:n}){return f.jsx(ds,{open:e,onOpenChange:t,children:f.jsxs(fs,{size:"lg",children:[f.jsx(hs,{title:"Schedule a job",description:"A one-shot run the queue executes unattended."}),f.jsx(ms,{children:e?f.jsx(Aae,{onScheduled:n}):null})]})})}function Rae(){const{stats:e,enabled:t,error:n}=Lv();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:[n?f.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can't reach the worker server: ",n,". Start it with"," ",f.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,t?f.jsxs(f.Fragment,{children:[f.jsx(B_,{className:"size-8 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-3",children:"Select a job on the left to watch it."}),f.jsxs("p",{className:"text-label text-fg-4",children:["Or schedule one with ",f.jsx("strong",{className:"text-fg-3",children:"+"})," in the sidebar header."]}),e?f.jsx("div",{className:"mt-2 w-full max-w-xl",children:f.jsx(Nae,{stats:e})}):null]}):f.jsxs(f.Fragment,{children:[f.jsx(uB,{className:"size-8 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-3",children:"The server has no job queue configured."}),f.jsxs("p",{className:"max-w-md text-label text-fg-4",children:["Pass ",f.jsxs("code",{className:"font-mono",children:["queue: ","{ maxConcurrency, … }"]})," to"," ",f.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — the dev server enables it by default."]})]})]})}const CI={queued:{label:"Queued",variant:"neutral"},running:{label:"Running",variant:"info",busy:!0},parked:{label:"Parked",variant:"accent"},succeeded:{label:"Succeeded",variant:"success"},failed:{label:"Failed",variant:"danger"},canceled:{label:"Canceled",variant:"warning"}},Iae=["queued","running","parked"];function Oae(){const e=ks(),t=xd({select:C=>C.location.pathname.match(/^\/jobs\/(.+)$/)?.[1]}),{jobs:n,enabled:r,live:s,refresh:a}=Lv(),[l,u]=y.useState(!1),[d,h]=y.useState(""),[p,m]=y.useState(!1),b=d.trim().toLowerCase(),x=[...n].sort((C,S)=>S.createdAt-C.createdAt).filter(C=>(!p||Iae.includes(C.status))&&(!b||C.prompt.toLowerCase().includes(b)||C.cwd.toLowerCase().includes(b)||(C.profile?.toLowerCase().includes(b)??!1)||C.id.startsWith(b))),E=n.length-x.length,N=r?f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Schedule a job",onClick:()=>u(!0),children:f.jsx(jo,{className:"size-4"})}):void 0;return f.jsxs(f.Fragment,{children:[f.jsx(wp,{section:"jobs",title:"Jobs",badge:r?f.jsx("span",{"aria-hidden":!0,title:s?"Streaming over the queue socket":"Polling",className:xe("size-1.5 shrink-0 rounded-full",s?"bg-success":"bg-fg-4")}):void 0,actions:f.jsxs(f.Fragment,{children:[f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void a(),children:f.jsx(ep,{className:"size-3.5"})}),N]}),railActions:N,children:r?f.jsxs(f.Fragment,{children:[n.length>0?f.jsxs("div",{className:"flex items-center gap-1 px-2 pb-2",children:[f.jsx(Yt,{value:d,onChange:C=>h(C.target.value),placeholder:"Search jobs","aria-label":"Search jobs",className:"h-7 min-w-0 flex-1 text-body-sm"}),f.jsx(Je,{variant:p?"default":"outline",size:"xs","aria-pressed":p,onClick:()=>m(!p),children:"Active"})]}):null,f.jsxs(kp,{children:[n.length===0?f.jsxs(Wc,{children:["No jobs yet. Schedule one with ",f.jsx("strong",{className:"text-fg-3",children:"+"}),"."]}):x.length===0?f.jsx(Wc,{children:"No jobs match."}):null,x.map(C=>f.jsx(Mae,{job:C,active:C.id===t,onOpen:()=>void e({to:"/jobs/$jobId",params:{jobId:C.id}}),onChanged:()=>void a()},C.id)),E>0?f.jsxs("p",{className:"px-1 pt-2 text-center text-label text-fg-4",children:[x.length," of ",n.length]}):null]})]}):f.jsx(Wc,{children:"The server has no job queue configured."})}),f.jsx(_ae,{open:l,onOpenChange:u,onScheduled:()=>{u(!1),a()}})]})}function Mae({job:e,active:t,onOpen:n,onChanged:r}){const s=CI[e.status],a=e.status==="queued"||e.status==="running"||e.status==="parked",l=[du(e.finishedAt??e.startedAt??e.createdAt),e.cwd.split("/").filter(Boolean).pop()??e.cwd];return e.profile&&l.push(`@${e.profile}`),e.usage.totalCostUsd>0&&l.push(Sa(e.usage.totalCostUsd)),f.jsx(Ov,{active:t,onSelect:n,title:e.prompt,status:f.jsxs(gn,{variant:s.variant,dot:!s.busy,className:"shrink-0",children:[s.busy?f.jsx(xn,{className:"size-3 text-current"}):null,s.label]}),description:l.join(" · "),actions:a?f.jsx(vI,{label:"Cancel job",onClick:()=>{Mr()?.cancelJob(e.id).then(r).catch(u=>an.error(u instanceof Error?u.message:"Cancel failed"))},children:f.jsx(Ss,{className:"size-3"})}):null})}const Lae=["web_search","download","web_fetch","deliver_file"],_h=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function ys({label:e,children:t}){return f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function Dae({onCreated:e}){const[t,n]=y.useState("provider"),[r,s]=y.useState(""),[a,l]=y.useState(""),[u,d]=y.useState(""),[h,p]=y.useState(""),[m,b]=y.useState(""),[x,E]=y.useState(""),[N,C]=y.useState(""),[S,k]=y.useState([]),[A,R]=y.useState(""),[M,_]=y.useState(""),[O,j]=y.useState(!1),H=t==="provider",B=async()=>{if(!r.trim()){an.error("Name is required");return}const K={name:r.trim(),engine:t};if(a.trim()&&(K.description=a.trim()),H){K.provider={id:u.trim(),model:h.trim()||void 0,models:_h(m).length>0?_h(m):void 0,apiKeyEnv:x.trim()||void 0};const X={};S.length>0&&(X.capabilities=S),_h(A).length>0&&(X.mcpServers=_h(A)),M.trim()&&(X.instructions=M.trim()),Object.keys(X).length>0&&(K.session=X)}else K.configDir=N.trim();j(!0);try{await Mr().createProfile(K),an.success(`Profile '${K.name}' created`),e(K.name)}catch(X){an.error(X instanceof Error?X.message:"Failed to create profile")}finally{j(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(ys,{label:"Engine",children:f.jsxs(Ys,{items:[{value:"provider",label:"provider"},{value:"claude",label:"claude"}],value:t,onValueChange:K=>n(K),children:[f.jsx(Ks,{className:"min-w-32",children:f.jsx(Gs,{})}),f.jsxs(Xs,{children:[f.jsx(ws,{value:"provider",children:f.jsx(Cs,{children:"provider — model-agnostic engine"})}),f.jsx(ws,{value:"claude",children:f.jsx(Cs,{children:"claude — Agent SDK + config dir"})})]})]})}),f.jsx(ys,{label:"Name",children:f.jsx(Yt,{value:r,onChange:K=>s(K.target.value),placeholder:"kimi"})}),f.jsx(ys,{label:"Description (optional)",children:f.jsx(Yt,{value:a,onChange:K=>l(K.target.value),placeholder:"what this profile is for"})})]}),H?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(ys,{label:"Provider id",children:f.jsx(Yt,{value:u,onChange:K=>d(K.target.value),placeholder:"anthropic / openai / moonshotai",className:"font-mono"})}),f.jsx(ys,{label:"Default model",children:f.jsx(Yt,{value:h,onChange:K=>p(K.target.value),placeholder:"kimi-k3",className:"font-mono"})}),f.jsx(ys,{label:"Models offered (comma-separated)",children:f.jsx(Yt,{value:m,onChange:K=>b(K.target.value),placeholder:"kimi-k3, kimi-k2",className:"font-mono"})}),f.jsx(ys,{label:"API key variable",children:f.jsx(Yt,{value:x,onChange:K=>E(K.target.value),placeholder:"MOONSHOT_API_KEY",className:"font-mono"})})]}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(ys,{label:"Capabilities granted",children:f.jsx("div",{className:"flex flex-wrap gap-3 py-1.5",children:Lae.map(K=>f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",checked:S.includes(K),onChange:X=>k(Z=>X.target.checked?[...Z,K]:Z.filter(te=>te!==K)),className:"size-3.5 accent-(--color-fg-1)"}),f.jsx("code",{className:"font-mono text-label",children:K})]},K))})}),f.jsx(ys,{label:"MCP servers (names, comma-separated)",children:f.jsx(Yt,{value:A,onChange:K=>R(K.target.value),placeholder:"deepwiki",className:"font-mono"})})]}),f.jsx(ys,{label:"Instructions (optional)",children:f.jsx(Yt,{value:M,onChange:K=>_(K.target.value),placeholder:"prepended to the session's system prompt"})}),f.jsx("p",{className:"text-label text-fg-4",children:"Leave capabilities and MCP servers empty to inherit whatever the server's engine factory wired — that factory is the ceiling either way, so a grant here can never exceed it. MCP servers are named, never configured: their transport config (and any credentials in it) stays on the server."})]}):f.jsxs(f.Fragment,{children:[f.jsx(ys,{label:"Config directory",children:f.jsx(Yt,{value:N,onChange:K=>C(K.target.value),placeholder:"/Users/you/.claude",spellCheck:!1,className:"font-mono"})}),f.jsxs("p",{className:"text-label text-fg-4",children:["Must resolve inside the server's"," ",f.jsx("code",{className:"font-mono",children:"allowedConfigDirRoots"})," — a config directory is a credential store, so the server bounds which ones a managed profile may point at."]})]}),f.jsx("div",{className:"flex justify-end",children:f.jsxs(Je,{onClick:()=>void B(),disabled:O,children:[O?f.jsx(xn,{className:"size-3.5 text-current"}):f.jsx(jo,{className:"size-4"}),"Create profile"]})})]})}function jae({open:e,onOpenChange:t,onCreated:n}){return f.jsx(ds,{open:e,onOpenChange:t,children:f.jsxs(fs,{size:"lg",children:[f.jsx(hs,{title:"New profile",description:"What a session runs as — a Claude config directory, or a model provider."}),f.jsx(ms,{children:e?f.jsx(Dae,{onCreated:n}):null})]})})}function Pae(){const e=ks(),t=xd({select:d=>d.location.pathname.match(/^\/profiles\/(.+)$/)?.[1]}),{profiles:n,canManage:r,refresh:s}=Mv(),[a,l]=y.useState(!1),u=r?f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"New profile",onClick:()=>l(!0),children:f.jsx(jo,{className:"size-4"})}):void 0;return f.jsxs(f.Fragment,{children:[f.jsx(wp,{section:"profiles",title:"Profiles",badge:n.length>0?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:n.length}):void 0,actions:u,railActions:u,children:f.jsxs(kp,{children:[n.length===0?f.jsx(Wc,{children:r?f.jsxs(f.Fragment,{children:["No profiles yet. Add one with ",f.jsx("strong",{className:"text-fg-3",children:"+"}),"."]}):"The server declares no profiles."}):null,n.map(d=>f.jsx(Ov,{active:d.name===t,onSelect:()=>void e({to:"/profiles/$profileName",params:{profileName:d.name}}),title:d.name,status:d.managed?null:f.jsx(gn,{variant:"neutral",className:"shrink-0",children:"declared"}),description:f.jsxs(f.Fragment,{children:[f.jsx(X5,{engine:d.engine??"claude",model:d.defaults?.model??d.provider?.model,className:"size-3 shrink-0 text-fg-3"}),f.jsx("span",{className:"min-w-0 truncate",children:d.configDir??(d.provider?`${d.provider.id}${d.provider.model?` · ${d.provider.model}`:""}`:d.engine??"claude")})]})},d.name))]})}),f.jsx(jae,{open:a,onOpenChange:l,onCreated:d=>{l(!1),s(),e({to:"/profiles/$profileName",params:{profileName:d}})}})]})}function Bae({sessions:e,onCreated:t}){const n=TI("session"),[r,s]=y.useState(!1),[a,l]=y.useState(),[u,d]=y.useState(!1),{engine:h}=n,p=async b=>{const x=b?.cwd??n.cwd.trim();if(!x){an.error("Working directory is required");return}s(!0);try{n.rememberCwd(x);const E=await Mr().createSession({...n.sessionFields({prompt:b?void 0:n.prompt.trim()||void 0,resume:b?.sessionId,allowBypass:!0}),cwd:x});t(E.id)}catch(E){an.error(E instanceof Error?E.message:"Failed to create session")}finally{s(!1)}},m=async()=>{if(!n.cwd.trim()){an.error("Set a working directory first — resumable sessions are listed per project");return}d(!0);try{l(await Mr().listSdkSessions({dir:n.cwd.trim(),limit:20,profile:n.profile||void 0}))}catch(b){an.error(b instanceof Error?b.message:"Failed to list resumable sessions")}finally{d(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(SI,{form:n,sessions:e,promptLabel:"Initial prompt (optional)",onProfileChange:()=>l(void 0),actions:f.jsxs(Je,{className:"ml-auto",onClick:()=>void p(),disabled:r,children:[r?f.jsx(xn,{className:"size-3.5 text-current"}):f.jsx(jo,{className:"size-4"}),"Create"]})}),h.capabilities.listSessions?f.jsxs("div",{className:"mt-1 border-t border-border pt-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Resume a previous session"}),f.jsxs(Je,{variant:"ghost",size:"xs",onClick:()=>void m(),disabled:u,children:[u?f.jsx(xn,{className:"size-3 text-current"}):f.jsx(tz,{className:"size-3"}),a?"Reload":"Browse"]})]}),a!==void 0?a.length===0?f.jsx("div",{className:"py-3 text-center text-body-sm text-fg-4",children:"No stored sessions for this directory."}):f.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:a.map(b=>f.jsxs("li",{className:"flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate text-body-sm text-fg-1",children:b.customTitle??b.summary}),f.jsxs("div",{className:"flex gap-2 font-mono text-label text-fg-4",children:[b.gitBranch?f.jsx("span",{className:"truncate",children:b.gitBranch}):null,f.jsx("span",{className:"shrink-0",children:du(b.lastModified)})]})]}),f.jsx(Je,{variant:"outline",size:"xs",onClick:()=>void p(b),disabled:r,children:"Resume"})]},b.sessionId))}):null]}):null]})}function zae({open:e,onOpenChange:t,sessions:n,onCreated:r}){return f.jsx(ds,{open:e,onOpenChange:t,children:f.jsxs(fs,{size:"lg",children:[f.jsx(hs,{title:"New session",description:"Pick a directory and an engine."}),f.jsx(ms,{children:f.jsx(Bae,{sessions:n,onCreated:r})})]})})}function Uae(){return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center",children:[f.jsx(sI,{className:"size-8 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-3",children:"Select a session on the left to open it."}),f.jsxs("p",{className:"text-label text-fg-4",children:["Or start a new one with ",f.jsx("strong",{className:"text-fg-3",children:"+"})," in the sidebar header."]})]})}const Uk="workerdeck.view-config";function Hae(){const[e,t]=y.useState(()=>{try{const r=localStorage.getItem(Uk),s=r?JSON.parse(r):{};return{...Lb,...s,search:"",scoped:!1}}catch{return{...Lb,scoped:!1}}}),n=y.useCallback(r=>{t(r);try{localStorage.setItem(Uk,JSON.stringify(r))}catch{}},[]);return[e,n]}function Fae(){const e=ks(),t=xd({select:A=>A.location.pathname.match(/^\/sessions\/[^/]+\/(.+)$/)?.[1]??void 0}),{snapshots:n,refresh:r}=Ld(),s=bae(n),a=n.filter(A=>A.error!==void 0),l=Cp(),u=n.find(A=>A.host.id===l?.id)?.sessions??[],d=A=>{l&&e({to:"/sessions/$hostId/$sessionId",params:{hostId:l.id,sessionId:A}})},[h,p]=Hae(),[m,b]=y.useState(!1),[x,E]=y.useState(rae),N=y.useMemo(()=>AR(s,h),[s,h]),C=A=>void e({to:"/sessions/$hostId/$sessionId",params:{hostId:A.hostId,sessionId:A.info.id}}),S=(A,R)=>{gd(A.hostId)?.updateSession(A.info.id,{title:R||null}).then(()=>r()).catch(M=>an.error(M instanceof Error?M.message:"Rename failed"))},k=f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"New session",onClick:()=>b(!0),children:f.jsx(jo,{className:"size-4"})});return f.jsxs(f.Fragment,{children:[f.jsxs(wp,{section:"sessions",title:"Sessions",railActions:k,actions:f.jsxs(f.Fragment,{children:[f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":x?"Hide filters":"Show filters","aria-pressed":x,onClick:()=>{E(!x),sae(!x)},children:f.jsx(XB,{className:xe("size-3.5",x&&"fill-current text-fg-1")})}),f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void r(),children:f.jsx(ep,{className:"size-3.5"})}),k]}),rail:N.map(A=>f.jsxs("button",{type:"button",title:`${Jl(A.info)} — ${A.state}`,"aria-label":Jl(A.info),onClick:()=>C(A),className:xe("flex w-full flex-col items-center gap-0.5 border-l-2 py-1.5",A.info.id===t?"border-l-accent bg-row-active":"border-l-transparent hover:bg-row-hover"),children:[f.jsx(X5,{engine:A.adapter,model:A.info.model,className:"size-4"}),f.jsx(K5,{row:A})]},A.info.id)),children:[a.map(({host:A,error:R})=>f.jsxs("div",{className:"mx-2 mb-2 rounded-md bg-danger-bg px-2 py-1.5 text-label text-danger",children:["Can’t reach ",A.name,": ",R]},A.id)),f.jsx(kp,{children:f.jsx(Rie,{rows:s,config:h,onConfigChange:p,showControls:x,activeId:t,onSelect:C,onRename:S,onDelete:A=>{gd(A.hostId)?.deleteSession(A.info.id).then(()=>r()).catch(R=>an.error(R instanceof Error?R.message:"Delete failed"))},emptyState:f.jsxs("div",{className:"px-1 py-6 text-center text-label text-fg-4",children:["No live sessions yet. Start one with the ",f.jsx("strong",{className:"text-fg-2",children:"+"})," ","above."]})})})]}),f.jsx(zae,{open:m,onOpenChange:b,sessions:u,onCreated:A=>{b(!1),d(A),r()}})]})}const Hk=[{id:"sessions",label:"Sessions",icon:Xz,path:"/sessions",sidebar:Fae},{id:"gateways",label:"Gateways",icon:Iy,path:"/gateways",sidebar:xae},{id:"jobs",label:"Jobs",icon:B_,path:"/jobs",sidebar:Oae},{id:"profiles",label:"Profiles",icon:My,path:"/profiles",sidebar:Pae}],Fk="workerdeck.sidebar-collapsed";function $ae({children:e}){const t=xd({select:p=>p.location.pathname}),n=[...Hk].sort((p,m)=>m.path.length-p.path.length).find(p=>t.startsWith(p.path)),r=n?.sidebar,[s,a]=y.useState(!1),[l,u]=y.useState(()=>{try{return localStorage.getItem(Fk)==="1"}catch{return!1}}),d=()=>{u(p=>{try{localStorage.setItem(Fk,p?"0":"1")}catch{}return!p})},h=p=>xe("flex items-center rounded-md text-body-sm transition-colors outline-none",l?"justify-center p-2":"gap-2 px-2 py-1.5",p?"bg-surface font-medium text-fg-1 shadow-(--shadow-xs)":"text-fg-3 hover:bg-row-hover hover:text-fg-1");return f.jsxs("div",{className:"flex h-dvh bg-sidebar",children:[f.jsxs("aside",{className:xe("flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150",l?"w-14 items-center":"w-52"),children:[f.jsxs("div",{className:xe("flex items-center py-2",l?"justify-center":"gap-2 px-2"),children:[f.jsx(sI,{className:"size-4 shrink-0 text-fg-1"}),!l&&f.jsx("span",{className:"text-body-sm font-semibold tracking-tight text-fg-1",children:"workerdeck"})]}),f.jsx("nav",{className:xe("mt-1 flex flex-1 flex-col gap-0.5",l&&"items-center"),children:Hk.map(p=>f.jsxs(Mm,{to:p.path,title:l?p.label:void 0,"aria-label":p.label,className:h(p.id===n?.id),children:[f.jsx(p.icon,{className:"size-4 shrink-0"}),!l&&p.label]},p.id))}),f.jsxs("button",{type:"button",onClick:()=>a(!0),title:l?"Settings":void 0,"aria-label":"Settings",className:xe(h(!1),l?"w-auto":"w-full"),children:[f.jsx(Bz,{className:"size-4 shrink-0"}),!l&&"Settings"]}),f.jsxs("div",{className:xe("mt-1 flex items-center",l?"flex-col gap-1":"justify-between px-1"),children:[!l&&f.jsxs("span",{className:"font-mono text-label text-fg-4",children:["v",Vie]}),f.jsx(rI,{}),f.jsx("button",{type:"button",onClick:d,title:l?"Expand sidebar":"Collapse sidebar","aria-label":l?"Expand sidebar":"Collapse sidebar",className:"flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-row-hover hover:text-fg-1",children:l?f.jsx(Ry,{className:"size-4"}):f.jsx(_y,{className:"size-4"})})]})]}),f.jsxs("div",{className:"frame-shine m-2 ml-0 flex min-w-0 flex-1 overflow-hidden rounded-xl",children:[r?f.jsx(r,{},n?.id):null,f.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:e??f.jsx(RN,{})})]}),f.jsx(Fie,{open:s,onOpenChange:a})]})}function Dv({crumbs:e,actions:t,children:n}){return f.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border bg-surface px-3",children:[f.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 items-center gap-1",children:e.map((r,s)=>f.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[s>0?f.jsx(Ed,{"aria-hidden":!0,className:"size-3 shrink-0 text-fg-4"}):null,r.to?f.jsx(Mm,{to:r.to,className:"shrink-0 text-body-sm text-fg-3 outline-none hover:text-fg-1",children:r.label}):f.jsx("span",{"aria-current":"page",className:"min-w-0 truncate text-body-sm font-medium text-fg-1",title:r.label,children:r.label})]},r.label))}),n,f.jsx("span",{className:"flex-1"}),t]})}function wI({children:e}){return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsx("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:e})})}function kc({label:e,children:t}){return f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),f.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function Vae(){const{hostId:e}=iu({from:"/gateways/$hostId"}),t=ks(),{hosts:n,ready:r}=Iv(),{snapshots:s}=Ld(),[a,l]=y.useState(!1),u=n.find(p=>p.id===e),d=s.find(p=>p.host.id===e);if(y.useEffect(()=>{!r||u||t({to:"/gateways"})},[r,u,t]),!u)return null;const h=d===void 0?"pending":d.error?"error":"ok";return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(Dv,{crumbs:[{label:"Gateways",to:"/gateways"},{label:u.name}],actions:u.implicit?null:f.jsxs(Je,{variant:"outline",size:"xs",onClick:()=>l(!0),children:[f.jsx(Td,{className:"size-3"}),"Remove"]}),children:f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:u.baseUrl,children:u.baseUrl})}),f.jsxs(wI,{children:[f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Connection"})}),f.jsxs(Ni,{className:"flex flex-col divide-y divide-border",children:[f.jsx(kc,{label:"Status",children:h==="ok"?f.jsx(gn,{variant:"success",dot:!0,children:"Connected"}):h==="error"?f.jsx(gn,{variant:"danger",dot:!0,children:"Unreachable"}):f.jsx(gn,{variant:"neutral",dot:!0,children:"Connecting…"})}),d?.error?f.jsx(kc,{label:"Last error",children:f.jsx("span",{className:"text-danger",children:d.error})}):null,f.jsx(kc,{label:"Live sessions",children:d?d.sessions.length:f.jsx("span",{className:"text-fg-4",children:"—"})}),f.jsx(kc,{label:"Reachability",children:cI(u)?"This machine (loopback)":"Remote"}),f.jsx(kc,{label:"Credential",children:u.implicit?f.jsx("span",{className:"text-fg-4",children:"the login cookie it set — same origin"}):f.jsx("span",{className:"text-fg-4",children:"an auth key held in this browser"})})]})]}),u.implicit?f.jsx("p",{className:"text-label text-fg-4",children:"This is the gateway that served the page. Its address is this origin and its credential is the cookie it already set, so there is nothing here to change — and nothing to remove, since removing it would just be closing the tab."}):f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Settings"})}),f.jsx(Ni,{children:f.jsx(hI,{host:u,onSaved:p=>an.success(`Saved ${p.name}`)},u.id)})]}),a?f.jsx(mI,{host:u,onClose:()=>l(!1),onRemoved:()=>{l(!1),t({to:"/gateways"})}}):null]})]})}function qae(){return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center",children:[f.jsx(Iy,{className:"size-8 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-3",children:"Select a gateway on the left to view or edit it."}),f.jsxs("p",{className:"text-label text-fg-4",children:["Or add one with ",f.jsx("strong",{className:"text-fg-3",children:"+"})," in the sidebar header."]})]})}function Yae({files:e,activePath:t,onActivate:n,onClose:r,className:s}){return f.jsx(yH,{delay:500,closeDelay:0,children:f.jsx("div",{"data-slot":"editor-tabs",role:"tablist","aria-label":"Open files",className:xe("flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface",s),children:e.map(a=>f.jsx(Gae,{file:a,active:a.path===t,onActivate:()=>n(a.path),onClose:()=>r(a.path),onArrow:l=>{const u=e.findIndex(h=>h.path===a.path),d=e[u+l];d&&n(d.path)}},a.path))})})}function Gae({file:e,active:t,onActivate:n,onClose:r,onArrow:s}){const a=dd(e),l=y.useRef(null);y.useEffect(()=>{t&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);const u=d=>{d.button===1&&(d.preventDefault(),r())};return f.jsxs(Py,{side:"bottom",render:f.jsx("div",{ref:l,role:"tab",tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:u,onKeyDown:d=>{if(d.key==="ArrowRight")s(1);else if(d.key==="ArrowLeft")s(-1);else if(d.key==="Enter"||d.key===" ")n();else return;d.preventDefault()},className:xe("group flex min-w-0 shrink-0 cursor-pointer items-center gap-1.5 border-r border-border px-3 py-1.5 transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-inset",t?"bg-bg text-fg-1":"text-fg-3 hover:bg-surface-hover hover:text-fg-2")}),content:f.jsxs("span",{className:"flex flex-col gap-0.5",children:[f.jsx("span",{className:"font-mono break-all",children:e.path}),e.bytes!==void 0?f.jsx("span",{className:"text-fg-4",children:No(e.bytes)}):null]}),children:[f.jsx("span",{className:xe("max-w-40 truncate font-mono text-label",a&&"italic"),children:e.name}),e.status==="error"?f.jsx("span",{className:"shrink-0 text-danger",children:"!"}):null,f.jsxs("button",{type:"button","aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:d=>{d.stopPropagation(),r()},className:xe("shrink-0 rounded p-0.5 text-fg-4 transition-opacity hover:bg-surface-hover hover:text-fg-1",t||a?"opacity-70":"opacity-0 group-hover:opacity-70 focus-visible:opacity-100"),children:[f.jsx("span",{className:xe("block",a&&"group-hover:hidden"),children:a?f.jsx("span",{className:"block size-3 rounded-full bg-fg-2"}):f.jsx(Ss,{className:"size-3"})}),a?f.jsx("span",{className:"hidden group-hover:block",children:f.jsx(Ss,{className:"size-3"})}):null]})]})}const kI=12;function Kae({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:s,style:a,className:l}){const[u,d]=y.useState(""),[h,p]=y.useState(),m=u.trim().length>0;return y.useEffect(()=>{if(!t?.available)return;const b=u.trim();if(!b){p(void 0);return}const x=new AbortController,E=setTimeout(()=>{t.search(b,{limit:60,signal:x.signal}).then(N=>{x.signal.aborted||p(N)})},150);return()=>{x.abort(),clearTimeout(E)}},[t,u]),f.jsxs("div",{"data-slot":"file-tree",style:a,className:xe("flex min-h-0 min-w-0 flex-col bg-surface",l),children:[f.jsxs("div",{className:"flex items-center gap-1 px-2 pt-2",children:[t?.available?f.jsxs("div",{className:"relative min-w-0 flex-1",children:[f.jsx(tp,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Yt,{value:u,onChange:b=>d(b.target.value),placeholder:"Search files…",className:"h-7 pr-7 pl-7 text-label",spellCheck:!1}),m?f.jsx("button",{type:"button",onClick:()=>d(""),"aria-label":"Clear search",className:"absolute top-1/2 right-1.5 -translate-y-1/2 text-fg-4 transition-colors hover:text-fg-2",children:f.jsx(Ss,{className:"size-3.5"})}):null]}):f.jsx("span",{className:"min-w-0 flex-1 truncate px-1 font-mono text-label text-fg-4",children:e.root}),f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Refresh the file tree",onClick:()=>e.refresh(),children:f.jsx(ep,{className:"size-3.5 text-fg-3"})}),s?f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Hide project files",onClick:s,children:f.jsx(_y,{className:"size-3.5 text-fg-3"})}):null]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-1 py-1",children:e.error?f.jsx("p",{className:"px-2 py-3 text-body-sm text-danger",children:e.error}):m?h===void 0?f.jsx("div",{className:"py-6 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})}):h.length===0?f.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"No matching files."}):f.jsx("ul",{children:h.map(b=>f.jsx("li",{children:f.jsx($k,{label:Xae(b.relative),detail:Wae(b.relative),title:b.relative,icon:f.jsx(Jm,{className:"size-3.5 shrink-0 text-fg-4"}),active:b.path===n,onClick:()=>r(b.path)})},b.path))}):e.loading?f.jsx("div",{className:"py-6 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})}):e.rows.length===0?f.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"This project is empty."}):f.jsx("ul",{role:"tree","aria-label":"Project files",children:e.rows.map(b=>f.jsxs("li",{role:"treeitem","aria-expanded":b.expanded,"aria-level":b.depth+1,children:[f.jsx($k,{label:b.entry.name,indent:b.depth,active:b.entry.path===n,icon:b.entry.type==="dir"?b.loading?f.jsx(xn,{className:"size-3.5 shrink-0 text-fg-4"}):b.expanded?f.jsx(FB,{className:"size-3.5 shrink-0 text-accent"}):f.jsx(D_,{className:"size-3.5 shrink-0 text-accent"}):f.jsx(Qae,{type:b.entry.type}),chevron:b.entry.type==="dir"?f.jsx(Ed,{className:xe("size-3 shrink-0 text-fg-4 transition-transform",b.expanded&&"rotate-90")}):void 0,onClick:()=>b.entry.type==="dir"?e.toggle(b.entry.path):r(b.entry.path)}),b.truncated?f.jsx("p",{className:"truncate py-0.5 text-label text-fg-4",style:{paddingLeft:(b.depth+1)*kI+22},children:"More entries than the server will return — use search."}):null]},b.entry.path))})})]})}function $k({label:e,detail:t,title:n,icon:r,chevron:s,indent:a=0,active:l,onClick:u}){const d=y.useRef(null);return y.useEffect(()=>{l&&d.current?.scrollIntoView({block:"nearest"})},[l]),f.jsxs("button",{ref:d,type:"button",onClick:u,title:n??e,style:{paddingLeft:a*kI+4},className:xe("flex w-full items-center gap-1 rounded py-1 pr-2 text-left transition-colors",l?"bg-surface-hover text-fg-1":"text-fg-2 hover:bg-surface-hover"),children:[f.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:s}),r,f.jsx("span",{className:"shrink-0 truncate font-mono text-label",children:e}),t?f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:t}):null]})}function Xae(e){return e.slice(e.lastIndexOf("/")+1)}function Wae(e){const t=e.lastIndexOf("/");return t===-1?void 0:e.slice(0,t)}function Qae({type:e}){return e==="symlink"?f.jsx(P_,{className:"size-3.5 shrink-0 text-fg-4"}):f.jsx(Jm,{className:"size-3.5 shrink-0 text-fg-4"})}function Zae({path:e,value:t,onChange:n,onSave:r,readOnly:s,className:a}){const l=y.useRef(null),u=y.useRef(null),d=y.useRef(null),[h,p]=y.useState(!1),m=Jae(),b=y.useRef({onChange:n,onSave:r});return b.current={onChange:n,onSave:r},y.useEffect(()=>{let x=!1;return eoe().then(E=>{if(x||!l.current)return;d.current=E;const N=E.editor.create(l.current,{value:t,language:Yk(e),readOnly:s,automaticLayout:!0,theme:Vk(document.documentElement.getAttribute("data-theme")),minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineHeight:20,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',renderLineHighlight:"line",smoothScrolling:!0,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},wordBasedSuggestions:"off",quickSuggestions:!1});u.current=N,N.onDidChangeModelContent(()=>{b.current.onChange?.(N.getValue())}),N.addCommand(E.KeyMod.CtrlCmd|E.KeyCode.KeyS,()=>{b.current.onSave?.()}),p(!0)}),()=>{x=!0,u.current?.dispose(),u.current=null,p(!1)}},[]),y.useEffect(()=>{const x=d.current,E=u.current;if(!x||!E||!h)return;const N=x.Uri.parse(`workerdeck://host${e}`),C=x.editor.getModel(N)??x.editor.createModel(t,Yk(e),N);E.getModel()!==C&&E.setModel(C)},[e,h,t]),y.useEffect(()=>{const x=u.current;if(!x||!h)return;const E=x.getModel();!E||E.getValue()===t||E.pushEditOperations([],[{range:E.getFullModelRange(),text:t}],()=>null)},[t,h]),y.useEffect(()=>{h&&u.current?.updateOptions({readOnly:s})},[s,h]),y.useEffect(()=>{h&&d.current?.editor.setTheme(Vk(m))},[m,h]),f.jsxs("div",{className:xe("relative min-h-0 min-w-0 flex-1",a),children:[f.jsx("div",{ref:l,className:"absolute inset-0"}),h?null:f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg",children:f.jsx(xn,{className:"size-4 text-fg-4"})})]})}function Jae(){const[e,t]=y.useState(()=>typeof document>"u"?null:document.documentElement.getAttribute("data-theme"));return y.useEffect(()=>{const n=document.documentElement,r=()=>t(n.getAttribute("data-theme"));r();const s=new MutationObserver(r);return s.observe(n,{attributes:!0,attributeFilter:["data-theme"]}),()=>s.disconnect()},[]),e}function Vk(e){return e==="light"?"wd-light":"wd-dark"}let qk;function eoe(){return qk??=(async()=>{const e=await eu(()=>import("./index-2lmB6qBE.js"),__vite__mapDeps([0,1]));return e.editor.defineTheme("wd-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),e.editor.defineTheme("wd-light",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),e})(),qk}function Yk(e){const t=e.slice(e.lastIndexOf("/")+1),n=toe[t.toLowerCase()];if(n)return n;const r=t.slice(t.lastIndexOf(".")+1).toLowerCase();return noe[r]??"plaintext"}const toe={dockerfile:"dockerfile",makefile:"plaintext",".gitignore":"plaintext",".env":"shell"},noe={ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",md:"markdown",mdx:"markdown",css:"css",scss:"scss",less:"less",html:"html",htm:"html",xml:"xml",svg:"xml",yml:"yaml",yaml:"yaml",toml:"plaintext",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",py:"python",rb:"ruby",rs:"rust",go:"go",swift:"swift",java:"java",kt:"kotlin",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",php:"php",sql:"sql",graphql:"graphql",gql:"graphql",lua:"lua",r:"r",pl:"perl",dart:"dart",scala:"scala",ini:"ini",cfg:"ini",conf:"ini",txt:"plaintext",log:"plaintext"};function roe({file:e,canWrite:t,onChange:n,onSave:r,onRevert:s,onReload:a,onOverwrite:l,onDismissConflict:u,className:d}){return e?f.jsxs("div",{"data-slot":"file-viewer",className:xe("flex min-h-0 min-w-0 flex-1 flex-col bg-bg",d),children:[e.conflict?f.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-warning/40 bg-warning-bg px-3 py-2",children:[f.jsx($l,{className:"size-3.5 shrink-0 text-warning"}),f.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-warning",children:"This file changed on disk since you opened it."}),f.jsx(Je,{variant:"outline",size:"xs",onClick:()=>a?.(e.path),children:"Use the version on disk"}),f.jsx(Je,{variant:"outline",size:"xs",onClick:()=>l?.(e.path),children:"Keep mine"}),f.jsx(Je,{variant:"ghost",size:"xs",onClick:()=>u?.(e.path),children:"Dismiss"})]}):e.saveError?f.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2",children:[f.jsx($l,{className:"size-3.5 shrink-0 text-danger"}),f.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-danger",children:e.saveError}),f.jsx(Je,{variant:"ghost",size:"xs",onClick:()=>u?.(e.path),children:"Dismiss"})]}):null,e.status==="loading"?f.jsx(sb,{children:f.jsx(xn,{className:"size-4 text-fg-4"})}):e.status==="error"?f.jsxs(sb,{children:[f.jsx($l,{className:"size-4 text-danger"}),f.jsx("p",{className:"text-body-sm text-danger",children:e.error})]}):e.status==="binary"?f.jsxs(sb,{children:[f.jsx(BB,{className:"size-4 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-4",children:"This file isn’t text."}),f.jsx("p",{className:"text-label text-fg-4",children:"It can’t be edited here without corrupting it."})]}):f.jsx(Zae,{path:e.path,value:jb(e),readOnly:!t,onChange:n?h=>n(e.path,h):void 0,onSave:r?()=>r(e.path):void 0}),e.status==="ready"&&(e.saving||dd(e)||!t)?f.jsx("div",{className:"flex shrink-0 items-center gap-2 border-t border-border px-3 py-1",children:e.saving?f.jsxs(f.Fragment,{children:[f.jsx(xn,{className:"size-3 text-fg-4"}),f.jsx("span",{className:"text-label text-fg-4",children:"Saving…"})]}):t?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-label text-fg-3",children:"Unsaved changes"}),f.jsx("span",{className:"flex-1"}),f.jsx(Je,{variant:"ghost",size:"xs",onClick:()=>s?.(e.path),children:"Revert"}),f.jsxs(Je,{variant:"outline",size:"xs",onClick:()=>r?.(e.path),children:["Save",f.jsx("span",{className:"ml-1 text-fg-4",children:"⌘S"})]})]}):f.jsx("span",{className:"text-label text-fg-4",children:"Read-only — this gateway doesn’t allow writes."})}):null]}):null}function sb({children:e}){return f.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6",children:e})}const soe=180,ioe=520,aoe=220,Gk=120;function NI({client:e,sessionId:t,header:n,transcriptVariant:r,transcriptDensity:s,statusPlacement:a,unseen:l,readOnly:u,onVitals:d,defaultRailWidth:h=260,defaultRailCollapsed:p,onRailChange:m,className:b}){const{info:x}=OR(e,t),E=x?.cwd,N=J$(e,E),C=IR(e,E),S=tV(e),{canWrite:k}=Z$(e);y.useEffect(()=>{if(!S.hasUnsaved)return;const P=$=>$.preventDefault();return window.addEventListener("beforeunload",P),()=>window.removeEventListener("beforeunload",P)},[S.hasUnsaved]);const A=loe(),[R,M]=y.useState(p??!1),[_,O]=y.useState(h),j=y.useRef(m);j.current=m,y.useEffect(()=>{j.current?.({width:_,collapsed:R})},[_,R]);const[H,B]=y.useState(360),K=S.files.length>0,X=!A,Z=N.available&&!R;y.useEffect(()=>{X&&M(!0)},[X]);const te=y.useCallback(P=>{const $=S.files.find(L=>L.path===P);if($&&dd($)){const L=$.name;if(!window.confirm(`${L} has unsaved changes. Close it and lose them?`))return}S.close(P)},[S]),q=y.useRef(null),z=ooe(q),V=Math.max(Gk,z-aoe),[W,le]=y.useState(null),D=n===void 0||W===null?void 0:typeof n=="function"?P=>or.createPortal(n(P),W):or.createPortal(n,W);return f.jsxs("div",{"data-slot":"session-workspace",className:xe("flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg",b),children:[n!==void 0?f.jsx("div",{ref:le,className:"shrink-0"}):null,f.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[Z?f.jsx(Kae,{tree:N,search:C,activePath:S.activePath,onOpenFile:S.open,onCollapse:()=>M(!0),style:{width:X?Math.min(_,320):_},className:xe("shrink-0 border-r border-border",X&&"absolute inset-y-0 left-0 z-20 shadow-lg")}):N.available?f.jsx("div",{className:"flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5",children:f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Show project files",onClick:()=>M(!1),children:f.jsx(Ry,{className:"size-4 text-fg-3"})})}):null,Z&&!X?f.jsx(Rb,{orientation:"vertical",value:_,onValueChange:O,min:soe,max:ioe,"aria-label":"Resize the file tree"}):null,f.jsxs("div",{ref:q,className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[K?f.jsxs("div",{className:"flex min-h-0 shrink-0 flex-col overflow-hidden",style:{height:Math.min(H,V||H)},children:[f.jsx(Yae,{files:S.files,activePath:S.activePath,onActivate:S.activate,onClose:te}),f.jsx(roe,{file:S.active,canWrite:k,onChange:S.edit,onSave:P=>void S.save(P),onRevert:S.revert,onReload:S.reload,onOverwrite:P=>void S.overwrite(P),onDismissConflict:S.dismissConflict})]}):null,K?f.jsx(Rb,{orientation:"horizontal",value:Math.min(H,V||H),onValueChange:B,min:Gk,max:V,"aria-label":"Resize the open file"}):null,f.jsx(Nie,{client:e,sessionId:t,header:D,transcriptVariant:r,transcriptDensity:s,statusPlacement:a,unseen:l,readOnly:u,onVitals:d,className:"min-h-0 flex-1"})]}),X&&Z?f.jsx("button",{type:"button","aria-label":"Close the file tree",onClick:()=>M(!0),className:"absolute inset-0 z-10 bg-black/30"}):null]})]})}function ooe(e){const[t,n]=y.useState(0);return y.useLayoutEffect(()=>{const r=e.current;if(!r)return;const s=new ResizeObserver(([a])=>{a&&n(a.contentRect.height)});return s.observe(r),()=>s.disconnect()},[e]),t}function loe(){const[e,t]=y.useState(!0);return y.useEffect(()=>{const n=window.matchMedia("(min-width: 768px)"),r=()=>t(n.matches);return r(),n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const AI="workerdeck.rail",Kk={width:260,collapsed:!1};function _I(){try{const e=localStorage.getItem(AI),t=e?JSON.parse(e):{};return{width:Math.min(520,Math.max(180,Number(t.width)||Kk.width)),collapsed:t.collapsed===!0}}catch{return Kk}}function RI(e){try{localStorage.setItem(AI,JSON.stringify(e))}catch{}}function uoe(){const{jobId:e}=iu({from:"/jobs/$jobId"}),t=ks(),{jobs:n,refresh:r}=Lv(),{snapshots:s}=Ld(),a=n.find(N=>N.id===e),l=Mr(),u=Cp()?.id,d=a?.sessionId!==void 0&&(s.find(N=>N.host.id===u)?.sessions.some(N=>N.id===a.sessionId)??!1),[h,p]=y.useState(!1);y.useEffect(()=>{n.length>0&&p(!0)},[n.length]),y.useEffect(()=>{!h||a||(an.error("That job is no longer in the queue"),t({to:"/jobs"}))},[h,a,t]);const[m]=y.useState(Nv),[b]=y.useState(Av),[x]=y.useState(_I);if(!a)return null;const E=f.jsx(Xk,{job:a,onChanged:()=>void r()});return!l||!d||!a.sessionId?f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[E,f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center",children:[f.jsx("p",{className:"text-body-sm text-fg-3",children:a.sessionId?"This job’s session is no longer on the gateway.":"This job never got as far as a session."}),f.jsx("p",{className:"max-w-md text-label text-fg-4",children:"The queue keeps the job record — status, usage, error — but the transcript lives with the session, and that one has been closed or swept."})]})]}):f.jsx(NI,{client:l,sessionId:a.sessionId,readOnly:!0,transcriptVariant:b,transcriptDensity:m,statusPlacement:"bottom",defaultRailWidth:x.width,defaultRailCollapsed:x.collapsed,onRailChange:RI,header:({actions:N})=>f.jsx(Xk,{job:a,onChanged:()=>void r(),actions:N})},a.sessionId)}function Xk({job:e,onChanged:t,actions:n}){const r=CI[e.status],s=e.status==="queued"||e.status==="running"||e.status==="parked",a=async()=>{try{await Mr().cancelJob(e.id),t()}catch(l){an.error(l instanceof Error?l.message:"Cancel failed")}};return f.jsxs(Dv,{crumbs:[{label:"Jobs",to:"/jobs"},{label:e.prompt}],actions:f.jsxs(f.Fragment,{children:[f.jsx(gn,{variant:"neutral",className:"shrink-0",children:"read-only"}),f.jsx(ud,{value:e.id,"aria-label":"Copy job id"}),s?f.jsxs(Je,{variant:"outline",size:"xs",onClick:()=>void a(),children:[f.jsx(Ss,{className:"size-3"}),"Cancel"]}):null,n]}),children:[f.jsxs(gn,{variant:r.variant,dot:!r.busy,className:"shrink-0",children:[r.busy?f.jsx(xn,{className:"size-3 text-current"}):null,r.label]}),f.jsxs("div",{className:"flex min-w-0 items-center gap-x-3 font-mono text-label text-fg-4",children:[f.jsx("span",{className:"truncate",children:e.cwd}),e.profile?f.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,f.jsx("span",{className:"shrink-0",children:du(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?f.jsxs("span",{className:"shrink-0",children:["attempt ",e.attempt??1,"/",e.maxAttempts,e.status==="queued"&&e.nextRunAt!==void 0&&e.nextRunAt>Date.now()?" — retry pending":""]}):null,e.usage.tokens>0?f.jsxs("span",{className:"shrink-0",children:[us(e.usage.tokens)," tok"]}):null,e.usage.totalCostUsd>0?f.jsx("span",{className:"shrink-0",children:Sa(e.usage.totalCostUsd)}):null,e.error?f.jsx("span",{className:"truncate text-danger",children:e.error}):null]})]})}const coe=["web_search","download","web_fetch","deliver_file"],Rh=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function ca({label:e,children:t}){return f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function doe({profile:e,onSaved:t}){const n=e.engine==="provider",[r,s]=y.useState(e.description??""),[a,l]=y.useState(e.defaults?.model??""),[u,d]=y.useState(e.defaults?.permissionMode),[h,p]=y.useState(e.provider?.model??""),[m,b]=y.useState((e.provider?.models??[]).join(", ")),[x,E]=y.useState(e.session?.capabilities),[N,C]=y.useState((e.session?.mcpServers??[]).join(", ")),[S,k]=y.useState(e.session?.instructions??""),[A,R]=y.useState(!1),M=async()=>{const _={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:u}};n&&(_.provider={...e.provider,id:e.provider?.id??"",model:h.trim()||void 0,models:Rh(m).length>0?Rh(m):void 0},_.session={capabilities:x,mcpServers:Rh(N).length>0?Rh(N):void 0,instructions:S.trim()||void 0}),R(!0);try{t(await Mr().updateProfile(e.name,_)),an.success("Profile saved")}catch(O){an.error(O instanceof Error?O.message:"Failed to save profile")}finally{R(!1)}};return f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Edit profile"})}),f.jsxs(Ni,{className:"flex flex-col gap-3",children:[f.jsx(ca,{label:"Description",children:f.jsx(Yt,{value:r,onChange:_=>s(_.target.value)})}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(ca,{label:"Default model",children:f.jsx(Yt,{value:a,onChange:_=>l(_.target.value),placeholder:"unset — request / engine default",className:"font-mono"})}),f.jsx(ca,{label:"Default permission mode",children:f.jsx(op,{variant:"form",mode:u,onModeChange:d,modes:(e.capabilities??wd[e.engine??"claude"]).permissionModes})})]}),n?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(ca,{label:"Default model id",children:f.jsx(Yt,{value:h,onChange:_=>p(_.target.value),className:"font-mono"})}),f.jsx(ca,{label:"Models offered (comma-separated)",children:f.jsx(Yt,{value:m,onChange:_=>b(_.target.value),className:"font-mono"})})]}),f.jsx(ca,{label:"Capabilities granted",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-3 py-1.5",children:[f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",checked:x===void 0,onChange:_=>E(_.target.checked?void 0:[]),className:"size-3.5 accent-(--color-fg-1)"}),"not declared"]}),coe.map(_=>f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",disabled:x===void 0,checked:x?.includes(_)??!1,onChange:O=>E(j=>O.target.checked?[...j??[],_]:(j??[]).filter(H=>H!==_)),className:"size-3.5 accent-(--color-fg-1) disabled:opacity-40"}),f.jsx("code",{className:"font-mono text-label",children:_})]},_))]})}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(ca,{label:"MCP servers (names, comma-separated)",children:f.jsx(Yt,{value:N,onChange:_=>C(_.target.value),className:"font-mono"})}),f.jsx(ca,{label:"Instructions",children:f.jsx(Yt,{value:S,onChange:_=>k(_.target.value)})})]})]}):null,f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("p",{className:"text-label text-fg-4",children:"Name and engine are fixed — sessions and jobs are pinned to the name, and the engine decides what the rest of these fields mean."}),f.jsxs(Je,{onClick:()=>void M(),disabled:A,children:[A?f.jsx(xn,{className:"size-3.5 text-current"}):f.jsx(Dz,{className:"size-4"}),"Save"]})]})]})]})}function foe(e){window.location.href=`vscode://file${e}`}function hoe(){return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center",children:[f.jsx(My,{className:"size-8 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-3",children:"Select a profile on the left to view it."}),f.jsx("p",{className:"max-w-sm text-label text-fg-4",children:"A profile is what a session runs as: a named Claude Code config directory — its own settings, memory, skills and credentials — or a model provider for the model-agnostic engine."})]})}function Mn({label:e,children:t}){return f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),f.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function da({items:e,empty:t}){return e.length===0?f.jsx("span",{className:"text-fg-4",children:t}):f.jsx("span",{className:"flex flex-wrap justify-end gap-1",children:e.map(n=>f.jsx(gn,{variant:"neutral",children:n},n))})}function moe(){const{profileName:e}=iu({from:"/profiles/$profileName"}),t=ks(),{refresh:n}=Mv(),[r,s]=y.useState(),[a,l]=y.useState();y.useEffect(()=>{let p=!0;return Mr()?.getProfile(e).then(m=>{p&&s(m)}).catch(m=>{p&&l(m instanceof Error?m.message:"Failed to load profile")}),()=>{p=!1}},[e]);const u=r?.profile,d=r?.config,h=async()=>{try{await Mr().deleteProfile(e),await n(),an.success(`Profile '${e}' deleted`),t({to:"/profiles"})}catch(p){an.error(p instanceof Error?p.message:"Delete failed")}};return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(Dv,{crumbs:[{label:"Profiles",to:"/profiles"},{label:e}],actions:f.jsxs(f.Fragment,{children:[u?.configDir?f.jsxs(Je,{variant:"outline",size:"xs",onClick:()=>foe(u.configDir),children:[f.jsx(M_,{className:"size-3"}),"Open in VSCode"]}):null,u?.managed?f.jsxs(Je,{variant:"outline",size:"xs",onClick:()=>void h(),children:[f.jsx(Td,{className:"size-3"}),"Delete"]}):null]}),children:u?.description?f.jsx("span",{className:"min-w-0 truncate text-label text-fg-4",children:u.description}):null}),f.jsxs(wI,{children:[a?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:a}):null,!r&&!a?f.jsx(xn,{className:"mx-auto size-5 text-fg-4"}):null,u&&d?f.jsxs(f.Fragment,{children:[f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Worker defaults"})}),f.jsxs(Ni,{className:"flex flex-col divide-y divide-border",children:[f.jsx(Mn,{label:"Engine",children:f.jsx(gn,{variant:"neutral",children:u.engine??"claude"})}),u.engine==="provider"?f.jsx(Mn,{label:"Provider",children:f.jsx("span",{className:"font-mono text-label",children:u.provider?.id})}):f.jsx(Mn,{label:"Config directory",children:f.jsx("span",{className:"font-mono text-label",children:u.configDir})}),f.jsx(Mn,{label:"Default model",children:u.defaults?.model??u.provider?.model??f.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),f.jsx(Mn,{label:"Default permission mode",children:u.defaults?.permissionMode??f.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),u.engine==="provider"?f.jsxs(f.Fragment,{children:[f.jsx(Mn,{label:"Models offered",children:f.jsx(da,{items:u.provider?.models??[],empty:"the default model only"})}),f.jsx(Mn,{label:"API key variable",children:u.provider?.apiKeyEnv?f.jsx("span",{className:"font-mono text-label",children:u.provider.apiKeyEnv}):f.jsx("span",{className:"text-fg-4",children:"provider SDK default"})})]}):null]})]}),u.engine==="provider"?f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Session grants"})}),f.jsxs(Ni,{className:"flex flex-col divide-y divide-border",children:[f.jsx(Mn,{label:"Capabilities",children:f.jsx(da,{items:u.session?.capabilities??[],empty:"not declared — whatever the server wired"})}),f.jsx(Mn,{label:"MCP servers",children:f.jsx(da,{items:u.session?.mcpServers??[],empty:"not declared — every connected server"})}),f.jsx(Mn,{label:"Instructions",children:u.session?.instructions?`${u.session.instructions.length} characters`:f.jsx("span",{className:"text-fg-4",children:"none"})})]})]}):null,u.engine==="provider"?null:f.jsxs(Ci,{children:[f.jsx(wi,{children:f.jsx(ki,{children:"Claude Code configuration"})}),f.jsxs(Ni,{className:"flex flex-col divide-y divide-border",children:[d.settings?f.jsxs(f.Fragment,{children:[f.jsx(Mn,{label:"Model (settings.json)",children:d.settings.model??f.jsx("span",{className:"text-fg-4",children:"not set"})}),f.jsx(Mn,{label:"Default permission mode",children:d.settings.defaultPermissionMode??f.jsx("span",{className:"text-fg-4",children:"not set"})}),f.jsx(Mn,{label:"Permission rules",children:f.jsx("span",{className:"font-mono text-label",children:d.settings.permissionRules?`${d.settings.permissionRules.allow} allow · ${d.settings.permissionRules.ask} ask · ${d.settings.permissionRules.deny} deny`:"—"})}),f.jsx(Mn,{label:"Env vars (names only)",children:f.jsx(da,{items:d.settings.envKeys??[],empty:"none"})}),f.jsx(Mn,{label:"Hooks",children:f.jsx(da,{items:d.settings.hooks??[],empty:"none"})})]}):f.jsx(Mn,{label:"settings.json",children:f.jsx("span",{className:"text-fg-4",children:"not found"})}),f.jsx(Mn,{label:"User memory (CLAUDE.md)",children:d.hasUserMemory?"present":f.jsx("span",{className:"text-fg-4",children:"none"})}),f.jsx(Mn,{label:"Skills",children:f.jsx(da,{items:d.skills,empty:"none"})}),f.jsx(Mn,{label:"Agents",children:f.jsx(da,{items:d.agents,empty:"none"})}),f.jsx(Mn,{label:"Commands",children:f.jsx(da,{items:d.commands,empty:"none"})})]})]}),u.managed?f.jsx(doe,{profile:u,onSaved:p=>s({...r,profile:p})}):null,f.jsxs("p",{className:"text-label text-fg-4",children:[u.managed?"Stored on the server and editable here. ":"View only — this profile is declared in the server options. ","Other profile configuration lives on the server (the"," ",f.jsx("code",{className:"font-mono",children:"profiles"})," option; for Claude profiles, the config directory itself, e.g. via VSCode). Provider credentials are resolved from the server's environment and never leave it."]})]}):null]})]})}function poe(){const{hostId:e,sessionId:t}=iu({from:"/sessions/$hostId/$sessionId"}),{ready:n}=Iv(),r=ks(),s=gd(e);return y.useEffect(()=>{!n||s||(an.error("That gateway is not configured here"),r({to:"/sessions"}))},[n,s,r]),s?f.jsx(goe,{hostId:e,sessionId:t,client:s},`${e}:${t}`):null}function goe({hostId:e,sessionId:t,client:n}){const r=ks(),{info:s,error:a}=OR(n,t),l=uae(e,t),[u]=y.useState(()=>lae(e,t)),[d]=y.useState(Nv),[h]=y.useState(Av),[p]=y.useState(_I);y.useEffect(()=>{a&&(an.error("Session not found"),r({to:"/sessions"}))},[a,r]);const m=async()=>{try{await n.deleteSession(t)}catch{}r({to:"/sessions"})},b=s?.cwd?.split("/").filter(Boolean).pop();return f.jsx(NI,{client:n,sessionId:t,transcriptVariant:h,transcriptDensity:d,statusPlacement:"bottom",defaultRailWidth:p.width,defaultRailCollapsed:p.collapsed,onRailChange:RI,unseen:u,onVitals:x=>{l({itemCount:x.itemCount,activity:s?.activityCount,turns:s?.numTurns}),mae()},header:({actions:x})=>f.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-surface px-3 py-2",children:[f.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:s?.title??b??t.slice(0,8)}),s?.engine&&s.engine!=="claude"?f.jsx(gn,{variant:"neutral",className:"shrink-0",children:s.engine}):null,s?.cwd?f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:s.cwd,children:s.cwd}):null,f.jsx("span",{className:"flex-1"}),f.jsx(ud,{value:t,"aria-label":"Copy session id"}),f.jsxs(SU,{children:[f.jsx(CU,{render:f.jsx(Je,{variant:"ghost",size:"icon-sm","aria-label":"Close session",children:f.jsx(Td,{className:"size-4 text-fg-3"})})}),f.jsxs(kU,{children:[f.jsx(NU,{children:"Close this session?"}),f.jsx(AU,{children:"The run is terminated on the server. You can pick it up later from “Resume a previous session” — the transcript is kept by the engine, not by the gateway."}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsx(wU,{render:f.jsx(Je,{variant:"outline",children:"Cancel"})}),f.jsx(Je,{variant:"destructive",onClick:()=>void m(),children:"Close session"})]})]})]}),x]})},t)}const ps=A8({component:$ae}),boe=Ns({getParentRoute:()=>ps,path:"/",beforeLoad:()=>{throw Rm({to:"/sessions"})}}),xoe=Ns({getParentRoute:()=>ps,path:"/sessions",component:Uae}),yoe=Ns({getParentRoute:()=>ps,path:"/sessions/$hostId/$sessionId",component:poe}),voe=Ns({getParentRoute:()=>ps,path:"/sessions/$sessionId",beforeLoad:({params:e})=>{throw Rm({to:"/sessions/$hostId/$sessionId",params:{hostId:aI,sessionId:e.sessionId}})}}),Eoe=Ns({getParentRoute:()=>ps,path:"/gateways",component:qae}),Toe=Ns({getParentRoute:()=>ps,path:"/gateways/$hostId",component:Vae}),Soe=Ns({getParentRoute:()=>ps,path:"/jobs",component:Rae}),Coe=Ns({getParentRoute:()=>ps,path:"/jobs/$jobId",component:uoe}),woe=Ns({getParentRoute:()=>ps,path:"/profiles",component:hoe}),koe=Ns({getParentRoute:()=>ps,path:"/profiles/$profileName",component:moe}),Noe=Ns({getParentRoute:()=>ps,path:"/settings",beforeLoad:()=>{throw Rm({to:"/sessions"})}}),Aoe=H8({routeTree:ps.addChildren([boe,xoe,yoe,voe,Eoe,Toe,Soe,Coe,woe,koe,Noe]),history:YL()});function _oe(){return f.jsxs(f.Fragment,{children:[f.jsx(V8,{router:Aoe}),f.jsx(KH,{})]})}Zk();const II=document.getElementById("root");if(!II)throw new Error("Root element #root not found");ZM.createRoot(II).render(f.jsx(y.StrictMode,{children:f.jsx(_oe,{})}));const Roe=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:B5},Symbol.toStringTag,{value:"Module"}));export{Hne as A,Moe as L,Yr as R,eu as _,f as j,y as r};