@workerdeck/web 0.11.0 → 0.13.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,673 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-976cPiHW.js","assets/index-CXkKwxiP.css"])))=>i.map(i=>d[i]);
2
- function oM(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)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(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function um(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d0={exports:{}},tc={};/**
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 R2;function lM(){if(R2)return tc;R2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return tc.Fragment=t,tc.jsx=n,tc.jsxs=n,tc}var O2;function uM(){return O2||(O2=1,d0.exports=lM()),d0.exports}var h=uM(),f0={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 I2;function cM(){if(I2)return gt;I2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=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 v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,w={};function S(P,F,j){this.props=P,this.context=F,this.refs=w,this.updater=j||v}S.prototype.isReactComponent={},S.prototype.setState=function(P,F){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,F,"setState")},S.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=S.prototype;function _(P,F,j){this.props=P,this.context=F,this.refs=w,this.updater=j||v}var A=_.prototype=new N;A.constructor=_,k(A,S.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function U(P,F,j){var ae=j.ref;return{$$typeof:e,type:P,key:F,ref:ae!==void 0?ae:null,props:j}}function z(P,F){return U(P.type,F,P.props)}function X(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function W(P){var F={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(j){return F[j]})}var V=/\/+/g;function ee(P,F){return typeof P=="object"&&P!==null&&P.key!=null?W(""+P.key):F.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(R,R):(P.status="pending",P.then(function(F){P.status==="pending"&&(P.status="fulfilled",P.value=F)},function(F){P.status==="pending"&&(P.status="rejected",P.reason=F)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function B(P,F,j,ae,ie){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 g:return de=P._init,B(de(P._payload),F,j,ae,ie)}}if(de)return ie=ie(P),de=ae===""?"."+ee(P,0):ae,L(ie)?(j="",de!=null&&(j=de.replace(V,"$&/")+"/"),B(ie,F,j,"",function(Fe){return Fe})):ie!=null&&(X(ie)&&(ie=z(ie,j+(ie.key==null||P&&P.key===ie.key?"":(""+ie.key).replace(V,"$&/")+"/")+de)),F.push(ie)),1;de=0;var fe=ae===""?".":ae+":";if(L(P))for(var ve=0;ve<P.length;ve++)ae=P[ve],ce=fe+ee(ae,ve),de+=B(ae,F,j,ce,ie);else if(ve=x(P),typeof ve=="function")for(P=ve.call(P),ve=0;!(ae=P.next()).done;)ae=ae.value,ce=fe+ee(ae,ve++),de+=B(ae,F,j,ce,ie);else if(ce==="object"){if(typeof P.then=="function")return B(q(P),F,j,ae,ie);throw F=String(P),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return de}function G(P,F,j){if(P==null)return P;var ae=[],ie=0;return B(P,ae,"","",function(ce){return F.call(j,ce,ie++)}),ae}function Q(P){if(P._status===-1){var F=P._result;F=F(),F.then(function(j){(P._status===0||P._status===-1)&&(P._status=1,P._result=j)},function(j){(P._status===0||P._status===-1)&&(P._status=2,P._result=j)}),P._status===-1&&(P._status=0,P._result=F)}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 F=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(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},M={map:G,forEach:function(P,F,j){G(P,function(){F.apply(this,arguments)},j)},count:function(P){var F=0;return G(P,function(){F++}),F},toArray:function(P){return G(P,function(F){return F})||[]},only:function(P){if(!X(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return gt.Activity=m,gt.Children=M,gt.Component=S,gt.Fragment=n,gt.Profiler=i,gt.PureComponent=_,gt.StrictMode=r,gt.Suspense=d,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,gt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return D.H.useMemoCache(P)}},gt.cache=function(P){return function(){return P.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(P,F,j){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var ae=k({},P.props),ie=P.key;if(F!=null)for(ce in F.key!==void 0&&(ie=""+F.key),F)!I.call(F,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&F.ref===void 0||(ae[ce]=F[ce]);var ce=arguments.length-2;if(ce===1)ae.children=j;else if(1<ce){for(var de=Array(ce),fe=0;fe<ce;fe++)de[fe]=arguments[fe+2];ae.children=de}return U(P.type,ie,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,F,j){var ae,ie={},ce=null;if(F!=null)for(ae in F.key!==void 0&&(ce=""+F.key),F)I.call(F,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ie[ae]=F[ae]);var de=arguments.length-2;if(de===1)ie.children=j;else if(1<de){for(var fe=Array(de),ve=0;ve<de;ve++)fe[ve]=arguments[ve+2];ie.children=fe}if(P&&P.defaultProps)for(ae in de=P.defaultProps,de)ie[ae]===void 0&&(ie[ae]=de[ae]);return U(P,ce,ie)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(P){return{$$typeof:c,render:P}},gt.isValidElement=X,gt.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:Q}},gt.memo=function(P,F){return{$$typeof:f,type:P,compare:F===void 0?null:F}},gt.startTransition=function(P){var F=D.T,j={};D.T=j;try{var ae=P(),ie=D.S;ie!==null&&ie(j,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(R,le)}catch(ce){le(ce)}finally{F!==null&&j.types!==null&&(F.types=j.types),D.T=F}},gt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},gt.use=function(P){return D.H.use(P)},gt.useActionState=function(P,F,j){return D.H.useActionState(P,F,j)},gt.useCallback=function(P,F){return D.H.useCallback(P,F)},gt.useContext=function(P){return D.H.useContext(P)},gt.useDebugValue=function(){},gt.useDeferredValue=function(P,F){return D.H.useDeferredValue(P,F)},gt.useEffect=function(P,F){return D.H.useEffect(P,F)},gt.useEffectEvent=function(P){return D.H.useEffectEvent(P)},gt.useId=function(){return D.H.useId()},gt.useImperativeHandle=function(P,F,j){return D.H.useImperativeHandle(P,F,j)},gt.useInsertionEffect=function(P,F){return D.H.useInsertionEffect(P,F)},gt.useLayoutEffect=function(P,F){return D.H.useLayoutEffect(P,F)},gt.useMemo=function(P,F){return D.H.useMemo(P,F)},gt.useOptimistic=function(P,F){return D.H.useOptimistic(P,F)},gt.useReducer=function(P,F,j){return D.H.useReducer(P,F,j)},gt.useRef=function(P){return D.H.useRef(P)},gt.useState=function(P){return D.H.useState(P)},gt.useSyncExternalStore=function(P,F,j){return D.H.useSyncExternalStore(P,F,j)},gt.useTransition=function(){return D.H.useTransition()},gt.version="19.2.7",gt}var M2;function rd(){return M2||(M2=1,f0.exports=cM()),f0.exports}var E=rd();const Ue=um(E),dM=oM({__proto__:null,default:Ue},[E]);var h0={exports:{}},nc={},m0={exports:{}},p0={};/**
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 L2;function fM(){return L2||(L2=1,(function(e){function t(B,G){var Q=B.length;B.push(G);e:for(;0<Q;){var le=Q-1>>>1,M=B[le];if(0<i(M,G))B[le]=G,B[Q]=M,Q=le;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var G=B[0],Q=B.pop();if(Q!==G){B[0]=Q;e:for(var le=0,M=B.length,P=M>>>1;le<P;){var F=2*(le+1)-1,j=B[F],ae=F+1,ie=B[ae];if(0>i(j,Q))ae<M&&0>i(ie,j)?(B[le]=ie,B[ae]=Q,le=ae):(B[le]=j,B[F]=Q,le=F);else if(ae<M&&0>i(ie,Q))B[le]=ie,B[ae]=Q,le=ae;else break e}}return G}function i(B,G){var Q=B.sortIndex-G.sortIndex;return Q!==0?Q:B.id-G.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,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],g=1,m=null,b=3,x=!1,v=!1,k=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function A(B){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=B)r(f),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(f)}}function L(B){if(k=!1,A(B),!v)if(n(d)!==null)v=!0,R||(R=!0,W());else{var G=n(f);G!==null&&q(L,G.startTime-B)}}var R=!1,D=-1,I=5,U=-1;function z(){return w?!0:!(e.unstable_now()-U<I)}function X(){if(w=!1,R){var B=e.unstable_now();U=B;var G=!0;try{e:{v=!1,k&&(k=!1,N(D),D=-1),x=!0;var Q=b;try{t:{for(A(B),m=n(d);m!==null&&!(m.expirationTime>B&&z());){var le=m.callback;if(typeof le=="function"){m.callback=null,b=m.priorityLevel;var M=le(m.expirationTime<=B);if(B=e.unstable_now(),typeof M=="function"){m.callback=M,A(B),G=!0;break t}m===n(d)&&r(d),A(B)}else r(d);m=n(d)}if(m!==null)G=!0;else{var P=n(f);P!==null&&q(L,P.startTime-B),G=!1}}break e}finally{m=null,b=Q,x=!1}G=void 0}}finally{G?W():R=!1}}}var W;if(typeof _=="function")W=function(){_(X)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,ee=V.port2;V.port1.onmessage=X,W=function(){ee.postMessage(null)}}else W=function(){S(X,0)};function q(B,G){D=S(function(){B(e.unstable_now())},G)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(B){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var Q=b;b=G;try{return B()}finally{b=Q}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Q=b;b=B;try{return G()}finally{b=Q}},e.unstable_scheduleCallback=function(B,G,Q){var le=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?le+Q:le):Q=le,B){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=Q+M,B={id:g++,callback:G,priorityLevel:B,startTime:Q,expirationTime:M,sortIndex:-1},Q>le?(B.sortIndex=Q,t(f,B),n(d)===null&&B===n(f)&&(k?(N(D),D=-1):k=!0,q(L,Q-le))):(B.sortIndex=M,t(d,B),v||x||(v=!0,R||(R=!0,W()))),B},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(B){var G=b;return function(){var Q=b;b=G;try{return B.apply(this,arguments)}finally{b=Q}}}})(p0)),p0}var D2;function hM(){return D2||(D2=1,m0.exports=fM()),m0.exports}var g0={exports:{}},rr={};/**
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 j2;function mM(){if(j2)return rr;j2=1;var e=rd();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+f+" 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},i=Symbol.for("react.portal");function a(d,f,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rr.createPortal=function(d,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,g)},rr.flushSync=function(d){var f=l.T,g=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=g,r.d.f()}},rr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},rr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},rr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var g=f.as,m=c(g,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:x}):g==="script"&&r.d.X(d,{crossOrigin:m,integrity:b,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},rr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},rr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,m=c(g,f.crossOrigin);r.d.L(d,g,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},rr.preloadModule=function(d,f){if(typeof d=="string")if(f){var g=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},rr.requestFormReset=function(d){r.d.r(d)},rr.unstable_batchedUpdates=function(d,f){return d(f)},rr.useFormState=function(d,f,g){return l.H.useFormState(d,f,g)},rr.useFormStatus=function(){return l.H.useHostTransitionStatus()},rr.version="19.2.7",rr}var P2;function qk(){if(P2)return g0.exports;P2=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(),g0.exports=mM(),g0.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 B2;function pM(){if(B2)return nc;B2=1;var e=hM(),t=rd(),n=qk();function r(s){var o="https://react.dev/errors/"+s;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var o=s,u=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,(o.flags&4098)!==0&&(u=o.return),s=o.return;while(s)}return o.tag===3?u:null}function l(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function c(s){if(s.tag===31){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var o=s.alternate;if(!o){if(o=a(s),o===null)throw Error(r(188));return o!==s?null:s}for(var u=s,p=o;;){var y=u.return;if(y===null)break;var T=y.alternate;if(T===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===T.child){for(T=y.child;T;){if(T===u)return d(y),s;if(T===p)return d(y),o;T=T.sibling}throw Error(r(188))}if(u.return!==p.return)u=y,p=T;else{for(var O=!1,H=y.child;H;){if(H===u){O=!0,u=y,p=T;break}if(H===p){O=!0,p=y,u=T;break}H=H.sibling}if(!O){for(H=T.child;H;){if(H===u){O=!0,u=T,p=y;break}if(H===p){O=!0,p=T,u=y;break}H=H.sibling}if(!O)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:o}function g(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=g(s),o!==null)return o;s=s.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),_=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function W(s){return s===null||typeof s!="object"?null:(s=X&&s[X]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function ee(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case k:return"Fragment";case S:return"Profiler";case w:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case U:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case v:return"Portal";case _:return s.displayName||"Context";case N:return(s._context.displayName||"Context")+".Consumer";case A:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return o=s.displayName||null,o!==null?o:ee(s.type)||"Memo";case I:o=s._payload,s=s._init;try{return ee(s(o))}catch{}}return null}var q=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},le=[],M=-1;function P(s){return{current:s}}function F(s){0>M||(s.current=le[M],le[M]=null,M--)}function j(s,o){M++,le[M]=s.current,s.current=o}var ae=P(null),ie=P(null),ce=P(null),de=P(null);function fe(s,o){switch(j(ce,o),j(ie,s),j(ae,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?JT(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=JT(o),s=e2(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}F(ae),j(ae,s)}function ve(){F(ae),F(ie),F(ce)}function Fe(s){s.memoizedState!==null&&j(de,s);var o=ae.current,u=e2(o,s.type);o!==u&&(j(ie,s),j(ae,u))}function Le(s){ie.current===s&&(F(ae),F(ie)),de.current===s&&(F(de),Qu._currentValue=Q)}var Ee,Oe;function ze(s){if(Ee===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);Ee=o&&o[1]||"",Oe=-1<u.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Ee+s+Oe}var Ge=!1;function $e(s,o){if(!s||Ge)return"";Ge=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(o){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(Te){var xe=Te}Reflect.construct(s,[],Ae)}else{try{Ae.call()}catch(Te){xe=Te}s.call(Ae.prototype)}}else{try{throw Error()}catch(Te){xe=Te}(Ae=s())&&typeof Ae.catch=="function"&&Ae.catch(function(){})}}catch(Te){if(Te&&xe&&typeof Te.stack=="string")return[Te.stack,xe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=p.DetermineComponentFrameRoot(),O=T[0],H=T[1];if(O&&H){var se=O.split(`
45
- `),be=H.split(`
46
- `);for(y=p=0;p<se.length&&!se[p].includes("DetermineComponentFrameRoot");)p++;for(;y<be.length&&!be[y].includes("DetermineComponentFrameRoot");)y++;if(p===se.length||y===be.length)for(p=se.length-1,y=be.length-1;1<=p&&0<=y&&se[p]!==be[y];)y--;for(;1<=p&&0<=y;p--,y--)if(se[p]!==be[y]){if(p!==1||y!==1)do if(p--,y--,0>y||se[p]!==be[y]){var Ne=`
47
- `+se[p].replace(" at new "," at ");return s.displayName&&Ne.includes("<anonymous>")&&(Ne=Ne.replace("<anonymous>",s.displayName)),Ne}while(1<=p&&0<=y);break}}}finally{Ge=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?ze(u):""}function De(s,o){switch(s.tag){case 26:case 27:case 5:return ze(s.type);case 16:return ze("Lazy");case 13:return s.child!==o&&o!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return $e(s.type,!1);case 11:return $e(s.type.render,!1);case 1:return $e(s.type,!0);case 31:return ze("Activity");default:return""}}function ke(s){try{var o="",u=null;do o+=De(s,u),u=s,s=s.return;while(s);return o}catch(p){return`
48
- Error generating stack: `+p.message+`
49
- `+p.stack}}var ye=Object.prototype.hasOwnProperty,Ie=e.unstable_scheduleCallback,je=e.unstable_cancelCallback,te=e.unstable_shouldYield,me=e.unstable_requestPaint,Z=e.unstable_now,re=e.unstable_getCurrentPriorityLevel,K=e.unstable_ImmediatePriority,$=e.unstable_UserBlockingPriority,oe=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,Re=e.unstable_IdlePriority,Ve=e.log,ot=e.unstable_setDisableYieldValue,et=null,dt=null;function ut(s){if(typeof Ve=="function"&&ot(s),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(et,s)}catch{}}var qe=Math.clz32?Math.clz32:lt,Rt=Math.log,jt=Math.LN2;function lt(s){return s>>>=0,s===0?32:31-(Rt(s)/jt|0)|0}var Lt=256,Qt=262144,$t=4194304;function Zt(s){var o=s&42;if(o!==0)return o;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Xe(s,o,u){var p=s.pendingLanes;if(p===0)return 0;var y=0,T=s.suspendedLanes,O=s.pingedLanes;s=s.warmLanes;var H=p&134217727;return H!==0?(p=H&~T,p!==0?y=Zt(p):(O&=H,O!==0?y=Zt(O):u||(u=H&~s,u!==0&&(y=Zt(u))))):(H=p&~T,H!==0?y=Zt(H):O!==0?y=Zt(O):u||(u=p&~s,u!==0&&(y=Zt(u)))),y===0?0:o!==0&&o!==y&&(o&T)===0&&(T=y&-y,u=o&-o,T>=u||T===32&&(u&4194048)!==0)?o:y}function yt(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function Ut(s,o){switch(s){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 Jt(){var s=$t;return $t<<=1,($t&62914560)===0&&($t=4194304),s}function Kn(s){for(var o=[],u=0;31>u;u++)o.push(s);return o}function Et(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function an(s,o,u,p,y,T){var O=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var H=s.entanglements,se=s.expirationTimes,be=s.hiddenUpdates;for(u=O&~u;0<u;){var Ne=31-qe(u),Ae=1<<Ne;H[Ne]=0,se[Ne]=-1;var xe=be[Ne];if(xe!==null)for(be[Ne]=null,Ne=0;Ne<xe.length;Ne++){var Te=xe[Ne];Te!==null&&(Te.lane&=-536870913)}u&=~Ae}p!==0&&Er(s,p,0),T!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=T&~(O&~o))}function Er(s,o,u){s.pendingLanes|=o,s.suspendedLanes&=~o;var p=31-qe(o);s.entangledLanes|=o,s.entanglements[p]=s.entanglements[p]|1073741824|u&261930}function pn(s,o){var u=s.entangledLanes|=o;for(s=s.entanglements;u;){var p=31-qe(u),y=1<<p;y&o|s[p]&o&&(s[p]|=o),u&=~y}}function Sn(s,o){var u=o&-o;return u=(u&42)!==0?1:ht(u),(u&(s.suspendedLanes|o))!==0?0:u}function ht(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Ot(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function bn(){var s=G.p;return s!==0?s:(s=window.event,s===void 0?32:S2(s.type))}function Hn(s,o){var u=G.p;try{return G.p=s,o()}finally{G.p=u}}var Dn=Math.random().toString(36).slice(2),en="__reactFiber$"+Dn,Xn="__reactProps$"+Dn,ys="__reactContainer$"+Dn,du="__reactEvents$"+Dn,Ed="__reactListeners$"+Dn,QO="__reactHandles$"+Dn,Hy="__reactResources$"+Dn,fu="__reactMarker$"+Dn;function rp(s){delete s[en],delete s[Xn],delete s[du],delete s[Ed],delete s[QO]}function Lo(s){var o=s[en];if(o)return o;for(var u=s.parentNode;u;){if(o=u[ys]||u[en]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(s=o2(s);s!==null;){if(u=s[en])return u;s=o2(s)}return o}s=u,u=s.parentNode}return null}function Do(s){if(s=s[en]||s[ys]){var o=s.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return s}return null}function hu(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s.stateNode;throw Error(r(33))}function jo(s){var o=s[Hy];return o||(o=s[Hy]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Un(s){s[fu]=!0}var Uy=new Set,Fy={};function Ta(s,o){Po(s,o),Po(s+"Capture",o)}function Po(s,o){for(Fy[s]=o,s=0;s<o.length;s++)Uy.add(o[s])}var ZO=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]*$"),$y={},Vy={};function JO(s){return ye.call(Vy,s)?!0:ye.call($y,s)?!1:ZO.test(s)?Vy[s]=!0:($y[s]=!0,!1)}function vd(s,o,u){if(JO(o))if(u===null)s.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(o);return;case"boolean":var p=o.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){s.removeAttribute(o);return}}s.setAttribute(o,""+u)}}function Td(s,o,u){if(u===null)s.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttribute(o,""+u)}}function Us(s,o,u,p){if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(o,u,""+p)}}function Xr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function qy(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function e6(s,o,u){var p=Object.getOwnPropertyDescriptor(s.constructor.prototype,o);if(!s.hasOwnProperty(o)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,T=p.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return y.call(this)},set:function(O){u=""+O,T.call(this,O)}}),Object.defineProperty(s,o,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(O){u=""+O},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function sp(s){if(!s._valueTracker){var o=qy(s)?"checked":"value";s._valueTracker=e6(s,o,""+s[o])}}function Yy(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var u=o.getValue(),p="";return s&&(p=qy(s)?s.checked?"true":"false":s.value),s=p,s!==u?(o.setValue(s),!0):!1}function Sd(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var t6=/[\n"\\]/g;function Wr(s){return s.replace(t6,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function ip(s,o,u,p,y,T,O,H){s.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.type=O:s.removeAttribute("type"),o!=null?O==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Xr(o)):s.value!==""+Xr(o)&&(s.value=""+Xr(o)):O!=="submit"&&O!=="reset"||s.removeAttribute("value"),o!=null?ap(s,O,Xr(o)):u!=null?ap(s,O,Xr(u)):p!=null&&s.removeAttribute("value"),y==null&&T!=null&&(s.defaultChecked=!!T),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?s.name=""+Xr(H):s.removeAttribute("name")}function Gy(s,o,u,p,y,T,O,H){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.type=T),o!=null||u!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){sp(s);return}u=u!=null?""+Xr(u):"",o=o!=null?""+Xr(o):u,H||o===s.value||(s.value=o),s.defaultValue=o}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,s.checked=H?s.checked:!!p,s.defaultChecked=!!p,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(s.name=O),sp(s)}function ap(s,o,u){o==="number"&&Sd(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Bo(s,o,u,p){if(s=s.options,o){o={};for(var y=0;y<u.length;y++)o["$"+u[y]]=!0;for(u=0;u<s.length;u++)y=o.hasOwnProperty("$"+s[u].value),s[u].selected!==y&&(s[u].selected=y),y&&p&&(s[u].defaultSelected=!0)}else{for(u=""+Xr(u),o=null,y=0;y<s.length;y++){if(s[y].value===u){s[y].selected=!0,p&&(s[y].defaultSelected=!0);return}o!==null||s[y].disabled||(o=s[y])}o!==null&&(o.selected=!0)}}function Ky(s,o,u){if(o!=null&&(o=""+Xr(o),o!==s.value&&(s.value=o),u==null)){s.defaultValue!==o&&(s.defaultValue=o);return}s.defaultValue=u!=null?""+Xr(u):""}function Xy(s,o,u,p){if(o==null){if(p!=null){if(u!=null)throw Error(r(92));if(q(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),o=u}u=Xr(o),s.defaultValue=u,p=s.textContent,p===u&&p!==""&&p!==null&&(s.value=p),sp(s)}function zo(s,o){if(o){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=o;return}}s.textContent=o}var n6=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 Wy(s,o,u){var p=o.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?s.setProperty(o,""):o==="float"?s.cssFloat="":s[o]="":p?s.setProperty(o,u):typeof u!="number"||u===0||n6.has(o)?o==="float"?s.cssFloat=u:s[o]=(""+u).trim():s[o]=u+"px"}function Qy(s,o,u){if(o!=null&&typeof o!="object")throw Error(r(62));if(s=s.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||o!=null&&o.hasOwnProperty(p)||(p.indexOf("--")===0?s.setProperty(p,""):p==="float"?s.cssFloat="":s[p]="");for(var y in o)p=o[y],o.hasOwnProperty(y)&&u[y]!==p&&Wy(s,y,p)}else for(var T in o)o.hasOwnProperty(T)&&Wy(s,T,o[T])}function op(s){if(s.indexOf("-")===-1)return!1;switch(s){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 r6=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"]]),s6=/^[\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 Cd(s){return s6.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Fs(){}var lp=null;function up(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ho=null,Uo=null;function Zy(s){var o=Do(s);if(o&&(s=o.stateNode)){var u=s[Xn]||null;e:switch(s=o.stateNode,o.type){case"input":if(ip(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),o=u.name,u.type==="radio"&&o!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Wr(""+o)+'"][type="radio"]'),o=0;o<u.length;o++){var p=u[o];if(p!==s&&p.form===s.form){var y=p[Xn]||null;if(!y)throw Error(r(90));ip(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(o=0;o<u.length;o++)p=u[o],p.form===s.form&&Yy(p)}break e;case"textarea":Ky(s,u.value,u.defaultValue);break e;case"select":o=u.value,o!=null&&Bo(s,!!u.multiple,o,!1)}}}var cp=!1;function Jy(s,o,u){if(cp)return s(o,u);cp=!0;try{var p=s(o);return p}finally{if(cp=!1,(Ho!==null||Uo!==null)&&(ff(),Ho&&(o=Ho,s=Uo,Uo=Ho=null,Zy(o),s)))for(o=0;o<s.length;o++)Zy(s[o])}}function mu(s,o){var u=s.stateNode;if(u===null)return null;var p=u[Xn]||null;if(p===null)return null;u=p[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":(p=!p.disabled)||(s=s.type,p=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!p;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(r(231,o,typeof u));return u}var $s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dp=!1;if($s)try{var pu={};Object.defineProperty(pu,"passive",{get:function(){dp=!0}}),window.addEventListener("test",pu,pu),window.removeEventListener("test",pu,pu)}catch{dp=!1}var Ti=null,fp=null,wd=null;function eE(){if(wd)return wd;var s,o=fp,u=o.length,p,y="value"in Ti?Ti.value:Ti.textContent,T=y.length;for(s=0;s<u&&o[s]===y[s];s++);var O=u-s;for(p=1;p<=O&&o[u-p]===y[T-p];p++);return wd=y.slice(s,1<p?1-p:void 0)}function kd(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function Nd(){return!0}function tE(){return!1}function vr(s){function o(u,p,y,T,O){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=T,this.target=O,this.currentTarget=null;for(var H in s)s.hasOwnProperty(H)&&(u=s[H],this[H]=u?u(T):T[H]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Nd:tE,this.isPropagationStopped=tE,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Nd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Nd)},persist:function(){},isPersistent:Nd}),o}var Sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_d=vr(Sa),gu=m({},Sa,{view:0,detail:0}),i6=vr(gu),hp,mp,bu,Ad=m({},gu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==bu&&(bu&&s.type==="mousemove"?(hp=s.screenX-bu.screenX,mp=s.screenY-bu.screenY):mp=hp=0,bu=s),hp)},movementY:function(s){return"movementY"in s?s.movementY:mp}}),nE=vr(Ad),a6=m({},Ad,{dataTransfer:0}),o6=vr(a6),l6=m({},gu,{relatedTarget:0}),pp=vr(l6),u6=m({},Sa,{animationName:0,elapsedTime:0,pseudoElement:0}),c6=vr(u6),d6=m({},Sa,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),f6=vr(d6),h6=m({},Sa,{data:0}),rE=vr(h6),m6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},p6={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"},g6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b6(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=g6[s])?!!o[s]:!1}function gp(){return b6}var x6=m({},gu,{key:function(s){if(s.key){var o=m6[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=kd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?p6[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gp,charCode:function(s){return s.type==="keypress"?kd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?kd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),y6=vr(x6),E6=m({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sE=vr(E6),v6=m({},gu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gp}),T6=vr(v6),S6=m({},Sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),C6=vr(S6),w6=m({},Ad,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),k6=vr(w6),N6=m({},Sa,{newState:0,oldState:0}),_6=vr(N6),A6=[9,13,27,32],bp=$s&&"CompositionEvent"in window,xu=null;$s&&"documentMode"in document&&(xu=document.documentMode);var R6=$s&&"TextEvent"in window&&!xu,iE=$s&&(!bp||xu&&8<xu&&11>=xu),aE=" ",oE=!1;function lE(s,o){switch(s){case"keyup":return A6.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uE(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Fo=!1;function O6(s,o){switch(s){case"compositionend":return uE(o);case"keypress":return o.which!==32?null:(oE=!0,aE);case"textInput":return s=o.data,s===aE&&oE?null:s;default:return null}}function I6(s,o){if(Fo)return s==="compositionend"||!bp&&lE(s,o)?(s=eE(),wd=fp=Ti=null,Fo=!1,s):null;switch(s){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 iE&&o.locale!=="ko"?null:o.data;default:return null}}var M6={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 cE(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!M6[s.type]:o==="textarea"}function dE(s,o,u,p){Ho?Uo?Uo.push(p):Uo=[p]:Ho=p,o=yf(o,"onChange"),0<o.length&&(u=new _d("onChange","change",null,u,p),s.push({event:u,listeners:o}))}var yu=null,Eu=null;function L6(s){GT(s,0)}function Rd(s){var o=hu(s);if(Yy(o))return s}function fE(s,o){if(s==="change")return o}var hE=!1;if($s){var xp;if($s){var yp="oninput"in document;if(!yp){var mE=document.createElement("div");mE.setAttribute("oninput","return;"),yp=typeof mE.oninput=="function"}xp=yp}else xp=!1;hE=xp&&(!document.documentMode||9<document.documentMode)}function pE(){yu&&(yu.detachEvent("onpropertychange",gE),Eu=yu=null)}function gE(s){if(s.propertyName==="value"&&Rd(Eu)){var o=[];dE(o,Eu,s,up(s)),Jy(L6,o)}}function D6(s,o,u){s==="focusin"?(pE(),yu=o,Eu=u,yu.attachEvent("onpropertychange",gE)):s==="focusout"&&pE()}function j6(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Rd(Eu)}function P6(s,o){if(s==="click")return Rd(o)}function B6(s,o){if(s==="input"||s==="change")return Rd(o)}function z6(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var Dr=typeof Object.is=="function"?Object.is:z6;function vu(s,o){if(Dr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var u=Object.keys(s),p=Object.keys(o);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!ye.call(o,y)||!Dr(s[y],o[y]))return!1}return!0}function bE(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function xE(s,o){var u=bE(s);s=0;for(var p;u;){if(u.nodeType===3){if(p=s+u.textContent.length,s<=o&&p>=o)return{node:u,offset:o-s};s=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=bE(u)}}function yE(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?yE(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function EE(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Sd(s.document);o instanceof s.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)s=o.contentWindow;else break;o=Sd(s.document)}return o}function Ep(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var H6=$s&&"documentMode"in document&&11>=document.documentMode,$o=null,vp=null,Tu=null,Tp=!1;function vE(s,o,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Tp||$o==null||$o!==Sd(p)||(p=$o,"selectionStart"in p&&Ep(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Tu&&vu(Tu,p)||(Tu=p,p=yf(vp,"onSelect"),0<p.length&&(o=new _d("onSelect","select",null,o,u),s.push({event:o,listeners:p}),o.target=$o)))}function Ca(s,o){var u={};return u[s.toLowerCase()]=o.toLowerCase(),u["Webkit"+s]="webkit"+o,u["Moz"+s]="moz"+o,u}var Vo={animationend:Ca("Animation","AnimationEnd"),animationiteration:Ca("Animation","AnimationIteration"),animationstart:Ca("Animation","AnimationStart"),transitionrun:Ca("Transition","TransitionRun"),transitionstart:Ca("Transition","TransitionStart"),transitioncancel:Ca("Transition","TransitionCancel"),transitionend:Ca("Transition","TransitionEnd")},Sp={},TE={};$s&&(TE=document.createElement("div").style,"AnimationEvent"in window||(delete Vo.animationend.animation,delete Vo.animationiteration.animation,delete Vo.animationstart.animation),"TransitionEvent"in window||delete Vo.transitionend.transition);function wa(s){if(Sp[s])return Sp[s];if(!Vo[s])return s;var o=Vo[s],u;for(u in o)if(o.hasOwnProperty(u)&&u in TE)return Sp[s]=o[u];return s}var SE=wa("animationend"),CE=wa("animationiteration"),wE=wa("animationstart"),U6=wa("transitionrun"),F6=wa("transitionstart"),$6=wa("transitioncancel"),kE=wa("transitionend"),NE=new Map,Cp="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(" ");Cp.push("scrollEnd");function cs(s,o){NE.set(s,o),Ta(o,[s])}var Od=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Qr=[],qo=0,wp=0;function Id(){for(var s=qo,o=wp=qo=0;o<s;){var u=Qr[o];Qr[o++]=null;var p=Qr[o];Qr[o++]=null;var y=Qr[o];Qr[o++]=null;var T=Qr[o];if(Qr[o++]=null,p!==null&&y!==null){var O=p.pending;O===null?y.next=y:(y.next=O.next,O.next=y),p.pending=y}T!==0&&_E(u,y,T)}}function Md(s,o,u,p){Qr[qo++]=s,Qr[qo++]=o,Qr[qo++]=u,Qr[qo++]=p,wp|=p,s.lanes|=p,s=s.alternate,s!==null&&(s.lanes|=p)}function kp(s,o,u,p){return Md(s,o,u,p),Ld(s)}function ka(s,o){return Md(s,null,null,o),Ld(s)}function _E(s,o,u){s.lanes|=u;var p=s.alternate;p!==null&&(p.lanes|=u);for(var y=!1,T=s.return;T!==null;)T.childLanes|=u,p=T.alternate,p!==null&&(p.childLanes|=u),T.tag===22&&(s=T.stateNode,s===null||s._visibility&1||(y=!0)),s=T,T=T.return;return s.tag===3?(T=s.stateNode,y&&o!==null&&(y=31-qe(u),s=T.hiddenUpdates,p=s[y],p===null?s[y]=[o]:p.push(o),o.lane=u|536870912),T):null}function Ld(s){if(50<Vu)throw Vu=0,Dg=null,Error(r(185));for(var o=s.return;o!==null;)s=o,o=s.return;return s.tag===3?s.stateNode:null}var Yo={};function V6(s,o,u,p){this.tag=s,this.key=u,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=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(s,o,u,p){return new V6(s,o,u,p)}function Np(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Vs(s,o){var u=s.alternate;return u===null?(u=jr(s.tag,o,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=o,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,o=s.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function AE(s,o){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=o,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,o=u.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),s}function Dd(s,o,u,p,y,T){var O=0;if(p=s,typeof s=="function")Np(s)&&(O=1);else if(typeof s=="string")O=XI(s,u,ae.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case U:return s=jr(31,u,o,y),s.elementType=U,s.lanes=T,s;case k:return Na(u.children,y,T,o);case w:O=8,y|=24;break;case S:return s=jr(12,u,o,y|2),s.elementType=S,s.lanes=T,s;case L:return s=jr(13,u,o,y),s.elementType=L,s.lanes=T,s;case R:return s=jr(19,u,o,y),s.elementType=R,s.lanes=T,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:O=10;break e;case N:O=9;break e;case A:O=11;break e;case D:O=14;break e;case I:O=16,p=null;break e}O=29,u=Error(r(130,s===null?"null":typeof s,"")),p=null}return o=jr(O,u,o,y),o.elementType=s,o.type=p,o.lanes=T,o}function Na(s,o,u,p){return s=jr(7,s,p,o),s.lanes=u,s}function _p(s,o,u){return s=jr(6,s,null,o),s.lanes=u,s}function RE(s){var o=jr(18,null,null,0);return o.stateNode=s,o}function Ap(s,o,u){return o=jr(4,s.children!==null?s.children:[],s.key,o),o.lanes=u,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}var OE=new WeakMap;function Zr(s,o){if(typeof s=="object"&&s!==null){var u=OE.get(s);return u!==void 0?u:(o={value:s,source:o,stack:ke(o)},OE.set(s,o),o)}return{value:s,source:o,stack:ke(o)}}var Go=[],Ko=0,jd=null,Su=0,Jr=[],es=0,Si=null,Es=1,vs="";function qs(s,o){Go[Ko++]=Su,Go[Ko++]=jd,jd=s,Su=o}function IE(s,o,u){Jr[es++]=Es,Jr[es++]=vs,Jr[es++]=Si,Si=s;var p=Es;s=vs;var y=32-qe(p)-1;p&=~(1<<y),u+=1;var T=32-qe(o)+y;if(30<T){var O=y-y%5;T=(p&(1<<O)-1).toString(32),p>>=O,y-=O,Es=1<<32-qe(o)+y|u<<y|p,vs=T+s}else Es=1<<T|u<<y|p,vs=s}function Rp(s){s.return!==null&&(qs(s,1),IE(s,1,0))}function Op(s){for(;s===jd;)jd=Go[--Ko],Go[Ko]=null,Su=Go[--Ko],Go[Ko]=null;for(;s===Si;)Si=Jr[--es],Jr[es]=null,vs=Jr[--es],Jr[es]=null,Es=Jr[--es],Jr[es]=null}function ME(s,o){Jr[es++]=Es,Jr[es++]=vs,Jr[es++]=Si,Es=o.id,vs=o.overflow,Si=s}var Wn=null,on=null,Dt=!1,Ci=null,ts=!1,Ip=Error(r(519));function wi(s){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cu(Zr(o,s)),Ip}function LE(s){var o=s.stateNode,u=s.type,p=s.memoizedProps;switch(o[en]=s,o[Xn]=p,u){case"dialog":Nt("cancel",o),Nt("close",o);break;case"iframe":case"object":case"embed":Nt("load",o);break;case"video":case"audio":for(u=0;u<Yu.length;u++)Nt(Yu[u],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),Gy(o,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Nt("invalid",o);break;case"textarea":Nt("invalid",o),Xy(o,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||o.textContent===""+u||p.suppressHydrationWarning===!0||QT(o.textContent,u)?(p.popover!=null&&(Nt("beforetoggle",o),Nt("toggle",o)),p.onScroll!=null&&Nt("scroll",o),p.onScrollEnd!=null&&Nt("scrollend",o),p.onClick!=null&&(o.onclick=Fs),o=!0):o=!1,o||wi(s,!0)}function DE(s){for(Wn=s.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 Xo(s){if(s!==Wn)return!1;if(!Dt)return DE(s),Dt=!0,!1;var o=s.tag,u;if((u=o!==3&&o!==27)&&((u=o===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Wg(s.type,s.memoizedProps)),u=!u),u&&on&&wi(s),DE(s),o===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));on=a2(s)}else if(o===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));on=a2(s)}else o===27?(o=on,zi(s.type)?(s=t0,t0=null,on=s):on=o):on=Wn?rs(s.stateNode.nextSibling):null;return!0}function _a(){on=Wn=null,Dt=!1}function Mp(){var s=Ci;return s!==null&&(wr===null?wr=s:wr.push.apply(wr,s),Ci=null),s}function Cu(s){Ci===null?Ci=[s]:Ci.push(s)}var Lp=P(null),Aa=null,Ys=null;function ki(s,o,u){j(Lp,o._currentValue),o._currentValue=u}function Gs(s){s._currentValue=Lp.current,F(Lp)}function Dp(s,o,u){for(;s!==null;){var p=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),s===u)break;s=s.return}}function jp(s,o,u,p){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var T=y.dependencies;if(T!==null){var O=y.child;T=T.firstContext;e:for(;T!==null;){var H=T;T=y;for(var se=0;se<o.length;se++)if(H.context===o[se]){T.lanes|=u,H=T.alternate,H!==null&&(H.lanes|=u),Dp(T.return,u,s),p||(O=null);break e}T=H.next}}else if(y.tag===18){if(O=y.return,O===null)throw Error(r(341));O.lanes|=u,T=O.alternate,T!==null&&(T.lanes|=u),Dp(O,u,s),O=null}else O=y.child;if(O!==null)O.return=y;else for(O=y;O!==null;){if(O===s){O=null;break}if(y=O.sibling,y!==null){y.return=O.return,O=y;break}O=O.return}y=O}}function Wo(s,o,u,p){s=null;for(var y=o,T=!1;y!==null;){if(!T){if((y.flags&524288)!==0)T=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var O=y.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var H=y.type;Dr(y.pendingProps.value,O.value)||(s!==null?s.push(H):s=[H])}}else if(y===de.current){if(O=y.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(Qu):s=[Qu])}y=y.return}s!==null&&jp(o,s,u,p),o.flags|=262144}function Pd(s){for(s=s.firstContext;s!==null;){if(!Dr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Ra(s){Aa=s,Ys=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Qn(s){return jE(Aa,s)}function Bd(s,o){return Aa===null&&Ra(s),jE(s,o)}function jE(s,o){var u=o._currentValue;if(o={context:o,memoizedValue:u,next:null},Ys===null){if(s===null)throw Error(r(308));Ys=o,s.dependencies={lanes:0,firstContext:o},s.flags|=524288}else Ys=Ys.next=o;return u}var q6=typeof AbortController<"u"?AbortController:function(){var s=[],o=this.signal={aborted:!1,addEventListener:function(u,p){s.push(p)}};this.abort=function(){o.aborted=!0,s.forEach(function(u){return u()})}},Y6=e.unstable_scheduleCallback,G6=e.unstable_NormalPriority,_n={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pp(){return{controller:new q6,data:new Map,refCount:0}}function wu(s){s.refCount--,s.refCount===0&&Y6(G6,function(){s.controller.abort()})}var ku=null,Bp=0,Qo=0,Zo=null;function K6(s,o){if(ku===null){var u=ku=[];Bp=0,Qo=Ug(),Zo={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Bp++,o.then(PE,PE),o}function PE(){if(--Bp===0&&ku!==null){Zo!==null&&(Zo.status="fulfilled");var s=ku;ku=null,Qo=0,Zo=null;for(var o=0;o<s.length;o++)(0,s[o])()}}function X6(s,o){var u=[],p={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return s.then(function(){p.status="fulfilled",p.value=o;for(var y=0;y<u.length;y++)(0,u[y])(o)},function(y){for(p.status="rejected",p.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),p}var BE=B.S;B.S=function(s,o){vT=Z(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&K6(s,o),BE!==null&&BE(s,o)};var Oa=P(null);function zp(){var s=Oa.current;return s!==null?s:tn.pooledCache}function zd(s,o){o===null?j(Oa,Oa.current):j(Oa,o.pool)}function zE(){var s=zp();return s===null?null:{parent:_n._currentValue,pool:s}}var Jo=Error(r(460)),Hp=Error(r(474)),Hd=Error(r(542)),Ud={then:function(){}};function HE(s){return s=s.status,s==="fulfilled"||s==="rejected"}function UE(s,o,u){switch(u=s[u],u===void 0?s.push(o):u!==o&&(o.then(Fs,Fs),o=u),o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,$E(s),s;default:if(typeof o.status=="string")o.then(Fs,Fs);else{if(s=tn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=o,s.status="pending",s.then(function(p){if(o.status==="pending"){var y=o;y.status="fulfilled",y.value=p}},function(p){if(o.status==="pending"){var y=o;y.status="rejected",y.reason=p}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,$E(s),s}throw Ma=o,Jo}}function Ia(s){try{var o=s._init;return o(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ma=u,Jo):u}}var Ma=null;function FE(){if(Ma===null)throw Error(r(459));var s=Ma;return Ma=null,s}function $E(s){if(s===Jo||s===Hd)throw Error(r(483))}var el=null,Nu=0;function Fd(s){var o=Nu;return Nu+=1,el===null&&(el=[]),UE(el,s,o)}function _u(s,o){o=o.props.ref,s.ref=o!==void 0?o:null}function $d(s,o){throw o.$$typeof===b?Error(r(525)):(s=Object.prototype.toString.call(o),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s)))}function VE(s){function o(he,ue){if(s){var ge=he.deletions;ge===null?(he.deletions=[ue],he.flags|=16):ge.push(ue)}}function u(he,ue){if(!s)return null;for(;ue!==null;)o(he,ue),ue=ue.sibling;return null}function p(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 y(he,ue){return he=Vs(he,ue),he.index=0,he.sibling=null,he}function T(he,ue,ge){return he.index=ge,s?(ge=he.alternate,ge!==null?(ge=ge.index,ge<ue?(he.flags|=67108866,ue):ge):(he.flags|=67108866,ue)):(he.flags|=1048576,ue)}function O(he){return s&&he.alternate===null&&(he.flags|=67108866),he}function H(he,ue,ge,_e){return ue===null||ue.tag!==6?(ue=_p(ge,he.mode,_e),ue.return=he,ue):(ue=y(ue,ge),ue.return=he,ue)}function se(he,ue,ge,_e){var rt=ge.type;return rt===k?Ne(he,ue,ge.props.children,_e,ge.key):ue!==null&&(ue.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===I&&Ia(rt)===ue.type)?(ue=y(ue,ge.props),_u(ue,ge),ue.return=he,ue):(ue=Dd(ge.type,ge.key,ge.props,null,he.mode,_e),_u(ue,ge),ue.return=he,ue)}function be(he,ue,ge,_e){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ge.containerInfo||ue.stateNode.implementation!==ge.implementation?(ue=Ap(ge,he.mode,_e),ue.return=he,ue):(ue=y(ue,ge.children||[]),ue.return=he,ue)}function Ne(he,ue,ge,_e,rt){return ue===null||ue.tag!==7?(ue=Na(ge,he.mode,_e,rt),ue.return=he,ue):(ue=y(ue,ge),ue.return=he,ue)}function Ae(he,ue,ge){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=_p(""+ue,he.mode,ge),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return ge=Dd(ue.type,ue.key,ue.props,null,he.mode,ge),_u(ge,ue),ge.return=he,ge;case v:return ue=Ap(ue,he.mode,ge),ue.return=he,ue;case I:return ue=Ia(ue),Ae(he,ue,ge)}if(q(ue)||W(ue))return ue=Na(ue,he.mode,ge,null),ue.return=he,ue;if(typeof ue.then=="function")return Ae(he,Fd(ue),ge);if(ue.$$typeof===_)return Ae(he,Bd(he,ue),ge);$d(he,ue)}return null}function xe(he,ue,ge,_e){var rt=ue!==null?ue.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return rt!==null?null:H(he,ue,""+ge,_e);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return ge.key===rt?se(he,ue,ge,_e):null;case v:return ge.key===rt?be(he,ue,ge,_e):null;case I:return ge=Ia(ge),xe(he,ue,ge,_e)}if(q(ge)||W(ge))return rt!==null?null:Ne(he,ue,ge,_e,null);if(typeof ge.then=="function")return xe(he,ue,Fd(ge),_e);if(ge.$$typeof===_)return xe(he,ue,Bd(he,ge),_e);$d(he,ge)}return null}function Te(he,ue,ge,_e,rt){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return he=he.get(ge)||null,H(ue,he,""+_e,rt);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case x:return he=he.get(_e.key===null?ge:_e.key)||null,se(ue,he,_e,rt);case v:return he=he.get(_e.key===null?ge:_e.key)||null,be(ue,he,_e,rt);case I:return _e=Ia(_e),Te(he,ue,ge,_e,rt)}if(q(_e)||W(_e))return he=he.get(ge)||null,Ne(ue,he,_e,rt,null);if(typeof _e.then=="function")return Te(he,ue,ge,Fd(_e),rt);if(_e.$$typeof===_)return Te(he,ue,ge,Bd(ue,_e),rt);$d(ue,_e)}return null}function Ze(he,ue,ge,_e){for(var rt=null,zt=null,Je=ue,xt=ue=0,Mt=null;Je!==null&&xt<ge.length;xt++){Je.index>xt?(Mt=Je,Je=null):Mt=Je.sibling;var Ht=xe(he,Je,ge[xt],_e);if(Ht===null){Je===null&&(Je=Mt);break}s&&Je&&Ht.alternate===null&&o(he,Je),ue=T(Ht,ue,xt),zt===null?rt=Ht:zt.sibling=Ht,zt=Ht,Je=Mt}if(xt===ge.length)return u(he,Je),Dt&&qs(he,xt),rt;if(Je===null){for(;xt<ge.length;xt++)Je=Ae(he,ge[xt],_e),Je!==null&&(ue=T(Je,ue,xt),zt===null?rt=Je:zt.sibling=Je,zt=Je);return Dt&&qs(he,xt),rt}for(Je=p(Je);xt<ge.length;xt++)Mt=Te(Je,he,xt,ge[xt],_e),Mt!==null&&(s&&Mt.alternate!==null&&Je.delete(Mt.key===null?xt:Mt.key),ue=T(Mt,ue,xt),zt===null?rt=Mt:zt.sibling=Mt,zt=Mt);return s&&Je.forEach(function(Vi){return o(he,Vi)}),Dt&&qs(he,xt),rt}function it(he,ue,ge,_e){if(ge==null)throw Error(r(151));for(var rt=null,zt=null,Je=ue,xt=ue=0,Mt=null,Ht=ge.next();Je!==null&&!Ht.done;xt++,Ht=ge.next()){Je.index>xt?(Mt=Je,Je=null):Mt=Je.sibling;var Vi=xe(he,Je,Ht.value,_e);if(Vi===null){Je===null&&(Je=Mt);break}s&&Je&&Vi.alternate===null&&o(he,Je),ue=T(Vi,ue,xt),zt===null?rt=Vi:zt.sibling=Vi,zt=Vi,Je=Mt}if(Ht.done)return u(he,Je),Dt&&qs(he,xt),rt;if(Je===null){for(;!Ht.done;xt++,Ht=ge.next())Ht=Ae(he,Ht.value,_e),Ht!==null&&(ue=T(Ht,ue,xt),zt===null?rt=Ht:zt.sibling=Ht,zt=Ht);return Dt&&qs(he,xt),rt}for(Je=p(Je);!Ht.done;xt++,Ht=ge.next())Ht=Te(Je,he,xt,Ht.value,_e),Ht!==null&&(s&&Ht.alternate!==null&&Je.delete(Ht.key===null?xt:Ht.key),ue=T(Ht,ue,xt),zt===null?rt=Ht:zt.sibling=Ht,zt=Ht);return s&&Je.forEach(function(aM){return o(he,aM)}),Dt&&qs(he,xt),rt}function Kt(he,ue,ge,_e){if(typeof ge=="object"&&ge!==null&&ge.type===k&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:e:{for(var rt=ge.key;ue!==null;){if(ue.key===rt){if(rt=ge.type,rt===k){if(ue.tag===7){u(he,ue.sibling),_e=y(ue,ge.props.children),_e.return=he,he=_e;break e}}else if(ue.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===I&&Ia(rt)===ue.type){u(he,ue.sibling),_e=y(ue,ge.props),_u(_e,ge),_e.return=he,he=_e;break e}u(he,ue);break}else o(he,ue);ue=ue.sibling}ge.type===k?(_e=Na(ge.props.children,he.mode,_e,ge.key),_e.return=he,he=_e):(_e=Dd(ge.type,ge.key,ge.props,null,he.mode,_e),_u(_e,ge),_e.return=he,he=_e)}return O(he);case v:e:{for(rt=ge.key;ue!==null;){if(ue.key===rt)if(ue.tag===4&&ue.stateNode.containerInfo===ge.containerInfo&&ue.stateNode.implementation===ge.implementation){u(he,ue.sibling),_e=y(ue,ge.children||[]),_e.return=he,he=_e;break e}else{u(he,ue);break}else o(he,ue);ue=ue.sibling}_e=Ap(ge,he.mode,_e),_e.return=he,he=_e}return O(he);case I:return ge=Ia(ge),Kt(he,ue,ge,_e)}if(q(ge))return Ze(he,ue,ge,_e);if(W(ge)){if(rt=W(ge),typeof rt!="function")throw Error(r(150));return ge=rt.call(ge),it(he,ue,ge,_e)}if(typeof ge.then=="function")return Kt(he,ue,Fd(ge),_e);if(ge.$$typeof===_)return Kt(he,ue,Bd(he,ge),_e);$d(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,ue!==null&&ue.tag===6?(u(he,ue.sibling),_e=y(ue,ge),_e.return=he,he=_e):(u(he,ue),_e=_p(ge,he.mode,_e),_e.return=he,he=_e),O(he)):u(he,ue)}return function(he,ue,ge,_e){try{Nu=0;var rt=Kt(he,ue,ge,_e);return el=null,rt}catch(Je){if(Je===Jo||Je===Hd)throw Je;var zt=jr(29,Je,null,he.mode);return zt.lanes=_e,zt.return=he,zt}finally{}}}var La=VE(!0),qE=VE(!1),Ni=!1;function Up(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fp(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function _i(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ai(s,o,u){var p=s.updateQueue;if(p===null)return null;if(p=p.shared,(Ft&2)!==0){var y=p.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),p.pending=o,o=Ld(s),_E(s,null,u),o}return Md(s,p,o,u),Ld(s)}function Au(s,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var p=o.lanes;p&=s.pendingLanes,u|=p,o.lanes=u,pn(s,u)}}function $p(s,o){var u=s.updateQueue,p=s.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,T=null;if(u=u.firstBaseUpdate,u!==null){do{var O={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};T===null?y=T=O:T=T.next=O,u=u.next}while(u!==null);T===null?y=T=o:T=T.next=o}else y=T=o;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:T,shared:p.shared,callbacks:p.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=o:s.next=o,u.lastBaseUpdate=o}var Vp=!1;function Ru(){if(Vp){var s=Zo;if(s!==null)throw s}}function Ou(s,o,u,p){Vp=!1;var y=s.updateQueue;Ni=!1;var T=y.firstBaseUpdate,O=y.lastBaseUpdate,H=y.shared.pending;if(H!==null){y.shared.pending=null;var se=H,be=se.next;se.next=null,O===null?T=be:O.next=be,O=se;var Ne=s.alternate;Ne!==null&&(Ne=Ne.updateQueue,H=Ne.lastBaseUpdate,H!==O&&(H===null?Ne.firstBaseUpdate=be:H.next=be,Ne.lastBaseUpdate=se))}if(T!==null){var Ae=y.baseState;O=0,Ne=be=se=null,H=T;do{var xe=H.lane&-536870913,Te=xe!==H.lane;if(Te?(It&xe)===xe:(p&xe)===xe){xe!==0&&xe===Qo&&(Vp=!0),Ne!==null&&(Ne=Ne.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var Ze=s,it=H;xe=o;var Kt=u;switch(it.tag){case 1:if(Ze=it.payload,typeof Ze=="function"){Ae=Ze.call(Kt,Ae,xe);break e}Ae=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=it.payload,xe=typeof Ze=="function"?Ze.call(Kt,Ae,xe):Ze,xe==null)break e;Ae=m({},Ae,xe);break e;case 2:Ni=!0}}xe=H.callback,xe!==null&&(s.flags|=64,Te&&(s.flags|=8192),Te=y.callbacks,Te===null?y.callbacks=[xe]:Te.push(xe))}else Te={lane:xe,tag:H.tag,payload:H.payload,callback:H.callback,next:null},Ne===null?(be=Ne=Te,se=Ae):Ne=Ne.next=Te,O|=xe;if(H=H.next,H===null){if(H=y.shared.pending,H===null)break;Te=H,H=Te.next,Te.next=null,y.lastBaseUpdate=Te,y.shared.pending=null}}while(!0);Ne===null&&(se=Ae),y.baseState=se,y.firstBaseUpdate=be,y.lastBaseUpdate=Ne,T===null&&(y.shared.lanes=0),Li|=O,s.lanes=O,s.memoizedState=Ae}}function YE(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function GE(s,o){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)YE(u[s],o)}var tl=P(null),Vd=P(0);function KE(s,o){s=ni,j(Vd,s),j(tl,o),ni=s|o.baseLanes}function qp(){j(Vd,ni),j(tl,tl.current)}function Yp(){ni=Vd.current,F(tl),F(Vd)}var Pr=P(null),ns=null;function Ri(s){var o=s.alternate;j(Cn,Cn.current&1),j(Pr,s),ns===null&&(o===null||tl.current!==null||o.memoizedState!==null)&&(ns=s)}function Gp(s){j(Cn,Cn.current),j(Pr,s),ns===null&&(ns=s)}function XE(s){s.tag===22?(j(Cn,Cn.current),j(Pr,s),ns===null&&(ns=s)):Oi()}function Oi(){j(Cn,Cn.current),j(Pr,Pr.current)}function Br(s){F(Pr),ns===s&&(ns=null),F(Cn)}var Cn=P(0);function qd(s){for(var o=s;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Jg(u)||e0(u)))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===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Ks=0,bt=null,Yt=null,An=null,Yd=!1,nl=!1,Da=!1,Gd=0,Iu=0,rl=null,W6=0;function xn(){throw Error(r(321))}function Kp(s,o){if(o===null)return!1;for(var u=0;u<o.length&&u<s.length;u++)if(!Dr(s[u],o[u]))return!1;return!0}function Xp(s,o,u,p,y,T){return Ks=T,bt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,B.H=s===null||s.memoizedState===null?Iv:cg,Da=!1,T=u(p,y),Da=!1,nl&&(T=QE(o,u,p,y)),WE(s),T}function WE(s){B.H=Du;var o=Yt!==null&&Yt.next!==null;if(Ks=0,An=Yt=bt=null,Yd=!1,Iu=0,rl=null,o)throw Error(r(300));s===null||Rn||(s=s.dependencies,s!==null&&Pd(s)&&(Rn=!0))}function QE(s,o,u,p){bt=s;var y=0;do{if(nl&&(rl=null),Iu=0,nl=!1,25<=y)throw Error(r(301));if(y+=1,An=Yt=null,s.updateQueue!=null){var T=s.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}B.H=Mv,T=o(u,p)}while(nl);return T}function Q6(){var s=B.H,o=s.useState()[0];return o=typeof o.then=="function"?Mu(o):o,s=s.useState()[0],(Yt!==null?Yt.memoizedState:null)!==s&&(bt.flags|=1024),o}function Wp(){var s=Gd!==0;return Gd=0,s}function Qp(s,o,u){o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~u}function Zp(s){if(Yd){for(s=s.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}Yd=!1}Ks=0,An=Yt=bt=null,nl=!1,Iu=Gd=0,rl=null}function dr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?bt.memoizedState=An=s:An=An.next=s,An}function wn(){if(Yt===null){var s=bt.alternate;s=s!==null?s.memoizedState:null}else s=Yt.next;var o=An===null?bt.memoizedState:An.next;if(o!==null)An=o,Yt=s;else{if(s===null)throw bt.alternate===null?Error(r(467)):Error(r(310));Yt=s,s={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},An===null?bt.memoizedState=An=s:An=An.next=s}return An}function Kd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mu(s){var o=Iu;return Iu+=1,rl===null&&(rl=[]),s=UE(rl,s,o),o=bt,(An===null?o.memoizedState:An.next)===null&&(o=o.alternate,B.H=o===null||o.memoizedState===null?Iv:cg),s}function Xd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Mu(s);if(s.$$typeof===_)return Qn(s)}throw Error(r(438,String(s)))}function Jp(s){var o=null,u=bt.updateQueue;if(u!==null&&(o=u.memoCache),o==null){var p=bt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(o={data:p.data.map(function(y){return y.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),u===null&&(u=Kd(),bt.updateQueue=u),u.memoCache=o,u=o.data[o.index],u===void 0)for(u=o.data[o.index]=Array(s),p=0;p<s;p++)u[p]=z;return o.index++,u}function Xs(s,o){return typeof o=="function"?o(s):o}function Wd(s){var o=wn();return eg(o,Yt,s)}function eg(s,o,u){var p=s.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var y=s.baseQueue,T=p.pending;if(T!==null){if(y!==null){var O=y.next;y.next=T.next,T.next=O}o.baseQueue=y=T,p.pending=null}if(T=s.baseState,y===null)s.memoizedState=T;else{o=y.next;var H=O=null,se=null,be=o,Ne=!1;do{var Ae=be.lane&-536870913;if(Ae!==be.lane?(It&Ae)===Ae:(Ks&Ae)===Ae){var xe=be.revertLane;if(xe===0)se!==null&&(se=se.next={lane:0,revertLane:0,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),Ae===Qo&&(Ne=!0);else if((Ks&xe)===xe){be=be.next,xe===Qo&&(Ne=!0);continue}else Ae={lane:0,revertLane:be.revertLane,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},se===null?(H=se=Ae,O=T):se=se.next=Ae,bt.lanes|=xe,Li|=xe;Ae=be.action,Da&&u(T,Ae),T=be.hasEagerState?be.eagerState:u(T,Ae)}else xe={lane:Ae,revertLane:be.revertLane,gesture:be.gesture,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},se===null?(H=se=xe,O=T):se=se.next=xe,bt.lanes|=Ae,Li|=Ae;be=be.next}while(be!==null&&be!==o);if(se===null?O=T:se.next=H,!Dr(T,s.memoizedState)&&(Rn=!0,Ne&&(u=Zo,u!==null)))throw u;s.memoizedState=T,s.baseState=O,s.baseQueue=se,p.lastRenderedState=T}return y===null&&(p.lanes=0),[s.memoizedState,p.dispatch]}function tg(s){var o=wn(),u=o.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var p=u.dispatch,y=u.pending,T=o.memoizedState;if(y!==null){u.pending=null;var O=y=y.next;do T=s(T,O.action),O=O.next;while(O!==y);Dr(T,o.memoizedState)||(Rn=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),u.lastRenderedState=T}return[T,p]}function ZE(s,o,u){var p=bt,y=wn(),T=Dt;if(T){if(u===void 0)throw Error(r(407));u=u()}else u=o();var O=!Dr((Yt||y).memoizedState,u);if(O&&(y.memoizedState=u,Rn=!0),y=y.queue,sg(tv.bind(null,p,y,s),[s]),y.getSnapshot!==o||O||An!==null&&An.memoizedState.tag&1){if(p.flags|=2048,sl(9,{destroy:void 0},ev.bind(null,p,y,u,o),null),tn===null)throw Error(r(349));T||(Ks&127)!==0||JE(p,o,u)}return u}function JE(s,o,u){s.flags|=16384,s={getSnapshot:o,value:u},o=bt.updateQueue,o===null?(o=Kd(),bt.updateQueue=o,o.stores=[s]):(u=o.stores,u===null?o.stores=[s]:u.push(s))}function ev(s,o,u,p){o.value=u,o.getSnapshot=p,nv(o)&&rv(s)}function tv(s,o,u){return u(function(){nv(o)&&rv(s)})}function nv(s){var o=s.getSnapshot;s=s.value;try{var u=o();return!Dr(s,u)}catch{return!0}}function rv(s){var o=ka(s,2);o!==null&&kr(o,s,2)}function ng(s){var o=dr();if(typeof s=="function"){var u=s;if(s=u(),Da){ut(!0);try{u()}finally{ut(!1)}}}return o.memoizedState=o.baseState=s,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xs,lastRenderedState:s},o}function sv(s,o,u,p){return s.baseState=u,eg(s,Yt,typeof p=="function"?p:Xs)}function Z6(s,o,u,p,y){if(Jd(s))throw Error(r(485));if(s=o.action,s!==null){var T={payload:y,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){T.listeners.push(O)}};B.T!==null?u(!0):T.isTransition=!1,p(T),u=o.pending,u===null?(T.next=o.pending=T,iv(o,T)):(T.next=u.next,o.pending=u.next=T)}}function iv(s,o){var u=o.action,p=o.payload,y=s.state;if(o.isTransition){var T=B.T,O={};B.T=O;try{var H=u(y,p),se=B.S;se!==null&&se(O,H),av(s,o,H)}catch(be){rg(s,o,be)}finally{T!==null&&O.types!==null&&(T.types=O.types),B.T=T}}else try{T=u(y,p),av(s,o,T)}catch(be){rg(s,o,be)}}function av(s,o,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){ov(s,o,p)},function(p){return rg(s,o,p)}):ov(s,o,u)}function ov(s,o,u){o.status="fulfilled",o.value=u,lv(o),s.state=u,o=s.pending,o!==null&&(u=o.next,u===o?s.pending=null:(u=u.next,o.next=u,iv(s,u)))}function rg(s,o,u){var p=s.pending;if(s.pending=null,p!==null){p=p.next;do o.status="rejected",o.reason=u,lv(o),o=o.next;while(o!==p)}s.action=null}function lv(s){s=s.listeners;for(var o=0;o<s.length;o++)(0,s[o])()}function uv(s,o){return o}function cv(s,o){if(Dt){var u=tn.formState;if(u!==null){e:{var p=bt;if(Dt){if(on){t:{for(var y=on,T=ts;y.nodeType!==8;){if(!T){y=null;break t}if(y=rs(y.nextSibling),y===null){y=null;break t}}T=y.data,y=T==="F!"||T==="F"?y:null}if(y){on=rs(y.nextSibling),p=y.data==="F!";break e}}wi(p)}p=!1}p&&(o=u[0])}}return u=dr(),u.memoizedState=u.baseState=o,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uv,lastRenderedState:o},u.queue=p,u=Av.bind(null,bt,p),p.dispatch=u,p=ng(!1),T=ug.bind(null,bt,!1,p.queue),p=dr(),y={state:o,dispatch:null,action:s,pending:null},p.queue=y,u=Z6.bind(null,bt,y,T,u),y.dispatch=u,p.memoizedState=s,[o,u,!1]}function dv(s){var o=wn();return fv(o,Yt,s)}function fv(s,o,u){if(o=eg(s,o,uv)[0],s=Wd(Xs)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var p=Mu(o)}catch(O){throw O===Jo?Hd:O}else p=o;o=wn();var y=o.queue,T=y.dispatch;return u!==o.memoizedState&&(bt.flags|=2048,sl(9,{destroy:void 0},J6.bind(null,y,u),null)),[p,T,s]}function J6(s,o){s.action=o}function hv(s){var o=wn(),u=Yt;if(u!==null)return fv(o,u,s);wn(),o=o.memoizedState,u=wn();var p=u.queue.dispatch;return u.memoizedState=s,[o,p,!1]}function sl(s,o,u,p){return s={tag:s,create:u,deps:p,inst:o,next:null},o=bt.updateQueue,o===null&&(o=Kd(),bt.updateQueue=o),u=o.lastEffect,u===null?o.lastEffect=s.next=s:(p=u.next,u.next=s,s.next=p,o.lastEffect=s),s}function mv(){return wn().memoizedState}function Qd(s,o,u,p){var y=dr();bt.flags|=s,y.memoizedState=sl(1|o,{destroy:void 0},u,p===void 0?null:p)}function Zd(s,o,u,p){var y=wn();p=p===void 0?null:p;var T=y.memoizedState.inst;Yt!==null&&p!==null&&Kp(p,Yt.memoizedState.deps)?y.memoizedState=sl(o,T,u,p):(bt.flags|=s,y.memoizedState=sl(1|o,T,u,p))}function pv(s,o){Qd(8390656,8,s,o)}function sg(s,o){Zd(2048,8,s,o)}function eI(s){bt.flags|=4;var o=bt.updateQueue;if(o===null)o=Kd(),bt.updateQueue=o,o.events=[s];else{var u=o.events;u===null?o.events=[s]:u.push(s)}}function gv(s){var o=wn().memoizedState;return eI({ref:o,nextImpl:s}),function(){if((Ft&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function bv(s,o){return Zd(4,2,s,o)}function xv(s,o){return Zd(4,4,s,o)}function yv(s,o){if(typeof o=="function"){s=s();var u=o(s);return function(){typeof u=="function"?u():o(null)}}if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function Ev(s,o,u){u=u!=null?u.concat([s]):null,Zd(4,4,yv.bind(null,o,s),u)}function ig(){}function vv(s,o){var u=wn();o=o===void 0?null:o;var p=u.memoizedState;return o!==null&&Kp(o,p[1])?p[0]:(u.memoizedState=[s,o],s)}function Tv(s,o){var u=wn();o=o===void 0?null:o;var p=u.memoizedState;if(o!==null&&Kp(o,p[1]))return p[0];if(p=s(),Da){ut(!0);try{s()}finally{ut(!1)}}return u.memoizedState=[p,o],p}function ag(s,o,u){return u===void 0||(Ks&1073741824)!==0&&(It&261930)===0?s.memoizedState=o:(s.memoizedState=u,s=ST(),bt.lanes|=s,Li|=s,u)}function Sv(s,o,u,p){return Dr(u,o)?u:tl.current!==null?(s=ag(s,u,p),Dr(s,o)||(Rn=!0),s):(Ks&42)===0||(Ks&1073741824)!==0&&(It&261930)===0?(Rn=!0,s.memoizedState=u):(s=ST(),bt.lanes|=s,Li|=s,o)}function Cv(s,o,u,p,y){var T=G.p;G.p=T!==0&&8>T?T:8;var O=B.T,H={};B.T=H,ug(s,!1,o,u);try{var se=y(),be=B.S;if(be!==null&&be(H,se),se!==null&&typeof se=="object"&&typeof se.then=="function"){var Ne=X6(se,p);Lu(s,o,Ne,Ur(s))}else Lu(s,o,p,Ur(s))}catch(Ae){Lu(s,o,{then:function(){},status:"rejected",reason:Ae},Ur())}finally{G.p=T,O!==null&&H.types!==null&&(O.types=H.types),B.T=O}}function tI(){}function og(s,o,u,p){if(s.tag!==5)throw Error(r(476));var y=wv(s).queue;Cv(s,y,o,Q,u===null?tI:function(){return kv(s),u(p)})}function wv(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xs,lastRenderedState:Q},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xs,lastRenderedState:u},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function kv(s){var o=wv(s);o.next===null&&(o=s.alternate.memoizedState),Lu(s,o.next.queue,{},Ur())}function lg(){return Qn(Qu)}function Nv(){return wn().memoizedState}function _v(){return wn().memoizedState}function nI(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var u=Ur();s=_i(u);var p=Ai(o,s,u);p!==null&&(kr(p,o,u),Au(p,o,u)),o={cache:Pp()},s.payload=o;return}o=o.return}}function rI(s,o,u){var p=Ur();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Jd(s)?Rv(o,u):(u=kp(s,o,u,p),u!==null&&(kr(u,s,p),Ov(u,o,p)))}function Av(s,o,u){var p=Ur();Lu(s,o,u,p)}function Lu(s,o,u,p){var y={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Jd(s))Rv(o,y);else{var T=s.alternate;if(s.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var O=o.lastRenderedState,H=T(O,u);if(y.hasEagerState=!0,y.eagerState=H,Dr(H,O))return Md(s,o,y,0),tn===null&&Id(),!1}catch{}finally{}if(u=kp(s,o,y,p),u!==null)return kr(u,s,p),Ov(u,o,p),!0}return!1}function ug(s,o,u,p){if(p={lane:2,revertLane:Ug(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Jd(s)){if(o)throw Error(r(479))}else o=kp(s,u,p,2),o!==null&&kr(o,s,2)}function Jd(s){var o=s.alternate;return s===bt||o!==null&&o===bt}function Rv(s,o){nl=Yd=!0;var u=s.pending;u===null?o.next=o:(o.next=u.next,u.next=o),s.pending=o}function Ov(s,o,u){if((u&4194048)!==0){var p=o.lanes;p&=s.pendingLanes,u|=p,o.lanes=u,pn(s,u)}}var Du={readContext:Qn,use:Xd,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};Du.useEffectEvent=xn;var Iv={readContext:Qn,use:Xd,useCallback:function(s,o){return dr().memoizedState=[s,o===void 0?null:o],s},useContext:Qn,useEffect:pv,useImperativeHandle:function(s,o,u){u=u!=null?u.concat([s]):null,Qd(4194308,4,yv.bind(null,o,s),u)},useLayoutEffect:function(s,o){return Qd(4194308,4,s,o)},useInsertionEffect:function(s,o){Qd(4,2,s,o)},useMemo:function(s,o){var u=dr();o=o===void 0?null:o;var p=s();if(Da){ut(!0);try{s()}finally{ut(!1)}}return u.memoizedState=[p,o],p},useReducer:function(s,o,u){var p=dr();if(u!==void 0){var y=u(o);if(Da){ut(!0);try{u(o)}finally{ut(!1)}}}else y=o;return p.memoizedState=p.baseState=y,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:y},p.queue=s,s=s.dispatch=rI.bind(null,bt,s),[p.memoizedState,s]},useRef:function(s){var o=dr();return s={current:s},o.memoizedState=s},useState:function(s){s=ng(s);var o=s.queue,u=Av.bind(null,bt,o);return o.dispatch=u,[s.memoizedState,u]},useDebugValue:ig,useDeferredValue:function(s,o){var u=dr();return ag(u,s,o)},useTransition:function(){var s=ng(!1);return s=Cv.bind(null,bt,s.queue,!0,!1),dr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,u){var p=bt,y=dr();if(Dt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),tn===null)throw Error(r(349));(It&127)!==0||JE(p,o,u)}y.memoizedState=u;var T={value:u,getSnapshot:o};return y.queue=T,pv(tv.bind(null,p,T,s),[s]),p.flags|=2048,sl(9,{destroy:void 0},ev.bind(null,p,T,u,o),null),u},useId:function(){var s=dr(),o=tn.identifierPrefix;if(Dt){var u=vs,p=Es;u=(p&~(1<<32-qe(p)-1)).toString(32)+u,o="_"+o+"R_"+u,u=Gd++,0<u&&(o+="H"+u.toString(32)),o+="_"}else u=W6++,o="_"+o+"r_"+u.toString(32)+"_";return s.memoizedState=o},useHostTransitionStatus:lg,useFormState:cv,useActionState:cv,useOptimistic:function(s){var o=dr();o.memoizedState=o.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=u,o=ug.bind(null,bt,!0,u),u.dispatch=o,[s,o]},useMemoCache:Jp,useCacheRefresh:function(){return dr().memoizedState=nI.bind(null,bt)},useEffectEvent:function(s){var o=dr(),u={impl:s};return o.memoizedState=u,function(){if((Ft&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},cg={readContext:Qn,use:Xd,useCallback:vv,useContext:Qn,useEffect:sg,useImperativeHandle:Ev,useInsertionEffect:bv,useLayoutEffect:xv,useMemo:Tv,useReducer:Wd,useRef:mv,useState:function(){return Wd(Xs)},useDebugValue:ig,useDeferredValue:function(s,o){var u=wn();return Sv(u,Yt.memoizedState,s,o)},useTransition:function(){var s=Wd(Xs)[0],o=wn().memoizedState;return[typeof s=="boolean"?s:Mu(s),o]},useSyncExternalStore:ZE,useId:Nv,useHostTransitionStatus:lg,useFormState:dv,useActionState:dv,useOptimistic:function(s,o){var u=wn();return sv(u,Yt,s,o)},useMemoCache:Jp,useCacheRefresh:_v};cg.useEffectEvent=gv;var Mv={readContext:Qn,use:Xd,useCallback:vv,useContext:Qn,useEffect:sg,useImperativeHandle:Ev,useInsertionEffect:bv,useLayoutEffect:xv,useMemo:Tv,useReducer:tg,useRef:mv,useState:function(){return tg(Xs)},useDebugValue:ig,useDeferredValue:function(s,o){var u=wn();return Yt===null?ag(u,s,o):Sv(u,Yt.memoizedState,s,o)},useTransition:function(){var s=tg(Xs)[0],o=wn().memoizedState;return[typeof s=="boolean"?s:Mu(s),o]},useSyncExternalStore:ZE,useId:Nv,useHostTransitionStatus:lg,useFormState:hv,useActionState:hv,useOptimistic:function(s,o){var u=wn();return Yt!==null?sv(u,Yt,s,o):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Jp,useCacheRefresh:_v};Mv.useEffectEvent=gv;function dg(s,o,u,p){o=s.memoizedState,u=u(p,o),u=u==null?o:m({},o,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var fg={enqueueSetState:function(s,o,u){s=s._reactInternals;var p=Ur(),y=_i(p);y.payload=o,u!=null&&(y.callback=u),o=Ai(s,y,p),o!==null&&(kr(o,s,p),Au(o,s,p))},enqueueReplaceState:function(s,o,u){s=s._reactInternals;var p=Ur(),y=_i(p);y.tag=1,y.payload=o,u!=null&&(y.callback=u),o=Ai(s,y,p),o!==null&&(kr(o,s,p),Au(o,s,p))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var u=Ur(),p=_i(u);p.tag=2,o!=null&&(p.callback=o),o=Ai(s,p,u),o!==null&&(kr(o,s,u),Au(o,s,u))}};function Lv(s,o,u,p,y,T,O){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(p,T,O):o.prototype&&o.prototype.isPureReactComponent?!vu(u,p)||!vu(y,T):!0}function Dv(s,o,u,p){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,p),o.state!==s&&fg.enqueueReplaceState(o,o.state,null)}function ja(s,o){var u=o;if("ref"in o){u={};for(var p in o)p!=="ref"&&(u[p]=o[p])}if(s=s.defaultProps){u===o&&(u=m({},u));for(var y in s)u[y]===void 0&&(u[y]=s[y])}return u}function jv(s){Od(s)}function Pv(s){console.error(s)}function Bv(s){Od(s)}function ef(s,o){try{var u=s.onUncaughtError;u(o.value,{componentStack:o.stack})}catch(p){setTimeout(function(){throw p})}}function zv(s,o,u){try{var p=s.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function hg(s,o,u){return u=_i(u),u.tag=3,u.payload={element:null},u.callback=function(){ef(s,o)},u}function Hv(s){return s=_i(s),s.tag=3,s}function Uv(s,o,u,p){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var T=p.value;s.payload=function(){return y(T)},s.callback=function(){zv(o,u,p)}}var O=u.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(s.callback=function(){zv(o,u,p),typeof y!="function"&&(Di===null?Di=new Set([this]):Di.add(this));var H=p.stack;this.componentDidCatch(p.value,{componentStack:H!==null?H:""})})}function sI(s,o,u,p,y){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(o=u.alternate,o!==null&&Wo(o,u,y,!0),u=Pr.current,u!==null){switch(u.tag){case 31:case 13:return ns===null?hf():u.alternate===null&&yn===0&&(yn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,p===Ud?u.flags|=16384:(o=u.updateQueue,o===null?u.updateQueue=new Set([p]):o.add(p),Bg(s,p,y)),!1;case 22:return u.flags|=65536,p===Ud?u.flags|=16384:(o=u.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=o):(u=o.retryQueue,u===null?o.retryQueue=new Set([p]):u.add(p)),Bg(s,p,y)),!1}throw Error(r(435,u.tag))}return Bg(s,p,y),hf(),!1}if(Dt)return o=Pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=y,p!==Ip&&(s=Error(r(422),{cause:p}),Cu(Zr(s,u)))):(p!==Ip&&(o=Error(r(423),{cause:p}),Cu(Zr(o,u))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,p=Zr(p,u),y=hg(s.stateNode,p,y),$p(s,y),yn!==4&&(yn=2)),!1;var T=Error(r(520),{cause:p});if(T=Zr(T,u),$u===null?$u=[T]:$u.push(T),yn!==4&&(yn=2),o===null)return!0;p=Zr(p,u),u=o;do{switch(u.tag){case 3:return u.flags|=65536,s=y&-y,u.lanes|=s,s=hg(u.stateNode,p,s),$p(u,s),!1;case 1:if(o=u.type,T=u.stateNode,(u.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Di===null||!Di.has(T))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Hv(y),Uv(y,s,u,p),$p(u,y),!1}u=u.return}while(u!==null);return!1}var mg=Error(r(461)),Rn=!1;function Zn(s,o,u,p){o.child=s===null?qE(o,null,u,p):La(o,s.child,u,p)}function Fv(s,o,u,p,y){u=u.render;var T=o.ref;if("ref"in p){var O={};for(var H in p)H!=="ref"&&(O[H]=p[H])}else O=p;return Ra(o),p=Xp(s,o,u,O,T,y),H=Wp(),s!==null&&!Rn?(Qp(s,o,y),Ws(s,o,y)):(Dt&&H&&Rp(o),o.flags|=1,Zn(s,o,p,y),o.child)}function $v(s,o,u,p,y){if(s===null){var T=u.type;return typeof T=="function"&&!Np(T)&&T.defaultProps===void 0&&u.compare===null?(o.tag=15,o.type=T,Vv(s,o,T,p,y)):(s=Dd(u.type,null,p,o,o.mode,y),s.ref=o.ref,s.return=o,o.child=s)}if(T=s.child,!Tg(s,y)){var O=T.memoizedProps;if(u=u.compare,u=u!==null?u:vu,u(O,p)&&s.ref===o.ref)return Ws(s,o,y)}return o.flags|=1,s=Vs(T,p),s.ref=o.ref,s.return=o,o.child=s}function Vv(s,o,u,p,y){if(s!==null){var T=s.memoizedProps;if(vu(T,p)&&s.ref===o.ref)if(Rn=!1,o.pendingProps=p=T,Tg(s,y))(s.flags&131072)!==0&&(Rn=!0);else return o.lanes=s.lanes,Ws(s,o,y)}return pg(s,o,u,p,y)}function qv(s,o,u,p){var y=p.children,T=s!==null?s.memoizedState:null;if(s===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((o.flags&128)!==0){if(T=T!==null?T.baseLanes|u:u,s!==null){for(p=o.child=s.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~T}else p=0,o.child=null;return Yv(s,o,T,u,p)}if((u&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},s!==null&&zd(o,T!==null?T.cachePool:null),T!==null?KE(o,T):qp(),XE(o);else return p=o.lanes=536870912,Yv(s,o,T!==null?T.baseLanes|u:u,u,p)}else T!==null?(zd(o,T.cachePool),KE(o,T),Oi(),o.memoizedState=null):(s!==null&&zd(o,null),qp(),Oi());return Zn(s,o,y,u),o.child}function ju(s,o){return s!==null&&s.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Yv(s,o,u,p,y){var T=zp();return T=T===null?null:{parent:_n._currentValue,pool:T},o.memoizedState={baseLanes:u,cachePool:T},s!==null&&zd(o,null),qp(),XE(o),s!==null&&Wo(s,o,p,!0),o.childLanes=y,null}function tf(s,o){return o=rf({mode:o.mode,children:o.children},s.mode),o.ref=s.ref,s.child=o,o.return=s,o}function Gv(s,o,u){return La(o,s.child,null,u),s=tf(o,o.pendingProps),s.flags|=2,Br(o),o.memoizedState=null,s}function iI(s,o,u){var p=o.pendingProps,y=(o.flags&128)!==0;if(o.flags&=-129,s===null){if(Dt){if(p.mode==="hidden")return s=tf(o,p),o.lanes=536870912,ju(null,s);if(Gp(o),(s=on)?(s=i2(s,ts),s=s!==null&&s.data==="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:Si!==null?{id:Es,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},u=RE(s),u.return=o,o.child=u,Wn=o,on=null)):s=null,s===null)throw wi(o);return o.lanes=536870912,null}return tf(o,p)}var T=s.memoizedState;if(T!==null){var O=T.dehydrated;if(Gp(o),y)if(o.flags&256)o.flags&=-257,o=Gv(s,o,u);else if(o.memoizedState!==null)o.child=s.child,o.flags|=128,o=null;else throw Error(r(558));else if(Rn||Wo(s,o,u,!1),y=(u&s.childLanes)!==0,Rn||y){if(p=tn,p!==null&&(O=Sn(p,u),O!==0&&O!==T.retryLane))throw T.retryLane=O,ka(s,O),kr(p,s,O),mg;hf(),o=Gv(s,o,u)}else s=T.treeContext,on=rs(O.nextSibling),Wn=o,Dt=!0,Ci=null,ts=!1,s!==null&&ME(o,s),o=tf(o,p),o.flags|=4096;return o}return s=Vs(s.child,{mode:p.mode,children:p.children}),s.ref=o.ref,o.child=s,s.return=o,s}function nf(s,o){var u=o.ref;if(u===null)s!==null&&s.ref!==null&&(o.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(s===null||s.ref!==u)&&(o.flags|=4194816)}}function pg(s,o,u,p,y){return Ra(o),u=Xp(s,o,u,p,void 0,y),p=Wp(),s!==null&&!Rn?(Qp(s,o,y),Ws(s,o,y)):(Dt&&p&&Rp(o),o.flags|=1,Zn(s,o,u,y),o.child)}function Kv(s,o,u,p,y,T){return Ra(o),o.updateQueue=null,u=QE(o,p,u,y),WE(s),p=Wp(),s!==null&&!Rn?(Qp(s,o,T),Ws(s,o,T)):(Dt&&p&&Rp(o),o.flags|=1,Zn(s,o,u,T),o.child)}function Xv(s,o,u,p,y){if(Ra(o),o.stateNode===null){var T=Yo,O=u.contextType;typeof O=="object"&&O!==null&&(T=Qn(O)),T=new u(p,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=fg,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=p,T.state=o.memoizedState,T.refs={},Up(o),O=u.contextType,T.context=typeof O=="object"&&O!==null?Qn(O):Yo,T.state=o.memoizedState,O=u.getDerivedStateFromProps,typeof O=="function"&&(dg(o,u,O,p),T.state=o.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(O=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),O!==T.state&&fg.enqueueReplaceState(T,T.state,null),Ou(o,p,T,y),Ru(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),p=!0}else if(s===null){T=o.stateNode;var H=o.memoizedProps,se=ja(u,H);T.props=se;var be=T.context,Ne=u.contextType;O=Yo,typeof Ne=="object"&&Ne!==null&&(O=Qn(Ne));var Ae=u.getDerivedStateFromProps;Ne=typeof Ae=="function"||typeof T.getSnapshotBeforeUpdate=="function",H=o.pendingProps!==H,Ne||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(H||be!==O)&&Dv(o,T,p,O),Ni=!1;var xe=o.memoizedState;T.state=xe,Ou(o,p,T,y),Ru(),be=o.memoizedState,H||xe!==be||Ni?(typeof Ae=="function"&&(dg(o,u,Ae,p),be=o.memoizedState),(se=Ni||Lv(o,u,se,p,xe,be,O))?(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=p,o.memoizedState=be),T.props=p,T.state=be,T.context=O,p=se):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{T=o.stateNode,Fp(s,o),O=o.memoizedProps,Ne=ja(u,O),T.props=Ne,Ae=o.pendingProps,xe=T.context,be=u.contextType,se=Yo,typeof be=="object"&&be!==null&&(se=Qn(be)),H=u.getDerivedStateFromProps,(be=typeof H=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(O!==Ae||xe!==se)&&Dv(o,T,p,se),Ni=!1,xe=o.memoizedState,T.state=xe,Ou(o,p,T,y),Ru();var Te=o.memoizedState;O!==Ae||xe!==Te||Ni||s!==null&&s.dependencies!==null&&Pd(s.dependencies)?(typeof H=="function"&&(dg(o,u,H,p),Te=o.memoizedState),(Ne=Ni||Lv(o,u,Ne,p,xe,Te,se)||s!==null&&s.dependencies!==null&&Pd(s.dependencies))?(be||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(p,Te,se),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(p,Te,se)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||O===s.memoizedProps&&xe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&xe===s.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=Te),T.props=p,T.state=Te,T.context=se,p=Ne):(typeof T.componentDidUpdate!="function"||O===s.memoizedProps&&xe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&xe===s.memoizedState||(o.flags|=1024),p=!1)}return T=p,nf(s,o),p=(o.flags&128)!==0,T||p?(T=o.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,s!==null&&p?(o.child=La(o,s.child,null,y),o.child=La(o,null,u,y)):Zn(s,o,u,y),o.memoizedState=T.state,s=o.child):s=Ws(s,o,y),s}function Wv(s,o,u,p){return _a(),o.flags|=256,Zn(s,o,u,p),o.child}var gg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bg(s){return{baseLanes:s,cachePool:zE()}}function xg(s,o,u){return s=s!==null?s.childLanes&~u:0,o&&(s|=Hr),s}function Qv(s,o,u){var p=o.pendingProps,y=!1,T=(o.flags&128)!==0,O;if((O=T)||(O=s!==null&&s.memoizedState===null?!1:(Cn.current&2)!==0),O&&(y=!0,o.flags&=-129),O=(o.flags&32)!==0,o.flags&=-33,s===null){if(Dt){if(y?Ri(o):Oi(),(s=on)?(s=i2(s,ts),s=s!==null&&s.data!=="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:Si!==null?{id:Es,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},u=RE(s),u.return=o,o.child=u,Wn=o,on=null)):s=null,s===null)throw wi(o);return e0(s)?o.lanes=32:o.lanes=536870912,null}var H=p.children;return p=p.fallback,y?(Oi(),y=o.mode,H=rf({mode:"hidden",children:H},y),p=Na(p,y,u,null),H.return=o,p.return=o,H.sibling=p,o.child=H,p=o.child,p.memoizedState=bg(u),p.childLanes=xg(s,O,u),o.memoizedState=gg,ju(null,p)):(Ri(o),yg(o,H))}var se=s.memoizedState;if(se!==null&&(H=se.dehydrated,H!==null)){if(T)o.flags&256?(Ri(o),o.flags&=-257,o=Eg(s,o,u)):o.memoizedState!==null?(Oi(),o.child=s.child,o.flags|=128,o=null):(Oi(),H=p.fallback,y=o.mode,p=rf({mode:"visible",children:p.children},y),H=Na(H,y,u,null),H.flags|=2,p.return=o,H.return=o,p.sibling=H,o.child=p,La(o,s.child,null,u),p=o.child,p.memoizedState=bg(u),p.childLanes=xg(s,O,u),o.memoizedState=gg,o=ju(null,p));else if(Ri(o),e0(H)){if(O=H.nextSibling&&H.nextSibling.dataset,O)var be=O.dgst;O=be,p=Error(r(419)),p.stack="",p.digest=O,Cu({value:p,source:null,stack:null}),o=Eg(s,o,u)}else if(Rn||Wo(s,o,u,!1),O=(u&s.childLanes)!==0,Rn||O){if(O=tn,O!==null&&(p=Sn(O,u),p!==0&&p!==se.retryLane))throw se.retryLane=p,ka(s,p),kr(O,s,p),mg;Jg(H)||hf(),o=Eg(s,o,u)}else Jg(H)?(o.flags|=192,o.child=s.child,o=null):(s=se.treeContext,on=rs(H.nextSibling),Wn=o,Dt=!0,Ci=null,ts=!1,s!==null&&ME(o,s),o=yg(o,p.children),o.flags|=4096);return o}return y?(Oi(),H=p.fallback,y=o.mode,se=s.child,be=se.sibling,p=Vs(se,{mode:"hidden",children:p.children}),p.subtreeFlags=se.subtreeFlags&65011712,be!==null?H=Vs(be,H):(H=Na(H,y,u,null),H.flags|=2),H.return=o,p.return=o,p.sibling=H,o.child=p,ju(null,p),p=o.child,H=s.child.memoizedState,H===null?H=bg(u):(y=H.cachePool,y!==null?(se=_n._currentValue,y=y.parent!==se?{parent:se,pool:se}:y):y=zE(),H={baseLanes:H.baseLanes|u,cachePool:y}),p.memoizedState=H,p.childLanes=xg(s,O,u),o.memoizedState=gg,ju(s.child,p)):(Ri(o),u=s.child,s=u.sibling,u=Vs(u,{mode:"visible",children:p.children}),u.return=o,u.sibling=null,s!==null&&(O=o.deletions,O===null?(o.deletions=[s],o.flags|=16):O.push(s)),o.child=u,o.memoizedState=null,u)}function yg(s,o){return o=rf({mode:"visible",children:o},s.mode),o.return=s,s.child=o}function rf(s,o){return s=jr(22,s,null,o),s.lanes=0,s}function Eg(s,o,u){return La(o,s.child,null,u),s=yg(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function Zv(s,o,u){s.lanes|=o;var p=s.alternate;p!==null&&(p.lanes|=o),Dp(s.return,o,u)}function vg(s,o,u,p,y,T){var O=s.memoizedState;O===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y,treeForkCount:T}:(O.isBackwards=o,O.rendering=null,O.renderingStartTime=0,O.last=p,O.tail=u,O.tailMode=y,O.treeForkCount=T)}function Jv(s,o,u){var p=o.pendingProps,y=p.revealOrder,T=p.tail;p=p.children;var O=Cn.current,H=(O&2)!==0;if(H?(O=O&1|2,o.flags|=128):O&=1,j(Cn,O),Zn(s,o,p,u),p=Dt?Su:0,!H&&s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Zv(s,u,o);else if(s.tag===19)Zv(s,u,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(y){case"forwards":for(u=o.child,y=null;u!==null;)s=u.alternate,s!==null&&qd(s)===null&&(y=u),u=u.sibling;u=y,u===null?(y=o.child,o.child=null):(y=u.sibling,u.sibling=null),vg(o,!1,y,u,T,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=o.child,o.child=null;y!==null;){if(s=y.alternate,s!==null&&qd(s)===null){o.child=y;break}s=y.sibling,y.sibling=u,u=y,y=s}vg(o,!0,u,null,T,p);break;case"together":vg(o,!1,null,null,void 0,p);break;default:o.memoizedState=null}return o.child}function Ws(s,o,u){if(s!==null&&(o.dependencies=s.dependencies),Li|=o.lanes,(u&o.childLanes)===0)if(s!==null){if(Wo(s,o,u,!1),(u&o.childLanes)===0)return null}else return null;if(s!==null&&o.child!==s.child)throw Error(r(153));if(o.child!==null){for(s=o.child,u=Vs(s,s.pendingProps),o.child=u,u.return=o;s.sibling!==null;)s=s.sibling,u=u.sibling=Vs(s,s.pendingProps),u.return=o;u.sibling=null}return o.child}function Tg(s,o){return(s.lanes&o)!==0?!0:(s=s.dependencies,!!(s!==null&&Pd(s)))}function aI(s,o,u){switch(o.tag){case 3:fe(o,o.stateNode.containerInfo),ki(o,_n,s.memoizedState.cache),_a();break;case 27:case 5:Fe(o);break;case 4:fe(o,o.stateNode.containerInfo);break;case 10:ki(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Gp(o),null;break;case 13:var p=o.memoizedState;if(p!==null)return p.dehydrated!==null?(Ri(o),o.flags|=128,null):(u&o.child.childLanes)!==0?Qv(s,o,u):(Ri(o),s=Ws(s,o,u),s!==null?s.sibling:null);Ri(o);break;case 19:var y=(s.flags&128)!==0;if(p=(u&o.childLanes)!==0,p||(Wo(s,o,u,!1),p=(u&o.childLanes)!==0),y){if(p)return Jv(s,o,u);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),j(Cn,Cn.current),p)break;return null;case 22:return o.lanes=0,qv(s,o,u,o.pendingProps);case 24:ki(o,_n,s.memoizedState.cache)}return Ws(s,o,u)}function eT(s,o,u){if(s!==null)if(s.memoizedProps!==o.pendingProps)Rn=!0;else{if(!Tg(s,u)&&(o.flags&128)===0)return Rn=!1,aI(s,o,u);Rn=(s.flags&131072)!==0}else Rn=!1,Dt&&(o.flags&1048576)!==0&&IE(o,Su,o.index);switch(o.lanes=0,o.tag){case 16:e:{var p=o.pendingProps;if(s=Ia(o.elementType),o.type=s,typeof s=="function")Np(s)?(p=ja(s,p),o.tag=1,o=Xv(null,o,s,p,u)):(o.tag=0,o=pg(null,o,s,p,u));else{if(s!=null){var y=s.$$typeof;if(y===A){o.tag=11,o=Fv(null,o,s,p,u);break e}else if(y===D){o.tag=14,o=$v(null,o,s,p,u);break e}}throw o=ee(s)||s,Error(r(306,o,""))}}return o;case 0:return pg(s,o,o.type,o.pendingProps,u);case 1:return p=o.type,y=ja(p,o.pendingProps),Xv(s,o,p,y,u);case 3:e:{if(fe(o,o.stateNode.containerInfo),s===null)throw Error(r(387));p=o.pendingProps;var T=o.memoizedState;y=T.element,Fp(s,o),Ou(o,p,null,u);var O=o.memoizedState;if(p=O.cache,ki(o,_n,p),p!==T.cache&&jp(o,[_n],u,!0),Ru(),p=O.element,T.isDehydrated)if(T={element:p,isDehydrated:!1,cache:O.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=Wv(s,o,p,u);break e}else if(p!==y){y=Zr(Error(r(424)),o),Cu(y),o=Wv(s,o,p,u);break e}else{switch(s=o.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(on=rs(s.firstChild),Wn=o,Dt=!0,Ci=null,ts=!0,u=qE(o,null,p,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(_a(),p===y){o=Ws(s,o,u);break e}Zn(s,o,p,u)}o=o.child}return o;case 26:return nf(s,o),s===null?(u=d2(o.type,null,o.pendingProps,null))?o.memoizedState=u:Dt||(u=o.type,s=o.pendingProps,p=Ef(ce.current).createElement(u),p[en]=o,p[Xn]=s,Jn(p,u,s),Un(p),o.stateNode=p):o.memoizedState=d2(o.type,s.memoizedProps,o.pendingProps,s.memoizedState),null;case 27:return Fe(o),s===null&&Dt&&(p=o.stateNode=l2(o.type,o.pendingProps,ce.current),Wn=o,ts=!0,y=on,zi(o.type)?(t0=y,on=rs(p.firstChild)):on=y),Zn(s,o,o.pendingProps.children,u),nf(s,o),s===null&&(o.flags|=4194304),o.child;case 5:return s===null&&Dt&&((y=p=on)&&(p=jI(p,o.type,o.pendingProps,ts),p!==null?(o.stateNode=p,Wn=o,on=rs(p.firstChild),ts=!1,y=!0):y=!1),y||wi(o)),Fe(o),y=o.type,T=o.pendingProps,O=s!==null?s.memoizedProps:null,p=T.children,Wg(y,T)?p=null:O!==null&&Wg(y,O)&&(o.flags|=32),o.memoizedState!==null&&(y=Xp(s,o,Q6,null,null,u),Qu._currentValue=y),nf(s,o),Zn(s,o,p,u),o.child;case 6:return s===null&&Dt&&((s=u=on)&&(u=PI(u,o.pendingProps,ts),u!==null?(o.stateNode=u,Wn=o,on=null,s=!0):s=!1),s||wi(o)),null;case 13:return Qv(s,o,u);case 4:return fe(o,o.stateNode.containerInfo),p=o.pendingProps,s===null?o.child=La(o,null,p,u):Zn(s,o,p,u),o.child;case 11:return Fv(s,o,o.type,o.pendingProps,u);case 7:return Zn(s,o,o.pendingProps,u),o.child;case 8:return Zn(s,o,o.pendingProps.children,u),o.child;case 12:return Zn(s,o,o.pendingProps.children,u),o.child;case 10:return p=o.pendingProps,ki(o,o.type,p.value),Zn(s,o,p.children,u),o.child;case 9:return y=o.type._context,p=o.pendingProps.children,Ra(o),y=Qn(y),p=p(y),o.flags|=1,Zn(s,o,p,u),o.child;case 14:return $v(s,o,o.type,o.pendingProps,u);case 15:return Vv(s,o,o.type,o.pendingProps,u);case 19:return Jv(s,o,u);case 31:return iI(s,o,u);case 22:return qv(s,o,u,o.pendingProps);case 24:return Ra(o),p=Qn(_n),s===null?(y=zp(),y===null&&(y=tn,T=Pp(),y.pooledCache=T,T.refCount++,T!==null&&(y.pooledCacheLanes|=u),y=T),o.memoizedState={parent:p,cache:y},Up(o),ki(o,_n,y)):((s.lanes&u)!==0&&(Fp(s,o),Ou(o,null,null,u),Ru()),y=s.memoizedState,T=o.memoizedState,y.parent!==p?(y={parent:p,cache:p},o.memoizedState=y,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=y),ki(o,_n,p)):(p=T.cache,ki(o,_n,p),p!==y.cache&&jp(o,[_n],u,!0))),Zn(s,o,o.pendingProps.children,u),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Qs(s){s.flags|=4}function Sg(s,o,u,p,y){if((o=(s.mode&32)!==0)&&(o=!1),o){if(s.flags|=16777216,(y&335544128)===y)if(s.stateNode.complete)s.flags|=8192;else if(NT())s.flags|=8192;else throw Ma=Ud,Hp}else s.flags&=-16777217}function tT(s,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!g2(o))if(NT())s.flags|=8192;else throw Ma=Ud,Hp}function sf(s,o){o!==null&&(s.flags|=4),s.flags&16384&&(o=s.tag!==22?Jt():536870912,s.lanes|=o,ll|=o)}function Pu(s,o){if(!Dt)switch(s.tailMode){case"hidden":o=s.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:p.sibling=null}}function ln(s){var o=s.alternate!==null&&s.alternate.child===s.child,u=0,p=0;if(o)for(var y=s.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=p,s.childLanes=u,o}function oI(s,o,u){var p=o.pendingProps;switch(Op(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(o),null;case 1:return ln(o),null;case 3:return u=o.stateNode,p=null,s!==null&&(p=s.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),Gs(_n),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Xo(o)?Qs(o):s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Mp())),ln(o),null;case 26:var y=o.type,T=o.memoizedState;return s===null?(Qs(o),T!==null?(ln(o),tT(o,T)):(ln(o),Sg(o,y,null,p,u))):T?T!==s.memoizedState?(Qs(o),ln(o),tT(o,T)):(ln(o),o.flags&=-16777217):(s=s.memoizedProps,s!==p&&Qs(o),ln(o),Sg(o,y,s,p,u)),null;case 27:if(Le(o),u=ce.current,y=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==p&&Qs(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return ln(o),null}s=ae.current,Xo(o)?LE(o):(s=l2(y,p,u),o.stateNode=s,Qs(o))}return ln(o),null;case 5:if(Le(o),y=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==p&&Qs(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return ln(o),null}if(T=ae.current,Xo(o))LE(o);else{var O=Ef(ce.current);switch(T){case 1:T=O.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:T=O.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":T=O.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":T=O.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":T=O.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof p.is=="string"?O.createElement("select",{is:p.is}):O.createElement("select"),p.multiple?T.multiple=!0:p.size&&(T.size=p.size);break;default:T=typeof p.is=="string"?O.createElement(y,{is:p.is}):O.createElement(y)}}T[en]=o,T[Xn]=p;e:for(O=o.child;O!==null;){if(O.tag===5||O.tag===6)T.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===o)break e;for(;O.sibling===null;){if(O.return===null||O.return===o)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}o.stateNode=T;e:switch(Jn(T,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Qs(o)}}return ln(o),Sg(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,u),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==p&&Qs(o);else{if(typeof p!="string"&&o.stateNode===null)throw Error(r(166));if(s=ce.current,Xo(o)){if(s=o.stateNode,u=o.memoizedProps,p=null,y=Wn,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}s[en]=o,s=!!(s.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||QT(s.nodeValue,u)),s||wi(o,!0)}else s=Ef(s).createTextNode(p),s[en]=o,o.stateNode=s}return ln(o),null;case 31:if(u=o.memoizedState,s===null||s.memoizedState!==null){if(p=Xo(o),u!==null){if(s===null){if(!p)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[en]=o}else _a(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ln(o),s=!1}else u=Mp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return o.flags&256?(Br(o),o):(Br(o),null);if((o.flags&128)!==0)throw Error(r(558))}return ln(o),null;case 13:if(p=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=Xo(o),p!==null&&p.dehydrated!==null){if(s===null){if(!y)throw Error(r(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[en]=o}else _a(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ln(o),y=!1}else y=Mp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(Br(o),o):(Br(o),null)}return Br(o),(o.flags&128)!==0?(o.lanes=u,o):(u=p!==null,s=s!==null&&s.memoizedState!==null,u&&(p=o.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),T=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(T=p.memoizedState.cachePool.pool),T!==y&&(p.flags|=2048)),u!==s&&u&&(o.child.flags|=8192),sf(o,o.updateQueue),ln(o),null);case 4:return ve(),s===null&&qg(o.stateNode.containerInfo),ln(o),null;case 10:return Gs(o.type),ln(o),null;case 19:if(F(Cn),p=o.memoizedState,p===null)return ln(o),null;if(y=(o.flags&128)!==0,T=p.rendering,T===null)if(y)Pu(p,!1);else{if(yn!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(T=qd(s),T!==null){for(o.flags|=128,Pu(p,!1),s=T.updateQueue,o.updateQueue=s,sf(o,s),o.subtreeFlags=0,s=u,u=o.child;u!==null;)AE(u,s),u=u.sibling;return j(Cn,Cn.current&1|2),Dt&&qs(o,p.treeForkCount),o.child}s=s.sibling}p.tail!==null&&Z()>cf&&(o.flags|=128,y=!0,Pu(p,!1),o.lanes=4194304)}else{if(!y)if(s=qd(T),s!==null){if(o.flags|=128,y=!0,s=s.updateQueue,o.updateQueue=s,sf(o,s),Pu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!T.alternate&&!Dt)return ln(o),null}else 2*Z()-p.renderingStartTime>cf&&u!==536870912&&(o.flags|=128,y=!0,Pu(p,!1),o.lanes=4194304);p.isBackwards?(T.sibling=o.child,o.child=T):(s=p.last,s!==null?s.sibling=T:o.child=T,p.last=T)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=Z(),s.sibling=null,u=Cn.current,j(Cn,y?u&1|2:u&1),Dt&&qs(o,p.treeForkCount),s):(ln(o),null);case 22:case 23:return Br(o),Yp(),p=o.memoizedState!==null,s!==null?s.memoizedState!==null!==p&&(o.flags|=8192):p&&(o.flags|=8192),p?(u&536870912)!==0&&(o.flags&128)===0&&(ln(o),o.subtreeFlags&6&&(o.flags|=8192)):ln(o),u=o.updateQueue,u!==null&&sf(o,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==u&&(o.flags|=2048),s!==null&&F(Oa),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Gs(_n),ln(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function lI(s,o){switch(Op(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return Gs(_n),ve(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return Le(o),null;case 31:if(o.memoizedState!==null){if(Br(o),o.alternate===null)throw Error(r(340));_a()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(Br(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));_a()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return F(Cn),null;case 4:return ve(),null;case 10:return Gs(o.type),null;case 22:case 23:return Br(o),Yp(),s!==null&&F(Oa),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return Gs(_n),null;case 25:return null;default:return null}}function nT(s,o){switch(Op(o),o.tag){case 3:Gs(_n),ve();break;case 26:case 27:case 5:Le(o);break;case 4:ve();break;case 31:o.memoizedState!==null&&Br(o);break;case 13:Br(o);break;case 19:F(Cn);break;case 10:Gs(o.type);break;case 22:case 23:Br(o),Yp(),s!==null&&F(Oa);break;case 24:Gs(_n)}}function Bu(s,o){try{var u=o.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&s)===s){p=void 0;var T=u.create,O=u.inst;p=T(),O.destroy=p}u=u.next}while(u!==y)}}catch(H){qt(o,o.return,H)}}function Ii(s,o,u){try{var p=o.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var T=y.next;p=T;do{if((p.tag&s)===s){var O=p.inst,H=O.destroy;if(H!==void 0){O.destroy=void 0,y=o;var se=u,be=H;try{be()}catch(Ne){qt(y,se,Ne)}}}p=p.next}while(p!==T)}}catch(Ne){qt(o,o.return,Ne)}}function rT(s){var o=s.updateQueue;if(o!==null){var u=s.stateNode;try{GE(o,u)}catch(p){qt(s,s.return,p)}}}function sT(s,o,u){u.props=ja(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(p){qt(s,o,p)}}function zu(s,o){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var p=s.stateNode;break;case 30:p=s.stateNode;break;default:p=s.stateNode}typeof u=="function"?s.refCleanup=u(p):u.current=p}}catch(y){qt(s,o,y)}}function Ts(s,o){var u=s.ref,p=s.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(y){qt(s,o,y)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){qt(s,o,y)}else u.current=null}function iT(s){var o=s.type,u=s.memoizedProps,p=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(y){qt(s,s.return,y)}}function Cg(s,o,u){try{var p=s.stateNode;RI(p,s.type,u,o),p[Xn]=o}catch(y){qt(s,s.return,y)}}function aT(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&zi(s.type)||s.tag===4}function wg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||aT(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&zi(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function kg(s,o,u){var p=s.tag;if(p===5||p===6)s=s.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(s),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Fs));else if(p!==4&&(p===27&&zi(s.type)&&(u=s.stateNode,o=null),s=s.child,s!==null))for(kg(s,o,u),s=s.sibling;s!==null;)kg(s,o,u),s=s.sibling}function af(s,o,u){var p=s.tag;if(p===5||p===6)s=s.stateNode,o?u.insertBefore(s,o):u.appendChild(s);else if(p!==4&&(p===27&&zi(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(af(s,o,u),s=s.sibling;s!==null;)af(s,o,u),s=s.sibling}function oT(s){var o=s.stateNode,u=s.memoizedProps;try{for(var p=s.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);Jn(o,p,u),o[en]=s,o[Xn]=u}catch(T){qt(s,s.return,T)}}var Zs=!1,On=!1,Ng=!1,lT=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function uI(s,o){if(s=s.containerInfo,Kg=Nf,s=EE(s),Ep(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,T=p.focusNode;p=p.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var O=0,H=-1,se=-1,be=0,Ne=0,Ae=s,xe=null;t:for(;;){for(var Te;Ae!==u||y!==0&&Ae.nodeType!==3||(H=O+y),Ae!==T||p!==0&&Ae.nodeType!==3||(se=O+p),Ae.nodeType===3&&(O+=Ae.nodeValue.length),(Te=Ae.firstChild)!==null;)xe=Ae,Ae=Te;for(;;){if(Ae===s)break t;if(xe===u&&++be===y&&(H=O),xe===T&&++Ne===p&&(se=O),(Te=Ae.nextSibling)!==null)break;Ae=xe,xe=Ae.parentNode}Ae=Te}u=H===-1||se===-1?null:{start:H,end:se}}else u=null}u=u||{start:0,end:0}}else u=null;for(Xg={focusedElem:s,selectionRange:u},Nf=!1,Fn=o;Fn!==null;)if(o=Fn,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,Fn=s;else for(;Fn!==null;){switch(o=Fn,T=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)y=s[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&T!==null){s=void 0,u=o,y=T.memoizedProps,T=T.memoizedState,p=u.stateNode;try{var Ze=ja(u.type,y);s=p.getSnapshotBeforeUpdate(Ze,T),p.__reactInternalSnapshotBeforeUpdate=s}catch(it){qt(u,u.return,it)}}break;case 3:if((s&1024)!==0){if(s=o.stateNode.containerInfo,u=s.nodeType,u===9)Zg(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Zg(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=o.sibling,s!==null){s.return=o.return,Fn=s;break}Fn=o.return}}function uT(s,o,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:ei(s,u),p&4&&Bu(5,u);break;case 1:if(ei(s,u),p&4)if(s=u.stateNode,o===null)try{s.componentDidMount()}catch(O){qt(u,u.return,O)}else{var y=ja(u.type,o.memoizedProps);o=o.memoizedState;try{s.componentDidUpdate(y,o,s.__reactInternalSnapshotBeforeUpdate)}catch(O){qt(u,u.return,O)}}p&64&&rT(u),p&512&&zu(u,u.return);break;case 3:if(ei(s,u),p&64&&(s=u.updateQueue,s!==null)){if(o=null,u.child!==null)switch(u.child.tag){case 27:case 5:o=u.child.stateNode;break;case 1:o=u.child.stateNode}try{GE(s,o)}catch(O){qt(u,u.return,O)}}break;case 27:o===null&&p&4&&oT(u);case 26:case 5:ei(s,u),o===null&&p&4&&iT(u),p&512&&zu(u,u.return);break;case 12:ei(s,u);break;case 31:ei(s,u),p&4&&fT(s,u);break;case 13:ei(s,u),p&4&&hT(s,u),p&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=xI.bind(null,u),BI(s,u))));break;case 22:if(p=u.memoizedState!==null||Zs,!p){o=o!==null&&o.memoizedState!==null||On,y=Zs;var T=On;Zs=p,(On=o)&&!T?ti(s,u,(u.subtreeFlags&8772)!==0):ei(s,u),Zs=y,On=T}break;case 30:break;default:ei(s,u)}}function cT(s){var o=s.alternate;o!==null&&(s.alternate=null,cT(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&rp(o)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var fn=null,Tr=!1;function Js(s,o,u){for(u=u.child;u!==null;)dT(s,o,u),u=u.sibling}function dT(s,o,u){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:On||Ts(u,o),Js(s,o,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:On||Ts(u,o);var p=fn,y=Tr;zi(u.type)&&(fn=u.stateNode,Tr=!1),Js(s,o,u),Ku(u.stateNode),fn=p,Tr=y;break;case 5:On||Ts(u,o);case 6:if(p=fn,y=Tr,fn=null,Js(s,o,u),fn=p,Tr=y,fn!==null)if(Tr)try{(fn.nodeType===9?fn.body:fn.nodeName==="HTML"?fn.ownerDocument.body:fn).removeChild(u.stateNode)}catch(T){qt(u,o,T)}else try{fn.removeChild(u.stateNode)}catch(T){qt(u,o,T)}break;case 18:fn!==null&&(Tr?(s=fn,r2(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),gl(s)):r2(fn,u.stateNode));break;case 4:p=fn,y=Tr,fn=u.stateNode.containerInfo,Tr=!0,Js(s,o,u),fn=p,Tr=y;break;case 0:case 11:case 14:case 15:Ii(2,u,o),On||Ii(4,u,o),Js(s,o,u);break;case 1:On||(Ts(u,o),p=u.stateNode,typeof p.componentWillUnmount=="function"&&sT(u,o,p)),Js(s,o,u);break;case 21:Js(s,o,u);break;case 22:On=(p=On)||u.memoizedState!==null,Js(s,o,u),On=p;break;default:Js(s,o,u)}}function fT(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{gl(s)}catch(u){qt(o,o.return,u)}}}function hT(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{gl(s)}catch(u){qt(o,o.return,u)}}function cI(s){switch(s.tag){case 31:case 13:case 19:var o=s.stateNode;return o===null&&(o=s.stateNode=new lT),o;case 22:return s=s.stateNode,o=s._retryCache,o===null&&(o=s._retryCache=new lT),o;default:throw Error(r(435,s.tag))}}function of(s,o){var u=cI(s);o.forEach(function(p){if(!u.has(p)){u.add(p);var y=yI.bind(null,s,p);p.then(y,y)}})}function Sr(s,o){var u=o.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p],T=s,O=o,H=O;e:for(;H!==null;){switch(H.tag){case 27:if(zi(H.type)){fn=H.stateNode,Tr=!1;break e}break;case 5:fn=H.stateNode,Tr=!1;break e;case 3:case 4:fn=H.stateNode.containerInfo,Tr=!0;break e}H=H.return}if(fn===null)throw Error(r(160));dT(T,O,y),fn=null,Tr=!1,T=y.alternate,T!==null&&(T.return=null),y.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)mT(o,s),o=o.sibling}var ds=null;function mT(s,o){var u=s.alternate,p=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Sr(o,s),Cr(s),p&4&&(Ii(3,s,s.return),Bu(3,s),Ii(5,s,s.return));break;case 1:Sr(o,s),Cr(s),p&512&&(On||u===null||Ts(u,u.return)),p&64&&Zs&&(s=s.updateQueue,s!==null&&(p=s.callbacks,p!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var y=ds;if(Sr(o,s),Cr(s),p&512&&(On||u===null||Ts(u,u.return)),p&4){var T=u!==null?u.memoizedState:null;if(p=s.memoizedState,u===null)if(p===null)if(s.stateNode===null){e:{p=s.type,u=s.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":T=y.getElementsByTagName("title")[0],(!T||T[fu]||T[en]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=y.createElement(p),y.head.insertBefore(T,y.querySelector("head > title"))),Jn(T,p,u),T[en]=s,Un(T),p=T;break e;case"link":var O=m2("link","href",y).get(p+(u.href||""));if(O){for(var H=0;H<O.length;H++)if(T=O[H],T.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&T.getAttribute("rel")===(u.rel==null?null:u.rel)&&T.getAttribute("title")===(u.title==null?null:u.title)&&T.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){O.splice(H,1);break t}}T=y.createElement(p),Jn(T,p,u),y.head.appendChild(T);break;case"meta":if(O=m2("meta","content",y).get(p+(u.content||""))){for(H=0;H<O.length;H++)if(T=O[H],T.getAttribute("content")===(u.content==null?null:""+u.content)&&T.getAttribute("name")===(u.name==null?null:u.name)&&T.getAttribute("property")===(u.property==null?null:u.property)&&T.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&T.getAttribute("charset")===(u.charSet==null?null:u.charSet)){O.splice(H,1);break t}}T=y.createElement(p),Jn(T,p,u),y.head.appendChild(T);break;default:throw Error(r(468,p))}T[en]=s,Un(T),p=T}s.stateNode=p}else p2(y,s.type,s.stateNode);else s.stateNode=h2(y,p,s.memoizedProps);else T!==p?(T===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):T.count--,p===null?p2(y,s.type,s.stateNode):h2(y,p,s.memoizedProps)):p===null&&s.stateNode!==null&&Cg(s,s.memoizedProps,u.memoizedProps)}break;case 27:Sr(o,s),Cr(s),p&512&&(On||u===null||Ts(u,u.return)),u!==null&&p&4&&Cg(s,s.memoizedProps,u.memoizedProps);break;case 5:if(Sr(o,s),Cr(s),p&512&&(On||u===null||Ts(u,u.return)),s.flags&32){y=s.stateNode;try{zo(y,"")}catch(Ze){qt(s,s.return,Ze)}}p&4&&s.stateNode!=null&&(y=s.memoizedProps,Cg(s,y,u!==null?u.memoizedProps:y)),p&1024&&(Ng=!0);break;case 6:if(Sr(o,s),Cr(s),p&4){if(s.stateNode===null)throw Error(r(162));p=s.memoizedProps,u=s.stateNode;try{u.nodeValue=p}catch(Ze){qt(s,s.return,Ze)}}break;case 3:if(Sf=null,y=ds,ds=vf(o.containerInfo),Sr(o,s),ds=y,Cr(s),p&4&&u!==null&&u.memoizedState.isDehydrated)try{gl(o.containerInfo)}catch(Ze){qt(s,s.return,Ze)}Ng&&(Ng=!1,pT(s));break;case 4:p=ds,ds=vf(s.stateNode.containerInfo),Sr(o,s),Cr(s),ds=p;break;case 12:Sr(o,s),Cr(s);break;case 31:Sr(o,s),Cr(s),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,of(s,p)));break;case 13:Sr(o,s),Cr(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(uf=Z()),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,of(s,p)));break;case 22:y=s.memoizedState!==null;var se=u!==null&&u.memoizedState!==null,be=Zs,Ne=On;if(Zs=be||y,On=Ne||se,Sr(o,s),On=Ne,Zs=be,Cr(s),p&8192)e:for(o=s.stateNode,o._visibility=y?o._visibility&-2:o._visibility|1,y&&(u===null||se||Zs||On||Pa(s)),u=null,o=s;;){if(o.tag===5||o.tag===26){if(u===null){se=u=o;try{if(T=se.stateNode,y)O=T.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{H=se.stateNode;var Ae=se.memoizedProps.style,xe=Ae!=null&&Ae.hasOwnProperty("display")?Ae.display:null;H.style.display=xe==null||typeof xe=="boolean"?"":(""+xe).trim()}}catch(Ze){qt(se,se.return,Ze)}}}else if(o.tag===6){if(u===null){se=o;try{se.stateNode.nodeValue=y?"":se.memoizedProps}catch(Ze){qt(se,se.return,Ze)}}}else if(o.tag===18){if(u===null){se=o;try{var Te=se.stateNode;y?s2(Te,!0):s2(se.stateNode,!1)}catch(Ze){qt(se,se.return,Ze)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===s)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;u===o&&(u=null),o=o.return}u===o&&(u=null),o.sibling.return=o.return,o=o.sibling}p&4&&(p=s.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,of(s,u))));break;case 19:Sr(o,s),Cr(s),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,of(s,p)));break;case 30:break;case 21:break;default:Sr(o,s),Cr(s)}}function Cr(s){var o=s.flags;if(o&2){try{for(var u,p=s.return;p!==null;){if(aT(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,T=wg(s);af(s,T,y);break;case 5:var O=u.stateNode;u.flags&32&&(zo(O,""),u.flags&=-33);var H=wg(s);af(s,H,O);break;case 3:case 4:var se=u.stateNode.containerInfo,be=wg(s);kg(s,be,se);break;default:throw Error(r(161))}}catch(Ne){qt(s,s.return,Ne)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function pT(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;pT(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function ei(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)uT(s,o.alternate,o),o=o.sibling}function Pa(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:Ii(4,o,o.return),Pa(o);break;case 1:Ts(o,o.return);var u=o.stateNode;typeof u.componentWillUnmount=="function"&&sT(o,o.return,u),Pa(o);break;case 27:Ku(o.stateNode);case 26:case 5:Ts(o,o.return),Pa(o);break;case 22:o.memoizedState===null&&Pa(o);break;case 30:Pa(o);break;default:Pa(o)}s=s.sibling}}function ti(s,o,u){for(u=u&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var p=o.alternate,y=s,T=o,O=T.flags;switch(T.tag){case 0:case 11:case 15:ti(y,T,u),Bu(4,T);break;case 1:if(ti(y,T,u),p=T,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(be){qt(p,p.return,be)}if(p=T,y=p.updateQueue,y!==null){var H=p.stateNode;try{var se=y.shared.hiddenCallbacks;if(se!==null)for(y.shared.hiddenCallbacks=null,y=0;y<se.length;y++)YE(se[y],H)}catch(be){qt(p,p.return,be)}}u&&O&64&&rT(T),zu(T,T.return);break;case 27:oT(T);case 26:case 5:ti(y,T,u),u&&p===null&&O&4&&iT(T),zu(T,T.return);break;case 12:ti(y,T,u);break;case 31:ti(y,T,u),u&&O&4&&fT(y,T);break;case 13:ti(y,T,u),u&&O&4&&hT(y,T);break;case 22:T.memoizedState===null&&ti(y,T,u),zu(T,T.return);break;case 30:break;default:ti(y,T,u)}o=o.sibling}}function _g(s,o){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(s=o.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&wu(u))}function Ag(s,o){s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&wu(s))}function fs(s,o,u,p){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)gT(s,o,u,p),o=o.sibling}function gT(s,o,u,p){var y=o.flags;switch(o.tag){case 0:case 11:case 15:fs(s,o,u,p),y&2048&&Bu(9,o);break;case 1:fs(s,o,u,p);break;case 3:fs(s,o,u,p),y&2048&&(s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&wu(s)));break;case 12:if(y&2048){fs(s,o,u,p),s=o.stateNode;try{var T=o.memoizedProps,O=T.id,H=T.onPostCommit;typeof H=="function"&&H(O,o.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(se){qt(o,o.return,se)}}else fs(s,o,u,p);break;case 31:fs(s,o,u,p);break;case 13:fs(s,o,u,p);break;case 23:break;case 22:T=o.stateNode,O=o.alternate,o.memoizedState!==null?T._visibility&2?fs(s,o,u,p):Hu(s,o):T._visibility&2?fs(s,o,u,p):(T._visibility|=2,il(s,o,u,p,(o.subtreeFlags&10256)!==0||!1)),y&2048&&_g(O,o);break;case 24:fs(s,o,u,p),y&2048&&Ag(o.alternate,o);break;default:fs(s,o,u,p)}}function il(s,o,u,p,y){for(y=y&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=s,O=o,H=u,se=p,be=O.flags;switch(O.tag){case 0:case 11:case 15:il(T,O,H,se,y),Bu(8,O);break;case 23:break;case 22:var Ne=O.stateNode;O.memoizedState!==null?Ne._visibility&2?il(T,O,H,se,y):Hu(T,O):(Ne._visibility|=2,il(T,O,H,se,y)),y&&be&2048&&_g(O.alternate,O);break;case 24:il(T,O,H,se,y),y&&be&2048&&Ag(O.alternate,O);break;default:il(T,O,H,se,y)}o=o.sibling}}function Hu(s,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var u=s,p=o,y=p.flags;switch(p.tag){case 22:Hu(u,p),y&2048&&_g(p.alternate,p);break;case 24:Hu(u,p),y&2048&&Ag(p.alternate,p);break;default:Hu(u,p)}o=o.sibling}}var Uu=8192;function al(s,o,u){if(s.subtreeFlags&Uu)for(s=s.child;s!==null;)bT(s,o,u),s=s.sibling}function bT(s,o,u){switch(s.tag){case 26:al(s,o,u),s.flags&Uu&&s.memoizedState!==null&&WI(u,ds,s.memoizedState,s.memoizedProps);break;case 5:al(s,o,u);break;case 3:case 4:var p=ds;ds=vf(s.stateNode.containerInfo),al(s,o,u),ds=p;break;case 22:s.memoizedState===null&&(p=s.alternate,p!==null&&p.memoizedState!==null?(p=Uu,Uu=16777216,al(s,o,u),Uu=p):al(s,o,u));break;default:al(s,o,u)}}function xT(s){var o=s.alternate;if(o!==null&&(s=o.child,s!==null)){o.child=null;do o=s.sibling,s.sibling=null,s=o;while(s!==null)}}function Fu(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];Fn=p,ET(p,s)}xT(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)yT(s),s=s.sibling}function yT(s){switch(s.tag){case 0:case 11:case 15:Fu(s),s.flags&2048&&Ii(9,s,s.return);break;case 3:Fu(s);break;case 12:Fu(s);break;case 22:var o=s.stateNode;s.memoizedState!==null&&o._visibility&2&&(s.return===null||s.return.tag!==13)?(o._visibility&=-3,lf(s)):Fu(s);break;default:Fu(s)}}function lf(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];Fn=p,ET(p,s)}xT(s)}for(s=s.child;s!==null;){switch(o=s,o.tag){case 0:case 11:case 15:Ii(8,o,o.return),lf(o);break;case 22:u=o.stateNode,u._visibility&2&&(u._visibility&=-3,lf(o));break;default:lf(o)}s=s.sibling}}function ET(s,o){for(;Fn!==null;){var u=Fn;switch(u.tag){case 0:case 11:case 15:Ii(8,u,o);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:wu(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,Fn=p;else e:for(u=s;Fn!==null;){p=Fn;var y=p.sibling,T=p.return;if(cT(p),p===u){Fn=null;break e}if(y!==null){y.return=T,Fn=y;break e}Fn=T}}}var dI={getCacheForType:function(s){var o=Qn(_n),u=o.data.get(s);return u===void 0&&(u=s(),o.data.set(s,u)),u},cacheSignal:function(){return Qn(_n).controller.signal}},fI=typeof WeakMap=="function"?WeakMap:Map,Ft=0,tn=null,kt=null,It=0,Vt=0,zr=null,Mi=!1,ol=!1,Rg=!1,ni=0,yn=0,Li=0,Ba=0,Og=0,Hr=0,ll=0,$u=null,wr=null,Ig=!1,uf=0,vT=0,cf=1/0,df=null,Di=null,jn=0,ji=null,ul=null,ri=0,Mg=0,Lg=null,TT=null,Vu=0,Dg=null;function Ur(){return(Ft&2)!==0&&It!==0?It&-It:B.T!==null?Ug():bn()}function ST(){if(Hr===0)if((It&536870912)===0||Dt){var s=Qt;Qt<<=1,(Qt&3932160)===0&&(Qt=262144),Hr=s}else Hr=536870912;return s=Pr.current,s!==null&&(s.flags|=32),Hr}function kr(s,o,u){(s===tn&&(Vt===2||Vt===9)||s.cancelPendingCommit!==null)&&(cl(s,0),Pi(s,It,Hr,!1)),Et(s,u),((Ft&2)===0||s!==tn)&&(s===tn&&((Ft&2)===0&&(Ba|=u),yn===4&&Pi(s,It,Hr,!1)),Ss(s))}function CT(s,o,u){if((Ft&6)!==0)throw Error(r(327));var p=!u&&(o&127)===0&&(o&s.expiredLanes)===0||yt(s,o),y=p?pI(s,o):Pg(s,o,!0),T=p;do{if(y===0){ol&&!p&&Pi(s,o,0,!1);break}else{if(u=s.current.alternate,T&&!hI(u)){y=Pg(s,o,!1),T=!1;continue}if(y===2){if(T=o,s.errorRecoveryDisabledLanes&T)var O=0;else O=s.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){o=O;e:{var H=s;y=$u;var se=H.current.memoizedState.isDehydrated;if(se&&(cl(H,O).flags|=256),O=Pg(H,O,!1),O!==2){if(Rg&&!se){H.errorRecoveryDisabledLanes|=T,Ba|=T,y=4;break e}T=wr,wr=y,T!==null&&(wr===null?wr=T:wr.push.apply(wr,T))}y=O}if(T=!1,y!==2)continue}}if(y===1){cl(s,0),Pi(s,o,0,!0);break}e:{switch(p=s,T=y,T){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Pi(p,o,Hr,!Mi);break e;case 2:wr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(y=uf+300-Z(),10<y)){if(Pi(p,o,Hr,!Mi),Xe(p,0,!0)!==0)break e;ri=o,p.timeoutHandle=t2(wT.bind(null,p,u,wr,df,Ig,o,Hr,Ba,ll,Mi,T,"Throttled",-0,0),y);break e}wT(p,u,wr,df,Ig,o,Hr,Ba,ll,Mi,T,null,-0,0)}}break}while(!0);Ss(s)}function wT(s,o,u,p,y,T,O,H,se,be,Ne,Ae,xe,Te){if(s.timeoutHandle=-1,Ae=o.subtreeFlags,Ae&8192||(Ae&16785408)===16785408){Ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fs},bT(o,T,Ae);var Ze=(T&62914560)===T?uf-Z():(T&4194048)===T?vT-Z():0;if(Ze=QI(Ae,Ze),Ze!==null){ri=T,s.cancelPendingCommit=Ze(MT.bind(null,s,o,T,u,p,y,O,H,se,Ne,Ae,null,xe,Te)),Pi(s,T,O,!be);return}}MT(s,o,T,u,p,y,O,H,se)}function hI(s){for(var o=s;;){var u=o.tag;if((u===0||u===11||u===15)&&o.flags&16384&&(u=o.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var y=u[p],T=y.getSnapshot;y=y.value;try{if(!Dr(T(),y))return!1}catch{return!1}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Pi(s,o,u,p){o&=~Og,o&=~Ba,s.suspendedLanes|=o,s.pingedLanes&=~o,p&&(s.warmLanes|=o),p=s.expirationTimes;for(var y=o;0<y;){var T=31-qe(y),O=1<<T;p[T]=-1,y&=~O}u!==0&&Er(s,u,o)}function ff(){return(Ft&6)===0?(qu(0),!1):!0}function jg(){if(kt!==null){if(Vt===0)var s=kt.return;else s=kt,Ys=Aa=null,Zp(s),el=null,Nu=0,s=kt;for(;s!==null;)nT(s.alternate,s),s=s.return;kt=null}}function cl(s,o){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,MI(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),ri=0,jg(),tn=s,kt=u=Vs(s.current,null),It=o,Vt=0,zr=null,Mi=!1,ol=yt(s,o),Rg=!1,ll=Hr=Og=Ba=Li=yn=0,wr=$u=null,Ig=!1,(o&8)!==0&&(o|=o&32);var p=s.entangledLanes;if(p!==0)for(s=s.entanglements,p&=o;0<p;){var y=31-qe(p),T=1<<y;o|=s[y],p&=~T}return ni=o,Id(),u}function kT(s,o){bt=null,B.H=Du,o===Jo||o===Hd?(o=FE(),Vt=3):o===Hp?(o=FE(),Vt=4):Vt=o===mg?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,zr=o,kt===null&&(yn=1,ef(s,Zr(o,s.current)))}function NT(){var s=Pr.current;return s===null?!0:(It&4194048)===It?ns===null:(It&62914560)===It||(It&536870912)!==0?s===ns:!1}function _T(){var s=B.H;return B.H=Du,s===null?Du:s}function AT(){var s=B.A;return B.A=dI,s}function hf(){yn=4,Mi||(It&4194048)!==It&&Pr.current!==null||(ol=!0),(Li&134217727)===0&&(Ba&134217727)===0||tn===null||Pi(tn,It,Hr,!1)}function Pg(s,o,u){var p=Ft;Ft|=2;var y=_T(),T=AT();(tn!==s||It!==o)&&(df=null,cl(s,o)),o=!1;var O=yn;e:do try{if(Vt!==0&&kt!==null){var H=kt,se=zr;switch(Vt){case 8:jg(),O=6;break e;case 3:case 2:case 9:case 6:Pr.current===null&&(o=!0);var be=Vt;if(Vt=0,zr=null,dl(s,H,se,be),u&&ol){O=0;break e}break;default:be=Vt,Vt=0,zr=null,dl(s,H,se,be)}}mI(),O=yn;break}catch(Ne){kT(s,Ne)}while(!0);return o&&s.shellSuspendCounter++,Ys=Aa=null,Ft=p,B.H=y,B.A=T,kt===null&&(tn=null,It=0,Id()),O}function mI(){for(;kt!==null;)RT(kt)}function pI(s,o){var u=Ft;Ft|=2;var p=_T(),y=AT();tn!==s||It!==o?(df=null,cf=Z()+500,cl(s,o)):ol=yt(s,o);e:do try{if(Vt!==0&&kt!==null){o=kt;var T=zr;t:switch(Vt){case 1:Vt=0,zr=null,dl(s,o,T,1);break;case 2:case 9:if(HE(T)){Vt=0,zr=null,OT(o);break}o=function(){Vt!==2&&Vt!==9||tn!==s||(Vt=7),Ss(s)},T.then(o,o);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:HE(T)?(Vt=0,zr=null,OT(o)):(Vt=0,zr=null,dl(s,o,T,7));break;case 5:var O=null;switch(kt.tag){case 26:O=kt.memoizedState;case 5:case 27:var H=kt;if(O?g2(O):H.stateNode.complete){Vt=0,zr=null;var se=H.sibling;if(se!==null)kt=se;else{var be=H.return;be!==null?(kt=be,mf(be)):kt=null}break t}}Vt=0,zr=null,dl(s,o,T,5);break;case 6:Vt=0,zr=null,dl(s,o,T,6);break;case 8:jg(),yn=6;break e;default:throw Error(r(462))}}gI();break}catch(Ne){kT(s,Ne)}while(!0);return Ys=Aa=null,B.H=p,B.A=y,Ft=u,kt!==null?0:(tn=null,It=0,Id(),yn)}function gI(){for(;kt!==null&&!te();)RT(kt)}function RT(s){var o=eT(s.alternate,s,ni);s.memoizedProps=s.pendingProps,o===null?mf(s):kt=o}function OT(s){var o=s,u=o.alternate;switch(o.tag){case 15:case 0:o=Kv(u,o,o.pendingProps,o.type,void 0,It);break;case 11:o=Kv(u,o,o.pendingProps,o.type.render,o.ref,It);break;case 5:Zp(o);default:nT(u,o),o=kt=AE(o,ni),o=eT(u,o,ni)}s.memoizedProps=s.pendingProps,o===null?mf(s):kt=o}function dl(s,o,u,p){Ys=Aa=null,Zp(o),el=null,Nu=0;var y=o.return;try{if(sI(s,y,o,u,It)){yn=1,ef(s,Zr(u,s.current)),kt=null;return}}catch(T){if(y!==null)throw kt=y,T;yn=1,ef(s,Zr(u,s.current)),kt=null;return}o.flags&32768?(Dt||p===1?s=!0:ol||(It&536870912)!==0?s=!1:(Mi=s=!0,(p===2||p===9||p===3||p===6)&&(p=Pr.current,p!==null&&p.tag===13&&(p.flags|=16384))),IT(o,s)):mf(o)}function mf(s){var o=s;do{if((o.flags&32768)!==0){IT(o,Mi);return}s=o.return;var u=oI(o.alternate,o,ni);if(u!==null){kt=u;return}if(o=o.sibling,o!==null){kt=o;return}kt=o=s}while(o!==null);yn===0&&(yn=5)}function IT(s,o){do{var u=lI(s.alternate,s);if(u!==null){u.flags&=32767,kt=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!o&&(s=s.sibling,s!==null)){kt=s;return}kt=s=u}while(s!==null);yn=6,kt=null}function MT(s,o,u,p,y,T,O,H,se){s.cancelPendingCommit=null;do pf();while(jn!==0);if((Ft&6)!==0)throw Error(r(327));if(o!==null){if(o===s.current)throw Error(r(177));if(T=o.lanes|o.childLanes,T|=wp,an(s,u,T,O,H,se),s===tn&&(kt=tn=null,It=0),ul=o,ji=s,ri=u,Mg=T,Lg=y,TT=p,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,EI(oe,function(){return BT(),null})):(s.callbackNode=null,s.callbackPriority=0),p=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||p){p=B.T,B.T=null,y=G.p,G.p=2,O=Ft,Ft|=4;try{uI(s,o,u)}finally{Ft=O,G.p=y,B.T=p}}jn=1,LT(),DT(),jT()}}function LT(){if(jn===1){jn=0;var s=ji,o=ul,u=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||u){u=B.T,B.T=null;var p=G.p;G.p=2;var y=Ft;Ft|=4;try{mT(o,s);var T=Xg,O=EE(s.containerInfo),H=T.focusedElem,se=T.selectionRange;if(O!==H&&H&&H.ownerDocument&&yE(H.ownerDocument.documentElement,H)){if(se!==null&&Ep(H)){var be=se.start,Ne=se.end;if(Ne===void 0&&(Ne=be),"selectionStart"in H)H.selectionStart=be,H.selectionEnd=Math.min(Ne,H.value.length);else{var Ae=H.ownerDocument||document,xe=Ae&&Ae.defaultView||window;if(xe.getSelection){var Te=xe.getSelection(),Ze=H.textContent.length,it=Math.min(se.start,Ze),Kt=se.end===void 0?it:Math.min(se.end,Ze);!Te.extend&&it>Kt&&(O=Kt,Kt=it,it=O);var he=xE(H,it),ue=xE(H,Kt);if(he&&ue&&(Te.rangeCount!==1||Te.anchorNode!==he.node||Te.anchorOffset!==he.offset||Te.focusNode!==ue.node||Te.focusOffset!==ue.offset)){var ge=Ae.createRange();ge.setStart(he.node,he.offset),Te.removeAllRanges(),it>Kt?(Te.addRange(ge),Te.extend(ue.node,ue.offset)):(ge.setEnd(ue.node,ue.offset),Te.addRange(ge))}}}}for(Ae=[],Te=H;Te=Te.parentNode;)Te.nodeType===1&&Ae.push({element:Te,left:Te.scrollLeft,top:Te.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<Ae.length;H++){var _e=Ae[H];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}Nf=!!Kg,Xg=Kg=null}finally{Ft=y,G.p=p,B.T=u}}s.current=o,jn=2}}function DT(){if(jn===2){jn=0;var s=ji,o=ul,u=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||u){u=B.T,B.T=null;var p=G.p;G.p=2;var y=Ft;Ft|=4;try{uT(s,o.alternate,o)}finally{Ft=y,G.p=p,B.T=u}}jn=3}}function jT(){if(jn===4||jn===3){jn=0,me();var s=ji,o=ul,u=ri,p=TT;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?jn=5:(jn=0,ul=ji=null,PT(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(Di=null),Ot(u),o=o.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(et,o,void 0,(o.current.flags&128)===128)}catch{}if(p!==null){o=B.T,y=G.p,G.p=2,B.T=null;try{for(var T=s.onRecoverableError,O=0;O<p.length;O++){var H=p[O];T(H.value,{componentStack:H.stack})}}finally{B.T=o,G.p=y}}(ri&3)!==0&&pf(),Ss(s),y=s.pendingLanes,(u&261930)!==0&&(y&42)!==0?s===Dg?Vu++:(Vu=0,Dg=s):Vu=0,qu(0)}}function PT(s,o){(s.pooledCacheLanes&=o)===0&&(o=s.pooledCache,o!=null&&(s.pooledCache=null,wu(o)))}function pf(){return LT(),DT(),jT(),BT()}function BT(){if(jn!==5)return!1;var s=ji,o=Mg;Mg=0;var u=Ot(ri),p=B.T,y=G.p;try{G.p=32>u?32:u,B.T=null,u=Lg,Lg=null;var T=ji,O=ri;if(jn=0,ul=ji=null,ri=0,(Ft&6)!==0)throw Error(r(331));var H=Ft;if(Ft|=4,yT(T.current),gT(T,T.current,O,u),Ft=H,qu(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(et,T)}catch{}return!0}finally{G.p=y,B.T=p,PT(s,o)}}function zT(s,o,u){o=Zr(u,o),o=hg(s.stateNode,o,2),s=Ai(s,o,2),s!==null&&(Et(s,2),Ss(s))}function qt(s,o,u){if(s.tag===3)zT(s,s,u);else for(;o!==null;){if(o.tag===3){zT(o,s,u);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Di===null||!Di.has(p))){s=Zr(u,s),u=Hv(2),p=Ai(o,u,2),p!==null&&(Uv(u,p,o,s),Et(p,2),Ss(p));break}}o=o.return}}function Bg(s,o,u){var p=s.pingCache;if(p===null){p=s.pingCache=new fI;var y=new Set;p.set(o,y)}else y=p.get(o),y===void 0&&(y=new Set,p.set(o,y));y.has(u)||(Rg=!0,y.add(u),s=bI.bind(null,s,o,u),o.then(s,s))}function bI(s,o,u){var p=s.pingCache;p!==null&&p.delete(o),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,tn===s&&(It&u)===u&&(yn===4||yn===3&&(It&62914560)===It&&300>Z()-uf?(Ft&2)===0&&cl(s,0):Og|=u,ll===It&&(ll=0)),Ss(s)}function HT(s,o){o===0&&(o=Jt()),s=ka(s,o),s!==null&&(Et(s,o),Ss(s))}function xI(s){var o=s.memoizedState,u=0;o!==null&&(u=o.retryLane),HT(s,u)}function yI(s,o){var u=0;switch(s.tag){case 31:case 13:var p=s.stateNode,y=s.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=s.stateNode;break;case 22:p=s.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(o),HT(s,u)}function EI(s,o){return Ie(s,o)}var gf=null,fl=null,zg=!1,bf=!1,Hg=!1,Bi=0;function Ss(s){s!==fl&&s.next===null&&(fl===null?gf=fl=s:fl=fl.next=s),bf=!0,zg||(zg=!0,TI())}function qu(s,o){if(!Hg&&bf){Hg=!0;do for(var u=!1,p=gf;p!==null;){if(s!==0){var y=p.pendingLanes;if(y===0)var T=0;else{var O=p.suspendedLanes,H=p.pingedLanes;T=(1<<31-qe(42|s)+1)-1,T&=y&~(O&~H),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(u=!0,VT(p,T))}else T=It,T=Xe(p,p===tn?T:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(T&3)===0||yt(p,T)||(u=!0,VT(p,T));p=p.next}while(u);Hg=!1}}function vI(){UT()}function UT(){bf=zg=!1;var s=0;Bi!==0&&II()&&(s=Bi);for(var o=Z(),u=null,p=gf;p!==null;){var y=p.next,T=FT(p,o);T===0?(p.next=null,u===null?gf=y:u.next=y,y===null&&(fl=u)):(u=p,(s!==0||(T&3)!==0)&&(bf=!0)),p=y}jn!==0&&jn!==5||qu(s),Bi!==0&&(Bi=0)}function FT(s,o){for(var u=s.suspendedLanes,p=s.pingedLanes,y=s.expirationTimes,T=s.pendingLanes&-62914561;0<T;){var O=31-qe(T),H=1<<O,se=y[O];se===-1?((H&u)===0||(H&p)!==0)&&(y[O]=Ut(H,o)):se<=o&&(s.expiredLanes|=H),T&=~H}if(o=tn,u=It,u=Xe(s,s===o?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),p=s.callbackNode,u===0||s===o&&(Vt===2||Vt===9)||s.cancelPendingCommit!==null)return p!==null&&p!==null&&je(p),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||yt(s,u)){if(o=u&-u,o===s.callbackPriority)return o;switch(p!==null&&je(p),Ot(u)){case 2:case 8:u=$;break;case 32:u=oe;break;case 268435456:u=Re;break;default:u=oe}return p=$T.bind(null,s),u=Ie(u,p),s.callbackPriority=o,s.callbackNode=u,o}return p!==null&&p!==null&&je(p),s.callbackPriority=2,s.callbackNode=null,2}function $T(s,o){if(jn!==0&&jn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(pf()&&s.callbackNode!==u)return null;var p=It;return p=Xe(s,s===tn?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),p===0?null:(CT(s,p,o),FT(s,Z()),s.callbackNode!=null&&s.callbackNode===u?$T.bind(null,s):null)}function VT(s,o){if(pf())return null;CT(s,o,!0)}function TI(){LI(function(){(Ft&6)!==0?Ie(K,vI):UT()})}function Ug(){if(Bi===0){var s=Qo;s===0&&(s=Lt,Lt<<=1,(Lt&261888)===0&&(Lt=256)),Bi=s}return Bi}function qT(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Cd(""+s)}function YT(s,o){var u=o.ownerDocument.createElement("input");return u.name=o.name,u.value=o.value,s.id&&u.setAttribute("form",s.id),o.parentNode.insertBefore(u,o),s=new FormData(s),u.parentNode.removeChild(u),s}function SI(s,o,u,p,y){if(o==="submit"&&u&&u.stateNode===y){var T=qT((y[Xn]||null).action),O=p.submitter;O&&(o=(o=O[Xn]||null)?qT(o.formAction):O.getAttribute("formAction"),o!==null&&(T=o,O=null));var H=new _d("action","action",null,p,y);s.push({event:H,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Bi!==0){var se=O?YT(y,O):new FormData(y);og(u,{pending:!0,data:se,method:y.method,action:T},null,se)}}else typeof T=="function"&&(H.preventDefault(),se=O?YT(y,O):new FormData(y),og(u,{pending:!0,data:se,method:y.method,action:T},T,se))},currentTarget:y}]})}}for(var Fg=0;Fg<Cp.length;Fg++){var $g=Cp[Fg],CI=$g.toLowerCase(),wI=$g[0].toUpperCase()+$g.slice(1);cs(CI,"on"+wI)}cs(SE,"onAnimationEnd"),cs(CE,"onAnimationIteration"),cs(wE,"onAnimationStart"),cs("dblclick","onDoubleClick"),cs("focusin","onFocus"),cs("focusout","onBlur"),cs(U6,"onTransitionRun"),cs(F6,"onTransitionStart"),cs($6,"onTransitionCancel"),cs(kE,"onTransitionEnd"),Po("onMouseEnter",["mouseout","mouseover"]),Po("onMouseLeave",["mouseout","mouseover"]),Po("onPointerEnter",["pointerout","pointerover"]),Po("onPointerLeave",["pointerout","pointerover"]),Ta("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ta("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ta("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ta("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yu="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(" "),kI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yu));function GT(s,o){o=(o&4)!==0;for(var u=0;u<s.length;u++){var p=s[u],y=p.event;p=p.listeners;e:{var T=void 0;if(o)for(var O=p.length-1;0<=O;O--){var H=p[O],se=H.instance,be=H.currentTarget;if(H=H.listener,se!==T&&y.isPropagationStopped())break e;T=H,y.currentTarget=be;try{T(y)}catch(Ne){Od(Ne)}y.currentTarget=null,T=se}else for(O=0;O<p.length;O++){if(H=p[O],se=H.instance,be=H.currentTarget,H=H.listener,se!==T&&y.isPropagationStopped())break e;T=H,y.currentTarget=be;try{T(y)}catch(Ne){Od(Ne)}y.currentTarget=null,T=se}}}}function Nt(s,o){var u=o[du];u===void 0&&(u=o[du]=new Set);var p=s+"__bubble";u.has(p)||(KT(o,s,2,!1),u.add(p))}function Vg(s,o,u){var p=0;o&&(p|=4),KT(u,s,p,o)}var xf="_reactListening"+Math.random().toString(36).slice(2);function qg(s){if(!s[xf]){s[xf]=!0,Uy.forEach(function(u){u!=="selectionchange"&&(kI.has(u)||Vg(u,!1,s),Vg(u,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[xf]||(o[xf]=!0,Vg("selectionchange",!1,o))}}function KT(s,o,u,p){switch(S2(o)){case 2:var y=eM;break;case 8:y=tM;break;default:y=a0}u=y.bind(null,o,u,s),y=void 0,!dp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),p?y!==void 0?s.addEventListener(o,u,{capture:!0,passive:y}):s.addEventListener(o,u,!0):y!==void 0?s.addEventListener(o,u,{passive:y}):s.addEventListener(o,u,!1)}function Yg(s,o,u,p,y){var T=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var O=p.tag;if(O===3||O===4){var H=p.stateNode.containerInfo;if(H===y)break;if(O===4)for(O=p.return;O!==null;){var se=O.tag;if((se===3||se===4)&&O.stateNode.containerInfo===y)return;O=O.return}for(;H!==null;){if(O=Lo(H),O===null)return;if(se=O.tag,se===5||se===6||se===26||se===27){p=T=O;continue e}H=H.parentNode}}p=p.return}Jy(function(){var be=T,Ne=up(u),Ae=[];e:{var xe=NE.get(s);if(xe!==void 0){var Te=_d,Ze=s;switch(s){case"keypress":if(kd(u)===0)break e;case"keydown":case"keyup":Te=y6;break;case"focusin":Ze="focus",Te=pp;break;case"focusout":Ze="blur",Te=pp;break;case"beforeblur":case"afterblur":Te=pp;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=nE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=o6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=T6;break;case SE:case CE:case wE:Te=c6;break;case kE:Te=C6;break;case"scroll":case"scrollend":Te=i6;break;case"wheel":Te=k6;break;case"copy":case"cut":case"paste":Te=f6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=sE;break;case"toggle":case"beforetoggle":Te=_6}var it=(o&4)!==0,Kt=!it&&(s==="scroll"||s==="scrollend"),he=it?xe!==null?xe+"Capture":null:xe;it=[];for(var ue=be,ge;ue!==null;){var _e=ue;if(ge=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||ge===null||he===null||(_e=mu(ue,he),_e!=null&&it.push(Gu(ue,_e,ge))),Kt)break;ue=ue.return}0<it.length&&(xe=new Te(xe,Ze,null,u,Ne),Ae.push({event:xe,listeners:it}))}}if((o&7)===0){e:{if(xe=s==="mouseover"||s==="pointerover",Te=s==="mouseout"||s==="pointerout",xe&&u!==lp&&(Ze=u.relatedTarget||u.fromElement)&&(Lo(Ze)||Ze[ys]))break e;if((Te||xe)&&(xe=Ne.window===Ne?Ne:(xe=Ne.ownerDocument)?xe.defaultView||xe.parentWindow:window,Te?(Ze=u.relatedTarget||u.toElement,Te=be,Ze=Ze?Lo(Ze):null,Ze!==null&&(Kt=a(Ze),it=Ze.tag,Ze!==Kt||it!==5&&it!==27&&it!==6)&&(Ze=null)):(Te=null,Ze=be),Te!==Ze)){if(it=nE,_e="onMouseLeave",he="onMouseEnter",ue="mouse",(s==="pointerout"||s==="pointerover")&&(it=sE,_e="onPointerLeave",he="onPointerEnter",ue="pointer"),Kt=Te==null?xe:hu(Te),ge=Ze==null?xe:hu(Ze),xe=new it(_e,ue+"leave",Te,u,Ne),xe.target=Kt,xe.relatedTarget=ge,_e=null,Lo(Ne)===be&&(it=new it(he,ue+"enter",Ze,u,Ne),it.target=ge,it.relatedTarget=Kt,_e=it),Kt=_e,Te&&Ze)t:{for(it=NI,he=Te,ue=Ze,ge=0,_e=he;_e;_e=it(_e))ge++;_e=0;for(var rt=ue;rt;rt=it(rt))_e++;for(;0<ge-_e;)he=it(he),ge--;for(;0<_e-ge;)ue=it(ue),_e--;for(;ge--;){if(he===ue||ue!==null&&he===ue.alternate){it=he;break t}he=it(he),ue=it(ue)}it=null}else it=null;Te!==null&&XT(Ae,xe,Te,it,!1),Ze!==null&&Kt!==null&&XT(Ae,Kt,Ze,it,!0)}}e:{if(xe=be?hu(be):window,Te=xe.nodeName&&xe.nodeName.toLowerCase(),Te==="select"||Te==="input"&&xe.type==="file")var zt=fE;else if(cE(xe))if(hE)zt=B6;else{zt=j6;var Je=D6}else Te=xe.nodeName,!Te||Te.toLowerCase()!=="input"||xe.type!=="checkbox"&&xe.type!=="radio"?be&&op(be.elementType)&&(zt=fE):zt=P6;if(zt&&(zt=zt(s,be))){dE(Ae,zt,u,Ne);break e}Je&&Je(s,xe,be),s==="focusout"&&be&&xe.type==="number"&&be.memoizedProps.value!=null&&ap(xe,"number",xe.value)}switch(Je=be?hu(be):window,s){case"focusin":(cE(Je)||Je.contentEditable==="true")&&($o=Je,vp=be,Tu=null);break;case"focusout":Tu=vp=$o=null;break;case"mousedown":Tp=!0;break;case"contextmenu":case"mouseup":case"dragend":Tp=!1,vE(Ae,u,Ne);break;case"selectionchange":if(H6)break;case"keydown":case"keyup":vE(Ae,u,Ne)}var xt;if(bp)e:{switch(s){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else Fo?lE(s,u)&&(Mt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Mt="onCompositionStart");Mt&&(iE&&u.locale!=="ko"&&(Fo||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&Fo&&(xt=eE()):(Ti=Ne,fp="value"in Ti?Ti.value:Ti.textContent,Fo=!0)),Je=yf(be,Mt),0<Je.length&&(Mt=new rE(Mt,s,null,u,Ne),Ae.push({event:Mt,listeners:Je}),xt?Mt.data=xt:(xt=uE(u),xt!==null&&(Mt.data=xt)))),(xt=R6?O6(s,u):I6(s,u))&&(Mt=yf(be,"onBeforeInput"),0<Mt.length&&(Je=new rE("onBeforeInput","beforeinput",null,u,Ne),Ae.push({event:Je,listeners:Mt}),Je.data=xt)),SI(Ae,s,be,u,Ne)}GT(Ae,o)})}function Gu(s,o,u){return{instance:s,listener:o,currentTarget:u}}function yf(s,o){for(var u=o+"Capture",p=[];s!==null;){var y=s,T=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||T===null||(y=mu(s,u),y!=null&&p.unshift(Gu(s,y,T)),y=mu(s,o),y!=null&&p.push(Gu(s,y,T))),s.tag===3)return p;s=s.return}return[]}function NI(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function XT(s,o,u,p,y){for(var T=o._reactName,O=[];u!==null&&u!==p;){var H=u,se=H.alternate,be=H.stateNode;if(H=H.tag,se!==null&&se===p)break;H!==5&&H!==26&&H!==27||be===null||(se=be,y?(be=mu(u,T),be!=null&&O.unshift(Gu(u,be,se))):y||(be=mu(u,T),be!=null&&O.push(Gu(u,be,se)))),u=u.return}O.length!==0&&s.push({event:o,listeners:O})}var _I=/\r\n?/g,AI=/\u0000|\uFFFD/g;function WT(s){return(typeof s=="string"?s:""+s).replace(_I,`
50
- `).replace(AI,"")}function QT(s,o){return o=WT(o),WT(s)===o}function Gt(s,o,u,p,y,T){switch(u){case"children":typeof p=="string"?o==="body"||o==="textarea"&&p===""||zo(s,p):(typeof p=="number"||typeof p=="bigint")&&o!=="body"&&zo(s,""+p);break;case"className":Td(s,"class",p);break;case"tabIndex":Td(s,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Td(s,u,p);break;case"style":Qy(s,p,T);break;case"data":if(o!=="object"){Td(s,"data",p);break}case"src":case"href":if(p===""&&(o!=="a"||u!=="href")){s.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){s.removeAttribute(u);break}p=Cd(""+p),s.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){s.setAttribute(u,"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"&&(u==="formAction"?(o!=="input"&&Gt(s,o,"name",y.name,y,null),Gt(s,o,"formEncType",y.formEncType,y,null),Gt(s,o,"formMethod",y.formMethod,y,null),Gt(s,o,"formTarget",y.formTarget,y,null)):(Gt(s,o,"encType",y.encType,y,null),Gt(s,o,"method",y.method,y,null),Gt(s,o,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){s.removeAttribute(u);break}p=Cd(""+p),s.setAttribute(u,p);break;case"onClick":p!=null&&(s.onclick=Fs);break;case"onScroll":p!=null&&Nt("scroll",s);break;case"onScrollEnd":p!=null&&Nt("scrollend",s);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"multiple":s.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":s.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){s.removeAttribute("xlink:href");break}u=Cd(""+p),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,""+p):s.removeAttribute(u);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":p&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":p===!0?s.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,p):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?s.setAttribute(u,p):s.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?s.removeAttribute(u):s.setAttribute(u,p);break;case"popover":Nt("beforetoggle",s),Nt("toggle",s),vd(s,"popover",p);break;case"xlinkActuate":Us(s,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Us(s,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Us(s,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Us(s,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Us(s,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Us(s,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Us(s,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Us(s,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Us(s,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":vd(s,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=r6.get(u)||u,vd(s,u,p))}}function Gg(s,o,u,p,y,T){switch(u){case"style":Qy(s,p,T);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof p=="string"?zo(s,p):(typeof p=="number"||typeof p=="bigint")&&zo(s,""+p);break;case"onScroll":p!=null&&Nt("scroll",s);break;case"onScrollEnd":p!=null&&Nt("scrollend",s);break;case"onClick":p!=null&&(s.onclick=Fs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fy.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),o=u.slice(2,y?u.length-7:void 0),T=s[Xn]||null,T=T!=null?T[u]:null,typeof T=="function"&&s.removeEventListener(o,T,y),typeof p=="function")){typeof T!="function"&&T!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(o,p,y);break e}u in s?s[u]=p:p===!0?s.setAttribute(u,""):vd(s,u,p)}}}function Jn(s,o,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Nt("error",s),Nt("load",s);var p=!1,y=!1,T;for(T in u)if(u.hasOwnProperty(T)){var O=u[T];if(O!=null)switch(T){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Gt(s,o,T,O,u,null)}}y&&Gt(s,o,"srcSet",u.srcSet,u,null),p&&Gt(s,o,"src",u.src,u,null);return;case"input":Nt("invalid",s);var H=T=O=y=null,se=null,be=null;for(p in u)if(u.hasOwnProperty(p)){var Ne=u[p];if(Ne!=null)switch(p){case"name":y=Ne;break;case"type":O=Ne;break;case"checked":se=Ne;break;case"defaultChecked":be=Ne;break;case"value":T=Ne;break;case"defaultValue":H=Ne;break;case"children":case"dangerouslySetInnerHTML":if(Ne!=null)throw Error(r(137,o));break;default:Gt(s,o,p,Ne,u,null)}}Gy(s,T,H,se,be,O,y,!1);return;case"select":Nt("invalid",s),p=O=T=null;for(y in u)if(u.hasOwnProperty(y)&&(H=u[y],H!=null))switch(y){case"value":T=H;break;case"defaultValue":O=H;break;case"multiple":p=H;default:Gt(s,o,y,H,u,null)}o=T,u=O,s.multiple=!!p,o!=null?Bo(s,!!p,o,!1):u!=null&&Bo(s,!!p,u,!0);return;case"textarea":Nt("invalid",s),T=y=p=null;for(O in u)if(u.hasOwnProperty(O)&&(H=u[O],H!=null))switch(O){case"value":p=H;break;case"defaultValue":y=H;break;case"children":T=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(91));break;default:Gt(s,o,O,H,u,null)}Xy(s,p,y,T);return;case"option":for(se in u)if(u.hasOwnProperty(se)&&(p=u[se],p!=null))switch(se){case"selected":s.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Gt(s,o,se,p,u,null)}return;case"dialog":Nt("beforetoggle",s),Nt("toggle",s),Nt("cancel",s),Nt("close",s);break;case"iframe":case"object":Nt("load",s);break;case"video":case"audio":for(p=0;p<Yu.length;p++)Nt(Yu[p],s);break;case"image":Nt("error",s),Nt("load",s);break;case"details":Nt("toggle",s);break;case"embed":case"source":case"link":Nt("error",s),Nt("load",s);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 u)if(u.hasOwnProperty(be)&&(p=u[be],p!=null))switch(be){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Gt(s,o,be,p,u,null)}return;default:if(op(o)){for(Ne in u)u.hasOwnProperty(Ne)&&(p=u[Ne],p!==void 0&&Gg(s,o,Ne,p,u,void 0));return}}for(H in u)u.hasOwnProperty(H)&&(p=u[H],p!=null&&Gt(s,o,H,p,u,null))}function RI(s,o,u,p){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,T=null,O=null,H=null,se=null,be=null,Ne=null;for(Te in u){var Ae=u[Te];if(u.hasOwnProperty(Te)&&Ae!=null)switch(Te){case"checked":break;case"value":break;case"defaultValue":se=Ae;default:p.hasOwnProperty(Te)||Gt(s,o,Te,null,p,Ae)}}for(var xe in p){var Te=p[xe];if(Ae=u[xe],p.hasOwnProperty(xe)&&(Te!=null||Ae!=null))switch(xe){case"type":T=Te;break;case"name":y=Te;break;case"checked":be=Te;break;case"defaultChecked":Ne=Te;break;case"value":O=Te;break;case"defaultValue":H=Te;break;case"children":case"dangerouslySetInnerHTML":if(Te!=null)throw Error(r(137,o));break;default:Te!==Ae&&Gt(s,o,xe,Te,p,Ae)}}ip(s,O,H,se,be,Ne,T,y);return;case"select":Te=O=H=xe=null;for(T in u)if(se=u[T],u.hasOwnProperty(T)&&se!=null)switch(T){case"value":break;case"multiple":Te=se;default:p.hasOwnProperty(T)||Gt(s,o,T,null,p,se)}for(y in p)if(T=p[y],se=u[y],p.hasOwnProperty(y)&&(T!=null||se!=null))switch(y){case"value":xe=T;break;case"defaultValue":H=T;break;case"multiple":O=T;default:T!==se&&Gt(s,o,y,T,p,se)}o=H,u=O,p=Te,xe!=null?Bo(s,!!u,xe,!1):!!p!=!!u&&(o!=null?Bo(s,!!u,o,!0):Bo(s,!!u,u?[]:"",!1));return;case"textarea":Te=xe=null;for(H in u)if(y=u[H],u.hasOwnProperty(H)&&y!=null&&!p.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:Gt(s,o,H,null,p,y)}for(O in p)if(y=p[O],T=u[O],p.hasOwnProperty(O)&&(y!=null||T!=null))switch(O){case"value":xe=y;break;case"defaultValue":Te=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==T&&Gt(s,o,O,y,p,T)}Ky(s,xe,Te);return;case"option":for(var Ze in u)if(xe=u[Ze],u.hasOwnProperty(Ze)&&xe!=null&&!p.hasOwnProperty(Ze))switch(Ze){case"selected":s.selected=!1;break;default:Gt(s,o,Ze,null,p,xe)}for(se in p)if(xe=p[se],Te=u[se],p.hasOwnProperty(se)&&xe!==Te&&(xe!=null||Te!=null))switch(se){case"selected":s.selected=xe&&typeof xe!="function"&&typeof xe!="symbol";break;default:Gt(s,o,se,xe,p,Te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var it in u)xe=u[it],u.hasOwnProperty(it)&&xe!=null&&!p.hasOwnProperty(it)&&Gt(s,o,it,null,p,xe);for(be in p)if(xe=p[be],Te=u[be],p.hasOwnProperty(be)&&xe!==Te&&(xe!=null||Te!=null))switch(be){case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,o));break;default:Gt(s,o,be,xe,p,Te)}return;default:if(op(o)){for(var Kt in u)xe=u[Kt],u.hasOwnProperty(Kt)&&xe!==void 0&&!p.hasOwnProperty(Kt)&&Gg(s,o,Kt,void 0,p,xe);for(Ne in p)xe=p[Ne],Te=u[Ne],!p.hasOwnProperty(Ne)||xe===Te||xe===void 0&&Te===void 0||Gg(s,o,Ne,xe,p,Te);return}}for(var he in u)xe=u[he],u.hasOwnProperty(he)&&xe!=null&&!p.hasOwnProperty(he)&&Gt(s,o,he,null,p,xe);for(Ae in p)xe=p[Ae],Te=u[Ae],!p.hasOwnProperty(Ae)||xe===Te||xe==null&&Te==null||Gt(s,o,Ae,xe,p,Te)}function ZT(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function OI(){if(typeof performance.getEntriesByType=="function"){for(var s=0,o=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var y=u[p],T=y.transferSize,O=y.initiatorType,H=y.duration;if(T&&H&&ZT(O)){for(O=0,H=y.responseEnd,p+=1;p<u.length;p++){var se=u[p],be=se.startTime;if(be>H)break;var Ne=se.transferSize,Ae=se.initiatorType;Ne&&ZT(Ae)&&(se=se.responseEnd,O+=Ne*(se<H?1:(H-be)/(se-be)))}if(--p,o+=8*(T+O)/(y.duration/1e3),s++,10<s)break}}if(0<s)return o/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Kg=null,Xg=null;function Ef(s){return s.nodeType===9?s:s.ownerDocument}function JT(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function e2(s,o){if(s===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&o==="foreignObject"?0:s}function Wg(s,o){return s==="textarea"||s==="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 Qg=null;function II(){var s=window.event;return s&&s.type==="popstate"?s===Qg?!1:(Qg=s,!0):(Qg=null,!1)}var t2=typeof setTimeout=="function"?setTimeout:void 0,MI=typeof clearTimeout=="function"?clearTimeout:void 0,n2=typeof Promise=="function"?Promise:void 0,LI=typeof queueMicrotask=="function"?queueMicrotask:typeof n2<"u"?function(s){return n2.resolve(null).then(s).catch(DI)}:t2;function DI(s){setTimeout(function(){throw s})}function zi(s){return s==="head"}function r2(s,o){var u=o,p=0;do{var y=u.nextSibling;if(s.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(p===0){s.removeChild(y),gl(o);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Ku(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,Ku(u);for(var T=u.firstChild;T;){var O=T.nextSibling,H=T.nodeName;T[fu]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=O}}else u==="body"&&Ku(s.ownerDocument.body);u=y}while(u);gl(o)}function s2(s,o){var u=s;s=0;do{var p=u.nextSibling;if(u.nodeType===1?o?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(o?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=p}while(u)}function Zg(s){var o=s.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var u=o;switch(o=o.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Zg(u),rp(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function jI(s,o,u,p){for(;s.nodeType===1;){var y=u;if(s.nodeName.toLowerCase()!==o.toLowerCase()){if(!p&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(p){if(!s[fu])switch(o){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(T=s.getAttribute("rel"),T==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(T!==y.rel||s.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||s.getAttribute("title")!==(y.title==null?null:y.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(T=s.getAttribute("src"),(T!==(y.src==null?null:y.src)||s.getAttribute("type")!==(y.type==null?null:y.type)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&T&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(o==="input"&&s.type==="hidden"){var T=y.name==null?null:""+y.name;if(y.type==="hidden"&&s.getAttribute("name")===T)return s}else return s;if(s=rs(s.nextSibling),s===null)break}return null}function PI(s,o,u){if(o==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=rs(s.nextSibling),s===null))return null;return s}function i2(s,o){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=rs(s.nextSibling),s===null))return null;return s}function Jg(s){return s.data==="$?"||s.data==="$~"}function e0(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function BI(s,o){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=o;else if(s.data!=="$?"||u.readyState!=="loading")o();else{var p=function(){o(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),s._reactRetry=p}}function rs(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return s}var t0=null;function a2(s){s=s.nextSibling;for(var o=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(o===0)return rs(s.nextSibling);o--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||o++}s=s.nextSibling}return null}function o2(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(o===0)return s;o--}else u!=="/$"&&u!=="/&"||o++}s=s.previousSibling}return null}function l2(s,o,u){switch(o=Ef(u),s){case"html":if(s=o.documentElement,!s)throw Error(r(452));return s;case"head":if(s=o.head,!s)throw Error(r(453));return s;case"body":if(s=o.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Ku(s){for(var o=s.attributes;o.length;)s.removeAttributeNode(o[0]);rp(s)}var ss=new Map,u2=new Set;function vf(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var si=G.d;G.d={f:zI,r:HI,D:UI,C:FI,L:$I,m:VI,X:YI,S:qI,M:GI};function zI(){var s=si.f(),o=ff();return s||o}function HI(s){var o=Do(s);o!==null&&o.tag===5&&o.type==="form"?kv(o):si.r(s)}var hl=typeof document>"u"?null:document;function c2(s,o,u){var p=hl;if(p&&typeof o=="string"&&o){var y=Wr(o);y='link[rel="'+s+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),u2.has(y)||(u2.add(y),s={rel:s,crossOrigin:u,href:o},p.querySelector(y)===null&&(o=p.createElement("link"),Jn(o,"link",s),Un(o),p.head.appendChild(o)))}}function UI(s){si.D(s),c2("dns-prefetch",s,null)}function FI(s,o){si.C(s,o),c2("preconnect",s,o)}function $I(s,o,u){si.L(s,o,u);var p=hl;if(p&&s&&o){var y='link[rel="preload"][as="'+Wr(o)+'"]';o==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Wr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Wr(u.imageSizes)+'"]')):y+='[href="'+Wr(s)+'"]';var T=y;switch(o){case"style":T=ml(s);break;case"script":T=pl(s)}ss.has(T)||(s=m({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:s,as:o},u),ss.set(T,s),p.querySelector(y)!==null||o==="style"&&p.querySelector(Xu(T))||o==="script"&&p.querySelector(Wu(T))||(o=p.createElement("link"),Jn(o,"link",s),Un(o),p.head.appendChild(o)))}}function VI(s,o){si.m(s,o);var u=hl;if(u&&s){var p=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Wr(p)+'"][href="'+Wr(s)+'"]',T=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=pl(s)}if(!ss.has(T)&&(s=m({rel:"modulepreload",href:s},o),ss.set(T,s),u.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Wu(T)))return}p=u.createElement("link"),Jn(p,"link",s),Un(p),u.head.appendChild(p)}}}function qI(s,o,u){si.S(s,o,u);var p=hl;if(p&&s){var y=jo(p).hoistableStyles,T=ml(s);o=o||"default";var O=y.get(T);if(!O){var H={loading:0,preload:null};if(O=p.querySelector(Xu(T)))H.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":o},u),(u=ss.get(T))&&n0(s,u);var se=O=p.createElement("link");Un(se),Jn(se,"link",s),se._p=new Promise(function(be,Ne){se.onload=be,se.onerror=Ne}),se.addEventListener("load",function(){H.loading|=1}),se.addEventListener("error",function(){H.loading|=2}),H.loading|=4,Tf(O,o,p)}O={type:"stylesheet",instance:O,count:1,state:H},y.set(T,O)}}}function YI(s,o){si.X(s,o);var u=hl;if(u&&s){var p=jo(u).hoistableScripts,y=pl(s),T=p.get(y);T||(T=u.querySelector(Wu(y)),T||(s=m({src:s,async:!0},o),(o=ss.get(y))&&r0(s,o),T=u.createElement("script"),Un(T),Jn(T,"link",s),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},p.set(y,T))}}function GI(s,o){si.M(s,o);var u=hl;if(u&&s){var p=jo(u).hoistableScripts,y=pl(s),T=p.get(y);T||(T=u.querySelector(Wu(y)),T||(s=m({src:s,async:!0,type:"module"},o),(o=ss.get(y))&&r0(s,o),T=u.createElement("script"),Un(T),Jn(T,"link",s),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},p.set(y,T))}}function d2(s,o,u,p){var y=(y=ce.current)?vf(y):null;if(!y)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=ml(u.href),u=jo(y).hoistableStyles,p=u.get(o),p||(p={type:"style",instance:null,count:0,state:null},u.set(o,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=ml(u.href);var T=jo(y).hoistableStyles,O=T.get(s);if(O||(y=y.ownerDocument||y,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(s,O),(T=y.querySelector(Xu(s)))&&!T._p&&(O.instance=T,O.state.loading=5),ss.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ss.set(s,u),T||KI(y,s,u,O.state))),o&&p===null)throw Error(r(528,""));return O}if(o&&p!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=pl(u),u=jo(y).hoistableScripts,p=u.get(o),p||(p={type:"script",instance:null,count:0,state:null},u.set(o,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function ml(s){return'href="'+Wr(s)+'"'}function Xu(s){return'link[rel="stylesheet"]['+s+"]"}function f2(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function KI(s,o,u,p){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?p.loading=1:(o=s.createElement("link"),p.preload=o,o.addEventListener("load",function(){return p.loading|=1}),o.addEventListener("error",function(){return p.loading|=2}),Jn(o,"link",u),Un(o),s.head.appendChild(o))}function pl(s){return'[src="'+Wr(s)+'"]'}function Wu(s){return"script[async]"+s}function h2(s,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var p=s.querySelector('style[data-href~="'+Wr(u.href)+'"]');if(p)return o.instance=p,Un(p),p;var y=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(s.ownerDocument||s).createElement("style"),Un(p),Jn(p,"style",y),Tf(p,u.precedence,s),o.instance=p;case"stylesheet":y=ml(u.href);var T=s.querySelector(Xu(y));if(T)return o.state.loading|=4,o.instance=T,Un(T),T;p=f2(u),(y=ss.get(y))&&n0(p,y),T=(s.ownerDocument||s).createElement("link"),Un(T);var O=T;return O._p=new Promise(function(H,se){O.onload=H,O.onerror=se}),Jn(T,"link",p),o.state.loading|=4,Tf(T,u.precedence,s),o.instance=T;case"script":return T=pl(u.src),(y=s.querySelector(Wu(T)))?(o.instance=y,Un(y),y):(p=u,(y=ss.get(T))&&(p=m({},u),r0(p,y)),s=s.ownerDocument||s,y=s.createElement("script"),Un(y),Jn(y,"link",p),s.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(p=o.instance,o.state.loading|=4,Tf(p,u.precedence,s));return o.instance}function Tf(s,o,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,T=y,O=0;O<p.length;O++){var H=p[O];if(H.dataset.precedence===o)T=H;else if(T!==y)break}T?T.parentNode.insertBefore(s,T.nextSibling):(o=u.nodeType===9?u.head:u,o.insertBefore(s,o.firstChild))}function n0(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.title==null&&(s.title=o.title)}function r0(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.integrity==null&&(s.integrity=o.integrity)}var Sf=null;function m2(s,o,u){if(Sf===null){var p=new Map,y=Sf=new Map;y.set(u,p)}else y=Sf,p=y.get(u),p||(p=new Map,y.set(u,p));if(p.has(s))return p;for(p.set(s,null),u=u.getElementsByTagName(s),y=0;y<u.length;y++){var T=u[y];if(!(T[fu]||T[en]||s==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var O=T.getAttribute(o)||"";O=s+O;var H=p.get(O);H?H.push(T):p.set(O,[T])}}return p}function p2(s,o,u){s=s.ownerDocument||s,s.head.insertBefore(u,o==="title"?s.querySelector("head > title"):null)}function XI(s,o,u){if(u===1||o.itemProp!=null)return!1;switch(s){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 s=o.disabled,typeof o.precedence=="string"&&s==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 g2(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function WI(s,o,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=ml(p.href),T=o.querySelector(Xu(y));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=Cf.bind(s),o.then(s,s)),u.state.loading|=4,u.instance=T,Un(T);return}T=o.ownerDocument||o,p=f2(p),(y=ss.get(y))&&n0(p,y),T=T.createElement("link"),Un(T);var O=T;O._p=new Promise(function(H,se){O.onload=H,O.onerror=se}),Jn(T,"link",p),u.instance=T}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=Cf.bind(s),o.addEventListener("load",u),o.addEventListener("error",u))}}var s0=0;function QI(s,o){return s.stylesheets&&s.count===0&&kf(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var p=setTimeout(function(){if(s.stylesheets&&kf(s,s.stylesheets),s.unsuspend){var T=s.unsuspend;s.unsuspend=null,T()}},6e4+o);0<s.imgBytes&&s0===0&&(s0=62500*OI());var y=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&kf(s,s.stylesheets),s.unsuspend)){var T=s.unsuspend;s.unsuspend=null,T()}},(s.imgBytes>s0?50:800)+o);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function Cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kf(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var wf=null;function kf(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,wf=new Map,o.forEach(ZI,s),wf=null,Cf.call(s))}function ZI(s,o){if(!(o.state.loading&4)){var u=wf.get(s);if(u)var p=u.get(null);else{u=new Map,wf.set(s,u);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<y.length;T++){var O=y[T];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(u.set(O.dataset.precedence,O),p=O)}p&&u.set(null,p)}y=o.instance,O=y.getAttribute("data-precedence"),T=u.get(O)||p,T===p&&u.set(null,y),u.set(O,y),this.count++,p=Cf.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),T?T.parentNode.insertBefore(y,T.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(y,s.firstChild)),o.state.loading|=4}}var Qu={$$typeof:_,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function JI(s,o,u,p,y,T,O,H,se){this.tag=1,this.containerInfo=s,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=p,this.onUncaughtError=y,this.onCaughtError=T,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=se,this.incompleteTransitions=new Map}function b2(s,o,u,p,y,T,O,H,se,be,Ne,Ae){return s=new JI(s,o,u,O,se,be,Ne,Ae,H),o=1,T===!0&&(o|=24),T=jr(3,null,null,o),s.current=T,T.stateNode=s,o=Pp(),o.refCount++,s.pooledCache=o,o.refCount++,T.memoizedState={element:p,isDehydrated:u,cache:o},Up(T),s}function x2(s){return s?(s=Yo,s):Yo}function y2(s,o,u,p,y,T){y=x2(y),p.context===null?p.context=y:p.pendingContext=y,p=_i(o),p.payload={element:u},T=T===void 0?null:T,T!==null&&(p.callback=T),u=Ai(s,p,o),u!==null&&(kr(u,s,o),Au(u,s,o))}function E2(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<o?u:o}}function i0(s,o){E2(s,o),(s=s.alternate)&&E2(s,o)}function v2(s){if(s.tag===13||s.tag===31){var o=ka(s,67108864);o!==null&&kr(o,s,67108864),i0(s,67108864)}}function T2(s){if(s.tag===13||s.tag===31){var o=Ur();o=ht(o);var u=ka(s,o);u!==null&&kr(u,s,o),i0(s,o)}}var Nf=!0;function eM(s,o,u,p){var y=B.T;B.T=null;var T=G.p;try{G.p=2,a0(s,o,u,p)}finally{G.p=T,B.T=y}}function tM(s,o,u,p){var y=B.T;B.T=null;var T=G.p;try{G.p=8,a0(s,o,u,p)}finally{G.p=T,B.T=y}}function a0(s,o,u,p){if(Nf){var y=o0(p);if(y===null)Yg(s,o,p,_f,u),C2(s,p);else if(rM(y,s,o,u,p))p.stopPropagation();else if(C2(s,p),o&4&&-1<nM.indexOf(s)){for(;y!==null;){var T=Do(y);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var O=Zt(T.pendingLanes);if(O!==0){var H=T;for(H.pendingLanes|=2,H.entangledLanes|=2;O;){var se=1<<31-qe(O);H.entanglements[1]|=se,O&=~se}Ss(T),(Ft&6)===0&&(cf=Z()+500,qu(0))}}break;case 31:case 13:H=ka(T,2),H!==null&&kr(H,T,2),ff(),i0(T,2)}if(T=o0(p),T===null&&Yg(s,o,p,_f,u),T===y)break;y=T}y!==null&&p.stopPropagation()}else Yg(s,o,p,null,u)}}function o0(s){return s=up(s),l0(s)}var _f=null;function l0(s){if(_f=null,s=Lo(s),s!==null){var o=a(s);if(o===null)s=null;else{var u=o.tag;if(u===13){if(s=l(o),s!==null)return s;s=null}else if(u===31){if(s=c(o),s!==null)return s;s=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null)}}return _f=s,null}function S2(s){switch(s){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(re()){case K:return 2;case $:return 8;case oe:case Ce:return 32;case Re:return 268435456;default:return 32}default:return 32}}var u0=!1,Hi=null,Ui=null,Fi=null,Zu=new Map,Ju=new Map,$i=[],nM="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 C2(s,o){switch(s){case"focusin":case"focusout":Hi=null;break;case"dragenter":case"dragleave":Ui=null;break;case"mouseover":case"mouseout":Fi=null;break;case"pointerover":case"pointerout":Zu.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ju.delete(o.pointerId)}}function ec(s,o,u,p,y,T){return s===null||s.nativeEvent!==T?(s={blockedOn:o,domEventName:u,eventSystemFlags:p,nativeEvent:T,targetContainers:[y]},o!==null&&(o=Do(o),o!==null&&v2(o)),s):(s.eventSystemFlags|=p,o=s.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),s)}function rM(s,o,u,p,y){switch(o){case"focusin":return Hi=ec(Hi,s,o,u,p,y),!0;case"dragenter":return Ui=ec(Ui,s,o,u,p,y),!0;case"mouseover":return Fi=ec(Fi,s,o,u,p,y),!0;case"pointerover":var T=y.pointerId;return Zu.set(T,ec(Zu.get(T)||null,s,o,u,p,y)),!0;case"gotpointercapture":return T=y.pointerId,Ju.set(T,ec(Ju.get(T)||null,s,o,u,p,y)),!0}return!1}function w2(s){var o=Lo(s.target);if(o!==null){var u=a(o);if(u!==null){if(o=u.tag,o===13){if(o=l(u),o!==null){s.blockedOn=o,Hn(s.priority,function(){T2(u)});return}}else if(o===31){if(o=c(u),o!==null){s.blockedOn=o,Hn(s.priority,function(){T2(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Af(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var u=o0(s.nativeEvent);if(u===null){u=s.nativeEvent;var p=new u.constructor(u.type,u);lp=p,u.target.dispatchEvent(p),lp=null}else return o=Do(u),o!==null&&v2(o),s.blockedOn=u,!1;o.shift()}return!0}function k2(s,o,u){Af(s)&&u.delete(o)}function sM(){u0=!1,Hi!==null&&Af(Hi)&&(Hi=null),Ui!==null&&Af(Ui)&&(Ui=null),Fi!==null&&Af(Fi)&&(Fi=null),Zu.forEach(k2),Ju.forEach(k2)}function Rf(s,o){s.blockedOn===o&&(s.blockedOn=null,u0||(u0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sM)))}var Of=null;function N2(s){Of!==s&&(Of=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Of===s&&(Of=null);for(var o=0;o<s.length;o+=3){var u=s[o],p=s[o+1],y=s[o+2];if(typeof p!="function"){if(l0(p||u)===null)continue;break}var T=Do(u);T!==null&&(s.splice(o,3),o-=3,og(T,{pending:!0,data:y,method:u.method,action:p},p,y))}}))}function gl(s){function o(se){return Rf(se,s)}Hi!==null&&Rf(Hi,s),Ui!==null&&Rf(Ui,s),Fi!==null&&Rf(Fi,s),Zu.forEach(o),Ju.forEach(o);for(var u=0;u<$i.length;u++){var p=$i[u];p.blockedOn===s&&(p.blockedOn=null)}for(;0<$i.length&&(u=$i[0],u.blockedOn===null);)w2(u),u.blockedOn===null&&$i.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var y=u[p],T=u[p+1],O=y[Xn]||null;if(typeof T=="function")O||N2(u);else if(O){var H=null;if(T&&T.hasAttribute("formAction")){if(y=T,O=T[Xn]||null)H=O.formAction;else if(l0(y)!==null)continue}else H=O.action;typeof H=="function"?u[p+1]=H:(u.splice(p,3),p-=3),N2(u)}}}function _2(){function s(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(O){return y=O})},focusReset:"manual",scroll:"manual"})}function o(){y!==null&&(y(),y=null),p||setTimeout(u,20)}function u(){if(!p&&!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 p=!1,y=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),y!==null&&(y(),y=null)}}}function c0(s){this._internalRoot=s}If.prototype.render=c0.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(r(409));var u=o.current,p=Ur();y2(u,p,s,o,null,null)},If.prototype.unmount=c0.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;y2(s.current,2,null,s,null,null),ff(),o[ys]=null}};function If(s){this._internalRoot=s}If.prototype.unstable_scheduleHydration=function(s){if(s){var o=bn();s={blockedOn:null,target:s,priority:o};for(var u=0;u<$i.length&&o!==0&&o<$i[u].priority;u++);$i.splice(u,0,s),u===0&&w2(s)}};var A2=t.version;if(A2!=="19.2.7")throw Error(r(527,A2,"19.2.7"));G.findDOMNode=function(s){var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(o),s=s!==null?g(s):null,s=s===null?null:s.stateNode,s};var iM={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mf.isDisabled&&Mf.supportsFiber)try{et=Mf.inject(iM),dt=Mf}catch{}}return nc.createRoot=function(s,o){if(!i(s))throw Error(r(299));var u=!1,p="",y=jv,T=Pv,O=Bv;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(O=o.onRecoverableError)),o=b2(s,1,!1,null,null,u,p,null,y,T,O,_2),s[ys]=o.current,qg(s),new c0(o)},nc.hydrateRoot=function(s,o,u){if(!i(s))throw Error(r(299));var p=!1,y="",T=jv,O=Pv,H=Bv,se=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(T=u.onUncaughtError),u.onCaughtError!==void 0&&(O=u.onCaughtError),u.onRecoverableError!==void 0&&(H=u.onRecoverableError),u.formState!==void 0&&(se=u.formState)),o=b2(s,1,!0,o,u??null,p,y,se,T,O,H,_2),o.context=x2(null),u=o.current,p=Ur(),p=ht(p),y=_i(p),y.callback=null,Ai(u,y,p),u=p,o.current.lanes=u,Et(o,u),Ss(o),s[ys]=o.current,qg(s),new If(o)},nc.version="19.2.7",nc}var z2;function gM(){if(z2)return h0.exports;z2=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(),h0.exports=pM(),h0.exports}var bM=gM();const Yk="workerdeck.theme";function j1(){try{const e=localStorage.getItem(Yk);if(e==="light"||e==="dark")return e}catch{}return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Gk(e=j1()){document.documentElement.setAttribute("data-theme",e)}function xM(e){try{localStorage.setItem(Yk,e)}catch{}Gk(e)}function yM(){const e=j1()==="dark"?"light":"dark";return xM(e),e}var xc=typeof window<"u"?E.useLayoutEffect:E.useEffect;function b0(e){const t=E.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function EM(e,t,n={},r={}){E.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function vM(e){const t=E.useRef(null);return E.useImperativeHandle(e,()=>t.current,[]),t}const Kk=!1;function Uc(e){return e[e.length-1]}function TM(e){return typeof e=="function"}function Xa(e,t){return TM(e)?e(t):e}const Xk=Object.prototype.hasOwnProperty,H2=Object.prototype.propertyIsEnumerable;function Wk(e){for(const t in e)if(Xk.call(e,t))return!0;return!1}const SM=()=>Object.create(null),za=(e,t)=>Wa(e,t,SM);function Wa(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=$2(e)&&$2(i);if(!a&&!(Ah(e)&&Ah(i)))return i;const l=a?e:U2(e);if(!l)return i;const c=a?i:U2(i);if(!c)return i;const d=l.length,f=c.length,g=a?new Array(f):n();let m=0;for(let b=0;b<f;b++){const x=a?b:c[b],v=e[x],k=i[x];if(v===k){g[x]=v,(a?b<d:Xk.call(e,x))&&m++;continue}if(v===null||k===null||typeof v!="object"||typeof k!="object"){g[x]=k;continue}const w=Wa(v,k,n,r+1);g[x]=w,w===v&&m++}return d===f&&m===d?e:g}function U2(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!H2.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!H2.call(e,i))return!1;r.push(i)}return r}function Ah(e){if(!F2(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!F2(n)||!n.hasOwnProperty("isPrototypeOf"))}function F2(e){return Object.prototype.toString.call(e)==="[object Object]"}function $2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function to(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,i=e.length;r<i;r++)if(!to(e[r],t[r],n))return!1;return!0}if(Ah(e)&&Ah(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!to(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>i||!to(e[l],t[l],n)))return!1;return i===a}return!1}function jl(e){let t,n;const r=new Promise((i,a)=>{t=i,n=a});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Fc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const CM=/[\x00-\x1f\x7f"<>`{}]/g;function wM(e){return e.replace(CM,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function V2(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 wM(t)}const kM=["http:","https:","mailto:","tel:"];function Rh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function rc(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="",i;for(;(i=t.exec(e))!==null;)r+=V2(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+V2(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function NM(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function _M(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 di(){throw new Error("Invariant failed")}function $c(e){const t=new Map;let n,r;const i=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 i(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 c=t.get(a);if(c)c.value=l,i(c);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 ta=4,Qk=5;function AM(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 Zk(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=AM(a);if(l){const[c,d]=l,f=a.charCodeAt(c+1);if(f===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const g=c+3,m=d;if(g<m)return n[0]=3,n[1]=t+c,n[2]=t+g,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const g=c+1,m=c+2;return m===d?(n[0]=2,n[1]=t+c,n[2]=t+g,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function cm(e,t,n,r,i,a,l){l?.(n);let c=r;{const d=n.fullPath??n.from,f=d.length,g=n.options?.caseSensitive??e,m=n.options?.params?.parse??n.options?.parseParams;for(;c<f;){const x=Zk(d,c,t);let v;const k=c,w=x[5];switch(c=w+1,a++,x[0]){case 0:{const S=d.substring(x[2],x[3]);if(g){const N=i.static?.get(S);if(N)v=N;else{i.static??=new Map;const _=Qa(n.fullPath??n.from);_.parent=i,_.depth=a,v=_,i.static.set(S,_)}}else{const N=S.toLowerCase(),_=i.staticInsensitive?.get(N);if(_)v=_;else{i.staticInsensitive??=new Map;const A=Qa(n.fullPath??n.from);A.parent=i,A.depth=a,v=A,i.staticInsensitive.set(N,A)}}break}case 1:{const S=d.substring(k,x[1]),N=d.substring(x[4],w),_=g&&!!(S||N),A=S?_?S:S.toLowerCase():void 0,L=N?_?N:N.toLowerCase():void 0,R=!m&&i.dynamic?.find(D=>!D.parse&&D.caseSensitive===_&&D.prefix===A&&D.suffix===L);if(R)v=R;else{const D=y0(1,n.fullPath??n.from,_,A,L);v=D,D.depth=a,D.parent=i,i.dynamic??=[],i.dynamic.push(D)}break}case 3:{const S=d.substring(k,x[1]),N=d.substring(x[4],w),_=g&&!!(S||N),A=S?_?S:S.toLowerCase():void 0,L=N?_?N:N.toLowerCase():void 0,R=!m&&i.optional?.find(D=>!D.parse&&D.caseSensitive===_&&D.prefix===A&&D.suffix===L);if(R)v=R;else{const D=y0(3,n.fullPath??n.from,_,A,L);v=D,D.parent=i,D.depth=a,i.optional??=[],i.optional.push(D)}break}case 2:{const S=d.substring(k,x[1]),N=d.substring(x[4],w),_=g&&!!(S||N),A=S?_?S:S.toLowerCase():void 0,L=N?_?N:N.toLowerCase():void 0,R=y0(2,n.fullPath??n.from,_,A,L);v=R,R.parent=i,R.depth=a,i.wildcard??=[],i.wildcard.push(R)}}i=v}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=Qa(n.fullPath??n.from);x.kind=Qk,x.parent=i,a++,x.depth=a,i.pathless??=[],i.pathless.push(x),i=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&d.endsWith("/")){const x=Qa(n.fullPath??n.from);x.kind=ta,x.parent=i,a++,x.depth=a,i.index=x,i=x}i.parse=m??null,i.priority=n.options?.params?.priority??0,b&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)cm(e,t,d,c,i,a,l)}function x0(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 Ji(e){if(e.pathless)for(const t of e.pathless)Ji(t);if(e.static)for(const t of e.static.values())Ji(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ji(t);if(e.dynamic?.length){e.dynamic.sort(x0);for(const t of e.dynamic)Ji(t)}if(e.optional?.length){e.optional.sort(x0);for(const t of e.optional)Ji(t)}if(e.wildcard?.length){e.wildcard.sort(x0);for(const t of e.wildcard)Ji(t)}}function Qa(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 y0(e,t,n,r,i){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:i}}function RM(e,t){const n=Qa("/"),r=new Uint16Array(6);for(const i of e)cm(!1,r,i,1,n,0);Ji(n),t.masksTree=n,t.flatCache=$c(1e3)}function OM(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=P1(e,t.masksTree);return t.flatCache.set(e,r),r}function IM(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);return l||(l=Qa("/"),cm(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(a,l)),P1(r,l,n)}function MM(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let a;try{a=P1(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=eN(a.route)),t.matchCache.set(r,a),a}function LM(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function DM(e,t=!1,n){const r=Qa(e.fullPath),i=new Uint16Array(6),a={},l={};let c=0;return cm(t,i,e,1,r,0,d=>{if(n?.(d,c),d.id in a&&di(),a[d.id]=d,c!==0&&d.path){const f=LM(d.fullPath);(!l[f]||d.fullPath.endsWith("/"))&&(l[f]=d)}c++}),Ji(r),{processedTree:{segmentTree:r,singleCache:$c(1e3),matchCache:$c(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function P1(e,t,n=!1){const r=e.split("/"),i=PM(e,r,t,n);if(!i)return null;const[a]=Jk(e,r,i);return{route:i.node.route,rawParams:a}}function Jk(e,t,n){const r=jM(n.node);let i=null;const a=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;l++,c++,d++,f++){const g=r[c];if(g.kind===ta)break;if(g.kind===Qk){f--,l--,d--;continue}const m=t[l],b=d;if(m&&(d+=m.length),g.kind===1){i??=n.node.fullPath.split("/");const x=i[f],v=g.prefix?.length??0;if(x.charCodeAt(v)===123){const k=g.suffix?.length??0,w=x.substring(v+2,x.length-k-1),S=m.substring(v,m.length-k);a[w]=decodeURIComponent(S)}else{const k=x.substring(1);a[k]=decodeURIComponent(m)}}else if(g.kind===3){if(n.skipped&1<<c){l--,d=b-1;continue}i??=n.node.fullPath.split("/");const x=i[f],v=g.prefix?.length??0,k=g.suffix?.length??0,w=x.substring(v+3,x.length-k-1),S=g.suffix||g.prefix?m.substring(v,m.length-k):m;S&&(a[w]=decodeURIComponent(S))}else if(g.kind===2){const x=g,v=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),k=decodeURIComponent(v);a["*"]=k,a._splat=k;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:c,path:d,segment:f}]}function eN(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function jM(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function PM(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Uc(t),a=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,f=null;for(;c.length;){const g=c.pop(),{node:m,index:b,skipped:x,depth:v,statics:k,dynamics:w,optionals:S}=g;let{extract:N,rawParams:_}=g;if(m.kind===2&&m.route&&!Df(f,g))continue;if(m.parse){if(!q2(e,t,g))continue;_=g.rawParams,N=g.extract}r&&m.route&&m.kind!==ta&&Df(d,g)&&(d=g);const A=b===l;if(A&&(m.route&&(!a||m.kind===ta||m.kind===2)&&Df(f,g)&&(f=g),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const L=A?void 0:t[b];let R;if(A&&m.index){const D={node:m.index,index:b,skipped:x,depth:v+1,statics:k,dynamics:w,optionals:S,extract:N,rawParams:_};let I=!0;if(m.index.parse&&(q2(e,t,D)||(I=!1)),I){if(!w&&!S&&!x&&BM(k,l))return D;Df(f,D)&&(f=D)}}if(m.wildcard)for(let D=m.wildcard.length-1;D>=0;D--){const I=m.wildcard[D],{prefix:U,suffix:z}=I;if(!(U&&(A||!(I.caseSensitive?L:R??=L.toLowerCase()).startsWith(U)))){if(z){if(A)continue;const X=t.slice(b).join("/").slice(-z.length);if((I.caseSensitive?X:X.toLowerCase())!==z)continue}c.push({node:I,index:l,skipped:x,depth:v+1,statics:k,dynamics:w,optionals:S,extract:N,rawParams:_})}}if(m.optional){const D=x|1<<v,I=v+1;for(let U=m.optional.length-1;U>=0;U--){const z=m.optional[U];c.push({node:z,index:b,skipped:D,depth:I,statics:k,dynamics:w,optionals:S,extract:N,rawParams:_})}if(!A)for(let U=m.optional.length-1;U>=0;U--){const z=m.optional[U],{prefix:X,suffix:W}=z;if(X||W){const V=z.caseSensitive?L:R??=L.toLowerCase();if(X&&!V.startsWith(X)||W&&!V.endsWith(W))continue}c.push({node:z,index:b+1,skipped:x,depth:I,statics:k,dynamics:w,optionals:S+Lf(l,b),extract:N,rawParams:_})}}if(!A&&m.dynamic&&L)for(let D=m.dynamic.length-1;D>=0;D--){const I=m.dynamic[D],{prefix:U,suffix:z}=I;if(U||z){const X=I.caseSensitive?L:R??=L.toLowerCase();if(U&&!X.startsWith(U)||z&&!X.endsWith(z))continue}c.push({node:I,index:b+1,skipped:x,depth:v+1,statics:k,dynamics:w+Lf(l,b),optionals:S,extract:N,rawParams:_})}if(!A&&m.staticInsensitive){const D=m.staticInsensitive.get(R??=L.toLowerCase());D&&c.push({node:D,index:b+1,skipped:x,depth:v+1,statics:k+Lf(l,b),dynamics:w,optionals:S,extract:N,rawParams:_})}if(!A&&m.static){const D=m.static.get(L);D&&c.push({node:D,index:b+1,skipped:x,depth:v+1,statics:k+Lf(l,b),dynamics:w,optionals:S,extract:N,rawParams:_})}if(m.pathless){const D=v+1;for(let I=m.pathless.length-1;I>=0;I--){const U=m.pathless[I];c.push({node:U,index:b,skipped:x,depth:D,statics:k,dynamics:w,optionals:S,extract:N,rawParams:_})}}}if(f)return f;if(r&&d){let g=d.index;for(let b=0;b<d.index;b++)g+=t[b].length;const m=g===e.length?"/":e.slice(g);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(m),d}return null}function Lf(e,t){return 2**(e-t-1)}function BM(e,t){return e===2**(t-1)-1}function q2(e,t,n){let r,i;try{[r,i]=Jk(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Df(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===ta)>(e.node.kind===ta)||t.node.kind===ta==(e.node.kind===ta)&&t.depth>e.depth))):!0}function ph(e){return B1(e.filter(t=>t!==void 0).join("/"))}function B1(e){return e.replace(/\/{2,}/g,"/")}function tN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ci(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function nN(e){return ci(tN(e))}function Oh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function zM(e,t,n){return Oh(e,n)===Oh(t,n)}function HM({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(r){l=i?t:a?e:e+"\0"+t;const f=r.get(l);if(f)return f}let c;if(a)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&Uc(c)==="";)c.pop();const f=t.split("/");for(let g=0,m=f.length;g<m;g++){const b=f[g];b===""?g?g===m-1&&c.push(b):c=[b]:b===".."?c.pop():b==="."||c.push(b)}}c.length>1&&(Uc(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));const d=B1(c.join("/"))||"/";return l&&r&&r.set(l,d),d}function UM(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,a=>t.get(a)??a)}function E0(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>G2(i,n)).join("/"):G2(r,n)}function Y2({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const l=e.length;let c=0,d,f="";for(;c<l;){const g=c;d=Zk(e,g,d);const m=d[5];if(c=m+1,g===m)continue;const b=d[0];if(b===0){f+="/"+e.substring(g,m);continue}if(b===2){const x=t._splat;a._splat=x,a["*"]=x;const v=e.substring(g,d[1]),k=e.substring(d[4],m);if(!x){i=!0,(v||k)&&(f+="/"+v+k);continue}const w=E0("_splat",t,n);f+="/"+v+w+k;continue}if(b===1){const x=e.substring(d[2],d[3]);!i&&!(x in t)&&(i=!0),a[x]=t[x];const v=e.substring(g,d[1]),k=e.substring(d[4],m),w=E0(x,t,n)??"undefined";f+="/"+v+w+k;continue}if(b===3){const x=e.substring(d[2],d[3]),v=t[x];if(v==null)continue;a[x]=v;const k=e.substring(g,d[1]),w=e.substring(d[4],m),S=E0(x,t,n)??"";f+="/"+k+S+w;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function G2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function or(e){return e?.isNotFound===!0}function FM(){try{return sessionStorage}catch{return}}const $M="tsr-scroll-restoration-v1_3",rN=FM();function VM(){try{return JSON.parse(rN?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function qM(){try{rN?.setItem($M,JSON.stringify(Sl))}catch{}}const Sl=VM(),K2="data-scroll-restoration-id",YM=e=>e.state.__TSR_key||e.href;function GM(e){const t=e.getAttribute(K2);if(t)return`[${K2}="${t}"]`;let n="",r=e,i;for(;i=r.parentNode;){let a=1,l=r;for(;l=l.previousElementSibling;)a++;const c=`${r.localName}:nth-child(${a})`;n=n?`${c} > ${n}`:c,r=i}return n}let jf=!1;const gh="window";function _b(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function X2(e){const t=new Set;for(const n of e){if(n===gh)continue;const r=_b(n);r&&t.add(r)}return t}function KM(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const i=e.options.getScrollRestorationKey||YM,a=new Set,l=c=>{const d=Sl[c]||={};for(const f of a)f===document?d[gh]={scrollX,scrollY}:f.isConnected&&(d[GM(f)]={scrollX:f.scrollLeft,scrollY:f.scrollTop})};n&&!r.restoration&&(r.restoration=!0,jf=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{jf||a.add(c.target)},!0),e.subscribe("onBeforeLoad",c=>{c.fromLocation&&l(i(c.fromLocation)),a.clear()}),addEventListener("pagehide",()=>{l(i(e.stores.resolvedLocation.get()??e.stores.location.get())),qM()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",c=>{const d=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors,g=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=i(c.toLocation),v=c.fromLocation&&i(c.fromLocation);if(r.restoring&&v&&v!==x){const k=Sl[v];if(k){let w=Sl[x];for(const S in k){if(S===gh){if(g)continue}else{const N=_b(S);if(!N||g&&f&&(b??=X2(f),b.has(N)))continue}w||(w=Sl[x]={}),w[S]??=k[S]}}}jf=!0;try{const k=c.toLocation.hash,w=c.toLocation.state.__hashScrollIntoViewOptions??!0;let S=!1;if(g){!k&&f&&(b??=X2(f));const N=k&&w&&m,_=r.restoring?Sl[x]:void 0;if(_)for(const A in _){const{scrollX:L,scrollY:R}=_[A];if(A===gh){if(N)continue;scrollTo({top:R,left:L,behavior:d}),S=!0}else{const D=_b(A);D&&(D.scrollLeft=L,D.scrollTop=R,b?.delete(D))}}if(!k){const A={top:0,left:0,behavior:d};if(S||scrollTo(A),b)for(const L of b)L.scrollTo(A)}}!S&&k&&w&&document.getElementById(k)?.scrollIntoView(w)}finally{jf=!1}}))}function XM(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function v0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function WM(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const a=n[r];a==null?n[r]=v0(i):Array.isArray(a)?a.push(v0(i)):n[r]=[a,v0(i)]}return n}const QM=JM(JSON.parse),ZM=e5(JSON.stringify,JSON.parse);function JM(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=WM(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function e5(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const a=XM(i,r);return a?`?${a}`:""}}const no="__root__";function sN(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 Or(e){return e instanceof Response&&!!e.options}function t5(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=iN(e[n],t);return t}}}function n5(e){const t=nN(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:a})=>{const l=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return l===r?a.pathname="/":l.startsWith(i)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=ph(["/",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 iN(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 r5(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,l=new Map,c=new Map,d=new Map,f=n(e.status),g=n(e.loadedAt),m=n(e.isLoading),b=n(e.isTransitioning),x=n(e.location),v=n(e.resolvedLocation),k=n(e.statusCode),w=n(e.redirect),S=n([]),N=n([]),_=n([]),A=r(()=>T0(l,S.get())),L=r(()=>T0(c,N.get())),R=r(()=>T0(d,_.get())),D=r(()=>S.get()[0]),I=r(()=>S.get().some(G=>l.get(G)?.get().status==="pending")),U=r(()=>({locationHref:x.get().href,resolvedLocationHref:v.get()?.href,status:f.get()})),z=r(()=>({status:f.get(),loadedAt:g.get(),isLoading:m.get(),isTransitioning:b.get(),matches:A.get(),location:x.get(),resolvedLocation:v.get(),statusCode:k.get(),redirect:w.get()})),X=$c(64);function W(G){let Q=X.get(G);return Q||(Q=r(()=>{const le=S.get();for(const M of le){const P=l.get(M);if(P&&P.routeId===G)return P.get()}}),X.set(G,Q)),Q}const V={status:f,loadedAt:g,isLoading:m,isTransitioning:b,location:x,resolvedLocation:v,statusCode:k,redirect:w,matchesId:S,pendingIds:N,cachedIds:_,matches:A,pendingMatches:L,cachedMatches:R,firstId:D,hasPending:I,matchRouteDeps:U,matchStores:l,pendingMatchStores:c,cachedMatchStores:d,__store:z,getRouteMatchStore:W,setMatches:ee,setPending:q,setCached:B};ee(e.matches),a?.(V);function ee(G){S0(G,l,S,n,i)}function q(G){S0(G,c,N,n,i)}function B(G){S0(G,d,_,n,i)}return V}function T0(e,t){const n=[];for(const r of t){const i=e.get(r);i&&n.push(i.get())}return n}function S0(e,t,n,r,i){const a=e.map(c=>c.id),l=new Set(a);i(()=>{for(const c of t.keys())l.has(c)||t.delete(c);for(const c of e){const d=t.get(c.id);if(!d){const f=r(c);f.routeId=c.routeId,t.set(c.id,f);continue}d.routeId=c.routeId,d.get()!==c&&d.set(c)}_M(n.get(),a)||n.set(a)})}const Rb=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},s5=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),dm=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),ro=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},W2=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let l=a;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?a:i},na=(e,t,n)=>{if(!(!Or(n)&&!or(n)))throw Or(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:Or(n)?"redirected":or(n)?"notFound":r.status==="pending"?"success":r.status,context:ro(e,t.index),isFetching:!1,error:n})),or(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Or(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},aN=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Q2=(e,t,n)=>{const r=ro(e,n);e.updateMatch(t,i=>({...i,context:r}))},sc=(e,t,n)=>{const{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,na(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(l){n=l,na(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&&!Or(n)&&!or(n)&&(e.serialError??=n)},oN=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!dm(e,t)&&(n.options.loader||n.options.beforeLoad||uN(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{Rb(e)},i);r._nonReactive.pendingTimeout=a}},i5=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;oN(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&na(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},a5=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=jl(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:c}=i;l&&sc(e,n,l),c&&sc(e,n,c),oN(e,t,r,i);const d=new AbortController;let f=!1;const g=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{g(),m()});return}i._nonReactive.beforeLoadPromise=jl();const b={...ro(e,n,!1),...i.__routeContext},{search:x,params:v,cause:k}=i,w=dm(e,t),S={search:x,abortController:d,params:v,preload:w,context:b,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:w?"preload":k,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},N=A=>{if(A===void 0){e.router.batch(()=>{g(),m()});return}(Or(A)||or(A))&&(g(),sc(e,n,A)),e.router.batch(()=>{g(),e.updateMatch(t,L=>({...L,__beforeLoadContext:A})),m()})};let _;try{if(_=r.options.beforeLoad(S),Fc(_))return g(),_.catch(A=>{sc(e,n,A)}).then(N)}catch(A){g(),sc(e,n,A)}N(_)},o5=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>c(),l=()=>a5(e,n,t,i),c=()=>{if(aN(e,n))return;const d=i5(e,n,i);return Fc(d)?d.then(l):l()};return a()},l5=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,l,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:l,styles:a?.styles}))},lN=(e,t,n,r,i)=>{const a=t[r-1],{params:l,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),g=ro(e,r),m=dm(e,n);return{params:l,deps:c,preload:!!m,parentMatchPromise:a,abortController:d,context:g,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},Z2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(Kk??e.router.isServer)||a.ssr===!0)&&Vc(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,d=c?.(lN(e,t,n,r,i)),f=!!c&&Fc(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),c){const m=f?await d:d;na(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,b=>({...b,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const g=a._nonReactive.minPendingPromise;g&&await g,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:ro(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:ro(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,or(l)&&await i.options.notFoundComponent?.preload?.(),na(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(f){c=f,na(e,e.router.getMatch(n),f)}!Or(c)&&!or(c)&&await Vc(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:ro(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),na(e,l,a)}},u5=async(e,t,n)=>{async function r(x,v,k,w,S){const N=Date.now()-v.updatedAt,_=x?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,A=S.options.shouldReload,L=typeof A=="function"?A(lN(e,t,i,n,S)):A,{status:R,invalid:D}=w,I=N>=_&&(!!e.forceStaleReload||w.cause==="enter"||k!==void 0&&k!==w.id);l=R==="success"&&(D||(L??I)),x&&S.options.preload===!1||(l&&!e.sync&&g?(c=!0,(async()=>{try{await Z2(e,t,i,n,S);const U=e.router.getMatch(i);U._nonReactive.loaderPromise?.resolve(),U._nonReactive.loadPromise?.resolve(),U._nonReactive.loaderPromise=void 0,U._nonReactive.loadPromise=void 0}catch(U){Or(U)&&await e.router.navigate(U.options)}})()):R!=="success"||l?await Z2(e,t,i,n,S):Q2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let l=!1,c=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,g=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(aN(e,i)){if(!e.router.getMatch(i))return e.matches[n];Q2(e,i,n)}else{const x=e.router.getMatch(i),v=e.router.stores.matchesId.get()[n],k=(v&&e.router.stores.matchStores.get(v)||null)?.routeId===a?v:e.router.stores.matches.get().find(S=>S.routeId===a)?.id,w=dm(e,i);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&g)return x;await x._nonReactive.loaderPromise;const S=e.router.getMatch(i),N=S._nonReactive.error||S.error;N&&na(e,S,N),S.status==="pending"&&await r(w,x,k,S,d)}else{const S=w&&!e.router.stores.matchStores.has(i),N=e.router.getMatch(i);N._nonReactive.loaderPromise=jl(),S!==N.preload&&e.updateMatch(i,_=>({..._,preload:S})),await r(w,x,k,N,d)}}const m=e.router.getMatch(i);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const b=c?m.isFetching:!1;return b!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(i)):m};async function J2(e){const t=e,n=[];s5(t.router)&&Rb(t);let r;for(let b=0;b<t.matches.length;b++){try{const x=o5(t,b);Fc(x)&&await x}catch(x){if(Or(x))throw x;if(or(x))r=x;else if(!t.preload)throw x;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?W2(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let c,d;for(let b=0;b<l;b++)n.push(u5(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 v=x.reason;if(Or(v))throw v;or(v)?c??=v:d??=v}if(d!==void 0)throw d}const f=c??(r&&!t.preload?r:void 0);let g=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const b=W2(t,f);b===void 0&&di();const x=t.matches[b],v=t.router.looseRoutesById[x.routeId],k=t.router.options?.defaultNotFoundComponent;!v.options.notFoundComponent&&k&&(v.options.notFoundComponent=k),f.routeId=x.routeId;const w=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,S=>({...S,...w?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),g=b,await Vc(v,["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 Vc(b,["errorComponent"])}for(let b=0;b<=g;b++){const{id:x,routeId:v}=t.matches[b],k=t.router.looseRoutesById[v];try{const w=l5(t,x,k);if(w){const S=await w;t.updateMatch(x,N=>({...N,...S}))}}catch(w){console.error(`Error executing head for route ${v}:`,w)}}const m=Rb(t);if(Fc(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function eS(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Vc(e,t=bh){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...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===bh?(()=>{if(e._componentsPromise===void 0){const r=eS(e,bh);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():eS(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function uN(e){for(const t of bh)if(e.options[t]?.preload)return!0;return!1}const bh=["component","errorComponent","pendingComponent","notFoundComponent"];var ia="__TSR_index",tS="popstate",nS="beforeunload";function c5(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){l();return}const f=e.getBlockers?.()??[],g=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&g)for(const m of f){const b=qc(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,c,d)=>{const f=t.state[ia];c=rS(f+1,c),a({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:c})},replace:(l,c,d)=>{const f=t.state[ia];c=rS(f,c),a({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:c})},go:(l,c)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[ia]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function rS(e,t){t||(t={});const n=z1();return{...t,key:n,__TSR_key:n,[ia]:e}}function cN(e){const t=e?.window??(typeof document<"u"?window:void 0),n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,l=I=>i=I,c=e?.createHref??(I=>I),d=e?.parseLocation??(()=>qc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const I=z1();t.history.replaceState({[ia]:0,key:I,__TSR_key:I},"")}let f=d(),g,m=!1,b=!1,x=!1,v=!1;const k=()=>f;let w,S;const N=()=>{w&&(D._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),D._ignoreSubscribers=!1,w=void 0,S=void 0,g=void 0)},_=(I,U,z)=>{const X=c(U);S||(g=f),f=qc(U,z),w={href:X,state:z,isPush:w?.isPush||I==="push"},S||(S=Promise.resolve().then(()=>N()))},A=I=>{f=d(),D.notify({type:I})},L=async()=>{if(b){b=!1;return}const I=d(),U=I.state[ia]-f.state[ia],z=U===1,X=U===-1,W=!z&&!X||m;m=!1;const V=W?"GO":X?"BACK":"FORWARD",ee=W?{type:"GO",index:U}:{type:X?"BACK":"FORWARD"};if(x)x=!1;else{const q=a();if(typeof document<"u"&&q.length){for(const B of q)if(await B.blockerFn({currentLocation:f,nextLocation:I,action:V})){b=!0,t.history.go(1),D.notify(ee);return}}}f=d(),D.notify(ee)},R=I=>{if(v){v=!1;return}let U=!1;const z=a();if(typeof document<"u"&&z.length)for(const X of z){const W=X.enableBeforeUnload??!0;if(W===!0){U=!0;break}if(typeof W=="function"&&W()===!0){U=!0;break}}if(U)return I.preventDefault(),I.returnValue=""},D=c5({getLocation:k,getLength:()=>t.history.length,pushState:(I,U)=>_("push",I,U),replaceState:(I,U)=>_("replace",I,U),back:I=>(I&&(x=!0),v=!0,t.history.back()),forward:I=>{I&&(x=!0),v=!0,t.history.forward()},go:I=>{m=!0,t.history.go(I)},createHref:I=>c(I),flush:N,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(nS,R,{capture:!0}),t.removeEventListener(tS,L)},onBlocked:()=>{g&&f!==g&&(f=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(nS,R,{capture:!0}),t.addEventListener(tS,L),t.history.pushState=function(...I){const U=n.apply(t.history,I);return D._ignoreSubscribers||A("PUSH"),U},t.history.replaceState=function(...I){const U=r.apply(t.history,I);return D._ignoreSubscribers||A("REPLACE"),U},D}function d5(e){const t=typeof document<"u"?window:void 0;return cN({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",i=t.location.search,a=n.slice(1);return qc(`${r}${i}${a.length===0?"":`#${a.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function f5(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function qc(e,t){const n=f5(e),r=n.indexOf("#"),i=n.indexOf("?"),a=z1();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[ia]:0,key:a,__TSR_key:a}}}function z1(){return(Math.random()+1).toString(36).substring(7)}function Rl(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 h5=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,i=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=UM(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=cN()),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 g;this.resolvePathCache=$c(1e3),g=this.buildRouteTree(),this.setRoutes(g)}if(!this.stores&&this.latestLocation){const g=this.getStoreConfig(this);this.batch=g.batch,this.stores=r5(p5(this.latestLocation),g),KM(this)}let c=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(a||i!==d||l!==f){this.basepath=d;const g=[],m=nN(d);m&&m!=="/"&&g.push(n5({basepath:d})),f&&g.push(f),this.rewrite=g.length===0?void 0:g.length===1?g[0]:t5(g),this.history&&this.updateLatestLocation(),c=!0}c&&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=DM(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&RM(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:d,search:f,hash:g,href:m,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const S=this.options.parseSearch(f),N=this.options.stringifySearch(S);return{href:d+N+g,publicHref:d+N+g,pathname:rc(d).path,external:!1,searchStr:N,search:za(r?.search,S),hash:rc(g.slice(1)).path,state:Wa(r?.state,b)}}const x=new URL(m,this.origin),v=Ab(this.rewrite,x),k=this.options.parseSearch(v.search),w=this.options.stringifySearch(k);return v.search=w,{href:v.href.replace(v.origin,""),publicHref:m,pathname:rc(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:w,search:za(r?.search,k),hash:rc(v.hash.slice(1)).path,state:Wa(r?.state,b)}},a=i(n),{__tempLocation:l,__tempKey:c}=a.state;if(l&&(!c||c===this.tempLocationKey)){const d=i(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)=>HM({base:n,to:r.includes("//")?B1(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>g5({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,c=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.pathname:a.from??c.fullPath,f=a.to?`${a.to}`:void 0,g=c.search,m=Object.assign(Object.create(null),c.params),b=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),x=f?this.resolvePathWithBase(b,f):b,v=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?m:Object.assign(m,Xa(a.params,m)),k=this.routesByPath[ci(x)];let w;if(k)w=this.getRouteBranch(k);else if(x.includes("$"))w=[];else{const X=this.getMatchedRoutes(x);w=X.matchedRoutes,this.options.notFoundRoute&&(!X.foundRoute||X.foundRoute.path!=="/"&&X.routeParams["**"])&&(w=[...w,this.options.notFoundRoute])}if(w.length&&Wk(v))for(const X of w){const W=X.options.params?.stringify??X.options.stringifyParams;if(W)try{Object.assign(v,W(v))}catch{}}const S=n.leaveParams?x:rc(Y2({path:x,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=g;if(n._includeValidateSearch&&this.options.search?.strict){const X={};w.forEach(W=>{if(W.options.validateSearch)try{Object.assign(X,xh(W.options.validateSearch,{...X,...N}))}catch{}}),N=X}N=b5({search:N,dest:a,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),N=za(g,N);const _=this.options.stringifySearch(N),A=a.hash===!0?l.hash:a.hash?Xa(a.hash,l.hash):void 0,L=A?`#${A}`:"";let R=a.state===!0?l.state:a.state?Xa(a.state,l.state):{};R=Wa(l.state,R);const D=`${S}${_}${L}`;let I,U,z=!1;if(this.rewrite){const X=new URL(D,this.origin),W=iN(this.rewrite,X);I=X.href.replace(X.origin,""),W.origin!==this.origin?(U=W.href,z=!0):U=W.pathname+W.search+W.hash}else I=NM(D),U=I;return{publicHref:U,href:I,pathname:S,search:N,searchStr:_,state:R,hash:A??"",external:z,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const c=r(a);let d=l?r(l):void 0;if(!d){const f=Object.create(null);if(this.options.routeMasks){const g=OM(c.pathname,this.processedTree);if(g){Object.assign(f,g.rawParams);const{from:m,params:b,...x}=g.route,v=b===!1||b===null?Object.create(null):(b??!0)===!0?f:Object.assign(f,Xa(b,f));l={from:n.from,...x,params:v},d=r(l)}}}return d&&(c.maskedLocation=d),c};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{let a;const l=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{i.state[m]=this.latestLocation.state[m]});const g=to(i.state,this.latestLocation.state);return f.forEach(m=>{delete i.state[m]}),g},c=ci(this.latestLocation.href)===ci(i.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=jl(()=>{d?.resolve(),d=void 0}),c&&l())this.load();else{let{maskedLocation:f,hashScrollIntoView:g,...m}=i;f&&(m={...f,state:{...f.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=g??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,a=i.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(a?{action:{type:a}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:a,ignoreBlocker:l,href:c,...d}={})=>{if(c){const m=this.history.location.state.__TSR_index,b=qc(c,{__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 f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const g=this.commitLocation({...f,viewTransition:a,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:l});return queueMicrotask(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),g},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:a,...l})=>{let c=!1;if(i)try{new URL(`${i}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(n!==void 0||!i){const f=this.buildLocation({to:n,...l});i=i??f.publicHref,a=a??f.publicHref}const d=!c&&a?a:i;if(Rh(d,this.protocolAllowlist))return;if(!l.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const g of f)if(g?.blockerFn&&await g.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:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(i=>!n.some(a=>a.id===i.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 i,a,l;const c=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const g=this.latestLocation,m=Rl(g,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...m}),this.emit({type:"onBeforeLoad",...m}),await J2({router:this,sync:n?.sync,forceStaleReload:c.href===g.href,matches:this.stores.pendingMatches.get(),location:g,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=null,x=null,v=null,k=null;this.batch(()=>{const w=this.stores.pendingMatches.get(),S=w.length,N=this.stores.matches.get();b=S?N.filter(L=>!this.stores.pendingMatchStores.has(L.id)):null;const _=new Set;for(const L of this.stores.pendingMatchStores.values())L.routeId&&_.add(L.routeId);const A=new Set;for(const L of this.stores.matchStores.values())L.routeId&&A.add(L.routeId);x=S?N.filter(L=>!_.has(L.routeId)):null,v=S?w.filter(L=>!A.has(L.routeId)):null,k=S?w.filter(L=>A.has(L.routeId)):N,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),S&&(this.stores.setMatches(w),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...b.filter(L=>L.status!=="error"&&L.status!=="notFound"&&L.status!=="redirected")]),this.clearExpiredCache())});for(const[w,S]of[[x,"onLeave"],[v,"onEnter"],[k,"onStay"]])if(w)for(const N of w)this.looseRoutesById[N.routeId].options[S]?.(N)})})}})}catch(g){Or(g)?(i=g,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):or(g)&&(a=g);const m=i?i.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(i)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(f=>f.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 i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,l=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(Rl(a,l)):r.types;if(c===!1){n();return}i={update:n,types:c}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.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 c=r(l.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(d=>d.filter(f=>f!==n)):l.set(c)}})},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=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;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 i=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(i);n.options.href=a,n.headers.set("Location",a)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const a=i.pathname+i.search+i.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}if(n.options.href&&!n.options._builtLocation&&Rh(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(i=>!r(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=i=>{const a=this.looseRoutesById[i.routeId];if(!a.options.loader)return!0;const l=(i.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:r})},this.loadRouteChunk=Vc,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let i=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()]),c=i.filter(d=>!l.has(d.id));if(c.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...c])}try{return i=await J2({router:this,matches:i,location:r,preload:!0,updateMatch:(d,f)=>{a.has(d)?i=i.map(g=>g.id===d?f(g):g):this.updateMatch(d,f)}}),i}catch(d){if(Or(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});or(d)||console.error(d);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(i);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(),c=IM(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!c||n.params&&!to(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?to(l.search,a.search,{partial:!0})?c.rawParams:!1:c.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??ZM,parseSearch:e.parseSearch??QM,protocolAllowlist:e.protocolAllowlist??kM}),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=eN(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:i}=n;let{matchedRoutes:a}=n,l=!1;(r?r.path!=="/"&&i["**"]:ci(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const c=l?y5(this.options.notFoundMode,a):void 0,d=new Array(a.length),f=new Map;for(const g of this.stores.matchStores.values())g.routeId&&f.set(g.routeId,g.get());for(let g=0;g<a.length;g++){const m=a[g],b=d[g-1];let x,v,k;{const W=b?.search??e.search,V=b?._strictSearch??void 0;try{const ee=xh(m.options.validateSearch,{...W})??void 0;x={...W,...ee},v={...V,...ee},k=void 0}catch(ee){let q=ee;if(ee instanceof Ih||(q=new Ih(ee.message,{cause:ee})),t?.throwOnError)throw q;x=W,v={},k=q}}const w=m.options.loaderDeps?.({search:x})??"",S=w?JSON.stringify(w):"",{interpolatedPath:N,usedParams:_}=Y2({path:m.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),A=m.id+N+S,L=this.getMatch(A),R=f.get(m.id),D=L?._strictParams??_;let I;if(!L)try{sS(m,D)}catch(W){if(or(W)||Or(W)?I=W:I=new m5(W.message,{cause:W}),t?.throwOnError)throw I}Object.assign(i,D);const U=R?"stay":"enter";let z;if(L)z={...L,cause:U,params:R?.params??i,_strictParams:D,search:za(R?R.search:L.search,x),_strictSearch:v};else{const W=m.options.loader||m.options.beforeLoad||m.lazyFn||uN(m)?"pending":"success";z={id:A,ssr:m.options.ssr,index:g,routeId:m.id,params:R?.params??i,_strictParams:D,pathname:N,updatedAt:Date.now(),search:R?za(R.search,x):x,_strictSearch:v,searchError:void 0,status:W,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:jl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:U,loaderDeps:R?Wa(R.loaderDeps,w):w,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||(z.globalNotFound=c===m.id),z.searchError=k;const X=this.getParentContext(b);z.context={...X,...z.__routeContext,...z.__beforeLoadContext},d[g]=z}for(let g=0;g<d.length;g++){const m=d[g],b=this.looseRoutesById[m.routeId],x=this.getMatch(m.id),v=f.get(m.routeId);if(m.params=v?za(v.params,i):i,!x){const k=d[g-1],w=this.getParentContext(k);if(b.options.context){const S={deps:m.loaderDeps,params:m.params,context:w??{},location:e,navigate:N=>this.navigate({...N,_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={...w,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const t=Uc(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];const{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=Uc(r),l={...e.search};for(const m of r)try{Object.assign(l,xh(m.options.validateSearch,l))}catch{}const c=t&&this.stores.matchStores.get(t)?.get(),d=c&&c.routeId===a.id&&c.pathname===e.pathname;let f;if(d)f=c.params;else{const m=Object.assign(Object.create(null),i);for(const b of r)try{sS(b,m)}catch{}f=m}const g={matchedRoutes:r,fullPath:a.fullPath,search:l,params:f};return this.lightweightCache.set(e,[t,g]),g}},Ih=class extends Error{},m5=class extends Error{};function p5(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function xh(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ih("Async validation not supported");if(n.issues)throw new Ih(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 g5({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=ci(e);let a;const l=MM(i,n,!0);return l&&(a=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[t.__root__],routeParams:r,foundRoute:a}}function b5({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return x5(n)(e,t,r??!1)}function x5(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:f,next:g})=>{const m=g(l.preSearchFilters?l.preSearchFilters.reduce((b,x)=>x(b),f):f);return l.postSearchFilters?l.postSearchFilters.reduce((b,x)=>x(b),m):m};r.push(d)}const c=l.validateSearch;if(c){const d=({search:f,next:g,meta:m})=>{const b=g(f);if(n)try{const x=xh(c,b);if(m&&x)for(const v in x)v in b||(m.defaulted||=new Map).set(v,x[v]);return{...b,...x}}catch{}return b};r.push(d)}}const i=(a,l,c)=>{if(a>=r.length){if(!t.search)return{};if(t.search===!0)return l;const f=Xa(t.search,l);return c&&(c.explicit=f),f}const d=(f,g)=>{if(g){const m=c||{};return{search:i(a+1,f,m),meta:m}}return i(a+1,f,c)};return r[a]({search:l,next:d,meta:c})};return function(l,c,d){return t=c,n=d,i(0,l)}}function y5(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 no}function sS(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 E5="Error preloading route! ☝️";var dN=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=no:this.parentRoute||di();let i=r?no:n?.path;i&&i!=="/"&&(i=tN(i));const a=n?.id||i;let l=r?no:ph([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=ph(["/",l]));const c=l==="__root__"?"/":ph([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=ci(c)},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=>sN({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.")}},v5=class extends dN{constructor(e){super(e)}};function H1(e){const t=e.errorComponent??U1;return h.jsx(T5,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?E.createElement(t,{error:n,reset:r}):e.children})}var T5=class extends E.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 U1({error:e}){const[t,n]=E.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.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"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function S5({children:e,fallback:t=null}){return fN()?h.jsx(Ue.Fragment,{children:e}):h.jsx(Ue.Fragment,{children:t})}function fN(){return Ue.useSyncExternalStore(C5,()=>!0,()=>!1)}function C5(){return()=>{}}var hN=E.createContext(null);function Gr(e){return E.useContext(hN)}var fm=E.createContext(void 0),w5=E.createContext(void 0),mn=(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))(mn||{});function k5({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:l,shallowPropagate:c};function r(f,g,m){const b=g.depsTail;if(b!==void 0&&b.dep===f)return;const x=b!==void 0?b.nextDep:g.deps;if(x!==void 0&&x.dep===f){x.version=m,g.depsTail=x;return}const v=f.subsTail;if(v!==void 0&&v.version===m&&v.sub===g)return;const k=g.depsTail=f.subsTail={version:m,dep:f,sub:g,prevDep:b,nextDep:x,prevSub:v,nextSub:void 0};x!==void 0&&(x.prevDep=k),b!==void 0?b.nextDep=k:g.deps=k,v!==void 0?v.nextSub=k:f.subs=k}function i(f,g=f.sub){const m=f.dep,b=f.prevDep,x=f.nextDep,v=f.nextSub,k=f.prevSub;return x!==void 0?x.prevDep=b:g.depsTail=b,b!==void 0?b.nextDep=x:g.deps=x,v!==void 0?v.prevSub=k:m.subsTail=k,k!==void 0?k.nextSub=v:(m.subs=v)===void 0&&n(m),x}function a(f){let g=f.nextSub,m;e:do{const b=f.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(f,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 v=b.subs;if(v!==void 0){const k=(f=v).nextSub;k!==void 0&&(m={value:g,prev:m},g=k);continue}}if((f=g)!==void 0){g=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){g=f.nextSub;continue e}break}while(!0)}function l(f,g){let m,b=0,x=!1;e:do{const v=f.dep,k=v.flags;if(g.flags&16)x=!0;else if((k&17)===17){if(e(v)){const w=v.subs;w.nextSub!==void 0&&c(w),x=!0}}else if((k&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=v.deps,g=v,++b;continue}if(!x){const w=f.nextDep;if(w!==void 0){f=w;continue}}for(;b--;){const w=g.subs,S=w.nextSub!==void 0;if(S?(f=m.value,m=m.prev):f=w,x){if(e(g)){S&&c(w),g=f.sub;continue}x=!1}else g.flags&=-33;g=f.sub;const N=f.nextDep;if(N!==void 0){f=N;continue e}}return x}while(!0)}function c(f){do{const g=f.sub,m=g.flags;(m&48)===32&&(g.flags=m|16,(m&6)===2&&t(g))}while((f=f.nextSub)!==void 0)}function d(f,g){let m=g.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}function N5(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const Ob=[];let yh=0;const{link:iS,unlink:_5,propagate:A5,checkDirty:mN,shallowPropagate:aS}=k5({update(e){return e._update()},notify(e){Ob[Ib++]=e,e.flags&=~mn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=mn.Mutable|mn.Dirty,Mh(e))}});let Pf=0,Ib=0,_s,Mb=0;function pN(e){try{++Mb,e()}finally{--Mb||gN()}}function Mh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=_5(n,e)}function gN(){if(!(Mb>0)){for(;Pf<Ib;){const e=Ob[Pf];Ob[Pf++]=void 0,e.notify()}Pf=0,Ib=0}}function oS(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?mn.None:mn.Mutable,get(){return _s!==void 0&&iS(i,_s,yh),i._snapshot},subscribe(a){const l=N5(a),c={current:!1},d=R5(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=_s,c=t?.compare??Object.is;if(n)_s=i,++yh,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=mn.Mutable|mn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!c(d,f)?(i._snapshot=f,!0):!1}finally{_s=l,n&&(i.flags&=~mn.RecursedCheck),Mh(i)}}};return n?(i.flags=mn.Mutable|mn.Dirty,i.get=function(){const a=i.flags;if(a&mn.Dirty||a&mn.Pending&&mN(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&aS(l)}}else a&mn.Pending&&(i.flags=a&~mn.Pending);return _s!==void 0&&iS(i,_s,yh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(A5(l),aS(l),gN())}},i}function R5(e){const t=()=>{const r=_s;_s=n,++yh,n.depsTail=void 0,n.flags=mn.Watching|mn.RecursedCheck;try{return e()}finally{_s=r,n.flags&=~mn.RecursedCheck,Mh(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:mn.Watching|mn.RecursedCheck,notify(){const r=this.flags;r&mn.Dirty||r&mn.Pending&&mN(this.deps,this)?t():this.flags=mn.Watching},stop(){this.flags=mn.None,this.depsTail=void 0,Mh(this)}};return t(),n}var C0={exports:{}},w0={},k0={exports:{}},N0={};/**
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 lS;function O5(){if(lS)return N0;lS=1;var e=rd();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,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(m,b){var x=b(),v=r({inst:{value:x,getSnapshot:b}}),k=v[0].inst,w=v[1];return a(function(){k.value=x,k.getSnapshot=b,d(k)&&w({inst:k})},[m,x,b]),i(function(){return d(k)&&w({inst:k}),m(function(){d(k)&&w({inst:k})})},[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 f(m,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return N0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,N0}var uS;function bN(){return uS||(uS=1,k0.exports=O5()),k0.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 cS;function I5(){if(cS)return w0;cS=1;var e=rd(),t=bN();function n(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,d=e.useDebugValue;return w0.useSyncExternalStoreWithSelector=function(f,g,m,b,x){var v=a(null);if(v.current===null){var k={hasValue:!1,value:null};v.current=k}else k=v.current;v=c(function(){function S(R){if(!N){if(N=!0,_=R,R=b(R),x!==void 0&&k.hasValue){var D=k.value;if(x(D,R))return A=D}return A=R}if(D=A,r(_,R))return D;var I=b(R);return x!==void 0&&x(D,I)?(_=R,D):(_=R,A=I)}var N=!1,_,A,L=m===void 0?null:m;return[function(){return S(g())},L===null?void 0:function(){return S(L())}]},[g,m,b,x]);var w=i(f,v[0],v[1]);return l(function(){k.hasValue=!0,k.value=w},[w]),d(w),w},w0}var dS;function M5(){return dS||(dS=1,C0.exports=I5()),C0.exports}var xN=M5();function L5(e,t){return e===t}function br(e,t,n=L5){const r=E.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=E.useCallback(()=>e?.get(),[e]);return xN.useSyncExternalStoreWithSelector(r,i,i,t,n)}var _0={get(){},subscribe(){return{unsubscribe(){}}}};function yN(e,t){const n=E.useRef();return r=>{const i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Wa(n.current,i):i}}function To(e){const t=Gr(),n=E.useContext(e.from?w5:fm),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=yN(e,t),a=br(r??_0,l=>l?i(l):_0);if(a!==_0)return a;(e.shouldThrow??!0)&&di()}function EN(e){return To({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function vN(e){const{select:t,...n}=e;return To({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function hm(e){return To({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 TN(e){return To({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Xl(e){const t=Gr();return E.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function SN(e){return To({...e,select:t=>e.select?e.select(t.context):t.context})}var lr=qk();const D5=um(lr);function j5(e,t){const n=Gr(),r=vM(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:c,preload:d,preloadDelay:f,preloadIntentProximity:g,hashScrollIntoView:m,replace:b,startTransition:x,resetScroll:v,viewTransition:k,children:w,target:S,disabled:N,style:_,className:A,onClick:L,onBlur:R,onFocus:D,onMouseEnter:I,onMouseLeave:U,onTouchStart:z,ignoreBlocker:X,params:W,search:V,hash:ee,state:q,mask:B,reloadDocument:G,unsafeRelative:Q,from:le,_fromLocation:M,...P}=e,F=fN(),j=E.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ae=br(n.stores.location,re=>re,(re,K)=>re.href===K.href),ie=E.useMemo(()=>{const re={_fromLocation:ae,...j};return n.buildLocation(re)},[n,ae,j]),ce=ie.maskedLocation?ie.maskedLocation.publicHref:ie.publicHref,de=ie.maskedLocation?ie.maskedLocation.external:ie.external,fe=E.useMemo(()=>F5(ce,de,n.history,N),[N,de,ce,n.history]),ve=E.useMemo(()=>{if(fe?.external)return Rh(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!$5(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Rh(c,n.protocolAllowlist)?void 0:c}catch{}},[c,fe,n.protocolAllowlist]),Fe=E.useMemo(()=>{if(ve)return!1;if(l?.exact){if(!zM(ae.pathname,ie.pathname,n.basepath))return!1}else{const re=Oh(ae.pathname,n.basepath),K=Oh(ie.pathname,n.basepath);if(!(re.startsWith(K)&&(re.length===K.length||re[K.length]==="/")))return!1}return(l?.includeSearch??!0)&&!to(ae.search,ie.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?F&&ae.hash===ie.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,ae,ve,F,ie.hash,ie.pathname,ie.search,n.basepath]),Le=Fe?Xa(i,{})??P5:A0,Ee=Fe?A0:Xa(a,{})??A0,Oe=[A,Le.className,Ee.className].filter(Boolean).join(" "),ze=(_||Le.style||Ee.style)&&{..._,...Le.style,...Ee.style},[Ge,$e]=E.useState(!1),De=E.useRef(!1),ke=e.reloadDocument||ve?!1:d??n.options.defaultPreload,ye=f??n.options.defaultPreloadDelay??0,Ie=E.useCallback(()=>{n.preloadRoute({...j,_builtLocation:ie}).catch(re=>{console.warn(re),console.warn(E5)})},[n,j,ie]);EM(r,E.useCallback(re=>{re?.isIntersecting&&Ie()},[Ie]),U5,{disabled:!!N||ke!=="viewport"}),E.useEffect(()=>{De.current||!N&&ke==="render"&&(Ie(),De.current=!0)},[N,Ie,ke]);const je=re=>{const K=re.currentTarget.getAttribute("target"),$=S!==void 0?S:K;if(!N&&!V5(re)&&!re.defaultPrevented&&(!$||$==="_self")&&re.button===0){re.preventDefault(),lr.flushSync(()=>{$e(!0)});const oe=n.subscribe("onResolved",()=>{oe(),$e(!1)});n.navigate({...j,replace:b,resetScroll:v,hashScrollIntoView:m,startTransition:x,viewTransition:k,ignoreBlocker:X})}};if(ve)return{...P,ref:r,href:ve,...w&&{children:w},...S&&{target:S},...N&&{disabled:N},..._&&{style:_},...A&&{className:A},...L&&{onClick:L},...R&&{onBlur:R},...D&&{onFocus:D},...I&&{onMouseEnter:I},...U&&{onMouseLeave:U},...z&&{onTouchStart:z}};const te=re=>{if(N||ke!=="intent")return;if(!ye){Ie();return}const K=re.currentTarget;if(ic.has(K))return;const $=setTimeout(()=>{ic.delete(K),Ie()},ye);ic.set(K,$)},me=re=>{N||ke!=="intent"||Ie()},Z=re=>{if(N||!ke||!ye)return;const K=re.currentTarget,$=ic.get(K);$&&(clearTimeout($),ic.delete(K))};return{...P,...Le,...Ee,href:fe?.href,ref:r,onClick:bl([L,je]),onBlur:bl([R,Z]),onFocus:bl([D,te]),onMouseEnter:bl([I,te]),onMouseLeave:bl([U,Z]),onTouchStart:bl([z,me]),disabled:!!N,target:S,...ze&&{style:ze},...Oe&&{className:Oe},...N&&B5,...Fe&&z5,...F&&Ge&&H5}}var A0={},P5={className:"active"},B5={role:"link","aria-disabled":!0},z5={"data-status":"active","aria-current":"page"},H5={"data-transitioning":"transitioning"},ic=new WeakMap,U5={rootMargin:"100px"},bl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function F5(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function $5(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var sd=E.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=j5(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return E.createElement("a",d,l)}return E.createElement(n,a,l)});function V5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var q5=class extends dN{constructor(e){super(e),this.useMatch=t=>To({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>SN({...t,from:this.id}),this.useSearch=t=>TN({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>hm({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>vN({...t,from:this.id}),this.useLoaderData=t=>EN({...t,from:this.id}),this.useNavigate=()=>Xl({from:this.fullPath}),this.Link=Ue.forwardRef((t,n)=>h.jsx(sd,{ref:n,from:this.fullPath,...t}))}};function So(e){return new q5(e)}var Y5=class extends v5{constructor(e){super(e),this.useMatch=t=>To({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>SN({...t,from:this.id}),this.useSearch=t=>TN({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>hm({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>vN({...t,from:this.id}),this.useLoaderData=t=>EN({...t,from:this.id}),this.useNavigate=()=>Xl({from:this.fullPath}),this.Link=Ue.forwardRef((t,n)=>h.jsx(sd,{ref:n,from:this.fullPath,...t}))}};function G5(e){return new Y5(e)}function K5(e){const t=Gr(),n=`not-found-${br(t.stores.location,r=>r.pathname)}-${br(t.stores.status,r=>r)}`;return h.jsx(H1,{getResetKey:()=>n,onCatch:(r,i)=>{if(or(r))e.onCatch?.(r,i);else throw r},errorComponent:({error:r})=>{if(or(r))return e.fallback?.(r);throw r},children:e.children})}function X5(){return h.jsx("p",{children:"Not Found"})}function Cl(e){return h.jsx(h.Fragment,{children:e.children})}function CN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(X5,{})}function W5(e){return null}function Q5(){return W5(Gr()),null}var Z5=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,J5=(e,t)=>e[0]===t[0]&&e[1]===t[1],wN=E.memo(function({matchId:t}){const n=Gr(),r=n.stores.matchStores.get(t);r||di();const i=br(n.stores.loadedAt,l=>l),a=br(r,l=>l,Z5);return h.jsx(eL,{router:n,matchId:t,resetKey:i,matchState:E.useMemo(()=>{const l=a.routeId,c=n.routesById[l].parentRoute?.id;return{routeId:l,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:c}},[a._displayPending,a.routeId,a.ssr,n.routesById])})});function eL({router:e,matchId:t,resetKey:n,matchState:r}){const i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,l=a?h.jsx(a,{}):null,c=i.options.errorComponent??e.options.defaultErrorComponent,d=i.options.onCatch??e.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,g=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||g)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||g))?E.Suspense:Cl,b=c?H1:Cl,x=f?K5:Cl;return h.jsxs(i.isRoot?i.options.shellComponent??Cl:Cl,{children:[h.jsx(fm.Provider,{value:t,children:h.jsx(m,{fallback:l,children:h.jsx(b,{getResetKey:()=>n,errorComponent:c||U1,onCatch:(v,k)=>{if(or(v))throw v.routeId??=r.routeId,v;d?.(v,k)},children:h.jsx(x,{fallback:v=>{if(v.routeId??=r.routeId,!f||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!i.isRoot)throw v;return E.createElement(f,v)},children:g||r._displayPending?h.jsx(S5,{fallback:l,children:h.jsx(fS,{matchId:t})}):h.jsx(fS,{matchId:t})})})})}),r.parentRouteId===no?h.jsxs(h.Fragment,{children:[h.jsx(tL,{}),e.options.scrollRestoration&&Kk?h.jsx(Q5,{}):null]}):null]})}function tL(){const e=Gr(),t=E.useRef();return xc(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...Rl(e.stores.location.get(),r??n)}),t.current=n},[br(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var fS=E.memo(function({matchId:t}){const n=Gr(),r=(g,m)=>n.getMatch(g.id)?._nonReactive[m]??g._nonReactive[m],i=n.stores.matchStores.get(t);i||di();const a=br(i,g=>g),l=a.routeId,c=n.routesById[l],d=E.useMemo(()=>{const g=(n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:l,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return g?JSON.stringify(g):void 0},[l,a.loaderDeps,a._strictParams,a._strictSearch,n.options.defaultRemountDeps,n.routesById]),f=E.useMemo(()=>{const g=c.options.component??n.options.defaultComponent;return g?h.jsx(g,{},d):h.jsx(kN,{})},[d,c.options.component,n.options.defaultComponent]);if(a._displayPending)throw r(a,"displayPendingPromise");if(a._forcePending)throw r(a,"minPendingPromise");if(a.status==="pending"){const g=c.options.pendingMinMs??n.options.defaultPendingMinMs;if(g){const m=n.getMatch(a.id);if(m&&!m._nonReactive.minPendingPromise){const b=jl();m._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),m._nonReactive.minPendingPromise=void 0},g)}}throw r(a,"loadPromise")}if(a.status==="notFound")return or(a.error)||di(),CN(n,c,a.error);if(a.status==="redirected")throw Or(a.error)||di(),r(a,"loadPromise");if(a.status==="error")throw a.error;return f}),kN=E.memo(function(){const t=Gr(),n=E.useContext(fm);let r,i=!1,a;{const f=n?t.stores.matchStores.get(n):void 0;[r,i]=br(f,g=>[g?.routeId,g?.globalNotFound??!1],J5),a=br(t.stores.matchesId,g=>g[g.findIndex(m=>m===n)+1])}const l=r?t.routesById[r]:void 0,c=t.options.defaultPendingComponent?h.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||di(),CN(t,l,void 0);if(!a)return null;const d=h.jsx(wN,{matchId:a});return r===no?h.jsx(E.Suspense,{fallback:c,children:d}):d});function nL(){const e=Gr(),t=E.useRef({router:e,mounted:!1}),[n,r]=E.useState(!1),i=br(e.stores.isLoading,m=>m),a=br(e.stores.hasPending,m=>m),l=b0(i),c=i||n||a,d=b0(c),f=i||a,g=b0(f);return e.startTransition=m=>{r(!0),E.startTransition(()=>{m(),r(!1)})},E.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 ci(e.latestLocation.publicHref)!==ci(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{m()}},[e,e.history]),xc(()=>{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]),xc(()=>{l&&!i&&e.emit({type:"onLoad",...Rl(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),xc(()=>{g&&!f&&e.emit({type:"onBeforeRouteMount",...Rl(e.stores.location.get(),e.stores.resolvedLocation.get())})},[f,g,e]),xc(()=>{if(d&&!c){const m=Rl(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...m}),pN(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[c,d,e]),null}function rL(){const e=Gr(),t=e.routesById[no].options.pendingComponent??e.options.defaultPendingComponent,n=t?h.jsx(t,{}):null,r=h.jsxs(typeof document<"u"&&e.ssr?Cl:E.Suspense,{fallback:n,children:[h.jsx(nL,{}),h.jsx(sL,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:r}):r}function sL(){const e=Gr(),t=br(e.stores.firstId,i=>i),n=br(e.stores.loadedAt,i=>i),r=t?h.jsx(wN,{matchId:t}):null;return h.jsx(fm.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:h.jsx(H1,{getResetKey:()=>n,errorComponent:U1,onCatch:void 0,children:r})})}var iL=e=>({createMutableStore:oS,createReadonlyStore:oS,batch:pN}),aL=e=>new oL(e),oL=class extends h5{constructor(e){super(e,iL)}};function lL({router:e,children:t,...n}){Wk(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=h.jsx(hN.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:r}):r}function uL({router:e,...t}){return h.jsx(lL,{router:e,...t,children:h.jsx(rL,{})})}function cL(e){const t=Gr({warn:e?.router===void 0}),n=e?.router||t;return br(n.stores.__store,yN(e,n))}function NN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=NN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mm(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=NN(e))&&(r&&(r+=" "),r+=t);return r}const hS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mS=mm,_N=(e,t)=>n=>{var r;if(t?.variants==null)return mS(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(f=>{const g=n?.[f],m=a?.[f];if(g===null)return null;const b=hS(g)||hS(m);return i[f][b]}),c=n&&Object.entries(n).reduce((f,g)=>{let[m,b]=g;return b===void 0||(f[m]=b),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,g)=>{let{class:m,className:b,...x}=g;return Object.entries(x).every(v=>{let[k,w]=v;return Array.isArray(w)?w.includes({...a,...c}[k]):{...a,...c}[k]===w})?[...f,m,b]:f},[]);return mS(e,l,d,n?.class,n?.className)},dL=(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},fL=(e,t)=>({classGroupId:e,validator:t}),AN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lh="-",pS=[],hL="arbitrary..",mL=e=>{const t=gL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return pL(l);const c=l.split(Lh),d=c[0]===""&&c.length>1?1:0;return RN(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?dL(f,d):d:f||pS}return n[l]||pS}}},RN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=RN(e,t+1,a);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(Lh):e.slice(t).join(Lh),d=l.length;for(let f=0;f<d;f++){const g=l[f];if(g.validator(c))return g.classGroupId}},pL=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?hL+r:void 0})(),gL=e=>{const{theme:t,classGroups:n}=e;return bL(n,t)},bL=(e,t)=>{const n=AN();for(const r in e){const i=e[r];F1(i,n,r,t)}return n},F1=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];xL(l,t,n,r)}},xL=(e,t,n,r)=>{if(typeof e=="string"){yL(e,t,n);return}if(typeof e=="function"){EL(e,t,n,r);return}vL(e,t,n,r)},yL=(e,t,n)=>{const r=e===""?t:ON(t,e);r.classGroupId=n},EL=(e,t,n,r)=>{if(TL(e)){F1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(fL(n,e))},vL=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[c,d]=i[l];F1(d,ON(t,c),n,r)}},ON=(e,t)=>{let n=e;const r=t.split(Lh),i=r.length;for(let a=0;a<i;a++){const l=r[a];let c=n.nextPart.get(l);c||(c=AN(),n.nextPart.set(l,c)),n=c}return n},TL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,SL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(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 i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},Lb="!",gS=":",CL=[],bS=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),wL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let l=0,c=0,d=0,f;const g=i.length;for(let k=0;k<g;k++){const w=i[k];if(l===0&&c===0){if(w===gS){a.push(i.slice(d,k)),d=k+1;continue}if(w==="/"){f=k;continue}}w==="["?l++:w==="]"?l--:w==="("?c++:w===")"&&c--}const m=a.length===0?i:i.slice(d);let b=m,x=!1;m.endsWith(Lb)?(b=m.slice(0,-1),x=!0):m.startsWith(Lb)&&(b=m.slice(1),x=!0);const v=f&&f>d?f-d:void 0;return bS(a,x,b,v)};if(t){const i=t+gS,a=r;r=l=>l.startsWith(i)?a(l.slice(i.length)):bS(CL,!1,l,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},kL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const l=n[a],c=l[0]==="[",d=t.has(l);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},NL=e=>({cache:SL(e.cacheSize),parseClassName:wL(e),sortModifiers:kL(e),postfixLookupClassGroupIds:_L(e),...mL(e)}),_L=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},AL=/\s+/,RL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:l}=t,c=[],d=e.trim().split(AL);let f="";for(let g=d.length-1;g>=0;g-=1){const m=d[g],{isExternal:b,modifiers:x,hasImportantModifier:v,baseClassName:k,maybePostfixModifierPosition:w}=n(m);if(b){f=m+(f.length>0?" "+f:f);continue}let S=!!w,N;if(S){const D=k.substring(0,w);N=r(D);const I=N&&l[N]?r(k):void 0;I&&I!==N&&(N=I,S=!1)}else N=r(k);if(!N){if(!S){f=m+(f.length>0?" "+f:f);continue}if(N=r(k),!N){f=m+(f.length>0?" "+f:f);continue}S=!1}const _=x.length===0?"":x.length===1?x[0]:a(x).join(":"),A=v?_+Lb:_,L=A+N;if(c.indexOf(L)>-1)continue;c.push(L);const R=i(N,S);for(let D=0;D<R.length;++D){const I=R[D];c.push(A+I)}f=m+(f.length>0?" "+f:f)}return f},OL=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=IN(n))&&(i&&(i+=" "),i+=r);return i},IN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=IN(e[r]))&&(n&&(n+=" "),n+=t);return n},Db=(e,...t)=>{let n,r,i,a;const l=d=>{const f=t.reduce((g,m)=>m(g),e());return n=NL(f),r=n.cache.get,i=n.cache.set,a=c,c(d)},c=d=>{const f=r(d);if(f)return f;const g=RL(d,n);return i(d,g),g};return a=l,(...d)=>a(OL(...d))},IL=[],Pn=e=>{const t=n=>n[e]||IL;return t.isThemeGetter=!0,t},MN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,LN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ML=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,LL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DL=/\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$/,jL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,PL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qi=e=>ML.test(e),vt=e=>!!e&&!Number.isNaN(Number(e)),Cs=e=>!!e&&Number.isInteger(Number(e)),R0=e=>e.endsWith("%")&&vt(e.slice(0,-1)),ii=e=>LL.test(e),DN=()=>!0,zL=e=>DL.test(e)&&!jL.test(e),$1=()=>!1,HL=e=>PL.test(e),UL=e=>BL.test(e),FL=e=>!We(e)&&!Qe(e),$L=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)),VL=e=>fa(e,BN,$1),We=e=>MN.test(e),Ha=e=>fa(e,zN,zL),xS=e=>fa(e,ZL,vt),qL=e=>fa(e,UN,DN),YL=e=>fa(e,HN,$1),yS=e=>fa(e,jN,$1),GL=e=>fa(e,PN,UL),Bf=e=>fa(e,FN,HL),Qe=e=>LN.test(e),ac=e=>Co(e,zN),KL=e=>Co(e,HN),ES=e=>Co(e,jN),XL=e=>Co(e,BN),WL=e=>Co(e,PN),zf=e=>Co(e,FN,!0),QL=e=>Co(e,UN,!0),fa=(e,t,n)=>{const r=MN.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Co=(e,t,n=!1)=>{const r=LN.exec(e);return r?r[1]?t(r[1]):n:!1},jN=e=>e==="position"||e==="percentage",PN=e=>e==="image"||e==="url",BN=e=>e==="length"||e==="size"||e==="bg-size",zN=e=>e==="length",ZL=e=>e==="number",HN=e=>e==="family-name",UN=e=>e==="number"||e==="weight",FN=e=>e==="shadow",jb=()=>{const e=Pn("color"),t=Pn("font"),n=Pn("text"),r=Pn("font-weight"),i=Pn("tracking"),a=Pn("leading"),l=Pn("breakpoint"),c=Pn("container"),d=Pn("spacing"),f=Pn("radius"),g=Pn("shadow"),m=Pn("inset-shadow"),b=Pn("text-shadow"),x=Pn("drop-shadow"),v=Pn("blur"),k=Pn("perspective"),w=Pn("aspect"),S=Pn("ease"),N=Pn("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...A(),Qe,We],R=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],I=()=>[Qe,We,d],U=()=>[qi,"full","auto",...I()],z=()=>[Cs,"none","subgrid",Qe,We],X=()=>["auto",{span:["full",Cs,Qe,We]},Cs,Qe,We],W=()=>[Cs,"auto",Qe,We],V=()=>["auto","min","max","fr",Qe,We],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...I()],G=()=>[qi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],Q=()=>[qi,"screen","full","dvw","lvw","svw","min","max","fit",...I()],le=()=>[qi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],M=()=>[e,Qe,We],P=()=>[...A(),ES,yS,{position:[Qe,We]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",XL,VL,{size:[Qe,We]}],ae=()=>[R0,ac,Ha],ie=()=>["","none","full",f,Qe,We],ce=()=>["",vt,ac,Ha],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"],ve=()=>[vt,R0,ES,yS],Fe=()=>["","none",v,Qe,We],Le=()=>["none",vt,Qe,We],Ee=()=>["none",vt,Qe,We],Oe=()=>[vt,Qe,We],ze=()=>[qi,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ii],breakpoint:[ii],color:[DN],container:[ii],"drop-shadow":[ii],ease:["in","out","in-out"],font:[FL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ii],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ii],shadow:[ii],spacing:["px",vt],text:[ii],"text-shadow":[ii],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qi,We,Qe,w]}],container:["container"],"container-type":[{"@container":["","normal","size",Qe,We]}],"container-named":[$L],columns:[{columns:[vt,We,Qe,c]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:L()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{"inset-s":U(),start:U()}],end:[{"inset-e":U(),end:U()}],"inset-bs":[{"inset-bs":U()}],"inset-be":[{"inset-be":U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[Cs,"auto",Qe,We]}],basis:[{basis:[qi,"full","auto",c,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,qi,"auto","initial","none",We]}],grow:[{grow:["",vt,Qe,We]}],shrink:[{shrink:["",vt,Qe,We]}],order:[{order:[Cs,"first","last","none",Qe,We]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...le()]}],"min-block-size":[{"min-block":["auto",...le()]}],"max-block-size":[{"max-block":["none",...le()]}],w:[{w:[c,"screen",...G()]}],"min-w":[{"min-w":[c,"screen","none",...G()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,ac,Ha]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,QL,qL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",R0,We]}],"font-family":[{font:[KL,YL,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:[i,Qe,We]}],"line-clamp":[{"line-clamp":[vt,"none",Qe,xS]}],leading:[{leading:[a,...I()]}],"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:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",Qe,Ha]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[vt,"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:I()}],"tab-size":[{tab:[Cs,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:F()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Cs,Qe,We],radial:["",Qe,We],conic:[Cs,Qe,We]},WL,GL]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"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:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,Qe,We]}],"outline-w":[{outline:["",vt,ac,Ha]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",g,zf,Bf]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",m,zf,Bf]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[vt,Ha]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",b,zf,Bf]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[vt,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":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Qe,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Qe,We]}],filter:[{filter:["","none",Qe,We]}],blur:[{blur:Fe()}],brightness:[{brightness:[vt,Qe,We]}],contrast:[{contrast:[vt,Qe,We]}],"drop-shadow":[{"drop-shadow":["","none",x,zf,Bf]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",vt,Qe,We]}],"hue-rotate":[{"hue-rotate":[vt,Qe,We]}],invert:[{invert:["",vt,Qe,We]}],saturate:[{saturate:[vt,Qe,We]}],sepia:[{sepia:["",vt,Qe,We]}],"backdrop-filter":[{"backdrop-filter":["","none",Qe,We]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[vt,Qe,We]}],"backdrop-contrast":[{"backdrop-contrast":[vt,Qe,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,Qe,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,Qe,We]}],"backdrop-invert":[{"backdrop-invert":["",vt,Qe,We]}],"backdrop-opacity":[{"backdrop-opacity":[vt,Qe,We]}],"backdrop-saturate":[{"backdrop-saturate":[vt,Qe,We]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,Qe,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"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:[vt,"initial",Qe,We]}],ease:[{ease:["linear","initial",S,Qe,We]}],delay:[{delay:[vt,Qe,We]}],animate:[{animate:["none",N,Qe,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Qe,We]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],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:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],zoom:[{zoom:[Cs,Qe,We]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"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":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",...M()]}],"stroke-w":[{stroke:[vt,ac,Ha,xS]}],stroke:[{stroke:["none",...M()]}],"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"]}},JL=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(wl(e,"cacheSize",t),wl(e,"prefix",n),wl(e,"experimentalParseClassName",r),Hf(e.theme,a.theme),Hf(e.classGroups,a.classGroups),Hf(e.conflictingClassGroups,a.conflictingClassGroups),Hf(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),wl(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),wl(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),Uf(e.theme,i.theme),Uf(e.classGroups,i.classGroups),Uf(e.conflictingClassGroups,i.conflictingClassGroups),Uf(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Pb(e,i,"postfixLookupClassGroups"),Pb(e,i,"orderSensitiveModifiers"),e),wl=(e,t,n)=>{n!==void 0&&(e[t]=n)},Hf=(e,t)=>{if(t)for(const n in t)wl(e,n,t[n])},Uf=(e,t)=>{if(t)for(const n in t)Pb(e,t,n)},Pb=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},eD=(e,...t)=>typeof e=="function"?Db(jb,e,...t):Db(()=>JL(jb(),e),...t),$N=Db(jb),tD=eD({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 Se(...e){return tD(mm(e))}const nD=_N("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"}}),at=E.forwardRef(({className:e,variant:t="default",size:n="default",type:r="button",...i},a)=>h.jsx("button",{ref:a,type:r,"data-slot":"button",className:Se(nD({variant:t,size:n,className:e})),...i}));at.displayName="Button";const rD=_N("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:i,...a}){return h.jsxs("span",{"data-slot":"badge",className:Se(rD({variant:t,mono:n,className:e})),...a,children:[r?h.jsx("span",{"aria-hidden":!0,className:"size-1.5 rounded-full bg-current"}):null,i]})}function Ms({className:e,...t}){return h.jsx("div",{"data-slot":"card",className:Se("rounded-lg border border-border bg-surface",e),...t})}function Ls({className:e,...t}){return h.jsx("div",{className:Se("flex items-start justify-between gap-3 px-4 pt-3.5 pb-3",e),...t})}function Ds({className:e,...t}){return h.jsx("h3",{className:Se("text-heading-3 font-semibold text-text",e),...t})}function js({className:e,...t}){return h.jsx("div",{className:Se("px-4 pb-4",e),...t})}const un=E.forwardRef(({className:e,...t},n)=>h.jsx("input",{ref:n,"data-slot":"input",className:Se("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}));un.displayName="Input";const V1=E.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{ref:n,"data-slot":"textarea",className:Se("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}));V1.displayName="Textarea";const VN={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},qN={...VN,position:"fixed",top:0,left:0},sD={...VN,position:"absolute"},vS={};function xr(e,t){const n=E.useRef(vS);return n.current===vS&&(n.current=e(t)),n}function ao(e,t,n,r){const i=xr(YN).current;return aD(i,e,t,n,r)&&GN(i,[e,t,n,r]),i.callback}function iD(e){const t=xr(YN).current;return oD(t,e)&&GN(t,e),t.callback}function YN(){return{callback:null,cleanup:null,refs:[]}}function aD(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function oD(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function GN(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 i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=a(n);typeof l=="function"&&(r[i]=l);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=r[i];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}function q1(e){const t=E.useRef(!0);t.current&&(t.current=!1,e())}function lD(e){const[t,n]=E.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function uD(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function TS({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=E.useRef(e!==void 0),[a,l]=E.useState(t),c=i?e:a,d=E.useCallback(f=>{i||l(f)},[]);return[c,d]}const cD=()=>{},Ye=typeof document<"u"?E.useLayoutEffect:cD,Y1={...dM},O0=Y1.useInsertionEffect,dD=O0&&O0!==Y1.useLayoutEffect?O0:e=>e();function tt(e){const t=xr(fD).current;return t.next=e,dD(t.effect),t.trampoline}function fD(){const e={next:void 0,callback:hD,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function hD(){}function En(e){const t=xr(mD,e).current;return t.next=e,Ye(t.effect),t}function mD(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function pD(e,t){return function(r,...i){const a=new URL(e);return a.searchParams.set("code",r.toString()),i.forEach(l=>a.searchParams.append("args[]",l)),`${t} error #${r}; visit ${a} for the full message.`}}const Ln=pD("https://base-ui.com/production-error","Base UI"),Be=(e,t,n,r,i,a,...l)=>{if(l.length>0)throw new Error(Ln(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var KN=bN();const gD=parseInt(E.version,10);function G1(e){return gD>=e}const Bb=[];let zb;function bD(){return zb}function xD(e){Bb.push(e)}function K1(e){const t=(n,r)=>{const i=xr(yD).current;let a;try{zb=i;for(const l of Bb)l.before(i);a=e(n,r);for(const l of Bb)l.after(i);i.didInitialize=!0}finally{zb=void 0}return a};return t.displayName=e.displayName||e.name,t}function XN(e){return E.forwardRef(K1(e))}function yD(){return{didInitialize:!1}}const ED=G1(19),vD=ED?SD:CD;function ft(e,t,n,r,i){return vD(e,t,n,r,i)}function TD(e,t,n,r,i){const a=E.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return KN.useSyncExternalStore(e.subscribe,a,a)}xD({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],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}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 i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),KN.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function SD(e,t,n,r,i){const a=bD();if(!a)return TD(e,t,n,r,i);const l=a.syncIndex;a.syncIndex+=1;let c;return a.didInitialize?(c=a.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,i))&&(c.store!==e&&(a.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=i,c.value=t(e.getSnapshot(),n,r,i))):(c={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(c)),c.value}function CD(e,t,n,r,i){return xN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,i))}class WN{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,i){return ft(this,t,n,r,i)}}function Vn(){}const Pl=Object.freeze([]),dn=Object.freeze({});class pm extends WN{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){E.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){E.useDebugValue(t);const r=this,i=n!==void 0;Ye(()=>{i&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,i])}select(t,n,r,i){const a=this.selectors[t];return a(this.state,n,r,i)}useState(t,n,r,i){return E.useDebugValue(t),ft(this,this.selectors[t],n,r,i)}useContextCallback(t,n){E.useDebugValue(t);const r=tt(n??Vn);this.context[t]=r}useStateSetter(t){const n=E.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 i=r(this.state);return n(i,i,this),this.subscribe(a=>{const l=r(a);if(!Object.is(i,l)){const c=i;i=l,n(l,c,this)}})}}function gm(){return typeof window<"u"}function nr(e){return X1(e)?(e.nodeName||"").toLowerCase():"#document"}function sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yi(e){var t;return(t=(X1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function X1(e){return gm()?e instanceof Node||e instanceof sn(e).Node:!1}function St(e){return gm()?e instanceof Element||e instanceof sn(e).Element:!1}function cn(e){return gm()?e instanceof HTMLElement||e instanceof sn(e).HTMLElement:!1}function Bl(e){return!gm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sn(e).ShadowRoot}function wo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=qr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function wD(e){return/^(table|td|th)$/.test(nr(e))}function bm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const kD=/transform|translate|scale|rotate|perspective|filter/,ND=/paint|layout|strict|content/,Ua=e=>!!e&&e!=="none";let I0;function W1(e){const t=St(e)?qr(e):e;return Ua(t.transform)||Ua(t.translate)||Ua(t.scale)||Ua(t.rotate)||Ua(t.perspective)||!Q1()&&(Ua(t.backdropFilter)||Ua(t.filter))||kD.test(t.willChange||"")||ND.test(t.contain||"")}function _D(e){let t=pi(e);for(;cn(t)&&!fi(t);){if(W1(t))return t;if(bm(t))return null;t=pi(t)}return null}function Q1(){return I0==null&&(I0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),I0}function fi(e){return/^(html|body|#document)$/.test(nr(e))}function qr(e){return sn(e).getComputedStyle(e)}function xm(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pi(e){if(nr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bl(e)&&e.host||yi(e);return Bl(t)?t.host:t}function QN(e){const t=pi(e);return fi(t)?(e.ownerDocument||e).body:cn(t)&&wo(t)?t:QN(t)}function Yc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=QN(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),l=sn(i);if(a){const c=Hb(l);return t.concat(l,l.visualViewport||[],wo(i)?i:[],c&&n?Yc(c):[])}else return t.concat(i,Yc(i,[],n))}function Hb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ps(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function _t(e){return e?.ownerDocument||document}function Tt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const AD=[];function Z1(e){E.useEffect(e,AD)}const Ff=null;class RD{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 i=0;i<n.length;i+=1)n[i]?.(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 $f=new RD;class Rs{static create(){return new Rs}static request(t){return $f.request(t)}static cancel(t){return $f.cancel(t)}currentId=Ff;request(t){this.cancel(),this.currentId=$f.request(()=>{this.currentId=Ff,t()})}cancel=()=>{this.currentId!==Ff&&($f.cancel(this.currentId),this.currentId=Ff)};disposeEffect=()=>this.cancel}function zl(){const e=xr(Rs.create).current;return Z1(e.disposeEffect),e}const oc=0;class gs{static create(){return new gs}currentId=oc;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=oc,n()},t)}isStarted(){return this.currentId!==oc}clear=()=>{this.currentId!==oc&&(clearTimeout(this.currentId),this.currentId=oc)};disposeEffect=()=>this.clear}function Gn(){const e=xr(gs.create).current;return Z1(e.disposeEffect),e}function OD(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:ID,platform:MD,maxTouchPoints:LD}=OD(),ym=ID.toLowerCase(),Gc=MD.toLowerCase(),Em=/^i(os$|p)/.test(Gc)||Gc==="macintel"&&LD>1,SS="android",Ub=Gc===SS||ym.includes(SS),J1=!Em&&Gc.startsWith("mac");Gc.startsWith("win");const DD=J1||Em,ha=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!ha&&ym.includes("firefox");!ha&&ym.includes("chrom");const jD=DD,ex=/jsdom|happydom/.test(ym);function As(e){e.preventDefault(),e.stopPropagation()}function PD(e){return"nativeEvent"in e}function tx(e){return e.pointerType===""&&e.isTrusted?!0:Ub&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ZN(e){return ex?!1:!Ub&&e.width===0&&e.height===0||Ub&&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 oo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function BD(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Fb="data-base-ui-focusable",JN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",vm="ArrowLeft",Tm="ArrowRight",e3="ArrowUp",nx="ArrowDown";function Rr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function nt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Bl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function gr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Dh(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(nt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function M0(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 zD(e){return e.matches("html,body")}function Sm(e){return cn(e)&&e.matches(JN)}function HD(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${JN}`)!=null}function $b(e){return e?e.getAttribute("role")==="combobox"&&Sm(e):!1}function UD(e){if(!e||ex)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function jh(e){return e?e.hasAttribute(Fb)?e:e.querySelector(`[${Fb}]`)||e:null}function FD(e,t){return t!=null&&!oo(t)?0:typeof e=="function"?e():e}function Hl(e,t,n){const r=FD(e,n);return typeof r=="number"?r:r?.[t]}function CS(e){return typeof e=="function"?e():e}function t3(e,t){return t||e==="click"||e==="mousedown"}function $D(e){return e?.includes("mouse")&&e!=="mousedown"}const Wl="none",Ql="trigger-press",qn="trigger-hover",Ol="trigger-focus",Cm="outside-press",_c="item-press",VD="close-press",lo="focus-out",wm="escape-key",Vb="list-navigation",n3="cancel-open",yc="sibling-open",qD="disabled",rx="imperative-action",YD="window-resize";function mt(e,t,n,r){let i=!1,a=!1;const l=dn;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...l}}const r3=E.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new gs,currentIdRef:{current:null},currentContextRef:{current:null}});function GD(e,t){e.current=t.current}function KD(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=E.useRef(n),a=E.useRef(n),l=E.useRef(null),c=E.useRef(null),d=Gn();return Ye(()=>{if(a.current=n,!l.current){i.current=n;return}i.current={open:Hl(i.current,"open"),close:Hl(n,"close")}},[n,l,i,a]),h.jsx(r3.Provider,{value:E.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:l,timeoutMs:r,currentContextRef:c,timeout:d}),[r,d]),children:t})}function XD(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),a=E.useContext(r3),{currentIdRef:l,delayRef:c,timeoutMs:d,initialDelayRef:f,currentContextRef:g,hasProvider:m,timeout:b}=a,[x,v]=E.useState(!1),k=E.useRef(n),w=E.useRef(!1);return Ye(()=>{k.current=n},[n]),Ye(()=>()=>{w.current=!0},[]),Ye(()=>{function S(){w.current||v(!1),g.current?.setIsInstantPhase(!1),l.current=null,g.current=null,c.current=f.current,b.clear()}if(l.current&&!n&&l.current===i){if(v(!1),d){const N=i;return b.start(d,()=>{r.select("open")||l.current&&l.current!==N||S()}),()=>{(k.current||l.current!==N)&&b.clear()}}S()}},[n,i,l,c,d,f,g,b,r]),Ye(()=>{if(!n)return;const S=g.current,N=l.current;b.clear(),g.current={onOpenChange:r.setOpen,setIsInstantPhase:v},l.current=i,c.current={open:0,close:Hl(f.current,"close")},N!==null&&N!==i?(v(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,mt(Wl))):(v(!1),S?.setIsInstantPhase(!1))},[n,i,r,l,c,f,g,b]),Ye(()=>()=>{if(l.current===i){if(g.current=null,!k.current)return;l.current=null,GD(c,f),b.clear()}},[g,l,c,i,f,b]),E.useMemo(()=>({hasProvider:m,delayRef:c,isInstantPhase:x}),[m,c,x])}const Ul=E.forwardRef(function(t,n){const[r,i]=E.useState();Ye(()=>{jD&&ha&&i("button")},[]);const a={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:qN,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})}),WD=["top","right","bottom","left"],Fl=Math.min,hi=Math.max,Ph=Math.round,Vf=Math.floor,mi=e=>({x:e,y:e}),QD={left:"right",right:"left",bottom:"top",top:"bottom"};function s3(e,t,n){return hi(e,Fl(t,n))}function gi(e,t){return typeof e=="function"?e(t):e}function $r(e){return e.split("-")[0]}function ma(e){return e.split("-")[1]}function sx(e){return e==="x"?"y":"x"}function ix(e){return e==="y"?"height":"width"}function ls(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ax(e){return sx(ls(e))}function ZD(e,t,n){n===void 0&&(n=!1);const r=ma(e),i=ax(e),a=ix(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Bh(l)),[l,Bh(l)]}function JD(e){const t=Bh(e);return[qb(e),t,qb(t)]}function qb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const wS=["left","right"],kS=["right","left"],ej=["top","bottom"],tj=["bottom","top"];function nj(e,t,n){switch(e){case"top":case"bottom":return n?t?kS:wS:t?wS:kS;case"left":case"right":return t?ej:tj;default:return[]}}function rj(e,t,n,r){const i=ma(e);let a=nj($r(e),n==="start",r);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(qb)))),a}function Bh(e){const t=$r(e);return QD[t]+e.slice(t.length)}function sj(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function i3(e){return typeof e!="number"?sj(e):{top:e,right:e,bottom:e,left:e}}function Kc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function NS(e,t){return t<0||t>=e.length}function L0(e,t){return Nl(e.current,{disabledIndices:t})}function _S(e,t){return Nl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Nl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&a3(e,a,r));return a}function a3(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const i=e[t];return i?km(i)?!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!0:!1}function ij(e){return e.visibility==="hidden"||e.visibility==="collapse"}function km(e,t=e?qr(e):null){return!e||!e.isConnected||!t||ij(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const aj='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function oj(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Bl(n)?n.host:null}function Yb(e){for(const t of Array.from(e.children))if(nr(t)==="summary")return t;return null}function lj(e,t){const n=Yb(t);return!!n&&(e===n||nt(n,e))}function o3(e){const t=e?nr(e):"";return e!=null&&e.matches(aj)&&(t!=="summary"||e.parentElement!=null&&nr(e.parentElement)==="details"&&Yb(e.parentElement)===e)&&(t!=="details"||Yb(e)==null)&&(t!=="input"||e.type!=="hidden")}function l3(e){if(!o3(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=oj(t)){const n=t!==e,r=nr(t)==="slot";if(t.hasAttribute("inert")||n&&nr(t)==="details"&&!t.open&&!lj(e,t)||t.hasAttribute("hidden")||!r&&!uj(t,n))return!1}return!0}function uj(e,t){const n=qr(e);return t?n.display!=="none":km(e,n)}function u3(e){const t=e.tabIndex;if(t<0){const n=nr(e);if(n==="details"||n==="audio"||n==="video"||cn(e)&&e.isContentEditable)return 0}return t}function D0(e){if(nr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function cj(e,t){const n=D0(e);if(!n)return!0;const r=t.find(i=>{const a=D0(i);return a?.name===n.name&&a.form===n.form&&a.checked});return r?r===n:t.find(i=>{const a=D0(i);return a?.name===n.name&&a.form===n.form})===n}function c3(e){if(cn(e)&&nr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return cn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function d3(e,t){c3(e).forEach(n=>{o3(n)&&t.push(n),d3(n,t)})}function f3(e,t,n){c3(e).forEach(r=>{cn(r)&&r.matches(t)&&n.push(r),f3(r,t,n)})}function ox(e){return l3(e)&&u3(e)>=0}function h3(e){const t=[];return d3(e,t),t.filter(l3)}function id(e){const t=h3(e);return t.filter(n=>u3(n)>=0&&cj(n,t))}function m3(e,t){const n=id(e),r=n.length;if(r===0)return;const i=Rr(_t(e)),a=n.indexOf(i),l=a===-1?t===1?0:r-1:a+t;return n[l]}function lx(e){return m3(_t(e).body,1)||e}function p3(e){return m3(_t(e).body,-1)||e}function g3(e,t){if(!e)return null;const n=id(_t(e).body),r=n.length;if(r===0)return null;const i=n.indexOf(e);if(i===-1)return null;const a=(i+t+r)%r;return n[a]}function dj(e){return g3(e,1)}function fj(e){return g3(e,-1)}function Il(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!nt(n,r)}function hj(e){id(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function AS(e){const t=[];f3(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 oa(e,t,n=!0){return e.filter(i=>i.parentId===t).flatMap(i=>[...!n||i.context?.open?[i]:[],...oa(e,i.id,n)])}function RS(e,t){let n=[],r=e.find(i=>i.id===t)?.parentId;for(;r;){const i=e.find(a=>a.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function Xc(e){return`data-base-ui-${e}`}let qf=0;function Eh(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(qf);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),Vn;const l=requestAnimationFrame(a);return qf=l,()=>{qf===l&&(cancelAnimationFrame(l),qf=0)}}const j0={inert:new WeakMap,"aria-hidden":new WeakMap},OS="data-base-ui-inert",Gb={inert:new WeakSet,"aria-hidden":new WeakSet};let lc=new WeakMap,P0=0;function mj(e){return Gb[e]}function b3(e){return e?Bl(e)?e.host:b3(e.parentNode):null}const IS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=b3(n);return e.contains(r)?r:null}).filter(n=>n!=null),MS=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},LS=(e,t,n)=>{const r=[],i=a=>{!a||n.has(a)||Array.from(a.children).forEach(l=>{nr(l)!=="script"&&(t.has(l)?i(l):r.push(l))})};return i(e),r};function pj(e,t,n,r,{mark:i=!0}){let a=null;r?a="inert":n&&(a="aria-hidden");let l=null,c=null;const d=IS(t,e),f=i?LS(t,MS(d),new Set(d)):[],g=[],m=[];if(a){const b=j0[a],x=mj(a);c=x,l=b;const v=IS(t,Array.from(t.querySelectorAll("[aria-live]"))),k=d.concat(v);LS(t,MS(k),new Set(k)).forEach(S=>{const N=S.getAttribute(a),_=N!==null&&N!=="false",A=(b.get(S)||0)+1;b.set(S,A),g.push(S),A===1&&_&&x.add(S),_||S.setAttribute(a,a==="inert"?"":"true")})}return i&&f.forEach(b=>{const x=(lc.get(b)||0)+1;lc.set(b,x),m.push(b),x===1&&b.setAttribute(OS,"")}),P0+=1,()=>{l&&g.forEach(b=>{const v=(l.get(b)||0)-1;l.set(b,v),v||(!c?.has(b)&&a&&b.removeAttribute(a),c?.delete(b))}),i&&m.forEach(b=>{const x=(lc.get(b)||0)-1;lc.set(b,x),x||b.removeAttribute(OS)}),P0-=1,P0||(j0.inert=new WeakMap,j0["aria-hidden"]=new WeakMap,Gb.inert=new WeakSet,Gb["aria-hidden"]=new WeakSet,lc=new WeakMap)}}function DS(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=_t(e[0]).body;return pj(e,a,n,r,{mark:i})}let jS=0;function gj(e,t="mui"){const[n,r]=E.useState(e),i=e||n;return E.useEffect(()=>{n==null&&(jS+=1,r(`${t}-${jS}`))},[n,t]),i}const PS=Y1.useId;function uo(e,t){if(PS!==void 0){const n=PS();return e??(t?`${t}-${n}`:n)}return gj(e,t)}function BS(e){if(!E.isValidElement(e))return null;const t=e,n=t.props;return(G1(19)?n?.ref:t.ref)??null}function Kb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function bj(e,t){const n={};for(const r in e){const i=e[r];if(t?.hasOwnProperty(r)){const a=t[r](i);a!=null&&Object.assign(n,a);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function xj(e,t){return typeof e=="function"?e(t):e}function yj(e,t){return typeof e=="function"?e(t):e}const ux={};function Ir(e,t,n,r,i){if(!n&&!r&&!i&&!e)return zh(t);let a=zh(e);return t&&(a=Ec(a,t)),n&&(a=Ec(a,n)),r&&(a=Ec(a,r)),i&&(a=Ec(a,i)),a}function Ej(e){if(e.length===0)return ux;if(e.length===1)return zh(e[0]);let t=zh(e[0]);for(let n=1;n<e.length;n+=1)t=Ec(t,e[n]);return t}function zh(e){return cx(e)?{...y3(e,ux)}:vj(e)}function Ec(e,t){return cx(t)?y3(t,e):Tj(e,t)}function vj(e){const t={...e};for(const n in t){const r=t[n];x3(n,r)&&(t[n]=E3(r))}return t}function Tj(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Kb(e.style,r);break}case"className":{e[n]=v3(e.className,r);break}default:x3(n,r)?e[n]=Sj(e[n],r):e[n]=r}}return e}function x3(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function cx(e){return typeof e=="function"}function y3(e,t){return cx(e)?e(t):e??ux}function Sj(e,t){return t?e?(...n)=>{const r=n[0];if(T3(r)){const a=r;Hh(a);const l=t(...n);return a.baseUIHandlerPrevented||e?.(...n),l}const i=t(...n);return e?.(...n),i}:E3(t):e}function E3(e){return e&&((...t)=>{const n=t[0];return T3(n)&&Hh(n),e(...t)})}function Hh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function v3(e,t){return t?e?t+" "+e:t:e}function T3(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Nn(e,t,n={}){const r=t.render,i=Cj(t,n);if(n.enabled===!1)return null;const a=n.state??dn;return Nj(e,r,i,a)}function Cj(e,t={}){const{className:n,style:r,render:i}=e,{state:a=dn,ref:l,props:c,stateAttributesMapping:d,enabled:f=!0}=t,g=f?xj(n,a):void 0,m=f?yj(r,a):void 0,b=f?bj(a,d):dn,x=f&&c?wj(c):void 0,v=f?Kb(b,x)??{}:dn;return typeof document<"u"&&(f?Array.isArray(l)?v.ref=iD([v.ref,BS(i),...l]):v.ref=ao(v.ref,BS(i),l):ao(null,null)),f?(g!==void 0&&(v.className=v3(v.className,g)),m!==void 0&&(v.style=Kb(v.style,m)),v):dn}function wj(e){return Array.isArray(e)?Ej(e):Ir(void 0,e)}const kj=Symbol.for("react.lazy");function Nj(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=Ir(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===kj&&(a=E.Children.toArray(t)[0]),E.cloneElement(a,i)}if(e&&typeof e=="string")return _j(e,n);throw new Error(Ln(8))}function _j(e,t){return e==="button"?E.createElement("button",{type:"button",...t,key:t.key}):e==="img"?E.createElement("img",{alt:"",...t,key:t.key}):E.createElement(e,t)}const Aj=500,Rj=500,Oj={style:{transition:"none"}},S3="data-base-ui-click-trigger",C3={fallbackAxisSide:"none"},w3={fallbackAxisSide:"end"},Ij={clipPath:"inset(50%)",position:"fixed",top:0,left:0},k3=E.createContext(null),N3=()=>E.useContext(k3),Mj=Xc("portal");function _3(e={}){const{ref:t,container:n,componentProps:r=dn,elementProps:i}=e,a=uo(),c=N3()?.portalNode,[d,f]=E.useState(null),[g,m]=E.useState(null),b=tt(w=>{w!==null&&m(w)}),x=E.useRef(null);Ye(()=>{if(n===null){x.current&&(x.current=null,m(null),f(null));return}if(a==null)return;const w=(n&&(X1(n)?n:n.current))??c??document.body;if(w==null){x.current&&(x.current=null,m(null),f(null));return}x.current!==w&&(x.current=w,m(null),f(w))},[n,c,a]);const v=Nn("div",r,{ref:[t,b],props:[{id:a,[Mj]:""},i]});return{portalNode:g,portalSubtree:d&&v?lr.createPortal(v,d):null}}const dx=E.forwardRef(function(t,n){const{render:r,className:i,style:a,children:l,container:c,renderGuards:d,...f}=t,{portalNode:g,portalSubtree:m}=_3({container:c,ref:n,componentProps:t,elementProps:f}),b=E.useRef(null),x=E.useRef(null),v=E.useRef(null),k=E.useRef(null),[w,S]=E.useState(null),N=E.useRef(!1),_=w?.modal,A=w?.open,L=typeof d=="boolean"?d:!!w&&!w.modal&&w.open&&!!g;E.useEffect(()=>{if(!g||_)return;function D(I){g&&I.relatedTarget&&Il(I)&&(I.type==="focusin"?N.current&&(AS(g),N.current=!1):(hj(g),N.current=!0))}return Ps(Tt(g,"focusin",D,!0),Tt(g,"focusout",D,!0))},[g,_]),Ye(()=>{!g||A!==!0||!N.current||(AS(g),N.current=!1)},[A,g]);const R=E.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:x,beforeInsideRef:v,afterInsideRef:k,portalNode:g,setFocusManagerState:S}),[g]);return h.jsxs(E.Fragment,{children:[m,h.jsxs(k3.Provider,{value:R,children:[L&&g&&h.jsx(Ul,{"data-type":"outside",ref:b,onFocus:D=>{if(Il(D,g))v.current?.focus();else{const I=w?w.domReference:null;p3(I)?.focus()}}}),L&&g&&h.jsx("span",{"aria-owns":g.id,style:Ij}),g&&lr.createPortal(l,g),L&&g&&h.jsx(Ul,{"data-type":"outside",ref:x,onFocus:D=>{if(Il(D,g))k.current?.focus();else{const I=w?w.domReference:null;lx(I)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,mt(lo,D.nativeEvent))}}})]})]})});function A3(){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 fx{nodesRef={current:[]};events=A3();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 R3=E.createContext(null),O3=E.createContext(null),pa=()=>E.useContext(R3)?.id||null,ga=e=>{const t=E.useContext(O3);return e??t};function I3(e){const t=uo(),n=ga(e),r=pa();return Ye(()=>{if(!t)return;const i={id:t,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,t,r]),t}function Lj(e){const{children:t,id:n}=e,r=pa();return h.jsx(R3.Provider,{value:E.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Dj(e){const{children:t,externalTree:n}=e,r=xr(()=>n??new fx).current;return h.jsx(O3.Provider,{value:r,children:t})}function ai(e){return e==null?e:"current"in e?e.current:e}function jj(e,t){const n=sn(gr(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 zS=20;let ra=[];function hx(){ra=ra.filter(e=>e.deref()?.isConnected)}function HS(e){hx(),e&&nr(e)!=="body"&&(ra.push(new WeakRef(e)),ra.length>zS&&(ra=ra.slice(-zS)))}function US(){return hx(),ra[ra.length-1]?.deref()}function Pj(e){return e?ox(e)?e:id(e)[0]||e:null}function FS(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=h3(e).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return ox(i)||i.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 mx(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:d=!0,openInteractionType:f="",nextFocusableElement:g,previousFocusableElement:m,beforeContentFocusGuardRef:b,externalTree:x,getInsideElements:v}=e,k="rootStore"in t?t.rootStore:t,w=k.useState("open"),S=k.useState("domReferenceElement"),N=k.useState("floatingElement"),{events:_,dataRef:A}=k.context,L=tt(()=>A.current.floatingContext?.nodeId),R=i===!1,D=$b(S)&&R,I=En(i),U=En(a),z=En(f),X=En(w),W=ga(x),V=N3(),ee=E.useRef(!1),q=E.useRef(!1),B=E.useRef(!1),G=E.useRef(null),Q=E.useRef(""),le=E.useRef(""),M=E.useRef(null),P=E.useRef(null),F=ao(M,b,V?.beforeInsideRef),j=ao(P,V?.afterInsideRef),ae=Gn(),ie=Gn(),ce=zl(),de=V!=null,fe=jh(N),ve=tt((Ee=fe)=>Ee?id(Ee):[]),Fe=tt(()=>v?.().filter(Ee=>Ee!=null)??[]);E.useEffect(()=>{if(r||!c)return;function Ee(ze){ze.key==="Tab"&&nt(fe,Rr(_t(fe)))&&ve().length===0&&!D&&As(ze)}const Oe=_t(fe);return Tt(Oe,"keydown",Ee)},[r,fe,c,D,ve]),E.useEffect(()=>{if(r||!w)return;const Ee=_t(fe);function Oe(){B.current=!1}function ze($e){const De=gr($e),ke=Fe(),ye=nt(N,De)||nt(S,De)||nt(V?.portalNode,De)||ke.some(Ie=>Ie===De||nt(Ie,De));B.current=!ye,le.current=$e.pointerType||"keyboard",De?.closest(`[${S3}]`)&&(q.current=!0,ie.start(0,()=>{q.current=!1}))}function Ge(){le.current="keyboard"}return Ps(Tt(Ee,"pointerdown",ze,!0),Tt(Ee,"pointerup",Oe,!0),Tt(Ee,"pointercancel",Oe,!0),Tt(Ee,"keydown",Ge,!0),Oe)},[r,N,S,fe,w,V,ie,Fe]),E.useEffect(()=>{if(r||!d)return;const Ee=_t(fe);function Oe(){q.current=!0,ie.start(0,()=>{q.current=!1})}function ze(ke){const ye=gr(ke);ox(ye)&&(G.current=ye)}function Ge(ke){const ye=ke.relatedTarget,Ie=ke.currentTarget,je=gr(ke);c&&ye==null&&je!=null&&nt(N,je)&&HS(je),queueMicrotask(()=>{const te=L(),me=k.context.triggerElements,Z=Fe(),re=ye?.hasAttribute(Xc("focus-guard"))&&[M.current,P.current,V?.beforeInsideRef.current,V?.afterInsideRef.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,ai(m),ai(g)].includes(ye),K=!(nt(S,ye)||nt(N,ye)||nt(ye,N)||nt(V?.portalNode,ye)||Z.some($=>$===ye||nt($,ye))||ye!=null&&me.hasElement(ye)||me.hasMatchingElement($=>nt($,ye))||re||W&&(oa(W.nodesRef.current,te).find($=>nt($.context?.elements.floating,ye)||nt($.context?.elements.domReference,ye))||RS(W.nodesRef.current,te).find($=>[$.context?.elements.floating,jh($.context?.elements.floating)].includes(ye)||$.context?.elements.domReference===ye)));if(Ie===S&&fe&&FS(fe),l&&Ie!==S&&!km(je)&&Rr(Ee)===Ee.body){if(cn(fe)&&(fe.focus(),l==="popup")){ce.request(()=>{fe.focus()});return}const $=ve(),oe=G.current,Ce=(oe&&$.includes(oe)?oe:null)||$[$.length-1]||fe;cn(Ce)&&Ce.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(D||!c)&&ye&&K&&!q.current&&(D||ye!==US())&&(ee.current=!0,k.setOpen(!1,mt(lo,ke)))})}function $e(){B.current||(A.current.insideReactTree=!0,ae.start(0,()=>{A.current.insideReactTree=!1}))}const De=cn(S)?S:null;if(!(!N&&!De))return Ps(De&&Tt(De,"focusout",Ge),De&&Tt(De,"pointerdown",Oe),N&&Tt(N,"focusin",ze),N&&Tt(N,"focusout",Ge),N&&V&&Tt(N,"focusout",$e,!0))},[r,S,N,fe,c,W,V,k,d,l,ve,D,L,A,ae,ie,ce,g,m,Fe]),E.useEffect(()=>{if(r||!N||!w)return;const Ee=Array.from(V?.portalNode?.querySelectorAll(`[${Xc("portal")}]`)||[]),ze=(W?RS(W.nodesRef.current,L()):[]).find(Ie=>$b(Ie.context?.elements.domReference||null))?.context?.elements.domReference,$e=[...[N,...Ee,M.current,P.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,...Fe()],ze,ai(m),ai(g),D?S:null].filter(Ie=>Ie!=null),De=DS($e,{ariaHidden:c||D,mark:!1}),ke=[N,...Ee].filter(Ie=>Ie!=null),ye=DS(ke);return()=>{ye(),De()}},[w,r,S,N,c,V,D,W,L,g,m,Fe]),Ye(()=>{if(!w||r||!cn(fe))return;const Ee=_t(fe),Oe=Rr(Ee);queueMicrotask(()=>{const ze=I.current,Ge=typeof ze=="function"?ze(z.current||""):ze;if(Ge===void 0||Ge===!1||nt(fe,Oe))return;let De=null;const ke=()=>(De==null&&(De=ve(fe)),De[0]||fe);let ye;Ge===!0||Ge===null?ye=ke():ye=ai(Ge),ye=ye||ke();const Ie=nt(fe,Rr(Ee));Eh(ye,{preventScroll:ye===fe,shouldFocus(){if(!X.current)return!1;if(Ie)return!0;const je=Rr(Ee);return!(je!==ye&&nt(fe,je))}})})},[r,w,fe,ve,I,z,X]),Ye(()=>{if(r||!fe)return;const Ee=_t(fe),Oe=Rr(Ee),ze=z.current==null;HS(Oe);function Ge(De){if(De.open||(Q.current=jj(De.nativeEvent,le.current)),De.reason===qn&&De.nativeEvent.type==="mouseleave"&&(ee.current=!0),De.reason===Cm)if(De.nested)ee.current=!1;else if(tx(De.nativeEvent)||ZN(De.nativeEvent))ee.current=!1;else{let ke=!1;_t(fe).createElement("div").focus({get preventScroll(){return ke=!0,!1}}),ke?ee.current=!1:ee.current=!0}}_.on("openchange",Ge);function $e(){const De=U.current;let ke=typeof De=="function"?De(Q.current):De;if(ke===void 0||ke===!1)return null;ke===null&&(ke=!0);const ye=S?.isConnected?S:null,Ie=Oe?.isConnected&&nr(Oe)!=="body"?Oe:null;let je=ze?Ie||ye:ye||Ie;return je||(je=US()||null),typeof ke=="boolean"?je:ai(ke)||je||null}return()=>{_.off("openchange",Ge);const De=Rr(Ee),ke=Fe(),ye=nt(N,De)||ke.some(te=>te===De||nt(te,De))||W&&oa(W.nodesRef.current,L(),!1).some(te=>nt(te.context?.elements.floating,De)),Ie=U.current,je=$e();queueMicrotask(()=>{const te=Pj(je),me=typeof Ie!="boolean";Ie&&!ee.current&&cn(te)&&(!(!me&&te!==De&&De!==Ee.body)||ye)&&te.focus({preventScroll:!0}),ee.current=!1})}},[r,N,fe,U,z,_,W,S,L,Fe]),Ye(()=>{if(!ha||w||!N)return;const Ee=Rr(_t(N));!cn(Ee)||!Sm(Ee)||nt(N,Ee)&&Ee.blur()},[w,N]),Ye(()=>{if(!(r||!V))return V.setFocusManagerState({modal:c,closeOnFocusOut:d,open:w,onOpenChange:k.setOpen,domReference:S}),()=>{V.setFocusManagerState(null)}},[r,V,c,w,k,d,S]),Ye(()=>{if(!(r||!fe))return FS(fe),()=>{queueMicrotask(hx)}},[r,fe]);const Le=!r&&(c?!D:!0)&&(de||c);return h.jsxs(E.Fragment,{children:[Le&&h.jsx(Ul,{"data-type":"inside",ref:F,onFocus:Ee=>{if(c){const Oe=ve();Eh(Oe[Oe.length-1])}else V?.portalNode&&(ee.current=!1,Il(Ee,V.portalNode)?lx(S)?.focus():ai(m??V.beforeOutsideRef)?.focus())}}),n,Le&&h.jsx(Ul,{"data-type":"inside",ref:j,onFocus:Ee=>{c?Eh(ve()[0]):V?.portalNode&&(d&&(ee.current=!0),Il(Ee,V.portalNode)?p3(S)?.focus():ai(g??V.afterOutsideRef)?.focus())}})]})}function px(e,t={}){const{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:d=Ql}=t,f="rootStore"in e?e.rootStore:e,g=f.context.dataRef,m=E.useRef(void 0),b=zl(),x=Gn(),v=E.useMemo(()=>{function k(S,N,_,A){const L=mt(d,N,_);S&&A==="touch"&&c>0?x.start(c,()=>{f.setOpen(!0,L)}):f.setOpen(S,L)}function w(S,N,_){const A=g.current.openEvent,L=f.select("domReferenceElement")!==N;return S&&L||!S||!i?!0:A&&l?!_(A.type):!1}return{onPointerDown(S){m.current=S.pointerType},onMouseDown(S){const N=m.current,_=S.nativeEvent,A=f.select("open");if(S.button!==0||r==="click"||oo(N,!0)&&a)return;const L=w(A,S.currentTarget,I=>I==="click"||I==="mousedown"),R=gr(_);if(Sm(R)){k(L,_,R,N);return}const D=S.currentTarget;b.request(()=>{k(L,_,D,N)})},onClick(S){if(r==="mousedown-only")return;const N=m.current;if(r==="mousedown"&&N){m.current=void 0;return}if(oo(N,!0)&&a)return;const _=f.select("open"),A=w(_,S.currentTarget,L=>L==="click"||L==="mousedown"||L==="keydown"||L==="keyup");k(A,S.nativeEvent,S.currentTarget,N)},onKeyDown(){m.current=void 0}}},[g,r,a,d,f,l,i,b,x,c]);return E.useMemo(()=>n?{reference:v}:dn,[n,v])}function Bj(e,t){let n=null,r=null,i=!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",c=t.axis==="y"||t.axis==="both",d=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let f=a.width,g=a.height,m=a.x,b=a.y;return n==null&&t.x&&l&&(n=a.x-t.x),r==null&&t.y&&c&&(r=a.y-t.y),m-=n||0,b-=r||0,f=0,g=0,!i||d?(f=t.axis==="y"?a.width:0,g=t.axis==="x"?a.height:0,m=l&&t.x!=null?t.x:m,b=c&&t.y!=null?t.y:b):i&&!d&&(g=t.axis==="x"?a.height:g,f=t.axis==="y"?a.width:f),i=!0,{width:f,height:g,x:m,y:b,top:b,right:m+f,bottom:b+g,left:m}}}}function $S(e){return e!=null&&e.clientX!=null}function zj(e,t={}){const{enabled:n=!0,axis:r="both"}=t,i="rootStore"in e?e.rootStore:e,a=i.useState("open"),l=i.useState("floatingElement"),c=i.useState("domReferenceElement"),d=i.context.dataRef,f=E.useRef(!1),g=E.useRef(null),[m,b]=E.useState(),[x,v]=E.useState([]),k=tt(A=>{i.set("positionReference",A)}),w=tt((A,L,R)=>{f.current||d.current.openEvent&&!$S(d.current.openEvent)||i.set("positionReference",Bj(R??c,{x:A,y:L,axis:r,dataRef:d,pointerType:m}))}),S=tt(A=>{a?g.current||(w(A.clientX,A.clientY,A.currentTarget),v([])):w(A.clientX,A.clientY,A.currentTarget)}),N=oo(m)?l:a;E.useEffect(()=>{if(!n){k(c);return}if(!N)return;function A(){g.current?.(),g.current=null}const L=sn(l);function R(D){const I=gr(D);nt(l,I)?A():w(D.clientX,D.clientY)}return!d.current.openEvent||$S(d.current.openEvent)?g.current=Tt(L,"mousemove",R):k(c),A},[N,n,l,d,c,i,w,k,x]),E.useEffect(()=>()=>{i.set("positionReference",null)},[i]),E.useEffect(()=>{n&&!l&&(f.current=!1)},[n,l]),E.useEffect(()=>{!n&&a&&(f.current=!0)},[n,a]);const _=E.useMemo(()=>{function A(L){b(L.pointerType)}return{onPointerDown:A,onPointerEnter:A,onMouseMove:S,onMouseEnter:S}},[S]);return E.useMemo(()=>n?{reference:_,trigger:_}:{},[n,_])}function Hj(){return!1}function Uj(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Nm(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a="sloppy",referencePress:l=Hj,bubbles:c,externalTree:d}=t,f="rootStore"in e?e.rootStore:e,g=f.useState("open"),m=f.useState("floatingElement"),{dataRef:b}=f.context,x=ga(d),v=tt(typeof i=="function"?i:()=>!1),k=typeof i=="function"?v:i,w=k!==!1,S=tt(()=>a),{escapeKey:N,outsidePress:_}=Uj(c),A=E.useRef(!1),L=E.useRef(!1),R=E.useRef(!1),D=E.useRef(!1),I=E.useRef(""),U=E.useRef(null),z=Gn(),X=Gn(),W=tt(()=>{X.clear(),b.current.insideReactTree=!1}),V=tt(F=>{const j=b.current.floatingContext?.nodeId;return(x?oa(x.nodesRef.current,j):[]).some(ie=>ie.context?.open&&!ie.context.dataRef.current[F])}),ee=tt(F=>M0(F,f.select("floatingElement"))||M0(F,f.select("domReferenceElement"))),q=tt(F=>{l()&&f.setOpen(!1,mt(Ql,F.nativeEvent))}),B=tt(F=>{if(!g||!n||!r||F.key!=="Escape"||D.current||!N&&V("__escapeKeyBubbles"))return;const j=PD(F)?F.nativeEvent:F,ae=mt(wm,j);f.setOpen(!1,ae),ae.isCanceled||F.preventDefault(),!N&&!ae.isPropagationAllowed&&F.stopPropagation()}),G=tt(()=>{b.current.insideReactTree=!0,X.start(0,W)}),Q=tt(F=>{if(!g||!n||F.button!==0)return;const j=gr(F.nativeEvent);nt(f.select("floatingElement"),j)&&(A.current||(A.current=!0,L.current=!1))}),le=tt(F=>{!g||!n||(F.defaultPrevented||F.nativeEvent.defaultPrevented)&&A.current&&(L.current=!0)});E.useEffect(()=>{if(!g||!n)return;b.current.__escapeKeyBubbles=N,b.current.__outsidePressBubbles=_;const F=new gs,j=new gs;function ae(){F.clear(),D.current=!0}function ie(){F.start(ha?5:0,()=>{D.current=!1})}function ce(){R.current=!0,j.start(0,()=>{R.current=!1})}function de(){A.current=!1,L.current=!1}function fe(){const Z=I.current,re=Z==="pen"||!Z?"mouse":Z,K=S(),$=typeof K=="function"?K():K;return typeof $=="string"?$:$[re]}function ve(Z){const re=fe();return re==="intentional"&&Z.type!=="click"||re==="sloppy"&&Z.type==="click"}function Fe(Z){const re=b.current.floatingContext?.nodeId,K=x&&oa(x.nodesRef.current,re).some($=>M0(Z,$.context?.elements.floating));return ee(Z)||K}function Le(Z){if(ve(Z)){Z.type!=="click"&&!ee(Z)&&(j.clear(),R.current=!1),W();return}if(b.current.insideReactTree){W();return}const re=gr(Z),K=`[${Xc("inert")}]`,$=St(re)?re.getRootNode():null,oe=Array.from((Bl($)?$:_t(f.select("floatingElement"))).querySelectorAll(K)),Ce=f.context.triggerElements;if(re&&(Ce.hasElement(re)||Ce.hasMatchingElement(Ve=>nt(Ve,re))))return;let Re=St(re)?re:null;for(;Re&&!fi(Re);){const Ve=pi(Re);if(fi(Ve)||!St(Ve))break;Re=Ve}if(!(oe.length&&St(re)&&!zD(re)&&!nt(re,f.select("floatingElement"))&&oe.every(Ve=>!nt(Re,Ve)))){if(cn(re)&&!("touches"in Z)){const Ve=fi(re),ot=qr(re),et=/auto|scroll/,dt=Ve||et.test(ot.overflowX),ut=Ve||et.test(ot.overflowY),qe=dt&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,Rt=ut&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,jt=ot.direction==="rtl",lt=Rt&&(jt?Z.offsetX<=re.offsetWidth-re.clientWidth:Z.offsetX>re.clientWidth),Lt=qe&&Z.offsetY>re.clientHeight;if(lt||Lt)return}if(!Fe(Z)){if(fe()==="intentional"&&R.current){j.clear(),R.current=!1;return}typeof k=="function"&&!k(Z)||V("__outsidePressBubbles")||(f.setOpen(!1,mt(Cm,Z)),W())}}}function Ee(Z){fe()!=="sloppy"||Z.pointerType==="touch"||!f.select("open")||!n||ee(Z)||Le(Z)}function Oe(Z){if(fe()!=="sloppy"||!f.select("open")||!n||ee(Z))return;const re=Z.touches[0];re&&(U.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{U.current&&(U.current.dismissOnTouchEnd=!1,U.current.dismissOnMouseDown=!1)}))}function ze(Z,re){const K=gr(Z);if(!K)return;const $=Tt(K,Z.type,()=>{re(Z),$()})}function Ge(Z){I.current="touch",ze(Z,Oe)}function $e(Z){z.clear(),Z.type==="pointerdown"&&(I.current=Z.pointerType),!(Z.type==="mousedown"&&U.current&&!U.current.dismissOnMouseDown)&&ze(Z,re=>{re.type==="pointerdown"?Ee(re):Le(re)})}function De(Z){if(!A.current)return;const re=L.current;if(de(),fe()==="intentional"){if(Z.type==="pointercancel"){re&&ce();return}if(!Fe(Z)){if(re){ce();return}typeof k=="function"&&!k(Z)||(j.clear(),R.current=!0,W())}}}function ke(Z){if(fe()!=="sloppy"||!U.current||ee(Z))return;const re=Z.touches[0];if(!re)return;const K=Math.abs(re.clientX-U.current.startX),$=Math.abs(re.clientY-U.current.startY),oe=Math.sqrt(K*K+$*$);oe>5&&(U.current.dismissOnTouchEnd=!0),oe>10&&(Le(Z),z.clear(),U.current=null)}function ye(Z){ze(Z,ke)}function Ie(Z){fe()!=="sloppy"||!U.current||ee(Z)||(U.current.dismissOnTouchEnd&&Le(Z),z.clear(),U.current=null)}function je(Z){ze(Z,Ie)}const te=_t(m),me=Ps(r&&Ps(Tt(te,"keydown",B),Tt(te,"compositionstart",ae),Tt(te,"compositionend",ie)),w&&Ps(Tt(te,"click",$e,!0),Tt(te,"pointerdown",$e,!0),Tt(te,"pointerup",De,!0),Tt(te,"pointercancel",De,!0),Tt(te,"mousedown",$e,!0),Tt(te,"mouseup",De,!0),Tt(te,"touchstart",Ge,!0),Tt(te,"touchmove",ye,!0),Tt(te,"touchend",je,!0)));return()=>{me(),F.clear(),j.clear(),de(),R.current=!1}},[b,m,r,w,k,g,n,N,_,B,W,S,V,ee,x,f,z]),E.useEffect(W,[k,W]);const M=E.useMemo(()=>({onKeyDown:B,onPointerDown:q,onClick:q}),[B,q]),P=E.useMemo(()=>({onKeyDown:B,onPointerDown:le,onMouseDown:le,onClickCapture:G,onMouseDownCapture(F){G(),Q(F)},onPointerDownCapture(F){G(),Q(F)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[B,G,Q,le]);return E.useMemo(()=>n?{reference:M,floating:P,trigger:M}:{},[n,M,P])}function VS(e,t,n){let{reference:r,floating:i}=e;const a=ls(t),l=ax(t),c=ix(l),d=$r(t),f=a==="y",g=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,b=r[c]/2-i[c]/2;let x;switch(d){case"top":x={x:g,y:r.y-i.height};break;case"bottom":x={x:g,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-i.width,y:m};break;default:x={x:r.x,y:r.y}}const v=ma(t);return v&&(x[l]+=b*(v==="end"?1:-1)*(n&&f?-1:1)),x}async function Fj(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:l,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:b=!1,padding:x=0}=gi(t,e),v=i3(x),w=c[b?m==="floating"?"reference":"floating":m],S=Kc(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(w)))==null||n?w:w.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:g,strategy:d})),N=m==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),A=await(a.isElement==null?void 0:a.isElement(_))&&await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1},L=Kc(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:_,strategy:d}):N);return{top:(S.top-L.top+v.top)/A.y,bottom:(L.bottom-S.bottom+v.bottom)/A.y,left:(S.left-L.left+v.left)/A.x,right:(L.right-S.right+v.right)/A.x}}const $j=50,Vj=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:Fj},d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y:m}=VS(f,r,d),b=r,x=0;const v={};for(let k=0;k<a.length;k++){const w=a[k];if(!w)continue;const{name:S,fn:N}=w,{x:_,y:A,data:L,reset:R}=await N({x:g,y:m,initialPlacement:r,placement:b,strategy:i,middlewareData:v,rects:f,platform:c,elements:{reference:e,floating:t}});g=_??g,m=A??m,v[S]={...v[S],...L},R&&x<$j&&(x++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(f=R.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):R.rects),{x:g,y:m}=VS(f,b,d)),k=-1)}return{x:g,y:m,placement:b,strategy:i,middlewareData:v}},qj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:l,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:k=!0,...w}=gi(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const S=$r(i),N=ls(c),_=$r(c)===c,A=await(d.isRTL==null?void 0:d.isRTL(f.floating)),L=b||(_||!k?[Bh(c)]:JD(c)),R=v!=="none";!b&&R&&L.push(...rj(c,k,v,A));const D=[c,...L],I=await d.detectOverflow(t,w),U=[];let z=((r=a.flip)==null?void 0:r.overflows)||[];if(g&&U.push(I[S]),m){const ee=ZD(i,l,A);U.push(I[ee[0]],I[ee[1]])}if(z=[...z,{placement:i,overflows:U}],!U.every(ee=>ee<=0)){var X,W;const ee=(((X=a.flip)==null?void 0:X.index)||0)+1,q=D[ee];if(q&&(!(m==="alignment"?N!==ls(q):!1)||z.every(Q=>ls(Q.placement)===N?Q.overflows[0]>0:!0)))return{data:{index:ee,overflows:z},reset:{placement:q}};let B=(W=z.filter(G=>G.overflows[0]<=0).sort((G,Q)=>G.overflows[1]-Q.overflows[1])[0])==null?void 0:W.placement;if(!B)switch(x){case"bestFit":{var V;const G=(V=z.filter(Q=>{if(R){const le=ls(Q.placement);return le===N||le==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(le=>le>0).reduce((le,M)=>le+M,0)]).sort((Q,le)=>Q[1]-le[1])[0])==null?void 0:V[0];G&&(B=G);break}case"initialPlacement":B=c;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function qS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function YS(e){return WD.some(t=>e[t]>=0)}const Yj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=gi(e,t);switch(i){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),c=qS(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:YS(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),c=qS(l,n.floating);return{data:{escapedOffsets:c,escaped:YS(c)}}}default:return{}}}}},M3=new Set(["left","top"]);async function Gj(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=$r(n),c=ma(n),d=ls(n)==="y",f=M3.has(l)?-1:1,g=a&&d?-1:1,m=gi(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:v}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof v=="number"&&(x=c==="end"?v*-1:v),d?{x:x*g,y:b*f}:{x:b*f,y:x*g}}const Kj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:l,middlewareData:c}=t,d=await Gj(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:a+d.y,data:{...d,placement:l}}}}},Xj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:N=>{let{x:_,y:A}=N;return{x:_,y:A}}},...f}=gi(e,t),g={x:n,y:r},m=await a.detectOverflow(t,f),b=ls(i),x=sx(b);let v=g[x],k=g[b];const w=(N,_)=>s3(_+m[N==="y"?"top":"left"],_,_-m[N==="y"?"bottom":"right"]);l&&(v=w(x,v)),c&&(k=w(b,k));const S=d.fn({...t,[x]:v,[b]:k});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[x]:l,[b]:c}}}}}},Wj=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:a,placement:l,rects:c,middlewareData:d}=t,{offset:f=0,mainAxis:g=!0,crossAxis:m=!0}=gi(e,t),b={x:i,y:a},x=ls(l),v=sx(x);let k=b[v],w=b[x];const S=gi(f,t),N=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(g){const L=v==="y"?"height":"width",R=c.reference[v]-c.floating[L]+N.mainAxis,D=c.reference[v]+c.reference[L]-N.mainAxis;k<R?k=R:k>D&&(k=D)}if(m){var _,A;const L=v==="y"?"width":"height",R=M3.has($r(l)),D=c.reference[x]-c.floating[L]+(R&&((_=d.offset)==null?void 0:_[x])||0)+(R?0:N.crossAxis),I=c.reference[x]+c.reference[L]+(R?0:((A=d.offset)==null?void 0:A[x])||0)-(R?N.crossAxis:0);w<D?w=D:w>I&&(w=I)}return{[v]:k,[x]:w}}}},Qj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:a}=t,{apply:l=()=>{},...c}=gi(e,t),d=await i.detectOverflow(t,c),f=$r(n),g=ma(n),m=ls(n)==="y",{width:b,height:x}=r.floating;let v,k;f==="top"||f==="bottom"?(v=f,k=g===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(k=f,v=g==="end"?"top":"bottom");const w=x-d.top-d.bottom,S=b-d.left-d.right,N=Fl(x-d[v],w),_=Fl(b-d[k],S),A=t.middlewareData.shift,L=!A;let R=N,D=_;A!=null&&A.enabled.x&&(D=S),A!=null&&A.enabled.y&&(R=w),L&&!g&&(m?D=b-2*hi(d.left,d.right):R=x-2*hi(d.top,d.bottom)),await l({...t,availableWidth:D,availableHeight:R});const I=await i.getDimensions(a.floating);return b!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function L3(e){const t=qr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cn(e),a=i?e.offsetWidth:n,l=i?e.offsetHeight:r,c=Ph(n)!==a||Ph(r)!==l;return c&&(n=a,r=l),{width:n,height:r,$:c}}function gx(e){return St(e)?e:e.contextElement}function Ml(e){const t=gx(e);if(!cn(t))return mi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=L3(t);let l=(a?Ph(n.width):n.width)/r,c=(a?Ph(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const Zj=mi(0);function D3(e){const t=sn(e);return!Q1()||!t.visualViewport?Zj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jj(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===sn(e)}function co(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=gx(e);let l=mi(1);t&&(r?St(r)&&(l=Ml(r)):l=Ml(e));const c=Jj(a,n,r)?D3(a):mi(0);let d=(i.left+c.x)/l.x,f=(i.top+c.y)/l.y,g=i.width/l.x,m=i.height/l.y;if(a&&r){const b=sn(a),x=St(r)?sn(r):r;let v=b,k=Hb(v);for(;k&&x!==v;){const w=Ml(k),S=k.getBoundingClientRect(),N=qr(k),_=S.left+(k.clientLeft+parseFloat(N.paddingLeft))*w.x,A=S.top+(k.clientTop+parseFloat(N.paddingTop))*w.y;d*=w.x,f*=w.y,g*=w.x,m*=w.y,d+=_,f+=A,v=sn(k),k=Hb(v)}}return Kc({width:g,height:m,x:d,y:f})}function _m(e,t){const n=xm(e).scrollLeft;return t?t.left+n:co(yi(e)).left+n}function j3(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-_m(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function e8(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",l=yi(r),c=t?bm(t.floating):!1;if(r===l||c&&a)return n;let d={scrollLeft:0,scrollTop:0},f=mi(1);const g=mi(0),m=cn(r);if((m||!a)&&((nr(r)!=="body"||wo(l))&&(d=xm(r)),m)){const x=co(r);f=Ml(r),g.x=x.x+r.clientLeft,g.y=x.y+r.clientTop}const b=l&&!m&&!a?j3(l,d):mi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+g.x+b.x,y:n.y*f.y-d.scrollTop*f.y+g.y+b.y}}function t8(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function n8(e){const t=xm(e),n=e.ownerDocument.body,r=hi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=hi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-t.scrollLeft+_m(e);const l=-t.scrollTop;return qr(n).direction==="rtl"&&(a+=hi(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:l}}const r8=25;function s8(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=sn(e),a=yi(e),l=i.visualViewport;let c=a.clientWidth,d=a.clientHeight,f=0,g=0;if(l){const b=!Q1()||t==="fixed";r?b||(f=-l.offsetLeft,g=-l.offsetTop):(c=l.width,d=l.height,b&&(f=l.offsetLeft,g=l.offsetTop))}if(_m(a)<=0){const b=a.ownerDocument,x=b.body,v=getComputedStyle(x),k=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(a.clientWidth-x.clientWidth-k),S=getComputedStyle(a).scrollbarGutter==="stable both-edges"?w/2:w;S<=r8&&(c-=S)}return{width:c,height:d,x:f,y:g}}function i8(e,t){const n=co(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ml(e),l=e.clientWidth*a.x,c=e.clientHeight*a.y,d=i*a.x,f=r*a.y;return{width:l,height:c,x:d,y:f}}function GS(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=s8(e,n,t);else if(t==="document")r=n8(yi(e));else if(St(t))r=i8(t,n);else{const i=D3(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kc(r)}function a8(e,t){const n=t.get(e);if(n)return n;let r=Yc(e,[],!1).filter(c=>St(c)&&nr(c)!=="body"),i=null;const a=qr(e).position==="fixed";let l=a?pi(e):e;for(;St(l)&&!fi(l);){const c=qr(l),d=W1(l),f=i?i.position:a?"fixed":"";!d&&(f==="fixed"||f==="absolute"&&c.position==="static")?r=r.filter(m=>m!==l):i=c,l=pi(l)}return t.set(e,r),r}function o8(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?bm(t)?[]:a8(t,this._c):[].concat(n),r],c=GS(t,l[0],i);let d=c.top,f=c.right,g=c.bottom,m=c.left;for(let b=1;b<l.length;b++){const x=GS(t,l[b],i);d=hi(x.top,d),f=Fl(x.right,f),g=Fl(x.bottom,g),m=hi(x.left,m)}return{width:f-m,height:g-d,x:m,y:d}}function l8(e){const{width:t,height:n}=L3(e);return{width:t,height:n}}function u8(e,t,n){const r=cn(t),i=yi(t),a=n==="fixed",l=co(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=mi(0);if((r||!a)&&((nr(t)!=="body"||wo(i))&&(c=xm(t)),r)){const b=co(t,!0,a,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}!r&&i&&(d.x=_m(i));const f=i&&!r&&!a?j3(i,c):mi(0),g=l.left+c.scrollLeft-d.x-f.x,m=l.top+c.scrollTop-d.y-f.y;return{x:g,y:m,width:l.width,height:l.height}}function B0(e){return qr(e).position==="static"}function KS(e,t){if(!cn(e)||qr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yi(e)===n&&(n=n.ownerDocument.body),n}function P3(e,t){const n=sn(e);if(bm(e))return n;if(!cn(e)){let i=pi(e);for(;i&&!fi(i);){if(St(i)&&!B0(i))return i;i=pi(i)}return n}let r=KS(e,t);for(;r&&wD(r)&&B0(r);)r=KS(r,t);return r&&fi(r)&&B0(r)&&!W1(r)?n:r||_D(e)||n}const c8=async function(e){const t=this.getOffsetParent||P3,n=this.getDimensions,r=await n(e.floating);return{reference:u8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function d8(e){return qr(e).direction==="rtl"}const B3={convertOffsetParentRelativeRectToViewportRelativeRect:e8,getDocumentElement:yi,getClippingRect:o8,getOffsetParent:P3,getElementRects:c8,getClientRects:t8,getDimensions:l8,getScale:Ml,isElement:St,isRTL:d8};function z3(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function f8(e,t,n){let r=null,i;const a=yi(e);function l(){var g;clearTimeout(i),(g=r)==null||g.disconnect(),r=null}function c(g,m){g===void 0&&(g=!1),m===void 0&&(m=1),l();const b=e.getBoundingClientRect(),{left:x,top:v,width:k,height:w}=b;if(g||t(),!k||!w)return;const S=Vf(v),N=Vf(a.clientWidth-(x+k)),_=Vf(a.clientHeight-(v+w)),A=Vf(x),R={rootMargin:-S+"px "+-N+"px "+-_+"px "+-A+"px",threshold:hi(0,Fl(1,m))||1};let D=!0;function I(U){const z=U[0].intersectionRatio;if(!z3(b,e.getBoundingClientRect()))return c();if(z!==m){if(!D)return c();z?c(!1,z):i=setTimeout(()=>{c(!1,1e-7)},1e3)}D=!1}try{r=new IntersectionObserver(I,{...R,root:a.ownerDocument})}catch{r=new IntersectionObserver(I,R)}r.observe(e)}const d=sn(e),f=()=>c(n);return d.addEventListener("resize",f),c(!0),()=>{d.removeEventListener("resize",f),l()}}function XS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=gx(e),g=i||a?[...f?Yc(f):[],...t?Yc(t):[]]:[];g.forEach(S=>{i&&S.addEventListener("scroll",n),a&&S.addEventListener("resize",n)});const m=f&&c?f8(f,n,a):null;let b=-1,x=null;l&&(x=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=x)==null||_.observe(t)})),n()}),f&&!d&&x.observe(f),t&&x.observe(t));let v,k=d?co(e):null;d&&w();function w(){const S=co(e);k&&!z3(k,S)&&n(),k=S,v=requestAnimationFrame(w)}return n(),()=>{var S;g.forEach(N=>{i&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),m?.(),(S=x)==null||S.disconnect(),x=null,d&&cancelAnimationFrame(v)}}const h8=Kj,m8=Xj,p8=qj,g8=Qj,b8=Yj,x8=Wj,y8=(e,t,n)=>{const r=new Map,i=n??{},a={...B3,...i.platform,_c:r};return Vj(e,t,{...i,platform:a})};var E8=typeof document<"u",v8=function(){},vh=E8?E.useLayoutEffect:v8;function Uh(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,i;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(!Uh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Uh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function H3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WS(e,t){const n=H3(e);return Math.round(t*n)/n}function z0(e){const t=E.useRef(e);return vh(()=>{t.current=e}),t}function T8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[g,m]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=E.useState(r);Uh(b,r)||x(r);const[v,k]=E.useState(null),[w,S]=E.useState(null),N=E.useCallback(Q=>{Q!==R.current&&(R.current=Q,k(Q))},[]),_=E.useCallback(Q=>{Q!==D.current&&(D.current=Q,S(Q))},[]),A=a||v,L=l||w,R=E.useRef(null),D=E.useRef(null),I=E.useRef(g),U=d!=null,z=z0(d),X=z0(i),W=z0(f),V=E.useCallback(()=>{if(!R.current||!D.current)return;const Q={placement:t,strategy:n,middleware:b};X.current&&(Q.platform=X.current),y8(R.current,D.current,Q).then(le=>{const M={...le,isPositioned:W.current!==!1};ee.current&&!Uh(I.current,M)&&(I.current=M,lr.flushSync(()=>{m(M)}))})},[b,t,n,X,W]);vh(()=>{f===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(Q=>({...Q,isPositioned:!1})))},[f]);const ee=E.useRef(!1);vh(()=>(ee.current=!0,()=>{ee.current=!1}),[]),vh(()=>{if(A&&(R.current=A),L&&(D.current=L),A&&L){if(z.current)return z.current(A,L,V);V()}},[A,L,V,z,U]);const q=E.useMemo(()=>({reference:R,floating:D,setReference:N,setFloating:_}),[N,_]),B=E.useMemo(()=>({reference:A,floating:L}),[A,L]),G=E.useMemo(()=>{const Q={position:n,left:0,top:0};if(!B.floating)return Q;const le=WS(B.floating,g.x),M=WS(B.floating,g.y);return c?{...Q,transform:"translate("+le+"px, "+M+"px)",...H3(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:le,top:M}},[n,c,B.floating,g.x,g.y]);return E.useMemo(()=>({...g,update:V,refs:q,elements:B,floatingStyles:G}),[g,V,q,B,G])}const S8=(e,t)=>{const n=h8(e);return{name:n.name,fn:n.fn,options:[e,t]}},C8=(e,t)=>{const n=m8(e);return{name:n.name,fn:n.fn,options:[e,t]}},w8=(e,t)=>({fn:x8(e).fn,options:[e,t]}),k8=(e,t)=>{const n=p8(e);return{name:n.name,fn:n.fn,options:[e,t]}},N8=(e,t)=>{const n=g8(e);return{name:n.name,fn:n.fn,options:[e,t]}},_8=(e,t)=>{const n=b8(e);return{name:n.name,fn:n.fn,options:[e,t]}},A8={open:Be(e=>e.open),transitionStatus:Be(e=>e.transitionStatus),domReferenceElement:Be(e=>e.domReferenceElement),referenceElement:Be(e=>e.positionReference??e.referenceElement),floatingElement:Be(e=>e.floatingElement),floatingId:Be(e=>e.floatingId)};class Am extends pm{constructor(t){const{syncOnly:n,nested:r,onOpenChange:i,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:A3(),nested:r,triggerElements:a},A8),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&BD(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 U3(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:l}=e,c=t.useState("open"),d=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),g=t.context.triggerElements,m=l,b=E.useRef(null);r===void 0&&b.current===null&&(b.current=new Am({open:c,transitionStatus:void 0,referenceElement:d,floatingElement:f,triggerElements:g,onOpenChange:m,floatingId:i,syncOnly:!0,nested:a}));const x=r??b.current;return t.useSyncedValue("floatingId",i),Ye(()=>{const v={open:c,floatingId:i,referenceElement:d,floatingElement:f};St(d)&&(v.domReferenceElement=d),x.state.positionReference===x.state.referenceElement&&(v.positionReference=d),x.update(v)},[c,i,d,f,x]),x.context.onOpenChange=m,x.context.nested=a,x}function bx(e,t=!1,n=!1){const[r,i]=E.useState(e&&t?"idle":void 0),[a,l]=E.useState(e);return e&&!a&&(l(!0),i("starting")),!e&&a&&r!=="ending"&&!n&&i("ending"),!e&&!a&&r==="ending"&&i(void 0),Ye(()=>{if(!e&&a&&r!=="ending"&&n){const c=Rs.request(()=>{i("ending")});return()=>{Rs.cancel(c)}}},[e,a,r,n]),Ye(()=>{if(!e||t)return;const c=Rs.request(()=>{i(void 0)});return()=>{Rs.cancel(c)}},[t,e]),Ye(()=>{if(!e||!t)return;e&&a&&r!=="idle"&&i("starting");const c=Rs.request(()=>{i("idle")});return()=>{Rs.cancel(c)}},[t,e,a,r]),{mounted:a,setMounted:l,transitionStatus:r}}let Wc=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const R8={[Wc.startingStyle]:""},O8={[Wc.endingStyle]:""},Zl={transitionStatus(e){return e==="starting"?R8:e==="ending"?O8:null}};function F3(e,t=!1,n=!0){const r=zl();return tt((i,a=null)=>{r.cancel();const l=ai(e);if(l==null)return;const c=l,d=()=>{lr.flushSync(i)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function f(){Promise.all(c.getAnimations().map(g=>g.finished)).then(()=>{a?.aborted||d()}).catch(()=>{if(n){a?.aborted||d();return}const g=c.getAnimations();!a?.aborted&&g.length>0&&g.some(m=>m.pending||m.playState!=="finished")&&f()})}if(t){const g=Wc.startingStyle;if(!c.hasAttribute(g)){r.request(f);return}const m=new MutationObserver(()=>{c.hasAttribute(g)||(m.disconnect(),f())});m.observe(c,{attributes:!0,attributeFilter:[g]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(f)})}function ko(e){const{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=tt(i),l=F3(r,n,!1);E.useEffect(()=>{if(!t)return;const c=new AbortController;return l(a,c.signal),()=>{c.abort()}},[t,n,a,l])}const Rm={tabIndex:-1,[Fb]:""};function I8(e){return t=>t==="touch"?e.current:!0}function $3(e,t,n=!1){const r=uo(),i=pa()!=null,a=E.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,i));const l=e??a.current;return U3({popupStore:l,treatPopupAsFloatingElement:n,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:l.setOpen}),{store:l,internalStore:a.current}}function M8(e,t){const n=E.useRef(null),r=E.useRef(null);return E.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){const l=n.current,c=r.current,d=t.context.triggerElements.getById(l);c&&d===c&&(t.context.triggerElements.delete(l),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){const l=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==l&&t.set("triggerCount",l)}},[t,e])}function xx(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function V3(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function L8(e,t,n,r={}){const i=n.reason,a=i===qn,l=t&&i===Ol,c=!t&&(i===Ql||i===wm),d=V3(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const f=()=>{const g={...r.extraState,open:t};l?g.instantType="focus":c?g.instantType="dismiss":a&&(g.instantType=void 0),xx(g,t,n.trigger,d()),e.update(g)};a?lr.flushSync(f):f()}function q3(e,t,n,r){q1(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function yx(e,t,n,r){const i=n.useState("isMountedByTrigger",e),a=M8(e,n),l=tt(c=>{if(a(c),!c)return;const d=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...d?r:null});return}f==null&&d&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return Ye(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:i}}function Ex(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),i=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 c=e.select("activeTriggerId");let d=null;if(c){const f=e.context.triggerElements.getById(c);f?f!==e.state.activeTriggerElement&&(l.activeTriggerElement=f):d=c}if(!d&&!c&&a===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[g,m]=f.value;l.activeTriggerId=g,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 f=mt(Wl);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,i,n])}function vx(e,t,n){const{mounted:r,setMounted:i,transitionStatus:a}=bx(e),l=t.useState("preventUnmountingOnClose"),c=e?!1:l;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:c});const d=tt(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return ko({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:a}}function Tx(e,t){e.useSyncedValues(t),Ye(()=>()=>{e.update({activeTriggerProps:dn,inactiveTriggerProps:dn,popupProps:dn})},[e])}function D8(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 ad{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 j8(){return new Am({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new ad,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Sx(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:j8(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:dn,inactiveTriggerProps:dn,popupProps:dn}}function Y3(e,t,n=!1){return new Am({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const Ac=Be(e=>e.triggerIdProp??e.activeTriggerId),Cx=Be(e=>e.openProp??e.open),QS=Be(e=>(e.popupElement?.id??e.floatingId)||void 0);function G3(e,t){return t!==void 0&&Cx(e)&&Ac(e)===t}function P8(e,t){return G3(e,t)?!0:t!==void 0&&Cx(e)&&Ac(e)==null&&e.triggerCount===1}const wx={open:Cx,mounted:Be(e=>e.mounted),transitionStatus:Be(e=>e.transitionStatus),floatingRootContext:Be(e=>e.floatingRootContext),triggerCount:Be(e=>e.triggerCount),preventUnmountingOnClose:Be(e=>e.preventUnmountingOnClose),payload:Be(e=>e.payload),activeTriggerId:Ac,activeTriggerElement:Be(e=>e.mounted?e.activeTriggerElement:null),popupId:QS,isTriggerActive:Be((e,t)=>t!==void 0&&Ac(e)===t),isOpenedByTrigger:Be((e,t)=>G3(e,t)),isMountedByTrigger:Be((e,t)=>t!==void 0&&Ac(e)===t&&e.mounted),triggerProps:Be((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Be((e,t)=>P8(e,t)?QS(e):void 0),popupProps:Be(e=>e.popupProps),popupElement:Be(e=>e.popupElement),positionerElement:Be(e=>e.positionerElement)};function K3(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=uo(),a=pa()!=null,l=xr(()=>new Am({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new ad,floatingId:i,syncOnly:!1,nested:a})).current;return Ye(()=>{const c={open:t,floatingId:i};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=St(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,i,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l}function B8(e={}){const{nodeId:t,externalTree:n}=e,r=K3(e),i=e.rootContext||r,a=i.useState("referenceElement"),l=i.useState("floatingElement"),c=i.useState("domReferenceElement"),d=i.useState("open"),f=i.useState("floatingId"),[g,m]=E.useState(null),[b,x]=E.useState(void 0),[v,k]=E.useState(void 0),w=E.useRef(null),S=ga(n),N=E.useMemo(()=>({reference:a,floating:l,domReference:c}),[a,l,c]),_=T8({...e,elements:{...N,...g&&{reference:g}}}),A=St(b)?b:null,L=v===void 0?i.state.floatingElement:v;i.useSyncedValue("referenceElement",b??null),i.useSyncedValue("domReferenceElement",b===void 0?c:A),i.useSyncedValue("floatingElement",L);const R=E.useCallback(W=>{const V=St(W)?{getBoundingClientRect:()=>W.getBoundingClientRect(),getClientRects:()=>W.getClientRects(),contextElement:W}:W;m(V),_.refs.setReference(V)},[_.refs]),D=E.useCallback(W=>{(St(W)||W===null)&&(w.current=W,x(W)),(St(_.refs.reference.current)||_.refs.reference.current===null||W!==null&&!St(W))&&_.refs.setReference(W)},[_.refs,x]),I=E.useCallback(W=>{k(W),_.refs.setFloating(W)},[_.refs]),U=E.useMemo(()=>({..._.refs,setReference:D,setFloating:I,setPositionReference:R,domReference:w}),[_.refs,D,I,R]),z=E.useMemo(()=>({..._.elements,domReference:c}),[_.elements,c]),X=E.useMemo(()=>({..._,dataRef:i.context.dataRef,open:d,onOpenChange:i.setOpen,events:i.context.events,floatingId:f,refs:U,elements:z,nodeId:t,rootStore:i}),[_,U,z,t,i,d,f]);return Ye(()=>{c&&(w.current=c)},[c]),Ye(()=>{i.context.dataRef.current.floatingContext=X;const W=S?.nodesRef.current.find(V=>V.id===t);W&&(W.context=X)}),E.useMemo(()=>({..._,context:X,refs:U,elements:z,rootStore:i}),[_,U,z,X,i])}const H0=J1&&ha;function X3(e,t={}){const{enabled:n=!0,delay:r}=t,i="rootStore"in e?e.rootStore:e,{events:a,dataRef:l}=i.context,c=E.useRef(!1),d=E.useRef(null),f=E.useRef(!0),g=Gn();E.useEffect(()=>{const b=i.select("domReferenceElement");if(!n)return;const x=sn(b);function v(){const S=i.select("domReferenceElement");!i.select("open")&&cn(S)&&S===Rr(_t(S))&&(c.current=!0)}function k(){f.current=!0}function w(){f.current=!1}return Ps(Tt(x,"blur",v),H0&&Tt(x,"keydown",k,!0),H0&&Tt(x,"pointerdown",w,!0))},[i,n]),E.useEffect(()=>{if(!n)return;function b(x){if(x.reason===Ql||x.reason===wm){const v=i.select("domReferenceElement");St(v)&&(d.current=v,c.current=!0)}}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,n,i]);const m=E.useMemo(()=>{function b(){c.current=!1,d.current=null}return{onMouseLeave(){b()},onFocus(x){const v=x.currentTarget;if(c.current){if(d.current===v)return;b()}const k=gr(x.nativeEvent);if(St(k)){if(H0&&!x.relatedTarget){if(!f.current&&!Sm(k))return}else if(!UD(k))return}const w=Dh(x.relatedTarget,i.context.triggerElements),{nativeEvent:S,currentTarget:N}=x,_=typeof r=="function"?r():r;if(i.select("open")&&w||_===0||_===void 0){i.setOpen(!0,mt(Ol,S,N));return}g.start(_,()=>{c.current||i.setOpen(!0,mt(Ol,S,N))})},onBlur(x){b();const v=x.relatedTarget,k=x.nativeEvent,w=St(v)&&v.hasAttribute(Xc("focus-guard"))&&v.getAttribute("data-type")==="outside";g.start(0,()=>{const S=i.select("domReferenceElement"),N=Rr(_t(S));!v&&N===S||nt(l.current.floatingContext?.refs.floating.current,N)||nt(S,N)||w||Dh(v??N,i.context.triggerElements)||i.setOpen(!1,mt(Ol,k))})}}},[l,r,i,g]);return E.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}class kx{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 gs,this.restTimeout=new gs,this.handleCloseOptions=void 0}static create(){return new kx}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Fh=new WeakMap;function $h(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Fh.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Fh.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function W3(e,t){const{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Fh.get(n);a&&a!==e&&$h(a),$h(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Fh.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function Nx(e){const t=e.context.dataRef.current,n=xr(()=>t.hoverInteractionState??kx.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),Z1(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Q3(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a="rootStore"in e?e.rootStore:e,l=a.useState("open"),c=a.useState("floatingElement"),d=a.useState("domReferenceElement"),{dataRef:f}=a.context,g=ga(),m=pa(),b=Nx(a),x=Gn(),v=tt(()=>t3(f.current.openEvent?.type,b.interactedInside)),k=tt(()=>$D(f.current.openEvent?.type)),w=tt(()=>{$h(b)});Ye(()=>{l||(b.pointerType=void 0,b.restTimeoutPending=!1,b.interactedInside=!1,w())},[l,b,w]),E.useEffect(()=>w,[w]),Ye(()=>{if(n&&l&&b.handleCloseOptions?.blockPointerEvents&&k()&&St(d)&&c){const S=d,N=c,_=_t(c),A=g?.nodesRef.current.find(I=>I.id===m)?.context?.elements.floating;A&&(A.style.pointerEvents="");const L=b.pointerEventsScopeElement!==N?b.pointerEventsScopeElement:null,R=A!==N?A:null,D=b.handleCloseOptions?.getScope?.()??L??R??S.closest("[data-rootownerid]")??_.body;return W3(b,{scopeElement:D,referenceElement:S,floatingElement:N}),()=>{w()}}},[n,l,d,c,b,k,g,m,w]),E.useEffect(()=>{if(!n)return;function S(){return!!(g&&m&&oa(g.nodesRef.current,m).length>0)}function N(I){const U=Hl(r,"close",b.pointerType),z=()=>{a.setOpen(!1,mt(qn,I)),g?.events.emit("floating.closed",I)};U?b.openChangeTimeout.start(U,z):(b.openChangeTimeout.clear(),z())}function _(I){const U=gr(I);if(!HD(U)){b.interactedInside=!1;return}b.interactedInside=U?.closest("[aria-haspopup]")!=null}function A(){b.openChangeTimeout.clear(),x.clear(),g?.events.off("floating.closed",R),w()}function L(I){if(S()&&g){g.events.on("floating.closed",R);return}if(Dh(I.relatedTarget,a.context.triggerElements))return;const U=f.current.floatingContext?.nodeId??i,z=I.relatedTarget;if(!(g&&U&&St(z)&&oa(g.nodesRef.current,U,!1).some(W=>nt(W.context?.elements.floating,z)))){if(b.handler){b.handler(I);return}w(),k()&&!v()&&N(I)}}function R(I){!g||!m||S()||x.start(0,()=>{g.events.off("floating.closed",R),a.setOpen(!1,mt(qn,I)),g.events.emit("floating.closed",I)})}const D=c;return Ps(D&&Tt(D,"mouseenter",A),D&&Tt(D,"mouseleave",L),D&&Tt(D,"pointerdown",_,!0),()=>{g?.events.off("floating.closed",R)})},[n,c,a,f,r,i,k,v,w,b,g,m,x])}const z8={current:null};function Z3(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:l=0,move:c=!0,triggerElementRef:d=z8,externalTree:f,isActiveTrigger:g=!0,getHandleCloseContext:m,isClosing:b,shouldOpen:x}=t,v="rootStore"in e?e.rootStore:e,{dataRef:k,events:w}=v.context,S=ga(f),N=Nx(v),_=E.useRef(!1),A=En(i),L=En(r),R=En(l),D=En(n),I=En(x),U=En(b),z=tt(()=>t3(k.current.openEvent?.type,N.interactedInside)),X=tt(()=>I.current?.()!==!1),W=tt((q,B,G)=>{const Q=v.context.triggerElements;if(Q.hasElement(B))return!q||!nt(q,B);if(!St(G))return!1;const le=G;return Q.hasMatchingElement(M=>nt(M,le))&&(!q||!nt(q,le))}),V=tt(()=>{if(!N.handler)return;_t(v.select("domReferenceElement")).removeEventListener("mousemove",N.handler),N.handler=void 0}),ee=tt(()=>{$h(N)});return g&&(N.handleCloseOptions=A.current?.__options),E.useEffect(()=>V,[V]),E.useEffect(()=>{if(!n)return;function q(B){B.open?_.current=!1:(_.current=B.reason===qn,V(),N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1)}return w.on("openchange",q),()=>{w.off("openchange",q)}},[n,w,N,V]),E.useEffect(()=>{if(!n)return;function q(le,M=!0){const P=Hl(L.current,"close",N.pointerType);P?N.openChangeTimeout.start(P,()=>{v.setOpen(!1,mt(qn,le)),S?.events.emit("floating.closed",le)}):M&&(N.openChangeTimeout.clear(),v.setOpen(!1,mt(qn,le)),S?.events.emit("floating.closed",le))}const B=d.current??(g?v.select("domReferenceElement"):null);if(!St(B))return;function G(le){if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,a&&!oo(N.pointerType))return;const M=CS(R.current),P=Hl(L.current,"open",N.pointerType),F=gr(le),j=le.currentTarget??null,ae=v.select("domReferenceElement");let ie=j;if(St(F)&&!v.context.triggerElements.hasElement(F)){for(const ze of v.context.triggerElements.elements())if(nt(ze,F)){ie=ze;break}}St(j)&&St(ae)&&!v.context.triggerElements.hasElement(j)&&nt(j,ae)&&(ie=ae);const ce=ie==null?!1:W(ae,ie,F),de=v.select("open"),fe=U.current?.()??v.select("transitionStatus")==="ending",ve=!de&&fe&&_.current,Fe=!ce&&St(ie)&&St(ae)&&nt(ae,ie)&&ve,Le=M>0&&!P,Ee=ce&&(de||ve)||Fe,Oe=!de||ce;if(Ee){X()&&v.setOpen(!0,mt(qn,le,ie));return}Le||(P?N.openChangeTimeout.start(P,()=>{Oe&&X()&&v.setOpen(!0,mt(qn,le,ie))}):Oe&&X()&&v.setOpen(!0,mt(qn,le,ie)))}function Q(le){if(z()){ee();return}V();const M=v.select("domReferenceElement"),P=_t(M);N.restTimeout.clear(),N.restTimeoutPending=!1;const F=k.current.floatingContext??m?.();if(Dh(le.relatedTarget,v.context.triggerElements))return;if(A.current&&F){v.select("open")||N.openChangeTimeout.clear();const ae=d.current;N.handler=A.current({...F,tree:S,x:le.clientX,y:le.clientY,onClose(){ee(),V(),D.current&&!z()&&ae===v.select("domReferenceElement")&&q(le,!0)}}),P.addEventListener("mousemove",N.handler),N.handler(le);return}(N.pointerType==="touch"?!nt(v.select("floatingElement"),le.relatedTarget):!0)&&q(le)}return c?Ps(Tt(B,"mousemove",G,{once:!0}),Tt(B,"mouseenter",G),Tt(B,"mouseleave",Q)):Ps(Tt(B,"mouseenter",G),Tt(B,"mouseleave",Q))},[V,ee,k,L,v,n,A,N,g,W,z,a,c,R,d,S,D,m,U,X]),E.useMemo(()=>{if(!n)return;function q(B){N.pointerType=B.pointerType}return{onPointerDown:q,onPointerEnter:q,onMouseMove(B){const{nativeEvent:G}=B,Q=B.currentTarget,le=v.select("domReferenceElement"),M=v.select("open"),P=W(le,Q,B.target);if(a&&!oo(N.pointerType))return;if(M&&P&&N.handleCloseOptions?.blockPointerEvents){const ae=v.select("floatingElement");if(ae){const ie=N.handleCloseOptions?.getScope?.()??Q.ownerDocument.body;W3(N,{scopeElement:ie,referenceElement:Q,floatingElement:ae})}}const F=CS(R.current);if(M&&!P||F===0||!P&&N.restTimeoutPending&&B.movementX**2+B.movementY**2<2)return;N.restTimeout.clear();function j(){if(N.restTimeoutPending=!1,z())return;const ae=v.select("open");!N.blockMouseMove&&(!ae||P)&&X()&&v.setOpen(!0,mt(qn,G,Q))}N.pointerType==="touch"?lr.flushSync(()=>{j()}):P&&M?j():(N.restTimeoutPending=!0,N.restTimeout.start(F,j))}}},[n,N,z,W,a,v,R,X])}const H8="Escape";function Om(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Yf(e,t){return Om(t,e===e3||e===nx,e===vm||e===Tm)}function U0(e,t,n){return Om(t,e===nx,n?e===vm:e===Tm)||e==="Enter"||e===" "||e===""}function U8(e,t,n){return Om(t,n?e===vm:e===Tm,e===nx)}function F8(e,t,n,r){const i=n?e===Tm:e===vm,a=e===e3;return t==="both"||t==="horizontal"&&r?e===H8:Om(t,i,a)}function J3(e,t){const{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:l=null,allowEscape:c=!1,loopFocus:d=!1,nested:f=!1,rtl:g=!1,virtual:m=!1,focusItemOnOpen:b="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:v=!0,disabledIndices:k=void 0,orientation:w="vertical",parentOrientation:S,id:N,resetOnPointerLeave:_=!0,externalTree:A,grid:L}=t,R=L!=null,D="rootStore"in e?e.rootStore:e,I=D.useState("open"),U=D.useState("floatingElement"),z=D.useState("domReferenceElement"),X=D.context.dataRef,W=jh(U),V=$b(z),ee=En(W),q=pa(),B=ga(A),G=E.useRef(b),Q=E.useRef(l??-1),le=E.useRef(null),M=E.useRef(!0),P=tt(Z=>{i(Q.current===-1?null:Q.current,Z)}),F=E.useRef(!!U),j=E.useRef(I),ae=E.useRef(!1),ie=E.useRef(!1),ce=E.useRef(null),de=En(k),fe=En(I),ve=En(l),Fe=En(_),Le=zl(),Ee=zl(),Oe=tt(()=>{function Z(oe){m?B?.events.emit("virtualfocus",oe):ce.current=Eh(oe,{sync:ae.current,preventScroll:!0})}const re=n.current[Q.current],K=ie.current;re&&Z(re),(ae.current?oe=>oe():oe=>Le.request(oe))(()=>{const oe=n.current[Q.current]||re;if(!oe)return;re||Z(oe),ye&&(K||!M.current)&&oe.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Ye(()=>{X.current.orientation=w},[X,w]),Ye(()=>{a&&(I&&U?(Q.current=l??-1,G.current&&l!=null&&(ie.current=!0,P())):F.current&&(Q.current=-1,P()))},[a,I,U,l,P]),Ye(()=>{if(a){if(!I){ae.current=!1;return}if(U)if(r==null){if(ae.current=!1,ve.current!=null)return;if(F.current&&(Q.current=-1,Oe()),(!j.current||!F.current)&&G.current&&(le.current!=null||G.current===!0&&le.current==null)){let Z=0;const re=()=>{n.current[0]==null?(Z<2&&(Z?$=>Ee.request($):queueMicrotask)(re),Z+=1):(Q.current=le.current==null||U0(le.current,w,g)||f?L0(n):_S(n),le.current=null,P())};re()}}else NS(n.current,r)||(Q.current=r,Oe(),ie.current=!1)}},[a,I,U,r,ve,f,n,w,g,P,Oe,Ee]),Ye(()=>{if(!a||U||!B||m||!F.current)return;const Z=B.nodesRef.current,re=Z.find(oe=>oe.id===q)?.context?.elements.floating,K=Rr(_t(z??re??null)),$=Z.some(oe=>oe.context&&nt(oe.context.elements.floating,K));re&&!$&&M.current&&re.focus({preventScroll:!0})},[a,U,z,B,q,m]),Ye(()=>{j.current=I,F.current=!!U}),Ye(()=>{I||(le.current=null,G.current=b)},[I,b]);const ze=r!=null,Ge=tt(Z=>{if(!fe.current)return;const re=n.current.indexOf(Z.currentTarget);re!==-1&&(Q.current!==re||r!==re)&&(Q.current=re,P(Z))}),$e=tt(()=>S??B?.nodesRef.current.find(Z=>Z.id===q)?.context?.dataRef?.current.orientation),De=tt(()=>L0(n,de.current)),ke=tt(Z=>{if(M.current=!1,ae.current=!0,Z.which===229||!fe.current&&Z.currentTarget===ee.current)return;if(f&&F8(Z.key,w,g,R)){Yf(Z.key,$e())||As(Z),D.setOpen(!1,mt(Vb,Z.nativeEvent)),cn(z)&&(m?B?.events.emit("virtualfocus",z):z.focus());return}const re=Q.current,K=L0(n,k),$=_S(n,k);if(V||(Z.key==="Home"&&(As(Z),Q.current=K,P(Z)),Z.key==="End"&&(As(Z),Q.current=$,P(Z))),L!=null){const oe=L(Z,Q.current,n,w,d,g,k,K,$);if(oe!=null&&(Q.current=oe,P(Z)),w==="both")return}if(Yf(Z.key,w)){if(As(Z),I&&!m&&Rr(Z.currentTarget.ownerDocument)===Z.currentTarget){Q.current=U0(Z.key,w,g)?K:$,P(Z);return}U0(Z.key,w,g)?d?re>=$?c&&re!==n.current.length?Q.current=-1:(ae.current=!1,Q.current=K):Q.current=Nl(n.current,{startingIndex:re,disabledIndices:k}):Q.current=Math.min($,Nl(n.current,{startingIndex:re,disabledIndices:k})):d?re<=K?c&&re!==-1?Q.current=n.current.length:(ae.current=!1,Q.current=$):Q.current=Nl(n.current,{startingIndex:re,decrement:!0,disabledIndices:k}):Q.current=Math.max(K,Nl(n.current,{startingIndex:re,decrement:!0,disabledIndices:k})),NS(n.current,Q.current)&&(Q.current=-1),P(Z)}}),ye=E.useMemo(()=>({onFocus(re){ae.current=!0,Ge(re)},onClick:({currentTarget:re})=>re.focus({preventScroll:!0}),onMouseMove(re){ae.current=!0,ie.current=!1,x&&Ge(re)},onPointerLeave(re){if(!fe.current||!M.current||re.pointerType==="touch")return;ae.current=!0;const K=re.relatedTarget;if(!(!x||n.current.includes(K))&&Fe.current&&(ce.current?.(),ce.current=null,Q.current=-1,P(re),!m)){const $=ee.current,oe=Rr(_t($));$&&nt($,oe)&&$.focus({preventScroll:!0})}}}),[Ge,fe,ee,x,n,P,Fe,m]),Ie=E.useMemo(()=>m&&I&&ze&&{"aria-activedescendant":`${N}-${r}`},[m,I,ze,N,r]),je=E.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...V?{}:Ie,onKeyDown(Z){if(Z.key==="Tab"&&Z.shiftKey&&I&&!m){const re=gr(Z.nativeEvent);if(re&&!nt(ee.current,re))return;As(Z),D.setOpen(!1,mt(lo,Z.nativeEvent)),cn(z)&&z.focus();return}ke(Z)},onPointerMove(){M.current=!0}}),[Ie,ke,ee,w,V,D,I,m,z]),te=E.useMemo(()=>{function Z($){D.setOpen(!0,mt(Vb,$.nativeEvent,$.currentTarget))}function re($){b==="auto"&&tx($.nativeEvent)&&(G.current=!m)}function K($){G.current=b,b==="auto"&&ZN($.nativeEvent)&&(G.current=!0)}return{onKeyDown($){const oe=D.select("open");M.current=!1;const Ce=$.key.startsWith("Arrow"),Re=U8($.key,$e(),g),Ve=Yf($.key,w),ot=(f?Re:Ve)||$.key==="Enter"||$.key.trim()==="";if(m&&oe)return ke($);if(!(!oe&&!v&&Ce)){if(ot){const et=Yf($.key,$e());le.current=f&&et?null:$.key}if(f){Re&&(As($),oe?(Q.current=De(),P($)):Z($));return}Ve&&(ve.current!=null&&(Q.current=ve.current),As($),!oe&&v?Z($):ke($),oe&&P($))}},onFocus($){D.select("open")&&!m&&(Q.current=-1,P($))},onPointerDown:K,onPointerEnter:K,onMouseDown:re,onClick:re}},[ke,b,De,f,P,D,v,w,$e,g,ve,m]),me=E.useMemo(()=>({...Ie,...te}),[Ie,te]);return E.useMemo(()=>a?{reference:me,floating:je,item:ye,trigger:te}:{},[a,me,je,te,ye])}function e_(e,t){const{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:l,onTyping:c,enabled:d=!0,resetMs:f=750,selectedIndex:g=null}=t,m="rootStore"in e?e.rootStore:e,b=m.useState("open"),x=Gn(),v=E.useRef(""),k=E.useRef(g??i??-1),w=E.useRef(null),S=tt(A=>{function L(ee){const q=r?.current[ee];return!q||km(q)}function R(ee){return L(ee)?l==null||!a3(Pl,ee,l):!1}function D(ee,q,B=0){if(ee.length===0)return-1;const G=(B%ee.length+ee.length)%ee.length,Q=q.toLowerCase();for(let le=0;le<ee.length;le+=1){const M=(G+le)%ee.length;if(!(!ee[M]?.toLowerCase().startsWith(Q)||!R(M)))return M}return-1}const I=n.current;if(v.current.length>0&&A.key===" "&&(As(A),c?.(!0)),v.current.length>0&&v.current[0]!==" "&&D(I,v.current)===-1&&A.key!==" "&&c?.(!1),I==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;b&&A.key!==" "&&(As(A),c?.(!0));const U=v.current==="";U&&(k.current=g??i??-1),I.every((ee,q)=>ee&&R(q)?ee[0]?.toLowerCase()!==ee[1]?.toLowerCase():!0)&&v.current===A.key&&(v.current="",k.current=w.current),v.current+=A.key,x.start(f,()=>{v.current="",k.current=w.current,c?.(!1)});const W=((U?g??i??-1:k.current)??0)+1,V=D(I,v.current,W);V!==-1?(a?.(V),w.current=V):A.key!==" "&&(v.current="",c?.(!1))}),N=tt(A=>{const L=A.relatedTarget,R=m.select("domReferenceElement"),D=m.select("floatingElement");nt(R,L)||nt(D,L)||(x.clear(),v.current="",k.current=w.current,c?.(!1))});Ye(()=>{!b&&g!==null||(x.clear(),w.current=null,v.current!==""&&(v.current=""))},[b,g,x]),Ye(()=>{b&&v.current===""&&(k.current=g??i??-1)},[b,g,i]);const _=E.useMemo(()=>({onKeyDown:S,onBlur:N}),[S,N]);return E.useMemo(()=>d?{reference:_,floating:_}:{},[d,_])}const ZS=.1,$8=ZS*ZS,Xt=.5;function Gf(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Kf(e,t,n,r,i,a,l,c,d,f){let g=!1;return Gf(e,t,n,r,i,a)&&(g=!g),Gf(e,t,i,a,l,c)&&(g=!g),Gf(e,t,l,c,d,f)&&(g=!g),Gf(e,t,d,f,n,r)&&(g=!g),g}function V8(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Xf(e,t,n,r,i,a){const l=Math.min(n,i),c=Math.max(n,i),d=Math.min(r,a),f=Math.max(r,a);return e>=l&&e<=c&&t>=d&&t<=f}function t_(e={}){const{blockPointerEvents:t=!1}=e,n=new gs,r=({x:i,y:a,placement:l,elements:c,onClose:d,nodeId:f,tree:g})=>{const m=l?.split("-")[0];let b=!1,x=null,v=null,k=typeof performance<"u"?performance.now():0;function w(N,_){const A=performance.now(),L=A-k;if(x===null||v===null||L===0)return x=N,v=_,k=A,!1;const R=N-x,D=_-v,I=R*R+D*D,U=L*L*$8;return x=N,v=_,k=A,I<U}function S(){n.clear(),d()}return function(_){n.clear();const A=c.domReference,L=c.floating;if(!A||!L||m==null||i==null||a==null)return;const{clientX:R,clientY:D}=_,I=gr(_),U=_.type==="mouseleave",z=nt(L,I),X=nt(A,I);if(z&&(b=!0,!U))return;if(X&&(b=!1,!U)){b=!0;return}if(U&&St(_.relatedTarget)&&nt(L,_.relatedTarget))return;function W(){return!!(g&&oa(g.nodesRef.current,f).length>0)}function V(){W()||S()}if(W())return;const ee=A.getBoundingClientRect(),q=L.getBoundingClientRect(),B=i>q.right-q.width/2,G=a>q.bottom-q.height/2,Q=q.width>ee.width,le=q.height>ee.height,M=(Q?ee:q).left,P=(Q?ee:q).right,F=(le?ee:q).top,j=(le?ee:q).bottom;if(m==="top"&&a>=ee.bottom-1||m==="bottom"&&a<=ee.top+1||m==="left"&&i>=ee.right-1||m==="right"&&i<=ee.left+1){V();return}let ae=!1;switch(m){case"top":ae=Xf(R,D,M,ee.top+1,P,q.bottom-1);break;case"bottom":ae=Xf(R,D,M,q.top+1,P,ee.bottom-1);break;case"left":ae=Xf(R,D,q.right-1,j,ee.left+1,F);break;case"right":ae=Xf(R,D,ee.right-1,j,q.left+1,F);break}if(ae)return;if(b&&!V8(R,D,ee)){V();return}if(!U&&w(R,D)){V();return}let ie=!1;switch(m){case"top":{const ce=Q?Xt/2:Xt*4,de=Q||B?i+ce:i-ce,fe=Q?i-ce:B?i+ce:i-ce,ve=a+Xt+1,Fe=B||Q?q.bottom-Xt:q.top,Le=B?Q?q.bottom-Xt:q.top:q.bottom-Xt;ie=Kf(R,D,de,ve,fe,ve,q.left,Fe,q.right,Le);break}case"bottom":{const ce=Q?Xt/2:Xt*4,de=Q||B?i+ce:i-ce,fe=Q?i-ce:B?i+ce:i-ce,ve=a-Xt,Fe=B||Q?q.top+Xt:q.bottom,Le=B?Q?q.top+Xt:q.bottom:q.top+Xt;ie=Kf(R,D,de,ve,fe,ve,q.left,Fe,q.right,Le);break}case"left":{const ce=le?Xt/2:Xt*4,de=le||G?a+ce:a-ce,fe=le?a-ce:G?a+ce:a-ce,ve=i+Xt+1,Fe=G||le?q.right-Xt:q.left,Le=G?le?q.right-Xt:q.left:q.right-Xt;ie=Kf(R,D,Fe,q.top,Le,q.bottom,ve,de,ve,fe);break}case"right":{const ce=le?Xt/2:Xt*4,de=le||G?a+ce:a-ce,fe=le?a-ce:G?a+ce:a-ce,ve=i-Xt,Fe=G||le?q.left+Xt:q.right,Le=G?le?q.left+Xt:q.right:q.left+Xt;ie=Kf(R,D,ve,de,ve,fe,Fe,q.top,Le,q.bottom);break}}ie?b||n.start(40,V):V()}};return r.__options={...e,blockPointerEvents:t},r}const n_=E.createContext(null),r_=E.createContext(null);function ba(){const e=E.useContext(n_);if(e===null)throw new Error(Ln(60));return e}function s_(){const e=E.useContext(r_);if(e===null)throw new Error(Ln(61));return e}let JS=(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 q8={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},vc={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Y8={disabled:!1,...vc},G8={valid(e){return e===null?null:e?{[JS.valid]:""}:{[JS.invalid]:""}}},K8={invalid:void 0,name:void 0,validityData:{state:q8,errors:[],error:"",value:"",initialValue:null},setValidityData:Vn,disabled:void 0,touched:vc.touched,setTouched:Vn,dirty:vc.dirty,setDirty:Vn,filled:vc.filled,setFilled:Vn,focused:vc.focused,setFocused:Vn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Y8,markedDirtyRef:{current:!1},registerFieldControl:Vn,validation:{getValidationProps:(e,t=dn)=>t,inputRef:{current:null},registerInput:Vn,commit:async()=>{},change:Vn}},X8=E.createContext(K8);function _x(e=!0){const t=E.useContext(X8);if(t.setValidityData===Vn&&!e)throw new Error(Ln(28));return t}function W8(e,t,n,r,i=!0,a){const{registerFieldControl:l}=_x(),c=E.useRef(null);c.current||(c.current=Symbol()),Ye(()=>{const d=c.current;return!d||!i?void 0:(l(d,{controlRef:e,getValue:r,id:t,name:a,value:n}),()=>{l(d,void 0)})},[e,i,r,t,a,l,n])}function No(e){return uo(e,"base-ui")}const Q8=E.createContext({controlId:void 0,registerControlId:Vn,labelId:void 0,setLabelId:Vn,messageIds:[],setMessageIds:Vn,getDescriptionProps:e=>e});function i_(){return E.useContext(Q8)}function a_(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=i_(),l=No(t),c=n?i:void 0,d=xr(()=>Symbol("labelable-control")),f=E.useRef(!1),g=E.useRef(t!=null),m=tt(()=>{!f.current||a===Vn||(f.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=c??l}else if(t!=null)g.current=!0,b=t;else if(g.current)b=l;else{m();return}if(b===void 0){m();return}f.current=!0,a(d.current,b)},[t,r,c,a,n,l,d,m]),E.useEffect(()=>m,[m]),i??l}const Z8=(e,t)=>Object.is(e,t);function fo(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function J8(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:fo(t,r,n))}function Rc(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:fo(r,t,n))}function eP(e,t,n){return e.filter(r=>!fo(t,r,n))}function Xb(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function o_(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function tP(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(o_(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 l_(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 Xb(e)}function qa(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Xb(e.value):Xb(e)}function u_(e,t,n){function r(){return l_(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 i=t,a=o_(i)?i.flatMap(l=>l.items):i;if(e==null||typeof e!="object"){const l=a.find(c=>c.value===e);return l&&l.label!=null?l.label:r()}if("value"in e){const l=a.find(c=>c&&c.value===e.value);if(l&&l.label!=null)return l.label}}return r()}function nP(e,t,n){return e.reduce((r,i,a)=>(a>0&&r.push(", "),r.push(h.jsx(E.Fragment,{children:u_(i,t,n)},a)),r),[])}const ct={id:Be(e=>e.id),labelId:Be(e=>e.labelId),modal:Be(e=>e.modal),multiple:Be(e=>e.multiple),items:Be(e=>e.items),itemToStringLabel:Be(e=>e.itemToStringLabel),itemToStringValue:Be(e=>e.itemToStringValue),isItemEqualToValue:Be(e=>e.isItemEqualToValue),value:Be(e=>e.value),hasSelectedValue:Be(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:qa(t,r)!==""}),hasNullItemLabel:Be((e,t)=>t?tP(e.items):!1),open:Be(e=>e.open),mounted:Be(e=>e.mounted),forceMount:Be(e=>e.forceMount),transitionStatus:Be(e=>e.transitionStatus),openMethod:Be(e=>e.openMethod),activeIndex:Be(e=>e.activeIndex),selectedIndex:Be(e=>e.selectedIndex),isActive:Be((e,t)=>e.activeIndex===t),isSelected:Be((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(i=>fo(t,i,n)):fo(t,r,n)}),isSelectedByFocus:Be((e,t)=>e.selectedIndex===t),popupProps:Be(e=>e.popupProps),triggerProps:Be(e=>e.triggerProps),triggerElement:Be(e=>e.triggerElement),positionerElement:Be(e=>e.positionerElement),listElement:Be(e=>e.listElement),popupSide:Be(e=>e.popupSide),scrollUpArrowVisible:Be(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Be(e=>e.scrollDownArrowVisible),hasScrollArrows:Be(e=>e.hasScrollArrows)},rP=E.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Vn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function sP(){return E.useContext(rP)}function iP(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}function c_(e,t){const n=E.useRef(e),r=tt(t);Ye(()=>{n.current!==e&&r(n.current)},[e,r]),Ye(()=>{n.current=e},[e])}function aP(e){const t=E.useRef(""),n=E.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:E.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function d_(e,t){const n=tt((a,l)=>{(typeof e=="function"?e():e)||t(l||(Em?"touch":""))}),{onClick:r,onPointerDown:i}=aP(n);return E.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function f_(e){const[t,n]=E.useState(null),r=d_(e,n);return c_(e,i=>{i&&!e&&n(null)}),E.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Tc(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const oi=1;function h_(e,t){return Math.max(0,e-t)}function oP(e,t){if(t<=0)return 0;const n=Tc(e,0,t),r=n,i=t-n,a=r<=oi,l=i<=oi;return a&&l?r<=i?0:t:a?0:l?t:n}function lP(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:l=!1,onOpenChange:c,name:d,form:f,autoComplete:g,disabled:m=!1,readOnly:b=!1,required:x=!1,modal:v=!0,actionsRef:k,inputRef:w,onOpenChangeComplete:S,items:N,multiple:_=!1,itemToStringLabel:A,itemToStringValue:L,isItemEqualToValue:R=Z8,highlightItemOnHover:D=!0,children:I}=e,{clearErrors:U}=sP(),{setDirty:z,setTouched:X,setFocused:W,validityData:V,setFilled:ee,name:q,disabled:B,validation:G,validationMode:Q}=_x(),le=a_({id:t}),M=B||m,P=q??d,[F,j]=TS({controlled:n,default:_?r??Pl:r,name:"Select",state:"value"}),[ae,ie]=TS({controlled:a,default:l,name:"Select",state:"open"}),ce=E.useRef([]),de=E.useRef([]),fe=E.useRef(null),ve=E.useRef(null),Fe=E.useRef(0),Le=E.useRef(null),Ee=E.useRef([]),Oe=E.useRef(!1),ze=E.useRef(null),Ge=E.useRef(null),$e=E.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),De=E.useRef(!1),{mounted:ke,setMounted:ye,transitionStatus:Ie}=bx(ae),{openMethod:je,triggerProps:te}=f_(ae),me=xr(()=>new WN({id:le,labelId:void 0,modal:v,multiple:_,itemToStringLabel:A,itemToStringValue:L,isItemEqualToValue:R,value:F,open:ae,mounted:ke,transitionStatus:Ie,items:N,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,Z=ft(me,ct.activeIndex),re=ft(me,ct.selectedIndex),K=ft(me,ct.triggerElement),$=ft(me,ct.positionerElement),oe=lD(je),Ce=je??oe??null,Re=E.useMemo(()=>_?"":qa(F,L),[_,F,L]),Ve=E.useMemo(()=>_&&Array.isArray(F)?F.map(ht=>qa(ht,L)):qa(F,L),[_,F,L]),ot=En(me.state.triggerElement),et=tt(()=>Ve);W8(ot,le,F,et,!M,d);const dt=E.useRef(F),ut=_?Array.isArray(F)&&F.length>0:F!=null&&qa(F,L)!=="";Ye(()=>{F!==dt.current&&me.set("forceMount",!0)},[me,F]),Ye(()=>{ee(ut)},[ut,ee]),Ye(function(){const Ot=Ee.current;let bn;if(_){const Hn=Array.isArray(F)?F:[];if(Hn.length===0)bn=null;else{const Dn=Hn[Hn.length-1],en=Rc(Ot,Dn,R);bn=en===-1?null:en}}else{const Hn=Rc(Ot,F,R);bn=Hn===-1?null:Hn}bn===null&&(Ge.current=null),!ae&&me.set("selectedIndex",bn)},[ut,_,ae,F,Ee,R,me,Ge]);function qe(ht){const Ot=V.initialValue;return Array.isArray(ht)&&Array.isArray(Ot)?!iP(ht,Ot,(bn,Hn)=>fo(bn,Hn,R)):ht!==Ot}c_(F,()=>{U(P),z(qe(F)),G.change(F)});const Rt=tt((ht,Ot)=>{c?.(ht,Ot),!Ot.isCanceled&&(ie(ht),!ht&&(Ot.reason===lo||Ot.reason===Cm)&&(X(!0),W(!1),Q==="onBlur"&&G.commit(F)))}),jt=tt(()=>{ye(!1),me.update({activeIndex:null,openMethod:null}),S?.(!1)});ko({enabled:!k,open:ae,ref:fe,onComplete(){ae||jt()}}),E.useImperativeHandle(k,()=>({unmount:jt}),[jt]);const lt=tt((ht,Ot)=>{i?.(ht,Ot),!Ot.isCanceled&&j(ht)}),Lt=tt(()=>{const ht=me.state.listElement||fe.current;if(!ht)return;const Ot=h_(ht.scrollHeight,ht.clientHeight),bn=oP(ht.scrollTop,Ot),Hn=bn>0,Dn=bn<Ot;me.state.scrollUpArrowVisible!==Hn&&me.set("scrollUpArrowVisible",Hn),me.state.scrollDownArrowVisible!==Dn&&me.set("scrollDownArrowVisible",Dn)}),Qt=K3({open:ae,onOpenChange:Rt,elements:{reference:K,floating:$}}),$t=px(Qt,{enabled:!b&&!M,event:"mousedown"}),Zt=Nm(Qt),Xe=J3(Qt,{enabled:!b&&!M,listRef:ce,activeIndex:Z,selectedIndex:re,disabledIndices:Pl,onNavigate(ht){ht===null&&!ae||me.set("activeIndex",ht)},focusItemOnHover:D}),yt=e_(Qt,{enabled:!b&&!M&&(ae||!_),listRef:de,activeIndex:Z,selectedIndex:re,disabledIndices:ht=>uD(ce.current[ht]),onMatch(ht){ae?me.set("activeIndex",ht):lt(Ee.current[ht],mt("none"))},onTyping(ht){Oe.current=ht}}),Ut=E.useMemo(()=>{const ht=Ir(yt.reference,Xe.reference,Zt.reference,$t.reference,te);return le&&(ht.id=le),ht},[$t.reference,yt.reference,Xe.reference,Zt.reference,te,le]),Jt=E.useMemo(()=>Ir(Rm,yt.floating,Xe.floating,Zt.floating),[yt.floating,Xe.floating,Zt.floating]),Kn=Xe.item??dn;q1(()=>{me.update({popupProps:Jt,triggerProps:Ut})}),Ye(()=>{me.update({id:le,modal:v,multiple:_,value:F,open:ae,mounted:ke,transitionStatus:Ie,popupProps:Jt,triggerProps:Ut,items:N,itemToStringLabel:A,itemToStringValue:L,isItemEqualToValue:R,openMethod:Ce})},[me,le,v,_,F,ae,ke,Ie,Jt,Ut,N,A,L,R,Ce]);const Et=E.useMemo(()=>({store:me,name:P,required:x,disabled:M,readOnly:b,multiple:_,highlightItemOnHover:D,setValue:lt,setOpen:Rt,listRef:ce,popupRef:fe,scrollHandlerRef:ve,handleScrollArrowVisibility:Lt,scrollArrowsMountedCountRef:Fe,itemProps:Kn,valueRef:Le,valuesRef:Ee,labelsRef:de,typingRef:Oe,selectionRef:$e,firstItemTextRef:ze,selectedItemTextRef:Ge,validation:G,onOpenChangeComplete:S,alignItemWithTriggerActiveRef:De,initialValueRef:dt}),[me,P,x,M,b,_,D,lt,Rt,Kn,G,S,Lt]),an=ao(w,G.inputRef),Er=_&&Array.isArray(F)&&F.length>0,pn=_?void 0:P,Sn=E.useMemo(()=>!_||!Array.isArray(F)||!P?null:F.map(ht=>{const Ot=qa(ht,L);return h.jsx("input",{type:"hidden",form:f,name:P,value:Ot,disabled:M},Ot)}),[_,F,f,P,L,M]);return h.jsx(n_.Provider,{value:Et,children:h.jsxs(r_.Provider,{value:Qt,children:[I,h.jsx("input",{...G.getValidationProps(M,{onFocus(){me.state.triggerElement?.focus({focusVisible:!0})},onChange(ht){if(ht.nativeEvent.defaultPrevented||M||b)return;const Ot=ht.currentTarget.value,bn=mt(Wl,ht.nativeEvent);function Hn(){if(_)return;const Dn=Ot.toLowerCase();let en=Ee.current.findIndex(ys=>qa(ys,L).toLowerCase()===Dn||l_(ys,A).toLowerCase()===Dn);en===-1&&(en=Ee.current.findIndex((ys,du)=>{const Ed=de.current[du];return Ed!=null&&Ed.toLowerCase()===Dn}));const Xn=en===-1?void 0:Ee.current[en];Xn!=null&&lt(Xn,bn)}me.set("forceMount",!0),queueMicrotask(Hn)}}),id:le&&pn==null?`${le}-hidden-input`:void 0,form:f,name:pn,autoComplete:g,value:Re,disabled:M,required:x&&!Er,readOnly:b,ref:an,style:P?sD:qN,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Sn]})})}function uP(e,t){return e??t}let Za=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Wc.startingStyle]="startingStyle",e[e.endingStyle=Wc.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Vh=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const cP={[Vh.popupOpen]:""},dP={[Vh.popupOpen]:"",[Vh.pressed]:""},fP={[Za.open]:""},hP={[Za.closed]:""},mP={[Za.anchorHidden]:""},Ax={open(e){return e?cP:null}},Wb={open(e){return e?dP:null}},Jl={open(e){return e?fP:hP},anchorHidden(e){return e?mP:null}};function m_(e){const t=e.getBoundingClientRect(),n=sn(e);if(ex)return t;const r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return t;const l=parseFloat(r.width)||0,c=parseFloat(r.height)||0,d=parseFloat(i.width)||0,f=parseFloat(i.height)||0,g=Math.max(t.width,l,d),m=Math.max(t.height,c,f),b=g-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 pP=E.createContext(void 0);function Rx(e=!1){const t=E.useContext(pP);if(t===void 0&&!e)throw new Error(Ln(16));return t}function gP(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,l=r&&t!==!1,c=r&&t===!1;return{props:E.useMemo(()=>{const f={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return r||(f.tabIndex=i,!a&&n&&(f.tabIndex=t?i:-1)),(a&&(t||l)||!a&&n)&&(f["aria-disabled"]=n),a&&(!t||c)&&(f.disabled=n),f},[r,n,t,l,c,a,i])}}function eu(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,l=E.useRef(null),c=Rx(!0),d=a??c!==void 0,{props:f}=gP({focusableWhenDisabled:n,disabled:t,composite:d,tabIndex:r,isNativeButton:i}),g=E.useCallback(()=>{const x=l.current;F0(x)&&d&&t&&f.disabled===void 0&&x.disabled&&(x.disabled=!1)},[t,f.disabled,d]);Ye(g,[g]);const m=E.useCallback((x={})=>{const{onClick:v,onMouseDown:k,onKeyUp:w,onKeyDown:S,onPointerDown:N,..._}=x;return Ir({onClick(A){if(t){A.preventDefault();return}v?.(A)},onMouseDown(A){t||k?.(A)},onKeyDown(A){if(t||(Hh(A),S?.(A),A.baseUIHandlerPrevented))return;const L=A.target===A.currentTarget,R=A.currentTarget,D=F0(R),I=!i&&bP(R),U=L&&(i?D:!I),z=A.key==="Enter",X=A.key===" ",W=R.getAttribute("role"),V=W?.startsWith("menuitem")||W==="option"||W==="gridcell";if(L&&d&&X){if(A.defaultPrevented&&V)return;A.preventDefault(),I||i&&D?(R.click(),A.preventBaseUIHandler()):U&&(v?.(A),A.preventBaseUIHandler());return}U&&(!i&&(X||z)&&A.preventDefault(),!i&&z&&v?.(A))},onKeyUp(A){if(!t){if(Hh(A),w?.(A),A.target===A.currentTarget&&i&&d&&F0(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!i&&!d&&A.key===" "&&v?.(A)}},onPointerDown(A){if(t){A.preventDefault();return}N?.(A)}},i?{type:"button"}:{role:"button"},f,_)},[t,f,d,i]),b=tt(x=>{l.current=x,g()});return{getButtonProps:m,buttonRef:b}}function F0(e){return cn(e)&&e.tagName==="BUTTON"}function bP(e){return!!(e?.tagName==="A"&&e?.href)}const Wf=2,xP=400,yP={...Wb,...G8,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},EP=E.forwardRef(function(t,n){const{render:r,className:i,id:a,disabled:l=!1,nativeButton:c=!0,style:d,...f}=t,{setTouched:g,setFocused:m,validationMode:b,state:x,disabled:v}=_x(),{labelId:k}=i_(),{store:w,setOpen:S,selectionRef:N,validation:_,readOnly:A,required:L,alignItemWithTriggerActiveRef:R,disabled:D}=ba(),I=v||D||l,U=ft(w,ct.open),z=ft(w,ct.mounted),X=ft(w,ct.value),W=ft(w,ct.triggerProps),V=ft(w,ct.positionerElement),ee=ft(w,ct.listElement),q=ft(w,ct.popupSide),B=ft(w,ct.id),G=ft(w,ct.labelId),Q=ft(w,ct.hasSelectedValue),le=z&&V?q:null,M=a??B,P=uP(k,G);a_({id:M});const F=En(V),j=E.useRef(null),{getButtonProps:ae,buttonRef:ie}=eu({disabled:I,native:c}),ce=tt(Oe=>{w.set("triggerElement",Oe)}),de=Gn(),fe=Gn(),ve=Gn();E.useEffect(()=>{if(U)return ve.start(xP,()=>{N.current.allowUnselectedMouseUp=!0,N.current.allowSelectedMouseUp=!0}),()=>{ve.clear()};N.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},fe.clear()},[U,N,fe,ve]);const Fe=Ir(W,{id:M,role:"combobox","aria-expanded":U?"true":"false","aria-haspopup":"listbox","aria-controls":U?ee?.id??jh(V)?.id:void 0,"aria-labelledby":P,"aria-readonly":A||void 0,"aria-required":L||void 0,tabIndex:I?-1:0,onFocus(Oe){m(!0),U&&R.current&&S(!1,mt(Wl,Oe.nativeEvent)),de.start(0,()=>{w.set("forceMount",!0)})},onBlur(Oe){nt(V,Oe.relatedTarget)||(g(!0),m(!1),b==="onBlur"&&_.commit(X))},onMouseDown(Oe){if(U)return;const ze=_t(Oe.currentTarget);function Ge($e){if(!j.current)return;const De=$e.target;if(nt(j.current,De)||nt(F.current,De))return;const ke=m_(j.current);$e.clientX>=ke.left-Wf&&$e.clientX<=ke.right+Wf&&$e.clientY>=ke.top-Wf&&$e.clientY<=ke.bottom+Wf||S(!1,mt(n3,$e))}fe.start(0,()=>{ze.addEventListener("mouseup",Ge,{once:!0})})}},f,ae),Le=_.getValidationProps(I,Fe);Le.role="combobox";const Ee={...x,open:U,disabled:I,value:X,readOnly:A,popupSide:le,placeholder:!Q};return Nn("button",t,{ref:[n,j,ie,ce],state:Ee,stateAttributesMapping:yP,props:Le})}),vP={value:()=>null},TP=E.forwardRef(function(t,n){const{className:r,render:i,children:a,placeholder:l,style:c,...d}=t,{store:f,valueRef:g}=ba(),m=ft(f,ct.value),b=ft(f,ct.items),x=ft(f,ct.itemToStringLabel),v=ft(f,ct.hasSelectedValue),k=!v&&l!=null&&a==null,w=ft(f,ct.hasNullItemLabel,k),S={value:m,placeholder:!v};let N=null;return typeof a=="function"?N=a(m):a!=null?N=a:!v&&l!=null&&!w?N=l:Array.isArray(m)?N=nP(m,b,x):N=u_(m,b,x),Nn("span",t,{state:S,ref:[n,g],props:[{children:N},d],stateAttributesMapping:vP})}),SP=E.forwardRef(function(t,n){const{render:r,className:i,style:a,...l}=t,{store:c}=ba(),f={open:ft(c,ct.open)};return Nn("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:Ax})}),CP=E.createContext(void 0),wP=E.forwardRef(function(t,n){const{store:r}=ba(),i=ft(r,ct.mounted),a=ft(r,ct.forceMount);return i||a?h.jsx(CP.Provider,{value:!0,children:h.jsx(dx,{ref:n,...t})}):null});function Ox(e){return G1(19)?e:e?"true":void 0}const p_=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function kP(){return E.useContext(p_)}function g_(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=tt(i),l=E.useRef(0),c=xr(_P).current,d=xr(NP).current,[f,g]=E.useState(0),m=E.useRef(f),b=tt((S,N)=>{d.set(S,N??null),m.current+=1,g(m.current)}),x=tt(S=>{d.delete(S),m.current+=1,g(m.current)}),v=E.useMemo(()=>{const S=new Map;return Array.from(d.keys()).filter(_=>_.isConnected).sort(AP).forEach((_,A)=>{const L=d.get(_)??{};S.set(_,{...L,index:A})}),S},[d,f]);Ye(()=>{if(typeof MutationObserver!="function"||v.size===0)return;const S=new MutationObserver(N=>{const _=new Set,A=L=>_.has(L)?_.delete(L):_.add(L);N.forEach(L=>{L.removedNodes.forEach(A),L.addedNodes.forEach(A)}),_.size===0&&(m.current+=1,g(m.current))});return v.forEach((N,_)=>{_.parentElement&&S.observe(_.parentElement,{childList:!0})}),()=>{S.disconnect()}},[v]),Ye(()=>{m.current===f&&(n.current.length!==v.size&&(n.current.length=v.size),r&&r.current.length!==v.size&&(r.current.length=v.size),l.current=v.size),a(v)},[a,v,n,r,f]),Ye(()=>()=>{n.current=[]},[n]),Ye(()=>()=>{r&&(r.current=[])},[r]);const k=tt(S=>(c.add(S),()=>{c.delete(S)}));Ye(()=>{c.forEach(S=>S(v))},[c,v]);const w=E.useMemo(()=>({register:b,unregister:x,subscribeMapChange:k,elementsRef:n,labelsRef:r,nextIndexRef:l}),[b,x,k,n,r,l]);return h.jsx(p_.Provider,{value:w,children:t})}function NP(){return new Map}function _P(){return new Set}function AP(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 RP=E.createContext(void 0);function Ix(){return E.useContext(RP)?.direction??"ltr"}const OP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:l,elements:c,middlewareData:d}=t,{element:f,padding:g=0,offsetParent:m="real"}=gi(e,t)||{};if(f==null)return{};const b=i3(g),x={x:n,y:r},v=ax(i),k=ix(v),w=await l.getDimensions(f),S=v==="y",N=S?"top":"left",_=S?"bottom":"right",A=S?"clientHeight":"clientWidth",L=a.reference[k]+a.reference[v]-x[v]-a.floating[k],R=x[v]-a.reference[v],D=m==="real"?await l.getOffsetParent?.(f):c.floating;let I=c.floating[A]||a.floating[k];(!I||!await l.isElement?.(D))&&(I=c.floating[A]||a.floating[k]);const U=L/2-R/2,z=I/2-w[k]/2-1,X=Math.min(b[N],z),W=Math.min(b[_],z),V=X,ee=I-w[k]-W,q=I/2-w[k]/2+U,B=s3(V,q,ee),G=!d.arrow&&ma(i)!=null&&q!==B&&a.reference[k]/2-(q<V?X:W)-w[k]/2<0,Q=G?q<V?q-V:q-ee:0;return{[v]:x[v]+Q,data:{[v]:B,centerOffset:q-B-Q,...G&&{alignmentOffset:Q}},reset:G}}}),IP=(e,t)=>({...OP(e),options:[e,t]}),MP=_8().fn,LP={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await MP(e)).data?.referenceHidden||a}}}},Th={sideX:"left",sideY:"top"},b_={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:l,placement:c}=e,d=sn(i),f=d.getComputedStyle(i);if(!(f.transitionDuration!=="0s"&&f.transitionDuration!==""))return{x:t,y:n,data:Th};const m=await a.getOffsetParent?.(i);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 N=_t(i);b={width:N.documentElement.clientWidth,height:N.documentElement.clientHeight}}else await a.isElement?.(m)&&(b=await a.getDimensions(m));const x=$r(c);let v=t,k=n;x==="left"&&(v=b.width-(t+r.width)),x==="top"&&(k=b.height-(n+r.height));const w=x==="left"?"right":Th.sideX,S=x==="top"?"bottom":Th.sideY;return{x:v,y:k,data:{sideX:w,sideY:S}}}};function x_(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 eC(e,t,n){const{rects:r,placement:i}=e;return{side:x_(t,$r(i),n),align:ma(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Mx(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:d=5,sticky:f=!1,arrowPadding:g=5,disableAnchorTracking:m=!1,inline:b,keepMounted:x=!1,floatingRootContext:v,mounted:k,collisionAvoidance:w,shiftCrossAxis:S=!1,nodeId:N,adaptiveOrigin:_,lazyFlip:A=!1,externalTree:L}=e,[R,D]=E.useState(null);!k&&R!==null&&D(null);const I=w.side||"flip",U=w.align||"flip",z=w.fallbackAxisSide||"end",X=typeof t=="function"?t:void 0,W=tt(X),V=X?W:t,ee=En(t),q=En(k),G=Ix()==="rtl",Q=R||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":G?"left":"right","inline-start":G?"right":"left"}[r],le=a==="center"?Q:`${Q}-${a}`;let M=d;const P=1,F=r==="bottom"?P:0,j=r==="top"?P:0,ae=r==="right"?P:0,ie=r==="left"?P:0;typeof M=="number"?M={top:M+F,right:M+ie,bottom:M+j,left:M+ae}:M&&(M={top:(M.top||0)+F,right:(M.right||0)+ie,bottom:(M.bottom||0)+j,left:(M.left||0)+ae});const ce={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:M},de=E.useRef(null),fe=En(i),ve=En(l),Fe=typeof i!="function"?i:0,Le=typeof l!="function"?l:0,Ee=[];b&&Ee.push(b),Ee.push(S8(lt=>{const Lt=eC(lt,r,G),Qt=typeof fe.current=="function"?fe.current(Lt):fe.current,$t=typeof ve.current=="function"?ve.current(Lt):ve.current;return{mainAxis:Qt,crossAxis:$t,alignmentAxis:$t}},[Fe,Le,G,r]));const Oe=U==="none"&&I!=="shift",ze=!Oe&&(f||S||I==="shift"),Ge=I==="none"?null:k8({...ce,padding:{top:M.top+P,right:M.right+P,bottom:M.bottom+P,left:M.left+P},mainAxis:!S&&I==="flip",crossAxis:U==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),$e=Oe?null:C8(lt=>{const Lt=_t(lt.elements.floating).documentElement;return{...ce,rootBoundary:S?{x:0,y:0,width:Lt.clientWidth,height:Lt.clientHeight}:void 0,mainAxis:U!=="none",crossAxis:ze,limiter:f||S?void 0:w8(Qt=>{if(!de.current)return{};const{width:$t,height:Zt}=de.current.getBoundingClientRect(),Xe=ls($r(Qt.placement)),yt=Xe==="y"?$t:Zt,Ut=Xe==="y"?M.left+M.right:M.top+M.bottom;return{offset:yt/2+Ut/2}})}},[ce,f,S,M,U]);I==="shift"||U==="shift"||a==="center"?Ee.push($e,Ge):Ee.push(Ge,$e),Ee.push(N8({...ce,apply({elements:{floating:lt},availableWidth:Lt,availableHeight:Qt,rects:$t}){if(!q.current)return;const Zt=lt.style;Zt.setProperty("--available-width",`${Lt}px`),Zt.setProperty("--available-height",`${Qt}px`);const Xe=sn(lt).devicePixelRatio||1,{x:yt,y:Ut,width:Jt,height:Kn}=$t.reference,Et=(Math.round((yt+Jt)*Xe)-Math.round(yt*Xe))/Xe,an=(Math.round((Ut+Kn)*Xe)-Math.round(Ut*Xe))/Xe;Zt.setProperty("--anchor-width",`${Et}px`),Zt.setProperty("--anchor-height",`${an}px`)}}),IP(lt=>({element:de.current||_t(lt.elements.floating).createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(lt){const{elements:Lt,middlewareData:Qt,placement:$t,rects:Zt,y:Xe}=lt,yt=$r($t),Ut=ls(yt),Jt=de.current,Kn=Qt.arrow?.x||0,Et=Qt.arrow?.y||0,an=Jt?.clientWidth||0,Er=Jt?.clientHeight||0,pn=Kn+an/2,Sn=Et+Er/2,ht=Math.abs(Qt.shift?.y||0),Ot=Zt.reference.height/2,bn=typeof i=="function"?i(eC(lt,r,G)):i,Hn=ht>bn,Dn={top:`${pn}px calc(100% + ${bn}px)`,bottom:`${pn}px ${-bn}px`,left:`calc(100% + ${bn}px) ${Sn}px`,right:`${-bn}px ${Sn}px`}[yt],en=`${pn}px ${Zt.reference.y+Ot-Xe}px`;return Lt.floating.style.setProperty("--transform-origin",ze&&Ut==="y"&&Hn?en:Dn),{}}},LP,_),Ye(()=>{!k&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[k,v]);const De=E.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:ke,elements:ye,x:Ie,y:je,middlewareData:te,update:me,placement:Z,context:re,isPositioned:K,floatingStyles:$}=B8({rootContext:v,open:x?k:void 0,placement:le,middleware:Ee,strategy:n,whileElementsMounted:x?void 0:(...lt)=>XS(...lt,De),nodeId:N,externalTree:L}),{sideX:oe,sideY:Ce}=te.adaptiveOrigin||Th,Re=K?n:"fixed",Ve=E.useMemo(()=>{const lt=_?{position:Re,[oe]:Ie,[Ce]:je}:{position:Re,...$};return K||(lt.opacity=0),lt},[_,Re,oe,Ie,Ce,je,$,K]),ot=E.useRef(null);Ye(()=>{if(!k)return;const lt=ee.current,Lt=typeof lt=="function"?lt():lt,$t=(tC(Lt)?Lt.current:Lt)||null||null;$t!==ot.current&&(ke.setPositionReference($t),ot.current=$t)},[k,ke,V,ee]),E.useEffect(()=>{if(!k)return;const lt=ee.current;typeof lt!="function"&&tC(lt)&&lt.current!==ot.current&&(ke.setPositionReference(lt.current),ot.current=lt.current)},[k,ke,V,ee]),E.useEffect(()=>{if(x&&k&&ye.reference&&ye.floating)return XS(ye.reference,ye.floating,me,De)},[x,k,ye,me,De]);const et=$r(Z),dt=x_(r,et,G),ut=ma(Z)||"center",qe=!!te.hide?.referenceHidden;Ye(()=>{A&&k&&K&&D(et)},[A,k,K,et]);const Rt=E.useMemo(()=>({position:"absolute",top:te.arrow?.y,left:te.arrow?.x}),[te.arrow]),jt=te.arrow?.centerOffset!==0;return E.useMemo(()=>({positionerStyles:Ve,arrowStyles:Rt,arrowRef:de,arrowUncentered:jt,side:dt,align:ut,physicalSide:et,anchorHidden:qe,refs:ke,context:re,isPositioned:K,update:me}),[Ve,Rt,de,jt,dt,ut,et,qe,ke,re,K,me])}function tC(e){return e!=null&&"current"in e}const y_=E.createContext(void 0);function DP(){const e=E.useContext(y_);if(!e)throw new Error(Ln(59));return e}const Lx=E.forwardRef(function(t,n){const{cutout:r,...i}=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 h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function qh(e,t){e&&Object.assign(e.style,t)}const jP={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function Im(e){return e==="starting"?Oj:dn}function Dx(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:l,inert:c=!1}){const d={...n};return c&&(d.pointerEvents="none"),Nn("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:l,style:d},Im(r),i],stateAttributesMapping:Jl})}let nC={},rC={},sC="";function PP(e){if(typeof document>"u")return!1;const t=_t(e);return sn(t).innerWidth-t.documentElement.clientWidth>0}function BP(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=_t(e),r=n.documentElement,i=n.body,a=wo(r)?r:i,l=a.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const f=a.offsetWidth;return a.style.overflowY=l,r.style.scrollbarGutter=c,d===f}function zP(e){const t=_t(e),n=t.documentElement,r=t.body,i=wo(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,a)}}function HP(e){const t=_t(e),n=t.documentElement,r=t.body,i=sn(n);let a=0,l=0,c=!1;const d=Rs.create();if(ha&&(i.visualViewport?.scale??1)!==1)return()=>{};function f(){const x=i.getComputedStyle(n),v=i.getComputedStyle(r),S=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,nC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},sC=n.style.scrollBehavior,rC={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 N=n.scrollHeight>n.clientHeight,_=n.scrollWidth>n.clientWidth,A=x.overflowY==="scroll"||v.overflowY==="scroll",L=x.overflowX==="scroll"||v.overflowX==="scroll",R=Math.max(0,i.innerWidth-r.clientWidth),D=Math.max(0,i.innerHeight-r.clientHeight),I=parseFloat(v.marginTop)+parseFloat(v.marginBottom),U=parseFloat(v.marginLeft)+parseFloat(v.marginRight),z=wo(n)?n:r;if(c=BP(e),c){n.style.scrollbarGutter=S,z.style.overflowY="hidden",z.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(N||A)&&(n.style.overflowY="scroll"),(_||L)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||D?`calc(100dvh - ${I+D}px)`:"100dvh",width:U||R?`calc(100vw - ${U+R}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 g(){Object.assign(n.style,nC),Object.assign(r.style,rC),c||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=sC)}function m(){g(),d.request(f)}f();const b=Tt(i,"resize",m);return()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&b()}}class UP{lockCount=0;restore=null;timeoutLock=gs.create();timeoutUnlock=gs.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=_t(t).documentElement,i=sn(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=Vn;return}const a=Em||!PP(t);this.restore=a?zP(t):HP(t)}}const FP=new UP;function E_(e=!0,t=null){Ye(()=>{if(e)return FP.acquire(t)},[e,t])}const $P=20;function v_(e,t,n,r){const[i,a]=E.useState(!1);Ye(()=>{if(!e||!t||n==null){a(!1);return}const l=_t(n).documentElement.clientWidth,c=n.offsetWidth;a(l>0&&c>0&&c>=l-$P)},[e,t,n]),E_(e&&(!t||i),r)}const VP={position:"fixed"},qP=E.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:l,side:c="bottom",align:d="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:k,alignItemWithTrigger:w=!0,collisionAvoidance:S=C3,style:N,..._}=t,{store:A,listRef:L,labelsRef:R,alignItemWithTriggerActiveRef:D,selectedItemTextRef:I,valuesRef:U,initialValueRef:z,popupRef:X,setValue:W}=ba(),V=s_(),ee=ft(A,ct.open),q=ft(A,ct.mounted),B=ft(A,ct.modal),G=ft(A,ct.value),Q=ft(A,ct.openMethod),le=ft(A,ct.positionerElement),M=ft(A,ct.triggerElement),P=ft(A,ct.isItemEqualToValue),F=ft(A,ct.transitionStatus),j=E.useRef(null),ae=E.useRef(null),[ie,ce]=E.useState(w),de=q&&ie&&Q!=="touch";!q&&ie!==w&&ce(w),Ye(()=>{q||(ct.scrollUpArrowVisible(A.state)&&A.set("scrollUpArrowVisible",!1),ct.scrollDownArrowVisible(A.state)&&A.set("scrollDownArrowVisible",!1))},[A,q]),E.useImperativeHandle(D,()=>de),v_((de||B)&&ee,Q==="touch",le,M);const fe=Mx({anchor:r,floatingRootContext:V,positionMethod:i,mounted:q,side:c,sideOffset:f,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:m,collisionPadding:b,sticky:v,disableAnchorTracking:k??de,collisionAvoidance:S,keepMounted:!0}),ve=de?"none":fe.side,Fe=de?VP:fe.positionerStyles,Le={open:ee,side:ve,align:fe.align,anchorHidden:fe.anchorHidden};Ye(()=>{A.set("popupSide",fe.side)},[A,fe.side]);const Ee=tt(De=>{A.set("positionerElement",De)}),Oe=Dx(t,Le,{styles:Fe,transitionStatus:F,props:_,refs:[n,Ee],hidden:!q,inert:!ee}),ze=E.useRef(0),Ge=tt(De=>{if(De.size===0&&ze.current===0||U.current.length===0)return;const ke=ze.current;if(ze.current=De.size,De.size===ke)return;const ye=mt(Wl);if(ke!==0&&!A.state.multiple&&G!==null&&Rc(U.current,G,P)===-1){const je=z.current,me=je!=null&&Rc(U.current,je,P)!==-1?je:null;W(me,ye),me===null&&(A.set("selectedIndex",null),I.current=null)}if(ke!==0&&A.state.multiple&&Array.isArray(G)){const Ie=te=>Rc(U.current,te,P)!==-1,je=G.filter(te=>Ie(te));(je.length!==G.length||je.some(te=>!J8(G,te,P)))&&(W(je,ye),je.length===0&&(A.set("selectedIndex",null),I.current=null))}if(ee&&de){A.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ie={height:""};qh(le,Ie),qh(X.current,Ie)}}),$e=E.useMemo(()=>({...fe,side:ve,alignItemWithTriggerActive:de,setControlledAlignItemWithTrigger:ce,scrollUpArrowRef:j,scrollDownArrowRef:ae}),[fe,ve,de,ce]);return h.jsx(g_,{elementsRef:L,labelsRef:R,onMapChange:Ge,children:h.jsxs(y_.Provider,{value:$e,children:[q&&B&&h.jsx(Lx,{inert:Ox(!ee),cutout:M}),Oe]})})}),Qf="base-ui-disable-scrollbar",iC={className:Qf,getElement(e){return h.jsx("style",{nonce:e,href:Qf,precedence:"base-ui:low",children:`.${Qf}{scrollbar-width:none}.${Qf}::-webkit-scrollbar{display:none}`})}},YP=E.createContext(void 0);function T_(e){return E.useContext(YP)}const GP="ArrowUp",KP="ArrowDown",XP="ArrowLeft",WP="ArrowRight",QP="Home",ZP="End",JP=new Set([XP,WP]),e9=new Set([GP,KP]),t9=new Set([...JP,...e9]),jx=new Set([...t9,QP,ZP]),n9=E.createContext(void 0),r9={disableStyleElements:!1};function s9(){return E.useContext(n9)??r9}const i9={...Jl,...Zl},a9=E.forwardRef(function(t,n){const{render:r,className:i,style:a,finalFocus:l,...c}=t,{store:d,popupRef:f,onOpenChangeComplete:g,setOpen:m,valueRef:b,firstItemTextRef:x,selectedItemTextRef:v,multiple:k,handleScrollArrowVisibility:w,scrollHandlerRef:S,listRef:N,highlightItemOnHover:_}=ba(),{side:A,align:L,alignItemWithTriggerActive:R,isPositioned:D,setControlledAlignItemWithTrigger:I}=DP(),U=T_()!=null,z=s_(),X=Ix(),{nonce:W,disableStyleElements:V}=s9(),ee=ft(d,ct.id),q=ft(d,ct.open),B=ft(d,ct.openMethod),G=ft(d,ct.mounted),Q=ft(d,ct.popupProps),le=ft(d,ct.transitionStatus),M=ft(d,ct.triggerElement),P=ft(d,ct.positionerElement),F=ft(d,ct.listElement),j=E.useRef(!1),ae=E.useRef(!1),ie=E.useRef({}),ce=zl(),de=tt(Le=>{if(!P||!f.current||!ae.current)return;if(j.current||!R){w();return}const Ee=P.style.top==="0px",Oe=P.style.bottom==="0px";if(!Ee&&!Oe){w();return}const ze=oC(P),Ge=Sc(P.getBoundingClientRect().height,"y",ze),$e=_t(P),De=sn(P),ke=De.getComputedStyle(P),ye=parseFloat(ke.marginTop),Ie=parseFloat(ke.marginBottom),je=aC(De.getComputedStyle(f.current)),te=Math.min($e.documentElement.clientHeight-ye-Ie,je),me=Le.scrollTop,Z=Zf(Le);let re=0,K=null,$=!1,oe=!1;const Ce=et=>{P.style.height=`${et}px`},Re=(et,dt)=>{const ut=Tc(et,0,te-Ge);ut>0&&Ce(Ge+ut),Le.scrollTop=dt,te-(Ge+ut)<=oi&&(j.current=!0),w()},Ve=Ee?Z-me:me,ot=Math.min(Ge+Ve,te);if(re=ot,Ve<=oi){Re(Ve,Ee?Z:0);return}if(te-ot>oi)Ee?oe=!0:K=0;else if($=!0,Oe&&me<Z){const et=Ge+Ve-te;K=me-(Ve-et)}if(re=Math.ceil(re),re!==0&&Ce(re),oe||K!=null){const et=Zf(Le),dt=oe?et:Tc(K,0,et);Math.abs(Le.scrollTop-dt)>oi&&(Le.scrollTop=dt)}($||re>=te-oi)&&(j.current=!0),w()});E.useImperativeHandle(S,()=>de,[de]),ko({open:q,ref:f,onComplete(){q&&g?.(!0)}});const fe={open:q,transitionStatus:le,side:A,align:L};Ye(()=>{!P||!f.current||Object.keys(ie.current).length||(ie.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})},[f,P]),Ye(()=>{q||R||(ae.current=!1,j.current=!1,qh(P,ie.current))},[q,R,P,f]),Ye(()=>{const Le=f.current;if(!q||!M||!P||!Le||R&&!D||d.state.transitionStatus==="ending")return;if(!R){ae.current=!0,ce.request(w),Le.style.removeProperty("--transform-origin");return}const Ee=o9(Le);Le.style.removeProperty("--transform-origin");try{let Oe=v.current;Oe?.isConnected||(Oe=!ct.hasSelectedValue(d.state)&&x.current?.isConnected?x.current:null);const ze=b.current,Ge=sn(P),$e=Ge.getComputedStyle(P),De=Ge.getComputedStyle(Le),ke=_t(M),ye=oC(M),Ie=Jf(M.getBoundingClientRect(),ye),je=Jf(P.getBoundingClientRect(),ye),te=Ie.height,me=F||Le,Z=me.scrollHeight,re=parseFloat(De.borderBottomWidth),K=parseFloat($e.marginTop)||10,$=parseFloat($e.marginBottom)||10,oe=parseFloat($e.minHeight)||100,Ce=aC(De),Re=5,Ve=5,ot=20,et=ke.documentElement.clientHeight-K-$,dt=ke.documentElement.clientWidth,ut=et-Ie.bottom+te;let qe,Rt=X==="rtl"?Ie.right-je.width:Ie.left,jt=0;if(Oe&&ze){const Et=Jf(ze.getBoundingClientRect(),ye);qe=Jf(Oe.getBoundingClientRect(),ye),Rt=je.left+(X==="rtl"?Et.right-qe.right:Et.left-qe.left);const an=Et.top-Ie.top+Et.height/2;jt=qe.top-je.top+qe.height/2-an}const lt=ut+jt+$+re;let Lt=Math.min(et,lt);const Qt=et-K-$,$t=lt-Lt,Zt=dt-Ve;P.style.left=`${Tc(Rt,Re,Zt-je.width)}px`,P.style.height=`${Lt}px`,P.style.maxHeight="none",P.style.marginTop=`${K}px`,P.style.marginBottom=`${$}px`,Le.style.height="100%";const Xe=Zf(me),yt=$t>=Xe-oi;yt&&(Lt=Math.min(et,je.height)-($t-Xe));const Ut=Ie.top<ot||Ie.bottom>et-ot||Math.ceil(Lt)+oi<Math.min(Z,oe),Jt=(Ge.visualViewport?.scale??1)!==1&&ha;if(Ut||Jt){ae.current=!0,qh(P,ie.current),I(!1);return}const Kn=Math.max(oe,Lt);if(yt){const Et=Math.max(0,et-lt);P.style.top=je.height>=Qt?"0":`${Et}px`,P.style.height=`${Lt}px`,me.scrollTop=Zf(me)}else P.style.bottom="0",me.scrollTop=$t;if(qe){const Et=je.top,an=je.height,Er=qe.top+qe.height/2,pn=an>0?(Er-Et)/an*100:50,Sn=Tc(pn,0,100);Le.style.setProperty("--transform-origin",`50% ${Sn}%`)}(Kn===et||Lt>=Ce)&&(j.current=!0),w(),_&&d.state.selectedIndex===null&&d.state.activeIndex===null&&N.current[0]!=null&&d.set("activeIndex",0),ae.current=!0}finally{Ee()}},[d,q,P,M,b,x,v,f,w,R,I,ce,F,N,_,X,D]),E.useEffect(()=>{if(!R||!P||!q)return;const Le=sn(P);function Ee(Oe){m(!1,mt(YD,Oe))}return Tt(Le,"resize",Ee)},[m,R,P,q]);const ve={...F?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":k||void 0,id:`${ee}-list`},onKeyDown(Le){U&&jx.has(Le.key)&&Le.stopPropagation()},onScroll(Le){F||de(Le.currentTarget)},...R&&{style:F?{height:"100%"}:jP}},Fe=Nn("div",t,{ref:[n,f],state:fe,stateAttributesMapping:i9,props:[Q,ve,Im(le),{className:!F&&R?iC.className:void 0},c]});return h.jsxs(E.Fragment,{children:[!V&&iC.getElement(W),h.jsx(mx,{context:z,modal:!1,disabled:!G,openInteractionType:B,returnFocus:l,restoreFocus:!0,children:Fe})]})});function aC(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Zf(e){return h_(e.scrollHeight,e.clientHeight)}function oC(e){return B3.getScale(e)}function Sc(e,t,n){return e/n[t]}function Jf(e,t){return Kc({x:Sc(e.x,"x",t),y:Sc(e.y,"y",t),width:Sc(e.width,"x",t),height:Sc(e.height,"y",t)})}const lC=[["transform","none"],["scale","1"],["translate","0 0"]];function o9(e){const{style:t}=e,n={};for(const[r,i]of lC)n[r]=t.getPropertyValue(r),t.setProperty(r,i,"important");return()=>{for(const[r]of lC){const i=n[r];i?t.setProperty(r,i):t.removeProperty(r)}}}let S_=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Px(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:l,unregister:c,subscribeMapChange:d,elementsRef:f,labelsRef:g,nextIndexRef:m}=kP(),b=E.useRef(-1),[x,v]=E.useState(a??(i===S_.GuessFromOrder?()=>{if(b.current===-1){const S=m.current;m.current+=1,b.current=S}return b.current}:-1)),k=E.useRef(null),w=E.useCallback(S=>{if(k.current=S,x!==-1&&S!==null&&(f.current[x]=S,g)){const N=t!==void 0;g.current[x]=N?t:r?.current?.textContent??S.textContent}},[x,f,g,t,r]);return Ye(()=>{if(a!=null)return;const S=k.current;if(S)return l(S,n),()=>{c(S)}},[a,l,c,n]),Ye(()=>{if(a==null)return d(S=>{const N=k.current?S.get(k.current)?.index:null;N!=null&&v(N)})},[a,d,v]),{ref:w,index:x}}const C_=E.createContext(void 0);function Bx(){const e=E.useContext(C_);if(!e)throw new Error(Ln(57));return e}const l9=E.memo(E.forwardRef(function(t,n){const{render:r,className:i,style:a,value:l=null,label:c,disabled:d=!1,nativeButton:f=!1,...g}=t,m=E.useRef(null),b=Px({label:c,textRef:m,indexGuessBehavior:S_.GuessFromOrder}),{store:x,itemProps:v,setOpen:k,setValue:w,selectionRef:S,typingRef:N,valuesRef:_,multiple:A,selectedItemTextRef:L,disabled:R,readOnly:D}=ba(),I=ft(x,ct.isActive,b.index),U=ft(x,ct.open),z=ft(x,ct.isSelected,l),X=ft(x,ct.isSelectedByFocus,b.index),W=ft(x,ct.isItemEqualToValue),V=b.index,ee=V!==-1,q=E.useRef(null);Ye(()=>{if(!ee)return;const de=_.current;return de[V]=l,()=>{delete de[V]}},[ee,V,l,_]),Ye(()=>{if(!ee)return;const de=x.state.value;let fe=de;A&&Array.isArray(de)&&(fe=de.length>0?de[de.length-1]:void 0),fe!==void 0&&fo(l,fe,W)&&(x.set("selectedIndex",V),m.current&&(L.current=m.current))},[ee,V,A,W,x,l,L]);const B=E.useRef(null),G=E.useRef("mouse"),Q=E.useRef(!1),{getButtonProps:le,buttonRef:M}=eu({disabled:d,focusableWhenDisabled:!0,native:f,composite:!0}),P={disabled:d,selected:z,highlighted:I};function F(de){if(R||D)return;const fe=x.state.value;if(A){const ve=Array.isArray(fe)?fe:[],Fe=z?eP(ve,l,W):[...ve,l];w(Fe,mt(_c,de))}else w(l,mt(_c,de)),k(!1,mt(_c,de))}function j(){S.current.dragY=0}const ae={role:"option","aria-selected":z,tabIndex:U&&I?0:-1,onKeyDown(de){B.current=de.key,x.set("activeIndex",V),de.key===" "&&N.current&&de.preventDefault()},onClick(de){const fe=de.type==="click"&&G.current!=="touch",ve=de.nativeEvent.pointerType,Fe=fe&&tx(de.nativeEvent)&&(ve!==void 0||I),Le=fe&&!Fe&&!Q.current;Q.current=!1,!(de.type==="keydown"&&B.current===null)&&(d||de.type==="keydown"&&B.current===" "&&N.current||Le||(B.current=null,F(de.nativeEvent)))},onPointerEnter(de){G.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){G.current=de.pointerType,Q.current=!0,j()},onMouseUp(){if(j(),d||G.current==="touch"||Q.current)return;const de=!S.current.allowSelectedMouseUp&&z,fe=!S.current.allowUnselectedMouseUp&&!z;de||fe||(Q.current=!0,q.current?.click(),Q.current=!1)}},ie=Nn("div",t,{ref:[M,n,b.ref,q],state:P,props:[v,ae,g,le]}),ce=E.useMemo(()=>({selected:z,index:V,textRef:m,selectedByFocus:X,hasRegistered:ee}),[z,V,m,X,ee]);return h.jsx(C_.Provider,{value:ce,children:ie})})),u9=E.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=Bx();return r||i?h.jsx(c9,{...t,ref:n}):null}),c9=E.memo(E.forwardRef((e,t)=>{const{render:n,className:r,style:i,keepMounted:a,...l}=e,{selected:c}=Bx(),d=E.useRef(null),{transitionStatus:f,setMounted:g}=bx(c),b=Nn("span",e,{ref:[t,d],state:{selected:c,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:Zl});return ko({open:c,ref:d,onComplete(){c||g(!1)}}),b})),d9=E.memo(E.forwardRef(function(t,n){const{index:r,textRef:i,selectedByFocus:a,hasRegistered:l}=Bx(),{firstItemTextRef:c,selectedItemTextRef:d}=ba(),{render:f,className:g,style:m,...b}=t,x=E.useCallback(k=>{k&&(l&&r===0&&(c.current=k),l&&a&&(d.current=k))},[c,d,r,a,l]);return Nn("div",t,{ref:[x,n,i],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 w_=(...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 f9=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 h9=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 uC=e=>{const t=h9(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 $0={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 m9=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},p9=E.createContext({}),g9=()=>E.useContext(p9),b9=E.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...c},d)=>{const{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:m=!1,color:b="currentColor",className:x=""}=g9()??{},v=r??m?Number(n??g)*24/Number(t??f):n??g;return E.createElement("svg",{ref:d,...$0,width:t??f??$0.width,height:t??f??$0.height,stroke:e??b,strokeWidth:v,className:w_("lucide",x,i),...!a&&!m9(c)&&{"aria-hidden":"true"},...c},[...l.map(([k,w])=>E.createElement(k,w)),...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 Ke=(e,t)=>{const n=E.forwardRef(({className:r,...i},a)=>E.createElement(b9,{ref:a,iconNode:t,className:w_(`lucide-${f9(uC(e))}`,`lucide-${e}`,r),...i}));return n.displayName=uC(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 x9=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],y9=Ke("arrow-down",x9);/**
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 E9=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],k_=Ke("arrow-left",E9);/**
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 v9=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],T9=Ke("arrow-up",v9);/**
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 S9=[["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"}]],C9=Ke("at-sign",S9);/**
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 w9=[["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"}]],k9=Ke("brain",w9);/**
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 N9=[["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"}]],_9=Ke("calendar-clock",N9);/**
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 A9=[["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"}]],R9=Ke("chart-pie",A9);/**
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 O9=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],N_=Ke("check",O9);/**
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 I9=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],__=Ke("chevron-down",I9);/**
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 M9=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Yh=Ke("chevron-left",M9);/**
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 L9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Mm=Ke("chevron-right",L9);/**
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 D9=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],j9=Ke("chevrons-up-down",D9);/**
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 P9=[["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"}]],B9=Ke("circle-arrow-down",P9);/**
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 z9=[["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"}]],H9=Ke("clipboard-list",z9);/**
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 U9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],cC=Ke("clock",U9);/**
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 F9=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],zx=Ke("code",F9);/**
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 $9=[["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"}]],V9=Ke("copy",$9);/**
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 q9=[["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"}]],A_=Ke("download",q9);/**
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 Y9=[["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"}]],G9=Ke("ellipsis",Y9);/**
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 K9=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],R_=Ke("eye",K9);/**
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 X9=[["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"}]],W9=Ke("file-diff",X9);/**
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 Q9=[["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"}]],Z9=Ke("file-exclamation-point",Q9);/**
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 J9=[["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"}]],Hx=Ke("file-text",J9);/**
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 e7=[["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"}]],Lm=Ke("file",e7);/**
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 t7=[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],n7=Ke("folder-cog",t7);/**
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 r7=[["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"}]],s7=Ke("folder-open",r7);/**
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 i7=[["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"}]],a7=Ke("folder-search",i7);/**
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 o7=[["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"}]],l7=Ke("folder-tree",o7);/**
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 u7=[["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"}]],O_=Ke("folder",u7);/**
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 c7=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],d7=Ke("gauge",c7);/**
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 f7=[["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"}]],dC=Ke("globe",f7);/**
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 h7=[["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"}]],I_=Ke("hand",h7);/**
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 m7=[["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"}]],p7=Ke("history",m7);/**
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 g7=[["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"}]],b7=Ke("image",g7);/**
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 x7=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],y7=Ke("info",x7);/**
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 E7=[["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"}]],M_=Ke("link-2",E7);/**
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 v7=[["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"}]],L_=Ke("list-checks",v7);/**
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 T7=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],S7=Ke("loader-circle",T7);/**
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 C7=[["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"}]],D_=Ke("message-circle-question-mark",C7);/**
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 w7=[["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"}]],k7=Ke("message-square-text",w7);/**
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 N7=[["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"}]],_7=Ke("moon",N7);/**
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 A7=[["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"}]],j_=Ke("panel-left-close",A7);/**
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 R7=[["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"}]],P_=Ke("panel-left-open",R7);/**
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 O7=[["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"}]],I7=Ke("paperclip",O7);/**
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 M7=[["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"}]],L7=Ke("pencil-line",M7);/**
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 D7=[["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"}]],j7=Ke("plug",D7);/**
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 P7=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ux=Ke("plus",P7);/**
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 B7=[["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"}]],z7=Ke("power-off",B7);/**
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 H7=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],U7=Ke("power",H7);/**
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 F7=[["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"}]],$7=Ke("puzzle",F7);/**
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 V7=[["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"}]],Dm=Ke("refresh-cw",V7);/**
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 q7=[["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"}]],Y7=Ke("rotate-ccw",q7);/**
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 G7=[["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"}]],Fx=Ke("rotate-cw",G7);/**
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 K7=[["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"}]],X7=Ke("save",K7);/**
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 W7=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$x=Ke("search",W7);/**
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 Q7=[["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"}]],Z7=Ke("settings",Q7);/**
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 J7=[["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"}]],eB=Ke("shield-check",J7);/**
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 tB=[["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"}]],jm=Ke("sparkles",tB);/**
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 nB=[["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"}]],rB=Ke("square-check-big",nB);/**
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 sB=[["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"}]],iB=Ke("square-pen",sB);/**
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 aB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],oB=Ke("square-slash",aB);/**
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 lB=[["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"}]],uB=Ke("square-terminal",lB);/**
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 cB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],dB=Ke("square",cB);/**
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 fB=[["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"}]],hB=Ke("sun",fB);/**
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 mB=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Qb=Ke("terminal",mB);/**
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 pB=[["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"}]],Vx=Ke("trash-2",pB);/**
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 gB=[["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"}]],Ll=Ke("triangle-alert",gB);/**
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 bB=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],xB=Ke("user-round",bB);/**
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 yB=[["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"}]],B_=Ke("users-round",yB);/**
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 EB=[["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"}]],vB=Ke("wifi-off",EB);/**
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 TB=[["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"}]],SB=Ke("wrench",TB);/**
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 CB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bi=Ke("x",CB);/**
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 wB=[["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"}]],kB=Ke("zap",wB),ho=lP,mo=TP,la=d9,po=({className:e,children:t,...n})=>h.jsxs(EP,{"data-slot":"select-trigger",className:Se("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,h.jsx(SP,{className:"text-fg-4",children:h.jsx(j9,{className:"size-3.5"})})]}),go=({className:e,align:t="start",alignItemWithTrigger:n=!1,side:r="bottom",sideOffset:i=6,...a})=>h.jsx(wP,{children:h.jsx(qP,{align:t,alignItemWithTrigger:n,side:r,sideOffset:i,className:"isolate z-60 outline-none",children:h.jsx(a9,{"data-slot":"select-content",className:Se("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})})}),ua=({className:e,children:t,...n})=>h.jsxs(l9,{"data-slot":"select-item",className:Se("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:[h.jsx("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:t}),h.jsx(u9,{className:"mt-0.5 text-fg-1",children:h.jsx(N_,{className:"size-3.5"})})]});function NB(e){const{store:t,actionsRef:n}=e,r=t.useState("open");D8(t,r),Ex(t);const{forceUnmount:i}=vx(r,t),a=E.useCallback(()=>{t.setOpen(!1,mt(rx))},[t]);E.useImperativeHandle(n,()=>({unmount:i,close:a}),[i,a])}function _B({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),i=e.useState("disablePointerDismissal"),a=e.useState("modal"),l=e.useState("popupElement"),c=e.useState("floatingRootContext"),[d,f]=E.useState(0),[g,m]=E.useState(0),b=d===0,x=Nm(c,{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 N=gr(S);return b&&!i?a&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===N||e.context.backdropRef.current===N||nt(N,l)&&!N?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:b});E_(r&&a===!0,l),e.useContextCallback("onNestedDialogOpen",(S,N)=>{f(S),m(N)}),e.useContextCallback("onNestedDialogClose",()=>{f(0),m(0)}),E.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(d+1,g+(n?1:0)),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[n,r,d,g,t]);const v=x.reference??dn,k=x.trigger??dn,w=x.floating??dn;return Tx(e,{activeTriggerProps:v,inactiveTriggerProps:k,popupProps:w,nestedOpenDialogCount:d,nestedOpenDrawerCount:g}),null}const z_=E.createContext(!1),H_=E.createContext(void 0);function xa(e){const t=E.useContext(H_);if(e===!1&&t===void 0)throw new Error(Ln(27));return t}const AB={...wx,modal:Be(e=>e.modal),nested:Be(e=>e.nested),nestedOpenDialogCount:Be(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Be(e=>e.nestedOpenDrawerCount),disablePointerDismissal:Be(e=>e.disablePointerDismissal),openMethod:Be(e=>e.openMethod),descriptionElementId:Be(e=>e.descriptionElementId),titleElementId:Be(e=>e.titleElementId),viewportElement:Be(e=>e.viewportElement),role:Be(e=>e.role)};class qx extends pm{constructor(t,n,r=!1){const i=new ad,a=RB(t);a.floatingRootContext=Y3(i,n,r),super(a,{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:i,onOpenChange:void 0,onOpenChangeComplete:void 0},AB)}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};xx(r,t,n.trigger),this.update(r)};static useStore(t,n){return $3(t,(i,a)=>new qx(n,i,a),!0).store}}function RB(e={}){return{...Sx(),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 U_(e,t="dialog"){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:d=!0,actionsRef:f,handle:g,triggerId:m,defaultTriggerId:b=null}=e,x=t==="drawer",v=t==="alert-dialog",k=v?!0:d,w=v||c,S=v?"alertdialog":"dialog",N=xa(!0),A={modal:k,disablePointerDismissal:w,nested:!!N,role:S},L=qx.useStore(g?.store,{open:i,openProp:r,activeTriggerId:b,triggerIdProp:m,...A});q1(()=>{const X=r===void 0&&L.state.open===!1&&i===!0?{open:!0,activeTriggerId:b}:null;v?L.update(X?{...A,...X}:A):X&&L.update(X)}),L.useControlledProp("openProp",r),L.useControlledProp("triggerIdProp",m),L.useSyncedValues(A),L.useContextCallback("onOpenChange",a),L.useContextCallback("onOpenChangeComplete",l);const R=L.useState("open"),D=L.useState("mounted"),I=L.useState("payload");NB({store:L,actionsRef:f});const U=R||D,z=E.useMemo(()=>({store:L}),[L]);return h.jsx(z_.Provider,{value:!1,children:h.jsxs(H_.Provider,{value:z,children:[U&&h.jsx(_B,{store:L,parentContext:N?.store.context,isDrawer:x}),typeof n=="function"?n({payload:I}):n]})})}function OB(e){return U_(e,"alert-dialog")}const IB={...Jl,...Zl},F_=E.forwardRef(function(t,n){const{render:r,className:i,style:a,forceRender:l=!1,...c}=t,{store:d}=xa(),f=d.useState("open"),g=d.useState("nested"),m=d.useState("mounted"),b=d.useState("transitionStatus");return Nn("div",t,{state:{open:f,transitionStatus:b},ref:[d.context.backdropRef,n],stateAttributesMapping:IB,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!g})}),$_=E.forwardRef(function(t,n){const{render:r,className:i,style:a,disabled:l=!1,nativeButton:c=!0,...d}=t,{store:f}=xa(),g=f.useState("open"),{getButtonProps:m,buttonRef:b}=eu({disabled:l,native:c}),x={disabled:l};function v(k){g&&f.setOpen(!1,mt(VD,k.nativeEvent))}return Nn("button",t,{state:x,ref:[n,b],props:[{onClick:v},d,m]})}),V_=E.forwardRef(function(t,n){const{render:r,className:i,style:a,id:l,...c}=t,{store:d}=xa(),f=No(l);return d.useSyncedValueWithCleanup("descriptionElementId",f),Nn("p",t,{ref:n,props:[{id:f},c]})});let MB=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),LB=(function(e){return e[e.open=Za.open]="open",e[e.closed=Za.closed]="closed",e[e.startingStyle=Za.startingStyle]="startingStyle",e[e.endingStyle=Za.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const q_=E.createContext(void 0);function DB(){const e=E.useContext(q_);if(e===void 0)throw new Error(Ln(26));return e}const jB={...Jl,...Zl,nestedDialogOpen(e){return e?{[LB.nestedDialogOpen]:""}:null}},Y_=E.forwardRef(function(t,n){const{render:r,className:i,style:a,finalFocus:l,initialFocus:c,...d}=t,{store:f}=xa(),g=f.useState("descriptionElementId"),m=f.useState("disablePointerDismissal"),b=f.useState("floatingRootContext"),x=f.useState("popupProps"),v=f.useState("modal"),k=f.useState("mounted"),w=f.useState("nested"),S=f.useState("nestedOpenDialogCount"),N=f.useState("open"),_=f.useState("openMethod"),A=f.useState("titleElementId"),L=f.useState("transitionStatus"),R=f.useState("role"),D=b.useState("floatingId"),I=d.id??D;DB(),ko({open:N,ref:f.context.popupRef,onComplete(){N&&f.context.onOpenChangeComplete?.(!0)}});const U=c===void 0?I8(f.context.popupRef):c,z=S>0,X=f.useStateSetter("popupElement"),V=Nn("div",t,{state:{open:N,nested:w,transitionStatus:L,nestedDialogOpen:z},props:[x,{id:I,"aria-labelledby":A??void 0,"aria-describedby":g??void 0,role:R,...Rm,hidden:!k,onKeyDown(ee){jx.has(ee.key)&&ee.stopPropagation()},style:{[MB.nestedDialogs]:S}},d],ref:[n,f.context.popupRef,X],stateAttributesMapping:jB});return h.jsx(mx,{context:b,openInteractionType:_,disabled:!k,closeOnFocusOut:!m,initialFocus:U,returnFocus:l,modal:v!==!1,restoreFocus:"popup",children:V})}),G_=E.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:a}=xa(),l=a.useState("mounted"),c=a.useState("modal"),d=a.useState("open");return l||r?h.jsx(q_.Provider,{value:r,children:h.jsxs(dx,{ref:n,...i,children:[l&&c===!0&&h.jsx(Lx,{ref:a.context.internalBackdropRef,inert:Ox(!d)}),t.children]})}):null}),K_=E.forwardRef(function(t,n){const{render:r,className:i,style:a,id:l,...c}=t,{store:d}=xa(),f=No(l);return d.useSyncedValueWithCleanup("titleElementId",f),Nn("h2",t,{ref:n,props:[{id:f},c]})}),PB=E.forwardRef(function(t,n){const{render:r,className:i,style:a,disabled:l=!1,nativeButton:c=!0,id:d,payload:f,handle:g,...m}=t,b=xa(!0),x=g?.store??b?.store;if(!x)throw new Error(Ln(79));const v=No(d),k=x.useState("floatingRootContext"),w=x.useState("isOpenedByTrigger",v),S=x.useState("triggerPopupId",v),N=E.useRef(null),{registerTrigger:_,isMountedByThisTrigger:A}=yx(v,N,x,{payload:f}),{getButtonProps:L,buttonRef:R}=eu({disabled:l,native:c}),D=px(k,{enabled:k!=null}),I=d_(()=>x.select("open"),X=>{x.set("openMethod",X)}),U={disabled:l,open:w},z=x.useState("triggerProps",A);return Nn("button",t,{state:U,ref:[R,n,_,N],props:[D.reference,z,I,{[S3]:"",id:v,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":S},m,L],stateAttributesMapping:Ax})}),BB=PB,zB=OB,HB=BB,UB=$_,FB=({className:e,children:t,...n})=>h.jsxs(G_,{children:[h.jsx(F_,{className:Se("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")}),h.jsx(Y_,{"data-slot":"alert-dialog-content",className:Se("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})]}),$B=({className:e,...t})=>h.jsx(K_,{className:Se("text-heading-3 font-semibold text-text",e),...t}),VB=({className:e,...t})=>h.jsx(V_,{className:Se("mt-1.5 text-body-sm text-muted-foreground",e),...t}),X_=E.createContext(void 0);function W_(e){const t=E.useContext(X_);if(t===void 0&&!e)throw new Error(Ln(33));return t}const Q_=E.createContext(void 0);function _o(e){const t=E.useContext(Q_);if(t===void 0&&!e)throw new Error(Ln(36));return t}const qB=E.createContext(void 0);function Pm(e=!0){const t=E.useContext(qB);if(t===void 0&&!e)throw new Error(Ln(25));return t}function YB(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:l,itemRef:c,itemMetadata:d}=e,{events:f}=a.useState("floatingTreeRoot"),g=a.useState("open"),m=Pm(!0),b=m!==void 0;return E.useMemo(()=>({id:r,role:"menuitem",tabIndex:g&&n?0:-1,onKeyDown(x){x.key===" "&&l?.current&&x.preventDefault()},onMouseMove(x){i&&f.emit("itemhover",{nodeId:i,target:x.currentTarget})},onClick(x){t&&f.emit("close",{domEvent:x,reason:_c})},onMouseUp(x){if(m){const v=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,b&&v&&Math.abs(x.clientX-v.x)<=1&&Math.abs(x.clientY-v.y)<=1||b&&!J1&&x.button===2)return}c.current&&a.context.allowMouseUpTriggerRef.current&&(!b||x.button===2)&&(!d||d.type==="regular-item")&&c.current.click()}}),[t,n,r,f,i,g,a,l,c,m,b,d])}const GB={type:"regular-item"};function KB(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:l=a.context.typingRef,nativeButton:c,itemMetadata:d,nodeId:f}=e,g=a.useState("disabled"),m=n||g,b=E.useRef(null),{getButtonProps:x,buttonRef:v}=eu({disabled:m,focusableWhenDisabled:!0,native:c,composite:!0}),k=YB({closeOnClick:t,highlighted:r,id:i,nodeId:f,store:a,typingRef:l,itemRef:b,itemMetadata:d}),w=E.useCallback(N=>Ir(k,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()}},N,x),[k,x,d]),S=ao(b,v);return E.useMemo(()=>({getItemProps:w,itemRef:S}),[w,S])}const XB=E.forwardRef(function(t,n){const{render:r,className:i,id:a,label:l,nativeButton:c=!1,disabled:d=!1,closeOnClick:f=!0,style:g,...m}=t,b=Px({label:l}),x=W_(!0),v=No(a),{store:k}=_o(),w=k.useState("isActive",b.index),S=k.useState("itemProps"),{getItemProps:N,itemRef:_}=KB({closeOnClick:f,disabled:d,highlighted:w,id:v,store:k,nativeButton:c,nodeId:x?.context.nodeId,itemMetadata:GB});return Nn("div",t,{state:{disabled:d,highlighted:w},props:[S,m,N],ref:[_,n,b.ref]})}),WB={...Jl,...Zl},QB=E.forwardRef(function(t,n){const{render:r,className:i,style:a,finalFocus:l,...c}=t,{store:d}=_o(),{side:f,align:g}=W_(),m=T_()!=null,b=d.useState("open"),x=d.useState("transitionStatus"),v=d.useState("popupProps"),k=d.useState("mounted"),w=d.useState("instantType"),S=d.useState("activeTriggerElement"),N=d.useState("parent"),_=d.useState("lastOpenChangeReason"),A=d.useState("rootId"),L=d.useState("floatingRootContext"),R=d.useState("floatingTreeRoot"),D=d.useState("closeDelay"),I=d.useState("activeTriggerElement"),U=d.useState("hoverEnabled"),z=d.useState("disabled"),X=d.useState("openMethod"),W=N.type==="context-menu";ko({open:b,ref:d.context.popupRef,onComplete(){b&&d.context.onOpenChangeComplete?.(!0)}}),E.useEffect(()=>{function G(Q){d.setOpen(!1,mt(Q.reason,Q.domEvent))}return R.events.on("close",G),()=>{R.events.off("close",G)}},[R.events,d]),Q3(L,{enabled:U&&!z&&!W&&N.type!=="menubar",closeDelay:D});const V=E.useCallback(G=>{d.set("popupElement",G)},[d]),ee={transitionStatus:x,side:f,align:g,open:b,nested:N.type==="menu",instant:w},q=Nn("div",t,{state:ee,ref:[n,d.context.popupRef,V],stateAttributesMapping:WB,props:[v,{onKeyDown(G){m&&jx.has(G.key)&&G.stopPropagation()}},Im(x),c,{"data-rootownerid":A}]});let B=N.type===void 0||W;return(S||N.type==="menubar"&&_!==Cm)&&(B=!0),h.jsx(mx,{context:L,openInteractionType:X,modal:W,disabled:!k,returnFocus:l===void 0?B:l,initialFocus:N.type!=="menu",restoreFocus:!0,externalTree:N.type!=="menubar"?R:void 0,previousFocusableElement:I,nextFocusableElement:N.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:N.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:q})}),Z_=E.createContext(void 0);function ZB(){const e=E.useContext(Z_);if(e===void 0)throw new Error(Ln(32));return e}const JB=E.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:a}=_o();return a.useState("mounted")||r?h.jsx(Z_.Provider,{value:r,children:h.jsx(dx,{ref:n,...i})}):null}),ez=E.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:l,side:c,align:d,sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:k=!1,collisionAvoidance:w=C3,style:S,...N}=t,{store:_}=_o(),A=ZB(),L=Pm(!0),R=_.useState("parent"),D=_.useState("floatingRootContext"),I=_.useState("floatingTreeRoot"),U=_.useState("mounted"),z=_.useState("open"),X=_.useState("modal"),W=_.useState("openMethod"),V=_.useState("activeTriggerElement"),ee=_.useState("transitionStatus"),q=_.useState("positionerElement"),B=_.useState("instantType"),G=_.useState("hasViewport"),Q=_.useState("lastOpenChangeReason"),le=_.useState("floatingNodeId"),M=_.useState("floatingParentNodeId"),P=D.useState("domReferenceElement"),F=E.useRef(null),j=F3(q,!1,!1);let ae=r,ie=f,ce=g,de=d,fe=w;R.type==="context-menu"&&(ae=r??R.context?.anchor,de=de??"start",!c&&de!=="center"&&(ce=t.alignOffset??2,ie=t.sideOffset??-5));let ve=c,Fe=de;R.type==="menu"?(ve=ve??"inline-end",Fe=Fe??"start",fe=t.collisionAvoidance??w3):R.type==="menubar"&&(ve=ve??(R.context.orientation==="vertical"?"inline-end":"bottom"),Fe=Fe??"start");const Le=R.type==="context-menu",Ee=Mx({anchor:ae,floatingRootContext:D,positionMethod:L?"fixed":i,mounted:U,side:ve,sideOffset:ie,align:Fe,alignOffset:ce,arrowPadding:Le?0:x,collisionBoundary:m,collisionPadding:b,sticky:v,nodeId:le,keepMounted:A,disableAnchorTracking:k,collisionAvoidance:fe,shiftCrossAxis:Le&&!("side"in fe&&fe.side==="flip"),externalTree:I,adaptiveOrigin:G?b_:void 0});E.useEffect(()=>{function Ie(je){je.open&&(je.parentNodeId===le&&_.set("hoverEnabled",!1),je.nodeId!==le&&je.parentNodeId===_.select("floatingParentNodeId")&&_.setOpen(!1,mt(yc)))}return I.events.on("menuopenchange",Ie),()=>{I.events.off("menuopenchange",Ie)}},[_,I.events,le]),E.useEffect(()=>{if(_.select("floatingParentNodeId")==null)return;function Ie(je){if(je.open||je.nodeId!==_.select("floatingParentNodeId"))return;const te=je.reason??yc;_.setOpen(!1,mt(te))}return I.events.on("menuopenchange",Ie),()=>{I.events.off("menuopenchange",Ie)}},[I.events,_]);const Oe=Gn();E.useEffect(()=>{z||Oe.clear()},[z,Oe]),E.useEffect(()=>{function Ie(je){if(!(!z||je.nodeId!==_.select("floatingParentNodeId")))if(je.target&&V&&V!==je.target){const te=_.select("closeDelay");te>0?Oe.isStarted()||Oe.start(te,()=>{_.setOpen(!1,mt(yc))}):_.setOpen(!1,mt(yc))}else Oe.clear()}return I.events.on("itemhover",Ie),()=>{I.events.off("itemhover",Ie)}},[I.events,z,V,_,Oe]),E.useEffect(()=>{const Ie={open:z,nodeId:le,parentNodeId:M,reason:_.select("lastOpenChangeReason")};I.events.emit("menuopenchange",Ie)},[I.events,z,_,le,M]),Ye(()=>{const Ie=P,je=F.current;if(Ie&&(F.current=Ie),je&&Ie&&Ie!==je){_.set("instantType",void 0);const te=new AbortController;return j(()=>{_.set("instantType","trigger-change")},te.signal),()=>{te.abort()}}},[P,j,_]);const ze={open:z,side:Ee.side,align:Ee.align,anchorHidden:Ee.anchorHidden,nested:R.type==="menu",instant:B},Ge=R.type==="menubar"&&R.context.modal;v_(z&&(Ge||X&&Q!==qn),W==="touch",q,V);const De=Dx(t,ze,{styles:Ee.positionerStyles,transitionStatus:ee,props:N,refs:[n,_.useStateSetter("positionerElement")],hidden:!U,inert:!z}),ke=U&&R.type!=="menu"&&(R.type!=="menubar"&&X&&Q!==qn||R.type==="menubar"&&R.context.modal);let ye=null;return R.type==="menubar"?ye=R.context.contentElement:R.type===void 0&&(ye=V),h.jsxs(X_.Provider,{value:Ee,children:[ke&&h.jsx(Lx,{ref:R.type==="context-menu"||R.type==="nested-context-menu"?R.context.internalBackdropRef:null,inert:Ox(!z),cutout:ye}),h.jsx(Lj,{id:le,children:h.jsx(g_,{elementsRef:_.context.itemDomElements,labelsRef:_.context.itemLabels,children:De})})]})}),tz=E.createContext(null);function J_(e){return E.useContext(tz)}const nz={...wx,disabled:Be(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Be(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:Be(e=>e.openMethod),allowMouseEnter:Be(e=>e.allowMouseEnter),highlightItemOnHover:Be(e=>e.highlightItemOnHover),stickIfOpen:Be(e=>e.stickIfOpen),parent:Be(e=>e.parent),rootId:Be(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Be(e=>e.activeIndex),isActive:Be((e,t)=>e.activeIndex===t),hoverEnabled:Be(e=>e.hoverEnabled),instantType:Be(e=>e.instantType),lastOpenChangeReason:Be(e=>e.openChangeReason),floatingTreeRoot:Be(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Be(e=>e.floatingNodeId),floatingParentNodeId:Be(e=>e.floatingParentNodeId),itemProps:Be(e=>e.itemProps),closeDelay:Be(e=>e.closeDelay),hasViewport:Be(e=>e.hasViewport),keyboardEventRelay:Be(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Yx extends pm{constructor(t){super({...rz(),...t},{positionerRef:E.createRef(),popupRef:E.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:E.createRef(),beforeContentFocusGuardRef:E.createRef(),onOpenChangeComplete:void 0,triggerElements:new ad},nz),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),i=n.store.select("floatingTreeRoot"),a=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const l=n.store.select("rootId"),c=n.store.select("floatingTreeRoot"),d=n.store.select("keyboardEventRelay");r===l&&i===c&&a===d||(r=l,i=c,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=xr(()=>new Yx(n)).current;return t??r}unsubscribeParentListener=null}function rz(){return{...Sx(),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 fx,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:dn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const sz=E.createContext(void 0);function iz(){return E.useContext(sz)}const az=K1(function(t){const{children:n,open:r,onOpenChange:i,onOpenChangeComplete:a,defaultOpen:l=!1,disabled:c=!1,modal:d,loopFocus:f=!0,orientation:g="vertical",actionsRef:m,closeParentOnEsc:b=!1,handle:x,triggerId:v,defaultTriggerId:k=null,highlightItemOnHover:w=!0}=t,S=Pm(!0),N=_o(!0),_=J_(!0),A=iz(),L=E.useMemo(()=>A&&N?{type:"menu",store:N.store}:_?{type:"menubar",context:_}:S&&!N?{type:"context-menu",context:S}:{type:void 0},[S,N,_,A]),R=Yx.useStore(x?.store,{open:l,openProp:r,activeTriggerId:k,triggerIdProp:v,parent:L});q3(R,r,l,k),R.useControlledProp("openProp",r),R.useControlledProp("triggerIdProp",v),R.useContextCallback("onOpenChangeComplete",a);const D=uo(),I=uo(),U=R.useState("floatingTreeRoot"),z=I3(U),X=pa(),W=R.useState("open"),V=R.useState("activeTriggerElement"),ee=R.useState("positionerElement"),q=R.useState("hoverEnabled"),B=R.useState("disabled"),G=R.useState("lastOpenChangeReason"),Q=R.useState("parent"),le=R.useState("activeIndex"),M=R.useState("payload"),P=R.useState("floatingParentNodeId"),F=E.useRef(null),j=E.useRef(Q.type!=="context-menu"),ae=Gn(),ie=E.useRef(!0),ce=Gn(),de=P!=null,{openMethod:fe,triggerProps:ve}=f_(W);R.useSyncedValues({disabled:c,highlightItemOnHover:w,modal:Q.type===void 0?d:void 0,openMethod:fe,rootId:D}),Ex(R);const{forceUnmount:Fe}=vx(W,R,()=>{R.update({allowMouseEnter:!1,stickIfOpen:!0})});Ye(()=>{S&&!N?R.update({parent:{type:"context-menu",context:S},floatingNodeId:z,floatingParentNodeId:X}):N&&R.update({floatingNodeId:z,floatingParentNodeId:X})},[S,N,z,X,R]),E.useEffect(()=>{if(W||(F.current=null),Q.type==="context-menu"){if(!W){ae.clear(),j.current=!1;return}ae.start(500,()=>{j.current=!0})}},[ae,W,Q.type]),Ye(()=>{!W&&!q&&R.set("hoverEnabled",!0)},[W,q,R]);const Le=tt((oe,Ce)=>{const Re=Ce.reason;if(W===oe&&Ce.trigger===V&&G===Re)return;const Ve=V3(Ce);if(!oe&&Ce.trigger==null&&(Ce.trigger=V??void 0),i?.(oe,Ce),Ce.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(oe,Ce);const ot=Ce.event;if(oe===!1&&ot?.type==="click"&&ot.pointerType==="touch"&&!ie.current)return;oe&&Re===Ol?(ie.current=!1,ce.start(300,()=>{ie.current=!0})):(ie.current=!0,ce.clear());const et=(Re===Ql||Re===_c)&&ot.detail===0&&ot?.isTrusted,dt=!oe&&(Re===wm||Re==null),ut={open:oe,openChangeReason:Re};F.current=Ce.event??null,xx(ut,oe,Ce.trigger,Ve()),R.update(ut),Q.type==="menubar"&&(Re===Ol||Re===lo||Re===qn||Re===Vb||Re===yc)?R.set("instantType","group"):et||dt?R.set("instantType",et?"click":"dismiss"):R.set("instantType",void 0)}),Ee=U3({popupStore:R,floatingId:I,nested:X!=null,onOpenChange:Le}),Oe=Ee.context.events;E.useEffect(()=>{const oe=({open:Ce,eventDetails:Re})=>Le(Ce,Re);return Oe.on("setOpen",oe),()=>{Oe?.off("setOpen",oe)}},[Oe,Le]);const ze=E.useCallback(()=>{R.setOpen(!1,mt(rx))},[R]);E.useImperativeHandle(m,()=>({unmount:Fe,close:ze}),[Fe,ze]);let Ge;Q.type==="context-menu"&&(Ge=Q.context),E.useImperativeHandle(Ge?.positionerRef,()=>ee,[ee]),E.useImperativeHandle(Ge?.actionsRef,()=>({setOpen:Le}),[Le]);const $e=Nm(Ee,{enabled:!B,bubbles:{escapeKey:b&&Q.type==="menu"},outsidePress(){return Q.type!=="context-menu"||F.current?.type==="contextmenu"?!0:j.current},externalTree:de?U:void 0}),De=Ix(),ke=E.useCallback(oe=>{R.select("activeIndex")!==oe&&R.set("activeIndex",oe)},[R]),ye=J3(Ee,{enabled:!B,listRef:R.context.itemDomElements,activeIndex:le,nested:Q.type!==void 0,loopFocus:f,orientation:g,parentOrientation:Q.type==="menubar"?Q.context.orientation:void 0,rtl:De==="rtl",disabledIndices:Pl,onNavigate:ke,openOnArrowKeyDown:Q.type!=="context-menu",externalTree:de?U:void 0,focusItemOnHover:w}),Ie=E.useCallback(oe=>{R.context.typingRef.current=oe},[R]),je=e_(Ee,{enabled:!B,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:le,resetMs:Aj,onMatch:oe=>{W&&oe!==le&&R.set("activeIndex",oe)},onTyping:Ie}),te=E.useMemo(()=>{const oe=Ir(je.reference,ye.reference,$e.reference,{onMouseMove(){R.set("allowMouseEnter",!0)}},ve);return oe["aria-haspopup"]="menu",oe["aria-expanded"]=W,oe},[R,je.reference,ye.reference,$e.reference,ve,W]),me=E.useMemo(()=>{const oe=Ir(ye.trigger,$e.trigger,ve);return oe["aria-haspopup"]="menu",oe["aria-expanded"]=!1,oe},[ye.trigger,$e.trigger,ve]),Z=E.useMemo(()=>Ir(Rm,{id:I,role:"menu","aria-labelledby":V?.id,onMouseMove(){R.set("allowMouseEnter",!0),Q.type==="menu"&&R.set("hoverEnabled",!1)},onClick(){R.select("hoverEnabled")&&R.set("hoverEnabled",!1)},onKeyDown(oe){const Ce=R.select("keyboardEventRelay");Ce&&!oe.isPropagationStopped()&&Ce(oe)}},je.floating,ye.floating,$e.floating),[V,I,Q.type,R,je.floating,ye.floating,$e.floating]),re=ye.item??dn;Tx(R,{floatingRootContext:Ee,activeTriggerProps:te,inactiveTriggerProps:me,popupProps:Z,itemProps:re});const K=E.useMemo(()=>({store:R,parent:L}),[R,L]),$=h.jsx(Q_.Provider,{value:K,children:typeof n=="function"?n({payload:M}):n});return Q.type===void 0||Q.type==="context-menu"?h.jsx(Dj,{externalTree:U,children:$}):$});function oz(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Rx(),{ref:i,index:a}=Px(e),l=n===a,c=E.useRef(null),d=ao(i,c);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(a)},onMouseMove(){const g=c.current;if(!t||!g)return;const m=g.hasAttribute("disabled")||g.ariaDisabled==="true";!l&&!m&&g.focus()}},compositeRef:d,index:a}}function lz(e){const{render:t,className:n,style:r,state:i=dn,props:a=Pl,refs:l=Pl,metadata:c,stateAttributesMapping:d,tag:f="div",...g}=e,{compositeProps:m,compositeRef:b}=oz({metadata:c});return Nn(f,e,{state:i,ref:[...l,b],props:[m,...a,g],stateAttributesMapping:d})}function eA(e){if(cn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!fi(e))return eA(pi(e))}function uz(e,t){const n=E.useRef(null);function r(a){lr.flushSync(()=>{e.setOpen(!1,mt(lo,a.nativeEvent,a.currentTarget))}),fj(n.current)?.focus()}function i(a){const l=e.select("positionerElement");if(l&&Il(a,l))e.context.beforeContentFocusGuardRef.current?.focus();else{lr.flushSync(()=>{e.setOpen(!1,mt(lo,a.nativeEvent,a.currentTarget))});let c=dj(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&nt(l,c);){const d=c;if(c=lx(c),c===d)break}c?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function cz(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=E.useRef(!1);return E.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,_t(a.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:a=>{i.current&&(i.current=!1,a.preventBaseUIHandler())}}:dn,[t,n,r])}const eh=2,dz=XN(function(t,n){const{render:r,className:i,style:a,disabled:l=!1,nativeButton:c=!0,id:d,openOnHover:f,delay:g=100,closeDelay:m=0,handle:b,payload:x,...v}=t,k=_o(!0),w=b?.store??k?.store;if(!w)throw new Error(Ln(85));const S=No(d),N=w.useState("isTriggerActive",S),_=w.useState("floatingRootContext"),A=w.useState("isOpenedByTrigger",S),L=w.useState("triggerPopupId",S),R=E.useRef(null),D=hz(),I=Rx(!0),U=ga(),z=E.useMemo(()=>U??new fx,[U]),X=I3(z),W=pa(),{registerTrigger:V,isMountedByThisTrigger:ee}=yx(S,R,w,{payload:x,closeDelay:m,parent:D,floatingTreeRoot:z,floatingNodeId:X,floatingParentNodeId:W,keyboardEventRelay:I?.relayKeyboardEvent}),q=D.type==="menubar",B=w.useState("disabled"),G=l||B||q&&D.context.disabled,{getButtonProps:Q,buttonRef:le}=eu({disabled:G,native:c});E.useEffect(()=>{!A&&D.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,A,D.type]);const M=E.useRef(null),P=Gn(),F=tt(ye=>{if(!M.current)return;P.clear(),w.context.allowMouseUpTriggerRef.current=!1;const Ie=ye.target;if(nt(M.current,Ie)||nt(w.select("positionerElement"),Ie)||Ie===M.current||Ie!=null&&eA(Ie)===w.select("rootId"))return;const je=m_(M.current);ye.clientX>=je.left-eh&&ye.clientX<=je.right+eh&&ye.clientY>=je.top-eh&&ye.clientY<=je.bottom+eh||z.events.emit("close",{domEvent:ye,reason:n3})});E.useEffect(()=>{A&&w.select("lastOpenChangeReason")===qn&&_t(M.current).addEventListener("mouseup",F,{once:!0})},[A,F,w]);const j=q&&D.context.hasSubmenuOpen,ie=Z3(_,{enabled:(f??j)&&!G&&D.type!=="context-menu"&&(!q||j&&!ee),handleClose:t_({blockPointerEvents:!q}),mouseOnly:!0,move:!1,restMs:D.type===void 0?g:void 0,delay:{close:m},triggerElementRef:R,externalTree:z,isActiveTrigger:N,isClosing:()=>w.select("transitionStatus")==="ending"}),ce=fz(A,w.select("lastOpenChangeReason")),de=px(_,{enabled:!G&&D.type!=="context-menu",event:A&&q?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?ce:!1}),fe=X3(_,{enabled:!G&&j}),ve=cz({open:A,enabled:q,mouseDownAction:"open"}),Fe=E.useMemo(()=>Ir(fe.reference,de.reference),[fe.reference,de.reference]),Le=w.useState("triggerProps",ee),{preFocusGuardRef:Ee,handlePreFocusGuardFocus:Oe,handleFocusTargetFocus:ze}=uz(w,R),Ge={disabled:G,open:A},$e=[M,n,le,V,R],De=[Fe,ie??dn,Le,{"aria-haspopup":"menu","aria-controls":L,id:S,onMouseDown:ye=>{if(w.select("open"))return;P.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),_t(ye.currentTarget).addEventListener("mouseup",F,{once:!0})}},q?{role:"menuitem"}:{},ve,v,Q],ke=Nn("button",t,{enabled:!q,stateAttributesMapping:Wb,state:Ge,ref:$e,props:De});return q?h.jsx(lz,{tag:"button",render:r,className:i,style:a,state:Ge,refs:$e,props:De,stateAttributesMapping:Wb}):A?h.jsxs(E.Fragment,{children:[h.jsx(Ul,{ref:Ee,onFocus:Oe},`${S}-pre-focus-guard`),h.jsx(E.Fragment,{children:ke},S),h.jsx(Ul,{ref:w.context.triggerFocusTargetRef,onFocus:ze},`${S}-post-focus-guard`)]}):h.jsx(E.Fragment,{children:ke},S)});function fz(e,t){const n=Gn(),[r,i]=E.useState(!1);return Ye(()=>{e&&t==="trigger-hover"?(i(!0),n.start(Rj,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function hz(){const e=Pm(!0),t=_o(!0),n=J_();return E.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const mz=az,pz=dz,gz=({className:e,align:t="end",side:n="bottom",sideOffset:r=6,...i})=>h.jsx(JB,{children:h.jsx(ez,{align:t,side:n,sideOffset:r,className:"isolate z-60 outline-none",children:h.jsx(QB,{"data-slot":"menu-content",className:Se("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),...i})})}),xl=({className:e,destructive:t,...n})=>h.jsx(XB,{"data-slot":"menu-item",className:Se("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 bz(e){const t=E.useContext(z_)?"drawer":"dialog";return U_(e,t)}const tu=bz,nu=({className:e,children:t,size:n="md",...r})=>h.jsxs(G_,{children:[h.jsx(F_,{className:Se("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")}),h.jsx(Y_,{"data-slot":"dialog-content",className:Se("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})]}),ru=({title:e,description:t,actions:n})=>h.jsxs("div",{className:"flex items-start gap-2 border-b border-border px-4 py-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx(K_,{className:"truncate text-body-sm font-semibold text-text",children:e}),t?h.jsx(V_,{className:"mt-0.5 text-label text-fg-4",children:t}):null]}),n,h.jsx($_,{"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:h.jsx(bi,{className:"size-3.5"})})]}),su=({className:e,...t})=>h.jsx("div",{className:Se("min-h-0 flex-1 overflow-y-auto p-4",e),...t}),ir=({label:e,children:t,mono:n})=>h.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[h.jsx("span",{className:"shrink-0 text-label text-fg-3",children:e}),h.jsx("span",{className:Se("min-w-0 truncate text-right text-body-sm text-fg-1",n&&"font-mono text-label"),children:t})]}),tA=E.createContext(void 0);function Bm(e){const t=E.useContext(tA);if(t===void 0&&!e)throw new Error(Ln(72));return t}const xz={...wx,disabled:Be(e=>e.disabled),instantType:Be(e=>e.instantType),isInstantPhase:Be(e=>e.isInstantPhase),trackCursorAxis:Be(e=>e.trackCursorAxis),disableHoverablePopup:Be(e=>e.disableHoverablePopup),lastOpenChangeReason:Be(e=>e.openChangeReason),closeOnClick:Be(e=>e.closeOnClick),closeDelay:Be(e=>e.closeDelay),hasViewport:Be(e=>e.hasViewport)};class Gx extends pm{constructor(t,n,r=!1){const i=new ad,a={...yz(),...t};a.floatingRootContext=Y3(i,n,r),super(a,{popupRef:E.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:i},xz)}setOpen=(t,n)=>{L8(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,mt(Ql,t))}static useStore(t,n){return $3(t,(i,a)=>new Gx(n,i,a)).store}}function yz(){return{...Sx(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const Ez=K1(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:a=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:d,onOpenChangeComplete:f,handle:g,triggerId:m,defaultTriggerId:b=null,children:x}=t,v=Gx.useStore(g?.store,{open:r,openProp:i,activeTriggerId:b,triggerIdProp:m});q3(v,i,r,b),v.useControlledProp("openProp",i),v.useControlledProp("triggerIdProp",m),v.useContextCallback("onOpenChange",d),v.useContextCallback("onOpenChangeComplete",f);const k=v.useState("open"),w=!n&&k,S=v.useState("activeTriggerId"),N=v.useState("mounted"),_=v.useState("payload");v.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:a}),v.useSyncedValue("disabled",n),Ex(v,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:A,transitionStatus:L}=vx(w,v),R=v.useState("isInstantPhase"),D=v.useState("instantType"),I=v.useState("lastOpenChangeReason"),U=E.useRef(null);Ye(()=>{k&&n&&v.setOpen(!1,mt(qD))},[k,n,v]),Ye(()=>{L==="ending"&&I===Wl||L!=="ending"&&R?(D!=="delay"&&(U.current=D),v.set("instantType","delay")):U.current!==null&&(v.set("instantType",U.current),U.current=null)},[L,R,I,D,v]),Ye(()=>{w&&S==null&&v.set("payload",void 0)},[v,S,w]);const z=E.useCallback(()=>{v.setOpen(!1,mt(rx))},[v]);E.useImperativeHandle(c,()=>({unmount:A,close:z}),[A,z]);const X=w||N||!n&&l!=="none";return h.jsxs(tA.Provider,{value:v,children:[X&&h.jsx(vz,{store:v,disabled:n,trackCursorAxis:l}),typeof x=="function"?x({payload:_}):x]})});function vz({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),i=Nm(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=zj(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=E.useMemo(()=>Ir(a.reference,i.reference),[a.reference,i.reference]),c=E.useMemo(()=>Ir(a.trigger,i.trigger),[a.trigger,i.trigger]),d=E.useMemo(()=>Ir(Rm,a.floating,i.floating),[a.floating,i.floating]);return Tx(e,{activeTriggerProps:l,inactiveTriggerProps:c,popupProps:d}),null}const nA=E.createContext(void 0);function Tz(){return E.useContext(nA)}let Sz=(function(e){return e[e.popupOpen=Vh.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const Cz=600,rA="data-base-ui-tooltip-trigger";function fC(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const i=n[r];if(St(i))return i}}const t=e.target;return St(t)?t:null}function wz(e){let t=e;for(;t;){if(t.hasAttribute(rA))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 kz=XN(function(t,n){const{render:r,className:i,style:a,handle:l,payload:c,disabled:d,delay:f,closeOnClick:g=!0,closeDelay:m,id:b,...x}=t,v=Bm(!0),k=l?.store??v;if(!k)throw new Error(Ln(82));const w=No(b),S=k.useState("isTriggerActive",w),N=k.useState("isOpenedByTrigger",w),_=k.useState("floatingRootContext"),A=E.useRef(null),L=f??Cz,R=m??0,{registerTrigger:D,isMountedByThisTrigger:I}=yx(w,A,k,{payload:c,closeOnClick:g,closeDelay:R}),U=Tz(),{delayRef:z,isInstantPhase:X,hasProvider:W}=XD(_,{open:N}),V=Nx(_);k.useSyncedValue("isInstantPhase",X);const ee=k.useState("disabled"),q=d??ee,B=En(q),G=k.useState("trackCursorAxis"),Q=k.useState("disableHoverablePopup"),le=E.useRef(!1),M=Gn(),P=E.useRef(void 0);function F(){const Ee=U?.delay,Oe=typeof z.current=="object"?z.current.open:void 0;let ze=L;return W&&(Oe!==0?ze=f??Ee??L:ze=0),ze}function j(Ee){const Oe=A.current;if(!Oe||!Ee)return!1;const ze=wz(Ee);return ze!==null&&ze!==Oe&&nt(Oe,ze)}function ae(Ee){const Oe=j(Ee);return le.current=Oe,Oe&&(V.openChangeTimeout.clear(),V.restTimeout.clear(),V.restTimeoutPending=!1,M.clear()),Oe}const ie=Z3(_,{enabled:!q,mouseOnly:!0,move:!1,handleClose:!Q&&G!=="both"?t_():null,restMs:F,delay(){const Ee=typeof z.current=="object"?z.current.close:void 0;let Oe=R;return m==null&&W&&(Oe=Ee),{close:Oe}},triggerElementRef:A,isActiveTrigger:S,isClosing:()=>k.select("transitionStatus")==="ending",shouldOpen(){return!le.current}}),ce=X3(_,{enabled:!q}).reference,de=Ee=>{const Oe=le.current,ze=fC(Ee),Ge=ae(ze),$e=A.current,De=$e&&ze&&nt($e,ze);if(Ge&&k.select("open")&&k.select("lastOpenChangeReason")===qn){k.setOpen(!1,mt(qn,Ee));return}if(Oe&&!Ge&&De&&!B.current&&!k.select("open")&&$e&&oo(P.current)){const ke=()=>{!le.current&&!B.current&&!k.select("open")&&k.setOpen(!0,mt(qn,Ee,$e))},ye=F();ye===0?(M.clear(),ke()):M.start(ye,ke)}},fe=k.useState("triggerProps",I);return Nn("button",t,{state:{open:N},ref:[n,D,A],props:[ie,ce,I||G!=="none"?fe:void 0,{onMouseOver(Ee){de(Ee.nativeEvent)},onFocus(Ee){j(fC(Ee.nativeEvent))&&Ee.preventBaseUIHandler()},onMouseLeave(){le.current=!1,M.clear(),P.current=void 0},onPointerEnter(Ee){P.current=Ee.pointerType},onPointerDown(Ee){P.current=Ee.pointerType,k.set("closeOnClick",g),g&&!k.select("open")&&k.cancelPendingOpen(Ee.nativeEvent)},onClick(Ee){g&&!k.select("open")&&k.cancelPendingOpen(Ee.nativeEvent)},id:w,[Sz.triggerDisabled]:q?"":void 0,[rA]:q?void 0:""},x],stateAttributesMapping:Ax})}),sA=E.createContext(void 0);function Nz(){const e=E.useContext(sA);if(e===void 0)throw new Error(Ln(70));return e}const _z=E.forwardRef(function(t,n){const{children:r,container:i,className:a,render:l,style:c,...d}=t,{portalNode:f,portalSubtree:g}=_3({container:i,ref:n,componentProps:t,elementProps:d});return!g&&!f?null:h.jsxs(E.Fragment,{children:[g,f&&lr.createPortal(r,f)]})}),Az=E.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return Bm().useState("mounted")||r?h.jsx(sA.Provider,{value:r,children:h.jsx(_z,{ref:n,...i})}):null}),iA=E.createContext(void 0);function Rz(){const e=E.useContext(iA);if(e===void 0)throw new Error(Ln(71));return e}const Oz=E.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:l="absolute",side:c="top",align:d="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:k=!1,collisionAvoidance:w=w3,style:S,...N}=t,_=Bm(),A=Nz(),L=_.useState("open"),R=_.useState("mounted"),D=_.useState("trackCursorAxis"),I=_.useState("disableHoverablePopup"),U=_.useState("floatingRootContext"),z=_.useState("instantType"),X=_.useState("transitionStatus"),W=_.useState("hasViewport"),V=Mx({anchor:a,positionMethod:l,floatingRootContext:U,mounted:R,side:c,sideOffset:f,align:d,alignOffset:g,collisionBoundary:m,collisionPadding:b,sticky:v,arrowPadding:x,disableAnchorTracking:k,keepMounted:A,collisionAvoidance:w,adaptiveOrigin:W?b_:void 0}),ee=E.useMemo(()=>({open:L,side:V.side,align:V.align,anchorHidden:V.anchorHidden,instant:D!=="none"?"tracking-cursor":z}),[L,V.side,V.align,V.anchorHidden,D,z]),q=Dx(t,ee,{styles:V.positionerStyles,transitionStatus:X,props:N,refs:[n,_.useStateSetter("positionerElement")],hidden:!R,inert:!L||D==="both"||I});return h.jsx(iA.Provider,{value:V,children:q})}),Iz={...Jl,...Zl},Mz=E.forwardRef(function(t,n){const{render:r,className:i,style:a,...l}=t,c=Bm(),{side:d,align:f}=Rz(),g=c.useState("open"),m=c.useState("instantType"),b=c.useState("transitionStatus"),x=c.useState("popupProps"),v=c.useState("floatingRootContext"),k=c.useState("disabled"),w=c.useState("closeDelay");ko({open:g,ref:c.context.popupRef,onComplete(){g&&c.context.onOpenChangeComplete?.(!0)}}),Q3(v,{enabled:!k,closeDelay:w});const S=c.useStateSetter("popupElement");return Nn("div",t,{state:{open:g,side:d,align:f,instant:m,transitionStatus:b},ref:[n,c.context.popupRef,S],props:[x,Im(b),l],stateAttributesMapping:Iz})}),Lz=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,a=E.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),l=E.useMemo(()=>({open:n,close:r}),[n,r]);return h.jsx(nA.Provider,{value:a,children:h.jsx(KD,{delay:l,timeoutMs:i,children:t.children})})},Dz=Lz,jz=({className:e,side:t="top",sideOffset:n=6,...r})=>h.jsx(Az,{children:h.jsx(Oz,{side:t,sideOffset:n,className:"isolate z-60",children:h.jsx(Mz,{"data-slot":"tooltip-content",className:Se("rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none",e),...r})})});function Kx({content:e,render:t,side:n,children:r}){return h.jsxs(Ez,{children:[h.jsx(kz,{render:t??h.jsx("span",{className:"inline-flex"}),children:r}),h.jsx(jz,{side:n,children:e})]})}function Pz(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 Bz=e=>{switch(e){case"success":return Uz;case"info":return $z;case"warning":return Fz;case"error":return Vz;default:return null}},zz=Array(12).fill(0),Hz=({visible:e,className:t})=>Ue.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ue.createElement("div",{className:"sonner-spinner"},zz.map((n,r)=>Ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Uz=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.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"})),Fz=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ue.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"})),$z=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.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"})),Vz=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.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"})),qz=Ue.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"},Ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Yz=()=>{const[e,t]=Ue.useState(document.hidden);return Ue.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Zb=1;class Gz{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,...i}=t,a=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Zb++,l=this.toasts.find(d=>d.id===a),c=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:c,title:r}):d):this.addToast({title:r,...i,dismissible:c,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 i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,l;const c=i.then(async f=>{if(l=["resolve",f],Ue.isValidElement(f))a=!1,this.create({id:r,type:"default",message:f});else if(Xz(f)&&!f.ok){a=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,v=typeof m=="object"&&!Ue.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:b,...v})}else if(f instanceof Error){a=!1;const m=typeof n.error=="function"?await n.error(f):n.error,b=typeof n.description=="function"?await n.description(f):n.description,v=typeof m=="object"&&!Ue.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:b,...v})}else if(n.success!==void 0){a=!1;const m=typeof n.success=="function"?await n.success(f):n.success,b=typeof n.description=="function"?await n.description(f):n.description,v=typeof m=="object"&&!Ue.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:b,...v})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){a=!1;const g=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof g=="object"&&!Ue.isValidElement(g)?g:{message:g};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((f,g)=>c.then(()=>l[0]==="reject"?g(l[1]):f(l[1])).catch(g));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||Zb++;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 Gz,Kz=(e,t)=>{const n=t?.id||Zb++;return Ar.addToast({title:e,...t,id:n}),n},Xz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Wz=Kz,Qz=()=>Ar.toasts,Zz=()=>Ar.getActiveToasts(),zn=Object.assign(Wz,{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:Qz,getToasts:Zz});Pz("[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 th(e){return e.label!==void 0}const Jz=3,eH="24px",tH="16px",hC=4e3,nH=356,rH=14,sH=45,iH=200;function ws(...e){return e.filter(Boolean).join(" ")}function aH(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const oH=e=>{var t,n,r,i,a,l,c,d,f;const{invert:g,toast:m,unstyled:b,interacting:x,setHeights:v,visibleToasts:k,heights:w,index:S,toasts:N,expanded:_,removeToast:A,defaultRichColors:L,closeButton:R,style:D,cancelButtonStyle:I,actionButtonStyle:U,className:z="",descriptionClassName:X="",duration:W,position:V,gap:ee,expandByDefault:q,classNames:B,icons:G,closeButtonAriaLabel:Q="Close toast"}=e,[le,M]=Ue.useState(null),[P,F]=Ue.useState(null),[j,ae]=Ue.useState(!1),[ie,ce]=Ue.useState(!1),[de,fe]=Ue.useState(!1),[ve,Fe]=Ue.useState(!1),[Le,Ee]=Ue.useState(!1),[Oe,ze]=Ue.useState(0),[Ge,$e]=Ue.useState(0),De=Ue.useRef(m.duration||W||hC),ke=Ue.useRef(null),ye=Ue.useRef(null),Ie=S===0,je=S+1<=k,te=m.type,me=m.dismissible!==!1,Z=m.className||"",re=m.descriptionClassName||"",K=Ue.useMemo(()=>w.findIndex(Xe=>Xe.toastId===m.id)||0,[w,m.id]),$=Ue.useMemo(()=>{var Xe;return(Xe=m.closeButton)!=null?Xe:R},[m.closeButton,R]),oe=Ue.useMemo(()=>m.duration||W||hC,[m.duration,W]),Ce=Ue.useRef(0),Re=Ue.useRef(0),Ve=Ue.useRef(0),ot=Ue.useRef(null),[et,dt]=V.split("-"),ut=Ue.useMemo(()=>w.reduce((Xe,yt,Ut)=>Ut>=K?Xe:Xe+yt.height,0),[w,K]),qe=Yz(),Rt=m.invert||g,jt=te==="loading";Re.current=Ue.useMemo(()=>K*ee+ut,[K,ut]),Ue.useEffect(()=>{De.current=oe},[oe]),Ue.useEffect(()=>{ae(!0)},[]),Ue.useEffect(()=>{const Xe=ye.current;if(Xe){const yt=Xe.getBoundingClientRect().height;return $e(yt),v(Ut=>[{toastId:m.id,height:yt,position:m.position},...Ut]),()=>v(Ut=>Ut.filter(Jt=>Jt.toastId!==m.id))}},[v,m.id]),Ue.useLayoutEffect(()=>{if(!j)return;const Xe=ye.current,yt=Xe.style.height;Xe.style.height="auto";const Ut=Xe.getBoundingClientRect().height;Xe.style.height=yt,$e(Ut),v(Jt=>Jt.find(Et=>Et.toastId===m.id)?Jt.map(Et=>Et.toastId===m.id?{...Et,height:Ut}:Et):[{toastId:m.id,height:Ut,position:m.position},...Jt])},[j,m.title,m.description,v,m.id,m.jsx,m.action,m.cancel]);const lt=Ue.useCallback(()=>{ce(!0),ze(Re.current),v(Xe=>Xe.filter(yt=>yt.toastId!==m.id)),setTimeout(()=>{A(m)},iH)},[m,A,v,Re]);Ue.useEffect(()=>{if(m.promise&&te==="loading"||m.duration===1/0||m.type==="loading")return;let Xe;return _||x||qe?(()=>{if(Ve.current<Ce.current){const Jt=new Date().getTime()-Ce.current;De.current=De.current-Jt}Ve.current=new Date().getTime()})():(()=>{De.current!==1/0&&(Ce.current=new Date().getTime(),Xe=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),lt()},De.current))})(),()=>clearTimeout(Xe)},[_,x,m,te,qe,lt]),Ue.useEffect(()=>{m.delete&&(lt(),m.onDismiss==null||m.onDismiss.call(m,m))},[lt,m.delete]);function Lt(){var Xe;if(G?.loading){var yt;return Ue.createElement("div",{className:ws(B?.loader,m==null||(yt=m.classNames)==null?void 0:yt.loader,"sonner-loader"),"data-visible":te==="loading"},G.loading)}return Ue.createElement(Hz,{className:ws(B?.loader,m==null||(Xe=m.classNames)==null?void 0:Xe.loader),visible:te==="loading"})}const Qt=m.icon||G?.[te]||Bz(te);var $t,Zt;return Ue.createElement("li",{tabIndex:0,ref:ye,className:ws(z,Z,B?.toast,m==null||(t=m.classNames)==null?void 0:t.toast,B?.default,B?.[te],m==null||(n=m.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":($t=m.richColors)!=null?$t:L,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":j,"data-promise":!!m.promise,"data-swiped":Le,"data-removed":ie,"data-visible":je,"data-y-position":et,"data-x-position":dt,"data-index":S,"data-front":Ie,"data-swiping":de,"data-dismissible":me,"data-type":te,"data-invert":Rt,"data-swipe-out":ve,"data-swipe-direction":P,"data-expanded":!!(_||q&&j),"data-testid":m.testId,style:{"--index":S,"--toasts-before":S,"--z-index":N.length-S,"--offset":`${ie?Oe:Re.current}px`,"--initial-height":q?"auto":`${Ge}px`,...D,...m.style},onDragEnd:()=>{fe(!1),M(null),ot.current=null},onPointerDown:Xe=>{Xe.button!==2&&(jt||!me||(ke.current=new Date,ze(Re.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(fe(!0),ot.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,yt,Ut;if(ve||!me)return;ot.current=null;const Jt=Number(((Xe=ye.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Kn=Number(((yt=ye.current)==null?void 0:yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Et=new Date().getTime()-((Ut=ke.current)==null?void 0:Ut.getTime()),an=le==="x"?Jt:Kn,Er=Math.abs(an)/Et;if(Math.abs(an)>=sH||Er>.11){ze(Re.current),m.onDismiss==null||m.onDismiss.call(m,m),F(le==="x"?Jt>0?"right":"left":Kn>0?"down":"up"),lt(),Fe(!0);return}else{var pn,Sn;(pn=ye.current)==null||pn.style.setProperty("--swipe-amount-x","0px"),(Sn=ye.current)==null||Sn.style.setProperty("--swipe-amount-y","0px")}Ee(!1),fe(!1),M(null)},onPointerMove:Xe=>{var yt,Ut,Jt;if(!ot.current||!me||((yt=window.getSelection())==null?void 0:yt.toString().length)>0)return;const Et=Xe.clientY-ot.current.y,an=Xe.clientX-ot.current.x;var Er;const pn=(Er=e.swipeDirections)!=null?Er:aH(V);!le&&(Math.abs(an)>1||Math.abs(Et)>1)&&M(Math.abs(an)>Math.abs(Et)?"x":"y");let Sn={x:0,y:0};const ht=Ot=>1/(1.5+Math.abs(Ot)/20);if(le==="y"){if(pn.includes("top")||pn.includes("bottom"))if(pn.includes("top")&&Et<0||pn.includes("bottom")&&Et>0)Sn.y=Et;else{const Ot=Et*ht(Et);Sn.y=Math.abs(Ot)<Math.abs(Et)?Ot:Et}}else if(le==="x"&&(pn.includes("left")||pn.includes("right")))if(pn.includes("left")&&an<0||pn.includes("right")&&an>0)Sn.x=an;else{const Ot=an*ht(an);Sn.x=Math.abs(Ot)<Math.abs(an)?Ot:an}(Math.abs(Sn.x)>0||Math.abs(Sn.y)>0)&&Ee(!0),(Ut=ye.current)==null||Ut.style.setProperty("--swipe-amount-x",`${Sn.x}px`),(Jt=ye.current)==null||Jt.style.setProperty("--swipe-amount-y",`${Sn.y}px`)}},$&&!m.jsx&&te!=="loading"?Ue.createElement("button",{"aria-label":Q,"data-disabled":jt,"data-close-button":!0,onClick:jt||!me?()=>{}:()=>{lt(),m.onDismiss==null||m.onDismiss.call(m,m)},className:ws(B?.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(Zt=G?.close)!=null?Zt:qz):null,(te||m.icon||m.promise)&&m.icon!==null&&(G?.[te]!==null||m.icon)?Ue.createElement("div",{"data-icon":"",className:ws(B?.icon,m==null||(i=m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Lt():null,m.type!=="loading"?Qt:null):null,Ue.createElement("div",{"data-content":"",className:ws(B?.content,m==null||(a=m.classNames)==null?void 0:a.content)},Ue.createElement("div",{"data-title":"",className:ws(B?.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?Ue.createElement("div",{"data-description":"",className:ws(X,re,B?.description,m==null||(c=m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),Ue.isValidElement(m.cancel)?m.cancel:m.cancel&&th(m.cancel)?Ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:Xe=>{th(m.cancel)&&me&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Xe),lt())},className:ws(B?.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,Ue.isValidElement(m.action)?m.action:m.action&&th(m.action)?Ue.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||U,onClick:Xe=>{th(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Xe),!Xe.defaultPrevented&&lt())},className:ws(B?.actionButton,m==null||(f=m.classNames)==null?void 0:f.actionButton)},m.action.label):null)};function mC(){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 lH(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,l=a?"--mobile-offset":"--offset",c=a?tH:eH;function d(f){["top","right","bottom","left"].forEach(g=>{n[`${l}-${g}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=c:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const uH=Ue.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:g,mobileOffset:m,theme:b="light",richColors:x,duration:v,style:k,visibleToasts:w=Jz,toastOptions:S,dir:N=mC(),gap:_=rH,icons:A,containerAriaLabel:L="Notifications"}=t,[R,D]=Ue.useState([]),I=Ue.useMemo(()=>r?R.filter(j=>j.toasterId===r):R.filter(j=>!j.toasterId),[R,r]),U=Ue.useMemo(()=>Array.from(new Set([a].concat(I.filter(j=>j.position).map(j=>j.position)))),[I,a]),[z,X]=Ue.useState([]),[W,V]=Ue.useState(!1),[ee,q]=Ue.useState(!1),[B,G]=Ue.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=Ue.useRef(null),le=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=Ue.useRef(null),P=Ue.useRef(!1),F=Ue.useCallback(j=>{D(ae=>{var ie;return(ie=ae.find(ce=>ce.id===j.id))!=null&&ie.delete||Ar.dismiss(j.id),ae.filter(({id:ce})=>ce!==j.id)})},[]);return Ue.useEffect(()=>Ar.subscribe(j=>{if(j.dismiss){requestAnimationFrame(()=>{D(ae=>ae.map(ie=>ie.id===j.id?{...ie,delete:!0}:ie))});return}setTimeout(()=>{D5.flushSync(()=>{D(ae=>{const ie=ae.findIndex(ce=>ce.id===j.id);return ie!==-1?[...ae.slice(0,ie),{...ae[ie],...j},...ae.slice(ie+1)]:[j,...ae]})})})}),[R]),Ue.useEffect(()=>{if(b!=="system"){G(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const j=window.matchMedia("(prefers-color-scheme: dark)");try{j.addEventListener("change",({matches:ae})=>{G(ae?"dark":"light")})}catch{j.addListener(({matches:ie})=>{try{G(ie?"dark":"light")}catch(ce){console.error(ce)}})}},[b]),Ue.useEffect(()=>{R.length<=1&&V(!1)},[R]),Ue.useEffect(()=>{const j=ae=>{var ie;if(l.every(fe=>ae[fe]||ae.code===fe)){var de;V(!0),(de=Q.current)==null||de.focus()}ae.code==="Escape"&&(document.activeElement===Q.current||(ie=Q.current)!=null&&ie.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[l]),Ue.useEffect(()=>{if(Q.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,P.current=!1)}},[Q.current]),Ue.createElement("section",{ref:n,"aria-label":`${L} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((j,ae)=>{var ie;const[ce,de]=j.split("-");return I.length?Ue.createElement("ol",{key:j,dir:N==="auto"?mC():N,tabIndex:-1,ref:Q,className:f,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":ce,"data-x-position":de,style:{"--front-toast-height":`${((ie=z[0])==null?void 0:ie.height)||0}px`,"--width":`${nH}px`,"--gap":`${_}px`,...k,...lH(g,m)},onBlur:fe=>{P.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(P.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||P.current||(P.current=!0,M.current=fe.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{ee||V(!1)},onDragEnd:()=>V(!1),onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},I.filter(fe=>!fe.position&&ae===0||fe.position===j).map((fe,ve)=>{var Fe,Le;return Ue.createElement(oH,{key:fe.id,icons:A,index:ve,toast:fe,defaultRichColors:x,duration:(Fe=S?.duration)!=null?Fe:v,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:i,visibleToasts:w,closeButton:(Le=S?.closeButton)!=null?Le:d,interacting:ee,position:j,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:F,toasts:I.filter(Ee=>Ee.position==fe.position),heights:z.filter(Ee=>Ee.position==fe.position),setHeights:X,expandByDefault:c,gap:_,expanded:W,swipeDirections:t.swipeDirections})})):null}))});function cH(){return h.jsx(uH,{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 dH(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return fH(e)}function fH(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 Gh({value:e,glyph:t,className:n,variant:r="ghost",size:i="icon-sm",...a}){const[l,c]=E.useState(!1);return h.jsx(at,{variant:r,size:i,"aria-label":"Copy",className:Se("text-fg-3",n),onClick:()=>{dH(e).then(d=>{d&&(c(!0),setTimeout(()=>c(!1),1500))})},...a,children:t?h.jsx("span",{className:Se("font-mono text-body-sm leading-5",l&&"text-success"),children:l?"✓":"⧉"}):l?h.jsx(N_,{className:"size-3.5 text-success"}):h.jsx(V9,{className:"size-3.5"})})}function vn({className:e}){return h.jsx(S7,{"aria-label":"Loading",className:Se("size-4 animate-spin text-fg-3",e)})}function aA({code:e,label:t,copyable:n=!0,variant:r="panel",className:i}){const a=r==="plain",l=t!==void 0||n;return a?h.jsxs("div",{"data-slot":"code-block","data-variant":"plain",className:Se("min-w-0",i),children:[l?h.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[h.jsx("span",{className:"truncate text-label leading-5 text-fg-4",children:t}),n?h.jsx(Gh,{glyph:!0,value:e,className:"size-5 shrink-0 rounded-sm"}):null]}):null,h.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})]}):h.jsxs("div",{"data-slot":"code-block",className:Se("overflow-hidden rounded-md border border-border bg-code-bg",i),children:[l?h.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border px-2.5",children:[h.jsx("span",{className:"font-mono text-label text-fg-3",children:t}),n?h.jsx(Gh,{value:e}):null]}):null,h.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 pC({orientation:e,value:t,onValueChange:n,min:r,max:i,step:a=16,inverted:l,"aria-label":c,className:d}){const f=E.useRef(null),g=e==="vertical",m=E.useCallback(w=>Math.min(i,Math.max(r,w)),[r,i]),b=w=>{w.button===0&&(w.preventDefault(),w.currentTarget.setPointerCapture(w.pointerId),f.current={origin:g?w.clientX:w.clientY,start:t})},x=w=>{const S=f.current;if(!S)return;const N=(g?w.clientX:w.clientY)-S.origin;n(m(S.start+(l?-N:N)))},v=w=>{f.current&&(f.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId))},k=w=>{const S=g?"ArrowRight":"ArrowDown",N=g?"ArrowLeft":"ArrowUp",_=l?-1:1;if(w.key===S)n(m(t+a*_));else if(w.key===N)n(m(t-a*_));else if(w.key==="Home")n(r);else if(w.key==="End")n(i);else return;w.preventDefault()};return h.jsx("div",{"data-slot":"splitter",role:"separator",tabIndex:0,"aria-label":c,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":i,onPointerDown:b,onPointerMove:x,onPointerUp:v,onPointerCancel:v,onKeyDown:k,className:Se("group relative shrink-0 touch-none bg-border transition-colors","hover:bg-border-strong focus-visible:bg-accent focus-visible:outline-none",g?"w-px cursor-col-resize":"h-px cursor-row-resize",d),children:h.jsx("span",{"aria-hidden":!0,className:Se("absolute",g?"-inset-x-[3px] inset-y-0":"-inset-y-[3px] inset-x-0")})})}function oA({value:e,size:t=13,strokeWidth:n=2,className:r}){const i=Math.min(100,Math.max(0,e)),a=(t-n)/2,l=2*Math.PI*a;return h.jsxs("svg",{"data-slot":"progress-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":`${Math.round(i)}%`,className:Se("shrink-0 -rotate-90",r),children:[h.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:n}),h.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:l*(1-i/100)})]})}function Bn(e){return e.map(t=>t.type==="text"?t.text:`${t.trigger}${t.displayText}`).join("")}function hH(e){return e?[{type:"text",text:e}]:[]}function mH(e,t){if(t<=0)return[];const n=[];let r=0;for(const i of e){const a=i.type==="text"?i.text.length:i.trigger.length+i.displayText.length;if(r+a<=t){n.push(i),r+=a;continue}if(i.type==="text"){let l=t-r;if(l>0){const c=i.text.charCodeAt(l-1);c>=55296&&c<=56319&&(l-=1),l>0&&n.push({type:"text",text:i.text.slice(0,l)})}}break}return n}function Oc(e){return e===" "||e===`
467
- `||e===" "}function lA(e){const t=new Map;for(const n of e)t.has(n.char)||t.set(n.char,n);return t}function Kh(e,t,n){if(t===0)return!0;const r=e[t-1];return n==="start"?r===`
468
- `:Oc(r)}function pH(e,t,n){if(!e||t===0||n.length===0)return null;const r=lA(n);for(let i=t-1;i>=0;i--){const a=e[i];if(Oc(a)){if(i+1<t){const c=e[i+1],d=r.get(c);if(d&&Kh(e,i+1,d.position))return{config:d,startOffset:i+1,query:e.slice(i+2,t)}}return null}const l=r.get(a);if(l&&Kh(e,i,l.position))return{config:l,startOffset:i,query:e.slice(i+1,t)}}return null}function V0(e,t,n){const r=t.startOffset,i=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,v=l+b.length;(v<=r||x>=i)&&a.push(m),l=v}else{const b=l,x=l+m.text.length;if(x<=r)a.push(m);else if(b>=i)a.push(m);else{const v=m.text.slice(0,Math.max(0,r-b)),k=m.text.slice(Math.min(m.text.length,i-b));v&&a.push({type:"text",text:v});const w={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(w),k?a.push({type:"text",text:" "+k.replace(/^\s/,"")}):a.push({type:"text",text:" "})}l=x}const c=Ao(a);let d=-1,f=0;for(const m of c)m.type==="text"?f+=m.text.length:(f+=m.trigger.length+m.displayText.length,m.value===n.value&&m.displayText===n.displayText&&m.trigger===t.config.char&&(d=f));const g=d===-1?f:d+1;return{segments:c,cursorOffset:g}}function gH(e,t,n){const r=t.startOffset,i=r+1+t.query.length,a=[];let l=0,c=r+n.length;for(const g of e){if(g.type==="chip"){const x=l+`${g.trigger}${g.displayText}`.length;(x<=r||l>=i)&&a.push(g),l=x;continue}const m=l,b=l+g.text.length;if(b<=r||m>=i)a.push(g);else{const x=g.text.slice(0,Math.max(0,r-m)),v=g.text.slice(Math.min(g.text.length,i-m));x&&a.push({type:"text",text:x}),a.push({type:"text",text:n}),v&&a.push({type:"text",text:v})}l=b}const d=Ao(a),f=Bn(d).length;return c>f&&(c=f),{segments:d,cursorOffset:c}}function bH(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 Ao(n)}function xH(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}`,i=[...e.slice(0,t),{type:"text",text:r},...e.slice(t+1)];return{segments:Ao(i),revertedText:r}}function yH(e,t){const n=t.filter(a=>a.resolveOnSpace);if(n.length===0)return e;const r=lA(n),i=[];for(const a of e){if(a.type==="chip"){i.push(a);continue}const l=EH(a.text,r);i.push(...l)}return Ao(i)}function EH(e,t){if(!e)return[];const n=[];let r=0;for(;r<e.length;){const i=e[r];if(t.has(i)&&(r===0||Oc(e[r-1]))){const c=t.get(i);if(c&&Kh(e,r,c.position)){let d=r+1;for(;d<e.length&&!Oc(e[d]);)d++;const f=e.slice(r+1,d);if(f.length>0){const g=c.onSelect?.({value:f,label:f})||f;n.push({type:"chip",trigger:i,value:f,displayText:g,autoResolved:!0}),r=d;continue}}}const a=r;for(r++;r<e.length&&!(t.has(e[r])&&Oc(e[r-1]));)r++;n.push({type:"text",text:e.slice(a,r)})}return n}function mr(e,t,n,r){const i=[];let a=0,l=!1;for(const c of e)if(c.type==="chip"){const d=`${c.trigger}${c.displayText}`,f=a,g=a+d.length;!l&&t===n&&f===t&&(i.push({type:"text",text:r}),l=!0),(g<=t||f>=n)&&i.push(c),a=g}else{const d=a,f=a+c.text.length,g=t===n?f<t:f<=t,m=t===n?d>n:d>=n;if(g)i.push(c);else if(m)i.push(c);else{const b=c.text.slice(0,Math.max(0,t-d)),x=c.text.slice(Math.min(c.text.length,n-d));b&&i.push({type:"text",text:b}),!l&&d<=t&&(i.push({type:"text",text:r}),l=!0),x&&i.push({type:"text",text:x})}a=f}return!l&&r&&i.push({type:"text",text:r}),Ao(i)}function vH(e,t,n,r){if(t===n)return null;const i=Bn(e),a=r.length,l=t>=a&&i.slice(t-a,t)===r,c=n+a<=i.length&&i.slice(n,n+a)===r;let d=l&&c;if(d&&a===1){const m=t>a?i[t-a-1]:"",b=n+a<i.length?i[n+a]:"";(m===r||b===r)&&(d=!1)}if(d){const m=mr(e,n,n+a,"");return{segments:mr(m,t-a,t,""),selectionStart:t-a,selectionEnd:n-a}}const f=mr(e,n,n,r);return{segments:mr(f,t,t,r),selectionStart:t+a,selectionEnd:n+a}}function TH(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],i=t[n];if(r.type!==i.type)return!1;if(r.type==="text"){if(i.type!=="text"||r.text!==i.text)return!1}else if(i.type!=="chip"||r.trigger!==i.trigger||r.value!==i.value||r.displayText!==i.displayText||r.autoResolved!==i.autoResolved)return!1}return!0}function Ao(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 zm(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 $l(e,t){const n=e.lastIndexOf(`
469
- `,t-1)+1,r=e.indexOf(`
470
- `,t),i=e.slice(n,r===-1?e.length:r),a=zm(i);return a?{lineStart:n,prefix:i.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 SH(e,t){const n=Bn(e),r=n.lastIndexOf(`
471
- `,t-1)+1,i=n.slice(r,t),a=i.match(/^(\s*)[-*] $/);if(!a)return null;const c=`${a[1]}• `,d=r,f=r+i.length;return{segments:mr(e,d,f,c),cursorOffset:r+c.length}}function CH(e,t){const n=Bn(e),r=$l(n,t);if(!r)return null;const i=n.indexOf(`
472
- `,t);if(n.slice(r.contentStart,i===-1?n.length:i).trim()==="")return r.indent>0?{segments:mr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:mr(e,r.lineStart,r.lineStart+r.prefix.length,""),cursorOffset:r.lineStart};const l=" ".repeat(r.indent);let c;if(r.listType==="bullet")c=`${l}${r.marker??"•"} `;else{const g=(r.number??1)+1;c=`${l}${g}. `}const d=`
473
- ${c}`;return{segments:mr(e,t,t,d),cursorOffset:t+d.length}}function wH(e,t){if(t===0)return null;const n=e.lastIndexOf(`
474
- `,t-2)+1,r=zm(e.slice(n,t-1));return r?r.indent:null}function kH(e,t){const n=Bn(e),r=$l(n,t);if(!r)return null;const i=wH(n,r.lineStart),a=i===null?0:i+1;return r.indent>=a?null:{segments:mr(e,r.lineStart,r.lineStart," "),cursorOffset:t+2}}function NH(e,t){const n=Bn(e),r=$l(n,t);return!r||r.indent===0?null:{segments:mr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}}function _H(e,t){const n=Bn(e),r=$l(n,t);return!r||t>r.contentStart?null:{segments:mr(e,r.lineStart,r.contentStart," ".repeat(r.indent)),cursorOffset:r.lineStart+r.indent*2}}const AH=/^\s*```/;function uA(e,t){return t?e.replace(/^(\s*)- /,"$1• "):e.replace(/^(\s*)• /,"$1- ")}function cA(e){const t=new Set;let n=-1;return e.forEach((r,i)=>{if(AH.test(r))if(n===-1)n=i;else{for(let a=n;a<=i;a++)t.add(a);n=-1}}),t}function RH(e,t){const n=e.split(`
475
- `),r=cA(n);return n.map((i,a)=>r.has(a)?i:uA(i,t)).join(`
476
- `)}function gC(e,t){const n=[];e.forEach(c=>{c.type==="text"&&n.push(...c.text.split(`
477
- `))});const r=cA(n);let i=0,a=!1;const l=e.map(c=>{if(c.type!=="text")return c;const d=c.text.split(`
478
- `).map(f=>{const g=r.has(i)?f:uA(f,t);return i++,g}).join(`
479
- `);return d===c.text?c:(a=!0,{...c,text:d})});return a?l:e}function dA(e){let t=null,n=0,r=0,i=0,a=!0;for(const l of e.split(`
480
- `)){const c=zm(l);if(c?.kind==="numbered"&&c.indent===t){if(a=a&&c.number===r+1,r=c.number,i++,i>=2&&(n===1||a))return!0}else c?.kind==="numbered"?(t=c.indent,n=c.number,r=c.number,i=1,a=!0):(t=null,i=0)}return!1}function fA(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};const t=new Map,n=[],r=e.split(`
481
- `);let i="",a=0;const l=(c,d)=>{for(const f of t.keys())(d?f>=c:f>c)&&t.delete(f)};for(let c=0;c<r.length;c++){const d=r[c],f=zm(d);if(!f)t.clear(),i+=d;else if(f.kind==="bullet")l(f.indent,!0),i+=d;else{const g=f.indent;l(g,!1);const m=t.get(g),b=m===void 0?1:m+1;t.set(g,b);const x=String(b);x===String(f.number)?i+=d:(n.push({oldStart:a+f.numberStart,oldEnd:a+f.numberEnd,newText:x}),i+=d.slice(0,f.numberStart)+x+d.slice(f.numberEnd))}c<r.length-1&&(i+=`
482
- `),a+=d.length+1}return n.length===0?{text:e,edits:n}:{text:i,edits:n}}function bC(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 xC(e){const{edits:t}=fA(Bn(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let r=t.length-1;r>=0;r--){const i=t[r];n=mr(n,i.oldStart,i.oldEnd,i.newText)}return{segments:n,edits:t}}function xi(e){return e instanceof HTMLElement}function er(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function Xh(e){return e instanceof HTMLBRElement}function od(e){return e instanceof Text}function Jb(e){return er(e)&&e.dataset.chipAutoResolved==="true"}function OH(e){return e instanceof HTMLAnchorElement&&e.dataset.url==="true"}function IH(e){try{return JSON.parse(e)}catch{return}}function Sh(e){try{return JSON.stringify(e)}catch{return}}function hA(e){if(er(e))return e.dataset.chipTrigger}function MH(e){if(er(e))return e.dataset.chipValue}function mA(e){if(er(e))return e.dataset.chipDisplay??e.textContent??void 0}function LH(e){if(!er(e))return;const t=e.dataset.chipData;if(t)return IH(t)}function pA(e){const t=e.dataset.chipTrigger??"",n=e.dataset.chipDisplay??e.textContent??"";return t.length+n.length}function Wh(e){if(!er(e))return null;const t=hA(e),n=MH(e),r=mA(e);if(!t||n===void 0||!r)return null;const i=LH(e),a=Jb(e);return{type:"chip",trigger:t,value:n,displayText:r,...i!==void 0?{data:i}:{},...a?{autoResolved:!0}:{}}}function Ch(e,t){const n=e.childNodes;for(let r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function DH(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??"")!=="":Xh(e)?!e.dataset.sentinel:er(e)?Wh(e)!==null:xi(e)?(e.textContent??"")!=="":!1}function q0(e,t){let n=0;for(let r=0;r<t;r++)DH(e.childNodes[r])&&n++;return n}function e1(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function jH(e,t){const n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement("br")),e.replaceChild(n,t)}function t1(e){let t=!1;const n=new Set(["DIV","P","SECTION","ARTICLE","BLOCKQUOTE"]);for(let r=e.childNodes.length-1;r>=0;r--){const i=e.childNodes[r];if(!(i instanceof HTMLElement)||i.dataset.chipTrigger!==void 0||i instanceof HTMLBRElement)continue;const a=i.tagName;if(n.has(a))jH(e,i),t=!0;else if(a==="FONT"||a==="B"||a==="I"||a==="U"||a==="STRONG"||a==="EM"||a==="A"||a==="SPAN"){const l=i.textContent??"";l?e.replaceChild(document.createTextNode(l),i):e.removeChild(i),t=!0}}return e.normalize(),t}const yC=/https?:\/\/[^\s),]+/g;function PH(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];od(i)&&i.textContent&&n.push(i)}for(const r of n){const i=r.textContent??"";yC.lastIndex=0;const a=[];let l;for(;(l=yC.exec(i))!==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 c=r.parentNode;if(!c)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 f=document.createDocumentFragment();let g=0;for(const{url:m,href:b,index:x}of d){x>g&&f.appendChild(document.createTextNode(i.slice(g,x)));const v=document.createElement("a");v.href=b,v.target="_blank",v.rel="noopener noreferrer",v.dataset.url="true",v.className="text-accent hover:text-accent-hover underline cursor-pointer",v.textContent=m,f.appendChild(v),g=x+m.length}g<i.length&&f.appendChild(document.createTextNode(i.slice(g))),c.replaceChild(f,r)}return t}const EC=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g;function BH(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];od(i)&&i.textContent&&n.push(i)}for(const r of n){const i=r.textContent??"";EC.lastIndex=0;const a=[];let l;for(;(l=EC.exec(i))!==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 c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const{fullMatch:g,marker:m,content:b,index:x,className:v}of a){x>f&&d.appendChild(document.createTextNode(i.slice(f,x)));const k=document.createElement("span");k.dataset.md="true";const w=document.createElement("span");w.className="prompt-area-md-marker",w.textContent=m;const S=document.createElement("span");S.className=v,S.textContent=b;const N=document.createElement("span");N.className="prompt-area-md-marker",N.textContent=m,k.appendChild(w),k.appendChild(S),k.appendChild(N),d.appendChild(k),f=x+g.length}f<i.length&&d.appendChild(document.createTextNode(i.slice(f))),c.replaceChild(d,r)}return t}const vC=/(^|\n)([ \t]*)•/g;function zH(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];od(i)&&i.textContent?.includes("•")&&n.push(i)}for(const r of n){const i=r.textContent??"";vC.lastIndex=0;const a=[];let l;for(;(l=vC.exec(i))!==null;)a.push(l.index+l[1].length+l[2].length);if(a.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const g of a){g>f&&d.appendChild(document.createTextNode(i.slice(f,g)));const m=document.createElement("span");m.dataset.md="true",m.className="prompt-area-list-bullet",m.textContent="•",d.appendChild(m),f=g+1}f<i.length&&d.appendChild(document.createTextNode(i.slice(f))),c.replaceChild(d,r)}return t}const TC=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function HH(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];od(i)&&n.push(i)}for(const r of n){const i=r.textContent??"";TC.lastIndex=0;const a=[];let l;for(;(l=TC.exec(i))!==null;){const g=l.index+l[1].length;a.push({start:g,end:g+l[2].length})}if(a.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const{start:g,end:m}of a){g>f&&d.appendChild(document.createTextNode(i.slice(f,g)));const b=i.slice(g,m),x=Math.floor(b.length/2),v=document.createElement("span");v.dataset.md="true",v.className="prompt-area-list-indent",v.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${x})`,v.textContent=b,d.appendChild(v),f=m}f<i.length&&d.appendChild(document.createTextNode(i.slice(f))),c.replaceChild(d,r)}return t}function SC(e,t){t&&(HH(e),zH(e)),PH(e),t&&BH(e)}function Is(){const e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function UH(e){const t=Is();if(!t||!e.contains(t.startContainer))return null;const n=t.startContainer;if(n===e)return{nodeIndex:t.startOffset,offset:0};const r=e1(e,n);return r?{nodeIndex:Ch(e,r),offset:t.startOffset}:null}function FH(e,t){const n=window.getSelection();if(!n)return;const r=e.childNodes;if(r.length===0)return;const i=document.createRange();if(t.nodeIndex>=r.length){const a=r[r.length-1];a.nodeType===Node.TEXT_NODE?i.setStart(a,(a.textContent??"").length):i.setStartAfter(a)}else{const a=r[t.nodeIndex];if(a.nodeType===Node.TEXT_NODE){const l=(a.textContent??"").length;i.setStart(a,Math.min(t.offset,l))}else i.setStartAfter(a)}i.collapse(!0),n.removeAllRanges(),n.addRange(i)}function Yi(e){const t=Is();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),Qh(n)}function $H(e,t){const n=Qc(e,t);if(!n)return null;const r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function sr(e,t){const n=window.getSelection();if(!n)return;const r=Qc(e,t);if(r){const a=document.createRange();a.setStart(r.node,r.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}const i=document.createRange();i.selectNodeContents(e),i.collapse(!1),n.removeAllRanges(),n.addRange(i)}function Qh(e){const t=e.cloneContents();let n=0;const r=i=>{if(i.nodeType===Node.TEXT_NODE)n+=(i.textContent??"").length;else if(er(i))n+=pA(i);else if(xi(i)&&i.tagName==="BR"){if(i.dataset.sentinel)return;n+=1}else xi(i)&&i.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function nh(e){const t=Is();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=Qh(n);if(t.collapsed)return{start:r,end:r};const i=document.createRange();i.selectNodeContents(e),i.setEnd(t.endContainer,t.endOffset);const a=Qh(i);return{start:r,end:a}}function CC(e,t,n){const r=window.getSelection();if(!r)return;if(t===n){sr(e,t);return}const i=Qc(e,t),a=Qc(e,n);if(!i||!a)return;const l=document.createRange();l.setStart(i.node,i.offset),l.setEnd(a.node,a.offset),r.removeAllRanges(),r.addRange(l)}function Qc(e,t){let n=t;for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];if(i.nodeType===Node.TEXT_NODE){const a=(i.textContent??"").length;if(n<=a)return{node:i,offset:n};n-=a}else if(er(i)){const a=pA(i);if(n<=a)return{node:e,offset:r+1};n-=a}else if(Xh(i)){if(i.dataset.sentinel)continue;if(n<=1)return{node:e,offset:r+1};n-=1}else if(xi(i)){const a=(i.textContent??"").length;if(n<=a){const l=Qc(i,n);if(l)return l}n-=a}}return{node:e,offset:e.childNodes.length}}function VH(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gA(e,t){const n=r=>{r.nodeType===Node.TEXT_NODE?t.onText(r.textContent??""):er(r)?t.onChip(r):xi(r)&&r.tagName==="BR"?t.onBreak():r.childNodes.forEach(n)};e.childNodes.forEach(n)}function qH(e){let t="";return gA(e,{onText:n=>{t+=n},onChip:n=>{t+=(hA(n)??"")+(mA(n)??"")},onBreak:()=>{t+=`
483
- `}}),t}function YH(e){const t=[];return gA(e,{onText:n=>{n&&t.push({type:"text",text:n})},onChip:n=>{const r=Wh(n);r&&t.push(r)},onBreak:()=>{t.push({type:"text",text:`
484
- `})}}),t}function GH(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return null;const n=[];for(const r of t){if(!VH(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 i={type:"chip",trigger:r.trigger,value:r.value,displayText:r.displayText,...r.data!==void 0?{data:r.data}:{},...r.autoResolved?{autoResolved:!0}:{}};n.push(i)}else return null}return n}catch{return null}}function KH(e,t,n){const r=Is();if(!r)return[...e,...t];const i=document.createRange();i.selectNodeContents(n),i.setEnd(r.startContainer,r.startOffset);const a=Qh(i),l=[];let c=0,d=!1;const f=()=>{d||(l.push(...t),d=!0)};for(const g of e){if(g.type==="chip"){const b=g.trigger.length+g.displayText.length;c>=a&&f(),l.push(g),c+=b;continue}const m=c+g.text.length;if(m<=a)l.push(g);else if(c>=a)f(),l.push(g);else{const b=a-c,x=g.text.slice(0,b),v=g.text.slice(b);x&&l.push({type:"text",text:x}),f(),v&&l.push({type:"text",text:v})}c=m}return f(),Ao(l)}function Y0(e,t){const n=new RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,"i").exec(e);return n?n[1].trim().toLowerCase():""}function XH(e){if(e==="bold"||e==="bolder")return!0;const t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function WH(e){const t=e.tagName,n=e.getAttribute("style")??"",r=Y0(n,"font-weight"),i=r?XH(r):t==="B"||t==="STRONG",a=Y0(n,"font-style"),l=a?a==="italic"||a==="oblique":t==="I"||t==="EM",c=Y0(n,"text-decoration"),d=t==="S"||t==="DEL"||t==="STRIKE"||c.includes("line-through"),f=(d?"~~":"")+(i?"**":"")+(l?"*":""),g=(l?"*":"")+(i?"**":"")+(d?"~~":"");return{prefix:f,suffix:g}}function QH(e){return e.replace(/\s+/g," ")}function ZH(e){return e.replace(/\*/g,"\\*")}function JH(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 eU(e){const t=JH(e),n=(e.textContent??"").replace(/\n$/,"");return`
485
-
486
- \`\`\`${t}
487
- ${n}
488
- \`\`\`
489
-
490
- `}function tU(e){const t=e.textContent??"";return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function bA(e){return/^(https?:|mailto:)/i.test(e)}function nU(e,t){const n=e.getAttribute("href")??"",r=li(e,t).trim();return bA(n)?!r||r===n?n:`[${r}](${n})`:r}function rU(e){const t=e.getAttribute("src")??"";return!t||!bA(t)?"":`![${e.getAttribute("alt")??""}](${t})`}function sU(e,t){return`
491
-
492
- ${li(e,t).trim().split(`
493
- `).map(i=>i?`> ${i}`:">").join(`
494
- `)}
495
-
496
- `}function xA(e,t){const n=e.tagName==="OL",r=Number.parseInt(e.getAttribute("start")??"",10);let i=Number.isNaN(r)?1:r;const a=" ".repeat(t),l=[];for(const c of Array.from(e.childNodes)){if(!xi(c)||c.tagName!=="LI")continue;const d=n?`${i}. `:"- ";i++;let f="",g="";for(const m of Array.from(c.childNodes))xi(m)&&(m.tagName==="UL"||m.tagName==="OL")?g+=`
497
- ${xA(m,t+1)}`:f+=yA(m,t);l.push(`${a}${d}${f.trim()}${g}`)}return l.join(`
498
- `)}function iU(e,t){const n=Array.from(e.querySelectorAll("tr"));if(n.length===0)return"";const r=n.map(c=>Array.from(c.children).filter(d=>d.tagName==="TD"||d.tagName==="TH").map(d=>li(d,t).replace(/\n+/g," ").replace(/\|/g,"\\|").trim())),i=r[0],a=i.map(()=>"---"),l=c=>`| ${c.join(" | ")} |`;return[l(i),l(a),...r.slice(1).map(l)].join(`
499
- `)}function li(e,t){let n="";return e.childNodes.forEach(r=>{n+=yA(r,t)}),n}function yA(e,t){if(od(e))return ZH(QH(e.textContent??""));if(!xi(e))return"";const n=e.tagName;switch(n){case"SCRIPT":case"STYLE":case"NOSCRIPT":case"HEAD":case"TITLE":return"";case"BR":return`
500
- `;case"HR":return`
501
-
502
- ---
503
-
504
- `;case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":return`
505
-
506
- ${"#".repeat(Number(n[1]))} ${li(e,t).trim()}
507
-
508
- `;case"P":return`
509
-
510
- ${li(e,t).trim()}
511
-
512
- `;case"DIV":return`
513
- ${li(e,t).trim()}
514
- `;case"BLOCKQUOTE":return sU(e,t);case"UL":case"OL":return`
515
-
516
- ${xA(e,t)}
517
-
518
- `;case"LI":return`${li(e,t).trim()}
519
- `;case"PRE":return eU(e);case"CODE":return tU(e);case"A":return nU(e,t);case"IMG":return rU(e);case"TABLE":return`
520
-
521
- ${iU(e,t)}
522
-
523
- `;default:{const{prefix:r,suffix:i}=WH(e);return r+li(e,t)+i}}}function aU(e){return e.replace(/[ \t]+\n/g,`
524
- `).replace(/\n[ \t]*\n[ \t\n]*/g,`
525
-
526
- `).trim()}function oU(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html");return t.body?aU(li(t.body,0)):""}const lU=100,EA=150;function uU(e){const{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:i,runTriggerDetection:a,dismissTrigger:l,triggers:c,markdownEnabled:d,normalizeBullets:f,onPaste:g,onUndo:m,onRedo:b,onChipAdd:x,onImagePaste:v,onRawPaste:k}=e,w=E.useRef(!1),S=E.useRef({undoStack:[],redoStack:[]}),N=E.useCallback(V=>{const ee=S.current;ee.undoStack.push(V),ee.undoStack.length>lU&&ee.undoStack.shift(),ee.redoStack=[]},[]),_=E.useCallback(()=>{S.current={undoStack:[],redoStack:[]}},[]),A=E.useCallback(V=>{if(k?.(V),V.defaultPrevented)return;V.preventDefault();const ee=t.current;if(!ee)return;const q=Array.from(V.clipboardData.files).find(ie=>ie.type.startsWith("image/"))??(Array.from(V.clipboardData.items).find(ce=>ce.type.startsWith("image/"))?.getAsFile()??null);if(q){v?.(q);return}const B=n();N(B);const G=V.clipboardData.getData("text/prompt-area-segments");if(G){const ie=GH(G);if(ie&&ie.length>0){const ce=Is();if(!ce)return;ce.deleteContents();const de=n(),fe=KH(de,ie,ee);r(fe),i(fe),g?.({segments:fe,source:"internal"});for(const ve of ie)ve.type==="chip"&&x?.(ve);a();return}}let Q="";if(d)if(Q=V.clipboardData.getData("text/markdown"),Q)Q=Q.replace(/\\([()])/g,"$1");else{const ie=V.clipboardData.getData("text/html");if(ie)try{Q=oU(ie)}catch{Q=""}}if(Q||(Q=V.clipboardData.getData("text/plain")),!Q)return;d&&f&&(Q=RH(Q,!0)),d&&dA(Q)&&(Q=fA(Q).text);const le=Is();if(!le)return;le.deleteContents();const M=Q.split(`
527
- `),P=document.createDocumentFragment();for(let ie=0;ie<M.length;ie++)M[ie]&&P.appendChild(document.createTextNode(M[ie])),ie<M.length-1&&P.appendChild(document.createElement("br"));le.insertNode(P),le.collapse(!1);const F=window.getSelection();F?.removeAllRanges(),F?.addRange(le),t1(ee);const j=n(),ae=yH(j,c);if(ae!==j){r(ae),i(ae);for(const ie of ae)ie.type==="chip"&&!j.some(ce=>ce.type==="chip"&&ce.trigger===ie.trigger&&ce.value===ie.value&&ce.displayText===ie.displayText)&&x?.(ie)}else r(j);g?.({segments:ae,source:"external"}),a()},[t,n,r,N,a,i,c,d,f,g,x,v,k]),L=E.useCallback(V=>{V.preventDefault();const ee=Is();if(!ee)return;const q=ee.cloneContents(),B=qH(q);V.clipboardData.setData("text/plain",B);const G=YH(q);if(G.some(le=>le.type==="chip")){const le=Sh(G);le&&V.clipboardData.setData("text/prompt-area-segments",le)}},[]),R=E.useCallback(V=>{L(V);const ee=Is();if(!ee)return;const q=n();N(q),ee.deleteContents();const B=t.current;B&&t1(B);const G=n();r(G),a()},[L,t,n,r,N,a]),D=E.useCallback(V=>{V.preventDefault()},[]),I=E.useCallback(V=>{V.preventDefault()},[]),U=E.useCallback(()=>{w.current=!0},[]),z=E.useCallback(()=>{w.current=!1,a()},[a]),X=E.useCallback(()=>{setTimeout(()=>{const V=t.current;if(!V)return;const ee=document.activeElement;ee&&V.parentElement?.contains(ee)||l()},EA)},[t,l]),W=E.useCallback(V=>{if(!(V.metaKey||V.ctrlKey)||V.key!=="z")return!1;V.preventDefault();const q=S.current;if(V.shiftKey){if(q.redoStack.length===0)return!0;const B=q.redoStack.pop();if(!B)return!0;const G=n();q.undoStack.push(G),r(B),i(B),b?.(B)}else{if(q.undoStack.length===0)return!0;const B=q.undoStack.pop();if(!B)return!0;const G=n();q.redoStack.push(G),r(B),i(B),m?.(B)}return!0},[n,r,i,m,b]);return{handlePaste:A,handleCopy:L,handleCut:R,handleDrop:D,handleDragOver:I,handleCompositionStart:U,handleCompositionEnd:z,handleBlur:X,handleKeyDownForUndoRedo:W,pushUndo:N,resetUndoHistory:_,isComposing:w}}function cU(){const[e,t]=E.useState([]),[n,r]=E.useState(!1),[i,a]=E.useState(null),l=E.useRef(0),c=E.useRef(null),d=E.useRef(null),f=E.useCallback(()=>{c.current?.abort(),d.current&&clearTimeout(d.current),t([]),r(!1),a(null)},[]),g=E.useCallback((m,b)=>{if(!b.onSearch)return;c.current?.abort(),d.current&&clearTimeout(d.current),r(!0),a(null),l.current++;const x=l.current,v=new AbortController;c.current=v;const{onSearch:k,onSearchError:w,searchDebounceMs:S}=b,N=()=>{const _=k(m,{signal:v.signal});_ instanceof Promise?_.then(A=>{v.signal.aborted||l.current!==x||(t(A),r(!1))},A=>{v.signal.aborted||l.current!==x||A instanceof DOMException&&A.name==="AbortError"||(a(A instanceof Error?A.message:"Search failed"),r(!1),w?.(A))}):(t(_),r(!1))};S&&S>0&&m.length>0?d.current=setTimeout(N,S):N()},[]);return E.useEffect(()=>()=>{c.current?.abort(),d.current&&clearTimeout(d.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:i,search:g,reset:f}}const dU=300;function fU({value:e,onChange:t,triggers:n=[],disabled:r=!1,onSubmit:i,onEscape:a,onChipClick:l,onChipAdd:c,onChipDelete:d,onLinkClick:f,onPaste:g,onRawPaste:m,onUndo:b,onRedo:x,onImagePaste:v,markdown:k=!0,normalizeBullets:w=!0,submitOnEnter:S=!0,maxLength:N}){const _=E.useRef(null),[A,L]=E.useState(null),[R,D]=E.useState(0),[I,U]=E.useState(null),z=E.useRef(null),X=E.useRef(null),W=E.useRef(null),{suggestions:V,suggestionsLoading:ee,suggestionsError:q,search:B,reset:G}=cU(),Q=E.useRef(!1),le=E.useRef([]),M=E.useRef(null),P=E.useRef(null),F=E.useCallback(()=>{const te=_.current;if(!te)return[];const me=[];let Z=!1,re=!1;for(let K=0;K<te.childNodes.length;K++){const $=te.childNodes[K];if($.nodeType===Node.TEXT_NODE){const oe=$.textContent??"";oe&&(me.push({type:"text",text:oe}),Z=!0)}else if(er($)){const oe=Wh($);oe&&(me.push(oe),Z=!0)}else if(Xh($)){if($.dataset.sentinel){re=!0;continue}me.push({type:"text",text:`
528
- `})}else if(xi($)){const oe=$.textContent??"";oe&&(me.push({type:"text",text:oe}),Z=!0)}}return!Z&&!re?[]:me},[]),j=E.useCallback(te=>{const me=_.current;if(!me)return;Q.current=!0;const Z=UH(me);for(;me.firstChild;)me.removeChild(me.firstChild);for(const re of te)if(re.type==="text"){const K=re.text.split(`
529
- `);for(let $=0;$<K.length;$++)K[$]&&me.appendChild(document.createTextNode(K[$])),$<K.length-1&&me.appendChild(document.createElement("br"))}else{const K=document.createElement("span");if(K.contentEditable="false",K.dataset.chipTrigger=re.trigger,K.dataset.chipValue=re.value,K.dataset.chipDisplay=re.displayText,re.data!==void 0){const Ce=Sh(re.data);Ce&&(K.dataset.chipData=Ce)}re.autoResolved&&(K.dataset.chipAutoResolved="true");const $=n.find(Ce=>Ce.char===re.trigger),oe=$?.chipStyle??"pill";K.dataset.chipStyle=oe,K.className=Se("prompt-area-chip",oe==="inline"&&"prompt-area-chip--inline",$?.chipClassName),K.textContent=`${re.trigger}${re.displayText}`,K.setAttribute("role","button"),K.setAttribute("tabindex","-1"),me.appendChild(K)}if(me.lastChild&&Xh(me.lastChild)){const re=document.createElement("br");re.dataset.sentinel="true",me.appendChild(re)}SC(me,k),Z&&FH(me,Z),le.current=te,Q.current=!1},[n,k]),ae=E.useCallback((te,me)=>Z=>{const re=V0(te,me,{value:Z.value,displayText:Z.displayText,data:Z.data});t(re.segments),j(re.segments),c?.({type:"chip",trigger:me.config.char,value:Z.value,displayText:Z.displayText,...Z.data!==void 0?{data:Z.data}:{}});const K=_.current;K&&sr(K,re.cursorOffset)},[t,j,c]),ie=E.useCallback(()=>{const te=_.current;if(!te)return;const me=F(),Z=Bn(me),re=Yi(te);if(re===null)return;const K=pH(Z,re,n);if(z.current=null,X.current=null,K){L(K),D(0);const $=$H(te,K.startOffset);if($){const oe=$.getBoundingClientRect();(oe.height>0||oe.left>0||oe.top>0)&&U(oe)}K.config.mode==="dropdown"&&K.config.onSearch&&B(K.query,K.config),K.config.mode==="callback"&&K.config.onActivate&&K.config.onActivate({text:Z,cursorPosition:re,insertChip:ae(me,K)})}else L(null),G()},[n,F,ae,G,B]),ce=E.useCallback(()=>{z.current=null,X.current=null,L(null),D(0),G()},[G]),de=uU({editorRef:_,readSegmentsFromDOM:F,onChange:t,renderSegmentsToDOM:j,runTriggerDetection:ie,dismissTrigger:ce,triggers:n,markdownEnabled:k,normalizeBullets:w,onPaste:g,onRawPaste:m,onUndo:b,onRedo:x,onChipAdd:c,onImagePaste:v});E.useEffect(()=>{if(!Q.current&&!TH(e,le.current)){if(k&&w){const te=gC(e,!0);if(te!==e){t(te);return}}j(e)}},[e,j,k,w,t]);const fe=E.useRef(k);E.useEffect(()=>{if(fe.current===k)return;fe.current=k;const te=w?gC(e,k):e;te!==e?t(te):j(e)},[k,w,j,e,t]),E.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]);const ve=E.useCallback(()=>{if(Q.current)return;if(de.isComposing.current){const $=F();le.current=$,t($);return}const te=_.current,me=te?Yi(te):null;te&&t1(te);const Z=F();if(N!=null&&te&&Bn(Z).length>N){const $=Yi(te),oe=mH(Z,N);le.current=oe,t(oe),j(oe),sr(te,$!=null?Math.min($,N):N),ie();return}if(k&&w&&te&&me!==null){const $=SH(Z,me);if($){le.current=$.segments,t($.segments),j($.segments),sr(te,$.cursorOffset),ie();return}}let re=Z,K=null;if(k&&me!==null&&dA(Bn(Z))){const $=xC(Z);$.edits.length>0&&(re=$.segments,K=bC(me,$.edits))}P.current||(P.current=le.current),le.current=re,t(re),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{P.current&&(de.pushUndo(P.current),P.current=null),M.current=null},dU),te&&(K!==null?(j(re),sr(te,K)):(SC(te,k),me!==null&&sr(te,me))),ie()},[t,F,ie,j,k,w,N,de]),Fe=E.useCallback(te=>{const me=te.target;if(!(me instanceof Node))return;const Z=_.current;if(!Z)return;let re=me;for(;re&&re!==Z;){if(OH(re)){if(te.metaKey||te.ctrlKey){te.preventDefault(),f?.(re.href),window.open(re.href,"_blank","noopener,noreferrer");return}break}if(er(re)){const K=re.getBoundingClientRect(),$=document.createElement("span");$.className="prompt-area-chip-ripple";const oe=Math.max(K.width,K.height);$.style.width=`${oe}px`,$.style.height=`${oe}px`,$.style.left=`${te.clientX-K.left-oe/2}px`,$.style.top=`${te.clientY-K.top-oe/2}px`,re.appendChild($),$.addEventListener("animationend",()=>$.remove());const Ce=Wh(re);if(Ce){const Re=n.find(ot=>ot.char===Ce.trigger),Ve=W.current===re;if(W.current=null,!r&&!Ve&&Re?.reopenOnChipClick&&Re.mode==="dropdown"&&Re.onSearch){const ot=Ch(Z,re);z.current={chip:Ce,segIndex:q0(Z,ot)},X.current=re,L({config:Re,startOffset:0,query:""}),D(0),U(K),B("",Re)}l?.(Ce)}return}re=re.parentNode}},[l,f,n,B,r]),Le=E.useCallback(te=>{const me=te.target,Z=_.current;if(!Z||!(me instanceof Node)){W.current=null;return}let re=me;for(;re&&re!==Z;){if(er(re)){W.current=X.current===re?re:null;return}re=re.parentNode}W.current=null},[]),Ee=E.useCallback((te,me)=>{const Z=F(),re=Ch(te,me);if(re===-1)return!1;const K=q0(te,re),$=Z[K],oe=bH(Z,K);return t(oe),j(oe),$?.type==="chip"&&d?.($),!0},[F,t,j,d]),Oe=E.useCallback((te,me)=>{const Z=F(),re=Ch(te,me);if(re===-1)return!1;const K=q0(te,re),$=Z[K],oe=xH(Z,K);if(!oe)return!1;let Ce=0;for(let Re=0;Re<K;Re++){const Ve=Z[Re];Ve.type==="text"?Ce+=Ve.text.length:Ce+=Ve.trigger.length+Ve.displayText.length}return Ce+=oe.revertedText.length,t(oe.segments),j(oe.segments),sr(te,Ce),$?.type==="chip"&&d?.($),!0},[F,t,j,d]),ze=E.useCallback(()=>{const te=_.current;if(!te)return!1;const me=Is();if(!me||!me.collapsed)return!1;const Z=me.startContainer,re=me.startOffset;if(Z===te&&re>0){const K=te.childNodes[re-1];if(K&&er(K))return Jb(K)?Oe(te,K):Ee(te,K)}if(Z.nodeType===Node.TEXT_NODE&&re===0){const K=e1(te,Z);if(!K)return!1;let $=K.previousSibling;for(;$&&$.nodeType===Node.TEXT_NODE&&$.textContent==="";)$=$.previousSibling;if($&&er($))return Jb($)?Oe(te,$):Ee(te,$)}return!1},[Ee,Oe]),Ge=E.useCallback(()=>{const te=_.current;if(!te)return!1;const me=Is();if(!me||!me.collapsed)return!1;const Z=me.startContainer,re=me.startOffset;if(Z===te&&re<te.childNodes.length){const K=te.childNodes[re];if(K&&er(K))return Ee(te,K)}if(Z.nodeType===Node.TEXT_NODE&&re===(Z.textContent??"").length){const K=e1(te,Z);if(!K)return!1;let $=K.nextSibling;for(;$&&$.nodeType===Node.TEXT_NODE&&$.textContent==="";)$=$.nextSibling;if($&&er($))return Ee(te,$)}return!1},[Ee]),$e=E.useCallback(te=>{const me=F(),Z=te.query,re={value:Z,label:Z},K=te.config.onSelect?.(re)??Z,$={value:Z,displayText:K||Z,autoResolved:!0},oe=V0(me,te,$);t(oe.segments),j(oe.segments),c?.({type:"chip",trigger:te.config.char,...$});const Ce=_.current;Ce&&sr(Ce,oe.cursorOffset),ce()},[F,t,j,ce,c]),De=E.useCallback(te=>{if(!A)return;const me=F(),Z=A.config.insertAsText?.(te);if(Z!==void 0){const Re=gH(me,A,Z);de.pushUndo(me),t(Re.segments),j(Re.segments);const Ve=_.current;Ve&&sr(Ve,Re.cursorOffset),ce(),setTimeout(()=>{_.current?.focus()},0);return}const re=A.config.onSelect?.(te)??te.label,K={value:te.value,displayText:re||te.label,data:te.data},$=z.current;if($){const Re=_.current;if(Re&&!r){const Ve=me[$.segIndex],et=Ve?.type==="chip"&&Ve.trigger===$.chip.trigger&&Ve.value===$.chip.value?$.segIndex:(()=>{const ut=[];return me.forEach((qe,Rt)=>{qe.type==="chip"&&qe.trigger===$.chip.trigger&&qe.value===$.chip.value&&ut.push(Rt)}),ut.length===1?ut[0]:-1})(),dt=et!==-1?me[et]:void 0;if(dt?.type==="chip"){const ut={type:"chip",trigger:A.config.char,...K};let qe=me.map((Qt,$t)=>$t===et?ut:Qt);const Rt=qe[et+1],jt=!Rt||Rt.type!=="text"||Rt.text.length===0;jt&&(qe=[...qe.slice(0,et+1),{type:"text",text:" "},...qe.slice(et+1)]),de.pushUndo(me),t(qe),j(qe),dt.value===ut.value&&dt.displayText===ut.displayText&&Sh(dt.data)===Sh(ut.data)||(d?.(dt),c?.(ut));const Lt=Bn(qe.slice(0,et+1)).length+(jt?1:0);sr(Re,Lt)}}ce(),setTimeout(()=>{_.current?.focus()},0);return}const oe=V0(me,A,K);t(oe.segments),j(oe.segments),c?.({type:"chip",trigger:A.config.char,...K});const Ce=_.current;Ce&&sr(Ce,oe.cursorOffset),ce(),setTimeout(()=>{_.current?.focus()},0)},[A,F,t,j,ce,c,d,de,r]),ke=De;E.useEffect(()=>{const te=z.current;if(!te||!A?.config.reopenOnChipClick)return;const me=V.findIndex(Z=>Z.value===te.chip.value);me>0&&D(me)},[V,A]);const ye=E.useCallback(te=>{const me=($,oe)=>{let{segments:Ce,cursorOffset:Re}=oe;if(k){const Ve=xC(Ce);Ce=Ve.segments,Re=bC(Re,Ve.edits)}le.current=Ce,t(Ce),j(Ce),sr($,Re)},Z=$=>{if(!k)return!1;const oe=F(),Ce=Yi($);if(Ce===null)return!1;const Re=Bn(oe);if(!$l(Re,Ce))return!1;const Ve=CH(oe,Ce);return Ve&&me($,Ve),!0};if((te.metaKey||te.ctrlKey)&&te.key==="z"&&P.current&&(M.current&&(clearTimeout(M.current),M.current=null),de.pushUndo(P.current),P.current=null),de.handleKeyDownForUndoRedo(te))return;if(k&&(te.metaKey||te.ctrlKey)&&!te.shiftKey&&(te.key==="b"||te.key==="i")){te.preventDefault();const $=_.current;if(!$)return;const oe=nh($);if(!oe||oe.start===oe.end)return;const Ce=te.key==="b"?"**":"*",Re=F();de.pushUndo(Re);const Ve=vH(Re,oe.start,oe.end,Ce);if(!Ve)return;le.current=Ve.segments,t(Ve.segments),j(Ve.segments),CC($,Ve.selectionStart,Ve.selectionEnd);return}if(!te.metaKey&&!te.ctrlKey&&!te.altKey&&!te.nativeEvent.isComposing&&te.key.length===1){const $=n.find(Ce=>Ce.mode==="launch"&&Ce.char===te.key),oe=_.current;if($?.onActivate&&oe){const Ce=Yi(oe);if(Ce!==null){const Re=F(),Ve=Bn(Re);if(Kh(Ve,Ce,$.position)){te.preventDefault(),$.onActivate({text:Ve,cursorPosition:Ce,insertChip:ae(mr(Re,Ce,Ce,$.char),{config:$,startOffset:Ce,query:""})});return}}}}if(A&&A.config.mode==="dropdown"&&(V.length>0||ee||q!==null||!!A.config.emptyMessage)){if(te.key==="ArrowDown"){te.preventDefault(),V.length>0&&D($=>Math.min($+1,V.length-1));return}if(te.key==="ArrowUp"){te.preventDefault(),V.length>0&&D($=>Math.max($-1,0));return}if(te.key==="Enter"||te.key==="Tab"){te.preventDefault();const $=V[R];$&&De($);return}if(te.key==="Escape"){te.preventDefault(),ce();return}}if(te.key===" "&&A&&A.config.resolveOnSpace&&A.query.trim().length>0){te.preventDefault(),$e(A);return}if(k&&te.key==="Tab"&&!A){const $=_.current;if($){const oe=F(),Ce=Bn(oe),Re=Yi($);if(Re!==null&&$l(Ce,Re)){te.preventDefault();const ot=te.shiftKey?NH(oe,Re):kH(oe,Re);ot&&me($,ot);return}}}const K=$=>{const oe=nh($);if(!oe)return;const Ce=F();de.pushUndo(Ce);const Re=mr(Ce,oe.start,oe.end,`
530
- `);me($,{segments:Re,cursorOffset:oe.start+1})};if(te.key==="Enter"&&te.shiftKey&&!te.nativeEvent.isComposing){te.preventDefault();const $=_.current;$&&!Z($)&&K($);return}if(te.key==="Enter"&&!te.shiftKey&&!te.nativeEvent.isComposing){const $=_.current;if($&&Z($)){te.preventDefault();return}if(S){te.preventDefault(),i?.(F());return}te.preventDefault(),$&&K($);return}if(te.key==="Escape"&&a){a();return}if((te.key==="Backspace"||te.key==="Delete")&&!te.nativeEvent.isComposing){const $=_.current;if($){const oe=nh($);if(oe&&oe.start!==oe.end){te.preventDefault();const Ce=F();de.pushUndo(Ce);const Re=mr(Ce,oe.start,oe.end,"");me($,{segments:Re,cursorOffset:oe.start}),ie();return}}}if(te.key==="Backspace"){const $=_.current;if($){const oe=F(),Ce=Yi($);if(k&&Ce!==null){const Re=_H(oe,Ce);if(Re){te.preventDefault(),me($,Re),ie();return}}}if(ze()){te.preventDefault(),ie();return}}if(te.key==="Delete"&&Ge()){te.preventDefault(),ie();return}},[A,V,ee,q,R,i,S,a,F,t,j,k,ce,ze,Ge,$e,ie,De,de,n,ae]),Ie=E.useMemo(()=>({focus:()=>_.current?.focus(),blur:()=>_.current?.blur(),insertChip:te=>{const me=F(),Z={type:"chip",...te},re=[...me,Z,{type:"text",text:" "}];t(re),j(re),c?.(Z)},getPlainText:()=>Bn(F()),clear:()=>{t([]);const te=_.current;if(te)for(;te.firstChild;)te.removeChild(te.firstChild);de.resetUndoHistory(),M.current&&(clearTimeout(M.current),M.current=null),P.current=null},setText:te=>{de.pushUndo(F());const me=hH(te);t(me),j(me);const Z=_.current;Z&&sr(Z,te.length)},appendText:te=>{const me=F();de.pushUndo(me);const Z=me[me.length-1],re=Z?.type==="text"?[...me.slice(0,-1),{type:"text",text:Z.text+te}]:[...me,{type:"text",text:te}];t(re),j(re);const K=_.current;K&&sr(K,Bn(re).length)},getCursorPosition:()=>{const te=_.current;return te?Yi(te):null},setCursorPosition:te=>{const me=_.current;me&&sr(me,te)},setCursorToEnd:()=>{const te=_.current;te&&sr(te,Bn(F()).length)},getSelection:()=>{const te=_.current;return te?nh(te):null},setSelection:(te,me)=>{const Z=_.current;Z&&CC(Z,te,me)}}),[F,t,j,c,de]),je=E.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:_,activeTrigger:A,suggestions:V,suggestionsLoading:ee,suggestionsError:q,selectedSuggestionIndex:R,handleInput:ve,handleKeyDown:ye,handleClick:Fe,handleMouseDown:Le,selectSuggestion:ke,dismissTrigger:ce,handle:Ie,triggerRect:I,eventHandlers:je}}const wC=240;function hU({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:i,onSelect:a,onDismiss:l,triggerRect:c,triggerChar:d}){const f=E.useRef(null),g=E.useRef(null);if(E.useEffect(()=>{g.current?.scrollIntoView({block:"nearest"})},[i]),E.useEffect(()=>{const w=S=>{const N=S.target;f.current&&N instanceof Node&&!f.current.contains(N)&&l()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[l]),!c||e.length===0&&!t&&!n&&!r)return null;const m=Math.min(320,window.innerWidth-16),b=Math.min(c.left,window.innerWidth-m-8),x=window.innerHeight-c.bottom,v=x<wC&&c.top>x,k={position:"fixed",left:`${Math.max(8,b)}px`,zIndex:50,maxWidth:`${m}px`,maxHeight:`${wC}px`,...v?{bottom:`${window.innerHeight-c.top+4}px`}:{top:`${c.bottom+4}px`}};return h.jsx("div",{ref:f,className:Se("min-w-[200px] overflow-y-auto","bg-surface rounded-xl border p-2 shadow-md","animate-in fade-in-0 zoom-in-95"),style:k,role:"listbox","aria-label":`${d} suggestions`,children:t?h.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:"Loading suggestions..."}):n?h.jsx("div",{role:"option","aria-selected":!1,className:"text-destructive px-3 py-2 text-sm",children:n}):e.length===0&&r?h.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:r}):e.map((w,S)=>h.jsxs("button",{ref:S===i?g:void 0,type:"button",role:"option","aria-selected":S===i,className:Se("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===i&&"bg-surface-hover"),onMouseDown:N=>{N.preventDefault(),a(w)},children:[w.icon&&h.jsx("span",{className:"mt-0.5 shrink-0",children:w.icon}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate font-medium",children:w.label}),w.description&&h.jsx("div",{className:"text-muted-foreground truncate text-xs",children:w.description})]})]},w.value))})}function mU({texts:e,interval:t=3e3}){const[n,r]=E.useState(0);return E.useEffect(()=>{if(e.length<=1)return;const i=setInterval(()=>{r(a=>(a+1)%e.length)},t);return()=>clearInterval(i)},[e.length,t]),h.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:h.jsx("div",{className:"animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out",children:e[n]},n)})}function vA({onClick:e,label:t,className:n}){return h.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),e()},className:Se("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:h.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[h.jsx("line",{x1:"2.75",y1:"2.75",x2:"7.25",y2:"7.25"}),h.jsx("line",{x1:"7.25",y1:"2.75",x2:"2.75",y2:"7.25"})]})})}function pU({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:h.jsx("div",{className:Se("flex flex-wrap gap-2",r),role:"list","aria-label":"Attached images",children:e.map(i=>h.jsxs("div",{role:"listitem",className:Se("border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border",n&&"cursor-pointer"),onClick:()=>n?.(i),children:[h.jsx("img",{src:i.url,alt:i.alt??"Attached image",className:"h-full w-full object-cover"}),i.loading&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),t&&h.jsx(vA,{onClick:()=>t(i),label:`Remove ${i.alt??"image"}`})]},i.id))})}function ld({className:e,children:t}){return h.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 Hm=h.jsxs(h.Fragment,{children:[h.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"}),h.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"})]}),gU=({className:e})=>h.jsx(ld,{className:e,children:Hm}),bU=({className:e})=>h.jsxs(ld,{className:e,children:[Hm,h.jsx("path",{d:"M10 9H8"}),h.jsx("path",{d:"M16 13H8"}),h.jsx("path",{d:"M16 17H8"})]}),xU=({className:e})=>h.jsxs(ld,{className:e,children:[Hm,h.jsx("path",{d:"M8 13h2"}),h.jsx("path",{d:"M14 13h2"}),h.jsx("path",{d:"M8 17h2"}),h.jsx("path",{d:"M14 17h2"})]}),yU=({className:e})=>h.jsxs(ld,{className:e,children:[Hm,h.jsx("path",{d:"M10 12.5 8 15l2 2.5"}),h.jsx("path",{d:"m14 12.5 2 2.5-2 2.5"})]}),EU=({className:e})=>h.jsxs(ld,{className:e,children:[h.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),h.jsx("circle",{cx:"9",cy:"9",r:"2"}),h.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),rh=3;function vU(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 TU={pdf:bU,spreadsheet:xU,code:yU,image:EU,default:gU};function SU(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 CU(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function kC({file:e,compact:t,onRemove:n,onClick:r}){const i=CU(e.name),a=e.size!=null?SU(e.size):null,l=[i,a].filter(Boolean).join(" · ");return h.jsxs("div",{role:"listitem",className:Se("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 c=TU[vU(e.type)];return h.jsx(c,{className:Se("text-muted-foreground flex-shrink-0",t?"h-4 w-4":"h-5 w-5")})})(),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:Se("truncate font-medium",t?"text-xs":"text-sm"),title:e.name,children:e.name}),!t&&l&&h.jsx("div",{className:"text-muted-foreground truncate text-xs",children:l})]}),e.loading&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),n&&h.jsx(vA,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function wU({files:e,onRemove:t,onClick:n,className:r}){const[i,a]=E.useState(!1),l=E.useRef(null),c=E.useRef(null);if(E.useEffect(()=>{if(!i)return;const b=x=>{const v=x.target;v instanceof Node&&l.current&&!l.current.contains(v)&&!c.current?.contains(v)&&a(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[i]),e.length===0)return null;const d=e.length>rh,f=d,g=e.length-rh,m=e.slice(0,rh);return h.jsxs("div",{className:Se("relative",r),children:[h.jsxs("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"Attached files",children:[(d?m:e).map(b=>h.jsx(kC,{file:b,compact:f,onRemove:t,onClick:n},b.id)),d&&h.jsx("div",{role:"listitem",children:h.jsx("button",{ref:c,type:"button",onClick:()=>a(b=>!b),className:Se("border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors",f?"h-10 px-3 text-xs":"h-14 px-4 text-sm"),children:i?"Show less":`+${g} more`})})]}),i&&h.jsx("div",{ref:l,className:Se("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:h.jsx("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"More attached files",children:e.slice(rh).map(b=>h.jsx(kC,{file:b,compact:f,onRemove:t,onClick:n},b.id))})})]})}function NC({value:e,onChange:t,triggers:n,placeholder:r,className:i,disabled:a=!1,markdown:l,normalizeBullets:c,onSubmit:d,onEscape:f,onChipClick:g,onChipAdd:m,onChipDelete:b,onLinkClick:x,onPaste:v,onUndo:k,onRedo:w,minHeight:S=80,maxHeight:N,autoFocus:_=!1,autoGrow:A=!1,"aria-label":L,"data-test-id":R,images:D=[],imagePosition:I="above",onImagePaste:U,onImageRemove:z,onImageClick:X,files:W=[],filePosition:V="above",onFileRemove:ee,onFileClick:q,onKeyDown:B,onBlur:G,onRawPaste:Q,submitOnEnter:le,spellCheck:M,maxLength:P,"aria-describedby":F,ref:j}){const{editorRef:ae,activeTrigger:ie,suggestions:ce,suggestionsLoading:de,suggestionsError:fe,selectedSuggestionIndex:ve,handleInput:Fe,handleKeyDown:Le,handleClick:Ee,handleMouseDown:Oe,selectSuggestion:ze,dismissTrigger:Ge,handle:$e,triggerRect:De,eventHandlers:ke}=fU({value:e,onChange:t,triggers:n,disabled:a,onSubmit:d,onEscape:f,onChipClick:g,onChipAdd:m,onChipDelete:b,onLinkClick:x,onPaste:v,onRawPaste:Q,onUndo:k,onRedo:w,onImagePaste:U,markdown:l,normalizeBullets:c,submitOnEnter:le,maxLength:P});E.useImperativeHandle(j,()=>$e,[$e]),E.useEffect(()=>{_&&ae.current?.focus()},[_,ae]);const[ye,Ie]=E.useState(!1),[je,te]=E.useState(void 0),me=E.useCallback(()=>{const qe=ae.current;if(!qe)return;qe.style.height="auto";const Rt=qe.scrollHeight;qe.style.height=`${Rt}px`,te(Rt)},[ae]),Z=E.useCallback(()=>{A&&(Ie(!0),me())},[A,me]),re=E.useCallback(()=>{ke.onBlur(),A&&setTimeout(()=>{const qe=ae.current;if(!qe)return;const Rt=document.activeElement;Rt&&qe.parentElement?.contains(Rt)||(Ie(!1),te(void 0))},EA)},[ke,A,ae]),K=E.useCallback(()=>{Fe(),A&&ye&&me()},[Fe,A,ye,me]);E.useEffect(()=>{A&&ye&&requestAnimationFrame(()=>me())},[e,A,ye,me]);const[$,oe]=E.useState(!1),Ce=E.useRef(null);E.useEffect(()=>{if(!A)return;const qe=()=>{if(ye){oe(!1);return}const jt=ae.current;jt&&oe(jt.scrollHeight>jt.clientHeight)},Rt=ye?0:160;return Ce.current=setTimeout(qe,Rt),()=>{Ce.current!==null&&clearTimeout(Ce.current)}},[A,ye,e,ae]);const Re=E.useMemo(()=>{if(!A){const qe={minHeight:`${S}px`};return N&&(qe.maxHeight=`${N}px`,qe.overflowY="auto"),qe}return{height:ye&&je?`${je}px`:`${S}px`,minHeight:`${S}px`,maxHeight:N?`${N}px`:"70dvh",overflowY:ye?"auto":"hidden",transition:"height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)"}},[A,S,N,ye,je]),Ve=E.useCallback(qe=>{B?.(qe),!qe.defaultPrevented&&Le(qe)},[B,Le]),ot=E.useCallback(qe=>{G?.(qe),re()},[G,re]),et=e.length===0||e.length===1&&e[0].type==="text"&&e[0].text==="",dt=D.length>0?h.jsx(pU,{images:D,onRemove:z,onClick:X,className:I==="above"?"pb-2":"pt-2"}):null,ut=W.length>0?h.jsx(wU,{files:W,onRemove:ee,onClick:q,className:V==="above"?"pb-2":"pt-2"}):null;return h.jsxs("div",{className:Se("prompt-area-container relative text-sm leading-relaxed",i),children:[I==="above"&&dt,V==="above"&&ut,h.jsxs("div",{className:"relative",children:[h.jsx("div",{ref:ae,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-label":L??"Text input","aria-multiline":"true","aria-disabled":a||void 0,"aria-describedby":F,"data-test-id":R,spellCheck:M,className:Se("prompt-area-editor","w-full min-w-0 break-words whitespace-pre-wrap outline-none",a&&"cursor-not-allowed opacity-50"),style:Re,onFocus:Z,onInput:A?K:Fe,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}),A&&$&&!ye&&h.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:h.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)))"}})}),et&&r&&(Array.isArray(r)?h.jsx(mU,{texts:r}):h.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}))]}),V==="below"&&ut,I==="below"&&dt,ie&&ie.config.mode==="dropdown"&&h.jsx(hU,{suggestions:ce,loading:de,error:fe,emptyMessage:ie.config.emptyMessage,selectedIndex:ve,onSelect:ze,onDismiss:Ge,triggerRect:De,triggerChar:ie.config.char})]})}function kU(e={}){const{initialValue:t=[]}=e,[n,r]=E.useState(t),i=E.useRef(null),a=E.useMemo(()=>Bn(n),[n]),l=E.useMemo(()=>n.length===0?!0:n.every(v=>v.type==="text"&&v.text.trim()===""),[n]),c=E.useMemo(()=>n.some(v=>v.type==="chip"),[n]),d=E.useMemo(()=>n.filter(v=>v.type==="chip"),[n]),f=E.useMemo(()=>({ref:i,value:n,onChange:r}),[n]),g=E.useCallback(()=>{i.current?i.current.clear():r([])},[]),m=E.useCallback(()=>i.current?.focus(),[]),b=E.useCallback(()=>i.current?.blur(),[]),x=E.useCallback(v=>i.current?.insertChip(v),[]);return{bind:f,plainText:a,isEmpty:l,hasChips:c,chips:d,clear:g,focus:m,blur:b,insertChip:x}}function NU(e={}){const{char:t="@",...n}=e;return{char:t,position:"any",mode:"dropdown",chipStyle:"pill",accessibilityLabel:"mention",...n}}function _C(e={}){const{char:t="/",position:n="any",...r}=e;return{char:t,position:n,mode:"dropdown",chipStyle:"inline",accessibilityLabel:"command",...r}}const TA=7,ud={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"}};ud.provider.permissionModes;const _U={status:"starting",capabilities:ud.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},G0="streaming",sh="streaming-thinking";function AU(e){return e===void 0?"":typeof e=="string"?e:e.map(t=>typeof t.text=="string"?t.text:"").filter(Boolean).join(`
531
- `)}function AC(e){return typeof e=="string"?[{type:"text",text:e}]:e}function RU(e){if(e.type==="text")return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}const OU=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/;function Fa(e,t){const n=e.findIndex(i=>i.id===t.id&&i.kind===t.kind);if(n===-1)return[...e,t];const r=[...e];return r[n]=t,r}function IU(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??ud[n??"claude"],session:t}}function MU(e){const t=Object.entries(e.rateLimits??{}).filter(([,i])=>i.utilization!==void 0).map(([i,a])=>({key:i,info:a})),n=["five_hour","seven_day"].flatMap(i=>t.filter(a=>a.key===i)),r=t.filter(i=>i.key.startsWith("seven_day_")).sort((i,a)=>i.key.localeCompare(a.key));return[...n,...r]}function LU(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 i of AC(t.message.content))if(i.type==="tool_result"){const a=i,l=a.is_error===!0;r=r.map(c=>c.kind==="tool_call"&&c.id===a.tool_use_id?{...c,status:l?"failed":"settled",result:{text:AU(a.content),isError:l}}:c)}else if(i.type==="text"&&!t.synthetic){const a=i.text,l=OU.exec(a.trim());l?r=Fa(r,{kind:"notice",id:t.uuid??`user-${t.seq}`,level:l[1]==="stderr"?"error":"info",text:l[2].trim()}):r=Fa(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===sh)?.text??"",i=n.items.filter(l=>!(l.kind==="assistant_text"&&l.id===G0)&&!(l.kind==="thinking"&&l.id===sh));return AC(t.message.content).forEach((l,c)=>{const d=`${t.uuid}-${c}`;if(l.type==="text")i=Fa(i,{kind:"assistant_text",id:d,text:l.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(l.type==="thinking"){const f=l.thinking||r;if(r="",f.trim()==="")return;i=Fa(i,{kind:"thinking",id:d,text:f,parentToolUseId:t.parentToolUseId})}else if(l.type==="tool_use"){const f=l;i=Fa(i,{kind:"tool_call",id:f.id,name:f.name,input:f.input,parentToolUseId:t.parentToolUseId,status:"running"})}}),{...n,items:i}}case"stream_delta":{const r=t.event;if(r.type!=="content_block_delta")return n;if(r.delta?.type==="text_delta"){const i=n.items.find(l=>l.kind==="assistant_text"&&l.id===G0),a={kind:"assistant_text",id:G0,text:(i?.text??"")+(r.delta.text??""),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:Fa(n.items,a)}}if(r.delta?.type==="thinking_delta"){const i=n.items.find(l=>l.kind==="thinking"&&l.id===sh),a={kind:"thinking",id:sh,text:(i?.text??"")+(r.delta.thinking??""),parentToolUseId:t.parentToolUseId};return{...n,items:Fa(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:RU(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 DU(e,t){return t.type==="attached"?IU(e,t.session):LU(e,t)}const jU=3;function PU(e,t,n){const[r,i]=E.useReducer(DU,_U),[a,l]=E.useState("reconnecting"),[c,d]=E.useState(),[f,g]=E.useState(),m=E.useRef(null),b=E.useRef(n?.onProtocolError);b.current=n?.onProtocolError,E.useEffect(()=>{if(!t)return;const w=e.attach(t);m.current=w,g(w);const S=w.on("event",R=>i(R)),N=w.on("attached",R=>{i(R),d(R.protocolVersion===TA?void 0:R.protocolVersion)}),_=w.on("connectionChange",R=>l(R?"live":"reconnecting")),A=w.on("reconnectAttempt",R=>l(R>=jU?"offline":"reconnecting")),L=w.on("protocolError",R=>{b.current?.(R)});return()=>{S(),N(),_(),A(),L(),w.detach(),m.current=null,g(void 0),l("reconnecting"),d(void 0)}},[e,t]);const x=BU(e,t,r),v=a==="live",k=E.useCallback(()=>m.current?.reconnectNow(),[]);return E.useMemo(()=>({state:r,connected:v,connection:a,protocolMismatch:c,models:x,effectiveModel:r.model??r.defaultModel,handle:f,send:(w,S)=>m.current?.send(w,S),approve:(w,S)=>m.current?.approve(w,S),deny:(w,S,N)=>m.current?.deny(w,S,N),interrupt:()=>m.current?.interrupt(),setPermissionMode:w=>m.current?.setPermissionMode(w),setModel:w=>m.current?.setModel(w),closeSession:()=>m.current?.closeSession(),reconnectNow:k}),[r,v,a,c,x,f,k])}function BU(e,t,n){const[r,i]=E.useState([]),a=n.session?.profile,l=n.models,c=!!l?.length;return E.useEffect(()=>i([]),[t]),E.useEffect(()=>{if(!a||c)return;let d=!1;return e.listProfiles().then(f=>{d||i(f.profiles.find(g=>g.name===a)?.models??[])}).catch(()=>{}),()=>{d=!0}},[e,a,c]),c?l:r}function zU(e){const t=e.split(";")[0].trim().toLowerCase();if(t.startsWith("image/"))return"image";if(t==="application/pdf")return"pdf";if(t.startsWith("text/")||HU.has(t))return"text"}const HU=new Set(["application/json","application/xml","application/yaml","application/x-yaml","application/toml","application/javascript","application/typescript","application/x-sh","application/sql"]),RC=1568;function UU(e,t,{capabilities:n,engine:r}){const[i,a]=E.useState([]),[l,c]=E.useState(),d=E.useRef(0),f=E.useRef(new Map),g=E.useRef([]);g.current=i.flatMap(_=>_.previewUrl?[_.previewUrl]:[]);const m=n.attachments;E.useEffect(()=>()=>{for(const _ of g.current)URL.revokeObjectURL(_)},[]);const b=E.useCallback((_,A)=>{a(L=>L.map(R=>R.key===_?{...R,...A}:R))},[]),x=E.useCallback((_,A)=>{t&&(b(_,{status:"uploading",error:void 0}),(async()=>{try{const L=await VU(A),R=await e.uploadAttachment(t,{name:A.name,mediaType:L.mediaType,data:L.body});b(_,{status:"ready",id:R.id,bytes:R.bytes??A.size})}catch(L){b(_,{status:"failed",error:L instanceof Error?L.message:"Upload failed"})}})())},[e,b,t]),v=E.useCallback(_=>{const A=[],L=[];for(const R of _){const D=R.type||"application/octet-stream",I=zU(D);if(I&&!m.includes(I)){c(`The ${r??"claude"} engine does not take ${I} attachments.`);continue}const U=`att-${++d.current}`;A.push({key:U,name:R.name,mediaType:D,bytes:R.size,previewUrl:I==="image"?URL.createObjectURL(R):void 0,status:"uploading"}),L.push({key:U,file:R})}if(A.length!==0){a(R=>[...R,...A]),f.current=new Map([...f.current,...L.map(({key:R,file:D})=>[R,D])]);for(const{key:R,file:D}of L)x(R,D)}},[m,r,x]),k=E.useCallback(_=>{a(A=>{for(const L of A)_.includes(L.key)&&L.previewUrl&&URL.revokeObjectURL(L.previewUrl);return A.filter(L=>!_.includes(L.key))});for(const A of _)f.current.delete(A)},[]),w=E.useCallback(_=>k([_]),[k]),S=E.useCallback(()=>{a(_=>{for(const A of _)A.previewUrl&&URL.revokeObjectURL(A.previewUrl);return[]}),f.current.clear()},[]),N=E.useCallback(_=>{const A=f.current.get(_);A&&x(_,A)},[x]);return E.useMemo(()=>({items:i,readyIds:i.flatMap(_=>_.id?[_.id]:[]),uploading:i.some(_=>_.status==="uploading"),hasFailure:i.some(_=>_.status==="failed"),accept:FU(m),disabled:m.length===0||!t,add:v,retry:N,remove:w,clear:S,error:l,dismissError:()=>c(void 0)}),[i,m,t,v,N,w,S,l])}function FU(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 VU(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 i=await n(e),a=Math.max(i.width,i.height);if(a<=RC)return i.close(),{body:e,mediaType:t};const l=RC/a,c=r.createElement("canvas");c.width=Math.round(i.width*l),c.height=Math.round(i.height*l);const d=c.getContext("2d");if(!d)return i.close(),{body:e,mediaType:t};d.drawImage(i,0,0,c.width,c.height),i.close();const f=await new Promise(g=>c.toBlob(g,"image/jpeg",.85));return f?{body:f,mediaType:"image/jpeg"}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}const qU=/^[A-Za-z0-9\-_.:]+$/,YU=new Set([".",",",";",":","!","?",")","]","}",'"',"'"]);function GU(e){const t=[],n=/\S+/g;let r;for(;(r=n.exec(e))!==null;){const i=r[0],a=i[0]==="@"?"file":i[0]==="/"?"command":void 0;if(!a)continue;let l=r.index+i.length;for(;l>r.index&&YU.has(e[l-1]);)l--;const c=e.slice(r.index+1,l);c&&(a==="command"&&!qU.test(c)||t.push({kind:a,start:r.index,end:l,text:e.slice(r.index,l)}))}return t}class Ja extends Error{status;constructor(t,n){super(t),this.name="WorkerDeckError",this.status=n}}class KU{sessionId;#t;#r;#n;#e=new Map;#s;#u=!1;#o=0;#i=[];#c;constructor(t,n,r={}){this.#t=t,this.sessionId=n,this.#r={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,i){this.#a({type:"tool_call_error",executionId:t,reason:n,error:r,logs:i})}closeSession(){this.#a({type:"close"}),this.detach()}reconnectNow(){this.#u||this.#n&&this.#n.readyState===1||(clearTimeout(this.#c),this.#o=0,this.#d())}detach(){this.#u=!0,clearTimeout(this.#c),this.#n?.close(),this.#n=void 0}#l(t,n){const r=this.#e.get(t);if(r)for(const i of r)try{i(n)}catch{}}#a(t){const n=JSON.stringify(t);this.#n&&this.#n.readyState===1?this.#n.send(n):this.#i.push(n)}#d(){if(this.#u)return;const t=this.#t.openSocket(this.sessionId,this.#s);this.#n=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.#r.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 XU{#t;#r;#n;#e=new Map;#s=!1;#u=0;#o;constructor(t,n={}){this.#t=t,this.#r=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.#n?.close(),this.#n=void 0}#i(t,n){const r=this.#e.get(t);if(r)for(const i of r)try{i(n)}catch{}}#c(){if(this.#s)return;const t=this.#t.openQueueSocket();this.#n=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.#r)return;const n=Math.min(500*2**this.#u++,1e4);this.#o=setTimeout(()=>this.#c(),n)},t.onerror=()=>{}}}class WU{#t;#r;#n;constructor(t){this.#t=t,this.#r=t.fetchImpl??fetch.bind(globalThis),this.#n=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.#r(this.sessionFileUrl(t,n),{headers:this.#t.headers});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Ja(i.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)}`,i=await this.#r(r,{method:"POST",headers:{...this.#t.headers,"content-type":n.mediaType},body:n.data});if(!i.ok){const a=await i.json().catch(()=>({}));throw new Ja(a.error??`upload failed with ${i.status}`,i.status)}return(await i.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.#r(this.producedFileUrl(t,n),{headers:{...this.#t.headers}});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Ja(i.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 i=new URLSearchParams({path:t,q:n});return r!==void 0&&i.set("limit",String(r)),await this.#e("GET",`/fs/find?${i.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 KU(this,t,n)}attachQueue(t){return new XU(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.#n(r)}openQueueSocket(){const t=this.#t.buildQueueWsUrl?.()??`${this.#t.baseUrl.replace(/^http/,"ws")}/queue/ws`;return new this.#n(t)}async#e(t,n,r){const i=await this.#r(`${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 i.json().catch(()=>({}));if(!i.ok)throw new Ja(a.error??`${t} ${n} failed with ${i.status}`,i.status);return a}}function QU(e,t,n){const r=[],i=(a,l)=>{const c=t.get(a);if(c)for(const d of c.entries){if(d.type!=="dir"){r.push({entry:d,depth:l});continue}const f=n.has(d.path),g=t.get(d.path);r.push({entry:d,depth:l,expanded:f,loading:f&&!g,truncated:f?g?.truncated:void 0}),f&&g&&i(d.path,l+1)}};return i(e,0),r}function ZU(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("/"),i=[];let a=n;for(const l of r.slice(0,-1))a=`${a}/${l}`,i.push(a);return i}function SA(e,t){const[n,r]=E.useState(!1),i=E.useRef(t);E.useEffect(()=>{i.current!==t&&(i.current=t,r(!1))},[t]);const a=E.useCallback(async(l,c)=>{if(!t||n)return[];try{const d=await e.findHostFiles(t,l,c?.limit??8);return c?.signal?.aborted?[]:d.matches}catch(d){return d instanceof Ja&&d.status===404&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function JU(e){const[t,n]=E.useState({available:!1,canWrite:!1});return E.useEffect(()=>{let r=!1;return e.listHostRoots().then(i=>{r||n({available:!0,canWrite:i.canWrite})}).catch(()=>{r||n({available:!1,canWrite:!1})}),()=>{r=!0}},[e]),t}function eF(e,t){const[n,r]=E.useState(()=>new Map),[i,a]=E.useState(()=>new Set),[l,c]=E.useState(!1),[d,f]=E.useState(),g=E.useRef(t);E.useEffect(()=>{g.current!==t&&(g.current=t,r(new Map),a(new Set),c(!1),f(void 0))},[t]);const m=E.useRef(!0);E.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]);const b=E.useRef(new Set),x=E.useCallback((N,{force:_=!1}={})=>{l||!_&&b.current.has(N)||(b.current.add(N),e.listHostDir(N).then(A=>{m.current&&r(L=>{const R=new Map(L);return R.set(N,{entries:A.entries,truncated:A.truncated}),R})}).catch(A=>{if(m.current){if(b.current.delete(N),A instanceof Ja&&A.status===404){c(!0);return}f(A instanceof Error?A.message:"Could not read that directory")}}))},[e,l]);E.useEffect(()=>{t&&x(t)},[t,x]);const v=E.useCallback(N=>{a(_=>{const A=new Set(_);return A.has(N)?A.delete(N):A.add(N),A}),x(N)},[x]),k=E.useCallback(N=>{if(!t)return;const _=ZU(t,N);if(_.length!==0){for(const A of _)x(A);a(A=>{const L=new Set(A);for(const R of _)L.add(R);return L})}},[t,x]),w=E.useCallback(N=>{const _=N??t;_&&(f(void 0),x(_,{force:!0}))},[t,x]),S=E.useMemo(()=>t?QU(t,n,i):[],[t,n,i]);return{available:!!t&&!l,root:t,rows:S,loading:!!t&&!l&&!n.has(t)&&!d,error:d,toggle:v,reveal:k,refresh:w}}function CA(e,t){const[n,r]=E.useState(),[i,a]=E.useState(!!t),[l,c]=E.useState();return E.useEffect(()=>{if(!t){r(void 0),a(!1),c(void 0);return}let d=!1;return a(!0),c(void 0),r(void 0),e.getSession(t).then(f=>{d||(r(f),a(!1))}).catch(f=>{d||(c(f instanceof Error?f.message:"Session not found"),a(!1))}),()=>{d=!0}},[e,t]),{info:n,loading:i,error:l}}function Zc(e){return e.draft!==void 0&&e.draft!==e.content}function n1(e){return e.draft??e.content??""}const wA={files:[]};function tF(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:OC(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 i=r[n]??r[n-1];return{files:r,activePath:i?.path}}case"closeAll":return wA;case"activate":return e.files.some(n=>n.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case"loaded":return Gi(e,t.path,()=>({path:t.path,name:OC(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 Gi(e,t.path,n=>({...n,status:"error",error:t.error}));case"edit":return Gi(e,t.path,n=>n.status==="ready"?{...n,draft:t.content}:n);case"revert":return Gi(e,t.path,n=>({...n,draft:void 0,saveError:void 0,conflict:!1}));case"saveStart":return Gi(e,t.path,n=>({...n,saving:!0,saveError:void 0,conflict:!1}));case"saved":return Gi(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 Gi(e,t.path,n=>({...n,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case"dismissConflict":return Gi(e,t.path,n=>({...n,conflict:!1,saveError:void 0}))}}function Gi(e,t,n){const r=e.files.findIndex(c=>c.path===t);if(r===-1)return e;const i=e.files[r],a=n(i);if(a===i)return e;const l=e.files.slice();return l[r]=a,{...e,files:l}}function OC(e){const t=e.endsWith("/")?e.slice(0,-1):e;return t.slice(t.lastIndexOf("/")+1)||t||e}function nF(e){const[t,n]=E.useReducer(tF,wA),r=E.useRef(new Set),i=E.useRef(!0);E.useEffect(()=>(i.current=!0,()=>{i.current=!1}),[]);const a=E.useRef(t);E.useEffect(()=>{a.current=t},[t]);const c=t.files.filter(R=>R.status==="loading").map(R=>R.path).join(`
532
- `),d=E.useCallback(R=>e.readHostFile(R).then(D=>{if(i.current)return n({type:"loaded",path:R,content:D.content,encoding:D.encoding,bytes:D.bytes,hash:D.hash,modifiedAt:D.modifiedAt}),D}),[e]);E.useEffect(()=>{for(const R of c?c.split(`
533
- `):[])r.current.has(R)||(r.current.add(R),d(R).catch(D=>{i.current&&n({type:"failed",path:R,error:D instanceof Error?D.message:"Could not read that file"})}))},[d,c]);const f=E.useCallback(R=>n({type:"open",path:R}),[]),g=E.useCallback(R=>{r.current.delete(R),n({type:"close",path:R})},[]),m=E.useCallback(()=>{r.current.clear(),n({type:"closeAll"})},[]),b=E.useCallback(R=>n({type:"activate",path:R}),[]),x=E.useCallback((R,D)=>n({type:"edit",path:R,content:D}),[]),v=E.useCallback(R=>n({type:"revert",path:R}),[]),k=E.useCallback(R=>n({type:"dismissConflict",path:R}),[]),w=E.useCallback(R=>{r.current.add(R),d(R).catch(D=>{i.current&&n({type:"failed",path:R,error:D instanceof Error?D.message:"Could not re-read that file"})})},[d]),S=E.useCallback(async(R,D,I)=>{try{const U=await e.writeHostFile({path:R,content:D,expectedHash:I});if(!i.current)return;n({type:"saved",path:R,content:D,bytes:U.bytes,hash:U.hash,modifiedAt:U.modifiedAt})}catch(U){if(!i.current)return;const z=U instanceof Ja&&U.status===409;n({type:"saveFailed",path:R,conflict:z,error:z?"This file changed on disk since you opened it.":U instanceof Error?U.message:"Could not save that file"})}},[e]),N=E.useCallback(async R=>{const D=a.current.files.find(I=>I.path===R);!D||D.saving||!Zc(D)||(n({type:"saveStart",path:R}),await S(R,n1(D),D.hash))},[S]),_=E.useCallback(async R=>{const D=a.current.files.find(U=>U.path===R);if(!D||D.saving)return;const I=n1(D);n({type:"saveStart",path:R});try{const U=await e.readHostFile(R);if(!i.current)return;await S(R,I,U.hash)}catch(U){if(!i.current)return;n({type:"saveFailed",path:R,error:U instanceof Error?U.message:"Could not save that file"})}},[e,S]),A=E.useMemo(()=>t.files.find(R=>R.path===t.activePath),[t.files,t.activePath]),L=E.useMemo(()=>t.files.some(Zc),[t.files]);return{...t,active:A,hasUnsaved:L,open:f,close:g,closeAll:m,activate:b,edit:x,save:N,revert:v,reload:w,overwrite:_,dismissConflict:k}}const rF="modulepreload",sF=function(e){return"/"+e},IC={},Vl=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");i=l(n.map(f=>{if(f=sF(f),f in IC)return;IC[f]=!0;const g=f.endsWith(".css"),m=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":rF,g||(b.as="script"),b.crossOrigin="",b.href=f,d&&b.setAttribute("nonce",d),document.head.appendChild(b),g)return new Promise((x,v)=>{b.addEventListener("load",x),b.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return i.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};function iF(e,t={}){const n=new Map;let r,i=!1;const a=g=>t.onExecution?.(g),l=(g,m,b,x)=>{e.sendToolCallError(g.executionId,m,b),a({executionId:g.executionId,toolName:g.toolName,status:"failed",reason:m,startedAt:x,endedAt:Date.now()})},c=async g=>{const m=Date.now();if(!(t.tools??["eval_script"]).includes(g.toolName)){l(g,"unsupported_tool",`this client does not execute '${g.toolName}'`,m);return}const x=g.input?.script;if(typeof x!="string"){l(g,"invalid_input","expected a string `script` input",m);return}const v=new AbortController;n.set(g.executionId,v),a({executionId:g.executionId,toolName:g.toolName,status:"running",startedAt:m});try{const k=await Vl(()=>import("./index-sM-myQ3-.js"),[]),w=k.createVfs(g.vfsSeed),S=Math.min(g.limits?.timeoutMs??Number.POSITIVE_INFINITY,t.timeoutMs??5e3),N=Math.min(g.limits?.memoryLimitBytes??Number.POSITIVE_INFINITY,t.memoryLimitBytes??64*1024*1024),_=t.execute?await t.execute({script:x,vfs:w,timeoutMs:S,memoryLimitBytes:N,signal:v.signal}):await(async()=>(r??=(t.loadEngine??aF)(),k.runScript(await r,{script:x,vfs:w,timeoutMs:S,memoryLimitBytes:N,signal:v.signal,fetchText:t.fetchText})))();if(i||!n.has(g.executionId))return;const A=_.logs.map(L=>`[${L.level}] ${L.text}`);_.ok?(e.sendToolCallResult(g.executionId,{type:"json",value:_.value},A),a({executionId:g.executionId,toolName:g.toolName,status:"settled",startedAt:m,endedAt:Date.now()})):(e.sendToolCallError(g.executionId,_.reason,_.error,A),a({executionId:g.executionId,toolName:g.toolName,status:"failed",reason:_.reason,startedAt:m,endedAt:Date.now()}))}catch(k){if(i||!n.has(g.executionId))return;l(g,"host_error",k instanceof Error?k.message:String(k),m)}finally{n.delete(g.executionId)}},d=e.on("toolCallRequest",g=>void c(g)),f=e.on("toolCallCanceled",({executionId:g,reason:m})=>{const b=n.get(g);b&&(b.abort(),n.delete(g),a({executionId:g,toolName:"",status:"canceled",reason:m,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{i=!0,d(),f();for(const g of n.values())g.abort();n.clear()}}}async function aF(){const[e,t]=await Promise.all([Vl(()=>import("./index-sM-myQ3-.js"),[]),Vl(()=>import("./index-9_St22G9.js"),[])]);return e.loadEngine(t)}function oF(e,t={}){const[n,r]=E.useState([]),i=E.useRef(t);return i.current=t,E.useEffect(()=>{if(!e||t.enabled===!1)return;const a=iF(e,{get tools(){return i.current.tools},get timeoutMs(){return i.current.timeoutMs},get memoryLimitBytes(){return i.current.memoryLimitBytes},get loadEngine(){return i.current.loadEngine},get execute(){return i.current.execute},get fetchText(){return i.current.fetchText},onExecution:l=>{i.current.onExecution?.(l);const c=i.current.historyLimit??50;r(d=>[...d.filter(f=>f.executionId!==l.executionId),l].slice(-c))}});return()=>a.dispose()},[e,t.enabled]),{executions:n}}function lF(e,t){const n=Math.max(0,Math.min(t,e.items.length)),r=e.items.slice(n),i=new Map;let a=0,l=0,c=0,d=0,f=0;for(const b of r)switch(b.kind){case"turn_result":a+=1,b.isError&&(f+=1);break;case"assistant_text":l+=1;break;case"tool_call":c+=1,i.set(b.name,(i.get(b.name)??0)+1),(b.status==="failed"||b.result?.isError)&&(f+=1);break;case"file_delivered":d+=1;break;case"notice":b.level==="error"&&(f+=1);break}const g=[...i.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:c,toolNames:g,files:d,errors:f,pending:m,any:a+l+c+d+f+m>0}}function uF(e){if(!e.any)return;const t=[];if(e.turns>0?t.push(yl(e.turns,"turn")):e.replies>0&&t.push(yl(e.replies,"reply","replies")),e.tools>0){const n=e.toolNames.slice(0,3).join(", "),r=e.toolNames.length-3;t.push(`${yl(e.tools,"tool call")}${n?` (${n}${r>0?`, +${r}`:""})`:""}`)}return e.files>0&&t.push(yl(e.files,"file")),e.errors>0&&t.push(yl(e.errors,"error")),e.pending>0&&t.push(`${yl(e.pending,"approval")} waiting`),t.join(" · ")}function yl(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function bo(e){return e===void 0||Number.isNaN(e)?"—":e===0?"$0.00":e<.01?"<$0.01":`$${e.toFixed(2)}`}function r1(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 xo(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function s1(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 i=Math.floor(r/1440);return i>=1?`${i}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function cd(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 i=Math.floor(r/60);if(i<60)return`${i}m ago`;const a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function cF(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 dF(e){if(e==="five_hour")return 5*3600;if(e.startsWith("seven_day"))return 7*86400}function fF(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 i=Math.floor(n/60);return`${i} min${i===1?"":"s"} ago`}const r=Math.floor(n/3600);return`${r} hour${r===1?"":"s"} ago`}function i1(e,t=80){if(e==null)return"";if(typeof e=="object"){const r=e,i=r.command??r.file_path??r.path??r.url??r.pattern??r.query??r.description;if(typeof i=="string")return i.length>t?i.slice(0,t-1)+"…":i}const n=JSON.stringify(e)??"";return n.length>t?n.slice(0,t-1)+"…":n}const hF=e=>e.replace(/\s*\(MCP\)$/i,"");function kA(e){const t=e.defaultPrompt?.trim()||`$${e.name}`;return/\s$/.test(t)?t:t+" "}function MC(e,t){const n=e.toLowerCase(),r=t.map(i=>i.toLowerCase());return r.some(i=>i.startsWith(n))?2:r.some(i=>i.includes(n))?1:0}function mF({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:i="Message the agent…",commands:a,skills:l,onSearchFiles:c,attachments:d,toolbar:f,layout:g="stacked",className:m,ref:b}){const x=g==="inline",{bind:v,plainText:k,isEmpty:w,clear:S,focus:N}=kU(),_=E.useRef(null),[A,L]=E.useState(!1);E.useImperativeHandle(b,()=>({insertText:B=>{const G=k.length>0&&!/\s$/.test(k)?" ":"";v.ref.current?.appendText(G+B),N()},focus:N}),[v.ref,k,N]);const R=E.useMemo(()=>{const B=[],G=(l??[]).filter(Q=>Q.enabled);if(a&&a.length>0){const Q=new Set,le=a.flatMap(M=>{const P=hF(M.name);return Q.has(P)?[]:(Q.add(P),[{...M,name:P}])});B.push(_C({onSearch:M=>{const P=[];for(const F of le){const j=MC(M,[F.name,...F.aliases??[],...F.name.split(":")]);j!==0&&P.push({score:j,suggestion:{value:F.name,label:`/${F.name}${F.argumentHint?` ${F.argumentHint}`:""}`,description:F.description}})}return P.sort((F,j)=>j.score-F.score),P.map(({suggestion:F})=>F)},onSelect:M=>M.value,chipClassName:"font-mono"}))}return G.length>0&&B.push(_C({char:"$",accessibilityLabel:"skill",onSearch:Q=>{const le=[];for(const M of G){const P=MC(Q,[M.name,...M.name.split(/[-:_]/)]);if(P===0)continue;const F=M.shortDescription??M.description;le.push({score:P,suggestion:{value:M.name,label:M.displayName??M.name,description:F?`Skill · ${F}`:"Skill · inserts a message you can edit",icon:h.jsx(jm,{className:"size-3.5 text-fg-3"})}})}return le.sort((M,P)=>P.score-M.score),le.map(({suggestion:M})=>M)},insertAsText:Q=>{const le=G.find(M=>M.name===Q.value);return le?kA(le):`$${Q.value} `}})),c&&B.push(NU({searchDebounceMs:150,onSearch:async(Q,le)=>(await c(Q,le)).map(P=>({value:P.relative,label:P.relative,description:P.path})),onSelect:Q=>Q.value,chipStyle:"inline",chipClassName:"font-mono",emptyMessage:"No matching files"})),B.length>0?B:void 0},[a,l,c]),D=d?.items??[],I=!r&&(!w||D.length>0)&&!d?.uploading&&!d?.hasFailure,U=()=>{I&&(e(k.trim(),d?.readyIds??[]),d?.clear(),S(),N())},z=B=>{B&&B.length>0&&d?.add(B)},X=d&&!d.disabled?h.jsx("input",{ref:_,type:"file",multiple:!0,accept:d.accept||void 0,className:"hidden",onChange:B=>{z(B.target.files),B.target.value=""}}):null,V=!!d&&!d.disabled?h.jsxs(h.Fragment,{children:[X,x?h.jsx(LC,{label:"Attach files",disabled:r,onClick:()=>_.current?.click(),children:"+"}):h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Attach files",disabled:r,onClick:()=>_.current?.click(),children:h.jsx(I7,{className:"size-4"})})]}):null,ee=n&&!I,q=x?h.jsx(LC,{label:ee?"Interrupt":"Send",disabled:!ee&&!I,onClick:ee?t:U,className:ee?"text-warning":I?"text-accent":void 0,children:ee?"■":"↵"}):ee?h.jsx(at,{variant:"outline",size:"icon-sm","aria-label":"Interrupt",className:"rounded-full",onClick:t,children:h.jsx(dB,{className:"size-3"})}):h.jsx(at,{size:"icon-sm","aria-label":"Send",className:"rounded-full",disabled:!I,onClick:U,children:h.jsx(T9,{className:"size-4"})});return h.jsxs("div",{"data-slot":"composer",className:Se("px-3 pb-3",m),children:[h.jsxs("div",{onDragOver:B=>{d&&!d.disabled&&(B.preventDefault(),L(!0))},onDragLeave:()=>L(!1),onDrop:B=>{!d||d.disabled||(B.preventDefault(),L(!1),z(B.dataTransfer.files))},className:Se("mx-auto w-full max-w-[var(--wd-content-max-w,48rem)] overflow-hidden rounded-lg border border-border bg-bg shadow-(--shadow-xs)","transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",A&&"border-ring ring-2 ring-ring/30",r&&"opacity-60"),children:[D.length>0&&d?h.jsx(pF,{attachments:d}):null,x?h.jsxs("div",{className:"flex items-end gap-1 p-1",children:[V,h.jsx(NC,{...v,triggers:R,onSubmit:U,disabled:r,placeholder:r?"Session ended":i,minHeight:20,maxHeight:192,"aria-label":"Message the agent",className:"min-w-0 flex-1 py-0.5 text-body-sm text-text",onImagePaste:B=>d?.add([B])}),q]}):h.jsxs(h.Fragment,{children:[h.jsx(NC,{...v,triggers:R,onSubmit:U,disabled:r,placeholder:r?"Session ended":i,minHeight:28,maxHeight:192,"aria-label":"Message the agent",className:"px-3 pt-2.5 pb-1 text-body-sm text-text",onImagePaste:B=>d?.add([B])}),h.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-2",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[V,f]}),q]})]})]}),d?.error?h.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:[h.jsx(Ll,{className:"size-3 shrink-0"}),h.jsx("span",{className:"min-w-0 flex-1",children:d.error}),h.jsx("button",{type:"button",onClick:d.dismissError,"aria-label":"Dismiss",className:"shrink-0 opacity-70 hover:opacity-100",children:h.jsx(bi,{className:"size-3"})})]}):h.jsx("div",{"data-slot":"composer-hint",className:"mx-auto mt-1 w-full max-w-[var(--wd-content-max-w,48rem)] text-center text-label text-fg-4",children:"Enter to send · Shift+Enter for a new line"})]})}function LC({label:e,disabled:t,onClick:n,className:r,children:i}){return h.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:n,className:Se("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:i})}function pF({attachments:e}){return h.jsx("div",{className:"flex gap-2 overflow-x-auto border-b border-border px-2 py-2",children:e.items.map(t=>h.jsx(gF,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function gF({item:e,onRetry:t,onRemove:n}){const r=e.status==="failed";return h.jsxs("div",{className:"group relative shrink-0",title:r?`${e.name} — ${e.error}`:`${e.name} · ${xo(e.bytes)}`,children:[h.jsx("div",{className:Se("flex size-14 items-center justify-center overflow-hidden rounded-md border border-border bg-surface",r&&"border-danger/50"),children:e.previewUrl?h.jsx("img",{src:e.previewUrl,alt:e.name,className:"size-full object-cover"}):h.jsxs("div",{className:"flex flex-col items-center gap-0.5 text-fg-3",children:[h.jsx(Hx,{className:"size-4"}),h.jsx("span",{className:"max-w-12 truncate text-[9px] font-semibold uppercase",children:bF(e.name)})]})}),e.status==="uploading"?h.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md bg-black/35",children:h.jsx(vn,{className:"size-4 text-white"})}):null,r?h.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:h.jsx(Fx,{className:"size-4"})}):null,h.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:h.jsx(bi,{className:"size-2.5"})})]})}const bF=e=>{const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toUpperCase():"FILE"},xF=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0,yF=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function EF({usage:e,open:t,onOpenChange:n}){return h.jsx(tu,{open:t,onOpenChange:n,children:h.jsxs(nu,{children:[h.jsx(ru,{title:"Context",description:e?.model}),h.jsx(su,{children:e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[h.jsx("span",{className:"text-label text-fg-3",children:"Used"}),h.jsxs("span",{className:"font-mono text-body-sm text-fg-1",children:[us(e.totalTokens)," / ",us(e.maxTokens)," ·"," ",e.percentage.toFixed(0),"%"]})]}),h.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-border",children:h.jsx("div",{className:Se("h-full rounded-full",yF(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?h.jsxs("div",{className:"mt-5",children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Breakdown"}),h.jsx("div",{className:"mt-2 flex flex-col gap-3",children:e.categories.map(r=>{const i=r.tokens/Math.max(e.maxTokens,1)*100,a=xF(r.color);return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[h.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:a?{backgroundColor:a}:void 0}),h.jsx("span",{className:"truncate text-body-sm text-fg-1",children:r.name})]}),h.jsx("span",{className:"shrink-0 font-mono text-label text-fg-3",children:us(r.tokens)})]}),h.jsx("div",{className:"mt-1 h-1 overflow-hidden rounded-full bg-border",children:h.jsx("div",{className:"h-full rounded-full bg-fg-4",style:{width:`${Math.min(100,i)}%`,backgroundColor:a}})})]},r.name)})})]}):null]}):h.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 vF({client:e,cwd:t,open:n,onOpenChange:r}){const[i,a]=E.useState(t),[l,c]=E.useState([]),[d,f]=E.useState(!1),[g,m]=E.useState(""),[b,x]=E.useState(),[v,k]=E.useState(),[w,S]=E.useState(!1),[N,_]=E.useState(),A=E.useCallback(async I=>{S(!0),_(void 0);try{const U=await e.listHostDir(I);a(U.path),c(U.entries),f(U.truncated??!1)}catch(U){_(U instanceof Error?U.message:"Could not read that directory")}finally{S(!1)}},[e]);E.useEffect(()=>{n&&(k(void 0),m(""),x(void 0),_(void 0),t&&A(t))},[n,t,A]),E.useEffect(()=>{if(!n||!t)return;const I=g.trim();if(!I){x(void 0);return}const U=setTimeout(()=>{e.findHostFiles(t,I,40).then(z=>x(z.matches)).catch(()=>x([]))},150);return()=>clearTimeout(U)},[e,t,g,n]);const L=async I=>{S(!0),_(void 0);try{const U=await e.readHostFile(I);k({path:U.path,bytes:U.bytes,content:U.encoding==="utf8"?U.content:"(binary file — not shown)"})}catch(U){_(U instanceof Error?U.message:"Could not read that file")}finally{S(!1)}},R=i&&t&&i!==t?i.slice(0,i.lastIndexOf("/"))||"/":void 0,D=b??l;return h.jsx(tu,{open:n,onOpenChange:r,children:h.jsxs(nu,{size:"lg",children:[h.jsx(ru,{title:v?v.path.split("/").pop():"Files",description:v?v.path:i,actions:v?h.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>k(void 0),children:[h.jsx(Yh,{className:"size-3.5"}),"Back"]}):R?h.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>void A(R),children:[h.jsx(Yh,{className:"size-3.5"}),"Up"]}):null}),h.jsxs(su,{className:"flex flex-col gap-3",children:[N?h.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:N}):null,v?h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-label text-fg-4",children:xo(v.bytes)}),h.jsx(aA,{code:v.content,label:v.path.split("/").pop()})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"relative",children:[h.jsx($x,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),h.jsx(un,{value:g,onChange:I=>m(I.target.value),placeholder:"Search this project…",className:"pl-7",spellCheck:!1})]}),w&&D.length===0?h.jsx("div",{className:"py-6 text-center",children:h.jsx(vn,{className:"size-4 text-fg-4"})}):D.length===0?h.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:b?"No matching files.":"This directory is empty."}):h.jsx("ul",{className:"flex flex-col",children:b?b.map(I=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>void L(I.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:[h.jsx(Lm,{className:"size-3.5 shrink-0 text-fg-4"}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:I.relative})]})},I.path)):l.map(I=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>I.type==="dir"?void A(I.path):void L(I.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:[h.jsx(TF,{type:I.type}),h.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:[I.name,I.type==="dir"?"/":""]}),I.bytes!==void 0?h.jsx("span",{className:"shrink-0 text-label text-fg-4",children:xo(I.bytes)}):null]})},I.path))}),d&&!b?h.jsx("p",{className:"text-label text-fg-4",children:"More entries than the server will return — use the search box."}):null]})]})]})})}function TF({type:e}){return e==="dir"?h.jsx(O_,{className:"size-3.5 shrink-0 text-accent"}):e==="symlink"?h.jsx(M_,{className:"size-3.5 shrink-0 text-fg-4"}):h.jsx(Lm,{className:"size-3.5 shrink-0 text-fg-4"})}const NA={connected:"success",failed:"danger","needs-auth":"warning",pending:"info",disabled:"neutral"};function SF({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:i=!0}){const[a,l]=E.useState(),[c,d]=E.useState(),[f,g]=E.useState(!1),[m,b]=E.useState(),[x,v]=E.useState(),[k,w]=E.useState(),S=E.useCallback(async()=>{if(t){g(!0),d(void 0);try{l(await e.listMcpServers(t))}catch(R){d(R instanceof Error?R.message:"Could not read MCP status")}finally{g(!1)}}},[e,t]);E.useEffect(()=>{n&&(v(void 0),w(void 0),S())},[n,S]);const N=async(R,D)=>{if(t){b(R),d(void 0);try{l(await e.mcpServerAction(t,R,D))}catch(I){d(I instanceof Error?I.message:`Could not ${D} ${R}`)}finally{b(void 0)}}},_=a?.find(R=>R.name===x),A=_?.tools?.find(R=>R.name===k),L=A?.name??_?.name??"MCP servers";return h.jsx(tu,{open:n,onOpenChange:r,children:h.jsxs(nu,{children:[h.jsx(ru,{title:L,description:A?`${_?.name} tool`:_?_.serverInfo?.name:void 0,actions:x?h.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>k?w(void 0):v(void 0),children:[h.jsx(Yh,{className:"size-3.5"}),"Back"]}):h.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>void S(),disabled:f,children:[f?h.jsx(vn,{className:"size-3 text-current"}):h.jsx(Fx,{className:"size-3"}),"Refresh"]})}),h.jsxs(su,{children:[c?h.jsx("div",{className:"mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:c}):null,A?h.jsx(kF,{tool:A}):_?h.jsx(wF,{server:_,busy:m===_.name,canManage:i,onAct:R=>void N(_.name,R),onSelectTool:w}):c&&!a?null:h.jsx(CF,{servers:a,loading:f,onSelect:v})]})]})})}function CF({servers:e,loading:t,onSelect:n}){if(t&&!e)return h.jsx("div",{className:"py-6 text-center",children:h.jsx(vn,{className:"size-4 text-fg-4"})});if(!e?.length)return h.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(i=>i.scope??"other"))];return h.jsx("div",{className:"flex flex-col gap-4",children:r.map(i=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3 capitalize",children:i}),h.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(a=>(a.scope??"other")===i).map(a=>h.jsx("li",{children:h.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:[h.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-fg-1",children:a.name}),a.tools?.length?h.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[a.tools.length," tools"]}):null,h.jsx(gn,{variant:NA[a.status]??"neutral",dot:!0,className:"shrink-0",children:a.status}),h.jsx(Mm,{className:"size-3.5 shrink-0 text-fg-4"})]})},a.name))})]},i))})}function wF({server:e,busy:t,canManage:n,onAct:r,onSelectTool:i}){const a=e.status==="disabled";return h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsx(ir,{label:"Status",children:h.jsx(gn,{variant:NA[e.status]??"neutral",dot:!0,children:e.status})}),e.transport?h.jsx(ir,{label:"Transport",children:e.transport}):null,e.scope?h.jsx(ir,{label:"Scope",children:e.scope}):null,e.serverInfo?h.jsxs(ir,{label:"Server",children:[e.serverInfo.name," ",e.serverInfo.version]}):null,e.command?h.jsx(ir,{label:"Command",mono:!0,children:[e.command,...e.args??[]].join(" ")}):null,e.url?h.jsx(ir,{label:"URL",mono:!0,children:e.url}):null]}),e.error?h.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger",children:e.error}):null,n?h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(at,{variant:"outline",size:"sm",disabled:t,onClick:()=>r("reconnect"),children:[t?h.jsx(vn,{className:"size-3 text-current"}):h.jsx(Fx,{className:"size-3"}),"Reconnect"]}),h.jsxs(at,{variant:"outline",size:"sm",disabled:t,onClick:()=>r(a?"enable":"disable"),children:[a?h.jsx(U7,{className:"size-3"}):h.jsx(z7,{className:"size-3"}),a?"Enable":"Disable"]})]}):null,h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Tools"}),e.tools?.length?h.jsx("ul",{className:"mt-1 flex flex-col",children:e.tools.map(l=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>i(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:[h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:l.name}),h.jsx(Mm,{className:"size-3.5 shrink-0 text-fg-4"})]})},l.name))}):h.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 kF({tool:e}){const t=e.annotations;return h.jsxs("div",{className:"flex flex-col gap-3",children:[e.description?h.jsx("p",{className:"text-body-sm whitespace-pre-wrap text-fg-2",children:e.description}):h.jsx("p",{className:"text-body-sm text-fg-4",children:"This tool carries no description."}),t?h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.readOnly?h.jsx(gn,{variant:"success",children:"read-only"}):null,t.destructive?h.jsx(gn,{variant:"danger",children:"destructive"}):null,t.openWorld?h.jsx(gn,{variant:"warning",children:"open world"}):null]}):null,e.inputSchema!==void 0?h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Parameters"}),h.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2",children:NF(e.inputSchema)})]}):h.jsx("p",{className:Se("text-label text-fg-4"),children:"Parameters aren’t available: this engine names and describes each tool but reports no input schema."})]})}function NF(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const _A={user:"Personal",repo:"This project",system:"System",admin:"Managed"};function _F({skills:e,open:t,onOpenChange:n,onUse:r}){const[i,a]=E.useState(),l=e?.find(c=>c.name===i);return h.jsx(tu,{open:t,onOpenChange:c=>{c||a(void 0),n(c)},children:h.jsxs(nu,{children:[h.jsx(ru,{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?h.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>a(void 0),children:[h.jsx(Yh,{className:"size-3.5"}),"Back"]}):void 0}),h.jsx(su,{children:l?h.jsx(RF,{skill:l,onUse:r,onUsed:()=>n(!1)}):h.jsx(AF,{skills:e,onSelect:a})})]})})}function AF({skills:e,onSelect:t}){if(!e)return h.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 h.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 h.jsx("div",{className:"flex flex-col gap-4",children:n.map(r=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:_A[r]??r}),h.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(i=>(i.scope??"other")===r).map(i=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>t(i.name),className:"flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-body-sm text-fg-1",children:i.displayName??i.name}),i.shortDescription??i.description?h.jsx("span",{className:"block truncate text-label text-fg-4",children:i.shortDescription??i.description}):null]}),i.enabled?null:h.jsx(gn,{variant:"neutral",className:"mt-0.5 shrink-0",children:"off"}),h.jsx(Mm,{className:"mt-0.5 size-3.5 shrink-0 text-fg-4"})]})},i.name))})]},r))})}function RF({skill:e,onUse:t,onUsed:n}){return h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[e.scope?h.jsx(ir,{label:"Scope",children:_A[e.scope]??e.scope}):null,h.jsx(ir,{label:"Status",children:h.jsx(gn,{variant:e.enabled?"success":"neutral",dot:!0,children:e.enabled?"enabled":"disabled"})})]}),e.description?h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Description"}),h.jsx("p",{className:"mt-1 text-body-sm whitespace-pre-wrap text-fg-2",children:e.description})]}):h.jsx("p",{className:"text-body-sm text-fg-4",children:"This skill carries no description."}),t&&e.enabled?h.jsxs("div",{children:[h.jsx(at,{variant:"outline",size:"sm",onClick:()=>{t(e),n()},children:"Use this skill"}),h.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 a1=e=>e==="default",K0=e=>e.replace(/\[.*\]$/,"");function DC(e){const t=e.toLowerCase().split("-");return t[0]==="claude"&&t.shift(),t[0]??""}function OF(e,t){if(t===e.value||t===e.resolvedModel)return!0;const n=K0(t);if(e.resolvedModel)return n===K0(e.resolvedModel);const r=DC(n);return r!==""&&r===DC(K0(e.value))}function IF(e,t){if(t)return e.filter(n=>!a1(n.value)).find(n=>OF(n,t))}function AA({models:e,model:t,onModelChange:n,variant:r="toolbar",disabled:i,className:a}){const l=IF(e,t)??(t?void 0:e.find(c=>a1(c.value)));return h.jsxs(ho,{items:e.map(c=>({value:c.value,label:c.displayName})),value:l?.value??null,onValueChange:c=>{typeof c!="string"||c===l?.value||n(a1(c)?void 0:c)},disabled:i,children:[h.jsx(po,{"aria-label":"Model",className:Se(r==="toolbar"&&"h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover",a),children:h.jsx("span",{className:Se("truncate",r==="toolbar"&&"font-mono text-label"),children:h.jsx(mo,{placeholder:t??"model"})})}),h.jsx(go,{className:"min-w-72",children:e.map(c=>h.jsxs(ua,{value:c.value,children:[h.jsx(la,{children:h.jsx("span",{className:"font-medium",children:c.displayName})}),c.description?h.jsx("span",{className:"text-label text-fg-4",children:c.description}):null]},c.value))})]})}const ql=[{value:"default",label:"Manual",shortLabel:"Manual",description:"Always ask before making changes",icon:I_},{value:"acceptEdits",label:"Accept edits",shortLabel:"Edits",description:"Automatically accept all file edits",icon:zx},{value:"plan",label:"Plan",shortLabel:"Plan",description:"Create a plan before making changes",icon:H9},{value:"auto",label:"Auto",shortLabel:"Auto",description:"Claude handles permission decisions",icon:kB},{value:"dontAsk",label:"Don't ask",shortLabel:"Don't ask",description:"Never ask — deny anything not pre-approved",icon:eB},{value:"bypassPermissions",label:"Bypass permissions",shortLabel:"Bypass",description:"Skip every approval — the agent is unsupervised",icon:Ll,dangerous:!0}],MF=e=>ql.find(t=>t.value===e);function LF(e,t){return(e?ql.filter(r=>e.includes(r.value)):ql).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 dd({mode:e,onModeChange:t,modes:n,canBypass:r,variant:i="toolbar",disabled:a,className:l}){const c=e==="bypassPermissions",d=n?ql.filter(g=>n.includes(g.value)):ql,f=g=>g.value==="bypassPermissions"&&r===!1;return h.jsxs(ho,{items:d.map(g=>({value:g.value,label:g.label})),value:e??null,onValueChange:g=>{typeof g=="string"&&g!==e&&t(g)},disabled:a,children:[h.jsx(po,{"aria-label":"Permission mode",className:Se(i==="toolbar"&&"h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover",c?"text-danger":i==="toolbar"?"text-fg-3":void 0,l),children:h.jsx("span",{className:Se("truncate",i==="toolbar"&&"text-label"),children:h.jsx(mo,{placeholder:"permissions"})})}),h.jsx(go,{className:"min-w-64",children:d.map(g=>{const m=f(g);return h.jsxs(ua,{value:g.value,disabled:m,children:[h.jsx(la,{children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(g.icon,{className:Se("size-3.5 shrink-0",g.dangerous?"text-danger":"text-fg-3")}),h.jsx("span",{className:Se("font-medium",g.dangerous&&"text-danger"),children:g.label})]})}),h.jsx("span",{className:Se("pl-5.5 text-label",m?"text-fg-4":g.dangerous?"text-danger/80":"text-fg-4"),children:m?"Only available to a session started in this mode":g.description})]},g.value)})})]})}function RA(e){switch(e){case"Bash":case"BashOutput":case"KillShell":return Qb;case"Read":return Hx;case"Write":return iB;case"Edit":case"MultiEdit":case"NotebookEdit":return L7;case"Glob":return a7;case"Grep":return $x;case"WebFetch":return B9;case"WebSearch":return dC;case"Task":case"Agent":return B_;case"TodoWrite":return rB;case"Skill":return jm;case"AskUserQuestion":return D_;case"CodexCommand":return Qb;case"CodexFileChange":return W9;case"CodexWebSearch":return dC;case"CodexImageGeneration":case"CodexImageView":return b7;default:return e.startsWith("mcp__")?$7:SB}}function DF(e){switch(e){case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":case"Update":case"CodexFileChange":return!0;default:return!1}}const Um=(function(e){if(e==null)return zF;if(typeof e=="function")return Fm(e);if(typeof e=="object")return Array.isArray(e)?jF(e):PF(e);if(typeof e=="string")return BF(e);throw new Error("Expected function, string, or object as test")});function jF(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Um(e[n]);return Fm(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function PF(e){const t=e;return Fm(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function BF(e){return Fm(t);function t(n){return n&&n.type===e}}function Fm(e){return t;function t(n,r,i){return!!(HF(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function zF(){return!0}function HF(e){return e!==null&&typeof e=="object"&&"type"in e}const OA=[],Cc=!0,o1=!1,_l="skip";function Xx(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Um(i),l=r?-1:1;c(e,void 0,[])();function c(d,f,g){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=OA,v,k,w;if((!t||a(d,f,g[g.length-1]||void 0))&&(x=UF(n(d,g)),x[0]===o1))return x;if("children"in d&&d.children){const S=d;if(S.children&&x[0]!==_l)for(k=(r?S.children.length:-1)+l,w=g.concat(S);k>-1&&k<S.children.length;){const N=S.children[k];if(v=c(N,k,w)(),v[0]===o1)return v;k=typeof v[1]=="number"?v[1]:k+l}}return x}}}function UF(e){return Array.isArray(e)?e:typeof e=="number"?[Cc,e]:e==null?OA:[e]}function Bs(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),Xx(e,a,c,i);function c(d,f){const g=f[f.length-1],m=g?g.children.indexOf(d):void 0;return l(d,m,g)}}const Yl={indicator:"indicator",textOnly:"text-only",remove:"remove"};function FF({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],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:c=Yl.indicator,imageBlockPolicy:d=Yl.indicator}){const f=t.length&&!t.every(m=>m==="*"),g=n.length&&!n.every(m=>m==="*");if(!e&&(f||g))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return m=>{const b=KF(e,t,n,r,i,a,l,c,d);IA(m),Bs(m,b)}}function jC(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 $F(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const VF=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),qF=new Set(["javascript:","data:","file:","vbscript:"]);function PC(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&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 g=e.substring(5);if(g&&g.length>0&&g!=="invalid")return e}}catch{return null}return null}const l=jC(e,n);if(!l||qF.has(l.protocol)||!(VF.has(l.protocol)||a.includes(l.protocol)||a.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;const d=$F(e);return l&&t.some(f=>{const g=jC(f,n);return!g||g.origin!==l.origin?!1:l.href.startsWith(g.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 IA(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)IA(t)}}const X0=Symbol("node-seen");function YF(e,t,n){return t===Yl.remove?{type:"remove"}:t===Yl.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 GF(e,t,n){if(t===Yl.remove)return{type:"remove"};if(t===Yl.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 KF=(e,t,n,r,i,a,l,c,d)=>{const f=(g,m,b)=>{if(g.type!=="element"||g[X0])return Cc;if(g.tagName==="a"){const x=PC(g.properties.href,t,e,!1,!1,i);if(x===null){if(g[X0]=!0,Bs(g,f),b&&typeof m=="number"){const v=YF(g,c,l);if(v.type==="remove")return b.children.splice(m,1),[_l,m];b.children[m]=v.element}return _l}else return g.properties.href=x,g.properties.target="_blank",g.properties.rel="noopener noreferrer",Cc}if(g.tagName==="img"){const x=PC(g.properties.src,n,e,r,!0,i);if(x===null){if(g[X0]=!0,Bs(g,f),b&&typeof m=="number"){const v=GF(g,d,a);if(v.type==="remove")return b.children.splice(m,1),[_l,m];b.children[m]=v.element}return _l}else return g.properties.src=x,Cc}return Cc};return f},MA=-1,$m=0,Ic=1,Zh=2,Wx=3,Qx=4,Zx=5,Jx=6,LA=7,DA=8,jA=typeof self=="object"?self:globalThis,BC=(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 jA[e](t)},XF=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case $m:case MA:return n(l,i);case Ic:{const c=n([],i);for(const d of l)c.push(r(d));return c}case Zh:{const c=n({},i);for(const[d,f]of l)c[r(d)]=r(f);return c}case Wx:return n(new Date(l),i);case Qx:{const{source:c,flags:d}=l;return n(new RegExp(c,d),i)}case Zx:{const c=n(new Map,i);for(const[d,f]of l)c.set(r(d),r(f));return c}case Jx:{const c=n(new Set,i);for(const d of l)c.add(r(d));return c}case LA:{const{name:c,message:d}=l;return n(typeof jA[c]=="function"?BC(c,d):new Error(d),i)}case DA:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(BC(a,l),i)};return r},zC=e=>XF(new Map,e)(0),Ya="",{toString:WF}={},{keys:QF}=Object,uc=e=>{const t=typeof e;if(t!=="object"||!e)return[$m,t];const n=WF.call(e).slice(8,-1);switch(n){case"Array":return[Ic,Ya];case"Object":return[Zh,Ya];case"Date":return[Wx,Ya];case"RegExp":return[Qx,Ya];case"Map":return[Zx,Ya];case"Set":return[Jx,Ya];case"DataView":return[Ic,n]}return n.includes("Array")?[Ic,n]:e instanceof Error?[LA,e.name||"Error"]:[Zh,n]},ih=([e,t])=>e===$m&&(t==="function"||t==="symbol"),ZF=(e,t,n,r)=>{const i=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},a=l=>{if(n.has(l))return n.get(l);let[c,d]=uc(l);switch(c){case $m:{let g=l;switch(d){case"bigint":c=DA,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);g=null;break;case"undefined":return i([MA],l)}return i([c,g],l)}case Ic:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),i([d,[...b]],l)}const g=[],m=i([c,g],l);for(const b of l)g.push(a(b));return m}case Zh:{if(d)switch(d){case"BigInt":return i([d,l.toString()],l);case"Boolean":case"Number":case"String":return i([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const g=[],m=i([c,g],l);for(const b of QF(l))(e||!ih(uc(l[b])))&&g.push([a(b),a(l[b])]);return m}case Wx:return i([c,isNaN(l.getTime())?Ya:l.toISOString()],l);case Qx:{const{source:g,flags:m}=l;return i([c,{source:g,flags:m}],l)}case Zx:{const g=[],m=i([c,g],l);for(const[b,x]of l)(e||!(ih(uc(b))||ih(uc(x))))&&g.push([a(b),a(x)]);return m}case Jx:{const g=[],m=i([c,g],l);for(const b of l)(e||!ih(uc(b)))&&g.push(a(b));return m}}const{message:f}=l;return i([c,{name:d,message:f}],l)};return a},HC=(e,{json:t,lossy:n}={})=>{const r=[];return ZF(!(t||n),!!t,new Map,r)(e),r},yo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?zC(HC(e,t)):structuredClone(e):(e,t)=>zC(HC(e,t));class fd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}fd.prototype.normal={};fd.prototype.property={};fd.prototype.space=void 0;function PA(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new fd(n,r,t)}function Jc(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 JF=0;const pt=Ro(),Mn=Ro(),l1=Ro(),He=Ro(),nn=Ro(),so=Ro(),Fr=Ro();function Ro(){return 2**++JF}const u1=Object.freeze(Object.defineProperty({__proto__:null,boolean:pt,booleanish:Mn,commaOrSpaceSeparated:Fr,commaSeparated:so,number:He,overloadedBoolean:l1,spaceSeparated:nn},Symbol.toStringTag,{value:"Module"})),W0=Object.keys(u1);class ey extends Lr{constructor(t,n,r,i){let a=-1;if(super(t,n),UC(this,"space",i),typeof r=="number")for(;++a<W0.length;){const l=W0[a];UC(this,W0[a],(r&u1[l])===u1[l])}}}ey.prototype.defined=!0;function UC(e,t,n){n&&(e[t]=n)}function iu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new ey(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Jc(r)]=r,n[Jc(a.attribute)]=r}return new fd(t,n,e.space)}const BA=iu({properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:He,ariaColIndex:He,ariaColSpan:He,ariaControls:nn,ariaCurrent:null,ariaDescribedBy:nn,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:nn,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:nn,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nn,ariaLevel:He,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:nn,ariaPlaceholder:null,ariaPosInSet:He,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:nn,ariaRowCount:He,ariaRowIndex:He,ariaRowSpan:He,ariaSelected:Mn,ariaSetSize:He,ariaSort:null,ariaValueMax:He,ariaValueMin:He,ariaValueNow:He,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zA(e,t){return t in e?e[t]:t}function HA(e,t){return zA(e,t.toLowerCase())}const e$=iu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:so,acceptCharset:nn,accessKey:nn,action:null,allow:null,allowFullScreen:pt,allowPaymentRequest:pt,allowUserMedia:pt,alpha:pt,alt:null,as:null,async:pt,autoCapitalize:null,autoComplete:nn,autoFocus:pt,autoPlay:pt,blocking:nn,capture:null,charSet:null,checked:pt,cite:null,className:nn,closedBy:null,colorSpace:null,cols:He,colSpan:He,command:null,commandFor:null,content:null,contentEditable:Mn,controls:pt,controlsList:nn,coords:He|so,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pt,defer:pt,dir:null,dirName:null,disabled:pt,download:l1,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pt,formTarget:null,headers:nn,height:He,hidden:l1,high:He,href:null,hrefLang:null,htmlFor:nn,httpEquiv:nn,id:null,imageSizes:null,imageSrcSet:null,inert:pt,inputMode:null,integrity:null,is:null,isMap:pt,itemId:null,itemProp:nn,itemRef:nn,itemScope:pt,itemType:nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pt,low:He,manifest:null,max:null,maxLength:He,media:null,method:null,min:null,minLength:He,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:He,pattern:null,ping:nn,placeholder:null,playsInline:pt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pt,referrerPolicy:null,rel:nn,required:pt,reversed:pt,rows:He,rowSpan:He,sandbox:nn,scope:null,scoped:pt,seamless:pt,selected:pt,shadowRootClonable:pt,shadowRootCustomElementRegistry:pt,shadowRootDelegatesFocus:pt,shadowRootMode:null,shadowRootSerializable:pt,shape:null,size:He,sizes:null,slot:null,span:He,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:He,step:null,style:null,tabIndex:He,target:null,title:null,translate:null,type:null,typeMustMatch:pt,useMap:null,value:Mn,width:He,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nn,axis:null,background:null,bgColor:null,border:He,borderColor:null,bottomMargin:He,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pt,declare:pt,event:null,face:null,frame:null,frameBorder:null,hSpace:He,leftMargin:He,link:null,longDesc:null,lowSrc:null,marginHeight:He,marginWidth:He,noResize:pt,noHref:pt,noShade:pt,noWrap:pt,object:null,profile:null,prompt:null,rev:null,rightMargin:He,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:He,valueType:null,version:null,vAlign:null,vLink:null,vSpace:He,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:pt,disablePictureInPicture:pt,disableRemotePlayback:pt,exportParts:so,part:nn,prefix:null,property:null,results:He,security:null,unselectable:null},space:"html",transform:HA}),t$=iu({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:He,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:He,amplitude:He,arabicForm:null,ascent:He,attributeName:null,attributeType:null,azimuth:He,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:He,by:null,calcMode:null,capHeight:He,className:nn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:He,diffuseConstant:He,direction:null,display:null,dur:null,divisor:He,dominantBaseline:null,download:pt,dx:null,dy:null,edgeMode:null,editable:null,elevation:He,enableBackground:null,end:null,event:null,exponent:He,externalResourcesRequired:null,fill:null,fillOpacity:He,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:so,g2:so,glyphName:so,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:He,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:He,horizOriginX:He,horizOriginY:He,id:null,ideographic:He,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:He,k:He,k1:He,k2:He,k3:He,k4:He,kernelMatrix:Fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:He,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:He,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:He,overlineThickness:He,paintOrder:null,panose1:null,path:null,pathLength:He,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:He,pointsAtY:He,pointsAtZ:He,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:He,specularExponent:He,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:He,strikethroughThickness:He,string:null,stroke:null,strokeDashArray:Fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:He,strokeOpacity:He,strokeWidth:null,style:null,surfaceScale:He,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fr,tabIndex:He,tableValues:null,target:null,targetX:He,targetY:He,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:He,underlineThickness:He,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:He,values:null,vAlphabetic:He,vMathematical:He,vectorEffect:null,vHanging:He,vIdeographic:He,version:null,vertAdvY:He,vertOriginX:He,vertOriginY:He,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:He,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zA}),UA=iu({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()}}),FA=iu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:HA}),$A=iu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),n$={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"},r$=/[A-Z]/g,FC=/-[a-z]/g,s$=/^data[-\w.:]+$/i;function Vm(e,t){const n=Jc(t);let r=t,i=Lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&s$.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(FC,a$);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!FC.test(a)){let l=a.replace(r$,i$);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=ey}return new i(r,t)}function i$(e){return"-"+e.toLowerCase()}function a$(e){return e.charAt(1).toUpperCase()}const hd=PA([BA,e$,UA,FA,$A],"html"),ya=PA([BA,t$,UA,FA,$A],"svg");function $C(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const l=n.slice(i,r).trim();(l||!a)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function VA(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const VC=/[#.]/g;function o$(e,t){const n=e||"",r={};let i=0,a,l;for(;i<n.length;){VC.lastIndex=i;const c=VC.exec(n),d=n.slice(i,c?c.index:n.length);d&&(a?a==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,i+=d.length),c&&(a=c[0],i++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function qC(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function qA(e){return e.join(" ").trim()}function YA(e,t,n){const r=n?d$(n):void 0;function i(a,l,...c){let d;if(a==null){d={type:"root",children:[]};const f=l;c.unshift(f)}else{d=o$(a,t);const f=d.tagName.toLowerCase(),g=r?r.get(f):void 0;if(d.tagName=g||f,l$(l))c.unshift(l);else for(const[m,b]of Object.entries(l))u$(e,d.properties,m,b)}for(const f of c)c1(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return i}function l$(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 i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const l of a)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function u$(e,t,n,r){const i=Vm(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"?i.spaceSeparated?a=qC(r):i.commaSeparated?a=$C(r):i.commaOrSpaceSeparated?a=qC($C(r).join(" ")):a=YC(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?c$(r):String(r);if(Array.isArray(a)){const l=[];for(const c of a)l.push(YC(i,i.property,c));a=l}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function c1(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)c1(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?c1(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function YC(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Jc(n)===Jc(t)))return!0}return n}function c$(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function d$(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const f$=["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"],h$=YA(hd,"div"),m$=YA(ya,"g",f$);function p$(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const d=GC(t,n[l-1]);c=d===-1?t.length+1:d+1,n[l]=c}if(c>a)return{line:l+1,column:a-(l>0?n[l-1]:0)+1,offset:a};l++}}}function i(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 c=n[n.length-1],d=GC(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const l=(a.line>1?n[a.line-2]:0)+a.column-1;if(l<n[a.line-1])return l}}}function GC(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
534
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const eo={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/"},GA={}.hasOwnProperty,g$=Object.prototype;function b$(e,t){const n=t||{};return ty({file:n.file||void 0,location:!1,schema:n.space==="svg"?ya:hd,verbose:n.verbose||!1},e)}function ty(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},wh(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:KA(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),l=p$(a),c=l.toPoint(0),d=l.toPoint(a.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},wh(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},wh(e,r,n),n}default:return n=x$(e,t),n}}function KA(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=ty(e,t[n]);r.push(i)}return r}function x$(e,t){const n=e.schema;e.schema=t.namespaceURI===eo.svg?ya:hd;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;GA.call(g$,d)||(i[d]=c.value)}const l=(e.schema.space==="svg"?m$:h$)(t.tagName,i,KA(e,t.childNodes));if(wh(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&Al(d.startTag),g=d&&d.endTag&&Al(d.endTag),m=ty(e,c.content);f&&g&&e.file&&(m.position={start:f.end,end:g.start}),l.content=m}return e.schema=n,l}function wh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=y$(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function y$(e,t,n){const r=Al(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const a={};let l;if(n.attrs)for(l in n.attrs)GA.call(n.attrs,l)&&(a[Vm(e.schema,l).property]=Al(n.attrs[l]));n.startTag;const c=Al(n.startTag),d=n.endTag?Al(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function Al(e){const t=KC({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=KC({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function KC(e){return e.line&&e.column?e:void 0}const XC={}.hasOwnProperty;function XA(e,t){const n=t||{};function r(i,...a){let l=r.invalid;const c=r.handlers;if(i&&XC.call(i,e)){const d=String(i[e]);l=XC.call(c,d)?c[d]:r.unknown}if(l)return l.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const E$={},v$={}.hasOwnProperty,WA=XA("type",{handlers:{root:S$,element:_$,text:k$,comment:N$,doctype:w$}});function T$(e,t){const r=(t||E$).space;return WA(e,r==="svg"?ya:hd)}function S$(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=ny(e.children,n,t),au(e,n),n}function C$(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=ny(e.children,n,t),au(e,n),n}function w$(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return au(e,t),t}function k$(e){const t={nodeName:"#text",value:e.value,parentNode:null};return au(e,t),t}function N$(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return au(e,t),t}function _$(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ya);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&v$.call(e.properties,a)){const d=A$(r,a,e.properties[a]);d&&i.push(d)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:eo[l],childNodes:[],parentNode:null};return c.childNodes=ny(e.children,c,r),au(e,c),e.tagName==="template"&&e.content&&(c.content=C$(e.content,r)),c}function A$(e,t,n){const r=Vm(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?VA(n):qA(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=eo[r.space]}return i}function ny(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=WA(e[r],n);a.parentNode=t,i.push(a)}return i}function au(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 R$=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],O$=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]),hn="�";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 Nr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function QA(e){return e>=55296&&e<=57343}function I$(e){return e>=56320&&e<=57343}function M$(e,t){return(e-55296)*1024+9216+t}function ZA(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function JA(e){return e>=64976&&e<=65007||O$.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 L$=65536;class D${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=L$,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:i,offset:a}=this,l=i+n,c=a+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:c,endOffset:c}}_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(I$(n))return this.pos++,this._addGap(),M$(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,QA(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){ZA(t)?this._err(we.controlCharacterInInputStream):JA(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 eR(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 j$=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))),P$=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 B$(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=P$.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 z$=32;var sa;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(sa||(sa={}));function d1(e){return e>=Yn.ZERO&&e<=Yn.NINE}function H$(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_F||e>=Yn.LOWER_A&&e<=Yn.LOWER_F}function U$(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_Z||e>=Yn.LOWER_A&&e<=Yn.LOWER_Z||d1(e)}function F$(e){return e===Yn.EQUALS||U$(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 ui;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ui||(ui={}));class $${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=ui.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)|z$)===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,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+Number.parseInt(t.substr(n,a),i),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(d1(i)||H$(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(d1(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,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===ui.Strict)return 0;return this.emitCodePoint(B$(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 i=r[this.treeIndex],a=(i&sa.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=V$(r,i,this.treeIndex+Math.max(1,a),l),this.treeIndex<0)return this.result===0||this.decodeMode===ui.Attribute&&(a===0||F$(l))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&sa.VALUE_LENGTH)>>14,a!==0){if(l===Yn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==ui.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&sa.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~sa.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case $n.NamedEntity:return this.result!==0&&(this.decodeMode!==ui.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 V$(e,t,n,r){const i=(t&sa.BRANCH_LENGTH)>>7,a=t&sa.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=i?-1:e[n+d]-1}let l=n,c=l+i-1;for(;l<=c;){const d=l+c>>>1,f=e[d];if(f<r)l=d+1;else if(f>r)c=d-1;else return e[d+i]}return-1}var Me;(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/"})(Me||(Me={}));var io;(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"})(io||(io={}));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 C;(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"})(C||(C={}));const q$=new Map([[pe.A,C.A],[pe.ADDRESS,C.ADDRESS],[pe.ANNOTATION_XML,C.ANNOTATION_XML],[pe.APPLET,C.APPLET],[pe.AREA,C.AREA],[pe.ARTICLE,C.ARTICLE],[pe.ASIDE,C.ASIDE],[pe.B,C.B],[pe.BASE,C.BASE],[pe.BASEFONT,C.BASEFONT],[pe.BGSOUND,C.BGSOUND],[pe.BIG,C.BIG],[pe.BLOCKQUOTE,C.BLOCKQUOTE],[pe.BODY,C.BODY],[pe.BR,C.BR],[pe.BUTTON,C.BUTTON],[pe.CAPTION,C.CAPTION],[pe.CENTER,C.CENTER],[pe.CODE,C.CODE],[pe.COL,C.COL],[pe.COLGROUP,C.COLGROUP],[pe.DD,C.DD],[pe.DESC,C.DESC],[pe.DETAILS,C.DETAILS],[pe.DIALOG,C.DIALOG],[pe.DIR,C.DIR],[pe.DIV,C.DIV],[pe.DL,C.DL],[pe.DT,C.DT],[pe.EM,C.EM],[pe.EMBED,C.EMBED],[pe.FIELDSET,C.FIELDSET],[pe.FIGCAPTION,C.FIGCAPTION],[pe.FIGURE,C.FIGURE],[pe.FONT,C.FONT],[pe.FOOTER,C.FOOTER],[pe.FOREIGN_OBJECT,C.FOREIGN_OBJECT],[pe.FORM,C.FORM],[pe.FRAME,C.FRAME],[pe.FRAMESET,C.FRAMESET],[pe.H1,C.H1],[pe.H2,C.H2],[pe.H3,C.H3],[pe.H4,C.H4],[pe.H5,C.H5],[pe.H6,C.H6],[pe.HEAD,C.HEAD],[pe.HEADER,C.HEADER],[pe.HGROUP,C.HGROUP],[pe.HR,C.HR],[pe.HTML,C.HTML],[pe.I,C.I],[pe.IMG,C.IMG],[pe.IMAGE,C.IMAGE],[pe.INPUT,C.INPUT],[pe.IFRAME,C.IFRAME],[pe.KEYGEN,C.KEYGEN],[pe.LABEL,C.LABEL],[pe.LI,C.LI],[pe.LINK,C.LINK],[pe.LISTING,C.LISTING],[pe.MAIN,C.MAIN],[pe.MALIGNMARK,C.MALIGNMARK],[pe.MARQUEE,C.MARQUEE],[pe.MATH,C.MATH],[pe.MENU,C.MENU],[pe.META,C.META],[pe.MGLYPH,C.MGLYPH],[pe.MI,C.MI],[pe.MO,C.MO],[pe.MN,C.MN],[pe.MS,C.MS],[pe.MTEXT,C.MTEXT],[pe.NAV,C.NAV],[pe.NOBR,C.NOBR],[pe.NOFRAMES,C.NOFRAMES],[pe.NOEMBED,C.NOEMBED],[pe.NOSCRIPT,C.NOSCRIPT],[pe.OBJECT,C.OBJECT],[pe.OL,C.OL],[pe.OPTGROUP,C.OPTGROUP],[pe.OPTION,C.OPTION],[pe.P,C.P],[pe.PARAM,C.PARAM],[pe.PLAINTEXT,C.PLAINTEXT],[pe.PRE,C.PRE],[pe.RB,C.RB],[pe.RP,C.RP],[pe.RT,C.RT],[pe.RTC,C.RTC],[pe.RUBY,C.RUBY],[pe.S,C.S],[pe.SCRIPT,C.SCRIPT],[pe.SEARCH,C.SEARCH],[pe.SECTION,C.SECTION],[pe.SELECT,C.SELECT],[pe.SOURCE,C.SOURCE],[pe.SMALL,C.SMALL],[pe.SPAN,C.SPAN],[pe.STRIKE,C.STRIKE],[pe.STRONG,C.STRONG],[pe.STYLE,C.STYLE],[pe.SUB,C.SUB],[pe.SUMMARY,C.SUMMARY],[pe.SUP,C.SUP],[pe.TABLE,C.TABLE],[pe.TBODY,C.TBODY],[pe.TEMPLATE,C.TEMPLATE],[pe.TEXTAREA,C.TEXTAREA],[pe.TFOOT,C.TFOOT],[pe.TD,C.TD],[pe.TH,C.TH],[pe.THEAD,C.THEAD],[pe.TITLE,C.TITLE],[pe.TR,C.TR],[pe.TRACK,C.TRACK],[pe.TT,C.TT],[pe.U,C.U],[pe.UL,C.UL],[pe.SVG,C.SVG],[pe.VAR,C.VAR],[pe.WBR,C.WBR],[pe.XMP,C.XMP]]);function ou(e){var t;return(t=q$.get(e))!==null&&t!==void 0?t:C.UNKNOWN}const Pe=C,Y$={[Me.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]),[Me.MATHML]:new Set([Pe.MI,Pe.MO,Pe.MN,Pe.MS,Pe.MTEXT,Pe.ANNOTATION_XML]),[Me.SVG]:new Set([Pe.TITLE,Pe.FOREIGN_OBJECT,Pe.DESC]),[Me.XLINK]:new Set,[Me.XML]:new Set,[Me.XMLNS]:new Set},f1=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 J;(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"})(J||(J={}));const kn={DATA:J.DATA,RCDATA:J.RCDATA,RAWTEXT:J.RAWTEXT,SCRIPT_DATA:J.SCRIPT_DATA,PLAINTEXT:J.PLAINTEXT,CDATA_SECTION:J.CDATA_SECTION};function G$(e){return e>=Y.DIGIT_0&&e<=Y.DIGIT_9}function wc(e){return e>=Y.LATIN_CAPITAL_A&&e<=Y.LATIN_CAPITAL_Z}function K$(e){return e>=Y.LATIN_SMALL_A&&e<=Y.LATIN_SMALL_Z}function Qi(e){return K$(e)||wc(e)}function WC(e){return Qi(e)||G$(e)}function ah(e){return e+32}function tR(e){return e===Y.SPACE||e===Y.LINE_FEED||e===Y.TABULATION||e===Y.FORM_FEED}function QC(e){return tR(e)||e===Y.SOLIDUS||e===Y.GREATER_THAN_SIGN}function X$(e){return e===Y.NULL?we.nullCharacterReference:e>1114111?we.characterReferenceOutsideUnicodeRange:QA(e)?we.surrogateCharacterReference:JA(e)?we.noncharacterCharacterReference:ZA(e)||e===Y.CARRIAGE_RETURN?we.controlCharacterReference:null}class W${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=J.DATA,this.returnState=J.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new D$(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new $$(j$,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-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 i=X$(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.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:C.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ct.END_TAG,tagName:"",tagID:C.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(eR(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[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=ou(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=tR(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=J.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ui.Attribute:ui.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===J.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===J.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===J.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case J.DATA:{this._stateData(t);break}case J.RCDATA:{this._stateRcdata(t);break}case J.RAWTEXT:{this._stateRawtext(t);break}case J.SCRIPT_DATA:{this._stateScriptData(t);break}case J.PLAINTEXT:{this._statePlaintext(t);break}case J.TAG_OPEN:{this._stateTagOpen(t);break}case J.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case J.TAG_NAME:{this._stateTagName(t);break}case J.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case J.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case J.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case J.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case J.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case J.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case J.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case J.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case J.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case J.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case J.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case J.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case J.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case J.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case J.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case J.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case J.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case J.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case J.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case J.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case J.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case J.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case J.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case J.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case J.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case J.BOGUS_COMMENT:{this._stateBogusComment(t);break}case J.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case J.COMMENT_START:{this._stateCommentStart(t);break}case J.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case J.COMMENT:{this._stateComment(t);break}case J.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case J.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case J.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case J.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case J.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case J.COMMENT_END:{this._stateCommentEnd(t);break}case J.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case J.DOCTYPE:{this._stateDoctype(t);break}case J.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case J.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case J.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case J.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case J.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case J.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case J.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case J.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case J.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case J.CDATA_SECTION:{this._stateCdataSection(t);break}case J.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case J.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case J.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case J.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=J.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=J.RCDATA_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=J.RAWTEXT_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case Y.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(hn);break}case Y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Qi(t))this._createStartTagToken(),this.state=J.TAG_NAME,this._stateTagName(t);else switch(t){case Y.EXCLAMATION_MARK:{this.state=J.MARKUP_DECLARATION_OPEN;break}case Y.SOLIDUS:{this.state=J.END_TAG_OPEN;break}case Y.QUESTION_MARK:{this._err(we.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=J.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=J.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Qi(t))this._createEndTagToken(),this.state=J.TAG_NAME,this._stateTagName(t);else switch(t){case Y.GREATER_THAN_SIGN:{this._err(we.missingEndTagName),this.state=J.DATA;break}case Y.EOF:{this._err(we.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(we.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=J.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=J.BEFORE_ATTRIBUTE_NAME;break}case Y.SOLIDUS:{this.state=J.SELF_CLOSING_START_TAG;break}case Y.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentTagToken();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.tagName+=hn;break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(wc(t)?ah(t):t)}}_stateRcdataLessThanSign(t){t===Y.SOLIDUS?this.state=J.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=J.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Qi(t)?(this.state=J.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=J.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=J.BEFORE_ATTRIBUTE_NAME,!1;case Y.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=J.SELF_CLOSING_START_TAG,!1;case Y.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=J.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=J.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===Y.SOLIDUS?this.state=J.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=J.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Qi(t)?(this.state=J.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=J.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=J.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case Y.SOLIDUS:{this.state=J.SCRIPT_DATA_END_TAG_OPEN;break}case Y.EXCLAMATION_MARK:{this.state=J.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=J.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Qi(t)?(this.state=J.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=J.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=J.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===Y.HYPHEN_MINUS?(this.state=J.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=J.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===Y.HYPHEN_MINUS?(this.state=J.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=J.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case Y.HYPHEN_MINUS:{this.state=J.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(hn);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=J.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_ESCAPED,this._emitChars(hn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=J.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case Y.HYPHEN_MINUS:{this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Y.GREATER_THAN_SIGN:{this.state=J.SCRIPT_DATA,this._emitChars(">");break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_ESCAPED,this._emitChars(hn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=J.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===Y.SOLIDUS?this.state=J.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Qi(t)?(this._emitChars("<"),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Qi(t)?(this.state=J.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Nr.SCRIPT,!1)&&QC(this.preprocessor.peek(Nr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Nr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case Y.HYPHEN_MINUS:{this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(hn);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=J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case Y.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(hn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=J.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=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Y.GREATER_THAN_SIGN:{this.state=J.SCRIPT_DATA,this._emitChars(">");break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(hn);break}case Y.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===Y.SOLIDUS?(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Nr.SCRIPT,!1)&&QC(this.preprocessor.peek(Nr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Nr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=J.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=J.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=J.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case Y.EQUALS_SIGN:{this._err(we.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=J.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=J.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=J.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case Y.EQUALS_SIGN:{this._leaveAttrName(),this.state=J.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+=hn;break}default:this.currentAttr.name+=String.fromCodePoint(wc(t)?ah(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=J.SELF_CLOSING_START_TAG;break}case Y.EQUALS_SIGN:{this.state=J.BEFORE_ATTRIBUTE_VALUE;break}case Y.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=J.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=J.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this.state=J.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingAttributeValue),this.state=J.DATA,this.emitCurrentTagToken();break}default:this.state=J.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case Y.QUOTATION_MARK:{this.state=J.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=hn;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=J.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=hn;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=J.BEFORE_ATTRIBUTE_NAME;break}case Y.AMPERSAND:{this._startCharacterReference();break}case Y.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=J.DATA,this.emitCurrentTagToken();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=hn;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=J.BEFORE_ATTRIBUTE_NAME;break}case Y.SOLIDUS:{this._leaveAttrValue(),this.state=J.SELF_CLOSING_START_TAG;break}case Y.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=J.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._err(we.missingWhitespaceBetweenAttributes),this.state=J.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case Y.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=J.DATA,this.emitCurrentTagToken();break}case Y.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._err(we.unexpectedSolidusInTag),this.state=J.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.data+=hn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Nr.DASH_DASH,!0)?(this._createCommentToken(Nr.DASH_DASH.length+1),this.state=J.COMMENT_START):this._consumeSequenceIfMatch(Nr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Nr.DOCTYPE.length+1),this.state=J.DOCTYPE):this._consumeSequenceIfMatch(Nr.CDATA_START,!0)?this.inForeignNode?this.state=J.CDATA_SECTION:(this._err(we.cdataInHtmlContent),this._createCommentToken(Nr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=J.BOGUS_COMMENT):this._ensureHibernation()||(this._err(we.incorrectlyOpenedComment),this._createCommentToken(2),this.state=J.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case Y.HYPHEN_MINUS:{this.state=J.COMMENT_START_DASH;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptClosingOfEmptyComment),this.state=J.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=J.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=J.COMMENT_END;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptClosingOfEmptyComment),this.state=J.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=J.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=J.COMMENT_END_DASH;break}case Y.LESS_THAN_SIGN:{n.data+="<",this.state=J.COMMENT_LESS_THAN_SIGN;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.data+=hn;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=J.COMMENT_LESS_THAN_SIGN_BANG;break}case Y.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=J.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===Y.HYPHEN_MINUS?this.state=J.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=J.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===Y.HYPHEN_MINUS?this.state=J.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=J.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==Y.GREATER_THAN_SIGN&&t!==Y.EOF&&this._err(we.nestedComment),this.state=J.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{this.state=J.COMMENT_END;break}case Y.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=J.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentComment(n);break}case Y.EXCLAMATION_MARK:{this.state=J.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=J.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case Y.HYPHEN_MINUS:{n.data+="--!",this.state=J.COMMENT_END_DASH;break}case Y.GREATER_THAN_SIGN:{this._err(we.incorrectlyClosedComment),this.state=J.DATA,this.emitCurrentComment(n);break}case Y.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=J.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case Y.SPACE:case Y.LINE_FEED:case Y.TABULATION:case Y.FORM_FEED:{this.state=J.BEFORE_DOCTYPE_NAME;break}case Y.GREATER_THAN_SIGN:{this.state=J.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=J.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(wc(t))this._createDoctypeToken(String.fromCharCode(ah(t))),this.state=J.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(hn),this.state=J.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=J.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=J.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=J.AFTER_DOCTYPE_NAME;break}case Y.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentDoctype(n);break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.name+=hn;break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(wc(t)?ah(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=J.DATA,this.emitCurrentDoctype(n);break}case Y.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Nr.PUBLIC,!1)?this.state=J.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Nr.SYSTEM,!1)?this.state=J.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(we.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=J.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=J.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.QUOTATION_MARK:{this._err(we.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(we.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=J.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=J.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=J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.publicId="",this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=J.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=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case Y.QUOTATION_MARK:{this.state=J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.publicId+=hn;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.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=J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.publicId+=hn;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.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=J.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case Y.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentDoctype(n);break}case Y.QUOTATION_MARK:{this._err(we.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(we.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=J.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=J.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=J.DATA;break}case Y.QUOTATION_MARK:{n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.systemId="",this.state=J.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=J.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=J.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.QUOTATION_MARK:{this._err(we.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{this._err(we.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=J.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=J.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=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Y.APOSTROPHE:{n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Y.GREATER_THAN_SIGN:{this._err(we.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=J.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=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case Y.QUOTATION_MARK:{this.state=J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.systemId+=hn;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.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=J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Y.NULL:{this._err(we.unexpectedNullCharacter),n.systemId+=hn;break}case Y.GREATER_THAN_SIGN:{this._err(we.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.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=J.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=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case Y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=J.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=J.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=J.CDATA_SECTION_END:(this._emitChars("]"),this.state=J.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case Y.GREATER_THAN_SIGN:{this.state=J.DATA;break}case Y.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=J.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()&&WC(this.preprocessor.peek(1))?J.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){WC(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===Y.SEMICOLON&&this._err(we.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const nR=new Set([C.DD,C.DT,C.LI,C.OPTGROUP,C.OPTION,C.P,C.RB,C.RP,C.RT,C.RTC]),ZC=new Set([...nR,C.CAPTION,C.COLGROUP,C.TBODY,C.TD,C.TFOOT,C.TH,C.THEAD,C.TR]),Jh=new Set([C.APPLET,C.CAPTION,C.HTML,C.MARQUEE,C.OBJECT,C.TABLE,C.TD,C.TEMPLATE,C.TH]),Q$=new Set([...Jh,C.OL,C.UL]),Z$=new Set([...Jh,C.BUTTON]),JC=new Set([C.ANNOTATION_XML,C.MI,C.MN,C.MO,C.MS,C.MTEXT]),ew=new Set([C.DESC,C.FOREIGN_OBJECT,C.TITLE]),J$=new Set([C.TR,C.TEMPLATE,C.HTML]),eV=new Set([C.TBODY,C.TFOOT,C.THEAD,C.TEMPLATE,C.HTML]),tV=new Set([C.TABLE,C.TEMPLATE,C.HTML]),nV=new Set([C.TD,C.TH]);class rV{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=C.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===C.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Me.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 i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===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])!==Me.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(f1,Me.HTML)}popUntilTableCellPopped(){this.popUntilPopped(nV,Me.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(tV,Me.HTML)}clearBackToTableBodyContext(){this.clearBackTo(eV,Me.HTML)}clearBackToTableRowContext(){this.clearBackTo(J$,Me.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]===C.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]===C.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Me.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case Me.SVG:{if(ew.has(i))return!1;break}case Me.MATHML:{if(JC.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Jh)}hasInListItemScope(t){return this.hasInDynamicScope(t,Q$)}hasInButtonScope(t){return this.hasInDynamicScope(t,Z$)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Me.HTML:{if(f1.has(n))return!0;if(Jh.has(n))return!1;break}case Me.SVG:{if(ew.has(n))return!1;break}case Me.MATHML:{if(JC.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Me.HTML)switch(this.tagIDs[n]){case t:return!0;case C.TABLE:case C.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Me.HTML)switch(this.tagIDs[t]){case C.TBODY:case C.THEAD:case C.TFOOT:return!0;case C.TABLE:case C.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Me.HTML)switch(this.tagIDs[n]){case t:return!0;case C.OPTION:case C.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&nR.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&ZC.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&ZC.has(this.currentTagId);)this.pop()}}const Q0=3;var Os;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Os||(Os={}));const tw={type:Os.Marker};class sV{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===Os.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===l){const g=this.treeAdapter.getAttrList(f);g.length===i&&r.push({idx:c,attrs:g})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Q0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Q0)return;const i=new Map(n.map(l=>[l.name,l.value]));let a=0;for(let l=0;l<r.length;l++){const c=r[l];c.attrs.every(d=>i.get(d.name)===d.value)&&(a+=1,a>=Q0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(tw)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Os.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Os.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(tw);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Os.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Os.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Os.Element&&n.element===t)}}const Zi={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 i=e.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Zi.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(Zi.isTextNode(n)){n.value+=t;return}}Zi.appendChild(e,Zi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Zi.isTextNode(r)?r.value+=t:Zi.insertBefore(e,Zi.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}}},rR="html",iV="about:legacy-compat",aV="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",sR=["+//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//"],oV=[...sR,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],lV=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),iR=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],uV=[...iR,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function nw(e,t){return t.some(n=>e.startsWith(n))}function cV(e){return e.name===rR&&e.publicId===null&&(e.systemId===null||e.systemId===iV)}function dV(e){if(e.name!==rR)return is.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===aV)return is.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),lV.has(n))return is.QUIRKS;let r=t===null?oV:sR;if(nw(n,r))return is.QUIRKS;if(r=t===null?iR:uV,nw(n,r))return is.LIMITED_QUIRKS}return is.NO_QUIRKS}const rw={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},fV="definitionurl",hV="definitionURL",mV=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])),pV=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Me.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Me.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Me.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Me.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Me.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Me.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Me.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Me.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Me.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Me.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Me.XMLNS}]]),gV=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])),bV=new Set([C.B,C.BIG,C.BLOCKQUOTE,C.BODY,C.BR,C.CENTER,C.CODE,C.DD,C.DIV,C.DL,C.DT,C.EM,C.EMBED,C.H1,C.H2,C.H3,C.H4,C.H5,C.H6,C.HEAD,C.HR,C.I,C.IMG,C.LI,C.LISTING,C.MENU,C.META,C.NOBR,C.OL,C.P,C.PRE,C.RUBY,C.S,C.SMALL,C.SPAN,C.STRONG,C.STRIKE,C.SUB,C.SUP,C.TABLE,C.TT,C.U,C.UL,C.VAR]);function xV(e){const t=e.tagID;return t===C.FONT&&e.attrs.some(({name:r})=>r===io.COLOR||r===io.SIZE||r===io.FACE)||bV.has(t)}function aR(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===fV){e.attrs[t].name=hV;break}}function oR(e){for(let t=0;t<e.attrs.length;t++){const n=mV.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function ry(e){for(let t=0;t<e.attrs.length;t++){const n=pV.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 yV(e){const t=gV.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=ou(e.tagName))}function EV(e,t){return t===Me.MATHML&&(e===C.MI||e===C.MO||e===C.MN||e===C.MS||e===C.MTEXT)}function vV(e,t,n){if(t===Me.MATHML&&e===C.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===io.ENCODING){const i=n[r].value.toLowerCase();return i===rw.TEXT_HTML||i===rw.APPLICATION_XML}}return t===Me.SVG&&(e===C.FOREIGN_OBJECT||e===C.DESC||e===C.TITLE)}function TV(e,t,n,r){return(!r||r===Me.HTML)&&vV(e,t,n)||(!r||r===Me.MATHML)&&EV(e,t)}const SV="hidden",CV=8,wV=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 kV={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},lR=new Set([C.TABLE,C.TBODY,C.TFOOT,C.THEAD,C.TR]),sw={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Zi,onParseError:null};class iw{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,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={...sw,...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 W$(this.options,this),this.activeFormattingElements=new sV(this.treeAdapter),this.fragmentContextID=r?ou(this.treeAdapter.getTagName(r)):C.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new rV(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={...sw,...n};t??(t=r.treeAdapter.createElement(pe.TEMPLATE,Me.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Me.HTML,[]),a=new this(r,i,t);return a.fragmentContextID===C.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 i;if(!this.onParseError)return;const a=(i=t.location)!==null&&i!==void 0?i:kV,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 i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.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)===Me.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Me.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=kn.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)!==Me.HTML))switch(this.fragmentContextID){case C.TITLE:case C.TEXTAREA:{this.tokenizer.state=kn.RCDATA;break}case C.STYLE:case C.XMP:case C.IFRAME:case C.NOEMBED:case C.NOFRAMES:case C.NOSCRIPT:{this.tokenizer.state=kn.RAWTEXT;break}case C.SCRIPT:{this.tokenizer.state=kn.SCRIPT_DATA;break}case C.PLAINTEXT:{this.tokenizer.state=kn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));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,Me.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Me.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,Me.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,C.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 i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,l=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:f,endOffset:g}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:f,endOffset:g})}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,i=this.treeAdapter.getTagName(t),a=n.type===Ct.END_TAG&&i===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===C.SVG&&this.treeAdapter.getTagName(n)===pe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Me.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===C.MGLYPH||t.tagID===C.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Me.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 i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return TV(t,i,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Os.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];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(C.P),this.openElements.popUntilTagNamePopped(C.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case C.TR:{this.insertionMode=ne.IN_ROW;return}case C.TBODY:case C.THEAD:case C.TFOOT:{this.insertionMode=ne.IN_TABLE_BODY;return}case C.CAPTION:{this.insertionMode=ne.IN_CAPTION;return}case C.COLGROUP:{this.insertionMode=ne.IN_COLUMN_GROUP;return}case C.TABLE:{this.insertionMode=ne.IN_TABLE;return}case C.BODY:{this.insertionMode=ne.IN_BODY;return}case C.FRAMESET:{this.insertionMode=ne.IN_FRAMESET;return}case C.SELECT:{this._resetInsertionModeForSelect(t);return}case C.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case C.HTML:{this.insertionMode=this.headElement?ne.AFTER_HEAD:ne.BEFORE_HEAD;return}case C.TD:case C.TH:{if(t>0){this.insertionMode=ne.IN_CELL;return}break}case C.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===C.TEMPLATE)break;if(r===C.TABLE){this.insertionMode=ne.IN_SELECT_IN_TABLE;return}}this.insertionMode=ne.IN_SELECT}_isElementCausesFosterParenting(t){return lR.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 C.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Me.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case C.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 Y$[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){nY(this,t);return}switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{Mc(this,t);break}case ne.BEFORE_HEAD:{Lc(this,t);break}case ne.IN_HEAD:{Dc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{jc(this,t);break}case ne.AFTER_HEAD:{Pc(this,t);break}case ne.IN_BODY:case ne.IN_CAPTION:case ne.IN_CELL:case ne.IN_TEMPLATE:{cR(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:{Z0(this,t);break}case ne.IN_TABLE_TEXT:{gR(this,t);break}case ne.IN_COLUMN_GROUP:{em(this,t);break}case ne.AFTER_BODY:{tm(this,t);break}case ne.AFTER_AFTER_BODY:{kh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){tY(this,t);return}switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{Mc(this,t);break}case ne.BEFORE_HEAD:{Lc(this,t);break}case ne.IN_HEAD:{Dc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{jc(this,t);break}case ne.AFTER_HEAD:{Pc(this,t);break}case ne.TEXT:{this._insertCharacters(t);break}case ne.IN_TABLE:case ne.IN_TABLE_BODY:case ne.IN_ROW:{Z0(this,t);break}case ne.IN_COLUMN_GROUP:{em(this,t);break}case ne.AFTER_BODY:{tm(this,t);break}case ne.AFTER_AFTER_BODY:{kh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){h1(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:{h1(this,t);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}case ne.AFTER_BODY:{MV(this,t);break}case ne.AFTER_AFTER_BODY:case ne.AFTER_AFTER_FRAMESET:{LV(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case ne.INITIAL:{DV(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:{dc(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)?rY(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{jV(this,t);break}case ne.BEFORE_HEAD:{BV(this,t);break}case ne.IN_HEAD:{bs(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{UV(this,t);break}case ne.AFTER_HEAD:{$V(this,t);break}case ne.IN_BODY:{ur(this,t);break}case ne.IN_TABLE:{Gl(this,t);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}case ne.IN_CAPTION:{zq(this,t);break}case ne.IN_COLUMN_GROUP:{ay(this,t);break}case ne.IN_TABLE_BODY:{Gm(this,t);break}case ne.IN_ROW:{Km(this,t);break}case ne.IN_CELL:{Fq(this,t);break}case ne.IN_SELECT:{yR(this,t);break}case ne.IN_SELECT_IN_TABLE:{Vq(this,t);break}case ne.IN_TEMPLATE:{Yq(this,t);break}case ne.AFTER_BODY:{Kq(this,t);break}case ne.IN_FRAMESET:{Xq(this,t);break}case ne.AFTER_FRAMESET:{Qq(this,t);break}case ne.AFTER_AFTER_BODY:{Jq(this,t);break}case ne.AFTER_AFTER_FRAMESET:{eY(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?sY(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{PV(this,t);break}case ne.BEFORE_HEAD:{zV(this,t);break}case ne.IN_HEAD:{HV(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{FV(this,t);break}case ne.AFTER_HEAD:{VV(this,t);break}case ne.IN_BODY:{Ym(this,t);break}case ne.TEXT:{Aq(this,t);break}case ne.IN_TABLE:{ed(this,t);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}case ne.IN_CAPTION:{Hq(this,t);break}case ne.IN_COLUMN_GROUP:{Uq(this,t);break}case ne.IN_TABLE_BODY:{m1(this,t);break}case ne.IN_ROW:{xR(this,t);break}case ne.IN_CELL:{$q(this,t);break}case ne.IN_SELECT:{ER(this,t);break}case ne.IN_SELECT_IN_TABLE:{qq(this,t);break}case ne.IN_TEMPLATE:{Gq(this,t);break}case ne.AFTER_BODY:{TR(this,t);break}case ne.IN_FRAMESET:{Wq(this,t);break}case ne.AFTER_FRAMESET:{Zq(this,t);break}case ne.AFTER_AFTER_BODY:{kh(this,t);break}}}onEof(t){switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{Mc(this,t);break}case ne.BEFORE_HEAD:{Lc(this,t);break}case ne.IN_HEAD:{Dc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{jc(this,t);break}case ne.AFTER_HEAD:{Pc(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:{mR(this,t);break}case ne.TEXT:{Rq(this,t);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}case ne.IN_TEMPLATE:{vR(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:{iy(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:{uR(this,t);break}case ne.IN_TABLE:case ne.IN_TABLE_BODY:case ne.IN_ROW:{Z0(this,t);break}case ne.IN_TABLE_TEXT:{pR(this,t);break}}}}function NV(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):hR(e,t),n}function _V(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function AV(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,l=i;l!==n;a++,l=i){i=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),d=c&&a>=wV;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=RV(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function RV(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 OV(e,t,n){const r=e.treeAdapter.getTagName(t),i=ou(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);i===C.TEMPLATE&&a===Me.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function IV(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function sy(e,t){for(let n=0;n<CV;n++){const r=NV(e,t);if(!r)break;const i=_V(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=AV(e,i,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),l&&OV(e,l,a),IV(e,i,r)}}function h1(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function MV(e,t){e._appendCommentNode(t,e.openElements.items[0])}function LV(e,t){e._appendCommentNode(t,e.document)}function iy(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],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.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 DV(e,t){e._setDocumentType(t);const n=t.forceQuirks?is.QUIRKS:dV(t);cV(t)||e._err(t,we.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=ne.BEFORE_HTML}function cc(e,t){e._err(t,we.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,is.QUIRKS),e.insertionMode=ne.BEFORE_HTML,e._processToken(t)}function jV(e,t){t.tagID===C.HTML?(e._insertElement(t,Me.HTML),e.insertionMode=ne.BEFORE_HEAD):Mc(e,t)}function PV(e,t){const n=t.tagID;(n===C.HTML||n===C.HEAD||n===C.BODY||n===C.BR)&&Mc(e,t)}function Mc(e,t){e._insertFakeRootElement(),e.insertionMode=ne.BEFORE_HEAD,e._processToken(t)}function BV(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.HEAD:{e._insertElement(t,Me.HTML),e.headElement=e.openElements.current,e.insertionMode=ne.IN_HEAD;break}default:Lc(e,t)}}function zV(e,t){const n=t.tagID;n===C.HEAD||n===C.BODY||n===C.HTML||n===C.BR?Lc(e,t):e._err(t,we.endTagWithoutMatchingOpenElement)}function Lc(e,t){e._insertFakeElement(pe.HEAD,C.HEAD),e.headElement=e.openElements.current,e.insertionMode=ne.IN_HEAD,e._processToken(t)}function bs(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case C.TITLE:{e._switchToTextParsing(t,kn.RCDATA);break}case C.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,kn.RAWTEXT):(e._insertElement(t,Me.HTML),e.insertionMode=ne.IN_HEAD_NO_SCRIPT);break}case C.NOFRAMES:case C.STYLE:{e._switchToTextParsing(t,kn.RAWTEXT);break}case C.SCRIPT:{e._switchToTextParsing(t,kn.SCRIPT_DATA);break}case C.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=ne.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(ne.IN_TEMPLATE);break}case C.HEAD:{e._err(t,we.misplacedStartTagForHeadElement);break}default:Dc(e,t)}}function HV(e,t){switch(t.tagID){case C.HEAD:{e.openElements.pop(),e.insertionMode=ne.AFTER_HEAD;break}case C.BODY:case C.BR:case C.HTML:{Dc(e,t);break}case C.TEMPLATE:{Oo(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function Oo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==C.TEMPLATE&&e._err(t,we.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(C.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,we.endTagWithoutMatchingOpenElement)}function Dc(e,t){e.openElements.pop(),e.insertionMode=ne.AFTER_HEAD,e._processToken(t)}function UV(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.BASEFONT:case C.BGSOUND:case C.HEAD:case C.LINK:case C.META:case C.NOFRAMES:case C.STYLE:{bs(e,t);break}case C.NOSCRIPT:{e._err(t,we.nestedNoscriptInHead);break}default:jc(e,t)}}function FV(e,t){switch(t.tagID){case C.NOSCRIPT:{e.openElements.pop(),e.insertionMode=ne.IN_HEAD;break}case C.BR:{jc(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function jc(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 $V(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.BODY:{e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=ne.IN_BODY;break}case C.FRAMESET:{e._insertElement(t,Me.HTML),e.insertionMode=ne.IN_FRAMESET;break}case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:case C.NOFRAMES:case C.SCRIPT:case C.STYLE:case C.TEMPLATE:case C.TITLE:{e._err(t,we.abandonedHeadElementChild),e.openElements.push(e.headElement,C.HEAD),bs(e,t),e.openElements.remove(e.headElement);break}case C.HEAD:{e._err(t,we.misplacedStartTagForHeadElement);break}default:Pc(e,t)}}function VV(e,t){switch(t.tagID){case C.BODY:case C.HTML:case C.BR:{Pc(e,t);break}case C.TEMPLATE:{Oo(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function Pc(e,t){e._insertFakeElement(pe.BODY,C.BODY),e.insertionMode=ne.IN_BODY,qm(e,t)}function qm(e,t){switch(t.type){case Ct.CHARACTER:{cR(e,t);break}case Ct.WHITESPACE_CHARACTER:{uR(e,t);break}case Ct.COMMENT:{h1(e,t);break}case Ct.START_TAG:{ur(e,t);break}case Ct.END_TAG:{Ym(e,t);break}case Ct.EOF:{mR(e,t);break}}}function uR(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function cR(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function qV(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function YV(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function GV(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Me.HTML),e.insertionMode=ne.IN_FRAMESET)}function KV(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML)}function XV(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&f1.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Me.HTML)}function WV(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function QV(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML),n||(e.formElement=e.openElements.current))}function ZV(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===C.LI&&i===C.LI||(n===C.DD||n===C.DT)&&(i===C.DD||i===C.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==C.ADDRESS&&i!==C.DIV&&i!==C.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML)}function JV(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.tokenizer.state=kn.PLAINTEXT}function eq(e,t){e.openElements.hasInScope(C.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(C.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.framesetOk=!1}function tq(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(pe.A);n&&(sy(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function nq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function rq(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(C.NOBR)&&(sy(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function sq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function iq(e,t){e.treeAdapter.getDocumentMode(e.document)!==is.QUIRKS&&e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=ne.IN_TABLE}function dR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function fR(e){const t=eR(e,io.TYPE);return t!=null&&t.toLowerCase()===SV}function aq(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Me.HTML),fR(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function oq(e,t){e._appendElement(t,Me.HTML),t.ackSelfClosing=!0}function lq(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._appendElement(t,Me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function uq(e,t){t.tagName=pe.IMG,t.tagID=C.IMG,dR(e,t)}function cq(e,t){e._insertElement(t,Me.HTML),e.skipNextNewLine=!0,e.tokenizer.state=kn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=ne.TEXT}function dq(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,kn.RAWTEXT)}function fq(e,t){e.framesetOk=!1,e._switchToTextParsing(t,kn.RAWTEXT)}function aw(e,t){e._switchToTextParsing(t,kn.RAWTEXT)}function hq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.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 mq(e,t){e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML)}function pq(e,t){e.openElements.hasInScope(C.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Me.HTML)}function gq(e,t){e.openElements.hasInScope(C.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(C.RTC),e._insertElement(t,Me.HTML)}function bq(e,t){e._reconstructActiveFormattingElements(),aR(t),ry(t),t.selfClosing?e._appendElement(t,Me.MATHML):e._insertElement(t,Me.MATHML),t.ackSelfClosing=!0}function xq(e,t){e._reconstructActiveFormattingElements(),oR(t),ry(t),t.selfClosing?e._appendElement(t,Me.SVG):e._insertElement(t,Me.SVG),t.ackSelfClosing=!0}function ow(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML)}function ur(e,t){switch(t.tagID){case C.I:case C.S:case C.B:case C.U:case C.EM:case C.TT:case C.BIG:case C.CODE:case C.FONT:case C.SMALL:case C.STRIKE:case C.STRONG:{nq(e,t);break}case C.A:{tq(e,t);break}case C.H1:case C.H2:case C.H3:case C.H4:case C.H5:case C.H6:{XV(e,t);break}case C.P:case C.DL:case C.OL:case C.UL:case C.DIV:case C.DIR:case C.NAV:case C.MAIN:case C.MENU:case C.ASIDE:case C.CENTER:case C.FIGURE:case C.FOOTER:case C.HEADER:case C.HGROUP:case C.DIALOG:case C.DETAILS:case C.ADDRESS:case C.ARTICLE:case C.SEARCH:case C.SECTION:case C.SUMMARY:case C.FIELDSET:case C.BLOCKQUOTE:case C.FIGCAPTION:{KV(e,t);break}case C.LI:case C.DD:case C.DT:{ZV(e,t);break}case C.BR:case C.IMG:case C.WBR:case C.AREA:case C.EMBED:case C.KEYGEN:{dR(e,t);break}case C.HR:{lq(e,t);break}case C.RB:case C.RTC:{pq(e,t);break}case C.RT:case C.RP:{gq(e,t);break}case C.PRE:case C.LISTING:{WV(e,t);break}case C.XMP:{dq(e,t);break}case C.SVG:{xq(e,t);break}case C.HTML:{qV(e,t);break}case C.BASE:case C.LINK:case C.META:case C.STYLE:case C.TITLE:case C.SCRIPT:case C.BGSOUND:case C.BASEFONT:case C.TEMPLATE:{bs(e,t);break}case C.BODY:{YV(e,t);break}case C.FORM:{QV(e,t);break}case C.NOBR:{rq(e,t);break}case C.MATH:{bq(e,t);break}case C.TABLE:{iq(e,t);break}case C.INPUT:{aq(e,t);break}case C.PARAM:case C.TRACK:case C.SOURCE:{oq(e,t);break}case C.IMAGE:{uq(e,t);break}case C.BUTTON:{eq(e,t);break}case C.APPLET:case C.OBJECT:case C.MARQUEE:{sq(e,t);break}case C.IFRAME:{fq(e,t);break}case C.SELECT:{hq(e,t);break}case C.OPTION:case C.OPTGROUP:{mq(e,t);break}case C.NOEMBED:case C.NOFRAMES:{aw(e,t);break}case C.FRAMESET:{GV(e,t);break}case C.TEXTAREA:{cq(e,t);break}case C.NOSCRIPT:{e.options.scriptingEnabled?aw(e,t):ow(e,t);break}case C.PLAINTEXT:{JV(e,t);break}case C.COL:case C.TH:case C.TD:case C.TR:case C.HEAD:case C.FRAME:case C.TBODY:case C.TFOOT:case C.THEAD:case C.CAPTION:case C.COLGROUP:break;default:ow(e,t)}}function yq(e,t){if(e.openElements.hasInScope(C.BODY)&&(e.insertionMode=ne.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Eq(e,t){e.openElements.hasInScope(C.BODY)&&(e.insertionMode=ne.AFTER_BODY,TR(e,t))}function vq(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Tq(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(C.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(C.FORM):n&&e.openElements.remove(n))}function Sq(e){e.openElements.hasInButtonScope(C.P)||e._insertFakeElement(pe.P,C.P),e._closePElement()}function Cq(e){e.openElements.hasInListItemScope(C.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(C.LI),e.openElements.popUntilTagNamePopped(C.LI))}function wq(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function kq(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Nq(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function _q(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(pe.BR,C.BR),e.openElements.pop(),e.framesetOk=!1}function hR(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],l=e.openElements.tagIDs[i];if(r===l&&(r!==C.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(a,l))break}}function Ym(e,t){switch(t.tagID){case C.A:case C.B:case C.I:case C.S:case C.U:case C.EM:case C.TT:case C.BIG:case C.CODE:case C.FONT:case C.NOBR:case C.SMALL:case C.STRIKE:case C.STRONG:{sy(e,t);break}case C.P:{Sq(e);break}case C.DL:case C.UL:case C.OL:case C.DIR:case C.DIV:case C.NAV:case C.PRE:case C.MAIN:case C.MENU:case C.ASIDE:case C.BUTTON:case C.CENTER:case C.FIGURE:case C.FOOTER:case C.HEADER:case C.HGROUP:case C.DIALOG:case C.ADDRESS:case C.ARTICLE:case C.DETAILS:case C.SEARCH:case C.SECTION:case C.SUMMARY:case C.LISTING:case C.FIELDSET:case C.BLOCKQUOTE:case C.FIGCAPTION:{vq(e,t);break}case C.LI:{Cq(e);break}case C.DD:case C.DT:{wq(e,t);break}case C.H1:case C.H2:case C.H3:case C.H4:case C.H5:case C.H6:{kq(e);break}case C.BR:{_q(e);break}case C.BODY:{yq(e,t);break}case C.HTML:{Eq(e,t);break}case C.FORM:{Tq(e);break}case C.APPLET:case C.OBJECT:case C.MARQUEE:{Nq(e,t);break}case C.TEMPLATE:{Oo(e,t);break}default:hR(e,t)}}function mR(e,t){e.tmplInsertionModeStack.length>0?vR(e,t):iy(e,t)}function Aq(e,t){var n;t.tagID===C.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Rq(e,t){e._err(t,we.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Z0(e,t){if(e.openElements.currentTagId!==void 0&&lR.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:{gR(e,t);break}case Ct.WHITESPACE_CHARACTER:{pR(e,t);break}}else md(e,t)}function Oq(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Me.HTML),e.insertionMode=ne.IN_CAPTION}function Iq(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Me.HTML),e.insertionMode=ne.IN_COLUMN_GROUP}function Mq(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.COLGROUP,C.COLGROUP),e.insertionMode=ne.IN_COLUMN_GROUP,ay(e,t)}function Lq(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Me.HTML),e.insertionMode=ne.IN_TABLE_BODY}function Dq(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.TBODY,C.TBODY),e.insertionMode=ne.IN_TABLE_BODY,Gm(e,t)}function jq(e,t){e.openElements.hasInTableScope(C.TABLE)&&(e.openElements.popUntilTagNamePopped(C.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Pq(e,t){fR(t)?e._appendElement(t,Me.HTML):md(e,t),t.ackSelfClosing=!0}function Bq(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Me.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Gl(e,t){switch(t.tagID){case C.TD:case C.TH:case C.TR:{Dq(e,t);break}case C.STYLE:case C.SCRIPT:case C.TEMPLATE:{bs(e,t);break}case C.COL:{Mq(e,t);break}case C.FORM:{Bq(e,t);break}case C.TABLE:{jq(e,t);break}case C.TBODY:case C.TFOOT:case C.THEAD:{Lq(e,t);break}case C.INPUT:{Pq(e,t);break}case C.CAPTION:{Oq(e,t);break}case C.COLGROUP:{Iq(e,t);break}default:md(e,t)}}function ed(e,t){switch(t.tagID){case C.TABLE:{e.openElements.hasInTableScope(C.TABLE)&&(e.openElements.popUntilTagNamePopped(C.TABLE),e._resetInsertionMode());break}case C.TEMPLATE:{Oo(e,t);break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:case C.TBODY:case C.TD:case C.TFOOT:case C.TH:case C.THEAD:case C.TR:break;default:md(e,t)}}function md(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,qm(e,t),e.fosterParentingEnabled=n}function pR(e,t){e.pendingCharacterTokens.push(t)}function gR(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function dc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)md(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const bR=new Set([C.CAPTION,C.COL,C.COLGROUP,C.TBODY,C.TD,C.TFOOT,C.TH,C.THEAD,C.TR]);function zq(e,t){const n=t.tagID;bR.has(n)?e.openElements.hasInTableScope(C.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(C.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_TABLE,Gl(e,t)):ur(e,t)}function Hq(e,t){const n=t.tagID;switch(n){case C.CAPTION:case C.TABLE:{e.openElements.hasInTableScope(C.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(C.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_TABLE,n===C.TABLE&&ed(e,t));break}case C.BODY:case C.COL:case C.COLGROUP:case C.HTML:case C.TBODY:case C.TD:case C.TFOOT:case C.TH:case C.THEAD:case C.TR:break;default:Ym(e,t)}}function ay(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.COL:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case C.TEMPLATE:{bs(e,t);break}default:em(e,t)}}function Uq(e,t){switch(t.tagID){case C.COLGROUP:{e.openElements.currentTagId===C.COLGROUP&&(e.openElements.pop(),e.insertionMode=ne.IN_TABLE);break}case C.TEMPLATE:{Oo(e,t);break}case C.COL:break;default:em(e,t)}}function em(e,t){e.openElements.currentTagId===C.COLGROUP&&(e.openElements.pop(),e.insertionMode=ne.IN_TABLE,e._processToken(t))}function Gm(e,t){switch(t.tagID){case C.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Me.HTML),e.insertionMode=ne.IN_ROW;break}case C.TH:case C.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(pe.TR,C.TR),e.insertionMode=ne.IN_ROW,Km(e,t);break}case C.CAPTION:case C.COL:case C.COLGROUP:case C.TBODY:case C.TFOOT:case C.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE,Gl(e,t));break}default:Gl(e,t)}}function m1(e,t){const n=t.tagID;switch(t.tagID){case C.TBODY:case C.TFOOT:case C.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE);break}case C.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE,ed(e,t));break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:case C.TD:case C.TH:case C.TR:break;default:ed(e,t)}}function Km(e,t){switch(t.tagID){case C.TH:case C.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Me.HTML),e.insertionMode=ne.IN_CELL,e.activeFormattingElements.insertMarker();break}case C.CAPTION:case C.COL:case C.COLGROUP:case C.TBODY:case C.TFOOT:case C.THEAD:case C.TR:{e.openElements.hasInTableScope(C.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,Gm(e,t));break}default:Gl(e,t)}}function xR(e,t){switch(t.tagID){case C.TR:{e.openElements.hasInTableScope(C.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY);break}case C.TABLE:{e.openElements.hasInTableScope(C.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,m1(e,t));break}case C.TBODY:case C.TFOOT:case C.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(C.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,m1(e,t));break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:case C.TD:case C.TH:break;default:ed(e,t)}}function Fq(e,t){const n=t.tagID;bR.has(n)?(e.openElements.hasInTableScope(C.TD)||e.openElements.hasInTableScope(C.TH))&&(e._closeTableCell(),Km(e,t)):ur(e,t)}function $q(e,t){const n=t.tagID;switch(n){case C.TD:case C.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_ROW);break}case C.TABLE:case C.TBODY:case C.TFOOT:case C.THEAD:case C.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),xR(e,t));break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:break;default:Ym(e,t)}}function yR(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.OPTION:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e._insertElement(t,Me.HTML);break}case C.OPTGROUP:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e.openElements.currentTagId===C.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Me.HTML);break}case C.HR:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e.openElements.currentTagId===C.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case C.INPUT:case C.KEYGEN:case C.TEXTAREA:case C.SELECT:{e.openElements.hasInSelectScope(C.SELECT)&&(e.openElements.popUntilTagNamePopped(C.SELECT),e._resetInsertionMode(),t.tagID!==C.SELECT&&e._processStartTag(t));break}case C.SCRIPT:case C.TEMPLATE:{bs(e,t);break}}}function ER(e,t){switch(t.tagID){case C.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===C.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===C.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===C.OPTGROUP&&e.openElements.pop();break}case C.OPTION:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop();break}case C.SELECT:{e.openElements.hasInSelectScope(C.SELECT)&&(e.openElements.popUntilTagNamePopped(C.SELECT),e._resetInsertionMode());break}case C.TEMPLATE:{Oo(e,t);break}}}function Vq(e,t){const n=t.tagID;n===C.CAPTION||n===C.TABLE||n===C.TBODY||n===C.TFOOT||n===C.THEAD||n===C.TR||n===C.TD||n===C.TH?(e.openElements.popUntilTagNamePopped(C.SELECT),e._resetInsertionMode(),e._processStartTag(t)):yR(e,t)}function qq(e,t){const n=t.tagID;n===C.CAPTION||n===C.TABLE||n===C.TBODY||n===C.TFOOT||n===C.THEAD||n===C.TR||n===C.TD||n===C.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(C.SELECT),e._resetInsertionMode(),e.onEndTag(t)):ER(e,t)}function Yq(e,t){switch(t.tagID){case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:case C.NOFRAMES:case C.SCRIPT:case C.STYLE:case C.TEMPLATE:case C.TITLE:{bs(e,t);break}case C.CAPTION:case C.COLGROUP:case C.TBODY:case C.TFOOT:case C.THEAD:{e.tmplInsertionModeStack[0]=ne.IN_TABLE,e.insertionMode=ne.IN_TABLE,Gl(e,t);break}case C.COL:{e.tmplInsertionModeStack[0]=ne.IN_COLUMN_GROUP,e.insertionMode=ne.IN_COLUMN_GROUP,ay(e,t);break}case C.TR:{e.tmplInsertionModeStack[0]=ne.IN_TABLE_BODY,e.insertionMode=ne.IN_TABLE_BODY,Gm(e,t);break}case C.TD:case C.TH:{e.tmplInsertionModeStack[0]=ne.IN_ROW,e.insertionMode=ne.IN_ROW,Km(e,t);break}default:e.tmplInsertionModeStack[0]=ne.IN_BODY,e.insertionMode=ne.IN_BODY,ur(e,t)}}function Gq(e,t){t.tagID===C.TEMPLATE&&Oo(e,t)}function vR(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(C.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):iy(e,t)}function Kq(e,t){t.tagID===C.HTML?ur(e,t):tm(e,t)}function TR(e,t){var n;if(t.tagID===C.HTML){if(e.fragmentContext||(e.insertionMode=ne.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===C.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 tm(e,t)}function tm(e,t){e.insertionMode=ne.IN_BODY,qm(e,t)}function Xq(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.FRAMESET:{e._insertElement(t,Me.HTML);break}case C.FRAME:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case C.NOFRAMES:{bs(e,t);break}}}function Wq(e,t){t.tagID===C.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==C.FRAMESET&&(e.insertionMode=ne.AFTER_FRAMESET))}function Qq(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.NOFRAMES:{bs(e,t);break}}}function Zq(e,t){t.tagID===C.HTML&&(e.insertionMode=ne.AFTER_AFTER_FRAMESET)}function Jq(e,t){t.tagID===C.HTML?ur(e,t):kh(e,t)}function kh(e,t){e.insertionMode=ne.IN_BODY,qm(e,t)}function eY(e,t){switch(t.tagID){case C.HTML:{ur(e,t);break}case C.NOFRAMES:{bs(e,t);break}}}function tY(e,t){t.chars=hn,e._insertCharacters(t)}function nY(e,t){e._insertCharacters(t),e.framesetOk=!1}function SR(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Me.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function rY(e,t){if(xV(t))SR(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Me.MATHML?aR(t):r===Me.SVG&&(yV(t),oR(t)),ry(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function sY(e,t){if(t.tagID===C.P||t.tagID===C.BR){SR(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)===Me.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,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 Xm=CR("end"),zs=CR("start");function CR(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 wR(e){const t=zs(e),n=Xm(e);if(t&&n)return{start:t,end:n}}const iY=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,aY=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),lw={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function kR(e,t){const n=gY(e),r=XA("type",{handlers:{root:oY,element:lY,text:uY,comment:_R,doctype:cY,raw:fY},unknown:hY}),i={parser:n?new iw(lw):iw.getFragmentParser(void 0,lw),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),lu(i,zs());const a=n?i.parser.document:i.parser.getFragment(),l=b$(a,{file:i.options.file});return i.stitches&&Bs(l,"comment",function(c,d,f){const g=c;if(g.value.stitch&&f&&d!==void 0){const m=f.children;return m[d]=g.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function NR(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function oY(e,t){NR(e.children,t)}function lY(e,t){mY(e,t),NR(e.children,t),pY(e,t)}function uY(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Ct.CHARACTER,chars:e.value,location:pd(e)};lu(t,zs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function cY(e,t){const n={type:Ct.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:pd(e)};lu(t,zs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function dY(e,t){t.stitches=!0;const n=bY(e);if("children"in e&&"children"in n){const r=kR({type:"root",children:e.children},t.options);n.children=r.children}_R({type:"comment",value:{stitch:n}},t)}function _R(e,t){const n=e.value,r={type:Ct.COMMENT,data:n,location:pd(e)};lu(t,zs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function fY(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,AR(t,zs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(iY,"&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 hY(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))dY(n,t);else{let r="";throw aY.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 lu(e,t){AR(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=kn.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 AR(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 mY(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===kn.PLAINTEXT)return;lu(t,zs(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:eo.html;i===eo.html&&n==="svg"&&(i=eo.svg);const a=T$({...e,children:[]},{space:i===eo.svg?"svg":"html"}),l={type:Ct.START_TAG,tagName:n,tagID:ou(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:pd(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function pY(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&R$.includes(n)||t.parser.tokenizer.state===kn.PLAINTEXT)return;lu(t,Xm(e));const r={type:Ct.END_TAG,tagName:n,tagID:ou(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:pd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===kn.RCDATA||t.parser.tokenizer.state===kn.RAWTEXT||t.parser.tokenizer.state===kn.SCRIPT_DATA)&&(t.parser.tokenizer.state=kn.DATA)}function gY(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function pd(e){const t=zs(e)||{line:void 0,column:void 0,offset:void 0},n=Xm(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 bY(e){return"children"in e?yo({...e,children:[]}):yo(e)}function p1(e){return function(t,n){return kR(t,{...e,file:n})}}const $a=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Ga={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...$a,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...$a],h2:[["className","sr-only"]],img:[...$a,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...$a,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...$a],table:[...$a],ul:[...$a,["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"]},ea={}.hasOwnProperty;function xY(e,t){let n={type:"root",children:[]};const r={schema:t?{...Ga,...t}:Ga,stack:[]},i=RR(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function RR(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return yY(e,n);case"doctype":return EY(e,n);case"element":return vY(e,n);case"root":return TY(e,n);case"text":return SY(e,n)}}}function yY(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 gd(a,t),a}}function EY(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return gd(n,t),n}}function vY(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=OR(e,t.children),i=CY(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&&ea.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(a=!1;++d<c.length;)e.stack.includes(c[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const l={type:"element",tagName:n,properties:i,children:r};return gd(l,t),l}function TY(e,t){const r={type:"root",children:OR(e,t.children)};return gd(r,t),r}function SY(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return gd(r,t),r}function OR(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=RR(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function CY(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&ea.call(r,n)?r[n]:void 0,l=r&&ea.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(ea.call(c,f)){const g=c[f];let m=uw(e,cw(a,f),f,g);m==null&&(m=uw(e,cw(l,f),f,g)),m!=null&&(d[f]=m)}if(i&&ea.call(i,n)){const g=i[n];for(f in g)ea.call(g,f)&&!ea.call(d,f)&&(d[f]=g[f])}return d}function uw(e,t,n,r){return t?Array.isArray(r)?wY(e,t,n,r):IR(e,t,n,r):void 0}function wY(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const l=IR(e,t,n,r[i]);(typeof l=="number"||typeof l=="string")&&a.push(l)}return a}function IR(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&kY(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const l=t[a];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){i=!0;break}}else if(l===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function kY(e,t,n){const r=e.schema.protocols&&ea.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),a=i.indexOf(":"),l=i.indexOf("?"),c=i.indexOf("#"),d=i.indexOf("/");if(a<0||d>-1&&a>d||l>-1&&a>l||c>-1&&a>c)return!0;let f=-1;for(;++f<r.length;){const g=r[f];if(a===g.length&&i.slice(0,g.length)===g)return!0}return!1}function gd(e,t){const n=wR(t);t.data&&(e.data=yo(t.data)),n&&(e.position=n)}function cw(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],a=typeof i=="string"?i:i[0];if(a===t)return i;a==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function MR(e){return function(t){return xY(t,e)}}function dw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const hr=Ea(/[A-Za-z]/),ar=Ea(/[\dA-Za-z]/),NY=Ea(/[#-'*+\--9=?A-Z^-~]/);function nm(e){return e!==null&&(e<32||e===127)}const g1=Ea(/\d/),_Y=Ea(/[\dA-Fa-f]/),AY=Ea(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function At(e){return e===-2||e===-1||e===32}const Wm=Ea(/\p{P}|\p{S}/u),Eo=Ea(/\s/);function Ea(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function RY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function OY(e,t,n){const i=Um((n||{}).ignore||[]),a=IY(t);let l=-1;for(;++l<a.length;)Xx(e,"text",c);function c(f,g){let m=-1,b;for(;++m<g.length;){const x=g[m],v=b?b.children:void 0;if(i(x,v?v.indexOf(x):void 0,b))return;b=x}if(b)return d(f,g)}function d(f,g){const m=g[g.length-1],b=a[l][0],x=a[l][1];let v=0;const w=m.children.indexOf(f);let S=!1,N=[];b.lastIndex=0;let _=b.exec(f.value);for(;_;){const A=_.index,L={index:_.index,input:_.input,stack:[...g,f]};let R=x(..._,L);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=A+1:(v!==A&&N.push({type:"text",value:f.value.slice(v,A)}),Array.isArray(R)?N.push(...R):R&&N.push(R),v=A+_[0].length,S=!0),!b.global)break;_=b.exec(f.value)}return S?(v<f.value.length&&N.push({type:"text",value:f.value.slice(v)}),m.children.splice(w,1,...N)):N=[f],w+N.length}}function IY(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 i=n[r];t.push([MY(i[0]),LY(i[1])])}return t}function MY(e){return typeof e=="string"?new RegExp(RY(e),"g"):e}function LY(e){return typeof e=="function"?e:function(){return e}}const J0="phrasing",eb=["autolink","link","image","label"];function DY(){return{transforms:[FY],enter:{literalAutolink:PY,literalAutolinkEmail:tb,literalAutolinkHttp:tb,literalAutolinkWww:tb},exit:{literalAutolink:UY,literalAutolinkEmail:HY,literalAutolinkHttp:BY,literalAutolinkWww:zY}}}function jY(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:J0,notInConstruct:eb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:J0,notInConstruct:eb},{character:":",before:"[ps]",after:"\\/",inConstruct:J0,notInConstruct:eb}]}}function PY(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function tb(e){this.config.enter.autolinkProtocol.call(this,e)}function BY(e){this.config.exit.autolinkProtocol.call(this,e)}function zY(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 HY(e){this.config.exit.autolinkEmail.call(this,e)}function UY(e){this.exit(e)}function FY(e){OY(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$Y],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,VY]],{ignore:["link","linkReference"]})}function $Y(e,t,n,r,i){let a="";if(!LR(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!qY(n)))return!1;const l=YY(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function VY(e,t,n,r){return!LR(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function qY(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 YY(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 i=dw(e,"(");let a=dw(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function LR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Eo(n)||Wm(n))&&(!t||n!==47)}function ps(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}DR.peek=tG;function GY(){this.buffer()}function KY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function XY(){this.buffer()}function WY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function QY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ps(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZY(e){this.exit(e)}function JY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ps(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eG(e){this.exit(e)}function tG(){return"["}function DR(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=i.move("]"),a}function nG(){return{enter:{gfmFootnoteCallString:GY,gfmFootnoteCall:KY,gfmFootnoteDefinitionLabelString:XY,gfmFootnoteDefinition:WY},exit:{gfmFootnoteCallString:QY,gfmFootnoteCall:ZY,gfmFootnoteDefinitionLabelString:JY,gfmFootnoteDefinition:eG}}}function rG(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:DR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,l){const c=a.createTracker(l);let d=c.move("[^");const f=a.enter("footnoteDefinition"),g=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),g(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
535
- `:" ")+a.indentLines(a.containerFlow(r,c.current()),t?jR:sG))),f(),d}}function sG(e,t,n){return t===0?e:jR(e,t,n)}function jR(e,t,n){return(n?"":" ")+e}const iG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];PR.peek=cG;function aG(){return{canContainEols:["delete"],enter:{strikethrough:lG},exit:{strikethrough:uG}}}function oG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:iG}],handlers:{delete:PR}}}function lG(e){this.enter({type:"delete",children:[]},e)}function uG(e){this.exit(e)}function PR(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function cG(){return"~"}function dG(e){return e.length}function fG(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||dG,a=[],l=[],c=[],d=[];let f=0,g=-1;for(;++g<e.length;){const k=[],w=[];let S=-1;for(e[g].length>f&&(f=e[g].length);++S<e[g].length;){const N=hG(e[g][S]);if(n.alignDelimiters!==!1){const _=i(N);w[S]=_,(d[S]===void 0||_>d[S])&&(d[S]=_)}k.push(N)}l[g]=k,c[g]=w}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<f;)a[m]=fw(r[m]);else{const k=fw(r);for(;++m<f;)a[m]=k}m=-1;const b=[],x=[];for(;++m<f;){const k=a[m];let w="",S="";k===99?(w=":",S=":"):k===108?w=":":k===114&&(S=":");let N=n.alignDelimiters===!1?1:Math.max(1,d[m]-w.length-S.length);const _=w+"-".repeat(N)+S;n.alignDelimiters!==!1&&(N=w.length+N+S.length,N>d[m]&&(d[m]=N),x[m]=N),b[m]=_}l.splice(1,0,b),c.splice(1,0,x),g=-1;const v=[];for(;++g<l.length;){const k=l[g],w=c[g];m=-1;const S=[];for(;++m<f;){const N=k[m]||"";let _="",A="";if(n.alignDelimiters!==!1){const L=d[m]-(w[m]||0),R=a[m];R===114?_=" ".repeat(L):R===99?L%2?(_=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(_=" ".repeat(L/2),A=_):A=" ".repeat(L)}n.delimiterStart!==!1&&!m&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||m)&&S.push(" "),n.alignDelimiters!==!1&&S.push(_),S.push(N),n.alignDelimiters!==!1&&S.push(A),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||m!==f-1)&&S.push("|")}v.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
536
- `)}function hG(e){return e==null?"":String(e)}function fw(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 mG(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),pG);return i(),l}function pG(e,t,n){return">"+(n?"":" ")+e}function gG(e,t){return hw(e,t.inConstruct,!0)&&!hw(e,t.notInConstruct,!1)}function hw(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 mw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
537
- `&&gG(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
538
- `}function bG(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>l&&(l=a):a=1,i=r+t.length,r=n.indexOf(t,i);return l}function xG(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 yG(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 EG(e,t,n,r){const i=yG(n),a=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(xG(e,n)){const m=n.enter("codeIndented"),b=n.indentLines(a,vG);return m(),b}const c=n.createTracker(r),d=i.repeat(Math.max(bG(a,i)+1,3)),f=n.enter("codeFenced");let g=c.move(d);if(e.lang){const m=n.enter(`codeFencedLang${l}`);g+=c.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);g+=c.move(" "),g+=c.move(n.safe(e.meta,{before:g,after:`
539
- `,encode:["`"],...c.current()})),m()}return g+=c.move(`
540
- `),a&&(g+=c.move(a+`
541
- `)),g+=c.move(d),f(),g}function vG(e,t,n){return(n?"":" ")+e}function oy(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 TG(e,t,n,r){const i=oy(n),a=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("[");return f+=d.move(n.safe(n.associationId(e),{before:f,after:"]",...d.current()})),f+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":`
542
- `,...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+i),f+=d.move(n.safe(e.title,{before:f,after:i,...d.current()})),f+=d.move(i),c()),l(),f}function SG(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 td(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Kl(e){if(e===null||rn(e)||Eo(e))return 1;if(Wm(e))return 2}function rm(e,t,n){const r=Kl(e),i=Kl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}BR.peek=CG;function BR(e,t,n,r){const i=SG(n),a=n.enter("emphasis"),l=n.createTracker(r),c=l.move(i);let d=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const f=d.charCodeAt(0),g=rm(r.before.charCodeAt(r.before.length-1),f,i);g.inside&&(d=td(f)+d.slice(1));const m=d.charCodeAt(d.length-1),b=rm(r.after.charCodeAt(0),m,i);b.inside&&(d=d.slice(0,-1)+td(m));const x=l.move(i);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},c+d+x}function CG(e,t,n){return n.options.emphasis||"*"}const wG={};function ly(e,t){const n=wG,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return zR(e,r,i)}function zR(e,t,n){if(kG(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 pw(e.children,t,n)}return Array.isArray(e)?pw(e,t,n):""}function pw(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=zR(e[i],t,n);return r.join("")}function kG(e){return!!(e&&typeof e=="object")}function NG(e,t){let n=!1;return Bs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,o1}),!!((!e.depth||e.depth<3)&&ly(e)&&(t.options.setext||n))}function _G(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(NG(e,n)){const g=n.enter("headingSetext"),m=n.enter("phrasing"),b=n.containerPhrasing(e,{...a.current(),before:`
543
- `,after:`
544
- `});return m(),g(),b+`
545
- `+(i===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
546
- `))+1))}const l="#".repeat(i),c=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
547
- `,...a.current()});return/^[\t ]/.test(f)&&(f=td(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}HR.peek=AG;function HR(e){return e.value||""}function AG(){return"<"}UR.peek=RG;function UR(e,t,n,r){const i=oy(n),a=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+i),f+=d.move(n.safe(e.title,{before:f,after:i,...d.current()})),f+=d.move(i),c()),f+=d.move(")"),l(),f}function RG(){return"!"}FR.peek=OG;function FR(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=g,a(),i==="full"||!f||f!==m?d+=c.move(m+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function OG(){return"!"}$R.peek=IG;function $R(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";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],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return i+r+i}function IG(){return"`"}function VR(e,t){const n=ly(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))}qR.peek=MG;function qR(e,t,n,r){const i=oy(n),a=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,d;if(VR(e,n)){const g=n.stack;n.stack=[],c=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),c(),n.stack=g,m}c=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),f+=l.move(" "+i),f+=l.move(n.safe(e.title,{before:f,after:i,...l.current()})),f+=l.move(i),d()),f+=l.move(")"),c(),f}function MG(e,t,n){return VR(e,n)?"<":"["}YR.peek=LG;function YR(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=g,a(),i==="full"||!f||f!==m?d+=c.move(m+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function LG(){return"["}function uy(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 DG(e){const t=uy(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 jG(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 GR(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 PG(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?jG(n):uy(n);const c=e.ordered?l==="."?")":".":DG(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&g&&(!g.children||!g.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),GR(n)===l&&g){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=c),n.bulletCurrent=l;const f=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,i(),f}function BG(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 zG(e,t,n,r){const i=BG(n);let a=n.bulletCurrent||uy(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;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(l-a.length)),c.shift(l);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),g);return d(),f;function g(m,b,x){return b?(x?"":" ".repeat(l))+m:(x?a:a+" ".repeat(l-a.length))+m}}function HG(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),i(),l}const UG=Um(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function FG(e,t,n,r){return(e.children.some(function(l){return UG(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function $G(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}KR.peek=VG;function KR(e,t,n,r){const i=$G(n),a=n.enter("strong"),l=n.createTracker(r),c=l.move(i+i);let d=l.move(n.containerPhrasing(e,{after:i,before:c,...l.current()}));const f=d.charCodeAt(0),g=rm(r.before.charCodeAt(r.before.length-1),f,i);g.inside&&(d=td(f)+d.slice(1));const m=d.charCodeAt(d.length-1),b=rm(r.after.charCodeAt(0),m,i);b.inside&&(d=d.slice(0,-1)+td(m));const x=l.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},c+d+x}function VG(e,t,n){return n.options.strong||"*"}function qG(e,t,n,r){return n.safe(e.value,r)}function YG(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 GG(e,t,n){const r=(GR(n)+(n.options.ruleSpaces?" ":"")).repeat(YG(n));return n.options.ruleSpaces?r.slice(0,-1):r}const XR={blockquote:mG,break:mw,code:EG,definition:TG,emphasis:BR,hardBreak:mw,heading:_G,html:HR,image:UR,imageReference:FR,inlineCode:$R,link:qR,linkReference:YR,list:PG,listItem:zG,paragraph:HG,root:FG,strong:KR,text:qG,thematicBreak:GG},gw=document.createElement("i");function cy(e){const t="&"+e+";";gw.innerHTML=t;const n=gw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function WR(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 KG=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function XG(e){return e.replace(KG,WG)}function WG(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return WR(n.slice(a?2:1),a?16:10)}return cy(n)||e}function QG(){return{enter:{table:ZG,tableData:bw,tableHeader:bw,tableRow:eK},exit:{codeText:tK,table:JG,tableData:nb,tableHeader:nb,tableRow:nb}}}function ZG(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 JG(e){this.exit(e),this.data.inTable=void 0}function eK(e){this.enter({type:"tableRow",children:[]},e)}function nb(e){this.exit(e)}function bw(e){this.enter({type:"tableCell",children:[]},e)}function tK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,nK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function nK(e,t){return t==="|"?t:e}function rK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
548
- `,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:c}};function l(x,v,k,w){return f(g(x,k,w),x.align)}function c(x,v,k,w){const S=m(x,k,w),N=f([S]);return N.slice(0,N.indexOf(`
549
- `))}function d(x,v,k,w){const S=k.enter("tableCell"),N=k.enter("phrasing"),_=k.containerPhrasing(x,{...w,before:a,after:a});return N(),S(),_}function f(x,v){return fG(x,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function g(x,v,k){const w=x.children;let S=-1;const N=[],_=v.enter("table");for(;++S<w.length;)N[S]=m(w[S],v,k);return _(),N}function m(x,v,k){const w=x.children;let S=-1;const N=[],_=v.enter("tableRow");for(;++S<w.length;)N[S]=d(w[S],x,v,k);return _(),N}function b(x,v,k){let w=XR.inlineCode(x,v,k);return k.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function sK(){return{exit:{taskListCheckValueChecked:xw,taskListCheckValueUnchecked:xw,paragraph:aK}}}function iK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:oK}}}function xw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function aK(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 i=t.children;let a=-1,l;for(;++a<i.length;){const c=i[a];if(c.type==="paragraph"){l=c;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 oK(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(l);let d=XR.listItem(e,t,n,{...r,...c.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(g){return g+l}}function lK(){return[DY(),nG(),aG(),QG(),sK()]}function uK(e){return{extensions:[jY(),rG(e),oG(),rK(e),iK()]}}function Vr(e,t,n,r){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i: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 yw={}.hasOwnProperty;function QR(e){const t={};let n=-1;for(;++n<e.length;)cK(t,e[n]);return t}function cK(e,t){let n;for(n in t){const i=(yw.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){yw.call(i,l)||(i[l]=[]);const c=a[l];dK(i[l],Array.isArray(c)?c:c?[c]:[])}}}function dK(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 fK={tokenize:xK,partial:!0},ZR={tokenize:yK,partial:!0},JR={tokenize:EK,partial:!0},e4={tokenize:vK,partial:!0},hK={tokenize:TK,partial:!0},t4={name:"wwwAutolink",tokenize:gK,previous:r4},n4={name:"protocolAutolink",tokenize:bK,previous:s4},Ei={name:"emailAutolink",tokenize:pK,previous:i4},Hs={};function mK(){return{text:Hs}}let Va=48;for(;Va<123;)Hs[Va]=Ei,Va++,Va===58?Va=65:Va===91&&(Va=97);Hs[43]=Ei;Hs[45]=Ei;Hs[46]=Ei;Hs[95]=Ei;Hs[72]=[Ei,n4];Hs[104]=[Ei,n4];Hs[87]=[Ei,t4];Hs[119]=[Ei,t4];function pK(e,t,n){const r=this;let i,a;return l;function l(m){return!b1(m)||!i4.call(r,r.previous)||dy(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return b1(m)?(e.consume(m),c):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(hK,g,f)(m):m===45||m===95||ar(m)?(a=!0,e.consume(m),d):g(m)}function f(m){return e.consume(m),i=!0,d}function g(m){return a&&i&&hr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function gK(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!r4.call(r,r.previous)||dy(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(fK,e.attempt(ZR,e.attempt(JR,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function bK(e,t,n){const r=this;let i="",a=!1;return l;function l(m){return(m===72||m===104)&&s4.call(r,r.previous)&&!dy(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(hr(m)&&i.length<5)return i+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const b=i.toLowerCase();if(b==="http"||b==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?f:(a=!0,d)):n(m)}function f(m){return m===null||nm(m)||rn(m)||Eo(m)||Wm(m)?n(m):e.attempt(ZR,e.attempt(JR,g),n)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function xK(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function yK(e,t,n){let r,i,a;return l;function l(f){return f===46||f===95?e.check(e4,d,c)(f):f===null||rn(f)||Eo(f)||f!==45&&Wm(f)?d(f):(a=!0,e.consume(f),l)}function c(f){return f===95?r=!0:(i=r,r=void 0),e.consume(f),l}function d(f){return i||r||!a?n(f):t(f)}}function EK(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):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(e4,t,a)(l):l===null||rn(l)||Eo(l)?t(l):(e.consume(l),i)}function a(l){return l===41&&r++,e.consume(l),i}}function vK(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),i):c===60||c===null||rn(c)||Eo(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||rn(c)||Eo(c)?t(c):r(c)}function a(c){return hr(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):hr(c)?(e.consume(c),l):n(c)}}function TK(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return ar(a)?n(a):t(a)}}function r4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rn(e)}function s4(e){return!hr(e)}function i4(e){return!(e===47||b1(e))}function b1(e){return e===43||e===45||e===46||e===95||ar(e)}function dy(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 uu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&ar(e.charCodeAt(n+1))&&ar(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Qm(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const x1={name:"attention",resolveAll:SK,tokenize:CK};function SK(e,t){let n=-1,r,i,a,l,c,d,f,g;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};Ew(m,-d),Ew(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={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}},i={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=as(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=as(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=as(f,Qm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=as(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,f=as(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Vr(e,r-1,n-r+3,f),n=r+f.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function CK(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kl(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),g=Kl(d),m=!g||g===2&&i||n.includes(d),b=!i||i===2&&g||n.includes(r);return f._open=!!(a===42?m:m&&(i||!b)),f._close=!!(a===42?b:b&&(g||!m)),t(d)}}function Ew(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wK={name:"autolink",tokenize:kK};function kK(e,t,n){let r=0;return i;function i(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(x){return hr(x)?(e.consume(x),l):x===64?n(x):f(x)}function l(x){return x===43||x===45||x===46||ar(x)?(r=1,c(x)):f(x)}function c(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||ar(x))&&r++<32?(e.consume(x),c):(r=0,f(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||nm(x)?n(x):(e.consume(x),d)}function f(x){return x===64?(e.consume(x),g):NY(x)?(e.consume(x),f):n(x)}function g(x){return ar(x)?m(x):n(x)}function m(x){return x===46?(e.consume(x),r=0,g):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||ar(x))&&r++<63){const v=x===45?b:m;return e.consume(x),v}return n(x)}}function Pt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return At(d)?(e.enter(n),c(d)):t(d)}function c(d){return At(d)&&a++<i?(e.consume(d),c):(e.exit(n),t(d))}}const bd={partial:!0,tokenize:NK};function NK(e,t,n){return r;function r(a){return At(a)?Pt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||st(a)?t(a):n(a)}}const a4={continuation:{tokenize:AK},exit:RK,name:"blockQuote",tokenize:_K};function _K(e,t,n){const r=this;return i;function i(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return At(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function AK(e,t,n){const r=this;return i;function i(l){return At(l)?Pt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(a4,t,n)(l)}}function RK(e){e.exit("blockQuote")}const o4={name:"characterEscape",tokenize:OK};function OK(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return AY(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const l4={name:"characterReference",tokenize:IK};function IK(e,t,n){const r=this;let i=0,a,l;return c;function c(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"),f):(e.enter("characterReferenceValue"),a=31,l=ar,g(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=_Y,g):(e.enter("characterReferenceValue"),a=7,l=g1,g(m))}function g(m){if(m===59&&i){const b=e.exit("characterReferenceValue");return l===ar&&!cy(r.sliceSerialize(b))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&i++<a?(e.consume(m),g):n(m)}}const vw={partial:!0,tokenize:LK},Tw={concrete:!0,name:"codeFenced",tokenize:MK};function MK(e,t,n){const r=this,i={partial:!0,tokenize:L};let a=0,l=0,c;return d;function d(R){return f(R)}function f(R){const D=r.events[r.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,c=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===c?(l++,e.consume(R),g):l<3?n(R):(e.exit("codeFencedFenceSequence"),At(R)?Pt(e,m,"whitespace")(R):m(R))}function m(R){return R===null||st(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(vw,k,A)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||st(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(R)):At(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pt(e,x,"whitespace")(R)):R===96&&R===c?n(R):(e.consume(R),b)}function x(R){return R===null||st(R)?m(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||st(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(R)):R===96&&R===c?n(R):(e.consume(R),v)}function k(R){return e.attempt(i,A,w)(R)}function w(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),S}function S(R){return a>0&&At(R)?Pt(e,N,"linePrefix",a+1)(R):N(R)}function N(R){return R===null||st(R)?e.check(vw,k,A)(R):(e.enter("codeFlowValue"),_(R))}function _(R){return R===null||st(R)?(e.exit("codeFlowValue"),N(R)):(e.consume(R),_)}function A(R){return e.exit("codeFenced"),t(R)}function L(R,D,I){let U=0;return z;function z(q){return R.enter("lineEnding"),R.consume(q),R.exit("lineEnding"),X}function X(q){return R.enter("codeFencedFence"),At(q)?Pt(R,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):W(q)}function W(q){return q===c?(R.enter("codeFencedFenceSequence"),V(q)):I(q)}function V(q){return q===c?(U++,R.consume(q),V):U>=l?(R.exit("codeFencedFenceSequence"),At(q)?Pt(R,ee,"whitespace")(q):ee(q)):I(q)}function ee(q){return q===null||st(q)?(R.exit("codeFencedFence"),D(q)):I(q)}}}function LK(e,t,n){const r=this;return i;function i(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 rb={name:"codeIndented",tokenize:jK},DK={partial:!0,tokenize:PK};function jK(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Pt(e,a,"linePrefix",5)(f)}function a(f){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):st(f)?e.attempt(DK,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||st(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function PK(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):st(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Pt(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):st(l)?i(l):n(l)}}const BK={name:"codeText",previous:HK,resolve:zK,tokenize:UK};function zK(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function HK(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function UK(e,t,n){let r=0,i,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(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"),i=0,g(m)):st(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||st(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function g(m){return m===96?(e.consume(m),i++,g):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class FK{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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&fc(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),fc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fc(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);fc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fc(this.left,n.reverse())}}}function fc(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 u4(e){const t={};let n=-1,r,i,a,l,c,d,f;const g=new FK(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.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,$K(g,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(l=g.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(g.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...g.get(i)[1].start},c=g.slice(i,n),c.unshift(r),g.splice(i,n-i+1,c))}}return Vr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!f}function $K(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let g,m,b=-1,x=n,v=0,k=0;const w=[k];for(;x;){for(;e.get(++i)[1]!==x;);a.push(i),x._tokenizer||(g=r.sliceStream(x),x.next||g.push(null),m&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(k=b+1,w.push(k),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):w.pop(),b=w.length;b--;){const S=c.slice(w[b],w[b+1]),N=a.pop();d.push([N,N+S.length-1]),e.splice(N,2,S)}for(d.reverse(),b=-1;++b<d.length;)f[v+d[b][0]]=v+d[b][1],v+=d[b][1]-d[b][0]-1;return f}const VK={resolve:YK,tokenize:GK},qK={partial:!0,tokenize:KK};function YK(e){return u4(e),e}function GK(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?a(c):st(c)?e.check(qK,l,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function KK(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Pt(e,a,"linePrefix")}function a(l){if(l===null||st(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function c4(e,t,n,r,i,a,l,c,d){const f=d||Number.POSITIVE_INFINITY;let g=0;return m;function m(S){return S===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(S),e.exit(a),b):S===null||S===32||S===41||nm(S)?n(S):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),k(S))}function b(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(e.exit("chunkString"),e.exit(c),b(S)):S===null||S===60||st(S)?n(S):(e.consume(S),S===92?v:x)}function v(S){return S===60||S===62||S===92?(e.consume(S),x):x(S)}function k(S){return!g&&(S===null||S===41||rn(S))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(S)):g<f&&S===40?(e.consume(S),g++,k):S===41?(e.consume(S),g--,k):S===null||S===32||S===40||nm(S)?n(S):(e.consume(S),S===92?w:k)}function w(S){return S===40||S===41||S===92?(e.consume(S),k):k(S)}}function d4(e,t,n,r,i,a){const l=this;let c=0,d;return f;function f(x){return e.enter(r),e.enter(i),e.consume(x),e.exit(i),e.enter(a),g}function g(x){return c>999||x===null||x===91||x===93&&!d||x===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(e.exit(a),e.enter(i),e.consume(x),e.exit(i),e.exit(r),t):st(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||st(x)||c++>999?(e.exit("chunkString"),g(x)):(e.consume(x),d||(d=!At(x)),x===92?b:m)}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,m):m(x)}}function f4(e,t,n,r,i,a){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(r),e.enter(i),e.consume(b),e.exit(i),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):(e.enter(a),f(b))}function f(b){return b===l?(e.exit(a),d(l)):b===null?n(b):st(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Pt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===l||b===null||st(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?m:g)}function m(b){return b===l||b===92?(e.consume(b),g):g(b)}}function Bc(e,t){let n;return r;function r(i){return st(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):At(i)?Pt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const XK={name:"definition",tokenize:QK},WK={partial:!0,tokenize:ZK};function QK(e,t,n){const r=this;let i;return a;function a(x){return e.enter("definition"),l(x)}function l(x){return d4.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function c(x){return i=ps(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 rn(x)?Bc(e,f)(x):f(x)}function f(x){return c4(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(WK,m,m)(x)}function m(x){return At(x)?Pt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||st(x)?(e.exit("definition"),r.parser.defined.push(i),t(x)):n(x)}}function ZK(e,t,n){return r;function r(c){return rn(c)?Bc(e,i)(c):n(c)}function i(c){return f4(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return At(c)?Pt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||st(c)?t(c):n(c)}}const JK={name:"hardBreakEscape",tokenize:eX};function eX(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return st(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const tX={name:"headingAtx",resolve:nX,tokenize:rX};function nX(e,t){let n=e.length-2,r=3,i,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&&(i={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",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function rX(e,t,n){let r=0;return i;function i(g){return e.enter("atxHeading"),a(g)}function a(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&r++<6?(e.consume(g),l):g===null||rn(g)?(e.exit("atxHeadingSequence"),c(g)):n(g)}function c(g){return g===35?(e.enter("atxHeadingSequence"),d(g)):g===null||st(g)?(e.exit("atxHeading"),t(g)):At(g)?Pt(e,c,"whitespace")(g):(e.enter("atxHeadingText"),f(g))}function d(g){return g===35?(e.consume(g),d):(e.exit("atxHeadingSequence"),c(g))}function f(g){return g===null||g===35||rn(g)?(e.exit("atxHeadingText"),c(g)):(e.consume(g),f)}}const sX=["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"],Sw=["pre","script","style","textarea"],iX={concrete:!0,name:"htmlFlow",resolveTo:lX,tokenize:uX},aX={partial:!0,tokenize:dX},oX={partial:!0,tokenize:cX};function lX(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 uX(e,t,n){const r=this;let i,a,l,c,d;return f;function f(j){return g(j)}function g(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),m}function m(j){return j===33?(e.consume(j),b):j===47?(e.consume(j),a=!0,k):j===63?(e.consume(j),i=3,r.interrupt?t:M):hr(j)?(e.consume(j),l=String.fromCharCode(j),w):n(j)}function b(j){return j===45?(e.consume(j),i=2,x):j===91?(e.consume(j),i=5,c=0,v):hr(j)?(e.consume(j),i=4,r.interrupt?t:M):n(j)}function x(j){return j===45?(e.consume(j),r.interrupt?t:M):n(j)}function v(j){const ae="CDATA[";return j===ae.charCodeAt(c++)?(e.consume(j),c===ae.length?r.interrupt?t:W:v):n(j)}function k(j){return hr(j)?(e.consume(j),l=String.fromCharCode(j),w):n(j)}function w(j){if(j===null||j===47||j===62||rn(j)){const ae=j===47,ie=l.toLowerCase();return!ae&&!a&&Sw.includes(ie)?(i=1,r.interrupt?t(j):W(j)):sX.includes(l.toLowerCase())?(i=6,ae?(e.consume(j),S):r.interrupt?t(j):W(j)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):a?N(j):_(j))}return j===45||ar(j)?(e.consume(j),l+=String.fromCharCode(j),w):n(j)}function S(j){return j===62?(e.consume(j),r.interrupt?t:W):n(j)}function N(j){return At(j)?(e.consume(j),N):z(j)}function _(j){return j===47?(e.consume(j),z):j===58||j===95||hr(j)?(e.consume(j),A):At(j)?(e.consume(j),_):z(j)}function A(j){return j===45||j===46||j===58||j===95||ar(j)?(e.consume(j),A):L(j)}function L(j){return j===61?(e.consume(j),R):At(j)?(e.consume(j),L):_(j)}function R(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),d=j,D):At(j)?(e.consume(j),R):I(j)}function D(j){return j===d?(e.consume(j),d=null,U):j===null||st(j)?n(j):(e.consume(j),D)}function I(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||rn(j)?L(j):(e.consume(j),I)}function U(j){return j===47||j===62||At(j)?_(j):n(j)}function z(j){return j===62?(e.consume(j),X):n(j)}function X(j){return j===null||st(j)?W(j):At(j)?(e.consume(j),X):n(j)}function W(j){return j===45&&i===2?(e.consume(j),B):j===60&&i===1?(e.consume(j),G):j===62&&i===4?(e.consume(j),P):j===63&&i===3?(e.consume(j),M):j===93&&i===5?(e.consume(j),le):st(j)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(aX,F,V)(j)):j===null||st(j)?(e.exit("htmlFlowData"),V(j)):(e.consume(j),W)}function V(j){return e.check(oX,ee,F)(j)}function ee(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),q}function q(j){return j===null||st(j)?V(j):(e.enter("htmlFlowData"),W(j))}function B(j){return j===45?(e.consume(j),M):W(j)}function G(j){return j===47?(e.consume(j),l="",Q):W(j)}function Q(j){if(j===62){const ae=l.toLowerCase();return Sw.includes(ae)?(e.consume(j),P):W(j)}return hr(j)&&l.length<8?(e.consume(j),l+=String.fromCharCode(j),Q):W(j)}function le(j){return j===93?(e.consume(j),M):W(j)}function M(j){return j===62?(e.consume(j),P):j===45&&i===2?(e.consume(j),M):W(j)}function P(j){return j===null||st(j)?(e.exit("htmlFlowData"),F(j)):(e.consume(j),P)}function F(j){return e.exit("htmlFlow"),t(j)}}function cX(e,t,n){const r=this;return i;function i(l){return st(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 dX(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(bd,t,n)}}const fX={name:"htmlText",tokenize:hX};function hX(e,t,n){const r=this;let i,a,l;return c;function c(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),L):M===63?(e.consume(M),_):hr(M)?(e.consume(M),I):n(M)}function f(M){return M===45?(e.consume(M),g):M===91?(e.consume(M),a=0,v):hr(M)?(e.consume(M),N):n(M)}function g(M){return M===45?(e.consume(M),x):n(M)}function m(M){return M===null?n(M):M===45?(e.consume(M),b):st(M)?(l=m,G(M)):(e.consume(M),m)}function b(M){return M===45?(e.consume(M),x):m(M)}function x(M){return M===62?B(M):M===45?b(M):m(M)}function v(M){const P="CDATA[";return M===P.charCodeAt(a++)?(e.consume(M),a===P.length?k:v):n(M)}function k(M){return M===null?n(M):M===93?(e.consume(M),w):st(M)?(l=k,G(M)):(e.consume(M),k)}function w(M){return M===93?(e.consume(M),S):k(M)}function S(M){return M===62?B(M):M===93?(e.consume(M),S):k(M)}function N(M){return M===null||M===62?B(M):st(M)?(l=N,G(M)):(e.consume(M),N)}function _(M){return M===null?n(M):M===63?(e.consume(M),A):st(M)?(l=_,G(M)):(e.consume(M),_)}function A(M){return M===62?B(M):_(M)}function L(M){return hr(M)?(e.consume(M),R):n(M)}function R(M){return M===45||ar(M)?(e.consume(M),R):D(M)}function D(M){return st(M)?(l=D,G(M)):At(M)?(e.consume(M),D):B(M)}function I(M){return M===45||ar(M)?(e.consume(M),I):M===47||M===62||rn(M)?U(M):n(M)}function U(M){return M===47?(e.consume(M),B):M===58||M===95||hr(M)?(e.consume(M),z):st(M)?(l=U,G(M)):At(M)?(e.consume(M),U):B(M)}function z(M){return M===45||M===46||M===58||M===95||ar(M)?(e.consume(M),z):X(M)}function X(M){return M===61?(e.consume(M),W):st(M)?(l=X,G(M)):At(M)?(e.consume(M),X):U(M)}function W(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,V):st(M)?(l=W,G(M)):At(M)?(e.consume(M),W):(e.consume(M),ee)}function V(M){return M===i?(e.consume(M),i=void 0,q):M===null?n(M):st(M)?(l=V,G(M)):(e.consume(M),V)}function ee(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||rn(M)?U(M):(e.consume(M),ee)}function q(M){return M===47||M===62||rn(M)?U(M):n(M)}function B(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function G(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),Q}function Q(M){return At(M)?Pt(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):le(M)}function le(M){return e.enter("htmlTextData"),l(M)}}const fy={name:"labelEnd",resolveAll:bX,resolveTo:xX,tokenize:yX},mX={tokenize:EX},pX={tokenize:vX},gX={tokenize:TX};function bX(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 i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Vr(e,0,e.length,n),e}function xX(e,t){let n=e.length,r=0,i,a,l,c;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.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}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=as(c,e.slice(a+1,a+r+3)),c=as(c,[["enter",g,t]]),c=as(c,Qm(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=as(c,[["exit",g,t],e[l-2],e[l-1],["exit",f,t]]),c=as(c,e.slice(l+1)),c=as(c,[["exit",d,t]]),Vr(e,a,e.length,c),e}function yX(e,t,n){const r=this;let i=r.events.length,a,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return c;function c(b){return a?a._inactive?m(b):(l=r.parser.defined.includes(ps(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(mX,g,l?g:m)(b):b===91?e.attempt(pX,g,l?f:m)(b):l?g(b):m(b)}function f(b){return e.attempt(gX,g,m)(b)}function g(b){return t(b)}function m(b){return a._balanced=!0,n(b)}}function EX(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return rn(m)?Bc(e,a)(m):a(m)}function a(m){return m===41?g(m):c4(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return rn(m)?Bc(e,d)(m):g(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?f4(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function f(m){return rn(m)?Bc(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function vX(e,t,n){const r=this;return i;function i(c){return d4.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(ps(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function TX(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const SX={name:"labelStartImage",resolveAll:fy.resolveAll,tokenize:CX};function CX(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const wX={name:"labelStartLink",resolveAll:fy.resolveAll,tokenize:kX};function kX(e,t,n){const r=this;return i;function i(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 sb={name:"lineEnding",tokenize:NX};function NX(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Pt(e,t,"linePrefix")}}const Nh={name:"thematicBreak",tokenize:_X};function _X(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||st(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),At(f)?Pt(e,c,"whitespace")(f):c(f))}}const _r={continuation:{tokenize:IX},exit:LX,name:"list",tokenize:OX},AX={partial:!0,tokenize:DX},RX={partial:!0,tokenize:MX};function OX(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return c;function c(x){const v=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:g1(x)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Nh,n,f)(x):f(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return g1(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"),f(x)):n(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(bd,r.interrupt?n:g,e.attempt(AX,b,m))}function g(x){return r.containerState.initialBlankLine=!0,a++,b(x)}function m(x){return At(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 IX(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(bd,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Pt(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!At(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(RX,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Pt(e,e.attempt(_r,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function MX(e,t,n){const r=this;return Pt(e,i,"listItemIndent",r.containerState.size+1);function i(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 LX(e){e.exit(this.containerState.type)}function DX(e,t,n){const r=this;return Pt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!At(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Cw={name:"setextUnderline",resolveTo:jX,tokenize:PX};function jX(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=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[i][1].type="setextHeadingText",a?(e.splice(i,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 PX(e,t,n){const r=this;let i;return a;function a(f){let g=r.events.length,m;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){m=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),At(f)?Pt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||st(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const BX={tokenize:YX,partial:!0};function zX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$X,continuation:{tokenize:VX},exit:qX}},text:{91:{name:"gfmFootnoteCall",tokenize:FX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:HX,resolveTo:UX}}}}function HX(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const d=r.events[i][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 c;function c(d){if(!l||!l._balanced)return n(d);const f=ps(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function UX(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.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)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,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,...c),e}function FX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(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",f)}function f(m){if(a>999||m===93&&!l||m===null||m===91||rn(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return i.includes(ps(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return rn(m)||(l=!0),a++,e.consume(m),m===92?g:f}function g(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}}function $X(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return d;function d(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(v)}function g(v){if(l>999||v===93&&!c||v===null||v===91||rn(v))return n(v);if(v===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return a=ps(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return rn(v)||(c=!0),l++,e.consume(v),v===92?m:g}function m(v){return v===91||v===92||v===93?(e.consume(v),l++,g):g(v)}function b(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(a)||i.push(a),Pt(e,x,"gfmFootnoteDefinitionWhitespace")):n(v)}function x(v){return t(v)}}function VX(e,t,n){return e.check(bd,t,e.attempt(BX,t,n))}function qX(e){e.exit("gfmFootnoteDefinition")}function YX(e,t,n){const r=this;return Pt(e,i,"gfmFootnoteDefinitionIndent",5);function i(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 GX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",g,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",m,c]],x=c.parser.constructs.insideSpan.null;x&&Vr(b,b.length,0,Qm(x,l.slice(f+1,d),c)),Vr(b,b.length,0,[["exit",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",g,c]]),Vr(l,f-1,d-f+3,b),d=f+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,c,d){const f=this.previous,g=this.events;let m=0;return b;function b(v){return f===126&&g[g.length-1][1].type!=="characterEscape"?d(v):(l.enter("strikethroughSequenceTemporary"),x(v))}function x(v){const k=Kl(f);if(v===126)return m>1?d(v):(l.consume(v),m++,x);if(m<2&&!n)return d(v);const w=l.exit("strikethroughSequenceTemporary"),S=Kl(v);return w._open=!S||S===2&&!!k,w._close=!k||k===2&&!!S,c(v)}}}class KX{constructor(){this.map=[]}add(t,n,r){XX(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 i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function XX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function WX(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function QX(){return{flow:{null:{name:"table",tokenize:ZX,resolveAll:JX}}}}function ZX(e,t,n){const r=this;let i=0,a=0,l;return c;function c(z){let X=r.events.length-1;for(;X>-1;){const ee=r.events[X][1].type;if(ee==="lineEnding"||ee==="linePrefix")X--;else break}const W=X>-1?r.events[X][1].type:null,V=W==="tableHead"||W==="tableRow"?R:d;return V===R&&r.parser.lazy[r.now().line]?n(z):V(z)}function d(z){return e.enter("tableHead"),e.enter("tableRow"),f(z)}function f(z){return z===124||(l=!0,a+=1),g(z)}function g(z){return z===null?n(z):st(z)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),x):n(z):At(z)?Pt(e,g,"whitespace")(z):(a+=1,l&&(l=!1,i+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),l=!0,g):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||rn(z)?(e.exit("data"),g(z)):(e.consume(z),z===92?b:m)}function b(z){return z===92||z===124?(e.consume(z),m):m(z)}function x(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),l=!1,At(z)?Pt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):v(z))}function v(z){return z===45||z===58?w(z):z===124?(l=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),k):L(z)}function k(z){return At(z)?Pt(e,w,"whitespace")(z):w(z)}function w(z){return z===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),S):z===45?(a+=1,S(z)):z===null||st(z)?A(z):L(z)}function S(z){return z===45?(e.enter("tableDelimiterFiller"),N(z)):L(z)}function N(z){return z===45?(e.consume(z),N):z===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(z))}function _(z){return At(z)?Pt(e,A,"whitespace")(z):A(z)}function A(z){return z===124?v(z):z===null||st(z)?!l||i!==a?L(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):L(z)}function L(z){return n(z)}function R(z){return e.enter("tableRow"),D(z)}function D(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),D):z===null||st(z)?(e.exit("tableRow"),t(z)):At(z)?Pt(e,D,"whitespace")(z):(e.enter("data"),I(z))}function I(z){return z===null||z===124||rn(z)?(e.exit("data"),D(z)):(e.consume(z),z===92?U:I)}function U(z){return z===92||z===124?(e.consume(z),I):I(z)}}function JX(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,g,m;const b=new KX;for(;++n<e.length;){const x=e[n],v=x[1];x[0]==="enter"?v.type==="tableHead"?(c=!1,d!==0&&(ww(b,t,d,f,g),g=void 0,d=0),f={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},b.add(n,0,[["enter",f,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,g={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},b.add(n,0,[["enter",g,t]])),i=v.type==="tableDelimiterRow"?2:g?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=oh(b,t,a,i,void 0,m),a=[0,0,0,0]),l[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],m=oh(b,t,a,i,void 0,m)),a=l,l=[a[1],n,0,0])):v.type==="tableHead"?(c=!0,d=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],m=oh(b,t,a,i,n,m)):l[1]!==0&&(m=oh(b,t,l,i,n,m)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&ww(b,t,d,f,g),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=WX(t.events,n))}return e}function oh(e,t,n,r,i,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},kl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=kl(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 f=kl(t.events,n[2]),g=kl(t.events,n[3]),m={type:c,start:Object.assign({},f),end:Object.assign({},g)};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 v=n[2]+1,k=n[3]-n[2]-1;e.add(v,k,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(a.end=Object.assign({},kl(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function ww(e,t,n,r,i){const a=[],l=kl(t.events,n);i&&(i.end=Object.assign({},l),a.push(["exit",i,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function kl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const eW={name:"tasklistCheck",tokenize:nW};function tW(){return{text:{91:eW}}}function nW(e,t,n){const r=this;return i;function i(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 rn(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"),c):n(d)}function c(d){return st(d)?t(d):At(d)?e.check({tokenize:rW},t,n)(d):n(d)}}function rW(e,t,n){return Pt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function sW(e){return QR([mK(),zX(),GX(e),QX(),tW()])}const iW={};function aW(e){const t=this,n=e||iW,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(sW(n)),a.push(lK()),l.push(uK(n))}var oW=Object.defineProperty,lW=Object.defineProperties,uW=Object.getOwnPropertyDescriptors,kw=Object.getOwnPropertySymbols,cW=Object.prototype.hasOwnProperty,dW=Object.prototype.propertyIsEnumerable,Nw=(e,t,n)=>t in e?oW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h4=(e,t)=>{for(var n in t||(t={}))cW.call(t,n)&&Nw(e,n,t[n]);if(kw)for(var n of kw(t))dW.call(t,n)&&Nw(e,n,t[n]);return e},m4=(e,t)=>lW(e,uW(t)),yr=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},fW=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},hW=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]==="`"&&!fW(e,n)&&(t+=1)}return t},ca=(e,t)=>{let n=!1,r=!1,i=-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(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}return!1},mW=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,pW=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(mW,(t,n,r,i)=>yr(e,i)?t:`${n}\\>${r}`),gW=/(\*\*)([^*]*\*?)$/,bW=/(__)([^_]*?)$/,xW=/(\*\*\*)([^*]*?)$/,yW=/(\*)([^*]*?)$/,EW=/(_)([^_]*?)$/,vW=/(`)([^`]*?)$/,TW=/(~~)([^~]*?)$/,Io=/^[\s_~*`]*$/,p4=/^[\s]*[-*+][\s]+$/,SW=/[\p{L}\p{N}_]/u,CW=/^```[^`\n]*```?$/,wW=/^\*{4,}$/,kW=/(__)([^_]+)_$/,NW=/(~~)([^~]+)~$/,_w=/~~/g,da=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:SW.test(e)},_W=(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},g4=(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},Zm=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},AW=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
550
- `)return!1}return!1},b4=(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]==="]"?AW(e,t):!1;if(e[n]===`
551
- `)return!1}return!1},RW=(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]===`
552
- `)return!1}return!1},hy=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
553
- `){r=d+1;break}let i=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
554
- `){i=d;break}let a=e.substring(r,i),l=0,c=!1;for(let d of a)if(d===n)l+=1;else if(d!==" "&&d!==" "){c=!0;break}return l>=3&&!c},OW=(e,t,n,r)=>n==="\\"||e.includes("$")&&Zm(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&da(n)&&da(r)||(!n||n===" "||n===" "||n===`
555
- `)&&(!r||r===" "||r===" "||r===`
556
- `)),x4=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let a=i>0?e[i-1]:"",l=i<r-1?e[i+1]:"";OW(e,i,a,l)||(t+=1)}return t},IW=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&Zm(e,t)||b4(e,t)||RW(e,t)||n==="_"||r==="_"||n&&r&&da(n)&&da(r)),MW=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let a=i>0?e[i-1]:"",l=i<r-1?e[i+1]:"";IW(e,i,a,l)||(t+=1)}return t},LW=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},my=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},Aw=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},DW=(e,t,n)=>{if(!t||Io.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
557
- `),i=r===-1?0:r+1,a=e.substring(i,n);return p4.test(a)&&t.includes(`
558
- `)?!0:hy(e,n,"*")},jW=e=>{let t=e.match(gW);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return yr(e,r)||ca(e,r)||DW(e,n,r)?e:my(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},PW=(e,t,n)=>{if(!t||Io.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
559
- `),i=r===-1?0:r+1,a=e.substring(i,n);return p4.test(a)&&t.includes(`
560
- `)?!0:hy(e,n,"_")},BW=e=>{let t=e.match(bW);if(!t){let i=e.match(kW);if(i){let a=e.lastIndexOf(i[1]);if(!(yr(e,a)||ca(e,a))&&Aw(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return yr(e,r)||ca(e,r)||PW(e,n,r)?e:Aw(e)%2===1?`${e}__`:e},zW=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]!=="\\"&&!Zm(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
561
- `)&&(!i||i===" "||i===" "||i===`
562
- `)||r&&i&&da(r)&&da(i))continue;return n}}return-1},HW=e=>{if(!e.match(yW))return e;let t=zW(e);if(t===-1||yr(e,t)||ca(e,t))return e;let n=e.substring(t+1);return!n||Io.test(n)?e:x4(e)%2===1?`${e}*`:e},y4=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]!=="\\"&&!Zm(e,n)&&!b4(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&da(r)&&da(i))continue;return n}}return-1},UW=e=>{let t=e.length;for(;t>0&&e[t-1]===`
563
- `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},FW=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(my(t)%2!==1)return null;let n=t.indexOf("**"),r=y4(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},$W=e=>{if(!e.match(EW))return e;let t=y4(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||Io.test(n)||yr(e,t)||ca(e,t))return e;if(MW(e)%2===1){let r=FW(e);return r!==null?r:UW(e)}return e},VW=e=>{let t=my(e),n=x4(e);return t%2===0&&n%2===0},qW=(e,t,n)=>!t||Io.test(t)||yr(e,n)||ca(e,n)?!0:hy(e,n,"*"),YW=e=>{if(wW.test(e))return e;let t=e.match(xW);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return qW(e,n,r)?e:LW(e)%2===1?VW(e)?e:`${e}***`:e},GW=/<[a-zA-Z/][^>]*$/,KW=e=>{let t=e.match(GW);return!t||t.index===void 0||yr(e,t.index)?e:e.substring(0,t.index).trimEnd()},XW=e=>!e.match(CW)||e.includes(`
564
- `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,WW=e=>(e.match(/```/g)||[]).length%2===1,QW=e=>{let t=XW(e);if(t!==null)return t;let n=e.match(vW);if(n&&!WW(e)){let r=n[2];if(!r||Io.test(r))return e;if(hW(e)%2===1)return`${e}\``}return e},E4=(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)==="```",ZW=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!E4(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},JW=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!E4(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},eQ=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
565
- `,t)!==-1&&!e.endsWith(`
566
- `)?`${e}
567
- $$`:`${e}$$`},tQ=e=>ZW(e)%2===0?e:eQ(e),nQ=e=>JW(e)%2===1?`${e}$`:e,rQ=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=_W(e,t);if(r===-1||yr(e,r))return null;let i=r>0&&e[r-1]==="!",a=i?r-1:r,l=e.substring(0,a);if(i)return l;let c=e.substring(r+1,t);return n==="text-only"?`${l}${c}`:`${l}[${c}](streamdown:incomplete-link)`},Rw=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!yr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=g4(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},sQ=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let a=e.substring(0,i);if(r)return a;if(n==="text-only"){let l=Rw(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}if(g4(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n==="text-only"){let l=Rw(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}return null},v4=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!yr(e,n)){let r=rQ(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!yr(e,r)){let i=sQ(e,r,t);if(i!==null)return i}return e},iQ=/^-{1,2}$/,aQ=/^[\s]*-{1,2}[\s]+$/,oQ=/^={1,2}$/,lQ=/^[\s]*={1,2}[\s]+$/,uQ=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
568
- `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(iQ.test(i)&&!n.match(aQ)){let a=r.split(`
569
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}if(oQ.test(i)&&!n.match(lQ)){let a=r.split(`
570
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}return e},cQ=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),dQ=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(cQ,(t,n)=>yr(e,n)?t:"\\~"),fQ=e=>{var t,n;let r=e.match(TW);if(r){let i=r[2];if(!i||Io.test(i))return e;let a=e.lastIndexOf(r[1]);if(yr(e,a)||ca(e,a))return e;if(((t=e.match(_w))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(NW);if(i){let a=e.lastIndexOf(i[0].slice(0,2));if(yr(e,a)||ca(e,a))return e;if(((n=e.match(_w))==null?void 0:n.length)%2===1)return`${e}~`}}return e},ib=e=>e!==!1,hQ=e=>e===!0,fr={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},mQ=[{handler:{name:"singleTilde",handle:dQ,priority:fr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:pW,priority:fr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:KW,priority:fr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:uQ,priority:fr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:v4,priority:fr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:YW,priority:fr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:jW,priority:fr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:BW,priority:fr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:HW,priority:fr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:$W,priority:fr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:QW,priority:fr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:fQ,priority:fr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:tQ,priority:fr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:nQ,priority:fr.INLINE_KATEX},optionKey:"inlineKatex"}],pQ=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return mQ.filter(({handler:r,optionKey:i})=>r.name==="links"?ib(e?.links)||ib(e?.images):r.name==="inlineKatex"?hQ(e?.inlineKatex):ib(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:m4(h4({},r),{handle:a=>v4(a,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},gQ=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=pQ(t),a=((n=t?.handlers)!=null?n:[]).map(c=>{var d;return{handler:m4(h4({},c),{priority:(d=c.priority)!=null?d:fr.DEFAULT}),earlyReturn:void 0}}),l=[...i,...a].sort((c,d)=>{var f,g;return((f=c.handler.priority)!=null?f:0)-((g=d.handler.priority)!=null?g:0)});for(let{handler:c,earlyReturn:d}of l)if(r=c.handle(r),d!=null&&d(r))return r;return r},bQ=gQ;const xQ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yQ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,EQ={};function Ow(e,t){return(EQ.jsx?yQ:xQ).test(e)}const vQ=/[ \t\n\f\r]/g;function TQ(e){return typeof e=="object"?e.type==="text"?Iw(e.value):!1:Iw(e)}function Iw(e){return e.replace(vQ,"")===""}var El={},ab,Mw;function SQ(){if(Mw)return ab;Mw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
571
- `,f="/",g="*",m="",b="comment",x="declaration";function v(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var N=1,_=1;function A(ee){var q=ee.match(t);q&&(N+=q.length);var B=ee.lastIndexOf(d);_=~B?ee.length-B:_+ee.length}function L(){var ee={line:N,column:_};return function(q){return q.position=new R(ee),U(),q}}function R(ee){this.start=ee,this.end={line:N,column:_},this.source=S.source}R.prototype.content=w;function D(ee){var q=new Error(S.source+":"+N+":"+_+": "+ee);if(q.reason=ee,q.filename=S.source,q.line=N,q.column=_,q.source=w,!S.silent)throw q}function I(ee){var q=ee.exec(w);if(q){var B=q[0];return A(B),w=w.slice(B.length),q}}function U(){I(n)}function z(ee){var q;for(ee=ee||[];q=X();)q!==!1&&ee.push(q);return ee}function X(){var ee=L();if(!(f!=w.charAt(0)||g!=w.charAt(1))){for(var q=2;m!=w.charAt(q)&&(g!=w.charAt(q)||f!=w.charAt(q+1));)++q;if(q+=2,m===w.charAt(q-1))return D("End of comment missing");var B=w.slice(2,q-2);return _+=2,A(B),w=w.slice(q),_+=2,ee({type:b,comment:B})}}function W(){var ee=L(),q=I(r);if(q){if(X(),!I(i))return D("property missing ':'");var B=I(a),G=ee({type:x,property:k(q[0].replace(e,m)),value:B?k(B[0].replace(e,m)):m});return I(l),G}}function V(){var ee=[];z(ee);for(var q;q=W();)q!==!1&&(ee.push(q),z(ee));return ee}return U(),V()}function k(w){return w?w.replace(c,m):m}return ab=v,ab}var Lw;function CQ(){if(Lw)return El;Lw=1;var e=El&&El.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(El,"__esModule",{value:!0}),El.default=n;const t=e(SQ());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof i=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:g}=d;c?i(f,g,d):g&&(a=a||{},a[f]=g)}),a}return El}var hc={},Dw;function wQ(){if(Dw)return hc;Dw=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,g){return g.toUpperCase()},c=function(f,g){return"".concat(g,"-")},d=function(f,g){return g===void 0&&(g={}),a(f)?f:(f=f.toLowerCase(),g.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,l))};return hc.camelCase=d,hc}var mc,jw;function kQ(){if(jw)return mc;jw=1;var e=mc&&mc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(CQ()),n=wQ();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,mc=r,mc}var NQ=kQ();const _Q=um(NQ);function zc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Pw(e.position):"start"in e||"end"in e?Pw(e):"line"in e||"column"in e?y1(e):""}function y1(e){return Bw(e&&e.line)+":"+Bw(e&&e.column)}function Pw(e){return y1(e&&e.start)+"-"+y1(e&&e.end)}function Bw(e){return e&&typeof e=="number"?e:1}class cr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",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"?i=t:!a.cause&&t&&(l=!0,i=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 c=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=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=zc(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}}cr.prototype.file="";cr.prototype.name="";cr.prototype.reason="";cr.prototype.message="";cr.prototype.stack="";cr.prototype.column=void 0;cr.prototype.line=void 0;cr.prototype.ancestors=void 0;cr.prototype.cause=void 0;cr.prototype.fatal=void 0;cr.prototype.place=void 0;cr.prototype.ruleId=void 0;cr.prototype.source=void 0;const py={}.hasOwnProperty,AQ=new Map,RQ=/[A-Z]/g,OQ=new Set(["table","tbody","thead","tfoot","tr"]),IQ=new Set(["td","th"]),T4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function MQ(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=UQ(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=HQ(n,t.jsx,t.jsxs)}const i={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"?ya:hd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=S4(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function S4(e,t,n){if(t.type==="element")return LQ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return DQ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return PQ(e,t,n);if(t.type==="mdxjsEsm")return jQ(e,t);if(t.type==="root")return BQ(e,t,n);if(t.type==="text")return zQ(e,t)}function LQ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ya,e.schema=i),e.ancestors.push(t);const a=w4(e,t.tagName,!1),l=FQ(e,t);let c=by(e,t);return OQ.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!TQ(d):!0})),C4(e,l,a,t),gy(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function DQ(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)}nd(e,t.position)}function jQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);nd(e,t.position)}function PQ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ya,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:w4(e,t.name,!0),l=$Q(e,t),c=by(e,t);return C4(e,l,a,t),gy(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function BQ(e,t,n){const r={};return gy(r,by(e,t)),e.create(t,e.Fragment,r,n)}function zQ(e,t){return t.value}function C4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function gy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function HQ(e,t,n){return r;function r(i,a,l,c){const f=Array.isArray(l.children)?n:t;return c?f(a,l,c):f(a,l)}}function UQ(e,t){return n;function n(r,i,a,l){const c=Array.isArray(a.children),d=zs(r);return t(i,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function FQ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&py.call(t.properties,i)){const a=VQ(e,i,t.properties[i]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&IQ.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function $Q(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 c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else nd(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else nd(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function by(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:AQ;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 f=i.get(d)||0;l=d+"-"+f,i.set(d,f+1)}}const c=S4(e,a,l);c!==void 0&&n.push(c)}return n}function VQ(e,t,n){const r=Vm(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?VA(n):qA(n)),r.property==="style"){let i=typeof n=="object"?n:qQ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=YQ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?n$[r.property]||r.property:r.attribute,n]}}function qQ(e,t){try{return _Q(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new cr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=T4+"#cannot-parse-style-attribute",i}}function w4(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,l;for(;++a<i.length;){const c=Ow(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=Ow(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return py.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);nd(e)}function nd(e,t){const n=new cr("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=T4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function YQ(e){const t={};let n;for(n in e)py.call(e,n)&&(t[GQ(n)]=e[n]);return t}function GQ(e){let t=e.replace(RQ,KQ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function KQ(e){return"-"+e.toLowerCase()}const ob={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"]},XQ={tokenize:WQ};function WQ(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Pt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return st(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const QQ={tokenize:ZQ},zw={tokenize:JQ};function ZQ(e){const t=this,n=[];let r=0,i,a,l;return c;function c(_){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&N();const A=t.events.length;let L=A,R;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){R=t.events[L][1].end;break}S(r);let D=A;for(;D<t.events.length;)t.events[D][1].end={...R},D++;return Vr(t.events,L+1,0,t.events.slice(A)),t.events.length=D,f(_)}return c(_)}function f(_){if(r===n.length){if(!i)return b(_);if(i.currentConstruct&&i.currentConstruct.concrete)return v(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zw,g,m)(_)}function g(_){return i&&N(),S(r),b(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,v(_)}function b(_){return t.containerState={},e.attempt(zw,x,v)(_)}function x(_){return r++,n.push([t.currentConstruct,t.containerState]),b(_)}function v(_){if(_===null){i&&N(),S(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),k(_)}function k(_){if(_===null){w(e.exit("chunkFlow"),!0),S(0),e.consume(_);return}return st(_)?(e.consume(_),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(_),k)}function w(_,A){const L=t.sliceStream(_);if(A&&L.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(L),t.parser.lazy[_.start.line]){let R=i.events.length;for(;R--;)if(i.events[R][1].start.offset<l&&(!i.events[R][1].end||i.events[R][1].end.offset>l))return;const D=t.events.length;let I=D,U,z;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(U){z=t.events[I][1].end;break}U=!0}for(S(r),R=D;R<t.events.length;)t.events[R][1].end={...z},R++;Vr(t.events,I+1,0,t.events.slice(D)),t.events.length=R}}function S(_){let A=n.length;for(;A-- >_;){const L=n[A];t.containerState=L[1],L[0].exit.call(t,e)}n.length=_}function N(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function JQ(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 eZ={tokenize:tZ};function tZ(e){const t=this,n=e.attempt(bd,r,e.attempt(this.parser.constructs.flowInitial,i,Pt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(VK,i)),"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 i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const nZ={resolveAll:N4()},rZ=k4("string"),sZ=k4("text");function k4(e){return{resolveAll:N4(e==="text"?iZ:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,c);return l;function l(g){return f(g)?a(g):c(g)}function c(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),d}function d(g){return f(g)?(n.exit("data"),a(g)):(n.consume(g),d)}function f(g){if(g===null)return!0;const m=i[g];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 N4(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function iZ(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],i=t.sliceStream(r);let a=i.length,l=-1,c=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const aZ={42:_r,43:_r,45:_r,48:_r,49:_r,50:_r,51:_r,52:_r,53:_r,54:_r,55:_r,56:_r,57:_r,62:a4},oZ={91:XK},lZ={[-2]:rb,[-1]:rb,32:rb},uZ={35:tX,42:Nh,45:[Cw,Nh],60:iX,61:Cw,95:Nh,96:Tw,126:Tw},cZ={38:l4,92:o4},dZ={[-5]:sb,[-4]:sb,[-3]:sb,33:SX,38:l4,42:x1,60:[wK,fX],91:wX,92:[JK,o4],93:fy,95:x1,96:BK},fZ={null:[x1,nZ]},hZ={null:[42,95]},mZ={null:[]},pZ=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:hZ,contentInitial:oZ,disable:mZ,document:aZ,flow:uZ,flowInitial:lZ,insideSpan:fZ,string:cZ,text:dZ},Symbol.toStringTag,{value:"Module"}));function gZ(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 i={},a=[];let l=[],c=[];const d={attempt:D(L),check:D(R),consume:N,enter:_,exit:A,interrupt:D(R,{interrupt:!0})},f={code:null,containerState:{},defineSkip:k,events:[],now:v,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:m};let g=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(X){return l=as(l,X),w(),l[l.length-1]!==null?[]:(I(t,0),f.events=Qm(a,f.events,f),f.events)}function b(X,W){return xZ(x(X),W)}function x(X){return bZ(l,X)}function v(){const{_bufferIndex:X,_index:W,line:V,column:ee,offset:q}=r;return{_bufferIndex:X,_index:W,line:V,column:ee,offset:q}}function k(X){i[X.line]=X.column,z()}function w(){let X;for(;r._index<l.length;){const W=l[r._index];if(typeof W=="string")for(X=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===X&&r._bufferIndex<W.length;)S(W.charCodeAt(r._bufferIndex));else S(W)}}function S(X){g=g(X)}function N(X){st(X)?(r.line++,r.column=1,r.offset+=X===-3?2:1,z()):X!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=X}function _(X,W){const V=W||{};return V.type=X,V.start=v(),f.events.push(["enter",V,f]),c.push(V),V}function A(X){const W=c.pop();return W.end=v(),f.events.push(["exit",W,f]),W}function L(X,W){I(X,W.from)}function R(X,W){W.restore()}function D(X,W){return V;function V(ee,q,B){let G,Q,le,M;return Array.isArray(ee)?F(ee):"tokenize"in ee?F([ee]):P(ee);function P(ce){return de;function de(fe){const ve=fe!==null&&ce[fe],Fe=fe!==null&&ce.null,Le=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return F(Le)(fe)}}function F(ce){return G=ce,Q=0,ce.length===0?B:j(ce[Q])}function j(ce){return de;function de(fe){return M=U(),le=ce,ce.partial||(f.currentConstruct=ce),ce.name&&f.parser.constructs.disable.null.includes(ce.name)?ie():ce.tokenize.call(W?Object.assign(Object.create(f),W):f,d,ae,ie)(fe)}}function ae(ce){return X(le,M),q}function ie(ce){return M.restore(),++Q<G.length?j(G[Q]):B}}}function I(X,W){X.resolveAll&&!a.includes(X)&&a.push(X),X.resolve&&Vr(f.events,W,f.events.length-W,X.resolve(f.events.slice(W),f)),X.resolveTo&&(f.events=X.resolveTo(f.events,f))}function U(){const X=v(),W=f.previous,V=f.currentConstruct,ee=f.events.length,q=Array.from(c);return{from:ee,restore:B};function B(){r=X,f.previous=W,f.currentConstruct=V,f.events.length=ee,c=q,z()}}function z(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function bZ(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,a)];else{if(l=e.slice(n,i),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function xZ(e,t){let n=-1;const r=[];let i;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=`
572
- `;break}case-3:{l=`\r
573
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function yZ(e){const r={constructs:QR([pZ,...(e||{}).extensions||[]]),content:i(XQ),defined:[],document:i(QQ),flow:i(eZ),lazy:{},string:i(rZ),text:i(sZ)};return r;function i(a){return l;function l(c){return gZ(r,a,c)}}}function EZ(e){for(;!u4(e););return e}const Hw=/[\0\t\n\r]/g;function vZ(){let e=1,t="",n=!0,r;return i;function i(a,l,c){const d=[];let f,g,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(Hw.lastIndex=m,f=Hw.exec(a),b=f&&f.index!==void 0?f.index:a.length,x=a.charCodeAt(b),!f){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(g=Math.ceil(e/4)*4,d.push(-2);e++<g;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=b+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const _4={}.hasOwnProperty;function TZ(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),SZ(n)(EZ(yZ(n).document().write(vZ()(e,t,!0))))}function SZ(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ye),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(Ge),blockQuote:a(Fe),characterEscape:U,characterReference:U,codeFenced:a(Le),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Le,l),codeText:a(Ee,l),codeTextData:U,data:U,codeFlowValue:U,definition:a(Oe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ze),hardBreakEscape:a($e),hardBreakTrailing:a($e),htmlFlow:a(De,l),htmlFlowData:U,htmlText:a(De,l),htmlTextData:U,image:a(ke),label:l,link:a(ye),listItem:a(je),listItemValue:b,listOrdered:a(Ie,m),listUnordered:a(Ie),paragraph:a(te),reference:j,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ge),strong:a(me),thematicBreak:a(re)},exit:{atxHeading:d(),atxHeadingSequence:L,autolink:d(),autolinkEmail:ve,autolinkProtocol:fe,blockQuote:d(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ce,characterReference:de,codeFenced:d(w),codeFencedFence:k,codeFencedFenceInfo:x,codeFencedFenceMeta:v,codeFlowValue:z,codeIndented:d(S),codeText:d(q),codeTextData:z,data:z,definition:d(),definitionDestinationString:A,definitionLabelString:N,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(W),hardBreakTrailing:d(W),htmlFlow:d(V),htmlFlowData:z,htmlText:d(ee),htmlTextData:z,image:d(G),label:le,labelText:Q,lineEnding:X,link:d(B),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ae,resourceDestinationString:M,resourceTitleString:P,resource:F,setextHeading:d(I),setextHeadingLineSequence:D,setextHeadingText:R,strong:d(),thematicBreak:d()}};A4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let $={type:"root",children:[]};const oe={stack:[$],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:g,data:n},Ce=[];let Re=-1;for(;++Re<K.length;)if(K[Re][1].type==="listOrdered"||K[Re][1].type==="listUnordered")if(K[Re][0]==="enter")Ce.push(Re);else{const Ve=Ce.pop();Re=i(K,Ve,Re)}for(Re=-1;++Re<K.length;){const Ve=t[K[Re][0]];_4.call(Ve,K[Re][1].type)&&Ve[K[Re][1].type].call(Object.assign({sliceSerialize:K[Re][2].sliceSerialize},oe),K[Re][1])}if(oe.tokenStack.length>0){const Ve=oe.tokenStack[oe.tokenStack.length-1];(Ve[1]||Uw).call(oe,void 0,Ve[0])}for($.position={start:Ki(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Ki(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re<t.transforms.length;)$=t.transforms[Re]($)||$;return $}function i(K,$,oe){let Ce=$-1,Re=-1,Ve=!1,ot,et,dt,ut;for(;++Ce<=oe;){const qe=K[Ce];switch(qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{qe[0]==="enter"?Re++:Re--,ut=void 0;break}case"lineEndingBlank":{qe[0]==="enter"&&(ot&&!ut&&!Re&&!dt&&(dt=Ce),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Re&&qe[0]==="enter"&&qe[1].type==="listItemPrefix"||Re===-1&&qe[0]==="exit"&&(qe[1].type==="listUnordered"||qe[1].type==="listOrdered")){if(ot){let Rt=Ce;for(et=void 0;Rt--;){const jt=K[Rt];if(jt[1].type==="lineEnding"||jt[1].type==="lineEndingBlank"){if(jt[0]==="exit")continue;et&&(K[et][1].type="lineEndingBlank",Ve=!0),jt[1].type="lineEnding",et=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&&(!et||dt<et)&&(ot._spread=!0),ot.end=Object.assign({},et?K[et][1].start:qe[1].end),K.splice(et||Ce,0,["exit",ot,qe[2]]),Ce++,oe++}if(qe[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},qe[1].start),end:void 0};ot=Rt,K.splice(Ce,0,["enter",Rt,qe[2]]),Ce++,oe++,dt=void 0,ut=!0}}}return K[$][1]._spread=Ve,oe}function a(K,$){return oe;function oe(Ce){c.call(this,K(Ce),Ce),$&&$.call(this,Ce)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(K,$,oe){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([$,oe||void 0]),K.position={start:Ki($.start),end:void 0}}function d(K){return $;function $(oe){K&&K.call(this,oe),f.call(this,oe)}}function f(K,$){const oe=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==K.type&&($?$.call(this,K,Ce[0]):(Ce[1]||Uw).call(this,K,Ce[0]));else throw new Error("Cannot close `"+K.type+"` ("+zc({start:K.start,end:K.end})+"): it’s not open");oe.position.end=Ki(K.end)}function g(){return ly(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function b(K){if(this.data.expectingFirstListItemValue){const $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function x(){const K=this.resume(),$=this.stack[this.stack.length-1];$.lang=K}function v(){const K=this.resume(),$=this.stack[this.stack.length-1];$.meta=K}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const K=this.resume(),$=this.stack[this.stack.length-1];$.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const K=this.resume(),$=this.stack[this.stack.length-1];$.value=K.replace(/(\r?\n|\r)$/g,"")}function N(K){const $=this.resume(),oe=this.stack[this.stack.length-1];oe.label=$,oe.identifier=ps(this.sliceSerialize(K)).toLowerCase()}function _(){const K=this.resume(),$=this.stack[this.stack.length-1];$.title=K}function A(){const K=this.resume(),$=this.stack[this.stack.length-1];$.url=K}function L(K){const $=this.stack[this.stack.length-1];if(!$.depth){const oe=this.sliceSerialize(K).length;$.depth=oe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(K){const $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function U(K){const oe=this.stack[this.stack.length-1].children;let Ce=oe[oe.length-1];(!Ce||Ce.type!=="text")&&(Ce=Z(),Ce.position={start:Ki(K.start),end:void 0},oe.push(Ce)),this.stack.push(Ce)}function z(K){const $=this.stack.pop();$.value+=this.sliceSerialize(K),$.position.end=Ki(K.end)}function X(K){const $=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=$.children[$.children.length-1];oe.position.end=Ki(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes($.type)&&(U.call(this,K),z.call(this,K))}function W(){this.data.atHardBreak=!0}function V(){const K=this.resume(),$=this.stack[this.stack.length-1];$.value=K}function ee(){const K=this.resume(),$=this.stack[this.stack.length-1];$.value=K}function q(){const K=this.resume(),$=this.stack[this.stack.length-1];$.value=K}function B(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=$,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function G(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const $=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=$,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function Q(K){const $=this.sliceSerialize(K),oe=this.stack[this.stack.length-2];oe.label=XG($),oe.identifier=ps($).toLowerCase()}function le(){const K=this.stack[this.stack.length-1],$=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const Ce=K.children;oe.children=Ce}else oe.alt=$}function M(){const K=this.resume(),$=this.stack[this.stack.length-1];$.url=K}function P(){const K=this.resume(),$=this.stack[this.stack.length-1];$.title=K}function F(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function ae(K){const $=this.resume(),oe=this.stack[this.stack.length-1];oe.label=$,oe.identifier=ps(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function ie(K){this.data.characterReferenceType=K.type}function ce(K){const $=this.sliceSerialize(K),oe=this.data.characterReferenceType;let Ce;oe?(Ce=WR($,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=cy($);const Re=this.stack[this.stack.length-1];Re.value+=Ce}function de(K){const $=this.stack.pop();$.position.end=Ki(K.end)}function fe(K){z.call(this,K);const $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(K)}function ve(K){z.call(this,K);const $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(K)}function Fe(){return{type:"blockquote",children:[]}}function Le(){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 ze(){return{type:"emphasis",children:[]}}function Ge(){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 ye(){return{type:"link",title:null,url:"",children:[]}}function Ie(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function je(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function te(){return{type:"paragraph",children:[]}}function me(){return{type:"strong",children:[]}}function Z(){return{type:"text",value:""}}function re(){return{type:"thematicBreak"}}}function Ki(e){return{line:e.line,column:e.column,offset:e.offset}}function A4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?A4(e,r):CZ(e,r)}}function CZ(e,t){let n;for(n in t)if(_4.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 Uw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zc({start:t.start,end:t.end})+") is still open")}function wZ(e){const t=this;t.parser=n;function n(r){return TZ(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function kZ(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 NZ(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
574
- `}]}function _Z(e,t){const n=t.value?t.value+`
575
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[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 AZ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RZ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OZ(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=uu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function IZ(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 MZ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function R4(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function LZ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return R4(e,t);const i={src:uu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function DZ(e,t){const n={src:uu(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 jZ(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 PZ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return R4(e,t);const i={href:uu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function BZ(e,t){const n={href:uu(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 zZ(e,t,n){const r=e.all(t),i=n?HZ(n):O4(t),a={},l=[];if(typeof t.checked=="boolean"){const g=r[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(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 c=-1;for(;++c<r.length;){const g=r[c];(i||c!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
576
- `}),g.type==="element"&&g.tagName==="p"&&!i?l.push(...g.children):l.push(g)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
577
- `});const f={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,f),e.applyData(t,f)}function HZ(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=O4(n[r])}return t}function O4(e){const t=e.spread;return t??e.children.length>1}function UZ(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];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 FZ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $Z(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function VZ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qZ(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=zs(t.children[1]),d=Xm(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function YZ(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,c=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const m=t.children[d],b={},x=l?l[d]:void 0;x&&(b.align=x);let v={type:"element",tagName:a,properties:b,children:[]};m&&(v.children=e.all(m),e.patch(m,v),v=e.applyData(m,v)),f.push(v)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,g),e.applyData(t,g)}function GZ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Fw=9,$w=32;function KZ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(Vw(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Vw(t.slice(i),i>0,!1)),a.join("")}function Vw(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Fw||a===$w;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Fw||a===$w;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function XZ(e,t){const n={type:"text",value:KZ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function WZ(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const QZ={blockquote:kZ,break:NZ,code:_Z,delete:AZ,emphasis:RZ,footnoteReference:OZ,heading:IZ,html:MZ,imageReference:LZ,image:DZ,inlineCode:jZ,linkReference:PZ,link:BZ,listItem:zZ,list:UZ,paragraph:FZ,root:$Z,strong:VZ,table:qZ,tableCell:GZ,tableRow:YZ,text:XZ,thematicBreak:WZ,toml:lh,yaml:lh,definition:lh,footnoteDefinition:lh};function lh(){}function ZZ(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 JZ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function eJ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ZZ,r=e.options.footnoteBackLabel||JZ,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const g=e.all(f),m=String(f.identifier).toUpperCase(),b=uu(m.toLowerCase());let x=0;const v=[],k=e.footnoteCounts.get(m);for(;k!==void 0&&++x<=k;){v.length>0&&v.push({type:"text",value:" "});let N=typeof n=="string"?n:n(d,x);typeof N=="string"&&(N={type:"text",value:N}),v.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(N)?N:[N]})}const w=g[g.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const N=w.children[w.children.length-1];N&&N.type==="text"?N.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...v)}else g.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(f,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...yo(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
578
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
579
- `}]}}const E1={}.hasOwnProperty,tJ={};function nJ(e,t){const n=t||tJ,r=new Map,i=new Map,a=new Map,l={...QZ,...n.handlers},c={all:f,applyData:sJ,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:rJ,wrap:aJ};return Bs(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?r:i,b=String(g.identifier).toUpperCase();m.has(b)||m.set(b,g)}}),c;function d(g,m){const b=g.type,x=c.handlers[b];if(E1.call(c.handlers,b)&&x)return x(c,g,m);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in g){const{children:k,...w}=g,S=yo(w);return S.children=c.all(g),S}return yo(g)}return(c.options.unknownHandler||iJ)(c,g,m)}function f(g){const m=[];if("children"in g){const b=g.children;let x=-1;for(;++x<b.length;){const v=c.one(b[x],g);if(v){if(x&&b[x-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=qw(v.value)),!Array.isArray(v)&&v.type==="element")){const k=v.children[0];k&&k.type==="text"&&(k.value=qw(k.value))}Array.isArray(v)?m.push(...v):m.push(v)}}}return m}}function rJ(e,t){e.position&&(t.position=wR(e))}function sJ(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=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,yo(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function iJ(e,t){const n=t.data||{},r="value"in t&&!(E1.call(n,"hProperties")||E1.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 aJ(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
580
- `});++r<e.length;)r&&n.push({type:"text",value:`
581
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
582
- `}),n}function qw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Yw(e,t){const n=nJ(e,t),r=n.one(e,void 0),i=eJ(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
583
- `},i),a}function oJ(e,t){return e&&"run"in e?async function(n,r){const i=Yw(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Yw(n,{file:r,...e||t})}}function Gw(e){if(e)throw e}var lb,Kw;function lJ(){if(Kw)return lb;Kw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var g=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!g&&!m)return!1;var b;for(b in f);return typeof b>"u"||e.call(f,b)},l=function(f,g){n&&g.name==="__proto__"?n(f,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):f[g.name]=g.newValue},c=function(f,g){if(g==="__proto__")if(e.call(f,g)){if(r)return r(f,g).value}else return;return f[g]};return lb=function d(){var f,g,m,b,x,v,k=arguments[0],w=1,S=arguments.length,N=!1;for(typeof k=="boolean"&&(N=k,k=arguments[1]||{},w=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});w<S;++w)if(f=arguments[w],f!=null)for(g in f)m=c(k,g),b=c(f,g),k!==b&&(N&&b&&(a(b)||(x=i(b)))?(x?(x=!1,v=m&&i(m)?m:[]):v=m&&a(m)?m:{},l(k,{name:g,newValue:d(N,v,b)})):typeof b<"u"&&l(k,{name:g,newValue:b}));return k},lb}var uJ=lJ();const ub=um(uJ);function v1(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 cJ(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...i);function c(d,...f){const g=e[++a];let m=-1;if(d){l(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,g?dJ(g,c)(...f):l(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function dJ(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(i);try{d=e.apply(this,l)}catch(f){const g=f;if(c&&n)throw g;return i(g)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(l,...c){n||(n=!0,t(l,...c))}function a(l){i(null,l)}}const Ns={basename:fJ,dirname:hJ,extname:mJ,join:pJ,sep:"/"};function fJ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xd(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function hJ(e){if(xd(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 mJ(e){xd(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function pJ(...e){let t=-1,n;for(;++t<e.length;)xd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gJ(n)}function gJ(e){xd(e);const t=e.codePointAt(0)===47;let n=bJ(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function bJ(e,t){let n="",r=0,i=-1,a=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(i===l-1||a===1))if(i!==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("/")),i=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function xd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xJ={cwd:yJ};function yJ(){return"/"}function T1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function EJ(e){if(typeof e=="string")e=new URL(e);else if(!T1(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 vJ(e)}function vJ(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const cb=["history","path","basename","stem","extname","dirname"];class TJ{constructor(t){let n;t?T1(t)?n={path:t}:typeof t=="string"||SJ(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xJ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cb.length;){const a=cb[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)cb.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ns.basename(this.path):void 0}set basename(t){fb(t,"basename"),db(t,"basename"),this.path=Ns.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ns.dirname(this.path):void 0}set dirname(t){Xw(this.basename,"dirname"),this.path=Ns.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ns.extname(this.path):void 0}set extname(t){if(db(t,"extname"),Xw(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=Ns.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){T1(t)&&(t=EJ(t)),fb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ns.basename(this.path,this.extname):void 0}set stem(t){fb(t,"stem"),db(t,"stem"),this.path=Ns.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new cr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function db(e,t){if(e&&e.includes(Ns.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ns.sep+"`")}function fb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Xw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function SJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CJ=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),wJ={}.hasOwnProperty;class xy extends CJ{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=cJ()}copy(){const t=new xy;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ub(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(pb("data",this.frozen),this.namespace[t]=n,this):wJ.call(this.namespace,t)&&this.namespace[t]||void 0:t?(pb("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 i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=uh(t),r=this.parser||this.Parser;return hb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),hb("process",this.parser||this.Parser),mb("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const c=uh(t),d=r.parse(c);r.run(d,c,function(g,m,b){if(g||!m||!b)return f(g);const x=m,v=r.stringify(x,b);_J(v)?b.value=v:b.result=v,f(g,b)});function f(g,m){g||!m?l(g):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),hb("processSync",this.parser||this.Parser),mb("processSync",this.compiler||this.Compiler),this.process(t,i),Qw("processSync","process",n),r;function i(a,l){n=!0,Gw(a),r=l}}run(t,n,r){Ww(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,c){const d=uh(n);i.run(t,d,f);function f(g,m,b){const x=m||t;g?c(g):l?l(x):r(void 0,x,b)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Qw("runSync","run",r),i;function a(l,c){Gw(l),i=c,r=!0}}stringify(t,n){this.freeze();const r=uh(n),i=this.compiler||this.Compiler;return mb("stringify",i),Ww(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(pb("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[g,...m]=f;d(g,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))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");c(f.plugins),f.settings&&(i.settings=ub(!0,i.settings,f.settings))}function c(f){let g=-1;if(f!=null)if(Array.isArray(f))for(;++g<f.length;){const m=f[g];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,g){let m=-1,b=-1;for(;++m<r.length;)if(r[m][0]===f){b=m;break}if(b===-1)r.push([f,...g]);else if(g.length>0){let[x,...v]=g;const k=r[b][1];v1(k)&&v1(x)&&(x=ub(!0,k,x)),r[b]=[f,x,...v]}}}}const kJ=new xy().freeze();function hb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function mb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pb(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 Ww(e){if(!v1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Qw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function uh(e){return NJ(e)?e:new TJ(e)}function NJ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _J(e){return typeof e=="string"||AJ(e)}function AJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function yy(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Mo=yy();function I4(e){Mo=e}var Ka={exec:()=>null};function Bt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(pr.caret,"$1"),n=n.replace(i,l),r},getRegex:()=>new RegExp(n,t)};return r}var RJ=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),pr={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)}}>`)},OJ=/^(?:[ \t]*(?:\n|$))+/,IJ=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,MJ=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,LJ=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ey=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,M4=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,L4=Bt(M4).replace(/bull/g,Ey).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(),DJ=Bt(M4).replace(/bull/g,Ey).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(),vy=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,jJ=/^[^\n]+/,Ty=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,PJ=Bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ty).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),BJ=Bt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ey).getRegex(),Jm="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",Sy=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,zJ=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",Sy).replace("tag",Jm).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),D4=Bt(vy).replace("hr",yd).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",Jm).getRegex(),HJ=Bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",D4).getRegex(),Cy={blockquote:HJ,code:IJ,def:PJ,fences:MJ,heading:LJ,hr:yd,html:zJ,lheading:L4,list:BJ,newline:OJ,paragraph:D4,table:Ka,text:jJ},Zw=Bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yd).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",Jm).getRegex(),UJ={...Cy,lheading:DJ,table:Zw,paragraph:Bt(vy).replace("hr",yd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Zw).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",Jm).getRegex()},FJ={...Cy,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Sy).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:Ka,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(vy).replace("hr",yd).replace("heading",` *#{1,6} *[^
584
- ]`).replace("lheading",L4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},$J=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,VJ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,j4=/^( {2,}|\\)\n(?!\s*$)/,qJ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,cu=/[\p{P}\p{S}]/u,ep=/[\s\p{P}\p{S}]/u,wy=/[^\s\p{P}\p{S}]/u,YJ=Bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ep).getRegex(),P4=/(?!~)[\p{P}\p{S}]/u,GJ=/(?!~)[\s\p{P}\p{S}]/u,KJ=/(?:[^\s\p{P}\p{S}]|~)/u,XJ=Bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",RJ?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),B4=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,WJ=Bt(B4,"u").replace(/punct/g,cu).getRegex(),QJ=Bt(B4,"u").replace(/punct/g,P4).getRegex(),z4="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ZJ=Bt(z4,"gu").replace(/notPunctSpace/g,wy).replace(/punctSpace/g,ep).replace(/punct/g,cu).getRegex(),JJ=Bt(z4,"gu").replace(/notPunctSpace/g,KJ).replace(/punctSpace/g,GJ).replace(/punct/g,P4).getRegex(),eee=Bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wy).replace(/punctSpace/g,ep).replace(/punct/g,cu).getRegex(),tee=Bt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,cu).getRegex(),nee="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ree=Bt(nee,"gu").replace(/notPunctSpace/g,wy).replace(/punctSpace/g,ep).replace(/punct/g,cu).getRegex(),see=Bt(/\\(punct)/,"gu").replace(/punct/g,cu).getRegex(),iee=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(),aee=Bt(Sy).replace("(?:-->|$)","-->").getRegex(),oee=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",aee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sm=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,lee=Bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",sm).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),H4=Bt(/^!?\[(label)\]\[(ref)\]/).replace("label",sm).replace("ref",Ty).getRegex(),U4=Bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ty).getRegex(),uee=Bt("reflink|nolink(?!\\()","g").replace("reflink",H4).replace("nolink",U4).getRegex(),Jw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ky={_backpedal:Ka,anyPunctuation:see,autolink:iee,blockSkip:XJ,br:j4,code:VJ,del:Ka,delLDelim:Ka,delRDelim:Ka,emStrongLDelim:WJ,emStrongRDelimAst:ZJ,emStrongRDelimUnd:eee,escape:$J,link:lee,nolink:U4,punctuation:YJ,reflink:H4,reflinkSearch:uee,tag:oee,text:qJ,url:Ka},cee={...ky,link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",sm).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sm).getRegex()},S1={...ky,emStrongRDelimAst:JJ,emStrongLDelim:QJ,delLDelim:tee,delRDelim:ree,url:Bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Jw).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",Jw).getRegex()},dee={...S1,br:Bt(j4).replace("{2,}","*").getRegex(),text:Bt(S1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ch={normal:Cy,gfm:UJ,pedantic:FJ},pc={normal:ky,gfm:S1,breaks:dee,pedantic:cee},fee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ek=e=>fee[e];function ks(e,t){if(t){if(pr.escapeTest.test(e))return e.replace(pr.escapeReplace,ek)}else if(pr.escapeTestNoEncode.test(e))return e.replace(pr.escapeReplaceNoEncode,ek);return e}function tk(e){try{e=encodeURI(e).replace(pr.percentDecode,"%")}catch{return null}return e}function nk(e,t){let n=e.replace(pr.findPipe,(a,l,c)=>{let d=!1,f=l;for(;--f>=0&&c[f]==="\\";)d=!d;return d?"|":" |"}),r=n.split(pr.splitPipe),i=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(;i<r.length;i++)r[i]=r[i].trim().replace(pr.slashPipe,"|");return r}function gc(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function hee(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 mee(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let a=4-n%4;r+=" ".repeat(a),n+=a}else r+=i,n++;return r}function rk(e,t,n,r,i){let a=t.href,l=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:l,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,d}function pee(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
585
- `).map(a=>{let l=a.match(n.other.beginningSpace);if(l===null)return a;let[c]=l;return c.length>=i.length?a.slice(i.length):a}).join(`
586
- `)}var im=class{options;rules;lexer;constructor(e){this.options=e||Mo}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:gc(n,`
587
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=pee(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=gc(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:gc(t[0],`
588
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=gc(t[0],`
589
- `).split(`
590
- `),r="",i="",a=[];for(;n.length>0;){let l=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),l=!0;else if(!l)c.push(n[d]);else break;n=n.slice(d);let f=c.join(`
591
- `),g=f.replace(this.rules.other.blockquoteSetextReplace,`
592
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
593
- ${f}`:f,i=i?`${i}
594
- ${g}`:g;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,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,v=x.raw+`
595
- `+n.join(`
596
- `),k=this.blockquote(v);a[a.length-1]=k,r=r.substring(0,r.length-x.raw.length)+k.raw,i=i.substring(0,i.length-x.text.length)+k.text;break}else if(b?.type==="list"){let x=b,v=x.raw+`
597
- `+n.join(`
598
- `),k=this.list(v);a[a.length-1]=k,r=r.substring(0,r.length-b.raw.length)+k.raw,i=i.substring(0,i.length-x.raw.length)+k.raw,n=v.substring(a.at(-1).raw.length).split(`
599
- `);continue}}return{type:"blockquote",raw:r,tokens:a,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={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,f="",g="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let m=mee(t[2].split(`
600
- `,1)[0],t[1].length),b=e.split(`
601
- `,1)[0],x=!m.trim(),v=0;if(this.options.pedantic?(v=2,g=m.trimStart()):x?v=t[1].length+1:(v=m.search(this.rules.other.nonSpaceChar),v=v>4?1:v,g=m.slice(v),v+=t[1].length),x&&this.rules.other.blankLine.test(b)&&(f+=b+`
602
- `,e=e.substring(b.length+1),d=!0),!d){let k=this.rules.other.nextBulletRegex(v),w=this.rules.other.hrRegex(v),S=this.rules.other.fencesBeginRegex(v),N=this.rules.other.headingBeginRegex(v),_=this.rules.other.htmlBeginRegex(v),A=this.rules.other.blockquoteBeginRegex(v);for(;e;){let L=e.split(`
603
- `,1)[0],R;if(b=L,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),R=b):R=b.replace(this.rules.other.tabCharGlobal," "),S.test(b)||N.test(b)||_.test(b)||A.test(b)||k.test(b)||w.test(b))break;if(R.search(this.rules.other.nonSpaceChar)>=v||!b.trim())g+=`
604
- `+R.slice(v);else{if(x||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(m)||N.test(m)||w.test(m))break;g+=`
605
- `+b}x=!b.trim(),f+=L+`
606
- `,e=e.substring(L.length+1),m=R.slice(v)}}i.loose||(l?i.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(l=!0)),i.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),i.raw+=f}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let d of i.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 g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let g={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=g.checked,i.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=g.raw+d.tokens[0].raw,d.tokens[0].text=g.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(g)):d.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):d.tokens.unshift(g)}}if(!i.loose){let f=d.tokens.filter(m=>m.type==="space"),g=f.length>0&&f.some(m=>this.rules.other.anyLine.test(m.raw));i.loose=g}}if(i.loose)for(let d of i.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return i}}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"):"",i=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:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=nk(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
607
- `):[],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 i)a.rows.push(nk(l,a.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),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)===`
608
- `?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=gc(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=hee(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],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],i=a[3])}else i=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)),rk(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.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," "),i=t[r.toLowerCase()];if(!i){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return rk(n,i,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 i=[...r[0]].length-1,a,l,c=i,d=0,f=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+i);(r=f.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]){c+=l;continue}else if((r[5]||r[6])&&i%3&&!((i+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);let g=[...r[0]][0].length,m=e.slice(0,i+r.index+g+l);if(Math.min(i,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),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(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 i=[...r[0]].length-1,a,l,c=i,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(l=[...a].length,l!==i))continue;if(r[3]||r[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let f=[...r[0]][0].length,g=e.slice(0,i+r.index+f+l),m=g.slice(i,-i);return{type:"del",raw:g,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 i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==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 C1{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Mo,this.options.tokenizer=this.options.tokenizer||new im,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:pr,block:ch.normal,inline:pc.normal};this.options.pedantic?(n.block=ch.pedantic,n.inline=pc.pedantic):this.options.gfm&&(n.block=ch.gfm,this.options.breaks?n.inline=pc.breaks:n.inline=pc.gfm),this.tokenizer.rules=n}static get rules(){return{block:ch,inline:pc}}static lex(t,n){return new C1(n).lex(t)}static lexInline(t,n){return new C1(n).inlineTokens(t)}lex(t){t=t.replace(pr.carriageReturn,`
609
- `),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(pr.tabCharGlobal," ").replace(pr.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(l=>(i=l.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let l=n.at(-1);i.raw.length===1&&l!==void 0?l.raw+=`
610
- `:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
611
- `)?"":`
612
- `)+i.raw,l.text+=`
613
- `+i.text,this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
614
- `)?"":`
615
- `)+i.raw,l.text+=`
616
- `+i.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let a=t;if(this.options.extensions?.startBlock){let l=1/0,c=t.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},c),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&&(i=this.tokenizer.paragraph(a))){let l=n.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
617
- `)?"":`
618
- `)+i.raw,l.text+=`
619
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i),r=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
620
- `)?"":`
621
- `)+i.raw,l.text+=`
622
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i);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,i=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)d.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)a=i[2]?i[2].length:0,r=r.slice(0,i.index+a)+"["+"a".repeat(i[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,c="";for(;t;){l||(c=""),l=!1;let d;if(this.options.extensions?.inline?.some(g=>(d=g.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 g=n.at(-1);d.type==="text"&&g?.type==="text"?(g.raw+=d.raw,g.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,c)){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,c)){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 f=t;if(this.options.extensions?.startInline){let g=1/0,m=t.slice(1),b;this.options.extensions.startInline.forEach(x=>{b=x.call({lexer:this},m),typeof b=="number"&&b>=0&&(g=Math.min(g,b))}),g<1/0&&g>=0&&(f=t.substring(0,g+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(c=d.raw.slice(-1)),l=!0;let g=n.at(-1);g?.type==="text"?(g.raw+=d.raw,g.text+=d.text):n.push(d);continue}if(t){let g="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return n}},am=class{options;parser;constructor(t){this.options=t||Mo}space(t){return""}code({text:t,lang:n,escaped:r}){let i=(n||"").match(pr.notSpaceStart)?.[0],a=t.replace(pr.endingNewline,"")+`
623
- `;return i?'<pre><code class="language-'+ks(i)+'">'+(r?a:ks(a,!0))+`</code></pre>
624
- `:"<pre><code>"+(r?a:ks(a,!0))+`</code></pre>
625
- `}blockquote({tokens:t}){return`<blockquote>
626
- ${this.parser.parse(t)}</blockquote>
627
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
628
- `}hr(t){return`<hr>
629
- `}list(t){let n=t.ordered,r=t.start,i="";for(let c=0;c<t.items.length;c++){let d=t.items[c];i+=this.listitem(d)}let a=n?"ol":"ul",l=n&&r!==1?' start="'+r+'"':"";return"<"+a+l+`>
630
- `+i+"</"+a+`>
631
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
632
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
633
- `}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 i="";for(let a=0;a<t.rows.length;a++){let l=t.rows[a];r="";for(let c=0;c<l.length;c++)r+=this.tablecell(l[c]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
634
- <thead>
635
- `+n+`</thead>
636
- `+i+`</table>
637
- `}tablerow({text:t}){return`<tr>
638
- ${t}</tr>
639
- `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
640
- `}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>${ks(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 i=this.parser.parseInline(r),a=tk(t);if(a===null)return i;t=a;let l='<a href="'+t+'"';return n&&(l+=' title="'+ks(n)+'"'),l+=">"+i+"</a>",l}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let a=tk(t);if(a===null)return ks(r);t=a;let l=`<img src="${t}" alt="${ks(r)}"`;return n&&(l+=` title="${ks(n)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ks(t.text)}},Ny=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}},ms=class w1{options;renderer;textRenderer;constructor(t){this.options=t||Mo,this.options.renderer=this.options.renderer||new am,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ny}static parse(t,n){return new w1(n).parse(t)}static parseInline(t,n){return new w1(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let l=i,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let a=i;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 i=0;i<t.length;i++){let a=t[i];if(this.options.extensions?.renderers?.[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=c||"";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 c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},kc=class{options;block;constructor(e){this.options=e||Mo}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?ms.parse:ms.parseInline}},gee=class{defaults=yy();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ms;Renderer=am;TextRenderer=Ny;Lexer=os;Tokenizer=im;Hooks=kc;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let i of t)switch(r=r.concat(n.call(this,i)),i.type){case"table":{let a=i;for(let l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(let l of a.rows)for(let c of l)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{let a=i;r=r.concat(this.walkTokens(a.items,n));break}default:{let a=i;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);r=r.concat(this.walkTokens(c,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 i={...r};if(i.async=this.defaults.async||i.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(...c){let d=a.renderer.apply(this,c);return d===!1&&(d=l.apply(this,c)),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)}),i.extensions=n),r.renderer){let a=this.defaults.renderer||new am(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 c=l,d=r.renderer[c],f=a[c];a[c]=(...g)=>{let m=d.apply(a,g);return m===!1&&(m=f.apply(a,g)),m||""}}i.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new im(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 c=l,d=r.tokenizer[c],f=a[c];a[c]=(...g)=>{let m=d.apply(a,g);return m===!1&&(m=f.apply(a,g)),m}}i.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new kc;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 c=l,d=r.hooks[c],f=a[c];kc.passThroughHooks.has(l)?a[c]=g=>{if(this.defaults.async&&kc.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await d.call(a,g);return f.call(a,b)})();let m=d.call(a,g);return f.call(a,m)}:a[c]=(...g)=>{if(this.defaults.async)return(async()=>{let b=await d.apply(a,g);return b===!1&&(b=await f.apply(a,g)),b})();let m=d.apply(a,g);return m===!1&&(m=f.apply(a,g)),m}}i.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,l=r.walkTokens;i.walkTokens=function(c){let d=[];return d.push(l.call(this,c)),a&&(d=d.concat(a.call(this,c))),d}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return os.lex(t,n??this.defaults)}parser(t,n){return ms.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},a={...this.defaults,...i},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.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 c=a.hooks?await a.hooks.preprocess(n):n,d=await(a.hooks?await a.hooks.provideLexer(t):t?os.lex:os.lexInline)(c,a),f=a.hooks?await a.hooks.processAllTokens(d):d;a.walkTokens&&await Promise.all(this.walkTokens(f,a.walkTokens));let g=await(a.hooks?await a.hooks.provideParser(t):t?ms.parse:ms.parseInline)(f,a);return a.hooks?await a.hooks.postprocess(g):g})().catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let c=(a.hooks?a.hooks.provideLexer(t):t?os.lex:os.lexInline)(n,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let d=(a.hooks?a.hooks.provideParser(t):t?ms.parse:ms.parseInline)(c,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(t,n){return r=>{if(r.message+=`
641
- Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+ks(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},vo=new gee;function Wt(e,t){return vo.parse(e,t)}Wt.options=Wt.setOptions=function(e){return vo.setOptions(e),Wt.defaults=vo.defaults,I4(Wt.defaults),Wt};Wt.getDefaults=yy;Wt.defaults=Mo;Wt.use=function(...e){return vo.use(...e),Wt.defaults=vo.defaults,I4(Wt.defaults),Wt};Wt.walkTokens=function(e,t){return vo.walkTokens(e,t)};Wt.parseInline=vo.parseInline;Wt.Parser=ms;Wt.parser=ms.parse;Wt.Renderer=am;Wt.TextRenderer=Ny;Wt.Lexer=os;Wt.lexer=os.lex;Wt.Tokenizer=im;Wt.Hooks=kc;Wt.parse=Wt;Wt.options;Wt.setOptions;Wt.use;Wt.walkTokens;Wt.parseInline;ms.parse;os.lex;var bee=300,xee="300px",yee=500;function Eee(e={}){let{immediate:t=!1,debounceDelay:n=bee,rootMargin:r=xee,idleTimeout:i=yee}=e,[a,l]=E.useState(!1),c=E.useRef(null),d=E.useRef(null),f=E.useRef(null),g=E.useMemo(()=>x=>{let v=Date.now();return window.setTimeout(()=>{x({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),m=E.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(x,v)=>window.requestIdleCallback(x,v):g,[g]),b=E.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?x=>window.cancelIdleCallback(x):x=>{clearTimeout(x)},[]);return E.useEffect(()=>{if(t){l(!0);return}let x=c.current;if(!x)return;d.current&&(clearTimeout(d.current),d.current=null),f.current&&(b(f.current),f.current=null);let v=()=>{d.current&&(clearTimeout(d.current),d.current=null),f.current&&(b(f.current),f.current=null)},k=_=>{f.current=m(A=>{A.timeRemaining()>0||A.didTimeout?(l(!0),_.disconnect()):f.current=m(()=>{l(!0),_.disconnect()},{timeout:i/2})},{timeout:i})},w=_=>{v(),d.current=window.setTimeout(()=>{var A,L;let R=_.takeRecords();(R.length===0||(L=(A=R.at(-1))==null?void 0:A.isIntersecting)!=null&&L)&&k(_)},n)},S=(_,A)=>{_.isIntersecting?w(A):v()},N=new IntersectionObserver(_=>{for(let A of _)S(A,N)},{rootMargin:r,threshold:0});return N.observe(x),()=>{d.current&&clearTimeout(d.current),f.current&&b(f.current),N.disconnect()}},[t,n,r,i,b,m]),{shouldRender:a,containerRef:c}}var F4=/\s/,vee=/^\s+$/,Tee=new Set(["code","pre","svg","math","annotation"]),See=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",Cee=e=>e.some(t=>See(t)&&Tee.has(t.tagName)),wee=e=>{let t=[],n="",r=!1;for(let i of e){let a=F4.test(i);a!==r&&n&&(t.push(n),n=""),n+=i,r=a}return n&&t.push(n),t},kee=e=>{let t=[],n="";for(let r of e)F4.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},Nee=(e,t,n,r,i,a)=>{let l=`--sd-animation:sd-${t};--sd-duration:${i?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}]}},_ee=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(Cee(t))return _l;let l=a,c=l.children.indexOf(e);if(c===-1)return;let d=e.value;if(!d.trim()){i.count+=d.length;return}let f=n.sep==="char"?kee(d):wee(d),g=r.prevContentLength,m=f.map(b=>{let x=i.count;if(i.count+=b.length,vee.test(b))return{type:"text",value:b};let v=g>0&&x<g,k=v?0:i.newIndex++*n.stagger;return Nee(b,n.animation,n.duration,n.easing,v,k)});return l.children.splice(c,1,...m),c+m.length},Aee=0;function k1(e){var t,n,r,i,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:(i=e?.sep)!=null?i:"word",stagger:(a=e?.stagger)!=null?a:40},c={prevContentLength:0,lastRenderCharCount:0},d=Aee++,f=()=>g=>{let m={count:0,newIndex:0};Xx(g,"text",(b,x)=>_ee(b,x,l,c,m)),c.lastRenderCharCount=m.count,c.prevContentLength=0};return Object.defineProperty(f,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:f,setPrevContentLength(g){c.prevContentLength=g},getLastRenderCharCount(){let g=c.lastRenderCharCount;return c.lastRenderCharCount=0,g}}}k1();var $4=E.createContext(!1),Ree=()=>E.useContext($4),_y=(...e)=>$N(mm(e)),Oee=(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(" ")},Iee=e=>e?(...t)=>Oee(e,$N(mm(t))):_y,Dl=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)},N1=E.createContext(_y),wt=()=>E.useContext(N1),Mee=_y("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"),Lee=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();i&&a&&(t[i]=a)}}return t},Dee=E.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...l})=>{let c=wt(),d=E.useMemo(()=>c(Mee),[c]),f=E.useMemo(()=>{let g={};return t.bg&&(g["--sdm-bg"]=t.bg),t.fg&&(g["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(g,Lee(t.rootStyle)),g},[t.bg,t.fg,t.rootStyle]);return h.jsx("div",{className:c(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:h.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:f,children:h.jsx("code",{className:a?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((g,m)=>h.jsx("span",{className:a?d:void 0,children:g.length===0||g.length===1&&g[0].content===""?`
642
- `:g.map((b,x)=>{let v={},k=!!b.bgColor;if(b.color&&(v["--sdm-c"]=b.color),b.bgColor&&(v["--sdm-tbg"]=b.bgColor),b.htmlStyle)for(let[w,S]of Object.entries(b.htmlStyle))w==="color"?v["--sdm-c"]=S:w==="background-color"?(v["--sdm-tbg"]=S,k=!0):v[w]=S;return h.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",k&&"bg-[var(--sdm-tbg)]",k&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...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),jee=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=wt();return h.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},...i})},V4=E.createContext({code:""}),q4=()=>E.useContext(V4),Pee=({language:e})=>{let t=wt();return h.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:h.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},Bee=e=>{let t=e.length;for(;t>0&&e[t-1]===`
643
- `;)t--;return e.slice(0,t)},zee=E.lazy(()=>Vl(()=>import("./highlighted-body-OFNGDK62-Dbepw_E8.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),Hee=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:l,...c})=>{let d=wt(),f=E.useMemo(()=>Bee(e),[e]),g=E.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:f.split(`
644
- `).map(m=>[{content:m,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[f]);return h.jsx(V4.Provider,{value:{code:e},children:h.jsxs(jee,{isIncomplete:i,language:t,children:[h.jsx(Pee,{language:t}),r?h.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:h.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,h.jsx(E.Suspense,{fallback:h.jsx(Dee,{className:n,language:t,lineNumbers:l,result:g,startLine:a,...c}),children:h.jsx(zee,{className:n,code:f,language:t,lineNumbers:l,raw:g,startLine:a,...c})})]})})},Uee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),Fee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),$ee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),Vee=e=>h.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[h.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),qee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),Yee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),Gee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),Kee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),Xee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),Wee=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.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"})}),Nc={CheckIcon:Uee,CopyIcon:Fee,DownloadIcon:$ee,ExternalLinkIcon:Kee,Loader2Icon:Vee,Maximize2Icon:qee,RotateCcwIcon:Yee,XIcon:Gee,ZoomInIcon:Xee,ZoomOutIcon:Wee},Y4=E.createContext(Nc),Qee=(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(i=>e[i]===t[i])},sk=({icons:e,children:t})=>{let n=E.useRef(e),r=E.useRef(e?{...Nc,...e}:Nc);Qee(n.current,e)||(n.current=e,r.current=e?{...Nc,...e}:Nc);let i=r.current;return h.jsx(Y4.Provider,{value:i,children:t})},xs=()=>E.useContext(Y4),G4={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"},_1=E.createContext(G4),vi=()=>E.useContext(_1),ik=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...l})=>{let c=wt(),[d,f]=E.useState(!1),g=E.useRef(0),{code:m}=q4(),{isAnimating:b}=E.useContext(Yr),x=vi(),v=a??m,k=async()=>{var N;if(typeof window>"u"||!((N=navigator?.clipboard)!=null&&N.writeText)){t?.(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(v),f(!0),e?.(),g.current=window.setTimeout(()=>f(!1),n))}catch(_){t?.(_)}};E.useEffect(()=>()=>{window.clearTimeout(g.current)},[]);let w=xs(),S=d?w.CheckIcon:w.CopyIcon;return h.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:b,onClick:k,title:x.copyCode,type:"button",...l,children:r??h.jsx(S,{size:14})})},ak={"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"},Zee=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...l})=>{let c=wt(),{code:d}=q4(),{isAnimating:f}=E.useContext(Yr),g=vi(),m=xs(),b=a??d,x=`file.${n&&n in ak?ak[n]:"txt"}`,v="text/plain",k=()=>{try{Dl(x,b,v),e?.()}catch(w){t?.(w)}};return h.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:f,onClick:k,title:g.downloadFile,type:"button",...l,children:r??h.jsx(m.DownloadIcon,{size:14})})},ok=()=>{let{Loader2Icon:e}=xs(),t=wt();return h.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[h.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),h.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:h.jsx(e,{className:t("size-4 animate-spin")})})]})},Jee=/\.[^/.]+$/,ete=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...l})=>{let{DownloadIcon:c}=xs(),d=wt(),f=E.useRef(null),[g,m]=E.useState(!1),[b,x]=E.useState(!1),v=vi(),k=l.width!=null||l.height!=null,w=(g||k)&&!b,S=b&&!k;E.useEffect(()=>{let L=f.current;if(L!=null&&L.complete){let R=L.naturalWidth>0;m(R),x(!R)}},[]);let N=E.useCallback(L=>{m(!0),x(!1),i?.(L)},[i]),_=E.useCallback(L=>{m(!1),x(!0),a?.(L)},[a]),A=async()=>{if(n)try{let L=await(await fetch(n)).blob(),R=new URL(n,window.location.origin).pathname.split("/").pop()||"",D=R.split(".").pop(),I=R.includes(".")&&D!==void 0&&D.length<=4,U="";if(I)U=R;else{let z=L.type,X="png";z.includes("jpeg")||z.includes("jpg")?X="jpg":z.includes("png")?X="png":z.includes("svg")?X="svg":z.includes("gif")?X="gif":z.includes("webp")&&(X="webp"),U=`${(r||R||"image").replace(Jee,"")}.${X}`}Dl(U,L,L.type)}catch{window.open(n,"_blank")}};return n?h.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[h.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:_,onLoad:N,ref:f,src:n,...l}),S&&h.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),h.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),w&&h.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:A,title:v.downloadImage,type:"button",children:h.jsx(c,{size:14})})]}):null},Hc=0,Ay=()=>{Hc+=1,Hc===1&&(document.body.style.overflow="hidden")},Ry=()=>{Hc=Math.max(0,Hc-1),Hc===0&&(document.body.style.overflow="")},tte=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:l,XIcon:c}=xs(),d=wt(),[f,g]=E.useState(!1),m=vi(),b=E.useCallback(async()=>{try{await navigator.clipboard.writeText(e),g(!0),setTimeout(()=>g(!1),2e3)}catch{}},[e]),x=E.useCallback(()=>{r(),n()},[r,n]);return E.useEffect(()=>{if(t){Ay();let v=k=>{k.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),Ry()}}},[t,n]),t?h.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:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:h.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:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[h.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:h.jsx(c,{size:16})}),h.jsxs("div",{className:d("flex flex-col gap-2"),children:[h.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[h.jsx(l,{size:20}),h.jsx("span",{children:m.openExternalLink})]}),h.jsx("p",{className:d("text-muted-foreground text-sm"),children:m.externalLinkWarning})]}),h.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}),h.jsxs("div",{className:d("flex gap-2"),children:[h.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:f?h.jsxs(h.Fragment,{children:[h.jsx(i,{size:14}),h.jsx("span",{children:m.copied})]}):h.jsxs(h.Fragment,{children:[h.jsx(a,{size:14}),h.jsx("span",{children:m.copyLink})]})}),h.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:[h.jsx(l,{size:14}),h.jsx("span",{children:m.openLink})]})]})]})}):null},A1=E.createContext(null),Oy=()=>E.useContext(A1),_se=()=>{var e;let t=Oy();return(e=t?.code)!=null?e:null},Iy=()=>{var e;let t=Oy();return(e=t?.mermaid)!=null?e:null},nte=e=>{var t;let n=Oy();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},rte=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,a)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let d=document.createElement("canvas"),f=c.width*r,g=c.height*r;d.width=f,d.height=g;let m=d.getContext("2d");if(!m){a(new Error("Failed to create 2D canvas context for PNG export"));return}m.drawImage(c,0,0,f,g),d.toBlob(b=>{if(!b){a(new Error("Failed to create PNG blob"));return}i(b)},"image/png")},c.onerror=()=>a(new Error("Failed to load SVG image")),c.src=l})},ste=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let l=wt(),[c,d]=E.useState(!1),f=E.useRef(null),{isAnimating:g}=E.useContext(Yr),m=xs(),b=Iy(),x=vi(),v=async k=>{try{if(k==="mmd"){Dl("diagram.mmd",e,"text/plain"),d(!1),r?.(k);return}if(!b){a?.(new Error("Mermaid plugin not available"));return}let w=b.getMermaid(i),S=e.split("").reduce((A,L)=>(A<<5)-A+L.charCodeAt(0)|0,0),N=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:_}=await w.render(N,e);if(!_){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(k==="svg"){Dl("diagram.svg",_,"image/svg+xml"),d(!1),r?.(k);return}if(k==="png"){let A=await rte(_);Dl("diagram.png",A,"image/png"),r?.(k),d(!1);return}}catch(w){a?.(w)}};return E.useEffect(()=>{let k=w=>{let S=w.composedPath();f.current&&!S.includes(f.current)&&d(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),h.jsxs("div",{className:l("relative"),ref:f,children:[h.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:g,onClick:()=>d(!c),title:x.downloadDiagram,type:"button",children:t??h.jsx(m.DownloadIcon,{size:14})}),c?h.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:[h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:x.downloadDiagramAsSvg,type:"button",children:x.mermaidFormatSvg}),h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:x.downloadDiagramAsPng,type:"button",children:x.mermaidFormatPng}),h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:x.downloadDiagramAsMmd,type:"button",children:x.mermaidFormatMmd})]}):null]})},ite=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:l,XIcon:c}=xs(),d=wt(),[f,g]=E.useState(!1),{isAnimating:m,controls:b}=E.useContext(Yr),x=vi(),v=(()=>{if(typeof b=="boolean")return b;let w=b.mermaid;return w===!1?!1:w===!0||w===void 0?!0:w.panZoom!==!1})(),k=()=>{g(!f)};return E.useEffect(()=>{if(f){Ay();let w=S=>{S.key==="Escape"&&g(!1)};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w),Ry()}}},[f]),E.useEffect(()=>{f?n?.():r&&r()},[f,n,r]),h.jsxs(h.Fragment,{children:[h.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:m,onClick:k,title:x.viewFullscreen,type:"button",...a,children:h.jsx(l,{size:14})}),f?lr.createPortal(h.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:k,onKeyDown:w=>{w.key==="Escape"&&k()},role:"button",tabIndex:0,children:[h.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:k,title:x.exitFullscreen,type:"button",children:h.jsx(c,{size:20})}),h.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),role:"presentation",children:h.jsx(_O,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},K4=e=>{var t,n;let r=[],i=[],a=e.querySelectorAll("thead th");for(let c of a)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let c of l){let d=[],f=c.querySelectorAll("td");for(let g of f)d.push(((n=g.textContent)==null?void 0:n.trim())||"");i.push(d)}return{headers:r,rows:i}},X4=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1,f=!1;for(let g of c){if(g==='"'){d=!0,f=!0;break}(g===","||g===`
645
- `)&&(d=!0)}return d?f?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},i=t.length>0?n.length+1:n.length,a=new Array(i),l=0;t.length>0&&(a[l]=t.map(r).join(","),l+=1);for(let c of n)a[l]=c.map(r).join(","),l+=1;return a.join(`
646
- `)},ate=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1;for(let g of c)if(g===" "||g===`
647
- `||g==="\r"){d=!0;break}if(!d)return c;let f=[];for(let g of c)g===" "?f.push("\\t"):g===`
648
- `?f.push("\\n"):g==="\r"?f.push("\\r"):f.push(g);return f.join("")},i=t.length>0?n.length+1:n.length,a=new Array(i),l=0;t.length>0&&(a[l]=t.map(r).join(" "),l+=1);for(let c of n)a[l]=c.map(r).join(" "),l+=1;return a.join(`
649
- `)},gb=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("")},R1=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,a=t.map(c=>gb(c));r[i]=`| ${a.join(" | ")} |`,i+=1;let l=new Array(t.length);for(let c=0;c<t.length;c+=1)l[c]="---";r[i]=`| ${l.join(" | ")} |`,i+=1;for(let c of n)if(c.length<t.length){let d=new Array(t.length);for(let f=0;f<t.length;f+=1)d[f]=f<c.length?gb(c[f]):"";r[i]=`| ${d.join(" | ")} |`,i+=1}else{let d=c.map(f=>gb(f));r[i]=`| ${d.join(" | ")} |`,i+=1}return r.join(`
650
- `)},W4=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=wt(),[l,c]=E.useState(!1),[d,f]=E.useState(!1),g=E.useRef(null),m=E.useRef(0),{isAnimating:b}=E.useContext(Yr),x=vi(),v=async S=>{var N,_;if(typeof window>"u"||!((N=navigator?.clipboard)!=null&&N.write)){r?.(new Error("Clipboard API not available"));return}try{let A=(_=g.current)==null?void 0:_.closest('[data-streamdown="table-wrapper"]'),L=A?.querySelector("table");if(!L){r?.(new Error("Table not found"));return}let R=K4(L),D=({csv:X4,tsv:ate,md:R1}[S]||R1)(R),I=new ClipboardItem({"text/plain":new Blob([D],{type:"text/plain"}),"text/html":new Blob([L.outerHTML],{type:"text/html"})});await navigator.clipboard.write([I]),f(!0),c(!1),n?.(S),m.current=window.setTimeout(()=>f(!1),i)}catch(A){r?.(A)}};E.useEffect(()=>{let S=N=>{let _=N.composedPath();g.current&&!_.includes(g.current)&&c(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(m.current)}},[]);let k=xs(),w=d?k.CheckIcon:k.CopyIcon;return h.jsxs("div",{className:a("relative"),ref:g,children:[h.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:()=>c(!l),title:x.copyTable,type:"button",children:e??h.jsx(w,{height:14,width:14})}),l?h.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:[h.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:x.copyTableAsMarkdown,type:"button",children:x.tableFormatMarkdown}),h.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:x.copyTableAsCsv,type:"button",children:x.tableFormatCsv}),h.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:x.copyTableAsTsv,type:"button",children:x.tableFormatTsv})]}):null]})},Q4=({children:e,className:t,onDownload:n,onError:r})=>{let i=wt(),[a,l]=E.useState(!1),c=E.useRef(null),{isAnimating:d}=E.useContext(Yr),f=vi(),g=xs(),m=b=>{var x;try{let v=(x=c.current)==null?void 0:x.closest('[data-streamdown="table-wrapper"]'),k=v?.querySelector("table");if(!k){r?.(new Error("Table not found"));return}let w=K4(k),S=b==="csv"?X4(w):R1(w);Dl(`table.${b==="csv"?"csv":"md"}`,S,b==="csv"?"text/csv":"text/markdown"),l(!1),n?.(b)}catch(v){r?.(v)}};return E.useEffect(()=>{let b=x=>{let v=x.composedPath();c.current&&!v.includes(c.current)&&l(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]),h.jsxs("div",{className:i("relative"),ref:c,children:[h.jsx("button",{className:i("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:f.downloadTable,type:"button",children:e??h.jsx(g.DownloadIcon,{size:14})}),a?h.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[h.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("csv"),title:f.downloadTableAsCsv,type:"button",children:f.tableFormatCsv}),h.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("markdown"),title:f.downloadTableAsMarkdown,type:"button",children:f.tableFormatMarkdown})]}):null]})},ote=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=xs(),l=wt(),[c,d]=E.useState(!1),{isAnimating:f}=E.useContext(Yr),g=vi(),m=()=>{d(!0)},b=()=>{d(!1)};return E.useEffect(()=>{if(c){Ay();let x=v=>{v.key==="Escape"&&d(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),Ry()}}},[c]),h.jsxs(h.Fragment,{children:[h.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:f,onClick:m,title:g.viewFullscreen,type:"button",children:h.jsx(i,{size:14})}),c?lr.createPortal(h.jsx("div",{"aria-label":g.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:h.jsxs("div",{className:l("flex h-full flex-col"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:[h.jsxs("div",{className:l("flex items-center justify-end gap-1 p-4"),children:[n?h.jsx(W4,{}):null,r?h.jsx(Q4,{}):null,h.jsx("button",{className:l("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:b,title:g.exitFullscreen,type:"button",children:h.jsx(a,{size:20})})]}),h.jsx("div",{className:l("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:h.jsx("table",{className:l("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},lte=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...l})=>{let c=wt(),d=n&&r,f=n&&i,g=n&&a,m=d||f||g;return h.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[m?h.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[d?h.jsx(W4,{}):null,f?h.jsx(Q4,{}):null,g?h.jsx(ote,{showCopy:d,showDownload:f,children:e}):null]}):null,h.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:h.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...l,children:e})})]})},ute=/startLine=(\d+)/,cte=/\bnoLineNumbers\b/,dte=E.lazy(()=>Vl(()=>Promise.resolve().then(()=>wse),void 0).then(e=>({default:e.Mermaid}))),fte=/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,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function Tn(e,t){return e.className===t.className&&tp(e.node,t.node)}var O1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,bb=(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},lk=(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},dh=(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},My=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Tn(e,t));My.displayName="MarkdownOl";var Z4=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&tp(e.node,t.node));Z4.displayName="MarkdownLi";var J4=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Tn(e,t));J4.displayName="MarkdownUl";var eO=E.memo(({className:e,node:t,...n})=>{let r=wt();return h.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Tn(e,t));eO.displayName="MarkdownHr";var tO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Tn(e,t));tO.displayName="MarkdownStrong";var hte=({children:e,className:t,href:n,node:r,...i})=>{let a=wt(),{linkSafety:l}=E.useContext(Yr),[c,d]=E.useState(!1),f=n==="streamdown:incomplete-link",g=E.useCallback(async v=>{if(!(!(l!=null&&l.enabled&&n)||f)){if(v.preventDefault(),l.onLinkCheck&&await l.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[l,n,f]),m=E.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),b=E.useCallback(()=>{d(!1)},[]),x={url:n??"",isOpen:c,onClose:b,onConfirm:m};return l!=null&&l.enabled&&n?h.jsxs(h.Fragment,{children:[h.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":f,"data-streamdown":"link",onClick:g,type:"button",children:e}),l.renderModal?l.renderModal(x):h.jsx(tte,{...x})]}):h.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":f,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},nO=E.memo(hte,(e,t)=>Tn(e,t)&&e.href===t.href);nO.displayName="MarkdownA";var rO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Tn(e,t));rO.displayName="MarkdownH1";var sO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Tn(e,t));sO.displayName="MarkdownH2";var iO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Tn(e,t));iO.displayName="MarkdownH3";var aO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Tn(e,t));aO.displayName="MarkdownH4";var oO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Tn(e,t));oO.displayName="MarkdownH5";var lO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Tn(e,t));lO.displayName="MarkdownH6";var uO=E.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=E.useContext(Yr),a=O1(i,"table"),l=bb(i,"copy"),c=bb(i,"download"),d=bb(i,"fullscreen");return h.jsx(lte,{className:t,showControls:a,showCopy:l,showDownload:c,showFullscreen:d,...r,children:e})},(e,t)=>Tn(e,t));uO.displayName="MarkdownTable";var cO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Tn(e,t));cO.displayName="MarkdownThead";var dO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Tn(e,t));dO.displayName="MarkdownTbody";var fO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Tn(e,t));fO.displayName="MarkdownTr";var hO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>Tn(e,t));hO.displayName="MarkdownTh";var mO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Tn(e,t));mO.displayName="MarkdownTd";var pO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>Tn(e,t));pO.displayName="MarkdownBlockquote";var gO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Tn(e,t));gO.displayName="MarkdownSup";var bO=E.memo(({children:e,className:t,node:n,...r})=>{let i=wt();return h.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Tn(e,t));bO.displayName="MarkdownSub";var xO=E.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=l=>{var c,d;if(!E.isValidElement(l))return!1;let f=Array.isArray(l.props.children)?l.props.children:[l.props.children],g=!1,m=!1;for(let b of f)if(b){if(typeof b=="string")b.trim()!==""&&(g=!0);else if(E.isValidElement(b))if(((c=b.props)==null?void 0:c["data-footnote-backref"])!==void 0)m=!0;else{let x=Array.isArray(b.props.children)?b.props.children:[b.props.children];for(let v of x){if(typeof v=="string"&&v.trim()!==""){g=!0;break}if(E.isValidElement(v)&&((d=v.props)==null?void 0:d["data-footnote-backref"])===void 0){g=!0;break}}}}return m&&!g},a=Array.isArray(e)?e.map(l=>{if(!E.isValidElement(l))return l;if(l.type===My){let c=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(d=>!i(d));return c.length===0?null:{...l,props:{...l.props,children:c}}}return l}):e;return(Array.isArray(a)?a.some(l=>l!==null):a!==null)?h.jsx("section",{className:t,...r,children:a}):null}return h.jsx("section",{className:t,...r,children:e})},(e,t)=>Tn(e,t));xO.displayName="MarkdownSection";var mte=({node:e,className:t,children:n,...r})=>{var i,a;let l=wt(),c=!("data-block"in r),{mermaid:d,controls:f,lineNumbers:g}=E.useContext(Yr),m=Iy(),b=Ree(),x=t?.match(fte),v=(i=x?.at(1))!=null?i:"",k=nte(v);if(c)return h.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 w=(a=e?.properties)==null?void 0:a.metastring,S=w?.match(ute),N=S?Number.parseInt(S[1],10):void 0,_=N!==void 0&&N>=1?N:void 0,A=!(w&&cte.test(w))&&g!==!1,L="";if(E.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?L=n.props.children:typeof n=="string"&&(L=n),k){let U=k.component;return h.jsx(E.Suspense,{fallback:h.jsx(ok,{}),children:h.jsx(U,{code:L,isIncomplete:b,language:v,meta:w})})}if(v==="mermaid"&&m){let U=O1(f,"mermaid"),z=dh(f,"download"),X=dh(f,"copy"),W=dh(f,"fullscreen"),V=dh(f,"panZoom"),ee=U&&(z||X||W);return h.jsx(E.Suspense,{fallback:h.jsx(ok,{}),children:h.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:[h.jsx("div",{className:l("flex h-8 items-center text-muted-foreground text-xs"),children:h.jsx("span",{className:l("ml-1 font-mono lowercase"),children:"mermaid"})}),ee?h.jsx("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:h.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:[z?h.jsx(ste,{chart:L,config:d?.config}):null,X?h.jsx(ik,{code:L}):null,W?h.jsx(ite,{chart:L,config:d?.config}):null]})}):null,h.jsx("div",{className:l("rounded-md border border-border bg-background"),children:h.jsx(dte,{chart:L,config:d?.config,showControls:V})})]})})}let R=O1(f,"code"),D=lk(f,"download"),I=lk(f,"copy");return h.jsx(Hee,{className:t,code:L,isIncomplete:b,language:v,lineNumbers:A,startLine:_,children:R?h.jsxs(h.Fragment,{children:[D?h.jsx(Zee,{code:L,language:v}):null,I?h.jsx(ik,{}):null]}):null})},yO=E.memo(mte,(e,t)=>e.className===t.className&&tp(e.node,t.node));yO.displayName="MarkdownCode";var EO=E.memo(ete,(e,t)=>e.className===t.className&&tp(e.node,t.node));EO.displayName="MarkdownImg";var vO=E.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&E.isValidElement(r[0])){let i=r[0].props.node,a=i?.tagName;if(a==="img")return h.jsx(h.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return h.jsx(h.Fragment,{children:e})}return h.jsx("p",{...n,children:e})},(e,t)=>Tn(e,t));vO.displayName="MarkdownParagraph";var pte={ol:My,li:Z4,ul:J4,hr:eO,strong:tO,a:nO,h1:rO,h2:sO,h3:iO,h4:aO,h5:oO,h6:lO,table:uO,thead:cO,tbody:dO,tr:fO,th:hO,td:mO,blockquote:pO,code:yO,img:EO,pre:({children:e})=>E.isValidElement(e)?E.cloneElement(e,{"data-block":"true"}):e,sup:gO,sub:bO,p:vO,section:xO},gte=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,bte=/\p{L}/u;function uk(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(gte.test(n))return"rtl";if(bte.test(n))return"ltr"}return"ltr"}var xte=/^[ \t]{0,3}(`{3,}|~{3,})/,yte=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,ck=e=>{let t=e.split(`
651
- `),n=null,r=0;for(let i of t){let a=xte.exec(i);if(n===null){if(a){let l=a[1];n=l[0],r=l.length}}else if(a){let l=a[1],c=l[0],d=l.length;c===n&&d>=r&&(n=null,r=0)}}return n!==null},Ete=e=>{let t=e.split(`
652
- `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&yte.test(r))return!0}return!1},vte=()=>e=>{Bs(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},dk=[],fk={allowDangerousHtml:!0},fh=new WeakMap,Tte=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,i=e.remarkRehypeOptions;if(!(n||r||i)){let g="default";return this.keyCache.set(e,g),g}let a=g=>{if(!g||g.length===0)return"";let m="";for(let b=0;b<g.length;b+=1){let x=g[b];if(b>0&&(m+=","),Array.isArray(x)){let[v,k]=x;if(typeof v=="function"){let w=fh.get(v);w||(w=v.name,fh.set(v,w)),m+=w}else m+=String(v);m+=":",m+=JSON.stringify(k)}else if(typeof x=="function"){let v=fh.get(x);v||(v=x.name,fh.set(x,v)),m+=v}else m+=String(x)}return m},l=a(n),c=a(r),d=i?JSON.stringify(i):"",f=`${c}::${l}::${d}`;return this.keyCache.set(e,f),f}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()}},hk=new Tte,TO=e=>{let t=Ste(e),n=e.children||"",r=t.runSync(t.parse(n),n);return Rte(r,e)},Ste=e=>{let t=hk.get(e);if(t)return t;let n=wte(e);return hk.set(e,n),n},Cte=e=>e.some(t=>Array.isArray(t)?t[0]===p1:t===p1),wte=e=>{let t=e.rehypePlugins||dk,n=e.remarkPlugins||dk,r=Cte(t)?n:[...n,vte],i=e.remarkRehypeOptions?{...fk,...e.remarkRehypeOptions}:fk;return kJ().use(wZ).use(r).use(oJ,i).use(t)},kte=e=>e,Nte=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},_te=(e,t)=>{var n;for(let r in ob)if(Object.hasOwn(ob,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],a=ob[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},Ate=(e,t,n,r,i,a)=>{let l=!1;return r?l=!r.includes(e.tagName):i&&(l=i.includes(e.tagName)),!l&&a&&typeof t=="number"&&(l=!a(e,t,n)),l},Rte=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:l,urlTransform:c}=t;if(n||r||i||a||c){let d=c||kte;Bs(e,(f,g,m)=>{if(f.type==="raw"&&m&&typeof g=="number")return Nte(m,g,a,f.value),g;if(f.type==="element"&&(_te(f,d),Ate(f,g,m,r,i,n)&&m&&typeof g=="number"))return l&&f.children?m.children.splice(g,1,...f.children):m.children.splice(g,1),g})}return MQ(e,{Fragment:h.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0})},Ote=/\[\^[\w-]{1,200}\](?!:)/,Ite=/\[\^[\w-]{1,200}\]:/,Mte=/<(\w+)[\s>]/,Lte=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),mk=new Map,pk=new Map,Dte=e=>{let t=e.toLowerCase(),n=mk.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return mk.set(t,r),r},jte=e=>{let t=e.toLowerCase(),n=pk.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return pk.set(t,r),r},gk=(e,t)=>{if(Lte.has(t.toLowerCase()))return 0;let n=e.match(Dte(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},bk=(e,t)=>{let n=e.match(jte(t));return n?n.length:0},Pte=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},Bte=e=>{let t=Ote.test(e),n=Ite.test(e);if(t||n)return[e];let r=os.lex(e,{gfm:!0}),i=[],a=[],l=!1;for(let c of r){let d=c.raw,f=i.length;if(a.length>0){i[f-1]+=d;let g=a.at(-1),m=gk(d,g),b=bk(d,g);for(let x=0;x<m;x+=1)a.push(g);for(let x=0;x<b;x+=1)a.length>0&&a.at(-1)===g&&a.pop();continue}if(c.type==="html"&&c.block){let g=d.match(Mte);if(g){let m=g[1],b=gk(d,m),x=bk(d,m);b>x&&a.push(m)}}if(f>0&&!l){let g=i[f-1];if(Pte(g)%2===1){i[f-1]=g+d;continue}}i.push(d),c.type!=="space"&&(l=c.type==="code")}return i},zte=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,l,c,d)=>{if(!c.includes(`
653
-
654
- `))return l+c+d;let f=c.replace(/\n\n/g,`
655
- <!---->
656
- `),g=(f.startsWith(`
657
- `)?"":`
658
- `)+f+(f.endsWith(`
659
- `)?"":`
660
- `);return`${l}${g}${d}
661
-
662
- `})}return n},Hte=/([\\`*_~[\]|])/g,Ute=e=>e.replace(Hte,"\\$1"),Fte=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,l,c,d)=>{let f=Ute(c).replace(/\n\n/g,"&#10;&#10;");return l+f+d})}return n},SO=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(SO).join(""):"",$te=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Bs(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=SO(r);r.children=i?[{type:"text",value:i}]:[]}})},Vte=()=>e=>{Bs(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})})},qte=/^[ \t]*<[\w!/?-]/,Yte=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,Gte=e=>typeof e!="string"||e.length===0||!qte.test(e)?e:e.replace(Yte,"$1"),xk,yk,Ek,vk,_h={...Ga,protocols:{...Ga.protocols,href:[...(yk=(xk=Ga.protocols)==null?void 0:xk.href)!=null?yk:[],"tel"]},attributes:{...Ga.attributes,code:[...(vk=(Ek=Ga.attributes)==null?void 0:Ek.code)!=null?vk:[],"metastring"]}},I1={raw:p1,sanitize:[MR,_h],harden:[FF,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Kte={gfm:[aW,{}],codeMeta:Vte},Tk=Object.values(I1),Xte=Object.values(Kte),Wte={block:" ▋",circle:" ●"},CO=["github-light","github-dark"],wO={enabled:!0},Qte={shikiTheme:CO,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:wO},Yr=E.createContext(Qte),kO=E.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:l,...c})=>{if(l){let g=l.getLastRenderCharCount();l.setPrevContentLength(g)}let d=typeof e=="string"&&n?Gte(e):e,f=h.jsx(TO,{...c,children:d});return h.jsx($4.Provider,{value:i,children:a?h.jsx("div",{dir:a,style:{display:"contents"},children:f}):f})},(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(i=>{var a,l;return((a=e.components)==null?void 0:a[i])!==((l=t.components)==null?void 0:l[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});kO.displayName="Block";var NO=E.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:l=Tk,remarkPlugins:c=Xte,className:d,shikiTheme:f=CO,mermaid:g,controls:m=!0,isAnimating:b=!1,animated:x,BlockComponent:v=kO,parseMarkdownIntoBlocksFn:k=Bte,caret:w,plugins:S,remend:N,linkSafety:_=wO,lineNumbers:A=!0,allowedTags:L,literalTagContent:R,translations:D,icons:I,prefix:U,onAnimationStart:z,onAnimationEnd:X,...W})=>{let V=E.useId(),[ee,q]=E.useTransition(),B=E.useMemo(()=>Iee(U),[U]),G=E.useRef(null),Q=E.useRef(z),le=E.useRef(X);Q.current=z,le.current=X,E.useEffect(()=>{var ke,ye,Ie;if(t==="static")return;let je=G.current;if(G.current=b,je===null){b&&((ke=Q.current)==null||ke.call(Q));return}b&&!je?(ye=Q.current)==null||ye.call(Q):!b&&je&&((Ie=le.current)==null||Ie.call(le))},[b,t]);let M=E.useMemo(()=>L?Object.keys(L):[],[L]),P=E.useMemo(()=>{if(typeof e!="string")return"";let ke=t==="streaming"&&r?bQ(e,N):e;return R&&R.length>0&&(ke=Fte(ke,R)),M.length>0&&(ke=zte(ke,M)),ke},[e,t,r,N,M,R]),F=E.useMemo(()=>k(P),[P,k]),[j,ae]=E.useState(F);E.useEffect(()=>{t==="streaming"&&!ve?q(()=>{ae(F)}):ae(F)},[F,t]);let ie=t==="streaming"?j:F,ce=E.useMemo(()=>n==="auto"?ie.map(uk):void 0,[ie,n]),de=E.useMemo(()=>ie.map((ke,ye)=>`${V}-${ye}`),[ie.length,V]),fe=E.useMemo(()=>x===!0?"true":x?JSON.stringify(x):"",[x]),ve=E.useMemo(()=>fe?fe==="true"?k1():k1(x):null,[fe]),Fe=E.useMemo(()=>{var ke,ye;return{shikiTheme:(ye=(ke=S?.code)==null?void 0:ke.getThemes())!=null?ye:f,controls:m,isAnimating:b,lineNumbers:A,mode:t,mermaid:g,linkSafety:_}},[f,m,b,A,t,g,_,S?.code]),Le=E.useMemo(()=>D?JSON.stringify(D):"",[D]),Ee=E.useMemo(()=>({...G4,...D}),[Le]),Oe=E.useMemo(()=>{let{inlineCode:ke,...ye}=a??{},Ie={...pte,...ye};if(ke){let je=Ie.code;Ie.code=te=>"data-block"in te?je?E.createElement(je,te):null:E.createElement(ke,te)}return Ie},[a]),ze=E.useMemo(()=>{let ke=[];return S!=null&&S.cjk&&(ke=[...ke,...S.cjk.remarkPluginsBefore]),ke=[...ke,...c],S!=null&&S.cjk&&(ke=[...ke,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(ke=[...ke,S.math.remarkPlugin]),ke},[c,S?.math,S?.cjk]),Ge=E.useMemo(()=>{var ke;let ye=l;if(L&&Object.keys(L).length>0&&l===Tk){let Ie={..._h,tagNames:[...(ke=_h.tagNames)!=null?ke:[],...Object.keys(L)],attributes:{..._h.attributes,...L}};ye=[I1.raw,[MR,Ie],I1.harden]}return R&&R.length>0&&(ye=[...ye,[$te,R]]),S!=null&&S.math&&(ye=[...ye,S.math.rehypePlugin]),ve&&b&&(ye=[...ye,ve.rehypePlugin]),ye},[l,S?.math,ve,b,L,R]),$e=E.useMemo(()=>{if(!b||ie.length===0)return!1;let ke=ie.at(-1);return ck(ke)||Ete(ke)},[b,ie]),De=E.useMemo(()=>w&&b&&!$e?{"--streamdown-caret":`"${Wte[w]}"`}:void 0,[w,b,$e]);return t==="static"?h.jsx(_1.Provider,{value:Ee,children:h.jsx(A1.Provider,{value:S??null,children:h.jsx(Yr.Provider,{value:Fe,children:h.jsx(sk,{icons:I,children:h.jsx(N1.Provider,{value:B,children:h.jsx("div",{className:B("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?uk(P):n,children:h.jsx(TO,{components:Oe,rehypePlugins:Ge,remarkPlugins:ze,...W,children:P})})})})})})}):h.jsx(_1.Provider,{value:Ee,children:h.jsx(A1.Provider,{value:S??null,children:h.jsx(Yr.Provider,{value:Fe,children:h.jsx(sk,{icons:I,children:h.jsx(N1.Provider,{value:B,children:h.jsxs("div",{className:B("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",w&&!$e?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:De,children:[ie.length===0&&w&&b&&h.jsx("span",{}),ie.map((ke,ye)=>{var Ie;let je=ye===ie.length-1,te=b&&je&&ck(ke);return h.jsx(v,{animatePlugin:ve,components:Oe,content:ke,dir:(Ie=ce?.[ye])!=null?Ie:n!=="auto"?n:void 0,index:ye,isIncomplete:te,rehypePlugins:Ge,remarkPlugins:ze,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...W},de[ye])})]})})})})})})},(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);NO.displayName="Streamdown";var Zte=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:l=1,fullscreen:c=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:f,ZoomOutIcon:g}=xs(),m=wt(),b=E.useRef(null),x=E.useRef(null),[v,k]=E.useState(l),[w,S]=E.useState({x:0,y:0}),[N,_]=E.useState(!1),[A,L]=E.useState({x:0,y:0}),[R,D]=E.useState({x:0,y:0}),I=E.useCallback(B=>{k(G=>Math.max(n,Math.min(r,G+B)))},[n,r]),U=E.useCallback(()=>{I(i)},[I,i]),z=E.useCallback(()=>{I(-i)},[I,i]),X=E.useCallback(()=>{k(l),S({x:0,y:0})},[l]),W=E.useCallback(B=>{B.preventDefault();let G=B.deltaY>0?-i:i;I(G)},[I,i]),V=E.useCallback(B=>{if(B.button!==0||B.isPrimary===!1)return;_(!0),L({x:B.clientX,y:B.clientY}),D(w);let G=B.currentTarget;G instanceof HTMLElement&&G.setPointerCapture(B.pointerId)},[w]),ee=E.useCallback(B=>{if(!N)return;B.preventDefault();let G=B.clientX-A.x,Q=B.clientY-A.y;S({x:R.x+G,y:R.y+Q})},[N,A,R]),q=E.useCallback(B=>{_(!1);let G=B.currentTarget;G instanceof HTMLElement&&G.releasePointerCapture(B.pointerId)},[]);return E.useEffect(()=>{let B=b.current;if(B)return B.addEventListener("wheel",W,{passive:!1}),()=>{B.removeEventListener("wheel",W)}},[W]),E.useEffect(()=>{let B=x.current;if(B&&N)return document.body.style.userSelect="none",B.addEventListener("pointermove",ee,{passive:!1}),B.addEventListener("pointerup",q),B.addEventListener("pointercancel",q),()=>{document.body.style.userSelect="",B.removeEventListener("pointermove",ee),B.removeEventListener("pointerup",q),B.removeEventListener("pointercancel",q)}},[N,ee,q]),h.jsxs("div",{className:m("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:b,style:{cursor:N?"grabbing":"grab"},children:[a?h.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",c?"bottom-4 left-4":"bottom-2 left-2"),children:[h.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:v>=r,onClick:U,title:"Zoom in",type:"button",children:h.jsx(f,{size:16})}),h.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:v<=n,onClick:z,title:"Zoom out",type:"button",children:h.jsx(g,{size:16})}),h.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:X,title:"Reset zoom and pan",type:"button",children:h.jsx(d,{size:16})})]}):null,h.jsx("div",{className:m("flex-1 origin-center transition-transform duration-150 ease-out",c?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:V,ref:x,role:"application",style:{transform:`translate(${w.x}px, ${w.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},_O=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=wt(),[l,c]=E.useState(null),[d,f]=E.useState(!1),[g,m]=E.useState(""),[b,x]=E.useState(""),[v,k]=E.useState(0),{mermaid:w}=E.useContext(Yr),S=Iy(),N=w?.errorComponent,{shouldRender:_,containerRef:A}=Eee({immediate:r});if(E.useEffect(()=>{if(_){if(!S){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),f(!0);let R=S.getMermaid(n),D=e.split("").reduce((z,X)=>(z<<5)-z+X.charCodeAt(0)|0,0),I=`mermaid-${Math.abs(D)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:U}=await R.render(I,e);m(U),x(U)}catch(R){if(!(b||g)){let D=R instanceof Error?R.message:"Failed to render Mermaid chart";c(D)}}finally{f(!1)}})()}},[e,n,v,_,S]),!(_||g||b))return h.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:A});if(d&&!g&&!b)return h.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:A,children:h.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[h.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),h.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(l&&!g&&!b){let R=()=>k(D=>D+1);return N?h.jsx("div",{ref:A,children:h.jsx(N,{chart:e,error:l,retry:R})}):h.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:A,children:[h.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",l]}),h.jsxs("details",{className:a("mt-2"),children:[h.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),h.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let L=g||b;return h.jsx("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:A,children:h.jsx(Zte,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:h.jsx("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:L},role:"img"})})})};const AO=E.createContext("cards");function RO({value:e,children:t}){return h.jsx(AO.Provider,{value:e,children:t})}function Jte(){return E.useContext(AO)}function Kr(){return Jte()==="lines"}function Mr({children:e,className:t}){return h.jsx("span",{"aria-hidden":!0,className:Se("w-3.5 shrink-0 select-none text-center font-mono text-label leading-5 text-fg-4",t),children:e})}const ene="text-body-sm leading-5",tne=["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(" "),xb=e=>function({className:n}){return h.jsx("span",{"aria-hidden":!0,className:Se("font-mono text-body-sm leading-5",n),children:e})},nne={DownloadIcon:xb("⤓"),CopyIcon:xb("⧉"),CheckIcon:xb("✓")},Ly=E.memo(function({children:t,streaming:n,className:r}){const i=Kr();return h.jsx(NO,{mode:n?"streaming":"static",parseIncompleteMarkdown:n,shikiTheme:["github-light","github-dark"],icons:i?nne:void 0,className:Se("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",i&&tne,r),children:t})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className),aa="pl-[calc(0.875rem+0.5rem)]",rne={check:["[ ]","[x]"],radio:["( )","(•)"]};function OO({options:e,focused:t,onFocus:n,onChoose:r,active:i=!0,label:a,className:l}){const c=E.useRef([]);E.useEffect(()=>{i&&c.current[t]?.focus()},[i,t]);const d=f=>{e.length>0&&n((t+f+e.length)%e.length)};return h.jsx("div",{role:"group","aria-label":a,className:Se("flex flex-col",l),onKeyDown:f=>{if(f.key==="ArrowDown"){d(1),f.preventDefault();return}if(f.key==="ArrowUp"){d(-1),f.preventDefault();return}const g=Number(f.key);Number.isInteger(g)&&g>=1&&g<=Math.min(e.length,9)&&(n(g-1),r(g-1),f.preventDefault())},children:e.map((f,g)=>{const m=g===t;return h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("button",{ref:b=>{c.current[g]=b},type:"button",tabIndex:m?0:-1,"aria-pressed":f.checked,onFocus:()=>n(g),onClick:()=>r(g),className:Se("flex w-full items-baseline gap-2 text-left outline-none",m?"bg-surface-hover":"hover:bg-surface-hover/60"),children:[h.jsx(Mr,{className:m?"text-accent":void 0,children:m?"❯":" "}),h.jsx("span",{className:"shrink-0 font-mono text-label leading-5 text-fg-4",children:g+1}),f.checked!==void 0?h.jsx("span",{className:Se("shrink-0 font-mono text-label leading-5",f.checked?"text-accent":"text-fg-4"),children:rne[f.marker??"check"][f.checked?1:0]}):null,h.jsxs("span",{className:Se("min-w-0 flex-1 text-body-sm leading-5",f.danger?"text-danger":"text-fg-1"),children:[f.label,f.description?h.jsxs("span",{className:"text-fg-4",children:[" — ",f.description]}):null]})]}),f.detail?h.jsx("div",{className:aa,children:f.detail}):null]},f.key)})})}function IO({children:e}){return h.jsx("div",{className:Se(aa,"text-label leading-5 text-fg-4"),children:e})}function MO({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:i}){return h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-accent",children:"›"}),h.jsx("input",{autoFocus:!0,value:e,placeholder:i,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 Dy({code:e,label:t,language:n,className:r}){return h.jsxs("div",{className:Se("min-w-0",r),children:[h.jsx("span",{className:"block truncate text-label leading-5 text-fg-4",children:t}),h.jsx(Ly,{children:sne(e,n)})]})}function sne(e,t){const n=Math.max(0,...[...e.matchAll(/`+/g)].map(i=>i[0].length)),r="`".repeat(Math.max(3,n+1));return`${r}${t??""}
663
- ${e}
664
- ${r}`}function ine({request:e,onApprove:t,onDeny:n,className:r}){const i=Kr(),[a,l]=E.useState(!1),[c,d]=E.useState(!1),[f,g]=E.useState(""),[m,b]=E.useState(0),x=S=>{const N=f.trim();n(e.id,N||void 0,S||void 0),g(""),d(!1)},v=i1(e.input),k=RA(e.toolName),w=e.title??e.displayName??"Permission needed";if(i){const S=[{key:"allow",label:"Allow"},{key:"deny",label:"Deny",description:"the turn continues",detail:c?h.jsx(MO,{value:f,onChange:g,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 h.jsxs("div",{"data-slot":"permission-prompt",className:Se("w-full",r),onKeyDown:N=>{N.key==="Escape"&&(N.preventDefault(),x(!1))},children:[h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-warning",children:"!"}),h.jsx("span",{className:"min-w-0 flex-1 text-body-sm leading-5 font-medium text-fg-1",children:w})]}),e.description?h.jsx("div",{className:Se(aa,"text-label leading-5 text-fg-3"),children:e.description}):null,e.decisionReason?h.jsx("div",{className:Se(aa,"text-label leading-5 text-fg-4"),children:e.decisionReason}):null,h.jsxs("button",{type:"button",onClick:()=>l(N=>!N),className:"flex w-full items-baseline gap-2 text-left outline-none hover:bg-surface-hover/60",children:[h.jsx(Mr,{className:"text-fg-4",children:"⎿"}),h.jsxs("span",{className:"min-w-0 flex-1 truncate text-label leading-5 text-fg-4",children:[h.jsx("span",{className:"font-medium text-fg-2",children:e.toolName}),v?`(${v})`:null]})]}),a?h.jsx("div",{className:aa,children:h.jsx(Dy,{code:JSON.stringify(e.input,null,2),language:"json",label:"Input"})}):null,h.jsx(OO,{label:w,options:S,focused:m,onFocus:b,active:!c,onChoose:N=>{N===0?t(e.id):N===1?d(!0):x(!0)}}),h.jsx(IO,{children:"↑↓ move · 1–3 choose · esc deny"})]})}return h.jsxs("div",{"data-slot":"permission-prompt",className:Se("rounded-lg border border-warning/40 bg-warning-bg p-3",r),children:[h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx(I_,{className:"mt-0.5 size-4 shrink-0 text-warning"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-body-sm font-medium text-fg-1",children:e.title??e.displayName??"Permission needed"}),e.description?h.jsx("div",{className:"mt-0.5 text-label text-fg-3",children:e.description}):null,e.decisionReason?h.jsx("div",{className:"mt-0.5 text-label text-fg-4",children:e.decisionReason}):null,h.jsxs("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[h.jsx(k,{className:"size-3 shrink-0 text-fg-3"}),h.jsx("span",{className:"shrink-0 font-mono text-label font-medium text-fg-2",children:e.toolName}),v?h.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",children:v}):null]}),h.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?h.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]}),h.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-1.5",children:[h.jsx(at,{size:"sm",onClick:()=>t(e.id),children:"Allow"}),h.jsx(at,{size:"sm",variant:"outline",onClick:()=>d(S=>!S),children:"Deny"}),h.jsx(at,{size:"sm",variant:"outline",onClick:()=>x(!0),children:"Deny & stop"})]})]}),c?h.jsxs("div",{className:"mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5",children:[h.jsx(un,{autoFocus:!0,value:f,onChange:S=>g(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"}),h.jsx(at,{size:"sm",variant:"outline",onClick:()=>d(!1),children:"Cancel"}),h.jsx(at,{size:"sm",variant:"destructive",onClick:()=>x(!1),children:"Deny"})]}):null]})}const Sk=[{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 LO(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(n=>{const r=n;if(typeof r.question!="string"||!Array.isArray(r.options))return[];const i=r.options.filter(a=>typeof a?.label=="string");return i.length===0?[]:[{question:r.question,header:typeof r.header=="string"?r.header:"",options:i,multiSelect:r.multiSelect===!0}]})}const ane=e=>e.some(t=>t.multiSelect===!0),vl={labels:[],other:"",otherActive:!1};function Ck(e){const t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(", ")}function one({request:e,onAnswer:t,onDismiss:n,className:r}){const i=Kr(),a=LO(e.input),[l,c]=E.useState(()=>a.map(()=>vl)),[d,f]=E.useState(()=>a.map(()=>0)),[g,m]=E.useState(0),b=(w,S)=>{c(N=>N.map((_,A)=>A===w?{..._,...S}:_))},x=(w,S,N)=>{const _=l[w]??vl;N?b(w,{labels:_.labels.includes(S)?_.labels.filter(A=>A!==S):[..._.labels,S]}):b(w,{labels:_.labels[0]===S?[]:[S],otherActive:!1})},v=a.every((w,S)=>Ck(l[S]??vl)!==""),k=()=>{const w={};a.forEach((S,N)=>{w[S.question]=Ck(l[N]??vl)}),t(e.id,{...e.input,answers:w})};if(i){const w=()=>n(e.id,"Question dismissed by user");return h.jsxs("div",{"data-slot":"question-prompt",className:Se("flex w-full flex-col gap-2",r),onKeyDown:S=>{if(S.key==="Escape"){S.preventDefault(),w();return}S.key==="Enter"&&(S.metaKey||S.ctrlKey)&&v&&(S.preventDefault(),k())},children:[a.map((S,N)=>{const _=l[N]??vl,A=d[N]??0,L=S.multiSelect===!0,R=[...S.options.map((D,I)=>{const U=_.labels.includes(D.label);return{key:D.label,label:D.label,description:D.description,detail:D.preview&&(U||A===I)?h.jsx(Dy,{code:D.preview,label:"Preview"}):void 0,checked:U,marker:L?"check":"radio"}}),{key:"__other",label:"Other…",checked:_.otherActive,marker:L?"check":"radio",detail:_.otherActive?h.jsx(MO,{value:_.other,onChange:D=>b(N,{other:D}),onSubmit:()=>{v&&k()},onCancel:()=>b(N,{otherActive:!1,other:""}),placeholder:"Type your own answer"}):void 0}];return h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-info",children:"?"}),h.jsxs("span",{className:"min-w-0 flex-1 text-body-sm leading-5 text-fg-1",children:[S.header?h.jsxs("span",{className:"text-fg-4",children:[S.header," · "]}):null,h.jsx("span",{className:"font-medium",children:S.question})]})]}),h.jsx(OO,{label:S.question,options:R,focused:A,active:g===N&&!_.otherActive,onFocus:D=>{m(N),f(I=>I.map((U,z)=>z===N?D:U))},onChoose:D=>{if(D===S.options.length){b(N,{otherActive:!_.otherActive});return}const I=S.options[D];I&&x(N,I.label,L)}})]},N)}),h.jsx("div",{className:Se(aa,"flex flex-col"),children:h.jsx("button",{type:"button",disabled:!v,onClick:k,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"})}),h.jsxs(IO,{children:["↑↓ move · ",ane(a)?"space/1–9 toggle":"1–9 choose"," · ⌘⏎ answer · esc dismiss"]})]})}return h.jsx("div",{"data-slot":"question-prompt",className:Se("rounded-lg border border-info/40 bg-info-bg p-3",r),children:h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx(D_,{className:"mt-0.5 size-4 shrink-0 text-info"}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[a.map((w,S)=>{const N=l[S]??vl;return h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[w.header?h.jsx(gn,{variant:"info",children:w.header}):null,h.jsx("span",{className:"text-body-sm font-medium text-fg-1",children:w.question})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[w.options.map(_=>{const A=N.labels.includes(_.label);return h.jsxs("button",{type:"button",onClick:()=>x(S,_.label,w.multiSelect===!0),className:Se("rounded-md border px-2.5 py-1.5 text-left transition-colors",A?"border-info bg-bg":"border-border bg-bg/50 hover:border-border-strong hover:bg-bg"),children:[h.jsx("span",{className:"block text-body-sm font-medium text-fg-1",children:_.label}),_.description?h.jsx("span",{className:"block text-label text-fg-4",children:_.description}):null,A&&_.preview?h.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:_.preview}):null]},_.label)}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:()=>b(S,{otherActive:!N.otherActive}),className:Se("shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors",N.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…"}),N.otherActive?h.jsx(un,{autoFocus:!0,value:N.other,onChange:_=>b(S,{other:_.target.value}),placeholder:"Type your own answer",className:"flex-1"}):null]})]})]},S)}),h.jsx("div",{children:h.jsx(at,{size:"sm",onClick:k,disabled:!v,children:"Answer"})})]}),h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss question",className:"shrink-0",onClick:()=>n(e.id,"Question dismissed by user"),children:h.jsx(bi,{className:"size-3.5"})})]})})}function lne({state:e,client:t,sessionId:n,open:r,onOpenChange:i}){const a=e.session,l=e.permissionMode?MF(e.permissionMode):void 0;return h.jsx(tu,{open:r,onOpenChange:i,children:h.jsxs(nu,{children:[h.jsx(ru,{title:"Session info",description:a?.title}),h.jsx(su,{children:h.jsxs("div",{className:"flex flex-col divide-y divide-border",children:[h.jsxs("div",{className:"pb-2",children:[h.jsx(ir,{label:"Engine",children:e.engine??"claude"}),a?.profile?h.jsx(ir,{label:"Profile",children:a.profile}):null,e.model?h.jsx(ir,{label:"Model",mono:!0,children:e.model}):null,l?h.jsx(ir,{label:"Permission mode",children:l.label}):null,a?.apiKeySource?h.jsx(ir,{label:"Credentials",children:a.apiKeySource}):null]}),h.jsxs("div",{className:"py-2",children:[e.cwd?h.jsx(yb,{label:"Working directory",value:e.cwd}):null,e.sdkSessionId?h.jsx(yb,{label:"Engine session id",value:e.sdkSessionId}):null,a?h.jsx(yb,{label:"Gateway session id",value:a.id}):null]}),h.jsxs("div",{className:"py-2",children:[a?.createdAt?h.jsx(ir,{label:"Started",children:cd(a.createdAt)}):null,a?.numTurns!==void 0?h.jsx(ir,{label:"Turns",children:a.numTurns}):null,h.jsx(ir,{label:"Cost",mono:!0,children:bo(e.totalCostUsd)})]}),e.capabilities.vfs?h.jsx(une,{client:t,sessionId:n,open:r}):null]})})]})})}function yb({label:e,value:t}){return h.jsxs("div",{className:"flex items-start justify-between gap-2 py-1.5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-label text-fg-3",children:e}),h.jsx("div",{className:"mt-0.5 font-mono text-label break-all text-fg-1",children:t})]}),h.jsx(Gh,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function une({client:e,sessionId:t,open:n}){const[r,i]=E.useState(),[a,l]=E.useState(!1);return E.useEffect(()=>{if(!n||!t)return;let c=!1;return l(!0),e.listSessionFiles(t).then(d=>{c||i(d)}).catch(()=>{c||i([])}).finally(()=>{c||l(!1)}),()=>{c=!0}},[e,t,n]),h.jsxs("div",{className:"pt-3",children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Files"}),a?h.jsx("div",{className:"py-3 text-center",children:h.jsx(vn,{className:"size-4 text-fg-4"})}):r?.length?h.jsx("ul",{className:"mt-1 flex flex-col",children:r.map(c=>h.jsx("li",{children:h.jsxs("a",{href:t?e.sessionFileUrl(t,c.path):void 0,className:"flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover",children:[h.jsx(A_,{className:"size-3.5 shrink-0 text-fg-4"}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:c.path}),h.jsx("span",{className:"shrink-0 text-label text-fg-4",children:xo(c.bytes)})]})},c.path))}):h.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:"Nothing delivered yet."})]})}const DO={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 cne(e=3e4){const[t,n]=E.useState(()=>Date.now());return E.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}const jO=e=>e>=95?"text-danger":e>=80?"text-warning":"text-fg-3",dne=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0;function fne({usage:e}){return h.jsx(Kx,{content:h.jsxs("div",{className:"flex min-w-44 flex-col gap-1 py-0.5",children:[e.categories.map(t=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:dne(t.color)?{backgroundColor:t.color}:void 0}),h.jsx("span",{className:"flex-1",children:t.name}),h.jsx("span",{className:"font-mono text-fg-3",children:us(t.tokens)})]},t.name)),h.jsxs("div",{className:"mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1",children:[h.jsx("span",{children:"Total"}),h.jsxs("span",{className:"font-mono text-fg-3",children:[us(e.totalTokens)," / ",us(e.maxTokens)," (",e.percentage.toFixed(0),"%)"]})]})]}),children:h.jsxs("span",{className:Se("inline-flex cursor-default items-center gap-1 font-mono text-label",jO(e.percentage)),children:["Ctx ",us(e.totalTokens)]})})}function wk({label:e,info:t,now:n}){const r=t.utilization,i=t.resetsAt!==void 0?t.resetsAt*1e3:void 0;return h.jsx(Kx,{content:h.jsxs("div",{className:"flex min-w-36 flex-col gap-1 py-0.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{children:[e," usage"]}),h.jsx("span",{className:"font-mono text-fg-3",children:r!==void 0?`${r.toFixed(1)}%`:"—"})]}),i!==void 0?h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{children:"Resets in"}),h.jsx("span",{className:"font-mono text-fg-3",children:s1(i,n)})]}):null,t.isUsingOverage?h.jsx("div",{className:"text-warning",children:"Using overage"}):null,t.status==="rejected"?h.jsx("div",{className:"text-danger",children:"Limit reached"}):null]}),children:h.jsxs("span",{className:Se("inline-flex cursor-default items-center gap-1 font-mono text-label",t.status==="rejected"?"text-danger":jO(r??0)),children:[h.jsx(oA,{value:r??0}),e,r!==void 0?` ${r.toFixed(0)}%`:"",i!==void 0?h.jsxs("span",{className:"text-fg-4",children:["· ",s1(i,n)]}):null]})})}function Eb({onClick:e,hint:t,children:n}){return e?h.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}):h.jsx(h.Fragment,{children:n})}function hne({state:e,connected:t,connection:n,onOpenStatus:r,onOpenContext:i,onOpenUsage:a,actions:l,className:c}){const d=DO[e.status],f=cne(),g=e.rateLimits?.five_hour,m=e.rateLimits?.seven_day,b=n??(t===!1?"reconnecting":"live");return h.jsxs("div",{"data-slot":"status-bar",className:Se("flex items-center gap-2 border-b border-border bg-surface px-3 py-1.5",c),children:[h.jsx(Eb,{onClick:r,hint:"Session info",children:b==="live"?h.jsxs(gn,{variant:d.variant,dot:!d.busy,children:[d.busy?h.jsx(vn,{className:"size-3 text-current"}):null,d.label]}):h.jsxs(gn,{variant:b==="offline"?"danger":"warning",dot:!1,children:[b==="offline"?h.jsx(vB,{className:"size-3 text-current"}):h.jsx(Dm,{className:"size-3 animate-spin text-current"}),b==="offline"?"Offline":"Reconnecting…"]})}),e.capabilities.contextUsage&&e.contextUsage?h.jsx(Eb,{onClick:i,hint:"Context breakdown",children:h.jsx(fne,{usage:e.contextUsage})}):null,g||m?h.jsx(Eb,{onClick:a,hint:"Plan usage",children:h.jsxs("span",{className:"inline-flex items-center gap-2",children:[g?h.jsx(wk,{label:"Session",info:g,now:f}):null,m?h.jsx(wk,{label:"Weekly",info:m,now:f}):null]})}):null,h.jsx("span",{className:"flex-1"}),h.jsx("span",{className:"font-mono text-label text-fg-3",children:bo(e.totalCostUsd)}),l]})}function mne(e,t,n){const r=new Array(e);return new Proxy(r,{get(i,a,l){if(typeof a=="string"){const c=a.charCodeAt(0);if(c>=48&&c<=57){const d=+a;if(Number.isInteger(d)&&d>=0&&d<e){let f=i[d];if(!f){const g=t[d*2];f=i[d]={index:d,key:n(d),start:g,size:t[d*2+1],end:g+t[d*2+1],lane:0}}return f}}if(a==="length")return e}return Reflect.get(i,a,l)}})}function Tl(e,t,n){let r=n.initialDeps??[],i,a=!0;function l(){const c=e();return(c.length!==r.length||c.some((f,g)=>r[g]!==f))&&(r=c,i=t(...c),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return l.updateDeps=c=>{r=c},l}function kk(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const pne=(e,t)=>Math.abs(e-t)<1.01,gne=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}};let bc;const vb=()=>{if(bc!==void 0)return bc;if(typeof navigator>"u")return bc=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return bc=!0;const e=navigator.maxTouchPoints;return bc=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Nk=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},bne=e=>e,xne=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,i=new Array(r);for(let a=0;a<r;a++)i[a]=t+a;return i},yne=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=l=>{const{width:c,height:d}=l;t({width:Math.round(c),height:Math.round(d)})};if(i(Nk(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(l=>{const c=()=>{const d=l[0];if(d?.borderBoxSize){const f=d.borderBoxSize[0];if(f){i({width:f.inlineSize,height:f.blockSize});return}}i(Nk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},om={passive:!0},Ene=typeof window>"u"?!0:"onscrollend"in window,vne=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const a=e.options.useScrollendEvent&&Ene;let l=0;const c=a?null:gne(i,()=>t(l,!1),e.options.isScrollingResetDelay),d=m=>()=>{l=n(r),c?.(),t(l,m)},f=d(!0),g=d(!1);return r.addEventListener("scroll",f,om),a&&r.addEventListener("scrollend",g,om),()=>{r.removeEventListener("scroll",f),a&&r.removeEventListener("scrollend",g)}},Tne=(e,t)=>vne(e,t,n=>{const{horizontal:r,isRtl:i}=e.options;return r?n.scrollLeft*(i&&-1||1):n.scrollTop}),Sne=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),i=n.options.getItemKey(r);return n.itemSizeCache.get(i)??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),i=n.options.getItemKey(r),a=n.itemSizeCache.get(i);if(a!==void 0)return a}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Cne=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||a.call(i,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},wne=Cne;class kne{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,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(a=>{const l=()=>{const c=a.target,d=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[f,g]of this.elementsCache)if(g===c){this.elementsCache.delete(f);break}return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(c,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var a;return(a=r())==null?void 0:a.observe(i,{box:"border-box"})},unobserve:i=>{var a;return(a=r())==null?void 0:a.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{var r,i;const a={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bne,rangeExtractor:xne,onChange:()=>{},measureElement:Sne,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 c=null,d=null,f=!1;if(l!==void 0&&l.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const b=l.count,x=a.count,v=this.getMeasurements(),k=b>0?((r=v[0])==null?void 0:r.key)??l.getItemKey(0):null,w=b>0?((i=v[b-1])==null?void 0:i.key)??l.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(a.getItemKey(0)!==k||a.getItemKey(x-1)!==w)){f=!0;const _=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??v[0]:null;_&&(c=[_.key,this.getScrollOffset()-_.start]);const A=a.followOnAppend===!0?"auto":a.followOnAppend||null;A&&x>b&&this.isAtEnd(l.scrollEndThreshold)&&(b===0||a.getItemKey(x-1)!==w)&&(d=A)}}this.options=a,f&&(this.pendingMin=0,this.itemSizeCacheVersion++);let g=!1,m=0;if(c&&this.scrollOffset!==null){const[b,x]=c,v=this.getMeasurements(),{count:k,getItemKey:w}=this.options;let S=0;for(;S<k&&w(S)!==b;)S++;if(S<k){const N=v[S];if(N){const _=Math.max(0,N.start+x);_!==this.scrollOffset&&(m=_-this.scrollOffset,this.scrollOffset=_,g=!0)}}}(g||d)&&(this.pendingScrollAnchor=[g?c[0]:null,g?c[1]:0,d,m])},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Tl(()=>(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 c=this.getScrollOffset();this.scrollDirection=l?c===a?this.scrollDirection:c<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)},c=()=>{this._iosTouching=!1,!(!vb()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,om),a.addEventListener("touchend",c,om),this.unsubs.push(()=>{a.removeEventListener("touchstart",l),a.removeEventListener("touchend",c),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 i=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled){const[a,l,c,d]=i;a!==null&&!c&&(vb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?d!==0&&(this._iosDeferredAdjustment+=d):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}},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 i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=i,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=Tl(()=>[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,i,a,l,c,d,f)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:i,getItemKey:a,enabled:l,lanes:c,laneAssignmentMode:d,gap:f}),{key:!1}),this.getMeasurements=Tl(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:i,getItemKey:a,enabled:l,lanes:c,laneAssignmentMode:d,gap:f},g)=>{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),c===1){const S=n*2;let N=this._flatMeasurements;if(!N||N.length<S){const L=new Float64Array(S);N&&b>0&&L.set(N.subarray(0,b*2)),N=L,this._flatMeasurements=N}let _;if(b===0)_=r+i;else{const L=b-1;_=N[L*2]+N[L*2+1]+f}for(let L=b;L<n;L++){const R=a(L),D=m.get(R),I=typeof D=="number"?D:this.options.estimateSize(L);N[L*2]=_,N[L*2+1]=I,_+=I+f}const A=mne(n,N,a);return this.measurementsCache=A,A}const x=this.measurementsCache.slice(0,b),v=new Array(c).fill(void 0),k=new Float64Array(c);let w=0;for(let S=0;S<b;S++){const N=x[S];N&&(v[N.lane]===void 0&&w++,v[N.lane]=S,k[N.lane]=N.end)}for(let S=b;S<n;S++){const N=a(S),_=this.laneAssignments.get(S);let A,L;const R=d==="estimate"||m.has(N);if(_!==void 0&&this.options.lanes>1){A=_;const z=v[A],X=z!==void 0?x[z]:void 0;L=X?X.end+f:r+i}else if(w===c){let z=0,X=k[0],W=v[0];for(let V=1;V<c;V++){const ee=k[V];(ee<X||ee===X&&v[V]<W)&&(z=V,X=ee,W=v[V])}A=z,L=X+f,R&&this.laneAssignments.set(S,A)}else A=S%this.options.lanes,L=r+i,R&&this.laneAssignments.set(S,A);const D=m.get(N),I=typeof D=="number"?D:this.options.estimateSize(S),U=L+I;x[S]={index:S,start:L,size:I,end:U,key:N,lane:A},v[A]===void 0&&w++,v[A]=S,k[A]=U}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Tl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,a)=>n.length===0||r===0?(this.range=null,null):(this.range=_ne(n,r,i,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Tl(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,a,l)=>a===null||l===null?[]:n({startIndex:a,endIndex:l,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,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 i=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(i!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,i-a),c=Math.min(this.options.count-1,i+a);return n>=l&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((l,c)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(c))});return}const r=this.indexFromElement(n),i=this.options.getItemKey(r),a=this.elementsCache.get(i);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var i,a;if(n<0||n>=this.options.count)return;let l,c,d;const f=this._flatMeasurements;if(this.options.lanes===1&&f!==null)d=this.options.getItemKey(n),c=f[n*2],l=f[n*2+1];else{const b=this.measurementsCache[n];if(!b)return;d=b.key,c=b.start,l=b.size}const g=this.itemSizeCache.get(d)??l,m=r-g;if(m!==0){const b=this.options.anchorTo==="end"&&((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=b?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,w=!this.itemSizeCache.has(d)?c<v:c+g<=v&&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:c,size:l,end:c+l,lane:0},m,this):w);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(d,r),this.itemSizeCacheVersion++;let N=!1;b?N=this.applyScrollAdjustment(this.getTotalSize()-x):S&&(N=this.applyScrollAdjustment(m)),this.notify(N)}},this.getVirtualItems=Tl(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let a=0,l=n.length;a<l;a++){const c=n[a],d=r[c];i.push(d)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const i=this._flatMeasurements,a=this.options.lanes===1&&i!=null,l=PO(0,r.length-1,a?c=>i[c*2]:c=>kk(r[c]).start,n);return kk(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,i=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),l=this.getScrollOffset();r==="auto"&&(r=n>=l+a?"end":"start"),r==="center"?n+=(i-a)/2:r==="end"&&(n-=a);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),a=this.getScrollOffset(),l=this.measurementsCache[n];if(!l)return;if(r==="auto")if(l.end>=a+i-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 c=r==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,l.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{this._iosDeferredAdjustment=0;const a=this.getOffsetForAlignment(n,r),l=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="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,c]=a,d=this.now();this.scrollState={index:n,align:c,behavior:i,startedAt:d,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{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 i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1){const a=r.length-1,l=this._flatMeasurements;l!=null?i=l[a*2]+l[a*2+1]:i=((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(c=>c===null);){const c=r[l];a[c.lane]===null&&(a[c.lane]=c.end),l--}i=Math.max(...a.filter(c=>c!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const i of r)i&&this.itemSizeCache.has(i.key)&&n.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:i,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:vb()&&(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,i=r?r[0]:this.scrollState.lastTargetOffset,a=1,l=i!==this.scrollState.lastTargetOffset;if(!l&&pne(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const c=this.getSize()||600,d=Math.abs(i-this.getScrollOffset()),f=this.scrollState.behavior==="smooth"&&d>c;this.scrollState.lastTargetOffset=i,f||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:f?"smooth":"auto"})}this.scheduleScrollReconcile()}}const PO=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Nne(e,t,n){let r=0;for(;r<=t;){const i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function _ne(e,t,n,r,i){const a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){const f=Nne(i,a,n);let g=f;const m=n+t;for(;g<a&&i[g*2]+i[g*2+1]<m;)g++;return{startIndex:f,endIndex:g}}let c=PO(0,a,f=>e[f].start,n),d=c;if(r===1)for(;d<a&&e[d].end<n+t;)d++;else if(r>1){const f=Array(r).fill(0);for(;d<a&&f.some(m=>m<n+t);){const m=e[d];f[m.lane]=m.end,d++}const g=Array(r).fill(n+t);for(;c>=0&&g.some(m=>m>=n);){const m=e[c];g[m.lane]=m.start,c--}c=Math.max(0,c-c%r),d=Math.min(a,d+(r-1-d%r))}return{startIndex:c,endIndex:d}}const Tb=typeof document<"u"?E.useLayoutEffect:E.useEffect;function Ane({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const i=E.useReducer(g=>g+1,0)[1],a=E.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;const l=g=>{const m=a.current;if(!m.enabled||!m.container)return;const b=g.getTotalSize();if(b!==m.lastSize){m.lastSize=b;const x=g.options.horizontal?"width":"height";m.container.style[x]=`${b}px`}},c=g=>{const m=a.current;if(!m.enabled||!m.container)return;l(g);const b=!!g.options.horizontal,x=m.mode==="transform",v=b?"left":"top",k=g.options.scrollMargin,w=g.getVirtualItems();for(const S of w){const N=S.start-k,_=g.elementsCache.get(S.key);_&&m.lastPositions.get(_)!==N&&(m.lastPositions.set(_,N),x?_.style.transform=b?`translate3d(${N}px, 0, 0)`:`translate3d(0, ${N}px, 0)`:_.style[v]=`${N}px`)}},d={...r,onChange:(g,m)=>{var b;const x=a.current;let v=!0;if(x.enabled){c(g);const k=g.range,w=x.prevRange;v=!w||w.isScrolling!==g.isScrolling||w.startIndex!==k?.startIndex||w.endIndex!==k?.endIndex,v&&(x.prevRange=k?{startIndex:k.startIndex,endIndex:k.endIndex,isScrolling:g.isScrolling}:null)}v&&(e&&m?lr.flushSync(i):i()),(b=r.onChange)==null||b.call(r,g,m)}},[f]=E.useState(()=>{const g=new kne(d);return Object.assign(g,{containerRef:m=>{const b=a.current;if(b.container=m,b.lastSize=null,m&&b.enabled){const x=g.getTotalSize();b.lastSize=x;const v=g.options.horizontal?"width":"height";m.style[v]=`${x}px`}}})});return f.setOptions(d),Tb(()=>f._didMount(),[]),Tb(()=>(l(f),f._willUpdate())),Tb(()=>{c(f)}),f}function Rne(e){return Ane({observeElementRect:yne,observeElementOffset:Tne,scrollToFn:wne,...e})}/*!---------------------------------------------------------------------------------------------
665
- * Copyright (c) StackBlitz. All rights reserved.
666
- * Licensed under the MIT License. See License.txt in the project root for license information.
667
- *--------------------------------------------------------------------------------------------*/const One={damping:.7,stiffness:.05,mass:1.25},Ine=70,Mne=1e3/60,Lne=350;let np=!1;globalThis.document?.addEventListener("mousedown",()=>{np=!0});globalThis.document?.addEventListener("mouseup",()=>{np=!1});globalThis.document?.addEventListener("click",()=>{np=!1});const Dne=(e={})=>{const[t,n]=E.useState(!1),[r,i]=E.useState(e.initial!==!1),[a,l]=E.useState(!1),c=E.useRef(null);c.current=e;const d=E.useCallback(()=>{if(!np)return!1;const N=window.getSelection();if(!N||!N.rangeCount)return!1;const _=N.getRangeAt(0);return _.commonAncestorContainer.contains(w.current)||w.current?.contains(_.commonAncestorContainer)},[]),f=E.useCallback(N=>{m.isAtBottom=N,i(N)},[]),g=E.useCallback(N=>{m.escapedFromLock=N,n(N)},[]),m=E.useMemo(()=>{let N;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return w.current?.scrollTop??0},set scrollTop(_){if(w.current){const{scrollBehavior:A}=getComputedStyle(w.current);A!=="auto"&&(w.current.style.scrollBehavior="auto"),w.current.scrollTop=_,m.ignoreScrollToTop=w.current.scrollTop,A!=="auto"&&(w.current.style.scrollBehavior=A)}},get targetScrollTop(){return!w.current||!S.current?0:w.current.scrollHeight-1-w.current.clientHeight},get calculatedTargetScrollTop(){if(!w.current||!S.current)return 0;const{targetScrollTop:_}=this;if(!e.targetScrollTop)return _;if(N?.targetScrollTop===_)return N.calculatedScrollTop;const A=Math.max(Math.min(e.targetScrollTop(_,{scrollElement:w.current,contentElement:S.current}),_),0);return N={targetScrollTop:_,calculatedScrollTop:A},requestAnimationFrame(()=>{N=void 0}),A},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Ine}}},[]),b=E.useCallback((N={})=>{typeof N=="string"&&(N={animation:N}),N.preserveScrollPosition||f(!0);const _=Date.now()+(Number(N.wait)||0),A=Cb(c.current,N.animation),{ignoreEscapes:L=!1}=N;let R,D=m.calculatedTargetScrollTop;N.duration instanceof Promise?N.duration.finally(()=>{R=Date.now()}):R=_+(N.duration??0);const I=async()=>{const U=new Promise(requestAnimationFrame).then(()=>{if(!m.isAtBottom)return m.animation=void 0,!1;const{scrollTop:z}=m,X=performance.now(),W=(X-(m.lastTick??X))/Mne;if(m.animation||(m.animation={behavior:A,promise:U,ignoreEscapes:L}),m.animation.behavior===A&&(m.lastTick=X),d()||_>Date.now())return I();if(z<Math.min(D,m.calculatedTargetScrollTop)){if(m.animation?.behavior===A){if(A==="instant")return m.scrollTop=m.calculatedTargetScrollTop,I();m.velocity=(A.damping*m.velocity+A.stiffness*m.scrollDifference)/A.mass,m.accumulated+=m.velocity*W,m.scrollTop+=m.accumulated,m.scrollTop!==z&&(m.accumulated=0)}return I()}return R>Date.now()?(D=m.calculatedTargetScrollTop,I()):(m.animation=void 0,m.scrollTop<m.calculatedTargetScrollTop?b({animation:Cb(c.current,c.current.resize),ignoreEscapes:L,duration:Math.max(0,R-Date.now())||void 0}):m.isAtBottom)});return U.then(z=>(requestAnimationFrame(()=>{m.animation||(m.lastTick=void 0,m.velocity=0)}),z))};return N.wait!==!0&&(m.animation=void 0),m.animation?.behavior===A?m.animation.promise:I()},[f,d,m]),x=E.useCallback(()=>{g(!0),f(!1)},[g,f]),v=E.useCallback(({target:N})=>{if(N!==w.current)return;const{scrollTop:_,ignoreScrollToTop:A}=m;let{lastScrollTop:L=_}=m;m.lastScrollTop=_,m.ignoreScrollToTop=void 0,A&&A>_&&(L=A),l(m.isNearBottom),setTimeout(()=>{if(m.resizeDifference||_===A)return;if(d()){g(!0),f(!1);return}const R=_>L,D=_<L;if(m.animation?.ignoreEscapes){m.scrollTop=L;return}D&&(g(!0),f(!1)),R&&g(!1),!m.escapedFromLock&&m.isNearBottom&&f(!0)},1)},[g,f,d,m]),k=E.useCallback(({target:N,deltaY:_})=>{let A=N;for(;!["scroll","auto"].includes(getComputedStyle(A).overflow);){if(!A.parentElement)return;A=A.parentElement}A===w.current&&_<0&&w.current.scrollHeight>w.current.clientHeight&&!m.animation?.ignoreEscapes&&(g(!0),f(!1))},[g,f,m]),w=_k(N=>{w.current?.removeEventListener("scroll",v),w.current?.removeEventListener("wheel",k),N?.addEventListener("scroll",v,{passive:!0}),N?.addEventListener("wheel",k,{passive:!0})},[]),S=_k(N=>{if(m.resizeObserver?.disconnect(),m.resizeObserver=void 0,!N)return;let _;m.resizeObserver=new ResizeObserver(([A])=>{const{height:L}=A.contentRect,R=L-(_??L);if(m.resizeDifference=R,m.scrollTop>m.targetScrollTop&&(m.scrollTop=m.targetScrollTop),l(m.isNearBottom),R>=0){const D=Cb(c.current,_?c.current.resize:c.current.initial);b({animation:D,wait:!0,preserveScrollPosition:!0,duration:D==="instant"?void 0:Lne})}else m.isNearBottom&&(g(!1),f(!0));_=L,requestAnimationFrame(()=>{setTimeout(()=>{m.resizeDifference===R&&(m.resizeDifference=0)},1)})}),m.resizeObserver?.observe(N)},[]);return{contentRef:S,scrollRef:w,scrollToBottom:b,stopScroll:x,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:m}};function _k(e,t){const n=E.useCallback(r=>(n.current=r,e(r)),t);return n}const Sb=new Map;function Cb(...e){const t={...One};let n=!1;for(const i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const r=JSON.stringify(t);return Sb.has(r)||Sb.set(r,Object.freeze(t)),n?"instant":Sb.get(r)}/*!---------------------------------------------------------------------------------------------
668
- * Copyright (c) StackBlitz. All rights reserved.
669
- * Licensed under the MIT License. See License.txt in the project root for license information.
670
- *--------------------------------------------------------------------------------------------*/const BO=E.createContext(null),jne=typeof window<"u"?E.useLayoutEffect:E.useEffect;function lm({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:l,targetScrollTop:c,contextRef:d,...f}){const g=E.useRef(null),m=E.useCallback((L,R)=>(A?.targetScrollTop??c)?.(L,R)??L,[c]),b=Dne({mass:i,damping:a,stiffness:l,resize:n,initial:r,targetScrollTop:m}),{scrollRef:x,contentRef:v,scrollToBottom:k,stopScroll:w,isAtBottom:S,escapedFromLock:N,state:_}=e??b,A=E.useMemo(()=>({scrollToBottom:k,stopScroll:w,scrollRef:x,isAtBottom:S,escapedFromLock:N,contentRef:v,state:_,get targetScrollTop(){return g.current},set targetScrollTop(L){g.current=L}}),[k,S,v,x,w,N,_]);return E.useImperativeHandle(d,()=>A,[A]),jne(()=>{x.current&&getComputedStyle(x.current).overflow==="visible"&&(x.current.style.overflow="auto")},[]),E.createElement(BO.Provider,{value:A},E.createElement("div",{...f},typeof t=="function"?t(A):t))}(function(e){function t({children:n,scrollClassName:r,...i}){const a=jy();return E.createElement("div",{ref:a.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},E.createElement("div",{...i,ref:a.contentRef},typeof n=="function"?n(a):n))}e.Content=t})(lm||(lm={}));function jy(){const e=E.useContext(BO);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}function Pne({className:e,children:t,resize:n="smooth",...r}){return h.jsx(lm,{"data-slot":"conversation",className:Se("relative flex-1 overflow-y-auto",e),initial:"instant",resize:n,role:"log",...r,children:t})}function Bne({className:e,children:t,...n}){return h.jsx(lm.Content,{"data-slot":"conversation-content",className:Se("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 zne({className:e}){const{isAtBottom:t,scrollToBottom:n}=jy();return t?null:h.jsx(at,{variant:"outline",size:"icon","aria-label":"Scroll to bottom","data-slot":"conversation-scroll-button",className:Se("absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)",e),onClick:()=>void n(),children:h.jsx(y9,{className:"size-4"})})}function Hne({item:e,href:t,className:n}){const r=Kr(),i=e.path.split("/").pop()||e.path;return r?h.jsxs("div",{"data-slot":"file-delivered",className:Se("flex w-full items-baseline gap-2",n),children:[h.jsx(Mr,{className:"text-fg-4",children:"◇"}),h.jsxs("span",{className:"min-w-0 flex-1 truncate text-body-sm leading-5",children:[h.jsx("span",{className:"font-medium text-fg-1",children:i}),h.jsxs("span",{className:"text-fg-4",children:[" · ",xo(e.bytes),e.description?` · ${e.description}`:""]})]}),t?h.jsx("a",{href:t,download:i,className:"shrink-0 text-label text-fg-3 underline-offset-2 hover:text-fg-1 hover:underline",children:"download"}):null]}):h.jsxs("div",{"data-slot":"file-delivered",className:Se("flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5",n),children:[h.jsx(Hx,{className:"size-4 shrink-0 text-fg-3"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate font-mono text-body-sm font-medium text-fg-1",children:i}),h.jsxs("div",{className:"truncate text-label text-fg-4",children:[xo(e.bytes),e.description?` · ${e.description}`:""]})]}),t?h.jsxs("a",{href:t,download:i,className:Se("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:[h.jsx(A_,{className:"size-3.5"}),"Download"]}):null]})}const Ak=["✢","✳","✶","✻","✽","✻","✶","✳"],Une=120,wb=["Working","Thinking","Churning","Pondering","Whirring","Computing","Percolating","Tinkering","Deliberating","Simmering","Crunching","Noodling"],Fne=4e3;function $ne(e){const[t,n]=E.useState(0);return E.useEffect(()=>{if(!e)return;const r=setInterval(()=>n(i=>i+1),Une);return()=>clearInterval(r)},[e]),t}function Vne(){const[e,t]=E.useState(!1);return E.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 qne({label:e,startedAt:t,tokens:n,className:r}){const i=Kr(),a=Vne(),l=$ne(i&&!a);if(!i)return h.jsxs("div",{"data-slot":"loader",className:Se("flex items-center gap-2 py-1 text-body-sm text-fg-4",r),children:[h.jsx("span",{className:"flex items-center gap-1",children:[0,1,2].map(g=>h.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-fg-4",style:{animationDelay:`${g*160}ms`}},g))}),e?h.jsx("span",{children:e}):null]});const c=t===void 0?void 0:Date.now()-t,d=e??wb[Math.floor((c??0)/Fne)%wb.length]??wb[0],f=[c!==void 0?r1(c):void 0,n!==void 0?`↓ ${us(n)}`:void 0].filter(Boolean);return h.jsxs("div",{"data-slot":"loader",className:Se("flex items-baseline gap-2",r),children:[h.jsx(Mr,{className:"text-accent",children:Ak[l%Ak.length]}),h.jsxs("span",{className:"min-w-0 flex-1 text-body-sm leading-5 text-fg-3",children:[d,"…"," ",f.length?h.jsxs("span",{className:"text-label text-fg-4",children:["(",f.join(" · "),")"]}):null]})]})}function Rk({from:e,className:t,children:n,...r}){const i=Kr();return h.jsx("div",{"data-slot":"message","data-from":e,className:Se("flex w-full",i?Se("flex-row gap-2",e==="user"&&"-mx-1 rounded-sm bg-surface px-1"):Se("flex-col gap-1",e==="user"?"items-end":"items-start"),t),...r,children:i?h.jsxs(h.Fragment,{children:[h.jsx(Mr,{className:e==="user"?"text-accent":"text-fg-3",children:e==="user"?"❯":"●"}),h.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:n})]}):n})}function Ok({className:e,...t}){const n=Kr();return h.jsx("div",{"data-slot":"message-content",className:Se("min-w-0",n?Se("w-full text-fg-1",ene,"in-data-[from=user]:whitespace-pre-wrap"):Se("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-br-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 Yne({text:e,className:t}){const n=GU(e);if(n.length===0)return h.jsx("span",{className:t,children:e});const r=[];let i=0;for(const[a,l]of n.entries())l.start>i&&r.push(e.slice(i,l.start)),r.push(h.jsx("span",{className:Se("font-mono",l.kind==="file"?"text-accent":"text-info"),children:l.text},`${l.start}-${a}`)),i=l.end;return i<e.length&&r.push(e.slice(i)),h.jsx("span",{className:t,children:r.map((a,l)=>h.jsx(E.Fragment,{children:a},l))})}function Gne({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){const i=Kr(),[a,l]=E.useState(n??t),c=E.useRef(!1);E.useEffect(()=>{if(!c.current)if(t)l(!0);else{const f=setTimeout(()=>l(!1),600);return()=>clearTimeout(f)}},[t]);const d=e.trim()!=="";return!d&&!t?null:h.jsxs("div",{"data-slot":"reasoning","data-streaming":t||void 0,className:Se("w-full",r),children:[h.jsxs("button",{type:"button",disabled:!d,onClick:()=>{c.current=!0,l(f=>!f)},className:Se("flex items-baseline text-label text-fg-3 transition-colors outline-none disabled:cursor-default hover:text-fg-1 disabled:hover:text-fg-3",i?"w-full gap-2":"items-center gap-1.5"),children:[i?h.jsx(Mr,{className:"text-fg-4",children:"✻"}):h.jsx(k9,{className:"size-3.5"}),h.jsx("span",{className:Se(i&&"leading-5"),children:t?"Thinking…":"Thought process"}),d&&!i?h.jsx(__,{className:Se("size-3.5 transition-transform",a&&"rotate-180")}):null]}),a&&d?h.jsx("div",{className:Se("border-l border-border text-body-sm text-fg-3 [&_*]:text-fg-3",i?"ml-[0.4375rem] mt-0.5 pl-2 leading-5":"mt-2 border-l-2 pl-3"),children:h.jsx(Ly,{streaming:t,children:e})}):null]})}function Kne({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:i}){const a=[{icon:k7,text:"Tell the agent what to do."},...t?[{icon:oB,text:"Type / for the CLI’s slash commands."}]:[],...n?[{icon:jm,text:"Type $ to draft a message for one of the agent’s skills."}]:[],...r?[{icon:C9,text:"Type @ to search this project’s files."}]:[]];return h.jsxs("div",{className:Se("flex flex-col items-center gap-4 py-10",i),children:[h.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3",children:h.jsx(Qb,{className:"size-5"})}),e?h.jsx("p",{className:"max-w-full truncate font-mono text-label text-fg-4",children:e}):null,h.jsx("ul",{className:"w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface",children:a.map(l=>h.jsxs("li",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[h.jsx(l.icon,{className:"size-4 shrink-0 text-fg-4"}),h.jsx("span",{className:"text-body-sm text-fg-3",children:l.text})]},l.text))})]})}const Ik=2e3,Xne=new Set(["CodexImageGeneration","CodexImageView"]),Wne=e=>{if(!Xne.has(e.name))return;const t=e.input,n=t?.savedPath??t?.path;return typeof n=="string"?n:void 0},Qne={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}},Zne={running:"text-info",pending:"text-info",deferred:"text-accent",settled:"text-fg-4",failed:"text-danger"},Jne={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 ere(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 Jne[r]}function tre({item:e,hostImage:t,className:n}){const r=Kr(),[i,a]=E.useState(!1),[l,c]=E.useState(!1),d=Wne(e),f=e.status??(e.result===void 0?"running":"settled"),g=Qne[f],m=f==="failed"||e.result?.isError===!0,b=RA(e.name),x=e.result?.text??"",v=!l&&x.length>Ik,k=v?x.slice(0,Ik):x,w=r?"plain":"panel",S=r?sre:rre,N=i?h.jsxs("div",{className:Se("flex flex-col",r?"gap-1 py-1":"gap-2 border-t border-border p-2.5"),children:[h.jsx(S,{code:JSON.stringify(e.input,null,2),language:"json",label:"Parameters",variant:w}),e.logs?.length?h.jsx(S,{code:e.logs.join(`
671
- `),label:"Logs",variant:w}):null,e.result!==void 0?h.jsxs("div",{children:[h.jsx(S,{code:k||"(empty result)",language:ere(e),label:m?"Error":"Result",variant:w,className:Se(m&&(r?"[&_pre]:text-danger":"border-danger/40 [&_pre]:text-danger"))}),v?h.jsxs("button",{type:"button",className:"mt-1 text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>c(!0),children:["Show all ",x.length.toLocaleString()," chars"]}):null]}):null]}):null,_=d&&t?h.jsx(ire,{path:d,load:t,lines:r}):null;return r?h.jsxs("div",{"data-slot":"tool-call","data-state":f,className:Se("w-full",n),children:[h.jsxs("button",{type:"button",onClick:()=>a(A=>!A),className:"flex w-full items-baseline gap-2 text-left outline-none",children:[h.jsx(Mr,{className:f==="settled"&&!m&&DF(e.name)?"text-success":Zne[f],children:g.busy?"◐":"●"}),h.jsxs("span",{className:"min-w-0 flex-1 truncate text-body-sm leading-5 text-fg-3",children:[h.jsx("span",{className:"font-medium text-fg-1",children:e.name}),h.jsxs("span",{className:"text-fg-4",children:["(",i1(e.input),")"]})]}),e.backend&&e.backend!=="server"?h.jsx("span",{className:"shrink-0 text-label text-fg-4",children:e.backend}):null,g.busy?h.jsx(vn,{className:"size-3 shrink-0 self-center text-fg-4"}):null,f==="deferred"?h.jsx(cC,{className:"size-3 shrink-0 self-center text-fg-4"}):null,m&&!g.busy?h.jsx("span",{className:"shrink-0 text-label text-danger",children:"error"}):null]}),!i&&x?h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-fg-4",children:"⎿"}),h.jsx("span",{className:Se("min-w-0 flex-1 truncate text-label leading-5",m?"text-danger":"text-fg-4"),children:nre(x)})]}):null,_,N?h.jsx("div",{className:aa,children:N}):null]}):h.jsxs("div",{"data-slot":"tool-call","data-state":f,className:Se("w-full overflow-hidden rounded-lg border border-border bg-surface",n),children:[h.jsxs("button",{type:"button",onClick:()=>a(A=>!A),className:Se("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:[h.jsx(b,{className:"size-3.5 shrink-0 text-fg-3"}),h.jsx("span",{className:"shrink-0 font-mono text-body-sm font-medium text-fg-1",children:e.name}),e.backend&&e.backend!=="server"?h.jsx(gn,{variant:"neutral",className:"shrink-0",children:e.backend}):null,h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:i1(e.input)}),h.jsxs(gn,{variant:g.variant,dot:!g.busy,className:"shrink-0 gap-1",children:[g.busy?h.jsx(vn,{className:"size-3 text-current"}):null,f==="deferred"?h.jsx(cC,{className:"size-3 text-current"}):null,g.label]}),h.jsx(__,{className:Se("size-3.5 shrink-0 text-fg-4 transition-transform",i&&"rotate-180")})]}),_,N]})}function nre(e){const t=e.split(`
672
- `).find(i=>i.trim()!=="")??"",n=e.trimEnd().split(`
673
- `).length-1,r=t.trim();return n>0?`${r} (+${n} lines)`:r}function rre({code:e,label:t,variant:n,className:r}){return h.jsx(aA,{code:e,label:t,variant:n,className:r})}function sre({code:e,label:t,language:n,className:r}){return h.jsx(Dy,{code:e,label:t,language:n,className:r})}function ire({path:e,load:t,lines:n}){const[r,i]=E.useState();return E.useEffect(()=>{let a=!1;return i(void 0),t(e).then(l=>{a||i(l)}).catch(()=>{}),()=>{a=!0}},[e,t]),r?h.jsx("div",{className:Se(n?Se("py-1",aa):"border-t border-border p-2.5"),children:h.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 are({item:e}){return Kr()?h.jsxs("div",{"data-slot":"turn-result",className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-fg-4",children:"·"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("span",{className:Se("text-label leading-5",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",r1(e.durationMs)," ·"," ",bo(e.totalCostUsd)]}),e.errors?.length?h.jsx("ul",{className:"flex flex-col",children:e.errors.map((n,r)=>h.jsx("li",{className:"text-label leading-5 break-words text-danger",children:n},r))}):null]})]}):h.jsxs("div",{"data-slot":"turn-result",className:"py-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"h-px flex-1 bg-border"}),h.jsxs("span",{className:Se("font-mono text-label",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",r1(e.durationMs)," ·"," ",bo(e.totalCostUsd)]}),h.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.errors?.length?h.jsx("ul",{className:"mt-1 flex flex-col gap-0.5 text-center",children:e.errors.map((n,r)=>h.jsx("li",{className:"text-label break-words text-danger",children:n},r))}):null]})}function ore({item:e}){return Kr()?h.jsxs("div",{"data-slot":"notice",className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:e.level==="error"?"text-danger":"text-fg-4",children:"!"}),h.jsx("span",{className:Se("min-w-0 flex-1 text-body-sm leading-5",e.level==="error"?"text-danger":"text-fg-3"),children:e.text})]}):h.jsx("div",{"data-slot":"notice",className:Se("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 lre({item:e,fileUrl:t,attachmentUrl:n,hostImage:r}){switch(e.kind){case"user":return h.jsxs(Rk,{from:"user",children:[e.attachments?.length?h.jsx(hre,{attachments:e.attachments,attachmentUrl:n}):null,e.text?h.jsx(Ok,{children:h.jsx(Yne,{text:e.text})}):null]});case"assistant_text":return h.jsx(Rk,{from:"assistant",children:h.jsx(Ok,{children:h.jsx(Ly,{streaming:e.streaming,children:e.text})})});case"thinking":return h.jsx(Gne,{isStreaming:e.id==="streaming-thinking",children:e.text});case"tool_call":return h.jsx(tre,{item:e,hostImage:r});case"turn_result":return h.jsx(are,{item:e});case"notice":return h.jsx(ore,{item:e});case"file_delivered":return h.jsx(Hne,{item:e,href:t?.(e.path)});default:return null}}function ure({line:e,since:t}){const n=Kr(),r=t===void 0?void 0:cd(t),i=r?`${e} · last here ${r}`:e;return n?h.jsxs("div",{"data-slot":"recap",className:"flex items-baseline gap-2 py-0.5",children:[h.jsx(Mr,{className:"text-accent",children:"※"}),h.jsxs("span",{className:"min-w-0 flex-1 text-label leading-5 text-fg-3",children:[h.jsx("span",{className:"text-fg-2",children:"recap:"})," ",i]})]}):h.jsxs("div",{"data-slot":"recap",className:"flex items-center gap-2 py-1",children:[h.jsx("div",{className:"h-px flex-1 bg-border"}),h.jsxs("span",{className:"font-mono text-label text-fg-3",children:["※ recap: ",i]}),h.jsx("div",{className:"h-px flex-1 bg-border"})]})}function cre(e,t,n=400){const[r,i]=E.useState(!1);return E.useEffect(()=>{if(r||e===0)return;const a=setTimeout(()=>i(!0),n);return()=>clearTimeout(a)},[e,r,n]),r&&(t==="running"||t==="starting")}function dre(e){const t=e==="running"||e==="starting",[n,r]=E.useState(void 0);return E.useEffect(()=>{r(i=>t?i??Date.now():void 0)},[t]),t?n:void 0}function fre(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 hre({attachments:e,attachmentUrl:t}){const n=Kr();return h.jsx("div",{className:Se("mb-1 flex flex-wrap gap-1.5",n?"justify-start":"justify-end"),children:e.map(r=>{const i=t?.(r.id);return r.mediaType.startsWith("image/")&&i?h.jsx("img",{src:i,alt:r.name,className:"size-20 rounded-md border border-border object-cover"},r.id):h.jsx("span",{className:"rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3",children:r.name},r.id)})})}function mre(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 pre({rows:e,boundary:t,since:n,lines:r,fileUrl:i,attachmentUrl:a,hostImage:l,jumpToRecapRef:c}){const d=jy(),[f,g]=E.useState(null);E.useEffect(()=>{g(d.scrollRef.current)},[d.scrollRef]);const m=Rne({count:e.length,getScrollElement:()=>(f&&m.scrollElement!==f&&(m.scrollOffset=f.scrollTop),f),estimateSize:()=>r?32:100,overscan:8,getItemKey:x=>e[x].key,useFlushSync:!0});m.shouldAdjustScrollPositionOnItemSizeChange=(x,v,k)=>{if(d.state.isAtBottom)return!1;const w=(k.scrollOffset??0)+k.scrollAdjustments;return k.itemSizeCache.has(x.key)?x.end<=w&&k.scrollDirection!=="backward":x.start<w};const b=E.useRef(void 0);return E.useEffect(()=>()=>clearTimeout(b.current),[]),E.useEffect(()=>{if(c)return c.current=()=>{const x=e.findIndex(k=>k.key==="recap");if(x<0)return;d.stopScroll(),clearTimeout(b.current);const v=k=>{const w=f?.querySelector('[data-slot="recap"]');if(w){w.scrollIntoView({behavior:"smooth",block:"center"});return}k>=6||(m.scrollToIndex(x,{align:"center",behavior:"smooth"}),b.current=setTimeout(()=>v(k+1),300))};v(0)},()=>{c.current=null}}),h.jsx("div",{"data-slot":"transcript-rows",className:"relative w-full",style:{height:m.getTotalSize()},children:m.getVirtualItems().map(x=>{const v=e[x.index];return h.jsx("div",{ref:m.measureElement,"data-index":x.index,className:Se("absolute inset-x-0 top-0",!r&&x.index>0&&"pt-4"),style:{transform:`translateY(${x.start}px)`},children:"item"in v?h.jsx("div",{className:Se(r&&"-mx-1 rounded-sm px-1 py-0.5 transition-colors hover:bg-surface-hover",t!==void 0&&v.index<t&&"opacity-45",mre(v.item,r)),children:h.jsx(lre,{item:v.item,fileUrl:i,attachmentUrl:a,hostImage:l})}):h.jsx(ure,{line:v.line,since:n})},v.key)})})}function gre({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:i,variant:a="cards",catchUp:l,jumpToRecapRef:c,className:d}){const f=a==="lines",g=dre(e.status),m=cre(e.items.length,e.status),b=l&&l.from>0&&l.from<e.items.length?l.from:void 0,x=E.useMemo(()=>b===void 0?void 0:uF(lF(e,b)),[e,b]),v=E.useMemo(()=>{const k=[];for(const[w,S]of e.items.entries())w===b&&x&&k.push({key:"recap",line:x}),k.push({key:`${S.kind}:${S.id}`,item:S,index:w});return k},[e.items,b,x]);return h.jsx(RO,{value:a,children:h.jsxs(Pne,{className:d,resize:m?"smooth":"instant",children:[h.jsxs(Bne,{className:Se(f&&"gap-0 px-2 py-1.5"),children:[e.items.length===0&&e.status!=="starting"?h.jsx(Kne,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(k=>k.enabled),canBrowseFiles:r}):h.jsx(pre,{rows:v,boundary:b,since:l?.since,lines:f,fileUrl:t,attachmentUrl:n,hostImage:i,jumpToRecapRef:c}),fre(e)?h.jsx(qne,{label:e.status==="starting"?"Starting session…":void 0,startedAt:g,tokens:e.contextUsage?.totalTokens,className:Se(f&&"py-0.5")}):null]}),h.jsx(zne,{})]})})}function bre(e){const[t,n]=E.useState(()=>Date.now());return E.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(r)},[e]),t}const xre=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function yre({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,updatedAt:i,open:a,onOpenChange:l}){const c=bre(a);return h.jsx(tu,{open:a,onOpenChange:l,children:h.jsxs(nu,{children:[h.jsx(ru,{title:"Usage",description:n==="claude"?"Claude Code":n,actions:t?h.jsx(gn,{variant:"accent",className:"mt-0.5 shrink-0 capitalize",children:t}):null}),h.jsxs(su,{children:[e.length===0?h.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.`}):h.jsx("div",{className:"flex flex-col gap-5",children:e.map(({key:d,info:f})=>h.jsx(Ere,{windowKey:d,info:f,now:c},d))}),h.jsxs("div",{className:"mt-5 flex items-baseline justify-between gap-4 border-t border-border pt-3",children:[h.jsx("span",{className:"text-label text-fg-3",children:"This session has cost"}),h.jsx("span",{className:"font-mono text-body-sm text-fg-1",children:bo(r)})]}),i?h.jsxs("p",{className:"mt-2 text-label text-fg-4",children:["Updated ",fF(i,c)]}):null]})]})})}function Ere({windowKey:e,info:t,now:n}){const r=t.utilization??0,i=t.resetsAt!==void 0?t.resetsAt*1e3:void 0,a=dF(e),l=i!==void 0?(i-n)/1e3:void 0,c=a!==void 0&&l!==void 0&&l>0&&l<a?(a-l)/a:void 0;return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[h.jsx("span",{className:"truncate text-body-sm text-fg-1",children:cF(e)}),h.jsxs("span",{className:Se("shrink-0 font-mono text-body-sm font-medium",t.status==="rejected"?"text-danger":"text-fg-1"),children:[r.toFixed(0),"% used"]})]}),h.jsxs("div",{className:"relative mt-2 h-2 rounded-full bg-border",children:[h.jsx("div",{className:Se("h-full rounded-full",xre(r)),style:{width:`${Math.min(100,Math.max(2,r))}%`}}),c!==void 0?h.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,c*100))}%`}}):null]}),h.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-label text-fg-4",children:[i!==void 0?h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(Y7,{className:"size-3"})," Resets in ",s1(i,n)]}):null,t.isUsingOverage?h.jsx("span",{className:"text-warning",children:"overage"}):null,t.status==="rejected"?h.jsx("span",{className:"text-danger",children:"limit reached"}):null]})]})}const vre=["button","a","input","textarea","select","summary","img",'[contenteditable="true"]','[role="button"]','[role="menuitem"]','[role="checkbox"]','[role="radio"]','[role="tab"]'].join(",");function Tre({client:e,sessionId:t,header:n,panelSurface:r="internal",statusSurface:i="internal",onOpenPanel:a,onVitals:l,transcriptVariant:c="cards",controlsSurface:d="internal",onControls:f,focusComposerOnClick:g=!1,unseen:m,className:b}){const x=r==="external",v=i==="external",k=d==="external",[w,S]=E.useState(void 0),[N,_]=E.useState(),{state:A,connection:L,protocolMismatch:R,models:D,effectiveModel:I,handle:U,send:z,approve:X,deny:W,interrupt:V,setModel:ee,setPermissionMode:q,reconnectNow:B}=PU(e,t,{onProtocolError:S});E.useEffect(()=>S(void 0),[t]);const[G,Q]=E.useState(!1);E.useEffect(()=>{Q(!1)},[t]);const[le]=E.useState(m),M=G?void 0:le,P=M?Math.max(0,A.items.length-M.itemCount):0,F=E.useCallback(Z=>{x?a?.(Z):_(Z)},[x,a]);E.useEffect(()=>{const Z=()=>{document.visibilityState==="visible"&&B()};return document.addEventListener("visibilitychange",Z),()=>document.removeEventListener("visibilitychange",Z)},[B]),oF(U);const j=A.capabilities,ae=E.useRef(l);ae.current=l;const ie=I??A.model,ce=E.useMemo(()=>LF(j.permissionModes,A.session?.canBypassPermissions),[j.permissionModes,A.session?.canBypassPermissions]);E.useEffect(()=>{ae.current?.({status:A.status,connection:L,engine:A.engine,capabilities:A.capabilities,model:ie,models:D,permissionMode:A.permissionMode,permissionModes:ce,cwd:A.cwd,contextUsage:A.contextUsage,rateLimits:A.rateLimits,itemCount:A.items.length})},[A.status,L,A.engine,A.capabilities,ie,D,A.permissionMode,ce,A.cwd,A.contextUsage,A.rateLimits,A.items.length]);const de=E.useRef(f);de.current=f;const fe=E.useRef({setModel:ee,setPermissionMode:q,interrupt:V});fe.current={setModel:ee,setPermissionMode:q,interrupt:V};const ve=E.useRef({setModel:Z=>fe.current.setModel(Z),setPermissionMode:Z=>fe.current.setPermissionMode(Z),interrupt:()=>fe.current.interrupt()});E.useEffect(()=>{const Z=de.current;return Z?.(ve.current),()=>Z?.(void 0)},[t]);const Fe=A.status==="running"||A.status==="awaiting_approval",Le=A.status==="failed"||A.status==="closed",Ee=UU(e,t,{capabilities:j,engine:A.engine}),Oe=SA(e,A.cwd),ze=E.useMemo(()=>MU(A),[A]),Ge=Sre(e,t,A.producedFiles),$e=E.useRef(null),De=E.useRef(null),ke=E.useMemo(()=>{if(A.commands)return A.commands.some(Z=>Z.name==="model")?A.commands:[{name:"model",description:"Switch the model for this session",argumentHint:"<model>"},...A.commands]},[A.commands]),ye=(Z,re)=>{if(re.length===0){const K=/^\/model\s+(\S+)$/.exec(Z);if(K){ee(K[1]);return}if(j.mcpStatus&&Z.trim()==="/mcp"){F("mcp");return}}Q(!0),z(Z,re)},Ie=h.jsxs(mz,{children:[h.jsx(pz,{render:h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Session actions",children:h.jsx(G9,{className:"size-4"})})}),h.jsxs(gz,{children:[j.contextUsage?h.jsxs(xl,{onClick:()=>F("context"),children:[h.jsx(R9,{className:"size-3.5 text-fg-3"})," Context"]}):null,j.rateLimits?h.jsxs(xl,{onClick:()=>F("usage"),children:[h.jsx(d7,{className:"size-3.5 text-fg-3"})," Usage"]}):null,h.jsxs(xl,{onClick:()=>F("info"),children:[h.jsx(y7,{className:"size-3.5 text-fg-3"})," Session info"]}),j.mcpStatus?h.jsxs(xl,{onClick:()=>F("mcp"),children:[h.jsx(j7,{className:"size-3.5 text-fg-3"})," MCP servers"]}):null,j.skillsList?h.jsxs(xl,{onClick:()=>F("skills"),children:[h.jsx(jm,{className:"size-3.5 text-fg-3"})," Skills"]}):null,Oe.available?h.jsxs(xl,{onClick:()=>F("files"),children:[h.jsx(l7,{className:"size-3.5 text-fg-3"})," Project files"]}):null]})]}),je=x?null:Ie,te=typeof n=="function",me=Z=>{!g||Z.target?.closest(vre)||window.getSelection()?.isCollapsed!==!1&&$e.current?.focus()};return h.jsx(RO,{value:c,children:h.jsxs("div",{"data-slot":"session-panel",onClick:me,className:Se("flex h-full min-h-0 flex-col overflow-hidden bg-bg",b),children:[te?n({actions:je}):n,v?null:h.jsx(hne,{state:A,connection:L,onOpenStatus:x&&!a?void 0:()=>F("info"),onOpenContext:x&&!a?void 0:()=>F("context"),onOpenUsage:x&&!a?void 0:()=>F("usage"),actions:te?void 0:je}),R!==void 0?h.jsxs(Mk,{level:"warning",children:["Server speaks protocol v",R,", this build renders v",TA,". Some events may not render."]}):null,w?h.jsx(Mk,{level:"error",onDismiss:()=>S(void 0),children:w}):null,h.jsx(gre,{state:A,fileUrl:t?Z=>e.sessionFileUrl(t,Z):void 0,attachmentUrl:t?Z=>e.attachmentUrl(t,Z):void 0,canBrowseFiles:Oe.available,hostImage:Ge,variant:c,catchUp:M&&P>0?{from:M.itemCount,since:M.since}:void 0,jumpToRecapRef:De}),M&&P>0?h.jsx("div",{className:"px-3 pb-1",children:h.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:[h.jsx("span",{"aria-hidden":!0,className:"select-none text-accent",children:"※"}),h.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[P," new ",P===1?"row":"rows",M.since!==void 0?" since you were last here":""]}),h.jsx("button",{type:"button",onClick:()=>De.current?.(),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"jump"}),h.jsx("button",{type:"button",onClick:()=>Q(!0),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"dismiss"})]})}):null,j.interactiveApprovals&&A.pendingApprovals.length>0?h.jsx("div",{className:"px-3 pb-2",children:h.jsx("div",{className:"mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] flex-col gap-2",children:A.pendingApprovals.map(Z=>Z.toolName==="AskUserQuestion"&&LO(Z.input).length>0?h.jsx(one,{request:Z,onAnswer:X,onDismiss:re=>W(re,"Question dismissed by user")},Z.id):h.jsx(ine,{request:Z,onApprove:X,onDeny:W},Z.id))})}):null,h.jsx(mF,{ref:$e,onSend:ye,onInterrupt:V,busy:Fe,disabled:Le||!t,commands:j.slashCommands?ke:void 0,skills:j.skillsList?A.skills:void 0,attachments:Ee,onSearchFiles:Oe.available?(Z,re)=>Oe.search(Z,{...re,limit:8}):void 0,layout:k?"inline":"stacked",toolbar:k?void 0:h.jsxs(h.Fragment,{children:[D.length?h.jsx(AA,{models:D,model:I,onModelChange:ee,disabled:Le}):null,A.permissionMode?h.jsx(dd,{mode:A.permissionMode,onModeChange:q,modes:j.permissionModes,canBypass:A.session?.canBypassPermissions,disabled:Le}):null]})}),x?null:h.jsxs(h.Fragment,{children:[h.jsx(lne,{state:A,client:e,sessionId:t,open:N==="info",onOpenChange:Z=>_(Z?"info":void 0)}),h.jsx(EF,{usage:A.contextUsage,open:N==="context",onOpenChange:Z=>_(Z?"context":void 0)}),h.jsx(yre,{rateLimits:ze,subscriptionType:A.subscriptionType,engine:A.engine??"claude",totalCostUsd:A.totalCostUsd,updatedAt:A.rateLimitsUpdatedAt,open:N==="usage",onOpenChange:Z=>_(Z?"usage":void 0)}),h.jsx(SF,{client:e,sessionId:t,canManageServers:j.mcpServerActions,open:N==="mcp",onOpenChange:Z=>_(Z?"mcp":void 0)}),h.jsx(_F,{skills:A.skills,open:N==="skills",onOpenChange:Z=>_(Z?"skills":void 0),onUse:Z=>$e.current?.insertText(kA(Z))}),h.jsx(vF,{client:e,cwd:A.cwd,open:N==="files",onOpenChange:Z=>_(Z?"files":void 0)})]})]})})}function Sre(e,t,n){const r=E.useRef(new Map),i=E.useRef([]);return E.useEffect(()=>()=>{for(const a of i.current)URL.revokeObjectURL(a);i.current=[]},[]),E.useCallback(a=>{const l=n?.[a],c=l?`produced:${l.fileId}`:`fs:${a}`,d=r.current.get(c);if(d)return d;const f=l&&t?e.readProducedFile(t,l.fileId).then(g=>{if(g.size===0)return;const m=URL.createObjectURL(g);return i.current.push(m),m}).catch(()=>{}):e.readHostFile(a).then(g=>{if(g.encoding!=="base64")return;const m=a.slice(a.lastIndexOf(".")+1).toLowerCase(),b=Cre[m];return b?`data:${b};base64,${g.content}`:void 0}).catch(()=>{});return r.current.set(c,f),f},[e,t,n])}const Cre={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function Mk({level:e,onDismiss:t,children:n}){return h.jsx("div",{className:"px-3 pt-2",children:h.jsxs("div",{role:"alert",className:Se("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:[h.jsx(Ll,{className:"mt-0.5 size-3.5 shrink-0"}),h.jsx("span",{className:"min-w-0 flex-1 break-words",children:n}),t?h.jsx("button",{type:"button",onClick:t,"aria-label":"Dismiss",className:"shrink-0 opacity-70 transition-opacity hover:opacity-100",children:h.jsx(bi,{className:"size-3.5"})}):null]})})}function wre({session:e,active:t,onSelect:n,onDelete:r}){const i=DO[e.status];return h.jsxs("div",{"data-slot":"session-list-item","data-active":t||void 0,className:Se("group flex w-full items-center gap-2 rounded-md border border-transparent px-2.5 py-2 text-left transition-colors",t?"border-border bg-surface":"hover:bg-surface-hover"),children:[h.jsxs("button",{type:"button",onClick:()=>n?.(e.id),className:"min-w-0 flex-1 text-left outline-none",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:e.title??e.id.slice(0,8)}),h.jsx(gn,{variant:i.variant,dot:!0,className:"shrink-0",children:i.label})]}),h.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-label text-fg-4",children:[h.jsx("span",{className:"truncate",children:e.cwd}),e.profile?h.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,h.jsx("span",{className:"shrink-0",children:bo(e.totalCostUsd)}),h.jsx("span",{className:"shrink-0",children:cd(e.lastActivityAt??e.createdAt)})]})]}),r?h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Close session",className:"opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>r(e.id),children:h.jsx(Vx,{className:"size-3.5 text-fg-3"})}):null]})}function kre({sessions:e,activeId:t,onSelect:n,onDelete:r,emptyText:i="No sessions yet.",className:a}){return h.jsx("div",{"data-slot":"session-list",className:Se("flex flex-col gap-1",a),children:e.length===0?h.jsx("div",{className:"px-2.5 py-6 text-center text-body-sm text-fg-4",children:i}):e.map(l=>h.jsx(wre,{session:l,active:l.id===t,onSelect:n,onDelete:r},l.id))})}const Nre="0.11.0",_re=Nre;function Are({className:e}){return h.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[h.jsx("path",{d:"M12 3 20.5 7.75 12 12.5 3.5 7.75Z"}),h.jsx("path",{d:"M3.5 12.25 12 17l8.5-4.75"}),h.jsx("path",{d:"M3.5 16.5 12 21.25l8.5-4.75"}),h.jsx("path",{d:"M12 6.15 14.85 7.75 12 9.35 9.15 7.75Z",fill:"#2fbf71",stroke:"none"})]})}function zO(){const[e,t]=E.useState(j1());return h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Toggle theme",onClick:()=>t(yM()),children:e==="dark"?h.jsx(hB,{className:"size-4"}):h.jsx(_7,{className:"size-4"})})}const Rre=[{id:"sessions",label:"Sessions",icon:uB,path:"/sessions"},{id:"jobs",label:"Jobs",icon:L_,path:"/jobs"},{id:"profiles",label:"Profiles",icon:B_,path:"/profiles"},{id:"settings",label:"Settings",icon:Z7,path:"/settings"}],Lk="workerdeck.sidebar-collapsed";function Ore({children:e}){const t=cL({select:a=>a.location.pathname}),[n,r]=E.useState(()=>{try{return localStorage.getItem(Lk)==="1"}catch{return!1}}),i=()=>{r(a=>{try{localStorage.setItem(Lk,a?"0":"1")}catch{}return!a})};return h.jsxs("div",{className:"flex h-dvh bg-sidebar",children:[h.jsxs("aside",{className:Se("flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150",n?"w-14 items-center":"w-52"),children:[h.jsxs("div",{className:Se("flex items-center py-2",n?"justify-center":"gap-2 px-2"),children:[h.jsx(Are,{className:"size-4 shrink-0 text-fg-1"}),!n&&h.jsx("span",{className:"text-body-sm font-semibold tracking-tight text-fg-1",children:"workerdeck"})]}),h.jsx("nav",{className:Se("mt-1 flex flex-1 flex-col gap-0.5",n&&"items-center"),children:Rre.map(a=>{const l=t.startsWith(a.path);return h.jsxs(sd,{to:a.path,title:n?a.label:void 0,"aria-label":a.label,className:Se("flex items-center rounded-md text-body-sm transition-colors outline-none",n?"justify-center p-2":"gap-2 px-2 py-1.5",l?"bg-surface font-medium text-fg-1 shadow-(--shadow-xs)":"text-fg-3 hover:bg-surface-hover hover:text-fg-1"),children:[h.jsx(a.icon,{className:"size-4 shrink-0"}),!n&&a.label]},a.id)})}),h.jsxs("div",{className:Se("flex items-center",n?"flex-col gap-1":"justify-between px-1"),children:[!n&&h.jsxs("span",{className:"font-mono text-label text-fg-4",children:["v",_re]}),h.jsx(zO,{}),h.jsx("button",{type:"button",onClick:i,title:n?"Expand sidebar":"Collapse sidebar","aria-label":n?"Expand sidebar":"Collapse sidebar",className:"flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1",children:n?h.jsx(P_,{className:"size-4"}):h.jsx(j_,{className:"size-4"})})]})]}),h.jsx("main",{className:"frame-shine m-2 ml-0 flex min-w-0 flex-1 flex-col overflow-hidden rounded-xl",children:e??h.jsx(kN,{})})]})}const HO=[{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"}],M1={session:"workerdeck.default-session-model",job:"workerdeck.default-job-model"};function Py(e){return localStorage.getItem(M1[e])??""}function Ire(e,t){const n=t.trim();n?localStorage.setItem(M1[e],n):localStorage.removeItem(M1[e])}const UO={session:"workerdeck.default-session-permission-mode",job:"workerdeck.default-job-permission-mode"},Mre={session:"default",job:"acceptEdits"};function By(e){const t=localStorage.getItem(UO[e]);return ql.some(r=>r.value===t)?t:Mre[e]}function Lre(e,t){localStorage.setItem(UO[e],t)}function zy({value:e,onChange:t,models:n=HO,className:r}){return h.jsx(AA,{variant:"form",models:n,model:e||void 0,onModelChange:i=>t(i??""),className:r})}function FO({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Profile"}),h.jsxs(ho,{items:e.map(i=>({value:i.name,label:i.name})),value:t,onValueChange:i=>n(i),children:[h.jsx(po,{className:r,children:h.jsx(mo,{})}),h.jsx(go,{children:e.map(i=>h.jsx(ua,{value:i.name,children:h.jsx(la,{children:h.jsxs("span",{className:i.available===!1?"text-fg-4":void 0,title:i.unavailableReason,children:[i.description?`${i.name} — ${i.description}`:i.name,i.available===!1?" (unavailable)":""]})})},i.name))})]})]})}const tr=new WU({baseUrl:`${location.origin}/v1`});function $O(e,t,n){const r=e?.capabilities??ud[e?.engine??"claude"],i=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 f=e.provider;a=(f?.models?.length?f.models:f?.model?[f.model]:[]).map(m=>({value:m,displayName:m})),l=f?.model}else a=HO.filter(f=>f.value!=="default");const c=a.find(f=>f.value===n||f.resolvedModel===n),d=c||n===""?n:"";return{capabilities:r,modes:r.permissionModes,models:[{value:"default",displayName:"Profile default",description:l??"the profile's configured model"},...a],mode:i,model:d,reasoningEfforts:(c?c.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}function Dre(e=15e3){const[t,n]=E.useState([]),[r,i]=E.useState(),[a,l]=E.useState(!0),[c,d]=E.useState(!1),[f,g]=E.useState(),m=E.useRef(void 0),b=E.useCallback(async()=>{try{const[v,k]=await Promise.all([tr.listJobs(),tr.queueStats()]);n(v),i(k),l(!0),g(void 0)}catch(v){const k=v instanceof Error?v.message:String(v);/not configured/i.test(k)?(l(!1),g(void 0)):g(k)}},[]);E.useEffect(()=>(b(),m.current=setInterval(()=>void b(),e),()=>clearInterval(m.current)),[b,e]);const x=a&&r!==void 0;return E.useEffect(()=>{if(!x)return;const v=tr.attachQueue(),k=[v.on("attached",()=>void b()),v.on("stats",i),v.on("connectionChange",d),v.on("event",w=>{n(S=>S.some(_=>_.id===w.job.id)?S.map(_=>_.id===w.job.id?w.job:_):[...S,w.job])})];return()=>{for(const w of k)w();v.detach()}},[x,b]),{jobs:t,stats:r,enabled:a,live:c,error:f,refresh:b}}const VO={profiles:[]};let L1,kb;const D1=new Set;async function Dk(){const e=await tr.listProfiles().catch(()=>VO);L1=e;for(const t of D1)t(e);return e}function qO(){const[e,t]=E.useState(L1??VO);E.useEffect(()=>(D1.add(t),L1||(kb??=Dk()),()=>{D1.delete(t)}),[]);const n=E.useCallback(async()=>{kb=Dk(),await kb},[]);return{...e,refresh:n}}function jre(){return qO().profiles}const jk="workerdeck.last-profile";function YO(){const e=jre(),[t,n]=E.useState(()=>localStorage.getItem(jk)??""),r=e.some(l=>l.name===t)?t:e[0]?.name??"",i=e.find(l=>l.name===r);return{profiles:e,profile:r,selected:i,select:l=>{n(l),localStorage.setItem(jk,l)}}}function GO(e=5e3){const[t,n]=E.useState([]),[r,i]=E.useState(),a=E.useRef(void 0),l=E.useCallback(async()=>{try{n(await tr.listSessions()),i(void 0)}catch(c){i(c instanceof Error?c.message:String(c))}},[]);return E.useEffect(()=>(l(),a.current=setInterval(()=>void l(),e),()=>clearInterval(a.current)),[l,e]),{sessions:t,error:r,refresh:l}}const Pk="workerdeck.last-cwd",Pre={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"}};function Bre({stats:e}){const t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return h.jsxs("div",{className:"flex flex-wrap items-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:[h.jsxs("span",{children:["Running ",h.jsxs("span",{className:"font-mono text-fg-1",children:[e.running,"/",e.maxConcurrency]})]}),h.jsxs("span",{children:["Queued ",h.jsx("span",{className:"font-mono text-fg-1",children:e.queued})]}),e.parked>0?h.jsxs("span",{children:["Parked ",h.jsx("span",{className:"font-mono text-fg-1",children:e.parked})]}):null,h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t!==void 0?h.jsx(oA,{value:t,className:t>=95?"text-danger":t>=80?"text-warning":"text-fg-3"}):null,"Daily tokens"," ",h.jsxs("span",{className:"font-mono text-fg-1",children:[us(e.dailyTokensUsed),e.dailyTokenLimit!==void 0?` / ${us(e.dailyTokenLimit)}`:""]})]}),e.sessionTokenLimit!==void 0?h.jsxs("span",{children:["Per-job cap ",h.jsx("span",{className:"font-mono text-fg-1",children:us(e.sessionTokenLimit)})]}):null,e.paused?h.jsx(gn,{variant:"warning",dot:!0,children:"Paused — daily budget exhausted"}):null]})}function zre({onScheduled:e}){const[t,n]=E.useState(()=>localStorage.getItem(Pk)??""),[r,i]=E.useState(""),[a,l]=E.useState(()=>By("job")),[c,d]=E.useState("auto"),[f,g]=E.useState(()=>Py("job")),[m,b]=E.useState(""),{profiles:x,profile:v,selected:k,select:w}=YO(),S=$O(k,a,f),[N,_]=E.useState(!1),[A,L]=E.useState(""),[R,D]=E.useState(""),[I,U]=E.useState(""),[z,X]=E.useState(!1),W=async()=>{if(!t.trim()||!r.trim()){zn.error("Working directory and prompt are required");return}const V=A.trim()?Number(A.trim()):void 0;if(V!==void 0&&(!Number.isFinite(V)||V<=0)){zn.error("Max tokens must be a positive number");return}const ee=R.trim()?Number(R.trim()):void 0;if(ee!==void 0&&(!Number.isInteger(ee)||ee<1)){zn.error("Attempts must be a whole number of at least 1");return}X(!0);try{localStorage.setItem(Pk,t.trim()),await tr.createJob({session:{cwd:t.trim(),profile:v||void 0,prompt:r.trim(),permissionMode:S.mode,questionBehavior:S.capabilities.interactiveApprovals?c:void 0,model:S.model.trim()||void 0,reasoningEffort:m&&S.reasoningEfforts.includes(m)?m:void 0,...S.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:N||void 0}:{}},maxTokens:V,attempts:ee,webhook:I.trim()?{url:I.trim()}:void 0}),i(""),zn.success("Job scheduled"),e()}catch(q){zn.error(q instanceof Error?q.message:"Failed to schedule job")}finally{X(!1)}};return h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"Schedule a job"})}),h.jsxs(js,{className:"flex flex-col gap-3",children:[h.jsxs("label",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),h.jsx(un,{value:t,onChange:V=>n(V.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"})]}),h.jsxs("label",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Prompt (the task — runs unattended)"}),h.jsx(V1,{value:r,onChange:V=>i(V.target.value),rows:2,placeholder:"e.g. /verify-content 42, or a task description"})]}),h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(FO,{profiles:x,value:v,onChange:w,className:"min-w-32"}),h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),h.jsx(dd,{variant:"form",mode:S.mode,onModeChange:l,modes:S.modes,className:"min-w-44"})]}),S.capabilities.interactiveApprovals?h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Questions"}),h.jsxs(ho,{items:Sk.map(V=>({value:V.value,label:V.label})),value:c,onValueChange:V=>d(V),children:[h.jsx(po,{className:"min-w-36",children:h.jsx(mo,{})}),h.jsx(go,{children:Sk.map(V=>h.jsx(ua,{value:V.value,children:h.jsx(la,{children:`${V.label} — ${V.description}`})},V.value))})]})]}):null,h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),h.jsx(zy,{value:S.model,onChange:g,models:S.models,className:"min-w-40"})]}),S.reasoningEfforts.length>0?h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),h.jsxs(ho,{items:[{value:"default",label:"Default"},...S.reasoningEfforts.map(V=>({value:V,label:V}))],value:m||"default",onValueChange:V=>b(V==="default"?"":String(V)),children:[h.jsx(po,{className:"min-w-28",children:h.jsx(mo,{})}),h.jsx(go,{children:["default",...S.reasoningEfforts].map(V=>h.jsx(ua,{value:V,children:h.jsx(la,{children:V})},V))})]})]}):null,h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Max tokens (optional)"}),h.jsx(un,{value:A,onChange:V=>L(V.target.value),placeholder:"per-job cap",inputMode:"numeric",className:"min-w-28 font-mono"})]}),h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Attempts (optional)"}),h.jsx(un,{value:R,onChange:V=>D(V.target.value),placeholder:"1",inputMode:"numeric",className:"min-w-20 font-mono"})]}),h.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Webhook URL (optional)"}),h.jsx(un,{value:I,onChange:V=>U(V.target.value),placeholder:"https://…/hook",spellCheck:!1,className:"min-w-44 font-mono"})]}),h.jsxs(at,{onClick:()=>void W(),disabled:z,children:[z?h.jsx(vn,{className:"size-3.5 text-current"}):h.jsx(Ux,{className:"size-4"}),"Schedule"]})]}),S.capabilities.settingSources?h.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:[h.jsx("input",{type:"checkbox",checked:N,onChange:V=>_(V.target.checked),className:"size-3.5 accent-(--color-fg-1)"}),"Allow switching to ",h.jsx("code",{className:"font-mono",children:"bypassPermissions"})," mid-run",h.jsx("span",{className:"text-label text-fg-4",children:"(dangerous)"})]}):null,h.jsxs("p",{className:"text-label text-fg-4",children:["Unattended runs still surface permission prompts — watch the job's session to approve, 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"," ",h.jsx("code",{className:"font-mono",children:"POST /sessions/:id/permissions/:requestId"}),"."]})]})]})}function Hre({job:e,watchable:t,onChanged:n}){const r=Xl(),i=Pre[e.status],a=e.status==="queued"||e.status==="running"||e.status==="parked",l=async()=>{try{await tr.cancelJob(e.id),n()}catch(c){zn.error(c instanceof Error?c.message:"Cancel failed")}};return h.jsxs("li",{className:"flex items-center gap-3 rounded-md px-2 py-2 hover:bg-surface-hover",children:[h.jsxs(gn,{variant:i.variant,dot:!i.busy,children:[i.busy?h.jsx(vn,{className:"size-3 text-current"}):null,i.label]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate text-body-sm text-fg-1",children:e.prompt}),h.jsxs("div",{className:"flex flex-wrap gap-x-3 font-mono text-label text-fg-4",children:[h.jsx("span",{className:"truncate",children:e.cwd}),e.profile?h.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,h.jsx("span",{className:"shrink-0",children:cd(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?h.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?h.jsxs("span",{className:"shrink-0",children:[us(e.usage.tokens)," tok"]}):null,e.usage.totalCostUsd>0?h.jsx("span",{className:"shrink-0",children:bo(e.usage.totalCostUsd)}):null,e.error?h.jsx("span",{className:"truncate text-danger",children:e.error}):null]})]}),e.sessionId&&t?h.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>void r({to:"/sessions/$sessionId",params:{sessionId:e.sessionId}}),children:[h.jsx(R_,{className:"size-3"}),"Watch"]}):null,a?h.jsxs(at,{variant:"outline",size:"xs",onClick:()=>void l(),children:[h.jsx(bi,{className:"size-3"}),"Cancel"]}):null]})}function Ure(){const{jobs:e,stats:t,enabled:n,live:r,error:i,refresh:a}=Dre(),{sessions:l}=GO(),c=new Set(l.map(f=>f.id)),d=[...e].sort((f,g)=>g.createdAt-f.createdAt);return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[h.jsxs("header",{className:"flex items-end justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Jobs"}),h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Scheduled one-shot runs with concurrency and token budgets."})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx(gn,{variant:r?"success":"neutral",dot:!0,children:r?"Live":"Polling"}):null,h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void a(),children:h.jsx(Dm,{className:"size-4"})})]})]}),i?h.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can't reach the worker server: ",i,". Start it with"," ",h.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,n?h.jsxs(h.Fragment,{children:[t?h.jsx(Bre,{stats:t}):null,d.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[h.jsx(L_,{className:"size-6 text-fg-4"}),h.jsx("p",{className:"text-body-sm text-fg-2",children:"No jobs yet. Schedule one below."})]}):h.jsx("ul",{className:"flex flex-col gap-1 rounded-md border border-border bg-surface p-1",children:d.map(f=>h.jsx(Hre,{job:f,watchable:f.sessionId!==void 0&&c.has(f.sessionId),onChanged:()=>void a()},f.id))}),h.jsx(zre,{onScheduled:()=>void a()})]}):h.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[h.jsx(_9,{className:"size-6 text-fg-4"}),h.jsx("p",{className:"text-body-sm text-fg-2",children:"The server has no job queue configured."}),h.jsxs("p",{className:"text-label text-fg-4",children:["Pass ",h.jsxs("code",{className:"font-mono",children:["queue: ","{ maxConcurrency, … }"]})," to"," ",h.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — the dev server enables it by default."]})]})]})})}const Fre=["web_search","download","web_fetch","deliver_file"],hh=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function Xi({label:e,children:t}){return h.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function $re({profile:e,onSaved:t}){const n=e.engine==="provider",[r,i]=E.useState(e.description??""),[a,l]=E.useState(e.defaults?.model??""),[c,d]=E.useState(e.defaults?.permissionMode),[f,g]=E.useState(e.provider?.model??""),[m,b]=E.useState((e.provider?.models??[]).join(", ")),[x,v]=E.useState(e.session?.capabilities),[k,w]=E.useState((e.session?.mcpServers??[]).join(", ")),[S,N]=E.useState(e.session?.instructions??""),[_,A]=E.useState(!1),L=async()=>{const R={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:c}};n&&(R.provider={...e.provider,id:e.provider?.id??"",model:f.trim()||void 0,models:hh(m).length>0?hh(m):void 0},R.session={capabilities:x,mcpServers:hh(k).length>0?hh(k):void 0,instructions:S.trim()||void 0}),A(!0);try{t(await tr.updateProfile(e.name,R)),zn.success("Profile saved")}catch(D){zn.error(D instanceof Error?D.message:"Failed to save profile")}finally{A(!1)}};return h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"Edit profile"})}),h.jsxs(js,{className:"flex flex-col gap-3",children:[h.jsx(Xi,{label:"Description",children:h.jsx(un,{value:r,onChange:R=>i(R.target.value)})}),h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(Xi,{label:"Default model",children:h.jsx(un,{value:a,onChange:R=>l(R.target.value),placeholder:"unset — request / engine default",className:"font-mono"})}),h.jsx(Xi,{label:"Default permission mode",children:h.jsx(dd,{variant:"form",mode:c,onModeChange:d,modes:(e.capabilities??ud[e.engine??"claude"]).permissionModes})})]}),n?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(Xi,{label:"Default model id",children:h.jsx(un,{value:f,onChange:R=>g(R.target.value),className:"font-mono"})}),h.jsx(Xi,{label:"Models offered (comma-separated)",children:h.jsx(un,{value:m,onChange:R=>b(R.target.value),className:"font-mono"})})]}),h.jsx(Xi,{label:"Capabilities granted",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-3 py-1.5",children:[h.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[h.jsx("input",{type:"checkbox",checked:x===void 0,onChange:R=>v(R.target.checked?void 0:[]),className:"size-3.5 accent-(--color-fg-1)"}),"not declared"]}),Fre.map(R=>h.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[h.jsx("input",{type:"checkbox",disabled:x===void 0,checked:x?.includes(R)??!1,onChange:D=>v(I=>D.target.checked?[...I??[],R]:(I??[]).filter(U=>U!==R)),className:"size-3.5 accent-(--color-fg-1) disabled:opacity-40"}),h.jsx("code",{className:"font-mono text-label",children:R})]},R))]})}),h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(Xi,{label:"MCP servers (names, comma-separated)",children:h.jsx(un,{value:k,onChange:R=>w(R.target.value),className:"font-mono"})}),h.jsx(Xi,{label:"Instructions",children:h.jsx(un,{value:S,onChange:R=>N(R.target.value)})})]})]}):null,h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.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."}),h.jsxs(at,{onClick:()=>void L(),disabled:_,children:[_?h.jsx(vn,{className:"size-3.5 text-current"}):h.jsx(X7,{className:"size-4"}),"Save"]})]})]})]})}const Vre=["web_search","download","web_fetch","deliver_file"],mh=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function hs({label:e,children:t}){return h.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function qre({onCreated:e}){const[t,n]=E.useState("provider"),[r,i]=E.useState(""),[a,l]=E.useState(""),[c,d]=E.useState(""),[f,g]=E.useState(""),[m,b]=E.useState(""),[x,v]=E.useState(""),[k,w]=E.useState(""),[S,N]=E.useState([]),[_,A]=E.useState(""),[L,R]=E.useState(""),[D,I]=E.useState(!1),U=t==="provider",z=async()=>{if(!r.trim()){zn.error("Name is required");return}const X={name:r.trim(),engine:t};if(a.trim()&&(X.description=a.trim()),U){X.provider={id:c.trim(),model:f.trim()||void 0,models:mh(m).length>0?mh(m):void 0,apiKeyEnv:x.trim()||void 0};const W={};S.length>0&&(W.capabilities=S),mh(_).length>0&&(W.mcpServers=mh(_)),L.trim()&&(W.instructions=L.trim()),Object.keys(W).length>0&&(X.session=W)}else X.configDir=k.trim();I(!0);try{await tr.createProfile(X),await e(),i(""),l(""),R(""),zn.success(`Profile '${X.name}' created`)}catch(W){zn.error(W instanceof Error?W.message:"Failed to create profile")}finally{I(!1)}};return h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"New profile"})}),h.jsxs(js,{className:"flex flex-col gap-3",children:[h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(hs,{label:"Engine",children:h.jsxs(ho,{items:[{value:"provider",label:"provider"},{value:"claude",label:"claude"}],value:t,onValueChange:X=>n(X),children:[h.jsx(po,{className:"min-w-32",children:h.jsx(mo,{})}),h.jsxs(go,{children:[h.jsx(ua,{value:"provider",children:h.jsx(la,{children:"provider — model-agnostic engine"})}),h.jsx(ua,{value:"claude",children:h.jsx(la,{children:"claude — Agent SDK + config dir"})})]})]})}),h.jsx(hs,{label:"Name",children:h.jsx(un,{value:r,onChange:X=>i(X.target.value),placeholder:"kimi"})}),h.jsx(hs,{label:"Description (optional)",children:h.jsx(un,{value:a,onChange:X=>l(X.target.value),placeholder:"what this profile is for"})})]}),U?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(hs,{label:"Provider id",children:h.jsx(un,{value:c,onChange:X=>d(X.target.value),placeholder:"anthropic / openai / moonshotai",className:"font-mono"})}),h.jsx(hs,{label:"Default model",children:h.jsx(un,{value:f,onChange:X=>g(X.target.value),placeholder:"kimi-k3",className:"font-mono"})}),h.jsx(hs,{label:"Models offered (comma-separated)",children:h.jsx(un,{value:m,onChange:X=>b(X.target.value),placeholder:"kimi-k3, kimi-k2",className:"font-mono"})}),h.jsx(hs,{label:"API key variable",children:h.jsx(un,{value:x,onChange:X=>v(X.target.value),placeholder:"MOONSHOT_API_KEY",className:"font-mono"})})]}),h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(hs,{label:"Capabilities granted",children:h.jsx("div",{className:"flex flex-wrap gap-3 py-1.5",children:Vre.map(X=>h.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[h.jsx("input",{type:"checkbox",checked:S.includes(X),onChange:W=>N(V=>W.target.checked?[...V,X]:V.filter(ee=>ee!==X)),className:"size-3.5 accent-(--color-fg-1)"}),h.jsx("code",{className:"font-mono text-label",children:X})]},X))})}),h.jsx(hs,{label:"MCP servers (names, comma-separated)",children:h.jsx(un,{value:_,onChange:X=>A(X.target.value),placeholder:"deepwiki",className:"font-mono"})})]}),h.jsx(hs,{label:"Instructions (optional)",children:h.jsx(un,{value:L,onChange:X=>R(X.target.value),placeholder:"prepended to the session's system prompt"})}),h.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."})]}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{label:"Config directory",children:h.jsx(un,{value:k,onChange:X=>w(X.target.value),placeholder:"/Users/you/.claude",spellCheck:!1,className:"font-mono"})}),h.jsxs("p",{className:"text-label text-fg-4",children:["Must resolve inside the server's"," ",h.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."]})]}),h.jsx("div",{className:"flex justify-end",children:h.jsxs(at,{onClick:()=>void z(),disabled:D,children:[D?h.jsx(vn,{className:"size-3.5 text-current"}):h.jsx(Ux,{className:"size-4"}),"Create profile"]})})]})]})}function KO(e){window.location.href=`vscode://file${e}`}function Yre(){const{profiles:e,canManage:t,refresh:n}=qO(),r=Xl(),i=a=>{tr.deleteProfile(a).then(()=>n()).then(()=>zn.success(`Profile '${a}' deleted`)).catch(l=>zn.error(l instanceof Error?l.message:"Delete failed"))};return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[h.jsxs("header",{children:[h.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Profiles"}),h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"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."})]}),e.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[h.jsx(n7,{className:"size-6 text-fg-4"}),h.jsx("p",{className:"text-body-sm text-fg-2",children:"The server declares no profiles."}),h.jsxs("p",{className:"text-label text-fg-4",children:["Pass ",h.jsxs("code",{className:"font-mono",children:["profiles: [","{ name, configDir, … }","]"]})," to"," ",h.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — without the option, a"," ",h.jsx("code",{className:"font-mono",children:"default"})," profile is auto-created from"," ",h.jsx("code",{className:"font-mono",children:"~/.claude"})," when it exists."]})]}):h.jsx("ul",{className:"divide-y divide-border rounded-md border border-border bg-surface",children:e.map(a=>h.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[h.jsx(xB,{className:"size-4 shrink-0 text-fg-3"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:a.name}),a.description?h.jsx("span",{className:"truncate text-body-sm text-fg-3",children:a.description}):null]}),h.jsx("div",{className:"mt-0.5 truncate font-mono text-label text-fg-4",children:a.configDir??(a.provider?`${a.provider.id}${a.provider.model?` · ${a.provider.model}`:""}`:"")})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[h.jsx(gn,{variant:"neutral",children:a.engine??"claude"}),a.defaults?.model?h.jsx(gn,{variant:"neutral",children:a.defaults.model}):null,a.defaults?.permissionMode?h.jsx(gn,{variant:"neutral",children:a.defaults.permissionMode}):null,a.configDir?h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":`Open ${a.name} in VSCode`,title:"Open config dir in VSCode",onClick:()=>KO(a.configDir),children:h.jsx(zx,{className:"size-4"})}):null,h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":`View ${a.name}`,title:"View profile",onClick:()=>void r({to:"/profiles/$profileName",params:{profileName:a.name}}),children:h.jsx(R_,{className:"size-4"})}),a.managed?h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${a.name}`,title:"Delete profile",onClick:()=>i(a.name),children:h.jsx(Vx,{className:"size-4"})}):null]})]},a.name))}),t?h.jsx(qre,{onCreated:n}):null,h.jsxs("p",{className:"text-label text-fg-4",children:["Session and job creates run under the selected profile; when the server declares more than one, picking a profile is required."," ",t?"Profiles created here are stored by the server; the ones declared in its options are code and stay read-only.":"Profiles are declared in server configuration and read-only here."]})]})})}function In({label:e,children:t}){return h.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[h.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),h.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function Wi({items:e,empty:t}){return e.length===0?h.jsx("span",{className:"text-fg-4",children:t}):h.jsx("span",{className:"flex flex-wrap justify-end gap-1",children:e.map(n=>h.jsx(gn,{variant:"neutral",children:n},n))})}function Gre(){const{profileName:e}=hm({from:"/profiles/$profileName"}),[t,n]=E.useState(),[r,i]=E.useState();E.useEffect(()=>{let c=!0;return tr.getProfile(e).then(d=>{c&&n(d)}).catch(d=>{c&&i(d instanceof Error?d.message:"Failed to load profile")}),()=>{c=!1}},[e]);const a=t?.profile,l=t?.config;return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[h.jsxs("header",{className:"flex items-end justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs(sd,{to:"/profiles",className:"mb-1 inline-flex items-center gap-1 text-label text-fg-3 hover:text-fg-1",children:[h.jsx(k_,{className:"size-3"}),"Profiles"]}),h.jsx("h1",{className:"truncate text-display-sm font-semibold tracking-tight text-text",children:e}),a?.description?h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:a.description}):null]}),a?.configDir?h.jsxs(at,{variant:"outline",size:"xs",onClick:()=>KO(a.configDir),children:[h.jsx(zx,{className:"size-3"}),"Open in VSCode"]}):null]}),r?h.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:r}):null,!t&&!r?h.jsx(vn,{className:"mx-auto size-5 text-fg-4"}):null,a&&l?h.jsxs(h.Fragment,{children:[h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"Worker defaults"})}),h.jsxs(js,{className:"flex flex-col divide-y divide-border",children:[h.jsx(In,{label:"Engine",children:h.jsx(gn,{variant:"neutral",children:a.engine??"claude"})}),a.engine==="provider"?h.jsx(In,{label:"Provider",children:h.jsx("span",{className:"font-mono text-label",children:a.provider?.id})}):h.jsx(In,{label:"Config directory",children:h.jsx("span",{className:"font-mono text-label",children:a.configDir})}),h.jsx(In,{label:"Default model",children:a.defaults?.model??a.provider?.model??h.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),h.jsx(In,{label:"Default permission mode",children:a.defaults?.permissionMode??h.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),a.engine==="provider"?h.jsxs(h.Fragment,{children:[h.jsx(In,{label:"Models offered",children:h.jsx(Wi,{items:a.provider?.models??[],empty:"the default model only"})}),h.jsx(In,{label:"API key variable",children:a.provider?.apiKeyEnv?h.jsx("span",{className:"font-mono text-label",children:a.provider.apiKeyEnv}):h.jsx("span",{className:"text-fg-4",children:"provider SDK default"})})]}):null]})]}),a.engine==="provider"?h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"Session grants"})}),h.jsxs(js,{className:"flex flex-col divide-y divide-border",children:[h.jsx(In,{label:"Capabilities",children:h.jsx(Wi,{items:a.session?.capabilities??[],empty:"not declared — whatever the server wired"})}),h.jsx(In,{label:"MCP servers",children:h.jsx(Wi,{items:a.session?.mcpServers??[],empty:"not declared — every connected server"})}),h.jsx(In,{label:"Instructions",children:a.session?.instructions?`${a.session.instructions.length} characters`:h.jsx("span",{className:"text-fg-4",children:"none"})})]})]}):null,a.engine==="provider"?null:h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"Claude Code configuration"})}),h.jsxs(js,{className:"flex flex-col divide-y divide-border",children:[l.settings?h.jsxs(h.Fragment,{children:[h.jsx(In,{label:"Model (settings.json)",children:l.settings.model??h.jsx("span",{className:"text-fg-4",children:"not set"})}),h.jsx(In,{label:"Default permission mode",children:l.settings.defaultPermissionMode??h.jsx("span",{className:"text-fg-4",children:"not set"})}),h.jsx(In,{label:"Permission rules",children:h.jsx("span",{className:"font-mono text-label",children:l.settings.permissionRules?`${l.settings.permissionRules.allow} allow · ${l.settings.permissionRules.ask} ask · ${l.settings.permissionRules.deny} deny`:"—"})}),h.jsx(In,{label:"Env vars (names only)",children:h.jsx(Wi,{items:l.settings.envKeys??[],empty:"none"})}),h.jsx(In,{label:"Hooks",children:h.jsx(Wi,{items:l.settings.hooks??[],empty:"none"})})]}):h.jsx(In,{label:"settings.json",children:h.jsx("span",{className:"text-fg-4",children:"not found"})}),h.jsx(In,{label:"User memory (CLAUDE.md)",children:l.hasUserMemory?"present":h.jsx("span",{className:"text-fg-4",children:"none"})}),h.jsx(In,{label:"Skills",children:h.jsx(Wi,{items:l.skills,empty:"none"})}),h.jsx(In,{label:"Agents",children:h.jsx(Wi,{items:l.agents,empty:"none"})}),h.jsx(In,{label:"Commands",children:h.jsx(Wi,{items:l.commands,empty:"none"})})]})]}),a.managed?h.jsx($re,{profile:a,onSaved:c=>n({...t,profile:c})}):null,h.jsxs("p",{className:"text-label text-fg-4",children:[a.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"," ",h.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 Kre({files:e,activePath:t,onActivate:n,onClose:r,className:i}){return h.jsx(Dz,{delay:500,closeDelay:0,children:h.jsx("div",{"data-slot":"editor-tabs",role:"tablist","aria-label":"Open files",className:Se("flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface",i),children:e.map(a=>h.jsx(Xre,{file:a,active:a.path===t,onActivate:()=>n(a.path),onClose:()=>r(a.path),onArrow:l=>{const c=e.findIndex(f=>f.path===a.path),d=e[c+l];d&&n(d.path)}},a.path))})})}function Xre({file:e,active:t,onActivate:n,onClose:r,onArrow:i}){const a=Zc(e),l=E.useRef(null);E.useEffect(()=>{t&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);const c=d=>{d.button===1&&(d.preventDefault(),r())};return h.jsxs(Kx,{side:"bottom",render:h.jsx("div",{ref:l,role:"tab",tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:c,onKeyDown:d=>{if(d.key==="ArrowRight")i(1);else if(d.key==="ArrowLeft")i(-1);else if(d.key==="Enter"||d.key===" ")n();else return;d.preventDefault()},className:Se("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:h.jsxs("span",{className:"flex flex-col gap-0.5",children:[h.jsx("span",{className:"font-mono break-all",children:e.path}),e.bytes!==void 0?h.jsx("span",{className:"text-fg-4",children:xo(e.bytes)}):null]}),children:[h.jsx("span",{className:Se("max-w-40 truncate font-mono text-label",a&&"italic"),children:e.name}),e.status==="error"?h.jsx("span",{className:"shrink-0 text-danger",children:"!"}):null,h.jsxs("button",{type:"button","aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:d=>{d.stopPropagation(),r()},className:Se("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:[h.jsx("span",{className:Se("block",a&&"group-hover:hidden"),children:a?h.jsx("span",{className:"block size-3 rounded-full bg-fg-2"}):h.jsx(bi,{className:"size-3"})}),a?h.jsx("span",{className:"hidden group-hover:block",children:h.jsx(bi,{className:"size-3"})}):null]})]})}const XO=12;function Wre({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:i,style:a,className:l}){const[c,d]=E.useState(""),[f,g]=E.useState(),m=c.trim().length>0;return E.useEffect(()=>{if(!t?.available)return;const b=c.trim();if(!b){g(void 0);return}const x=new AbortController,v=setTimeout(()=>{t.search(b,{limit:60,signal:x.signal}).then(k=>{x.signal.aborted||g(k)})},150);return()=>{x.abort(),clearTimeout(v)}},[t,c]),h.jsxs("div",{"data-slot":"file-tree",style:a,className:Se("flex min-h-0 min-w-0 flex-col bg-surface",l),children:[h.jsxs("div",{className:"flex items-center gap-1 px-2 pt-2",children:[t?.available?h.jsxs("div",{className:"relative min-w-0 flex-1",children:[h.jsx($x,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),h.jsx(un,{value:c,onChange:b=>d(b.target.value),placeholder:"Search files…",className:"h-7 pr-7 pl-7 text-label",spellCheck:!1}),m?h.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:h.jsx(bi,{className:"size-3.5"})}):null]}):h.jsx("span",{className:"min-w-0 flex-1 truncate px-1 font-mono text-label text-fg-4",children:e.root}),h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Refresh the file tree",onClick:()=>e.refresh(),children:h.jsx(Dm,{className:"size-3.5 text-fg-3"})}),i?h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Hide project files",onClick:i,children:h.jsx(j_,{className:"size-3.5 text-fg-3"})}):null]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-1 py-1",children:e.error?h.jsx("p",{className:"px-2 py-3 text-body-sm text-danger",children:e.error}):m?f===void 0?h.jsx("div",{className:"py-6 text-center",children:h.jsx(vn,{className:"size-4 text-fg-4"})}):f.length===0?h.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"No matching files."}):h.jsx("ul",{children:f.map(b=>h.jsx("li",{children:h.jsx(Bk,{label:Qre(b.relative),detail:Zre(b.relative),title:b.relative,icon:h.jsx(Lm,{className:"size-3.5 shrink-0 text-fg-4"}),active:b.path===n,onClick:()=>r(b.path)})},b.path))}):e.loading?h.jsx("div",{className:"py-6 text-center",children:h.jsx(vn,{className:"size-4 text-fg-4"})}):e.rows.length===0?h.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"This project is empty."}):h.jsx("ul",{role:"tree","aria-label":"Project files",children:e.rows.map(b=>h.jsxs("li",{role:"treeitem","aria-expanded":b.expanded,"aria-level":b.depth+1,children:[h.jsx(Bk,{label:b.entry.name,indent:b.depth,active:b.entry.path===n,icon:b.entry.type==="dir"?b.loading?h.jsx(vn,{className:"size-3.5 shrink-0 text-fg-4"}):b.expanded?h.jsx(s7,{className:"size-3.5 shrink-0 text-accent"}):h.jsx(O_,{className:"size-3.5 shrink-0 text-accent"}):h.jsx(Jre,{type:b.entry.type}),chevron:b.entry.type==="dir"?h.jsx(Mm,{className:Se("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?h.jsx("p",{className:"truncate py-0.5 text-label text-fg-4",style:{paddingLeft:(b.depth+1)*XO+22},children:"More entries than the server will return — use search."}):null]},b.entry.path))})})]})}function Bk({label:e,detail:t,title:n,icon:r,chevron:i,indent:a=0,active:l,onClick:c}){const d=E.useRef(null);return E.useEffect(()=>{l&&d.current?.scrollIntoView({block:"nearest"})},[l]),h.jsxs("button",{ref:d,type:"button",onClick:c,title:n??e,style:{paddingLeft:a*XO+4},className:Se("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:[h.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:i}),r,h.jsx("span",{className:"shrink-0 truncate font-mono text-label",children:e}),t?h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:t}):null]})}function Qre(e){return e.slice(e.lastIndexOf("/")+1)}function Zre(e){const t=e.lastIndexOf("/");return t===-1?void 0:e.slice(0,t)}function Jre({type:e}){return e==="symlink"?h.jsx(M_,{className:"size-3.5 shrink-0 text-fg-4"}):h.jsx(Lm,{className:"size-3.5 shrink-0 text-fg-4"})}function ese({path:e,value:t,onChange:n,onSave:r,readOnly:i,className:a}){const l=E.useRef(null),c=E.useRef(null),d=E.useRef(null),[f,g]=E.useState(!1),m=tse(),b=E.useRef({onChange:n,onSave:r});return b.current={onChange:n,onSave:r},E.useEffect(()=>{let x=!1;return nse().then(v=>{if(x||!l.current)return;d.current=v;const k=v.editor.create(l.current,{value:t,language:Uk(e),readOnly:i,automaticLayout:!0,theme:zk(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});c.current=k,k.onDidChangeModelContent(()=>{b.current.onChange?.(k.getValue())}),k.addCommand(v.KeyMod.CtrlCmd|v.KeyCode.KeyS,()=>{b.current.onSave?.()}),g(!0)}),()=>{x=!0,c.current?.dispose(),c.current=null,g(!1)}},[]),E.useEffect(()=>{const x=d.current,v=c.current;if(!x||!v||!f)return;const k=x.Uri.parse(`workerdeck://host${e}`),w=x.editor.getModel(k)??x.editor.createModel(t,Uk(e),k);v.getModel()!==w&&v.setModel(w)},[e,f,t]),E.useEffect(()=>{const x=c.current;if(!x||!f)return;const v=x.getModel();!v||v.getValue()===t||v.pushEditOperations([],[{range:v.getFullModelRange(),text:t}],()=>null)},[t,f]),E.useEffect(()=>{f&&c.current?.updateOptions({readOnly:i})},[i,f]),E.useEffect(()=>{f&&d.current?.editor.setTheme(zk(m))},[m,f]),h.jsxs("div",{className:Se("relative min-h-0 min-w-0 flex-1",a),children:[h.jsx("div",{ref:l,className:"absolute inset-0"}),f?null:h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg",children:h.jsx(vn,{className:"size-4 text-fg-4"})})]})}function tse(){const[e,t]=E.useState(()=>typeof document>"u"?null:document.documentElement.getAttribute("data-theme"));return E.useEffect(()=>{const n=document.documentElement,r=()=>t(n.getAttribute("data-theme"));r();const i=new MutationObserver(r);return i.observe(n,{attributes:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[]),e}function zk(e){return e==="light"?"wd-light":"wd-dark"}let Hk;function nse(){return Hk??=(async()=>{const e=await Vl(()=>import("./index-976cPiHW.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})(),Hk}function Uk(e){const t=e.slice(e.lastIndexOf("/")+1),n=rse[t.toLowerCase()];if(n)return n;const r=t.slice(t.lastIndexOf(".")+1).toLowerCase();return sse[r]??"plaintext"}const rse={dockerfile:"dockerfile",makefile:"plaintext",".gitignore":"plaintext",".env":"shell"},sse={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 ise({file:e,canWrite:t,onChange:n,onSave:r,onRevert:i,onReload:a,onOverwrite:l,onDismissConflict:c,className:d}){return e?h.jsxs("div",{"data-slot":"file-viewer",className:Se("flex min-h-0 min-w-0 flex-1 flex-col bg-bg",d),children:[e.conflict?h.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:[h.jsx(Ll,{className:"size-3.5 shrink-0 text-warning"}),h.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-warning",children:"This file changed on disk since you opened it."}),h.jsx(at,{variant:"outline",size:"xs",onClick:()=>a?.(e.path),children:"Use the version on disk"}),h.jsx(at,{variant:"outline",size:"xs",onClick:()=>l?.(e.path),children:"Keep mine"}),h.jsx(at,{variant:"ghost",size:"xs",onClick:()=>c?.(e.path),children:"Dismiss"})]}):e.saveError?h.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2",children:[h.jsx(Ll,{className:"size-3.5 shrink-0 text-danger"}),h.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-danger",children:e.saveError}),h.jsx(at,{variant:"ghost",size:"xs",onClick:()=>c?.(e.path),children:"Dismiss"})]}):null,e.status==="loading"?h.jsx(Nb,{children:h.jsx(vn,{className:"size-4 text-fg-4"})}):e.status==="error"?h.jsxs(Nb,{children:[h.jsx(Ll,{className:"size-4 text-danger"}),h.jsx("p",{className:"text-body-sm text-danger",children:e.error})]}):e.status==="binary"?h.jsxs(Nb,{children:[h.jsx(Z9,{className:"size-4 text-fg-4"}),h.jsx("p",{className:"text-body-sm text-fg-4",children:"This file isn’t text."}),h.jsx("p",{className:"text-label text-fg-4",children:"It can’t be edited here without corrupting it."})]}):h.jsx(ese,{path:e.path,value:n1(e),readOnly:!t,onChange:n?f=>n(e.path,f):void 0,onSave:r?()=>r(e.path):void 0}),e.status==="ready"&&(e.saving||Zc(e)||!t)?h.jsx("div",{className:"flex shrink-0 items-center gap-2 border-t border-border px-3 py-1",children:e.saving?h.jsxs(h.Fragment,{children:[h.jsx(vn,{className:"size-3 text-fg-4"}),h.jsx("span",{className:"text-label text-fg-4",children:"Saving…"})]}):t?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-label text-fg-3",children:"Unsaved changes"}),h.jsx("span",{className:"flex-1"}),h.jsx(at,{variant:"ghost",size:"xs",onClick:()=>i?.(e.path),children:"Revert"}),h.jsxs(at,{variant:"outline",size:"xs",onClick:()=>r?.(e.path),children:["Save",h.jsx("span",{className:"ml-1 text-fg-4",children:"⌘S"})]})]}):h.jsx("span",{className:"text-label text-fg-4",children:"Read-only — this gateway doesn’t allow writes."})}):null]}):null}function Nb({children:e}){return h.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6",children:e})}const ase=180,ose=520,lse=220,Fk=120;function use({client:e,sessionId:t,header:n,defaultRailWidth:r=260,defaultRailCollapsed:i,className:a}){const{info:l}=CA(e,t),c=l?.cwd,d=eF(e,c),f=SA(e,c),g=nF(e),{canWrite:m}=JU(e);E.useEffect(()=>{if(!g.hasUnsaved)return;const V=ee=>ee.preventDefault();return window.addEventListener("beforeunload",V),()=>window.removeEventListener("beforeunload",V)},[g.hasUnsaved]);const b=dse(),[x,v]=E.useState(i??!1),[k,w]=E.useState(r),[S,N]=E.useState(360),_=g.files.length>0,A=!b,L=d.available&&!x;E.useEffect(()=>{A&&v(!0)},[A]);const R=E.useCallback(V=>{const ee=g.files.find(q=>q.path===V);if(ee&&Zc(ee)){const q=ee.name;if(!window.confirm(`${q} has unsaved changes. Close it and lose them?`))return}g.close(V)},[g]),D=E.useRef(null),I=cse(D),U=Math.max(Fk,I-lse),[z,X]=E.useState(null),W=n===void 0||z===null?void 0:typeof n=="function"?V=>lr.createPortal(n(V),z):lr.createPortal(n,z);return h.jsxs("div",{"data-slot":"session-workspace",className:Se("flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg",a),children:[n!==void 0?h.jsx("div",{ref:X,className:"shrink-0"}):null,h.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[L?h.jsx(Wre,{tree:d,search:f,activePath:g.activePath,onOpenFile:g.open,onCollapse:()=>v(!0),style:{width:A?Math.min(k,320):k},className:Se("shrink-0 border-r border-border",A&&"absolute inset-y-0 left-0 z-20 shadow-lg")}):d.available?h.jsx("div",{className:"flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5",children:h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Show project files",onClick:()=>v(!1),children:h.jsx(P_,{className:"size-4 text-fg-3"})})}):null,L&&!A?h.jsx(pC,{orientation:"vertical",value:k,onValueChange:w,min:ase,max:ose,"aria-label":"Resize the file tree"}):null,h.jsxs("div",{ref:D,className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[_?h.jsxs("div",{className:"flex min-h-0 shrink-0 flex-col overflow-hidden",style:{height:Math.min(S,U||S)},children:[h.jsx(Kre,{files:g.files,activePath:g.activePath,onActivate:g.activate,onClose:R}),h.jsx(ise,{file:g.active,canWrite:m,onChange:g.edit,onSave:V=>void g.save(V),onRevert:g.revert,onReload:g.reload,onOverwrite:V=>void g.overwrite(V),onDismissConflict:g.dismissConflict})]}):null,_?h.jsx(pC,{orientation:"horizontal",value:Math.min(S,U||S),onValueChange:N,min:Fk,max:U,"aria-label":"Resize the open file"}):null,h.jsx(Tre,{client:e,sessionId:t,header:W,className:"min-h-0 flex-1"})]}),A&&L?h.jsx("button",{type:"button","aria-label":"Close the file tree",onClick:()=>v(!0),className:"absolute inset-0 z-10 bg-black/30"}):null]})]})}function cse(e){const[t,n]=E.useState(0);return E.useLayoutEffect(()=>{const r=e.current;if(!r)return;const i=new ResizeObserver(([a])=>{a&&n(a.contentRect.height)});return i.observe(r),()=>i.disconnect()},[e]),t}function dse(){const[e,t]=E.useState(!0);return E.useEffect(()=>{const n=window.matchMedia("(min-width: 768px)"),r=()=>t(n.matches);return r(),n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}function fse(){const{sessionId:e}=hm({from:"/sessions/$sessionId"}),t=Xl(),{info:n,error:r}=CA(tr,e);E.useEffect(()=>{r&&(zn.error("Session not found"),t({to:"/sessions"}))},[r,t]);const i=async()=>{try{await tr.deleteSession(e)}catch{}t({to:"/sessions"})},a=n?.cwd?.split("/").filter(Boolean).pop();return h.jsx(use,{client:tr,sessionId:e,header:({actions:l})=>h.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-surface px-3 py-2",children:[h.jsx(sd,{to:"/sessions","aria-label":"Back to sessions",children:h.jsx(at,{variant:"ghost",size:"icon-sm",children:h.jsx(k_,{className:"size-4"})})}),h.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:n?.title??a??e.slice(0,8)}),n?.engine&&n.engine!=="claude"?h.jsx(gn,{variant:"neutral",className:"shrink-0",children:n.engine}):null,n?.cwd?h.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:n.cwd,children:n.cwd}):null,h.jsx("span",{className:"flex-1"}),h.jsx(Gh,{value:e,"aria-label":"Copy session id"}),h.jsxs(zB,{children:[h.jsx(HB,{render:h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Close session",children:h.jsx(Vx,{className:"size-4 text-fg-3"})})}),h.jsxs(FB,{children:[h.jsx($B,{children:"Close this session?"}),h.jsx(VB,{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."}),h.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[h.jsx(UB,{render:h.jsx(at,{variant:"outline",children:"Cancel"})}),h.jsx(at,{variant:"destructive",onClick:()=>void i(),children:"Close session"})]})]})]}),l]})},e)}const $k="workerdeck.last-cwd";function hse({onCreated:e}){const[t,n]=E.useState(()=>localStorage.getItem($k)??""),[r,i]=E.useState(""),[a,l]=E.useState(()=>By("session")),[c,d]=E.useState(()=>Py("session")),[f,g]=E.useState(""),{profiles:m,profile:b,selected:x,select:v}=YO(),k=$O(x,a,c),[w,S]=E.useState(!1),[N,_]=E.useState(),[A,L]=E.useState(!1),R=async I=>{const U=I?.cwd??t.trim();if(!U){zn.error("Working directory is required");return}S(!0);try{localStorage.setItem($k,t.trim()||U);const z=await tr.createSession({cwd:U,profile:b||void 0,prompt:I?void 0:r.trim()||void 0,permissionMode:k.mode,model:k.model.trim()||void 0,resume:I?.sessionId,reasoningEffort:f&&k.reasoningEfforts.includes(f)?f:void 0,...k.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:!0}:{}});e(z.id)}catch(z){zn.error(z instanceof Error?z.message:"Failed to create session")}finally{S(!1)}},D=async()=>{if(!t.trim()){zn.error("Set a working directory first — resumable sessions are listed per project");return}L(!0);try{_(await tr.listSdkSessions({dir:t.trim(),limit:20,profile:b||void 0}))}catch(I){zn.error(I instanceof Error?I.message:"Failed to list resumable sessions")}finally{L(!1)}};return h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"New session"})}),h.jsxs(js,{className:"flex flex-col gap-3",children:[h.jsxs("label",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),h.jsx(un,{value:t,onChange:I=>n(I.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"})]}),h.jsxs("label",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Initial prompt (optional)"}),h.jsx(V1,{value:r,onChange:I=>i(I.target.value),rows:2,placeholder:"e.g. /verify-content 42, or a task description"})]}),h.jsxs("div",{className:"flex items-end justify-between gap-3",children:[h.jsx(FO,{profiles:m,value:b,onChange:I=>{v(I),_(void 0)},className:"min-w-32"}),h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),h.jsx(dd,{variant:"form",mode:k.mode,onModeChange:l,modes:k.modes,className:"min-w-44"})]}),h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),h.jsx(zy,{value:k.model,onChange:d,models:k.models,className:"min-w-44"})]}),k.reasoningEfforts.length>0?h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),h.jsxs(ho,{items:[{value:"default",label:"Default"},...k.reasoningEfforts.map(I=>({value:I,label:I}))],value:f||"default",onValueChange:I=>g(I==="default"?"":String(I)),children:[h.jsx(po,{className:"min-w-28",children:h.jsx(mo,{})}),h.jsx(go,{children:["default",...k.reasoningEfforts].map(I=>h.jsx(ua,{value:I,children:h.jsx(la,{children:I})},I))})]})]}):null,h.jsxs(at,{onClick:()=>void R(),disabled:w,children:[w?h.jsx(vn,{className:"size-3.5 text-current"}):h.jsx(Ux,{className:"size-4"}),"Create"]})]}),k.capabilities.listSessions?h.jsxs("div",{className:"mt-1 border-t border-border pt-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Resume a previous session"}),h.jsxs(at,{variant:"ghost",size:"xs",onClick:()=>void D(),disabled:A,children:[A?h.jsx(vn,{className:"size-3 text-current"}):h.jsx(p7,{className:"size-3"}),N?"Reload":"Browse"]})]}),N!==void 0?N.length===0?h.jsx("div",{className:"py-3 text-center text-body-sm text-fg-4",children:"No stored sessions for this directory."}):h.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:N.map(I=>h.jsxs("li",{className:"flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate text-body-sm text-fg-1",children:I.customTitle??I.summary}),h.jsxs("div",{className:"flex gap-2 font-mono text-label text-fg-4",children:[I.gitBranch?h.jsx("span",{className:"truncate",children:I.gitBranch}):null,h.jsx("span",{className:"shrink-0",children:cd(I.lastModified)})]})]}),h.jsx(at,{variant:"outline",size:"xs",onClick:()=>void R(I),disabled:w,children:"Resume"})]},I.sessionId))}):null]}):null]})]})}function mse(){const e=Xl(),{sessions:t,error:n,refresh:r}=GO(),i=a=>void e({to:"/sessions/$sessionId",params:{sessionId:a}});return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[h.jsxs("header",{className:"flex items-end justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Sessions"}),h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Live Agent SDK sessions on this worker."})]}),h.jsx(at,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void r(),children:h.jsx(Dm,{className:"size-4"})})]}),n?h.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 ",h.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,h.jsx(kre,{sessions:[...t].sort((a,l)=>(l.lastActivityAt??l.createdAt)-(a.lastActivityAt??a.createdAt)),onSelect:i,onDelete:a=>{tr.deleteSession(a).then(()=>r()).catch(l=>zn.error(l instanceof Error?l.message:"Delete failed"))},emptyText:"No live sessions. Create one below."}),h.jsx(hse,{onCreated:i})]})})}function Vk({kind:e,label:t}){const[n,r]=E.useState(()=>Py(e)),[i,a]=E.useState(()=>By(e));return h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-2",children:[h.jsx("span",{className:"text-body-sm text-fg-2",children:t}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(dd,{variant:"form",mode:i,onModeChange:l=>{a(l),Lre(e,l)},className:"min-w-40"}),h.jsx(zy,{value:n,onChange:l=>{r(l),Ire(e,l)},className:"min-w-44"})]})]})}function pse(){return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-6 py-6",children:[h.jsxs("header",{children:[h.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Settings"}),h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Client-side preferences. Server policy (auth, cwd roots, API-key requirements) is configured where the worker runs."})]}),h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"Appearance"})}),h.jsxs(js,{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-body-sm text-fg-2",children:"Theme"}),h.jsx(zO,{})]})]}),h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"Defaults"})}),h.jsxs(js,{className:"flex flex-col gap-3",children:[h.jsx(Vk,{kind:"session",label:"New session"}),h.jsx(Vk,{kind:"job",label:"Queue job"}),h.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.'})]})]}),h.jsxs(Ms,{children:[h.jsx(Ls,{children:h.jsx(Ds,{children:"Worker server"})}),h.jsxs(js,{className:"flex flex-col gap-1 text-body-sm text-fg-2",children:[h.jsxs("div",{children:["Endpoint: ",h.jsxs("code",{className:"font-mono text-code",children:[location.origin,"/v1"]})," (dev proxy → ",h.jsx("code",{className:"font-mono text-code",children:"WORKER_URL"}),", default"," ",h.jsx("code",{className:"font-mono text-code",children:"http://127.0.0.1:8787"}),")"]}),h.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 va=G5({component:Ore}),gse=So({getParentRoute:()=>va,path:"/",beforeLoad:()=>{throw sN({to:"/sessions"})}}),bse=So({getParentRoute:()=>va,path:"/sessions",component:mse}),xse=So({getParentRoute:()=>va,path:"/sessions/$sessionId",component:fse}),yse=So({getParentRoute:()=>va,path:"/jobs",component:Ure}),Ese=So({getParentRoute:()=>va,path:"/profiles",component:Yre}),vse=So({getParentRoute:()=>va,path:"/profiles/$profileName",component:Gre}),Tse=So({getParentRoute:()=>va,path:"/settings",component:pse}),Sse=aL({routeTree:va.addChildren([gse,bse,xse,yse,Ese,vse,Tse]),history:d5()});function Cse(){return h.jsxs(h.Fragment,{children:[h.jsx(uL,{router:Sse}),h.jsx(cH,{})]})}Gk();const WO=document.getElementById("root");if(!WO)throw new Error("Root element #root not found");bM.createRoot(WO).render(h.jsx(E.StrictMode,{children:h.jsx(Cse,{})}));const wse=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:_O},Symbol.toStringTag,{value:"Module"}));export{Dee as A,_se as L,Yr as R,Vl as _,h as j,E as r};