dorkos 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -37
- package/dist/bin/cli.js +22 -7
- package/dist/client/assets/{TopologyGraph-DUHOb6MC.js → TopologyGraph-BDQJfh8H.js} +19 -24
- package/dist/client/assets/highlighted-body-TPN3WLV5-C-9u4GvI.js +1 -0
- package/dist/client/assets/index-CRsHB5DU.css +1 -0
- package/dist/client/assets/index-D8O7L1KA.js +798 -0
- package/dist/client/index.html +2 -2
- package/dist/drizzle/0005_heavy_ultimo.sql +1 -0
- package/dist/drizzle/meta/0005_snapshot.json +660 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/index.js +66049 -33739
- package/dist/server/index.js.map +4 -4
- package/package.json +19 -15
- package/dist/client/assets/highlighted-body-B3W2YXNL-D-c41b3T.js +0 -1
- package/dist/client/assets/index-lIzhHlx_.js +0 -724
- package/dist/client/assets/index-pIOn2ZAY.css +0 -1
|
@@ -1,724 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TopologyGraph-DUHOb6MC.js","assets/TopologyGraph-C7eadB24.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var ZB=Object.defineProperty;var kN=e=>{throw TypeError(e)};var JB=(e,t,n)=>t in e?ZB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var We=(e,t,n)=>JB(e,typeof t!="symbol"?t+"":t,n),R1=(e,t,n)=>t.has(e)||kN("Cannot "+n);var Z=(e,t,n)=>(R1(e,t,"read from private field"),n?n.call(e):t.get(e)),Ye=(e,t,n)=>t.has(e)?kN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Me=(e,t,n,r)=>(R1(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ct=(e,t,n)=>(R1(e,t,"access private method"),n);var Rm=(e,t,n,r)=>({set _(s){Me(e,t,s,n)},get _(){return Z(e,t,r)}});function e7(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const t7="modulepreload",n7=function(e){return"/"+e},_N={},c0=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=l(n.map(d=>{if(d=n7(d),d in _N)return;_N[d]=!0;const p=d.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":t7,p||(x.as="script"),x.crossOrigin="",x.href=d,f&&x.setAttribute("nonce",f),document.head.appendChild(x),p)return new Promise((y,v)=>{x.addEventListener("load",y),x.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})};var yye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ml(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O1={exports:{}},xd={};/**
|
|
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 RN;function r7(){if(RN)return xd;RN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var c in s)c!=="key"&&(i[c]=s[c])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:i}}return xd.Fragment=t,xd.jsx=n,xd.jsxs=n,xd}var ON;function s7(){return ON||(ON=1,O1.exports=r7()),O1.exports}var u=s7(),D1={exports:{}},nt={};/**
|
|
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 DN;function a7(){if(DN)return nt;DN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function y(q){return q===null||typeof q!="object"?null:(q=x&&q[x]||q["@@iterator"],typeof q=="function"?q:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,w={};function N(q,V,j){this.props=q,this.context=V,this.refs=w,this.updater=j||v}N.prototype.isReactComponent={},N.prototype.setState=function(q,V){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,V,"setState")},N.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function A(){}A.prototype=N.prototype;function k(q,V,j){this.props=q,this.context=V,this.refs=w,this.updater=j||v}var R=k.prototype=new A;R.constructor=k,T(R,N.prototype),R.isPureReactComponent=!0;var D=Array.isArray;function O(){}var M={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function H(q,V,j){var re=j.ref;return{$$typeof:e,type:q,key:V,ref:re!==void 0?re:null,props:j}}function P(q,V){return H(q.type,V,q.props)}function K(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function Y(q){var V={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(j){return V[j]})}var W=/\/+/g;function te(q,V){return typeof q=="object"&&q!==null&&q.key!=null?Y(""+q.key):V.toString(36)}function J(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(O,O):(q.status="pending",q.then(function(V){q.status==="pending"&&(q.status="fulfilled",q.value=V)},function(V){q.status==="pending"&&(q.status="rejected",q.reason=V)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function L(q,V,j,re,ae){var me=typeof q;(me==="undefined"||me==="boolean")&&(q=null);var le=!1;if(q===null)le=!0;else switch(me){case"bigint":case"string":case"number":le=!0;break;case"object":switch(q.$$typeof){case e:case t:le=!0;break;case p:return le=q._init,L(le(q._payload),V,j,re,ae)}}if(le)return ae=ae(q),le=re===""?"."+te(q,0):re,D(ae)?(j="",le!=null&&(j=le.replace(W,"$&/")+"/"),L(ae,V,j,"",function(Re){return Re})):ae!=null&&(K(ae)&&(ae=P(ae,j+(ae.key==null||q&&q.key===ae.key?"":(""+ae.key).replace(W,"$&/")+"/")+le)),V.push(ae)),1;le=0;var ye=re===""?".":re+":";if(D(q))for(var ve=0;ve<q.length;ve++)re=q[ve],me=ye+te(re,ve),le+=L(re,V,j,me,ae);else if(ve=y(q),typeof ve=="function")for(q=ve.call(q),ve=0;!(re=q.next()).done;)re=re.value,me=ye+te(re,ve++),le+=L(re,V,j,me,ae);else if(me==="object"){if(typeof q.then=="function")return L(J(q),V,j,re,ae);throw V=String(q),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return le}function B(q,V,j){if(q==null)return q;var re=[],ae=0;return L(q,re,"","",function(me){return V.call(j,me,ae++)}),re}function U(q){if(q._status===-1){var V=q._result;V=V(),V.then(function(j){(q._status===0||q._status===-1)&&(q._status=1,q._result=j)},function(j){(q._status===0||q._status===-1)&&(q._status=2,q._result=j)}),q._status===-1&&(q._status=0,q._result=V)}if(q._status===1)return q._result.default;throw q._result}var ne=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},z={map:B,forEach:function(q,V,j){B(q,function(){V.apply(this,arguments)},j)},count:function(q){var V=0;return B(q,function(){V++}),V},toArray:function(q){return B(q,function(V){return V})||[]},only:function(q){if(!K(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return nt.Activity=m,nt.Children=z,nt.Component=N,nt.Fragment=n,nt.Profiler=s,nt.PureComponent=k,nt.StrictMode=r,nt.Suspense=f,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,nt.__COMPILER_RUNTIME={__proto__:null,c:function(q){return M.H.useMemoCache(q)}},nt.cache=function(q){return function(){return q.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(q,V,j){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var re=T({},q.props),ae=q.key;if(V!=null)for(me in V.key!==void 0&&(ae=""+V.key),V)!I.call(V,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&V.ref===void 0||(re[me]=V[me]);var me=arguments.length-2;if(me===1)re.children=j;else if(1<me){for(var le=Array(me),ye=0;ye<me;ye++)le[ye]=arguments[ye+2];re.children=le}return H(q.type,ae,re)},nt.createContext=function(q){return q={$$typeof:l,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:i,_context:q},q},nt.createElement=function(q,V,j){var re,ae={},me=null;if(V!=null)for(re in V.key!==void 0&&(me=""+V.key),V)I.call(V,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ae[re]=V[re]);var le=arguments.length-2;if(le===1)ae.children=j;else if(1<le){for(var ye=Array(le),ve=0;ve<le;ve++)ye[ve]=arguments[ve+2];ae.children=ye}if(q&&q.defaultProps)for(re in le=q.defaultProps,le)ae[re]===void 0&&(ae[re]=le[re]);return H(q,me,ae)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(q){return{$$typeof:c,render:q}},nt.isValidElement=K,nt.lazy=function(q){return{$$typeof:p,_payload:{_status:-1,_result:q},_init:U}},nt.memo=function(q,V){return{$$typeof:d,type:q,compare:V===void 0?null:V}},nt.startTransition=function(q){var V=M.T,j={};M.T=j;try{var re=q(),ae=M.S;ae!==null&&ae(j,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(O,ne)}catch(me){ne(me)}finally{V!==null&&j.types!==null&&(V.types=j.types),M.T=V}},nt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},nt.use=function(q){return M.H.use(q)},nt.useActionState=function(q,V,j){return M.H.useActionState(q,V,j)},nt.useCallback=function(q,V){return M.H.useCallback(q,V)},nt.useContext=function(q){return M.H.useContext(q)},nt.useDebugValue=function(){},nt.useDeferredValue=function(q,V){return M.H.useDeferredValue(q,V)},nt.useEffect=function(q,V){return M.H.useEffect(q,V)},nt.useEffectEvent=function(q){return M.H.useEffectEvent(q)},nt.useId=function(){return M.H.useId()},nt.useImperativeHandle=function(q,V,j){return M.H.useImperativeHandle(q,V,j)},nt.useInsertionEffect=function(q,V){return M.H.useInsertionEffect(q,V)},nt.useLayoutEffect=function(q,V){return M.H.useLayoutEffect(q,V)},nt.useMemo=function(q,V){return M.H.useMemo(q,V)},nt.useOptimistic=function(q,V){return M.H.useOptimistic(q,V)},nt.useReducer=function(q,V,j){return M.H.useReducer(q,V,j)},nt.useRef=function(q){return M.H.useRef(q)},nt.useState=function(q){return M.H.useState(q)},nt.useSyncExternalStore=function(q,V,j){return M.H.useSyncExternalStore(q,V,j)},nt.useTransition=function(){return M.H.useTransition()},nt.version="19.2.4",nt}var jN;function jf(){return jN||(jN=1,D1.exports=a7()),D1.exports}var b=jf();const oe=ml(b),iE=e7({__proto__:null,default:oe},[b]);var j1={exports:{}},yd={},M1={exports:{}},I1={};/**
|
|
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 MN;function i7(){return MN||(MN=1,(function(e){function t(L,B){var U=L.length;L.push(B);e:for(;0<U;){var ne=U-1>>>1,z=L[ne];if(0<s(z,B))L[ne]=B,L[U]=z,U=ne;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var B=L[0],U=L.pop();if(U!==B){L[0]=U;e:for(var ne=0,z=L.length,q=z>>>1;ne<q;){var V=2*(ne+1)-1,j=L[V],re=V+1,ae=L[re];if(0>s(j,U))re<z&&0>s(ae,j)?(L[ne]=ae,L[re]=U,ne=re):(L[ne]=j,L[V]=U,ne=V);else if(re<z&&0>s(ae,U))L[ne]=ae,L[re]=U,ne=re;else break e}}return B}function s(L,B){var U=L.sortIndex-B.sortIndex;return U!==0?U:L.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],p=1,m=null,x=3,y=!1,v=!1,T=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function R(L){for(var B=n(d);B!==null;){if(B.callback===null)r(d);else if(B.startTime<=L)r(d),B.sortIndex=B.expirationTime,t(f,B);else break;B=n(d)}}function D(L){if(T=!1,R(L),!v)if(n(f)!==null)v=!0,O||(O=!0,Y());else{var B=n(d);B!==null&&J(D,B.startTime-L)}}var O=!1,M=-1,I=5,H=-1;function P(){return w?!0:!(e.unstable_now()-H<I)}function K(){if(w=!1,O){var L=e.unstable_now();H=L;var B=!0;try{e:{v=!1,T&&(T=!1,A(M),M=-1),y=!0;var U=x;try{t:{for(R(L),m=n(f);m!==null&&!(m.expirationTime>L&&P());){var ne=m.callback;if(typeof ne=="function"){m.callback=null,x=m.priorityLevel;var z=ne(m.expirationTime<=L);if(L=e.unstable_now(),typeof z=="function"){m.callback=z,R(L),B=!0;break t}m===n(f)&&r(f),R(L)}else r(f);m=n(f)}if(m!==null)B=!0;else{var q=n(d);q!==null&&J(D,q.startTime-L),B=!1}}break e}finally{m=null,x=U,y=!1}B=void 0}}finally{B?Y():O=!1}}}var Y;if(typeof k=="function")Y=function(){k(K)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,te=W.port2;W.port1.onmessage=K,Y=function(){te.postMessage(null)}}else Y=function(){N(K,0)};function J(L,B){M=N(function(){L(e.unstable_now())},B)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(L){switch(x){case 1:case 2:case 3:var B=3;break;default:B=x}var U=x;x=B;try{return L()}finally{x=U}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(L,B){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var U=x;x=L;try{return B()}finally{x=U}},e.unstable_scheduleCallback=function(L,B,U){var ne=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?ne+U:ne):U=ne,L){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=U+z,L={id:p++,callback:B,priorityLevel:L,startTime:U,expirationTime:z,sortIndex:-1},U>ne?(L.sortIndex=U,t(d,L),n(f)===null&&L===n(d)&&(T?(A(M),M=-1):T=!0,J(D,U-ne))):(L.sortIndex=z,t(f,L),v||y||(v=!0,O||(O=!0,Y()))),L},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(L){var B=x;return function(){var U=x;x=B;try{return L.apply(this,arguments)}finally{x=U}}}})(I1)),I1}var IN;function o7(){return IN||(IN=1,M1.exports=i7()),M1.exports}var L1={exports:{}},fr={};/**
|
|
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 LN;function l7(){if(LN)return fr;LN=1;var e=jf();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(f,d,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:f,containerInfo:d,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return fr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fr.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return i(f,d,null,p)},fr.flushSync=function(f){var d=l.T,p=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=p,r.d.f()}},fr.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},fr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},fr.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,m=c(p,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:y}):p==="script"&&r.d.X(f,{crossOrigin:m,integrity:x,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},fr.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},fr.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,m=c(p,d.crossOrigin);r.d.L(f,p,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},fr.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},fr.requestFormReset=function(f){r.d.r(f)},fr.unstable_batchedUpdates=function(f,d){return f(d)},fr.useFormState=function(f,d,p){return l.H.useFormState(f,d,p)},fr.useFormStatus=function(){return l.H.useHostTransitionStatus()},fr.version="19.2.4",fr}var PN;function h5(){if(PN)return L1.exports;PN=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(),L1.exports=l7(),L1.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 BN;function u7(){if(BN)return yd;BN=1;var e=o7(),t=jf(),n=h5();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)o+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function i(a){var o=a,h=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(h=o.return),a=o.return;while(a)}return o.tag===3?h:null}function l(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function f(a){if(i(a)!==a)throw Error(r(188))}function d(a){var o=a.alternate;if(!o){if(o=i(a),o===null)throw Error(r(188));return o!==a?null:a}for(var h=a,g=o;;){var E=h.return;if(E===null)break;var S=E.alternate;if(S===null){if(g=E.return,g!==null){h=g;continue}break}if(E.child===S.child){for(S=E.child;S;){if(S===h)return f(E),a;if(S===g)return f(E),o;S=S.sibling}throw Error(r(188))}if(h.return!==g.return)h=E,g=S;else{for(var _=!1,F=E.child;F;){if(F===h){_=!0,h=E,g=S;break}if(F===g){_=!0,g=E,h=S;break}F=F.sibling}if(!_){for(F=S.child;F;){if(F===h){_=!0,h=S,g=E;break}if(F===g){_=!0,g=S,h=E;break}F=F.sibling}if(!_)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?a:o}function p(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=p(a),o!==null)return o;a=a.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),k=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function Y(a){return a===null||typeof a!="object"?null:(a=K&&a[K]||a["@@iterator"],typeof a=="function"?a:null)}var W=Symbol.for("react.client.reference");function te(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===W?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case N:return"Profiler";case w:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList";case H:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case k:return a.displayName||"Context";case A:return(a._context.displayName||"Context")+".Consumer";case R:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case M:return o=a.displayName||null,o!==null?o:te(a.type)||"Memo";case I:o=a._payload,a=a._init;try{return te(a(o))}catch{}}return null}var J=Array.isArray,L=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},ne=[],z=-1;function q(a){return{current:a}}function V(a){0>z||(a.current=ne[z],ne[z]=null,z--)}function j(a,o){z++,ne[z]=a.current,a.current=o}var re=q(null),ae=q(null),me=q(null),le=q(null);function ye(a,o){switch(j(me,o),j(ae,a),j(re,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?WC(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=WC(o),a=ZC(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}V(re),j(re,a)}function ve(){V(re),V(ae),V(me)}function Re(a){a.memoizedState!==null&&j(le,a);var o=re.current,h=ZC(o,a.type);o!==h&&(j(ae,a),j(re,h))}function ke(a){ae.current===a&&(V(re),V(ae)),le.current===a&&(V(le),hd._currentValue=U)}var $e,Et;function Oe(a){if($e===void 0)try{throw Error()}catch(h){var o=h.stack.trim().match(/\n( *(at )?)/);$e=o&&o[1]||"",Et=-1<h.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+$e+a+Et}var Xt=!1;function un(a,o){if(!a||Xt)return"";Xt=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(fe){var de=fe}Reflect.construct(a,[],be)}else{try{be.call()}catch(fe){de=fe}a.call(be.prototype)}}else{try{throw Error()}catch(fe){de=fe}(be=a())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(fe){if(fe&&de&&typeof fe.stack=="string")return[fe.stack,de.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=g.DetermineComponentFrameRoot(),_=S[0],F=S[1];if(_&&F){var X=_.split(`
|
|
45
|
-
`),ce=F.split(`
|
|
46
|
-
`);for(E=g=0;g<X.length&&!X[g].includes("DetermineComponentFrameRoot");)g++;for(;E<ce.length&&!ce[E].includes("DetermineComponentFrameRoot");)E++;if(g===X.length||E===ce.length)for(g=X.length-1,E=ce.length-1;1<=g&&0<=E&&X[g]!==ce[E];)E--;for(;1<=g&&0<=E;g--,E--)if(X[g]!==ce[E]){if(g!==1||E!==1)do if(g--,E--,0>E||X[g]!==ce[E]){var ge=`
|
|
47
|
-
`+X[g].replace(" at new "," at ");return a.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",a.displayName)),ge}while(1<=g&&0<=E);break}}}finally{Xt=!1,Error.prepareStackTrace=h}return(h=a?a.displayName||a.name:"")?Oe(h):""}function tn(a,o){switch(a.tag){case 26:case 27:case 5:return Oe(a.type);case 16:return Oe("Lazy");case 13:return a.child!==o&&o!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return un(a.type,!1);case 11:return un(a.type.render,!1);case 1:return un(a.type,!0);case 31:return Oe("Activity");default:return""}}function pt(a){try{var o="",h=null;do o+=tn(a,h),h=a,a=a.return;while(a);return o}catch(g){return`
|
|
48
|
-
Error generating stack: `+g.message+`
|
|
49
|
-
`+g.stack}}var Tt=Object.prototype.hasOwnProperty,Ht=e.unstable_scheduleCallback,cn=e.unstable_cancelCallback,St=e.unstable_shouldYield,dn=e.unstable_requestPaint,it=e.unstable_now,Rt=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,Ve=e.unstable_NormalPriority,et=e.unstable_LowPriority,st=e.unstable_IdlePriority,Dn=e.log,fn=e.unstable_setDisableYieldValue,vn=null,nn=null;function kn(a){if(typeof Dn=="function"&&fn(a),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(vn,a)}catch{}}var Ot=Math.clz32?Math.clz32:Ae,Se=Math.log,qe=Math.LN2;function Ae(a){return a>>>=0,a===0?32:31-(Se(a)/qe|0)|0}var Ke=256,gt=262144,Je=4194304;function ot(a){var o=a&42;if(o!==0)return o;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ie(a,o,h){var g=a.pendingLanes;if(g===0)return 0;var E=0,S=a.suspendedLanes,_=a.pingedLanes;a=a.warmLanes;var F=g&134217727;return F!==0?(g=F&~S,g!==0?E=ot(g):(_&=F,_!==0?E=ot(_):h||(h=F&~a,h!==0&&(E=ot(h))))):(F=g&~S,F!==0?E=ot(F):_!==0?E=ot(_):h||(h=g&~a,h!==0&&(E=ot(h)))),E===0?0:o!==0&&o!==E&&(o&S)===0&&(S=E&-E,h=o&-o,S>=h||S===32&&(h&4194048)!==0)?o:E}function tt(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Wt(a,o){switch(a){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 $t(){var a=Je;return Je<<=1,(Je&62914560)===0&&(Je=4194304),a}function dr(a){for(var o=[],h=0;31>h;h++)o.push(a);return o}function jt(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function an(a,o,h,g,E,S){var _=a.pendingLanes;a.pendingLanes=h,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=h,a.entangledLanes&=h,a.errorRecoveryDisabledLanes&=h,a.shellSuspendCounter=0;var F=a.entanglements,X=a.expirationTimes,ce=a.hiddenUpdates;for(h=_&~h;0<h;){var ge=31-Ot(h),be=1<<ge;F[ge]=0,X[ge]=-1;var de=ce[ge];if(de!==null)for(ce[ge]=null,ge=0;ge<de.length;ge++){var fe=de[ge];fe!==null&&(fe.lane&=-536870913)}h&=~be}g!==0&&rs(a,g,0),S!==0&&E===0&&a.tag!==0&&(a.suspendedLanes|=S&~(_&~o))}function rs(a,o,h){a.pendingLanes|=o,a.suspendedLanes&=~o;var g=31-Ot(o);a.entangledLanes|=o,a.entanglements[g]=a.entanglements[g]|1073741824|h&261930}function rr(a,o){var h=a.entangledLanes|=o;for(a=a.entanglements;h;){var g=31-Ot(h),E=1<<g;E&o|a[g]&o&&(a[g]|=o),h&=~E}}function Rr(a,o){var h=o&-o;return h=(h&42)!==0?1:Cl(h),(h&(a.suspendedLanes|o))!==0?0:h}function Cl(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function _s(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function vg(){var a=B.p;return a!==0?a:(a=window.event,a===void 0?32:EN(a.type))}function P2(a,o){var h=B.p;try{return B.p=a,o()}finally{B.p=h}}var li=Math.random().toString(36).slice(2),sr="__reactFiber$"+li,Or="__reactProps$"+li,Nl="__reactContainer$"+li,Eg="__reactEvents$"+li,U8="__reactListeners$"+li,H8="__reactHandles$"+li,B2="__reactResources$"+li,kc="__reactMarker$"+li;function Tg(a){delete a[sr],delete a[Or],delete a[Eg],delete a[U8],delete a[H8]}function Al(a){var o=a[sr];if(o)return o;for(var h=a.parentNode;h;){if(o=h[Nl]||h[sr]){if(h=o.alternate,o.child!==null||h!==null&&h.child!==null)for(a=aN(a);a!==null;){if(h=a[sr])return h;a=aN(a)}return o}a=h,h=a.parentNode}return null}function kl(a){if(a=a[sr]||a[Nl]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function _c(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function _l(a){var o=a[B2];return o||(o=a[B2]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Xn(a){a[kc]=!0}var F2=new Set,z2={};function po(a,o){Rl(a,o),Rl(a+"Capture",o)}function Rl(a,o){for(z2[a]=o,a=0;a<o.length;a++)F2.add(o[a])}var $8=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]*$"),U2={},H2={};function V8(a){return Tt.call(H2,a)?!0:Tt.call(U2,a)?!1:$8.test(a)?H2[a]=!0:(U2[a]=!0,!1)}function yh(a,o,h){if(V8(o))if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+h)}}function bh(a,o,h){if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+h)}}function Ca(a,o,h,g){if(g===null)a.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttributeNS(o,h,""+g)}}function ss(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function $2(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function q8(a,o,h){var g=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,S=g.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return E.call(this)},set:function(_){h=""+_,S.call(this,_)}}),Object.defineProperty(a,o,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(_){h=""+_},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Sg(a){if(!a._valueTracker){var o=$2(a)?"checked":"value";a._valueTracker=q8(a,o,""+a[o])}}function V2(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var h=o.getValue(),g="";return a&&(g=$2(a)?a.checked?"true":"false":a.value),a=g,a!==h?(o.setValue(a),!0):!1}function vh(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Y8=/[\n"\\]/g;function as(a){return a.replace(Y8,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function wg(a,o,h,g,E,S,_,F){a.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?a.type=_:a.removeAttribute("type"),o!=null?_==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+ss(o)):a.value!==""+ss(o)&&(a.value=""+ss(o)):_!=="submit"&&_!=="reset"||a.removeAttribute("value"),o!=null?Cg(a,_,ss(o)):h!=null?Cg(a,_,ss(h)):g!=null&&a.removeAttribute("value"),E==null&&S!=null&&(a.defaultChecked=!!S),E!=null&&(a.checked=E&&typeof E!="function"&&typeof E!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?a.name=""+ss(F):a.removeAttribute("name")}function q2(a,o,h,g,E,S,_,F){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),o!=null||h!=null){if(!(S!=="submit"&&S!=="reset"||o!=null)){Sg(a);return}h=h!=null?""+ss(h):"",o=o!=null?""+ss(o):h,F||o===a.value||(a.value=o),a.defaultValue=o}g=g??E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,a.checked=F?a.checked:!!g,a.defaultChecked=!!g,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(a.name=_),Sg(a)}function Cg(a,o,h){o==="number"&&vh(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function Ol(a,o,h,g){if(a=a.options,o){o={};for(var E=0;E<h.length;E++)o["$"+h[E]]=!0;for(h=0;h<a.length;h++)E=o.hasOwnProperty("$"+a[h].value),a[h].selected!==E&&(a[h].selected=E),E&&g&&(a[h].defaultSelected=!0)}else{for(h=""+ss(h),o=null,E=0;E<a.length;E++){if(a[E].value===h){a[E].selected=!0,g&&(a[E].defaultSelected=!0);return}o!==null||a[E].disabled||(o=a[E])}o!==null&&(o.selected=!0)}}function Y2(a,o,h){if(o!=null&&(o=""+ss(o),o!==a.value&&(a.value=o),h==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=h!=null?""+ss(h):""}function G2(a,o,h,g){if(o==null){if(g!=null){if(h!=null)throw Error(r(92));if(J(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),o=h}h=ss(o),a.defaultValue=h,g=a.textContent,g===h&&g!==""&&g!==null&&(a.value=g),Sg(a)}function Dl(a,o){if(o){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=o;return}}a.textContent=o}var G8=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 K2(a,o,h){var g=o.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":g?a.setProperty(o,h):typeof h!="number"||h===0||G8.has(o)?o==="float"?a.cssFloat=h:a[o]=(""+h).trim():a[o]=h+"px"}function Q2(a,o,h){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?a.setProperty(g,""):g==="float"?a.cssFloat="":a[g]="");for(var E in o)g=o[E],o.hasOwnProperty(E)&&h[E]!==g&&K2(a,E,g)}else for(var S in o)o.hasOwnProperty(S)&&K2(a,S,o[S])}function Ng(a){if(a.indexOf("-")===-1)return!1;switch(a){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 K8=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"]]),Q8=/^[\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 Eh(a){return Q8.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Na(){}var Ag=null;function kg(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var jl=null,Ml=null;function X2(a){var o=kl(a);if(o&&(a=o.stateNode)){var h=a[Or]||null;e:switch(a=o.stateNode,o.type){case"input":if(wg(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),o=h.name,h.type==="radio"&&o!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+as(""+o)+'"][type="radio"]'),o=0;o<h.length;o++){var g=h[o];if(g!==a&&g.form===a.form){var E=g[Or]||null;if(!E)throw Error(r(90));wg(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(o=0;o<h.length;o++)g=h[o],g.form===a.form&&V2(g)}break e;case"textarea":Y2(a,h.value,h.defaultValue);break e;case"select":o=h.value,o!=null&&Ol(a,!!h.multiple,o,!1)}}}var _g=!1;function W2(a,o,h){if(_g)return a(o,h);_g=!0;try{var g=a(o);return g}finally{if(_g=!1,(jl!==null||Ml!==null)&&(lm(),jl&&(o=jl,a=Ml,Ml=jl=null,X2(o),a)))for(o=0;o<a.length;o++)X2(a[o])}}function Rc(a,o){var h=a.stateNode;if(h===null)return null;var g=h[Or]||null;if(g===null)return null;h=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(r(231,o,typeof h));return h}var Aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rg=!1;if(Aa)try{var Oc={};Object.defineProperty(Oc,"passive",{get:function(){Rg=!0}}),window.addEventListener("test",Oc,Oc),window.removeEventListener("test",Oc,Oc)}catch{Rg=!1}var ui=null,Og=null,Th=null;function Z2(){if(Th)return Th;var a,o=Og,h=o.length,g,E="value"in ui?ui.value:ui.textContent,S=E.length;for(a=0;a<h&&o[a]===E[a];a++);var _=h-a;for(g=1;g<=_&&o[h-g]===E[S-g];g++);return Th=E.slice(a,1<g?1-g:void 0)}function Sh(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function wh(){return!0}function J2(){return!1}function Dr(a){function o(h,g,E,S,_){this._reactName=h,this._targetInst=E,this.type=g,this.nativeEvent=S,this.target=_,this.currentTarget=null;for(var F in a)a.hasOwnProperty(F)&&(h=a[F],this[F]=h?h(S):S[F]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?wh:J2,this.isPropagationStopped=J2,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=wh)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=wh)},persist:function(){},isPersistent:wh}),o}var go={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ch=Dr(go),Dc=m({},go,{view:0,detail:0}),X8=Dr(Dc),Dg,jg,jc,Nh=m({},Dc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ig,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==jc&&(jc&&a.type==="mousemove"?(Dg=a.screenX-jc.screenX,jg=a.screenY-jc.screenY):jg=Dg=0,jc=a),Dg)},movementY:function(a){return"movementY"in a?a.movementY:jg}}),eS=Dr(Nh),W8=m({},Nh,{dataTransfer:0}),Z8=Dr(W8),J8=m({},Dc,{relatedTarget:0}),Mg=Dr(J8),e9=m({},go,{animationName:0,elapsedTime:0,pseudoElement:0}),t9=Dr(e9),n9=m({},go,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),r9=Dr(n9),s9=m({},go,{data:0}),tS=Dr(s9),a9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i9={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"},o9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function l9(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=o9[a])?!!o[a]:!1}function Ig(){return l9}var u9=m({},Dc,{key:function(a){if(a.key){var o=a9[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=Sh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?i9[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ig,charCode:function(a){return a.type==="keypress"?Sh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Sh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),c9=Dr(u9),d9=m({},Nh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nS=Dr(d9),f9=m({},Dc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ig}),h9=Dr(f9),m9=m({},go,{propertyName:0,elapsedTime:0,pseudoElement:0}),p9=Dr(m9),g9=m({},Nh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),x9=Dr(g9),y9=m({},go,{newState:0,oldState:0}),b9=Dr(y9),v9=[9,13,27,32],Lg=Aa&&"CompositionEvent"in window,Mc=null;Aa&&"documentMode"in document&&(Mc=document.documentMode);var E9=Aa&&"TextEvent"in window&&!Mc,rS=Aa&&(!Lg||Mc&&8<Mc&&11>=Mc),sS=" ",aS=!1;function iS(a,o){switch(a){case"keyup":return v9.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Il=!1;function T9(a,o){switch(a){case"compositionend":return oS(o);case"keypress":return o.which!==32?null:(aS=!0,sS);case"textInput":return a=o.data,a===sS&&aS?null:a;default:return null}}function S9(a,o){if(Il)return a==="compositionend"||!Lg&&iS(a,o)?(a=Z2(),Th=Og=ui=null,Il=!1,a):null;switch(a){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 rS&&o.locale!=="ko"?null:o.data;default:return null}}var w9={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 lS(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!w9[a.type]:o==="textarea"}function uS(a,o,h,g){jl?Ml?Ml.push(g):Ml=[g]:jl=g,o=pm(o,"onChange"),0<o.length&&(h=new Ch("onChange","change",null,h,g),a.push({event:h,listeners:o}))}var Ic=null,Lc=null;function C9(a){qC(a,0)}function Ah(a){var o=_c(a);if(V2(o))return a}function cS(a,o){if(a==="change")return o}var dS=!1;if(Aa){var Pg;if(Aa){var Bg="oninput"in document;if(!Bg){var fS=document.createElement("div");fS.setAttribute("oninput","return;"),Bg=typeof fS.oninput=="function"}Pg=Bg}else Pg=!1;dS=Pg&&(!document.documentMode||9<document.documentMode)}function hS(){Ic&&(Ic.detachEvent("onpropertychange",mS),Lc=Ic=null)}function mS(a){if(a.propertyName==="value"&&Ah(Lc)){var o=[];uS(o,Lc,a,kg(a)),W2(C9,o)}}function N9(a,o,h){a==="focusin"?(hS(),Ic=o,Lc=h,Ic.attachEvent("onpropertychange",mS)):a==="focusout"&&hS()}function A9(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ah(Lc)}function k9(a,o){if(a==="click")return Ah(o)}function _9(a,o){if(a==="input"||a==="change")return Ah(o)}function R9(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var Vr=typeof Object.is=="function"?Object.is:R9;function Pc(a,o){if(Vr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var h=Object.keys(a),g=Object.keys(o);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var E=h[g];if(!Tt.call(o,E)||!Vr(a[E],o[E]))return!1}return!0}function pS(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function gS(a,o){var h=pS(a);a=0;for(var g;h;){if(h.nodeType===3){if(g=a+h.textContent.length,a<=o&&g>=o)return{node:h,offset:o-a};a=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=pS(h)}}function xS(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?xS(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function yS(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=vh(a.document);o instanceof a.HTMLIFrameElement;){try{var h=typeof o.contentWindow.location.href=="string"}catch{h=!1}if(h)a=o.contentWindow;else break;o=vh(a.document)}return o}function Fg(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var O9=Aa&&"documentMode"in document&&11>=document.documentMode,Ll=null,zg=null,Bc=null,Ug=!1;function bS(a,o,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Ug||Ll==null||Ll!==vh(g)||(g=Ll,"selectionStart"in g&&Fg(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Bc&&Pc(Bc,g)||(Bc=g,g=pm(zg,"onSelect"),0<g.length&&(o=new Ch("onSelect","select",null,o,h),a.push({event:o,listeners:g}),o.target=Ll)))}function xo(a,o){var h={};return h[a.toLowerCase()]=o.toLowerCase(),h["Webkit"+a]="webkit"+o,h["Moz"+a]="moz"+o,h}var Pl={animationend:xo("Animation","AnimationEnd"),animationiteration:xo("Animation","AnimationIteration"),animationstart:xo("Animation","AnimationStart"),transitionrun:xo("Transition","TransitionRun"),transitionstart:xo("Transition","TransitionStart"),transitioncancel:xo("Transition","TransitionCancel"),transitionend:xo("Transition","TransitionEnd")},Hg={},vS={};Aa&&(vS=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function yo(a){if(Hg[a])return Hg[a];if(!Pl[a])return a;var o=Pl[a],h;for(h in o)if(o.hasOwnProperty(h)&&h in vS)return Hg[a]=o[h];return a}var ES=yo("animationend"),TS=yo("animationiteration"),SS=yo("animationstart"),D9=yo("transitionrun"),j9=yo("transitionstart"),M9=yo("transitioncancel"),wS=yo("transitionend"),CS=new Map,$g="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(" ");$g.push("scrollEnd");function Rs(a,o){CS.set(a,o),po(o,[a])}var kh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},is=[],Bl=0,Vg=0;function _h(){for(var a=Bl,o=Vg=Bl=0;o<a;){var h=is[o];is[o++]=null;var g=is[o];is[o++]=null;var E=is[o];is[o++]=null;var S=is[o];if(is[o++]=null,g!==null&&E!==null){var _=g.pending;_===null?E.next=E:(E.next=_.next,_.next=E),g.pending=E}S!==0&&NS(h,E,S)}}function Rh(a,o,h,g){is[Bl++]=a,is[Bl++]=o,is[Bl++]=h,is[Bl++]=g,Vg|=g,a.lanes|=g,a=a.alternate,a!==null&&(a.lanes|=g)}function qg(a,o,h,g){return Rh(a,o,h,g),Oh(a)}function bo(a,o){return Rh(a,null,null,o),Oh(a)}function NS(a,o,h){a.lanes|=h;var g=a.alternate;g!==null&&(g.lanes|=h);for(var E=!1,S=a.return;S!==null;)S.childLanes|=h,g=S.alternate,g!==null&&(g.childLanes|=h),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(E=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,E&&o!==null&&(E=31-Ot(h),a=S.hiddenUpdates,g=a[E],g===null?a[E]=[o]:g.push(o),o.lane=h|536870912),S):null}function Oh(a){if(50<id)throw id=0,e1=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Fl={};function I9(a,o,h,g){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qr(a,o,h,g){return new I9(a,o,h,g)}function Yg(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ka(a,o){var h=a.alternate;return h===null?(h=qr(a.tag,o,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=o,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&65011712,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,o=a.dependencies,h.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h.refCleanup=a.refCleanup,h}function AS(a,o){a.flags&=65011714;var h=a.alternate;return h===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=h.childLanes,a.lanes=h.lanes,a.child=h.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=h.memoizedProps,a.memoizedState=h.memoizedState,a.updateQueue=h.updateQueue,a.type=h.type,o=h.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Dh(a,o,h,g,E,S){var _=0;if(g=a,typeof a=="function")Yg(a)&&(_=1);else if(typeof a=="string")_=zB(a,h,re.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case H:return a=qr(31,h,o,E),a.elementType=H,a.lanes=S,a;case T:return vo(h.children,E,S,o);case w:_=8,E|=24;break;case N:return a=qr(12,h,o,E|2),a.elementType=N,a.lanes=S,a;case D:return a=qr(13,h,o,E),a.elementType=D,a.lanes=S,a;case O:return a=qr(19,h,o,E),a.elementType=O,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case k:_=10;break e;case A:_=9;break e;case R:_=11;break e;case M:_=14;break e;case I:_=16,g=null;break e}_=29,h=Error(r(130,a===null?"null":typeof a,"")),g=null}return o=qr(_,h,o,E),o.elementType=a,o.type=g,o.lanes=S,o}function vo(a,o,h,g){return a=qr(7,a,g,o),a.lanes=h,a}function Gg(a,o,h){return a=qr(6,a,null,o),a.lanes=h,a}function kS(a){var o=qr(18,null,null,0);return o.stateNode=a,o}function Kg(a,o,h){return o=qr(4,a.children!==null?a.children:[],a.key,o),o.lanes=h,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var _S=new WeakMap;function os(a,o){if(typeof a=="object"&&a!==null){var h=_S.get(a);return h!==void 0?h:(o={value:a,source:o,stack:pt(o)},_S.set(a,o),o)}return{value:a,source:o,stack:pt(o)}}var zl=[],Ul=0,jh=null,Fc=0,ls=[],us=0,ci=null,Ks=1,Qs="";function _a(a,o){zl[Ul++]=Fc,zl[Ul++]=jh,jh=a,Fc=o}function RS(a,o,h){ls[us++]=Ks,ls[us++]=Qs,ls[us++]=ci,ci=a;var g=Ks;a=Qs;var E=32-Ot(g)-1;g&=~(1<<E),h+=1;var S=32-Ot(o)+E;if(30<S){var _=E-E%5;S=(g&(1<<_)-1).toString(32),g>>=_,E-=_,Ks=1<<32-Ot(o)+E|h<<E|g,Qs=S+a}else Ks=1<<S|h<<E|g,Qs=a}function Qg(a){a.return!==null&&(_a(a,1),RS(a,1,0))}function Xg(a){for(;a===jh;)jh=zl[--Ul],zl[Ul]=null,Fc=zl[--Ul],zl[Ul]=null;for(;a===ci;)ci=ls[--us],ls[us]=null,Qs=ls[--us],ls[us]=null,Ks=ls[--us],ls[us]=null}function OS(a,o){ls[us++]=Ks,ls[us++]=Qs,ls[us++]=ci,Ks=o.id,Qs=o.overflow,ci=a}var ar=null,on=null,kt=!1,di=null,cs=!1,Wg=Error(r(519));function fi(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zc(os(o,a)),Wg}function DS(a){var o=a.stateNode,h=a.type,g=a.memoizedProps;switch(o[sr]=a,o[Or]=g,h){case"dialog":yt("cancel",o),yt("close",o);break;case"iframe":case"object":case"embed":yt("load",o);break;case"video":case"audio":for(h=0;h<ld.length;h++)yt(ld[h],o);break;case"source":yt("error",o);break;case"img":case"image":case"link":yt("error",o),yt("load",o);break;case"details":yt("toggle",o);break;case"input":yt("invalid",o),q2(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":yt("invalid",o);break;case"textarea":yt("invalid",o),G2(o,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||o.textContent===""+h||g.suppressHydrationWarning===!0||QC(o.textContent,h)?(g.popover!=null&&(yt("beforetoggle",o),yt("toggle",o)),g.onScroll!=null&&yt("scroll",o),g.onScrollEnd!=null&&yt("scrollend",o),g.onClick!=null&&(o.onclick=Na),o=!0):o=!1,o||fi(a,!0)}function jS(a){for(ar=a.return;ar;)switch(ar.tag){case 5:case 31:case 13:cs=!1;return;case 27:case 3:cs=!0;return;default:ar=ar.return}}function Hl(a){if(a!==ar)return!1;if(!kt)return jS(a),kt=!0,!1;var o=a.tag,h;if((h=o!==3&&o!==27)&&((h=o===5)&&(h=a.type,h=!(h!=="form"&&h!=="button")||p1(a.type,a.memoizedProps)),h=!h),h&&on&&fi(a),jS(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));on=sN(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));on=sN(a)}else o===27?(o=on,Ni(a.type)?(a=v1,v1=null,on=a):on=o):on=ar?fs(a.stateNode.nextSibling):null;return!0}function Eo(){on=ar=null,kt=!1}function Zg(){var a=di;return a!==null&&(Lr===null?Lr=a:Lr.push.apply(Lr,a),di=null),a}function zc(a){di===null?di=[a]:di.push(a)}var Jg=q(null),To=null,Ra=null;function hi(a,o,h){j(Jg,o._currentValue),o._currentValue=h}function Oa(a){a._currentValue=Jg.current,V(Jg)}function ex(a,o,h){for(;a!==null;){var g=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),a===h)break;a=a.return}}function tx(a,o,h,g){var E=a.child;for(E!==null&&(E.return=a);E!==null;){var S=E.dependencies;if(S!==null){var _=E.child;S=S.firstContext;e:for(;S!==null;){var F=S;S=E;for(var X=0;X<o.length;X++)if(F.context===o[X]){S.lanes|=h,F=S.alternate,F!==null&&(F.lanes|=h),ex(S.return,h,a),g||(_=null);break e}S=F.next}}else if(E.tag===18){if(_=E.return,_===null)throw Error(r(341));_.lanes|=h,S=_.alternate,S!==null&&(S.lanes|=h),ex(_,h,a),_=null}else _=E.child;if(_!==null)_.return=E;else for(_=E;_!==null;){if(_===a){_=null;break}if(E=_.sibling,E!==null){E.return=_.return,_=E;break}_=_.return}E=_}}function $l(a,o,h,g){a=null;for(var E=o,S=!1;E!==null;){if(!S){if((E.flags&524288)!==0)S=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var _=E.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var F=E.type;Vr(E.pendingProps.value,_.value)||(a!==null?a.push(F):a=[F])}}else if(E===le.current){if(_=E.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(a!==null?a.push(hd):a=[hd])}E=E.return}a!==null&&tx(o,a,h,g),o.flags|=262144}function Mh(a){for(a=a.firstContext;a!==null;){if(!Vr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function So(a){To=a,Ra=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ir(a){return MS(To,a)}function Ih(a,o){return To===null&&So(a),MS(a,o)}function MS(a,o){var h=o._currentValue;if(o={context:o,memoizedValue:h,next:null},Ra===null){if(a===null)throw Error(r(308));Ra=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Ra=Ra.next=o;return h}var L9=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(h,g){a.push(g)}};this.abort=function(){o.aborted=!0,a.forEach(function(h){return h()})}},P9=e.unstable_scheduleCallback,B9=e.unstable_NormalPriority,jn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nx(){return{controller:new L9,data:new Map,refCount:0}}function Uc(a){a.refCount--,a.refCount===0&&P9(B9,function(){a.controller.abort()})}var Hc=null,rx=0,Vl=0,ql=null;function F9(a,o){if(Hc===null){var h=Hc=[];rx=0,Vl=i1(),ql={status:"pending",value:void 0,then:function(g){h.push(g)}}}return rx++,o.then(IS,IS),o}function IS(){if(--rx===0&&Hc!==null){ql!==null&&(ql.status="fulfilled");var a=Hc;Hc=null,Vl=0,ql=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function z9(a,o){var h=[],g={status:"pending",value:null,reason:null,then:function(E){h.push(E)}};return a.then(function(){g.status="fulfilled",g.value=o;for(var E=0;E<h.length;E++)(0,h[E])(o)},function(E){for(g.status="rejected",g.reason=E,E=0;E<h.length;E++)(0,h[E])(void 0)}),g}var LS=L.S;L.S=function(a,o){bC=it(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&F9(a,o),LS!==null&&LS(a,o)};var wo=q(null);function sx(){var a=wo.current;return a!==null?a:Zt.pooledCache}function Lh(a,o){o===null?j(wo,wo.current):j(wo,o.pool)}function PS(){var a=sx();return a===null?null:{parent:jn._currentValue,pool:a}}var Yl=Error(r(460)),ax=Error(r(474)),Ph=Error(r(542)),Bh={then:function(){}};function BS(a){return a=a.status,a==="fulfilled"||a==="rejected"}function FS(a,o,h){switch(h=a[h],h===void 0?a.push(o):h!==o&&(o.then(Na,Na),o=h),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,US(a),a;default:if(typeof o.status=="string")o.then(Na,Na);else{if(a=Zt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(g){if(o.status==="pending"){var E=o;E.status="fulfilled",E.value=g}},function(g){if(o.status==="pending"){var E=o;E.status="rejected",E.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,US(a),a}throw No=o,Yl}}function Co(a){try{var o=a._init;return o(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(No=h,Yl):h}}var No=null;function zS(){if(No===null)throw Error(r(459));var a=No;return No=null,a}function US(a){if(a===Yl||a===Ph)throw Error(r(483))}var Gl=null,$c=0;function Fh(a){var o=$c;return $c+=1,Gl===null&&(Gl=[]),FS(Gl,a,o)}function Vc(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function zh(a,o){throw o.$$typeof===x?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function HS(a){function o(se,ee){if(a){var ue=se.deletions;ue===null?(se.deletions=[ee],se.flags|=16):ue.push(ee)}}function h(se,ee){if(!a)return null;for(;ee!==null;)o(se,ee),ee=ee.sibling;return null}function g(se){for(var ee=new Map;se!==null;)se.key!==null?ee.set(se.key,se):ee.set(se.index,se),se=se.sibling;return ee}function E(se,ee){return se=ka(se,ee),se.index=0,se.sibling=null,se}function S(se,ee,ue){return se.index=ue,a?(ue=se.alternate,ue!==null?(ue=ue.index,ue<ee?(se.flags|=67108866,ee):ue):(se.flags|=67108866,ee)):(se.flags|=1048576,ee)}function _(se){return a&&se.alternate===null&&(se.flags|=67108866),se}function F(se,ee,ue,xe){return ee===null||ee.tag!==6?(ee=Gg(ue,se.mode,xe),ee.return=se,ee):(ee=E(ee,ue),ee.return=se,ee)}function X(se,ee,ue,xe){var Ge=ue.type;return Ge===T?ge(se,ee,ue.props.children,xe,ue.key):ee!==null&&(ee.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===I&&Co(Ge)===ee.type)?(ee=E(ee,ue.props),Vc(ee,ue),ee.return=se,ee):(ee=Dh(ue.type,ue.key,ue.props,null,se.mode,xe),Vc(ee,ue),ee.return=se,ee)}function ce(se,ee,ue,xe){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ue.containerInfo||ee.stateNode.implementation!==ue.implementation?(ee=Kg(ue,se.mode,xe),ee.return=se,ee):(ee=E(ee,ue.children||[]),ee.return=se,ee)}function ge(se,ee,ue,xe,Ge){return ee===null||ee.tag!==7?(ee=vo(ue,se.mode,xe,Ge),ee.return=se,ee):(ee=E(ee,ue),ee.return=se,ee)}function be(se,ee,ue){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Gg(""+ee,se.mode,ue),ee.return=se,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ue=Dh(ee.type,ee.key,ee.props,null,se.mode,ue),Vc(ue,ee),ue.return=se,ue;case v:return ee=Kg(ee,se.mode,ue),ee.return=se,ee;case I:return ee=Co(ee),be(se,ee,ue)}if(J(ee)||Y(ee))return ee=vo(ee,se.mode,ue,null),ee.return=se,ee;if(typeof ee.then=="function")return be(se,Fh(ee),ue);if(ee.$$typeof===k)return be(se,Ih(se,ee),ue);zh(se,ee)}return null}function de(se,ee,ue,xe){var Ge=ee!==null?ee.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ge!==null?null:F(se,ee,""+ue,xe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===Ge?X(se,ee,ue,xe):null;case v:return ue.key===Ge?ce(se,ee,ue,xe):null;case I:return ue=Co(ue),de(se,ee,ue,xe)}if(J(ue)||Y(ue))return Ge!==null?null:ge(se,ee,ue,xe,null);if(typeof ue.then=="function")return de(se,ee,Fh(ue),xe);if(ue.$$typeof===k)return de(se,ee,Ih(se,ue),xe);zh(se,ue)}return null}function fe(se,ee,ue,xe,Ge){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return se=se.get(ue)||null,F(ee,se,""+xe,Ge);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case y:return se=se.get(xe.key===null?ue:xe.key)||null,X(ee,se,xe,Ge);case v:return se=se.get(xe.key===null?ue:xe.key)||null,ce(ee,se,xe,Ge);case I:return xe=Co(xe),fe(se,ee,ue,xe,Ge)}if(J(xe)||Y(xe))return se=se.get(ue)||null,ge(ee,se,xe,Ge,null);if(typeof xe.then=="function")return fe(se,ee,ue,Fh(xe),Ge);if(xe.$$typeof===k)return fe(se,ee,ue,Ih(ee,xe),Ge);zh(ee,xe)}return null}function Pe(se,ee,ue,xe){for(var Ge=null,Mt=null,Ue=ee,lt=ee=0,Ct=null;Ue!==null&<<ue.length;lt++){Ue.index>lt?(Ct=Ue,Ue=null):Ct=Ue.sibling;var It=de(se,Ue,ue[lt],xe);if(It===null){Ue===null&&(Ue=Ct);break}a&&Ue&&It.alternate===null&&o(se,Ue),ee=S(It,ee,lt),Mt===null?Ge=It:Mt.sibling=It,Mt=It,Ue=Ct}if(lt===ue.length)return h(se,Ue),kt&&_a(se,lt),Ge;if(Ue===null){for(;lt<ue.length;lt++)Ue=be(se,ue[lt],xe),Ue!==null&&(ee=S(Ue,ee,lt),Mt===null?Ge=Ue:Mt.sibling=Ue,Mt=Ue);return kt&&_a(se,lt),Ge}for(Ue=g(Ue);lt<ue.length;lt++)Ct=fe(Ue,se,lt,ue[lt],xe),Ct!==null&&(a&&Ct.alternate!==null&&Ue.delete(Ct.key===null?lt:Ct.key),ee=S(Ct,ee,lt),Mt===null?Ge=Ct:Mt.sibling=Ct,Mt=Ct);return a&&Ue.forEach(function(Oi){return o(se,Oi)}),kt&&_a(se,lt),Ge}function Xe(se,ee,ue,xe){if(ue==null)throw Error(r(151));for(var Ge=null,Mt=null,Ue=ee,lt=ee=0,Ct=null,It=ue.next();Ue!==null&&!It.done;lt++,It=ue.next()){Ue.index>lt?(Ct=Ue,Ue=null):Ct=Ue.sibling;var Oi=de(se,Ue,It.value,xe);if(Oi===null){Ue===null&&(Ue=Ct);break}a&&Ue&&Oi.alternate===null&&o(se,Ue),ee=S(Oi,ee,lt),Mt===null?Ge=Oi:Mt.sibling=Oi,Mt=Oi,Ue=Ct}if(It.done)return h(se,Ue),kt&&_a(se,lt),Ge;if(Ue===null){for(;!It.done;lt++,It=ue.next())It=be(se,It.value,xe),It!==null&&(ee=S(It,ee,lt),Mt===null?Ge=It:Mt.sibling=It,Mt=It);return kt&&_a(se,lt),Ge}for(Ue=g(Ue);!It.done;lt++,It=ue.next())It=fe(Ue,se,lt,It.value,xe),It!==null&&(a&&It.alternate!==null&&Ue.delete(It.key===null?lt:It.key),ee=S(It,ee,lt),Mt===null?Ge=It:Mt.sibling=It,Mt=It);return a&&Ue.forEach(function(WB){return o(se,WB)}),kt&&_a(se,lt),Ge}function Yt(se,ee,ue,xe){if(typeof ue=="object"&&ue!==null&&ue.type===T&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var Ge=ue.key;ee!==null;){if(ee.key===Ge){if(Ge=ue.type,Ge===T){if(ee.tag===7){h(se,ee.sibling),xe=E(ee,ue.props.children),xe.return=se,se=xe;break e}}else if(ee.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===I&&Co(Ge)===ee.type){h(se,ee.sibling),xe=E(ee,ue.props),Vc(xe,ue),xe.return=se,se=xe;break e}h(se,ee);break}else o(se,ee);ee=ee.sibling}ue.type===T?(xe=vo(ue.props.children,se.mode,xe,ue.key),xe.return=se,se=xe):(xe=Dh(ue.type,ue.key,ue.props,null,se.mode,xe),Vc(xe,ue),xe.return=se,se=xe)}return _(se);case v:e:{for(Ge=ue.key;ee!==null;){if(ee.key===Ge)if(ee.tag===4&&ee.stateNode.containerInfo===ue.containerInfo&&ee.stateNode.implementation===ue.implementation){h(se,ee.sibling),xe=E(ee,ue.children||[]),xe.return=se,se=xe;break e}else{h(se,ee);break}else o(se,ee);ee=ee.sibling}xe=Kg(ue,se.mode,xe),xe.return=se,se=xe}return _(se);case I:return ue=Co(ue),Yt(se,ee,ue,xe)}if(J(ue))return Pe(se,ee,ue,xe);if(Y(ue)){if(Ge=Y(ue),typeof Ge!="function")throw Error(r(150));return ue=Ge.call(ue),Xe(se,ee,ue,xe)}if(typeof ue.then=="function")return Yt(se,ee,Fh(ue),xe);if(ue.$$typeof===k)return Yt(se,ee,Ih(se,ue),xe);zh(se,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ee!==null&&ee.tag===6?(h(se,ee.sibling),xe=E(ee,ue),xe.return=se,se=xe):(h(se,ee),xe=Gg(ue,se.mode,xe),xe.return=se,se=xe),_(se)):h(se,ee)}return function(se,ee,ue,xe){try{$c=0;var Ge=Yt(se,ee,ue,xe);return Gl=null,Ge}catch(Ue){if(Ue===Yl||Ue===Ph)throw Ue;var Mt=qr(29,Ue,null,se.mode);return Mt.lanes=xe,Mt.return=se,Mt}finally{}}}var Ao=HS(!0),$S=HS(!1),mi=!1;function ix(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ox(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function pi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function gi(a,o,h){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Bt&2)!==0){var E=g.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),g.pending=o,o=Oh(a),NS(a,null,h),o}return Rh(a,g,o,h),Oh(a)}function qc(a,o,h){if(o=o.updateQueue,o!==null&&(o=o.shared,(h&4194048)!==0)){var g=o.lanes;g&=a.pendingLanes,h|=g,o.lanes=h,rr(a,h)}}function lx(a,o){var h=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var E=null,S=null;if(h=h.firstBaseUpdate,h!==null){do{var _={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};S===null?E=S=_:S=S.next=_,h=h.next}while(h!==null);S===null?E=S=o:S=S.next=o}else E=S=o;h={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:S,shared:g.shared,callbacks:g.callbacks},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=o:a.next=o,h.lastBaseUpdate=o}var ux=!1;function Yc(){if(ux){var a=ql;if(a!==null)throw a}}function Gc(a,o,h,g){ux=!1;var E=a.updateQueue;mi=!1;var S=E.firstBaseUpdate,_=E.lastBaseUpdate,F=E.shared.pending;if(F!==null){E.shared.pending=null;var X=F,ce=X.next;X.next=null,_===null?S=ce:_.next=ce,_=X;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,F=ge.lastBaseUpdate,F!==_&&(F===null?ge.firstBaseUpdate=ce:F.next=ce,ge.lastBaseUpdate=X))}if(S!==null){var be=E.baseState;_=0,ge=ce=X=null,F=S;do{var de=F.lane&-536870913,fe=de!==F.lane;if(fe?(wt&de)===de:(g&de)===de){de!==0&&de===Vl&&(ux=!0),ge!==null&&(ge=ge.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var Pe=a,Xe=F;de=o;var Yt=h;switch(Xe.tag){case 1:if(Pe=Xe.payload,typeof Pe=="function"){be=Pe.call(Yt,be,de);break e}be=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=Xe.payload,de=typeof Pe=="function"?Pe.call(Yt,be,de):Pe,de==null)break e;be=m({},be,de);break e;case 2:mi=!0}}de=F.callback,de!==null&&(a.flags|=64,fe&&(a.flags|=8192),fe=E.callbacks,fe===null?E.callbacks=[de]:fe.push(de))}else fe={lane:de,tag:F.tag,payload:F.payload,callback:F.callback,next:null},ge===null?(ce=ge=fe,X=be):ge=ge.next=fe,_|=de;if(F=F.next,F===null){if(F=E.shared.pending,F===null)break;fe=F,F=fe.next,fe.next=null,E.lastBaseUpdate=fe,E.shared.pending=null}}while(!0);ge===null&&(X=be),E.baseState=X,E.firstBaseUpdate=ce,E.lastBaseUpdate=ge,S===null&&(E.shared.lanes=0),Ei|=_,a.lanes=_,a.memoizedState=be}}function VS(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function qS(a,o){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)VS(h[a],o)}var Kl=q(null),Uh=q(0);function YS(a,o){a=za,j(Uh,a),j(Kl,o),za=a|o.baseLanes}function cx(){j(Uh,za),j(Kl,Kl.current)}function dx(){za=Uh.current,V(Kl),V(Uh)}var Yr=q(null),ds=null;function xi(a){var o=a.alternate;j(_n,_n.current&1),j(Yr,a),ds===null&&(o===null||Kl.current!==null||o.memoizedState!==null)&&(ds=a)}function fx(a){j(_n,_n.current),j(Yr,a),ds===null&&(ds=a)}function GS(a){a.tag===22?(j(_n,_n.current),j(Yr,a),ds===null&&(ds=a)):yi()}function yi(){j(_n,_n.current),j(Yr,Yr.current)}function Gr(a){V(Yr),ds===a&&(ds=null),V(_n)}var _n=q(0);function Hh(a){for(var o=a;o!==null;){if(o.tag===13){var h=o.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||y1(h)||b1(h)))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===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Da=0,at=null,Vt=null,Mn=null,$h=!1,Ql=!1,ko=!1,Vh=0,Kc=0,Xl=null,U9=0;function En(){throw Error(r(321))}function hx(a,o){if(o===null)return!1;for(var h=0;h<o.length&&h<a.length;h++)if(!Vr(a[h],o[h]))return!1;return!0}function mx(a,o,h,g,E,S){return Da=S,at=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,L.H=a===null||a.memoizedState===null?Rw:_x,ko=!1,S=h(g,E),ko=!1,Ql&&(S=QS(o,h,g,E)),KS(a),S}function KS(a){L.H=Wc;var o=Vt!==null&&Vt.next!==null;if(Da=0,Mn=Vt=at=null,$h=!1,Kc=0,Xl=null,o)throw Error(r(300));a===null||In||(a=a.dependencies,a!==null&&Mh(a)&&(In=!0))}function QS(a,o,h,g){at=a;var E=0;do{if(Ql&&(Xl=null),Kc=0,Ql=!1,25<=E)throw Error(r(301));if(E+=1,Mn=Vt=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}L.H=Ow,S=o(h,g)}while(Ql);return S}function H9(){var a=L.H,o=a.useState()[0];return o=typeof o.then=="function"?Qc(o):o,a=a.useState()[0],(Vt!==null?Vt.memoizedState:null)!==a&&(at.flags|=1024),o}function px(){var a=Vh!==0;return Vh=0,a}function gx(a,o,h){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~h}function xx(a){if($h){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}$h=!1}Da=0,Mn=Vt=at=null,Ql=!1,Kc=Vh=0,Xl=null}function br(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?at.memoizedState=Mn=a:Mn=Mn.next=a,Mn}function Rn(){if(Vt===null){var a=at.alternate;a=a!==null?a.memoizedState:null}else a=Vt.next;var o=Mn===null?at.memoizedState:Mn.next;if(o!==null)Mn=o,Vt=a;else{if(a===null)throw at.alternate===null?Error(r(467)):Error(r(310));Vt=a,a={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Mn===null?at.memoizedState=Mn=a:Mn=Mn.next=a}return Mn}function qh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qc(a){var o=Kc;return Kc+=1,Xl===null&&(Xl=[]),a=FS(Xl,a,o),o=at,(Mn===null?o.memoizedState:Mn.next)===null&&(o=o.alternate,L.H=o===null||o.memoizedState===null?Rw:_x),a}function Yh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Qc(a);if(a.$$typeof===k)return ir(a)}throw Error(r(438,String(a)))}function yx(a){var o=null,h=at.updateQueue;if(h!==null&&(o=h.memoCache),o==null){var g=at.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(E){return E.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),h===null&&(h=qh(),at.updateQueue=h),h.memoCache=o,h=o.data[o.index],h===void 0)for(h=o.data[o.index]=Array(a),g=0;g<a;g++)h[g]=P;return o.index++,h}function ja(a,o){return typeof o=="function"?o(a):o}function Gh(a){var o=Rn();return bx(o,Vt,a)}function bx(a,o,h){var g=a.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var E=a.baseQueue,S=g.pending;if(S!==null){if(E!==null){var _=E.next;E.next=S.next,S.next=_}o.baseQueue=E=S,g.pending=null}if(S=a.baseState,E===null)a.memoizedState=S;else{o=E.next;var F=_=null,X=null,ce=o,ge=!1;do{var be=ce.lane&-536870913;if(be!==ce.lane?(wt&be)===be:(Da&be)===be){var de=ce.revertLane;if(de===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),be===Vl&&(ge=!0);else if((Da&de)===de){ce=ce.next,de===Vl&&(ge=!0);continue}else be={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},X===null?(F=X=be,_=S):X=X.next=be,at.lanes|=de,Ei|=de;be=ce.action,ko&&h(S,be),S=ce.hasEagerState?ce.eagerState:h(S,be)}else de={lane:be,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},X===null?(F=X=de,_=S):X=X.next=de,at.lanes|=be,Ei|=be;ce=ce.next}while(ce!==null&&ce!==o);if(X===null?_=S:X.next=F,!Vr(S,a.memoizedState)&&(In=!0,ge&&(h=ql,h!==null)))throw h;a.memoizedState=S,a.baseState=_,a.baseQueue=X,g.lastRenderedState=S}return E===null&&(g.lanes=0),[a.memoizedState,g.dispatch]}function vx(a){var o=Rn(),h=o.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=a;var g=h.dispatch,E=h.pending,S=o.memoizedState;if(E!==null){h.pending=null;var _=E=E.next;do S=a(S,_.action),_=_.next;while(_!==E);Vr(S,o.memoizedState)||(In=!0),o.memoizedState=S,o.baseQueue===null&&(o.baseState=S),h.lastRenderedState=S}return[S,g]}function XS(a,o,h){var g=at,E=Rn(),S=kt;if(S){if(h===void 0)throw Error(r(407));h=h()}else h=o();var _=!Vr((Vt||E).memoizedState,h);if(_&&(E.memoizedState=h,In=!0),E=E.queue,Sx(JS.bind(null,g,E,a),[a]),E.getSnapshot!==o||_||Mn!==null&&Mn.memoizedState.tag&1){if(g.flags|=2048,Wl(9,{destroy:void 0},ZS.bind(null,g,E,h,o),null),Zt===null)throw Error(r(349));S||(Da&127)!==0||WS(g,o,h)}return h}function WS(a,o,h){a.flags|=16384,a={getSnapshot:o,value:h},o=at.updateQueue,o===null?(o=qh(),at.updateQueue=o,o.stores=[a]):(h=o.stores,h===null?o.stores=[a]:h.push(a))}function ZS(a,o,h,g){o.value=h,o.getSnapshot=g,ew(o)&&tw(a)}function JS(a,o,h){return h(function(){ew(o)&&tw(a)})}function ew(a){var o=a.getSnapshot;a=a.value;try{var h=o();return!Vr(a,h)}catch{return!0}}function tw(a){var o=bo(a,2);o!==null&&Pr(o,a,2)}function Ex(a){var o=br();if(typeof a=="function"){var h=a;if(a=h(),ko){kn(!0);try{h()}finally{kn(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:a},o}function nw(a,o,h,g){return a.baseState=h,bx(a,Vt,typeof g=="function"?g:ja)}function $9(a,o,h,g,E){if(Xh(a))throw Error(r(485));if(a=o.action,a!==null){var S={payload:E,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){S.listeners.push(_)}};L.T!==null?h(!0):S.isTransition=!1,g(S),h=o.pending,h===null?(S.next=o.pending=S,rw(o,S)):(S.next=h.next,o.pending=h.next=S)}}function rw(a,o){var h=o.action,g=o.payload,E=a.state;if(o.isTransition){var S=L.T,_={};L.T=_;try{var F=h(E,g),X=L.S;X!==null&&X(_,F),sw(a,o,F)}catch(ce){Tx(a,o,ce)}finally{S!==null&&_.types!==null&&(S.types=_.types),L.T=S}}else try{S=h(E,g),sw(a,o,S)}catch(ce){Tx(a,o,ce)}}function sw(a,o,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){aw(a,o,g)},function(g){return Tx(a,o,g)}):aw(a,o,h)}function aw(a,o,h){o.status="fulfilled",o.value=h,iw(o),a.state=h,o=a.pending,o!==null&&(h=o.next,h===o?a.pending=null:(h=h.next,o.next=h,rw(a,h)))}function Tx(a,o,h){var g=a.pending;if(a.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=h,iw(o),o=o.next;while(o!==g)}a.action=null}function iw(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function ow(a,o){return o}function lw(a,o){if(kt){var h=Zt.formState;if(h!==null){e:{var g=at;if(kt){if(on){t:{for(var E=on,S=cs;E.nodeType!==8;){if(!S){E=null;break t}if(E=fs(E.nextSibling),E===null){E=null;break t}}S=E.data,E=S==="F!"||S==="F"?E:null}if(E){on=fs(E.nextSibling),g=E.data==="F!";break e}}fi(g)}g=!1}g&&(o=h[0])}}return h=br(),h.memoizedState=h.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ow,lastRenderedState:o},h.queue=g,h=Aw.bind(null,at,g),g.dispatch=h,g=Ex(!1),S=kx.bind(null,at,!1,g.queue),g=br(),E={state:o,dispatch:null,action:a,pending:null},g.queue=E,h=$9.bind(null,at,E,S,h),E.dispatch=h,g.memoizedState=a,[o,h,!1]}function uw(a){var o=Rn();return cw(o,Vt,a)}function cw(a,o,h){if(o=bx(a,o,ow)[0],a=Gh(ja)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=Qc(o)}catch(_){throw _===Yl?Ph:_}else g=o;o=Rn();var E=o.queue,S=E.dispatch;return h!==o.memoizedState&&(at.flags|=2048,Wl(9,{destroy:void 0},V9.bind(null,E,h),null)),[g,S,a]}function V9(a,o){a.action=o}function dw(a){var o=Rn(),h=Vt;if(h!==null)return cw(o,h,a);Rn(),o=o.memoizedState,h=Rn();var g=h.queue.dispatch;return h.memoizedState=a,[o,g,!1]}function Wl(a,o,h,g){return a={tag:a,create:h,deps:g,inst:o,next:null},o=at.updateQueue,o===null&&(o=qh(),at.updateQueue=o),h=o.lastEffect,h===null?o.lastEffect=a.next=a:(g=h.next,h.next=a,a.next=g,o.lastEffect=a),a}function fw(){return Rn().memoizedState}function Kh(a,o,h,g){var E=br();at.flags|=a,E.memoizedState=Wl(1|o,{destroy:void 0},h,g===void 0?null:g)}function Qh(a,o,h,g){var E=Rn();g=g===void 0?null:g;var S=E.memoizedState.inst;Vt!==null&&g!==null&&hx(g,Vt.memoizedState.deps)?E.memoizedState=Wl(o,S,h,g):(at.flags|=a,E.memoizedState=Wl(1|o,S,h,g))}function hw(a,o){Kh(8390656,8,a,o)}function Sx(a,o){Qh(2048,8,a,o)}function q9(a){at.flags|=4;var o=at.updateQueue;if(o===null)o=qh(),at.updateQueue=o,o.events=[a];else{var h=o.events;h===null?o.events=[a]:h.push(a)}}function mw(a){var o=Rn().memoizedState;return q9({ref:o,nextImpl:a}),function(){if((Bt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function pw(a,o){return Qh(4,2,a,o)}function gw(a,o){return Qh(4,4,a,o)}function xw(a,o){if(typeof o=="function"){a=a();var h=o(a);return function(){typeof h=="function"?h():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function yw(a,o,h){h=h!=null?h.concat([a]):null,Qh(4,4,xw.bind(null,o,a),h)}function wx(){}function bw(a,o){var h=Rn();o=o===void 0?null:o;var g=h.memoizedState;return o!==null&&hx(o,g[1])?g[0]:(h.memoizedState=[a,o],a)}function vw(a,o){var h=Rn();o=o===void 0?null:o;var g=h.memoizedState;if(o!==null&&hx(o,g[1]))return g[0];if(g=a(),ko){kn(!0);try{a()}finally{kn(!1)}}return h.memoizedState=[g,o],g}function Cx(a,o,h){return h===void 0||(Da&1073741824)!==0&&(wt&261930)===0?a.memoizedState=o:(a.memoizedState=h,a=EC(),at.lanes|=a,Ei|=a,h)}function Ew(a,o,h,g){return Vr(h,o)?h:Kl.current!==null?(a=Cx(a,h,g),Vr(a,o)||(In=!0),a):(Da&42)===0||(Da&1073741824)!==0&&(wt&261930)===0?(In=!0,a.memoizedState=h):(a=EC(),at.lanes|=a,Ei|=a,o)}function Tw(a,o,h,g,E){var S=B.p;B.p=S!==0&&8>S?S:8;var _=L.T,F={};L.T=F,kx(a,!1,o,h);try{var X=E(),ce=L.S;if(ce!==null&&ce(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ge=z9(X,g);Xc(a,o,ge,Xr(a))}else Xc(a,o,g,Xr(a))}catch(be){Xc(a,o,{then:function(){},status:"rejected",reason:be},Xr())}finally{B.p=S,_!==null&&F.types!==null&&(_.types=F.types),L.T=_}}function Y9(){}function Nx(a,o,h,g){if(a.tag!==5)throw Error(r(476));var E=Sw(a).queue;Tw(a,E,o,U,h===null?Y9:function(){return ww(a),h(g)})}function Sw(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:U},next:null};var h={};return o.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:h},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function ww(a){var o=Sw(a);o.next===null&&(o=a.alternate.memoizedState),Xc(a,o.next.queue,{},Xr())}function Ax(){return ir(hd)}function Cw(){return Rn().memoizedState}function Nw(){return Rn().memoizedState}function G9(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var h=Xr();a=pi(h);var g=gi(o,a,h);g!==null&&(Pr(g,o,h),qc(g,o,h)),o={cache:nx()},a.payload=o;return}o=o.return}}function K9(a,o,h){var g=Xr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Xh(a)?kw(o,h):(h=qg(a,o,h,g),h!==null&&(Pr(h,a,g),_w(h,o,g)))}function Aw(a,o,h){var g=Xr();Xc(a,o,h,g)}function Xc(a,o,h,g){var E={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Xh(a))kw(o,E);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=o.lastRenderedReducer,S!==null))try{var _=o.lastRenderedState,F=S(_,h);if(E.hasEagerState=!0,E.eagerState=F,Vr(F,_))return Rh(a,o,E,0),Zt===null&&_h(),!1}catch{}finally{}if(h=qg(a,o,E,g),h!==null)return Pr(h,a,g),_w(h,o,g),!0}return!1}function kx(a,o,h,g){if(g={lane:2,revertLane:i1(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Xh(a)){if(o)throw Error(r(479))}else o=qg(a,h,g,2),o!==null&&Pr(o,a,2)}function Xh(a){var o=a.alternate;return a===at||o!==null&&o===at}function kw(a,o){Ql=$h=!0;var h=a.pending;h===null?o.next=o:(o.next=h.next,h.next=o),a.pending=o}function _w(a,o,h){if((h&4194048)!==0){var g=o.lanes;g&=a.pendingLanes,h|=g,o.lanes=h,rr(a,h)}}var Wc={readContext:ir,use:Yh,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useLayoutEffect:En,useInsertionEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useSyncExternalStore:En,useId:En,useHostTransitionStatus:En,useFormState:En,useActionState:En,useOptimistic:En,useMemoCache:En,useCacheRefresh:En};Wc.useEffectEvent=En;var Rw={readContext:ir,use:Yh,useCallback:function(a,o){return br().memoizedState=[a,o===void 0?null:o],a},useContext:ir,useEffect:hw,useImperativeHandle:function(a,o,h){h=h!=null?h.concat([a]):null,Kh(4194308,4,xw.bind(null,o,a),h)},useLayoutEffect:function(a,o){return Kh(4194308,4,a,o)},useInsertionEffect:function(a,o){Kh(4,2,a,o)},useMemo:function(a,o){var h=br();o=o===void 0?null:o;var g=a();if(ko){kn(!0);try{a()}finally{kn(!1)}}return h.memoizedState=[g,o],g},useReducer:function(a,o,h){var g=br();if(h!==void 0){var E=h(o);if(ko){kn(!0);try{h(o)}finally{kn(!1)}}}else E=o;return g.memoizedState=g.baseState=E,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:E},g.queue=a,a=a.dispatch=K9.bind(null,at,a),[g.memoizedState,a]},useRef:function(a){var o=br();return a={current:a},o.memoizedState=a},useState:function(a){a=Ex(a);var o=a.queue,h=Aw.bind(null,at,o);return o.dispatch=h,[a.memoizedState,h]},useDebugValue:wx,useDeferredValue:function(a,o){var h=br();return Cx(h,a,o)},useTransition:function(){var a=Ex(!1);return a=Tw.bind(null,at,a.queue,!0,!1),br().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,h){var g=at,E=br();if(kt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=o(),Zt===null)throw Error(r(349));(wt&127)!==0||WS(g,o,h)}E.memoizedState=h;var S={value:h,getSnapshot:o};return E.queue=S,hw(JS.bind(null,g,S,a),[a]),g.flags|=2048,Wl(9,{destroy:void 0},ZS.bind(null,g,S,h,o),null),h},useId:function(){var a=br(),o=Zt.identifierPrefix;if(kt){var h=Qs,g=Ks;h=(g&~(1<<32-Ot(g)-1)).toString(32)+h,o="_"+o+"R_"+h,h=Vh++,0<h&&(o+="H"+h.toString(32)),o+="_"}else h=U9++,o="_"+o+"r_"+h.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Ax,useFormState:lw,useActionState:lw,useOptimistic:function(a){var o=br();o.memoizedState=o.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=h,o=kx.bind(null,at,!0,h),h.dispatch=o,[a,o]},useMemoCache:yx,useCacheRefresh:function(){return br().memoizedState=G9.bind(null,at)},useEffectEvent:function(a){var o=br(),h={impl:a};return o.memoizedState=h,function(){if((Bt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},_x={readContext:ir,use:Yh,useCallback:bw,useContext:ir,useEffect:Sx,useImperativeHandle:yw,useInsertionEffect:pw,useLayoutEffect:gw,useMemo:vw,useReducer:Gh,useRef:fw,useState:function(){return Gh(ja)},useDebugValue:wx,useDeferredValue:function(a,o){var h=Rn();return Ew(h,Vt.memoizedState,a,o)},useTransition:function(){var a=Gh(ja)[0],o=Rn().memoizedState;return[typeof a=="boolean"?a:Qc(a),o]},useSyncExternalStore:XS,useId:Cw,useHostTransitionStatus:Ax,useFormState:uw,useActionState:uw,useOptimistic:function(a,o){var h=Rn();return nw(h,Vt,a,o)},useMemoCache:yx,useCacheRefresh:Nw};_x.useEffectEvent=mw;var Ow={readContext:ir,use:Yh,useCallback:bw,useContext:ir,useEffect:Sx,useImperativeHandle:yw,useInsertionEffect:pw,useLayoutEffect:gw,useMemo:vw,useReducer:vx,useRef:fw,useState:function(){return vx(ja)},useDebugValue:wx,useDeferredValue:function(a,o){var h=Rn();return Vt===null?Cx(h,a,o):Ew(h,Vt.memoizedState,a,o)},useTransition:function(){var a=vx(ja)[0],o=Rn().memoizedState;return[typeof a=="boolean"?a:Qc(a),o]},useSyncExternalStore:XS,useId:Cw,useHostTransitionStatus:Ax,useFormState:dw,useActionState:dw,useOptimistic:function(a,o){var h=Rn();return Vt!==null?nw(h,Vt,a,o):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:yx,useCacheRefresh:Nw};Ow.useEffectEvent=mw;function Rx(a,o,h,g){o=a.memoizedState,h=h(g,o),h=h==null?o:m({},o,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Ox={enqueueSetState:function(a,o,h){a=a._reactInternals;var g=Xr(),E=pi(g);E.payload=o,h!=null&&(E.callback=h),o=gi(a,E,g),o!==null&&(Pr(o,a,g),qc(o,a,g))},enqueueReplaceState:function(a,o,h){a=a._reactInternals;var g=Xr(),E=pi(g);E.tag=1,E.payload=o,h!=null&&(E.callback=h),o=gi(a,E,g),o!==null&&(Pr(o,a,g),qc(o,a,g))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var h=Xr(),g=pi(h);g.tag=2,o!=null&&(g.callback=o),o=gi(a,g,h),o!==null&&(Pr(o,a,h),qc(o,a,h))}};function Dw(a,o,h,g,E,S,_){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,S,_):o.prototype&&o.prototype.isPureReactComponent?!Pc(h,g)||!Pc(E,S):!0}function jw(a,o,h,g){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(h,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(h,g),o.state!==a&&Ox.enqueueReplaceState(o,o.state,null)}function _o(a,o){var h=o;if("ref"in o){h={};for(var g in o)g!=="ref"&&(h[g]=o[g])}if(a=a.defaultProps){h===o&&(h=m({},h));for(var E in a)h[E]===void 0&&(h[E]=a[E])}return h}function Mw(a){kh(a)}function Iw(a){console.error(a)}function Lw(a){kh(a)}function Wh(a,o){try{var h=a.onUncaughtError;h(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function Pw(a,o,h){try{var g=a.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Dx(a,o,h){return h=pi(h),h.tag=3,h.payload={element:null},h.callback=function(){Wh(a,o)},h}function Bw(a){return a=pi(a),a.tag=3,a}function Fw(a,o,h,g){var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var S=g.value;a.payload=function(){return E(S)},a.callback=function(){Pw(o,h,g)}}var _=h.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(a.callback=function(){Pw(o,h,g),typeof E!="function"&&(Ti===null?Ti=new Set([this]):Ti.add(this));var F=g.stack;this.componentDidCatch(g.value,{componentStack:F!==null?F:""})})}function Q9(a,o,h,g,E){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=h.alternate,o!==null&&$l(o,h,E,!0),h=Yr.current,h!==null){switch(h.tag){case 31:case 13:return ds===null?um():h.alternate===null&&Tn===0&&(Tn=3),h.flags&=-257,h.flags|=65536,h.lanes=E,g===Bh?h.flags|=16384:(o=h.updateQueue,o===null?h.updateQueue=new Set([g]):o.add(g),r1(a,g,E)),!1;case 22:return h.flags|=65536,g===Bh?h.flags|=16384:(o=h.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=o):(h=o.retryQueue,h===null?o.retryQueue=new Set([g]):h.add(g)),r1(a,g,E)),!1}throw Error(r(435,h.tag))}return r1(a,g,E),um(),!1}if(kt)return o=Yr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=E,g!==Wg&&(a=Error(r(422),{cause:g}),zc(os(a,h)))):(g!==Wg&&(o=Error(r(423),{cause:g}),zc(os(o,h))),a=a.current.alternate,a.flags|=65536,E&=-E,a.lanes|=E,g=os(g,h),E=Dx(a.stateNode,g,E),lx(a,E),Tn!==4&&(Tn=2)),!1;var S=Error(r(520),{cause:g});if(S=os(S,h),ad===null?ad=[S]:ad.push(S),Tn!==4&&(Tn=2),o===null)return!0;g=os(g,h),h=o;do{switch(h.tag){case 3:return h.flags|=65536,a=E&-E,h.lanes|=a,a=Dx(h.stateNode,g,a),lx(h,a),!1;case 1:if(o=h.type,S=h.stateNode,(h.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ti===null||!Ti.has(S))))return h.flags|=65536,E&=-E,h.lanes|=E,E=Bw(E),Fw(E,a,h,g),lx(h,E),!1}h=h.return}while(h!==null);return!1}var jx=Error(r(461)),In=!1;function or(a,o,h,g){o.child=a===null?$S(o,null,h,g):Ao(o,a.child,h,g)}function zw(a,o,h,g,E){h=h.render;var S=o.ref;if("ref"in g){var _={};for(var F in g)F!=="ref"&&(_[F]=g[F])}else _=g;return So(o),g=mx(a,o,h,_,S,E),F=px(),a!==null&&!In?(gx(a,o,E),Ma(a,o,E)):(kt&&F&&Qg(o),o.flags|=1,or(a,o,g,E),o.child)}function Uw(a,o,h,g,E){if(a===null){var S=h.type;return typeof S=="function"&&!Yg(S)&&S.defaultProps===void 0&&h.compare===null?(o.tag=15,o.type=S,Hw(a,o,S,g,E)):(a=Dh(h.type,null,g,o,o.mode,E),a.ref=o.ref,a.return=o,o.child=a)}if(S=a.child,!Ux(a,E)){var _=S.memoizedProps;if(h=h.compare,h=h!==null?h:Pc,h(_,g)&&a.ref===o.ref)return Ma(a,o,E)}return o.flags|=1,a=ka(S,g),a.ref=o.ref,a.return=o,o.child=a}function Hw(a,o,h,g,E){if(a!==null){var S=a.memoizedProps;if(Pc(S,g)&&a.ref===o.ref)if(In=!1,o.pendingProps=g=S,Ux(a,E))(a.flags&131072)!==0&&(In=!0);else return o.lanes=a.lanes,Ma(a,o,E)}return Mx(a,o,h,g,E)}function $w(a,o,h,g){var E=g.children,S=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(S=S!==null?S.baseLanes|h:h,a!==null){for(g=o.child=a.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~S}else g=0,o.child=null;return Vw(a,o,S,h,g)}if((h&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&Lh(o,S!==null?S.cachePool:null),S!==null?YS(o,S):cx(),GS(o);else return g=o.lanes=536870912,Vw(a,o,S!==null?S.baseLanes|h:h,h,g)}else S!==null?(Lh(o,S.cachePool),YS(o,S),yi(),o.memoizedState=null):(a!==null&&Lh(o,null),cx(),yi());return or(a,o,E,h),o.child}function Zc(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Vw(a,o,h,g,E){var S=sx();return S=S===null?null:{parent:jn._currentValue,pool:S},o.memoizedState={baseLanes:h,cachePool:S},a!==null&&Lh(o,null),cx(),GS(o),a!==null&&$l(a,o,g,!0),o.childLanes=E,null}function Zh(a,o){return o=em({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function qw(a,o,h){return Ao(o,a.child,null,h),a=Zh(o,o.pendingProps),a.flags|=2,Gr(o),o.memoizedState=null,a}function X9(a,o,h){var g=o.pendingProps,E=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(kt){if(g.mode==="hidden")return a=Zh(o,g),o.lanes=536870912,Zc(null,a);if(fx(o),(a=on)?(a=rN(a,cs),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ci!==null?{id:Ks,overflow:Qs}:null,retryLane:536870912,hydrationErrors:null},h=kS(a),h.return=o,o.child=h,ar=o,on=null)):a=null,a===null)throw fi(o);return o.lanes=536870912,null}return Zh(o,g)}var S=a.memoizedState;if(S!==null){var _=S.dehydrated;if(fx(o),E)if(o.flags&256)o.flags&=-257,o=qw(a,o,h);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(In||$l(a,o,h,!1),E=(h&a.childLanes)!==0,In||E){if(g=Zt,g!==null&&(_=Rr(g,h),_!==0&&_!==S.retryLane))throw S.retryLane=_,bo(a,_),Pr(g,a,_),jx;um(),o=qw(a,o,h)}else a=S.treeContext,on=fs(_.nextSibling),ar=o,kt=!0,di=null,cs=!1,a!==null&&OS(o,a),o=Zh(o,g),o.flags|=4096;return o}return a=ka(a.child,{mode:g.mode,children:g.children}),a.ref=o.ref,o.child=a,a.return=o,a}function Jh(a,o){var h=o.ref;if(h===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(a===null||a.ref!==h)&&(o.flags|=4194816)}}function Mx(a,o,h,g,E){return So(o),h=mx(a,o,h,g,void 0,E),g=px(),a!==null&&!In?(gx(a,o,E),Ma(a,o,E)):(kt&&g&&Qg(o),o.flags|=1,or(a,o,h,E),o.child)}function Yw(a,o,h,g,E,S){return So(o),o.updateQueue=null,h=QS(o,g,h,E),KS(a),g=px(),a!==null&&!In?(gx(a,o,S),Ma(a,o,S)):(kt&&g&&Qg(o),o.flags|=1,or(a,o,h,S),o.child)}function Gw(a,o,h,g,E){if(So(o),o.stateNode===null){var S=Fl,_=h.contextType;typeof _=="object"&&_!==null&&(S=ir(_)),S=new h(g,S),o.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Ox,o.stateNode=S,S._reactInternals=o,S=o.stateNode,S.props=g,S.state=o.memoizedState,S.refs={},ix(o),_=h.contextType,S.context=typeof _=="object"&&_!==null?ir(_):Fl,S.state=o.memoizedState,_=h.getDerivedStateFromProps,typeof _=="function"&&(Rx(o,h,_,g),S.state=o.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(_=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),_!==S.state&&Ox.enqueueReplaceState(S,S.state,null),Gc(o,g,S,E),Yc(),S.state=o.memoizedState),typeof S.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(a===null){S=o.stateNode;var F=o.memoizedProps,X=_o(h,F);S.props=X;var ce=S.context,ge=h.contextType;_=Fl,typeof ge=="object"&&ge!==null&&(_=ir(ge));var be=h.getDerivedStateFromProps;ge=typeof be=="function"||typeof S.getSnapshotBeforeUpdate=="function",F=o.pendingProps!==F,ge||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(F||ce!==_)&&jw(o,S,g,_),mi=!1;var de=o.memoizedState;S.state=de,Gc(o,g,S,E),Yc(),ce=o.memoizedState,F||de!==ce||mi?(typeof be=="function"&&(Rx(o,h,be,g),ce=o.memoizedState),(X=mi||Dw(o,h,X,g,de,ce,_))?(ge||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(o.flags|=4194308)):(typeof S.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=ce),S.props=g,S.state=ce,S.context=_,g=X):(typeof S.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{S=o.stateNode,ox(a,o),_=o.memoizedProps,ge=_o(h,_),S.props=ge,be=o.pendingProps,de=S.context,ce=h.contextType,X=Fl,typeof ce=="object"&&ce!==null&&(X=ir(ce)),F=h.getDerivedStateFromProps,(ce=typeof F=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_!==be||de!==X)&&jw(o,S,g,X),mi=!1,de=o.memoizedState,S.state=de,Gc(o,g,S,E),Yc();var fe=o.memoizedState;_!==be||de!==fe||mi||a!==null&&a.dependencies!==null&&Mh(a.dependencies)?(typeof F=="function"&&(Rx(o,h,F,g),fe=o.memoizedState),(ge=mi||Dw(o,h,ge,g,de,fe,X)||a!==null&&a.dependencies!==null&&Mh(a.dependencies))?(ce||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(g,fe,X),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(g,fe,X)),typeof S.componentDidUpdate=="function"&&(o.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof S.componentDidUpdate!="function"||_===a.memoizedProps&&de===a.memoizedState||(o.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&de===a.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=fe),S.props=g,S.state=fe,S.context=X,g=ge):(typeof S.componentDidUpdate!="function"||_===a.memoizedProps&&de===a.memoizedState||(o.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&de===a.memoizedState||(o.flags|=1024),g=!1)}return S=g,Jh(a,o),g=(o.flags&128)!==0,S||g?(S=o.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:S.render(),o.flags|=1,a!==null&&g?(o.child=Ao(o,a.child,null,E),o.child=Ao(o,null,h,E)):or(a,o,h,E),o.memoizedState=S.state,a=o.child):a=Ma(a,o,E),a}function Kw(a,o,h,g){return Eo(),o.flags|=256,or(a,o,h,g),o.child}var Ix={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lx(a){return{baseLanes:a,cachePool:PS()}}function Px(a,o,h){return a=a!==null?a.childLanes&~h:0,o&&(a|=Qr),a}function Qw(a,o,h){var g=o.pendingProps,E=!1,S=(o.flags&128)!==0,_;if((_=S)||(_=a!==null&&a.memoizedState===null?!1:(_n.current&2)!==0),_&&(E=!0,o.flags&=-129),_=(o.flags&32)!==0,o.flags&=-33,a===null){if(kt){if(E?xi(o):yi(),(a=on)?(a=rN(a,cs),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ci!==null?{id:Ks,overflow:Qs}:null,retryLane:536870912,hydrationErrors:null},h=kS(a),h.return=o,o.child=h,ar=o,on=null)):a=null,a===null)throw fi(o);return b1(a)?o.lanes=32:o.lanes=536870912,null}var F=g.children;return g=g.fallback,E?(yi(),E=o.mode,F=em({mode:"hidden",children:F},E),g=vo(g,E,h,null),F.return=o,g.return=o,F.sibling=g,o.child=F,g=o.child,g.memoizedState=Lx(h),g.childLanes=Px(a,_,h),o.memoizedState=Ix,Zc(null,g)):(xi(o),Bx(o,F))}var X=a.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(S)o.flags&256?(xi(o),o.flags&=-257,o=Fx(a,o,h)):o.memoizedState!==null?(yi(),o.child=a.child,o.flags|=128,o=null):(yi(),F=g.fallback,E=o.mode,g=em({mode:"visible",children:g.children},E),F=vo(F,E,h,null),F.flags|=2,g.return=o,F.return=o,g.sibling=F,o.child=g,Ao(o,a.child,null,h),g=o.child,g.memoizedState=Lx(h),g.childLanes=Px(a,_,h),o.memoizedState=Ix,o=Zc(null,g));else if(xi(o),b1(F)){if(_=F.nextSibling&&F.nextSibling.dataset,_)var ce=_.dgst;_=ce,g=Error(r(419)),g.stack="",g.digest=_,zc({value:g,source:null,stack:null}),o=Fx(a,o,h)}else if(In||$l(a,o,h,!1),_=(h&a.childLanes)!==0,In||_){if(_=Zt,_!==null&&(g=Rr(_,h),g!==0&&g!==X.retryLane))throw X.retryLane=g,bo(a,g),Pr(_,a,g),jx;y1(F)||um(),o=Fx(a,o,h)}else y1(F)?(o.flags|=192,o.child=a.child,o=null):(a=X.treeContext,on=fs(F.nextSibling),ar=o,kt=!0,di=null,cs=!1,a!==null&&OS(o,a),o=Bx(o,g.children),o.flags|=4096);return o}return E?(yi(),F=g.fallback,E=o.mode,X=a.child,ce=X.sibling,g=ka(X,{mode:"hidden",children:g.children}),g.subtreeFlags=X.subtreeFlags&65011712,ce!==null?F=ka(ce,F):(F=vo(F,E,h,null),F.flags|=2),F.return=o,g.return=o,g.sibling=F,o.child=g,Zc(null,g),g=o.child,F=a.child.memoizedState,F===null?F=Lx(h):(E=F.cachePool,E!==null?(X=jn._currentValue,E=E.parent!==X?{parent:X,pool:X}:E):E=PS(),F={baseLanes:F.baseLanes|h,cachePool:E}),g.memoizedState=F,g.childLanes=Px(a,_,h),o.memoizedState=Ix,Zc(a.child,g)):(xi(o),h=a.child,a=h.sibling,h=ka(h,{mode:"visible",children:g.children}),h.return=o,h.sibling=null,a!==null&&(_=o.deletions,_===null?(o.deletions=[a],o.flags|=16):_.push(a)),o.child=h,o.memoizedState=null,h)}function Bx(a,o){return o=em({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function em(a,o){return a=qr(22,a,null,o),a.lanes=0,a}function Fx(a,o,h){return Ao(o,a.child,null,h),a=Bx(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function Xw(a,o,h){a.lanes|=o;var g=a.alternate;g!==null&&(g.lanes|=o),ex(a.return,o,h)}function zx(a,o,h,g,E,S){var _=a.memoizedState;_===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:E,treeForkCount:S}:(_.isBackwards=o,_.rendering=null,_.renderingStartTime=0,_.last=g,_.tail=h,_.tailMode=E,_.treeForkCount=S)}function Ww(a,o,h){var g=o.pendingProps,E=g.revealOrder,S=g.tail;g=g.children;var _=_n.current,F=(_&2)!==0;if(F?(_=_&1|2,o.flags|=128):_&=1,j(_n,_),or(a,o,g,h),g=kt?Fc:0,!F&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Xw(a,h,o);else if(a.tag===19)Xw(a,h,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(E){case"forwards":for(h=o.child,E=null;h!==null;)a=h.alternate,a!==null&&Hh(a)===null&&(E=h),h=h.sibling;h=E,h===null?(E=o.child,o.child=null):(E=h.sibling,h.sibling=null),zx(o,!1,E,h,S,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,E=o.child,o.child=null;E!==null;){if(a=E.alternate,a!==null&&Hh(a)===null){o.child=E;break}a=E.sibling,E.sibling=h,h=E,E=a}zx(o,!0,h,null,S,g);break;case"together":zx(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function Ma(a,o,h){if(a!==null&&(o.dependencies=a.dependencies),Ei|=o.lanes,(h&o.childLanes)===0)if(a!==null){if($l(a,o,h,!1),(h&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,h=ka(a,a.pendingProps),o.child=h,h.return=o;a.sibling!==null;)a=a.sibling,h=h.sibling=ka(a,a.pendingProps),h.return=o;h.sibling=null}return o.child}function Ux(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&Mh(a)))}function W9(a,o,h){switch(o.tag){case 3:ye(o,o.stateNode.containerInfo),hi(o,jn,a.memoizedState.cache),Eo();break;case 27:case 5:Re(o);break;case 4:ye(o,o.stateNode.containerInfo);break;case 10:hi(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,fx(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(xi(o),o.flags|=128,null):(h&o.child.childLanes)!==0?Qw(a,o,h):(xi(o),a=Ma(a,o,h),a!==null?a.sibling:null);xi(o);break;case 19:var E=(a.flags&128)!==0;if(g=(h&o.childLanes)!==0,g||($l(a,o,h,!1),g=(h&o.childLanes)!==0),E){if(g)return Ww(a,o,h);o.flags|=128}if(E=o.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),j(_n,_n.current),g)break;return null;case 22:return o.lanes=0,$w(a,o,h,o.pendingProps);case 24:hi(o,jn,a.memoizedState.cache)}return Ma(a,o,h)}function Zw(a,o,h){if(a!==null)if(a.memoizedProps!==o.pendingProps)In=!0;else{if(!Ux(a,h)&&(o.flags&128)===0)return In=!1,W9(a,o,h);In=(a.flags&131072)!==0}else In=!1,kt&&(o.flags&1048576)!==0&&RS(o,Fc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(a=Co(o.elementType),o.type=a,typeof a=="function")Yg(a)?(g=_o(a,g),o.tag=1,o=Gw(null,o,a,g,h)):(o.tag=0,o=Mx(null,o,a,g,h));else{if(a!=null){var E=a.$$typeof;if(E===R){o.tag=11,o=zw(null,o,a,g,h);break e}else if(E===M){o.tag=14,o=Uw(null,o,a,g,h);break e}}throw o=te(a)||a,Error(r(306,o,""))}}return o;case 0:return Mx(a,o,o.type,o.pendingProps,h);case 1:return g=o.type,E=_o(g,o.pendingProps),Gw(a,o,g,E,h);case 3:e:{if(ye(o,o.stateNode.containerInfo),a===null)throw Error(r(387));g=o.pendingProps;var S=o.memoizedState;E=S.element,ox(a,o),Gc(o,g,null,h);var _=o.memoizedState;if(g=_.cache,hi(o,jn,g),g!==S.cache&&tx(o,[jn],h,!0),Yc(),g=_.element,S.isDehydrated)if(S={element:g,isDehydrated:!1,cache:_.cache},o.updateQueue.baseState=S,o.memoizedState=S,o.flags&256){o=Kw(a,o,g,h);break e}else if(g!==E){E=os(Error(r(424)),o),zc(E),o=Kw(a,o,g,h);break e}else{switch(a=o.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(on=fs(a.firstChild),ar=o,kt=!0,di=null,cs=!0,h=$S(o,null,g,h),o.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Eo(),g===E){o=Ma(a,o,h);break e}or(a,o,g,h)}o=o.child}return o;case 26:return Jh(a,o),a===null?(h=uN(o.type,null,o.pendingProps,null))?o.memoizedState=h:kt||(h=o.type,a=o.pendingProps,g=gm(me.current).createElement(h),g[sr]=o,g[Or]=a,lr(g,h,a),Xn(g),o.stateNode=g):o.memoizedState=uN(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return Re(o),a===null&&kt&&(g=o.stateNode=iN(o.type,o.pendingProps,me.current),ar=o,cs=!0,E=on,Ni(o.type)?(v1=E,on=fs(g.firstChild)):on=E),or(a,o,o.pendingProps.children,h),Jh(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&kt&&((E=g=on)&&(g=AB(g,o.type,o.pendingProps,cs),g!==null?(o.stateNode=g,ar=o,on=fs(g.firstChild),cs=!1,E=!0):E=!1),E||fi(o)),Re(o),E=o.type,S=o.pendingProps,_=a!==null?a.memoizedProps:null,g=S.children,p1(E,S)?g=null:_!==null&&p1(E,_)&&(o.flags|=32),o.memoizedState!==null&&(E=mx(a,o,H9,null,null,h),hd._currentValue=E),Jh(a,o),or(a,o,g,h),o.child;case 6:return a===null&&kt&&((a=h=on)&&(h=kB(h,o.pendingProps,cs),h!==null?(o.stateNode=h,ar=o,on=null,a=!0):a=!1),a||fi(o)),null;case 13:return Qw(a,o,h);case 4:return ye(o,o.stateNode.containerInfo),g=o.pendingProps,a===null?o.child=Ao(o,null,g,h):or(a,o,g,h),o.child;case 11:return zw(a,o,o.type,o.pendingProps,h);case 7:return or(a,o,o.pendingProps,h),o.child;case 8:return or(a,o,o.pendingProps.children,h),o.child;case 12:return or(a,o,o.pendingProps.children,h),o.child;case 10:return g=o.pendingProps,hi(o,o.type,g.value),or(a,o,g.children,h),o.child;case 9:return E=o.type._context,g=o.pendingProps.children,So(o),E=ir(E),g=g(E),o.flags|=1,or(a,o,g,h),o.child;case 14:return Uw(a,o,o.type,o.pendingProps,h);case 15:return Hw(a,o,o.type,o.pendingProps,h);case 19:return Ww(a,o,h);case 31:return X9(a,o,h);case 22:return $w(a,o,h,o.pendingProps);case 24:return So(o),g=ir(jn),a===null?(E=sx(),E===null&&(E=Zt,S=nx(),E.pooledCache=S,S.refCount++,S!==null&&(E.pooledCacheLanes|=h),E=S),o.memoizedState={parent:g,cache:E},ix(o),hi(o,jn,E)):((a.lanes&h)!==0&&(ox(a,o),Gc(o,null,null,h),Yc()),E=a.memoizedState,S=o.memoizedState,E.parent!==g?(E={parent:g,cache:g},o.memoizedState=E,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=E),hi(o,jn,g)):(g=S.cache,hi(o,jn,g),g!==E.cache&&tx(o,[jn],h,!0))),or(a,o,o.pendingProps.children,h),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Ia(a){a.flags|=4}function Hx(a,o,h,g,E){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(E&335544128)===E)if(a.stateNode.complete)a.flags|=8192;else if(CC())a.flags|=8192;else throw No=Bh,ax}else a.flags&=-16777217}function Jw(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!mN(o))if(CC())a.flags|=8192;else throw No=Bh,ax}function tm(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?$t():536870912,a.lanes|=o,tu|=o)}function Jc(a,o){if(!kt)switch(a.tailMode){case"hidden":o=a.tail;for(var h=null;o!==null;)o.alternate!==null&&(h=o),o=o.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function ln(a){var o=a.alternate!==null&&a.alternate.child===a.child,h=0,g=0;if(o)for(var E=a.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=g,a.childLanes=h,o}function Z9(a,o,h){var g=o.pendingProps;switch(Xg(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 h=o.stateNode,g=null,a!==null&&(g=a.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),Oa(jn),ve(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(Hl(o)?Ia(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Zg())),ln(o),null;case 26:var E=o.type,S=o.memoizedState;return a===null?(Ia(o),S!==null?(ln(o),Jw(o,S)):(ln(o),Hx(o,E,null,g,h))):S?S!==a.memoizedState?(Ia(o),ln(o),Jw(o,S)):(ln(o),o.flags&=-16777217):(a=a.memoizedProps,a!==g&&Ia(o),ln(o),Hx(o,E,a,g,h)),null;case 27:if(ke(o),h=me.current,E=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==g&&Ia(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return ln(o),null}a=re.current,Hl(o)?DS(o):(a=iN(E,g,h),o.stateNode=a,Ia(o))}return ln(o),null;case 5:if(ke(o),E=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==g&&Ia(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return ln(o),null}if(S=re.current,Hl(o))DS(o);else{var _=gm(me.current);switch(S){case 1:S=_.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:S=_.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":S=_.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":S=_.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":S=_.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof g.is=="string"?_.createElement("select",{is:g.is}):_.createElement("select"),g.multiple?S.multiple=!0:g.size&&(S.size=g.size);break;default:S=typeof g.is=="string"?_.createElement(E,{is:g.is}):_.createElement(E)}}S[sr]=o,S[Or]=g;e:for(_=o.child;_!==null;){if(_.tag===5||_.tag===6)S.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===o)break e;for(;_.sibling===null;){if(_.return===null||_.return===o)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}o.stateNode=S;e:switch(lr(S,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ia(o)}}return ln(o),Hx(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,h),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==g&&Ia(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(a=me.current,Hl(o)){if(a=o.stateNode,h=o.memoizedProps,g=null,E=ar,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}a[sr]=o,a=!!(a.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||QC(a.nodeValue,h)),a||fi(o,!0)}else a=gm(a).createTextNode(g),a[sr]=o,o.stateNode=a}return ln(o),null;case 31:if(h=o.memoizedState,a===null||a.memoizedState!==null){if(g=Hl(o),h!==null){if(a===null){if(!g)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[sr]=o}else Eo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ln(o),a=!1}else h=Zg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return o.flags&256?(Gr(o),o):(Gr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return ln(o),null;case 13:if(g=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(E=Hl(o),g!==null&&g.dehydrated!==null){if(a===null){if(!E)throw Error(r(318));if(E=o.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[sr]=o}else Eo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ln(o),E=!1}else E=Zg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=E),E=!0;if(!E)return o.flags&256?(Gr(o),o):(Gr(o),null)}return Gr(o),(o.flags&128)!==0?(o.lanes=h,o):(h=g!==null,a=a!==null&&a.memoizedState!==null,h&&(g=o.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),S=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(S=g.memoizedState.cachePool.pool),S!==E&&(g.flags|=2048)),h!==a&&h&&(o.child.flags|=8192),tm(o,o.updateQueue),ln(o),null);case 4:return ve(),a===null&&c1(o.stateNode.containerInfo),ln(o),null;case 10:return Oa(o.type),ln(o),null;case 19:if(V(_n),g=o.memoizedState,g===null)return ln(o),null;if(E=(o.flags&128)!==0,S=g.rendering,S===null)if(E)Jc(g,!1);else{if(Tn!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(S=Hh(a),S!==null){for(o.flags|=128,Jc(g,!1),a=S.updateQueue,o.updateQueue=a,tm(o,a),o.subtreeFlags=0,a=h,h=o.child;h!==null;)AS(h,a),h=h.sibling;return j(_n,_n.current&1|2),kt&&_a(o,g.treeForkCount),o.child}a=a.sibling}g.tail!==null&&it()>im&&(o.flags|=128,E=!0,Jc(g,!1),o.lanes=4194304)}else{if(!E)if(a=Hh(S),a!==null){if(o.flags|=128,E=!0,a=a.updateQueue,o.updateQueue=a,tm(o,a),Jc(g,!0),g.tail===null&&g.tailMode==="hidden"&&!S.alternate&&!kt)return ln(o),null}else 2*it()-g.renderingStartTime>im&&h!==536870912&&(o.flags|=128,E=!0,Jc(g,!1),o.lanes=4194304);g.isBackwards?(S.sibling=o.child,o.child=S):(a=g.last,a!==null?a.sibling=S:o.child=S,g.last=S)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=it(),a.sibling=null,h=_n.current,j(_n,E?h&1|2:h&1),kt&&_a(o,g.treeForkCount),a):(ln(o),null);case 22:case 23:return Gr(o),dx(),g=o.memoizedState!==null,a!==null?a.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(h&536870912)!==0&&(o.flags&128)===0&&(ln(o),o.subtreeFlags&6&&(o.flags|=8192)):ln(o),h=o.updateQueue,h!==null&&tm(o,h.retryQueue),h=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==h&&(o.flags|=2048),a!==null&&V(wo),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),o.memoizedState.cache!==h&&(o.flags|=2048),Oa(jn),ln(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function J9(a,o){switch(Xg(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Oa(jn),ve(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return ke(o),null;case 31:if(o.memoizedState!==null){if(Gr(o),o.alternate===null)throw Error(r(340));Eo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Gr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Eo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return V(_n),null;case 4:return ve(),null;case 10:return Oa(o.type),null;case 22:case 23:return Gr(o),dx(),a!==null&&V(wo),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return Oa(jn),null;case 25:return null;default:return null}}function eC(a,o){switch(Xg(o),o.tag){case 3:Oa(jn),ve();break;case 26:case 27:case 5:ke(o);break;case 4:ve();break;case 31:o.memoizedState!==null&&Gr(o);break;case 13:Gr(o);break;case 19:V(_n);break;case 10:Oa(o.type);break;case 22:case 23:Gr(o),dx(),a!==null&&V(wo);break;case 24:Oa(jn)}}function ed(a,o){try{var h=o.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var E=g.next;h=E;do{if((h.tag&a)===a){g=void 0;var S=h.create,_=h.inst;g=S(),_.destroy=g}h=h.next}while(h!==E)}}catch(F){Ut(o,o.return,F)}}function bi(a,o,h){try{var g=o.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var S=E.next;g=S;do{if((g.tag&a)===a){var _=g.inst,F=_.destroy;if(F!==void 0){_.destroy=void 0,E=o;var X=h,ce=F;try{ce()}catch(ge){Ut(E,X,ge)}}}g=g.next}while(g!==S)}}catch(ge){Ut(o,o.return,ge)}}function tC(a){var o=a.updateQueue;if(o!==null){var h=a.stateNode;try{qS(o,h)}catch(g){Ut(a,a.return,g)}}}function nC(a,o,h){h.props=_o(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(g){Ut(a,o,g)}}function td(a,o){try{var h=a.ref;if(h!==null){switch(a.tag){case 26:case 27:case 5:var g=a.stateNode;break;case 30:g=a.stateNode;break;default:g=a.stateNode}typeof h=="function"?a.refCleanup=h(g):h.current=g}}catch(E){Ut(a,o,E)}}function Xs(a,o){var h=a.ref,g=a.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(E){Ut(a,o,E)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(E){Ut(a,o,E)}else h.current=null}function rC(a){var o=a.type,h=a.memoizedProps,g=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(E){Ut(a,a.return,E)}}function $x(a,o,h){try{var g=a.stateNode;EB(g,a.type,h,o),g[Or]=o}catch(E){Ut(a,a.return,E)}}function sC(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ni(a.type)||a.tag===4}function Vx(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||sC(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ni(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function qx(a,o,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,o?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(a,o):(o=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,o.appendChild(a),h=h._reactRootContainer,h!=null||o.onclick!==null||(o.onclick=Na));else if(g!==4&&(g===27&&Ni(a.type)&&(h=a.stateNode,o=null),a=a.child,a!==null))for(qx(a,o,h),a=a.sibling;a!==null;)qx(a,o,h),a=a.sibling}function nm(a,o,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,o?h.insertBefore(a,o):h.appendChild(a);else if(g!==4&&(g===27&&Ni(a.type)&&(h=a.stateNode),a=a.child,a!==null))for(nm(a,o,h),a=a.sibling;a!==null;)nm(a,o,h),a=a.sibling}function aC(a){var o=a.stateNode,h=a.memoizedProps;try{for(var g=a.type,E=o.attributes;E.length;)o.removeAttributeNode(E[0]);lr(o,g,h),o[sr]=a,o[Or]=h}catch(S){Ut(a,a.return,S)}}var La=!1,Ln=!1,Yx=!1,iC=typeof WeakSet=="function"?WeakSet:Set,Wn=null;function eB(a,o){if(a=a.containerInfo,h1=Sm,a=yS(a),Fg(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var E=g.anchorOffset,S=g.focusNode;g=g.focusOffset;try{h.nodeType,S.nodeType}catch{h=null;break e}var _=0,F=-1,X=-1,ce=0,ge=0,be=a,de=null;t:for(;;){for(var fe;be!==h||E!==0&&be.nodeType!==3||(F=_+E),be!==S||g!==0&&be.nodeType!==3||(X=_+g),be.nodeType===3&&(_+=be.nodeValue.length),(fe=be.firstChild)!==null;)de=be,be=fe;for(;;){if(be===a)break t;if(de===h&&++ce===E&&(F=_),de===S&&++ge===g&&(X=_),(fe=be.nextSibling)!==null)break;be=de,de=be.parentNode}be=fe}h=F===-1||X===-1?null:{start:F,end:X}}else h=null}h=h||{start:0,end:0}}else h=null;for(m1={focusedElem:a,selectionRange:h},Sm=!1,Wn=o;Wn!==null;)if(o=Wn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Wn=a;else for(;Wn!==null;){switch(o=Wn,S=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(h=0;h<a.length;h++)E=a[h],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,h=o,E=S.memoizedProps,S=S.memoizedState,g=h.stateNode;try{var Pe=_o(h.type,E);a=g.getSnapshotBeforeUpdate(Pe,S),g.__reactInternalSnapshotBeforeUpdate=a}catch(Xe){Ut(h,h.return,Xe)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,h=a.nodeType,h===9)x1(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":x1(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,Wn=a;break}Wn=o.return}}function oC(a,o,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Ba(a,h),g&4&&ed(5,h);break;case 1:if(Ba(a,h),g&4)if(a=h.stateNode,o===null)try{a.componentDidMount()}catch(_){Ut(h,h.return,_)}else{var E=_o(h.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(E,o,a.__reactInternalSnapshotBeforeUpdate)}catch(_){Ut(h,h.return,_)}}g&64&&tC(h),g&512&&td(h,h.return);break;case 3:if(Ba(a,h),g&64&&(a=h.updateQueue,a!==null)){if(o=null,h.child!==null)switch(h.child.tag){case 27:case 5:o=h.child.stateNode;break;case 1:o=h.child.stateNode}try{qS(a,o)}catch(_){Ut(h,h.return,_)}}break;case 27:o===null&&g&4&&aC(h);case 26:case 5:Ba(a,h),o===null&&g&4&&rC(h),g&512&&td(h,h.return);break;case 12:Ba(a,h);break;case 31:Ba(a,h),g&4&&cC(a,h);break;case 13:Ba(a,h),g&4&&dC(a,h),g&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=uB.bind(null,h),_B(a,h))));break;case 22:if(g=h.memoizedState!==null||La,!g){o=o!==null&&o.memoizedState!==null||Ln,E=La;var S=Ln;La=g,(Ln=o)&&!S?Fa(a,h,(h.subtreeFlags&8772)!==0):Ba(a,h),La=E,Ln=S}break;case 30:break;default:Ba(a,h)}}function lC(a){var o=a.alternate;o!==null&&(a.alternate=null,lC(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&Tg(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var hn=null,jr=!1;function Pa(a,o,h){for(h=h.child;h!==null;)uC(a,o,h),h=h.sibling}function uC(a,o,h){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(vn,h)}catch{}switch(h.tag){case 26:Ln||Xs(h,o),Pa(a,o,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Ln||Xs(h,o);var g=hn,E=jr;Ni(h.type)&&(hn=h.stateNode,jr=!1),Pa(a,o,h),cd(h.stateNode),hn=g,jr=E;break;case 5:Ln||Xs(h,o);case 6:if(g=hn,E=jr,hn=null,Pa(a,o,h),hn=g,jr=E,hn!==null)if(jr)try{(hn.nodeType===9?hn.body:hn.nodeName==="HTML"?hn.ownerDocument.body:hn).removeChild(h.stateNode)}catch(S){Ut(h,o,S)}else try{hn.removeChild(h.stateNode)}catch(S){Ut(h,o,S)}break;case 18:hn!==null&&(jr?(a=hn,tN(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),uu(a)):tN(hn,h.stateNode));break;case 4:g=hn,E=jr,hn=h.stateNode.containerInfo,jr=!0,Pa(a,o,h),hn=g,jr=E;break;case 0:case 11:case 14:case 15:bi(2,h,o),Ln||bi(4,h,o),Pa(a,o,h);break;case 1:Ln||(Xs(h,o),g=h.stateNode,typeof g.componentWillUnmount=="function"&&nC(h,o,g)),Pa(a,o,h);break;case 21:Pa(a,o,h);break;case 22:Ln=(g=Ln)||h.memoizedState!==null,Pa(a,o,h),Ln=g;break;default:Pa(a,o,h)}}function cC(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{uu(a)}catch(h){Ut(o,o.return,h)}}}function dC(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{uu(a)}catch(h){Ut(o,o.return,h)}}function tB(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new iC),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new iC),o;default:throw Error(r(435,a.tag))}}function rm(a,o){var h=tB(a);o.forEach(function(g){if(!h.has(g)){h.add(g);var E=cB.bind(null,a,g);g.then(E,E)}})}function Mr(a,o){var h=o.deletions;if(h!==null)for(var g=0;g<h.length;g++){var E=h[g],S=a,_=o,F=_;e:for(;F!==null;){switch(F.tag){case 27:if(Ni(F.type)){hn=F.stateNode,jr=!1;break e}break;case 5:hn=F.stateNode,jr=!1;break e;case 3:case 4:hn=F.stateNode.containerInfo,jr=!0;break e}F=F.return}if(hn===null)throw Error(r(160));uC(S,_,E),hn=null,jr=!1,S=E.alternate,S!==null&&(S.return=null),E.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)fC(o,a),o=o.sibling}var Os=null;function fC(a,o){var h=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Mr(o,a),Ir(a),g&4&&(bi(3,a,a.return),ed(3,a),bi(5,a,a.return));break;case 1:Mr(o,a),Ir(a),g&512&&(Ln||h===null||Xs(h,h.return)),g&64&&La&&(a=a.updateQueue,a!==null&&(g=a.callbacks,g!==null&&(h=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var E=Os;if(Mr(o,a),Ir(a),g&512&&(Ln||h===null||Xs(h,h.return)),g&4){var S=h!==null?h.memoizedState:null;if(g=a.memoizedState,h===null)if(g===null)if(a.stateNode===null){e:{g=a.type,h=a.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":S=E.getElementsByTagName("title")[0],(!S||S[kc]||S[sr]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=E.createElement(g),E.head.insertBefore(S,E.querySelector("head > title"))),lr(S,g,h),S[sr]=a,Xn(S),g=S;break e;case"link":var _=fN("link","href",E).get(g+(h.href||""));if(_){for(var F=0;F<_.length;F++)if(S=_[F],S.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&S.getAttribute("rel")===(h.rel==null?null:h.rel)&&S.getAttribute("title")===(h.title==null?null:h.title)&&S.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){_.splice(F,1);break t}}S=E.createElement(g),lr(S,g,h),E.head.appendChild(S);break;case"meta":if(_=fN("meta","content",E).get(g+(h.content||""))){for(F=0;F<_.length;F++)if(S=_[F],S.getAttribute("content")===(h.content==null?null:""+h.content)&&S.getAttribute("name")===(h.name==null?null:h.name)&&S.getAttribute("property")===(h.property==null?null:h.property)&&S.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&S.getAttribute("charset")===(h.charSet==null?null:h.charSet)){_.splice(F,1);break t}}S=E.createElement(g),lr(S,g,h),E.head.appendChild(S);break;default:throw Error(r(468,g))}S[sr]=a,Xn(S),g=S}a.stateNode=g}else hN(E,a.type,a.stateNode);else a.stateNode=dN(E,g,a.memoizedProps);else S!==g?(S===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):S.count--,g===null?hN(E,a.type,a.stateNode):dN(E,g,a.memoizedProps)):g===null&&a.stateNode!==null&&$x(a,a.memoizedProps,h.memoizedProps)}break;case 27:Mr(o,a),Ir(a),g&512&&(Ln||h===null||Xs(h,h.return)),h!==null&&g&4&&$x(a,a.memoizedProps,h.memoizedProps);break;case 5:if(Mr(o,a),Ir(a),g&512&&(Ln||h===null||Xs(h,h.return)),a.flags&32){E=a.stateNode;try{Dl(E,"")}catch(Pe){Ut(a,a.return,Pe)}}g&4&&a.stateNode!=null&&(E=a.memoizedProps,$x(a,E,h!==null?h.memoizedProps:E)),g&1024&&(Yx=!0);break;case 6:if(Mr(o,a),Ir(a),g&4){if(a.stateNode===null)throw Error(r(162));g=a.memoizedProps,h=a.stateNode;try{h.nodeValue=g}catch(Pe){Ut(a,a.return,Pe)}}break;case 3:if(bm=null,E=Os,Os=xm(o.containerInfo),Mr(o,a),Os=E,Ir(a),g&4&&h!==null&&h.memoizedState.isDehydrated)try{uu(o.containerInfo)}catch(Pe){Ut(a,a.return,Pe)}Yx&&(Yx=!1,hC(a));break;case 4:g=Os,Os=xm(a.stateNode.containerInfo),Mr(o,a),Ir(a),Os=g;break;case 12:Mr(o,a),Ir(a);break;case 31:Mr(o,a),Ir(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,rm(a,g)));break;case 13:Mr(o,a),Ir(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(am=it()),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,rm(a,g)));break;case 22:E=a.memoizedState!==null;var X=h!==null&&h.memoizedState!==null,ce=La,ge=Ln;if(La=ce||E,Ln=ge||X,Mr(o,a),Ln=ge,La=ce,Ir(a),g&8192)e:for(o=a.stateNode,o._visibility=E?o._visibility&-2:o._visibility|1,E&&(h===null||X||La||Ln||Ro(a)),h=null,o=a;;){if(o.tag===5||o.tag===26){if(h===null){X=h=o;try{if(S=X.stateNode,E)_=S.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{F=X.stateNode;var be=X.memoizedProps.style,de=be!=null&&be.hasOwnProperty("display")?be.display:null;F.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Pe){Ut(X,X.return,Pe)}}}else if(o.tag===6){if(h===null){X=o;try{X.stateNode.nodeValue=E?"":X.memoizedProps}catch(Pe){Ut(X,X.return,Pe)}}}else if(o.tag===18){if(h===null){X=o;try{var fe=X.stateNode;E?nN(fe,!0):nN(X.stateNode,!1)}catch(Pe){Ut(X,X.return,Pe)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;h===o&&(h=null),o=o.return}h===o&&(h=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=a.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,rm(a,h))));break;case 19:Mr(o,a),Ir(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,rm(a,g)));break;case 30:break;case 21:break;default:Mr(o,a),Ir(a)}}function Ir(a){var o=a.flags;if(o&2){try{for(var h,g=a.return;g!==null;){if(sC(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var E=h.stateNode,S=Vx(a);nm(a,S,E);break;case 5:var _=h.stateNode;h.flags&32&&(Dl(_,""),h.flags&=-33);var F=Vx(a);nm(a,F,_);break;case 3:case 4:var X=h.stateNode.containerInfo,ce=Vx(a);qx(a,ce,X);break;default:throw Error(r(161))}}catch(ge){Ut(a,a.return,ge)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function hC(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;hC(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function Ba(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)oC(a,o.alternate,o),o=o.sibling}function Ro(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:bi(4,o,o.return),Ro(o);break;case 1:Xs(o,o.return);var h=o.stateNode;typeof h.componentWillUnmount=="function"&&nC(o,o.return,h),Ro(o);break;case 27:cd(o.stateNode);case 26:case 5:Xs(o,o.return),Ro(o);break;case 22:o.memoizedState===null&&Ro(o);break;case 30:Ro(o);break;default:Ro(o)}a=a.sibling}}function Fa(a,o,h){for(h=h&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,E=a,S=o,_=S.flags;switch(S.tag){case 0:case 11:case 15:Fa(E,S,h),ed(4,S);break;case 1:if(Fa(E,S,h),g=S,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(ce){Ut(g,g.return,ce)}if(g=S,E=g.updateQueue,E!==null){var F=g.stateNode;try{var X=E.shared.hiddenCallbacks;if(X!==null)for(E.shared.hiddenCallbacks=null,E=0;E<X.length;E++)VS(X[E],F)}catch(ce){Ut(g,g.return,ce)}}h&&_&64&&tC(S),td(S,S.return);break;case 27:aC(S);case 26:case 5:Fa(E,S,h),h&&g===null&&_&4&&rC(S),td(S,S.return);break;case 12:Fa(E,S,h);break;case 31:Fa(E,S,h),h&&_&4&&cC(E,S);break;case 13:Fa(E,S,h),h&&_&4&&dC(E,S);break;case 22:S.memoizedState===null&&Fa(E,S,h),td(S,S.return);break;case 30:break;default:Fa(E,S,h)}o=o.sibling}}function Gx(a,o){var h=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==h&&(a!=null&&a.refCount++,h!=null&&Uc(h))}function Kx(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Uc(a))}function Ds(a,o,h,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)mC(a,o,h,g),o=o.sibling}function mC(a,o,h,g){var E=o.flags;switch(o.tag){case 0:case 11:case 15:Ds(a,o,h,g),E&2048&&ed(9,o);break;case 1:Ds(a,o,h,g);break;case 3:Ds(a,o,h,g),E&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Uc(a)));break;case 12:if(E&2048){Ds(a,o,h,g),a=o.stateNode;try{var S=o.memoizedProps,_=S.id,F=S.onPostCommit;typeof F=="function"&&F(_,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(X){Ut(o,o.return,X)}}else Ds(a,o,h,g);break;case 31:Ds(a,o,h,g);break;case 13:Ds(a,o,h,g);break;case 23:break;case 22:S=o.stateNode,_=o.alternate,o.memoizedState!==null?S._visibility&2?Ds(a,o,h,g):nd(a,o):S._visibility&2?Ds(a,o,h,g):(S._visibility|=2,Zl(a,o,h,g,(o.subtreeFlags&10256)!==0||!1)),E&2048&&Gx(_,o);break;case 24:Ds(a,o,h,g),E&2048&&Kx(o.alternate,o);break;default:Ds(a,o,h,g)}}function Zl(a,o,h,g,E){for(E=E&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var S=a,_=o,F=h,X=g,ce=_.flags;switch(_.tag){case 0:case 11:case 15:Zl(S,_,F,X,E),ed(8,_);break;case 23:break;case 22:var ge=_.stateNode;_.memoizedState!==null?ge._visibility&2?Zl(S,_,F,X,E):nd(S,_):(ge._visibility|=2,Zl(S,_,F,X,E)),E&&ce&2048&&Gx(_.alternate,_);break;case 24:Zl(S,_,F,X,E),E&&ce&2048&&Kx(_.alternate,_);break;default:Zl(S,_,F,X,E)}o=o.sibling}}function nd(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var h=a,g=o,E=g.flags;switch(g.tag){case 22:nd(h,g),E&2048&&Gx(g.alternate,g);break;case 24:nd(h,g),E&2048&&Kx(g.alternate,g);break;default:nd(h,g)}o=o.sibling}}var rd=8192;function Jl(a,o,h){if(a.subtreeFlags&rd)for(a=a.child;a!==null;)pC(a,o,h),a=a.sibling}function pC(a,o,h){switch(a.tag){case 26:Jl(a,o,h),a.flags&rd&&a.memoizedState!==null&&UB(h,Os,a.memoizedState,a.memoizedProps);break;case 5:Jl(a,o,h);break;case 3:case 4:var g=Os;Os=xm(a.stateNode.containerInfo),Jl(a,o,h),Os=g;break;case 22:a.memoizedState===null&&(g=a.alternate,g!==null&&g.memoizedState!==null?(g=rd,rd=16777216,Jl(a,o,h),rd=g):Jl(a,o,h));break;default:Jl(a,o,h)}}function gC(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function sd(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var g=o[h];Wn=g,yC(g,a)}gC(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)xC(a),a=a.sibling}function xC(a){switch(a.tag){case 0:case 11:case 15:sd(a),a.flags&2048&&bi(9,a,a.return);break;case 3:sd(a);break;case 12:sd(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,sm(a)):sd(a);break;default:sd(a)}}function sm(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var g=o[h];Wn=g,yC(g,a)}gC(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:bi(8,o,o.return),sm(o);break;case 22:h=o.stateNode,h._visibility&2&&(h._visibility&=-3,sm(o));break;default:sm(o)}a=a.sibling}}function yC(a,o){for(;Wn!==null;){var h=Wn;switch(h.tag){case 0:case 11:case 15:bi(8,h,o);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Uc(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Wn=g;else e:for(h=a;Wn!==null;){g=Wn;var E=g.sibling,S=g.return;if(lC(g),g===h){Wn=null;break e}if(E!==null){E.return=S,Wn=E;break e}Wn=S}}}var nB={getCacheForType:function(a){var o=ir(jn),h=o.data.get(a);return h===void 0&&(h=a(),o.data.set(a,h)),h},cacheSignal:function(){return ir(jn).controller.signal}},rB=typeof WeakMap=="function"?WeakMap:Map,Bt=0,Zt=null,xt=null,wt=0,zt=0,Kr=null,vi=!1,eu=!1,Qx=!1,za=0,Tn=0,Ei=0,Oo=0,Xx=0,Qr=0,tu=0,ad=null,Lr=null,Wx=!1,am=0,bC=0,im=1/0,om=null,Ti=null,Un=0,Si=null,nu=null,Ua=0,Zx=0,Jx=null,vC=null,id=0,e1=null;function Xr(){return(Bt&2)!==0&&wt!==0?wt&-wt:L.T!==null?i1():vg()}function EC(){if(Qr===0)if((wt&536870912)===0||kt){var a=gt;gt<<=1,(gt&3932160)===0&&(gt=262144),Qr=a}else Qr=536870912;return a=Yr.current,a!==null&&(a.flags|=32),Qr}function Pr(a,o,h){(a===Zt&&(zt===2||zt===9)||a.cancelPendingCommit!==null)&&(ru(a,0),wi(a,wt,Qr,!1)),jt(a,h),((Bt&2)===0||a!==Zt)&&(a===Zt&&((Bt&2)===0&&(Oo|=h),Tn===4&&wi(a,wt,Qr,!1)),Ws(a))}function TC(a,o,h){if((Bt&6)!==0)throw Error(r(327));var g=!h&&(o&127)===0&&(o&a.expiredLanes)===0||tt(a,o),E=g?iB(a,o):n1(a,o,!0),S=g;do{if(E===0){eu&&!g&&wi(a,o,0,!1);break}else{if(h=a.current.alternate,S&&!sB(h)){E=n1(a,o,!1),S=!1;continue}if(E===2){if(S=o,a.errorRecoveryDisabledLanes&S)var _=0;else _=a.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){o=_;e:{var F=a;E=ad;var X=F.current.memoizedState.isDehydrated;if(X&&(ru(F,_).flags|=256),_=n1(F,_,!1),_!==2){if(Qx&&!X){F.errorRecoveryDisabledLanes|=S,Oo|=S,E=4;break e}S=Lr,Lr=E,S!==null&&(Lr===null?Lr=S:Lr.push.apply(Lr,S))}E=_}if(S=!1,E!==2)continue}}if(E===1){ru(a,0),wi(a,o,0,!0);break}e:{switch(g=a,S=E,S){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:wi(g,o,Qr,!vi);break e;case 2:Lr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(E=am+300-it(),10<E)){if(wi(g,o,Qr,!vi),Ie(g,0,!0)!==0)break e;Ua=o,g.timeoutHandle=JC(SC.bind(null,g,h,Lr,om,Wx,o,Qr,Oo,tu,vi,S,"Throttled",-0,0),E);break e}SC(g,h,Lr,om,Wx,o,Qr,Oo,tu,vi,S,null,-0,0)}}break}while(!0);Ws(a)}function SC(a,o,h,g,E,S,_,F,X,ce,ge,be,de,fe){if(a.timeoutHandle=-1,be=o.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Na},pC(o,S,be);var Pe=(S&62914560)===S?am-it():(S&4194048)===S?bC-it():0;if(Pe=HB(be,Pe),Pe!==null){Ua=S,a.cancelPendingCommit=Pe(OC.bind(null,a,o,S,h,g,E,_,F,X,ge,be,null,de,fe)),wi(a,S,_,!ce);return}}OC(a,o,S,h,g,E,_,F,X)}function sB(a){for(var o=a;;){var h=o.tag;if((h===0||h===11||h===15)&&o.flags&16384&&(h=o.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var E=h[g],S=E.getSnapshot;E=E.value;try{if(!Vr(S(),E))return!1}catch{return!1}}if(h=o.child,o.subtreeFlags&16384&&h!==null)h.return=o,o=h;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function wi(a,o,h,g){o&=~Xx,o&=~Oo,a.suspendedLanes|=o,a.pingedLanes&=~o,g&&(a.warmLanes|=o),g=a.expirationTimes;for(var E=o;0<E;){var S=31-Ot(E),_=1<<S;g[S]=-1,E&=~_}h!==0&&rs(a,h,o)}function lm(){return(Bt&6)===0?(od(0),!1):!0}function t1(){if(xt!==null){if(zt===0)var a=xt.return;else a=xt,Ra=To=null,xx(a),Gl=null,$c=0,a=xt;for(;a!==null;)eC(a.alternate,a),a=a.return;xt=null}}function ru(a,o){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,wB(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),Ua=0,t1(),Zt=a,xt=h=ka(a.current,null),wt=o,zt=0,Kr=null,vi=!1,eu=tt(a,o),Qx=!1,tu=Qr=Xx=Oo=Ei=Tn=0,Lr=ad=null,Wx=!1,(o&8)!==0&&(o|=o&32);var g=a.entangledLanes;if(g!==0)for(a=a.entanglements,g&=o;0<g;){var E=31-Ot(g),S=1<<E;o|=a[E],g&=~S}return za=o,_h(),h}function wC(a,o){at=null,L.H=Wc,o===Yl||o===Ph?(o=zS(),zt=3):o===ax?(o=zS(),zt=4):zt=o===jx?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Kr=o,xt===null&&(Tn=1,Wh(a,os(o,a.current)))}function CC(){var a=Yr.current;return a===null?!0:(wt&4194048)===wt?ds===null:(wt&62914560)===wt||(wt&536870912)!==0?a===ds:!1}function NC(){var a=L.H;return L.H=Wc,a===null?Wc:a}function AC(){var a=L.A;return L.A=nB,a}function um(){Tn=4,vi||(wt&4194048)!==wt&&Yr.current!==null||(eu=!0),(Ei&134217727)===0&&(Oo&134217727)===0||Zt===null||wi(Zt,wt,Qr,!1)}function n1(a,o,h){var g=Bt;Bt|=2;var E=NC(),S=AC();(Zt!==a||wt!==o)&&(om=null,ru(a,o)),o=!1;var _=Tn;e:do try{if(zt!==0&&xt!==null){var F=xt,X=Kr;switch(zt){case 8:t1(),_=6;break e;case 3:case 2:case 9:case 6:Yr.current===null&&(o=!0);var ce=zt;if(zt=0,Kr=null,su(a,F,X,ce),h&&eu){_=0;break e}break;default:ce=zt,zt=0,Kr=null,su(a,F,X,ce)}}aB(),_=Tn;break}catch(ge){wC(a,ge)}while(!0);return o&&a.shellSuspendCounter++,Ra=To=null,Bt=g,L.H=E,L.A=S,xt===null&&(Zt=null,wt=0,_h()),_}function aB(){for(;xt!==null;)kC(xt)}function iB(a,o){var h=Bt;Bt|=2;var g=NC(),E=AC();Zt!==a||wt!==o?(om=null,im=it()+500,ru(a,o)):eu=tt(a,o);e:do try{if(zt!==0&&xt!==null){o=xt;var S=Kr;t:switch(zt){case 1:zt=0,Kr=null,su(a,o,S,1);break;case 2:case 9:if(BS(S)){zt=0,Kr=null,_C(o);break}o=function(){zt!==2&&zt!==9||Zt!==a||(zt=7),Ws(a)},S.then(o,o);break e;case 3:zt=7;break e;case 4:zt=5;break e;case 7:BS(S)?(zt=0,Kr=null,_C(o)):(zt=0,Kr=null,su(a,o,S,7));break;case 5:var _=null;switch(xt.tag){case 26:_=xt.memoizedState;case 5:case 27:var F=xt;if(_?mN(_):F.stateNode.complete){zt=0,Kr=null;var X=F.sibling;if(X!==null)xt=X;else{var ce=F.return;ce!==null?(xt=ce,cm(ce)):xt=null}break t}}zt=0,Kr=null,su(a,o,S,5);break;case 6:zt=0,Kr=null,su(a,o,S,6);break;case 8:t1(),Tn=6;break e;default:throw Error(r(462))}}oB();break}catch(ge){wC(a,ge)}while(!0);return Ra=To=null,L.H=g,L.A=E,Bt=h,xt!==null?0:(Zt=null,wt=0,_h(),Tn)}function oB(){for(;xt!==null&&!St();)kC(xt)}function kC(a){var o=Zw(a.alternate,a,za);a.memoizedProps=a.pendingProps,o===null?cm(a):xt=o}function _C(a){var o=a,h=o.alternate;switch(o.tag){case 15:case 0:o=Yw(h,o,o.pendingProps,o.type,void 0,wt);break;case 11:o=Yw(h,o,o.pendingProps,o.type.render,o.ref,wt);break;case 5:xx(o);default:eC(h,o),o=xt=AS(o,za),o=Zw(h,o,za)}a.memoizedProps=a.pendingProps,o===null?cm(a):xt=o}function su(a,o,h,g){Ra=To=null,xx(o),Gl=null,$c=0;var E=o.return;try{if(Q9(a,E,o,h,wt)){Tn=1,Wh(a,os(h,a.current)),xt=null;return}}catch(S){if(E!==null)throw xt=E,S;Tn=1,Wh(a,os(h,a.current)),xt=null;return}o.flags&32768?(kt||g===1?a=!0:eu||(wt&536870912)!==0?a=!1:(vi=a=!0,(g===2||g===9||g===3||g===6)&&(g=Yr.current,g!==null&&g.tag===13&&(g.flags|=16384))),RC(o,a)):cm(o)}function cm(a){var o=a;do{if((o.flags&32768)!==0){RC(o,vi);return}a=o.return;var h=Z9(o.alternate,o,za);if(h!==null){xt=h;return}if(o=o.sibling,o!==null){xt=o;return}xt=o=a}while(o!==null);Tn===0&&(Tn=5)}function RC(a,o){do{var h=J9(a.alternate,a);if(h!==null){h.flags&=32767,xt=h;return}if(h=a.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!o&&(a=a.sibling,a!==null)){xt=a;return}xt=a=h}while(a!==null);Tn=6,xt=null}function OC(a,o,h,g,E,S,_,F,X){a.cancelPendingCommit=null;do dm();while(Un!==0);if((Bt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(S=o.lanes|o.childLanes,S|=Vg,an(a,h,S,_,F,X),a===Zt&&(xt=Zt=null,wt=0),nu=o,Si=a,Ua=h,Zx=S,Jx=E,vC=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,dB(Ve,function(){return LC(),null})):(a.callbackNode=null,a.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=L.T,L.T=null,E=B.p,B.p=2,_=Bt,Bt|=4;try{eB(a,o,h)}finally{Bt=_,B.p=E,L.T=g}}Un=1,DC(),jC(),MC()}}function DC(){if(Un===1){Un=0;var a=Si,o=nu,h=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||h){h=L.T,L.T=null;var g=B.p;B.p=2;var E=Bt;Bt|=4;try{fC(o,a);var S=m1,_=yS(a.containerInfo),F=S.focusedElem,X=S.selectionRange;if(_!==F&&F&&F.ownerDocument&&xS(F.ownerDocument.documentElement,F)){if(X!==null&&Fg(F)){var ce=X.start,ge=X.end;if(ge===void 0&&(ge=ce),"selectionStart"in F)F.selectionStart=ce,F.selectionEnd=Math.min(ge,F.value.length);else{var be=F.ownerDocument||document,de=be&&be.defaultView||window;if(de.getSelection){var fe=de.getSelection(),Pe=F.textContent.length,Xe=Math.min(X.start,Pe),Yt=X.end===void 0?Xe:Math.min(X.end,Pe);!fe.extend&&Xe>Yt&&(_=Yt,Yt=Xe,Xe=_);var se=gS(F,Xe),ee=gS(F,Yt);if(se&&ee&&(fe.rangeCount!==1||fe.anchorNode!==se.node||fe.anchorOffset!==se.offset||fe.focusNode!==ee.node||fe.focusOffset!==ee.offset)){var ue=be.createRange();ue.setStart(se.node,se.offset),fe.removeAllRanges(),Xe>Yt?(fe.addRange(ue),fe.extend(ee.node,ee.offset)):(ue.setEnd(ee.node,ee.offset),fe.addRange(ue))}}}}for(be=[],fe=F;fe=fe.parentNode;)fe.nodeType===1&&be.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<be.length;F++){var xe=be[F];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}Sm=!!h1,m1=h1=null}finally{Bt=E,B.p=g,L.T=h}}a.current=o,Un=2}}function jC(){if(Un===2){Un=0;var a=Si,o=nu,h=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||h){h=L.T,L.T=null;var g=B.p;B.p=2;var E=Bt;Bt|=4;try{oC(a,o.alternate,o)}finally{Bt=E,B.p=g,L.T=h}}Un=3}}function MC(){if(Un===4||Un===3){Un=0,dn();var a=Si,o=nu,h=Ua,g=vC;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Un=5:(Un=0,nu=Si=null,IC(a,a.pendingLanes));var E=a.pendingLanes;if(E===0&&(Ti=null),_s(h),o=o.stateNode,nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(vn,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=L.T,E=B.p,B.p=2,L.T=null;try{for(var S=a.onRecoverableError,_=0;_<g.length;_++){var F=g[_];S(F.value,{componentStack:F.stack})}}finally{L.T=o,B.p=E}}(Ua&3)!==0&&dm(),Ws(a),E=a.pendingLanes,(h&261930)!==0&&(E&42)!==0?a===e1?id++:(id=0,e1=a):id=0,od(0)}}function IC(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Uc(o)))}function dm(){return DC(),jC(),MC(),LC()}function LC(){if(Un!==5)return!1;var a=Si,o=Zx;Zx=0;var h=_s(Ua),g=L.T,E=B.p;try{B.p=32>h?32:h,L.T=null,h=Jx,Jx=null;var S=Si,_=Ua;if(Un=0,nu=Si=null,Ua=0,(Bt&6)!==0)throw Error(r(331));var F=Bt;if(Bt|=4,xC(S.current),mC(S,S.current,_,h),Bt=F,od(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(vn,S)}catch{}return!0}finally{B.p=E,L.T=g,IC(a,o)}}function PC(a,o,h){o=os(h,o),o=Dx(a.stateNode,o,2),a=gi(a,o,2),a!==null&&(jt(a,2),Ws(a))}function Ut(a,o,h){if(a.tag===3)PC(a,a,h);else for(;o!==null;){if(o.tag===3){PC(o,a,h);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ti===null||!Ti.has(g))){a=os(h,a),h=Bw(2),g=gi(o,h,2),g!==null&&(Fw(h,g,o,a),jt(g,2),Ws(g));break}}o=o.return}}function r1(a,o,h){var g=a.pingCache;if(g===null){g=a.pingCache=new rB;var E=new Set;g.set(o,E)}else E=g.get(o),E===void 0&&(E=new Set,g.set(o,E));E.has(h)||(Qx=!0,E.add(h),a=lB.bind(null,a,o,h),o.then(a,a))}function lB(a,o,h){var g=a.pingCache;g!==null&&g.delete(o),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,Zt===a&&(wt&h)===h&&(Tn===4||Tn===3&&(wt&62914560)===wt&&300>it()-am?(Bt&2)===0&&ru(a,0):Xx|=h,tu===wt&&(tu=0)),Ws(a)}function BC(a,o){o===0&&(o=$t()),a=bo(a,o),a!==null&&(jt(a,o),Ws(a))}function uB(a){var o=a.memoizedState,h=0;o!==null&&(h=o.retryLane),BC(a,h)}function cB(a,o){var h=0;switch(a.tag){case 31:case 13:var g=a.stateNode,E=a.memoizedState;E!==null&&(h=E.retryLane);break;case 19:g=a.stateNode;break;case 22:g=a.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(o),BC(a,h)}function dB(a,o){return Ht(a,o)}var fm=null,au=null,s1=!1,hm=!1,a1=!1,Ci=0;function Ws(a){a!==au&&a.next===null&&(au===null?fm=au=a:au=au.next=a),hm=!0,s1||(s1=!0,hB())}function od(a,o){if(!a1&&hm){a1=!0;do for(var h=!1,g=fm;g!==null;){if(a!==0){var E=g.pendingLanes;if(E===0)var S=0;else{var _=g.suspendedLanes,F=g.pingedLanes;S=(1<<31-Ot(42|a)+1)-1,S&=E&~(_&~F),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(h=!0,HC(g,S))}else S=wt,S=Ie(g,g===Zt?S:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(S&3)===0||tt(g,S)||(h=!0,HC(g,S));g=g.next}while(h);a1=!1}}function fB(){FC()}function FC(){hm=s1=!1;var a=0;Ci!==0&&SB()&&(a=Ci);for(var o=it(),h=null,g=fm;g!==null;){var E=g.next,S=zC(g,o);S===0?(g.next=null,h===null?fm=E:h.next=E,E===null&&(au=h)):(h=g,(a!==0||(S&3)!==0)&&(hm=!0)),g=E}Un!==0&&Un!==5||od(a),Ci!==0&&(Ci=0)}function zC(a,o){for(var h=a.suspendedLanes,g=a.pingedLanes,E=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var _=31-Ot(S),F=1<<_,X=E[_];X===-1?((F&h)===0||(F&g)!==0)&&(E[_]=Wt(F,o)):X<=o&&(a.expiredLanes|=F),S&=~F}if(o=Zt,h=wt,h=Ie(a,a===o?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g=a.callbackNode,h===0||a===o&&(zt===2||zt===9)||a.cancelPendingCommit!==null)return g!==null&&g!==null&&cn(g),a.callbackNode=null,a.callbackPriority=0;if((h&3)===0||tt(a,h)){if(o=h&-h,o===a.callbackPriority)return o;switch(g!==null&&cn(g),_s(h)){case 2:case 8:h=Ne;break;case 32:h=Ve;break;case 268435456:h=st;break;default:h=Ve}return g=UC.bind(null,a),h=Ht(h,g),a.callbackPriority=o,a.callbackNode=h,o}return g!==null&&g!==null&&cn(g),a.callbackPriority=2,a.callbackNode=null,2}function UC(a,o){if(Un!==0&&Un!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(dm()&&a.callbackNode!==h)return null;var g=wt;return g=Ie(a,a===Zt?g:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g===0?null:(TC(a,g,o),zC(a,it()),a.callbackNode!=null&&a.callbackNode===h?UC.bind(null,a):null)}function HC(a,o){if(dm())return null;TC(a,o,!0)}function hB(){CB(function(){(Bt&6)!==0?Ht(pe,fB):FC()})}function i1(){if(Ci===0){var a=Vl;a===0&&(a=Ke,Ke<<=1,(Ke&261888)===0&&(Ke=256)),Ci=a}return Ci}function $C(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Eh(""+a)}function VC(a,o){var h=o.ownerDocument.createElement("input");return h.name=o.name,h.value=o.value,a.id&&h.setAttribute("form",a.id),o.parentNode.insertBefore(h,o),a=new FormData(a),h.parentNode.removeChild(h),a}function mB(a,o,h,g,E){if(o==="submit"&&h&&h.stateNode===E){var S=$C((E[Or]||null).action),_=g.submitter;_&&(o=(o=_[Or]||null)?$C(o.formAction):_.getAttribute("formAction"),o!==null&&(S=o,_=null));var F=new Ch("action","action",null,g,E);a.push({event:F,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ci!==0){var X=_?VC(E,_):new FormData(E);Nx(h,{pending:!0,data:X,method:E.method,action:S},null,X)}}else typeof S=="function"&&(F.preventDefault(),X=_?VC(E,_):new FormData(E),Nx(h,{pending:!0,data:X,method:E.method,action:S},S,X))},currentTarget:E}]})}}for(var o1=0;o1<$g.length;o1++){var l1=$g[o1],pB=l1.toLowerCase(),gB=l1[0].toUpperCase()+l1.slice(1);Rs(pB,"on"+gB)}Rs(ES,"onAnimationEnd"),Rs(TS,"onAnimationIteration"),Rs(SS,"onAnimationStart"),Rs("dblclick","onDoubleClick"),Rs("focusin","onFocus"),Rs("focusout","onBlur"),Rs(D9,"onTransitionRun"),Rs(j9,"onTransitionStart"),Rs(M9,"onTransitionCancel"),Rs(wS,"onTransitionEnd"),Rl("onMouseEnter",["mouseout","mouseover"]),Rl("onMouseLeave",["mouseout","mouseover"]),Rl("onPointerEnter",["pointerout","pointerover"]),Rl("onPointerLeave",["pointerout","pointerover"]),po("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),po("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),po("onBeforeInput",["compositionend","keypress","textInput","paste"]),po("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),po("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),po("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ld="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(" "),xB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ld));function qC(a,o){o=(o&4)!==0;for(var h=0;h<a.length;h++){var g=a[h],E=g.event;g=g.listeners;e:{var S=void 0;if(o)for(var _=g.length-1;0<=_;_--){var F=g[_],X=F.instance,ce=F.currentTarget;if(F=F.listener,X!==S&&E.isPropagationStopped())break e;S=F,E.currentTarget=ce;try{S(E)}catch(ge){kh(ge)}E.currentTarget=null,S=X}else for(_=0;_<g.length;_++){if(F=g[_],X=F.instance,ce=F.currentTarget,F=F.listener,X!==S&&E.isPropagationStopped())break e;S=F,E.currentTarget=ce;try{S(E)}catch(ge){kh(ge)}E.currentTarget=null,S=X}}}}function yt(a,o){var h=o[Eg];h===void 0&&(h=o[Eg]=new Set);var g=a+"__bubble";h.has(g)||(YC(o,a,2,!1),h.add(g))}function u1(a,o,h){var g=0;o&&(g|=4),YC(h,a,g,o)}var mm="_reactListening"+Math.random().toString(36).slice(2);function c1(a){if(!a[mm]){a[mm]=!0,F2.forEach(function(h){h!=="selectionchange"&&(xB.has(h)||u1(h,!1,a),u1(h,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[mm]||(o[mm]=!0,u1("selectionchange",!1,o))}}function YC(a,o,h,g){switch(EN(o)){case 2:var E=qB;break;case 8:E=YB;break;default:E=C1}h=E.bind(null,o,h,a),E=void 0,!Rg||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(E=!0),g?E!==void 0?a.addEventListener(o,h,{capture:!0,passive:E}):a.addEventListener(o,h,!0):E!==void 0?a.addEventListener(o,h,{passive:E}):a.addEventListener(o,h,!1)}function d1(a,o,h,g,E){var S=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var _=g.tag;if(_===3||_===4){var F=g.stateNode.containerInfo;if(F===E)break;if(_===4)for(_=g.return;_!==null;){var X=_.tag;if((X===3||X===4)&&_.stateNode.containerInfo===E)return;_=_.return}for(;F!==null;){if(_=Al(F),_===null)return;if(X=_.tag,X===5||X===6||X===26||X===27){g=S=_;continue e}F=F.parentNode}}g=g.return}W2(function(){var ce=S,ge=kg(h),be=[];e:{var de=CS.get(a);if(de!==void 0){var fe=Ch,Pe=a;switch(a){case"keypress":if(Sh(h)===0)break e;case"keydown":case"keyup":fe=c9;break;case"focusin":Pe="focus",fe=Mg;break;case"focusout":Pe="blur",fe=Mg;break;case"beforeblur":case"afterblur":fe=Mg;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=eS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=Z8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=h9;break;case ES:case TS:case SS:fe=t9;break;case wS:fe=p9;break;case"scroll":case"scrollend":fe=X8;break;case"wheel":fe=x9;break;case"copy":case"cut":case"paste":fe=r9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=nS;break;case"toggle":case"beforetoggle":fe=b9}var Xe=(o&4)!==0,Yt=!Xe&&(a==="scroll"||a==="scrollend"),se=Xe?de!==null?de+"Capture":null:de;Xe=[];for(var ee=ce,ue;ee!==null;){var xe=ee;if(ue=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ue===null||se===null||(xe=Rc(ee,se),xe!=null&&Xe.push(ud(ee,xe,ue))),Yt)break;ee=ee.return}0<Xe.length&&(de=new fe(de,Pe,null,h,ge),be.push({event:de,listeners:Xe}))}}if((o&7)===0){e:{if(de=a==="mouseover"||a==="pointerover",fe=a==="mouseout"||a==="pointerout",de&&h!==Ag&&(Pe=h.relatedTarget||h.fromElement)&&(Al(Pe)||Pe[Nl]))break e;if((fe||de)&&(de=ge.window===ge?ge:(de=ge.ownerDocument)?de.defaultView||de.parentWindow:window,fe?(Pe=h.relatedTarget||h.toElement,fe=ce,Pe=Pe?Al(Pe):null,Pe!==null&&(Yt=i(Pe),Xe=Pe.tag,Pe!==Yt||Xe!==5&&Xe!==27&&Xe!==6)&&(Pe=null)):(fe=null,Pe=ce),fe!==Pe)){if(Xe=eS,xe="onMouseLeave",se="onMouseEnter",ee="mouse",(a==="pointerout"||a==="pointerover")&&(Xe=nS,xe="onPointerLeave",se="onPointerEnter",ee="pointer"),Yt=fe==null?de:_c(fe),ue=Pe==null?de:_c(Pe),de=new Xe(xe,ee+"leave",fe,h,ge),de.target=Yt,de.relatedTarget=ue,xe=null,Al(ge)===ce&&(Xe=new Xe(se,ee+"enter",Pe,h,ge),Xe.target=ue,Xe.relatedTarget=Yt,xe=Xe),Yt=xe,fe&&Pe)t:{for(Xe=yB,se=fe,ee=Pe,ue=0,xe=se;xe;xe=Xe(xe))ue++;xe=0;for(var Ge=ee;Ge;Ge=Xe(Ge))xe++;for(;0<ue-xe;)se=Xe(se),ue--;for(;0<xe-ue;)ee=Xe(ee),xe--;for(;ue--;){if(se===ee||ee!==null&&se===ee.alternate){Xe=se;break t}se=Xe(se),ee=Xe(ee)}Xe=null}else Xe=null;fe!==null&&GC(be,de,fe,Xe,!1),Pe!==null&&Yt!==null&&GC(be,Yt,Pe,Xe,!0)}}e:{if(de=ce?_c(ce):window,fe=de.nodeName&&de.nodeName.toLowerCase(),fe==="select"||fe==="input"&&de.type==="file")var Mt=cS;else if(lS(de))if(dS)Mt=_9;else{Mt=A9;var Ue=N9}else fe=de.nodeName,!fe||fe.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ce&&Ng(ce.elementType)&&(Mt=cS):Mt=k9;if(Mt&&(Mt=Mt(a,ce))){uS(be,Mt,h,ge);break e}Ue&&Ue(a,de,ce),a==="focusout"&&ce&&de.type==="number"&&ce.memoizedProps.value!=null&&Cg(de,"number",de.value)}switch(Ue=ce?_c(ce):window,a){case"focusin":(lS(Ue)||Ue.contentEditable==="true")&&(Ll=Ue,zg=ce,Bc=null);break;case"focusout":Bc=zg=Ll=null;break;case"mousedown":Ug=!0;break;case"contextmenu":case"mouseup":case"dragend":Ug=!1,bS(be,h,ge);break;case"selectionchange":if(O9)break;case"keydown":case"keyup":bS(be,h,ge)}var lt;if(Lg)e:{switch(a){case"compositionstart":var Ct="onCompositionStart";break e;case"compositionend":Ct="onCompositionEnd";break e;case"compositionupdate":Ct="onCompositionUpdate";break e}Ct=void 0}else Il?iS(a,h)&&(Ct="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(Ct="onCompositionStart");Ct&&(rS&&h.locale!=="ko"&&(Il||Ct!=="onCompositionStart"?Ct==="onCompositionEnd"&&Il&&(lt=Z2()):(ui=ge,Og="value"in ui?ui.value:ui.textContent,Il=!0)),Ue=pm(ce,Ct),0<Ue.length&&(Ct=new tS(Ct,a,null,h,ge),be.push({event:Ct,listeners:Ue}),lt?Ct.data=lt:(lt=oS(h),lt!==null&&(Ct.data=lt)))),(lt=E9?T9(a,h):S9(a,h))&&(Ct=pm(ce,"onBeforeInput"),0<Ct.length&&(Ue=new tS("onBeforeInput","beforeinput",null,h,ge),be.push({event:Ue,listeners:Ct}),Ue.data=lt)),mB(be,a,ce,h,ge)}qC(be,o)})}function ud(a,o,h){return{instance:a,listener:o,currentTarget:h}}function pm(a,o){for(var h=o+"Capture",g=[];a!==null;){var E=a,S=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||S===null||(E=Rc(a,h),E!=null&&g.unshift(ud(a,E,S)),E=Rc(a,o),E!=null&&g.push(ud(a,E,S))),a.tag===3)return g;a=a.return}return[]}function yB(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function GC(a,o,h,g,E){for(var S=o._reactName,_=[];h!==null&&h!==g;){var F=h,X=F.alternate,ce=F.stateNode;if(F=F.tag,X!==null&&X===g)break;F!==5&&F!==26&&F!==27||ce===null||(X=ce,E?(ce=Rc(h,S),ce!=null&&_.unshift(ud(h,ce,X))):E||(ce=Rc(h,S),ce!=null&&_.push(ud(h,ce,X)))),h=h.return}_.length!==0&&a.push({event:o,listeners:_})}var bB=/\r\n?/g,vB=/\u0000|\uFFFD/g;function KC(a){return(typeof a=="string"?a:""+a).replace(bB,`
|
|
50
|
-
`).replace(vB,"")}function QC(a,o){return o=KC(o),KC(a)===o}function qt(a,o,h,g,E,S){switch(h){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||Dl(a,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&Dl(a,""+g);break;case"className":bh(a,"class",g);break;case"tabIndex":bh(a,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":bh(a,h,g);break;case"style":Q2(a,g,S);break;case"data":if(o!=="object"){bh(a,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||h!=="href")){a.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(h);break}g=Eh(""+g),a.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){a.setAttribute(h,"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 S=="function"&&(h==="formAction"?(o!=="input"&&qt(a,o,"name",E.name,E,null),qt(a,o,"formEncType",E.formEncType,E,null),qt(a,o,"formMethod",E.formMethod,E,null),qt(a,o,"formTarget",E.formTarget,E,null)):(qt(a,o,"encType",E.encType,E,null),qt(a,o,"method",E.method,E,null),qt(a,o,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(h);break}g=Eh(""+g),a.setAttribute(h,g);break;case"onClick":g!=null&&(a.onclick=Na);break;case"onScroll":g!=null&&yt("scroll",a);break;case"onScrollEnd":g!=null&&yt("scrollend",a);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(E.children!=null)throw Error(r(60));a.innerHTML=h}}break;case"multiple":a.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":a.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){a.removeAttribute("xlink:href");break}h=Eh(""+g),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,""+g):a.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,""):a.removeAttribute(h);break;case"capture":case"download":g===!0?a.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,g):a.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?a.setAttribute(h,g):a.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?a.removeAttribute(h):a.setAttribute(h,g);break;case"popover":yt("beforetoggle",a),yt("toggle",a),yh(a,"popover",g);break;case"xlinkActuate":Ca(a,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ca(a,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ca(a,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ca(a,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ca(a,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ca(a,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ca(a,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ca(a,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ca(a,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":yh(a,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=K8.get(h)||h,yh(a,h,g))}}function f1(a,o,h,g,E,S){switch(h){case"style":Q2(a,g,S);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(E.children!=null)throw Error(r(60));a.innerHTML=h}}break;case"children":typeof g=="string"?Dl(a,g):(typeof g=="number"||typeof g=="bigint")&&Dl(a,""+g);break;case"onScroll":g!=null&&yt("scroll",a);break;case"onScrollEnd":g!=null&&yt("scrollend",a);break;case"onClick":g!=null&&(a.onclick=Na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!z2.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(E=h.endsWith("Capture"),o=h.slice(2,E?h.length-7:void 0),S=a[Or]||null,S=S!=null?S[h]:null,typeof S=="function"&&a.removeEventListener(o,S,E),typeof g=="function")){typeof S!="function"&&S!==null&&(h in a?a[h]=null:a.hasAttribute(h)&&a.removeAttribute(h)),a.addEventListener(o,g,E);break e}h in a?a[h]=g:g===!0?a.setAttribute(h,""):yh(a,h,g)}}}function lr(a,o,h){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",a),yt("load",a);var g=!1,E=!1,S;for(S in h)if(h.hasOwnProperty(S)){var _=h[S];if(_!=null)switch(S){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:qt(a,o,S,_,h,null)}}E&&qt(a,o,"srcSet",h.srcSet,h,null),g&&qt(a,o,"src",h.src,h,null);return;case"input":yt("invalid",a);var F=S=_=E=null,X=null,ce=null;for(g in h)if(h.hasOwnProperty(g)){var ge=h[g];if(ge!=null)switch(g){case"name":E=ge;break;case"type":_=ge;break;case"checked":X=ge;break;case"defaultChecked":ce=ge;break;case"value":S=ge;break;case"defaultValue":F=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,o));break;default:qt(a,o,g,ge,h,null)}}q2(a,S,F,X,ce,_,E,!1);return;case"select":yt("invalid",a),g=_=S=null;for(E in h)if(h.hasOwnProperty(E)&&(F=h[E],F!=null))switch(E){case"value":S=F;break;case"defaultValue":_=F;break;case"multiple":g=F;default:qt(a,o,E,F,h,null)}o=S,h=_,a.multiple=!!g,o!=null?Ol(a,!!g,o,!1):h!=null&&Ol(a,!!g,h,!0);return;case"textarea":yt("invalid",a),S=E=g=null;for(_ in h)if(h.hasOwnProperty(_)&&(F=h[_],F!=null))switch(_){case"value":g=F;break;case"defaultValue":E=F;break;case"children":S=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(91));break;default:qt(a,o,_,F,h,null)}G2(a,g,E,S);return;case"option":for(X in h)if(h.hasOwnProperty(X)&&(g=h[X],g!=null))switch(X){case"selected":a.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:qt(a,o,X,g,h,null)}return;case"dialog":yt("beforetoggle",a),yt("toggle",a),yt("cancel",a),yt("close",a);break;case"iframe":case"object":yt("load",a);break;case"video":case"audio":for(g=0;g<ld.length;g++)yt(ld[g],a);break;case"image":yt("error",a),yt("load",a);break;case"details":yt("toggle",a);break;case"embed":case"source":case"link":yt("error",a),yt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in h)if(h.hasOwnProperty(ce)&&(g=h[ce],g!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:qt(a,o,ce,g,h,null)}return;default:if(Ng(o)){for(ge in h)h.hasOwnProperty(ge)&&(g=h[ge],g!==void 0&&f1(a,o,ge,g,h,void 0));return}}for(F in h)h.hasOwnProperty(F)&&(g=h[F],g!=null&&qt(a,o,F,g,h,null))}function EB(a,o,h,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,S=null,_=null,F=null,X=null,ce=null,ge=null;for(fe in h){var be=h[fe];if(h.hasOwnProperty(fe)&&be!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":X=be;default:g.hasOwnProperty(fe)||qt(a,o,fe,null,g,be)}}for(var de in g){var fe=g[de];if(be=h[de],g.hasOwnProperty(de)&&(fe!=null||be!=null))switch(de){case"type":S=fe;break;case"name":E=fe;break;case"checked":ce=fe;break;case"defaultChecked":ge=fe;break;case"value":_=fe;break;case"defaultValue":F=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,o));break;default:fe!==be&&qt(a,o,de,fe,g,be)}}wg(a,_,F,X,ce,ge,S,E);return;case"select":fe=_=F=de=null;for(S in h)if(X=h[S],h.hasOwnProperty(S)&&X!=null)switch(S){case"value":break;case"multiple":fe=X;default:g.hasOwnProperty(S)||qt(a,o,S,null,g,X)}for(E in g)if(S=g[E],X=h[E],g.hasOwnProperty(E)&&(S!=null||X!=null))switch(E){case"value":de=S;break;case"defaultValue":F=S;break;case"multiple":_=S;default:S!==X&&qt(a,o,E,S,g,X)}o=F,h=_,g=fe,de!=null?Ol(a,!!h,de,!1):!!g!=!!h&&(o!=null?Ol(a,!!h,o,!0):Ol(a,!!h,h?[]:"",!1));return;case"textarea":fe=de=null;for(F in h)if(E=h[F],h.hasOwnProperty(F)&&E!=null&&!g.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:qt(a,o,F,null,g,E)}for(_ in g)if(E=g[_],S=h[_],g.hasOwnProperty(_)&&(E!=null||S!=null))switch(_){case"value":de=E;break;case"defaultValue":fe=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==S&&qt(a,o,_,E,g,S)}Y2(a,de,fe);return;case"option":for(var Pe in h)if(de=h[Pe],h.hasOwnProperty(Pe)&&de!=null&&!g.hasOwnProperty(Pe))switch(Pe){case"selected":a.selected=!1;break;default:qt(a,o,Pe,null,g,de)}for(X in g)if(de=g[X],fe=h[X],g.hasOwnProperty(X)&&de!==fe&&(de!=null||fe!=null))switch(X){case"selected":a.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:qt(a,o,X,de,g,fe)}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 Xe in h)de=h[Xe],h.hasOwnProperty(Xe)&&de!=null&&!g.hasOwnProperty(Xe)&&qt(a,o,Xe,null,g,de);for(ce in g)if(de=g[ce],fe=h[ce],g.hasOwnProperty(ce)&&de!==fe&&(de!=null||fe!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,o));break;default:qt(a,o,ce,de,g,fe)}return;default:if(Ng(o)){for(var Yt in h)de=h[Yt],h.hasOwnProperty(Yt)&&de!==void 0&&!g.hasOwnProperty(Yt)&&f1(a,o,Yt,void 0,g,de);for(ge in g)de=g[ge],fe=h[ge],!g.hasOwnProperty(ge)||de===fe||de===void 0&&fe===void 0||f1(a,o,ge,de,g,fe);return}}for(var se in h)de=h[se],h.hasOwnProperty(se)&&de!=null&&!g.hasOwnProperty(se)&&qt(a,o,se,null,g,de);for(be in g)de=g[be],fe=h[be],!g.hasOwnProperty(be)||de===fe||de==null&&fe==null||qt(a,o,be,de,g,fe)}function XC(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TB(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var E=h[g],S=E.transferSize,_=E.initiatorType,F=E.duration;if(S&&F&&XC(_)){for(_=0,F=E.responseEnd,g+=1;g<h.length;g++){var X=h[g],ce=X.startTime;if(ce>F)break;var ge=X.transferSize,be=X.initiatorType;ge&&XC(be)&&(X=X.responseEnd,_+=ge*(X<F?1:(F-ce)/(X-ce)))}if(--g,o+=8*(S+_)/(E.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var h1=null,m1=null;function gm(a){return a.nodeType===9?a:a.ownerDocument}function WC(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ZC(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function p1(a,o){return a==="textarea"||a==="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 g1=null;function SB(){var a=window.event;return a&&a.type==="popstate"?a===g1?!1:(g1=a,!0):(g1=null,!1)}var JC=typeof setTimeout=="function"?setTimeout:void 0,wB=typeof clearTimeout=="function"?clearTimeout:void 0,eN=typeof Promise=="function"?Promise:void 0,CB=typeof queueMicrotask=="function"?queueMicrotask:typeof eN<"u"?function(a){return eN.resolve(null).then(a).catch(NB)}:JC;function NB(a){setTimeout(function(){throw a})}function Ni(a){return a==="head"}function tN(a,o){var h=o,g=0;do{var E=h.nextSibling;if(a.removeChild(h),E&&E.nodeType===8)if(h=E.data,h==="/$"||h==="/&"){if(g===0){a.removeChild(E),uu(o);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")cd(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,cd(h);for(var S=h.firstChild;S;){var _=S.nextSibling,F=S.nodeName;S[kc]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&S.rel.toLowerCase()==="stylesheet"||h.removeChild(S),S=_}}else h==="body"&&cd(a.ownerDocument.body);h=E}while(h);uu(o)}function nN(a,o){var h=a;a=0;do{var g=h.nextSibling;if(h.nodeType===1?o?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(o?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(a===0)break;a--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||a++;h=g}while(h)}function x1(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var h=o;switch(o=o.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":x1(h),Tg(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function AB(a,o,h,g){for(;a.nodeType===1;){var E=h;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(g){if(!a[kc])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==E.rel||a.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||a.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||a.getAttribute("title")!==(E.title==null?null:E.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(E.src==null?null:E.src)||a.getAttribute("type")!==(E.type==null?null:E.type)||a.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var S=E.name==null?null:""+E.name;if(E.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=fs(a.nextSibling),a===null)break}return null}function kB(a,o,h){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=fs(a.nextSibling),a===null))return null;return a}function rN(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=fs(a.nextSibling),a===null))return null;return a}function y1(a){return a.data==="$?"||a.data==="$~"}function b1(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function _B(a,o){var h=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||h.readyState!=="loading")o();else{var g=function(){o(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),a._reactRetry=g}}function fs(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var v1=null;function sN(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(o===0)return fs(a.nextSibling);o--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||o++}a=a.nextSibling}return null}function aN(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(o===0)return a;o--}else h!=="/$"&&h!=="/&"||o++}a=a.previousSibling}return null}function iN(a,o,h){switch(o=gm(h),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function cd(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);Tg(a)}var hs=new Map,oN=new Set;function xm(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ha=B.d;B.d={f:RB,r:OB,D:DB,C:jB,L:MB,m:IB,X:PB,S:LB,M:BB};function RB(){var a=Ha.f(),o=lm();return a||o}function OB(a){var o=kl(a);o!==null&&o.tag===5&&o.type==="form"?ww(o):Ha.r(a)}var iu=typeof document>"u"?null:document;function lN(a,o,h){var g=iu;if(g&&typeof o=="string"&&o){var E=as(o);E='link[rel="'+a+'"][href="'+E+'"]',typeof h=="string"&&(E+='[crossorigin="'+h+'"]'),oN.has(E)||(oN.add(E),a={rel:a,crossOrigin:h,href:o},g.querySelector(E)===null&&(o=g.createElement("link"),lr(o,"link",a),Xn(o),g.head.appendChild(o)))}}function DB(a){Ha.D(a),lN("dns-prefetch",a,null)}function jB(a,o){Ha.C(a,o),lN("preconnect",a,o)}function MB(a,o,h){Ha.L(a,o,h);var g=iu;if(g&&a&&o){var E='link[rel="preload"][as="'+as(o)+'"]';o==="image"&&h&&h.imageSrcSet?(E+='[imagesrcset="'+as(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(E+='[imagesizes="'+as(h.imageSizes)+'"]')):E+='[href="'+as(a)+'"]';var S=E;switch(o){case"style":S=ou(a);break;case"script":S=lu(a)}hs.has(S)||(a=m({rel:"preload",href:o==="image"&&h&&h.imageSrcSet?void 0:a,as:o},h),hs.set(S,a),g.querySelector(E)!==null||o==="style"&&g.querySelector(dd(S))||o==="script"&&g.querySelector(fd(S))||(o=g.createElement("link"),lr(o,"link",a),Xn(o),g.head.appendChild(o)))}}function IB(a,o){Ha.m(a,o);var h=iu;if(h&&a){var g=o&&typeof o.as=="string"?o.as:"script",E='link[rel="modulepreload"][as="'+as(g)+'"][href="'+as(a)+'"]',S=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=lu(a)}if(!hs.has(S)&&(a=m({rel:"modulepreload",href:a},o),hs.set(S,a),h.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(fd(S)))return}g=h.createElement("link"),lr(g,"link",a),Xn(g),h.head.appendChild(g)}}}function LB(a,o,h){Ha.S(a,o,h);var g=iu;if(g&&a){var E=_l(g).hoistableStyles,S=ou(a);o=o||"default";var _=E.get(S);if(!_){var F={loading:0,preload:null};if(_=g.querySelector(dd(S)))F.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":o},h),(h=hs.get(S))&&E1(a,h);var X=_=g.createElement("link");Xn(X),lr(X,"link",a),X._p=new Promise(function(ce,ge){X.onload=ce,X.onerror=ge}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,ym(_,o,g)}_={type:"stylesheet",instance:_,count:1,state:F},E.set(S,_)}}}function PB(a,o){Ha.X(a,o);var h=iu;if(h&&a){var g=_l(h).hoistableScripts,E=lu(a),S=g.get(E);S||(S=h.querySelector(fd(E)),S||(a=m({src:a,async:!0},o),(o=hs.get(E))&&T1(a,o),S=h.createElement("script"),Xn(S),lr(S,"link",a),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},g.set(E,S))}}function BB(a,o){Ha.M(a,o);var h=iu;if(h&&a){var g=_l(h).hoistableScripts,E=lu(a),S=g.get(E);S||(S=h.querySelector(fd(E)),S||(a=m({src:a,async:!0,type:"module"},o),(o=hs.get(E))&&T1(a,o),S=h.createElement("script"),Xn(S),lr(S,"link",a),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},g.set(E,S))}}function uN(a,o,h,g){var E=(E=me.current)?xm(E):null;if(!E)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(o=ou(h.href),h=_l(E).hoistableStyles,g=h.get(o),g||(g={type:"style",instance:null,count:0,state:null},h.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){a=ou(h.href);var S=_l(E).hoistableStyles,_=S.get(a);if(_||(E=E.ownerDocument||E,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,_),(S=E.querySelector(dd(a)))&&!S._p&&(_.instance=S,_.state.loading=5),hs.has(a)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},hs.set(a,h),S||FB(E,a,h,_.state))),o&&g===null)throw Error(r(528,""));return _}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=h.async,h=h.src,typeof h=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=lu(h),h=_l(E).hoistableScripts,g=h.get(o),g||(g={type:"script",instance:null,count:0,state:null},h.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function ou(a){return'href="'+as(a)+'"'}function dd(a){return'link[rel="stylesheet"]['+a+"]"}function cN(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function FB(a,o,h,g){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=a.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),lr(o,"link",h),Xn(o),a.head.appendChild(o))}function lu(a){return'[src="'+as(a)+'"]'}function fd(a){return"script[async]"+a}function dN(a,o,h){if(o.count++,o.instance===null)switch(o.type){case"style":var g=a.querySelector('style[data-href~="'+as(h.href)+'"]');if(g)return o.instance=g,Xn(g),g;var E=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(a.ownerDocument||a).createElement("style"),Xn(g),lr(g,"style",E),ym(g,h.precedence,a),o.instance=g;case"stylesheet":E=ou(h.href);var S=a.querySelector(dd(E));if(S)return o.state.loading|=4,o.instance=S,Xn(S),S;g=cN(h),(E=hs.get(E))&&E1(g,E),S=(a.ownerDocument||a).createElement("link"),Xn(S);var _=S;return _._p=new Promise(function(F,X){_.onload=F,_.onerror=X}),lr(S,"link",g),o.state.loading|=4,ym(S,h.precedence,a),o.instance=S;case"script":return S=lu(h.src),(E=a.querySelector(fd(S)))?(o.instance=E,Xn(E),E):(g=h,(E=hs.get(S))&&(g=m({},h),T1(g,E)),a=a.ownerDocument||a,E=a.createElement("script"),Xn(E),lr(E,"link",g),a.head.appendChild(E),o.instance=E);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,ym(g,h.precedence,a));return o.instance}function ym(a,o,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,S=E,_=0;_<g.length;_++){var F=g[_];if(F.dataset.precedence===o)S=F;else if(S!==E)break}S?S.parentNode.insertBefore(a,S.nextSibling):(o=h.nodeType===9?h.head:h,o.insertBefore(a,o.firstChild))}function E1(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function T1(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var bm=null;function fN(a,o,h){if(bm===null){var g=new Map,E=bm=new Map;E.set(h,g)}else E=bm,g=E.get(h),g||(g=new Map,E.set(h,g));if(g.has(a))return g;for(g.set(a,null),h=h.getElementsByTagName(a),E=0;E<h.length;E++){var S=h[E];if(!(S[kc]||S[sr]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var _=S.getAttribute(o)||"";_=a+_;var F=g.get(_);F?F.push(S):g.set(_,[S])}}return g}function hN(a,o,h){a=a.ownerDocument||a,a.head.insertBefore(h,o==="title"?a.querySelector("head > title"):null)}function zB(a,o,h){if(h===1||o.itemProp!=null)return!1;switch(a){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 a=o.disabled,typeof o.precedence=="string"&&a==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 mN(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function UB(a,o,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var E=ou(g.href),S=o.querySelector(dd(E));if(S){o=S._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=vm.bind(a),o.then(a,a)),h.state.loading|=4,h.instance=S,Xn(S);return}S=o.ownerDocument||o,g=cN(g),(E=hs.get(E))&&E1(g,E),S=S.createElement("link"),Xn(S);var _=S;_._p=new Promise(function(F,X){_.onload=F,_.onerror=X}),lr(S,"link",g),h.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(h,o),(o=h.state.preload)&&(h.state.loading&3)===0&&(a.count++,h=vm.bind(a),o.addEventListener("load",h),o.addEventListener("error",h))}}var S1=0;function HB(a,o){return a.stylesheets&&a.count===0&&Tm(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var g=setTimeout(function(){if(a.stylesheets&&Tm(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+o);0<a.imgBytes&&S1===0&&(S1=62500*TB());var E=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Tm(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>S1?50:800)+o);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function vm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Em=null;function Tm(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Em=new Map,o.forEach($B,a),Em=null,vm.call(a))}function $B(a,o){if(!(o.state.loading&4)){var h=Em.get(a);if(h)var g=h.get(null);else{h=new Map,Em.set(a,h);for(var E=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<E.length;S++){var _=E[S];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(h.set(_.dataset.precedence,_),g=_)}g&&h.set(null,g)}E=o.instance,_=E.getAttribute("data-precedence"),S=h.get(_)||g,S===g&&h.set(null,E),h.set(_,E),this.count++,g=vm.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),S?S.parentNode.insertBefore(E,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(E,a.firstChild)),o.state.loading|=4}}var hd={$$typeof:k,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function VB(a,o,h,g,E,S,_,F,X){this.tag=1,this.containerInfo=a,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=dr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dr(0),this.hiddenUpdates=dr(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=S,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function pN(a,o,h,g,E,S,_,F,X,ce,ge,be){return a=new VB(a,o,h,_,X,ce,ge,be,F),o=1,S===!0&&(o|=24),S=qr(3,null,null,o),a.current=S,S.stateNode=a,o=nx(),o.refCount++,a.pooledCache=o,o.refCount++,S.memoizedState={element:g,isDehydrated:h,cache:o},ix(S),a}function gN(a){return a?(a=Fl,a):Fl}function xN(a,o,h,g,E,S){E=gN(E),g.context===null?g.context=E:g.pendingContext=E,g=pi(o),g.payload={element:h},S=S===void 0?null:S,S!==null&&(g.callback=S),h=gi(a,g,o),h!==null&&(Pr(h,a,o),qc(h,a,o))}function yN(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<o?h:o}}function w1(a,o){yN(a,o),(a=a.alternate)&&yN(a,o)}function bN(a){if(a.tag===13||a.tag===31){var o=bo(a,67108864);o!==null&&Pr(o,a,67108864),w1(a,67108864)}}function vN(a){if(a.tag===13||a.tag===31){var o=Xr();o=Cl(o);var h=bo(a,o);h!==null&&Pr(h,a,o),w1(a,o)}}var Sm=!0;function qB(a,o,h,g){var E=L.T;L.T=null;var S=B.p;try{B.p=2,C1(a,o,h,g)}finally{B.p=S,L.T=E}}function YB(a,o,h,g){var E=L.T;L.T=null;var S=B.p;try{B.p=8,C1(a,o,h,g)}finally{B.p=S,L.T=E}}function C1(a,o,h,g){if(Sm){var E=N1(g);if(E===null)d1(a,o,g,wm,h),TN(a,g);else if(KB(E,a,o,h,g))g.stopPropagation();else if(TN(a,g),o&4&&-1<GB.indexOf(a)){for(;E!==null;){var S=kl(E);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var _=ot(S.pendingLanes);if(_!==0){var F=S;for(F.pendingLanes|=2,F.entangledLanes|=2;_;){var X=1<<31-Ot(_);F.entanglements[1]|=X,_&=~X}Ws(S),(Bt&6)===0&&(im=it()+500,od(0))}}break;case 31:case 13:F=bo(S,2),F!==null&&Pr(F,S,2),lm(),w1(S,2)}if(S=N1(g),S===null&&d1(a,o,g,wm,h),S===E)break;E=S}E!==null&&g.stopPropagation()}else d1(a,o,g,null,h)}}function N1(a){return a=kg(a),A1(a)}var wm=null;function A1(a){if(wm=null,a=Al(a),a!==null){var o=i(a);if(o===null)a=null;else{var h=o.tag;if(h===13){if(a=l(o),a!==null)return a;a=null}else if(h===31){if(a=c(o),a!==null)return a;a=null}else if(h===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return wm=a,null}function EN(a){switch(a){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(Rt()){case pe:return 2;case Ne:return 8;case Ve:case et:return 32;case st:return 268435456;default:return 32}default:return 32}}var k1=!1,Ai=null,ki=null,_i=null,md=new Map,pd=new Map,Ri=[],GB="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 TN(a,o){switch(a){case"focusin":case"focusout":Ai=null;break;case"dragenter":case"dragleave":ki=null;break;case"mouseover":case"mouseout":_i=null;break;case"pointerover":case"pointerout":md.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":pd.delete(o.pointerId)}}function gd(a,o,h,g,E,S){return a===null||a.nativeEvent!==S?(a={blockedOn:o,domEventName:h,eventSystemFlags:g,nativeEvent:S,targetContainers:[E]},o!==null&&(o=kl(o),o!==null&&bN(o)),a):(a.eventSystemFlags|=g,o=a.targetContainers,E!==null&&o.indexOf(E)===-1&&o.push(E),a)}function KB(a,o,h,g,E){switch(o){case"focusin":return Ai=gd(Ai,a,o,h,g,E),!0;case"dragenter":return ki=gd(ki,a,o,h,g,E),!0;case"mouseover":return _i=gd(_i,a,o,h,g,E),!0;case"pointerover":var S=E.pointerId;return md.set(S,gd(md.get(S)||null,a,o,h,g,E)),!0;case"gotpointercapture":return S=E.pointerId,pd.set(S,gd(pd.get(S)||null,a,o,h,g,E)),!0}return!1}function SN(a){var o=Al(a.target);if(o!==null){var h=i(o);if(h!==null){if(o=h.tag,o===13){if(o=l(h),o!==null){a.blockedOn=o,P2(a.priority,function(){vN(h)});return}}else if(o===31){if(o=c(h),o!==null){a.blockedOn=o,P2(a.priority,function(){vN(h)});return}}else if(o===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Cm(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var h=N1(a.nativeEvent);if(h===null){h=a.nativeEvent;var g=new h.constructor(h.type,h);Ag=g,h.target.dispatchEvent(g),Ag=null}else return o=kl(h),o!==null&&bN(o),a.blockedOn=h,!1;o.shift()}return!0}function wN(a,o,h){Cm(a)&&h.delete(o)}function QB(){k1=!1,Ai!==null&&Cm(Ai)&&(Ai=null),ki!==null&&Cm(ki)&&(ki=null),_i!==null&&Cm(_i)&&(_i=null),md.forEach(wN),pd.forEach(wN)}function Nm(a,o){a.blockedOn===o&&(a.blockedOn=null,k1||(k1=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,QB)))}var Am=null;function CN(a){Am!==a&&(Am=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Am===a&&(Am=null);for(var o=0;o<a.length;o+=3){var h=a[o],g=a[o+1],E=a[o+2];if(typeof g!="function"){if(A1(g||h)===null)continue;break}var S=kl(h);S!==null&&(a.splice(o,3),o-=3,Nx(S,{pending:!0,data:E,method:h.method,action:g},g,E))}}))}function uu(a){function o(X){return Nm(X,a)}Ai!==null&&Nm(Ai,a),ki!==null&&Nm(ki,a),_i!==null&&Nm(_i,a),md.forEach(o),pd.forEach(o);for(var h=0;h<Ri.length;h++){var g=Ri[h];g.blockedOn===a&&(g.blockedOn=null)}for(;0<Ri.length&&(h=Ri[0],h.blockedOn===null);)SN(h),h.blockedOn===null&&Ri.shift();if(h=(a.ownerDocument||a).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var E=h[g],S=h[g+1],_=E[Or]||null;if(typeof S=="function")_||CN(h);else if(_){var F=null;if(S&&S.hasAttribute("formAction")){if(E=S,_=S[Or]||null)F=_.formAction;else if(A1(E)!==null)continue}else F=_.action;typeof F=="function"?h[g+1]=F:(h.splice(g,3),g-=3),CN(h)}}}function NN(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(_){return E=_})},focusReset:"manual",scroll:"manual"})}function o(){E!==null&&(E(),E=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),E!==null&&(E(),E=null)}}}function _1(a){this._internalRoot=a}km.prototype.render=_1.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var h=o.current,g=Xr();xN(h,g,a,o,null,null)},km.prototype.unmount=_1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;xN(a.current,2,null,a,null,null),lm(),o[Nl]=null}};function km(a){this._internalRoot=a}km.prototype.unstable_scheduleHydration=function(a){if(a){var o=vg();a={blockedOn:null,target:a,priority:o};for(var h=0;h<Ri.length&&o!==0&&o<Ri[h].priority;h++);Ri.splice(h,0,a),h===0&&SN(a)}};var AN=t.version;if(AN!=="19.2.4")throw Error(r(527,AN,"19.2.4"));B.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=d(o),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var XB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _m=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_m.isDisabled&&_m.supportsFiber)try{vn=_m.inject(XB),nn=_m}catch{}}return yd.createRoot=function(a,o){if(!s(a))throw Error(r(299));var h=!1,g="",E=Mw,S=Iw,_=Lw;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(E=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError)),o=pN(a,1,!1,null,null,h,g,null,E,S,_,NN),a[Nl]=o.current,c1(a),new _1(o)},yd.hydrateRoot=function(a,o,h){if(!s(a))throw Error(r(299));var g=!1,E="",S=Mw,_=Iw,F=Lw,X=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onUncaughtError!==void 0&&(S=h.onUncaughtError),h.onCaughtError!==void 0&&(_=h.onCaughtError),h.onRecoverableError!==void 0&&(F=h.onRecoverableError),h.formState!==void 0&&(X=h.formState)),o=pN(a,1,!0,o,h??null,g,E,X,S,_,F,NN),o.context=gN(null),h=o.current,g=Xr(),g=Cl(g),E=pi(g),E.callback=null,gi(h,E,g),h=g,o.current.lanes=h,jt(o,h),Ws(o),a[Nl]=o.current,c1(a),new km(o)},yd.version="19.2.4",yd}var FN;function c7(){if(FN)return j1.exports;FN=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(),j1.exports=u7(),j1.exports}var d7=c7();const f7=ml(d7);var sc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},h7={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ui,aE,n5,m7=(n5=class{constructor(){Ye(this,Ui,h7);Ye(this,aE,!1)}setTimeoutProvider(e){Me(this,Ui,e)}setTimeout(e,t){return Z(this,Ui).setTimeout(e,t)}clearTimeout(e){Z(this,Ui).clearTimeout(e)}setInterval(e,t){return Z(this,Ui).setInterval(e,t)}clearInterval(e){Z(this,Ui).clearInterval(e)}},Ui=new WeakMap,aE=new WeakMap,n5),Bo=new m7;function p7(e){setTimeout(e,0)}var rl=typeof window>"u"||"Deno"in globalThis;function Tr(){}function g7(e,t){return typeof e=="function"?e(t):e}function Eb(e){return typeof e=="number"&&e>=0&&e!==1/0}function m5(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zi(e,t){return typeof e=="function"?e(t):e}function ps(e,t){return typeof e=="function"?e(t):e}function zN(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==oE(l,t.options))return!1}else if(!lf(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||i&&!i(t))}function UN(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(sl(t.options.mutationKey)!==sl(i))return!1}else if(!lf(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function oE(e,t){return((t==null?void 0:t.queryKeyHashFn)||sl)(e)}function sl(e){return JSON.stringify(e,(t,n)=>Tb(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function lf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>lf(e[n],t[n])):!1}var x7=Object.prototype.hasOwnProperty;function p5(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=HN(e)&&HN(t);if(!r&&!(Tb(e)&&Tb(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let p=0;p<c;p++){const m=r?p:l[p],x=e[m],y=t[m];if(x===y){f[m]=x,(r?p<i:x7.call(e,m))&&d++;continue}if(x===null||y===null||typeof x!="object"||typeof y!="object"){f[m]=y;continue}const v=p5(x,y,n+1);f[m]=v,v===x&&d++}return i===c&&d===i?e:f}function kp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function HN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tb(e){if(!$N(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!$N(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $N(e){return Object.prototype.toString.call(e)==="[object Object]"}function y7(e){return new Promise(t=>{Bo.setTimeout(t,e)})}function Sb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?p5(e,t):t}function b7(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function v7(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var lE=Symbol();function g5(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===lE?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function uE(e,t){return typeof e=="function"?e(...t):!!e}function E7(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Ho,Hi,Fu,r5,T7=(r5=class extends sc{constructor(){super();Ye(this,Ho);Ye(this,Hi);Ye(this,Fu);Me(this,Fu,t=>{if(!rl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,Hi)||this.setEventListener(Z(this,Fu))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Hi))==null||t.call(this),Me(this,Hi,void 0))}setEventListener(t){var n;Me(this,Fu,t),(n=Z(this,Hi))==null||n.call(this),Me(this,Hi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Ho)!==t&&(Me(this,Ho,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Z(this,Ho)=="boolean"?Z(this,Ho):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ho=new WeakMap,Hi=new WeakMap,Fu=new WeakMap,r5),cE=new T7;function wb(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var S7=p7;function w7(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=S7;const i=c=>{t?e.push(c):s(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&s(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{i(()=>{c(...f)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}var Yn=w7(),zu,$i,Uu,s5,C7=(s5=class extends sc{constructor(){super();Ye(this,zu,!0);Ye(this,$i);Ye(this,Uu);Me(this,Uu,t=>{if(!rl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,$i)||this.setEventListener(Z(this,Uu))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,$i))==null||t.call(this),Me(this,$i,void 0))}setEventListener(t){var n;Me(this,Uu,t),(n=Z(this,$i))==null||n.call(this),Me(this,$i,t(this.setOnline.bind(this)))}setOnline(t){Z(this,zu)!==t&&(Me(this,zu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,zu)}},zu=new WeakMap,$i=new WeakMap,Uu=new WeakMap,s5),_p=new C7;function N7(e){return Math.min(1e3*2**e,3e4)}function x5(e){return(e??"online")==="online"?_p.isOnline():!0}var Cb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function y5(e){let t=!1,n=0,r;const s=wb(),i=()=>s.status!=="pending",l=T=>{var w;if(!i()){const N=new Cb(T);x(N),(w=e.onCancel)==null||w.call(e,N)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>cE.isFocused()&&(e.networkMode==="always"||_p.isOnline())&&e.canRun(),p=()=>x5(e.networkMode)&&e.canRun(),m=T=>{i()||(r==null||r(),s.resolve(T))},x=T=>{i()||(r==null||r(),s.reject(T))},y=()=>new Promise(T=>{var w;r=N=>{(i()||d())&&T(N)},(w=e.onPause)==null||w.call(e)}).then(()=>{var T;r=void 0,i()||(T=e.onContinue)==null||T.call(e)}),v=()=>{if(i())return;let T;const w=n===0?e.initialPromise:void 0;try{T=w??e.fn()}catch(N){T=Promise.reject(N)}Promise.resolve(T).then(m).catch(N=>{var O;if(i())return;const A=e.retry??(rl?0:3),k=e.retryDelay??N7,R=typeof k=="function"?k(n,N):k,D=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,N);if(t||!D){x(N);return}n++,(O=e.onFail)==null||O.call(e,n,N),y7(R).then(()=>d()?void 0:y()).then(()=>{t?x(N):v()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:c,continueRetry:f,canStart:p,start:()=>(p()?v():y().then(v),s)}}var $o,a5,b5=(a5=class{constructor(){Ye(this,$o)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Eb(this.gcTime)&&Me(this,$o,Bo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rl?1/0:300*1e3))}clearGcTimeout(){Z(this,$o)&&(Bo.clearTimeout(Z(this,$o)),Me(this,$o,void 0))}},$o=new WeakMap,a5),Vo,Hu,ms,qo,er,kf,Yo,Ls,Va,i5,A7=(i5=class extends b5{constructor(t){super();Ye(this,Ls);Ye(this,Vo);Ye(this,Hu);Ye(this,ms);Ye(this,qo);Ye(this,er);Ye(this,kf);Ye(this,Yo);Me(this,Yo,!1),Me(this,kf,t.defaultOptions),this.setOptions(t.options),this.observers=[],Me(this,qo,t.client),Me(this,ms,Z(this,qo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Me(this,Vo,qN(this.options)),this.state=t.state??Z(this,Vo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Z(this,er))==null?void 0:t.promise}setOptions(t){if(this.options={...Z(this,kf),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=qN(this.options);n.data!==void 0&&(this.setState(VN(n.data,n.dataUpdatedAt)),Me(this,Vo,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Z(this,ms).remove(this)}setData(t,n){const r=Sb(this.state.data,t,this.options);return ct(this,Ls,Va).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ct(this,Ls,Va).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=Z(this,er))==null?void 0:r.promise;return(s=Z(this,er))==null||s.cancel(t),n?n.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Z(this,Vo))}isActive(){return this.observers.some(t=>ps(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lE||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Zi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!m5(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,er))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,er))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Z(this,ms).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Z(this,er)&&(Z(this,Yo)?Z(this,er).cancel({revert:!0}):Z(this,er).cancelRetry()),this.scheduleGc()),Z(this,ms).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ct(this,Ls,Va).call(this,{type:"invalidate"})}async fetch(t,n){var f,d,p,m,x,y,v,T,w,N,A,k;if(this.state.fetchStatus!=="idle"&&((f=Z(this,er))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,er))return Z(this,er).continueRetry(),Z(this,er).promise}if(t&&this.setOptions(t),!this.options.queryFn){const R=this.observers.find(D=>D.options.queryFn);R&&this.setOptions(R.options)}const r=new AbortController,s=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(Me(this,Yo,!0),r.signal)})},i=()=>{const R=g5(this.options,n),O=(()=>{const M={client:Z(this,qo),queryKey:this.queryKey,meta:this.meta};return s(M),M})();return Me(this,Yo,!1),this.options.persister?this.options.persister(R,O,this):R(O)},c=(()=>{const R={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Z(this,qo),state:this.state,fetchFn:i};return s(R),R})();(d=this.options.behavior)==null||d.onFetch(c,this),Me(this,Hu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=c.fetchOptions)==null?void 0:p.meta))&&ct(this,Ls,Va).call(this,{type:"fetch",meta:(m=c.fetchOptions)==null?void 0:m.meta}),Me(this,er,y5({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:R=>{R instanceof Cb&&R.revert&&this.setState({...Z(this,Hu),fetchStatus:"idle"}),r.abort()},onFail:(R,D)=>{ct(this,Ls,Va).call(this,{type:"failed",failureCount:R,error:D})},onPause:()=>{ct(this,Ls,Va).call(this,{type:"pause"})},onContinue:()=>{ct(this,Ls,Va).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const R=await Z(this,er).start();if(R===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(R),(y=(x=Z(this,ms).config).onSuccess)==null||y.call(x,R,this),(T=(v=Z(this,ms).config).onSettled)==null||T.call(v,R,this.state.error,this),R}catch(R){if(R instanceof Cb){if(R.silent)return Z(this,er).promise;if(R.revert){if(this.state.data===void 0)throw R;return this.state.data}}throw ct(this,Ls,Va).call(this,{type:"error",error:R}),(N=(w=Z(this,ms).config).onError)==null||N.call(w,R,this),(k=(A=Z(this,ms).config).onSettled)==null||k.call(A,this.state.data,R,this),R}finally{this.scheduleGc()}}},Vo=new WeakMap,Hu=new WeakMap,ms=new WeakMap,qo=new WeakMap,er=new WeakMap,kf=new WeakMap,Yo=new WeakMap,Ls=new WeakSet,Va=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...v5(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...VN(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,Hu,t.manual?s:void 0),s;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Yn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Z(this,ms).notify({query:this,type:"updated",action:t})})},i5);function v5(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:x5(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function VN(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qN(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var zr,_t,_f,Er,Go,$u,Ya,Vi,Rf,Vu,qu,Ko,Qo,qi,Yu,Ft,Ld,Nb,Ab,kb,_b,Rb,Ob,Db,E5,o5,k7=(o5=class extends sc{constructor(t,n){super();Ye(this,Ft);Ye(this,zr);Ye(this,_t);Ye(this,_f);Ye(this,Er);Ye(this,Go);Ye(this,$u);Ye(this,Ya);Ye(this,Vi);Ye(this,Rf);Ye(this,Vu);Ye(this,qu);Ye(this,Ko);Ye(this,Qo);Ye(this,qi);Ye(this,Yu,new Set);this.options=n,Me(this,zr,t),Me(this,Vi,null),Me(this,Ya,wb()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,_t).addObserver(this),YN(Z(this,_t),this.options)?ct(this,Ft,Ld).call(this):this.updateResult(),ct(this,Ft,_b).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jb(Z(this,_t),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jb(Z(this,_t),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ct(this,Ft,Rb).call(this),ct(this,Ft,Ob).call(this),Z(this,_t).removeObserver(this)}setOptions(t){const n=this.options,r=Z(this,_t);if(this.options=Z(this,zr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ps(this.options.enabled,Z(this,_t))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ct(this,Ft,Db).call(this),Z(this,_t).setOptions(this.options),n._defaulted&&!kp(this.options,n)&&Z(this,zr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,_t),observer:this});const s=this.hasListeners();s&&GN(Z(this,_t),r,this.options,n)&&ct(this,Ft,Ld).call(this),this.updateResult(),s&&(Z(this,_t)!==r||ps(this.options.enabled,Z(this,_t))!==ps(n.enabled,Z(this,_t))||Zi(this.options.staleTime,Z(this,_t))!==Zi(n.staleTime,Z(this,_t)))&&ct(this,Ft,Nb).call(this);const i=ct(this,Ft,Ab).call(this);s&&(Z(this,_t)!==r||ps(this.options.enabled,Z(this,_t))!==ps(n.enabled,Z(this,_t))||i!==Z(this,qi))&&ct(this,Ft,kb).call(this,i)}getOptimisticResult(t){const n=Z(this,zr).getQueryCache().build(Z(this,zr),t),r=this.createResult(n,t);return R7(this,r)&&(Me(this,Er,r),Me(this,$u,this.options),Me(this,Go,Z(this,_t).state)),r}getCurrentResult(){return Z(this,Er)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Z(this,Ya).status==="pending"&&Z(this,Ya).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){Z(this,Yu).add(t)}getCurrentQuery(){return Z(this,_t)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,zr).defaultQueryOptions(t),r=Z(this,zr).getQueryCache().build(Z(this,zr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ct(this,Ft,Ld).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,Er)))}createResult(t,n){var H;const r=Z(this,_t),s=this.options,i=Z(this,Er),l=Z(this,Go),c=Z(this,$u),d=t!==r?t.state:Z(this,_f),{state:p}=t;let m={...p},x=!1,y;if(n._optimisticResults){const P=this.hasListeners(),K=!P&&YN(t,n),Y=P&&GN(t,r,n,s);(K||Y)&&(m={...m,...v5(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:T,status:w}=m;y=m.data;let N=!1;if(n.placeholderData!==void 0&&y===void 0&&w==="pending"){let P;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(P=i.data,N=!0):P=typeof n.placeholderData=="function"?n.placeholderData((H=Z(this,qu))==null?void 0:H.state.data,Z(this,qu)):n.placeholderData,P!==void 0&&(w="success",y=Sb(i==null?void 0:i.data,P,n),x=!0)}if(n.select&&y!==void 0&&!N)if(i&&y===(l==null?void 0:l.data)&&n.select===Z(this,Rf))y=Z(this,Vu);else try{Me(this,Rf,n.select),y=n.select(y),y=Sb(i==null?void 0:i.data,y,n),Me(this,Vu,y),Me(this,Vi,null)}catch(P){Me(this,Vi,P)}Z(this,Vi)&&(v=Z(this,Vi),y=Z(this,Vu),T=Date.now(),w="error");const A=m.fetchStatus==="fetching",k=w==="pending",R=w==="error",D=k&&A,O=y!==void 0,I={status:w,fetchStatus:m.fetchStatus,isPending:k,isSuccess:w==="success",isError:R,isInitialLoading:D,isLoading:D,data:y,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:T,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:A,isRefetching:A&&!k,isLoadingError:R&&!O,isPaused:m.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:R&&O,isStale:dE(t,n),refetch:this.refetch,promise:Z(this,Ya),isEnabled:ps(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=I.data!==void 0,K=I.status==="error"&&!P,Y=J=>{K?J.reject(I.error):P&&J.resolve(I.data)},W=()=>{const J=Me(this,Ya,I.promise=wb());Y(J)},te=Z(this,Ya);switch(te.status){case"pending":t.queryHash===r.queryHash&&Y(te);break;case"fulfilled":(K||I.data!==te.value)&&W();break;case"rejected":(!K||I.error!==te.reason)&&W();break}}return I}updateResult(){const t=Z(this,Er),n=this.createResult(Z(this,_t),this.options);if(Me(this,Go,Z(this,_t).state),Me(this,$u,this.options),Z(this,Go).data!==void 0&&Me(this,qu,Z(this,_t)),kp(n,t))return;Me(this,Er,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!Z(this,Yu).size)return!0;const l=new Set(i??Z(this,Yu));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,Er)).some(c=>{const f=c;return Z(this,Er)[f]!==t[f]&&l.has(f)})};ct(this,Ft,E5).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ct(this,Ft,_b).call(this)}},zr=new WeakMap,_t=new WeakMap,_f=new WeakMap,Er=new WeakMap,Go=new WeakMap,$u=new WeakMap,Ya=new WeakMap,Vi=new WeakMap,Rf=new WeakMap,Vu=new WeakMap,qu=new WeakMap,Ko=new WeakMap,Qo=new WeakMap,qi=new WeakMap,Yu=new WeakMap,Ft=new WeakSet,Ld=function(t){ct(this,Ft,Db).call(this);let n=Z(this,_t).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tr)),n},Nb=function(){ct(this,Ft,Rb).call(this);const t=Zi(this.options.staleTime,Z(this,_t));if(rl||Z(this,Er).isStale||!Eb(t))return;const r=m5(Z(this,Er).dataUpdatedAt,t)+1;Me(this,Ko,Bo.setTimeout(()=>{Z(this,Er).isStale||this.updateResult()},r))},Ab=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,_t)):this.options.refetchInterval)??!1},kb=function(t){ct(this,Ft,Ob).call(this),Me(this,qi,t),!(rl||ps(this.options.enabled,Z(this,_t))===!1||!Eb(Z(this,qi))||Z(this,qi)===0)&&Me(this,Qo,Bo.setInterval(()=>{(this.options.refetchIntervalInBackground||cE.isFocused())&&ct(this,Ft,Ld).call(this)},Z(this,qi)))},_b=function(){ct(this,Ft,Nb).call(this),ct(this,Ft,kb).call(this,ct(this,Ft,Ab).call(this))},Rb=function(){Z(this,Ko)&&(Bo.clearTimeout(Z(this,Ko)),Me(this,Ko,void 0))},Ob=function(){Z(this,Qo)&&(Bo.clearInterval(Z(this,Qo)),Me(this,Qo,void 0))},Db=function(){const t=Z(this,zr).getQueryCache().build(Z(this,zr),this.options);if(t===Z(this,_t))return;const n=Z(this,_t);Me(this,_t,t),Me(this,_f,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},E5=function(t){Yn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,Er))}),Z(this,zr).getQueryCache().notify({query:Z(this,_t),type:"observerResultsUpdated"})})},o5);function _7(e,t){return ps(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function YN(e,t){return _7(e,t)||e.state.data!==void 0&&jb(e,t,t.refetchOnMount)}function jb(e,t,n){if(ps(t.enabled,e)!==!1&&Zi(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&dE(e,t)}return!1}function GN(e,t,n,r){return(e!==t||ps(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&dE(e,n)}function dE(e,t){return ps(t.enabled,e)!==!1&&e.isStaleByTime(Zi(t.staleTime,e))}function R7(e,t){return!kp(e.getCurrentResult(),t)}function KN(e){return{onFetch:(t,n)=>{var p,m,x,y,v;const r=t.options,s=(x=(m=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:x.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((v=t.state.data)==null?void 0:v.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let T=!1;const w=k=>{E7(k,()=>t.signal,()=>T=!0)},N=g5(t.options,t.fetchOptions),A=async(k,R,D)=>{if(T)return Promise.reject();if(R==null&&k.pages.length)return Promise.resolve(k);const M=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:R,direction:D?"backward":"forward",meta:t.options.meta};return w(K),K})(),I=await N(M),{maxPages:H}=t.options,P=D?v7:b7;return{pages:P(k.pages,I,H),pageParams:P(k.pageParams,R,H)}};if(s&&i.length){const k=s==="backward",R=k?O7:QN,D={pages:i,pageParams:l},O=R(r,D);c=await A(D,O,k)}else{const k=e??i.length;do{const R=f===0?l[0]??r.initialPageParam:QN(r,c);if(f>0&&R==null)break;c=await A(c,R),f++}while(f<k)}return c};t.options.persister?t.fetchFn=()=>{var T,w;return(w=(T=t.options).persister)==null?void 0:w.call(T,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function QN(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function O7(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Of,ta,hr,Xo,na,Mi,l5,D7=(l5=class extends b5{constructor(t){super();Ye(this,na);Ye(this,Of);Ye(this,ta);Ye(this,hr);Ye(this,Xo);Me(this,Of,t.client),this.mutationId=t.mutationId,Me(this,hr,t.mutationCache),Me(this,ta,[]),this.state=t.state||T5(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,ta).includes(t)||(Z(this,ta).push(t),this.clearGcTimeout(),Z(this,hr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Me(this,ta,Z(this,ta).filter(n=>n!==t)),this.scheduleGc(),Z(this,hr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,ta).length||(this.state.status==="pending"?this.scheduleGc():Z(this,hr).remove(this))}continue(){var t;return((t=Z(this,Xo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,p,m,x,y,v,T,w,N,A,k,R,D,O,M;const n=()=>{ct(this,na,Mi).call(this,{type:"continue"})},r={client:Z(this,Of),meta:this.options.meta,mutationKey:this.options.mutationKey};Me(this,Xo,y5({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,H)=>{ct(this,na,Mi).call(this,{type:"failed",failureCount:I,error:H})},onPause:()=>{ct(this,na,Mi).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Z(this,hr).canRun(this)}));const s=this.state.status==="pending",i=!Z(this,Xo).canStart();try{if(s)n();else{ct(this,na,Mi).call(this,{type:"pending",variables:t,isPaused:i}),Z(this,hr).config.onMutate&&await Z(this,hr).config.onMutate(t,this,r);const H=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));H!==this.state.context&&ct(this,na,Mi).call(this,{type:"pending",context:H,variables:t,isPaused:i})}const I=await Z(this,Xo).start();return await((d=(f=Z(this,hr).config).onSuccess)==null?void 0:d.call(f,I,t,this.state.context,this,r)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,I,t,this.state.context,r)),await((y=(x=Z(this,hr).config).onSettled)==null?void 0:y.call(x,I,null,this.state.variables,this.state.context,this,r)),await((T=(v=this.options).onSettled)==null?void 0:T.call(v,I,null,t,this.state.context,r)),ct(this,na,Mi).call(this,{type:"success",data:I}),I}catch(I){try{await((N=(w=Z(this,hr).config).onError)==null?void 0:N.call(w,I,t,this.state.context,this,r))}catch(H){Promise.reject(H)}try{await((k=(A=this.options).onError)==null?void 0:k.call(A,I,t,this.state.context,r))}catch(H){Promise.reject(H)}try{await((D=(R=Z(this,hr).config).onSettled)==null?void 0:D.call(R,void 0,I,this.state.variables,this.state.context,this,r))}catch(H){Promise.reject(H)}try{await((M=(O=this.options).onSettled)==null?void 0:M.call(O,void 0,I,t,this.state.context,r))}catch(H){Promise.reject(H)}throw ct(this,na,Mi).call(this,{type:"error",error:I}),I}finally{Z(this,hr).runNext(this)}}},Of=new WeakMap,ta=new WeakMap,hr=new WeakMap,Xo=new WeakMap,na=new WeakSet,Mi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Yn.batch(()=>{Z(this,ta).forEach(r=>{r.onMutationUpdate(t)}),Z(this,hr).notify({mutation:this,type:"updated",action:t})})},l5);function T5(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ga,Ps,Df,u5,j7=(u5=class extends sc{constructor(t={}){super();Ye(this,Ga);Ye(this,Ps);Ye(this,Df);this.config=t,Me(this,Ga,new Set),Me(this,Ps,new Map),Me(this,Df,0)}build(t,n,r){const s=new D7({client:t,mutationCache:this,mutationId:++Rm(this,Df)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){Z(this,Ga).add(t);const n=Om(t);if(typeof n=="string"){const r=Z(this,Ps).get(n);r?r.push(t):Z(this,Ps).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Z(this,Ga).delete(t)){const n=Om(t);if(typeof n=="string"){const r=Z(this,Ps).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&Z(this,Ps).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Om(t);if(typeof n=="string"){const r=Z(this,Ps).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Om(t);if(typeof n=="string"){const s=(r=Z(this,Ps).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yn.batch(()=>{Z(this,Ga).forEach(t=>{this.notify({type:"removed",mutation:t})}),Z(this,Ga).clear(),Z(this,Ps).clear()})}getAll(){return Array.from(Z(this,Ga))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>UN(n,r))}findAll(t={}){return this.getAll().filter(n=>UN(t,n))}notify(t){Yn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Yn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Tr))))}},Ga=new WeakMap,Ps=new WeakMap,Df=new WeakMap,u5);function Om(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ka,Yi,Ur,Qa,Ja,fp,Mb,c5,M7=(c5=class extends sc{constructor(n,r){super();Ye(this,Ja);Ye(this,Ka);Ye(this,Yi);Ye(this,Ur);Ye(this,Qa);Me(this,Ka,n),this.setOptions(r),this.bindMethods(),ct(this,Ja,fp).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=Z(this,Ka).defaultMutationOptions(n),kp(this.options,r)||Z(this,Ka).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Z(this,Ur),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&sl(r.mutationKey)!==sl(this.options.mutationKey)?this.reset():((s=Z(this,Ur))==null?void 0:s.state.status)==="pending"&&Z(this,Ur).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Z(this,Ur))==null||n.removeObserver(this)}onMutationUpdate(n){ct(this,Ja,fp).call(this),ct(this,Ja,Mb).call(this,n)}getCurrentResult(){return Z(this,Yi)}reset(){var n;(n=Z(this,Ur))==null||n.removeObserver(this),Me(this,Ur,void 0),ct(this,Ja,fp).call(this),ct(this,Ja,Mb).call(this)}mutate(n,r){var s;return Me(this,Qa,r),(s=Z(this,Ur))==null||s.removeObserver(this),Me(this,Ur,Z(this,Ka).getMutationCache().build(Z(this,Ka),this.options)),Z(this,Ur).addObserver(this),Z(this,Ur).execute(n)}},Ka=new WeakMap,Yi=new WeakMap,Ur=new WeakMap,Qa=new WeakMap,Ja=new WeakSet,fp=function(){var r;const n=((r=Z(this,Ur))==null?void 0:r.state)??T5();Me(this,Yi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Mb=function(n){Yn.batch(()=>{var r,s,i,l,c,f,d,p;if(Z(this,Qa)&&this.hasListeners()){const m=Z(this,Yi).variables,x=Z(this,Yi).context,y={client:Z(this,Ka),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=Z(this,Qa)).onSuccess)==null||s.call(r,n.data,m,x,y)}catch(v){Promise.reject(v)}try{(l=(i=Z(this,Qa)).onSettled)==null||l.call(i,n.data,null,m,x,y)}catch(v){Promise.reject(v)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=Z(this,Qa)).onError)==null||f.call(c,n.error,m,x,y)}catch(v){Promise.reject(v)}try{(p=(d=Z(this,Qa)).onSettled)==null||p.call(d,void 0,n.error,m,x,y)}catch(v){Promise.reject(v)}}}this.listeners.forEach(m=>{m(Z(this,Yi))})})},c5),ra,d5,I7=(d5=class extends sc{constructor(t={}){super();Ye(this,ra);this.config=t,Me(this,ra,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??oE(s,n);let l=this.get(i);return l||(l=new A7({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){Z(this,ra).has(t.queryHash)||(Z(this,ra).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,ra).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,ra).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,ra).get(t)}getAll(){return[...Z(this,ra).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zN(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>zN(t,r)):n}notify(t){Yn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Yn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ra=new WeakMap,d5),Sn,Gi,Ki,Gu,Ku,Qi,Qu,Xu,f5,L7=(f5=class{constructor(e={}){Ye(this,Sn);Ye(this,Gi);Ye(this,Ki);Ye(this,Gu);Ye(this,Ku);Ye(this,Qi);Ye(this,Qu);Ye(this,Xu);Me(this,Sn,e.queryCache||new I7),Me(this,Gi,e.mutationCache||new j7),Me(this,Ki,e.defaultOptions||{}),Me(this,Gu,new Map),Me(this,Ku,new Map),Me(this,Qi,0)}mount(){Rm(this,Qi)._++,Z(this,Qi)===1&&(Me(this,Qu,cE.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Sn).onFocus())})),Me(this,Xu,_p.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Sn).onOnline())})))}unmount(){var e,t;Rm(this,Qi)._--,Z(this,Qi)===0&&((e=Z(this,Qu))==null||e.call(this),Me(this,Qu,void 0),(t=Z(this,Xu))==null||t.call(this),Me(this,Xu,void 0))}isFetching(e){return Z(this,Sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,Gi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Sn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Z(this,Sn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Zi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Z(this,Sn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=Z(this,Sn).get(r.queryHash),i=s==null?void 0:s.state.data,l=g7(t,i);if(l!==void 0)return Z(this,Sn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Yn.batch(()=>Z(this,Sn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Sn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Z(this,Sn);Yn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Sn);return Yn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Yn.batch(()=>Z(this,Sn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(e,t={}){return Yn.batch(()=>(Z(this,Sn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Yn.batch(()=>Z(this,Sn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Tr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,Sn).build(this,t);return n.isStaleByTime(Zi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tr).catch(Tr)}fetchInfiniteQuery(e){return e.behavior=KN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tr).catch(Tr)}ensureInfiniteQueryData(e){return e.behavior=KN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _p.isOnline()?Z(this,Gi).resumePausedMutations():Promise.resolve()}getQueryCache(){return Z(this,Sn)}getMutationCache(){return Z(this,Gi)}getDefaultOptions(){return Z(this,Ki)}setDefaultOptions(e){Me(this,Ki,e)}setQueryDefaults(e,t){Z(this,Gu).set(sl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,Gu).values()],n={};return t.forEach(r=>{lf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Z(this,Ku).set(sl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,Ku).values()],n={};return t.forEach(r=>{lf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Z(this,Ki).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=oE(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===lE&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,Ki).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Sn).clear(),Z(this,Gi).clear()}},Sn=new WeakMap,Gi=new WeakMap,Ki=new WeakMap,Gu=new WeakMap,Ku=new WeakMap,Qi=new WeakMap,Qu=new WeakMap,Xu=new WeakMap,f5),S5=b.createContext(void 0),Qt=e=>{const t=b.useContext(S5);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},P7=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(S5.Provider,{value:e,children:t})),w5=b.createContext(!1),B7=()=>b.useContext(w5);w5.Provider;function F7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z7=b.createContext(F7()),U7=()=>b.useContext(z7),H7=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?uE(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},$7=e=>{b.useEffect(()=>{e.clearReset()},[e])},V7=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||uE(n,[e.error,r])),q7=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Y7=(e,t)=>e.isLoading&&e.isFetching&&!t,G7=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,XN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function K7(e,t,n){var x,y,v,T;const r=B7(),s=U7(),i=Qt(),l=i.defaultQueryOptions(e);(y=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||y.call(x,l);const c=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",q7(l),H7(l,s,c),$7(s);const f=!i.getQueryCache().get(l.queryHash),[d]=b.useState(()=>new t(i,l)),p=d.getOptimisticResult(l),m=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(w=>{const N=m?d.subscribe(Yn.batchCalls(w)):Tr;return d.updateResult(),N},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),b.useEffect(()=>{d.setOptions(l)},[l,d]),G7(l,p))throw XN(l,d,s);if(V7({result:p,errorResetBoundary:s,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;if((T=(v=i.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||T.call(v,l,p),l.experimental_prefetchInRender&&!rl&&Y7(p,r)){const w=f?XN(l,d,s):c==null?void 0:c.promise;w==null||w.catch(Tr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?p:d.trackResult(p)}function vt(e,t){return K7(e,k7)}function Nn(e,t){const n=Qt(),[r]=b.useState(()=>new M7(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const s=b.useSyncExternalStore(b.useCallback(l=>r.subscribe(Yn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=b.useCallback((l,c)=>{r.mutate(l,c).catch(Tr)},[r]);if(s.error&&uE(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const fE=W7();function pn(e,...t){if(!fE)return;const n=X7(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function Q7(e,...t){fE&&console.warn(e,...t)}function X7(e,...t){return e.replace(/%[sfdO]/g,n=>{const r=t.shift();return n==="%O"&&r?JSON.stringify(r).replace(/"([^"]+)":/g,"$1:"):String(r)})}function W7(){try{const e="nuqs-localStorage-test";if(typeof localStorage>"u")return!1;localStorage.setItem(e,e);const t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}const Z7={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function Mf(e){return`[nuqs] ${Z7[e]}
|
|
51
|
-
See https://nuqs.dev/NUQS-${e}`}function J7(e){if(e.size===0)return"";const t=[];for(const[r,s]of e.entries()){const i=r.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${i}=${eF(s)}`)}return"?"+t.join("&")}function eF(e){return e.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,t=>encodeURIComponent(t))}const al=b.createContext({useAdapter(){throw new Error(Mf(404))}});al.displayName="NuqsAdapterContext";fE&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==al&&console.error(Mf(303)),window.__NuqsAdapterContext=al);function tF(e){return({children:t,defaultOptions:n,processUrlSearchParams:r,...s})=>b.createElement(al.Provider,{...s,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:r}},t)}function nF(e){const t=b.useContext(al);if(!("useAdapter"in t))throw new Error(Mf(404));return t.useAdapter(e)}const rF=()=>b.useContext(al).defaultOptions,sF=()=>b.useContext(al).processUrlSearchParams;function aF(){var e;if(typeof window>"u"||!window.GestureEvent)return 50;try{const t=(e=navigator.userAgent)==null?void 0:e.match(/version\/([\d\.]+) safari/i);return parseFloat(t[1])>=17?120:320}catch{return 320}}function iF(e){return{method:"throttle",timeMs:e}}const Vd=iF(aF());function oF(e){return e===null||Array.isArray(e)&&e.length===0}function lF(e,t,n){if(typeof e=="string")n.set(t,e);else{n.delete(t);for(const r of e)n.append(t,r);n.has(t)||n.set(t,"")}return n}function hE(){const e=new Map;return{on(t,n){const r=e.get(t)||[];return r.push(n),e.set(t,r),()=>this.off(t,n)},off(t,n){const r=e.get(t);r&&e.set(t,r.filter(s=>s!==n))},emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))}}}function Ib(e,t,n){function r(){e(),n.removeEventListener("abort",i)}const s=setTimeout(r,t);function i(){clearTimeout(s),n.removeEventListener("abort",i)}n.addEventListener("abort",i)}function Lb(){const e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((r,s)=>{t=r,n=s}),resolve:t,reject:n}}function uF(e,t){let n=t;for(let r=e.length-1;r>=0;r--){const s=e[r];if(!s)continue;const i=n;n=()=>s(i)}n()}function Pb(){return new URLSearchParams(location.search)}var C5=class{constructor(){We(this,"updateMap",new Map);We(this,"options",{history:"replace",scroll:!1,shallow:!0});We(this,"timeMs",Vd.timeMs);We(this,"transitions",new Set);We(this,"resolvers",null);We(this,"controller",null);We(this,"lastFlushedAt",0);We(this,"resetQueueOnNextPush",!1)}push({key:e,query:t,options:n},r=Vd.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),pn("[nuqs gtq] Enqueueing %s=%s %O",e,t,n),this.updateMap.set(e,t),n.history==="push"&&(this.options.history="push"),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||r>this.timeMs)&&(this.timeMs=r)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=Pb}){var t;return((t=this.resolvers)==null?void 0:t.promise)??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=Pb,rateLimitFactor:t=1,...n},r){if(this.controller??(this.controller=new AbortController),!Number.isFinite(this.timeMs))return pn("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=Lb();const s=()=>{this.lastFlushedAt=performance.now();const[l,c]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},r);c===null?(this.resolvers.resolve(l),this.resetQueueOnNextPush=!0):this.resolvers.reject(l),this.resolvers=null};return Ib(()=>{const l=performance.now()-this.lastFlushedAt,c=this.timeMs,f=t*Math.max(0,c-l);pn("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",f,c,t),f===0?s():Ib(s,f,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){var e,t;return(e=this.controller)==null||e.abort(),this.controller=new AbortController,(t=this.resolvers)==null||t.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){const e=Array.from(this.updateMap.keys());return pn("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=Vd.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:n,getSearchParamsSnapshot:r}=e;let s=r();if(pn("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,s.toString()),this.updateMap.size===0)return[s,null];const i=Array.from(this.updateMap.entries()),l={...this.options},c=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),pn("[nuqs gtq] Flushing queue %O with options %O",i,l);for(const[f,d]of i)d===null?s.delete(f):s=lF(d,f,s);t&&(s=t(s));try{return uF(c,()=>{n(s,l)}),[s,null]}catch(f){return console.error(Mf(429),i.map(([d])=>d).join(),f),[s,f]}}};const hp=new C5;function cF(e,t,n){const r=b.useCallback(()=>{const i=Object.fromEntries(e.map(l=>[l,n(l)]));return[JSON.stringify(i),i]},[e.join(","),n]),s=b.useRef(null);return s.current===null&&(s.current=r()),b.useSyncExternalStore(b.useCallback(i=>{const l=e.map(c=>t(c,i));return()=>l.forEach(c=>c())},[e.join(","),t]),()=>{const[i,l]=r();return s.current[0]===i?s.current[1]:(s.current=[i,l],l)},()=>s.current[1])}var dF=class{constructor(e){We(this,"callback");We(this,"resolvers",Lb());We(this,"controller",new AbortController);We(this,"queuedValue");this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,Ib(()=>{const n=this.resolvers;try{pn("[nuqs dq] Flushing debounce queue",e);const r=this.callback(e);pn("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=Lb(),r.then(s=>n.resolve(s)).catch(s=>n.reject(s))}catch(r){this.queuedValue=void 0,n.reject(r)}},t,this.controller.signal),this.resolvers.promise}},fF=class{constructor(e=new C5){We(this,"throttleQueue");We(this,"queues",new Map);We(this,"queuedQuerySync",hE());this.throttleQueue=e}useQueuedQueries(e){return cF(e,(t,n)=>this.queuedQuerySync.on(t,n),t=>this.getQueuedQuery(t))}push(e,t,n,r){if(!Number.isFinite(t)){const l=n.getSearchParamsSnapshot??Pb;return Promise.resolve(l())}const s=e.key;if(!this.queues.has(s)){pn("[nuqs dqc] Creating debounce queue for `%s`",s);const l=new dF(c=>(this.throttleQueue.push(c),this.throttleQueue.flush(n,r).finally(()=>{var f;((f=this.queues.get(c.key))==null?void 0:f.queuedValue)===void 0&&(pn("[nuqs dqc] Cleaning up empty queue for `%s`",c.key),this.queues.delete(c.key)),this.queuedQuerySync.emit(c.key)})));this.queues.set(s,l)}pn("[nuqs dqc] Enqueueing debounce update %O",e);const i=this.queues.get(s).push(e,t);return this.queuedQuerySync.emit(s),i}abort(e){var n;const t=this.queues.get(e);return t?(pn("[nuqs dqc] Aborting debounce queue %s=%s",e,(n=t.queuedValue)==null?void 0:n.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),r=>(r.then(t.resolvers.resolve,t.resolvers.reject),r)):r=>r}abortAll(){var e;for(const[t,n]of this.queues.entries())pn("[nuqs dqc] Aborting debounce queue %s=%s",t,(e=n.queuedValue)==null?void 0:e.query),n.abort(),n.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(t);this.queues.clear()}getQueuedQuery(e){var n,r;const t=(r=(n=this.queues.get(e))==null?void 0:n.queuedValue)==null?void 0:r.query;return t!==void 0?t:this.throttleQueue.getQueuedQuery(e)}};const P1=new fF(hp);function N5(e,t){return e===t?!0:e===null||t===null||typeof e=="string"||typeof t=="string"||e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function WN(e,t,n){return r=>{if(!(t.length===0||t.some(i=>!N5(r.getAll(i),e.getAll(i)))))return pn("[nuqs `%s`] no change, returning previous",t.join(","),r),r;const s=A5(e,t,n);return pn("[nuqs `%s`] subbed search params change\n from %O\n to %O",t.join(","),r,s),s}}function A5(e,t,n){if(t.length===0)return e;const r=n?new URLSearchParams(e):e;for(const s of e.keys())t.includes(s)||r.delete(s);return r}const hF="__nuqs__",Bb=hE();function mF(e){return function(n,r){const s=new URL(location.href);s.search=J7(n),pn("[nuqs react] Updating url: %s",s),e&&r.shallow===!1?(r.history==="push"?location.assign:location.replace).call(location,s):(r.history==="push"?history.pushState:history.replaceState).call(history,history.state,hF,s),Bb.emit("update",n),r.scroll===!0&&window.scrollTo({top:0})}}const k5=b.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function pF(e){const{fullPageNavigationOnShallowFalseUpdates:t}=b.useContext(k5),[n,r]=b.useState(()=>typeof location>"u"?new URLSearchParams:A5(new URLSearchParams(location.search),e,!1));return b.useEffect(()=>{const s=()=>{r(WN(new URLSearchParams(location.search),e,!1))},i=l=>{r(WN(l,e,!0))};return Bb.on("update",i),window.addEventListener("popstate",s),()=>{Bb.off("update",i),window.removeEventListener("popstate",s)}},[e.join("&")]),{searchParams:n,updateUrl:b.useMemo(()=>mF(t),[t])}}const gF=tF(pF);function xF({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return b.createElement(k5.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},b.createElement(gF,{...n,children:e}))}const _5=b.createContext(null);function yF({transport:e,children:t}){return u.jsx(_5.Provider,{value:e,children:t})}function He(){const e=b.useContext(_5);if(!e)throw new Error("useTransport must be used within a TransportProvider");return e}const ZN=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const x=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,x))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,s,c);return c},bF=(e=>e?ZN(e):ZN),vF=e=>e;function EF(e,t=vF){const n=oe.useSyncExternalStore(e.subscribe,oe.useCallback(()=>t(e.getState()),[e,t]),oe.useCallback(()=>t(e.getInitialState()),[e,t]));return oe.useDebugValue(n),n}const JN=e=>{const t=bF(e),n=r=>EF(t,r);return Object.assign(n,t),n},R5=(e=>e?JN(e):JN),eA={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},tA=e=>!!e.dispatchFromDevtools&&typeof e.dispatch=="function",uf=new Map,Dm=e=>{const t=uf.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},TF=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=uf.get(n.name);if(r)return{type:"tracked",store:e,...r};const s={connection:t.connect(n),stores:{}};return uf.set(n.name,s),{type:"tracked",store:e,...s}},SF=(e,t)=>{if(t===void 0)return;const n=uf.get(e);n&&(delete n.stores[t],Object.keys(n.stores).length===0&&uf.delete(e))},wF=e=>{var t,n;if(!e)return;const r=e.split(`
|
|
52
|
-
`),s=r.findIndex(l=>l.includes("api.setState"));if(s<0)return;const i=((t=r[s+1])==null?void 0:t.trim())||"";return(n=/.+ (.+) .+/.exec(i))==null?void 0:n[1]},CF=(e,t={})=>(n,r,s)=>{const{enabled:i,anonymousActionType:l,store:c,...f}=t;let d;try{d=(i??(eA?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!d)return e(n,r,s);const{connection:p,...m}=TF(c,d,f);let x=!0;s.setState=((T,w,N)=>{const A=n(T,w);if(!x)return A;const k=N===void 0?{type:l||wF(new Error().stack)||"anonymous"}:typeof N=="string"?{type:N}:N;return c===void 0?(p==null||p.send(k,r()),A):(p==null||p.send({...k,type:`${c}/${k.type}`},{...Dm(f.name),[c]:s.getState()}),A)}),s.devtools={cleanup:()=>{p&&typeof p.unsubscribe=="function"&&p.unsubscribe(),SF(f.name,c)}};const y=(...T)=>{const w=x;x=!1,n(...T),x=w},v=e(s.setState,r,s);if(m.type==="untracked"?p==null||p.init(v):(m.stores[m.store]=s,p==null||p.init(Object.fromEntries(Object.entries(m.stores).map(([T,w])=>[T,T===m.store?v:w.getState()])))),tA(s)){let T=!1;const w=s.dispatch;s.dispatch=(...N)=>{(eA?"production":void 0)!=="production"&&N[0].type==="__setState"&&!T&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),T=!0),w(...N)}}return p.subscribe(T=>{var w;switch(T.type){case"ACTION":if(typeof T.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return B1(T.payload,N=>{if(N.type==="__setState"){if(c===void 0){y(N.state);return}Object.keys(N.state).length!==1&&console.error(`
|
|
53
|
-
[zustand devtools middleware] Unsupported __setState action format.
|
|
54
|
-
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
55
|
-
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
56
|
-
`);const A=N.state[c];if(A==null)return;JSON.stringify(s.getState())!==JSON.stringify(A)&&y(A);return}tA(s)&&s.dispatch(N)});case"DISPATCH":switch(T.payload.type){case"RESET":return y(v),c===void 0?p==null?void 0:p.init(s.getState()):p==null?void 0:p.init(Dm(f.name));case"COMMIT":if(c===void 0){p==null||p.init(s.getState());return}return p==null?void 0:p.init(Dm(f.name));case"ROLLBACK":return B1(T.state,N=>{if(c===void 0){y(N),p==null||p.init(s.getState());return}y(N[c]),p==null||p.init(Dm(f.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return B1(T.state,N=>{if(c===void 0){y(N);return}JSON.stringify(s.getState())!==JSON.stringify(N[c])&&y(N[c])});case"IMPORT_STATE":{const{nextLiftedState:N}=T.payload,A=(w=N.computedStates.slice(-1)[0])==null?void 0:w.state;if(!A)return;y(c===void 0?A:A[c]),p==null||p.send(null,N);return}case"PAUSE_RECORDING":return x=!x}return}}),v},NF=CF,B1=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function O5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=O5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mE(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=O5(e))&&(r&&(r+=" "),r+=t);return r}const AF=(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},kF=(e,t)=>({classGroupId:e,validator:t}),D5=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Rp="-",nA=[],_F="arbitrary..",RF=e=>{const t=DF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return OF(l);const c=l.split(Rp),f=c[0]===""&&c.length>1?1:0;return j5(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?AF(d,f):f:d||nA}return n[l]||nA}}},j5=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const d=j5(e,t+1,i);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(Rp):e.slice(t).join(Rp),f=l.length;for(let d=0;d<f;d++){const p=l[d];if(p.validator(c))return p.classGroupId}},OF=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?_F+r:void 0})(),DF=e=>{const{theme:t,classGroups:n}=e;return jF(n,t)},jF=(e,t)=>{const n=D5();for(const r in e){const s=e[r];pE(s,n,r,t)}return n},pE=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const l=e[i];MF(l,t,n,r)}},MF=(e,t,n,r)=>{if(typeof e=="string"){IF(e,t,n);return}if(typeof e=="function"){LF(e,t,n,r);return}PF(e,t,n,r)},IF=(e,t,n)=>{const r=e===""?t:M5(t,e);r.classGroupId=n},LF=(e,t,n,r)=>{if(BF(e)){pE(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(kF(n,e))},PF=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let l=0;l<i;l++){const[c,f]=s[l];pE(f,M5(t,c),n,r)}},M5=(e,t)=>{let n=e;const r=t.split(Rp),s=r.length;for(let i=0;i<s;i++){const l=r[i];let c=n.nextPart.get(l);c||(c=D5(),n.nextPart.set(l,c)),n=c}return n},BF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,FF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,l)=>{n[i]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let l=n[i];if(l!==void 0)return l;if((l=r[i])!==void 0)return s(i,l),l},set(i,l){i in n?n[i]=l:s(i,l)}}},Fb="!",rA=":",zF=[],sA=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),UF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let l=0,c=0,f=0,d;const p=s.length;for(let T=0;T<p;T++){const w=s[T];if(l===0&&c===0){if(w===rA){i.push(s.slice(f,T)),f=T+1;continue}if(w==="/"){d=T;continue}}w==="["?l++:w==="]"?l--:w==="("?c++:w===")"&&c--}const m=i.length===0?s:s.slice(f);let x=m,y=!1;m.endsWith(Fb)?(x=m.slice(0,-1),y=!0):m.startsWith(Fb)&&(x=m.slice(1),y=!0);const v=d&&d>f?d-f:void 0;return sA(i,y,x,v)};if(t){const s=t+rA,i=r;r=l=>l.startsWith(s)?i(l.slice(s.length)):sA(zF,!1,l,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},HF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const l=n[i],c=l[0]==="[",f=t.has(l);c||f?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},$F=e=>({cache:FF(e.cacheSize),parseClassName:UF(e),sortModifiers:HF(e),...RF(e)}),VF=/\s+/,qF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,l=[],c=e.trim().split(VF);let f="";for(let d=c.length-1;d>=0;d-=1){const p=c[d],{isExternal:m,modifiers:x,hasImportantModifier:y,baseClassName:v,maybePostfixModifierPosition:T}=n(p);if(m){f=p+(f.length>0?" "+f:f);continue}let w=!!T,N=r(w?v.substring(0,T):v);if(!N){if(!w){f=p+(f.length>0?" "+f:f);continue}if(N=r(v),!N){f=p+(f.length>0?" "+f:f);continue}w=!1}const A=x.length===0?"":x.length===1?x[0]:i(x).join(":"),k=y?A+Fb:A,R=k+N;if(l.indexOf(R)>-1)continue;l.push(R);const D=s(N,w);for(let O=0;O<D.length;++O){const M=D[O];l.push(k+M)}f=p+(f.length>0?" "+f:f)}return f},YF=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=I5(n))&&(s&&(s+=" "),s+=r);return s},I5=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=I5(e[r]))&&(n&&(n+=" "),n+=t);return n},GF=(e,...t)=>{let n,r,s,i;const l=f=>{const d=t.reduce((p,m)=>m(p),e());return n=$F(d),r=n.cache.get,s=n.cache.set,i=c,c(f)},c=f=>{const d=r(f);if(d)return d;const p=qF(f,n);return s(f,p),p};return i=l,(...f)=>i(YF(...f))},KF=[],Hn=e=>{const t=n=>n[e]||KF;return t.isThemeGetter=!0,t},L5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,P5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QF=/^\d+\/\d+$/,XF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WF=/\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$/,ZF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ez=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cu=e=>QF.test(e),dt=e=>!!e&&!Number.isNaN(Number(e)),Di=e=>!!e&&Number.isInteger(Number(e)),F1=e=>e.endsWith("%")&&dt(e.slice(0,-1)),$a=e=>XF.test(e),tz=()=>!0,nz=e=>WF.test(e)&&!ZF.test(e),B5=()=>!1,rz=e=>JF.test(e),sz=e=>ez.test(e),az=e=>!Be(e)&&!Fe(e),iz=e=>ac(e,U5,B5),Be=e=>L5.test(e),Do=e=>ac(e,H5,nz),z1=e=>ac(e,dz,dt),aA=e=>ac(e,F5,B5),oz=e=>ac(e,z5,sz),jm=e=>ac(e,$5,rz),Fe=e=>P5.test(e),bd=e=>ic(e,H5),lz=e=>ic(e,fz),iA=e=>ic(e,F5),uz=e=>ic(e,U5),cz=e=>ic(e,z5),Mm=e=>ic(e,$5,!0),ac=(e,t,n)=>{const r=L5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ic=(e,t,n=!1)=>{const r=P5.exec(e);return r?r[1]?t(r[1]):n:!1},F5=e=>e==="position"||e==="percentage",z5=e=>e==="image"||e==="url",U5=e=>e==="length"||e==="size"||e==="bg-size",H5=e=>e==="length",dz=e=>e==="number",fz=e=>e==="family-name",$5=e=>e==="shadow",hz=()=>{const e=Hn("color"),t=Hn("font"),n=Hn("text"),r=Hn("font-weight"),s=Hn("tracking"),i=Hn("leading"),l=Hn("breakpoint"),c=Hn("container"),f=Hn("spacing"),d=Hn("radius"),p=Hn("shadow"),m=Hn("inset-shadow"),x=Hn("text-shadow"),y=Hn("drop-shadow"),v=Hn("blur"),T=Hn("perspective"),w=Hn("aspect"),N=Hn("ease"),A=Hn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...R(),Fe,Be],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],I=()=>[Fe,Be,f],H=()=>[cu,"full","auto",...I()],P=()=>[Di,"none","subgrid",Fe,Be],K=()=>["auto",{span:["full",Di,Fe,Be]},Di,Fe,Be],Y=()=>[Di,"auto",Fe,Be],W=()=>["auto","min","max","fr",Fe,Be],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...I()],B=()=>[cu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],U=()=>[e,Fe,Be],ne=()=>[...R(),iA,aA,{position:[Fe,Be]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",uz,iz,{size:[Fe,Be]}],V=()=>[F1,bd,Do],j=()=>["","none","full",d,Fe,Be],re=()=>["",dt,bd,Do],ae=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dt,F1,iA,aA],ye=()=>["","none",v,Fe,Be],ve=()=>["none",dt,Fe,Be],Re=()=>["none",dt,Fe,Be],ke=()=>[dt,Fe,Be],$e=()=>[cu,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$a],breakpoint:[$a],color:[tz],container:[$a],"drop-shadow":[$a],ease:["in","out","in-out"],font:[az],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$a],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$a],shadow:[$a],spacing:["px",dt],text:[$a],"text-shadow":[$a],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cu,Be,Fe,w]}],container:["container"],columns:[{columns:[dt,Be,Fe,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:D()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{start:H()}],end:[{end:H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[Di,"auto",Fe,Be]}],basis:[{basis:[cu,"full","auto",c,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,cu,"auto","initial","none",Be]}],grow:[{grow:["",dt,Fe,Be]}],shrink:[{shrink:["",dt,Fe,Be]}],order:[{order:[Di,"first","last","none",Fe,Be]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[c,"screen",...B()]}],"min-w":[{"min-w":[c,"screen","none",...B()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,bd,Do]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Fe,z1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",F1,Be]}],"font-family":[{font:[lz,Be,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Fe,Be]}],"line-clamp":[{"line-clamp":[dt,"none",Fe,z1]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",Fe,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Fe,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",Fe,Do]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[dt,"auto",Fe,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Fe,Be]}],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",Fe,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Di,Fe,Be],radial:["",Fe,Be],conic:[Di,Fe,Be]},cz,oz]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,Fe,Be]}],"outline-w":[{outline:["",dt,bd,Do]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",p,Mm,jm]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",m,Mm,jm]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[dt,Do]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",x,Mm,jm]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[dt,Fe,Be]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Fe,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Fe,Be]}],filter:[{filter:["","none",Fe,Be]}],blur:[{blur:ye()}],brightness:[{brightness:[dt,Fe,Be]}],contrast:[{contrast:[dt,Fe,Be]}],"drop-shadow":[{"drop-shadow":["","none",y,Mm,jm]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",dt,Fe,Be]}],"hue-rotate":[{"hue-rotate":[dt,Fe,Be]}],invert:[{invert:["",dt,Fe,Be]}],saturate:[{saturate:[dt,Fe,Be]}],sepia:[{sepia:["",dt,Fe,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Fe,Be]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[dt,Fe,Be]}],"backdrop-contrast":[{"backdrop-contrast":[dt,Fe,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,Fe,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,Fe,Be]}],"backdrop-invert":[{"backdrop-invert":["",dt,Fe,Be]}],"backdrop-opacity":[{"backdrop-opacity":[dt,Fe,Be]}],"backdrop-saturate":[{"backdrop-saturate":[dt,Fe,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,Fe,Be]}],"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",Fe,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",Fe,Be]}],ease:[{ease:["linear","initial",N,Fe,Be]}],delay:[{delay:[dt,Fe,Be]}],animate:[{animate:["none",A,Fe,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,Fe,Be]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:Re()}],"scale-x":[{"scale-x":Re()}],"scale-y":[{"scale-y":Re()}],"scale-z":[{"scale-z":Re()}],"scale-3d":["scale-3d"],skew:[{skew:ke()}],"skew-x":[{"skew-x":ke()}],"skew-y":[{"skew-y":ke()}],transform:[{transform:[Fe,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:$e()}],"translate-x":[{"translate-x":$e()}],"translate-y":[{"translate-y":$e()}],"translate-z":[{"translate-z":$e()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",Fe,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":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-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",Fe,Be]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[dt,bd,Do,z1]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},V5=GF(hz);function Ee(...e){return V5(mE(e))}function q5(e,t){if(!e)return{match:!0,score:0,indices:[]};const n=e.toLowerCase(),r=t.toLowerCase();let s=0,i=0,l=0;const c=[];for(let f=0;f<r.length&&s<n.length;f++)r[f]===n[s]?(s++,l++,i+=l,c.push(f)):l=0;return{match:s===n.length,score:i,indices:c}}async function Le(e,t,n){const r=await fetch(`${e}${t}`,{headers:{"Content-Type":"application/json"},...n});if(!r.ok){const s=await r.json().catch(()=>({error:r.statusText}));throw new Error(s.error||`HTTP ${r.status}`)}return r.json()}class mz{constructor(t){We(this,"clientId");We(this,"etagCache",new Map);We(this,"messageCache",new Map);this.baseUrl=t,this.clientId=crypto.randomUUID()}createSession(t){return Le(this.baseUrl,"/sessions",{method:"POST",body:JSON.stringify(t)})}listSessions(t){const n=new URLSearchParams;t&&n.set("cwd",t);const r=n.toString();return Le(this.baseUrl,`/sessions${r?`?${r}`:""}`)}getSession(t,n){const r=new URLSearchParams;n&&r.set("cwd",n);const s=r.toString();return Le(this.baseUrl,`/sessions/${t}${s?`?${s}`:""}`)}updateSession(t,n,r){const s=new URLSearchParams;r&&s.set("cwd",r);const i=s.toString();return Le(this.baseUrl,`/sessions/${t}${i?`?${i}`:""}`,{method:"PATCH",body:JSON.stringify(n)})}async getMessages(t,n){const r=new URLSearchParams;n&&r.set("cwd",n);const s=r.toString(),i=`/sessions/${t}/messages${s?`?${s}`:""}`,l={"Content-Type":"application/json"},c=this.etagCache.get(t);c&&(l["If-None-Match"]=c);const f=await fetch(`${this.baseUrl}${i}`,{headers:l});if(f.status===304){const m=this.messageCache.get(t);if(m)return m;throw new Error("304 received but no cached response available")}if(!f.ok){const m=await f.json().catch(()=>({error:f.statusText}));throw new Error(m.error||`HTTP ${f.status}`)}const d=await f.json(),p=f.headers.get("ETag");return p&&(this.etagCache.set(t,p),this.messageCache.set(t,d)),d}async sendMessage(t,n,r,s,i){const l=await fetch(`${this.baseUrl}/sessions/${t}/messages`,{method:"POST",headers:{"Content-Type":"application/json","X-Client-Id":this.clientId},body:JSON.stringify({content:n,...i&&{cwd:i}}),signal:s});if(!l.ok){if(l.status===409){const p=await l.json().catch(()=>null);if(p&&p.code==="SESSION_LOCKED"){const m=new Error("Session locked");throw m.code="SESSION_LOCKED",m.lockedBy=p.lockedBy,m.lockedAt=p.lockedAt,m}}throw new Error(`HTTP ${l.status}`)}const c=l.body.getReader(),f=new TextDecoder;let d="";for(;;){const{done:p,value:m}=await c.read();if(p)break;d+=f.decode(m,{stream:!0});const x=d.split(`
|
|
57
|
-
`);d=x.pop()||"";let y="";for(const v of x)if(v.startsWith("event: "))y=v.slice(7).trim();else if(v.startsWith("data: ")&&y){const T=JSON.parse(v.slice(6));r({type:y,data:T}),y=""}}}approveTool(t,n){return Le(this.baseUrl,`/sessions/${t}/approve`,{method:"POST",body:JSON.stringify({toolCallId:n})})}denyTool(t,n){return Le(this.baseUrl,`/sessions/${t}/deny`,{method:"POST",body:JSON.stringify({toolCallId:n})})}submitAnswers(t,n,r){return Le(this.baseUrl,`/sessions/${t}/submit-answers`,{method:"POST",body:JSON.stringify({toolCallId:n,answers:r})})}async getTasks(t,n){try{const r=new URLSearchParams;n&&r.set("cwd",n);const s=r.toString();return await Le(this.baseUrl,`/sessions/${t}/tasks${s?`?${s}`:""}`)}catch{return{tasks:[]}}}browseDirectory(t,n){const r=new URLSearchParams;t&&r.set("path",t),n&&r.set("showHidden","true");const s=r.toString();return Le(this.baseUrl,`/directory${s?`?${s}`:""}`)}getDefaultCwd(){return Le(this.baseUrl,"/directory/default")}getCommands(t=!1,n){const r=new URLSearchParams;t&&r.set("refresh","true"),n&&r.set("cwd",n);const s=r.toString();return Le(this.baseUrl,`/commands${s?`?${s}`:""}`)}getGitStatus(t){const n=new URLSearchParams;t&&n.set("dir",t);const r=n.toString();return Le(this.baseUrl,`/git/status${r?`?${r}`:""}`)}health(){return Le(this.baseUrl,"/health")}listFiles(t){const n=new URLSearchParams({cwd:t});return Le(this.baseUrl,`/files?${n}`)}getConfig(){return Le(this.baseUrl,"/config")}async updateConfig(t){await Le(this.baseUrl,"/config",{method:"PATCH",body:JSON.stringify(t)})}getModels(){return Le(this.baseUrl,"/models").then(t=>t.models)}startTunnel(){return Le(this.baseUrl,"/tunnel/start",{method:"POST"})}async stopTunnel(){await Le(this.baseUrl,"/tunnel/stop",{method:"POST"})}listSchedules(){return Le(this.baseUrl,"/pulse/schedules")}createSchedule(t){return Le(this.baseUrl,"/pulse/schedules",{method:"POST",body:JSON.stringify(t)})}updateSchedule(t,n){return Le(this.baseUrl,`/pulse/schedules/${t}`,{method:"PATCH",body:JSON.stringify(n)})}deleteSchedule(t){return Le(this.baseUrl,`/pulse/schedules/${t}`,{method:"DELETE"})}triggerSchedule(t){return Le(this.baseUrl,`/pulse/schedules/${t}/trigger`,{method:"POST"})}listRuns(t){const n=new URLSearchParams;t!=null&&t.scheduleId&&n.set("scheduleId",t.scheduleId),t!=null&&t.status&&n.set("status",t.status),t!=null&&t.limit&&n.set("limit",String(t.limit)),t!=null&&t.offset&&n.set("offset",String(t.offset));const r=n.toString();return Le(this.baseUrl,`/pulse/runs${r?`?${r}`:""}`)}getRun(t){return Le(this.baseUrl,`/pulse/runs/${t}`)}cancelRun(t){return Le(this.baseUrl,`/pulse/runs/${t}/cancel`,{method:"POST"})}getPulsePresets(){return Le(this.baseUrl,"/pulse/presets")}listRelayMessages(t){const n=new URLSearchParams;t!=null&&t.subject&&n.set("subject",t.subject),t!=null&&t.status&&n.set("status",t.status),t!=null&&t.from&&n.set("from",t.from),t!=null&&t.cursor&&n.set("cursor",t.cursor),t!=null&&t.limit&&n.set("limit",String(t.limit));const r=n.toString();return Le(this.baseUrl,`/relay/messages${r?`?${r}`:""}`)}getRelayMessage(t){return Le(this.baseUrl,`/relay/messages/${t}`)}sendRelayMessage(t){return Le(this.baseUrl,"/relay/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}listRelayEndpoints(){return Le(this.baseUrl,"/relay/endpoints")}registerRelayEndpoint(t){return Le(this.baseUrl,"/relay/endpoints",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subject:t})})}unregisterRelayEndpoint(t){return Le(this.baseUrl,`/relay/endpoints/${t}`,{method:"DELETE"})}readRelayInbox(t,n){const r=new URLSearchParams;n!=null&&n.status&&r.set("status",n.status),n!=null&&n.cursor&&r.set("cursor",n.cursor),n!=null&&n.limit&&r.set("limit",String(n.limit));const s=r.toString();return Le(this.baseUrl,`/relay/endpoints/${t}/inbox${s?`?${s}`:""}`)}getRelayMetrics(){return Le(this.baseUrl,"/relay/metrics")}listRelayDeadLetters(t){const n=new URLSearchParams;t!=null&&t.endpointHash&&n.set("endpointHash",t.endpointHash);const r=n.toString();return Le(this.baseUrl,`/relay/dead-letters${r?`?${r}`:""}`)}listRelayConversations(){return Le(this.baseUrl,"/relay/conversations")}async sendMessageRelay(t,n,r){const s=await fetch(`${this.baseUrl}/sessions/${t}/messages`,{method:"POST",headers:{"Content-Type":"application/json","X-Client-Id":(r==null?void 0:r.clientId)??this.clientId},body:JSON.stringify({content:n})});if(s.status!==202&&!s.ok){const i=await s.json().catch(()=>({error:s.statusText}));throw new Error(i.error||`HTTP ${s.status}`)}return s.json()}getRelayTrace(t){return Le(this.baseUrl,`/relay/messages/${t}/trace`)}getRelayDeliveryMetrics(){return Le(this.baseUrl,"/relay/trace/metrics")}listRelayAdapters(){return Le(this.baseUrl,"/relay/adapters")}toggleRelayAdapter(t,n){return Le(this.baseUrl,`/relay/adapters/${t}/${n?"enable":"disable"}`,{method:"POST"})}getAdapterCatalog(){return Le(this.baseUrl,"/relay/adapters/catalog")}addRelayAdapter(t,n,r){return Le(this.baseUrl,"/relay/adapters",{method:"POST",body:JSON.stringify({type:t,id:n,config:r})})}removeRelayAdapter(t){return Le(this.baseUrl,`/relay/adapters/${encodeURIComponent(t)}`,{method:"DELETE"})}updateRelayAdapterConfig(t,n){return Le(this.baseUrl,`/relay/adapters/${encodeURIComponent(t)}/config`,{method:"PATCH",body:JSON.stringify({config:n})})}testRelayAdapterConnection(t,n){return Le(this.baseUrl,"/relay/adapters/test",{method:"POST",body:JSON.stringify({type:t,config:n})})}getBindings(){return Le(this.baseUrl,"/relay/bindings").then(t=>t.bindings)}createBinding(t){return Le(this.baseUrl,"/relay/bindings",{method:"POST",body:JSON.stringify(t)}).then(n=>n.binding)}async deleteBinding(t){await Le(this.baseUrl,`/relay/bindings/${encodeURIComponent(t)}`,{method:"DELETE"})}listMeshAgentPaths(){return Le(this.baseUrl,"/mesh/agents/paths")}discoverMeshAgents(t,n){return Le(this.baseUrl,"/mesh/discover",{method:"POST",body:JSON.stringify({roots:t,...n!==void 0&&{maxDepth:n}})})}listMeshAgents(t){const n=new URLSearchParams;t!=null&&t.runtime&&n.set("runtime",t.runtime),t!=null&&t.capability&&n.set("capability",t.capability);const r=n.toString();return Le(this.baseUrl,`/mesh/agents${r?`?${r}`:""}`)}getMeshAgent(t){return Le(this.baseUrl,`/mesh/agents/${t}`)}registerMeshAgent(t,n,r){return Le(this.baseUrl,"/mesh/agents",{method:"POST",body:JSON.stringify({path:t,...n&&{overrides:n},...r&&{approver:r}})})}updateMeshAgent(t,n){return Le(this.baseUrl,`/mesh/agents/${t}`,{method:"PATCH",body:JSON.stringify(n)})}unregisterMeshAgent(t){return Le(this.baseUrl,`/mesh/agents/${t}`,{method:"DELETE"})}denyMeshAgent(t,n,r){return Le(this.baseUrl,"/mesh/deny",{method:"POST",body:JSON.stringify({path:t,...n&&{reason:n},...r&&{denier:r}})})}listDeniedMeshAgents(){return Le(this.baseUrl,"/mesh/denied")}clearMeshDenial(t){return Le(this.baseUrl,`/mesh/denied/${encodeURIComponent(t)}`,{method:"DELETE"})}getMeshStatus(){return Le(this.baseUrl,"/mesh/status")}getMeshAgentHealth(t){return Le(this.baseUrl,`/mesh/agents/${t}/health`)}sendMeshHeartbeat(t,n){return Le(this.baseUrl,`/mesh/agents/${t}/heartbeat`,{method:"POST",body:JSON.stringify({...n&&{event:n}})})}getMeshTopology(t){const n=t?`?namespace=${encodeURIComponent(t)}`:"";return Le(this.baseUrl,`/mesh/topology${n}`)}updateMeshAccessRule(t){return Le(this.baseUrl,"/mesh/topology/access",{method:"PUT",body:JSON.stringify(t)})}getMeshAgentAccess(t){return Le(this.baseUrl,`/mesh/agents/${encodeURIComponent(t)}/access`)}async getAgentByPath(t){const n=await fetch(`${this.baseUrl}/agents/current?path=${encodeURIComponent(t)}`);if(n.status===404)return null;if(!n.ok)throw new Error(`Failed to get agent: ${n.statusText}`);return n.json()}async resolveAgents(t){return(await Le(this.baseUrl,"/agents/resolve",{method:"POST",body:JSON.stringify({paths:t})})).agents}createAgent(t,n,r,s){return Le(this.baseUrl,"/agents",{method:"POST",body:JSON.stringify({path:t,...n&&{name:n},...r&&{description:r},...s&&{runtime:s}})})}updateAgentByPath(t,n){return Le(this.baseUrl,`/agents/current?path=${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}async resetAllData(t){const n=await fetch(`${this.baseUrl}/admin/reset`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:t})});if(!n.ok){const r=await n.text();throw new Error(r)}return n.json()}async restartServer(){const t=await fetch(`${this.baseUrl}/admin/restart`,{method:"POST"});if(!t.ok){const n=await t.text();throw new Error(n)}return t.json()}}function vr(e){return typeof e=="string"?e:""}function U1(e){if(!e)return"...";const t=e.split("/");return t[t.length-1]||"..."}function pz(e){if(!e)return"...";try{return new URL(e).hostname}catch{return e.slice(0,30)}}function vd(e,t){return e?e.length>t?e.slice(0,t)+"…":e:"..."}function Im(e){return!e||e==="..."?'"…"':`"${e}"`}function gz(e,t){let n=null;try{n=JSON.parse(t)}catch{return e}if(!n||typeof n!="object")return e;switch(e){case"Bash":return`Run ${Im(vd(vr(n.description)||vr(n.command),40))}`;case"Read":return`Read ${U1(vr(n.file_path))}`;case"Write":return`Write ${U1(vr(n.file_path))}`;case"Edit":return`Edit ${U1(vr(n.file_path))}`;case"Glob":return`Find ${vr(n.pattern)||"..."}`;case"Grep":return`Search ${Im(vd(vr(n.pattern),30))}`;case"Task":return`Agent: ${vd(vr(n.description)||vr(n.prompt),40)}`;case"TaskCreate":return`Create task ${Im(vd(vr(n.subject),35))}`;case"TaskUpdate":{const r=vr(n.taskId),s=vr(n.status);return s?`Update task #${r} → ${s}`:`Update task #${r}`}case"TaskList":return"List tasks";case"Skill":return`Skill ${vr(n.skill)||"..."}`;case"WebSearch":return`Search ${Im(vd(vr(n.query),35))}`;case"WebFetch":return`Fetch ${pz(vr(n.url))}`;default:return e}}function Y5(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,t=>t.toUpperCase())}function xz(e,t){return e.length<=t?e:e.slice(0,t)+"…"}function yz(e){return/^[/~.]/.test(e)||/\.(ts|tsx|js|jsx|json|md|py|rs|go|sh|yml|yaml|toml)$/.test(e)}function zb(e,t){if(e===null)return u.jsx("span",{className:"text-muted-foreground italic",children:"null"});if(typeof e=="boolean")return u.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:String(e)});if(typeof e=="number")return u.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:e});if(typeof e=="string"){const n=xz(e,t);return yz(e)?u.jsx("code",{className:"bg-muted rounded px-1 py-0.5 text-xs break-all",children:n}):u.jsx("span",{className:"break-words",children:n})}if(Array.isArray(e)){const n=e.slice(0,5),r=e.length-5;return u.jsxs("div",{className:"space-y-0.5",children:[n.map((s,i)=>u.jsx("div",{className:"border-border/40 border-l pl-2",children:zb(s,80)},i)),r>0&&u.jsxs("span",{className:"text-muted-foreground text-xs italic",children:["… and ",r," more"]})]})}if(typeof e=="object"){const n=Object.entries(e);return u.jsx("div",{className:"space-y-0.5",children:n.map(([r,s])=>u.jsxs("div",{className:"border-border/40 border-l pl-2",children:[u.jsxs("span",{className:"text-muted-foreground text-xs",children:[Y5(r),": "]}),typeof s=="object"&&s!==null?u.jsx("span",{className:"text-muted-foreground italic",children:"{..."}):zb(s,80)]},r))})}return u.jsx("span",{children:String(e)})}function G5({toolName:e,input:t}){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return u.jsx("pre",{className:"overflow-x-auto text-xs whitespace-pre-wrap",children:t})}if(typeof n!="object"||n===null||Array.isArray(n))return u.jsx("pre",{className:"overflow-x-auto text-xs whitespace-pre-wrap",children:t});const r=Object.entries(n);return r.length===0?null:u.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs",children:r.map(([s,i])=>u.jsxs("div",{className:"contents",children:[u.jsx("dt",{className:"text-muted-foreground py-0.5 font-medium whitespace-nowrap",children:Y5(s)}),u.jsx("dd",{className:"min-w-0 py-0.5",children:zb(i,120)})]},s))})}const Ub=["😀","😎","🤖","🦊","🐱","🐶","🦁","🐸","🐵","🦄","🐲","🦉","🐧","🐼","🦋","🌸","🔮","🎯","🚀","⚡","🌊","🍀","🎨","🎵","💎","🔥","🌈","⭐","🧠","👾"];function K5(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t*16777619>>>0;return t}function cf(e){return`hsl(${K5(e)%360}, 70%, 55%)`}function df(e){return Ub[K5(e)%Ub.length]}function bz(e){const t=document.createElement("canvas");t.width=32,t.height=32;const n=t.getContext("2d");return n?(n.fillStyle=e,n.beginPath(),n.arc(16,16,15,0,Math.PI*2),n.fill(),t.toDataURL("image/png")):""}function vz(e,t=20,n=.3){return new Promise((r,s)=>{const i=new Image;i.onload=()=>{const l=[];for(let c=0;c<t;c++){const d=1-Math.sin(c/t*Math.PI)*(1-n),p=document.createElement("canvas");p.width=32,p.height=32;const m=p.getContext("2d");if(!m){s(new Error("Canvas context unavailable"));return}m.globalAlpha=d,m.drawImage(i,0,0),l.push(p.toDataURL("image/png"))}r(l)},i.onerror=s,i.src=e})}function H1(e){let t=document.querySelector("link[rel*='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e}const oA="DorkOS";function Lm(e){document.title=e>0?`(${e}) ${oA}`:oA}let Pm=null;function Ez(){try{Pm||(Pm=new Audio("/notification.wav")),Pm.currentTime=0,Pm.play().catch(()=>{})}catch{}}const Sr={FONT_SIZE:"dorkos-font-size",FONT_FAMILY:"dorkos-font-family",RECENT_CWDS:"dorkos-recent-cwds",PICKER_VIEW:"dorkos-picker-view",GESTURE_HINT_COUNT:"dorkos-gesture-hint-count"},lA={small:"0.9",medium:"1",large:"1.15"},Tz=10,Ns={COPY_FEEDBACK_MS:1500,NEW_SESSION_HIGHLIGHT_MS:300,SIDEBAR_AUTO_CLOSE_MS:300,TOOL_CALL_AUTO_HIDE_MS:5e3,CELEBRATION_DISPLAY_MS:2e3,GESTURE_HINT_DISMISS_MS:4e3,LONG_PRESS_MS:500,MIN_STREAM_DURATION_MS:3e3,SESSION_BUSY_CLEAR_MS:5e3},uA={MS_PER_MINUTE:6e4,MS_PER_HOUR:36e5},vs={DEFAULT_STALE_TIME_MS:3e4,DEFAULT_RETRY:1,SESSIONS_REFETCH_MS:6e4,ACTIVE_TAB_REFETCH_MS:3e3,BACKGROUND_TAB_REFETCH_MS:1e4,COMMANDS_STALE_TIME_MS:300*1e3,COMMANDS_GC_TIME_MS:1800*1e3,FILES_STALE_TIME_MS:300*1e3,FILES_GC_TIME_MS:1800*1e3,GIT_STATUS_REFETCH_MS:1e4,GIT_STATUS_STALE_TIME_MS:5e3,MESSAGE_STALE_TIME_MS:0},du={DEBOUNCE_WINDOW_MS:2e3,DEBOUNCE_THRESHOLD:3,MINI_PROBABILITY:.3,MIN_TASKS_FOR_MAJOR:3,IDLE_TIMEOUT_MS:3e4},Sz=["Today","Yesterday","Previous 7 Days","Previous 30 Days","Older"];function wz(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(n);r.setDate(r.getDate()-1);const s=new Date(n);s.setDate(s.getDate()-7);const i=new Date(n);i.setDate(i.getDate()-30);const l={Today:[],Yesterday:[],"Previous 7 Days":[],"Previous 30 Days":[],Older:[]};for(const c of e){const f=new Date(c.updatedAt);f>=n?l.Today.push(c):f>=r?l.Yesterday.push(c):f>=s?l["Previous 7 Days"].push(c):f>=i?l["Previous 30 Days"].push(c):l.Older.push(c)}return Sz.map(c=>({label:c,sessions:l[c]})).filter(c=>c.sessions.length>0)}function Op(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,"~")}function Dp(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),s=Math.floor(r/uA.MS_PER_MINUTE),i=Math.floor(r/uA.MS_PER_HOUR),l=new Date(t.getFullYear(),t.getMonth(),t.getDate()),c=new Date(l);c.setDate(c.getDate()-1);const f=new Date(l);if(f.setDate(f.getDate()-7),n>=l)return s<1?"Just now":s<60?`${s}m ago`:`${i}h ago`;const d=n.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0}).toLowerCase();return n>=c?`Yesterday, ${d}`:n>=f?`${n.toLocaleDateString("en-US",{weekday:"short"})}, ${d}`:`${n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}, ${d}`}const jp=[{key:"system",displayName:"System Default",description:"Native platform fonts",sans:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",mono:"ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace",googleFontsUrl:null},{key:"inter",displayName:"Inter",description:"Inter + JetBrains Mono",sans:"'Inter', system-ui, sans-serif",mono:"'JetBrains Mono', ui-monospace, monospace",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono&display=swap"},{key:"geist",displayName:"Geist",description:"Geist + Geist Mono",sans:"'Geist', system-ui, sans-serif",mono:"'Geist Mono', ui-monospace, monospace",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono&display=swap"},{key:"ibm-plex",displayName:"IBM Plex",description:"IBM Plex Sans + IBM Plex Mono",sans:"'IBM Plex Sans', system-ui, sans-serif",mono:"'IBM Plex Mono', ui-monospace, monospace",googleFontsUrl:"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono&display=swap"},{key:"roboto",displayName:"Roboto",description:"Roboto + Roboto Mono",sans:"'Roboto', system-ui, sans-serif",mono:"'Roboto Mono', ui-monospace, monospace",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Mono&display=swap"},{key:"source",displayName:"Source",description:"Source Sans 3 + Source Code Pro",sans:"'Source Sans 3', system-ui, sans-serif",mono:"'Source Code Pro', ui-monospace, monospace",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600&family=Source+Code+Pro&display=swap"},{key:"fira",displayName:"Fira",description:"Fira Sans + Fira Code",sans:"'Fira Sans', system-ui, sans-serif",mono:"'Fira Code', ui-monospace, monospace",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;600&family=Fira+Code&display=swap"},{key:"space",displayName:"Space",description:"Space Grotesk + Space Mono",sans:"'Space Grotesk', system-ui, sans-serif",mono:"'Space Mono', ui-monospace, monospace",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Space+Mono&display=swap"}],Pd="inter";function $1(e){return jp.find(t=>t.key===e)??jp.find(t=>t.key===Pd)}function Cz(e){return jp.some(t=>t.key===e)}const Hb="google-fonts-link";function V1(e){let t=document.getElementById(Hb);t?t.href=e:(t=document.createElement("link"),t.id=Hb,t.rel="stylesheet",t.href=e,document.head.appendChild(t))}function Nz(){var e;(e=document.getElementById(Hb))==null||e.remove()}function q1(e,t){document.documentElement.style.setProperty("--font-sans",e),document.documentElement.style.setProperty("--font-mono",t)}function Az(){document.documentElement.style.removeProperty("--font-sans"),document.documentElement.style.removeProperty("--font-mono")}class kz{constructor(t){We(this,"config");We(this,"recentCompletions",[]);We(this,"queue",[]);We(this,"isIdle",!1);We(this,"debounceTimer",null);this.config=t}onTaskCompleted(t,n){if(!this.config.enabled)return;const r=Date.now();this.recentCompletions.push(r),this.recentCompletions=this.recentCompletions.filter(c=>r-c<this.config.debounceWindowMs);const s=n.length,i=n.filter(c=>c.status==="completed").length;if(s>=this.config.minTasksForMajor&&i===s){this.cancelDebounce();const c={level:"major",taskId:t,timestamp:r};this.emitOrQueue(c);return}if(this.recentCompletions.length>=this.config.debounceThreshold){this.cancelDebounce(),this.debounceTimer=setTimeout(()=>{const c={level:"mini",taskId:t,timestamp:Date.now()};this.emitOrQueue(c),this.recentCompletions=[]},this.config.debounceWindowMs);return}if(Math.random()<this.config.miniProbability){const c={level:"mini",taskId:t,timestamp:r};this.emitOrQueue(c)}}setIdle(t){this.isIdle=t}onUserReturn(){if(this.queue.length>0){const n=this.queue.some(r=>r.level==="major")?this.queue.find(r=>r.level==="major"):this.queue[this.queue.length-1];this.config.onCelebrate(n),this.queue=[]}}destroy(){this.cancelDebounce(),this.queue=[],this.recentCompletions=[]}emitOrQueue(t){this.isIdle?this.queue.push(t):this.config.onCelebrate(t)}cancelDebounce(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}}async function Q5(e){const t=(await c0(async()=>{const{default:s}=await import("./confetti.module-5PKC4vm3.js");return{default:s}},[])).default,r={...{particleCount:40,spread:70,origin:{x:.5,y:.6},colors:["#FFD700","#FFC107","#F7B500"],ticks:120,gravity:1.2,scalar:.9,drift:0,disableForReducedMotion:!0},...e};return t(r),()=>t.reset()}const _z={background:"radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%)"};function Rz(e){if(typeof BroadcastChannel>"u")return{postMessage:()=>{},onMessage:()=>()=>{},close:()=>{}};const t=new BroadcastChannel(e);return{postMessage(n){t.postMessage(n)},onMessage(n){const r=s=>n(s.data);return t.addEventListener("message",r),()=>t.removeEventListener("message",r)},close(){t.close()}}}function ur(e,t){try{const n=localStorage.getItem(e);return n===null?t:n==="true"}catch{return t}}function Zn(e,t){try{localStorage.setItem(e,String(t))}catch{}}const Nt={sidebarOpen:"dorkos-sidebar-open",showTimestamps:"dorkos-show-timestamps",expandToolCalls:"dorkos-expand-tool-calls",autoHideToolCalls:"dorkos-auto-hide-tool-calls",showShortcutChips:"dorkos-show-shortcut-chips",showStatusBarCwd:"dorkos-show-status-bar-cwd",showStatusBarPermission:"dorkos-show-status-bar-permission",showStatusBarModel:"dorkos-show-status-bar-model",showStatusBarCost:"dorkos-show-status-bar-cost",showStatusBarContext:"dorkos-show-status-bar-context",showStatusBarGit:"dorkos-show-status-bar-git",showTaskCelebrations:"dorkos-show-task-celebrations",enableNotificationSound:"dorkos-enable-notification-sound",enablePulseNotifications:"dorkos-enable-pulse-notifications",showStatusBarSound:"dorkos-show-status-bar-sound",showStatusBarVersion:"dorkos-show-status-bar-version",showStatusBarTunnel:"dorkos-show-status-bar-tunnel"},cA={sidebarOpen:!1,showTimestamps:!1,expandToolCalls:!1,autoHideToolCalls:!0,showShortcutChips:!0,showStatusBarCwd:!0,showStatusBarPermission:!0,showStatusBarModel:!0,showStatusBarCost:!0,showStatusBarContext:!0,showStatusBarGit:!0,showTaskCelebrations:!0,enableNotificationSound:!0,enablePulseNotifications:!0,showStatusBarSound:!0,showStatusBarVersion:!0,showStatusBarTunnel:!0},Jt=R5()(NF(e=>({sidebarOpen:(()=>{try{if(window.matchMedia("(max-width: 767px)").matches)return!1}catch{}return ur(Nt.sidebarOpen,cA.sidebarOpen)})(),toggleSidebar:()=>e(t=>{const n=!t.sidebarOpen;return Zn(Nt.sidebarOpen,n),{sidebarOpen:n}}),setSidebarOpen:t=>{Zn(Nt.sidebarOpen,t),e({sidebarOpen:t})},settingsOpen:!1,setSettingsOpen:t=>e({settingsOpen:t}),pulseOpen:!1,setPulseOpen:t=>e({pulseOpen:t}),relayOpen:!1,setRelayOpen:t=>e({relayOpen:t}),meshOpen:!1,setMeshOpen:t=>e({meshOpen:t}),pickerOpen:!1,setPickerOpen:t=>e({pickerOpen:t}),sessionId:null,setSessionId:t=>e({sessionId:t}),selectedCwd:null,setSelectedCwd:t=>e(n=>{const s=[{path:t,accessedAt:new Date().toISOString()},...n.recentCwds.filter(i=>i.path!==t)].slice(0,Tz);try{localStorage.setItem(Sr.RECENT_CWDS,JSON.stringify(s))}catch{}return{selectedCwd:t,recentCwds:s}}),recentCwds:(()=>{try{return JSON.parse(localStorage.getItem(Sr.RECENT_CWDS)||"[]").map(n=>typeof n=="string"?{path:n,accessedAt:new Date().toISOString()}:n)}catch{return[]}})(),devtoolsOpen:!1,toggleDevtools:()=>e(t=>({devtoolsOpen:!t.devtoolsOpen})),showTimestamps:ur(Nt.showTimestamps,!1),setShowTimestamps:t=>{Zn(Nt.showTimestamps,t),e({showTimestamps:t})},expandToolCalls:ur(Nt.expandToolCalls,!1),setExpandToolCalls:t=>{Zn(Nt.expandToolCalls,t),e({expandToolCalls:t})},autoHideToolCalls:ur(Nt.autoHideToolCalls,!0),setAutoHideToolCalls:t=>{Zn(Nt.autoHideToolCalls,t),e({autoHideToolCalls:t})},showShortcutChips:ur(Nt.showShortcutChips,!0),setShowShortcutChips:t=>{Zn(Nt.showShortcutChips,t),e({showShortcutChips:t})},showStatusBarCwd:ur(Nt.showStatusBarCwd,!0),setShowStatusBarCwd:t=>{Zn(Nt.showStatusBarCwd,t),e({showStatusBarCwd:t})},showStatusBarPermission:ur(Nt.showStatusBarPermission,!0),setShowStatusBarPermission:t=>{Zn(Nt.showStatusBarPermission,t),e({showStatusBarPermission:t})},showStatusBarModel:ur(Nt.showStatusBarModel,!0),setShowStatusBarModel:t=>{Zn(Nt.showStatusBarModel,t),e({showStatusBarModel:t})},showStatusBarCost:ur(Nt.showStatusBarCost,!0),setShowStatusBarCost:t=>{Zn(Nt.showStatusBarCost,t),e({showStatusBarCost:t})},showStatusBarContext:ur(Nt.showStatusBarContext,!0),setShowStatusBarContext:t=>{Zn(Nt.showStatusBarContext,t),e({showStatusBarContext:t})},showStatusBarGit:ur(Nt.showStatusBarGit,!0),setShowStatusBarGit:t=>{Zn(Nt.showStatusBarGit,t),e({showStatusBarGit:t})},showTaskCelebrations:ur(Nt.showTaskCelebrations,!0),setShowTaskCelebrations:t=>{Zn(Nt.showTaskCelebrations,t),e({showTaskCelebrations:t})},enableNotificationSound:ur(Nt.enableNotificationSound,!0),setEnableNotificationSound:t=>{Zn(Nt.enableNotificationSound,t),e({enableNotificationSound:t})},enablePulseNotifications:ur(Nt.enablePulseNotifications,!0),setEnablePulseNotifications:t=>{Zn(Nt.enablePulseNotifications,t),e({enablePulseNotifications:t})},showStatusBarSound:ur(Nt.showStatusBarSound,!0),setShowStatusBarSound:t=>{Zn(Nt.showStatusBarSound,t),e({showStatusBarSound:t})},showStatusBarVersion:ur(Nt.showStatusBarVersion,!0),setShowStatusBarVersion:t=>{Zn(Nt.showStatusBarVersion,t),e({showStatusBarVersion:t})},showStatusBarTunnel:ur(Nt.showStatusBarTunnel,!0),setShowStatusBarTunnel:t=>{Zn(Nt.showStatusBarTunnel,t),e({showStatusBarTunnel:t})},fontSize:(()=>{try{const t=localStorage.getItem(Sr.FONT_SIZE);if(t==="small"||t==="medium"||t==="large")return document.documentElement.style.setProperty("--user-font-scale",lA[t]),t}catch{}return"medium"})(),setFontSize:t=>{try{localStorage.setItem(Sr.FONT_SIZE,t)}catch{}document.documentElement.style.setProperty("--user-font-scale",lA[t]),e({fontSize:t})},fontFamily:(()=>{try{const t=localStorage.getItem(Sr.FONT_FAMILY),n=Cz(t??"")?t:Pd,r=$1(n);return r.googleFontsUrl&&V1(r.googleFontsUrl),r.key!=="system"&&q1(r.sans,r.mono),n}catch{return Pd}})(),setFontFamily:t=>{try{localStorage.setItem(Sr.FONT_FAMILY,t)}catch{}const n=$1(t);n.googleFontsUrl?V1(n.googleFontsUrl):Nz(),n.key!=="system"?q1(n.sans,n.mono):Az(),e({fontFamily:t})},resetPreferences:()=>{try{for(const n of Object.values(Nt))localStorage.removeItem(n);localStorage.removeItem(Sr.FONT_SIZE),localStorage.removeItem(Sr.FONT_FAMILY)}catch{}document.documentElement.style.setProperty("--user-font-scale","1");const t=$1(Pd);t.googleFontsUrl&&V1(t.googleFontsUrl),q1(t.sans,t.mono),e({...cA,devtoolsOpen:!1,fontSize:"medium",fontFamily:Pd})},isStreaming:!1,setIsStreaming:t=>e({isStreaming:t}),isWaitingForUser:!1,setIsWaitingForUser:t=>e({isWaitingForUser:t}),activeForm:null,setActiveForm:t=>e({activeForm:t}),contextFiles:[],addContextFile:t=>e(n=>n.contextFiles.some(r=>r.path===t.path)?n:{contextFiles:[...n.contextFiles,{...t,id:crypto.randomUUID()}]}),removeContextFile:t=>e(n=>({contextFiles:n.contextFiles.filter(r=>r.id!==t)})),clearContextFiles:()=>e({contextFiles:[]})}),{name:"app-store"})),X5="dorkos-theme",Oz="(prefers-color-scheme: dark)";function Dz(){const e=localStorage.getItem(X5);return e==="light"||e==="dark"||e==="system"?e:"system"}function Bm(e){document.documentElement.classList.toggle("dark",e)}function gE(){const[e,t]=b.useState(Dz),n=b.useCallback(r=>{localStorage.setItem(X5,r),t(r)},[]);return b.useEffect(()=>{if(e==="system"){if(typeof window.matchMedia!="function"){Bm(!1);return}const r=window.matchMedia(Oz);Bm(r.matches);const s=i=>Bm(i.matches);return r.addEventListener("change",s),()=>r.removeEventListener("change",s)}Bm(e==="dark")},[e]),{theme:e,setTheme:n}}const dA=768;function pl(){const[e,t]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(`(max-width: ${dA-1}px)`).matches);return b.useEffect(()=>{const n=window.matchMedia(`(max-width: ${dA-1}px)`),r=s=>t(s.matches);return n.addEventListener("change",r),t(n.matches),()=>n.removeEventListener("change",r)},[]),e}const jz=100;function Mz({cwd:e,isStreaming:t,color:n}){const r=b.useRef(""),s=b.useRef([]),i=b.useRef(null),l=b.useRef(0),c=b.useRef(t);b.useEffect(()=>{c.current=t},[t]);const f=b.useCallback(()=>{i.current&&(clearInterval(i.current),i.current=null),s.current.length!==0&&(l.current=0,i.current=window.setInterval(()=>{const p=s.current;p.length!==0&&(H1(p[l.current]),l.current=(l.current+1)%p.length)},jz))},[]),d=b.useCallback(()=>{i.current&&(clearInterval(i.current),i.current=null),r.current&&H1(r.current)},[]);b.useEffect(()=>{if(!e)return;const p=n??cf(e),m=bz(p);r.current=m,s.current=[],H1(m);let x=!1;return vz(m).then(y=>{x||(s.current=y,c.current&&f())}),()=>{x=!0}},[e,n,f]),b.useEffect(()=>(t?f():d(),d),[t,f,d])}function fA(e,t,n,r,s){const i=s??df(e),l=r??e.split("/").filter(Boolean).pop()??e;let c=`${n}${i} ${l}`;if(t){const f=t.length>40?t.slice(0,40)+"…":t;c+=` — ${f}`}return c+=" — DorkOS",c}function Iz({cwd:e,activeForm:t,isStreaming:n,isWaitingForUser:r,agentName:s,agentEmoji:i}){const l=b.useRef(document.hidden),c=b.useRef(!1),f=b.useRef(n),d=b.useRef(e),p=b.useRef(t),m=b.useRef(r),x=b.useRef(s),y=b.useRef(i);b.useEffect(()=>{d.current=e,p.current=t,m.current=r,x.current=s,y.current=i},[e,t,r,s,i]),b.useEffect(()=>{const v=()=>{if(l.current=document.hidden,!document.hidden&&c.current&&(c.current=!1,d.current)){const T=m.current?"🔔 ":"";document.title=fA(d.current,p.current,T,x.current,y.current)}};return document.addEventListener("visibilitychange",v),()=>document.removeEventListener("visibilitychange",v)},[]),b.useEffect(()=>{f.current&&!n&&l.current&&(c.current=!0),f.current=n},[n]),b.useEffect(()=>{if(!e){document.title="DorkOS";return}let v="";r?v="🔔 ":c.current&&(v="🏁 "),document.title=fA(e,t,v,s,i)},[e,t,n,r,s,i])}function Lz(e){const t=Math.floor(e/1e3);if(t<3600){const s=Math.floor(t/60),i=t%60;return`${s}m ${String(i).padStart(2,"0")}s`}const n=Math.floor(t/3600),r=Math.floor(t%3600/60);return`${n}h ${String(r).padStart(2,"0")}m`}function Pz(e){const[t,n]=b.useState(()=>Date.now()),r=b.useRef(null);if(b.useEffect(()=>{if(e===null){r.current&&(clearInterval(r.current),r.current=null);return}return n(Date.now()),r.current=setInterval(()=>n(Date.now()),1e3),()=>{r.current&&(clearInterval(r.current),r.current=null)}},[e]),e===null)return{formatted:"0m 00s",ms:0};const s=Math.max(0,t-e);return{formatted:Lz(s),ms:s}}function Bz(e={}){const{timeoutMs:t=3e4,onIdle:n,onReturn:r}=e,s=b.useRef(!1),i=b.useRef(null),l=b.useCallback(()=>{s.current||(s.current=!0,n==null||n())},[n]),c=b.useCallback(()=>{s.current&&(s.current=!1,r==null||r())},[r]),f=b.useCallback(()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(l,t),c()},[t,l,c]);return b.useEffect(()=>{i.current=setTimeout(l,t);const d=["mousemove","keydown","scroll","touchstart"];d.forEach(m=>document.addEventListener(m,f,{passive:!0}));const p=()=>{document.hidden?l():f()};return document.addEventListener("visibilitychange",p),()=>{i.current&&clearTimeout(i.current),d.forEach(m=>document.removeEventListener(m,f)),document.removeEventListener("visibilitychange",p)}},[t,l,f]),{isIdle:s.current}}function Fz({activeInteraction:e,onApprove:t,onDeny:n,onToggleOption:r,onNavigateOption:s,onNavigateQuestion:i,onSubmit:l,optionCount:c=0,focusedIndex:f=0}){const d=b.useRef(!1);b.useEffect(()=>{d.current=!1},[e==null?void 0:e.toolCallId]),b.useEffect(()=>{if(!e)return;function p(m){const x=m.target,y=(x.tagName==="TEXTAREA"||x.tagName==="INPUT")&&!x.disabled;if(!d.current){if(e.type==="approval"){m.key==="Enter"?(m.preventDefault(),d.current=!0,t==null||t()):m.key==="Escape"&&(m.preventDefault(),d.current=!0,n==null||n());return}if(e.type==="question"){if(y){m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),l==null||l());return}const v=parseInt(m.key,10);if(v>=1&&v<=9){m.preventDefault(),v-1<c&&(r==null||r(v-1));return}switch(m.key){case"ArrowUp":m.preventDefault(),s==null||s("up");break;case"ArrowDown":m.preventDefault(),s==null||s("down");break;case" ":m.preventDefault(),r==null||r(f);break;case"ArrowLeft":case"[":m.preventDefault(),i==null||i("prev");break;case"ArrowRight":case"]":m.preventDefault(),i==null||i("next");break;case"Enter":m.preventDefault(),l==null||l();break}}}}return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,t,n,r,s,i,l,c,f])}const zz=300*1e3;function xE(e){var r;const t=He(),{data:n}=vt({queryKey:["config"],queryFn:()=>t.getConfig(),staleTime:zz});return((r=n==null?void 0:n[e])==null?void 0:r.enabled)??!1}function W5(e,t,n){try{return e(t)}catch(r){return Q7("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,r,n),null}}function si(e){function t(n){if(typeof n>"u")return null;let r="";if(Array.isArray(n)){if(n[0]===void 0)return null;r=n[0]}return typeof n=="string"&&(r=n),W5(e.parse,r)}return{type:"single",eq:(n,r)=>n===r,...e,parseServerSide:t,withDefault(n){return{...this,defaultValue:n,parseServerSide(r){return t(r)??n}}},withOptions(n){return{...this,...n}}}}si({parse:e=>e,serialize:String});si({parse:e=>{const t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)});si({parse:e=>{const t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)});si({parse:e=>{const t=parseInt(e,16);return t==t?t:null},serialize:e=>{const t=Math.round(e).toString(16);return(t.length&1?"0":"")+t}});si({parse:e=>{const t=parseFloat(e);return t==t?t:null},serialize:String});si({parse:e=>e.toLowerCase()==="true",serialize:String});function yE(e,t){return e.valueOf()===t.valueOf()}si({parse:e=>{const t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:yE});si({parse:e=>{const t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:yE});si({parse:e=>{const t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:yE});const Y1=hE(),Uz={};function Hz(e,t={}){const n=b.useId(),r=rF(),s=sF(),{history:i="replace",scroll:l=(r==null?void 0:r.scroll)??!1,shallow:c=(r==null?void 0:r.shallow)??!0,throttleMs:f=Vd.timeMs,limitUrlUpdates:d=r==null?void 0:r.limitUrlUpdates,clearOnDefault:p=(r==null?void 0:r.clearOnDefault)??!0,startTransition:m,urlKeys:x=Uz}=t,y=Object.keys(e).join(","),v=b.useMemo(()=>Object.fromEntries(Object.keys(e).map(I=>[I,x[I]??I])),[y,JSON.stringify(x)]),T=nF(Object.values(v)),w=T.searchParams,N=b.useRef({}),A=b.useMemo(()=>Object.fromEntries(Object.keys(e).map(I=>[I,e[I].defaultValue??null])),[Object.values(e).map(({defaultValue:I})=>I).join(",")]),k=P1.useQueuedQueries(Object.values(v)),[R,D]=b.useState(()=>G1(e,x,w??new URLSearchParams,k).state),O=b.useRef(R);if(pn("[nuq+ %s `%s`] render - state: %O, iSP: %s",n,y,R,w),Object.keys(N.current).join("&")!==Object.values(v).join("&")){const{state:I,hasChanged:H}=G1(e,x,w,k,N.current,O.current);H&&(pn("[nuq+ %s `%s`] State changed: %O",n,y,{state:I,initialSearchParams:w,queuedQueries:k,queryRef:N.current,stateRef:O.current}),O.current=I,D(I)),N.current=Object.fromEntries(Object.entries(v).map(([P,K])=>{var Y;return[K,((Y=e[P])==null?void 0:Y.type)==="multi"?w==null?void 0:w.getAll(K):(w==null?void 0:w.get(K))??null]}))}b.useEffect(()=>{const{state:I,hasChanged:H}=G1(e,x,w,k,N.current,O.current);H&&(pn("[nuq+ %s `%s`] State changed: %O",n,y,{state:I,initialSearchParams:w,queuedQueries:k,queryRef:N.current,stateRef:O.current}),O.current=I,D(I))},[Object.values(v).map(I=>`${I}=${w==null?void 0:w.getAll(I)}`).join("&"),JSON.stringify(k)]),b.useEffect(()=>{const I=Object.keys(e).reduce((H,P)=>(H[P]=({state:K,query:Y})=>{D(W=>{const{defaultValue:te}=e[P],J=v[P],L=K??te??null,B=W[P]??te??null;return Object.is(B,L)?(pn("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",n,y,J,K,te,O.current),W):(O.current={...O.current,[P]:L},N.current[J]=Y,pn("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",n,y,J,K,te,O.current),O.current)})},H),{});for(const H of Object.keys(e)){const P=v[H];pn("[nuq+ %s `%s`] Subscribing to sync for `%s`",n,P,y),Y1.on(P,I[H])}return()=>{for(const H of Object.keys(e)){const P=v[H];pn("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",n,P,y),Y1.off(P,I[H])}}},[y,v]);const M=b.useCallback((I,H={})=>{var B,U,ne,z,q,V;const P=Object.fromEntries(Object.keys(e).map(j=>[j,null])),K=typeof I=="function"?I(hA(O.current,A))??P:I??P;pn("[nuq+ %s `%s`] setState: %O",n,y,K);let Y,W=0,te=!1;const J=[];for(let[j,re]of Object.entries(K)){const ae=e[j],me=v[j];if(!ae||re===void 0)continue;(H.clearOnDefault??ae.clearOnDefault??p)&&re!==null&&ae.defaultValue!==void 0&&(ae.eq??((ve,Re)=>ve===Re))(re,ae.defaultValue)&&(re=null);const le=re===null?null:(ae.serialize??String)(re);Y1.emit(me,{state:re,query:le});const ye={key:me,query:le,options:{history:H.history??ae.history??i,shallow:H.shallow??ae.shallow??c,scroll:H.scroll??ae.scroll??l,startTransition:H.startTransition??ae.startTransition??m}};if(((B=H==null?void 0:H.limitUrlUpdates)==null?void 0:B.method)==="debounce"||(d==null?void 0:d.method)==="debounce"||((U=ae.limitUrlUpdates)==null?void 0:U.method)==="debounce"){ye.options.shallow===!0&&console.warn(Mf(422));const ve=((ne=H==null?void 0:H.limitUrlUpdates)==null?void 0:ne.timeMs)??(d==null?void 0:d.timeMs)??((z=ae.limitUrlUpdates)==null?void 0:z.timeMs)??Vd.timeMs,Re=P1.push(ye,ve,T,s);W<ve&&(Y=Re,W=ve)}else{const ve=((q=H==null?void 0:H.limitUrlUpdates)==null?void 0:q.timeMs)??((V=ae==null?void 0:ae.limitUrlUpdates)==null?void 0:V.timeMs)??(d==null?void 0:d.timeMs)??H.throttleMs??ae.throttleMs??f;J.push(P1.abort(me)),hp.push(ye,ve),te=!0}}const L=J.reduce((j,re)=>re(j),te?hp.flush(T,s):hp.getPendingPromise(T));return Y??L},[y,i,c,l,f,d==null?void 0:d.method,d==null?void 0:d.timeMs,m,v,T.updateUrl,T.getSearchParamsSnapshot,T.rateLimitFactor,s,A]);return[b.useMemo(()=>hA(R,A),[R,A]),M]}function G1(e,t,n,r,s,i){let l=!1;const c=Object.entries(e).reduce((f,[d,p])=>{const m=(t==null?void 0:t[d])??d,x=r[m],y=p.type==="multi"?[]:null,v=x===void 0?(p.type==="multi"?n==null?void 0:n.getAll(m):n==null?void 0:n.get(m))??y:x;return s&&i&&N5(s[m]??y,v)?(f[d]=i[d]??null,f):(l=!0,f[d]=(oF(v)?null:W5(p.parse,v,m))??null,s&&(s[m]=v),f)},{});if(!l){const f=Object.keys(e),d=Object.keys(i??{});l=f.length!==d.length||f.some(p=>!d.includes(p))}return{state:c,hasChanged:l}}function hA(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function Z5(e,t={}){const{parse:n,type:r,serialize:s,eq:i,defaultValue:l,...c}=t,[{[e]:f},d]=Hz({[e]:{parse:n??(p=>p),type:r,serialize:s,eq:i,defaultValue:l}},c);return[f,b.useCallback((p,m={})=>d(x=>({[e]:typeof p=="function"?p(x[e]):p}),m),[e,d])]}function oc(){Jt(n=>n.sessionId),Jt(n=>n.setSessionId);const[e,t]=Z5("session");return[e,t]}function $z(){const e=Qt(),[t,n]=oc(),r=He(),{selectedCwd:s}=Jt(),i=vt({queryKey:["sessions",s],queryFn:()=>r.listSessions(s??void 0),refetchInterval:vs.SESSIONS_REFETCH_MS,enabled:s!==null}),l=Nn({mutationFn:c=>r.createSession({...c,cwd:s??void 0}),onSuccess:c=>{e.invalidateQueries({queryKey:["sessions",s]}),n(c.id)}});return{sessions:i.data??[],isLoading:i.isLoading,createSession:l,activeSessionId:t,setActiveSession:n}}const Vz="claude-sonnet-4-5-20250929",qz={"claude-opus-4":2e5,"claude-sonnet-4":2e5,"claude-haiku-4":2e5,"claude-sonnet-3":2e5,"claude-haiku-3":2e5};function Yz(e){for(const[t,n]of Object.entries(qz))if(e.startsWith(t))return n;return null}function J5(e,t,n){const r=He(),s=Qt(),i=Jt(w=>w.selectedCwd),[l,c]=b.useState(null),[f,d]=b.useState(null),{data:p}=vt({queryKey:["session",e,i],queryFn:()=>r.getSession(e,i??void 0),staleTime:3e4}),m=l??(t==null?void 0:t.model)??(p==null?void 0:p.model)??Vz,x=(t==null?void 0:t.contextTokens)??(p==null?void 0:p.contextTokens)??null,y=(t==null?void 0:t.contextMaxTokens)??Yz(m),v={permissionMode:f??(p==null?void 0:p.permissionMode)??"default",model:m,costUsd:(t==null?void 0:t.costUsd)??null,contextPercent:x&&y?Math.min(100,Math.round(x/y*100)):null,isStreaming:n,cwd:(p==null?void 0:p.cwd)??null},T=b.useCallback(async w=>{w.model&&c(w.model),w.permissionMode&&d(w.permissionMode);try{const N=await r.updateSession(e,w,i??void 0);return s.setQueryData(["session",e,i],N),w.model&&c(null),w.permissionMode&&d(null),N}catch{w.model&&c(null),w.permissionMode&&d(null)}},[r,e,i,s]);return{...v,updateSession:T}}function Gz(){const e=He(),t=Jt(s=>s.selectedCwd),n=Jt(s=>s.setSelectedCwd),{data:r}=vt({queryKey:["defaultCwd"],queryFn:()=>e.getDefaultCwd(),enabled:t===null,staleTime:1/0,refetchOnMount:!1,refetchOnReconnect:!1});b.useEffect(()=>{r!=null&&r.path&&t===null&&n(r.path)},[r,t,n])}function If(){const e=Jt(i=>i.selectedCwd),t=Jt(i=>i.setSelectedCwd),[n,r]=Z5("dir"),[,s]=oc();return b.useEffect(()=>{n&&n!==e&&t(n)},[n]),[n??e,i=>{i?(r(i),t(i),s(null)):r(null)}]}function Kz(){const e=He();return vt({queryKey:["models"],queryFn:()=>e.getModels(),staleTime:1800*1e3})}const Xa={all:["agents"],byPath:e=>["agents","byPath",e],resolved:e=>["agents","resolved",...e]};function bE(e){const t=He();return vt({queryKey:Xa.byPath(e??""),queryFn:()=>t.getAgentByPath(e),enabled:!!e,staleTime:6e4,gcTime:5*6e4})}function e4(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.createAgent(n.path,n.name,n.description,n.runtime),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Xa.byPath(r.path)}),t.invalidateQueries({queryKey:Xa.all})}})}function Qz(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.updateAgentByPath(n.path,n.updates),onMutate:async({path:n,updates:r})=>{await t.cancelQueries({queryKey:Xa.byPath(n)});const s=t.getQueryData(Xa.byPath(n));return s&&t.setQueryData(Xa.byPath(n),{...s,...r}),{previous:s}},onError:(n,{path:r},s)=>{s!=null&&s.previous&&t.setQueryData(Xa.byPath(r),s.previous)},onSettled:(n,r,{path:s})=>{t.invalidateQueries({queryKey:Xa.byPath(s)})}})}function t4(e){const t=He();return vt({queryKey:Xa.resolved(e),queryFn:()=>t.resolveAgents(e),enabled:e.length>0,staleTime:6e4})}function n4(e,t){return b.useMemo(()=>{if(e){const n=e.id;return{color:e.color??cf(n),emoji:e.icon??df(n)}}return{color:cf(t),emoji:df(t)}},[e,t])}const vE=b.createContext({});function d0(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const r4=typeof window<"u",s4=r4?b.useLayoutEffect:b.useEffect,f0=b.createContext(null);function EE(e,t){e.indexOf(t)===-1&&e.push(t)}function Mp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ma=(e,t,n)=>n>t?t:n<e?e:n;let TE=()=>{};const ei={},a4=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function i4(e){return typeof e=="object"&&e!==null}const o4=e=>/^0[^.\s]+$/u.test(e);function SE(e){let t;return()=>(t===void 0&&(t=e()),t)}const Es=e=>e,Xz=(e,t)=>n=>t(e(n)),Lf=(...e)=>e.reduce(Xz),ff=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class wE{constructor(){this.subscriptions=[]}add(t){return EE(this.subscriptions,t),()=>Mp(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const l=this.subscriptions[i];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const zs=e=>e*1e3,bs=e=>e/1e3;function l4(e,t){return t?e*(1e3/t):0}const u4=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Wz=1e-7,Zz=12;function Jz(e,t,n,r,s){let i,l,c=0;do l=t+(n-t)/2,i=u4(l,r,s)-e,i>0?n=l:t=l;while(Math.abs(i)>Wz&&++c<Zz);return l}function Pf(e,t,n,r){if(e===t&&n===r)return Es;const s=i=>Jz(i,0,1,e,n);return i=>i===0||i===1?i:u4(s(i),t,r)}const c4=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,d4=e=>t=>1-e(1-t),f4=Pf(.33,1.53,.69,.99),CE=d4(f4),h4=c4(CE),m4=e=>(e*=2)<1?.5*CE(e):.5*(2-Math.pow(2,-10*(e-1))),NE=e=>1-Math.sin(Math.acos(e)),p4=d4(NE),g4=c4(NE),eU=Pf(.42,0,1,1),tU=Pf(0,0,.58,1),x4=Pf(.42,0,.58,1),nU=e=>Array.isArray(e)&&typeof e[0]!="number",y4=e=>Array.isArray(e)&&typeof e[0]=="number",rU={linear:Es,easeIn:eU,easeInOut:x4,easeOut:tU,circIn:NE,circInOut:g4,circOut:p4,backIn:CE,backInOut:h4,backOut:f4,anticipate:m4},sU=e=>typeof e=="string",mA=e=>{if(y4(e)){TE(e.length===4);const[t,n,r,s]=e;return Pf(t,n,r,s)}else if(sU(e))return rU[e];return e},Fm=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function aU(e,t){let n=new Set,r=new Set,s=!1,i=!1;const l=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function f(p){l.has(p)&&(d.schedule(p),e()),p(c)}const d={schedule:(p,m=!1,x=!1)=>{const v=x&&s?n:r;return m&&l.add(p),v.has(p)||v.add(p),p},cancel:p=>{r.delete(p),l.delete(p)},process:p=>{if(c=p,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(f),n.clear(),s=!1,i&&(i=!1,d.process(p))}};return d}const iU=40;function b4(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,l=Fm.reduce((k,R)=>(k[R]=aU(i),k),{}),{setup:c,read:f,resolveKeyframes:d,preUpdate:p,update:m,preRender:x,render:y,postRender:v}=l,T=()=>{const k=ei.useManualTiming?s.timestamp:performance.now();n=!1,ei.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,iU),1)),s.timestamp=k,s.isProcessing=!0,c.process(s),f.process(s),d.process(s),p.process(s),m.process(s),x.process(s),y.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(T))},w=()=>{n=!0,r=!0,s.isProcessing||e(T)};return{schedule:Fm.reduce((k,R)=>{const D=l[R];return k[R]=(O,M=!1,I=!1)=>(n||w(),D.schedule(O,M,I)),k},{}),cancel:k=>{for(let R=0;R<Fm.length;R++)l[Fm[R]].cancel(k)},state:s,steps:l}}const{schedule:sn,cancel:Ji,state:cr,steps:K1}=b4(typeof requestAnimationFrame<"u"?requestAnimationFrame:Es,!0);let mp;function oU(){mp=void 0}const Cr={now:()=>(mp===void 0&&Cr.set(cr.isProcessing||ei.useManualTiming?cr.timestamp:performance.now()),mp),set:e=>{mp=e,queueMicrotask(oU)}},v4=e=>t=>typeof t=="string"&&t.startsWith(e),E4=v4("--"),lU=v4("var(--"),AE=e=>lU(e)?uU.test(e.split("/*")[0].trim()):!1,uU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function pA(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const lc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},hf={...lc,transform:e=>ma(0,1,e)},zm={...lc,default:1},qd=e=>Math.round(e*1e5)/1e5,kE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function cU(e){return e==null}const dU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,_E=(e,t)=>n=>!!(typeof n=="string"&&dU.test(n)&&n.startsWith(e)||t&&!cU(n)&&Object.prototype.hasOwnProperty.call(n,t)),T4=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,l,c]=r.match(kE);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},fU=e=>ma(0,255,e),Q1={...lc,transform:e=>Math.round(fU(e))},Fo={test:_E("rgb","red"),parse:T4("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Q1.transform(e)+", "+Q1.transform(t)+", "+Q1.transform(n)+", "+qd(hf.transform(r))+")"};function hU(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const $b={test:_E("#"),parse:hU,transform:Fo.transform},Bf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ii=Bf("deg"),oa=Bf("%"),ze=Bf("px"),mU=Bf("vh"),pU=Bf("vw"),gA={...oa,parse:e=>oa.parse(e)/100,transform:e=>oa.transform(e*100)},Cu={test:_E("hsl","hue"),parse:T4("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+oa.transform(qd(t))+", "+oa.transform(qd(n))+", "+qd(hf.transform(r))+")"},Fn={test:e=>Fo.test(e)||$b.test(e)||Cu.test(e),parse:e=>Fo.test(e)?Fo.parse(e):Cu.test(e)?Cu.parse(e):$b.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Fo.transform(e):Cu.transform(e),getAnimatableNone:e=>{const t=Fn.parse(e);return t.alpha=0,Fn.transform(t)}},gU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xU(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(kE))==null?void 0:t.length)||0)+(((n=e.match(gU))==null?void 0:n.length)||0)>0}const S4="number",w4="color",yU="var",bU="var(",xA="${}",vU=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function mf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const c=t.replace(vU,f=>(Fn.test(f)?(r.color.push(i),s.push(w4),n.push(Fn.parse(f))):f.startsWith(bU)?(r.var.push(i),s.push(yU),n.push(f)):(r.number.push(i),s.push(S4),n.push(parseFloat(f))),++i,xA)).split(xA);return{values:n,split:c,indexes:r,types:s}}function C4(e){return mf(e).values}function N4(e){const{split:t,types:n}=mf(e),r=t.length;return s=>{let i="";for(let l=0;l<r;l++)if(i+=t[l],s[l]!==void 0){const c=n[l];c===S4?i+=qd(s[l]):c===w4?i+=Fn.transform(s[l]):i+=s[l]}return i}}const EU=e=>typeof e=="number"?0:Fn.test(e)?Fn.getAnimatableNone(e):e;function TU(e){const t=C4(e);return N4(e)(t.map(EU))}const eo={test:xU,parse:C4,createTransformer:N4,getAnimatableNone:TU};function X1(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function SU({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,l=0;if(!t)s=i=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,f=2*n-c;s=X1(f,c,e+1/3),i=X1(f,c,e),l=X1(f,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(l*255),alpha:r}}function Ip(e,t){return n=>n>0?t:e}const bn=(e,t,n)=>e+(t-e)*n,W1=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},wU=[$b,Fo,Cu],CU=e=>wU.find(t=>t.test(e));function yA(e){const t=CU(e);if(!t)return!1;let n=t.parse(e);return t===Cu&&(n=SU(n)),n}const bA=(e,t)=>{const n=yA(e),r=yA(t);if(!n||!r)return Ip(e,t);const s={...n};return i=>(s.red=W1(n.red,r.red,i),s.green=W1(n.green,r.green,i),s.blue=W1(n.blue,r.blue,i),s.alpha=bn(n.alpha,r.alpha,i),Fo.transform(s))},Vb=new Set(["none","hidden"]);function NU(e,t){return Vb.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function AU(e,t){return n=>bn(e,t,n)}function RE(e){return typeof e=="number"?AU:typeof e=="string"?AE(e)?Ip:Fn.test(e)?bA:RU:Array.isArray(e)?A4:typeof e=="object"?Fn.test(e)?bA:kU:Ip}function A4(e,t){const n=[...e],r=n.length,s=e.map((i,l)=>RE(i)(i,t[l]));return i=>{for(let l=0;l<r;l++)n[l]=s[l](i);return n}}function kU(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=RE(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function _U(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],l=e.indexes[i][r[i]],c=e.values[l]??0;n[s]=c,r[i]++}return n}const RU=(e,t)=>{const n=eo.createTransformer(t),r=mf(e),s=mf(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Vb.has(e)&&!s.values.length||Vb.has(t)&&!r.values.length?NU(e,t):Lf(A4(_U(r,s),s.values),n):Ip(e,t)};function k4(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?bn(e,t,n):RE(e)(e,t)}const OU=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>sn.update(t,n),stop:()=>Ji(t),now:()=>cr.isProcessing?cr.timestamp:Cr.now()}},_4=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Lp=2e4;function OE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Lp;)t+=n,r=e.next(t);return t>=Lp?1/0:t}function DU(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(OE(r),Lp);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:bs(s)}}const jU=5;function R4(e,t,n){const r=Math.max(t-jU,0);return l4(n-e(r),t-r)}const wn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Z1=.001;function MU({duration:e=wn.duration,bounce:t=wn.bounce,velocity:n=wn.velocity,mass:r=wn.mass}){let s,i,l=1-t;l=ma(wn.minDamping,wn.maxDamping,l),e=ma(wn.minDuration,wn.maxDuration,bs(e)),l<1?(s=d=>{const p=d*l,m=p*e,x=p-n,y=qb(d,l),v=Math.exp(-m);return Z1-x/y*v},i=d=>{const m=d*l*e,x=m*n+n,y=Math.pow(l,2)*Math.pow(d,2)*e,v=Math.exp(-m),T=qb(Math.pow(d,2),l);return(-s(d)+Z1>0?-1:1)*((x-y)*v)/T}):(s=d=>{const p=Math.exp(-d*e),m=(d-n)*e+1;return-Z1+p*m},i=d=>{const p=Math.exp(-d*e),m=(n-d)*(e*e);return p*m});const c=5/e,f=LU(s,i,c);if(e=zs(e),isNaN(f))return{stiffness:wn.stiffness,damping:wn.damping,duration:e};{const d=Math.pow(f,2)*r;return{stiffness:d,damping:l*2*Math.sqrt(r*d),duration:e}}}const IU=12;function LU(e,t,n){let r=n;for(let s=1;s<IU;s++)r=r-e(r)/t(r);return r}function qb(e,t){return e*Math.sqrt(1-t*t)}const PU=["duration","bounce"],BU=["stiffness","damping","mass"];function vA(e,t){return t.some(n=>e[n]!==void 0)}function FU(e){let t={velocity:wn.velocity,stiffness:wn.stiffness,damping:wn.damping,mass:wn.mass,isResolvedFromDuration:!1,...e};if(!vA(e,BU)&&vA(e,PU))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ma(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:wn.mass,stiffness:s,damping:i}}else{const n=MU(e);t={...t,...n,mass:wn.mass},t.isResolvedFromDuration=!0}return t}function Pp(e=wn.visualDuration,t=wn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:i},{stiffness:f,damping:d,mass:p,duration:m,velocity:x,isResolvedFromDuration:y}=FU({...n,velocity:-bs(n.velocity||0)}),v=x||0,T=d/(2*Math.sqrt(f*p)),w=l-i,N=bs(Math.sqrt(f/p)),A=Math.abs(w)<5;r||(r=A?wn.restSpeed.granular:wn.restSpeed.default),s||(s=A?wn.restDelta.granular:wn.restDelta.default);let k;if(T<1){const D=qb(N,T);k=O=>{const M=Math.exp(-T*N*O);return l-M*((v+T*N*w)/D*Math.sin(D*O)+w*Math.cos(D*O))}}else if(T===1)k=D=>l-Math.exp(-N*D)*(w+(v+N*w)*D);else{const D=N*Math.sqrt(T*T-1);k=O=>{const M=Math.exp(-T*N*O),I=Math.min(D*O,300);return l-M*((v+T*N*w)*Math.sinh(I)+D*w*Math.cosh(I))/D}}const R={calculatedDuration:y&&m||null,next:D=>{const O=k(D);if(y)c.done=D>=m;else{let M=D===0?v:0;T<1&&(M=D===0?zs(v):R4(k,D,O));const I=Math.abs(M)<=r,H=Math.abs(l-O)<=s;c.done=I&&H}return c.value=c.done?l:O,c},toString:()=>{const D=Math.min(OE(R),Lp),O=_4(M=>R.next(D*M).value,D,30);return D+"ms "+O},toTransition:()=>{}};return R}Pp.applyToOptions=e=>{const t=DU(e,100,Pp);return e.ease=t.ease,e.duration=zs(t.duration),e.type="keyframes",e};function Yb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:l,min:c,max:f,restDelta:d=.5,restSpeed:p}){const m=e[0],x={done:!1,value:m},y=I=>c!==void 0&&I<c||f!==void 0&&I>f,v=I=>c===void 0?f:f===void 0||Math.abs(c-I)<Math.abs(f-I)?c:f;let T=n*t;const w=m+T,N=l===void 0?w:l(w);N!==w&&(T=N-m);const A=I=>-T*Math.exp(-I/r),k=I=>N+A(I),R=I=>{const H=A(I),P=k(I);x.done=Math.abs(H)<=d,x.value=x.done?N:P};let D,O;const M=I=>{y(x.value)&&(D=I,O=Pp({keyframes:[x.value,v(x.value)],velocity:R4(k,I,x.value),damping:s,stiffness:i,restDelta:d,restSpeed:p}))};return M(0),{calculatedDuration:null,next:I=>{let H=!1;return!O&&D===void 0&&(H=!0,R(I),M(I)),D!==void 0&&I>=D?O.next(I-D):(!H&&R(I),x)}}}function zU(e,t,n){const r=[],s=n||ei.mix||k4,i=e.length-1;for(let l=0;l<i;l++){let c=s(e[l],e[l+1]);if(t){const f=Array.isArray(t)?t[l]||Es:t;c=Lf(f,c)}r.push(c)}return r}function UU(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(TE(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=zU(t,r,s),f=c.length,d=p=>{if(l&&p<e[0])return t[0];let m=0;if(f>1)for(;m<e.length-2&&!(p<e[m+1]);m++);const x=ff(e[m],e[m+1],p);return c[m](x)};return n?p=>d(ma(e[0],e[i-1],p)):d}function HU(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ff(0,t,r);e.push(bn(n,1,s))}}function $U(e){const t=[0];return HU(t,e.length-1),t}function VU(e,t){return e.map(n=>n*t)}function qU(e,t){return e.map(()=>t||x4).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=nU(r)?r.map(mA):mA(r),i={done:!1,value:t[0]},l=VU(n&&n.length===t.length?n:$U(t),e),c=UU(l,t,{ease:Array.isArray(s)?s:qU(t,s)});return{calculatedDuration:e,next:f=>(i.value=c(f),i.done=f>=e,i)}}const YU=e=>e!==null;function DE(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(YU),c=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!c||r===void 0?i[c]:r}const GU={decay:Yb,inertia:Yb,tween:Yd,keyframes:Yd,spring:Pp};function O4(e){typeof e.type=="string"&&(e.type=GU[e.type])}class jE{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const KU=e=>e/100;class ME extends jE{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Cr.now()&&this.tick(Cr.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;O4(t);const{type:n=Yd,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:l=0}=t;let{keyframes:c}=t;const f=n||Yd;f!==Yd&&typeof c[0]!="number"&&(this.mixKeyframes=Lf(KU,k4(c[0],c[1])),c=[0,100]);const d=f({...t,keyframes:c});i==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...c].reverse(),velocity:-l})),d.calculatedDuration===null&&(d.calculatedDuration=OE(d));const{calculatedDuration:p}=d;this.calculatedDuration=p,this.resolvedDuration=p+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:p,repeat:m,repeatType:x,repeatDelay:y,type:v,onUpdate:T,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-d*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let k=this.currentTime,R=r;if(m){const I=Math.min(this.currentTime,s)/c;let H=Math.floor(I),P=I%1;!P&&I>=1&&(P=1),P===1&&H--,H=Math.min(H,m+1),!!(H%2)&&(x==="reverse"?(P=1-P,y&&(P-=y/c)):x==="mirror"&&(R=l)),k=ma(0,1,P)*c}const D=A?{done:!1,value:p[0]}:R.next(k);i&&(D.value=i(D.value));let{done:O}=D;!A&&f!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return M&&v!==Yb&&(D.value=DE(p,this.options,w,this.speed)),T&&T(D.value),M&&this.finish(),D}then(t,n){return this.finished.then(t,n)}get duration(){return bs(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+bs(t)}get time(){return bs(this.currentTime)}set time(t){var n;t=zs(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Cr.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=bs(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=OU,startTime:n}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Cr.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function QU(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const zo=e=>e*180/Math.PI,Gb=e=>{const t=zo(Math.atan2(e[1],e[0]));return Kb(t)},XU={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Gb,rotateZ:Gb,skewX:e=>zo(Math.atan(e[1])),skewY:e=>zo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Kb=e=>(e=e%360,e<0&&(e+=360),e),EA=Gb,TA=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),SA=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),WU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:TA,scaleY:SA,scale:e=>(TA(e)+SA(e))/2,rotateX:e=>Kb(zo(Math.atan2(e[6],e[5]))),rotateY:e=>Kb(zo(Math.atan2(-e[2],e[0]))),rotateZ:EA,rotate:EA,skewX:e=>zo(Math.atan(e[4])),skewY:e=>zo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Qb(e){return e.includes("scale")?1:0}function Xb(e,t){if(!e||e==="none")return Qb(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=WU,s=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=XU,s=c}if(!s)return Qb(t);const i=r[t],l=s[1].split(",").map(JU);return typeof i=="function"?i(l):l[i]}const ZU=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Xb(n,t)};function JU(e){return parseFloat(e.trim())}const uc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cc=new Set(uc),wA=e=>e===lc||e===ze,eH=new Set(["x","y","z"]),tH=uc.filter(e=>!eH.has(e));function nH(e){const t=[];return tH.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Xi={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Xb(t,"x"),y:(e,{transform:t})=>Xb(t,"y")};Xi.translateX=Xi.x;Xi.translateY=Xi.y;const Wo=new Set;let Wb=!1,Zb=!1,Jb=!1;function D4(){if(Zb){const e=Array.from(Wo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=nH(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,l])=>{var c;(c=r.getValue(i))==null||c.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Zb=!1,Wb=!1,Wo.forEach(e=>e.complete(Jb)),Wo.clear()}function j4(){Wo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Zb=!0)})}function rH(){Jb=!0,j4(),D4(),Jb=!1}class IE{constructor(t,n,r,s,i,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Wo.add(this),Wb||(Wb=!0,sn.read(j4),sn.resolveKeyframes(D4))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),l=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),s&&i===void 0&&s.set(t[0])}QU(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Wo.delete(this)}cancel(){this.state==="scheduled"&&(Wo.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const sH=e=>e.startsWith("--");function aH(e,t,n){sH(t)?e.style.setProperty(t,n):e.style[t]=n}const iH=SE(()=>window.ScrollTimeline!==void 0),oH={};function lH(e,t){const n=SE(e);return()=>oH[t]??n()}const M4=lH(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Bd=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,CA={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bd([0,.65,.55,1]),circOut:Bd([.55,0,1,.45]),backIn:Bd([.31,.01,.66,-.59]),backOut:Bd([.33,1.53,.69,.99])};function I4(e,t){if(e)return typeof e=="function"?M4()?_4(e,t):"ease-out":y4(e)?Bd(e):Array.isArray(e)?e.map(n=>I4(n,t)||CA.easeOut):CA[e]}function uH(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:l="loop",ease:c="easeOut",times:f}={},d=void 0){const p={[t]:n};f&&(p.offset=f);const m=I4(c,s);Array.isArray(m)&&(p.easing=m);const x={delay:r,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:i+1,direction:l==="reverse"?"alternate":"normal"};return d&&(x.pseudoElement=d),e.animate(p,x)}function L4(e){return typeof e=="function"&&"applyToOptions"in e}function cH({type:e,...t}){return L4(e)&&M4()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class P4 extends jE{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:l=!1,finalKeyframe:c,onComplete:f}=t;this.isPseudoElement=!!i,this.allowFlatten=l,this.options=t,TE(typeof t.type!="string");const d=cH(t);this.animation=uH(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const p=DE(s,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(p):aH(n,r,p),this.animation.cancel()}f==null||f(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return bs(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+bs(t)}get time(){return bs(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=zs(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&iH()?(this.animation.timeline=t,Es):n(this)}}const B4={anticipate:m4,backInOut:h4,circInOut:g4};function dH(e){return e in B4}function fH(e){typeof e.ease=="string"&&dH(e.ease)&&(e.ease=B4[e.ease])}const J1=10;class hH extends P4{constructor(t){fH(t),O4(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new ME({...l,autoplay:!1}),f=Math.max(J1,Cr.now()-this.startTime),d=ma(0,J1,f-J1);n.setWithVelocity(c.sample(Math.max(0,f-d)).value,c.sample(f).value,d),c.stop()}}const NA=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(eo.test(e)||e==="0")&&!e.startsWith("url("));function mH(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function pH(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],l=NA(s,t),c=NA(i,t);return!l||!c?!1:mH(e)||(n==="spring"||L4(n))&&r}function ev(e){e.duration=0,e.type="keyframes"}const gH=new Set(["opacity","clipPath","filter","transform"]),xH=SE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function yH(e){var p;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:l}=e;if(!(((p=t==null?void 0:t.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:d}=t.owner.getProps();return xH()&&n&&gH.has(n)&&(n!=="transform"||!d)&&!f&&!r&&s!=="mirror"&&i!==0&&l!=="inertia"}const bH=40;class vH extends jE{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:l="loop",keyframes:c,name:f,motionValue:d,element:p,...m}){var v;super(),this.stop=()=>{var T,w;this._animation&&(this._animation.stop(),(T=this.stopTimeline)==null||T.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=Cr.now();const x={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:l,name:f,motionValue:d,element:p,...m},y=(p==null?void 0:p.KeyframeResolver)||IE;this.keyframeResolver=new y(c,(T,w,N)=>this.onKeyframesResolved(T,w,x,!N),f,d,p),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){var w,N;this.keyframeResolver=void 0;const{name:i,type:l,velocity:c,delay:f,isHandoff:d,onUpdate:p}=r;this.resolvedAt=Cr.now(),pH(t,i,l,c)||((ei.instantAnimations||!f)&&(p==null||p(DE(t,r,n))),t[0]=t[t.length-1],ev(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>bH?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=!d&&yH(x),v=(N=(w=x.motionValue)==null?void 0:w.owner)==null?void 0:N.current,T=y?new hH({...x,element:v}):new ME(x);T.finished.then(()=>{this.notifyFinished()}).catch(Es),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),rH()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function F4(e,t,n,r=0,s=1){const i=Array.from(e).sort((d,p)=>d.sortNodePosition(p)).indexOf(t),l=e.size,c=(l-1)*r;return typeof n=="function"?n(i,l):s===1?i*r:c-i*r}const EH=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function TH(e){const t=EH.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function z4(e,t,n=1){const[r,s]=TH(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const l=i.trim();return a4(l)?parseFloat(l):l}return AE(s)?z4(s,t,n+1):s}const SH={type:"spring",stiffness:500,damping:25,restSpeed:10},wH=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),CH={type:"keyframes",duration:.8},NH={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},AH=(e,{keyframes:t})=>t.length>2?CH:cc.has(e)?e.startsWith("scale")?wH(t[1]):SH:NH,kH=e=>e!==null;function _H(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(kH),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[i]}function LE(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function PE(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?LE(n,e):n}function RH({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:l,repeatDelay:c,from:f,elapsed:d,...p}){return!!Object.keys(p).length}const BE=(e,t,n,r={},s,i)=>l=>{const c=PE(r,e)||{},f=c.delay||r.delay||0;let{elapsed:d=0}=r;d=d-zs(f);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-d,onUpdate:x=>{t.set(x),c.onUpdate&&c.onUpdate(x)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:i?void 0:s};RH(c)||Object.assign(p,AH(e,p)),p.duration&&(p.duration=zs(p.duration)),p.repeatDelay&&(p.repeatDelay=zs(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let m=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(ev(p),p.delay===0&&(m=!0)),(ei.instantAnimations||ei.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(m=!0,ev(p),p.delay=0),p.allowFlatten=!c.type&&!c.ease,m&&!i&&t.get()!==void 0){const x=_H(p.keyframes,c);if(x!==void 0){sn.update(()=>{p.onUpdate(x),p.onComplete()});return}}return c.isSync?new ME(p):new vH(p)};function AA(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function FE(e,t,n,r){if(typeof t=="function"){const[s,i]=AA(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=AA(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Du(e,t,n){const r=e.getProps();return FE(r,t,n!==void 0?n:r.custom,e)}const U4=new Set(["width","height","top","left","right","bottom",...uc]),kA=30,OH=e=>!isNaN(parseFloat(e));class DH{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Cr.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Cr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=OH(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new wE);const r=this.events[t].add(n);return t==="change"?()=>{r(),sn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Cr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>kA)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,kA);return l4(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wu(e,t){return new DH(e,t)}const tv=e=>Array.isArray(e);function jH(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wu(n))}function MH(e){return tv(e)?e[e.length-1]||0:e}function IH(e,t){const n=Du(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const l in i){const c=MH(i[l]);jH(e,l,c)}}const mr=e=>!!(e&&e.getVelocity);function LH(e){return!!(mr(e)&&e.add)}function nv(e,t){const n=e.getValue("willChange");if(LH(n))return n.add(t);if(!n&&ei.WillChange){const r=new ei.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function zE(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const PH="framerAppearId",H4="data-"+zE(PH);function $4(e){return e.props[H4]}function BH({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function V4(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:l,...c}=t;const f=e.getDefaultTransition();i=i?LE(i,f):f;const d=i==null?void 0:i.reduceMotion;r&&(i=r);const p=[],m=s&&e.animationState&&e.animationState.getState()[s];for(const x in c){const y=e.getValue(x,e.latestValues[x]??null),v=c[x];if(v===void 0||m&&BH(m,x))continue;const T={delay:n,...PE(i||{},x)},w=y.get();if(w!==void 0&&!y.isAnimating&&!Array.isArray(v)&&v===w&&!T.velocity)continue;let N=!1;if(window.MotionHandoffAnimation){const R=$4(e);if(R){const D=window.MotionHandoffAnimation(R,x,sn);D!==null&&(T.startTime=D,N=!0)}}nv(e,x);const A=d??e.shouldReduceMotion;y.start(BE(x,y,v,A&&U4.has(x)?{type:!1}:T,e,N));const k=y.animation;k&&p.push(k)}if(l){const x=()=>sn.update(()=>{l&&IH(e,l)});p.length?Promise.all(p).then(x):x()}return p}function rv(e,t,n={}){var f;const r=Du(e,t,n.type==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(V4(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:p=0,staggerChildren:m,staggerDirection:x}=s;return FH(e,t,d,p,m,x,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[d,p]=c==="beforeChildren"?[i,l]:[l,i];return d().then(()=>p())}else return Promise.all([i(),l(n.delay)])}function FH(e,t,n=0,r=0,s=0,i=1,l){const c=[];for(const f of e.variantChildren)f.notify("AnimationStart",t),c.push(rv(f,t,{...l,delay:n+(typeof r=="function"?0:r)+F4(e.variantChildren,f,r,s,i)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(c)}function zH(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>rv(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=rv(e,t,n);else{const s=typeof t=="function"?Du(e,t,n.custom):t;r=Promise.all(V4(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const UH={test:e=>e==="auto",parse:e=>e},q4=e=>t=>t.test(e),Y4=[lc,ze,oa,Ii,pU,mU,UH],_A=e=>Y4.find(q4(e));function HH(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||o4(e):!0}const $H=new Set(["brightness","contrast","saturate","opacity"]);function VH(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(kE)||[];if(!r)return e;const s=n.replace(r,"");let i=$H.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const qH=/\b([a-z-]*)\(.*?\)/gu,sv={...eo,getAnimatableNone:e=>{const t=e.match(qH);return t?t.map(VH).join(" "):e}},RA={...lc,transform:Math.round},YH={rotate:Ii,rotateX:Ii,rotateY:Ii,rotateZ:Ii,scale:zm,scaleX:zm,scaleY:zm,scaleZ:zm,skew:Ii,skewX:Ii,skewY:Ii,distance:ze,translateX:ze,translateY:ze,translateZ:ze,x:ze,y:ze,z:ze,perspective:ze,transformPerspective:ze,opacity:hf,originX:gA,originY:gA,originZ:ze},UE={borderWidth:ze,borderTopWidth:ze,borderRightWidth:ze,borderBottomWidth:ze,borderLeftWidth:ze,borderRadius:ze,borderTopLeftRadius:ze,borderTopRightRadius:ze,borderBottomRightRadius:ze,borderBottomLeftRadius:ze,width:ze,maxWidth:ze,height:ze,maxHeight:ze,top:ze,right:ze,bottom:ze,left:ze,inset:ze,insetBlock:ze,insetBlockStart:ze,insetBlockEnd:ze,insetInline:ze,insetInlineStart:ze,insetInlineEnd:ze,padding:ze,paddingTop:ze,paddingRight:ze,paddingBottom:ze,paddingLeft:ze,paddingBlock:ze,paddingBlockStart:ze,paddingBlockEnd:ze,paddingInline:ze,paddingInlineStart:ze,paddingInlineEnd:ze,margin:ze,marginTop:ze,marginRight:ze,marginBottom:ze,marginLeft:ze,marginBlock:ze,marginBlockStart:ze,marginBlockEnd:ze,marginInline:ze,marginInlineStart:ze,marginInlineEnd:ze,fontSize:ze,backgroundPositionX:ze,backgroundPositionY:ze,...YH,zIndex:RA,fillOpacity:hf,strokeOpacity:hf,numOctaves:RA},GH={...UE,color:Fn,backgroundColor:Fn,outlineColor:Fn,fill:Fn,stroke:Fn,borderColor:Fn,borderTopColor:Fn,borderRightColor:Fn,borderBottomColor:Fn,borderLeftColor:Fn,filter:sv,WebkitFilter:sv},G4=e=>GH[e];function K4(e,t){let n=G4(e);return n!==sv&&(n=eo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const KH=new Set(["auto","none","0"]);function QH(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!KH.has(i)&&mf(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=K4(n,s)}class XH extends IE{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let m=t[p];if(typeof m=="string"&&(m=m.trim(),AE(m))){const x=z4(m,n.current);x!==void 0&&(t[p]=x),p===t.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!U4.has(r)||t.length!==2)return;const[s,i]=t,l=_A(s),c=_A(i),f=pA(s),d=pA(i);if(f!==d&&Xi[r]){this.needsMeasurement=!0;return}if(l!==c)if(wA(l)&&wA(c))for(let p=0;p<t.length;p++){const m=t[p];typeof m=="string"&&(t[p]=parseFloat(m))}else Xi[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||HH(t[s]))&&r.push(s);r.length&&QH(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Xi[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var c;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,l=r[i];r[i]=Xi[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(c=this.removedTransforms)!=null&&c.length&&this.removedTransforms.forEach(([f,d])=>{t.getValue(f).set(d)}),this.resolveNoneKeyframes()}}const WH=new Set(["opacity","clipPath","filter","transform"]);function Q4(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const X4=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function av(e){return i4(e)&&"offsetHeight"in e}const{schedule:HE}=b4(queueMicrotask,!1),Ms={x:!1,y:!1};function W4(){return Ms.x||Ms.y}function ZH(e){return e==="x"||e==="y"?Ms[e]?null:(Ms[e]=!0,()=>{Ms[e]=!1}):Ms.x||Ms.y?null:(Ms.x=Ms.y=!0,()=>{Ms.x=Ms.y=!1})}function Z4(e,t){const n=Q4(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function JH(e){return!(e.pointerType==="touch"||W4())}function e$(e,t,n={}){const[r,s,i]=Z4(e,n);return r.forEach(l=>{let c=!1,f=!1,d;const p=()=>{l.removeEventListener("pointerleave",v)},m=w=>{d&&(d(w),d=void 0),p()},x=w=>{c=!1,window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),f&&(f=!1,m(w))},y=()=>{c=!0,window.addEventListener("pointerup",x,s),window.addEventListener("pointercancel",x,s)},v=w=>{if(w.pointerType!=="touch"){if(c){f=!0;return}m(w)}},T=w=>{if(!JH(w))return;f=!1;const N=t(l,w);typeof N=="function"&&(d=N,l.addEventListener("pointerleave",v,s))};l.addEventListener("pointerenter",T,s),l.addEventListener("pointerdown",y,s)}),i}const J4=(e,t)=>t?e===t?!0:J4(e,t.parentElement):!1,$E=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,t$=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function n$(e){return t$.has(e.tagName)||e.isContentEditable===!0}const r$=new Set(["INPUT","SELECT","TEXTAREA"]);function s$(e){return r$.has(e.tagName)||e.isContentEditable===!0}const pp=new WeakSet;function OA(e){return t=>{t.key==="Enter"&&e(t)}}function ey(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const a$=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=OA(()=>{if(pp.has(n))return;ey(n,"down");const s=OA(()=>{ey(n,"up")}),i=()=>ey(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function DA(e){return $E(e)&&!W4()}const jA=new WeakSet;function i$(e,t,n={}){const[r,s,i]=Z4(e,n),l=c=>{const f=c.currentTarget;if(!DA(c)||jA.has(c))return;pp.add(f),n.stopPropagation&&jA.add(c);const d=t(f,c),p=(y,v)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",x),pp.has(f)&&pp.delete(f),DA(y)&&typeof d=="function"&&d(y,{success:v})},m=y=>{p(y,f===window||f===document||n.useGlobalTarget||J4(f,y.target))},x=y=>{p(y,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",x,s)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,s),av(c)&&(c.addEventListener("focus",d=>a$(d,s)),!n$(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),i}function VE(e){return i4(e)&&"ownerSVGElement"in e}const gp=new WeakMap;let Li;const eO=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:VE(r)&&"getBBox"in r?r.getBBox()[t]:r[n],o$=eO("inline","width","offsetWidth"),l$=eO("block","height","offsetHeight");function u$({target:e,borderBoxSize:t}){var n;(n=gp.get(e))==null||n.forEach(r=>{r(e,{get width(){return o$(e,t)},get height(){return l$(e,t)}})})}function c$(e){e.forEach(u$)}function d$(){typeof ResizeObserver>"u"||(Li=new ResizeObserver(c$))}function f$(e,t){Li||d$();const n=Q4(e);return n.forEach(r=>{let s=gp.get(r);s||(s=new Set,gp.set(r,s)),s.add(t),Li==null||Li.observe(r)}),()=>{n.forEach(r=>{const s=gp.get(r);s==null||s.delete(t),s!=null&&s.size||Li==null||Li.unobserve(r)})}}const xp=new Set;let Nu;function h$(){Nu=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};xp.forEach(t=>t(e))},window.addEventListener("resize",Nu)}function m$(e){return xp.add(e),Nu||h$(),()=>{xp.delete(e),!xp.size&&typeof Nu=="function"&&(window.removeEventListener("resize",Nu),Nu=void 0)}}function MA(e,t){return typeof e=="function"?m$(e):f$(e,t)}function p$(e){return VE(e)&&e.tagName==="svg"}const g$=[...Y4,Fn,eo],x$=e=>g$.find(q4(e)),IA=()=>({translate:0,scale:1,origin:0,originPoint:0}),Au=()=>({x:IA(),y:IA()}),LA=()=>({min:0,max:0}),Vn=()=>({x:LA(),y:LA()}),y$=new WeakMap;function h0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pf(e){return typeof e=="string"||Array.isArray(e)}const qE=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],YE=["initial",...qE];function m0(e){return h0(e.animate)||YE.some(t=>pf(e[t]))}function tO(e){return!!(m0(e)||e.variants)}function b$(e,t,n){for(const r in t){const s=t[r],i=n[r];if(mr(s))e.addValue(r,s);else if(mr(i))e.addValue(r,Wu(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(r);e.addValue(r,Wu(l!==void 0?l:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Bp={current:null},GE={current:!1},v$=typeof window<"u";function nO(){if(GE.current=!0,!!v$)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Bp.current=e.matches;e.addEventListener("change",t),t()}else Bp.current=!1}const PA=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Fp={};function rO(e){Fp=e}function E$(){return Fp}class T${scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:l,visualState:c},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=IE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=Cr.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,sn.render(this.render,!1,!0))};const{latestValues:d,renderState:p}=c;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=f,this.blockInitialAnimation=!!l,this.isControllingVariants=m0(n),this.isVariantNode=tO(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:m,...x}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in x){const v=x[y];d[y]!==void 0&&mr(v)&&v.set(d[y])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,y$.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(GE.current||nO(),this.shouldReduceMotion=Bp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Ji(this.notifyUpdate),Ji(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&WH.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:f,ease:d,duration:p}=n.accelerate,m=new P4({element:this.current,name:t,keyframes:c,times:f,ease:d,duration:zs(p)}),x=l(m);this.valueSubscriptions.set(t,()=>{x(),m.cancel()});return}const r=cc.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&sn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Fp){const n=Fp[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Vn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<PA.length;r++){const s=PA[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,l=t[i];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=b$(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Wu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(a4(r)||o4(r))?r=parseFloat(r):!x$(r)&&eo.test(n)&&(r=K4(t,n)),this.setBaseTarget(t,mr(r)?r.get():r)),mr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const l=FE(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);l&&(r=l[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!mr(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new wE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){HE.render(this.render)}}class sO extends T${constructor(){super(...arguments),this.KeyframeResolver=XH}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;mr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class lo{constructor(t){this.isMounted=!1,this.node=t}update(){}}function aO({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function S$({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function w$(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ty(e){return e===void 0||e===1}function iv({scale:e,scaleX:t,scaleY:n}){return!ty(e)||!ty(t)||!ty(n)}function Po(e){return iv(e)||iO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function iO(e){return BA(e.x)||BA(e.y)}function BA(e){return e&&e!=="0%"}function zp(e,t,n){const r=e-n,s=t*r;return n+s}function FA(e,t,n,r,s){return s!==void 0&&(e=zp(e,s,r)),zp(e,n,r)+t}function ov(e,t=0,n=1,r,s){e.min=FA(e.min,t,n,r,s),e.max=FA(e.max,t,n,r,s)}function oO(e,{x:t,y:n}){ov(e.x,t.translate,t.scale,t.originPoint),ov(e.y,n.translate,n.scale,n.originPoint)}const zA=.999999999999,UA=1.0000000000001;function C$(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,l;for(let c=0;c<s;c++){i=n[c],l=i.projectionDelta;const{visualElement:f}=i.options;f&&f.props.style&&f.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&_u(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,oO(e,l)),r&&Po(i.latestValues)&&_u(e,i.latestValues))}t.x<UA&&t.x>zA&&(t.x=1),t.y<UA&&t.y>zA&&(t.y=1)}function ku(e,t){e.min=e.min+t,e.max=e.max+t}function HA(e,t,n,r,s=.5){const i=bn(e.min,e.max,s);ov(e,t,n,i,r)}function _u(e,t){HA(e.x,t.x,t.scaleX,t.scale,t.originX),HA(e.y,t.y,t.scaleY,t.scale,t.originY)}function lO(e,t){return aO(w$(e.getBoundingClientRect(),t))}function N$(e,t,n){const r=lO(e,n),{scroll:s}=t;return s&&(ku(r.x,s.offset.x),ku(r.y,s.offset.y)),r}const A$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},k$=uc.length;function _$(e,t,n){let r="",s=!0;for(let i=0;i<k$;i++){const l=uc[i],c=e[l];if(c===void 0)continue;let f=!0;if(typeof c=="number")f=c===(l.startsWith("scale")?1:0);else{const d=parseFloat(c);f=l.startsWith("scale")?d===1:d===0}if(!f||n){const d=X4(c,UE[l]);if(!f){s=!1;const p=A$[l]||l;r+=`${p}(${d}) `}n&&(t[l]=d)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function KE(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let l=!1,c=!1;for(const f in t){const d=t[f];if(cc.has(f)){l=!0;continue}else if(E4(f)){s[f]=d;continue}else{const p=X4(d,UE[f]);f.startsWith("origin")?(c=!0,i[f]=p):r[f]=p}}if(t.transform||(l||n?r.transform=_$(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:f="50%",originY:d="50%",originZ:p=0}=i;r.transformOrigin=`${f} ${d} ${p}`}}function uO(e,{style:t,vars:n},r,s){const i=e.style;let l;for(l in t)i[l]=t[l];s==null||s.applyProjectionStyles(i,r);for(l in n)i.setProperty(l,n[l])}function $A(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ed={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ze.test(e))e=parseFloat(e);else return e;const n=$A(e,t.target.x),r=$A(e,t.target.y);return`${n}% ${r}%`}},R$={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=eo.parse(e);if(s.length>5)return r;const i=eo.createTransformer(e),l=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,f=n.y.scale*t.y;s[0+l]/=c,s[1+l]/=f;const d=bn(c,f,.5);return typeof s[2+l]=="number"&&(s[2+l]/=d),typeof s[3+l]=="number"&&(s[3+l]/=d),i(s)}},lv={borderRadius:{...Ed,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ed,borderTopRightRadius:Ed,borderBottomLeftRadius:Ed,borderBottomRightRadius:Ed,boxShadow:R$};function cO(e,{layout:t,layoutId:n}){return cc.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!lv[e]||e==="opacity")}function QE(e,t,n){var l;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const c in r)(mr(r[c])||s&&mr(s[c])||cO(c,e)||((l=n==null?void 0:n.getValue(c))==null?void 0:l.liveStyle)!==void 0)&&(i[c]=r[c]);return i}function O$(e){return window.getComputedStyle(e)}class D$ extends sO{constructor(){super(...arguments),this.type="html",this.renderInstance=uO}readValueFromInstance(t,n){var r;if(cc.has(n))return(r=this.projection)!=null&&r.isProjecting?Qb(n):ZU(t,n);{const s=O$(t),i=(E4(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return lO(t,n)}build(t,n,r){KE(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return QE(t,n,r)}}const j$={offset:"stroke-dashoffset",array:"stroke-dasharray"},M$={offset:"strokeDashoffset",array:"strokeDasharray"};function I$(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?j$:M$;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const L$=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function dO(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...c},f,d,p){if(KE(e,c,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:x}=e;m.transform&&(x.transform=m.transform,delete m.transform),(x.transform||m.transformOrigin)&&(x.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),x.transform&&(x.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete m.transformBox);for(const y of L$)m[y]!==void 0&&(x[y]=m[y],delete m[y]);t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&&I$(m,s,i,l,!1)}const fO=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),hO=e=>typeof e=="string"&&e.toLowerCase()==="svg";function P$(e,t,n,r){uO(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(fO.has(s)?s:zE(s),t.attrs[s])}function mO(e,t,n){const r=QE(e,t,n);for(const s in e)if(mr(e[s])||mr(t[s])){const i=uc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class B$ extends sO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Vn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(cc.has(n)){const r=G4(n);return r&&r.default||0}return n=fO.has(n)?n:zE(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return mO(t,n,r)}build(t,n,r){dO(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){P$(t,n,r,s)}mount(t){this.isSVGTag=hO(t.tagName),super.mount(t)}}const F$=YE.length;function pO(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?pO(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<F$;n++){const r=YE[n],s=e.props[r];(pf(s)||s===!1)&&(t[r]=s)}return t}function gO(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const z$=[...qE].reverse(),U$=qE.length;function H$(e){return t=>Promise.all(t.map(({animation:n,options:r})=>zH(e,n,r)))}function $$(e){let t=H$(e),n=VA(),r=!0;const s=f=>(d,p)=>{var x;const m=Du(e,p,f==="exit"?(x=e.presenceContext)==null?void 0:x.custom:void 0);if(m){const{transition:y,transitionEnd:v,...T}=m;d={...d,...T,...v}}return d};function i(f){t=f(e)}function l(f){const{props:d}=e,p=pO(e.parent)||{},m=[],x=new Set;let y={},v=1/0;for(let w=0;w<U$;w++){const N=z$[w],A=n[N],k=d[N]!==void 0?d[N]:p[N],R=pf(k),D=N===f?A.isActive:null;D===!1&&(v=w);let O=k===p[N]&&k!==d[N]&&R;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),A.protectedKeys={...y},!A.isActive&&D===null||!k&&!A.prevProp||h0(k)||typeof k=="boolean")continue;if(N==="exit"&&A.isActive&&D!==!0){A.prevResolvedValues&&(y={...y,...A.prevResolvedValues});continue}const M=V$(A.prevProp,k);let I=M||N===f&&A.isActive&&!O&&R||w>v&&R,H=!1;const P=Array.isArray(k)?k:[k];let K=P.reduce(s(N),{});D===!1&&(K={});const{prevResolvedValues:Y={}}=A,W={...Y,...K},te=B=>{I=!0,x.has(B)&&(H=!0,x.delete(B)),A.needsAnimating[B]=!0;const U=e.getValue(B);U&&(U.liveStyle=!1)};for(const B in W){const U=K[B],ne=Y[B];if(y.hasOwnProperty(B))continue;let z=!1;tv(U)&&tv(ne)?z=!gO(U,ne):z=U!==ne,z?U!=null?te(B):x.add(B):U!==void 0&&x.has(B)?te(B):A.protectedKeys[B]=!0}A.prevProp=k,A.prevResolvedValues=K,A.isActive&&(y={...y,...K}),r&&e.blockInitialAnimation&&(I=!1);const J=O&&M;I&&(!J||H)&&m.push(...P.map(B=>{const U={type:N};if(typeof B=="string"&&r&&!J&&e.manuallyAnimateOnMount&&e.parent){const{parent:ne}=e,z=Du(ne,B);if(ne.enteringChildren&&z){const{delayChildren:q}=z.transition||{};U.delay=F4(ne.enteringChildren,e,q)}}return{animation:B,options:U}}))}if(x.size){const w={};if(typeof d.initial!="boolean"){const N=Du(e,Array.isArray(d.initial)?d.initial[0]:d.initial);N&&N.transition&&(w.transition=N.transition)}x.forEach(N=>{const A=e.getBaseTarget(N),k=e.getValue(N);k&&(k.liveStyle=!0),w[N]=A??null}),m.push({animation:w})}let T=!!m.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(T=!1),r=!1,T?t(m):Promise.resolve()}function c(f,d){var m;if(n[f].isActive===d)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(x=>{var y;return(y=x.animationState)==null?void 0:y.setActive(f,d)}),n[f].isActive=d;const p=l(f);for(const x in n)n[x].protectedKeys={};return p}return{animateChanges:l,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=VA()}}}function V$(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gO(t,e):!1}function jo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function VA(){return{animate:jo(!0),whileInView:jo(),whileHover:jo(),whileTap:jo(),whileDrag:jo(),whileFocus:jo(),exit:jo()}}function qA(e,t){e.min=t.min,e.max=t.max}function js(e,t){qA(e.x,t.x),qA(e.y,t.y)}function YA(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const xO=1e-4,q$=1-xO,Y$=1+xO,yO=.01,G$=0-yO,K$=0+yO;function Nr(e){return e.max-e.min}function Q$(e,t,n){return Math.abs(e-t)<=n}function GA(e,t,n,r=.5){e.origin=r,e.originPoint=bn(t.min,t.max,e.origin),e.scale=Nr(n)/Nr(t),e.translate=bn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=q$&&e.scale<=Y$||isNaN(e.scale))&&(e.scale=1),(e.translate>=G$&&e.translate<=K$||isNaN(e.translate))&&(e.translate=0)}function Gd(e,t,n,r){GA(e.x,t.x,n.x,r?r.originX:void 0),GA(e.y,t.y,n.y,r?r.originY:void 0)}function KA(e,t,n){e.min=n.min+t.min,e.max=e.min+Nr(t)}function X$(e,t,n){KA(e.x,t.x,n.x),KA(e.y,t.y,n.y)}function QA(e,t,n){e.min=t.min-n.min,e.max=e.min+Nr(t)}function Up(e,t,n){QA(e.x,t.x,n.x),QA(e.y,t.y,n.y)}function XA(e,t,n,r,s){return e-=t,e=zp(e,1/n,r),s!==void 0&&(e=zp(e,1/s,r)),e}function W$(e,t=0,n=1,r=.5,s,i=e,l=e){if(oa.test(t)&&(t=parseFloat(t),t=bn(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=bn(i.min,i.max,r);e===i&&(c-=t),e.min=XA(e.min,t,n,c,s),e.max=XA(e.max,t,n,c,s)}function WA(e,t,[n,r,s],i,l){W$(e,t[n],t[r],t[s],t.scale,i,l)}const Z$=["x","scaleX","originX"],J$=["y","scaleY","originY"];function ZA(e,t,n,r){WA(e.x,t,Z$,n?n.x:void 0,r?r.x:void 0),WA(e.y,t,J$,n?n.y:void 0,r?r.y:void 0)}function JA(e){return e.translate===0&&e.scale===1}function bO(e){return JA(e.x)&&JA(e.y)}function ek(e,t){return e.min===t.min&&e.max===t.max}function eV(e,t){return ek(e.x,t.x)&&ek(e.y,t.y)}function tk(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vO(e,t){return tk(e.x,t.x)&&tk(e.y,t.y)}function nk(e){return Nr(e.x)/Nr(e.y)}function rk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Js(e){return[e("x"),e("y")]}function tV(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((s||i||l)&&(r=`translate3d(${s}px, ${i}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:p,rotateX:m,rotateY:x,skewX:y,skewY:v}=n;d&&(r=`perspective(${d}px) ${r}`),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),x&&(r+=`rotateY(${x}deg) `),y&&(r+=`skewX(${y}deg) `),v&&(r+=`skewY(${v}deg) `)}const c=e.x.scale*t.x,f=e.y.scale*t.y;return(c!==1||f!==1)&&(r+=`scale(${c}, ${f})`),r||"none"}const EO=["TopLeft","TopRight","BottomLeft","BottomRight"],nV=EO.length,sk=e=>typeof e=="string"?parseFloat(e):e,ak=e=>typeof e=="number"||ze.test(e);function rV(e,t,n,r,s,i){s?(e.opacity=bn(0,n.opacity??1,sV(r)),e.opacityExit=bn(t.opacity??1,0,aV(r))):i&&(e.opacity=bn(t.opacity??1,n.opacity??1,r));for(let l=0;l<nV;l++){const c=`border${EO[l]}Radius`;let f=ik(t,c),d=ik(n,c);if(f===void 0&&d===void 0)continue;f||(f=0),d||(d=0),f===0||d===0||ak(f)===ak(d)?(e[c]=Math.max(bn(sk(f),sk(d),r),0),(oa.test(d)||oa.test(f))&&(e[c]+="%")):e[c]=d}(t.rotate||n.rotate)&&(e.rotate=bn(t.rotate||0,n.rotate||0,r))}function ik(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const sV=TO(0,.5,p4),aV=TO(.5,.95,Es);function TO(e,t,n){return r=>r<e?0:r>t?1:n(ff(e,t,r))}function iV(e,t,n){const r=mr(e)?e:Wu(e);return r.start(BE("",r,t,n)),r.animation}function gf(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const oV=(e,t)=>e.depth-t.depth;class lV{constructor(){this.children=[],this.isDirty=!1}add(t){EE(this.children,t),this.isDirty=!0}remove(t){Mp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(oV),this.isDirty=!1,this.children.forEach(t)}}function uV(e,t){const n=Cr.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ji(r),e(i-t))};return sn.setup(r,!0),()=>Ji(r)}function yp(e){return mr(e)?e.get():e}class cV{constructor(){this.members=[]}add(t){EE(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;s&&s.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&Mp(this.members,r)}t.scheduleRender()}remove(t){if(Mp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s],l=i.instance;if(i.isPresent!==!1&&(!l||l.isConnected!==!1)){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const s=r.options.layoutDependency,i=t.options.layoutDependency;if(!(s!==void 0&&i!==void 0&&s===i)){const f=r.instance;f&&f.isConnected===!1&&!r.snapshot||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:c}=t.options;c===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const bp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ny=["","X","Y","Z"],dV=1e3;let fV=0;function ry(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function SO(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=$4(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",sn,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&SO(r)}function wO({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(l={},c=t==null?void 0:t()){this.id=fV++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(pV),this.nodes.forEach(bV),this.nodes.forEach(vV),this.nodes.forEach(gV)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new lV)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new wE),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const f=this.eventHandlers.get(l);f&&f.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=VE(l)&&!p$(l),this.instance=l;const{layoutId:c,layout:f,visualElement:d}=this.options;if(d&&!d.current&&d.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),e){let p,m=0;const x=()=>this.root.updateBlockedByResize=!1;sn.read(()=>{m=window.innerWidth}),e(l,()=>{const y=window.innerWidth;y!==m&&(m=y,this.root.updateBlockedByResize=!0,p&&p(),p=uV(x,250),bp.hasAnimatedSinceResize&&(bp.hasAnimatedSinceResize=!1,this.nodes.forEach(uk)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:m,hasRelativeLayoutChanged:x,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||d.getDefaultTransition()||CV,{onLayoutAnimationStart:T,onLayoutAnimationComplete:w}=d.getProps(),N=!this.targetLayout||!vO(this.targetLayout,y),A=!m&&x;if(this.options.layoutRoot||this.resumeFrom||A||m&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...PE(v,"layout"),onPlay:T,onComplete:w};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(p,A)}else m||uk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ji(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(EV),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&SO(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const m=this.path[p];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:c,layout:f}=this.options;if(c===void 0&&!f)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ok);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(lk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(yV),this.nodes.forEach(hV),this.nodes.forEach(mV)):this.nodes.forEach(lk),this.clearAllSnapshots();const c=Cr.now();cr.delta=ma(0,1e3/60,c-cr.timestamp),cr.timestamp=c,cr.isProcessing=!0,K1.update.process(cr),K1.preRender.process(cr),K1.render.process(cr),cr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,HE.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xV),this.sharedNodes.forEach(TV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,sn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){sn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Nr(this.snapshot.measuredBox.x)&&!Nr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f<this.path.length;f++)this.path[f].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Vn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const f=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!bO(this.projectionDelta),f=this.getTransformTemplate(),d=f?f(this.latestValues,""):void 0,p=d!==this.prevTransformTemplateValue;l&&this.instance&&(c||Po(this.latestValues)||p)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return l&&(f=this.removeTransform(f)),NV(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:l}=this.options;if(!l)return Vn();const c=l.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(AV))){const{scroll:p}=this.root;p&&(ku(c.x,p.offset.x),ku(c.y,p.offset.y))}return c}removeElementScroll(l){var f;const c=Vn();if(js(c,l),(f=this.scroll)!=null&&f.wasRoot)return c;for(let d=0;d<this.path.length;d++){const p=this.path[d],{scroll:m,options:x}=p;p!==this.root&&m&&x.layoutScroll&&(m.wasRoot&&js(c,l),ku(c.x,m.offset.x),ku(c.y,m.offset.y))}return c}applyTransform(l,c=!1){const f=Vn();js(f,l);for(let d=0;d<this.path.length;d++){const p=this.path[d];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&_u(f,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),Po(p.latestValues)&&_u(f,p.latestValues)}return Po(this.latestValues)&&_u(f,this.latestValues),f}removeTransform(l){const c=Vn();js(c,l);for(let f=0;f<this.path.length;f++){const d=this.path[f];if(!d.instance||!Po(d.latestValues))continue;iv(d.latestValues)&&d.updateSnapshot();const p=Vn(),m=d.measurePageBox();js(p,m),ZA(c,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,p)}return Po(this.latestValues)&&ZA(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==cr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var y;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(l||f&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:m}=this.options;if(!this.layout||!(p||m))return;this.resolvedRelativeTargetAt=cr.timestamp;const x=this.getClosestProjectingParent();x&&this.linkedParentVersion!==x.layoutVersion&&!x.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(x&&x.layout?this.createRelativeTarget(x,this.layout.layoutBox,x.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Vn(),this.targetWithTransforms=Vn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),X$(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):js(this.target,this.layout.layoutBox),oO(this.target,this.targetDelta)):js(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?this.createRelativeTarget(x,this.target,x.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||iv(this.parent.latestValues)||iO(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,f){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Vn(),this.relativeTargetOrigin=Vn(),Up(this.relativeTargetOrigin,c,f),js(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var v;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let f=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===cr.timestamp&&(f=!1),f)return;const{layout:d,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||p))return;js(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,x=this.treeScale.y;C$(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Vn());const{target:y}=l;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(YA(this.prevProjectionDelta.x,this.projectionDelta.x),YA(this.prevProjectionDelta.y,this.projectionDelta.y)),Gd(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==x||!rk(this.projectionDelta.x,this.prevProjectionDelta.x)||!rk(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),l){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Au(),this.projectionDelta=Au(),this.projectionDeltaWithTransform=Au()}setAnimationOrigin(l,c=!1){const f=this.snapshot,d=f?f.latestValues:{},p={...this.latestValues},m=Au();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const x=Vn(),y=f?f.source:void 0,v=this.layout?this.layout.source:void 0,T=y!==v,w=this.getStack(),N=!w||w.members.length<=1,A=!!(T&&!N&&this.options.crossfade===!0&&!this.path.some(wV));this.animationProgress=0;let k;this.mixTargetDelta=R=>{const D=R/1e3;ck(m.x,l.x,D),ck(m.y,l.y,D),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Up(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),SV(this.relativeTarget,this.relativeTargetOrigin,x,D),k&&eV(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Vn()),js(k,this.relativeTarget)),T&&(this.animationValues=p,rV(p,d,this.latestValues,D,A,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var c,f,d;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(d=(f=this.resumingFrom)==null?void 0:f.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Ji(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=sn.update(()=>{bp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Wu(0)),this.currentAnimation=iV(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),l.onUpdate&&l.onUpdate(p)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(dV),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:f,layout:d,latestValues:p}=l;if(!(!c||!f||!d)){if(this!==l&&this.layout&&d&&CO(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||Vn();const m=Nr(this.layout.layoutBox.x);f.x.min=l.target.x.min,f.x.max=f.x.min+m;const x=Nr(this.layout.layoutBox.y);f.y.min=l.target.y.min,f.y.max=f.y.min+x}js(c,f),_u(c,p),Gd(this.projectionDeltaWithTransform,this.layoutCorrected,c,p)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new cV),this.sharedNodes.get(l).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var c;const{layoutId:l}=this.options;return l?((c=this.getStack())==null?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:l}=this.options;return l?(c=this.getStack())==null?void 0:c.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:f}={}){const d=this.getStack();d&&d.promote(this,f),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:f}=l;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const d={};f.z&&ry("z",l,d,this.animationValues);for(let p=0;p<ny.length;p++)ry(`rotate${ny[p]}`,l,d,this.animationValues),ry(`skew${ny[p]}`,l,d,this.animationValues);l.render();for(const p in d)l.setStaticValue(p,d[p]),this.animationValues&&(this.animationValues[p]=d[p]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=yp(c==null?void 0:c.pointerEvents)||"",l.transform=f?f(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=yp(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Po(this.latestValues)&&(l.transform=f?f({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=d.animationValues||d.latestValues;this.applyTransformsToTarget();let m=tV(this.projectionDeltaWithTransform,this.treeScale,p);f&&(m=f(p,m)),l.transform=m;const{x,y}=this.projectionDelta;l.transformOrigin=`${x.origin*100}% ${y.origin*100}% 0`,d.animationValues?l.opacity=d===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=d===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const v in lv){if(p[v]===void 0)continue;const{correct:T,applyTo:w,isCSSVariable:N}=lv[v],A=m==="none"?p[v]:T(p[v],d);if(w){const k=w.length;for(let R=0;R<k;R++)l[w[R]]=A}else N?this.options.visualElement.renderState.vars[v]=A:l[v]=A}this.options.layoutId&&(l.pointerEvents=d===this?yp(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var c;return(c=l.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(ok),this.root.sharedNodes.clear()}}}function hV(e){e.updateLayout()}function mV(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,l=t.source!==e.layout.source;i==="size"?Js(m=>{const x=l?t.measuredBox[m]:t.layoutBox[m],y=Nr(x);x.min=r[m].min,x.max=x.min+y}):CO(i,t.layoutBox,r)&&Js(m=>{const x=l?t.measuredBox[m]:t.layoutBox[m],y=Nr(r[m]);x.max=x.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+y)});const c=Au();Gd(c,r,t.layoutBox);const f=Au();l?Gd(f,e.applyTransform(s,!0),t.measuredBox):Gd(f,r,t.layoutBox);const d=!bO(c);let p=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:x,layout:y}=m;if(x&&y){const v=Vn();Up(v,t.layoutBox,x.layoutBox);const T=Vn();Up(T,r,y.layoutBox),vO(v,T)||(p=!0),m.options.layoutRoot&&(e.relativeTarget=T,e.relativeTargetOrigin=v,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:f,layoutDelta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function pV(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function gV(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xV(e){e.clearSnapshot()}function ok(e){e.clearMeasurements()}function lk(e){e.isLayoutDirty=!1}function yV(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function uk(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bV(e){e.resolveTargetDelta()}function vV(e){e.calcProjection()}function EV(e){e.resetSkewAndRotation()}function TV(e){e.removeLeadSnapshot()}function ck(e,t,n){e.translate=bn(t.translate,0,n),e.scale=bn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function dk(e,t,n,r){e.min=bn(t.min,n.min,r),e.max=bn(t.max,n.max,r)}function SV(e,t,n,r){dk(e.x,t.x,n.x,r),dk(e.y,t.y,n.y,r)}function wV(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const CV={duration:.45,ease:[.4,0,.1,1]},fk=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),hk=fk("applewebkit/")&&!fk("chrome/")?Math.round:Es;function mk(e){e.min=hk(e.min),e.max=hk(e.max)}function NV(e){mk(e.x),mk(e.y)}function CO(e,t,n){return e==="position"||e==="preserve-aspect"&&!Q$(nk(t),nk(n),.2)}function AV(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const kV=wO({attachResizeListener:(e,t)=>gf(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),sy={current:void 0},NO=wO({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sy.current){const e=new kV({});e.mount(window),e.setOptions({layoutScroll:!0}),sy.current=e}return sy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),xf=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function pk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _V(...e){return t=>{let n=!1;const r=e.map(s=>{const i=pk(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():pk(e[s],null)}}}}function RV(...e){return b.useCallback(_V(...e),e)}class OV extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=av(r)&&r.offsetWidth||0,i=av(r)&&r.offsetHeight||0,l=this.props.sizeRef.current;l.height=n.offsetHeight||0,l.width=n.offsetWidth||0,l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function DV({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var x;const l=b.useId(),c=b.useRef(null),f=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=b.useContext(xf),p=((x=e.props)==null?void 0:x.ref)??(e==null?void 0:e.ref),m=RV(c,p);return b.useInsertionEffect(()=>{const{width:y,height:v,top:T,left:w,right:N,bottom:A}=f.current;if(t||i===!1||!c.current||!y||!v)return;const k=n==="left"?`left: ${w}`:`right: ${N}`,R=r==="bottom"?`bottom: ${A}`:`top: ${T}`;c.current.dataset.motionPopId=l;const D=document.createElement("style");d&&(D.nonce=d);const O=s??document.head;return O.appendChild(D),D.sheet&&D.sheet.insertRule(`
|
|
58
|
-
[data-motion-pop-id="${l}"] {
|
|
59
|
-
position: absolute !important;
|
|
60
|
-
width: ${y}px !important;
|
|
61
|
-
height: ${v}px !important;
|
|
62
|
-
${k}px !important;
|
|
63
|
-
${R}px !important;
|
|
64
|
-
}
|
|
65
|
-
`),()=>{O.contains(D)&&O.removeChild(D)}},[t]),u.jsx(OV,{isPresent:t,childRef:c,sizeRef:f,pop:i,children:i===!1?e:b.cloneElement(e,{ref:m})})}const jV=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:l,anchorX:c,anchorY:f,root:d})=>{const p=d0(MV),m=b.useId();let x=!0,y=b.useMemo(()=>(x=!1,{id:m,initial:t,isPresent:n,custom:s,onExitComplete:v=>{p.set(v,!0);for(const T of p.values())if(!T)return;r&&r()},register:v=>(p.set(v,!1),()=>p.delete(v))}),[n,p,r]);return i&&x&&(y={...y}),b.useMemo(()=>{p.forEach((v,T)=>p.set(T,!1))},[n]),b.useEffect(()=>{!n&&!p.size&&r&&r()},[n]),e=u.jsx(DV,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:f,root:d,children:e}),u.jsx(f0.Provider,{value:y,children:e})};function MV(){return new Map}function AO(e=!0){const t=b.useContext(f0);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=b.useId();b.useEffect(()=>{if(e)return s(i)},[e]);const l=b.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,l]:[!0]}const Um=e=>e.key||"";function gk(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const ft=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:l=!1,anchorX:c="left",anchorY:f="top",root:d})=>{const[p,m]=AO(l),x=b.useMemo(()=>gk(e),[e]),y=l&&!p?[]:x.map(Um),v=b.useRef(!0),T=b.useRef(x),w=d0(()=>new Map),N=b.useRef(new Set),[A,k]=b.useState(x),[R,D]=b.useState(x);s4(()=>{v.current=!1,T.current=x;for(let I=0;I<R.length;I++){const H=Um(R[I]);y.includes(H)?(w.delete(H),N.current.delete(H)):w.get(H)!==!0&&w.set(H,!1)}},[R,y.length,y.join("-")]);const O=[];if(x!==A){let I=[...x];for(let H=0;H<R.length;H++){const P=R[H],K=Um(P);y.includes(K)||(I.splice(H,0,P),O.push(P))}return i==="wait"&&O.length&&(I=O),D(gk(I)),k(x),null}const{forceRender:M}=b.useContext(vE);return u.jsx(u.Fragment,{children:R.map(I=>{const H=Um(I),P=l&&!p?!1:x===R||y.includes(H),K=()=>{if(N.current.has(H))return;if(N.current.add(H),w.has(H))w.set(H,!0);else return;let Y=!0;w.forEach(W=>{W||(Y=!1)}),Y&&(M==null||M(),D(T.current),l&&(m==null||m()),r&&r())};return u.jsx(jV,{isPresent:P,initial:!v.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:P?void 0:K,anchorX:c,anchorY:f,children:I},H)})})},kO=b.createContext({strict:!1}),xk={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let yk=!1;function IV(){if(yk)return;const e={};for(const t in xk)e[t]={isEnabled:n=>xk[t].some(r=>!!n[r])};rO(e),yk=!0}function _O(){return IV(),E$()}function LV(e){const t=_O();for(const n in e)t[n]={...t[n],...e[n]};rO(t)}const PV=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Hp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||PV.has(e)}let RO=e=>!Hp(e);function OO(e){typeof e=="function"&&(RO=t=>t.startsWith("on")?!Hp(t):e(t))}try{OO(require("@emotion/is-prop-valid").default)}catch{}function BV(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(RO(s)||n===!0&&Hp(s)||!t&&!Hp(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function bk({children:e,isValidProp:t,...n}){t&&OO(t);const r=b.useContext(xf);n={...r,...n},n.transition=LE(n.transition,r.transition),n.isStatic=d0(()=>n.isStatic);const s=b.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return u.jsx(xf.Provider,{value:s,children:e})}const p0=b.createContext({});function FV(e,t){if(m0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pf(n)?n:void 0,animate:pf(r)?r:void 0}}return e.inherit!==!1?t:{}}function zV(e){const{initial:t,animate:n}=FV(e,b.useContext(p0));return b.useMemo(()=>({initial:t,animate:n}),[vk(t),vk(n)])}function vk(e){return Array.isArray(e)?e.join(" "):e}const XE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function DO(e,t,n){for(const r in t)!mr(t[r])&&!cO(r,n)&&(e[r]=t[r])}function UV({transformTemplate:e},t){return b.useMemo(()=>{const n=XE();return KE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function HV(e,t){const n=e.style||{},r={};return DO(r,n,e),Object.assign(r,UV(e,t)),r}function $V(e,t){const n={},r=HV(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const jO=()=>({...XE(),attrs:{}});function VV(e,t,n,r){const s=b.useMemo(()=>{const i=jO();return dO(i,t,hO(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};DO(i,e.style,e),s.style={...i,...s.style}}return s}const qV=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function WE(e){return typeof e!="string"||e.includes("-")?!1:!!(qV.indexOf(e)>-1||/[A-Z]/u.test(e))}function YV(e,t,n,{latestValues:r},s,i=!1,l){const f=(l??WE(e)?VV:$V)(t,r,s,e),d=BV(t,typeof e=="string",i),p=e!==b.Fragment?{...d,...f,ref:n}:{},{children:m}=t,x=b.useMemo(()=>mr(m)?m.get():m,[m]);return b.createElement(e,{...p,children:x})}function GV({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:KV(n,r,s,e),renderState:t()}}function KV(e,t,n,r){const s={},i=r(e,{});for(const x in i)s[x]=yp(i[x]);let{initial:l,animate:c}=e;const f=m0(e),d=tO(e);t&&d&&!f&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const m=p?c:l;if(m&&typeof m!="boolean"&&!h0(m)){const x=Array.isArray(m)?m:[m];for(let y=0;y<x.length;y++){const v=FE(e,x[y]);if(v){const{transitionEnd:T,transition:w,...N}=v;for(const A in N){let k=N[A];if(Array.isArray(k)){const R=p?k.length-1:0;k=k[R]}k!==null&&(s[A]=k)}for(const A in T)s[A]=T[A]}}}return s}const MO=e=>(t,n)=>{const r=b.useContext(p0),s=b.useContext(f0),i=()=>GV(e,t,r,s);return n?i():d0(i)},QV=MO({scrapeMotionValuesFromProps:QE,createRenderState:XE}),XV=MO({scrapeMotionValuesFromProps:mO,createRenderState:jO}),WV=Symbol.for("motionComponentSymbol");function ZV(e,t,n){const r=b.useRef(n);b.useInsertionEffect(()=>{r.current=n});const s=b.useRef(null);return b.useCallback(i=>{var c;i&&((c=e.onMount)==null||c.call(e,i)),t&&(i?t.mount(i):t.unmount());const l=r.current;if(typeof l=="function")if(i){const f=l(i);typeof f=="function"&&(s.current=f)}else s.current?(s.current(),s.current=null):l(i);else l&&(l.current=i)},[t])}const IO=b.createContext({});function Eu(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function JV(e,t,n,r,s,i){var k,R;const{visualElement:l}=b.useContext(p0),c=b.useContext(kO),f=b.useContext(f0),d=b.useContext(xf),p=d.reducedMotion,m=d.skipAnimations,x=b.useRef(null),y=b.useRef(!1);r=r||c.renderer,!x.current&&r&&(x.current=r(e,{visualState:t,parent:l,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:p,skipAnimations:m,isSVG:i}),y.current&&x.current&&(x.current.manuallyAnimateOnMount=!0));const v=x.current,T=b.useContext(IO);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&eq(x.current,n,s,T);const w=b.useRef(!1);b.useInsertionEffect(()=>{v&&w.current&&v.update(n,f)});const N=n[H4],A=b.useRef(!!N&&!((k=window.MotionHandoffIsComplete)!=null&&k.call(window,N))&&((R=window.MotionHasOptimisedAnimation)==null?void 0:R.call(window,N)));return s4(()=>{y.current=!0,v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),A.current&&v.animationState&&v.animationState.animateChanges())}),b.useEffect(()=>{v&&(!A.current&&v.animationState&&v.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{var D;(D=window.MotionHandoffMarkAsComplete)==null||D.call(window,N)}),A.current=!1),v.enteringChildren=void 0)}),v}function eq(e,t,n,r){const{layoutId:s,layout:i,drag:l,dragConstraints:c,layoutScroll:f,layoutRoot:d,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:LO(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!l||c&&Eu(c),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:f,layoutRoot:d})}function LO(e){if(e)return e.options.allowProjection!==!1?e.projection:LO(e.parent)}function ay(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&LV(r);const i=n?n==="svg":WE(e),l=i?XV:QV;function c(d,p){let m;const x={...b.useContext(xf),...d,layoutId:tq(d)},{isStatic:y}=x,v=zV(d),T=l(d,y);if(!y&&r4){nq();const w=rq(x);m=w.MeasureLayout,v.visualElement=JV(e,T,x,s,w.ProjectionNode,i)}return u.jsxs(p0.Provider,{value:v,children:[m&&v.visualElement?u.jsx(m,{visualElement:v.visualElement,...x}):null,YV(e,d,ZV(T,v.visualElement,p),T,y,t,i)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=b.forwardRef(c);return f[WV]=e,f}function tq({layoutId:e}){const t=b.useContext(vE).id;return t&&e!==void 0?t+"-"+e:e}function nq(e,t){b.useContext(kO).strict}function rq(e){const t=_O(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function sq(e,t){if(typeof Proxy>"u")return ay;const n=new Map,r=(i,l)=>ay(i,l,e,t),s=(i,l)=>r(i,l);return new Proxy(s,{get:(i,l)=>l==="create"?r:(n.has(l)||n.set(l,ay(l,void 0,e,t)),n.get(l))})}const aq=(e,t)=>t.isSVG??WE(e)?new B$(t):new D$(t,{allowProjection:e!==b.Fragment});class iq extends lo{constructor(t){super(t),t.animationState||(t.animationState=$$(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();h0(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let oq=0;class lq extends lo{constructor(){super(...arguments),this.id=oq++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const uq={animation:{Feature:iq},exit:{Feature:lq}};function Ff(e){return{point:{x:e.pageX,y:e.pageY}}}const cq=e=>t=>$E(t)&&e(t,Ff(t));function Kd(e,t,n,r){return gf(e,t,cq(n),r)}const PO=({current:e})=>e?e.ownerDocument.defaultView:null,Ek=(e,t)=>Math.abs(e-t);function dq(e,t){const n=Ek(e.x,t.x),r=Ek(e.y,t.y);return Math.sqrt(n**2+r**2)}const Tk=new Set(["auto","scroll"]);class BO{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=oy(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,T=dq(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!T)return;const{point:w}=y,{timestamp:N}=cr;this.history.push({...w,timestamp:N});const{onStart:A,onMove:k}=this.handlers;v||(A&&A(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,y)},this.handlePointerMove=(y,v)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=iy(v,this.transformPagePoint),sn.update(this.updatePoint,!0)},this.handlePointerUp=(y,v)=>{this.end();const{onEnd:T,onSessionEnd:w,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=oy(y.type==="pointercancel"?this.lastMoveEventInfo:iy(v,this.transformPagePoint),this.history);this.startEvent&&T&&T(y,A),w&&w(y,A)},!$E(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=s||window;const f=Ff(t),d=iy(f,this.transformPagePoint),{point:p}=d,{timestamp:m}=cr;this.history=[{...p,timestamp:m}];const{onSessionStart:x}=n;x&&x(t,oy(d,this.history)),this.removeListeners=Lf(Kd(this.contextWindow,"pointermove",this.handlePointerMove),Kd(this.contextWindow,"pointerup",this.handlePointerUp),Kd(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Tk.has(r.overflowX)||Tk.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),sn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ji(this.updatePoint)}}function iy(e,t){return t?{point:t(e.point)}:e}function Sk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oy({point:e},t){return{point:e,delta:Sk(e,FO(t)),offset:Sk(e,fq(t)),velocity:hq(t,.1)}}function fq(e){return e[0]}function FO(e){return e[e.length-1]}function hq(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=FO(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>zs(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>zs(t)*2&&(r=e[1]);const i=bs(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const l={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function mq(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?bn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?bn(n,e,r.max):Math.min(e,n)),e}function wk(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function pq(e,{top:t,left:n,bottom:r,right:s}){return{x:wk(e.x,n,s),y:wk(e.y,t,r)}}function Ck(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function gq(e,t){return{x:Ck(e.x,t.x),y:Ck(e.y,t.y)}}function xq(e,t){let n=.5;const r=Nr(e),s=Nr(t);return s>r?n=ff(t.min,t.max-r,e.min):r>s&&(n=ff(e.min,e.max-s,t.min)),ma(0,1,n)}function yq(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const uv=.35;function bq(e=uv){return e===!1?e=0:e===!0&&(e=uv),{x:Nk(e,"left","right"),y:Nk(e,"top","bottom")}}function Nk(e,t,n){return{min:Ak(e,t),max:Ak(e,n)}}function Ak(e,t){return typeof e=="number"?e:e[t]||0}const vq=new WeakMap;class Eq{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Vn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=m=>{n&&this.snapToCursor(Ff(m).point),this.stopAnimation()},l=(m,x)=>{const{drag:y,dragPropagation:v,onDragStart:T}=this.getProps();if(y&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ZH(y),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Js(N=>{let A=this.getAxisMotionValue(N).get()||0;if(oa.test(A)){const{projection:k}=this.visualElement;if(k&&k.layout){const R=k.layout.layoutBox[N];R&&(A=Nr(R)*(parseFloat(A)/100))}}this.originPoint[N]=A}),T&&sn.update(()=>T(m,x),!1,!0),nv(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},c=(m,x)=>{this.latestPointerEvent=m,this.latestPanInfo=x;const{dragPropagation:y,dragDirectionLock:v,onDirectionLock:T,onDrag:w}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:N}=x;if(v&&this.currentDirection===null){this.currentDirection=Sq(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",x.point,N),this.updateAxis("y",x.point,N),this.visualElement.render(),w&&sn.update(()=>w(m,x),!1,!0)},f=(m,x)=>{this.latestPointerEvent=m,this.latestPanInfo=x,this.stop(m,x),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new BO(t,{onSessionStart:i,onStart:l,onMove:c,onSessionEnd:f,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:PO(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&sn.postRender(()=>c(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Hm(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=mq(l,this.constraints[t],this.elastic[t])),i.set(l)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Eu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=pq(r.layoutBox,t):this.constraints=!1,this.elastic=bq(n),s!==this.constraints&&!Eu(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Js(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=yq(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Eu(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=N$(r,s.root,this.visualElement.getTransformPagePoint());let l=gq(s.layout.layoutBox,i);if(n){const c=n(S$(l));this.hasMutatedConstraints=!!c,c&&(l=aO(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},d=Js(p=>{if(!Hm(p,n,this.currentDirection))return;let m=f&&f[p]||{};l&&(m={min:0,max:0});const x=s?200:1e6,y=s?40:1e7,v={type:"inertia",velocity:r?t[p]:0,bounceStiffness:x,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...m};return this.startAxisValueAnimation(p,v)});return Promise.all(d).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return nv(this.visualElement,t),r.start(BE(t,r,0,n,this.visualElement,!1))}stopAnimation(){Js(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Js(n=>{const{drag:r}=this.getProps();if(!Hm(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:c}=s.layout.layoutBox[n],f=i.get()||0;i.set(t[n]-bn(l,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Eu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Js(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const f=c.get();s[l]=xq({min:f,max:f},this.constraints[l])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Js(l=>{if(!Hm(l,t,null))return;const c=this.getAxisMotionValue(l),{min:f,max:d}=this.constraints[l];c.set(bn(f,d,s[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;vq.set(this.visualElement,this);const t=this.visualElement.current,n=Kd(t,"pointerdown",d=>{const{drag:p,dragListener:m=!0}=this.getProps(),x=d.target,y=x!==t&&s$(x);p&&m&&!y&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Eu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Tq(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,l=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),sn.read(s);const c=gf(window,"resize",()=>this.scalePositionWithinConstraints()),f=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(Js(m=>{const x=this.getAxisMotionValue(m);x&&(this.originPoint[m]+=d[m].translate,x.set(x.get()+d[m].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),f&&f(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:l=uv,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:l,dragMomentum:c}}}function kk(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Tq(e,t,n){const r=MA(e,kk(n)),s=MA(t,kk(n));return()=>{r(),s()}}function Hm(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sq(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wq extends lo{constructor(t){super(t),this.removeGroupControls=Es,this.removeListeners=Es,this.controls=new Eq(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Es}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ly=e=>(t,n)=>{e&&sn.update(()=>e(t,n),!1,!0)};class Cq extends lo{constructor(){super(...arguments),this.removePointerDownListener=Es}onPointerDown(t){this.session=new BO(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:PO(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:ly(t),onStart:ly(n),onMove:ly(r),onEnd:(i,l)=>{delete this.session,s&&sn.postRender(()=>s(i,l))}}}mount(){this.removePointerDownListener=Kd(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let uy=!1;class Nq extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),uy&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),bp.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:l}=r;return l&&(l.isPresent=i,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),uy=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?l.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?l.promote():l.relegate()||sn.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),HE.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;uy=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function zO(e){const[t,n]=AO(),r=b.useContext(vE);return u.jsx(Nq,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(IO),isPresent:t,safeToRemove:n})}const Aq={pan:{Feature:Cq},drag:{Feature:wq,ProjectionNode:NO,MeasureLayout:zO}};function _k(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&sn.postRender(()=>i(t,Ff(t)))}class kq extends lo{mount(){const{current:t}=this.node;t&&(this.unmount=e$(t,(n,r)=>(_k(this.node,r,"Start"),s=>_k(this.node,s,"End"))))}unmount(){}}class _q extends lo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Lf(gf(this.node.current,"focus",()=>this.onFocus()),gf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Rk(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&sn.postRender(()=>i(t,Ff(t)))}class Rq extends lo{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=i$(t,(s,i)=>(Rk(this.node,i,"Start"),(l,{success:c})=>Rk(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const cv=new WeakMap,cy=new WeakMap,Oq=e=>{const t=cv.get(e.target);t&&t(e)},Dq=e=>{e.forEach(Oq)};function jq({root:e,...t}){const n=e||document;cy.has(n)||cy.set(n,{});const r=cy.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Dq,{root:e,...t})),r[s]}function Mq(e,t,n){const r=jq(t);return cv.set(e,n),r.observe(e),()=>{cv.delete(e),r.unobserve(e)}}const Iq={some:0,all:1};class Lq extends lo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Iq[s]},c=f=>{const{isIntersecting:d}=f;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),x=d?p:m;x&&x(f)};return Mq(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Pq(t,n))&&this.startObserver()}unmount(){}}function Pq({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Bq={inView:{Feature:Lq},tap:{Feature:Rq},focus:{Feature:_q},hover:{Feature:kq}},Fq={layout:{ProjectionNode:NO,MeasureLayout:zO}},zq={...uq,...Bq,...Aq,...Fq},De=sq(zq,aq);function dc(){!GE.current&&nO();const[e]=b.useState(Bp.current);return e}/**
|
|
66
|
-
* @license lucide-react v0.575.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const UO=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
71
|
-
* @license lucide-react v0.575.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const Uq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
76
|
-
* @license lucide-react v0.575.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const Hq=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
81
|
-
* @license lucide-react v0.575.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const Ok=e=>{const t=Hq(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
86
|
-
* @license lucide-react v0.575.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/var $q={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"};/**
|
|
91
|
-
* @license lucide-react v0.575.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const Vq=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
96
|
-
* @license lucide-react v0.575.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const qq=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:l,...c},f)=>b.createElement("svg",{ref:f,...$q,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:UO("lucide",s),...!i&&!Vq(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,p])=>b.createElement(d,p)),...Array.isArray(i)?i:[i]]));/**
|
|
101
|
-
* @license lucide-react v0.575.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const je=(e,t)=>{const n=b.forwardRef(({className:r,...s},i)=>b.createElement(qq,{ref:i,iconNode:t,className:UO(`lucide-${Uq(Ok(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Ok(e),n};/**
|
|
106
|
-
* @license lucide-react v0.575.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const Yq=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Gq=je("activity",Yq);/**
|
|
111
|
-
* @license lucide-react v0.575.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const Kq=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],HO=je("arrow-down",Kq);/**
|
|
116
|
-
* @license lucide-react v0.575.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Qq=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Xq=je("arrow-left",Qq);/**
|
|
121
|
-
* @license lucide-react v0.575.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const Wq=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],dv=je("arrow-up-right",Wq);/**
|
|
126
|
-
* @license lucide-react v0.575.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const Zq=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ZE=je("arrow-up",Zq);/**
|
|
131
|
-
* @license lucide-react v0.575.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const Jq=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],$O=je("bot",Jq);/**
|
|
136
|
-
* @license lucide-react v0.575.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const eY=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],tY=je("chart-column",eY);/**
|
|
141
|
-
* @license lucide-react v0.575.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const nY=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],zn=je("check",nY);/**
|
|
146
|
-
* @license lucide-react v0.575.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const rY=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ti=je("chevron-down",rY);/**
|
|
151
|
-
* @license lucide-react v0.575.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const sY=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],As=je("chevron-right",sY);/**
|
|
156
|
-
* @license lucide-react v0.575.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const aY=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],iY=je("chevrons-up-down",aY);/**
|
|
161
|
-
* @license lucide-react v0.575.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const oY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],zf=je("circle-check",oY);/**
|
|
166
|
-
* @license lucide-react v0.575.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const lY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],uY=je("circle-minus",lY);/**
|
|
171
|
-
* @license lucide-react v0.575.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const cY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],VO=je("circle-x",cY);/**
|
|
176
|
-
* @license lucide-react v0.575.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const dY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],qO=je("circle",dY);/**
|
|
181
|
-
* @license lucide-react v0.575.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const fY=[["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"}]],hY=je("clipboard-list",fY);/**
|
|
186
|
-
* @license lucide-react v0.575.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const mY=[["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"}]],pY=je("clipboard",mY);/**
|
|
191
|
-
* @license lucide-react v0.575.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const gY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Uf=je("clock",gY);/**
|
|
196
|
-
* @license lucide-react v0.575.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const xY=[["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"}]],JE=je("copy",xY);/**
|
|
201
|
-
* @license lucide-react v0.575.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const yY=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],bY=je("corner-down-left",yY);/**
|
|
206
|
-
* @license lucide-react v0.575.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const vY=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],EY=je("dollar-sign",vY);/**
|
|
211
|
-
* @license lucide-react v0.575.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const TY=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],SY=je("ellipsis-vertical",TY);/**
|
|
216
|
-
* @license lucide-react v0.575.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const wY=[["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"}]],CY=je("ellipsis",wY);/**
|
|
221
|
-
* @license lucide-react v0.575.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const NY=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],fv=je("external-link",NY);/**
|
|
226
|
-
* @license lucide-react v0.575.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const AY=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],YO=je("eye-off",AY);/**
|
|
231
|
-
* @license lucide-react v0.575.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const kY=[["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"}]],GO=je("eye",kY);/**
|
|
236
|
-
* @license lucide-react v0.575.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const _Y=[["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"}]],RY=je("file-text",_Y);/**
|
|
241
|
-
* @license lucide-react v0.575.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const OY=[["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"}]],DY=je("file",OY);/**
|
|
246
|
-
* @license lucide-react v0.575.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const jY=[["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"}]],Hf=je("folder-open",jY);/**
|
|
251
|
-
* @license lucide-react v0.575.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const MY=[["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"}]],IY=je("folder-search",MY);/**
|
|
256
|
-
* @license lucide-react v0.575.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const LY=[["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"}]],Zo=je("folder",LY);/**
|
|
261
|
-
* @license lucide-react v0.575.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const PY=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],hv=je("git-branch",PY);/**
|
|
266
|
-
* @license lucide-react v0.575.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const BY=[["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"}]],FY=je("globe",BY);/**
|
|
271
|
-
* @license lucide-react v0.575.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const zY=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],$p=je("inbox",zY);/**
|
|
276
|
-
* @license lucide-react v0.575.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const UY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],KO=je("info",UY);/**
|
|
281
|
-
* @license lucide-react v0.575.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const HY=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],$Y=je("layers",HY);/**
|
|
286
|
-
* @license lucide-react v0.575.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const VY=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],qY=je("link",VY);/**
|
|
291
|
-
* @license lucide-react v0.575.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const YY=[["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"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],GY=je("list-todo",YY);/**
|
|
296
|
-
* @license lucide-react v0.575.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const KY=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qn=je("loader-circle",KY);/**
|
|
301
|
-
* @license lucide-react v0.575.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const QY=[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h9",key:"1j9vog"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m17 17 4 4",key:"1b3523"}],["path",{d:"m21 17-4 4",key:"uinynz"}]],XY=je("mail-x",QY);/**
|
|
306
|
-
* @license lucide-react v0.575.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const WY=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ZY=je("maximize-2",WY);/**
|
|
311
|
-
* @license lucide-react v0.575.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const JY=[["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"}]],QO=je("message-square",JY);/**
|
|
316
|
-
* @license lucide-react v0.575.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const eG=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],tG=je("minimize-2",eG);/**
|
|
321
|
-
* @license lucide-react v0.575.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const nG=[["path",{d:"M5 12h14",key:"1ays0h"}]],rG=je("minus",nG);/**
|
|
326
|
-
* @license lucide-react v0.575.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const sG=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],aG=je("monitor",sG);/**
|
|
331
|
-
* @license lucide-react v0.575.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const iG=[["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"}]],oG=je("moon",iG);/**
|
|
336
|
-
* @license lucide-react v0.575.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const lG=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],XO=je("network",lG);/**
|
|
341
|
-
* @license lucide-react v0.575.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const uG=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],cG=je("octagon-x",uG);/**
|
|
346
|
-
* @license lucide-react v0.575.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const dG=[["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"}]],fG=je("panel-left-close",dG);/**
|
|
351
|
-
* @license lucide-react v0.575.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const hG=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Dk=je("panel-left",hG);/**
|
|
356
|
-
* @license lucide-react v0.575.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const mG=[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],pG=je("pen-line",mG);/**
|
|
361
|
-
* @license lucide-react v0.575.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const gG=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],xG=je("pencil",gG);/**
|
|
366
|
-
* @license lucide-react v0.575.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const yG=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],WO=je("play",yG);/**
|
|
371
|
-
* @license lucide-react v0.575.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const bG=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],eT=je("plus",bG);/**
|
|
376
|
-
* @license lucide-react v0.575.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const vG=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],ZO=je("radar",vG);/**
|
|
381
|
-
* @license lucide-react v0.575.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const EG=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],JO=je("radio",EG);/**
|
|
386
|
-
* @license lucide-react v0.575.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const TG=[["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"}]],SG=je("refresh-cw",TG);/**
|
|
391
|
-
* @license lucide-react v0.575.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const wG=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],CG=je("route",wG);/**
|
|
396
|
-
* @license lucide-react v0.575.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const NG=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$f=je("search",NG);/**
|
|
401
|
-
* @license lucide-react v0.575.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const AG=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],kG=je("send",AG);/**
|
|
406
|
-
* @license lucide-react v0.575.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const _G=[["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"}]],g0=je("settings",_G);/**
|
|
411
|
-
* @license lucide-react v0.575.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const RG=[["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"}]],eD=je("shield-check",RG);/**
|
|
416
|
-
* @license lucide-react v0.575.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const OG=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],tD=je("shield-off",OG);/**
|
|
421
|
-
* @license lucide-react v0.575.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const DG=[["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"}]],x0=je("shield",DG);/**
|
|
426
|
-
* @license lucide-react v0.575.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const jG=[["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"}]],MG=je("square-check-big",jG);/**
|
|
431
|
-
* @license lucide-react v0.575.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const IG=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],nD=je("square",IG);/**
|
|
436
|
-
* @license lucide-react v0.575.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const LG=[["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"}]],PG=je("sun",LG);/**
|
|
441
|
-
* @license lucide-react v0.575.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const BG=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],FG=je("terminal",BG);/**
|
|
446
|
-
* @license lucide-react v0.575.0 - ISC
|
|
447
|
-
*
|
|
448
|
-
* This source code is licensed under the ISC license.
|
|
449
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
-
*/const zG=[["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"}]],tT=je("trash-2",zG);/**
|
|
451
|
-
* @license lucide-react v0.575.0 - ISC
|
|
452
|
-
*
|
|
453
|
-
* This source code is licensed under the ISC license.
|
|
454
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
-
*/const UG=[["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"}]],fc=je("triangle-alert",UG);/**
|
|
456
|
-
* @license lucide-react v0.575.0 - ISC
|
|
457
|
-
*
|
|
458
|
-
* This source code is licensed under the ISC license.
|
|
459
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
-
*/const HG=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],$G=je("users",HG);/**
|
|
461
|
-
* @license lucide-react v0.575.0 - ISC
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the ISC license.
|
|
464
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/const VG=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],qG=je("volume-2",VG);/**
|
|
466
|
-
* @license lucide-react v0.575.0 - ISC
|
|
467
|
-
*
|
|
468
|
-
* This source code is licensed under the ISC license.
|
|
469
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
-
*/const YG=[["path",{d:"M16 9a5 5 0 0 1 .95 2.293",key:"1fgyg8"}],["path",{d:"M19.364 5.636a9 9 0 0 1 1.889 9.96",key:"l3zxae"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11",key:"1gbwow"}],["path",{d:"M9.828 4.172A.686.686 0 0 1 11 4.657v.686",key:"s2je0y"}]],GG=je("volume-off",YG);/**
|
|
471
|
-
* @license lucide-react v0.575.0 - ISC
|
|
472
|
-
*
|
|
473
|
-
* This source code is licensed under the ISC license.
|
|
474
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
-
*/const KG=[["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"}]],QG=je("wifi-off",KG);/**
|
|
476
|
-
* @license lucide-react v0.575.0 - ISC
|
|
477
|
-
*
|
|
478
|
-
* This source code is licensed under the ISC license.
|
|
479
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/const XG=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],WG=je("wifi",XG);/**
|
|
481
|
-
* @license lucide-react v0.575.0 - ISC
|
|
482
|
-
*
|
|
483
|
-
* This source code is licensed under the ISC license.
|
|
484
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
-
*/const ZG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ba=je("x",ZG);function jk({sessionId:e}){return null}function JG(e,t){const n=b.createContext(t),r=i=>{const{children:l,...c}=i,f=b.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function s(i){const l=b.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function ns(e,t=[]){let n=[];function r(i,l){const c=b.createContext(l),f=n.length;n=[...n,l];const d=m=>{var N;const{scope:x,children:y,...v}=m,T=((N=x==null?void 0:x[e])==null?void 0:N[f])||c,w=b.useMemo(()=>v,Object.values(v));return u.jsx(T.Provider,{value:w,children:y})};d.displayName=i+"Provider";function p(m,x){var T;const y=((T=x==null?void 0:x[e])==null?void 0:T[f])||c,v=b.useContext(y);if(v)return v;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,p]}const s=()=>{const i=n.map(l=>b.createContext(l));return function(c){const f=(c==null?void 0:c[e])||i;return b.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return s.scopeName=e,[r,eK(s,...t)]}function eK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=r.reduce((c,{useScope:f,scopeName:d})=>{const m=f(i)[`__scope${d}`];return{...c,...m}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Mk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pa(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Mk(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Mk(e[s],null)}}}}function At(...e){return b.useCallback(pa(...e),e)}function _e(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var gr=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},tK=iE[" useId ".trim().toString()]||(()=>{}),nK=0;function nr(e){const[t,n]=b.useState(tK());return gr(()=>{n(r=>r??String(nK++))},[e]),t?`radix-${t}`:""}var rK=iE[" useInsertionEffect ".trim().toString()]||gr;function ga({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,l]=sK({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:s;{const p=b.useRef(e!==void 0);b.useEffect(()=>{const m=p.current;m!==c&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const d=b.useCallback(p=>{var m;if(c){const x=aK(p)?p(e):p;x!==e&&((m=l.current)==null||m.call(l,x))}else i(p)},[c,e,i,l]);return[f,d]}function sK({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),s=b.useRef(n),i=b.useRef(t);return rK(()=>{i.current=t},[t]),b.useEffect(()=>{var l;s.current!==n&&((l=i.current)==null||l.call(i,n),s.current=n)},[n,s]),[n,r,i]}function aK(e){return typeof e=="function"}var ai=h5();const rD=ml(ai);function to(e){const t=oK(e),n=b.forwardRef((r,s)=>{const{children:i,...l}=r,c=b.Children.toArray(i),f=c.find(lK);if(f){const d=f.props.children,p=c.map(m=>m===f?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return u.jsx(t,{...l,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,p):null})}return u.jsx(t,{...l,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var iK=to("Slot");function oK(e){const t=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const l=cK(s),c=uK(i,s.props);return s.type!==b.Fragment&&(c.ref=r?pa(r,l):l),b.cloneElement(s,c)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sD=Symbol("radix.slottable");function aD(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=sD,t}function lK(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sD}function uK(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const f=i(...c);return s(...c),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function cK(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rt=dK.reduce((e,t)=>{const n=to(`Primitive.${t}`),r=b.forwardRef((s,i)=>{const{asChild:l,...c}=s,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function iD(e,t){e&&ai.flushSync(()=>e.dispatchEvent(t))}function xa(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function fK(e,t=globalThis==null?void 0:globalThis.document){const n=xa(e);b.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var hK="DismissableLayer",mv="dismissableLayer.update",mK="dismissableLayer.pointerDownOutside",pK="dismissableLayer.focusOutside",Ik,oD=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gl=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...f}=e,d=b.useContext(oD),[p,m]=b.useState(null),x=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=b.useState({}),v=At(t,M=>m(M)),T=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),N=T.indexOf(w),A=p?T.indexOf(p):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,R=A>=N,D=yK(M=>{const I=M.target,H=[...d.branches].some(P=>P.contains(I));!R||H||(s==null||s(M),l==null||l(M),M.defaultPrevented||c==null||c())},x),O=bK(M=>{const I=M.target;[...d.branches].some(P=>P.contains(I))||(i==null||i(M),l==null||l(M),M.defaultPrevented||c==null||c())},x);return fK(M=>{A===d.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&c&&(M.preventDefault(),c()))},x),b.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ik=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Lk(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Ik)}},[p,x,n,d]),b.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Lk())},[p,d]),b.useEffect(()=>{const M=()=>y({});return document.addEventListener(mv,M),()=>document.removeEventListener(mv,M)},[]),u.jsx(rt.div,{...f,ref:v,style:{pointerEvents:k?R?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,O.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,D.onPointerDownCapture)})});gl.displayName=hK;var gK="DismissableLayerBranch",xK=b.forwardRef((e,t)=>{const n=b.useContext(oD),r=b.useRef(null),s=At(t,r);return b.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),u.jsx(rt.div,{...e,ref:s})});xK.displayName=gK;function yK(e,t=globalThis==null?void 0:globalThis.document){const n=xa(e),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let f=function(){lD(mK,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=f,t.addEventListener("click",s.current,{once:!0})):f()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function bK(e,t=globalThis==null?void 0:globalThis.document){const n=xa(e),r=b.useRef(!1);return b.useEffect(()=>{const s=i=>{i.target&&!r.current&&lD(pK,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lk(){const e=new CustomEvent(mv);document.dispatchEvent(e)}function lD(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?iD(s,i):s.dispatchEvent(i)}var dy="focusScope.autoFocusOnMount",fy="focusScope.autoFocusOnUnmount",Pk={bubbles:!1,cancelable:!0},vK="FocusScope",Vf=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[c,f]=b.useState(null),d=xa(s),p=xa(i),m=b.useRef(null),x=At(t,T=>f(T)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let T=function(k){if(y.paused||!c)return;const R=k.target;c.contains(R)?m.current=R:Pi(m.current,{select:!0})},w=function(k){if(y.paused||!c)return;const R=k.relatedTarget;R!==null&&(c.contains(R)||Pi(m.current,{select:!0}))},N=function(k){if(document.activeElement===document.body)for(const D of k)D.removedNodes.length>0&&Pi(c)};document.addEventListener("focusin",T),document.addEventListener("focusout",w);const A=new MutationObserver(N);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",w),A.disconnect()}}},[r,c,y.paused]),b.useEffect(()=>{if(c){Fk.add(y);const T=document.activeElement;if(!c.contains(T)){const N=new CustomEvent(dy,Pk);c.addEventListener(dy,d),c.dispatchEvent(N),N.defaultPrevented||(EK(NK(uD(c)),{select:!0}),document.activeElement===T&&Pi(c))}return()=>{c.removeEventListener(dy,d),setTimeout(()=>{const N=new CustomEvent(fy,Pk);c.addEventListener(fy,p),c.dispatchEvent(N),N.defaultPrevented||Pi(T??document.body,{select:!0}),c.removeEventListener(fy,p),Fk.remove(y)},0)}}},[c,d,p,y]);const v=b.useCallback(T=>{if(!n&&!r||y.paused)return;const w=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,N=document.activeElement;if(w&&N){const A=T.currentTarget,[k,R]=TK(A);k&&R?!T.shiftKey&&N===R?(T.preventDefault(),n&&Pi(k,{select:!0})):T.shiftKey&&N===k&&(T.preventDefault(),n&&Pi(R,{select:!0})):N===A&&T.preventDefault()}},[n,r,y.paused]);return u.jsx(rt.div,{tabIndex:-1,...l,ref:x,onKeyDown:v})});Vf.displayName=vK;function EK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pi(r,{select:t}),document.activeElement!==n)return}function TK(e){const t=uD(e),n=Bk(t,e),r=Bk(t.reverse(),e);return[n,r]}function uD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Bk(e,t){for(const n of e)if(!SK(n,{upTo:t}))return n}function SK(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function wK(e){return e instanceof HTMLInputElement&&"select"in e}function Pi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wK(e)&&t&&e.select()}}var Fk=CK();function CK(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=zk(e,t),e.unshift(t)},remove(t){var n;e=zk(e,t),(n=e[0])==null||n.resume()}}}function zk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NK(e){return e.filter(t=>t.tagName!=="A")}var AK="Portal",xl=b.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,i]=b.useState(!1);gr(()=>i(!0),[]);const l=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?rD.createPortal(u.jsx(rt.div,{...r,ref:t}),l):null});xl.displayName=AK;function kK(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var kr=e=>{const{present:t,children:n}=e,r=_K(t),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),i=At(r.ref,RK(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:i}):null};kr.displayName="Presence";function _K(e){const[t,n]=b.useState(),r=b.useRef(null),s=b.useRef(e),i=b.useRef("none"),l=e?"mounted":"unmounted",[c,f]=kK(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=$m(r.current);i.current=c==="mounted"?d:"none"},[c]),gr(()=>{const d=r.current,p=s.current;if(p!==e){const x=i.current,y=$m(d);e?f("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(p&&x!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),gr(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=y=>{const T=$m(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&T&&(f("ANIMATION_END"),!s.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},x=y=>{y.target===t&&(i.current=$m(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function $m(e){return(e==null?void 0:e.animationName)||"none"}function RK(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hy=0;function y0(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Uk()),document.body.insertAdjacentElement("beforeend",e[1]??Uk()),hy++,()=>{hy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hy--}},[])}function Uk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var aa=function(){return aa=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},aa.apply(this,arguments)};function cD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function OK(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var vp="right-scroll-bar-position",Ep="width-before-scroll-bar",DK="with-scroll-bars-hidden",jK="--removed-body-scroll-bar-size";function my(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MK(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var IK=typeof window<"u"?b.useLayoutEffect:b.useEffect,Hk=new WeakMap;function LK(e,t){var n=MK(null,function(r){return e.forEach(function(s){return my(s,r)})});return IK(function(){var r=Hk.get(n);if(r){var s=new Set(r),i=new Set(e),l=n.current;s.forEach(function(c){i.has(c)||my(c,null)}),i.forEach(function(c){s.has(c)||my(c,l)})}Hk.set(n,e)},[e]),n}function PK(e){return e}function BK(e,t){t===void 0&&(t=PK);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(i),l=n}var f=function(){var p=l;l=[],p.forEach(i)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(p){l.push(p),d()},filter:function(p){return l=l.filter(p),n}}}};return s}function FK(e){e===void 0&&(e={});var t=BK(null);return t.options=aa({async:!0,ssr:!1},e),t}var dD=function(e){var t=e.sideCar,n=cD(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,aa({},n))};dD.isSideCarExport=!0;function zK(e,t){return e.useMedium(t),dD}var fD=FK(),py=function(){},b0=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:py,onWheelCapture:py,onTouchMoveCapture:py}),s=r[0],i=r[1],l=e.forwardProps,c=e.children,f=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,x=e.sideCar,y=e.noRelative,v=e.noIsolation,T=e.inert,w=e.allowPinchZoom,N=e.as,A=N===void 0?"div":N,k=e.gapMode,R=cD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=x,O=LK([n,t]),M=aa(aa({},R),s);return b.createElement(b.Fragment,null,p&&b.createElement(D,{sideCar:fD,removeScrollBar:d,shards:m,noRelative:y,noIsolation:v,inert:T,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:k}),l?b.cloneElement(b.Children.only(c),aa(aa({},M),{ref:O})):b.createElement(A,aa({},M,{className:f,ref:O}),c))});b0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};b0.classNames={fullWidth:Ep,zeroRight:vp};var UK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function HK(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=UK();return t&&e.setAttribute("nonce",t),e}function $K(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function VK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=HK())&&($K(t,n),VK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},YK=function(){var e=qK();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hD=function(){var e=YK(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},GK={left:0,top:0,right:0,gap:0},gy=function(e){return parseInt(e||"",10)||0},KK=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[gy(n),gy(r),gy(s)]},QK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GK;var t=KK(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},XK=hD(),ju="data-scroll-locked",WK=function(e,t,n,r){var s=e.left,i=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
486
|
-
.`.concat(DK,` {
|
|
487
|
-
overflow: hidden `).concat(r,`;
|
|
488
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
489
|
-
}
|
|
490
|
-
body[`).concat(ju,`] {
|
|
491
|
-
overflow: hidden `).concat(r,`;
|
|
492
|
-
overscroll-behavior: contain;
|
|
493
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
494
|
-
padding-left: `.concat(s,`px;
|
|
495
|
-
padding-top: `).concat(i,`px;
|
|
496
|
-
padding-right: `).concat(l,`px;
|
|
497
|
-
margin-left:0;
|
|
498
|
-
margin-top:0;
|
|
499
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
500
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
.`).concat(vp,` {
|
|
504
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
.`).concat(Ep,` {
|
|
508
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.`).concat(vp," .").concat(vp,` {
|
|
512
|
-
right: 0 `).concat(r,`;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
.`).concat(Ep," .").concat(Ep,` {
|
|
516
|
-
margin-right: 0 `).concat(r,`;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
body[`).concat(ju,`] {
|
|
520
|
-
`).concat(jK,": ").concat(c,`px;
|
|
521
|
-
}
|
|
522
|
-
`)},$k=function(){var e=parseInt(document.body.getAttribute(ju)||"0",10);return isFinite(e)?e:0},ZK=function(){b.useEffect(function(){return document.body.setAttribute(ju,($k()+1).toString()),function(){var e=$k()-1;e<=0?document.body.removeAttribute(ju):document.body.setAttribute(ju,e.toString())}},[])},JK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;ZK();var i=b.useMemo(function(){return QK(s)},[s]);return b.createElement(XK,{styles:WK(i,!t,s,n?"":"!important")})},pv=!1;if(typeof window<"u")try{var Vm=Object.defineProperty({},"passive",{get:function(){return pv=!0,!0}});window.addEventListener("test",Vm,Vm),window.removeEventListener("test",Vm,Vm)}catch{pv=!1}var fu=pv?{passive:!1}:!1,eQ=function(e){return e.tagName==="TEXTAREA"},mD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!eQ(e)&&n[t]==="visible")},tQ=function(e){return mD(e,"overflowY")},nQ=function(e){return mD(e,"overflowX")},Vk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=pD(e,r);if(s){var i=gD(e,r),l=i[1],c=i[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},sQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},pD=function(e,t){return e==="v"?tQ(t):nQ(t)},gD=function(e,t){return e==="v"?rQ(t):sQ(t)},aQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},iQ=function(e,t,n,r,s){var i=aQ(e,window.getComputedStyle(t).direction),l=i*r,c=n.target,f=t.contains(c),d=!1,p=l>0,m=0,x=0;do{if(!c)break;var y=gD(e,c),v=y[0],T=y[1],w=y[2],N=T-w-i*v;(v||N)&&pD(e,c)&&(m+=N,x+=v);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(x)<1)&&(d=!0),d},qm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qk=function(e){return[e.deltaX,e.deltaY]},Yk=function(e){return e&&"current"in e?e.current:e},oQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lQ=function(e){return`
|
|
523
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
524
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
525
|
-
`)},uQ=0,hu=[];function cQ(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),s=b.useState(uQ++)[0],i=b.useState(hD)[0],l=b.useRef(e);b.useEffect(function(){l.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var T=OK([e.lockRef.current],(e.shards||[]).map(Yk),!0).filter(Boolean);return T.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),T.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=b.useCallback(function(T,w){if("touches"in T&&T.touches.length===2||T.type==="wheel"&&T.ctrlKey)return!l.current.allowPinchZoom;var N=qm(T),A=n.current,k="deltaX"in T?T.deltaX:A[0]-N[0],R="deltaY"in T?T.deltaY:A[1]-N[1],D,O=T.target,M=Math.abs(k)>Math.abs(R)?"h":"v";if("touches"in T&&M==="h"&&O.type==="range")return!1;var I=window.getSelection(),H=I&&I.anchorNode,P=H?H===O||H.contains(O):!1;if(P)return!1;var K=Vk(M,O);if(!K)return!0;if(K?D=M:(D=M==="v"?"h":"v",K=Vk(M,O)),!K)return!1;if(!r.current&&"changedTouches"in T&&(k||R)&&(r.current=D),!D)return!0;var Y=r.current||D;return iQ(Y,w,T,Y==="h"?k:R)},[]),f=b.useCallback(function(T){var w=T;if(!(!hu.length||hu[hu.length-1]!==i)){var N="deltaY"in w?qk(w):qm(w),A=t.current.filter(function(D){return D.name===w.type&&(D.target===w.target||w.target===D.shadowParent)&&oQ(D.delta,N)})[0];if(A&&A.should){w.cancelable&&w.preventDefault();return}if(!A){var k=(l.current.shards||[]).map(Yk).filter(Boolean).filter(function(D){return D.contains(w.target)}),R=k.length>0?c(w,k[0]):!l.current.noIsolation;R&&w.cancelable&&w.preventDefault()}}},[]),d=b.useCallback(function(T,w,N,A){var k={name:T,delta:w,target:N,should:A,shadowParent:dQ(N)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(R){return R!==k})},1)},[]),p=b.useCallback(function(T){n.current=qm(T),r.current=void 0},[]),m=b.useCallback(function(T){d(T.type,qk(T),T.target,c(T,e.lockRef.current))},[]),x=b.useCallback(function(T){d(T.type,qm(T),T.target,c(T,e.lockRef.current))},[]);b.useEffect(function(){return hu.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:x}),document.addEventListener("wheel",f,fu),document.addEventListener("touchmove",f,fu),document.addEventListener("touchstart",p,fu),function(){hu=hu.filter(function(T){return T!==i}),document.removeEventListener("wheel",f,fu),document.removeEventListener("touchmove",f,fu),document.removeEventListener("touchstart",p,fu)}},[]);var y=e.removeScrollBar,v=e.inert;return b.createElement(b.Fragment,null,v?b.createElement(i,{styles:lQ(s)}):null,y?b.createElement(JK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dQ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fQ=zK(fD,cQ);var qf=b.forwardRef(function(e,t){return b.createElement(b0,aa({},e,{ref:t,sideCar:fQ}))});qf.classNames=b0.classNames;var hQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mu=new WeakMap,Ym=new WeakMap,Gm={},xy=0,xD=function(e){return e&&(e.host||xD(e.parentNode))},mQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},pQ=function(e,t,n,r){var s=mQ(t,Array.isArray(e)?e:[e]);Gm[n]||(Gm[n]=new WeakMap);var i=Gm[n],l=[],c=new Set,f=new Set(s),d=function(m){!m||c.has(m)||(c.add(m),d(m.parentNode))};s.forEach(d);var p=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(x){if(c.has(x))p(x);else try{var y=x.getAttribute(r),v=y!==null&&y!=="false",T=(mu.get(x)||0)+1,w=(i.get(x)||0)+1;mu.set(x,T),i.set(x,w),l.push(x),T===1&&v&&Ym.set(x,!0),w===1&&x.setAttribute(n,"true"),v||x.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return p(t),c.clear(),xy++,function(){l.forEach(function(m){var x=mu.get(m)-1,y=i.get(m)-1;mu.set(m,x),i.set(m,y),x||(Ym.has(m)||m.removeAttribute(r),Ym.delete(m)),y||m.removeAttribute(n)}),xy--,xy||(mu=new WeakMap,mu=new WeakMap,Ym=new WeakMap,Gm={})}},v0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=hQ(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),pQ(r,s,n,"aria-hidden")):function(){return null}},E0="Dialog",[yD,bD]=ns(E0),[gQ,Ys]=yD(E0),vD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,c=b.useRef(null),f=b.useRef(null),[d,p]=ga({prop:r,defaultProp:s??!1,onChange:i,caller:E0});return u.jsx(gQ,{scope:t,triggerRef:c,contentRef:f,contentId:nr(),titleId:nr(),descriptionId:nr(),open:d,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};vD.displayName=E0;var ED="DialogTrigger",TD=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(ED,n),i=At(t,s.triggerRef);return u.jsx(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sT(s.open),...r,ref:i,onClick:_e(e.onClick,s.onOpenToggle)})});TD.displayName=ED;var nT="DialogPortal",[xQ,SD]=yD(nT,{forceMount:void 0}),wD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Ys(nT,t);return u.jsx(xQ,{scope:t,forceMount:n,children:b.Children.map(r,l=>u.jsx(kr,{present:n||i.open,children:u.jsx(xl,{asChild:!0,container:s,children:l})}))})};wD.displayName=nT;var Vp="DialogOverlay",CD=b.forwardRef((e,t)=>{const n=SD(Vp,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ys(Vp,e.__scopeDialog);return i.modal?u.jsx(kr,{present:r||i.open,children:u.jsx(bQ,{...s,ref:t})}):null});CD.displayName=Vp;var yQ=to("DialogOverlay.RemoveScroll"),bQ=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(Vp,n);return u.jsx(qf,{as:yQ,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(rt.div,{"data-state":sT(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),il="DialogContent",ND=b.forwardRef((e,t)=>{const n=SD(il,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ys(il,e.__scopeDialog);return u.jsx(kr,{present:r||i.open,children:i.modal?u.jsx(vQ,{...s,ref:t}):u.jsx(EQ,{...s,ref:t})})});ND.displayName=il;var vQ=b.forwardRef((e,t)=>{const n=Ys(il,e.__scopeDialog),r=b.useRef(null),s=At(t,n.contentRef,r);return b.useEffect(()=>{const i=r.current;if(i)return v0(i)},[]),u.jsx(AD,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&i.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault())})}),EQ=b.forwardRef((e,t)=>{const n=Ys(il,e.__scopeDialog),r=b.useRef(!1),s=b.useRef(!1);return u.jsx(AD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),AD=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,c=Ys(il,n),f=b.useRef(null),d=At(t,f);return y0(),u.jsxs(u.Fragment,{children:[u.jsx(Vf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:u.jsx(gl,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":sT(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(SQ,{titleId:c.titleId}),u.jsx(CQ,{contentRef:f,descriptionId:c.descriptionId})]})]})}),rT="DialogTitle",kD=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(rT,n);return u.jsx(rt.h2,{id:s.titleId,...r,ref:t})});kD.displayName=rT;var _D="DialogDescription",RD=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(_D,n);return u.jsx(rt.p,{id:s.descriptionId,...r,ref:t})});RD.displayName=_D;var OD="DialogClose",DD=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(OD,n);return u.jsx(rt.button,{type:"button",...r,ref:t,onClick:_e(e.onClick,()=>s.onOpenChange(!1))})});DD.displayName=OD;function sT(e){return e?"open":"closed"}var jD="DialogTitleWarning",[TQ,MD]=JG(jD,{contentName:il,titleName:rT,docsSlug:"dialog"}),SQ=({titleId:e})=>{const t=MD(jD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
526
|
-
|
|
527
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
528
|
-
|
|
529
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},wQ="DialogDescriptionWarning",CQ=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MD(wQ).contentName}}.`;return b.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},T0=vD,aT=TD,S0=wD,Yf=CD,Gf=ND,w0=kD,C0=RD,iT=DD,ID="AlertDialog",[NQ]=ns(ID,[bD]),ii=bD(),LD=e=>{const{__scopeAlertDialog:t,...n}=e,r=ii(t);return u.jsx(T0,{...r,...n,modal:!0})};LD.displayName=ID;var AQ="AlertDialogTrigger",kQ=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=ii(n);return u.jsx(aT,{...s,...r,ref:t})});kQ.displayName=AQ;var _Q="AlertDialogPortal",PD=e=>{const{__scopeAlertDialog:t,...n}=e,r=ii(t);return u.jsx(S0,{...r,...n})};PD.displayName=_Q;var RQ="AlertDialogOverlay",BD=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=ii(n);return u.jsx(Yf,{...s,...r,ref:t})});BD.displayName=RQ;var Mu="AlertDialogContent",[OQ,DQ]=NQ(Mu),jQ=aD("AlertDialogContent"),FD=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=ii(n),l=b.useRef(null),c=At(t,l),f=b.useRef(null);return u.jsx(TQ,{contentName:Mu,titleName:zD,docsSlug:"alert-dialog",children:u.jsx(OQ,{scope:n,cancelRef:f,children:u.jsxs(Gf,{role:"alertdialog",...i,...s,ref:c,onOpenAutoFocus:_e(s.onOpenAutoFocus,d=>{var p;d.preventDefault(),(p=f.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[u.jsx(jQ,{children:r}),u.jsx(IQ,{contentRef:l})]})})})});FD.displayName=Mu;var zD="AlertDialogTitle",UD=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=ii(n);return u.jsx(w0,{...s,...r,ref:t})});UD.displayName=zD;var HD="AlertDialogDescription",$D=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=ii(n);return u.jsx(C0,{...s,...r,ref:t})});$D.displayName=HD;var MQ="AlertDialogAction",VD=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=ii(n);return u.jsx(iT,{...s,...r,ref:t})});VD.displayName=MQ;var qD="AlertDialogCancel",YD=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=DQ(qD,n),i=ii(n),l=At(t,s);return u.jsx(iT,{...i,...r,ref:l})});YD.displayName=qD;var IQ=({contentRef:e})=>{const t=`\`${Mu}\` requires a description for the component to be accessible for screen reader users.
|
|
530
|
-
|
|
531
|
-
You can add a description to the \`${Mu}\` by passing a \`${HD}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
532
|
-
|
|
533
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Mu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
534
|
-
|
|
535
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return b.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},LQ=LD,PQ=PD,GD=BD,KD=FD,QD=VD,XD=YD,WD=UD,ZD=$D;const Gk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kk=mE,JD=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Kk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(d=>{const p=n==null?void 0:n[d],m=i==null?void 0:i[d];if(p===null)return null;const x=Gk(p)||Gk(m);return s[d][x]}),c=n&&Object.entries(n).reduce((d,p)=>{let[m,x]=p;return x===void 0||(d[m]=x),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:m,className:x,...y}=p;return Object.entries(y).every(v=>{let[T,w]=v;return Array.isArray(w)?w.includes({...i,...c}[T]):{...i,...c}[T]===w})?[...d,m,x]:d},[]);return Kk(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)};var ej=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),BQ="VisuallyHidden",tj=b.forwardRef((e,t)=>u.jsx(rt.span,{...e,ref:t,style:{...ej,...e.style}}));tj.displayName=BQ;var FQ=tj;function oT(e){const t=e+"CollectionProvider",[n,r]=ns(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=T=>{const{scope:w,children:N}=T,A=oe.useRef(null),k=oe.useRef(new Map).current;return u.jsx(s,{scope:w,itemMap:k,collectionRef:A,children:N})};l.displayName=t;const c=e+"CollectionSlot",f=to(c),d=oe.forwardRef((T,w)=>{const{scope:N,children:A}=T,k=i(c,N),R=At(w,k.collectionRef);return u.jsx(f,{ref:R,children:A})});d.displayName=c;const p=e+"CollectionItemSlot",m="data-radix-collection-item",x=to(p),y=oe.forwardRef((T,w)=>{const{scope:N,children:A,...k}=T,R=oe.useRef(null),D=At(w,R),O=i(p,N);return oe.useEffect(()=>(O.itemMap.set(R,{ref:R,...k}),()=>void O.itemMap.delete(R))),u.jsx(x,{[m]:"",ref:D,children:A})});y.displayName=p;function v(T){const w=i(e+"CollectionConsumer",T);return oe.useCallback(()=>{const A=w.collectionRef.current;if(!A)return[];const k=Array.from(A.querySelectorAll(`[${m}]`));return Array.from(w.itemMap.values()).sort((O,M)=>k.indexOf(O.ref.current)-k.indexOf(M.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:d,ItemSlot:y},v,r]}var zQ=b.createContext(void 0);function N0(e){const t=b.useContext(zQ);return e||t||"ltr"}function nj(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function rj(e){const[t,n]=b.useState(void 0);return gr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let l,c;if("borderBoxSize"in i){const f=i.borderBoxSize,d=Array.isArray(f)?f[0]:f;l=d.inlineSize,c=d.blockSize}else l=e.offsetWidth,c=e.offsetHeight;n({width:l,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const UQ=["top","right","bottom","left"],no=Math.min,Jr=Math.max,qp=Math.round,Km=Math.floor,la=e=>({x:e,y:e}),HQ={left:"right",right:"left",bottom:"top",top:"bottom"},$Q={start:"end",end:"start"};function gv(e,t,n){return Jr(e,no(t,n))}function ni(e,t){return typeof e=="function"?e(t):e}function ri(e){return e.split("-")[0]}function hc(e){return e.split("-")[1]}function lT(e){return e==="x"?"y":"x"}function uT(e){return e==="y"?"height":"width"}const VQ=new Set(["top","bottom"]);function ia(e){return VQ.has(ri(e))?"y":"x"}function cT(e){return lT(ia(e))}function qQ(e,t,n){n===void 0&&(n=!1);const r=hc(e),s=cT(e),i=uT(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Yp(l)),[l,Yp(l)]}function YQ(e){const t=Yp(e);return[xv(e),t,xv(t)]}function xv(e){return e.replace(/start|end/g,t=>$Q[t])}const Qk=["left","right"],Xk=["right","left"],GQ=["top","bottom"],KQ=["bottom","top"];function QQ(e,t,n){switch(e){case"top":case"bottom":return n?t?Xk:Qk:t?Qk:Xk;case"left":case"right":return t?GQ:KQ;default:return[]}}function XQ(e,t,n,r){const s=hc(e);let i=QQ(ri(e),n==="start",r);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(xv)))),i}function Yp(e){return e.replace(/left|right|bottom|top/g,t=>HQ[t])}function WQ(e){return{top:0,right:0,bottom:0,left:0,...e}}function sj(e){return typeof e!="number"?WQ(e):{top:e,right:e,bottom:e,left:e}}function Gp(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Wk(e,t,n){let{reference:r,floating:s}=e;const i=ia(t),l=cT(t),c=uT(l),f=ri(t),d=i==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,x=r[c]/2-s[c]/2;let y;switch(f){case"top":y={x:p,y:r.y-s.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}switch(hc(t)){case"start":y[l]-=x*(n&&d?-1:1);break;case"end":y[l]+=x*(n&&d?-1:1);break}return y}async function ZQ(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:l,elements:c,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:x=!1,padding:y=0}=ni(t,e),v=sj(y),w=c[x?m==="floating"?"reference":"floating":m],N=Gp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:p,strategy:f})),A=m==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},D=Gp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:k,strategy:f}):A);return{top:(N.top-D.top+v.top)/R.y,bottom:(D.bottom-N.bottom+v.bottom)/R.y,left:(N.left-D.left+v.left)/R.x,right:(D.right-N.right+v.right)/R.x}}const JQ=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=Wk(d,r,f),x=r,y={},v=0;for(let w=0;w<c.length;w++){var T;const{name:N,fn:A}=c[w],{x:k,y:R,data:D,reset:O}=await A({x:p,y:m,initialPlacement:r,placement:x,strategy:s,middlewareData:y,rects:d,platform:{...l,detectOverflow:(T=l.detectOverflow)!=null?T:ZQ},elements:{reference:e,floating:t}});p=k??p,m=R??m,y={...y,[N]:{...y[N],...D}},O&&v<=50&&(v++,typeof O=="object"&&(O.placement&&(x=O.placement),O.rects&&(d=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x:p,y:m}=Wk(d,x,f)),w=-1)}return{x:p,y:m,placement:x,strategy:s,middlewareData:y}},eX=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:l,elements:c,middlewareData:f}=t,{element:d,padding:p=0}=ni(e,t)||{};if(d==null)return{};const m=sj(p),x={x:n,y:r},y=cT(s),v=uT(y),T=await l.getDimensions(d),w=y==="y",N=w?"top":"left",A=w?"bottom":"right",k=w?"clientHeight":"clientWidth",R=i.reference[v]+i.reference[y]-x[y]-i.floating[v],D=x[y]-i.reference[y],O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let M=O?O[k]:0;(!M||!await(l.isElement==null?void 0:l.isElement(O)))&&(M=c.floating[k]||i.floating[v]);const I=R/2-D/2,H=M/2-T[v]/2-1,P=no(m[N],H),K=no(m[A],H),Y=P,W=M-T[v]-K,te=M/2-T[v]/2+I,J=gv(Y,te,W),L=!f.arrow&&hc(s)!=null&&te!==J&&i.reference[v]/2-(te<Y?P:K)-T[v]/2<0,B=L?te<Y?te-Y:te-W:0;return{[y]:x[y]+B,data:{[y]:J,centerOffset:te-J-B,...L&&{alignmentOffset:B}},reset:L}}}),tX=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:l,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:x,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:T=!0,...w}=ni(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const N=ri(s),A=ia(c),k=ri(c)===c,R=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=x||(k||!T?[Yp(c)]:YQ(c)),O=v!=="none";!x&&O&&D.push(...XQ(c,T,v,R));const M=[c,...D],I=await f.detectOverflow(t,w),H=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&H.push(I[N]),m){const te=qQ(s,l,R);H.push(I[te[0]],I[te[1]])}if(P=[...P,{placement:s,overflows:H}],!H.every(te=>te<=0)){var K,Y;const te=(((K=i.flip)==null?void 0:K.index)||0)+1,J=M[te];if(J&&(!(m==="alignment"?A!==ia(J):!1)||P.every(U=>ia(U.placement)===A?U.overflows[0]>0:!0)))return{data:{index:te,overflows:P},reset:{placement:J}};let L=(Y=P.filter(B=>B.overflows[0]<=0).sort((B,U)=>B.overflows[1]-U.overflows[1])[0])==null?void 0:Y.placement;if(!L)switch(y){case"bestFit":{var W;const B=(W=P.filter(U=>{if(O){const ne=ia(U.placement);return ne===A||ne==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(ne=>ne>0).reduce((ne,z)=>ne+z,0)]).sort((U,ne)=>U[1]-ne[1])[0])==null?void 0:W[0];B&&(L=B);break}case"initialPlacement":L=c;break}if(s!==L)return{reset:{placement:L}}}return{}}}};function Zk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jk(e){return UQ.some(t=>e[t]>=0)}const nX=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...i}=ni(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=Zk(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Jk(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),c=Zk(l,n.floating);return{data:{escapedOffsets:c,escaped:Jk(c)}}}default:return{}}}}},aj=new Set(["left","top"]);async function rX(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=ri(n),c=hc(n),f=ia(n)==="y",d=aj.has(l)?-1:1,p=i&&f?-1:1,m=ni(t,e);let{mainAxis:x,crossAxis:y,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"&&(y=c==="end"?v*-1:v),f?{x:y*p,y:x*d}:{x:x*d,y:y*p}}const sX=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:l,middlewareData:c}=t,f=await rX(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+f.x,y:i+f.y,data:{...f,placement:l}}}}},aX=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:N=>{let{x:A,y:k}=N;return{x:A,y:k}}},...d}=ni(e,t),p={x:n,y:r},m=await i.detectOverflow(t,d),x=ia(ri(s)),y=lT(x);let v=p[y],T=p[x];if(l){const N=y==="y"?"top":"left",A=y==="y"?"bottom":"right",k=v+m[N],R=v-m[A];v=gv(k,v,R)}if(c){const N=x==="y"?"top":"left",A=x==="y"?"bottom":"right",k=T+m[N],R=T-m[A];T=gv(k,T,R)}const w=f.fn({...t,[y]:v,[x]:T});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[y]:l,[x]:c}}}}}},iX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:l}=t,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=ni(e,t),p={x:n,y:r},m=ia(s),x=lT(m);let y=p[x],v=p[m];const T=ni(c,t),w=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:0,crossAxis:0,...T};if(f){const k=x==="y"?"height":"width",R=i.reference[x]-i.floating[k]+w.mainAxis,D=i.reference[x]+i.reference[k]-w.mainAxis;y<R?y=R:y>D&&(y=D)}if(d){var N,A;const k=x==="y"?"width":"height",R=aj.has(ri(s)),D=i.reference[m]-i.floating[k]+(R&&((N=l.offset)==null?void 0:N[m])||0)+(R?0:w.crossAxis),O=i.reference[m]+i.reference[k]+(R?0:((A=l.offset)==null?void 0:A[m])||0)-(R?w.crossAxis:0);v<D?v=D:v>O&&(v=O)}return{[x]:y,[m]:v}}}},oX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:l,elements:c}=t,{apply:f=()=>{},...d}=ni(e,t),p=await l.detectOverflow(t,d),m=ri(s),x=hc(s),y=ia(s)==="y",{width:v,height:T}=i.floating;let w,N;m==="top"||m==="bottom"?(w=m,N=x===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(N=m,w=x==="end"?"top":"bottom");const A=T-p.top-p.bottom,k=v-p.left-p.right,R=no(T-p[w],A),D=no(v-p[N],k),O=!t.middlewareData.shift;let M=R,I=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=A),O&&!x){const P=Jr(p.left,0),K=Jr(p.right,0),Y=Jr(p.top,0),W=Jr(p.bottom,0);y?I=v-2*(P!==0||K!==0?P+K:Jr(p.left,p.right)):M=T-2*(Y!==0||W!==0?Y+W:Jr(p.top,p.bottom))}await f({...t,availableWidth:I,availableHeight:M});const H=await l.getDimensions(c.floating);return v!==H.width||T!==H.height?{reset:{rects:!0}}:{}}}};function A0(){return typeof window<"u"}function mc(e){return ij(e)?(e.nodeName||"").toLowerCase():"#document"}function es(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function va(e){var t;return(t=(ij(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ij(e){return A0()?e instanceof Node||e instanceof es(e).Node:!1}function Vs(e){return A0()?e instanceof Element||e instanceof es(e).Element:!1}function ya(e){return A0()?e instanceof HTMLElement||e instanceof es(e).HTMLElement:!1}function e3(e){return!A0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof es(e).ShadowRoot}const lX=new Set(["inline","contents"]);function Kf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=qs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!lX.has(s)}const uX=new Set(["table","td","th"]);function cX(e){return uX.has(mc(e))}const dX=[":popover-open",":modal"];function k0(e){return dX.some(t=>{try{return e.matches(t)}catch{return!1}})}const fX=["transform","translate","scale","rotate","perspective"],hX=["transform","translate","scale","rotate","perspective","filter"],mX=["paint","layout","strict","content"];function dT(e){const t=fT(),n=Vs(e)?qs(e):e;return fX.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||hX.some(r=>(n.willChange||"").includes(r))||mX.some(r=>(n.contain||"").includes(r))}function pX(e){let t=ro(e);for(;ya(t)&&!Zu(t);){if(dT(t))return t;if(k0(t))return null;t=ro(t)}return null}function fT(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gX=new Set(["html","body","#document"]);function Zu(e){return gX.has(mc(e))}function qs(e){return es(e).getComputedStyle(e)}function _0(e){return Vs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ro(e){if(mc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||e3(e)&&e.host||va(e);return e3(t)?t.host:t}function oj(e){const t=ro(e);return Zu(t)?e.ownerDocument?e.ownerDocument.body:e.body:ya(t)&&Kf(t)?t:oj(t)}function yf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=oj(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),l=es(s);if(i){const c=yv(l);return t.concat(l,l.visualViewport||[],Kf(s)?s:[],c&&n?yf(c):[])}return t.concat(s,yf(s,[],n))}function yv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lj(e){const t=qs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=ya(e),i=s?e.offsetWidth:n,l=s?e.offsetHeight:r,c=qp(n)!==i||qp(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function hT(e){return Vs(e)?e:e.contextElement}function Iu(e){const t=hT(e);if(!ya(t))return la(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=lj(t);let l=(i?qp(n.width):n.width)/r,c=(i?qp(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const xX=la(0);function uj(e){const t=es(e);return!fT()||!t.visualViewport?xX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yX(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==es(e)?!1:t}function ol(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=hT(e);let l=la(1);t&&(r?Vs(r)&&(l=Iu(r)):l=Iu(e));const c=yX(i,n,r)?uj(i):la(0);let f=(s.left+c.x)/l.x,d=(s.top+c.y)/l.y,p=s.width/l.x,m=s.height/l.y;if(i){const x=es(i),y=r&&Vs(r)?es(r):r;let v=x,T=yv(v);for(;T&&r&&y!==v;){const w=Iu(T),N=T.getBoundingClientRect(),A=qs(T),k=N.left+(T.clientLeft+parseFloat(A.paddingLeft))*w.x,R=N.top+(T.clientTop+parseFloat(A.paddingTop))*w.y;f*=w.x,d*=w.y,p*=w.x,m*=w.y,f+=k,d+=R,v=es(T),T=yv(v)}}return Gp({width:p,height:m,x:f,y:d})}function R0(e,t){const n=_0(e).scrollLeft;return t?t.left+n:ol(va(e)).left+n}function cj(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-R0(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function bX(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",l=va(r),c=t?k0(t.floating):!1;if(r===l||c&&i)return n;let f={scrollLeft:0,scrollTop:0},d=la(1);const p=la(0),m=ya(r);if((m||!m&&!i)&&((mc(r)!=="body"||Kf(l))&&(f=_0(r)),ya(r))){const y=ol(r);d=Iu(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const x=l&&!m&&!i?cj(l,f):la(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+p.x+x.x,y:n.y*d.y-f.scrollTop*d.y+p.y+x.y}}function vX(e){return Array.from(e.getClientRects())}function EX(e){const t=va(e),n=_0(e),r=e.ownerDocument.body,s=Jr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Jr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+R0(e);const c=-n.scrollTop;return qs(r).direction==="rtl"&&(l+=Jr(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:l,y:c}}const t3=25;function TX(e,t){const n=es(e),r=va(e),s=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,f=0;if(s){i=s.width,l=s.height;const p=fT();(!p||p&&t==="fixed")&&(c=s.offsetLeft,f=s.offsetTop)}const d=R0(r);if(d<=0){const p=r.ownerDocument,m=p.body,x=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,v=Math.abs(r.clientWidth-m.clientWidth-y);v<=t3&&(i-=v)}else d<=t3&&(i+=d);return{width:i,height:l,x:c,y:f}}const SX=new Set(["absolute","fixed"]);function wX(e,t){const n=ol(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=ya(e)?Iu(e):la(1),l=e.clientWidth*i.x,c=e.clientHeight*i.y,f=s*i.x,d=r*i.y;return{width:l,height:c,x:f,y:d}}function n3(e,t,n){let r;if(t==="viewport")r=TX(e,n);else if(t==="document")r=EX(va(e));else if(Vs(t))r=wX(t,n);else{const s=uj(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Gp(r)}function dj(e,t){const n=ro(e);return n===t||!Vs(n)||Zu(n)?!1:qs(n).position==="fixed"||dj(n,t)}function CX(e,t){const n=t.get(e);if(n)return n;let r=yf(e,[],!1).filter(c=>Vs(c)&&mc(c)!=="body"),s=null;const i=qs(e).position==="fixed";let l=i?ro(e):e;for(;Vs(l)&&!Zu(l);){const c=qs(l),f=dT(l);!f&&c.position==="fixed"&&(s=null),(i?!f&&!s:!f&&c.position==="static"&&!!s&&SX.has(s.position)||Kf(l)&&!f&&dj(e,l))?r=r.filter(p=>p!==l):s=c,l=ro(l)}return t.set(e,r),r}function NX(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?k0(t)?[]:CX(t,this._c):[].concat(n),r],c=l[0],f=l.reduce((d,p)=>{const m=n3(t,p,s);return d.top=Jr(m.top,d.top),d.right=no(m.right,d.right),d.bottom=no(m.bottom,d.bottom),d.left=Jr(m.left,d.left),d},n3(t,c,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function AX(e){const{width:t,height:n}=lj(e);return{width:t,height:n}}function kX(e,t,n){const r=ya(t),s=va(t),i=n==="fixed",l=ol(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const f=la(0);function d(){f.x=R0(s)}if(r||!r&&!i)if((mc(t)!=="body"||Kf(s))&&(c=_0(t)),r){const y=ol(t,!0,i,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else s&&d();i&&!r&&s&&d();const p=s&&!r&&!i?cj(s,c):la(0),m=l.left+c.scrollLeft-f.x-p.x,x=l.top+c.scrollTop-f.y-p.y;return{x:m,y:x,width:l.width,height:l.height}}function yy(e){return qs(e).position==="static"}function r3(e,t){if(!ya(e)||qs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return va(e)===n&&(n=n.ownerDocument.body),n}function fj(e,t){const n=es(e);if(k0(e))return n;if(!ya(e)){let s=ro(e);for(;s&&!Zu(s);){if(Vs(s)&&!yy(s))return s;s=ro(s)}return n}let r=r3(e,t);for(;r&&cX(r)&&yy(r);)r=r3(r,t);return r&&Zu(r)&&yy(r)&&!dT(r)?n:r||pX(e)||n}const _X=async function(e){const t=this.getOffsetParent||fj,n=this.getDimensions,r=await n(e.floating);return{reference:kX(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RX(e){return qs(e).direction==="rtl"}const OX={convertOffsetParentRelativeRectToViewportRelativeRect:bX,getDocumentElement:va,getClippingRect:NX,getOffsetParent:fj,getElementRects:_X,getClientRects:vX,getDimensions:AX,getScale:Iu,isElement:Vs,isRTL:RX};function hj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DX(e,t){let n=null,r;const s=va(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),i();const d=e.getBoundingClientRect(),{left:p,top:m,width:x,height:y}=d;if(c||t(),!x||!y)return;const v=Km(m),T=Km(s.clientWidth-(p+x)),w=Km(s.clientHeight-(m+y)),N=Km(p),k={rootMargin:-v+"px "+-T+"px "+-w+"px "+-N+"px",threshold:Jr(0,no(1,f))||1};let R=!0;function D(O){const M=O[0].intersectionRatio;if(M!==f){if(!R)return l();M?l(!1,M):r=setTimeout(()=>{l(!1,1e-7)},1e3)}M===1&&!hj(d,e.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(D,{...k,root:s.ownerDocument})}catch{n=new IntersectionObserver(D,k)}n.observe(e)}return l(!0),i}function jX(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=hT(e),p=s||i?[...d?yf(d):[],...yf(t)]:[];p.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),i&&N.addEventListener("resize",n)});const m=d&&c?DX(d,n):null;let x=-1,y=null;l&&(y=new ResizeObserver(N=>{let[A]=N;A&&A.target===d&&y&&(y.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var k;(k=y)==null||k.observe(t)})),n()}),d&&!f&&y.observe(d),y.observe(t));let v,T=f?ol(e):null;f&&w();function w(){const N=ol(e);T&&!hj(T,N)&&n(),T=N,v=requestAnimationFrame(w)}return n(),()=>{var N;p.forEach(A=>{s&&A.removeEventListener("scroll",n),i&&A.removeEventListener("resize",n)}),m==null||m(),(N=y)==null||N.disconnect(),y=null,f&&cancelAnimationFrame(v)}}const MX=sX,IX=aX,LX=tX,PX=oX,BX=nX,s3=eX,FX=iX,zX=(e,t,n)=>{const r=new Map,s={platform:OX,...n},i={...s.platform,_c:r};return JQ(e,t,{...s,platform:i})};var UX=typeof document<"u",HX=function(){},Tp=UX?b.useLayoutEffect:HX;function Kp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kp(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Kp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function mj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function a3(e,t){const n=mj(e);return Math.round(t*n)/n}function by(e){const t=b.useRef(e);return Tp(()=>{t.current=e}),t}function $X(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=e,[p,m]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,y]=b.useState(r);Kp(x,r)||y(r);const[v,T]=b.useState(null),[w,N]=b.useState(null),A=b.useCallback(U=>{U!==O.current&&(O.current=U,T(U))},[]),k=b.useCallback(U=>{U!==M.current&&(M.current=U,N(U))},[]),R=i||v,D=l||w,O=b.useRef(null),M=b.useRef(null),I=b.useRef(p),H=f!=null,P=by(f),K=by(s),Y=by(d),W=b.useCallback(()=>{if(!O.current||!M.current)return;const U={placement:t,strategy:n,middleware:x};K.current&&(U.platform=K.current),zX(O.current,M.current,U).then(ne=>{const z={...ne,isPositioned:Y.current!==!1};te.current&&!Kp(I.current,z)&&(I.current=z,ai.flushSync(()=>{m(z)}))})},[x,t,n,K,Y]);Tp(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(U=>({...U,isPositioned:!1})))},[d]);const te=b.useRef(!1);Tp(()=>(te.current=!0,()=>{te.current=!1}),[]),Tp(()=>{if(R&&(O.current=R),D&&(M.current=D),R&&D){if(P.current)return P.current(R,D,W);W()}},[R,D,W,P,H]);const J=b.useMemo(()=>({reference:O,floating:M,setReference:A,setFloating:k}),[A,k]),L=b.useMemo(()=>({reference:R,floating:D}),[R,D]),B=b.useMemo(()=>{const U={position:n,left:0,top:0};if(!L.floating)return U;const ne=a3(L.floating,p.x),z=a3(L.floating,p.y);return c?{...U,transform:"translate("+ne+"px, "+z+"px)",...mj(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:z}},[n,c,L.floating,p.x,p.y]);return b.useMemo(()=>({...p,update:W,refs:J,elements:L,floatingStyles:B}),[p,W,J,L,B])}const VX=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?s3({element:r.current,padding:s}).fn(n):{}:r?s3({element:r,padding:s}).fn(n):{}}}},qX=(e,t)=>({...MX(e),options:[e,t]}),YX=(e,t)=>({...IX(e),options:[e,t]}),GX=(e,t)=>({...FX(e),options:[e,t]}),KX=(e,t)=>({...LX(e),options:[e,t]}),QX=(e,t)=>({...PX(e),options:[e,t]}),XX=(e,t)=>({...BX(e),options:[e,t]}),WX=(e,t)=>({...VX(e),options:[e,t]});var ZX="Arrow",pj=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return u.jsx(rt.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});pj.displayName=ZX;var JX=pj,mT="Popper",[gj,Ea]=ns(mT),[eW,xj]=gj(mT),yj=e=>{const{__scopePopper:t,children:n}=e,[r,s]=b.useState(null);return u.jsx(eW,{scope:t,anchor:r,onAnchorChange:s,children:n})};yj.displayName=mT;var bj="PopperAnchor",vj=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=xj(bj,n),l=b.useRef(null),c=At(t,l),f=b.useRef(null);return b.useEffect(()=>{const d=f.current;f.current=(r==null?void 0:r.current)||l.current,d!==f.current&&i.onAnchorChange(f.current)}),r?null:u.jsx(rt.div,{...s,ref:c})});vj.displayName=bj;var pT="PopperContent",[tW,nW]=gj(pT),Ej=b.forwardRef((e,t)=>{var le,ye,ve,Re,ke,$e;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:x=!1,updatePositionStrategy:y="optimized",onPlaced:v,...T}=e,w=xj(pT,n),[N,A]=b.useState(null),k=At(t,Et=>A(Et)),[R,D]=b.useState(null),O=rj(R),M=(O==null?void 0:O.width)??0,I=(O==null?void 0:O.height)??0,H=r+(i!=="center"?"-"+i:""),P=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},K=Array.isArray(d)?d:[d],Y=K.length>0,W={padding:P,boundary:K.filter(sW),altBoundary:Y},{refs:te,floatingStyles:J,placement:L,isPositioned:B,middlewareData:U}=$X({strategy:"fixed",placement:H,whileElementsMounted:(...Et)=>jX(...Et,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[qX({mainAxis:s+I,alignmentAxis:l}),f&&YX({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?GX():void 0,...W}),f&&KX({...W}),QX({...W,apply:({elements:Et,rects:Oe,availableWidth:Xt,availableHeight:un})=>{const{width:tn,height:pt}=Oe.reference,Tt=Et.floating.style;Tt.setProperty("--radix-popper-available-width",`${Xt}px`),Tt.setProperty("--radix-popper-available-height",`${un}px`),Tt.setProperty("--radix-popper-anchor-width",`${tn}px`),Tt.setProperty("--radix-popper-anchor-height",`${pt}px`)}}),R&&WX({element:R,padding:c}),aW({arrowWidth:M,arrowHeight:I}),x&&XX({strategy:"referenceHidden",...W})]}),[ne,z]=wj(L),q=xa(v);gr(()=>{B&&(q==null||q())},[B,q]);const V=(le=U.arrow)==null?void 0:le.x,j=(ye=U.arrow)==null?void 0:ye.y,re=((ve=U.arrow)==null?void 0:ve.centerOffset)!==0,[ae,me]=b.useState();return gr(()=>{N&&me(window.getComputedStyle(N).zIndex)},[N]),u.jsx("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:B?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(Re=U.transformOrigin)==null?void 0:Re.x,(ke=U.transformOrigin)==null?void 0:ke.y].join(" "),...(($e=U.hide)==null?void 0:$e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(tW,{scope:n,placedSide:ne,onArrowChange:D,arrowX:V,arrowY:j,shouldHideArrow:re,children:u.jsx(rt.div,{"data-side":ne,"data-align":z,...T,ref:k,style:{...T.style,animation:B?void 0:"none"}})})})});Ej.displayName=pT;var Tj="PopperArrow",rW={top:"bottom",right:"left",bottom:"top",left:"right"},Sj=b.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=nW(Tj,r),l=rW[i.placedSide];return u.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:u.jsx(JX,{...s,ref:n,style:{...s.style,display:"block"}})})});Sj.displayName=Tj;function sW(e){return e!==null}var aW=e=>({name:"transformOrigin",options:e,fn(t){var w,N,A;const{placement:n,rects:r,middlewareData:s}=t,l=((w=s.arrow)==null?void 0:w.centerOffset)!==0,c=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[d,p]=wj(n),m={start:"0%",center:"50%",end:"100%"}[p],x=(((N=s.arrow)==null?void 0:N.x)??0)+c/2,y=(((A=s.arrow)==null?void 0:A.y)??0)+f/2;let v="",T="";return d==="bottom"?(v=l?m:`${x}px`,T=`${-f}px`):d==="top"?(v=l?m:`${x}px`,T=`${r.floating.height+f}px`):d==="right"?(v=`${-f}px`,T=l?m:`${y}px`):d==="left"&&(v=`${r.floating.width+f}px`,T=l?m:`${y}px`),{data:{x:v,y:T}}}});function wj(e){const[t,n="center"]=e.split("-");return[t,n]}var Qf=yj,pc=vj,Xf=Ej,Wf=Sj,vy="rovingFocusGroup.onEntryFocus",iW={bubbles:!1,cancelable:!0},Zf="RovingFocusGroup",[bv,Cj,oW]=oT(Zf),[lW,O0]=ns(Zf,[oW]),[uW,cW]=lW(Zf),Nj=b.forwardRef((e,t)=>u.jsx(bv.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(bv.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(dW,{...e,ref:t})})}));Nj.displayName=Zf;var dW=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,x=b.useRef(null),y=At(t,x),v=N0(i),[T,w]=ga({prop:l,defaultProp:c??null,onChange:f,caller:Zf}),[N,A]=b.useState(!1),k=xa(d),R=Cj(n),D=b.useRef(!1),[O,M]=b.useState(0);return b.useEffect(()=>{const I=x.current;if(I)return I.addEventListener(vy,k),()=>I.removeEventListener(vy,k)},[k]),u.jsx(uW,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:T,onItemFocus:b.useCallback(I=>w(I),[w]),onItemShiftTab:b.useCallback(()=>A(!0),[]),onFocusableItemAdd:b.useCallback(()=>M(I=>I+1),[]),onFocusableItemRemove:b.useCallback(()=>M(I=>I-1),[]),children:u.jsx(rt.div,{tabIndex:N||O===0?-1:0,"data-orientation":r,...m,ref:y,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{D.current=!0}),onFocus:_e(e.onFocus,I=>{const H=!D.current;if(I.target===I.currentTarget&&H&&!N){const P=new CustomEvent(vy,iW);if(I.currentTarget.dispatchEvent(P),!P.defaultPrevented){const K=R().filter(L=>L.focusable),Y=K.find(L=>L.active),W=K.find(L=>L.id===T),J=[Y,W,...K].filter(Boolean).map(L=>L.ref.current);_j(J,p)}}D.current=!1}),onBlur:_e(e.onBlur,()=>A(!1))})})}),Aj="RovingFocusGroupItem",kj=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:l,...c}=e,f=nr(),d=i||f,p=cW(Aj,n),m=p.currentTabStopId===d,x=Cj(n),{onFocusableItemAdd:y,onFocusableItemRemove:v,currentTabStopId:T}=p;return b.useEffect(()=>{if(r)return y(),()=>v()},[r,y,v]),u.jsx(bv.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:u.jsx(rt.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:_e(e.onMouseDown,w=>{r?p.onItemFocus(d):w.preventDefault()}),onFocus:_e(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:_e(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const N=mW(w,p.orientation,p.dir);if(N!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=x().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")k.reverse();else if(N==="prev"||N==="next"){N==="prev"&&k.reverse();const R=k.indexOf(w.currentTarget);k=p.loop?pW(k,R+1):k.slice(R+1)}setTimeout(()=>_j(k))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:T!=null}):l})})});kj.displayName=Aj;var fW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mW(e,t,n){const r=hW(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fW[r]}function _j(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function pW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Rj=Nj,Oj=kj,vv=["Enter"," "],gW=["ArrowDown","PageUp","Home"],Dj=["ArrowUp","PageDown","End"],xW=[...gW,...Dj],yW={ltr:[...vv,"ArrowRight"],rtl:[...vv,"ArrowLeft"]},bW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Jf="Menu",[bf,vW,EW]=oT(Jf),[yl,jj]=ns(Jf,[EW,Ea,O0]),D0=Ea(),Mj=O0(),[TW,bl]=yl(Jf),[SW,eh]=yl(Jf),Ij=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:l=!0}=e,c=D0(t),[f,d]=b.useState(null),p=b.useRef(!1),m=xa(i),x=N0(s);return b.useEffect(()=>{const y=()=>{p.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>p.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),u.jsx(Qf,{...c,children:u.jsx(TW,{scope:t,open:n,onOpenChange:m,content:f,onContentChange:d,children:u.jsx(SW,{scope:t,onClose:b.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:x,modal:l,children:r})})})};Ij.displayName=Jf;var wW="MenuAnchor",gT=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=D0(n);return u.jsx(pc,{...s,...r,ref:t})});gT.displayName=wW;var xT="MenuPortal",[CW,Lj]=yl(xT,{forceMount:void 0}),Pj=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=bl(xT,t);return u.jsx(CW,{scope:t,forceMount:n,children:u.jsx(kr,{present:n||i.open,children:u.jsx(xl,{asChild:!0,container:s,children:r})})})};Pj.displayName=xT;var Ts="MenuContent",[NW,yT]=yl(Ts),Bj=b.forwardRef((e,t)=>{const n=Lj(Ts,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=bl(Ts,e.__scopeMenu),l=eh(Ts,e.__scopeMenu);return u.jsx(bf.Provider,{scope:e.__scopeMenu,children:u.jsx(kr,{present:r||i.open,children:u.jsx(bf.Slot,{scope:e.__scopeMenu,children:l.modal?u.jsx(AW,{...s,ref:t}):u.jsx(kW,{...s,ref:t})})})})}),AW=b.forwardRef((e,t)=>{const n=bl(Ts,e.__scopeMenu),r=b.useRef(null),s=At(t,r);return b.useEffect(()=>{const i=r.current;if(i)return v0(i)},[]),u.jsx(bT,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kW=b.forwardRef((e,t)=>{const n=bl(Ts,e.__scopeMenu);return u.jsx(bT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),_W=to("MenuContent.ScrollLock"),bT=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:x,onDismiss:y,disableOutsideScroll:v,...T}=e,w=bl(Ts,n),N=eh(Ts,n),A=D0(n),k=Mj(n),R=vW(n),[D,O]=b.useState(null),M=b.useRef(null),I=At(t,M,w.onContentChange),H=b.useRef(0),P=b.useRef(""),K=b.useRef(0),Y=b.useRef(null),W=b.useRef("right"),te=b.useRef(0),J=v?qf:b.Fragment,L=v?{as:_W,allowPinchZoom:!0}:void 0,B=ne=>{var le,ye;const z=P.current+ne,q=R().filter(ve=>!ve.disabled),V=document.activeElement,j=(le=q.find(ve=>ve.ref.current===V))==null?void 0:le.textValue,re=q.map(ve=>ve.textValue),ae=UW(re,z,j),me=(ye=q.find(ve=>ve.textValue===ae))==null?void 0:ye.ref.current;(function ve(Re){P.current=Re,window.clearTimeout(H.current),Re!==""&&(H.current=window.setTimeout(()=>ve(""),1e3))})(z),me&&setTimeout(()=>me.focus())};b.useEffect(()=>()=>window.clearTimeout(H.current),[]),y0();const U=b.useCallback(ne=>{var q,V;return W.current===((q=Y.current)==null?void 0:q.side)&&$W(ne,(V=Y.current)==null?void 0:V.area)},[]);return u.jsx(NW,{scope:n,searchRef:P,onItemEnter:b.useCallback(ne=>{U(ne)&&ne.preventDefault()},[U]),onItemLeave:b.useCallback(ne=>{var z;U(ne)||((z=M.current)==null||z.focus(),O(null))},[U]),onTriggerLeave:b.useCallback(ne=>{U(ne)&&ne.preventDefault()},[U]),pointerGraceTimerRef:K,onPointerGraceIntentChange:b.useCallback(ne=>{Y.current=ne},[]),children:u.jsx(J,{...L,children:u.jsx(Vf,{asChild:!0,trapped:s,onMountAutoFocus:_e(i,ne=>{var z;ne.preventDefault(),(z=M.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:u.jsx(gl,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:x,onDismiss:y,children:u.jsx(Rj,{asChild:!0,...k,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:O,onEntryFocus:_e(f,ne=>{N.isUsingKeyboardRef.current||ne.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(Xf,{role:"menu","aria-orientation":"vertical","data-state":eM(w.open),"data-radix-menu-content":"",dir:N.dir,...A,...T,ref:I,style:{outline:"none",...T.style},onKeyDown:_e(T.onKeyDown,ne=>{const q=ne.target.closest("[data-radix-menu-content]")===ne.currentTarget,V=ne.ctrlKey||ne.altKey||ne.metaKey,j=ne.key.length===1;q&&(ne.key==="Tab"&&ne.preventDefault(),!V&&j&&B(ne.key));const re=M.current;if(ne.target!==re||!xW.includes(ne.key))return;ne.preventDefault();const me=R().filter(le=>!le.disabled).map(le=>le.ref.current);Dj.includes(ne.key)&&me.reverse(),FW(me)}),onBlur:_e(e.onBlur,ne=>{ne.currentTarget.contains(ne.target)||(window.clearTimeout(H.current),P.current="")}),onPointerMove:_e(e.onPointerMove,vf(ne=>{const z=ne.target,q=te.current!==ne.clientX;if(ne.currentTarget.contains(z)&&q){const V=ne.clientX>te.current?"right":"left";W.current=V,te.current=ne.clientX}}))})})})})})})});Bj.displayName=Ts;var RW="MenuGroup",vT=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(rt.div,{role:"group",...r,ref:t})});vT.displayName=RW;var OW="MenuLabel",Fj=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(rt.div,{...r,ref:t})});Fj.displayName=OW;var Qp="MenuItem",i3="menu.itemSelect",j0=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=b.useRef(null),l=eh(Qp,e.__scopeMenu),c=yT(Qp,e.__scopeMenu),f=At(t,i),d=b.useRef(!1),p=()=>{const m=i.current;if(!n&&m){const x=new CustomEvent(i3,{bubbles:!0,cancelable:!0});m.addEventListener(i3,y=>r==null?void 0:r(y),{once:!0}),iD(m,x),x.defaultPrevented?d.current=!1:l.onClose()}};return u.jsx(zj,{...s,ref:f,disabled:n,onClick:_e(e.onClick,p),onPointerDown:m=>{var x;(x=e.onPointerDown)==null||x.call(e,m),d.current=!0},onPointerUp:_e(e.onPointerUp,m=>{var x;d.current||(x=m.currentTarget)==null||x.click()}),onKeyDown:_e(e.onKeyDown,m=>{const x=c.searchRef.current!=="";n||x&&m.key===" "||vv.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});j0.displayName=Qp;var zj=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,l=yT(Qp,n),c=Mj(n),f=b.useRef(null),d=At(t,f),[p,m]=b.useState(!1),[x,y]=b.useState("");return b.useEffect(()=>{const v=f.current;v&&y((v.textContent??"").trim())},[i.children]),u.jsx(bf.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:u.jsx(Oj,{asChild:!0,...c,focusable:!r,children:u.jsx(rt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:_e(e.onPointerMove,vf(v=>{r?l.onItemLeave(v):(l.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_e(e.onPointerLeave,vf(v=>l.onItemLeave(v))),onFocus:_e(e.onFocus,()=>m(!0)),onBlur:_e(e.onBlur,()=>m(!1))})})})}),DW="MenuCheckboxItem",Uj=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return u.jsx(Yj,{scope:e.__scopeMenu,checked:n,children:u.jsx(j0,{role:"menuitemcheckbox","aria-checked":Xp(n)?"mixed":n,...s,ref:t,"data-state":TT(n),onSelect:_e(s.onSelect,()=>r==null?void 0:r(Xp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Uj.displayName=DW;var Hj="MenuRadioGroup",[jW,MW]=yl(Hj,{value:void 0,onValueChange:()=>{}}),$j=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=xa(r);return u.jsx(jW,{scope:e.__scopeMenu,value:n,onValueChange:i,children:u.jsx(vT,{...s,ref:t})})});$j.displayName=Hj;var Vj="MenuRadioItem",qj=b.forwardRef((e,t)=>{const{value:n,...r}=e,s=MW(Vj,e.__scopeMenu),i=n===s.value;return u.jsx(Yj,{scope:e.__scopeMenu,checked:i,children:u.jsx(j0,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":TT(i),onSelect:_e(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});qj.displayName=Vj;var ET="MenuItemIndicator",[Yj,IW]=yl(ET,{checked:!1}),Gj=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=IW(ET,n);return u.jsx(kr,{present:r||Xp(i.checked)||i.checked===!0,children:u.jsx(rt.span,{...s,ref:t,"data-state":TT(i.checked)})})});Gj.displayName=ET;var LW="MenuSeparator",Kj=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(rt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Kj.displayName=LW;var PW="MenuArrow",Qj=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=D0(n);return u.jsx(Wf,{...s,...r,ref:t})});Qj.displayName=PW;var BW="MenuSub",[Eye,Xj]=yl(BW),Fd="MenuSubTrigger",Wj=b.forwardRef((e,t)=>{const n=bl(Fd,e.__scopeMenu),r=eh(Fd,e.__scopeMenu),s=Xj(Fd,e.__scopeMenu),i=yT(Fd,e.__scopeMenu),l=b.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=i,d={__scopeMenu:e.__scopeMenu},p=b.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return b.useEffect(()=>p,[p]),b.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),f(null)}},[c,f]),u.jsx(gT,{asChild:!0,...d,children:u.jsx(zj,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":eM(n.open),...e,ref:pa(t,s.onTriggerChange),onClick:m=>{var x;(x=e.onClick)==null||x.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:_e(e.onPointerMove,vf(m=>{i.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:_e(e.onPointerLeave,vf(m=>{var y,v;p();const x=(y=n.content)==null?void 0:y.getBoundingClientRect();if(x){const T=(v=n.content)==null?void 0:v.dataset.side,w=T==="right",N=w?-5:5,A=x[w?"left":"right"],k=x[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+N,y:m.clientY},{x:A,y:x.top},{x:k,y:x.top},{x:k,y:x.bottom},{x:A,y:x.bottom}],side:T}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:_e(e.onKeyDown,m=>{var y;const x=i.searchRef.current!=="";e.disabled||x&&m.key===" "||yW[r.dir].includes(m.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),m.preventDefault())})})})});Wj.displayName=Fd;var Zj="MenuSubContent",Jj=b.forwardRef((e,t)=>{const n=Lj(Ts,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=bl(Ts,e.__scopeMenu),l=eh(Ts,e.__scopeMenu),c=Xj(Zj,e.__scopeMenu),f=b.useRef(null),d=At(t,f);return u.jsx(bf.Provider,{scope:e.__scopeMenu,children:u.jsx(kr,{present:r||i.open,children:u.jsx(bf.Slot,{scope:e.__scopeMenu,children:u.jsx(bT,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var m;l.isUsingKeyboardRef.current&&((m=f.current)==null||m.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:_e(e.onFocusOutside,p=>{p.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:_e(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:_e(e.onKeyDown,p=>{var y;const m=p.currentTarget.contains(p.target),x=bW[l.dir].includes(p.key);m&&x&&(i.onOpenChange(!1),(y=c.trigger)==null||y.focus(),p.preventDefault())})})})})})});Jj.displayName=Zj;function eM(e){return e?"open":"closed"}function Xp(e){return e==="indeterminate"}function TT(e){return Xp(e)?"indeterminate":e?"checked":"unchecked"}function FW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function zW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function UW(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=zW(e,Math.max(i,0));s.length===1&&(l=l.filter(d=>d!==n));const f=l.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function HW(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const c=t[i],f=t[l],d=c.x,p=c.y,m=f.x,x=f.y;p>r!=x>r&&n<(m-d)*(r-p)/(x-p)+d&&(s=!s)}return s}function $W(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return HW(n,t)}function vf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var VW=Ij,qW=gT,YW=Pj,GW=Bj,KW=vT,QW=Fj,XW=j0,WW=Uj,ZW=$j,JW=qj,eZ=Gj,tZ=Kj,nZ=Qj,rZ=Wj,sZ=Jj,M0="DropdownMenu",[aZ]=ns(M0,[jj]),_r=jj(),[iZ,tM]=aZ(M0),nM=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,f=_r(t),d=b.useRef(null),[p,m]=ga({prop:s,defaultProp:i??!1,onChange:l,caller:M0});return u.jsx(iZ,{scope:t,triggerId:nr(),triggerRef:d,contentId:nr(),open:p,onOpenChange:m,onOpenToggle:b.useCallback(()=>m(x=>!x),[m]),modal:c,children:u.jsx(VW,{...f,open:p,onOpenChange:m,dir:r,modal:c,children:n})})};nM.displayName=M0;var rM="DropdownMenuTrigger",sM=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=tM(rM,n),l=_r(n);return u.jsx(qW,{asChild:!0,...l,children:u.jsx(rt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:pa(t,i.triggerRef),onPointerDown:_e(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:_e(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});sM.displayName=rM;var oZ="DropdownMenuPortal",aM=e=>{const{__scopeDropdownMenu:t,...n}=e,r=_r(t);return u.jsx(YW,{...r,...n})};aM.displayName=oZ;var iM="DropdownMenuContent",oM=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=tM(iM,n),i=_r(n),l=b.useRef(!1);return u.jsx(GW,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,c=>{var f;l.current||(f=s.triggerRef.current)==null||f.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,c=>{const f=c.detail.originalEvent,d=f.button===0&&f.ctrlKey===!0,p=f.button===2||d;(!s.modal||p)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});oM.displayName=iM;var lZ="DropdownMenuGroup",uZ=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(KW,{...s,...r,ref:t})});uZ.displayName=lZ;var cZ="DropdownMenuLabel",lM=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(QW,{...s,...r,ref:t})});lM.displayName=cZ;var dZ="DropdownMenuItem",uM=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(XW,{...s,...r,ref:t})});uM.displayName=dZ;var fZ="DropdownMenuCheckboxItem",hZ=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(WW,{...s,...r,ref:t})});hZ.displayName=fZ;var mZ="DropdownMenuRadioGroup",cM=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(ZW,{...s,...r,ref:t})});cM.displayName=mZ;var pZ="DropdownMenuRadioItem",dM=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(JW,{...s,...r,ref:t})});dM.displayName=pZ;var gZ="DropdownMenuItemIndicator",fM=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(eZ,{...s,...r,ref:t})});fM.displayName=gZ;var xZ="DropdownMenuSeparator",hM=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(tZ,{...s,...r,ref:t})});hM.displayName=xZ;var yZ="DropdownMenuArrow",bZ=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(nZ,{...s,...r,ref:t})});bZ.displayName=yZ;var vZ="DropdownMenuSubTrigger",EZ=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(rZ,{...s,...r,ref:t})});EZ.displayName=vZ;var TZ="DropdownMenuSubContent",SZ=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_r(n);return u.jsx(sZ,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});SZ.displayName=TZ;var wZ=nM,CZ=sM,NZ=aM,mM=oM,pM=lM,gM=uM,AZ=cM,xM=dM,kZ=fM,yM=hM,Ey,I0="HoverCard",[bM]=ns(I0,[Ea]),L0=Ea(),[_Z,P0]=bM(I0),vM=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:i,openDelay:l=700,closeDelay:c=300}=e,f=L0(t),d=b.useRef(0),p=b.useRef(0),m=b.useRef(!1),x=b.useRef(!1),[y,v]=ga({prop:r,defaultProp:s??!1,onChange:i,caller:I0}),T=b.useCallback(()=>{clearTimeout(p.current),d.current=window.setTimeout(()=>v(!0),l)},[l,v]),w=b.useCallback(()=>{clearTimeout(d.current),!m.current&&!x.current&&(p.current=window.setTimeout(()=>v(!1),c))},[c,v]),N=b.useCallback(()=>v(!1),[v]);return b.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(p.current)},[]),u.jsx(_Z,{scope:t,open:y,onOpenChange:v,onOpen:T,onClose:w,onDismiss:N,hasSelectionRef:m,isPointerDownOnContentRef:x,children:u.jsx(Qf,{...f,children:n})})};vM.displayName=I0;var EM="HoverCardTrigger",TM=b.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=P0(EM,n),i=L0(n);return u.jsx(pc,{asChild:!0,...i,children:u.jsx(rt.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:_e(e.onPointerEnter,Zp(s.onOpen)),onPointerLeave:_e(e.onPointerLeave,Zp(s.onClose)),onFocus:_e(e.onFocus,s.onOpen),onBlur:_e(e.onBlur,s.onClose),onTouchStart:_e(e.onTouchStart,l=>l.preventDefault())})})});TM.displayName=EM;var ST="HoverCardPortal",[RZ,OZ]=bM(ST,{forceMount:void 0}),SM=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,i=P0(ST,t);return u.jsx(RZ,{scope:t,forceMount:n,children:u.jsx(kr,{present:n||i.open,children:u.jsx(xl,{asChild:!0,container:s,children:r})})})};SM.displayName=ST;var Wp="HoverCardContent",wM=b.forwardRef((e,t)=>{const n=OZ(Wp,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=P0(Wp,e.__scopeHoverCard);return u.jsx(kr,{present:r||i.open,children:u.jsx(DZ,{"data-state":i.open?"open":"closed",...s,onPointerEnter:_e(e.onPointerEnter,Zp(i.onOpen)),onPointerLeave:_e(e.onPointerLeave,Zp(i.onClose)),ref:t})})});wM.displayName=Wp;var DZ=b.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,...c}=e,f=P0(Wp,n),d=L0(n),p=b.useRef(null),m=At(t,p),[x,y]=b.useState(!1);return b.useEffect(()=>{if(x){const v=document.body;return Ey=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Ey,v.style.webkitUserSelect=Ey}}},[x]),b.useEffect(()=>{if(p.current){const v=()=>{y(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var w;((w=document.getSelection())==null?void 0:w.toString())!==""&&(f.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),b.useEffect(()=>{p.current&&IZ(p.current).forEach(T=>T.setAttribute("tabindex","-1"))}),u.jsx(gl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:_e(i,v=>{v.preventDefault()}),onDismiss:f.onDismiss,children:u.jsx(Xf,{...d,...c,onPointerDown:_e(c.onPointerDown,v=>{v.currentTarget.contains(v.target)&&y(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:m,style:{...c.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),jZ="HoverCardArrow",MZ=b.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=L0(n);return u.jsx(Wf,{...s,...r,ref:t})});MZ.displayName=jZ;function Zp(e){return t=>t.pointerType==="touch"?void 0:e()}function IZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var LZ=vM,PZ=TM,BZ=SM,FZ=wM;function o3(e,[t,n]){return Math.min(n,Math.max(t,e))}var B0="Popover",[CM]=ns(B0,[Ea]),th=Ea(),[zZ,uo]=CM(B0),NM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,c=th(t),f=b.useRef(null),[d,p]=b.useState(!1),[m,x]=ga({prop:r,defaultProp:s??!1,onChange:i,caller:B0});return u.jsx(Qf,{...c,children:u.jsx(zZ,{scope:t,contentId:nr(),triggerRef:f,open:m,onOpenChange:x,onOpenToggle:b.useCallback(()=>x(y=>!y),[x]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>p(!0),[]),onCustomAnchorRemove:b.useCallback(()=>p(!1),[]),modal:l,children:n})})};NM.displayName=B0;var AM="PopoverAnchor",UZ=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=uo(AM,n),i=th(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return b.useEffect(()=>(l(),()=>c()),[l,c]),u.jsx(pc,{...i,...r,ref:t})});UZ.displayName=AM;var kM="PopoverTrigger",_M=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=uo(kM,n),i=th(n),l=At(t,s.triggerRef),c=u.jsx(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":MM(s.open),...r,ref:l,onClick:_e(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:u.jsx(pc,{asChild:!0,...i,children:c})});_M.displayName=kM;var wT="PopoverPortal",[HZ,$Z]=CM(wT,{forceMount:void 0}),RM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=uo(wT,t);return u.jsx(HZ,{scope:t,forceMount:n,children:u.jsx(kr,{present:n||i.open,children:u.jsx(xl,{asChild:!0,container:s,children:r})})})};RM.displayName=wT;var Ju="PopoverContent",OM=b.forwardRef((e,t)=>{const n=$Z(Ju,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=uo(Ju,e.__scopePopover);return u.jsx(kr,{present:r||i.open,children:i.modal?u.jsx(qZ,{...s,ref:t}):u.jsx(YZ,{...s,ref:t})})});OM.displayName=Ju;var VZ=to("PopoverContent.RemoveScroll"),qZ=b.forwardRef((e,t)=>{const n=uo(Ju,e.__scopePopover),r=b.useRef(null),s=At(t,r),i=b.useRef(!1);return b.useEffect(()=>{const l=r.current;if(l)return v0(l)},[]),u.jsx(qf,{as:VZ,allowPinchZoom:!0,children:u.jsx(DM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),i.current||(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,d=c.button===2||f;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:_e(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),YZ=b.forwardRef((e,t)=>{const n=uo(Ju,e.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return u.jsx(DM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),DM=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,...m}=e,x=uo(Ju,n),y=th(n);return y0(),u.jsx(Vf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:u.jsx(gl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>x.onOpenChange(!1),children:u.jsx(Xf,{"data-state":MM(x.open),role:"dialog",id:x.contentId,...y,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),jM="PopoverClose",GZ=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=uo(jM,n);return u.jsx(rt.button,{type:"button",...r,ref:t,onClick:_e(e.onClick,()=>s.onOpenChange(!1))})});GZ.displayName=jM;var KZ="PopoverArrow",QZ=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=th(n);return u.jsx(Wf,{...s,...r,ref:t})});QZ.displayName=KZ;function MM(e){return e?"open":"closed"}var XZ=NM,WZ=_M,ZZ=RM,JZ=OM,eJ=[" ","Enter","ArrowUp","ArrowDown"],tJ=[" ","Enter"],ll="Select",[F0,z0,nJ]=oT(ll),[gc]=ns(ll,[nJ,Ea]),U0=Ea(),[rJ,co]=gc(ll),[sJ,aJ]=gc(ll),IM=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:l,defaultValue:c,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:x,required:y,form:v}=e,T=U0(t),[w,N]=b.useState(null),[A,k]=b.useState(null),[R,D]=b.useState(!1),O=N0(d),[M,I]=ga({prop:r,defaultProp:s??!1,onChange:i,caller:ll}),[H,P]=ga({prop:l,defaultProp:c,onChange:f,caller:ll}),K=b.useRef(null),Y=w?v||!!w.closest("form"):!0,[W,te]=b.useState(new Set),J=Array.from(W).map(L=>L.props.value).join(";");return u.jsx(Qf,{...T,children:u.jsxs(rJ,{required:y,scope:t,trigger:w,onTriggerChange:N,valueNode:A,onValueNodeChange:k,valueNodeHasChildren:R,onValueNodeHasChildrenChange:D,contentId:nr(),value:H,onValueChange:P,open:M,onOpenChange:I,dir:O,triggerPointerDownPosRef:K,disabled:x,children:[u.jsx(F0.Provider,{scope:t,children:u.jsx(sJ,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(L=>{te(B=>new Set(B).add(L))},[]),onNativeOptionRemove:b.useCallback(L=>{te(B=>{const U=new Set(B);return U.delete(L),U})},[]),children:n})}),Y?u.jsxs(t6,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:m,value:H,onChange:L=>P(L.target.value),disabled:x,form:v,children:[H===void 0?u.jsx("option",{value:""}):null,Array.from(W)]},J):null]})})};IM.displayName=ll;var LM="SelectTrigger",PM=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=U0(n),l=co(LM,n),c=l.disabled||r,f=At(t,l.onTriggerChange),d=z0(n),p=b.useRef("touch"),[m,x,y]=r6(T=>{const w=d().filter(k=>!k.disabled),N=w.find(k=>k.value===l.value),A=s6(w,T,N);A!==void 0&&l.onValueChange(A.value)}),v=T=>{c||(l.onOpenChange(!0),y()),T&&(l.triggerPointerDownPosRef.current={x:Math.round(T.pageX),y:Math.round(T.pageY)})};return u.jsx(pc,{asChild:!0,...i,children:u.jsx(rt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":n6(l.value)?"":void 0,...s,ref:f,onClick:_e(s.onClick,T=>{T.currentTarget.focus(),p.current!=="mouse"&&v(T)}),onPointerDown:_e(s.onPointerDown,T=>{p.current=T.pointerType;const w=T.target;w.hasPointerCapture(T.pointerId)&&w.releasePointerCapture(T.pointerId),T.button===0&&T.ctrlKey===!1&&T.pointerType==="mouse"&&(v(T),T.preventDefault())}),onKeyDown:_e(s.onKeyDown,T=>{const w=m.current!=="";!(T.ctrlKey||T.altKey||T.metaKey)&&T.key.length===1&&x(T.key),!(w&&T.key===" ")&&eJ.includes(T.key)&&(v(),T.preventDefault())})})})});PM.displayName=LM;var BM="SelectValue",FM=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:l="",...c}=e,f=co(BM,n),{onValueNodeHasChildrenChange:d}=f,p=i!==void 0,m=At(t,f.onValueNodeChange);return gr(()=>{d(p)},[d,p]),u.jsx(rt.span,{...c,ref:m,style:{pointerEvents:"none"},children:n6(f.value)?u.jsx(u.Fragment,{children:l}):i})});FM.displayName=BM;var iJ="SelectIcon",zM=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return u.jsx(rt.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});zM.displayName=iJ;var oJ="SelectPortal",UM=e=>u.jsx(xl,{asChild:!0,...e});UM.displayName=oJ;var ul="SelectContent",HM=b.forwardRef((e,t)=>{const n=co(ul,e.__scopeSelect),[r,s]=b.useState();if(gr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?ai.createPortal(u.jsx($M,{scope:e.__scopeSelect,children:u.jsx(F0.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),i):null}return u.jsx(VM,{...e,ref:t})});HM.displayName=ul;var Is=10,[$M,fo]=gc(ul),lJ="SelectContentImpl",uJ=to("SelectContent.RemoveScroll"),VM=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:x,collisionPadding:y,sticky:v,hideWhenDetached:T,avoidCollisions:w,...N}=e,A=co(ul,n),[k,R]=b.useState(null),[D,O]=b.useState(null),M=At(t,le=>R(le)),[I,H]=b.useState(null),[P,K]=b.useState(null),Y=z0(n),[W,te]=b.useState(!1),J=b.useRef(!1);b.useEffect(()=>{if(k)return v0(k)},[k]),y0();const L=b.useCallback(le=>{const[ye,...ve]=Y().map($e=>$e.ref.current),[Re]=ve.slice(-1),ke=document.activeElement;for(const $e of le)if($e===ke||($e==null||$e.scrollIntoView({block:"nearest"}),$e===ye&&D&&(D.scrollTop=0),$e===Re&&D&&(D.scrollTop=D.scrollHeight),$e==null||$e.focus(),document.activeElement!==ke))return},[Y,D]),B=b.useCallback(()=>L([I,k]),[L,I,k]);b.useEffect(()=>{W&&B()},[W,B]);const{onOpenChange:U,triggerPointerDownPosRef:ne}=A;b.useEffect(()=>{if(k){let le={x:0,y:0};const ye=Re=>{var ke,$e;le={x:Math.abs(Math.round(Re.pageX)-(((ke=ne.current)==null?void 0:ke.x)??0)),y:Math.abs(Math.round(Re.pageY)-((($e=ne.current)==null?void 0:$e.y)??0))}},ve=Re=>{le.x<=10&&le.y<=10?Re.preventDefault():k.contains(Re.target)||U(!1),document.removeEventListener("pointermove",ye),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ve,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ve,{capture:!0})}}},[k,U,ne]),b.useEffect(()=>{const le=()=>U(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[U]);const[z,q]=r6(le=>{const ye=Y().filter(ke=>!ke.disabled),ve=ye.find(ke=>ke.ref.current===document.activeElement),Re=s6(ye,le,ve);Re&&setTimeout(()=>Re.ref.current.focus())}),V=b.useCallback((le,ye,ve)=>{const Re=!J.current&&!ve;(A.value!==void 0&&A.value===ye||Re)&&(H(le),Re&&(J.current=!0))},[A.value]),j=b.useCallback(()=>k==null?void 0:k.focus(),[k]),re=b.useCallback((le,ye,ve)=>{const Re=!J.current&&!ve;(A.value!==void 0&&A.value===ye||Re)&&K(le)},[A.value]),ae=r==="popper"?Ev:qM,me=ae===Ev?{side:c,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:x,collisionPadding:y,sticky:v,hideWhenDetached:T,avoidCollisions:w}:{};return u.jsx($M,{scope:n,content:k,viewport:D,onViewportChange:O,itemRefCallback:V,selectedItem:I,onItemLeave:j,itemTextRefCallback:re,focusSelectedItem:B,selectedItemText:P,position:r,isPositioned:W,searchRef:z,children:u.jsx(qf,{as:uJ,allowPinchZoom:!0,children:u.jsx(Vf,{asChild:!0,trapped:A.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:_e(s,le=>{var ye;(ye=A.trigger)==null||ye.focus({preventScroll:!0}),le.preventDefault()}),children:u.jsx(gl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:u.jsx(ae,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:le=>le.preventDefault(),...N,...me,onPlaced:()=>te(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:_e(N.onKeyDown,le=>{const ye=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!ye&&le.key.length===1&&q(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let Re=Y().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(le.key)&&(Re=Re.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const ke=le.target,$e=Re.indexOf(ke);Re=Re.slice($e+1)}setTimeout(()=>L(Re)),le.preventDefault()}})})})})})})});VM.displayName=lJ;var cJ="SelectItemAlignedPosition",qM=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=co(ul,n),l=fo(ul,n),[c,f]=b.useState(null),[d,p]=b.useState(null),m=At(t,M=>p(M)),x=z0(n),y=b.useRef(!1),v=b.useRef(!0),{viewport:T,selectedItem:w,selectedItemText:N,focusSelectedItem:A}=l,k=b.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&T&&w&&N){const M=i.trigger.getBoundingClientRect(),I=d.getBoundingClientRect(),H=i.valueNode.getBoundingClientRect(),P=N.getBoundingClientRect();if(i.dir!=="rtl"){const ke=P.left-I.left,$e=H.left-ke,Et=M.left-$e,Oe=M.width+Et,Xt=Math.max(Oe,I.width),un=window.innerWidth-Is,tn=o3($e,[Is,Math.max(Is,un-Xt)]);c.style.minWidth=Oe+"px",c.style.left=tn+"px"}else{const ke=I.right-P.right,$e=window.innerWidth-H.right-ke,Et=window.innerWidth-M.right-$e,Oe=M.width+Et,Xt=Math.max(Oe,I.width),un=window.innerWidth-Is,tn=o3($e,[Is,Math.max(Is,un-Xt)]);c.style.minWidth=Oe+"px",c.style.right=tn+"px"}const K=x(),Y=window.innerHeight-Is*2,W=T.scrollHeight,te=window.getComputedStyle(d),J=parseInt(te.borderTopWidth,10),L=parseInt(te.paddingTop,10),B=parseInt(te.borderBottomWidth,10),U=parseInt(te.paddingBottom,10),ne=J+L+W+U+B,z=Math.min(w.offsetHeight*5,ne),q=window.getComputedStyle(T),V=parseInt(q.paddingTop,10),j=parseInt(q.paddingBottom,10),re=M.top+M.height/2-Is,ae=Y-re,me=w.offsetHeight/2,le=w.offsetTop+me,ye=J+L+le,ve=ne-ye;if(ye<=re){const ke=K.length>0&&w===K[K.length-1].ref.current;c.style.bottom="0px";const $e=d.clientHeight-T.offsetTop-T.offsetHeight,Et=Math.max(ae,me+(ke?j:0)+$e+B),Oe=ye+Et;c.style.height=Oe+"px"}else{const ke=K.length>0&&w===K[0].ref.current;c.style.top="0px";const Et=Math.max(re,J+T.offsetTop+(ke?V:0)+me)+ve;c.style.height=Et+"px",T.scrollTop=ye-re+T.offsetTop}c.style.margin=`${Is}px 0`,c.style.minHeight=z+"px",c.style.maxHeight=Y+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[x,i.trigger,i.valueNode,c,d,T,w,N,i.dir,r]);gr(()=>k(),[k]);const[R,D]=b.useState();gr(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const O=b.useCallback(M=>{M&&v.current===!0&&(k(),A==null||A(),v.current=!1)},[k,A]);return u.jsx(fJ,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:O,children:u.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:u.jsx(rt.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});qM.displayName=cJ;var dJ="SelectPopperPosition",Ev=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Is,...i}=e,l=U0(n);return u.jsx(Xf,{...l,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ev.displayName=dJ;var[fJ,CT]=gc(ul,{}),Tv="SelectViewport",YM=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=fo(Tv,n),l=CT(Tv,n),c=At(t,i.onViewportChange),f=b.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(F0.Slot,{scope:n,children:u.jsx(rt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:_e(s.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:x}=l;if(x!=null&&x.current&&m){const y=Math.abs(f.current-p.scrollTop);if(y>0){const v=window.innerHeight-Is*2,T=parseFloat(m.style.minHeight),w=parseFloat(m.style.height),N=Math.max(T,w);if(N<v){const A=N+y,k=Math.min(v,A),R=A-k;m.style.height=k+"px",m.style.bottom==="0px"&&(p.scrollTop=R>0?R:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});YM.displayName=Tv;var GM="SelectGroup",[hJ,mJ]=gc(GM),pJ=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=nr();return u.jsx(hJ,{scope:n,id:s,children:u.jsx(rt.div,{role:"group","aria-labelledby":s,...r,ref:t})})});pJ.displayName=GM;var KM="SelectLabel",gJ=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=mJ(KM,n);return u.jsx(rt.div,{id:s.id,...r,ref:t})});gJ.displayName=KM;var Jp="SelectItem",[xJ,QM]=gc(Jp),XM=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...l}=e,c=co(Jp,n),f=fo(Jp,n),d=c.value===r,[p,m]=b.useState(i??""),[x,y]=b.useState(!1),v=At(t,A=>{var k;return(k=f.itemRefCallback)==null?void 0:k.call(f,A,r,s)}),T=nr(),w=b.useRef("touch"),N=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(xJ,{scope:n,value:r,disabled:s,textId:T,isSelected:d,onItemTextChange:b.useCallback(A=>{m(k=>k||((A==null?void 0:A.textContent)??"").trim())},[]),children:u.jsx(F0.ItemSlot,{scope:n,value:r,disabled:s,textValue:p,children:u.jsx(rt.div,{role:"option","aria-labelledby":T,"data-highlighted":x?"":void 0,"aria-selected":d&&x,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:v,onFocus:_e(l.onFocus,()=>y(!0)),onBlur:_e(l.onBlur,()=>y(!1)),onClick:_e(l.onClick,()=>{w.current!=="mouse"&&N()}),onPointerUp:_e(l.onPointerUp,()=>{w.current==="mouse"&&N()}),onPointerDown:_e(l.onPointerDown,A=>{w.current=A.pointerType}),onPointerMove:_e(l.onPointerMove,A=>{var k;w.current=A.pointerType,s?(k=f.onItemLeave)==null||k.call(f):w.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(l.onPointerLeave,A=>{var k;A.currentTarget===document.activeElement&&((k=f.onItemLeave)==null||k.call(f))}),onKeyDown:_e(l.onKeyDown,A=>{var R;((R=f.searchRef)==null?void 0:R.current)!==""&&A.key===" "||(tJ.includes(A.key)&&N(),A.key===" "&&A.preventDefault())})})})})});XM.displayName=Jp;var zd="SelectItemText",WM=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,l=co(zd,n),c=fo(zd,n),f=QM(zd,n),d=aJ(zd,n),[p,m]=b.useState(null),x=At(t,N=>m(N),f.onItemTextChange,N=>{var A;return(A=c.itemTextRefCallback)==null?void 0:A.call(c,N,f.value,f.disabled)}),y=p==null?void 0:p.textContent,v=b.useMemo(()=>u.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:T,onNativeOptionRemove:w}=d;return gr(()=>(T(v),()=>w(v)),[T,w,v]),u.jsxs(u.Fragment,{children:[u.jsx(rt.span,{id:f.textId,...i,ref:x}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ai.createPortal(i.children,l.valueNode):null]})});WM.displayName=zd;var ZM="SelectItemIndicator",JM=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return QM(ZM,n).isSelected?u.jsx(rt.span,{"aria-hidden":!0,...r,ref:t}):null});JM.displayName=ZM;var Sv="SelectScrollUpButton",yJ=b.forwardRef((e,t)=>{const n=fo(Sv,e.__scopeSelect),r=CT(Sv,e.__scopeSelect),[s,i]=b.useState(!1),l=At(t,r.onScrollButtonChange);return gr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=f.scrollTop>0;i(d)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?u.jsx(e6,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop-f.offsetHeight)}}):null});yJ.displayName=Sv;var wv="SelectScrollDownButton",bJ=b.forwardRef((e,t)=>{const n=fo(wv,e.__scopeSelect),r=CT(wv,e.__scopeSelect),[s,i]=b.useState(!1),l=At(t,r.onScrollButtonChange);return gr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<d;i(p)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?u.jsx(e6,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop+f.offsetHeight)}}):null});bJ.displayName=wv;var e6=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=fo("SelectScrollButton",n),l=b.useRef(null),c=z0(n),f=b.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return b.useEffect(()=>()=>f(),[f]),gr(()=>{var p;const d=c().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[c]),u.jsx(rt.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:_e(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:_e(s.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:_e(s.onPointerLeave,()=>{f()})})}),vJ="SelectSeparator",EJ=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(rt.div,{"aria-hidden":!0,...r,ref:t})});EJ.displayName=vJ;var Cv="SelectArrow",TJ=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=U0(n),i=co(Cv,n),l=fo(Cv,n);return i.open&&l.position==="popper"?u.jsx(Wf,{...s,...r,ref:t}):null});TJ.displayName=Cv;var SJ="SelectBubbleInput",t6=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=b.useRef(null),i=At(r,s),l=nj(t);return b.useEffect(()=>{const c=s.current;if(!c)return;const f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==t&&p){const m=new Event("change",{bubbles:!0});p.call(c,t),c.dispatchEvent(m)}},[l,t]),u.jsx(rt.select,{...n,style:{...ej,...n.style},ref:i,defaultValue:t})});t6.displayName=SJ;function n6(e){return e===""||e===void 0}function r6(e){const t=xa(e),n=b.useRef(""),r=b.useRef(0),s=b.useCallback(l=>{const c=n.current+l;t(c),(function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(c)},[t]),i=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function s6(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=wJ(e,Math.max(i,0));s.length===1&&(l=l.filter(d=>d!==n));const f=l.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function wJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CJ=IM,a6=PM,NJ=FM,AJ=zM,kJ=UM,i6=HM,_J=YM,o6=XM,RJ=WM,OJ=JM,H0="Switch",[DJ]=ns(H0),[jJ,MJ]=DJ(H0),l6=b.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:l,disabled:c,value:f="on",onCheckedChange:d,form:p,...m}=e,[x,y]=b.useState(null),v=At(t,k=>y(k)),T=b.useRef(!1),w=x?p||!!x.closest("form"):!0,[N,A]=ga({prop:s,defaultProp:i??!1,onChange:d,caller:H0});return u.jsxs(jJ,{scope:n,checked:N,disabled:c,children:[u.jsx(rt.button,{type:"button",role:"switch","aria-checked":N,"aria-required":l,"data-state":f6(N),"data-disabled":c?"":void 0,disabled:c,value:f,...m,ref:v,onClick:_e(e.onClick,k=>{A(R=>!R),w&&(T.current=k.isPropagationStopped(),T.current||k.stopPropagation())})}),w&&u.jsx(d6,{control:x,bubbles:!T.current,name:r,value:f,checked:N,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});l6.displayName=H0;var u6="SwitchThumb",c6=b.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=MJ(u6,n);return u.jsx(rt.span,{"data-state":f6(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});c6.displayName=u6;var IJ="SwitchBubbleInput",d6=b.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const l=b.useRef(null),c=At(l,i),f=nj(n),d=rj(t);return b.useEffect(()=>{const p=l.current;if(!p)return;const m=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(m,"checked").set;if(f!==n&&y){const v=new Event("click",{bubbles:r});y.call(p,n),p.dispatchEvent(v)}},[f,n,r]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});d6.displayName=IJ;function f6(e){return e?"checked":"unchecked"}var h6=l6,LJ=c6,$0="Tabs",[PJ]=ns($0,[O0]),m6=O0(),[BJ,NT]=PJ($0),p6=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:l="horizontal",dir:c,activationMode:f="automatic",...d}=e,p=N0(c),[m,x]=ga({prop:r,onChange:s,defaultProp:i??"",caller:$0});return u.jsx(BJ,{scope:n,baseId:nr(),value:m,onValueChange:x,orientation:l,dir:p,activationMode:f,children:u.jsx(rt.div,{dir:p,"data-orientation":l,...d,ref:t})})});p6.displayName=$0;var g6="TabsList",x6=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=NT(g6,n),l=m6(n);return u.jsx(Rj,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:u.jsx(rt.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});x6.displayName=g6;var y6="TabsTrigger",b6=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,l=NT(y6,n),c=m6(n),f=T6(l.baseId,r),d=S6(l.baseId,r),p=r===l.value;return u.jsx(Oj,{asChild:!0,...c,focusable:!s,active:p,children:u.jsx(rt.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...i,ref:t,onMouseDown:_e(e.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?l.onValueChange(r):m.preventDefault()}),onKeyDown:_e(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(r)}),onFocus:_e(e.onFocus,()=>{const m=l.activationMode!=="manual";!p&&!s&&m&&l.onValueChange(r)})})})});b6.displayName=y6;var v6="TabsContent",E6=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...l}=e,c=NT(v6,n),f=T6(c.baseId,r),d=S6(c.baseId,r),p=r===c.value,m=b.useRef(p);return b.useEffect(()=>{const x=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(x)},[]),u.jsx(kr,{present:s||p,children:({present:x})=>u.jsx(rt.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":f,hidden:!x,id:d,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:x&&i})})});E6.displayName=v6;function T6(e,t){return`${e}-trigger-${t}`}function S6(e,t){return`${e}-content-${t}`}var FJ=p6,w6=x6,C6=b6,N6=E6,[V0]=ns("Tooltip",[Ea]),q0=Ea(),A6="TooltipProvider",zJ=700,Nv="tooltip.open",[UJ,AT]=V0(A6),k6=e=>{const{__scopeTooltip:t,delayDuration:n=zJ,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,l=b.useRef(!0),c=b.useRef(!1),f=b.useRef(0);return b.useEffect(()=>{const d=f.current;return()=>window.clearTimeout(d)},[]),u.jsx(UJ,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(f.current),l.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:b.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:i})};k6.displayName=A6;var Ef="Tooltip",[HJ,nh]=V0(Ef),_6=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:c}=e,f=AT(Ef,e.__scopeTooltip),d=q0(t),[p,m]=b.useState(null),x=nr(),y=b.useRef(0),v=l??f.disableHoverableContent,T=c??f.delayDuration,w=b.useRef(!1),[N,A]=ga({prop:r,defaultProp:s??!1,onChange:M=>{M?(f.onOpen(),document.dispatchEvent(new CustomEvent(Nv))):f.onClose(),i==null||i(M)},caller:Ef}),k=b.useMemo(()=>N?w.current?"delayed-open":"instant-open":"closed",[N]),R=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,A(!0)},[A]),D=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,A(!1)},[A]),O=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,A(!0),y.current=0},T)},[T,A]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(Qf,{...d,children:u.jsx(HJ,{scope:t,contentId:x,open:N,stateAttribute:k,trigger:p,onTriggerChange:m,onTriggerEnter:b.useCallback(()=>{f.isOpenDelayedRef.current?O():R()},[f.isOpenDelayedRef,O,R]),onTriggerLeave:b.useCallback(()=>{v?D():(window.clearTimeout(y.current),y.current=0)},[D,v]),onOpen:R,onClose:D,disableHoverableContent:v,children:n})})};_6.displayName=Ef;var Av="TooltipTrigger",R6=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=nh(Av,n),i=AT(Av,n),l=q0(n),c=b.useRef(null),f=At(t,c,s.onTriggerChange),d=b.useRef(!1),p=b.useRef(!1),m=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),u.jsx(pc,{asChild:!0,...l,children:u.jsx(rt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:_e(e.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:_e(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:_e(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:_e(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:_e(e.onBlur,s.onClose),onClick:_e(e.onClick,s.onClose)})})});R6.displayName=Av;var kT="TooltipPortal",[$J,VJ]=V0(kT,{forceMount:void 0}),O6=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=nh(kT,t);return u.jsx($J,{scope:t,forceMount:n,children:u.jsx(kr,{present:n||i.open,children:u.jsx(xl,{asChild:!0,container:s,children:r})})})};O6.displayName=kT;var ec="TooltipContent",D6=b.forwardRef((e,t)=>{const n=VJ(ec,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,l=nh(ec,e.__scopeTooltip);return u.jsx(kr,{present:r||l.open,children:l.disableHoverableContent?u.jsx(j6,{side:s,...i,ref:t}):u.jsx(qJ,{side:s,...i,ref:t})})}),qJ=b.forwardRef((e,t)=>{const n=nh(ec,e.__scopeTooltip),r=AT(ec,e.__scopeTooltip),s=b.useRef(null),i=At(t,s),[l,c]=b.useState(null),{trigger:f,onClose:d}=n,p=s.current,{onPointerInTransitChange:m}=r,x=b.useCallback(()=>{c(null),m(!1)},[m]),y=b.useCallback((v,T)=>{const w=v.currentTarget,N={x:v.clientX,y:v.clientY},A=XJ(N,w.getBoundingClientRect()),k=WJ(N,A),R=ZJ(T.getBoundingClientRect()),D=eee([...k,...R]);c(D),m(!0)},[m]);return b.useEffect(()=>()=>x(),[x]),b.useEffect(()=>{if(f&&p){const v=w=>y(w,p),T=w=>y(w,f);return f.addEventListener("pointerleave",v),p.addEventListener("pointerleave",T),()=>{f.removeEventListener("pointerleave",v),p.removeEventListener("pointerleave",T)}}},[f,p,y,x]),b.useEffect(()=>{if(l){const v=T=>{const w=T.target,N={x:T.clientX,y:T.clientY},A=(f==null?void 0:f.contains(w))||(p==null?void 0:p.contains(w)),k=!JJ(N,l);A?x():k&&(x(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[f,p,l,d,x]),u.jsx(j6,{...e,ref:i})}),[YJ,GJ]=V0(Ef,{isInside:!1}),KJ=aD("TooltipContent"),j6=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...c}=e,f=nh(ec,n),d=q0(n),{onClose:p}=f;return b.useEffect(()=>(document.addEventListener(Nv,p),()=>document.removeEventListener(Nv,p)),[p]),b.useEffect(()=>{if(f.trigger){const m=x=>{const y=x.target;y!=null&&y.contains(f.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[f.trigger,p]),u.jsx(gl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:u.jsxs(Xf,{"data-state":f.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(KJ,{children:r}),u.jsx(YJ,{scope:n,isInside:!0,children:u.jsx(FQ,{id:f.contentId,role:"tooltip",children:s||r})})]})})});D6.displayName=ec;var M6="TooltipArrow",QJ=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=q0(n);return GJ(M6,n).isInside?null:u.jsx(Wf,{...s,...r,ref:t})});QJ.displayName=M6;function XJ(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function WJ(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ZJ(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function JJ(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const c=t[i],f=t[l],d=c.x,p=c.y,m=f.x,x=f.y;p>r!=x>r&&n<(m-d)*(r-p)/(x-p)+d&&(s=!s)}return s}function eee(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),tee(t)}function tee(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var nee=k6,ree=_6,see=R6,aee=O6,iee=D6;const _T=JD("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function mt({className:e,variant:t="default",size:n="default",asChild:r=!1,...s}){const i=r?iK:"button";return u.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:Ee(_T({variant:t,size:n,className:e})),...s})}const RT=LQ,oee=PQ,I6=b.forwardRef(({className:e,...t},n)=>u.jsx(GD,{ref:n,className:Ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t}));I6.displayName=GD.displayName;const Y0=b.forwardRef(({className:e,...t},n)=>u.jsxs(oee,{children:[u.jsx(I6,{}),u.jsx(KD,{ref:n,className:Ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));Y0.displayName=KD.displayName;function OT({className:e,...t}){return u.jsx("div",{"data-slot":"alert-dialog-header",className:Ee("flex flex-col space-y-2 text-center sm:text-left",e),...t})}function DT({className:e,...t}){return u.jsx("div",{"data-slot":"alert-dialog-footer",className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const G0=b.forwardRef(({className:e,...t},n)=>u.jsx(WD,{ref:n,className:Ee("text-lg font-semibold",e),...t}));G0.displayName=WD.displayName;const K0=b.forwardRef(({className:e,...t},n)=>u.jsx(ZD,{ref:n,className:Ee("text-muted-foreground text-sm",e),...t}));K0.displayName=ZD.displayName;const Q0=b.forwardRef(({className:e,...t},n)=>u.jsx(QD,{ref:n,className:Ee(_T(),e),...t}));Q0.displayName=QD.displayName;const X0=b.forwardRef(({className:e,...t},n)=>u.jsx(XD,{ref:n,className:Ee(_T({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));X0.displayName=XD.displayName;const lee=JD("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function gn({className:e,variant:t,...n}){return u.jsx("div",{className:Ee(lee({variant:t}),e),...n})}function Ss({className:e,type:t,...n}){return u.jsx("input",{type:t,"data-slot":"input",className:Ee("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var l3=1,uee=.9,cee=.8,dee=.17,Ty=.1,Sy=.999,fee=.9999,hee=.99,mee=/[\\\/_+.#"@\[\(\{&]/,pee=/[\\\/_+.#"@\[\(\{&]/g,gee=/[\s-]/,L6=/[\s-]/g;function kv(e,t,n,r,s,i,l){if(i===t.length)return s===e.length?l3:hee;var c=`${s},${i}`;if(l[c]!==void 0)return l[c];for(var f=r.charAt(i),d=n.indexOf(f,s),p=0,m,x,y,v;d>=0;)m=kv(e,t,n,r,d+1,i+1,l),m>p&&(d===s?m*=l3:mee.test(e.charAt(d-1))?(m*=cee,y=e.slice(s,d-1).match(pee),y&&s>0&&(m*=Math.pow(Sy,y.length))):gee.test(e.charAt(d-1))?(m*=uee,v=e.slice(s,d-1).match(L6),v&&s>0&&(m*=Math.pow(Sy,v.length))):(m*=dee,s>0&&(m*=Math.pow(Sy,d-s))),e.charAt(d)!==t.charAt(i)&&(m*=fee)),(m<Ty&&n.charAt(d-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(d-1)!==r.charAt(i))&&(x=kv(e,t,n,r,d+1,i+2,l),x*Ty>m&&(m=x*Ty)),m>p&&(p=m),d=n.indexOf(f,d+1);return l[c]=p,p}function u3(e){return e.toLowerCase().replace(L6," ")}function xee(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,kv(e,t,u3(e),u3(t),0,0,{})}var yee=Symbol.for("react.lazy"),e0=iE[" use ".trim().toString()];function bee(e){return typeof e=="object"&&e!==null&&"then"in e}function P6(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===yee&&"_payload"in e&&bee(e._payload)}function vee(e){const t=Eee(e),n=b.forwardRef((r,s)=>{let{children:i,...l}=r;P6(i)&&typeof e0=="function"&&(i=e0(i._payload));const c=b.Children.toArray(i),f=c.find(See);if(f){const d=f.props.children,p=c.map(m=>m===f?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return u.jsx(t,{...l,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,p):null})}return u.jsx(t,{...l,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Eee(e){const t=b.forwardRef((n,r)=>{let{children:s,...i}=n;if(P6(s)&&typeof e0=="function"&&(s=e0(s._payload)),b.isValidElement(s)){const l=Cee(s),c=wee(i,s.props);return s.type!==b.Fragment&&(c.ref=r?pa(r,l):l),b.cloneElement(s,c)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tee=Symbol("radix.slottable");function See(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tee}function wee(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const f=i(...c);return s(...c),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Cee(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Nee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=Nee.reduce((e,t)=>{const n=vee(`Primitive.${t}`),r=b.forwardRef((s,i)=>{const{asChild:l,...c}=s,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Td='[cmdk-group=""]',wy='[cmdk-group-items=""]',Aee='[cmdk-group-heading=""]',B6='[cmdk-item=""]',c3=`${B6}:not([aria-disabled="true"])`,_v="cmdk-item-select",Tu="data-value",kee=(e,t,n)=>xee(e,t,n),F6=b.createContext(void 0),rh=()=>b.useContext(F6),z6=b.createContext(void 0),jT=()=>b.useContext(z6),U6=b.createContext(void 0),H6=b.forwardRef((e,t)=>{let n=Su(()=>{var V,j;return{search:"",value:(j=(V=e.value)!=null?V:e.defaultValue)!=null?j:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Su(()=>new Set),s=Su(()=>new Map),i=Su(()=>new Map),l=Su(()=>new Set),c=$6(e),{label:f,children:d,value:p,onValueChange:m,filter:x,shouldFilter:y,loop:v,disablePointerSelection:T=!1,vimBindings:w=!0,...N}=e,A=nr(),k=nr(),R=nr(),D=b.useRef(null),O=Fee();cl(()=>{if(p!==void 0){let V=p.trim();n.current.value=V,M.emit()}},[p]),cl(()=>{O(6,W)},[]);let M=b.useMemo(()=>({subscribe:V=>(l.current.add(V),()=>l.current.delete(V)),snapshot:()=>n.current,setState:(V,j,re)=>{var ae,me,le,ye;if(!Object.is(n.current[V],j)){if(n.current[V]=j,V==="search")Y(),P(),O(1,K);else if(V==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ve=document.getElementById(R);ve?ve.focus():(ae=document.getElementById(A))==null||ae.focus()}if(O(7,()=>{var ve;n.current.selectedItemId=(ve=te())==null?void 0:ve.id,M.emit()}),re||O(5,W),((me=c.current)==null?void 0:me.value)!==void 0){let ve=j??"";(ye=(le=c.current).onValueChange)==null||ye.call(le,ve);return}}M.emit()}},emit:()=>{l.current.forEach(V=>V())}}),[]),I=b.useMemo(()=>({value:(V,j,re)=>{var ae;j!==((ae=i.current.get(V))==null?void 0:ae.value)&&(i.current.set(V,{value:j,keywords:re}),n.current.filtered.items.set(V,H(j,re)),O(2,()=>{P(),M.emit()}))},item:(V,j)=>(r.current.add(V),j&&(s.current.has(j)?s.current.get(j).add(V):s.current.set(j,new Set([V]))),O(3,()=>{Y(),P(),n.current.value||K(),M.emit()}),()=>{i.current.delete(V),r.current.delete(V),n.current.filtered.items.delete(V);let re=te();O(4,()=>{Y(),(re==null?void 0:re.getAttribute("id"))===V&&K(),M.emit()})}),group:V=>(s.current.has(V)||s.current.set(V,new Set),()=>{i.current.delete(V),s.current.delete(V)}),filter:()=>c.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:A,inputId:R,labelId:k,listInnerRef:D}),[]);function H(V,j){var re,ae;let me=(ae=(re=c.current)==null?void 0:re.filter)!=null?ae:kee;return V?me(V,n.current.search,j):0}function P(){if(!n.current.search||c.current.shouldFilter===!1)return;let V=n.current.filtered.items,j=[];n.current.filtered.groups.forEach(ae=>{let me=s.current.get(ae),le=0;me.forEach(ye=>{let ve=V.get(ye);le=Math.max(ve,le)}),j.push([ae,le])});let re=D.current;J().sort((ae,me)=>{var le,ye;let ve=ae.getAttribute("id"),Re=me.getAttribute("id");return((le=V.get(Re))!=null?le:0)-((ye=V.get(ve))!=null?ye:0)}).forEach(ae=>{let me=ae.closest(wy);me?me.appendChild(ae.parentElement===me?ae:ae.closest(`${wy} > *`)):re.appendChild(ae.parentElement===re?ae:ae.closest(`${wy} > *`))}),j.sort((ae,me)=>me[1]-ae[1]).forEach(ae=>{var me;let le=(me=D.current)==null?void 0:me.querySelector(`${Td}[${Tu}="${encodeURIComponent(ae[0])}"]`);le==null||le.parentElement.appendChild(le)})}function K(){let V=J().find(re=>re.getAttribute("aria-disabled")!=="true"),j=V==null?void 0:V.getAttribute(Tu);M.setState("value",j||void 0)}function Y(){var V,j,re,ae;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let me=0;for(let le of r.current){let ye=(j=(V=i.current.get(le))==null?void 0:V.value)!=null?j:"",ve=(ae=(re=i.current.get(le))==null?void 0:re.keywords)!=null?ae:[],Re=H(ye,ve);n.current.filtered.items.set(le,Re),Re>0&&me++}for(let[le,ye]of s.current)for(let ve of ye)if(n.current.filtered.items.get(ve)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=me}function W(){var V,j,re;let ae=te();ae&&(((V=ae.parentElement)==null?void 0:V.firstChild)===ae&&((re=(j=ae.closest(Td))==null?void 0:j.querySelector(Aee))==null||re.scrollIntoView({block:"nearest"})),ae.scrollIntoView({block:"nearest"}))}function te(){var V;return(V=D.current)==null?void 0:V.querySelector(`${B6}[aria-selected="true"]`)}function J(){var V;return Array.from(((V=D.current)==null?void 0:V.querySelectorAll(c3))||[])}function L(V){let j=J()[V];j&&M.setState("value",j.getAttribute(Tu))}function B(V){var j;let re=te(),ae=J(),me=ae.findIndex(ye=>ye===re),le=ae[me+V];(j=c.current)!=null&&j.loop&&(le=me+V<0?ae[ae.length-1]:me+V===ae.length?ae[0]:ae[me+V]),le&&M.setState("value",le.getAttribute(Tu))}function U(V){let j=te(),re=j==null?void 0:j.closest(Td),ae;for(;re&&!ae;)re=V>0?Pee(re,Td):Bee(re,Td),ae=re==null?void 0:re.querySelector(c3);ae?M.setState("value",ae.getAttribute(Tu)):B(V)}let ne=()=>L(J().length-1),z=V=>{V.preventDefault(),V.metaKey?ne():V.altKey?U(1):B(1)},q=V=>{V.preventDefault(),V.metaKey?L(0):V.altKey?U(-1):B(-1)};return b.createElement(Ta.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:V=>{var j;(j=N.onKeyDown)==null||j.call(N,V);let re=V.nativeEvent.isComposing||V.keyCode===229;if(!(V.defaultPrevented||re))switch(V.key){case"n":case"j":{w&&V.ctrlKey&&z(V);break}case"ArrowDown":{z(V);break}case"p":case"k":{w&&V.ctrlKey&&q(V);break}case"ArrowUp":{q(V);break}case"Home":{V.preventDefault(),L(0);break}case"End":{V.preventDefault(),ne();break}case"Enter":{V.preventDefault();let ae=te();if(ae){let me=new Event(_v);ae.dispatchEvent(me)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:Uee},f),W0(e,V=>b.createElement(z6.Provider,{value:M},b.createElement(F6.Provider,{value:I},V))))}),_ee=b.forwardRef((e,t)=>{var n,r;let s=nr(),i=b.useRef(null),l=b.useContext(U6),c=rh(),f=$6(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:l==null?void 0:l.forceMount;cl(()=>{if(!d)return c.item(s,l==null?void 0:l.id)},[d]);let p=V6(s,i,[e.value,e.children,i],e.keywords),m=jT(),x=so(O=>O.value&&O.value===p.current),y=so(O=>d||c.filter()===!1?!0:O.search?O.filtered.items.get(s)>0:!0);b.useEffect(()=>{let O=i.current;if(!(!O||e.disabled))return O.addEventListener(_v,v),()=>O.removeEventListener(_v,v)},[y,e.onSelect,e.disabled]);function v(){var O,M;T(),(M=(O=f.current).onSelect)==null||M.call(O,p.current)}function T(){m.setState("value",p.current,!0)}if(!y)return null;let{disabled:w,value:N,onSelect:A,forceMount:k,keywords:R,...D}=e;return b.createElement(Ta.div,{ref:pa(i,t),...D,id:s,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!x,"data-disabled":!!w,"data-selected":!!x,onPointerMove:w||c.getDisablePointerSelection()?void 0:T,onClick:w?void 0:v},e.children)}),Ree=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,l=nr(),c=b.useRef(null),f=b.useRef(null),d=nr(),p=rh(),m=so(y=>s||p.filter()===!1?!0:y.search?y.filtered.groups.has(l):!0);cl(()=>p.group(l),[]),V6(l,c,[e.value,e.heading,f]);let x=b.useMemo(()=>({id:l,forceMount:s}),[s]);return b.createElement(Ta.div,{ref:pa(c,t),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&b.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),W0(e,y=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},b.createElement(U6.Provider,{value:x},y))))}),Oee=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=b.useRef(null),i=so(l=>!l.search);return!n&&!i?null:b.createElement(Ta.div,{ref:pa(s,t),...r,"cmdk-separator":"",role:"separator"})}),Dee=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=jT(),l=so(d=>d.search),c=so(d=>d.selectedItemId),f=rh();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(Ta.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:s?e.value:l,onChange:d=>{s||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),jee=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=b.useRef(null),l=b.useRef(null),c=so(d=>d.selectedItemId),f=rh();return b.useEffect(()=>{if(l.current&&i.current){let d=l.current,p=i.current,m,x=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=d.offsetHeight;p.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return x.observe(d),()=>{cancelAnimationFrame(m),x.unobserve(d)}}},[]),b.createElement(Ta.div,{ref:pa(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:f.listId},W0(e,d=>b.createElement("div",{ref:pa(l,f.listInnerRef),"cmdk-list-sizer":""},d)))}),Mee=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:l,...c}=e;return b.createElement(T0,{open:n,onOpenChange:r},b.createElement(S0,{container:l},b.createElement(Yf,{"cmdk-overlay":"",className:s}),b.createElement(Gf,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(H6,{ref:t,...c}))))}),Iee=b.forwardRef((e,t)=>so(n=>n.filtered.count===0)?b.createElement(Ta.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Lee=b.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return b.createElement(Ta.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},W0(e,l=>b.createElement("div",{"aria-hidden":!0},l)))}),xc=Object.assign(H6,{List:jee,Item:_ee,Input:Dee,Group:Ree,Separator:Oee,Dialog:Mee,Empty:Iee,Loading:Lee});function Pee(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Bee(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $6(e){let t=b.useRef(e);return cl(()=>{t.current=e}),t}var cl=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Su(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function so(e){let t=jT(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function V6(e,t,n,r=[]){let s=b.useRef(),i=rh();return cl(()=>{var l;let c=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():s.current}})(),f=r.map(d=>d.trim());i.value(e,c,f),(l=t.current)==null||l.setAttribute(Tu,c),s.current=c}),s}var Fee=()=>{let[e,t]=b.useState(),n=Su(()=>new Map);return cl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function zee(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function W0({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(zee(t),{ref:t.ref},n(t.props.children)):n(t)}var Uee={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Hee({className:e,...t}){return u.jsx(xc,{"data-slot":"command",className:Ee("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function $ee({className:e,...t}){return u.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[u.jsx($f,{className:"size-4 shrink-0 opacity-50"}),u.jsx(xc.Input,{"data-slot":"command-input",className:Ee("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function Vee({className:e,...t}){return u.jsx(xc.List,{"data-slot":"command-list",className:Ee("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function qee({...e}){return u.jsx(xc.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function d3({className:e,...t}){return u.jsx(xc.Group,{"data-slot":"command-group",className:Ee("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function Cy({className:e,...t}){return u.jsx(xc.Item,{"data-slot":"command-item",className:Ee("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}const sh=T0,q6=aT,Yee=S0,Y6=b.forwardRef(({className:e,...t},n)=>u.jsx(Yf,{ref:n,className:Ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t}));Y6.displayName=Yf.displayName;const yc=b.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Yee,{children:[u.jsx(Y6,{}),u.jsxs(Gf,{ref:r,className:Ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,u.jsxs(iT,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[u.jsx(ba,{className:"size-(--size-icon-md)"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yc.displayName=Gf.displayName;function bc({className:e,...t}){return u.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}bc.displayName="DialogHeader";function Z0({className:e,...t}){return u.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}Z0.displayName="DialogFooter";const vc=b.forwardRef(({className:e,...t},n)=>u.jsx(w0,{ref:n,className:Ee("text-lg leading-none font-semibold tracking-tight",e),...t}));vc.displayName=w0.displayName;const ah=b.forwardRef(({className:e,...t},n)=>u.jsx(C0,{ref:n,className:Ee("text-muted-foreground text-sm",e),...t}));ah.displayName=C0.displayName;function Gee(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 G6=oe.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),ih=()=>{const e=oe.useContext(G6);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Gee(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
536
|
-
[data-state=closed]
|
|
537
|
-
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Kee(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Qee(){return MT(/^Mac/)}function Xee(){return MT(/^iPhone/)}function f3(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Wee(){return MT(/^iPad/)||Qee()&&navigator.maxTouchPoints>1}function K6(){return Xee()||Wee()}function MT(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Zee=24,Jee=typeof window<"u"?b.useLayoutEffect:b.useEffect;function h3(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Ny=typeof document<"u"&&window.visualViewport;function m3(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Q6(e){for(m3(e)&&(e=e.parentElement);e&&!m3(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const ete=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Qm=0,Ay;function tte(e={}){let{isDisabled:t}=e;Jee(()=>{if(!t)return Qm++,Qm===1&&K6()&&(Ay=nte()),()=>{Qm--,Qm===0&&(Ay==null||Ay())}},[t])}function nte(){let e,t=0,n=m=>{e=Q6(m.target),!(e===document.documentElement&&e===document.body)&&(t=m.changedTouches[0].pageY)},r=m=>{if(!e||e===document.documentElement||e===document.body){m.preventDefault();return}let x=m.changedTouches[0].pageY,y=e.scrollTop,v=e.scrollHeight-e.clientHeight;v!==0&&((y<=0&&x>t||y>=v&&x<t)&&m.preventDefault(),t=x)},s=m=>{let x=m.target;Rv(x)&&x!==document.activeElement&&(m.preventDefault(),x.style.transform="translateY(-2000px)",x.focus(),requestAnimationFrame(()=>{x.style.transform=""}))},i=m=>{let x=m.target;Rv(x)&&(x.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{x.style.transform="",Ny&&(Ny.height<window.innerHeight?requestAnimationFrame(()=>{p3(x)}):Ny.addEventListener("resize",()=>p3(x),{once:!0}))}))},l=()=>{window.scrollTo(0,0)},c=window.pageXOffset,f=window.pageYOffset,d=h3(rte(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let p=h3(Sd(document,"touchstart",n,{passive:!1,capture:!0}),Sd(document,"touchmove",r,{passive:!1,capture:!0}),Sd(document,"touchend",s,{passive:!1,capture:!0}),Sd(document,"focus",i,!0),Sd(window,"scroll",l));return()=>{d(),p(),window.scrollTo(c,f)}}function rte(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Sd(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function p3(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Q6(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,s=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const l=n.getBoundingClientRect().bottom+Zee;i>l&&(n.scrollTop+=s-r)}e=n.parentElement}}function Rv(e){return e instanceof HTMLInputElement&&!ete.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function ste(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ate(...e){return t=>e.forEach(n=>ste(n,t))}function X6(...e){return b.useCallback(ate(...e),e)}const W6=new WeakMap;function qn(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([s,i])=>{if(s.startsWith("--")){e.style.setProperty(s,i);return}r[s]=e.style[s],e.style[s]=i}),!n&&W6.set(e,r)}function ite(e,t){if(!e||!(e instanceof HTMLElement))return;let n=W6.get(e);n&&(e.style[t]=n[t])}const Bn=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Xm(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Bn(t)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Bn(t)?5:4]):null)}function ote(e){return 8*(Math.log(e+1)-2)}function ky(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function lte(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const yn={DURATION:.5,EASE:[.32,.72,0,1]},Z6=.4,ute=.25,cte=100,J6=8,Mo=16,Ov=26,_y="vaul-dragging";function eI(e){const t=oe.useRef(e);return oe.useEffect(()=>{t.current=e}),oe.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function dte({defaultProp:e,onChange:t}){const n=oe.useState(e),[r]=n,s=oe.useRef(r),i=eI(t);return oe.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function tI({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=dte({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,c=eI(n),f=oe.useCallback(d=>{if(i){const m=typeof d=="function"?d(e):d;m!==e&&c(m)}else s(d)},[i,e,s,c]);return[l,f]}function fte({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:l,direction:c="bottom",container:f,snapToSequentialPoint:d}){const[p,m]=tI({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[x,y]=oe.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);oe.useEffect(()=>{function M(){y({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);const v=oe.useMemo(()=>p===(n==null?void 0:n[n.length-1])||null,[n,p]),T=oe.useMemo(()=>{var M;return(M=n==null?void 0:n.findIndex(I=>I===p))!=null?M:null},[n,p]),w=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===p||!n,N=oe.useMemo(()=>{const M=f?{width:f.getBoundingClientRect().width,height:f.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var I;return(I=n==null?void 0:n.map(H=>{const P=typeof H=="string";let K=0;if(P&&(K=parseInt(H,10)),Bn(c)){const W=P?K:x?H*M.height:0;return x?c==="bottom"?M.height-W:-M.height+W:W}const Y=P?K:x?H*M.width:0;return x?c==="right"?M.width-Y:-M.width+Y:Y}))!=null?I:[]},[n,x,f]),A=oe.useMemo(()=>T!==null?N==null?void 0:N[T]:null,[N,T]),k=oe.useCallback(M=>{var I;const H=(I=N==null?void 0:N.findIndex(P=>P===M))!=null?I:null;l(H),qn(r.current,{transition:`transform ${yn.DURATION}s cubic-bezier(${yn.EASE.join(",")})`,transform:Bn(c)?`translate3d(0, ${M}px, 0)`:`translate3d(${M}px, 0, 0)`}),N&&H!==N.length-1&&i!==void 0&&H!==i&&H<i?qn(s.current,{transition:`opacity ${yn.DURATION}s cubic-bezier(${yn.EASE.join(",")})`,opacity:"0"}):qn(s.current,{transition:`opacity ${yn.DURATION}s cubic-bezier(${yn.EASE.join(",")})`,opacity:"1"}),m(n==null?void 0:n[Math.max(H,0)])},[r.current,n,N,i,s,m]);oe.useEffect(()=>{if(p||e){var M;const I=(M=n==null?void 0:n.findIndex(H=>H===e||H===p))!=null?M:-1;N&&I!==-1&&typeof N[I]=="number"&&k(N[I])}},[p,e,n,N,k]);function R({draggedDistance:M,closeDrawer:I,velocity:H,dismissible:P}){if(i===void 0)return;const K=c==="bottom"||c==="right"?(A??0)-M:(A??0)+M,Y=T===i-1,W=T===0,te=M>0;if(Y&&qn(s.current,{transition:`opacity ${yn.DURATION}s cubic-bezier(${yn.EASE.join(",")})`}),!d&&H>2&&!te){P?I():k(N[0]);return}if(!d&&H>2&&te&&N&&n){k(N[n.length-1]);return}const J=N==null?void 0:N.reduce((B,U)=>typeof B!="number"||typeof U!="number"?B:Math.abs(U-K)<Math.abs(B-K)?U:B),L=Bn(c)?window.innerHeight:window.innerWidth;if(H>Z6&&Math.abs(M)<L*.4){const B=te?1:-1;if(B>0&&v&&n){k(N[n.length-1]);return}if(W&&B<0&&P&&I(),T===null)return;k(N[T+B]);return}k(J)}function D({draggedDistance:M}){if(A===null)return;const I=c==="bottom"||c==="right"?A-M:A+M;(c==="bottom"||c==="right")&&I<N[N.length-1]||(c==="top"||c==="left")&&I>N[N.length-1]||qn(r.current,{transform:Bn(c)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`})}function O(M,I){if(!n||typeof T!="number"||!N||i===void 0)return null;const H=T===i-1;if(T>=i&&I)return 0;if(H&&!I)return 1;if(!w&&!H)return null;const K=H?T+1:T-1,Y=H?N[K]-N[K-1]:N[K+1]-N[K],W=M/Math.abs(Y);return H?1-W:W}return{isLastSnapPoint:v,activeSnapPoint:p,shouldFade:w,getPercentageDragged:O,setActiveSnapPoint:m,activeSnapPointIndex:T,onRelease:R,onDrag:D,snapPointsOffset:N}}const hte=()=>()=>{};function mte(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=ih(),i=oe.useRef(null),l=b.useMemo(()=>document.body.style.backgroundColor,[]);function c(){return(window.innerWidth-Ov)/window.innerWidth}oe.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const f=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!f)return;lte(r&&!s?ky(document.body,{background:"black"}):hte,ky(f,{transformOrigin:Bn(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${yn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${yn.EASE.join(",")})`}));const d=ky(f,{borderRadius:`${J6}px`,overflow:"hidden",...Bn(e)?{transform:`scale(${c()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${c()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),i.current=window.setTimeout(()=>{l?document.body.style.background=l:document.body.style.removeProperty("background")},yn.DURATION*1e3)}}},[t,n,l])}let wd=null;function pte({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[l,c]=oe.useState(()=>typeof window<"u"?window.location.href:""),f=oe.useRef(0),d=oe.useCallback(()=>{if(f3()&&wd===null&&e&&!i){wd={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:m,innerHeight:x}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-f.current}px`,left:`${-m}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const y=x-window.innerHeight;y&&f.current>=x&&(document.body.style.top=`${-(f.current+y)}px`)}),300)}},[e]),p=oe.useCallback(()=>{if(f3()&&wd!==null&&!i){const m=-parseInt(document.body.style.top,10),x=-parseInt(document.body.style.left,10);Object.assign(document.body.style,wd),window.requestAnimationFrame(()=>{if(s&&l!==window.location.href){c(window.location.href);return}window.scrollTo(x,m)}),wd=null}},[l]);return oe.useEffect(()=>{function m(){f.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),oe.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||p()}},[t,p]),oe.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),t||window.setTimeout(()=>{p()},500)):p())},[e,r,l,t,n,d,p]),{restorePositionSetting:p}}function gte({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:l=!1,setBackgroundColorOnScale:c=!0,closeThreshold:f=ute,scrollLockTimeout:d=cte,dismissible:p=!0,handleOnly:m=!1,fadeFromIndex:x=i&&i.length-1,activeSnapPoint:y,setActiveSnapPoint:v,fixed:T,modal:w=!0,onClose:N,nested:A,noBodyStyles:k=!1,direction:R="bottom",defaultOpen:D=!1,disablePreventScroll:O=!0,snapToSequentialPoint:M=!1,preventScrollRestoration:I=!1,repositionInputs:H=!0,onAnimationEnd:P,container:K,autoFocus:Y=!1}){var W,te;const[J=!1,L]=tI({defaultProp:D,prop:e,onChange:Ae=>{t==null||t(Ae),!Ae&&!A&&Ne(),setTimeout(()=>{P==null||P(Ae)},yn.DURATION*1e3),Ae&&!w&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ae||(document.body.style.pointerEvents="auto")}}),[B,U]=oe.useState(!1),[ne,z]=oe.useState(!1),[q,V]=oe.useState(!1),j=oe.useRef(null),re=oe.useRef(null),ae=oe.useRef(null),me=oe.useRef(null),le=oe.useRef(null),ye=oe.useRef(!1),ve=oe.useRef(null),Re=oe.useRef(0),ke=oe.useRef(!1),$e=oe.useRef(!D),Et=oe.useRef(0),Oe=oe.useRef(null),Xt=oe.useRef(((W=Oe.current)==null?void 0:W.getBoundingClientRect().height)||0),un=oe.useRef(((te=Oe.current)==null?void 0:te.getBoundingClientRect().width)||0),tn=oe.useRef(0),pt=oe.useCallback(Ae=>{i&&Ae===dn.length-1&&(re.current=new Date)},[]),{activeSnapPoint:Tt,activeSnapPointIndex:Ht,setActiveSnapPoint:cn,onRelease:St,snapPointsOffset:dn,onDrag:it,shouldFade:Rt,getPercentageDragged:pe}=fte({snapPoints:i,activeSnapPointProp:y,setActiveSnapPointProp:v,drawerRef:Oe,fadeFromIndex:x,overlayRef:j,onSnapPointChange:pt,direction:R,container:K,snapToSequentialPoint:M});tte({isDisabled:!J||ne||!w||q||!B||!H||!O});const{restorePositionSetting:Ne}=pte({isOpen:J,modal:w,nested:A??!1,hasBeenOpened:B,preventScrollRestoration:I,noBodyStyles:k});function Ve(){return(window.innerWidth-Ov)/window.innerWidth}function et(Ae){var Ke,gt;!p&&!i||Oe.current&&!Oe.current.contains(Ae.target)||(Xt.current=((Ke=Oe.current)==null?void 0:Ke.getBoundingClientRect().height)||0,un.current=((gt=Oe.current)==null?void 0:gt.getBoundingClientRect().width)||0,z(!0),ae.current=new Date,K6()&&window.addEventListener("touchend",()=>ye.current=!1,{once:!0}),Ae.target.setPointerCapture(Ae.pointerId),Re.current=Bn(R)?Ae.pageY:Ae.pageX)}function st(Ae,Ke){var gt;let Je=Ae;const ot=(gt=window.getSelection())==null?void 0:gt.toString(),Ie=Oe.current?Xm(Oe.current,R):null,tt=new Date;if(Je.tagName==="SELECT"||Je.hasAttribute("data-vaul-no-drag")||Je.closest("[data-vaul-no-drag]"))return!1;if(R==="right"||R==="left")return!0;if(re.current&&tt.getTime()-re.current.getTime()<500)return!1;if(Ie!==null&&(R==="bottom"?Ie>0:Ie<0))return!0;if(ot&&ot.length>0)return!1;if(le.current&&tt.getTime()-le.current.getTime()<d&&Ie===0||Ke)return le.current=tt,!1;for(;Je;){if(Je.scrollHeight>Je.clientHeight){if(Je.scrollTop!==0)return le.current=new Date,!1;if(Je.getAttribute("role")==="dialog")return!0}Je=Je.parentNode}return!0}function Dn(Ae){if(Oe.current&&ne){const Ke=R==="bottom"||R==="right"?1:-1,gt=(Re.current-(Bn(R)?Ae.pageY:Ae.pageX))*Ke,Je=gt>0,ot=i&&!p&&!Je;if(ot&&Ht===0)return;const Ie=Math.abs(gt),tt=document.querySelector("[data-vaul-drawer-wrapper]"),Wt=R==="bottom"||R==="top"?Xt.current:un.current;let $t=Ie/Wt;const dr=pe(Ie,Je);if(dr!==null&&($t=dr),ot&&$t>=1||!ye.current&&!st(Ae.target,Je))return;if(Oe.current.classList.add(_y),ye.current=!0,qn(Oe.current,{transition:"none"}),qn(j.current,{transition:"none"}),i&&it({draggedDistance:gt}),Je&&!i){const an=ote(gt),rs=Math.min(an*-1,0)*Ke;qn(Oe.current,{transform:Bn(R)?`translate3d(0, ${rs}px, 0)`:`translate3d(${rs}px, 0, 0)`});return}const jt=1-$t;if((Rt||x&&Ht===x-1)&&(r==null||r(Ae,$t),qn(j.current,{opacity:`${jt}`,transition:"none"},!0)),tt&&j.current&&l){const an=Math.min(Ve()+$t*(1-Ve()),1),rs=8-$t*8,rr=Math.max(0,14-$t*14);qn(tt,{borderRadius:`${rs}px`,transform:Bn(R)?`scale(${an}) translate3d(0, ${rr}px, 0)`:`scale(${an}) translate3d(${rr}px, 0, 0)`,transition:"none"},!0)}if(!i){const an=Ie*Ke;qn(Oe.current,{transform:Bn(R)?`translate3d(0, ${an}px, 0)`:`translate3d(${an}px, 0, 0)`})}}}oe.useEffect(()=>{window.requestAnimationFrame(()=>{$e.current=!0})},[]),oe.useEffect(()=>{var Ae;function Ke(){if(!Oe.current||!H)return;const gt=document.activeElement;if(Rv(gt)||ke.current){var Je;const ot=((Je=window.visualViewport)==null?void 0:Je.height)||0,Ie=window.innerHeight;let tt=Ie-ot;const Wt=Oe.current.getBoundingClientRect().height||0,$t=Wt>Ie*.8;tn.current||(tn.current=Wt);const dr=Oe.current.getBoundingClientRect().top;if(Math.abs(Et.current-tt)>60&&(ke.current=!ke.current),i&&i.length>0&&dn&&Ht){const jt=dn[Ht]||0;tt+=jt}if(Et.current=tt,Wt>ot||ke.current){const jt=Oe.current.getBoundingClientRect().height;let an=jt;jt>ot&&(an=ot-($t?dr:Ov)),T?Oe.current.style.height=`${jt-Math.max(tt,0)}px`:Oe.current.style.height=`${Math.max(an,ot-dr)}px`}else Kee()||(Oe.current.style.height=`${tn.current}px`);i&&i.length>0&&!ke.current?Oe.current.style.bottom="0px":Oe.current.style.bottom=`${Math.max(tt,0)}px`}}return(Ae=window.visualViewport)==null||Ae.addEventListener("resize",Ke),()=>{var gt;return(gt=window.visualViewport)==null?void 0:gt.removeEventListener("resize",Ke)}},[Ht,i,dn]);function fn(Ae){nn(),N==null||N(),Ae||L(!1),setTimeout(()=>{i&&cn(i[0])},yn.DURATION*1e3)}function vn(){if(!Oe.current)return;const Ae=document.querySelector("[data-vaul-drawer-wrapper]"),Ke=Xm(Oe.current,R);qn(Oe.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${yn.DURATION}s cubic-bezier(${yn.EASE.join(",")})`}),qn(j.current,{transition:`opacity ${yn.DURATION}s cubic-bezier(${yn.EASE.join(",")})`,opacity:"1"}),l&&Ke&&Ke>0&&J&&qn(Ae,{borderRadius:`${J6}px`,overflow:"hidden",...Bn(R)?{transform:`scale(${Ve()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ve()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${yn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${yn.EASE.join(",")})`},!0)}function nn(){!ne||!Oe.current||(Oe.current.classList.remove(_y),ye.current=!1,z(!1),me.current=new Date)}function kn(Ae){if(!ne||!Oe.current)return;Oe.current.classList.remove(_y),ye.current=!1,z(!1),me.current=new Date;const Ke=Xm(Oe.current,R);if(!Ae||!st(Ae.target,!1)||!Ke||Number.isNaN(Ke)||ae.current===null)return;const gt=me.current.getTime()-ae.current.getTime(),Je=Re.current-(Bn(R)?Ae.pageY:Ae.pageX),ot=Math.abs(Je)/gt;if(ot>.05&&(V(!0),setTimeout(()=>{V(!1)},200)),i){St({draggedDistance:Je*(R==="bottom"||R==="right"?1:-1),closeDrawer:fn,velocity:ot,dismissible:p}),s==null||s(Ae,!0);return}if(R==="bottom"||R==="right"?Je>0:Je<0){vn(),s==null||s(Ae,!0);return}if(ot>Z6){fn(),s==null||s(Ae,!1);return}var Ie;const tt=Math.min((Ie=Oe.current.getBoundingClientRect().height)!=null?Ie:0,window.innerHeight);var Wt;const $t=Math.min((Wt=Oe.current.getBoundingClientRect().width)!=null?Wt:0,window.innerWidth),dr=R==="left"||R==="right";if(Math.abs(Ke)>=(dr?$t:tt)*f){fn(),s==null||s(Ae,!1);return}s==null||s(Ae,!0),vn()}oe.useEffect(()=>(J&&(qn(document.documentElement,{scrollBehavior:"auto"}),re.current=new Date),()=>{ite(document.documentElement,"scrollBehavior")}),[J]);function Ot(Ae){const Ke=Ae?(window.innerWidth-Mo)/window.innerWidth:1,gt=Ae?-Mo:0;ve.current&&window.clearTimeout(ve.current),qn(Oe.current,{transition:`transform ${yn.DURATION}s cubic-bezier(${yn.EASE.join(",")})`,transform:Bn(R)?`scale(${Ke}) translate3d(0, ${gt}px, 0)`:`scale(${Ke}) translate3d(${gt}px, 0, 0)`}),!Ae&&Oe.current&&(ve.current=setTimeout(()=>{const Je=Xm(Oe.current,R);qn(Oe.current,{transition:"none",transform:Bn(R)?`translate3d(0, ${Je}px, 0)`:`translate3d(${Je}px, 0, 0)`})},500))}function Se(Ae,Ke){if(Ke<0)return;const gt=(window.innerWidth-Mo)/window.innerWidth,Je=gt+Ke*(1-gt),ot=-Mo+Ke*Mo;qn(Oe.current,{transform:Bn(R)?`scale(${Je}) translate3d(0, ${ot}px, 0)`:`scale(${Je}) translate3d(${ot}px, 0, 0)`,transition:"none"})}function qe(Ae,Ke){const gt=Bn(R)?window.innerHeight:window.innerWidth,Je=Ke?(gt-Mo)/gt:1,ot=Ke?-Mo:0;Ke&&qn(Oe.current,{transition:`transform ${yn.DURATION}s cubic-bezier(${yn.EASE.join(",")})`,transform:Bn(R)?`scale(${Je}) translate3d(0, ${ot}px, 0)`:`scale(${Je}) translate3d(${ot}px, 0, 0)`})}return oe.useEffect(()=>{w||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[w]),oe.createElement(T0,{defaultOpen:D,onOpenChange:Ae=>{!p&&!Ae||(Ae?U(!0):fn(!0),L(Ae))},open:J},oe.createElement(G6.Provider,{value:{activeSnapPoint:Tt,snapPoints:i,setActiveSnapPoint:cn,drawerRef:Oe,overlayRef:j,onOpenChange:t,onPress:et,onRelease:kn,onDrag:Dn,dismissible:p,shouldAnimate:$e,handleOnly:m,isOpen:J,isDragging:ne,shouldFade:Rt,closeDrawer:fn,onNestedDrag:Se,onNestedOpenChange:Ot,onNestedRelease:qe,keyboardIsOpen:ke,modal:w,snapPointsOffset:dn,activeSnapPointIndex:Ht,direction:R,shouldScaleBackground:l,setBackgroundColorOnScale:c,noBodyStyles:k,container:K,autoFocus:Y}},n))}const nI=oe.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:l,modal:c,shouldAnimate:f}=ih(),d=X6(t,n),p=r&&r.length>0;if(!c)return null;const m=oe.useCallback(x=>s(x),[s]);return oe.createElement(Yf,{onMouseUp:m,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":l&&p?"true":"false","data-vaul-snap-points-overlay":l&&i?"true":"false","data-vaul-animate":f!=null&&f.current?"true":"false",...e})});nI.displayName="Drawer.Overlay";const rI=oe.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},s){const{drawerRef:i,onPress:l,onRelease:c,onDrag:f,keyboardIsOpen:d,snapPointsOffset:p,activeSnapPointIndex:m,modal:x,isOpen:y,direction:v,snapPoints:T,container:w,handleOnly:N,shouldAnimate:A,autoFocus:k}=ih(),[R,D]=oe.useState(!1),O=X6(s,i),M=oe.useRef(null),I=oe.useRef(null),H=oe.useRef(!1),P=T&&T.length>0;mte();const K=(W,te,J=0)=>{if(H.current)return!0;const L=Math.abs(W.y),B=Math.abs(W.x),U=B>L,ne=["bottom","right"].includes(te)?1:-1;if(te==="left"||te==="right"){if(!(W.x*ne<0)&&B>=0&&B<=J)return U}else if(!(W.y*ne<0)&&L>=0&&L<=J)return!U;return H.current=!0,!0};oe.useEffect(()=>{P&&window.requestAnimationFrame(()=>{D(!0)})},[]);function Y(W){M.current=null,H.current=!1,c(W)}return oe.createElement(Gf,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":R?"true":"false","data-vaul-snap-points":y&&P?"true":"false","data-vaul-custom-container":w?"true":"false","data-vaul-animate":A!=null&&A.current?"true":"false",...r,ref:O,style:p&&p.length>0?{"--snap-point-height":`${p[m??0]}px`,...t}:t,onPointerDown:W=>{N||(r.onPointerDown==null||r.onPointerDown.call(r,W),M.current={x:W.pageX,y:W.pageY},l(W))},onOpenAutoFocus:W=>{n==null||n(W),k||W.preventDefault()},onPointerDownOutside:W=>{if(e==null||e(W),!x||W.defaultPrevented){W.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:W=>{if(!x){W.preventDefault();return}},onPointerMove:W=>{if(I.current=W,N||(r.onPointerMove==null||r.onPointerMove.call(r,W),!M.current))return;const te=W.pageY-M.current.y,J=W.pageX-M.current.x,L=W.pointerType==="touch"?10:2;K({x:J,y:te},v,L)?f(W):(Math.abs(J)>L||Math.abs(te)>L)&&(M.current=null)},onPointerUp:W=>{r.onPointerUp==null||r.onPointerUp.call(r,W),M.current=null,H.current=!1,c(W)},onPointerOut:W=>{r.onPointerOut==null||r.onPointerOut.call(r,W),Y(I.current)},onContextMenu:W=>{r.onContextMenu==null||r.onContextMenu.call(r,W),I.current&&Y(I.current)}})});rI.displayName="Drawer.Content";const xte=250,yte=120,bte=oe.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:s,isDragging:i,snapPoints:l,activeSnapPoint:c,setActiveSnapPoint:f,dismissible:d,handleOnly:p,isOpen:m,onPress:x,onDrag:y}=ih(),v=oe.useRef(null),T=oe.useRef(!1);function w(){if(T.current){k();return}window.setTimeout(()=>{N()},yte)}function N(){if(i||e||T.current){k();return}if(k(),!l||l.length===0){d||s();return}if(c===l[l.length-1]&&d){s();return}const D=l.findIndex(M=>M===c);if(D===-1)return;const O=l[D+1];f(O)}function A(){v.current=window.setTimeout(()=>{T.current=!0},xte)}function k(){v.current&&window.clearTimeout(v.current),T.current=!1}return oe.createElement("div",{onClick:w,onPointerCancel:k,onPointerDown:R=>{p&&x(R),A()},onPointerMove:R=>{p&&y(R)},ref:r,"data-vaul-drawer-visible":m?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},oe.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});bte.displayName="Drawer.Handle";function vte(e){const t=ih(),{container:n=t.container,...r}=e;return oe.createElement(S0,{container:n,...r})}const vl={Root:gte,Content:rI,Overlay:nI,Trigger:aT,Portal:vte,Title:w0,Description:C0},IT=({shouldScaleBackground:e=!0,...t})=>u.jsx(vl.Root,{shouldScaleBackground:e,...t});IT.displayName="Drawer";const Ete=vl.Trigger,Tte=vl.Portal,sI=b.forwardRef(({className:e,...t},n)=>u.jsx(vl.Overlay,{ref:n,className:Ee("fixed inset-0 z-50 bg-black/80",e),...t}));sI.displayName="DrawerOverlay";const LT=b.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Tte,{children:[u.jsx(sI,{}),u.jsxs(vl.Content,{ref:r,className:Ee("bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border",e),...n,children:[u.jsx("div",{className:"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full"}),t]})]}));LT.displayName="DrawerContent";function PT({className:e,...t}){return u.jsx("div",{className:Ee("grid gap-1.5 p-4 text-center sm:text-left",e),...t})}PT.displayName="DrawerHeader";function aI({className:e,...t}){return u.jsx("div",{className:Ee("mt-auto flex flex-col gap-2 p-4",e),...t})}aI.displayName="DrawerFooter";const BT=b.forwardRef(({className:e,...t},n)=>u.jsx(vl.Title,{ref:n,className:Ee("text-lg leading-none font-semibold tracking-tight",e),...t}));BT.displayName="DrawerTitle";const iI=b.forwardRef(({className:e,...t},n)=>u.jsx(vl.Description,{ref:n,className:Ee("text-muted-foreground text-sm",e),...t}));iI.displayName="DrawerDescription";const FT=wZ,zT=CZ,J0=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(NZ,{children:u.jsx(mM,{ref:r,sideOffset:t,className:Ee("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));J0.displayName=mM.displayName;const oI=b.forwardRef(({className:e,...t},n)=>u.jsx(pM,{ref:n,className:Ee("text-muted-foreground px-2 py-1.5 text-xs font-semibold",e),...t}));oI.displayName=pM.displayName;const lI=b.forwardRef(({className:e,...t},n)=>u.jsx(yM,{ref:n,className:Ee("bg-muted -mx-1 my-1 h-px",e),...t}));lI.displayName=yM.displayName;const Lu=b.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(gM,{ref:r,className:Ee("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-xs outline-none select-none","focus:bg-accent focus:text-accent-foreground transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Lu.displayName=gM.displayName;const Ste=AZ,uI=b.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(xM,{ref:r,className:Ee("relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-xs outline-none select-none","focus:bg-accent focus:text-accent-foreground transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[u.jsx("span",{className:"absolute left-2 flex size-(--size-icon-sm) items-center justify-center",children:u.jsx(kZ,{children:u.jsx(zn,{className:"size-(--size-icon-xs)"})})}),t]}));uI.displayName=xM.displayName;function wte({...e}){return u.jsx(LZ,{"data-slot":"hover-card",...e})}function Cte({...e}){return u.jsx(PZ,{"data-slot":"hover-card-trigger",...e})}function Nte({className:e,align:t="center",sideOffset:n=4,...r}){return u.jsx(BZ,{"data-slot":"hover-card-portal",children:u.jsx(FZ,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:Ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function Wa({className:e,children:t,...n}){return u.jsx("kbd",{className:Ee("bg-muted text-muted-foreground pointer-events-none hidden h-5 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium select-none md:inline-flex",e),...n,children:t})}var Ate="Label",cI=b.forwardRef((e,t)=>u.jsx(Ta.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));cI.displayName=Ate;var dI=cI;const Gt=b.forwardRef(({className:e,...t},n)=>u.jsx(dI,{ref:n,className:Ee("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Gt.displayName=dI.displayName;function Dv({path:e,maxSegments:t,onSegmentClick:n,size:r="md"}){if(!e)return null;const s=e.split("/").filter(Boolean),i=t!=null&&s.length>t,l=i?s.slice(-t):s,c=s.length-l.length,f=r==="sm"?"text-2xs":"text-xs",d="size-(--size-icon-xs)",p=r==="sm"?"max-w-[80px]":"max-w-[120px]";return u.jsxs("div",{className:"flex min-w-0 items-center gap-0.5 overflow-hidden",children:[i&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:`${f} text-muted-foreground/50 flex-shrink-0`,children:"..."}),u.jsx(As,{className:`${d} text-muted-foreground/40 flex-shrink-0`})]}),l.map((m,x)=>{const y=c+x,v="/"+s.slice(0,y+1).join("/"),T=y===s.length-1,w=`${f} truncate ${p} ${T?"font-medium text-foreground":"text-muted-foreground"}`;return u.jsxs("span",{className:`flex items-center ${T?"flex-shrink-0":"min-w-0"}`,children:[x>0&&u.jsx(As,{className:`${d} text-muted-foreground/40 flex-shrink-0`}),n?u.jsx("button",{onClick:()=>n(v),className:`hover:bg-accent rounded px-1 py-0.5 transition-colors ${w}`,children:m}):u.jsx("span",{className:w,children:m})]},v)})]})}function kte({...e}){return u.jsx(XZ,{"data-slot":"popover",...e})}function _te({...e}){return u.jsx(WZ,{"data-slot":"popover-trigger",...e})}function Rte({className:e,align:t="center",sideOffset:n=4,...r}){return u.jsx(ZZ,{children:u.jsx(JZ,{"data-slot":"popover-content",align:t,sideOffset:n,className:Ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}const fI=b.createContext(void 0);function Ec(){const e=b.useContext(fI);if(!e)throw new Error("useResponsiveDialog must be used within a <ResponsiveDialog>");return e}function ua({children:e,defaultFullscreen:t=!1,onOpenChange:n,...r}){const s=!pl(),[i,l]=b.useState(t),c=s?sh:IT,f=b.useCallback(m=>{m||l(t),n==null||n(m)},[t,n]),d=b.useCallback(()=>{l(m=>!m)},[]),p=b.useMemo(()=>({isDesktop:s,isFullscreen:s?i:!1,toggleFullscreen:d}),[s,i,d]);return u.jsx(fI.Provider,{value:p,children:u.jsx(c,{...r,onOpenChange:f,children:e})})}ua.displayName="ResponsiveDialog";function ca({className:e,children:t,...n}){const{isDesktop:r,isFullscreen:s}=Ec();return r?u.jsx(yc,{"data-fullscreen":s||void 0,className:Ee("flex min-h-[50vh] flex-col overflow-hidden transition-all duration-300 ease-[cubic-bezier(0,0,0.2,1)]","data-[fullscreen]:top-4 data-[fullscreen]:right-4 data-[fullscreen]:bottom-4 data-[fullscreen]:left-4","data-[fullscreen]:translate-x-0 data-[fullscreen]:translate-y-0","data-[fullscreen]:max-w-none data-[fullscreen]:max-h-none data-[fullscreen]:w-auto data-[fullscreen]:h-auto",e),...n,children:t}):u.jsx(LT,{className:Ee("flex flex-col",e),...n,children:t})}ca.displayName="ResponsiveDialogContent";function da({className:e,...t}){const{isDesktop:n}=Ec(),r=n?bc:PT;return u.jsx(r,{className:Ee(e,n&&"pr-14"),...t})}da.displayName="ResponsiveDialogHeader";function fa({className:e,...t}){const{isDesktop:n}=Ec(),r=n?vc:BT;return u.jsx(r,{className:e,...t})}fa.displayName="ResponsiveDialogTitle";function ha({className:e,...t}){const{isDesktop:n}=Ec(),r=n?ah:iI;return u.jsx(r,{className:e,...t})}ha.displayName="ResponsiveDialogDescription";function hI({className:e,...t}){const{isDesktop:n}=Ec(),r=n?Z0:aI;return u.jsx(r,{className:e,...t})}hI.displayName="ResponsiveDialogFooter";function UT({className:e}){const{isDesktop:t,isFullscreen:n,toggleFullscreen:r}=Ec();if(!t)return null;const s=n?tG:ZY;return u.jsx("button",{type:"button",onClick:r,className:Ee("ring-offset-background focus:ring-ring absolute top-4 right-12 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none",e),"aria-label":n?"Exit fullscreen":"Enter fullscreen",children:u.jsx(s,{className:"size-(--size-icon-md)"})})}UT.displayName="ResponsiveDialogFullscreenToggle";const ao=b.createContext({isDesktop:!0,close:()=>{}});function mI({children:e,open:t,onOpenChange:n}){const r=!pl(),[s,i]=b.useState(!1),l=t??s,c=b.useCallback(d=>{i(d),n==null||n(d)},[n]),f=b.useCallback(()=>{c(!1)},[c]);return r?u.jsx(ao.Provider,{value:{isDesktop:r,close:f},children:u.jsx(FT,{open:t,onOpenChange:n,children:e})}):u.jsx(ao.Provider,{value:{isDesktop:r,close:f},children:u.jsx(IT,{open:l,onOpenChange:c,children:e})})}function pI({className:e,children:t,...n}){const{isDesktop:r}=b.useContext(ao),s=r?zT:Ete;return u.jsx(s,{className:e,...n,children:t})}function gI({className:e,children:t,...n}){const{isDesktop:r}=b.useContext(ao);return r?u.jsx(J0,{className:e,...n,children:t}):u.jsx(LT,{children:u.jsx("div",{className:"pb-6",children:t})})}function xI({className:e,children:t,...n}){const{isDesktop:r}=b.useContext(ao);return r?u.jsx(oI,{className:e,...n,children:t}):u.jsx(PT,{className:"pb-2",children:u.jsx(BT,{className:Ee("text-muted-foreground text-sm font-semibold",e),children:t})})}const yI=b.createContext({closeOnSelect:!0});function bI({value:e,onValueChange:t,closeOnSelect:n=!0,children:r,className:s}){const{isDesktop:i}=b.useContext(ao);return i?u.jsx(Ste,{value:e,onValueChange:t,className:s,children:r}):u.jsx(yI.Provider,{value:{value:e,onValueChange:t,closeOnSelect:n},children:u.jsx("div",{role:"radiogroup",className:Ee("flex flex-col",s),children:r})})}function vI({value:e,children:t,icon:n,description:r,className:s}){const{isDesktop:i}=b.useContext(ao);return i?u.jsx(uI,{value:e,className:s,children:n||r?u.jsxs("div",{className:"flex items-center gap-2",children:[n&&u.jsx(n,{className:"size-(--size-icon-xs) shrink-0"}),u.jsxs("div",{className:"text-left",children:[u.jsx("div",{children:t}),r&&u.jsx("div",{className:"text-muted-foreground text-[10px]",children:r})]})]}):t}):u.jsx(Ote,{value:e,icon:n,description:r,className:s,children:t})}function Ote({value:e,children:t,icon:n,description:r,className:s}){const{value:i,onValueChange:l,closeOnSelect:c}=b.useContext(yI),{close:f}=b.useContext(ao),d=i===e;return u.jsxs("button",{role:"radio","aria-checked":d,className:Ee("border-border flex w-full items-center gap-3 border-b px-4 py-3 text-left transition-colors","active:bg-accent/50 min-h-[44px]","last:border-b-0",s),onClick:()=>{l==null||l(e),c&&f()},children:[n&&u.jsx(n,{className:"size-5 shrink-0"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"text-[17px] leading-snug",children:t}),r&&u.jsx("div",{className:"text-muted-foreground text-[13px] leading-snug",children:r})]}),d&&u.jsx(zn,{className:"text-primary size-5 shrink-0"})]})}const Us=CJ,Hs=NJ,ws=b.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(a6,{ref:r,className:Ee("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,u.jsx(AJ,{asChild:!0,children:u.jsx(ti,{className:"h-4 w-4 opacity-50"})})]}));ws.displayName=a6.displayName;const Cs=b.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>u.jsx(kJ,{children:u.jsx(i6,{ref:s,className:Ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:u.jsx(_J,{className:Ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Cs.displayName=i6.displayName;const Lt=b.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(o6,{ref:r,className:Ee("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[u.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(OJ,{children:u.jsx(zn,{className:"h-4 w-4"})})}),u.jsx(RJ,{children:t})]}));Lt.displayName=o6.displayName;var Dte="Separator",g3="horizontal",jte=["horizontal","vertical"],EI=b.forwardRef((e,t)=>{const{decorative:n,orientation:r=g3,...s}=e,i=Mte(r)?r:g3,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return u.jsx(Ta.div,{"data-orientation":i,...c,...s,ref:t})});EI.displayName=Dte;function Mte(e){return jte.includes(e)}var TI=EI;const HT=b.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>u.jsx(TI,{ref:s,decorative:n,orientation:t,className:Ee("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));HT.displayName=TI.displayName;const xn=b.forwardRef(({className:e,...t},n)=>u.jsx(h6,{className:Ee("peer focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:u.jsx(LJ,{className:Ee("bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));xn.displayName=h6.displayName;const oh=FJ,Tc=b.forwardRef(({className:e,...t},n)=>u.jsx(w6,{ref:n,className:Ee("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...t}));Tc.displayName=w6.displayName;const Gn=b.forwardRef(({className:e,...t},n)=>u.jsx(C6,{ref:n,className:Ee("ring-offset-background inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all","focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Gn.displayName=C6.displayName;const Kn=b.forwardRef(({className:e,...t},n)=>u.jsx(N6,{ref:n,className:Ee("ring-offset-background mt-2","focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));Kn.displayName=N6.displayName;function Ite(e,t){if(e.length===0||e.length===1&&e[0].path===t)return"browse";try{const n=localStorage.getItem(Sr.PICKER_VIEW);if(n){const r=JSON.parse(n);if(Date.now()-new Date(r.timestamp).getTime()<480*60*1e3)return r.view}}catch{}return"recent"}function eg({open:e,onOpenChange:t,onSelect:n,initialPath:r,resolvedAgents:s}){const i=He(),{recentCwds:l}=Jt(),[c,f]=b.useState(r||""),[d,p]=b.useState(!1),[m,x]=b.useState(()=>Ite(l,r??null)),y=b.useCallback(()=>t(!1),[t]),{data:v,isLoading:T}=vt({queryKey:["directory",c,d],queryFn:()=>i.browseDirectory(c||void 0,d),placeholderData:D=>D,staleTime:3e4}),w=b.useCallback(()=>{v!=null&&v.path&&(n(v.path),y())},[v==null?void 0:v.path,n,y]),N=b.useCallback(D=>{x(D);try{localStorage.setItem(Sr.PICKER_VIEW,JSON.stringify({view:D,timestamp:new Date().toISOString()}))}catch{}},[]),A=b.useCallback(D=>{f(D),x("browse")},[]),k=b.useCallback(D=>{n(D),y()},[n,y]),R=(D,O)=>`p-1.5 transition-colors ${O==="left"?"rounded-l-md":"rounded-r-md"} ${D?"bg-accent text-foreground":"text-muted-foreground/40 hover:text-muted-foreground"}`;return u.jsx(ua,{open:e,onOpenChange:t,children:u.jsxs(ca,{className:"max-h-[85vh] max-w-lg gap-0 overflow-hidden p-0 sm:rounded-xl",children:[u.jsx(da,{className:"space-y-0 border-b px-4 py-3",children:u.jsx(fa,{className:"text-sm font-medium",children:"Select Working Directory"})}),u.jsxs("div",{className:"bg-muted/30 flex items-center gap-2 overflow-x-auto border-b px-4 py-2",children:[u.jsxs("div",{className:"flex flex-shrink-0 items-center rounded-md border",children:[l.length>0&&u.jsx("button",{onClick:()=>N("recent"),className:R(m==="recent","left"),"aria-label":"Recent directories",title:"Recent",children:u.jsx(Uf,{className:"size-(--size-icon-sm)"})}),u.jsx("button",{onClick:()=>{N("browse"),A("")},className:R(m==="browse",l.length>0?"right":"left"),"aria-label":"Browse directories",title:"Browse",children:u.jsx(Zo,{className:"size-(--size-icon-sm)"})})]}),m==="browse"?u.jsxs(u.Fragment,{children:[u.jsx(Dv,{path:(v==null?void 0:v.path)??null,maxSegments:5,onSegmentClick:A,size:"md"}),u.jsx("div",{className:"flex-1"}),u.jsx("button",{onClick:()=>p(!d),className:"hover:bg-accent flex-shrink-0 rounded p-1 transition-colors max-md:p-2","aria-label":d?"Hide hidden folders":"Show hidden folders",title:d?"Hide hidden folders":"Show hidden folders",children:d?u.jsx(GO,{className:"text-muted-foreground size-(--size-icon-sm)"}):u.jsx(YO,{className:"text-muted-foreground size-(--size-icon-sm)"})})]}):u.jsx("span",{className:"text-muted-foreground px-1 text-xs",children:"Recent"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:m==="browse"?u.jsx(u.Fragment,{children:T&&!v?u.jsx("div",{className:"flex h-20 items-center justify-center",children:u.jsx(Qn,{className:"text-muted-foreground size-(--size-icon-md) animate-spin"})}):(v==null?void 0:v.entries.length)===0?u.jsx("div",{className:"flex h-20 items-center justify-center",children:u.jsx("p",{className:"text-muted-foreground/60 text-xs",children:"No subdirectories"})}):u.jsxs("div",{className:"py-1",children:[(v==null?void 0:v.parent)&&u.jsxs("button",{onClick:()=>A(v.parent),className:"hover:bg-accent flex w-full items-center gap-2 px-4 py-1.5 text-left transition-colors",children:[u.jsx(Zo,{className:"text-muted-foreground size-(--size-icon-md)"}),u.jsx("span",{className:"text-muted-foreground text-sm",children:".."})]}),v==null?void 0:v.entries.map(D=>u.jsxs("button",{onClick:()=>A(D.path),className:"hover:bg-accent flex w-full items-center gap-2 px-4 py-1.5 text-left transition-colors",children:[u.jsx(Hf,{className:"text-muted-foreground size-(--size-icon-md)"}),u.jsx("span",{className:"truncate text-sm",children:D.name})]},D.path))]})}):u.jsx("div",{className:"py-1",children:l.slice(0,10).map(D=>{const O=(s==null?void 0:s[D.path])??null,M=(O==null?void 0:O.color)??cf((O==null?void 0:O.id)??D.path),I=(O==null?void 0:O.icon)??df((O==null?void 0:O.id)??D.path);return u.jsxs("button",{onClick:()=>k(D.path),className:"hover:bg-accent flex w-full items-center gap-2 px-4 py-1.5 text-left transition-colors",children:[O?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"size-2 flex-shrink-0 rounded-full",style:{backgroundColor:M}}),u.jsx("span",{className:"text-sm",children:I}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:O.name}),u.jsx("span",{className:"text-muted-foreground truncate text-xs",children:Op(D.path)})]}):u.jsxs(u.Fragment,{children:[u.jsx(Zo,{className:"text-muted-foreground size-(--size-icon-md) flex-shrink-0"}),u.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-sm",children:Op(D.path)})]}),u.jsx("span",{className:"text-muted-foreground/50 ml-auto flex-shrink-0 text-[11px]",children:Dp(D.accessedAt)})]},D.path)})})}),u.jsxs("div",{className:"bg-muted/20 flex items-center justify-end gap-2 border-t px-4 py-3",children:[u.jsx("button",{onClick:y,className:"hover:bg-accent rounded-md px-3 py-1.5 text-xs transition-colors",children:"Cancel"}),u.jsx("button",{onClick:w,disabled:!(v!=null&&v.path)||m!=="browse",className:"bg-primary text-primary-foreground hover:bg-primary/90 rounded-md px-3 py-1.5 text-xs transition-colors disabled:opacity-50",children:"Select"})]})]})})}function Bs({className:e,...t}){return u.jsx("div",{"data-slot":"skeleton",className:Ee("bg-accent animate-pulse rounded-md",e),...t})}function $T({className:e,...t}){return u.jsx("textarea",{"data-slot":"textarea",className:Ee("placeholder:text-muted-foreground dark:bg-input/30 border-input flex min-h-[60px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}function Lte(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 Pte=e=>{switch(e){case"success":return zte;case"info":return Hte;case"warning":return Ute;case"error":return $te;default:return null}},Bte=Array(12).fill(0),Fte=({visible:e,className:t})=>oe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},oe.createElement("div",{className:"sonner-spinner"},Bte.map((n,r)=>oe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),zte=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},oe.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"})),Ute=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},oe.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"})),Hte=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},oe.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"})),$te=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},oe.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"})),Vte=oe.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"},oe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),oe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qte=()=>{const[e,t]=oe.useState(document.hidden);return oe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let jv=1;class Yte{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:jv++,l=this.toasts.find(f=>f.id===i),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),l?this.toasts=this.toasts.map(f=>f.id===i?(this.publish({...f,...t,id:i,title:r}),{...f,...t,id:i,dismissible:c,title:r}):f):this.addToast({title:r,...s,dismissible:c,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,l;const c=s.then(async d=>{if(l=["resolve",d],oe.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(Kte(d)&&!d.ok){i=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,x=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,v=typeof m=="object"&&!oe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:x,...v})}else if(d instanceof Error){i=!1;const m=typeof n.error=="function"?await n.error(d):n.error,x=typeof n.description=="function"?await n.description(d):n.description,v=typeof m=="object"&&!oe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:x,...v})}else if(n.success!==void 0){i=!1;const m=typeof n.success=="function"?await n.success(d):n.success,x=typeof n.description=="function"?await n.description(d):n.description,v=typeof m=="object"&&!oe.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:x,...v})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,y=typeof p=="object"&&!oe.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,p)=>c.then(()=>l[0]==="reject"?p(l[1]):d(l[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||jv++;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 Hr=new Yte,Gte=(e,t)=>{const n=(t==null?void 0:t.id)||jv++;return Hr.addToast({title:e,...t,id:n}),n},Kte=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Qte=Gte,Xte=()=>Hr.toasts,Wte=()=>Hr.getActiveToasts(),Cn=Object.assign(Qte,{success:Hr.success,info:Hr.info,warning:Hr.warning,error:Hr.error,custom:Hr.custom,message:Hr.message,promise:Hr.promise,dismiss:Hr.dismiss,loading:Hr.loading},{getHistory:Xte,getToasts:Wte});Lte("[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 Wm(e){return e.label!==void 0}const Zte=3,Jte="24px",ene="16px",x3=4e3,tne=356,nne=14,rne=45,sne=200;function Zs(...e){return e.filter(Boolean).join(" ")}function ane(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const ine=e=>{var t,n,r,s,i,l,c,f,d;const{invert:p,toast:m,unstyled:x,interacting:y,setHeights:v,visibleToasts:T,heights:w,index:N,toasts:A,expanded:k,removeToast:R,defaultRichColors:D,closeButton:O,style:M,cancelButtonStyle:I,actionButtonStyle:H,className:P="",descriptionClassName:K="",duration:Y,position:W,gap:te,expandByDefault:J,classNames:L,icons:B,closeButtonAriaLabel:U="Close toast"}=e,[ne,z]=oe.useState(null),[q,V]=oe.useState(null),[j,re]=oe.useState(!1),[ae,me]=oe.useState(!1),[le,ye]=oe.useState(!1),[ve,Re]=oe.useState(!1),[ke,$e]=oe.useState(!1),[Et,Oe]=oe.useState(0),[Xt,un]=oe.useState(0),tn=oe.useRef(m.duration||Y||x3),pt=oe.useRef(null),Tt=oe.useRef(null),Ht=N===0,cn=N+1<=T,St=m.type,dn=m.dismissible!==!1,it=m.className||"",Rt=m.descriptionClassName||"",pe=oe.useMemo(()=>w.findIndex(Ie=>Ie.toastId===m.id)||0,[w,m.id]),Ne=oe.useMemo(()=>{var Ie;return(Ie=m.closeButton)!=null?Ie:O},[m.closeButton,O]),Ve=oe.useMemo(()=>m.duration||Y||x3,[m.duration,Y]),et=oe.useRef(0),st=oe.useRef(0),Dn=oe.useRef(0),fn=oe.useRef(null),[vn,nn]=W.split("-"),kn=oe.useMemo(()=>w.reduce((Ie,tt,Wt)=>Wt>=pe?Ie:Ie+tt.height,0),[w,pe]),Ot=qte(),Se=m.invert||p,qe=St==="loading";st.current=oe.useMemo(()=>pe*te+kn,[pe,kn]),oe.useEffect(()=>{tn.current=Ve},[Ve]),oe.useEffect(()=>{re(!0)},[]),oe.useEffect(()=>{const Ie=Tt.current;if(Ie){const tt=Ie.getBoundingClientRect().height;return un(tt),v(Wt=>[{toastId:m.id,height:tt,position:m.position},...Wt]),()=>v(Wt=>Wt.filter($t=>$t.toastId!==m.id))}},[v,m.id]),oe.useLayoutEffect(()=>{if(!j)return;const Ie=Tt.current,tt=Ie.style.height;Ie.style.height="auto";const Wt=Ie.getBoundingClientRect().height;Ie.style.height=tt,un(Wt),v($t=>$t.find(jt=>jt.toastId===m.id)?$t.map(jt=>jt.toastId===m.id?{...jt,height:Wt}:jt):[{toastId:m.id,height:Wt,position:m.position},...$t])},[j,m.title,m.description,v,m.id,m.jsx,m.action,m.cancel]);const Ae=oe.useCallback(()=>{me(!0),Oe(st.current),v(Ie=>Ie.filter(tt=>tt.toastId!==m.id)),setTimeout(()=>{R(m)},sne)},[m,R,v,st]);oe.useEffect(()=>{if(m.promise&&St==="loading"||m.duration===1/0||m.type==="loading")return;let Ie;return k||y||Ot?(()=>{if(Dn.current<et.current){const $t=new Date().getTime()-et.current;tn.current=tn.current-$t}Dn.current=new Date().getTime()})():(()=>{tn.current!==1/0&&(et.current=new Date().getTime(),Ie=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Ae()},tn.current))})(),()=>clearTimeout(Ie)},[k,y,m,St,Ot,Ae]),oe.useEffect(()=>{m.delete&&(Ae(),m.onDismiss==null||m.onDismiss.call(m,m))},[Ae,m.delete]);function Ke(){var Ie;if(B!=null&&B.loading){var tt;return oe.createElement("div",{className:Zs(L==null?void 0:L.loader,m==null||(tt=m.classNames)==null?void 0:tt.loader,"sonner-loader"),"data-visible":St==="loading"},B.loading)}return oe.createElement(Fte,{className:Zs(L==null?void 0:L.loader,m==null||(Ie=m.classNames)==null?void 0:Ie.loader),visible:St==="loading"})}const gt=m.icon||(B==null?void 0:B[St])||Pte(St);var Je,ot;return oe.createElement("li",{tabIndex:0,ref:Tt,className:Zs(P,it,L==null?void 0:L.toast,m==null||(t=m.classNames)==null?void 0:t.toast,L==null?void 0:L.default,L==null?void 0:L[St],m==null||(n=m.classNames)==null?void 0:n[St]),"data-sonner-toast":"","data-rich-colors":(Je=m.richColors)!=null?Je:D,"data-styled":!(m.jsx||m.unstyled||x),"data-mounted":j,"data-promise":!!m.promise,"data-swiped":ke,"data-removed":ae,"data-visible":cn,"data-y-position":vn,"data-x-position":nn,"data-index":N,"data-front":Ht,"data-swiping":le,"data-dismissible":dn,"data-type":St,"data-invert":Se,"data-swipe-out":ve,"data-swipe-direction":q,"data-expanded":!!(k||J&&j),"data-testid":m.testId,style:{"--index":N,"--toasts-before":N,"--z-index":A.length-N,"--offset":`${ae?Et:st.current}px`,"--initial-height":J?"auto":`${Xt}px`,...M,...m.style},onDragEnd:()=>{ye(!1),z(null),fn.current=null},onPointerDown:Ie=>{Ie.button!==2&&(qe||!dn||(pt.current=new Date,Oe(st.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(ye(!0),fn.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,tt,Wt;if(ve||!dn)return;fn.current=null;const $t=Number(((Ie=Tt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dr=Number(((tt=Tt.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),jt=new Date().getTime()-((Wt=pt.current)==null?void 0:Wt.getTime()),an=ne==="x"?$t:dr,rs=Math.abs(an)/jt;if(Math.abs(an)>=rne||rs>.11){Oe(st.current),m.onDismiss==null||m.onDismiss.call(m,m),V(ne==="x"?$t>0?"right":"left":dr>0?"down":"up"),Ae(),Re(!0);return}else{var rr,Rr;(rr=Tt.current)==null||rr.style.setProperty("--swipe-amount-x","0px"),(Rr=Tt.current)==null||Rr.style.setProperty("--swipe-amount-y","0px")}$e(!1),ye(!1),z(null)},onPointerMove:Ie=>{var tt,Wt,$t;if(!fn.current||!dn||((tt=window.getSelection())==null?void 0:tt.toString().length)>0)return;const jt=Ie.clientY-fn.current.y,an=Ie.clientX-fn.current.x;var rs;const rr=(rs=e.swipeDirections)!=null?rs:ane(W);!ne&&(Math.abs(an)>1||Math.abs(jt)>1)&&z(Math.abs(an)>Math.abs(jt)?"x":"y");let Rr={x:0,y:0};const Cl=_s=>1/(1.5+Math.abs(_s)/20);if(ne==="y"){if(rr.includes("top")||rr.includes("bottom"))if(rr.includes("top")&&jt<0||rr.includes("bottom")&&jt>0)Rr.y=jt;else{const _s=jt*Cl(jt);Rr.y=Math.abs(_s)<Math.abs(jt)?_s:jt}}else if(ne==="x"&&(rr.includes("left")||rr.includes("right")))if(rr.includes("left")&&an<0||rr.includes("right")&&an>0)Rr.x=an;else{const _s=an*Cl(an);Rr.x=Math.abs(_s)<Math.abs(an)?_s:an}(Math.abs(Rr.x)>0||Math.abs(Rr.y)>0)&&$e(!0),(Wt=Tt.current)==null||Wt.style.setProperty("--swipe-amount-x",`${Rr.x}px`),($t=Tt.current)==null||$t.style.setProperty("--swipe-amount-y",`${Rr.y}px`)}},Ne&&!m.jsx&&St!=="loading"?oe.createElement("button",{"aria-label":U,"data-disabled":qe,"data-close-button":!0,onClick:qe||!dn?()=>{}:()=>{Ae(),m.onDismiss==null||m.onDismiss.call(m,m)},className:Zs(L==null?void 0:L.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(ot=B==null?void 0:B.close)!=null?ot:Vte):null,(St||m.icon||m.promise)&&m.icon!==null&&((B==null?void 0:B[St])!==null||m.icon)?oe.createElement("div",{"data-icon":"",className:Zs(L==null?void 0:L.icon,m==null||(s=m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Ke():null,m.type!=="loading"?gt:null):null,oe.createElement("div",{"data-content":"",className:Zs(L==null?void 0:L.content,m==null||(i=m.classNames)==null?void 0:i.content)},oe.createElement("div",{"data-title":"",className:Zs(L==null?void 0:L.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?oe.createElement("div",{"data-description":"",className:Zs(K,Rt,L==null?void 0:L.description,m==null||(c=m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),oe.isValidElement(m.cancel)?m.cancel:m.cancel&&Wm(m.cancel)?oe.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:Ie=>{Wm(m.cancel)&&dn&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Ie),Ae())},className:Zs(L==null?void 0:L.cancelButton,m==null||(f=m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,oe.isValidElement(m.action)?m.action:m.action&&Wm(m.action)?oe.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:Ie=>{Wm(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Ie),!Ie.defaultPrevented&&Ae())},className:Zs(L==null?void 0:L.actionButton,m==null||(d=m.classNames)==null?void 0:d.actionButton)},m.action.label):null)};function y3(){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 one(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,l=i?"--mobile-offset":"--offset",c=i?ene:Jte;function f(d){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=c:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(c)}),n}const lne=oe.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:p,mobileOffset:m,theme:x="light",richColors:y,duration:v,style:T,visibleToasts:w=Zte,toastOptions:N,dir:A=y3(),gap:k=nne,icons:R,containerAriaLabel:D="Notifications"}=t,[O,M]=oe.useState([]),I=oe.useMemo(()=>r?O.filter(j=>j.toasterId===r):O.filter(j=>!j.toasterId),[O,r]),H=oe.useMemo(()=>Array.from(new Set([i].concat(I.filter(j=>j.position).map(j=>j.position)))),[I,i]),[P,K]=oe.useState([]),[Y,W]=oe.useState(!1),[te,J]=oe.useState(!1),[L,B]=oe.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=oe.useRef(null),ne=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=oe.useRef(null),q=oe.useRef(!1),V=oe.useCallback(j=>{M(re=>{var ae;return(ae=re.find(me=>me.id===j.id))!=null&&ae.delete||Hr.dismiss(j.id),re.filter(({id:me})=>me!==j.id)})},[]);return oe.useEffect(()=>Hr.subscribe(j=>{if(j.dismiss){requestAnimationFrame(()=>{M(re=>re.map(ae=>ae.id===j.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{rD.flushSync(()=>{M(re=>{const ae=re.findIndex(me=>me.id===j.id);return ae!==-1?[...re.slice(0,ae),{...re[ae],...j},...re.slice(ae+1)]:[j,...re]})})})}),[O]),oe.useEffect(()=>{if(x!=="system"){B(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const j=window.matchMedia("(prefers-color-scheme: dark)");try{j.addEventListener("change",({matches:re})=>{B(re?"dark":"light")})}catch{j.addListener(({matches:ae})=>{try{B(ae?"dark":"light")}catch(me){console.error(me)}})}},[x]),oe.useEffect(()=>{O.length<=1&&W(!1)},[O]),oe.useEffect(()=>{const j=re=>{var ae;if(l.every(ye=>re[ye]||re.code===ye)){var le;W(!0),(le=U.current)==null||le.focus()}re.code==="Escape"&&(document.activeElement===U.current||(ae=U.current)!=null&&ae.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[l]),oe.useEffect(()=>{if(U.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,q.current=!1)}},[U.current]),oe.createElement("section",{ref:n,"aria-label":`${D} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((j,re)=>{var ae;const[me,le]=j.split("-");return I.length?oe.createElement("ol",{key:j,dir:A==="auto"?y3():A,tabIndex:-1,ref:U,className:d,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":me,"data-x-position":le,style:{"--front-toast-height":`${((ae=P[0])==null?void 0:ae.height)||0}px`,"--width":`${tne}px`,"--gap":`${k}px`,...T,...one(p,m)},onBlur:ye=>{q.current&&!ye.currentTarget.contains(ye.relatedTarget)&&(q.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||q.current||(q.current=!0,z.current=ye.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{te||W(!1)},onDragEnd:()=>W(!1),onPointerDown:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||J(!0)},onPointerUp:()=>J(!1)},I.filter(ye=>!ye.position&&re===0||ye.position===j).map((ye,ve)=>{var Re,ke;return oe.createElement(ine,{key:ye.id,icons:R,index:ve,toast:ye,defaultRichColors:y,duration:(Re=N==null?void 0:N.duration)!=null?Re:v,className:N==null?void 0:N.className,descriptionClassName:N==null?void 0:N.descriptionClassName,invert:s,visibleToasts:w,closeButton:(ke=N==null?void 0:N.closeButton)!=null?ke:f,interacting:te,position:j,style:N==null?void 0:N.style,unstyled:N==null?void 0:N.unstyled,classNames:N==null?void 0:N.classNames,cancelButtonStyle:N==null?void 0:N.cancelButtonStyle,actionButtonStyle:N==null?void 0:N.actionButtonStyle,closeButtonAriaLabel:N==null?void 0:N.closeButtonAriaLabel,removeToast:V,toasts:I.filter($e=>$e.position==ye.position),heights:P.filter($e=>$e.position==ye.position),setHeights:K,expandByDefault:c,gap:k,expanded:Y,swipeDirections:t.swipeDirections})})):null}))});function b3({...e}){const{theme:t}=gE();return u.jsx(lne,{theme:t,className:"toaster group",icons:{success:u.jsx(zf,{className:"size-4"}),info:u.jsx(KO,{className:"size-4"}),warning:u.jsx(fc,{className:"size-4"}),error:u.jsx(cG,{className:"size-4"}),loading:u.jsx(Qn,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})}function v3({delayDuration:e=700,...t}){return u.jsx(nee,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Jo({...e}){return u.jsx(ree,{"data-slot":"tooltip",...e})}function el({...e}){return u.jsx(see,{"data-slot":"tooltip-trigger",...e})}function tl({className:e,sideOffset:t=4,...n}){return u.jsx(aee,{children:u.jsx(iee,{"data-slot":"tooltip-content",sideOffset:t,className:Ee("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n})})}function VT({icon:e,name:t,description:n,command:r}){return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[u.jsx(e,{className:"size-8 text-muted-foreground/50"}),u.jsxs("div",{children:[u.jsxs("p",{className:"font-medium",children:[t," is currently disabled"]}),u.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n})]}),u.jsx("code",{className:"mt-2 rounded-md bg-muted px-3 py-1.5 font-mono text-sm",children:r})]})}function qT(){return xE("pulse")}const tg=["pulse","schedules"];function une(e=!0){const t=He();return vt({queryKey:[...tg],queryFn:()=>t.listSchedules(),enabled:e})}function SI(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.createSchedule(n),onSuccess:()=>{t.invalidateQueries({queryKey:[...tg]})}})}function wI(){const e=He(),t=Qt();return Nn({mutationFn:({id:n,...r})=>e.updateSchedule(n,r),onSuccess:()=>{t.invalidateQueries({queryKey:[...tg]})}})}function cne(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.deleteSchedule(n),onSuccess:()=>{t.invalidateQueries({queryKey:[...tg]})}})}function dne(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.triggerSchedule(n),onSuccess:()=>{t.invalidateQueries({queryKey:["pulse","runs"]})}})}const YT=["pulse","runs"];function CI(e,t=!0){const n=He();return vt({queryKey:[...YT,e],queryFn:()=>n.listRuns(e),refetchInterval:r=>{var s;return(s=r.state.data)!=null&&s.some(i=>i.status==="running")?1e4:!1},enabled:t})}function fne(e=!0){const t=He();return vt({queryKey:[...YT,"active-count"],queryFn:async()=>(await t.listRuns({limit:50})).filter(r=>r.status==="running").length,enabled:e,refetchInterval:1e4})}function hne(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.cancelRun(n),onSuccess:()=>{t.invalidateQueries({queryKey:[...YT]})}})}const mne="dorkos-pulse-last-viewed";function pne(e=!0){const{data:t}=CI({limit:50},e),n=b.useRef(new Set),r=b.useRef(0),[,s]=b.useState(0);b.useEffect(()=>{if(!t)return;const l=new Set(t.filter(d=>d.status==="running").map(d=>d.id)),c=n.current;let f=0;for(const d of c){const p=t.find(m=>m.id===d);p&&p.status!=="running"&&f++}f>0&&(r.current+=f,s(d=>d+1)),n.current=l},[t]);const i=b.useCallback(()=>{r.current=0,localStorage.setItem(mne,new Date().toISOString()),s(l=>l+1)},[]);return{unviewedCount:r.current,clearBadge:i}}function lh(){return xE("relay")}const gne=["relay","messages"];function xne(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.sendRelayMessage(n),onSuccess:()=>{t.invalidateQueries({queryKey:[...gne]})}})}const yne=["relay","endpoints"];function bne(e=!0){const t=He();return vt({queryKey:[...yne],queryFn:()=>t.listRelayEndpoints(),enabled:e,staleTime:3e4})}const vne=3;function Ene(e,t){const n=Qt(),[r,s]=b.useState("connected"),[i,l]=b.useState(0);return b.useEffect(()=>{if(!e)return;const c="",f=new EventSource(`/api/relay/stream${c}`);return f.onopen=()=>{s("connected"),l(0)},f.onerror=()=>{l(d=>{const p=d+1;return s(p>=vne?"disconnected":"reconnecting"),p})},f.addEventListener("relay_message",d=>{try{const p=JSON.parse(d.data);n.setQueryData(["relay","messages",void 0],m=>m?{...m,messages:[p,...m.messages]}:{messages:[p]})}catch{console.warn("[Relay] Failed to parse relay_message event:",d.data)}}),f.addEventListener("relay_delivery",d=>{try{const p=JSON.parse(d.data);n.setQueryData(["relay","messages",void 0],m=>m&&{...m,messages:m.messages.map(x=>{const y=x;return y.id===p.messageId?{...y,status:p.status}:x})})}catch{console.warn("[Relay] Failed to parse relay_delivery event:",d.data)}}),()=>f.close()},[e,t,n]),{connectionState:r,failedAttempts:i}}const NI=["relay","adapters"],Cd=["relay","adapters","catalog"];function Tye(e=!0){const t=He();return vt({queryKey:[...NI],queryFn:()=>t.listRelayAdapters(),enabled:e,refetchInterval:1e4})}function Tne(){const e=He(),t=Qt();return Nn({mutationFn:({id:n,enabled:r})=>e.toggleRelayAdapter(n,r),onMutate:async({id:n,enabled:r})=>{await t.cancelQueries({queryKey:[...Cd]});const s=t.getQueryData([...Cd]);return s&&t.setQueryData([...Cd],i=>i==null?void 0:i.map(l=>({...l,instances:l.instances.map(c=>c.id===n?{...c,enabled:r}:c)}))),{previousCatalog:s}},onError:(n,r,s)=>{s!=null&&s.previousCatalog&&t.setQueryData([...Cd],s.previousCatalog),Cn.error("Failed to toggle adapter")},onSettled:()=>{t.invalidateQueries({queryKey:[...NI]}),t.invalidateQueries({queryKey:[...Cd]})}})}const ng=["relay","adapters","catalog"],GT=["relay","adapters"];function KT(e){return e instanceof Error?e.message:"An unexpected error occurred"}function AI(e=!0){const t=He();return vt({queryKey:[...ng],queryFn:()=>t.getAdapterCatalog(),enabled:e,refetchInterval:3e4})}function Sne(){const e=He(),t=Qt();return Nn({mutationFn:({type:n,id:r,config:s})=>e.addRelayAdapter(n,r,s),onSuccess:()=>{t.invalidateQueries({queryKey:[...ng]}),t.invalidateQueries({queryKey:[...GT]}),Cn.success("Adapter added")},onError:n=>{Cn.error(KT(n))}})}function wne(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.removeRelayAdapter(n),onSuccess:()=>{t.invalidateQueries({queryKey:[...ng]}),t.invalidateQueries({queryKey:[...GT]}),Cn.success("Adapter removed")},onError:n=>{Cn.error(KT(n))}})}function Cne(){const e=He(),t=Qt();return Nn({mutationFn:({id:n,config:r})=>e.updateRelayAdapterConfig(n,r),onSuccess:()=>{t.invalidateQueries({queryKey:[...ng]}),t.invalidateQueries({queryKey:[...GT]}),Cn.success("Configuration updated")},onError:n=>{Cn.error(KT(n))}})}function Nne(){const e=He();return Nn({mutationFn:({type:t,config:n})=>e.testRelayAdapterConnection(t,n)})}function Ane(e){const t=He();return vt({queryKey:["relay","trace",e],queryFn:()=>t.getRelayTrace(e),enabled:!!e,staleTime:3e4})}function kI(){const e=He();return vt({queryKey:["relay","metrics"],queryFn:()=>e.getRelayDeliveryMetrics(),staleTime:3e4,refetchInterval:3e4})}const kne=["relay","dead-letters"];function _ne(e,t=!0){const n=He();return vt({queryKey:[...kne,e],queryFn:async()=>await n.listRelayDeadLetters(e),enabled:t,refetchInterval:3e4})}const Rne=["relay","conversations"];function One(e=!0){const t=He();return vt({queryKey:[...Rne],queryFn:()=>t.listRelayConversations(),enabled:e,refetchInterval:5e3})}function rg(){return xE("mesh")}const Dne=["mesh","agent-paths"];function jne(){const e=He();return vt({queryKey:[...Dne],queryFn:()=>e.listMeshAgentPaths(),staleTime:3e4})}const Mne=["mesh","agents"];function _I(e,t=!0){const n=He();return vt({queryKey:[...Mne,e],queryFn:()=>n.listMeshAgents(e),enabled:t,staleTime:3e4})}function Ine(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.discoverMeshAgents(n.roots,n.maxDepth),onSuccess:()=>{t.invalidateQueries({queryKey:["mesh","agents"]})}})}function QT(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.registerMeshAgent(n.path,n.overrides,n.approver),onSuccess:()=>{t.invalidateQueries({queryKey:["mesh","agents"]}),t.invalidateQueries({queryKey:["mesh","agent-paths"]})}})}function Lne(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.denyMeshAgent(n.path,n.reason,n.denier),onSuccess:()=>{t.invalidateQueries({queryKey:["mesh","denied"]})}})}function Pne(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.unregisterMeshAgent(n),onSuccess:()=>{t.invalidateQueries({queryKey:["mesh","agents"]})}})}const Bne=["mesh","denied"];function Fne(e=!0){const t=He();return vt({queryKey:[...Bne],queryFn:()=>t.listDeniedMeshAgents(),enabled:e,staleTime:3e4})}const zne=["mesh","status"],Une=3e4;function Hne(e=!0){const t=He();return vt({queryKey:[...zne],queryFn:()=>t.getMeshStatus(),enabled:e,refetchInterval:Une})}function RI(e){const t=He();return vt({queryKey:["mesh","agent-health",e],queryFn:()=>t.getMeshAgentHealth(e),enabled:e!==null})}const $ne=["mesh","topology"];function Vne(e,t=!0){const n=He();return vt({queryKey:[...$ne,e],queryFn:()=>n.getMeshTopology(e),enabled:t,staleTime:3e4,refetchInterval:3e4})}const qne=["mesh","topology"];function Yne(){const e=He(),t=Qt();return Nn({mutationFn:n=>e.updateMeshAccessRule(n),onSuccess:()=>{t.invalidateQueries({queryKey:qne})}})}function Gne(){var d;const e=He(),t=Qt(),{data:n}=vt({queryKey:["config"],queryFn:()=>e.getConfig(),staleTime:300*1e3}),r=((d=n==null?void 0:n.mesh)==null?void 0:d.scanRoots)??[],s=(n==null?void 0:n.boundary)??"",i=r.length>0?r:s?[s]:[],{mutate:l,isPending:c}=Nn({mutationFn:async p=>{await e.updateConfig({mesh:{scanRoots:p}})},onSuccess:()=>{t.invalidateQueries({queryKey:["config"]})}}),f=b.useCallback(p=>l(p),[l]);return{roots:i,boundary:s,isSaving:c,setScanRoots:f}}function E3(e){try{return new Date(e).toLocaleString([],{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function Kne({text:e,label:t}){const[n,r]=b.useState(!1),s=b.useCallback(async i=>{i.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),Ns.COPY_FEEDBACK_MS)}catch{}},[e]);return u.jsx("button",{onClick:s,className:"hover:bg-secondary/80 text-muted-foreground/60 hover:text-muted-foreground rounded p-0.5 transition-colors duration-100 max-md:p-2","aria-label":`Copy ${t}`,children:n?u.jsx(zn,{className:"size-(--size-icon-xs) text-green-500"}):u.jsx(JE,{className:"size-(--size-icon-xs)"})})}function Qne({session:e,isActive:t,onClick:n,isNew:r=!1}){const[s,i]=b.useState(!1),l=e.permissionMode==="bypassPermissions",c=r?De.div:"div",f=r?{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.2,ease:[0,0,.2,1]}}:{};function d(p){p.stopPropagation(),i(m=>!m)}return u.jsxs(c,{...f,"data-testid":"session-item",className:Ee("group rounded-lg transition-colors duration-150",t?"bg-secondary text-foreground border-primary border-l-2":"hover:bg-secondary/50 border-l-2 border-transparent"),children:[u.jsxs("div",{role:"button",tabIndex:0,onClick:()=>{n()},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),n())},className:"cursor-pointer px-3 py-2",children:[u.jsxs("div",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[u.jsx("span",{className:"min-w-0 flex-1",children:Dp(e.updatedAt)}),u.jsxs("span",{className:"flex flex-shrink-0 items-center gap-1",children:[l&&u.jsx(tD,{className:"size-(--size-icon-xs) text-red-500","aria-label":"Permissions skipped"}),u.jsx("button",{onClick:d,className:Ee("rounded p-0.5 transition-all duration-150 max-md:hidden max-md:p-2",s?"text-muted-foreground opacity-100":"text-muted-foreground/60 hover:text-muted-foreground opacity-0 group-hover:opacity-100"),"aria-label":"Session details",children:u.jsx(De.div,{animate:{rotate:s?180:0},transition:{type:"spring",stiffness:400,damping:30},children:u.jsx(ti,{className:"size-(--size-icon-sm)"})})})]})]}),u.jsx("div",{className:"text-muted-foreground/70 mt-0.5 truncate text-xs",children:e.title})]}),u.jsx(ft,{initial:!1,children:s&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:[0,0,.2,1]},className:"overflow-hidden",children:u.jsxs("div",{className:"text-muted-foreground border-border/30 mx-2 space-y-1.5 border-t px-3 pt-2 pb-2 text-[11px]",children:[u.jsx(Zm,{label:"Session ID",value:e.id,copyable:!0}),u.jsx(Zm,{label:"Created",value:E3(e.createdAt)}),u.jsx(Zm,{label:"Updated",value:E3(e.updatedAt)}),u.jsx(Zm,{label:"Permissions",value:l?"Skip (unsafe)":"Default"})]})})})]})}function Zm({label:e,value:t,copyable:n=!1}){return u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("span",{className:"text-muted-foreground/60 w-16 flex-shrink-0",children:e}),u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono select-all",children:t}),n&&u.jsx(Kne,{text:t,label:e})]})}function Xne({cwd:e,onOpenPicker:t,onOpenAgentDialog:n}){const{data:r,isLoading:s}=bE(e),i=e4(),l=n4(r??null,e),c=async()=>{try{await i.mutateAsync({path:e}),n()}catch{}};return s?u.jsx(Bs,{className:"h-10 w-full"}):r?u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsxs("div",{className:"flex min-w-0 items-start gap-2 px-2 py-1.5",children:[u.jsx("span",{className:"mt-1 size-2.5 flex-shrink-0 rounded-full",style:{backgroundColor:l.color}}),u.jsxs("button",{onClick:n,className:"hover:bg-accent min-w-0 flex-1 rounded-md px-1 py-0.5 text-left","aria-label":`Agent settings for ${r.name}`,children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-sm",children:l.emoji}),u.jsx("span",{className:"truncate text-sm font-semibold",children:r.name})]}),r.description&&u.jsx("p",{className:"text-muted-foreground truncate text-xs",children:r.description})]}),u.jsx("button",{onClick:n,className:"hover:bg-accent text-muted-foreground hover:text-foreground flex-shrink-0 rounded-md p-1 transition-colors duration-150","aria-label":"Agent settings",children:u.jsx(g0,{className:"size-(--size-icon-sm)"})})]}),u.jsx("button",{onClick:t,className:"text-muted-foreground hover:text-foreground truncate px-2 text-left text-xs transition-colors duration-150",title:e,"aria-label":"Change working directory",children:u.jsx(Dv,{path:e,maxSegments:3,size:"sm"})})]}):u.jsxs("div",{className:"flex min-w-0 items-center gap-1 px-2 py-1.5",children:[u.jsxs("button",{onClick:t,className:"hover:bg-accent flex min-w-0 flex-1 items-center gap-1 rounded-md px-1 py-0.5 transition-colors duration-150",title:e,"aria-label":"Change working directory",children:[u.jsx(Hf,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),u.jsx(Dv,{path:e,maxSegments:3,size:"sm"})]}),u.jsx("button",{onClick:c,disabled:i.isPending,className:"text-muted-foreground hover:text-foreground whitespace-nowrap text-xs transition-colors duration-150 disabled:opacity-50","aria-label":"Create agent for this directory",children:"+ Agent"})]})}/**
|
|
538
|
-
* @license lucide-react v0.576.0 - ISC
|
|
539
|
-
*
|
|
540
|
-
* This source code is licensed under the ISC license.
|
|
541
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
542
|
-
*/const OI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
543
|
-
* @license lucide-react v0.576.0 - ISC
|
|
544
|
-
*
|
|
545
|
-
* This source code is licensed under the ISC license.
|
|
546
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
547
|
-
*/const Wne=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
548
|
-
* @license lucide-react v0.576.0 - ISC
|
|
549
|
-
*
|
|
550
|
-
* This source code is licensed under the ISC license.
|
|
551
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
552
|
-
*/const Zne=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
553
|
-
* @license lucide-react v0.576.0 - ISC
|
|
554
|
-
*
|
|
555
|
-
* This source code is licensed under the ISC license.
|
|
556
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
557
|
-
*/const T3=e=>{const t=Zne(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
558
|
-
* @license lucide-react v0.576.0 - ISC
|
|
559
|
-
*
|
|
560
|
-
* This source code is licensed under the ISC license.
|
|
561
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
562
|
-
*/var Jne={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"};/**
|
|
563
|
-
* @license lucide-react v0.576.0 - ISC
|
|
564
|
-
*
|
|
565
|
-
* This source code is licensed under the ISC license.
|
|
566
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
567
|
-
*/const ere=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
568
|
-
* @license lucide-react v0.576.0 - ISC
|
|
569
|
-
*
|
|
570
|
-
* This source code is licensed under the ISC license.
|
|
571
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
572
|
-
*/const tre=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:l,...c},f)=>b.createElement("svg",{ref:f,...Jne,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:OI("lucide",s),...!i&&!ere(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,p])=>b.createElement(d,p)),...Array.isArray(i)?i:[i]]));/**
|
|
573
|
-
* @license lucide-react v0.576.0 - ISC
|
|
574
|
-
*
|
|
575
|
-
* This source code is licensed under the ISC license.
|
|
576
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
577
|
-
*/const XT=(e,t)=>{const n=b.forwardRef(({className:r,...s},i)=>b.createElement(tre,{ref:i,iconNode:t,className:OI(`lucide-${Wne(T3(e))}`,`lucide-${e}`,r),...s}));return n.displayName=T3(e),n};/**
|
|
578
|
-
* @license lucide-react v0.576.0 - ISC
|
|
579
|
-
*
|
|
580
|
-
* This source code is licensed under the ISC license.
|
|
581
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
582
|
-
*/const nre=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]],rre=XT("heart-pulse",nre);/**
|
|
583
|
-
* @license lucide-react v0.576.0 - ISC
|
|
584
|
-
*
|
|
585
|
-
* This source code is licensed under the ISC license.
|
|
586
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
587
|
-
*/const sre=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],are=XT("network",sre);/**
|
|
588
|
-
* @license lucide-react v0.576.0 - ISC
|
|
589
|
-
*
|
|
590
|
-
* This source code is licensed under the ISC license.
|
|
591
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
592
|
-
*/const ire=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],ore=XT("route",ire),Sp={pulse:rre,relay:ore,mesh:are};function lre({config:e,isLoading:t,onOpenTunnelDialog:n}){return u.jsxs("div",{className:"space-y-3",children:[u.jsx("h3",{className:"text-foreground text-sm font-semibold",children:"Server"}),t?u.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((r,s)=>u.jsxs("div",{className:"flex items-center justify-between py-1",children:[u.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),u.jsx("div",{className:"bg-muted h-4 w-16 animate-pulse rounded"})]},s))}):e?u.jsxs("div",{className:"space-y-1",children:[u.jsx(pu,{label:"Version",value:e.version}),e.latestVersion&&cre(e.latestVersion,e.version)&&u.jsxs("div",{className:"bg-amber-50 dark:bg-amber-950/30 border-amber-200 dark:border-amber-800 -mx-1 rounded border px-2 py-1.5",children:[u.jsx("div",{className:"flex items-center justify-between",children:u.jsxs("span",{className:"text-amber-800 dark:text-amber-200 text-sm font-medium",children:["Update available: v",e.latestVersion]})}),u.jsxs("p",{className:"text-amber-700 dark:text-amber-300 mt-0.5 text-xs",children:["Run"," ",u.jsx("code",{className:"bg-amber-100 dark:bg-amber-900/50 rounded px-1 py-0.5 font-mono text-[10px]",children:"npm update -g dorkos"})," ","to update"]})]}),u.jsx(pu,{label:"Port",value:String(e.port)}),u.jsx(pu,{label:"Uptime",value:dre(e.uptime)}),u.jsx(pu,{label:"Working Directory",value:e.workingDirectory,mono:!0,truncate:!0}),u.jsx(pu,{label:"Node.js",value:e.nodeVersion}),u.jsx(pu,{label:"Claude CLI",value:e.claudeCliPath||"Not found",mono:!0,truncate:!0,muted:!e.claudeCliPath}),u.jsxs("div",{className:"hover:bg-muted/50 -mx-1 flex items-center justify-between rounded px-1 py-1",children:[u.jsx("span",{className:"text-muted-foreground text-sm",children:"Tunnel"}),u.jsx("button",{onClick:n,className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-2.5 py-1 text-xs font-medium shadow-sm transition-colors",children:"Manage"})]})]}):null]})}function ure(){const[e,t]=b.useState(!1),n=b.useCallback(r=>{navigator.clipboard.writeText(r).then(()=>{t(!0),setTimeout(()=>t(!1),Ns.COPY_FEEDBACK_MS)})},[]);return{copied:e,copy:n}}function pu({label:e,value:t,mono:n,truncate:r,muted:s}){const{copied:i,copy:l}=ure();return u.jsxs("button",{type:"button",onClick:()=>l(t),className:"hover:bg-muted/50 active:bg-muted/70 -mx-1 flex w-full items-center justify-between gap-4 rounded px-1 py-1 transition-colors duration-100",children:[u.jsx("span",{className:"text-muted-foreground shrink-0 text-sm",children:e}),i?u.jsx("span",{className:"text-muted-foreground text-xs",children:"Copied"}):u.jsx("span",{className:Ee("text-right text-sm",n&&"font-mono",r&&"max-w-48 min-w-0 truncate",s&&"text-muted-foreground"),dir:r?"rtl":void 0,title:t,children:t})]})}function cre(e,t){const[n,r,s]=e.split(".").map(Number),[i,l,c]=t.split(".").map(Number);return n!==i?n>i:r!==l?r>l:s>c}function dre(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),s=[];return t>0&&s.push(`${t}h`),n>0&&s.push(`${n}m`),s.push(`${r}s`),s.join(" ")}var gu={},Ry={exports:{}},Oy,S3;function fre(){if(S3)return Oy;S3=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Oy=e,Oy}var Dy,w3;function hre(){if(w3)return Dy;w3=1;var e=fre();function t(){}function n(){}return n.resetWarningCache=t,Dy=function(){function r(l,c,f,d,p,m){if(m!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Dy}var C3;function DI(){return C3||(C3=1,Ry.exports=hre()()),Ry.exports}var jy,N3;function jI(){return N3||(N3=1,jy={L:1,M:0,Q:3,H:2}),jy}var My,A3;function MI(){return A3||(A3=1,My={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),My}var Iy,k3;function mre(){if(k3)return Iy;k3=1;var e=MI();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},Iy=t,Iy}var Ly,_3;function pre(){if(_3)return Ly;_3=1;var e=jI();function t(n,r){this.totalCount=n,this.dataCount=r}return t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(n,r){var s=t.getRsBlockTable(n,r);if(s==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var i=s.length/3,l=new Array,c=0;c<i;c++)for(var f=s[c*3+0],d=s[c*3+1],p=s[c*3+2],m=0;m<f;m++)l.push(new t(d,p));return l},t.getRsBlockTable=function(n,r){switch(r){case e.L:return t.RS_BLOCK_TABLE[(n-1)*4+0];case e.M:return t.RS_BLOCK_TABLE[(n-1)*4+1];case e.Q:return t.RS_BLOCK_TABLE[(n-1)*4+2];case e.H:return t.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},Ly=t,Ly}var Py,R3;function gre(){if(R3)return Py;R3=1;function e(){this.buffer=new Array,this.length=0}return e.prototype={get:function(t){var n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)==1},put:function(t,n){for(var r=0;r<n;r++)this.putBit((t>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},Py=e,Py}var By,O3;function II(){if(O3)return By;O3=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)e.EXP_TABLE[t]=e.EXP_TABLE[t-4]^e.EXP_TABLE[t-5]^e.EXP_TABLE[t-6]^e.EXP_TABLE[t-8];for(var t=0;t<255;t++)e.LOG_TABLE[e.EXP_TABLE[t]]=t;return By=e,By}var Fy,D3;function LI(){if(D3)return Fy;D3=1;var e=II();function t(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var s=0;s<n.length&&n[s]==0;)s++;this.num=new Array(n.length-s+r);for(var i=0;i<n.length-s;i++)this.num[i]=n[i+s]}return t.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),s=0;s<this.getLength();s++)for(var i=0;i<n.getLength();i++)r[s+i]^=e.gexp(e.glog(this.get(s))+e.glog(n.get(i)));return new t(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=e.glog(this.get(0))-e.glog(n.get(0)),s=new Array(this.getLength()),i=0;i<this.getLength();i++)s[i]=this.get(i);for(var i=0;i<n.getLength();i++)s[i]^=e.gexp(e.glog(n.get(i))+r);return new t(s,0).mod(n)}},Fy=t,Fy}var zy,j3;function xre(){if(j3)return zy;j3=1;var e=MI(),t=LI(),n=II(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){for(var l=i<<10;s.getBCHDigit(l)-s.getBCHDigit(s.G15)>=0;)l^=s.G15<<s.getBCHDigit(l)-s.getBCHDigit(s.G15);return(i<<10|l)^s.G15_MASK},getBCHTypeNumber:function(i){for(var l=i<<12;s.getBCHDigit(l)-s.getBCHDigit(s.G18)>=0;)l^=s.G18<<s.getBCHDigit(l)-s.getBCHDigit(s.G18);return i<<12|l},getBCHDigit:function(i){for(var l=0;i!=0;)l++,i>>>=1;return l},getPatternPosition:function(i){return s.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,l,c){switch(i){case r.PATTERN000:return(l+c)%2==0;case r.PATTERN001:return l%2==0;case r.PATTERN010:return c%3==0;case r.PATTERN011:return(l+c)%3==0;case r.PATTERN100:return(Math.floor(l/2)+Math.floor(c/3))%2==0;case r.PATTERN101:return l*c%2+l*c%3==0;case r.PATTERN110:return(l*c%2+l*c%3)%2==0;case r.PATTERN111:return(l*c%3+(l+c)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){for(var l=new t([1],0),c=0;c<i;c++)l=l.multiply(new t([1,n.gexp(c)],0));return l},getLengthInBits:function(i,l){if(1<=l&&l<10)switch(i){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(l<27)switch(i){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(l<41)switch(i){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+l)},getLostPoint:function(i){for(var l=i.getModuleCount(),c=0,f=0;f<l;f++)for(var d=0;d<l;d++){for(var p=0,m=i.isDark(f,d),x=-1;x<=1;x++)if(!(f+x<0||l<=f+x))for(var y=-1;y<=1;y++)d+y<0||l<=d+y||x==0&&y==0||m==i.isDark(f+x,d+y)&&p++;p>5&&(c+=3+p-5)}for(var f=0;f<l-1;f++)for(var d=0;d<l-1;d++){var v=0;i.isDark(f,d)&&v++,i.isDark(f+1,d)&&v++,i.isDark(f,d+1)&&v++,i.isDark(f+1,d+1)&&v++,(v==0||v==4)&&(c+=3)}for(var f=0;f<l;f++)for(var d=0;d<l-6;d++)i.isDark(f,d)&&!i.isDark(f,d+1)&&i.isDark(f,d+2)&&i.isDark(f,d+3)&&i.isDark(f,d+4)&&!i.isDark(f,d+5)&&i.isDark(f,d+6)&&(c+=40);for(var d=0;d<l;d++)for(var f=0;f<l-6;f++)i.isDark(f,d)&&!i.isDark(f+1,d)&&i.isDark(f+2,d)&&i.isDark(f+3,d)&&i.isDark(f+4,d)&&!i.isDark(f+5,d)&&i.isDark(f+6,d)&&(c+=40);for(var T=0,d=0;d<l;d++)for(var f=0;f<l;f++)i.isDark(f,d)&&T++;var w=Math.abs(100*T/l/l-50)/5;return c+=w*10,c}};return zy=s,zy}var Uy,M3;function yre(){if(M3)return Uy;M3=1;var e=mre(),t=pre(),n=gre(),r=xre(),s=LI();function i(c,f){this.typeNumber=c,this.errorCorrectLevel=f,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var l=i.prototype;return l.addData=function(c){var f=new e(c);this.dataList.push(f),this.dataCache=null},l.isDark=function(c,f){if(c<0||this.moduleCount<=c||f<0||this.moduleCount<=f)throw new Error(c+","+f);return this.modules[c][f]},l.getModuleCount=function(){return this.moduleCount},l.make=function(){if(this.typeNumber<1){var c=1;for(c=1;c<40;c++){for(var f=t.getRSBlocks(c,this.errorCorrectLevel),d=new n,p=0,m=0;m<f.length;m++)p+=f[m].dataCount;for(var m=0;m<this.dataList.length;m++){var x=this.dataList[m];d.put(x.mode,4),d.put(x.getLength(),r.getLengthInBits(x.mode,c)),x.write(d)}if(d.getLengthInBits()<=p*8)break}this.typeNumber=c}this.makeImpl(!1,this.getBestMaskPattern())},l.makeImpl=function(c,f){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=new Array(this.moduleCount);for(var p=0;p<this.moduleCount;p++)this.modules[d][p]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(c,f),this.typeNumber>=7&&this.setupTypeNumber(c),this.dataCache==null&&(this.dataCache=i.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,f)},l.setupPositionProbePattern=function(c,f){for(var d=-1;d<=7;d++)if(!(c+d<=-1||this.moduleCount<=c+d))for(var p=-1;p<=7;p++)f+p<=-1||this.moduleCount<=f+p||(0<=d&&d<=6&&(p==0||p==6)||0<=p&&p<=6&&(d==0||d==6)||2<=d&&d<=4&&2<=p&&p<=4?this.modules[c+d][f+p]=!0:this.modules[c+d][f+p]=!1)},l.getBestMaskPattern=function(){for(var c=0,f=0,d=0;d<8;d++){this.makeImpl(!0,d);var p=r.getLostPoint(this);(d==0||c>p)&&(c=p,f=d)}return f},l.createMovieClip=function(c,f,d){var p=c.createEmptyMovieClip(f,d),m=1;this.make();for(var x=0;x<this.modules.length;x++)for(var y=x*m,v=0;v<this.modules[x].length;v++){var T=v*m,w=this.modules[x][v];w&&(p.beginFill(0,100),p.moveTo(T,y),p.lineTo(T+m,y),p.lineTo(T+m,y+m),p.lineTo(T,y+m),p.endFill())}return p},l.setupTimingPattern=function(){for(var c=8;c<this.moduleCount-8;c++)this.modules[c][6]==null&&(this.modules[c][6]=c%2==0);for(var f=8;f<this.moduleCount-8;f++)this.modules[6][f]==null&&(this.modules[6][f]=f%2==0)},l.setupPositionAdjustPattern=function(){for(var c=r.getPatternPosition(this.typeNumber),f=0;f<c.length;f++)for(var d=0;d<c.length;d++){var p=c[f],m=c[d];if(this.modules[p][m]==null)for(var x=-2;x<=2;x++)for(var y=-2;y<=2;y++)x==-2||x==2||y==-2||y==2||x==0&&y==0?this.modules[p+x][m+y]=!0:this.modules[p+x][m+y]=!1}},l.setupTypeNumber=function(c){for(var f=r.getBCHTypeNumber(this.typeNumber),d=0;d<18;d++){var p=!c&&(f>>d&1)==1;this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=p}for(var d=0;d<18;d++){var p=!c&&(f>>d&1)==1;this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=p}},l.setupTypeInfo=function(c,f){for(var d=this.errorCorrectLevel<<3|f,p=r.getBCHTypeInfo(d),m=0;m<15;m++){var x=!c&&(p>>m&1)==1;m<6?this.modules[m][8]=x:m<8?this.modules[m+1][8]=x:this.modules[this.moduleCount-15+m][8]=x}for(var m=0;m<15;m++){var x=!c&&(p>>m&1)==1;m<8?this.modules[8][this.moduleCount-m-1]=x:m<9?this.modules[8][15-m-1+1]=x:this.modules[8][15-m-1]=x}this.modules[this.moduleCount-8][8]=!c},l.mapData=function(c,f){for(var d=-1,p=this.moduleCount-1,m=7,x=0,y=this.moduleCount-1;y>0;y-=2)for(y==6&&y--;;){for(var v=0;v<2;v++)if(this.modules[p][y-v]==null){var T=!1;x<c.length&&(T=(c[x]>>>m&1)==1);var w=r.getMask(f,p,y-v);w&&(T=!T),this.modules[p][y-v]=T,m--,m==-1&&(x++,m=7)}if(p+=d,p<0||this.moduleCount<=p){p-=d,d=-d;break}}},i.PAD0=236,i.PAD1=17,i.createData=function(c,f,d){for(var p=t.getRSBlocks(c,f),m=new n,x=0;x<d.length;x++){var y=d[x];m.put(y.mode,4),m.put(y.getLength(),r.getLengthInBits(y.mode,c)),y.write(m)}for(var v=0,x=0;x<p.length;x++)v+=p[x].dataCount;if(m.getLengthInBits()>v*8)throw new Error("code length overflow. ("+m.getLengthInBits()+">"+v*8+")");for(m.getLengthInBits()+4<=v*8&&m.put(0,4);m.getLengthInBits()%8!=0;)m.putBit(!1);for(;!(m.getLengthInBits()>=v*8||(m.put(i.PAD0,8),m.getLengthInBits()>=v*8));)m.put(i.PAD1,8);return i.createBytes(m,p)},i.createBytes=function(c,f){for(var d=0,p=0,m=0,x=new Array(f.length),y=new Array(f.length),v=0;v<f.length;v++){var T=f[v].dataCount,w=f[v].totalCount-T;p=Math.max(p,T),m=Math.max(m,w),x[v]=new Array(T);for(var N=0;N<x[v].length;N++)x[v][N]=255&c.buffer[N+d];d+=T;var A=r.getErrorCorrectPolynomial(w),k=new s(x[v],A.getLength()-1),R=k.mod(A);y[v]=new Array(A.getLength()-1);for(var N=0;N<y[v].length;N++){var D=N+R.getLength()-y[v].length;y[v][N]=D>=0?R.get(D):0}}for(var O=0,N=0;N<f.length;N++)O+=f[N].totalCount;for(var M=new Array(O),I=0,N=0;N<p;N++)for(var v=0;v<f.length;v++)N<x[v].length&&(M[I++]=x[v][N]);for(var N=0;N<m;N++)for(var v=0;v<f.length;v++)N<y[v].length&&(M[I++]=y[v][N]);return M},Uy=i,Uy}var Jm={},I3;function bre(){if(I3)return Jm;I3=1,Object.defineProperty(Jm,"__esModule",{value:!0});var e=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var m=arguments[p];for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&(d[x]=m[x])}return d},t=DI(),n=i(t),r=jf(),s=i(r);function i(d){return d&&d.__esModule?d:{default:d}}function l(d,p){var m={};for(var x in d)p.indexOf(x)>=0||Object.prototype.hasOwnProperty.call(d,x)&&(m[x]=d[x]);return m}var c={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},f=(0,r.forwardRef)(function(d,p){var m=d.bgColor,x=d.bgD,y=d.fgD,v=d.fgColor,T=d.size,w=d.title,N=d.viewBoxSize,A=d.xmlns,k=A===void 0?"http://www.w3.org/2000/svg":A,R=l(d,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return s.default.createElement("svg",e({},R,{height:T,ref:p,viewBox:"0 0 "+N+" "+N,width:T,xmlns:k}),w?s.default.createElement("title",null,w):null,s.default.createElement("path",{d:x,fill:m}),s.default.createElement("path",{d:y,fill:v}))});return f.displayName="QRCodeSvg",f.propTypes=c,Jm.default=f,Jm}var L3;function vre(){if(L3)return gu;L3=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.QRCode=void 0;var e=Object.assign||function(T){for(var w=1;w<arguments.length;w++){var N=arguments[w];for(var A in N)Object.prototype.hasOwnProperty.call(N,A)&&(T[A]=N[A])}return T},t=DI(),n=m(t),r=jI(),s=m(r),i=yre(),l=m(i),c=jf(),f=m(c),d=bre(),p=m(d);function m(T){return T&&T.__esModule?T:{default:T}}function x(T,w){var N={};for(var A in T)w.indexOf(A)>=0||Object.prototype.hasOwnProperty.call(T,A)&&(N[A]=T[A]);return N}var y={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},v=(0,c.forwardRef)(function(T,w){var N=T.bgColor,A=N===void 0?"#FFFFFF":N,k=T.fgColor,R=k===void 0?"#000000":k,D=T.level,O=D===void 0?"L":D,M=T.size,I=M===void 0?256:M,H=T.value,P=x(T,["bgColor","fgColor","level","size","value"]),K=new l.default(-1,s.default[O]);K.addData(H),K.make();var Y=K.modules;return f.default.createElement(p.default,e({},P,{bgColor:A,bgD:Y.map(function(W,te){return W.map(function(J,L){return J?"":"M "+L+" "+te+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:Y.map(function(W,te){return W.map(function(J,L){return J?"M "+L+" "+te+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:w,size:I,viewBoxSize:Y.length}))});return gu.QRCode=v,v.displayName="QRCode",v.propTypes=y,gu.default=v,gu}var Ere=vre();const Tre=ml(Ere);function Sre(){const e=He();return vt({queryKey:["tunnel-status"],queryFn:async()=>(await e.getConfig()).tunnel,refetchInterval:3e4})}const wre="dorkos-tunnel";function P3(){const e=Rz(wre);e.postMessage({type:"tunnel_changed"}),e.close()}function Cre(){return u.jsxs("svg",{viewBox:"0 0 240 120",className:"mx-auto h-24 w-48","aria-hidden":"true",children:[u.jsx("rect",{x:"80",y:"30",width:"80",height:"50",rx:"4",className:"fill-none stroke-current",strokeWidth:"2"}),u.jsx("rect",{x:"70",y:"80",width:"100",height:"6",rx:"2",className:"fill-current opacity-30"}),u.jsx("rect",{x:"90",y:"42",width:"20",height:"2",rx:"1",className:"fill-current opacity-40"}),u.jsx("rect",{x:"90",y:"48",width:"40",height:"2",rx:"1",className:"fill-current opacity-20"}),u.jsx("rect",{x:"90",y:"54",width:"30",height:"2",rx:"1",className:"fill-current opacity-20"}),u.jsx("rect",{x:"195",y:"35",width:"28",height:"45",rx:"4",className:"fill-none stroke-current",strokeWidth:"1.5"}),u.jsx("circle",{cx:"209",cy:"73",r:"2",className:"fill-current opacity-30"}),u.jsx("rect",{x:"10",y:"30",width:"40",height:"55",rx:"4",className:"fill-none stroke-current",strokeWidth:"1.5"}),u.jsx("circle",{cx:"30",cy:"78",r:"2",className:"fill-current opacity-30"}),u.jsx("line",{x1:"160",y1:"55",x2:"195",y2:"55",className:"stroke-current opacity-40",strokeWidth:"1.5",strokeDasharray:"4 3"}),u.jsx("line",{x1:"80",y1:"55",x2:"50",y2:"55",className:"stroke-current opacity-40",strokeWidth:"1.5",strokeDasharray:"4 3"})]})}function Nre(){return u.jsxs("div",{className:"space-y-4",children:[u.jsx(Cre,{}),u.jsx("p",{className:"text-foreground text-center text-sm font-medium",children:"Access DorkOS from any device"}),u.jsxs("ol",{className:"text-muted-foreground space-y-2 text-xs",children:[u.jsxs("li",{className:"flex gap-2",children:[u.jsx("span",{className:"bg-muted text-foreground inline-flex size-5 shrink-0 items-center justify-center rounded-full text-xs font-medium",children:"1"}),u.jsx("span",{children:u.jsxs("a",{href:"https://dashboard.ngrok.com/signup",target:"_blank",rel:"noopener noreferrer",className:"text-foreground inline-flex items-center gap-0.5 underline underline-offset-2",children:["Create a free ngrok account",u.jsx(dv,{className:"size-3"})]})})]}),u.jsxs("li",{className:"flex gap-2",children:[u.jsx("span",{className:"bg-muted text-foreground inline-flex size-5 shrink-0 items-center justify-center rounded-full text-xs font-medium",children:"2"}),u.jsx("span",{children:"Copy your auth token from the dashboard"})]}),u.jsxs("li",{className:"flex gap-2",children:[u.jsx("span",{className:"bg-muted text-foreground inline-flex size-5 shrink-0 items-center justify-center rounded-full text-xs font-medium",children:"3"}),u.jsx("span",{children:"Paste it above and toggle on"})]})]})]})}const Are=15e3,kre=3e4,_re=3e4;function Rre(e){return/auth|token|ERR_NGROK_105/i.test(e)?"Check your auth token at dashboard.ngrok.com":/timeout|ETIMEDOUT/i.test(e)?"Connection timed out. Check your network.":/limit|ERR_NGROK_108/i.test(e)?"Tunnel limit reached. Free ngrok accounts allow one active tunnel.":/DNS|NXDOMAIN|ERR_NGROK_332/i.test(e)?"DNS resolution failed. Check your domain configuration.":/gateway|502|ERR_NGROK_3200/i.test(e)?"Gateway error. The tunnel endpoint is unreachable.":/upgrade|ERR_NGROK_120/i.test(e)?"Feature requires a paid ngrok plan.":/ECONNREFUSED/i.test(e)?"Connection refused. Ensure the server is running.":e}function Ore(e){return e===null?"bg-gray-400":e<200?"bg-green-500":e<500?"bg-amber-400":"bg-red-500"}function PI({open:e,onOpenChange:t}){const n=He(),r=Qt(),[s]=oc(),{data:i}=vt({queryKey:["config"],queryFn:()=>n.getConfig(),staleTime:300*1e3}),l=i==null?void 0:i.tunnel,[c,f]=b.useState("off"),[d,p]=b.useState(null),[m,x]=b.useState(null),[y,v]=b.useState(""),[T,w]=b.useState(null),[N,A]=b.useState(!1),[k,R]=b.useState(!1),[D,O]=b.useState(!1),[M,I]=b.useState(""),[H,P]=b.useState(null),K=b.useRef(void 0);b.useEffect(()=>{l!=null&&l.connected&&(l!=null&&l.url)?(f("connected"),p(l.url)):c!=="starting"&&c!=="stopping"&&(f("off"),p(null))},[l==null?void 0:l.connected,l==null?void 0:l.url,c]),b.useEffect(()=>{l!=null&&l.domain&&I(l.domain)},[l==null?void 0:l.domain]),b.useEffect(()=>{const z=K.current,q=(l==null?void 0:l.connected)??!1;K.current=q,z!==void 0&&(z&&!q?Cn.error("Remote access disconnected",{description:"Attempting to reconnect..."}):!z&&q&&(l!=null&&l.url)&&Cn.success("Remote access reconnected",{description:l.url}))},[l==null?void 0:l.connected,l==null?void 0:l.url]),b.useEffect(()=>{if(c!=="starting"&&c!=="stopping")return;const z=setTimeout(()=>{c==="starting"?(f("error"),x("Connection timed out. Please try again.")):c==="stopping"&&(f("off"),p(null))},kre);return()=>clearTimeout(z)},[c]),b.useEffect(()=>{if(c!=="connected"||!d||!e){P(null);return}const z=async()=>{try{const V=performance.now();await fetch(`${d}/api/health`,{mode:"cors",cache:"no-store"}),P(Math.round(performance.now()-V))}catch{P(null)}};z();const q=setInterval(z,_re);return()=>clearInterval(q)},[c,d,e]);const Y=b.useCallback(async z=>{if(z){f("starting"),x(null);const q=setTimeout(()=>{f("error"),x("Connection timed out after 15 seconds")},Are);try{const V=await n.startTunnel();clearTimeout(q),f("connected"),p(V.url),r.invalidateQueries({queryKey:["config"]}),P3()}catch(V){clearTimeout(q),f("error"),x(V instanceof Error?V.message:"Failed to start tunnel")}}else{f("stopping"),x(null);try{await n.stopTunnel(),f("off"),p(null),r.invalidateQueries({queryKey:["config"]}),P3()}catch(q){f("connected"),x(q instanceof Error?q.message:"Failed to stop tunnel")}}},[n,r]),W=b.useCallback(async()=>{w(null);try{await n.updateConfig({tunnel:{authtoken:y}}),v(""),A(!1),r.invalidateQueries({queryKey:["config"]})}catch{w("Could not save token. Try again.")}},[y,r,n]),te=b.useCallback(async()=>{try{await n.updateConfig({tunnel:{domain:M.trim()||null}}),r.invalidateQueries({queryKey:["config"]})}catch{}},[M,r,n]),J=b.useCallback(()=>{d&&(navigator.clipboard.writeText(d),R(!0),setTimeout(()=>R(!1),Ns.COPY_FEEDBACK_MS))},[d]),L=b.useCallback(()=>{d&&s&&(navigator.clipboard.writeText(`${d}?session=${s}`),O(!0),setTimeout(()=>O(!1),Ns.COPY_FEEDBACK_MS))},[d,s]),B=c==="starting"||c==="stopping",U=c==="connected"||c==="starting"||c==="stopping",ne={off:"bg-gray-400",starting:"bg-amber-400",connected:"bg-green-500",stopping:"bg-gray-400",error:"bg-red-500"}[c];return u.jsx(ua,{open:e,onOpenChange:t,children:u.jsxs(ca,{className:"max-h-[85vh] max-w-md",children:[u.jsxs(da,{children:[u.jsxs(fa,{className:"flex items-center gap-2 text-sm font-medium",children:[u.jsx("span",{className:Ee("inline-block size-2 rounded-full",ne,(c==="starting"||c==="stopping")&&"animate-pulse")}),"Remote Access"]}),c==="off"&&u.jsx(ha,{className:"text-muted-foreground text-xs",children:"Access DorkOS from any device, any browser."}),c==="starting"&&u.jsx(ha,{className:"text-muted-foreground text-xs",children:"Establishing connection..."}),c==="stopping"&&u.jsx(ha,{className:"text-muted-foreground text-xs",children:"Disconnecting..."})]}),u.jsxs("div",{className:"space-y-4 px-4 pb-4",children:[c==="off"&&l&&!l.tokenConfigured&&u.jsx(Nre,{}),c!=="connected"&&l&&u.jsx(u.Fragment,{children:!l.tokenConfigured||N?u.jsxs("div",{className:"space-y-2",children:[u.jsx("span",{className:"text-muted-foreground text-xs font-medium uppercase tracking-wider",children:"Auth Token"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{type:"password",placeholder:"Paste token here",value:y,onChange:z=>v(z.target.value),className:"border-input bg-background placeholder:text-muted-foreground focus-visible:ring-ring flex-1 rounded-md border px-3 py-1.5 text-sm shadow-sm outline-none focus-visible:ring-1"}),u.jsx("button",{onClick:W,disabled:!y.trim(),className:"bg-primary text-primary-foreground hover:bg-primary/90 inline-flex items-center rounded-md px-3 py-1.5 text-sm font-medium shadow-sm transition-colors disabled:pointer-events-none disabled:opacity-50",children:"Save"})]}),T&&u.jsx("p",{className:"text-destructive text-xs",children:T}),!l.tokenConfigured&&u.jsxs("p",{className:"text-muted-foreground text-xs",children:["Need a token?"," ",u.jsxs("a",{href:"https://dashboard.ngrok.com/signup",target:"_blank",rel:"noopener noreferrer",className:"text-foreground inline-flex items-center gap-0.5 underline underline-offset-2",children:["Sign up at ngrok.com",u.jsx(dv,{className:"size-3"})]})]})]}):u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("span",{className:"text-muted-foreground text-sm",children:["Auth token saved",u.jsx(zn,{className:"ml-1 inline size-3.5 text-green-500"})]}),u.jsx("button",{onClick:()=>A(!0),className:"text-muted-foreground hover:text-foreground text-xs underline underline-offset-2 transition-colors",children:"Change"})]})}),(l==null?void 0:l.tokenConfigured)&&c!=="connected"&&c!=="stopping"&&u.jsxs("div",{className:"space-y-2",children:[u.jsx("span",{className:"text-muted-foreground text-xs font-medium uppercase tracking-wider",children:"Custom Domain"}),u.jsx("input",{type:"text",placeholder:"e.g. my-dorkos.ngrok-free.app",value:M,onChange:z=>I(z.target.value),onBlur:te,onKeyDown:z=>z.key==="Enter"&&te(),className:"border-input bg-background placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-1.5 text-sm shadow-sm outline-none focus-visible:ring-1"}),u.jsxs("p",{className:"text-muted-foreground text-xs",children:[u.jsxs("a",{href:"https://dashboard.ngrok.com/domains",target:"_blank",rel:"noopener noreferrer",className:"text-foreground inline-flex items-center gap-0.5 underline underline-offset-2",children:["Get a free static domain",u.jsx(dv,{className:"size-3"})]})," — ","same URL every restart, reusable QR codes, persistent bookmarks."]})]}),(c==="connected"||c==="stopping")&&d&&u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"flex justify-center rounded-lg bg-white p-3",children:u.jsx(Tre,{value:d,size:200,level:"M"})}),u.jsxs("div",{className:"flex items-center gap-2",children:[c==="connected"&&u.jsxs(Jo,{children:[u.jsx(el,{asChild:!0,children:u.jsx("span",{className:Ee("inline-block size-2 shrink-0 rounded-full",Ore(H))})}),u.jsx(tl,{side:"top",children:H!==null?`${H}ms`:"Measuring..."})]}),u.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 truncate font-mono text-xs",children:d}),u.jsx("button",{onClick:J,className:"border-input hover:bg-accent inline-flex shrink-0 items-center gap-1.5 rounded-md border bg-transparent px-2.5 py-1 text-xs font-medium shadow-sm transition-colors",children:k?u.jsxs(u.Fragment,{children:[u.jsx(zn,{className:"size-3"}),"Copied"]}):u.jsxs(u.Fragment,{children:[u.jsx(JE,{className:"size-3"}),"Copy"]})})]}),c==="connected"&&s&&u.jsx("button",{onClick:L,className:"border-input hover:bg-accent inline-flex w-full items-center justify-center gap-1.5 rounded-md border bg-transparent px-2.5 py-1 text-xs font-medium shadow-sm transition-colors",children:D?u.jsxs(u.Fragment,{children:[u.jsx(zn,{className:"size-3"}),"Copied session link"]}):u.jsxs(u.Fragment,{children:[u.jsx(qY,{className:"size-3"}),"Copy session link"]})}),u.jsx("p",{className:"text-muted-foreground text-center text-xs",children:"Scan or visit from any device"})]}),c==="error"&&m&&u.jsxs("div",{className:"space-y-2 rounded-md border border-red-200 bg-red-50 p-3 dark:border-red-800 dark:bg-red-950/30",children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:"Connection failed"}),u.jsx("p",{className:"text-xs text-red-700 dark:text-red-300",children:Rre(m)}),u.jsx("button",{className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-sm transition-colors",onClick:()=>{f("off"),x(null)},children:"Retry"})]}),u.jsx(HT,{}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-sm",children:"Enable remote access"}),u.jsx(xn,{checked:U,onCheckedChange:Y,disabled:B})]})]})]})})}function Dre({open:e,onOpenChange:t,onResetComplete:n}){const[r,s]=b.useState(""),[i,l]=b.useState(!1),c=He(),f=r==="reset";async function d(){l(!0);try{await c.resetAllData("reset"),localStorage.clear(),t(!1),n()}catch(m){Cn.error(m instanceof Error?m.message:"Failed to reset data")}finally{l(!1)}}function p(m){m||(s(""),l(!1)),t(m)}return u.jsx(RT,{open:e,onOpenChange:p,children:u.jsxs(Y0,{children:[u.jsxs(OT,{children:[u.jsx(G0,{children:"Reset All Data"}),u.jsx(K0,{asChild:!0,children:u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{children:"This will permanently delete all DorkOS data, including:"}),u.jsxs("ul",{className:"list-inside list-disc space-y-1 text-sm",children:[u.jsx("li",{children:"All Pulse schedules and run history"}),u.jsx("li",{children:"All Relay configuration and messages"}),u.jsx("li",{children:"All Mesh agent registry data"}),u.jsx("li",{children:"Your config file and preferences"}),u.jsx("li",{children:"All server logs"})]}),u.jsx("p",{children:"The server will restart automatically. Your UI preferences will also be cleared."}),u.jsx("p",{className:"font-semibold",children:"This action cannot be undone."})]})})]}),u.jsx("div",{className:"py-2",children:u.jsx(Ss,{placeholder:'Type "reset" to confirm',value:r,onChange:m=>s(m.target.value),"data-testid":"reset-confirm-input"})}),u.jsxs(DT,{children:[u.jsx(X0,{children:"Cancel"}),u.jsx(Q0,{disabled:!f||i,onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:i?"Resetting...":"Reset All Data"})]})]})})}function jre({open:e,onOpenChange:t,onRestartComplete:n}){const[r,s]=b.useState(!1),i=He();async function l(){s(!0);try{await i.restartServer(),t(!1),n()}catch(c){Cn.error(c instanceof Error?c.message:"Failed to restart server")}finally{s(!1)}}return u.jsx(RT,{open:e,onOpenChange:t,children:u.jsxs(Y0,{children:[u.jsxs(OT,{children:[u.jsx(G0,{children:"Restart Server"}),u.jsx(K0,{children:"This will restart the DorkOS server. All active sessions will be interrupted."})]}),u.jsxs(DT,{children:[u.jsx(X0,{children:"Cancel"}),u.jsx(Q0,{disabled:r,onClick:l,children:r?"Restarting...":"Restart Server"})]})]})})}function Mre({onResetComplete:e,onRestartComplete:t}){const[n,r]=b.useState(!1),[s,i]=b.useState(!1);return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"border-destructive/50 space-y-4 rounded-lg border p-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(fc,{className:"text-destructive size-4"}),u.jsx("h3",{className:"text-destructive text-sm font-semibold",children:"Danger Zone"})]}),u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-medium",children:"Reset All Data"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Permanently delete all DorkOS data and restart the server."})]}),u.jsx(mt,{variant:"destructive",size:"sm",onClick:()=>r(!0),children:"Reset"})]}),u.jsx(HT,{}),u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-medium",children:"Restart Server"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Restart the DorkOS server process. Active sessions will be interrupted."})]}),u.jsx(mt,{variant:"destructive",size:"sm",onClick:()=>i(!0),children:"Restart"})]})]}),u.jsx(Dre,{open:n,onOpenChange:r,onResetComplete:e}),u.jsx(jre,{open:s,onOpenChange:i,onRestartComplete:t})]})}const Ire=1500,Lre=3e4;function Pre({open:e,onDismiss:t}){const[n,r]=b.useState(!1),s=He(),i=b.useRef(null),l=b.useRef(null),c=b.useCallback(()=>{i.current&&clearTimeout(i.current),l.current&&clearInterval(l.current),i.current=null,l.current=null},[]),f=b.useCallback(()=>{r(!1),c(),i.current=setTimeout(()=>{l.current&&clearInterval(l.current),l.current=null,r(!0)},Lre),l.current=setInterval(async()=>{try{await s.health(),c(),window.location.reload()}catch{}},Ire)},[s,c]);if(b.useEffect(()=>(e&&f(),c),[e,f,c]),!e)return null;const d=u.jsx("div",{className:"bg-background/80 fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm","data-testid":"server-restart-overlay",children:u.jsx("div",{className:"flex flex-col items-center gap-4 text-center",children:n?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-foreground text-sm font-medium",children:"Server did not restart within 30 seconds."}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Check your terminal for errors."}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(mt,{variant:"outline",size:"sm",onClick:f,children:"Try Again"}),u.jsx(mt,{variant:"outline",size:"sm",onClick:t,children:"Dismiss"})]})]}):u.jsxs(u.Fragment,{children:[u.jsx(Qn,{className:"text-muted-foreground size-8 animate-spin"}),u.jsx("p",{className:"text-foreground text-sm font-medium",children:"Restarting server..."}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Waiting for server to come back..."})]})})});return ai.createPortal(d,document.body)}function Bre({open:e,onOpenChange:t}){const{theme:n,setTheme:r}=gE(),[s,i]=b.useState("appearance"),[l,c]=b.useState(!1),[f,d]=b.useState(!1),{showTimestamps:p,setShowTimestamps:m,expandToolCalls:x,setExpandToolCalls:y,autoHideToolCalls:v,setAutoHideToolCalls:T,devtoolsOpen:w,toggleDevtools:N,fontSize:A,setFontSize:k,fontFamily:R,setFontFamily:D,resetPreferences:O,showStatusBarCwd:M,setShowStatusBarCwd:I,showStatusBarPermission:H,setShowStatusBarPermission:P,showStatusBarModel:K,setShowStatusBarModel:Y,showStatusBarCost:W,setShowStatusBarCost:te,showStatusBarContext:J,setShowStatusBarContext:L,showStatusBarGit:B,setShowStatusBarGit:U,showShortcutChips:ne,setShowShortcutChips:z,showTaskCelebrations:q,setShowTaskCelebrations:V,enableNotificationSound:j,setEnableNotificationSound:re,enablePulseNotifications:ae,setEnablePulseNotifications:me,showStatusBarSound:le,setShowStatusBarSound:ye,showStatusBarTunnel:ve,setShowStatusBarTunnel:Re}=Jt(),ke=He(),{data:$e,isLoading:Et}=vt({queryKey:["config"],queryFn:()=>ke.getConfig(),staleTime:3e4,enabled:e});return u.jsxs(ua,{open:e,onOpenChange:t,children:[u.jsxs(ca,{"data-testid":"settings-dialog",className:"max-h-[85vh] max-w-lg gap-0 p-0",children:[u.jsx(da,{className:"space-y-0 border-b px-4 py-3",children:u.jsx(fa,{className:"text-sm font-medium",children:"Settings"})}),u.jsxs(oh,{value:s,onValueChange:i,className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs(Tc,{className:"mx-4 mt-3 grid w-full grid-cols-5",style:{width:"calc(100% - 2rem)"},children:[u.jsx(Gn,{value:"appearance",children:"Appearance"}),u.jsx(Gn,{value:"preferences",children:"Preferences"}),u.jsx(Gn,{value:"statusBar",children:"Status Bar"}),u.jsx(Gn,{value:"server",children:"Server"}),u.jsx(Gn,{value:"advanced",children:"Advanced"})]}),u.jsxs("div",{className:"min-h-[280px] flex-1 overflow-y-auto p-4",children:[u.jsx(Kn,{value:"appearance",className:"mt-0 space-y-6",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"text-foreground text-sm font-semibold",children:"Appearance"}),u.jsx("button",{onClick:()=>{O(),r("system")},className:"text-muted-foreground hover:text-foreground text-xs transition-colors duration-150",children:"Reset to defaults"})]}),u.jsx($n,{label:"Theme",description:"Choose your preferred color scheme",children:u.jsxs(Us,{value:n,onValueChange:r,children:[u.jsx(ws,{className:"w-32",children:u.jsx(Hs,{})}),u.jsxs(Cs,{children:[u.jsx(Lt,{value:"light",children:"Light"}),u.jsx(Lt,{value:"dark",children:"Dark"}),u.jsx(Lt,{value:"system",children:"System"})]})]})}),u.jsx($n,{label:"Font family",description:"Choose the typeface for the interface",children:u.jsxs(Us,{value:R,onValueChange:Oe=>D(Oe),children:[u.jsx(ws,{className:"w-40",children:u.jsx(Hs,{})}),u.jsx(Cs,{children:jp.map(Oe=>u.jsx(Lt,{value:Oe.key,children:u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{children:Oe.displayName}),u.jsx("span",{className:"text-muted-foreground text-xs",children:Oe.description})]})},Oe.key))})]})}),u.jsx($n,{label:"Font size",description:"Adjust the text size across the interface",children:u.jsxs(Us,{value:A,onValueChange:Oe=>k(Oe),children:[u.jsx(ws,{className:"w-32",children:u.jsx(Hs,{})}),u.jsxs(Cs,{children:[u.jsx(Lt,{value:"small",children:"Small"}),u.jsx(Lt,{value:"medium",children:"Medium"}),u.jsx(Lt,{value:"large",children:"Large"})]})]})})]})}),u.jsx(Kn,{value:"preferences",className:"mt-0 space-y-6",children:u.jsxs("div",{className:"space-y-4",children:[u.jsx("h3",{className:"text-foreground text-sm font-semibold",children:"Preferences"}),u.jsx($n,{label:"Show timestamps",description:"Display message timestamps in chat",children:u.jsx(xn,{checked:p,onCheckedChange:m})}),u.jsx($n,{label:"Expand tool calls",description:"Auto-expand tool call details in messages",children:u.jsx(xn,{checked:x,onCheckedChange:y})}),u.jsx($n,{label:"Auto-hide tool calls",description:"Fade out completed tool calls after a few seconds",children:u.jsx(xn,{checked:v,onCheckedChange:T})}),u.jsx($n,{label:"Show shortcut chips",description:"Display shortcut hints below the message input",children:u.jsx(xn,{checked:ne,onCheckedChange:z})}),u.jsx($n,{label:"Task celebrations",description:"Show animations when tasks complete",children:u.jsx(xn,{checked:q,onCheckedChange:V})}),u.jsx($n,{label:"Notification sound",description:"Play a sound when AI finishes responding (3s+ responses)",children:u.jsx(xn,{checked:j,onCheckedChange:re})}),u.jsx($n,{label:"Pulse run notifications",description:"Show a toast when a scheduled Pulse run completes",children:u.jsx(xn,{checked:ae,onCheckedChange:me})}),u.jsx($n,{label:"Show dev tools",description:"Enable developer tools panel",children:u.jsx(xn,{checked:w,onCheckedChange:()=>N()})})]})}),u.jsxs(Kn,{value:"statusBar",className:"mt-0 space-y-4",children:[u.jsx($n,{label:"Show directory",description:"Display current working directory",children:u.jsx(xn,{checked:M,onCheckedChange:I})}),u.jsx($n,{label:"Show git status",description:"Display branch name and change count",children:u.jsx(xn,{checked:B,onCheckedChange:U})}),u.jsx($n,{label:"Show permission mode",description:"Display current permission setting",children:u.jsx(xn,{checked:H,onCheckedChange:P})}),u.jsx($n,{label:"Show model",description:"Display selected AI model",children:u.jsx(xn,{checked:K,onCheckedChange:Y})}),u.jsx($n,{label:"Show cost",description:"Display session cost in USD",children:u.jsx(xn,{checked:W,onCheckedChange:te})}),u.jsx($n,{label:"Show context usage",description:"Display context window utilization",children:u.jsx(xn,{checked:J,onCheckedChange:L})}),u.jsx($n,{label:"Show sound toggle",description:"Display notification sound toggle",children:u.jsx(xn,{checked:le,onCheckedChange:ye})}),u.jsx($n,{label:"Show remote",description:"Display remote control",children:u.jsx(xn,{checked:ve,onCheckedChange:Re})})]}),u.jsx(Kn,{value:"server",className:"mt-0",children:u.jsx(lre,{config:$e,isLoading:Et,onOpenTunnelDialog:()=>c(!0)})}),u.jsx(Kn,{value:"advanced",className:"mt-0",children:u.jsx(Mre,{onResetComplete:()=>d(!0),onRestartComplete:()=>d(!0)})})]})]})]}),u.jsx(PI,{open:l,onOpenChange:c}),u.jsx(Pre,{open:f,onDismiss:()=>d(!1)})]})}function $n({label:e,description:t,children:n}){return u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx(Gt,{className:"text-sm font-medium",children:e}),u.jsx("p",{className:"text-muted-foreground text-xs",children:t})]}),n]})}var Hy={exports:{}},B3;function Fre(){return B3||(B3=1,(function(e,t){(function(r,s){e.exports=s()})(globalThis,()=>(()=>{var n={949(l,c,f){Object.defineProperty(c,"__esModule",{value:!0}),c.CronParser=void 0;var d=f(515),p=(function(){function m(x,y,v){y===void 0&&(y=!0),v===void 0&&(v=!1),this.expression=x,this.dayOfWeekStartIndexZero=y,this.monthStartIndexZero=v}return m.prototype.parse=function(){var x,y,v=(x=this.expression)!==null&&x!==void 0?x:"";if(v==="@reboot")return y=["@reboot","","","","","",""],y;if(v.startsWith("@")){var T=this.parseSpecial(this.expression);y=this.extractParts(T)}else y=this.extractParts(this.expression);return this.normalize(y),this.validate(y),y},m.prototype.parseSpecial=function(x){var y={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},v=y[x];if(!v)throw new Error("Unknown special expression.");return v},m.prototype.extractParts=function(x){if(!this.expression)throw new Error("cron expression is empty");for(var y=x.trim().split(/[ ]+/),v=0;v<y.length;v++)if(y[v].includes(",")){var T=y[v].split(",").map(function(N){return N.trim()}).filter(function(N){return N!==""}).map(function(N){return isNaN(Number(N))?N:Number(N)}).filter(function(N){return N!==null&&N!==""});T.length===0&&T.push("*"),T.sort(function(N,A){return N!==null&&A!==null?N-A:0}),y[v]=T.map(function(N){return N!==null?N.toString():""}).join(",")}if(y.length<5)throw new Error("Expression has only ".concat(y.length," part").concat(y.length==1?"":"s",". At least 5 parts are required."));if(y.length==5)y.unshift(""),y.push("");else if(y.length==6){var w=/\d{4}$/.test(y[5])||y[4]=="?"||y[2]=="?";w?y.unshift(""):y.push("")}else if(y.length>7)throw new Error("Expression has ".concat(y.length," parts; too many!"));return y},m.prototype.normalize=function(x){var y=this;if(x[3]=x[3].replace("?","*"),x[5]=x[5].replace("?","*"),x[2]=x[2].replace("?","*"),x[0].indexOf("0/")==0&&(x[0]=x[0].replace("0/","*/")),x[1].indexOf("0/")==0&&(x[1]=x[1].replace("0/","*/")),x[2].indexOf("0/")==0&&(x[2]=x[2].replace("0/","*/")),x[3].indexOf("1/")==0&&(x[3]=x[3].replace("1/","*/")),x[4].indexOf("1/")==0&&(x[4]=x[4].replace("1/","*/")),x[6].indexOf("1/")==0&&(x[6]=x[6].replace("1/","*/")),x[5]=x[5].replace(/(^\d)|([^#/\s]\d)/g,function(D){var O=D.replace(/\D/,""),M=O;return y.dayOfWeekStartIndexZero?O=="7"&&(M="0"):M=(parseInt(O)-1).toString(),D.replace(O,M)}),x[5]=="L"&&(x[5]="6"),x[3]=="?"&&(x[3]="*"),x[3].indexOf("W")>-1&&(x[3].indexOf(",")>-1||x[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var v={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var T in v)x[5]=x[5].replace(new RegExp(T,"gi"),v[T].toString());x[4]=x[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(D){var O=D.replace(/\D/,""),M=O;return y.monthStartIndexZero&&(M=(parseInt(O)+1).toString()),D.replace(O,M)});var w={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var N in w)x[4]=x[4].replace(new RegExp(N,"gi"),w[N].toString());x[0]=="0"&&(x[0]=""),!/\*|\-|\,|\//.test(x[2])&&(/\*|\//.test(x[1])||/\*|\//.test(x[0]))&&(x[2]+="-".concat(x[2]));for(var A=0;A<x.length;A++)if(x[A].indexOf(",")!=-1&&(x[A]=x[A].split(",").filter(function(D){return D!==""}).join(",")||"*"),x[A]=="*/1"&&(x[A]="*"),x[A].indexOf("/")>-1&&!/^\*|\-|\,/.test(x[A])){var k=null;switch(A){case 4:k="12";break;case 5:k="6";break;case 6:k="9999";break;default:k=null;break}if(k!==null){var R=x[A].split("/");x[A]="".concat(R[0],"-").concat(k,"/").concat(R[1])}}},m.prototype.validate=function(x){var y="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(x[0],y),this.validateOnlyExpectedCharactersFound(x[1],y),this.validateOnlyExpectedCharactersFound(x[2],y),this.validateOnlyExpectedCharactersFound(x[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(x[4],y),this.validateOnlyExpectedCharactersFound(x[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(x[6],y),this.validateAnyRanges(x)},m.prototype.validateAnyRanges=function(x){d.default.secondRange(x[0]),d.default.minuteRange(x[1]),d.default.hourRange(x[2]),d.default.dayOfMonthRange(x[3]),d.default.monthRange(x[4],this.monthStartIndexZero),d.default.dayOfWeekRange(x[5],this.dayOfWeekStartIndexZero)},m.prototype.validateOnlyExpectedCharactersFound=function(x,y){var v=x.match(new RegExp("[^".concat(y,"]+"),"gi"));if(v&&v.length)throw new Error("Expression contains invalid values: '".concat(v.toString(),"'"))},m})();c.CronParser=p},333(l,c,f){Object.defineProperty(c,"__esModule",{value:!0}),c.ExpressionDescriptor=void 0;var d=f(823),p=f(949),m=(function(){function x(y,v){if(this.expression=y,this.options=v,this.expressionParts=new Array(5),!this.options.locale&&x.defaultLocale&&(this.options.locale=x.defaultLocale),!x.locales[this.options.locale]){var T=Object.keys(x.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(T,"'.")),this.options.locale=T}this.i18n=x.locales[this.options.locale],v.use24HourTimeFormat===void 0&&(v.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return x.toString=function(y,v){var T=v===void 0?{}:v,w=T.throwExceptionOnParseError,N=w===void 0?!0:w,A=T.verbose,k=A===void 0?!1:A,R=T.dayOfWeekStartIndexZero,D=R===void 0?!0:R,O=T.monthStartIndexZero,M=O===void 0?!1:O,I=T.use24HourTimeFormat,H=T.locale,P=H===void 0?null:H,K=T.logicalAndDayFields,Y=K===void 0?!1:K,W={throwExceptionOnParseError:N,verbose:k,dayOfWeekStartIndexZero:D,monthStartIndexZero:M,use24HourTimeFormat:I,locale:P,logicalAndDayFields:Y};W.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var te=new x(y,W);return te.getFullDescription()},x.initialize=function(y,v){v===void 0&&(v="en"),x.specialCharacters=["/","-",",","*"],x.defaultLocale=v,y.load(x.locales)},x.prototype.getFullDescription=function(){var y,v,T="";try{var w=new p.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=w.parse(),this.expressionParts[0]==="@reboot")return((v=(y=this.i18n).atReboot)===null||v===void 0?void 0:v.call(y))||"Run once, at startup";var N=this.getTimeOfDayDescription(),A=this.getDayOfMonthDescription(),k=this.getMonthDescription(),R=this.getDayOfWeekDescription(),D=this.getYearDescription();T+=N+A+R+k+D,T=this.transformVerbosity(T,!!this.options.verbose),T=T.charAt(0).toLocaleUpperCase()+T.substr(1)}catch(O){if(!this.options.throwExceptionOnParseError)T=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(O)}return T},x.prototype.getTimeOfDayDescription=function(){var y=this.expressionParts[0],v=this.expressionParts[1],T=this.expressionParts[2],w="";if(!d.StringUtilities.containsAny(v,x.specialCharacters)&&!d.StringUtilities.containsAny(T,x.specialCharacters)&&!d.StringUtilities.containsAny(y,x.specialCharacters))w+=this.i18n.atSpace()+this.formatTime(T,v,y);else if(!y&&v.indexOf("-")>-1&&!(v.indexOf(",")>-1)&&!(v.indexOf("/")>-1)&&!d.StringUtilities.containsAny(T,x.specialCharacters)){var N=v.split("-");w+=d.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(T,N[0],""),this.formatTime(T,N[1],""))}else if(!y&&T.indexOf(",")>-1&&T.indexOf("-")==-1&&T.indexOf("/")==-1&&!d.StringUtilities.containsAny(v,x.specialCharacters)){var A=T.split(",");w+=this.i18n.at();for(var k=0;k<A.length;k++)w+=" ",w+=this.formatTime(A[k],v,""),k<A.length-2&&(w+=","),k==A.length-2&&(w+=this.i18n.spaceAnd())}else{var R=this.getSecondsDescription(),D=this.getMinutesDescription(),O=this.getHoursDescription();if(w+=R,w&&D&&(w+=", "),w+=D,D===O)return w;w&&O&&(w+=", "),w+=O}return w},x.prototype.getSecondsDescription=function(){var y=this,v=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(T){return T},function(T){return d.StringUtilities.format(y.i18n.everyX0Seconds(T),T)},function(T){return y.i18n.secondsX0ThroughX1PastTheMinute()},function(T){return T=="0"?"":parseInt(T)<20?y.i18n.atX0SecondsPastTheMinute(T):y.i18n.atX0SecondsPastTheMinuteGt20()||y.i18n.atX0SecondsPastTheMinute(T)});return v},x.prototype.getMinutesDescription=function(){var y=this,v=this.expressionParts[0],T=this.expressionParts[2],w=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(N){return N},function(N){return d.StringUtilities.format(y.i18n.everyX0Minutes(N),N)},function(N){return y.i18n.minutesX0ThroughX1PastTheHour()},function(N){var A,k;try{return N=="0"&&T.indexOf("/")==-1&&v==""?y.i18n.everyHour():N=="0"?((k=(A=y.i18n).onTheHour)===null||k===void 0?void 0:k.call(A))||y.i18n.atX0MinutesPastTheHour(N):parseInt(N)<20?y.i18n.atX0MinutesPastTheHour(N):y.i18n.atX0MinutesPastTheHourGt20()||y.i18n.atX0MinutesPastTheHour(N)}catch{return y.i18n.atX0MinutesPastTheHour(N)}});return w},x.prototype.getHoursDescription=function(){var y=this,v=this.expressionParts[2],T=0,w=[];v.split("/")[0].split(",").forEach(function(k){var R=k.split("-");R.length===2&&w.push({value:R[1],index:T+1}),T+=R.length});var N=0,A=this.getSegmentDescription(v,this.i18n.everyHour(),function(k){var R=w.find(function(O){return O.value===k&&O.index===N}),D=R&&y.expressionParts[1]!=="0";return N++,D?y.formatTime(k,"59",""):y.formatTime(k,"0","")},function(k){return d.StringUtilities.format(y.i18n.everyX0Hours(k),k)},function(k){return y.i18n.betweenX0AndX1()},function(k){return y.i18n.atX0()});return A},x.prototype.getDayOfWeekDescription=function(){var y=this,v=this.i18n.daysOfTheWeek(),T=null;return this.expressionParts[5]=="*"?T="":T=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(w,N){var A=w;w.indexOf("#")>-1?A=w.substring(0,w.indexOf("#")):w.indexOf("L")>-1&&(A=A.replace("L",""));var k=parseInt(A),R=y.i18n.daysOfTheWeekInCase?y.i18n.daysOfTheWeekInCase(N)[k]:v[k];if(w.indexOf("#")>-1){var D=null,O=w.substring(w.indexOf("#")+1),M=w.substring(0,w.indexOf("#"));switch(O){case"1":D=y.i18n.first(M);break;case"2":D=y.i18n.second(M);break;case"3":D=y.i18n.third(M);break;case"4":D=y.i18n.fourth(M);break;case"5":D=y.i18n.fifth(M);break}R=D+" "+R}return R},function(w){return parseInt(w)==1?"":d.StringUtilities.format(y.i18n.commaEveryX0DaysOfTheWeek(w),w)},function(w){var N=w.substring(0,w.indexOf("-")),A=y.expressionParts[3]!="*";return A?y.i18n.commaAndX0ThroughX1(N):y.i18n.commaX0ThroughX1(N)},function(w){var N=null;if(w.indexOf("#")>-1){var A=w.substring(w.indexOf("#")+1),k=w.substring(0,w.indexOf("#"));N=y.i18n.commaOnThe(A,k).trim()+y.i18n.spaceX0OfTheMonth()}else if(w.indexOf("L")>-1)N=y.i18n.commaOnTheLastX0OfTheMonth(w.replace("L",""));else{var R=y.expressionParts[3]!="*";R?y.options.logicalAndDayFields?N=y.i18n.commaOnlyOnX0(w):N=y.i18n.commaAndOnX0():N=y.i18n.commaOnlyOnX0(w)}return N}),T},x.prototype.getMonthDescription=function(){var y=this,v=this.i18n.monthsOfTheYear(),T=this.getSegmentDescription(this.expressionParts[4],"",function(w,N){return N&&y.i18n.monthsOfTheYearInCase?y.i18n.monthsOfTheYearInCase(N)[parseInt(w)-1]:v[parseInt(w)-1]},function(w){return parseInt(w)==1?"":d.StringUtilities.format(y.i18n.commaEveryX0Months(w),w)},function(w){return y.i18n.commaMonthX0ThroughMonthX1()||y.i18n.commaX0ThroughX1()},function(w){return y.i18n.commaOnlyInMonthX0?y.i18n.commaOnlyInMonthX0():y.i18n.commaOnlyInX0()});return T},x.prototype.getDayOfMonthDescription=function(){var y=this,v=null,T=this.expressionParts[3];switch(T){case"L":v=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":v=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var w=T.match(/(\d{1,2}W)|(W\d{1,2})/);if(w){var N=parseInt(w[0].replace("W","")),A=N==1?this.i18n.firstWeekday():d.StringUtilities.format(this.i18n.weekdayNearestDayX0(),N.toString());v=d.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),A);break}else{var k=T.match(/L-(\d{1,2})/);if(k){var R=k[1];v=d.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(R),R);break}else{if(T=="*"&&this.expressionParts[5]!="*")return"";v=this.getSegmentDescription(T,this.i18n.commaEveryDay(),function(D){return D=="L"?y.i18n.lastDay():y.i18n.dayX0?d.StringUtilities.format(y.i18n.dayX0(),D):D},function(D){return D=="1"?y.i18n.commaEveryDay():y.i18n.commaEveryX0Days(D)},function(D){return y.i18n.commaBetweenDayX0AndX1OfTheMonth(D)},function(D){return y.i18n.commaOnDayX0OfTheMonth(D)})}break}}return v},x.prototype.getYearDescription=function(){var y=this,v=this.getSegmentDescription(this.expressionParts[6],"",function(T){return/^\d+$/.test(T)?new Date(parseInt(T),1).getFullYear().toString():T},function(T){return d.StringUtilities.format(y.i18n.commaEveryX0Years(T),T)},function(T){return y.i18n.commaYearX0ThroughYearX1()||y.i18n.commaX0ThroughX1()},function(T){return y.i18n.commaOnlyInYearX0?y.i18n.commaOnlyInYearX0():y.i18n.commaOnlyInX0()});return v},x.prototype.getSegmentDescription=function(y,v,T,w,N,A){var k=null,R=y.indexOf("/")>-1,D=y.indexOf("-")>-1,O=y.indexOf(",")>-1;if(!y)k="";else if(y==="*")k=v;else if(!R&&!D&&!O)k=d.StringUtilities.format(A(y),T(y));else if(O){for(var M=y.split(","),I="",H=0;H<M.length;H++)if(H>0&&M.length>2&&(I+=",",H<M.length-1&&(I+=" ")),H>0&&M.length>1&&(H==M.length-1||M.length==2)&&(I+="".concat(this.i18n.spaceAnd()," ")),M[H].indexOf("/")>-1||M[H].indexOf("-")>-1){var P=M[H].indexOf("-")>-1&&M[H].indexOf("/")==-1,K=this.getSegmentDescription(M[H],v,T,w,P?this.i18n.commaX0ThroughX1:N,A);P&&(K=K.replace(", ","")),I+=K}else if(!R)I+=T(M[H]);else{var Y=this.getSegmentDescription(M[H],v,T,w,N,A);Y&&Y.startsWith(", ")&&(Y=Y.substring(2)),I+=Y}R?k=I:k=d.StringUtilities.format(A(y),I)}else if(R){var M=y.split("/");if(k=d.StringUtilities.format(w(M[1]),M[1]),M[0].indexOf("-")>-1){var W=this.generateRangeSegmentDescription(M[0],N,T);W.indexOf(", ")!=0&&(k+=", "),k+=W}else if(M[0].indexOf("*")==-1){var te=d.StringUtilities.format(A(M[0]),T(M[0]));te=te.replace(", ",""),k+=d.StringUtilities.format(this.i18n.commaStartingX0(),te)}}else D&&(k=this.generateRangeSegmentDescription(y,N,T));return k},x.prototype.generateRangeSegmentDescription=function(y,v,T){var w="",N=y.split("-"),A=T(N[0],1),k=T(N[1],2),R=v(y);return w+=d.StringUtilities.format(R,A,k),w},x.prototype.formatTime=function(y,v,T){var w=0,N=0,A=parseInt(y)+w,k=parseInt(v)+N;k>=60?(k-=60,A+=1):k<0&&(k+=60,A-=1),A>=24?A=A-24:A<0&&(A=24+A);var R="",D=!1;this.options.use24HourTimeFormat||(D=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),R=D?"".concat(this.getPeriod(A)," "):" ".concat(this.getPeriod(A)),A>12&&(A-=12),A===0&&(A=12));var O="";return T&&(O=":".concat(("00"+T).substring(T.length))),"".concat(D?R:"").concat(("00"+A.toString()).substring(A.toString().length),":").concat(("00"+k.toString()).substring(k.toString().length)).concat(O).concat(D?"":R)},x.prototype.transformVerbosity=function(y,v){if(!v&&(y=y.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),y=y.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),y=y.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),y=y.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var T=0,w=Object.entries(this.i18n.conciseVerbosityReplacements());T<w.length;T++){var N=w[T],A=N[0],k=N[1];y=y.replace(new RegExp(A,"g"),k)}return y},x.prototype.getPeriod=function(y){return y>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},x.locales={},x})();c.ExpressionDescriptor=m},747(l,c,f){Object.defineProperty(c,"__esModule",{value:!0}),c.enLocaleLoader=void 0;var d=f(486),p=(function(){function m(){}return m.prototype.load=function(x){x.en=new d.en},m})();c.enLocaleLoader=p},486(l,c){Object.defineProperty(c,"__esModule",{value:!0}),c.en=void 0;var f=(function(){function d(){}return d.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},d.prototype.atX0MinutesPastTheHourGt20=function(){return null},d.prototype.commaMonthX0ThroughMonthX1=function(){return null},d.prototype.commaYearX0ThroughYearX1=function(){return null},d.prototype.use24HourTimeFormatByDefault=function(){return!1},d.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},d.prototype.everyMinute=function(){return"every minute"},d.prototype.everyHour=function(){return"every hour"},d.prototype.atSpace=function(){return"At "},d.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},d.prototype.at=function(){return"At"},d.prototype.spaceAnd=function(){return" and"},d.prototype.everySecond=function(){return"every second"},d.prototype.everyX0Seconds=function(){return"every %s seconds"},d.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},d.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},d.prototype.everyX0Minutes=function(){return"every %s minutes"},d.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},d.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},d.prototype.everyX0Hours=function(){return"every %s hours"},d.prototype.betweenX0AndX1=function(){return"between %s and %s"},d.prototype.atX0=function(){return"at %s"},d.prototype.commaEveryDay=function(){return", every day"},d.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},d.prototype.commaX0ThroughX1=function(){return", %s through %s"},d.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},d.prototype.first=function(){return"first"},d.prototype.second=function(){return"second"},d.prototype.third=function(){return"third"},d.prototype.fourth=function(){return"fourth"},d.prototype.fifth=function(){return"fifth"},d.prototype.commaOnThe=function(){return", on the "},d.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},d.prototype.lastDay=function(){return"the last day"},d.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},d.prototype.commaOnlyOnX0=function(){return", only on %s"},d.prototype.commaAndOnX0=function(){return", and on %s"},d.prototype.commaEveryX0Months=function(){return", every %s months"},d.prototype.commaOnlyInX0=function(){return", only in %s"},d.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},d.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},d.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},d.prototype.firstWeekday=function(){return"first weekday"},d.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},d.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},d.prototype.commaEveryX0Days=function(){return", every %s days in a month"},d.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},d.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},d.prototype.commaEveryHour=function(){return", every hour"},d.prototype.commaEveryX0Years=function(){return", every %s years"},d.prototype.commaStartingX0=function(){return", starting %s"},d.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},d.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},d.prototype.atReboot=function(){return"Run once, at startup"},d.prototype.onTheHour=function(){return"on the hour"},d})();c.en=f},515(l,c){Object.defineProperty(c,"__esModule",{value:!0});function f(p,m){if(!p)throw new Error(m)}var d=(function(){function p(){}return p.secondRange=function(m){for(var x=m.split(","),y=0;y<x.length;y++)if(!isNaN(parseInt(x[y],10))){var v=parseInt(x[y],10);f(v>=0&&v<=59,"seconds part must be >= 0 and <= 59")}},p.minuteRange=function(m){for(var x=m.split(","),y=0;y<x.length;y++)if(!isNaN(parseInt(x[y],10))){var v=parseInt(x[y],10);f(v>=0&&v<=59,"minutes part must be >= 0 and <= 59")}},p.hourRange=function(m){for(var x=m.split(","),y=0;y<x.length;y++)if(!isNaN(parseInt(x[y],10))){var v=parseInt(x[y],10);f(v>=0&&v<=23,"hours part must be >= 0 and <= 23")}},p.dayOfMonthRange=function(m){for(var x=m.split(","),y=0;y<x.length;y++)if(!isNaN(parseInt(x[y],10))){var v=parseInt(x[y],10);f(v>=1&&v<=31,"DOM part must be >= 1 and <= 31")}},p.monthRange=function(m,x){for(var y=m.split(","),v=0;v<y.length;v++)if(!isNaN(parseInt(y[v],10))){var T=parseInt(y[v],10);f(T>=1&&T<=12,x?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},p.dayOfWeekRange=function(m,x){for(var y=m.split(","),v=0;v<y.length;v++)if(!isNaN(parseInt(y[v],10))){var T=parseInt(y[v],10);f(T>=0&&T<=6,x?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},p})();c.default=d},823(l,c){Object.defineProperty(c,"__esModule",{value:!0}),c.StringUtilities=void 0;var f=(function(){function d(){}return d.format=function(p){for(var m=[],x=1;x<arguments.length;x++)m[x-1]=arguments[x];return p.replace(/%s/g,function(y){return m.shift()})},d.containsAny=function(p,m){return m.some(function(x){return p.indexOf(x)>-1})},d})();c.StringUtilities=f}},r={};function s(l){var c=r[l];if(c!==void 0)return c.exports;var f=r[l]={exports:{}};return n[l](f,f.exports,s),f.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.toString=void 0;var c=s(333),f=s(747);c.ExpressionDescriptor.initialize(new f.enLocaleLoader),l.default=c.ExpressionDescriptor;var d=c.ExpressionDescriptor.toString;l.toString=d})(),i})())})(Hy)),Hy.exports}var zre=Fre();const BI=ml(zre),Ure=[{label:"5m",cron:"*/5 * * * *"},{label:"15m",cron:"*/15 * * * *"},{label:"1h",cron:"0 * * * *"},{label:"6h",cron:"0 */6 * * *"},{label:"Daily",cron:"0 0 * * *"},{label:"9am",cron:"0 9 * * *"},{label:"Weekdays",cron:"0 9 * * 1-5"},{label:"Weekly",cron:"0 9 * * 1"},{label:"Monthly",cron:"0 9 1 * *"}];function Hre({value:e,onChange:t}){return u.jsx("div",{className:"flex flex-wrap gap-1.5",children:Ure.map(n=>u.jsx("button",{type:"button",className:Ee("rounded-md border px-2 py-1 text-xs font-medium transition-colors",e===n.cron?"border-primary bg-primary/10 text-primary":"border-input hover:bg-accent hover:text-accent-foreground"),onClick:()=>t(n.cron),children:n.label},n.cron))})}function F3(e){const t=e.trim().split(/\s+/);return{minute:t[0]??"*",hour:t[1]??"*",dayOfMonth:t[2]??"*",month:t[3]??"*",dayOfWeek:t[4]??"*"}}function $re(e){return`${e.minute} ${e.hour} ${e.dayOfMonth} ${e.month} ${e.dayOfWeek}`}const Vre=["*","0","5","10","15","20","30","45"],qre=["*",...Array.from({length:24},(e,t)=>String(t))],Yre=["*",...Array.from({length:31},(e,t)=>String(t+1))],Gre=[{value:"*",label:"Every month"},{value:"1",label:"Jan"},{value:"2",label:"Feb"},{value:"3",label:"Mar"},{value:"4",label:"Apr"},{value:"5",label:"May"},{value:"6",label:"Jun"},{value:"7",label:"Jul"},{value:"8",label:"Aug"},{value:"9",label:"Sep"},{value:"10",label:"Oct"},{value:"11",label:"Nov"},{value:"12",label:"Dec"}],Kre=[{value:"*",label:"Every day"},{value:"0",label:"Sun"},{value:"1",label:"Mon"},{value:"2",label:"Tue"},{value:"3",label:"Wed"},{value:"4",label:"Thu"},{value:"5",label:"Fri"},{value:"6",label:"Sat"}];function Qre({value:e,onChange:t}){const n=b.useMemo(()=>F3(e),[e]),r=b.useCallback((s,i)=>{const l={...F3(e),[s]:i};t($re(l))},[e,t]);return u.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[u.jsx(Nd,{label:"Minute",value:n.minute,options:Vre,onChange:s=>r("minute",s)}),u.jsx(Nd,{label:"Hour",value:n.hour,options:qre,onChange:s=>r("hour",s)}),u.jsx(Nd,{label:"Day",value:n.dayOfMonth,options:Yre,onChange:s=>r("dayOfMonth",s)}),u.jsx(Nd,{label:"Month",value:n.month,options:Gre,onChange:s=>r("month",s)}),u.jsx(Nd,{label:"Weekday",value:n.dayOfWeek,options:Kre,onChange:s=>r("dayOfWeek",s)})]})}function Nd({label:e,value:t,options:n,onChange:r}){return u.jsxs("div",{className:"space-y-1",children:[u.jsx(Gt,{className:"text-[11px] text-muted-foreground",children:e}),u.jsxs(Us,{value:t,onValueChange:r,children:[u.jsx(ws,{className:"h-8 text-xs","aria-label":e,children:u.jsx(Hs,{})}),u.jsx(Cs,{children:n.map(s=>{const i=typeof s=="string"?s:s.value,l=typeof s=="string"?s==="*"?"Any":s:s.label;return u.jsx(Lt,{value:i,className:"text-xs",children:l},i)})})]})]})}function Xre(e){const t=new Map;for(const n of e){const[r]=n.split("/");t.has(r)||t.set(r,[]),t.get(r).push(n)}return t}function Wre({value:e,onChange:t}){const[n,r]=b.useState(!1),s=b.useRef(null),i=b.useMemo(()=>{try{return Intl.supportedValuesOf("timeZone")}catch{return[]}},[]),l=b.useMemo(()=>Xre(i),[i]),c=b.useMemo(()=>Intl.DateTimeFormat().resolvedOptions().timeZone,[]);b.useEffect(()=>{if(!n)return;function p(m){s.current&&!s.current.contains(m.target)&&r(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const f=e||"System default";function d(p){t(p),r(!1)}return u.jsxs("div",{ref:s,className:"relative w-full",children:[u.jsxs("button",{type:"button","aria-expanded":n,"aria-haspopup":"listbox",className:Ee("border-input ring-offset-background flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors","focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none","hover:bg-accent/50"),onClick:()=>r(p=>!p),children:[u.jsx("span",{className:"truncate",children:f}),u.jsx(iY,{className:"ml-2 size-4 shrink-0 opacity-50"})]}),n&&u.jsx("div",{className:"bg-popover text-popover-foreground absolute left-0 top-full z-50 mt-1 w-full rounded-md border shadow-md",children:u.jsxs(Hee,{children:[u.jsx($ee,{placeholder:"Search timezone..."}),u.jsxs(Vee,{className:"max-h-60",children:[u.jsx(qee,{children:"No timezone found."}),u.jsxs(d3,{heading:"Default",children:[u.jsxs(Cy,{value:"system-default",onSelect:()=>d(""),children:[u.jsx("span",{children:"System default"}),e===""&&u.jsx(zn,{className:"ml-auto size-4"})]}),c&&u.jsxs(Cy,{value:`${c}-detected`,onSelect:()=>d(c),children:[u.jsxs("span",{children:[c," (detected)"]}),e===c&&u.jsx(zn,{className:"ml-auto size-4"})]})]}),[...l.entries()].map(([p,m])=>u.jsx(d3,{heading:p,children:m.map(x=>u.jsxs(Cy,{value:x,onSelect:()=>d(x),children:[u.jsx("span",{children:x.replace(`${p}/`,"").replace(/_/g," ")}),x===e&&u.jsx(zn,{className:"ml-auto size-4"})]},x))},p))]})]})})]})}const z3=10,Zre=100,Jre=720;function ese(e){if(!e.trim())return"";try{return BI.toString(e)}catch{return"Invalid cron expression"}}function U3(e){return e?{name:e.name,prompt:e.prompt,cron:e.cron,cwd:e.cwd??"",timezone:e.timezone??"",permissionMode:e.permissionMode==="bypassPermissions"?"bypassPermissions":"acceptEdits",maxRuntimeMin:e.maxRuntime?e.maxRuntime/6e4:z3}:{name:"",prompt:"",cron:"",cwd:"",timezone:"",permissionMode:"acceptEdits",maxRuntimeMin:z3}}function H3({open:e,onOpenChange:t,editSchedule:n}){const r=SI(),s=wI(),[i,l]=b.useState(()=>U3(n)),[c,f]=b.useState(!1),[d,p]=b.useState(!1);b.useEffect(()=>{l(U3(n))},[n,e]);function m(w,N){l(A=>({...A,[w]:N}))}const x=ese(i.cron),y=i.name.trim()&&i.prompt.trim()&&i.cron.trim(),v=r.isPending||s.isPending;function T(w){if(w.preventDefault(),!y||v)return;const N={name:i.name.trim(),prompt:i.prompt.trim(),cron:i.cron.trim(),...i.cwd.trim()&&{cwd:i.cwd.trim()},...i.timezone&&{timezone:i.timezone},permissionMode:i.permissionMode,maxRuntime:i.maxRuntimeMin*6e4};n?s.mutate({id:n.id,...N},{onSuccess:()=>t(!1)}):r.mutate(N,{onSuccess:()=>t(!1)})}return u.jsxs(ua,{open:e,onOpenChange:t,children:[u.jsxs(ca,{className:"max-h-[85vh] max-w-lg gap-0 p-0",children:[u.jsxs(da,{className:"border-b px-4 py-3",children:[u.jsx(fa,{children:n?"Edit Schedule":"New Schedule"}),u.jsx(ha,{className:"sr-only",children:n?"Edit an existing Pulse schedule":"Create a new Pulse schedule"})]}),u.jsx("form",{onSubmit:T,id:"schedule-form",children:u.jsxs("div",{className:"space-y-5 overflow-y-auto px-4 py-5",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Gt,{htmlFor:"schedule-name",children:"Name *"}),u.jsx(Ss,{id:"schedule-name",value:i.name,onChange:w=>m("name",w.target.value),maxLength:Zre,placeholder:"Daily code review",required:!0})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Gt,{htmlFor:"schedule-prompt",children:"Prompt *"}),u.jsx("textarea",{id:"schedule-prompt",className:"border-input focus-visible:ring-ring w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:ring-1 focus-visible:outline-none",value:i.prompt,onChange:w=>m("prompt",w.target.value),rows:4,placeholder:"Review all pending PRs and summarize findings...",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"schedule-cron",children:"Schedule *"}),u.jsx(Hre,{value:i.cron,onChange:w=>m("cron",w)}),u.jsxs(mt,{type:"button",variant:"ghost",size:"xs",onClick:()=>f(w=>!w),className:"mt-1 text-muted-foreground hover:text-foreground",children:[u.jsx(As,{className:Ee("size-3 transition-transform",c&&"rotate-90")}),"Custom schedule"]}),u.jsx(ft,{initial:!1,children:c&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:[.4,0,.2,1]},className:"overflow-hidden",children:u.jsx("div",{className:"pt-2",children:u.jsx(Qre,{value:i.cron,onChange:w=>m("cron",w)})})})}),u.jsx(Ss,{id:"schedule-cron",className:"font-mono",value:i.cron,onChange:w=>m("cron",w.target.value),placeholder:"0 9 * * 1-5",required:!0}),x&&u.jsx("p",{className:Ee("text-xs",x==="Invalid cron expression"?"text-destructive":"text-muted-foreground"),children:x})]}),u.jsx("div",{className:"border-t pt-4",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Gt,{htmlFor:"schedule-cwd",children:"Working Directory"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("div",{className:Ee("flex-1 truncate rounded-md border px-3 py-2 text-sm font-mono",i.cwd?"text-foreground":"text-muted-foreground"),children:i.cwd||"Default (server working directory)"}),u.jsx(mt,{type:"button",variant:"outline",size:"icon-sm",onClick:()=>p(!0),"aria-label":"Browse directories",children:u.jsx(Hf,{className:"size-4"})})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Gt,{children:"Timezone"}),u.jsx(Wre,{value:i.timezone,onChange:w=>m("timezone",w)})]})]})}),u.jsxs("details",{className:"group",children:[u.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[u.jsx(As,{className:"size-4 transition-transform group-open:rotate-90"}),"Advanced settings"]}),u.jsxs("div",{className:"mt-3 space-y-4 pl-6",children:[u.jsxs("fieldset",{className:"space-y-2",children:[u.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permission Mode"}),u.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[u.jsx("input",{type:"radio",name:"permissionMode",checked:i.permissionMode==="acceptEdits",onChange:()=>m("permissionMode","acceptEdits")}),"Allow file edits"]}),u.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[u.jsx("input",{type:"radio",name:"permissionMode",checked:i.permissionMode==="bypassPermissions",onChange:()=>m("permissionMode","bypassPermissions")}),"Full autonomy"]}),i.permissionMode==="bypassPermissions"&&u.jsx("p",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Warning: This allows the agent to execute any tool without approval."})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Gt,{htmlFor:"schedule-max-runtime",children:"Max Runtime (minutes)"}),u.jsx(Ss,{id:"schedule-max-runtime",type:"number",className:"w-24",value:i.maxRuntimeMin,onChange:w=>m("maxRuntimeMin",Number(w.target.value)),min:1,max:Jre})]})]})]})]})}),u.jsxs(hI,{className:"border-t px-4 py-3",children:[u.jsx(mt,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),u.jsx(mt,{type:"submit",size:"sm",form:"schedule-form",disabled:!y||v,children:v?"Saving...":n?"Save":"Create"})]})]}),u.jsx(eg,{open:d,onOpenChange:p,onSelect:w=>m("cwd",w)})]})}function tse({onCreateSchedule:e}){return u.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-16",children:[u.jsx("div",{className:"mb-8 w-full max-w-md select-none opacity-40 pointer-events-none",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"rounded-lg border p-3",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"size-2 rounded-full bg-emerald-500"}),u.jsxs("div",{className:"flex-1 space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-sm font-medium",children:"Daily Health Check"}),u.jsx("span",{className:"text-xs text-muted-foreground",children:"Every day at 9:00 AM"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Run test suite and report failures"})]})]})}),u.jsx("div",{className:"rounded-lg border p-3",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"size-2 rounded-full bg-blue-500"}),u.jsxs("div",{className:"flex-1 space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-sm font-medium",children:"Weekly Code Review"}),u.jsx("span",{className:"text-xs text-muted-foreground",children:"Every Monday at 8:00 AM"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Review open PRs and summarize changes"})]})]})}),u.jsx("div",{className:"rounded-lg border p-3",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"size-2 rounded-full bg-muted"}),u.jsxs("div",{className:"flex-1 space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-sm font-medium",children:"Dependency Audit"}),u.jsx("span",{className:"text-xs text-muted-foreground",children:"Every Friday at 5:00 PM"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Check for outdated or vulnerable packages"})]})]})})]})}),u.jsx("h3",{className:"mb-2 text-lg font-medium",children:"Automate recurring tasks"}),u.jsx("p",{className:"mb-6 max-w-sm text-center text-sm text-muted-foreground",children:"Schedules run Claude Code on a cron — health checks, audits, code reviews, and more."}),u.jsx(mt,{onClick:e,children:"Create Schedule"})]})}function nse(e){if(e===null)return"-";if(e<1e3)return"< 1s";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}function $3(e,t=80){const n=e.split(`
|
|
593
|
-
`)[0]??"";return n.length>t?`${n.slice(0,t)}…`:n}function Mv(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}function rse({status:e}){switch(e){case"running":return u.jsx("span",{title:"Running","aria-label":"Running",children:u.jsx(Qn,{className:"size-3.5 animate-spin text-blue-500"})});case"completed":return u.jsx("span",{title:"Completed","aria-label":"Completed",children:u.jsx(zf,{className:"size-3.5 text-green-500"})});case"failed":return u.jsx("span",{title:"Failed","aria-label":"Failed",children:u.jsx(VO,{className:"size-3.5 text-destructive"})});case"cancelled":return u.jsx("span",{title:"Cancelled","aria-label":"Cancelled",children:u.jsx(uY,{className:"size-3.5 text-muted-foreground"})});default:return null}}function sse({trigger:e}){return e==="scheduled"?u.jsx(Uf,{className:"mr-1 inline size-3 shrink-0 text-muted-foreground/70","aria-hidden":"true"}):e==="manual"?u.jsx(WO,{className:"mr-1 inline size-3 shrink-0 text-muted-foreground/70","aria-hidden":"true"}):null}function ase({date:e}){const t=new Date,n=new Date(e),r=new Date(t);r.setDate(r.getDate()-7);const s=n>=r,i=s?Dp(e):Mv(e),l=s?Mv(e):Dp(e);return u.jsx("time",{dateTime:e,title:l,children:i})}function $y(){return u.jsxs("div",{className:"grid grid-cols-[20px_56px_1fr_64px_72px_20px] items-center gap-2 rounded-md px-2 py-2",children:[u.jsx(Bs,{className:"size-3.5 rounded-full"}),u.jsx(Bs,{className:"h-3 w-10"}),u.jsx(Bs,{className:"h-3 w-24"}),u.jsx(Bs,{className:"h-3 w-8"}),u.jsx("span",{}),u.jsx("span",{})]})}function ise({run:e,onNavigate:t,onCancel:n,isCancelling:r}){const s=!!e.sessionId;function i(){e.sessionId&&t(e.sessionId)}function l(f){f.stopPropagation(),n(e.id)}const c=e.startedAt?Mv(e.startedAt):"unknown time";return u.jsxs("div",{role:s?"button":void 0,tabIndex:s?0:void 0,"aria-label":s?`View ${e.status} run from ${c}`:void 0,onClick:s?i:void 0,onKeyDown:s?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i())}:void 0,className:Ee("grid grid-cols-[20px_56px_1fr_64px_72px_20px] items-center gap-2","rounded-md border border-transparent px-2 py-2 text-xs transition-colors",s&&["cursor-pointer hover:bg-muted/50 hover:border-border","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-none"],e.status==="failed"&&"bg-destructive/5"),children:[u.jsx(rse,{status:e.status}),u.jsxs("span",{className:"truncate capitalize text-muted-foreground",children:[u.jsx(sse,{trigger:e.trigger}),e.trigger]}),u.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[u.jsx("span",{className:"text-foreground",children:e.startedAt?u.jsx(ase,{date:e.startedAt}):"-"}),e.outputSummary&&u.jsx("span",{className:"truncate text-muted-foreground",title:e.outputSummary,children:$3(e.outputSummary)}),e.status==="failed"&&e.error&&u.jsx("span",{className:"truncate text-destructive",title:e.error,children:$3(e.error)})]}),u.jsx("span",{className:"text-muted-foreground",children:nse(e.durationMs)}),u.jsx("span",{children:e.status==="running"&&u.jsx("button",{type:"button",disabled:r,onClick:l,className:Ee("inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium","text-muted-foreground transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50"),children:"Cancel"})}),u.jsx("span",{className:"flex items-center justify-end",children:s&&u.jsx(As,{className:"size-3.5 text-muted-foreground/50","aria-hidden":"true"})})]})}const Vy=20;function ose({scheduleId:e,scheduleCwd:t}){const[n,r]=b.useState("all"),[s,i]=b.useState(0),[l,c]=b.useState([]),f=n==="all"?void 0:n,{data:d=[],isLoading:p}=CI({scheduleId:e,status:f,limit:Vy,offset:s}),m=hne(),[,x]=oc(),[y,v]=If(),T=s===0?d:[...l,...d],w=b.useCallback(()=>{c(T),i(k=>k+Vy)},[T]),N=b.useCallback(k=>{r(k),i(0),c([])},[]),A=b.useCallback(k=>{t&&t!==y?(v(t),setTimeout(()=>x(k),0)):x(k)},[t,y,v,x]);return p&&T.length===0?u.jsxs("div",{className:"space-y-0.5","aria-label":"Loading runs...",children:[u.jsx($y,{}),u.jsx($y,{}),u.jsx($y,{})]}):T.length===0&&!p?u.jsxs("div",{className:"space-y-2",children:[u.jsx(V3,{value:n,onChange:N}),u.jsx("p",{className:"py-4 text-center text-xs text-muted-foreground",children:n==="all"?"No runs yet":`No ${n} runs`})]}):u.jsxs("div",{className:"space-y-0.5",children:[u.jsx(V3,{value:n,onChange:N}),u.jsxs("div",{className:"hidden sm:grid sm:grid-cols-[20px_56px_1fr_64px_72px_20px] sm:gap-2 sm:px-2 sm:pb-1 sm:text-xs sm:font-medium sm:text-muted-foreground",children:[u.jsx("span",{}),u.jsx("span",{children:"Trigger"}),u.jsx("span",{children:"Started"}),u.jsx("span",{children:"Duration"}),u.jsx("span",{}),u.jsx("span",{})]}),T.map(k=>u.jsx(ise,{run:k,onNavigate:A,onCancel:R=>m.mutate(R,{onSuccess:()=>Cn("Run cancelled"),onError:D=>Cn.error(`Failed to cancel: ${D instanceof Error?D.message:"Unknown error"}`)}),isCancelling:m.isPending},k.id)),d.length===Vy&&u.jsx("button",{type:"button",onClick:w,disabled:p,className:"mt-1 w-full rounded-md py-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground disabled:opacity-50",children:p?"Loading...":"Load more"})]})}function V3({value:e,onChange:t}){return u.jsx("div",{className:"mb-1 flex items-center gap-2",children:u.jsxs(Us,{value:e,onValueChange:t,children:[u.jsx(ws,{className:"h-7 w-[130px] text-xs",children:u.jsx(Hs,{placeholder:"Filter status"})}),u.jsxs(Cs,{children:[u.jsx(Lt,{value:"all",children:"All"}),u.jsx(Lt,{value:"running",children:"Running"}),u.jsx(Lt,{value:"completed",children:"Completed"}),u.jsx(Lt,{value:"failed",children:"Failed"}),u.jsx(Lt,{value:"cancelled",children:"Cancelled"})]})]})})}function lse(e){try{return BI.toString(e)}catch{return e}}function use({schedule:e}){const t=e.status==="pending_approval"?"bg-yellow-500":e.enabled?"bg-green-500":"bg-neutral-400";return u.jsx("span",{className:Ee("inline-block size-2 rounded-full",t)})}function cse({schedule:e,agent:t,expanded:n,onToggleExpand:r,onEdit:s}){const i=wI(),l=dne(),c=cne(),[f,d]=b.useState(!1),p=v=>{v.stopPropagation(),l.mutate(e.id,{onSuccess:()=>Cn("Run triggered"),onError:T=>Cn.error(`Failed to trigger run: ${T.message}`)})},m=v=>{v.stopPropagation(),i.mutate({id:e.id,status:"active",enabled:!0},{onSuccess:()=>Cn("Schedule approved"),onError:T=>Cn.error(`Failed to approve: ${T.message}`)})},x=v=>{v.stopPropagation(),c.mutate(e.id,{onError:T=>Cn.error(`Failed to reject: ${T.message}`)})},y=()=>{c.mutate(e.id,{onSuccess:()=>d(!1),onError:v=>Cn.error(`Failed to delete: ${v.message}`)})};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"rounded-lg border",children:[u.jsxs("div",{role:"button",tabIndex:0,className:"flex cursor-pointer items-center gap-3 p-3",onClick:r,onKeyDown:v=>(v.key==="Enter"||v.key===" ")&&r(),children:[u.jsx(use,{schedule:e}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[t?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"inline-block size-2 shrink-0 rounded-full",style:{backgroundColor:t.color??cf(t.id)}}),u.jsx("span",{className:"text-xs leading-none",children:t.icon??df(t.id)}),u.jsx("span",{className:"text-sm font-medium",children:t.name}),u.jsx("span",{className:"text-muted-foreground text-xs",children:"·"})]}):null,u.jsx("span",{className:t?"text-muted-foreground text-xs":"text-sm font-medium",children:e.name})]}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:[lse(e.cron),e.nextRun&&u.jsxs(u.Fragment,{children:[" · Next: ",new Date(e.nextRun).toLocaleString()]})]})]}),e.status==="pending_approval"?u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-2.5 py-1 text-xs font-medium shadow-sm transition-colors",onClick:m,children:"Approve"}),u.jsx("button",{className:"hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md px-2.5 py-1 text-xs font-medium transition-colors",onClick:x,children:"Reject"})]}):u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(xn,{checked:e.enabled,onCheckedChange:v=>{i.mutate({id:e.id,enabled:v})},onClick:v=>v.stopPropagation(),"aria-label":`Toggle ${e.name}`}),u.jsxs(FT,{children:[u.jsx(zT,{asChild:!0,children:u.jsx("button",{className:"text-muted-foreground hover:text-foreground rounded-md p-1 transition-colors","aria-label":`Actions for ${e.name}`,onClick:v=>v.stopPropagation(),children:u.jsx(CY,{className:"size-4"})})}),u.jsxs(J0,{align:"end",children:[u.jsxs(Lu,{onClick:()=>s(),children:[u.jsx(xG,{className:"mr-2 size-3.5"}),"Edit"]}),u.jsxs(Lu,{onClick:p,disabled:!e.enabled,children:[u.jsx(WO,{className:"mr-2 size-3.5"}),"Run Now"]}),u.jsx(lI,{}),u.jsxs(Lu,{onClick:v=>{v.stopPropagation(),d(!0)},className:"text-destructive focus:text-destructive",children:[u.jsx(tT,{className:"mr-2 size-3.5"}),"Delete"]})]})]})]})]}),u.jsx(ft,{initial:!1,children:n&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:[.4,0,.2,1]},className:"overflow-hidden",children:u.jsx("div",{className:"border-t px-3 pb-3 pt-2",children:u.jsx(ose,{scheduleId:e.id,scheduleCwd:e.cwd})})})})]}),u.jsx(sh,{open:f,onOpenChange:d,children:u.jsxs(yc,{children:[u.jsxs(bc,{children:[u.jsx(vc,{children:"Delete schedule"}),u.jsxs(ah,{children:["Delete “",e.name,"”? This will also remove all run history. This action cannot be undone."]})]}),u.jsxs(Z0,{children:[u.jsx("button",{onClick:()=>d(!1),className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-sm transition-colors",children:"Cancel"}),u.jsx("button",{onClick:y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 inline-flex items-center rounded-md px-3 py-1.5 text-sm font-medium shadow-sm transition-colors",children:"Delete"})]})]})})]})}function dse(){const e=qT(),{data:t=[],isLoading:n}=une(e),[r,s]=b.useState(!1),[i,l]=b.useState(),[c,f]=b.useState(null),d=[...new Set(t.map(m=>m.cwd).filter(Boolean))],{data:p}=t4(d);return e?n?u.jsx("div",{className:"space-y-2 p-4",children:[1,2,3].map(m=>u.jsx("div",{className:"rounded-lg border p-3",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"size-2 animate-pulse rounded-full bg-muted"}),u.jsxs("div",{className:"flex-1 space-y-1.5",children:[u.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted"}),u.jsx("div",{className:"h-3 w-48 animate-pulse rounded bg-muted"})]})]})},m))}):t.length===0?u.jsxs(u.Fragment,{children:[u.jsx(tse,{onCreateSchedule:()=>{l(void 0),s(!0)}}),u.jsx(H3,{open:r,onOpenChange:s,editSchedule:i})]}):u.jsxs("div",{className:"space-y-2 p-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Schedules"}),u.jsx("button",{onClick:()=>{l(void 0),s(!0)},className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-sm transition-colors",children:"New Schedule"})]}),u.jsx(ft,{initial:!1,children:t.map(m=>u.jsx(De.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2,ease:[0,0,.2,1]},children:u.jsx(cse,{schedule:m,agent:(p==null?void 0:p[m.cwd??""])??null,expanded:c===m.id,onToggleExpand:()=>f(c===m.id?null:m.id),onEdit:()=>{l(m),s(!0)}})},m.id))}),u.jsx(H3,{open:r,onOpenChange:s,editSchedule:i})]}):u.jsx(VT,{icon:Sp.pulse,name:"Pulse",description:"Pulse runs AI agent tasks on a schedule. Start DorkOS with the --pulse flag to enable it.",command:"dorkos --pulse"})}const WT={healthy:{dot:"bg-green-500",text:"text-green-600 dark:text-green-400",border:"border-l-green-500"},delivered:{dot:"bg-green-500",text:"text-green-600 dark:text-green-400",border:"border-l-green-500"},connected:{dot:"bg-green-500",text:"text-green-600 dark:text-green-400",border:"border-l-green-500"},pending:{dot:"bg-blue-500",text:"text-blue-600 dark:text-blue-400",border:"border-l-blue-500"},starting:{dot:"bg-blue-500",text:"text-blue-600 dark:text-blue-400",border:"border-l-blue-500"},new:{dot:"bg-blue-500",text:"text-blue-600 dark:text-blue-400",border:"border-l-blue-500"},degraded:{dot:"bg-amber-500",text:"text-amber-600 dark:text-amber-400",border:"border-l-amber-500"},warning:{dot:"bg-amber-500",text:"text-amber-600 dark:text-amber-400",border:"border-l-amber-500"},rate_limited:{dot:"bg-amber-500",text:"text-amber-600 dark:text-amber-400",border:"border-l-amber-500"},failed:{dot:"bg-red-500",text:"text-red-600 dark:text-red-400",border:"border-l-red-500"},error:{dot:"bg-red-500",text:"text-red-600 dark:text-red-400",border:"border-l-red-500"},disconnected:{dot:"bg-red-500",text:"text-red-600 dark:text-red-400",border:"border-l-red-500"},inactive:{dot:"bg-gray-400",text:"text-muted-foreground",border:"border-l-gray-400"},stopped:{dot:"bg-gray-400",text:"text-muted-foreground",border:"border-l-gray-400"}};function FI(e){var t;return((t=WT[e])==null?void 0:t.dot)??"bg-gray-400"}function fse(e){var t;return((t=WT[e])==null?void 0:t.text)??"text-muted-foreground"}function ZT(e){var t;return((t=WT[e])==null?void 0:t.border)??"border-l-gray-400"}function hse(e){switch(e){case"delivered":return"bg-green-500";case"failed":return"bg-red-500";case"sent":return"bg-yellow-500";case"timeout":return"bg-gray-500";default:return"bg-gray-400"}}function mse(e){return new Date(e).toLocaleTimeString()}function q3(e,t){if(e==null||t==null)return null;const n=new Date(t).getTime()-new Date(e).getTime();return n<1e3?`${n}ms`:`${(n/1e3).toFixed(1)}s`}function zI({messageId:e,onClose:t}){const{data:n,isLoading:r,error:s}=Ane(e);if(r)return u.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading trace..."});if(s||!n)return u.jsx("div",{className:"p-4 text-sm text-destructive",children:"Failed to load trace."});const{traceId:i,spans:l}=n;return u.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Trace: ",i.slice(0,8),"..."]}),t&&u.jsx("button",{onClick:t,className:"text-xs text-muted-foreground hover:text-foreground",children:"Close"})]}),u.jsx("div",{className:"relative ml-3 border-l border-border pl-6",children:l.map(c=>{const f=q3(c.sentAt,c.deliveredAt),d=q3(c.deliveredAt,c.processedAt);return u.jsxs("div",{className:"relative pb-4 last:pb-0",children:[u.jsx("div",{className:`absolute -left-[calc(1.5rem+0.3125rem)] top-1 h-2.5 w-2.5 rounded-full ${hse(c.status)}`}),u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[u.jsx("span",{className:"font-medium",children:c.subject}),u.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:c.status})]}),u.jsxs("div",{className:"flex gap-3 text-xs text-muted-foreground",children:[u.jsxs("span",{children:["Sent: ",mse(c.sentAt)]}),f&&u.jsxs("span",{children:["Delivery: ",f]}),d&&u.jsxs("span",{children:["Processing: ",d]})]}),c.errorMessage&&u.jsx("div",{className:"mt-1 rounded bg-destructive/10 px-2 py-1 text-xs text-destructive",children:c.errorMessage})]})]},c.id)})})]})}const pse={delivered:"Delivered",failed:"Failed",pending:"Pending"};function gse(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Y3(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:"2-digit"})}function xse(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function yse(e){return e.status==="delivered"?e.responseCount>0?`delivered · ${e.responseCount} chunks`:"delivered":e.failureReason??pse[e.status].toLowerCase()}function bse({conversation:e}){const[t,n]=b.useState(!1),[r,s]=b.useState(!1),[i,l]=b.useState(!1),c=FI(e.status),f=fse(e.status),d=ZT(e.status);return u.jsxs("div",{className:Ee("w-full rounded-lg border border-l-2 text-left transition-colors hover:bg-muted/50 hover:shadow-sm",d,t&&"bg-muted/30"),children:[u.jsxs("button",{type:"button",onClick:()=>n(!t),className:"w-full p-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:Ee("size-2 shrink-0 rounded-full",c)}),u.jsxs("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:[e.from.label,u.jsx("span",{className:"mx-1.5 text-muted-foreground",children:"→"}),e.to.label]}),u.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:gse(e.sentAt)})]}),u.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.preview&&u.jsxs("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:['"',e.preview,'"']}),u.jsx("span",{className:Ee("shrink-0 text-xs",f),children:yse(e)})]})]}),u.jsx(ft,{initial:!1,children:t&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"overflow-hidden",children:u.jsxs("div",{className:"space-y-3 border-t px-3 pb-3 pt-3",children:[e.payload!=null&&u.jsxs("div",{children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Payload"}),u.jsx("pre",{className:"mt-1 max-h-40 overflow-auto rounded bg-muted p-2 font-mono text-xs",children:JSON.stringify(e.payload,null,2)})]}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:[u.jsxs("span",{children:["Sent ",Y3(e.sentAt)]}),e.completedAt&&u.jsxs("span",{children:[" · Completed ",Y3(e.completedAt)]}),e.durationMs!=null&&u.jsxs("span",{children:[" · Duration: ",xse(e.durationMs)]}),e.responseCount>0&&u.jsxs("span",{children:[" · ",e.responseCount," response chunks"]})]}),e.failureReason&&u.jsx("div",{className:"rounded bg-destructive/10 px-2 py-1 text-xs text-destructive",children:e.failureReason}),u.jsxs("button",{type:"button",onClick:p=>{p.stopPropagation(),s(!r)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",children:[r?u.jsx(ti,{className:"size-3.5"}):u.jsx(As,{className:"size-3.5"}),"Technical Details"]}),u.jsx(ft,{initial:!1,children:r&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:"overflow-hidden",children:u.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs",children:[u.jsx("dt",{className:"text-muted-foreground",children:"Subject"}),u.jsx("dd",{className:"truncate font-mono",children:e.subject}),e.sessionId&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{className:"text-muted-foreground",children:"Session"}),u.jsx("dd",{className:"font-mono",children:e.sessionId.slice(0,8)})]}),e.traceId&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{className:"text-muted-foreground",children:"Trace ID"}),u.jsxs("dd",{className:"font-mono",children:[e.traceId.slice(0,12),"…"]})]}),u.jsx("dt",{className:"text-muted-foreground",children:"From (raw)"}),u.jsx("dd",{className:"truncate font-mono",children:e.from.raw}),u.jsx("dt",{className:"text-muted-foreground",children:"To (raw)"}),u.jsx("dd",{className:"truncate font-mono",children:e.to.raw})]})})}),e.traceId&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",onClick:p=>{p.stopPropagation(),l(!i)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",children:[i?u.jsx(ti,{className:"size-3.5"}):u.jsx(As,{className:"size-3.5"}),"Trace Timeline"]}),u.jsx(ft,{initial:!1,children:i&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:"overflow-hidden",children:u.jsx(zI,{messageId:e.traceId,onClose:()=>l(!1)})})})]})]})})})]})}const vse={hop_limit:{label:"Hop Limit",className:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400"},ttl_expired:{label:"TTL Expired",className:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400"},cycle_detected:{label:"Cycle Detected",className:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"},budget_exhausted:{label:"Budget Exhausted",className:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"}},Ese={label:"Unknown",className:"bg-muted text-muted-foreground"};function Tse(e){return e==="relay.system.console"?"System Console":e.startsWith("relay.system.pulse.")?"Pulse Scheduler":e.startsWith("relay.human.console.")?"Your Browser Session":e.startsWith("relay.agent.")?`Agent (${e.slice(12).slice(0,7)})`:e}function Sse(e){if(!e||typeof e!="object")return"";const t=e,n=(t==null?void 0:t.content)??(t==null?void 0:t.text)??(t==null?void 0:t.message);return typeof n=="string"?n.slice(0,80):""}function wse(e){const t=typeof e.subject=="string"?e.subject:"",n=t?Tse(t):"",r=Sse(e.payload);return r&&n?`"${r}" → ${n}`:r?`"${r}"`:n||""}function Cse(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Nse({item:e}){const[t,n]=b.useState(!1),r=vse[e.reason]??Ese,s=wse(e.envelope);return u.jsxs("div",{className:"border-l-2 border-red-500 pl-3",children:[u.jsxs("button",{type:"button",onClick:()=>n(!t),className:"flex w-full items-center gap-2 rounded py-1.5 text-left transition-colors hover:bg-muted/50",children:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:s||u.jsx("span",{className:"font-mono",children:e.messageId})}),u.jsx(gn,{className:Ee("shrink-0 text-xs font-normal border-0",r.className),children:r.label}),u.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Cse(e.failedAt)})]}),t&&u.jsxs("div",{className:"pb-2 pr-2 pt-1",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Envelope"}),u.jsx("pre",{className:"mt-1 max-h-32 overflow-auto rounded bg-muted p-2 font-mono text-xs",children:JSON.stringify(e.envelope,null,2)}),u.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Endpoint: ",u.jsx("span",{className:"font-mono",children:e.endpointHash})]})]})]})}function Ase({endpointHash:e,enabled:t=!0}){const[n,r]=b.useState(!1),s=e!=null?{endpointHash:e}:void 0,{data:i=[],isLoading:l}=_ne(s,t);if(l||i.length===0)return null;const c=n?ti:As;return u.jsxs("div",{className:"border-t",children:[u.jsxs("button",{type:"button",onClick:()=>r(!n),className:"flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-muted/50","aria-expanded":n,children:[u.jsx(fc,{className:"size-4 shrink-0 text-red-500"}),u.jsx("span",{className:"flex-1 text-sm font-medium",children:"Dead Letters"}),u.jsx(gn,{variant:"destructive",className:"shrink-0 tabular-nums",children:i.length}),u.jsx(c,{className:"size-4 shrink-0 text-muted-foreground"})]}),n&&u.jsx("div",{className:"space-y-1 px-3 pb-3",children:i.map(f=>u.jsx(Nse,{item:f},f.messageId))})]})}function kse(e){try{return JSON.parse(e)}catch{return{content:e}}}function _se({open:e,onOpenChange:t}={}){const[n,r]=b.useState(!1),[s,i]=b.useState(""),[l,c]=b.useState("relay.human.console"),[f,d]=b.useState(""),[p,m]=b.useState(null),x=e!==void 0,y=x?e:n,v=xne();function T(){i(""),c("relay.human.console"),d(""),m(null)}function w(A){x?t==null||t(A):r(A),A||T()}function N(A){A.preventDefault(),m(null),v.mutate({subject:s,from:l,payload:kse(f)},{onSuccess:()=>{Cn.success("Message sent"),T(),w(!1)},onError:k=>{m(k instanceof Error?k.message:"Failed to send message")}})}return u.jsxs(sh,{open:y,onOpenChange:w,children:[!x&&u.jsx(q6,{asChild:!0,children:u.jsxs(mt,{variant:"ghost",size:"sm",className:"gap-1.5","data-testid":"compose-trigger",children:[u.jsx(pG,{className:"size-3.5"}),"Compose"]})}),u.jsxs(yc,{children:[u.jsxs(bc,{children:[u.jsx(vc,{children:"Send Test Message"}),u.jsx(ah,{children:"Compose a message to send through the Relay bus."})]}),u.jsxs("form",{onSubmit:N,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"compose-subject",children:"Subject"}),u.jsx(Ss,{id:"compose-subject",value:s,onChange:A=>i(A.target.value),placeholder:"e.g. relay.test.ping",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"compose-from",children:"From"}),u.jsx(Ss,{id:"compose-from",value:l,onChange:A=>c(A.target.value),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"compose-payload",children:"Payload"}),u.jsx($T,{id:"compose-payload",value:f,onChange:A=>d(A.target.value),placeholder:'Plain text or JSON (e.g. {"content": "hello"})',rows:4})]}),p!==null&&u.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:p}),u.jsx("div",{className:"flex justify-end",children:u.jsxs(mt,{type:"submit",disabled:v.isPending,children:[v.isPending?u.jsx(Qn,{className:"mr-2 size-4 animate-spin"}):u.jsx(kG,{className:"mr-2 size-4"}),"Send"]})})]})]})]})}function Rse(e){return e.startsWith("relay.agent.")?"chat":e.startsWith("relay.system.pulse.")?"pulse":"system"}const Ose={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeOut"}},Dse={initial:!1,animate:{opacity:1,y:0},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeOut"}};function jse(e,t,n,r){return e.filter(s=>{if(t!=="all"&&Rse(s.subject)!==t||n!=="all"&&s.status!==n)return!1;if(r){const i=r.toLowerCase();if(!(s.from.label.toLowerCase().includes(i)||s.to.label.toLowerCase().includes(i)||s.preview.toLowerCase().includes(i)||s.subject.toLowerCase().includes(i)))return!1}return!0})}function Mse({enabled:e,deadLetterRef:t,onSwitchToAdapters:n}){const[r,s]=b.useState("all"),[i,l]=b.useState("all"),[c,f]=b.useState(""),{data:d,isLoading:p}=One(e),m=(d==null?void 0:d.conversations)??[],x=b.useRef(null);b.useEffect(()=>{m.length>0&&x.current===null&&(x.current=new Set(m.map(w=>w.id)))},[m]);const y=r!=="all"||i!=="all"||c!=="",v=jse(m,r,i,c);function T(){s("all"),l("all"),f("")}return p?u.jsx("div",{className:"space-y-2 p-4",children:[1,2,3].map(w=>u.jsx("div",{className:"rounded-lg border p-3",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"size-4 animate-pulse rounded bg-muted"}),u.jsx("div",{className:"h-4 w-40 animate-pulse rounded bg-muted"}),u.jsx("div",{className:"ml-auto h-3 w-16 animate-pulse rounded bg-muted"})]})},w))}):u.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[u.jsx("div",{ref:t,children:u.jsx(Ase,{enabled:e})}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsxs(Us,{value:r,onValueChange:w=>s(w),children:[u.jsx(ws,{className:"w-32",children:u.jsx(Hs,{})}),u.jsxs(Cs,{children:[u.jsx(Lt,{value:"all",children:"All sources"}),u.jsx(Lt,{value:"chat",children:"Chat messages"}),u.jsx(Lt,{value:"pulse",children:"Pulse jobs"}),u.jsx(Lt,{value:"system",children:"System"})]})]}),u.jsxs(Us,{value:i,onValueChange:w=>l(w),children:[u.jsx(ws,{className:"w-32",children:u.jsx(Hs,{})}),u.jsxs(Cs,{children:[u.jsx(Lt,{value:"all",children:"All statuses"}),u.jsx(Lt,{value:"delivered",children:"Delivered"}),u.jsx(Lt,{value:"failed",children:"Failed"}),u.jsx(Lt,{value:"pending",children:"Pending"})]})]}),u.jsx(Ss,{className:"h-9 w-44",placeholder:"Filter by agent or message...",value:c,onChange:w=>f(w.target.value),"aria-label":"Search conversations"}),y&&u.jsx(mt,{variant:"ghost",size:"sm",onClick:T,children:"Clear filters"}),u.jsx("div",{className:"ml-auto",children:u.jsx(_se,{})})]}),v.length===0&&!y?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[u.jsx($p,{className:"size-10 text-muted-foreground/50"}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium",children:"No messages yet"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Messages will appear here once your adapters are connected and agents start communicating."})]}),n&&u.jsx(mt,{variant:"outline",size:"sm",onClick:n,children:"Set up an adapter"})]}):v.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[u.jsx($f,{className:"size-10 text-muted-foreground/50"}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium",children:"No messages match your filters"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Try adjusting your filter criteria."})]}),u.jsx(mt,{variant:"ghost",size:"sm",onClick:T,children:"Clear filters"})]}):u.jsx("div",{className:"space-y-2",children:u.jsx(ft,{mode:"popLayout",children:v.map(w=>{const A=x.current!==null&&!x.current.has(w.id)?Ose:Dse;return u.jsx(De.div,{...A,children:u.jsx(bse,{conversation:w})},w.id)})})})]})}function Ise({connectionState:e,className:t}){if(e==="connected")return null;const n=e==="disconnected";return u.jsxs("div",{className:Ee("flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium",n?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-amber-500/10 text-amber-600 dark:text-amber-400",t),children:[n?u.jsx(QG,{className:"size-3.5"}):u.jsx(WG,{className:"size-3.5 animate-pulse"}),u.jsx("span",{children:n?"Connection lost. Check your network.":"Connection lost. Reconnecting..."})]})}function Lse(e){return e==="relay.system.console"?"System Console":e.startsWith("relay.system.pulse.")?"Pulse Scheduler":e.startsWith("relay.human.console.")?"Your Browser Session":e.startsWith("relay.agent.")?`Agent (${e.slice(12).slice(0,7)})`:e}function Pse(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Bse({enabled:e,onSelectEndpoint:t}){const{data:n=[],isLoading:r}=bne(e);return r?u.jsx("div",{className:"space-y-2 p-4",children:[1,2].map(s=>u.jsxs("div",{className:"rounded-lg border p-3",children:[u.jsx("div",{className:"h-4 w-48 animate-pulse rounded bg-muted"}),u.jsx("div",{className:"mt-1.5 h-3 w-32 animate-pulse rounded bg-muted"})]},s))}):n.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[u.jsx($p,{className:"size-10 text-muted-foreground/50"}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium",children:"No endpoints registered"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Endpoints are created automatically when adapters subscribe to message subjects."})]})]}):u.jsx("div",{className:"space-y-2 p-4",children:n.map(s=>{const i=s,l=i.subject,c=i.status??"healthy",f=i.description,d=i.messageCount,p=i.lastActivity;return u.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(l),className:"w-full rounded-lg border p-3 text-left transition-shadow hover:shadow-sm",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:Ee("size-2 shrink-0 rounded-full",FI(c)),"aria-label":`Status: ${c}`}),u.jsx($p,{className:"size-4 shrink-0 text-muted-foreground"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"text-sm font-medium",children:Lse(l)}),u.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:l})]})]}),f!=null&&u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:f}),(d!=null||p!=null)&&u.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[d!=null&&u.jsxs("span",{children:[d," messages"]}),p!=null&&u.jsx("span",{children:Pse(p)})]})]},l)})})}const G3={new:{icon:Uf,className:"text-muted-foreground",label:"New"},cur:{icon:zn,className:"text-muted-foreground",label:"Delivered"},failed:{icon:fc,className:"text-destructive",label:"Failed"},dead_letter:{icon:XY,className:"text-amber-500",label:"Dead Letter"}};function Fse(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}const ep=80;function zse(e){if(!e||typeof e!="object")return"";const t=e,n=t.content??t.text??t.message??t.body;if(typeof n=="string")return n.length>ep?n.slice(0,ep)+"...":n;const r=JSON.stringify(e);return r.length>ep?r.slice(0,ep)+"...":r}function Use({message:e}){const[t,n]=b.useState(!1),[r,s]=b.useState(!1),i=e.status??"new",l=G3[i]??G3.new,c=l.icon,f=e.id,d=ZT(i==="cur"?"delivered":i),p=zse(e.payload);return u.jsxs("div",{className:Ee("w-full rounded-lg border border-l-2 text-left transition-colors hover:bg-muted/50 hover:shadow-sm",d,t&&"bg-muted/30"),children:[u.jsxs("button",{type:"button",onClick:()=>n(!t),className:"w-full p-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(c,{className:Ee("size-4 shrink-0",l.className)}),u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:e.subject}),u.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.from}),u.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.createdAt?Fse(e.createdAt):""}),u.jsx(gn,{variant:"outline",className:"shrink-0 text-xs",children:l.label})]}),p&&!t&&u.jsx("p",{className:"mt-1 truncate text-left text-sm text-muted-foreground",children:p})]}),u.jsx(ft,{initial:!1,children:t&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"overflow-hidden",children:u.jsxs("div",{className:"space-y-2 border-t px-3 pb-3 pt-3",children:[u.jsxs("div",{children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Payload"}),u.jsx("pre",{className:"mt-1 max-h-40 overflow-auto rounded bg-muted p-2 font-mono text-xs",children:String(JSON.stringify(e.payload,null,2))})]}),e.budget!=null&&u.jsxs("div",{children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Budget"}),u.jsx("pre",{className:"mt-1 rounded bg-muted p-2 font-mono text-xs",children:String(JSON.stringify(e.budget,null,2))})]}),f&&u.jsx("div",{className:"border-t pt-2",children:u.jsxs("button",{type:"button",onClick:m=>{m.stopPropagation(),s(!r)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",children:[u.jsx(Gq,{className:"size-3.5"}),r?"Hide trace":"Show trace"]})})]})})}),u.jsx(ft,{initial:!1,children:r&&f&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"overflow-hidden border-t",children:u.jsx(zI,{messageId:f,onClose:()=>s(!1)})})})]})}function Hse({subject:e,onBack:t}){const n=He(),{data:r,isLoading:s}=vt({queryKey:["relay","inbox",e],queryFn:()=>n.readRelayInbox(e)}),i=(r==null?void 0:r.messages)??[];return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2 border-b p-3",children:[u.jsx("button",{type:"button",onClick:t,className:"rounded p-1 hover:bg-muted",children:u.jsx(Xq,{className:"size-4"})}),u.jsx("span",{className:"font-mono text-sm",children:e})]}),s?u.jsx("div",{className:"space-y-2 p-4",children:[1,2].map(l=>u.jsx("div",{className:"rounded-lg border p-3",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"size-4 animate-pulse rounded bg-muted"}),u.jsx("div",{className:"h-4 w-40 animate-pulse rounded bg-muted"})]})},l))}):i.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[u.jsx($p,{className:"size-8 text-muted-foreground/30"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No messages in this inbox."})]}):u.jsx("div",{className:"space-y-2 p-4",children:i.map((l,c)=>u.jsx(Use,{message:l},l.id??c))})]})}const $se={messaging:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",automation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",internal:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",custom:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"};function Vse({instance:e,manifest:t,onToggle:n,onConfigure:r,onRemove:s}){const[i,l]=b.useState(!1),c=ZT(e.status.state),f=t.type==="claude-code"&&t.builtin,d=e.status.displayName||e.id;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:Ee("flex items-center justify-between rounded-lg border border-l-2 p-3","hover:shadow-sm transition-shadow",c),children:[u.jsx("div",{className:"flex items-center gap-3",children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[t.iconEmoji&&u.jsx("span",{className:"text-sm",role:"img","aria-hidden":!0,children:t.iconEmoji}),u.jsx("span",{className:"text-sm font-medium",children:d}),u.jsx(gn,{variant:"secondary",className:$se[t.category]??"",children:t.category}),f&&u.jsx(gn,{variant:"outline",className:"text-xs",children:"System"})]}),f&&u.jsx("p",{className:"text-xs text-muted-foreground",children:"Handles: Chat messages, Pulse jobs"}),u.jsxs("div",{className:"text-xs text-muted-foreground/70",children:["In: ",e.status.messageCount.inbound," | Out: ",e.status.messageCount.outbound,e.status.errorCount>0&&` | Errors: ${e.status.errorCount}`]}),e.status.lastError&&u.jsx("div",{className:"mt-1 max-w-[200px] truncate text-xs text-red-500",children:e.status.lastError})]})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(xn,{checked:e.enabled,onCheckedChange:n}),u.jsxs(FT,{children:[u.jsx(zT,{asChild:!0,children:u.jsx(mt,{variant:"ghost",size:"sm",className:"size-7 p-0","aria-label":"Adapter actions",children:u.jsx(SY,{className:"size-4"})})}),u.jsxs(J0,{align:"end",children:[u.jsxs(Lu,{onClick:r,children:[u.jsx(g0,{className:"mr-2 size-3.5"}),"Configure"]}),u.jsxs(Lu,{onClick:()=>l(!0),disabled:f,className:"text-red-600 focus:text-red-600",children:[u.jsx(tT,{className:"mr-2 size-3.5"}),"Remove"]})]})]})]})]}),u.jsx(RT,{open:i,onOpenChange:l,children:u.jsxs(Y0,{children:[u.jsxs(OT,{children:[u.jsx(G0,{children:"Remove adapter"}),u.jsxs(K0,{children:['Are you sure you want to remove "',d,'"? This will stop the adapter and remove its configuration. Messages to its subjects will no longer be delivered.']})]}),u.jsxs(DT,{children:[u.jsx(X0,{children:"Cancel"}),u.jsx(Q0,{onClick:s,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:"Remove"})]})]})})]})}const qse={messaging:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",automation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",internal:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",custom:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"};function Yse({manifest:e,onAdd:t}){return u.jsxs("div",{className:"flex flex-col justify-between rounded-lg border p-4 transition-colors hover:bg-muted/50",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[e.iconEmoji&&u.jsx("span",{className:"text-lg",role:"img","aria-hidden":!0,children:e.iconEmoji}),u.jsx("span",{className:"text-sm font-medium",children:e.displayName}),u.jsx(gn,{variant:"secondary",className:qse[e.category]??"",children:e.category})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:e.description})]}),u.jsx("div",{className:"mt-3",children:u.jsxs(mt,{variant:"outline",size:"sm",className:"w-full",onClick:t,children:[u.jsx(eT,{className:"mr-1 size-3"}),"Add"]})})]})}function Gse({field:e,value:t,onChange:n,error:r,allValues:s}){const[i,l]=b.useState(!1);if(e.showWhen&&s[e.showWhen.field]!==e.showWhen.equals)return null;const c=`config-field-${e.key}`,f=t!=null?String(t):"",d=()=>{var p;switch(e.type){case"text":case"url":return u.jsx(Ss,{id:c,type:e.type==="url"?"url":"text",value:f,onChange:m=>n(e.key,m.target.value),placeholder:e.placeholder});case"password":return u.jsxs("div",{className:"relative",children:[u.jsx(Ss,{id:c,type:i?"text":"password",value:f,onChange:m=>n(e.key,m.target.value),placeholder:e.placeholder}),u.jsx(mt,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>l(!i),"aria-label":i?"Hide password":"Show password",children:i?u.jsx(YO,{className:"size-4"}):u.jsx(GO,{className:"size-4"})})]});case"number":return u.jsx(Ss,{id:c,type:"number",value:f,onChange:m=>n(e.key,m.target.value?Number(m.target.value):void 0),placeholder:e.placeholder});case"boolean":return u.jsx(xn,{id:c,checked:!!t,onCheckedChange:m=>n(e.key,m)});case"select":return u.jsxs(Us,{value:f,onValueChange:m=>n(e.key,m),children:[u.jsx(ws,{id:c,children:u.jsx(Hs,{placeholder:e.placeholder??"Select..."})}),u.jsx(Cs,{children:(p=e.options)==null?void 0:p.map(m=>u.jsx(Lt,{value:m.value,children:m.label},m.value))})]});case"textarea":return u.jsx($T,{id:c,value:f,onChange:m=>n(e.key,m.target.value),placeholder:e.placeholder,rows:3});default:return null}};return u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:c,className:Ee(e.required&&'after:ml-0.5 after:text-red-500 after:content-["*"]'),children:e.label}),d(),e.description&&u.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}),r&&u.jsx("p",{className:"text-xs text-red-500",children:r})]})}function Kse({fields:e,values:t,onChange:n,errors:r}){const s=new Map;for(const i of e){const l=i.section;s.has(l)||s.set(l,[]),s.get(l).push(i)}return u.jsx("div",{className:"space-y-6",children:Array.from(s.entries()).map(([i,l])=>u.jsxs("div",{className:"space-y-4",children:[i&&u.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:i}),l.map(c=>u.jsx(Gse,{field:c,value:t[c.key],onChange:n,error:r[c.key],allValues:t},c.key))]},i??"__default"))})}function qy(e){const t={};for(const[n,r]of Object.entries(e)){const s=n.split(".");let i=t;for(let l=0;l<s.length-1;l++){const c=s[l];(!(c in i)||typeof i[c]!="object"||i[c]===null)&&(i[c]={}),i=i[c]}i[s[s.length-1]]=r}return t}function Qse(e,t){const n=t.split(".");let r=e;for(const s of n){if(r==null||typeof r!="object")return;r=r[s]}return r}function Xse(e,t){const n={};for(const r of e.configFields){const s=t?Qse(t,r.key):void 0;s!==void 0&&r.type!=="password"?n[r.key]=s:r.default!==void 0?n[r.key]=r.default:n[r.key]=r.type==="boolean"?!1:""}return n}function Wse(e){return e.type}function Zse({open:e,onOpenChange:t,manifest:n,existingInstance:r}){var te;const s=!!r,[i,l]=b.useState("configure"),[c,f]=b.useState(()=>(r==null?void 0:r.id)??Wse(n)),[d,p]=b.useState(()=>Xse(n,r==null?void 0:r.config)),[m,x]=b.useState({}),[y,v]=b.useState(0),[T,w]=b.useState(""),N=Sne(),A=Cne(),k=Nne(),R=n.setupSteps&&n.setupSteps.length>0,D=b.useMemo(()=>{if(!R||!n.setupSteps)return n.configFields;const J=n.setupSteps[y];return J?n.configFields.filter(L=>J.fields.includes(L.key)):n.configFields},[n.configFields,n.setupSteps,R,y]),O=b.useCallback((J,L)=>{p(B=>({...B,[J]:L})),x(B=>{const U={...B};return delete U[J],U})},[]),M=b.useCallback(J=>{const L={};for(const B of J)if(!(B.showWhen&&d[B.showWhen.field]!==B.showWhen.equals)&&B.required){const U=d[B.key];(U==null||U==="")&&(L[B.key]=`${B.label} is required`)}return!s&&i==="configure"&&!c.trim()?(w("Adapter ID is required"),x(L),Object.keys(L).length===0&&!1):(w(""),x(L),Object.keys(L).length===0)},[d,s,c,i]),I=b.useCallback(()=>{if(i==="configure"){if(R&&n.setupSteps){if(!M(D))return;if(y<n.setupSteps.length-1){v(J=>J+1);return}}else if(!M(n.configFields))return;l("test"),k.mutate({type:n.type,config:qy(d)})}else i==="test"&&l("confirm")},[i,R,n,D,y,M,d,k]),H=b.useCallback(()=>{i==="test"?(l("configure"),k.reset()):i==="confirm"?l("test"):i==="configure"&&R&&y>0&&v(J=>J-1)},[i,R,y,k]),P=b.useCallback(()=>{const J=qy(d);s&&r?A.mutate({id:r.id,config:J},{onSuccess:()=>t(!1)}):N.mutate({type:n.type,id:c,config:J},{onSuccess:()=>t(!1),onError:L=>{var B,U;((B=L.message)!=null&&B.includes("duplicate")||(U=L.message)!=null&&U.includes("exists"))&&(w("An adapter with this ID already exists"),l("configure"),v(0))}})},[d,s,r,A,N,n.type,c,t]),K=b.useCallback(J=>{J||(l("configure"),v(0),x({}),w(""),k.reset()),t(J)},[t,k]),Y=N.isPending||A.isPending,W=R&&n.setupSteps?n.setupSteps[y]:void 0;return u.jsx(sh,{open:e,onOpenChange:K,children:u.jsxs(yc,{className:"max-w-lg",children:[u.jsxs(bc,{children:[u.jsx(vc,{children:s?`Edit ${n.displayName}`:`Add ${n.displayName}`}),u.jsxs(ah,{children:[i==="configure"&&((W==null?void 0:W.description)??"Configure the adapter settings."),i==="test"&&"Testing connection to the adapter.",i==="confirm"&&"Review your configuration before saving."]})]}),u.jsxs("div",{className:"space-y-4 py-2",children:[u.jsx(eae,{current:i}),u.jsx(ft,{mode:"wait",children:u.jsxs(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[i==="configure"&&u.jsx(tae,{manifest:n,isEditMode:s,adapterId:c,onAdapterIdChange:f,idError:T,fields:D,values:d,errors:m,onChange:O,currentSetupStep:W}),i==="test"&&u.jsx(nae,{isPending:k.isPending,isSuccess:k.isSuccess,isError:k.isError,errorMessage:(te=k.error)==null?void 0:te.message,onRetry:()=>k.mutate({type:n.type,config:qy(d)})}),i==="confirm"&&u.jsx(rae,{manifest:n,adapterId:c,isEditMode:s,values:d})]},i)})]}),u.jsxs(Z0,{children:[i!=="configure"&&u.jsx(mt,{variant:"outline",onClick:H,disabled:Y,children:"Back"}),i==="configure"&&R&&y>0&&u.jsx(mt,{variant:"outline",onClick:H,children:"Back"}),i==="test"&&u.jsx(mt,{variant:"ghost",onClick:()=>l("confirm"),children:"Skip"}),i==="configure"&&u.jsx(mt,{onClick:I,children:"Continue"}),i==="test"&&!k.isPending&&u.jsx(mt,{onClick:I,children:"Continue"}),i==="confirm"&&u.jsxs(mt,{onClick:P,disabled:Y,children:[Y&&u.jsx(Qn,{className:"mr-2 size-4 animate-spin"}),s?"Save Changes":"Add Adapter"]})]})]})})}const K3=["configure","test","confirm"],Jse={configure:"Configure",test:"Test",confirm:"Confirm"};function eae({current:e}){const t=K3.indexOf(e);return u.jsx("div",{className:"flex items-center gap-2",role:"navigation","aria-label":"Wizard steps",children:K3.map((n,r)=>u.jsxs("div",{className:"flex items-center gap-2",children:[r>0&&u.jsx("div",{className:"h-px w-4 bg-border"}),u.jsx("span",{className:`text-xs font-medium ${r<=t?"text-foreground":"text-muted-foreground"}`,"aria-current":n===e?"step":void 0,children:Jse[n]})]},n))})}function tae({manifest:e,isEditMode:t,adapterId:n,onAdapterIdChange:r,idError:s,fields:i,values:l,errors:c,onChange:f,currentSetupStep:d}){return u.jsxs("div",{className:"space-y-4",children:[e.setupInstructions&&u.jsxs("div",{className:"flex gap-2 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200",children:[u.jsx(KO,{className:"mt-0.5 size-4 shrink-0"}),u.jsx("p",{children:e.setupInstructions})]}),d&&u.jsx("h4",{className:"text-sm font-medium",children:d.title}),!t&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"adapter-id",className:"after:ml-0.5 after:text-red-500 after:content-['*']",children:"Adapter ID"}),u.jsx(Ss,{id:"adapter-id",value:n,onChange:p=>r(p.target.value),placeholder:e.type}),s&&u.jsx("p",{className:"text-xs text-red-500",children:s})]}),u.jsx(Kse,{fields:i,values:l,onChange:f,errors:c})]})}function nae({isPending:e,isSuccess:t,isError:n,errorMessage:r,onRetry:s}){return u.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e&&u.jsxs(u.Fragment,{children:[u.jsx(Qn,{className:"size-8 animate-spin text-muted-foreground"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Testing connection..."})]}),t&&u.jsxs(u.Fragment,{children:[u.jsx(zf,{className:"size-8 text-green-500"}),u.jsx("p",{className:"text-sm text-green-700 dark:text-green-400",children:"Connection successful"})]}),n&&u.jsxs(u.Fragment,{children:[u.jsx(VO,{className:"size-8 text-red-500"}),u.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:"Connection failed"}),r&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-xs text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:[u.jsx(fc,{className:"mt-0.5 size-3 shrink-0"}),u.jsx("span",{children:r})]}),u.jsx(mt,{variant:"outline",size:"sm",onClick:s,children:"Retry"})]})]})}function rae({manifest:e,adapterId:t,isEditMode:n,values:r}){return u.jsxs("div",{className:"space-y-3",children:[!n&&u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:"Adapter ID"}),u.jsx("span",{className:"font-mono",children:t})]}),e.configFields.map(s=>{if(s.showWhen&&r[s.showWhen.field]!==s.showWhen.equals)return null;const i=s.type==="password"?"***":String(r[s.key]??"");return u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:s.label}),u.jsx("span",{className:"max-w-[200px] truncate font-mono",children:i})]},s.key)})]})}function Q3(e,t=""){return e==null?"—":e%1===0?`${e}${t}`:`${e.toFixed(1)}${t}`}function sae(){const{data:e,isLoading:t,error:n}=kI();if(t)return u.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading metrics..."});if(n||!e)return u.jsx("div",{className:"p-4 text-sm text-destructive",children:"Failed to load metrics."});const r=e.deadLetteredCount,s=e.budgetRejections&&Object.values(e.budgetRejections).some(i=>i>0);return u.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[u.jsx("h3",{className:"text-sm font-medium",children:"Delivery Metrics"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[u.jsx(xu,{label:"Total",value:e.totalMessages}),u.jsx(xu,{label:"Delivered",value:e.deliveredCount,variant:"success"}),u.jsx(xu,{label:"Failed",value:e.failedCount,variant:e.failedCount>0?"danger":"default"}),u.jsx(xu,{label:"Dead Letter",value:r,variant:r>0?"warning":"default"})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsx(xu,{label:"Avg Latency",value:Q3(e.avgDeliveryLatencyMs,"ms")}),u.jsx(xu,{label:"P95 Latency",value:Q3(e.p95DeliveryLatencyMs,"ms")})]}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:["Active endpoints: ",e.activeEndpoints]}),s&&u.jsxs("div",{className:"rounded border border-border p-2",children:[u.jsx("div",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Budget Rejections"}),u.jsxs("div",{className:"grid grid-cols-2 gap-1 text-xs",children:[e.budgetRejections.hopLimit>0&&u.jsxs("span",{children:["Hop limit: ",e.budgetRejections.hopLimit]}),e.budgetRejections.ttlExpired>0&&u.jsxs("span",{children:["TTL expired: ",e.budgetRejections.ttlExpired]}),e.budgetRejections.cycleDetected>0&&u.jsxs("span",{children:["Cycle: ",e.budgetRejections.cycleDetected]}),e.budgetRejections.budgetExhausted>0&&u.jsxs("span",{children:["Exhausted: ",e.budgetRejections.budgetExhausted]})]})]})]})}const aae={default:"text-foreground",success:"text-green-600 dark:text-green-400",danger:"text-red-600 dark:text-red-400",warning:"text-yellow-600 dark:text-yellow-400"};function xu({label:e,value:t,variant:n="default"}){return u.jsxs("div",{className:"rounded border border-border p-2",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:e}),u.jsx("div",{className:`text-lg font-semibold ${aae[n]}`,children:t})]})}function iae(e){return e==null?"—":e<1?"<1ms":`${Math.round(e)}ms`}function oae(e){const{data:t=[],isLoading:n}=AI(e),r=t.flatMap(l=>l.instances),s=r.length,i=r.filter(l=>l.status.state==="connected").length;return{total:s,connected:i,isLoading:n}}function lae({enabled:e=!0,onFailedClick:t}){const n=lh(),[r,s]=b.useState(!1),{data:i,isLoading:l}=kI(),{total:c,connected:f,isLoading:d}=oae(e&&n);if(!n||!e||l||d||!i)return null;const p=i.failedCount>0,x=c>0&&f===c?"bg-green-500":"bg-amber-500";return u.jsxs("div",{className:"flex items-center gap-3 border-b px-3 py-1.5 text-xs text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:`h-2 w-2 rounded-full ${x}`,"aria-hidden":"true"}),f,"/",c," connected"]}),u.jsxs("span",{children:[i.totalMessages," today"]}),p?u.jsxs("button",{type:"button",onClick:t,className:"text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300","aria-label":`${i.failedCount} failed messages — click to view`,children:[i.failedCount," failed"]}):u.jsxs("span",{children:[i.failedCount," failed"]}),u.jsxs("span",{children:[iae(i.avgDeliveryLatencyMs)," avg"]}),u.jsxs(sh,{open:r,onOpenChange:s,children:[u.jsx(q6,{asChild:!0,children:u.jsx(mt,{variant:"ghost",size:"sm",className:"ml-auto size-6 p-0","aria-label":"Open delivery metrics",children:u.jsx(tY,{className:"size-3.5"})})}),u.jsxs(yc,{className:"max-w-lg",children:[u.jsx(bc,{children:u.jsx(vc,{children:"Delivery Metrics"})}),u.jsx(sae,{})]})]})]})}function uae({enabled:e}){const{data:t=[],isLoading:n}=AI(e),{mutate:r}=Tne(),{mutate:s}=wne(),[i,l]=b.useState({open:!1}),c=Qt();if(n)return u.jsxs("div",{className:"space-y-6 p-4",children:[u.jsxs("div",{className:"space-y-3",children:[u.jsx(Bs,{className:"h-4 w-32"}),u.jsx("div",{className:"space-y-2",children:[1,2].map(v=>u.jsx(Bs,{className:"h-16 w-full rounded-lg"},v))})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsx(Bs,{className:"h-4 w-32"}),u.jsx("div",{className:"grid grid-cols-2 gap-3",children:[1,2].map(v=>u.jsxs("div",{className:"rounded-lg border p-4",children:[u.jsx(Bs,{className:"mb-2 h-5 w-24"}),u.jsx(Bs,{className:"h-4 w-full"}),u.jsx(Bs,{className:"mt-3 h-8 w-full"})]},v))})]})]});const f=t.flatMap(v=>v.instances.map(T=>({instance:T,manifest:v.manifest}))),d=t.filter(v=>v.instances.length===0||v.manifest.multiInstance),p=v=>{l({open:!0,manifest:v})},m=(v,T)=>{l({open:!0,manifest:v,instanceId:T})},x=i.instanceId?t.flatMap(v=>v.instances).find(v=>v.id===i.instanceId):void 0,y=()=>{c.invalidateQueries({queryKey:["relay","adapters","catalog"]})};return u.jsxs("div",{className:"space-y-6 p-4",children:[u.jsxs("section",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Configured Adapters"}),u.jsx(mt,{variant:"ghost",size:"sm",onClick:y,className:"size-7 p-0","aria-label":"Refresh adapter catalog",children:u.jsx(SG,{className:"size-3.5"})})]}),f.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No adapters configured yet."}):u.jsx("div",{className:"space-y-2",children:f.map(({instance:v,manifest:T})=>u.jsx(Vse,{instance:v,manifest:T,onToggle:w=>r({id:v.id,enabled:w}),onConfigure:()=>m(T,v.id),onRemove:()=>s(v.id)},v.id))})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Available Adapters"}),d.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"All available adapter types are configured."}):u.jsx("div",{className:"grid grid-cols-2 gap-2",children:d.map(v=>u.jsx(Yse,{manifest:v.manifest,onAdd:()=>p(v.manifest)},v.manifest.type))})]}),i.manifest&&u.jsx(Zse,{open:i.open,onOpenChange:v=>{v||l({open:!1})},manifest:i.manifest,existingInstance:x})]})}function cae(){const e=lh(),[t,n]=b.useState(null),[r,s]=b.useState("activity"),i=b.useRef(null),{connectionState:l}=Ene(e),c=()=>{s("activity"),setTimeout(()=>{var f;(f=i.current)==null||f.scrollIntoView({behavior:"smooth",block:"start"})},0)};return e?u.jsxs(oh,{value:r,onValueChange:s,className:"flex h-full flex-col",children:[u.jsx(lae,{enabled:e,onFailedClick:c}),u.jsx(Ise,{connectionState:l,className:"mx-4 mt-2"}),u.jsxs(Tc,{className:"mx-4 mt-3 shrink-0",children:[u.jsx(Gn,{value:"activity",children:"Activity"}),u.jsx(Gn,{value:"endpoints",children:"Endpoints"}),u.jsx(Gn,{value:"adapters",children:"Adapters"})]}),u.jsx(ft,{mode:"wait",children:u.jsxs(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"min-h-0 flex-1 overflow-y-auto",children:[u.jsx(Kn,{value:"activity",className:"h-full",children:u.jsx(Mse,{enabled:e,deadLetterRef:i,onSwitchToAdapters:()=>s("adapters")})}),u.jsx(Kn,{value:"endpoints",className:"h-full",children:t?u.jsx(Hse,{subject:t,onBack:()=>n(null)}):u.jsx(Bse,{enabled:e,onSelectEndpoint:n})}),u.jsx(Kn,{value:"adapters",className:"h-full",children:u.jsx(uae,{enabled:e})})]},r)})]}):u.jsx(VT,{icon:CG,name:"Relay",description:"Relay provides inter-agent messaging. Start DorkOS with relay enabled.",command:"DORKOS_RELAY_ENABLED=true dorkos"})}const dae=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#6366f1","#a855f7","#ec4899","#78716c"],X3=500;function fae({agent:e,projectPath:t,onUpdate:n}){const[r,s]=b.useState(e.name),i=b.useRef(null);b.useEffect(()=>{s(e.name)},[e.name]);const l=b.useCallback(y=>{s(y),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{y.trim()&&n({name:y.trim()})},X3)},[n]),c=b.useCallback(()=>{i.current&&clearTimeout(i.current);const y=r.trim();y&&y!==e.name&&n({name:y})},[r,e.name,n]),[f,d]=b.useState(e.description),p=b.useRef(null);b.useEffect(()=>{d(e.description)},[e.description]);const m=b.useCallback(y=>{d(y),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{n({description:y})},X3)},[n]),x=b.useCallback(()=>{p.current&&clearTimeout(p.current),f!==e.description&&n({description:f})},[f,e.description,n]);return b.useEffect(()=>()=>{i.current&&clearTimeout(i.current),p.current&&clearTimeout(p.current)},[]),u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"agent-name",className:"text-sm font-medium",children:"Name"}),u.jsx("input",{id:"agent-name",type:"text",value:r,onChange:y=>l(y.target.value),onBlur:c,className:"border-border bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",placeholder:"Agent name"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"agent-description",className:"text-sm font-medium",children:"Description"}),u.jsx("textarea",{id:"agent-description",value:f,onChange:y=>m(y.target.value),onBlur:x,rows:3,className:"border-border bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring w-full resize-none rounded-md border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",placeholder:"What does this agent do?"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Gt,{className:"text-sm font-medium",children:"Color"}),e.color&&u.jsx("button",{onClick:()=>n({color:void 0}),className:"text-muted-foreground hover:text-foreground text-xs transition-colors duration-150",children:"Reset"})]}),u.jsx("div",{className:"flex flex-wrap gap-2",children:dae.map(y=>u.jsx("button",{onClick:()=>n({color:y}),className:Ee("size-7 rounded-full transition-all duration-150",e.color===y?"ring-foreground ring-2 ring-offset-2":"hover:scale-110"),style:{backgroundColor:y},"aria-label":`Select color ${y}`},y))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Gt,{className:"text-sm font-medium",children:"Icon"}),e.icon&&u.jsx("button",{onClick:()=>n({icon:void 0}),className:"text-muted-foreground hover:text-foreground text-xs transition-colors duration-150",children:"Reset"})]}),u.jsx("div",{className:"flex flex-wrap gap-1",children:Ub.map(y=>u.jsx("button",{onClick:()=>n({icon:y}),className:Ee("flex size-8 items-center justify-center rounded-md text-base transition-all duration-150",e.icon===y?"bg-accent ring-foreground ring-1":"hover:bg-accent/50"),"aria-label":`Select icon ${y}`,children:y},y))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{className:"text-sm font-medium",children:"Runtime"}),u.jsxs(Us,{value:e.runtime,onValueChange:y=>n({runtime:y}),children:[u.jsx(ws,{className:"w-48",children:u.jsx(Hs,{})}),u.jsxs(Cs,{children:[u.jsx(Lt,{value:"claude-code",children:"Claude Code"}),u.jsx(Lt,{value:"cursor",children:"Cursor"}),u.jsx(Lt,{value:"codex",children:"Codex"}),u.jsx(Lt,{value:"other",children:"Other"})]})]})]})]})}const hae=500,W3=4e3;function mae({agent:e,onUpdate:t}){const n=e,r=n.personaEnabled!==!1,[s,i]=b.useState(n.persona??""),l=b.useRef(null);b.useEffect(()=>{i(n.persona??"")},[n.persona]),b.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const c=b.useCallback(m=>{t({personaEnabled:m})},[t]),f=b.useCallback(m=>{i(m),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{t({persona:m})},hae)},[t]),d=b.useCallback(()=>{l.current&&clearTimeout(l.current),s!==(n.persona??"")&&t({persona:s})},[s,n.persona,t]),p=b.useMemo(()=>{let x=`<agent_identity>
|
|
594
|
-
${[`Name: ${e.name}`,`ID: ${e.id}`,e.description&&`Description: ${e.description}`,e.capabilities.length>0&&`Capabilities: ${e.capabilities.join(", ")}`].filter(Boolean).join(`
|
|
595
|
-
`)}
|
|
596
|
-
</agent_identity>`;return r&&s.trim()&&(x+=`
|
|
597
|
-
|
|
598
|
-
<agent_persona>
|
|
599
|
-
${s}
|
|
600
|
-
</agent_persona>`),x},[e.name,e.id,e.description,e.capabilities,r,s]);return u.jsxs("div",{className:"space-y-6",children:[u.jsx("p",{className:"text-muted-foreground text-sm",children:"This text is appended to Claude Code's system prompt for every session in this directory. Use it to define the agent's expertise, constraints, and personality."}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Gt,{htmlFor:"persona-toggle",className:"text-sm font-medium",children:"Inject persona into sessions"}),u.jsx(xn,{id:"persona-toggle",checked:r,onCheckedChange:c})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{id:"persona-text",value:s,onChange:m=>f(m.target.value),onBlur:d,rows:8,maxLength:W3,disabled:!r,className:"border-border bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring w-full resize-none rounded-md border px-3 py-2 font-mono text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",placeholder:"You are backend-bot, an expert in REST API design..."}),u.jsxs("p",{className:"text-muted-foreground text-right text-xs",children:[s.length," / ",W3.toLocaleString()]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{className:"text-sm font-medium",children:"Preview (injected into system prompt)"}),u.jsx("pre",{className:"bg-muted max-h-48 overflow-auto rounded-md p-3",children:u.jsx("code",{className:"text-xs",children:p})})]})]})}const tp="border-border bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2";function pae({agent:e,onUpdate:t}){var c,f,d;const[n,r]=b.useState(""),s=b.useCallback(p=>{const m=p.trim();!m||e.capabilities.includes(m)||(t({capabilities:[...e.capabilities,m]}),r(""))},[e.capabilities,t]),i=b.useCallback(p=>{t({capabilities:e.capabilities.filter(m=>m!==p)})},[e.capabilities,t]),l=b.useCallback(p=>{(p.key==="Enter"||p.key===",")&&(p.preventDefault(),s(n))},[n,s]);return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"cap-input",className:"text-sm font-medium",children:"Capabilities"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.capabilities.map(p=>u.jsxs(gn,{variant:"secondary",className:"gap-1 pr-1",children:[p,u.jsx("button",{onClick:()=>i(p),className:"hover:bg-muted rounded-sm p-0.5 transition-colors duration-150","aria-label":`Remove ${p}`,children:u.jsx(ba,{className:"size-3"})})]},p))}),u.jsx("input",{id:"cap-input",type:"text",value:n,onChange:p=>r(p.target.value),onKeyDown:l,className:tp,placeholder:"Add capability and press Enter"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{htmlFor:"agent-namespace",className:"text-sm font-medium",children:"Namespace"}),u.jsx("input",{id:"agent-namespace",type:"text",value:e.namespace??"",onChange:p=>t({namespace:p.target.value||void 0}),className:tp,placeholder:"Optional grouping namespace"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{className:"text-sm font-medium",children:"Response Mode"}),u.jsxs(Us,{value:((c=e.behavior)==null?void 0:c.responseMode)??"always",onValueChange:p=>t({behavior:{...e.behavior,responseMode:p}}),children:[u.jsx(ws,{className:"w-full",children:u.jsx(Hs,{})}),u.jsxs(Cs,{children:[u.jsx(Lt,{value:"always",children:"Always respond"}),u.jsx(Lt,{value:"direct-only",children:"Direct messages only"}),u.jsx(Lt,{value:"mention-only",children:"Mentions only"}),u.jsx(Lt,{value:"silent",children:"Silent"})]})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Gt,{className:"text-sm font-medium",children:"Budget"}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{htmlFor:"max-hops",className:"text-muted-foreground text-xs",children:"Max Hops / Message"}),u.jsx("input",{id:"max-hops",type:"number",min:1,value:((f=e.budget)==null?void 0:f.maxHopsPerMessage)??5,onChange:p=>t({budget:{...e.budget,maxHopsPerMessage:parseInt(p.target.value)||5}}),className:tp})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{htmlFor:"max-calls",className:"text-muted-foreground text-xs",children:"Max Calls / Hour"}),u.jsx("input",{id:"max-calls",type:"number",min:1,value:((d=e.budget)==null?void 0:d.maxCallsPerHour)??100,onChange:p=>t({budget:{...e.budget,maxCallsPerHour:parseInt(p.target.value)||100}}),className:tp})]})]})]})]})}function gae({agent:e}){const t=qT(),n=lh(),r=rg(),{data:s}=RI(r?e.id:null);return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("section",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h3",{className:"text-sm font-medium",children:"Pulse Schedules"}),u.jsx(gn,{variant:t?"default":"secondary",className:"text-xs",children:t?"Enabled":"Disabled"})]}),u.jsx("p",{className:"text-muted-foreground text-sm",children:t?"Configure automated schedules for this agent in the Pulse panel.":"Enable Pulse to schedule automated agent runs."})]}),u.jsxs("section",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h3",{className:"text-sm font-medium",children:"Relay Endpoints"}),u.jsx(gn,{variant:n?"default":"secondary",className:"text-xs",children:n?"Enabled":"Disabled"})]}),u.jsx("p",{className:"text-muted-foreground text-sm",children:n?"Manage messaging endpoints for this agent in the Relay panel.":"Enable Relay for inter-agent messaging."})]}),u.jsxs("section",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h3",{className:"text-sm font-medium",children:"Mesh Health"}),u.jsx(gn,{variant:r?"default":"secondary",className:"text-xs",children:r?"Enabled":"Disabled"})]}),r&&s?u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground text-sm",children:"Status:"}),u.jsx(gn,{variant:s.status==="active"?"default":"secondary",className:"text-xs",children:s.status}),s.lastSeenAt&&u.jsxs("span",{className:"text-muted-foreground text-xs",children:["Last seen ",new Date(s.lastSeenAt).toLocaleString()]})]}):u.jsx("p",{className:"text-muted-foreground text-sm",children:r?"Loading health information...":"Enable Mesh for agent discovery and registry."})]})]})}function UI({projectPath:e,open:t,onOpenChange:n}){const[r,s]=b.useState("identity"),{data:i}=bE(e),l=Qz(),c=b.useCallback(f=>{l.mutate({path:e,updates:f})},[e,l]);return i?u.jsx(ua,{open:t,onOpenChange:n,children:u.jsxs(ca,{"data-testid":"agent-dialog",className:"max-h-[85vh] max-w-lg gap-0 p-0",children:[u.jsx(UT,{}),u.jsxs(da,{className:"space-y-0 border-b px-4 py-3",children:[u.jsx(fa,{className:"text-sm font-medium",children:i.name}),u.jsx(ha,{className:"text-muted-foreground text-xs",children:"Agent configuration"})]}),u.jsxs(oh,{value:r,onValueChange:s,className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs(Tc,{className:"mx-4 mt-3 grid w-full grid-cols-4",style:{width:"calc(100% - 2rem)"},children:[u.jsx(Gn,{value:"identity",children:"Identity"}),u.jsx(Gn,{value:"persona",children:"Persona"}),u.jsx(Gn,{value:"capabilities",children:"Capabilities"}),u.jsx(Gn,{value:"connections",children:"Connections"})]}),u.jsxs("div",{className:"min-h-[280px] flex-1 overflow-y-auto p-4",children:[u.jsx(Kn,{value:"identity",className:"mt-0",children:u.jsx(fae,{agent:i,projectPath:e,onUpdate:c})}),u.jsx(Kn,{value:"persona",className:"mt-0",children:u.jsx(mae,{agent:i,onUpdate:c})}),u.jsx(Kn,{value:"capabilities",className:"mt-0",children:u.jsx(pae,{agent:i,onUpdate:c})}),u.jsx(Kn,{value:"connections",className:"mt-0",children:u.jsx(gae,{agent:i})})]})]})]})}):u.jsx(ua,{open:t,onOpenChange:n,children:u.jsxs(ca,{className:"max-h-[85vh] max-w-lg gap-0 p-0",children:[u.jsxs(da,{className:"space-y-0 border-b px-4 py-3",children:[u.jsx(fa,{className:"text-sm font-medium",children:"Agent"}),u.jsx(ha,{className:"sr-only",children:"Agent configuration"})]}),u.jsx("div",{className:"flex h-32 items-center justify-center",children:u.jsx("p",{className:"text-muted-foreground text-sm",children:"No agent registered"})})]})})}R5(e=>({open:!1,projectPath:null,openDialog:t=>e({open:!0,projectPath:t}),closeDialog:()=>e({open:!1,projectPath:null})}));const Z3=["config"],xae=["discovery","pulse","adapters"];function uh(){const e=He(),t=Qt(),{data:n,isLoading:r}=vt({queryKey:[...Z3],queryFn:()=>e.getConfig(),staleTime:300*1e3}),s={completedSteps:[],skippedSteps:[],startedAt:null,dismissedAt:null},i=n!=null&&n.onboarding?{completedSteps:n.onboarding.completedSteps,skippedSteps:n.onboarding.skippedSteps,startedAt:n.onboarding.startedAt,dismissedAt:n.onboarding.dismissedAt}:s,l=xae.every(v=>i.completedSteps.includes(v)),c=i.dismissedAt!==null,f=!r&&!l&&!c,d=Nn({mutationFn:v=>e.updateConfig({onboarding:v}),onSuccess:()=>{t.invalidateQueries({queryKey:[...Z3]})},onError:()=>{Cn.error("Failed to save onboarding progress")}});function p(v){i.completedSteps.includes(v)||d.mutate({completedSteps:[...i.completedSteps,v]})}function m(v){i.skippedSteps.includes(v)||d.mutate({skippedSteps:[...i.skippedSteps,v]})}function x(){return d.mutateAsync({dismissedAt:new Date().toISOString()})}function y(){i.startedAt||d.mutate({startedAt:new Date().toISOString()})}return{state:i,isOnboardingComplete:l,isOnboardingDismissed:c,shouldShowOnboarding:f,completeStep:p,skipStep:m,dismiss:x,startOnboarding:y}}function HI(){const[e,t]=b.useState([]),[n,r]=b.useState(!1),[s,i]=b.useState(null),[l,c]=b.useState(null),f=b.useRef(null),d=b.useCallback(m=>{var y;(y=f.current)==null||y.abort();const x=new AbortController;f.current=x,t([]),i(null),c(null),r(!0),(async()=>{try{const v=await fetch("/api/discovery/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m??{}),signal:x.signal});if(!v.ok){const A=await v.json().catch(()=>({error:v.statusText}));throw new Error(A.error??`HTTP ${v.status}`)}const T=v.body.getReader(),w=new TextDecoder;let N="";for(;;){const{done:A,value:k}=await T.read();if(A)break;N+=w.decode(k,{stream:!0});const R=N.split(`
|
|
601
|
-
`);N=R.pop()||"";let D="";for(const O of R)if(O.startsWith("event: "))D=O.slice(7).trim();else if(O.startsWith("data: ")&&D){const M=JSON.parse(O.slice(6));p(D,M),D=""}}}catch(v){v.name!=="AbortError"&&c(v instanceof Error?v.message:"Scan failed")}finally{r(!1)}})()},[]);function p(m,x){switch(m){case"candidate":t(y=>[...y,x]),i(y=>y?{...y,foundAgents:y.foundAgents+1}:{scannedDirs:0,foundAgents:1});break;case"progress":i(x);break;case"complete":i(x);break;case"error":c(x.error);break}}return{candidates:e,isScanning:n,progress:s,startScan:d,error:l}}function yae(){const e=He();return vt({queryKey:["pulse","presets"],queryFn:()=>e.getPulsePresets()})}const bae={default:"#1A1A1A",white:"#FFFFFF",orange:"#CE2021"};function J3({variant:e="default",size:t=40,className:n,style:r}){const s=bae[e],i=t*(799/2325);return u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:i,viewBox:"0 0 2325 799",fill:"none",className:n,style:r,"aria-hidden":"true",children:[u.jsx("rect",{x:"50",y:"50",width:"2225",height:"699",stroke:s,strokeWidth:"100"}),u.jsx("path",{d:"M492.333 199.627L599.833 295.627L600 295.776V491.707L492.207 599.5H199.5V199.5H492.19L492.333 199.627ZM334 347.5V448.5H435V347.5H334Z",fill:s}),u.jsx("path",{d:"M1108.5 497.715L1108.34 497.862L1001.34 599.362L1001.2 599.5H699V296.283L699.158 296.135L802.158 199.635L802.303 199.5H1108.5V497.715ZM855 347.5V448.5H956V347.5H855Z",fill:s}),u.jsx("path",{d:"M1616.94 200.24L1510.07 395.005L1616.94 598.768L1617.64 600.103L1616.28 599.451L1409 500.056L1208.22 599.448L1207.5 599.806V199.5H1617.34L1616.94 200.24ZM1332 337.5V439.207L1433.71 337.5H1332Z",fill:s}),u.jsx("path",{d:"M1716.5 599V200L1841 291.5L2125 200L2017.5 400L2125 599L1841 501L1716.5 599Z",fill:s,stroke:s})]})}const Yy=["Welcome","to","DorkOS"],vae=[{icon:$f,label:"Discover agents"},{icon:Uf,label:"Schedule tasks"},{icon:JO,label:"Connect channels"}],Gy=["TOP","LEFT","BOTTOM","RIGHT"],Eae={TOP:"radial-gradient(60% 80% at 50% 0%, hsl(var(--primary) / 0.5) 0%, transparent 100%)",LEFT:"radial-gradient(50% 80% at 0% 50%, hsl(var(--primary) / 0.5) 0%, transparent 100%)",BOTTOM:"radial-gradient(60% 80% at 50% 100%, hsl(var(--primary) / 0.5) 0%, transparent 100%)",RIGHT:"radial-gradient(50% 80% at 100% 50%, hsl(var(--primary) / 0.5) 0%, transparent 100%)"},Tae="radial-gradient(80% 120% at 50% 50%, hsl(var(--primary) / 0.8) 0%, hsl(var(--primary) / 0.3) 50%, transparent 100%)";function Sae({onGetStarted:e,onSkip:t}){const n=dc(),[r,s]=b.useState(!1),[i,l]=b.useState("TOP");return b.useEffect(()=>{if(n||r)return;const c=setInterval(()=>{l(f=>{const d=Gy.indexOf(f);return Gy[(d+1)%Gy.length]})},1200);return()=>clearInterval(c)},[r,n]),u.jsxs("div",{className:"mx-auto flex w-full max-w-md flex-col items-center px-4 text-center",children:[u.jsxs(De.div,{className:"mb-6 opacity-80",initial:n?!1:{opacity:0,scale:.8},animate:{opacity:.8,scale:1},transition:{duration:.4},children:[u.jsx(J3,{size:150,className:"dark:hidden"}),u.jsx(J3,{variant:"white",size:150,className:"hidden dark:block"})]}),u.jsx("h1",{className:"text-3xl font-semibold tracking-tight sm:text-4xl",children:n?Yy.join(" "):u.jsx(De.span,{initial:"hidden",animate:"visible",variants:{visible:{transition:{staggerChildren:.08}}},children:Yy.map((c,f)=>u.jsxs(De.span,{className:"inline-block",variants:{hidden:{opacity:0,filter:"blur(4px)"},visible:{opacity:1,filter:"blur(0px)"}},transition:{duration:.4},children:[c,f<Yy.length-1?" ":""]},f))})}),u.jsx(De.p,{className:"mt-4 text-muted-foreground",initial:n?!1:{opacity:0},animate:{opacity:1},transition:{delay:.4,duration:.5},children:"Let’s set up your AI agent workspace."}),u.jsx(De.div,{className:"mt-10 flex gap-8",initial:n?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.6,duration:.4},children:vae.map(({icon:c,label:f},d)=>u.jsxs("div",{className:"flex flex-col items-center gap-2",children:[u.jsx("div",{className:"flex size-10 items-center justify-center rounded-lg bg-muted",children:u.jsx(c,{className:"size-5 text-muted-foreground"})}),u.jsx("span",{className:"text-xs text-muted-foreground",children:f})]},d))}),u.jsxs(De.div,{className:"mt-12 flex flex-col items-center gap-3",initial:n?!1:{opacity:0},animate:{opacity:1},transition:{delay:.8,duration:.4},children:[u.jsxs("div",{className:"relative",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[u.jsx(De.div,{className:"absolute -inset-px rounded-md blur-sm",animate:{background:r?Tae:Eae[i]},transition:{ease:"linear",duration:.4}}),u.jsx(mt,{size:"lg",className:"relative",onClick:e,children:"Get Started"})]}),u.jsx("button",{onClick:t,className:"text-sm text-muted-foreground transition-colors hover:text-foreground",children:"Skip setup"})]})]})}const wae={"CLAUDE.md":"CLAUDE.md",".cursor":".cursor",".github/copilot":"Copilot",".dork":"DorkOS"};function Cae(e){return wae[e]??e}function $I(){const[e,t]=b.useState({x:0,y:0}),[n,r]=b.useState(!1),s=dc(),i=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches,l=s||i,c=b.useCallback(p=>{if(l)return;const m=p.currentTarget.getBoundingClientRect();t({x:p.clientX-m.left,y:p.clientY-m.top}),r(!0)},[l]),f=b.useCallback(()=>{r(!1)},[]),d=!l&&n?{background:`radial-gradient(350px circle at ${e.x}px ${e.y}px, rgba(59,130,246,0.06), transparent 80%)`}:void 0;return{position:e,isActive:n,onMouseMove:c,onMouseLeave:f,spotlightStyle:d}}function Nae(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,"~")}function Aae(e){const t=e.match(/:([^/]+\/[^/]+?)(?:\.git)?$/);if(t)return t[1];const n=e.replace(/\.git$/,"").split("/");return n.length>=2?`${n[n.length-2]}/${n[n.length-1]}`:e}function VI({candidate:e,selected:t,onToggle:n}){const{onMouseMove:r,onMouseLeave:s,spotlightStyle:i}=$I();return u.jsxs("button",{type:"button",onClick:n,onMouseMove:r,onMouseLeave:s,className:Ee("relative flex w-full items-start gap-4 rounded-xl border p-6 text-left transition-colors","hover:bg-muted/50",t?"border-primary bg-primary/5":"border-border"),children:[i&&u.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-xl",style:i}),u.jsx("div",{className:"mt-0.5 flex size-11 flex-shrink-0 items-center justify-center",children:u.jsx("div",{className:Ee("flex size-5 items-center justify-center rounded border-2 transition-colors",t?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40"),children:t&&u.jsx("svg",{className:"size-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})})}),u.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-lg font-semibold",children:e.name}),e.hasDorkManifest&&u.jsx(gn,{variant:"secondary",className:"text-xs",children:"Registered"})]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.markers.map(l=>u.jsx(gn,{variant:"secondary",className:"text-xs",children:Cae(l)},l))}),u.jsxs("p",{className:"flex items-center gap-1.5 truncate text-sm text-muted-foreground",children:[u.jsx(Zo,{className:"size-3.5 shrink-0"}),u.jsx("span",{className:"truncate font-mono",children:Nae(e.path)})]}),e.gitRemote&&u.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[u.jsx(hv,{className:"size-3 shrink-0"}),u.jsx("span",{className:"truncate font-mono",children:Aae(e.gitRemote)})]})]})]})}function kae({onAgentCreated:e}){var y;const[t,n]=b.useState(""),[r,s]=b.useState(""),[i,l]=b.useState(""),[c,f]=b.useState(!1),[d,p]=b.useState(!1),m=e4(),x=b.useCallback(()=>{!t||!r.trim()||m.mutate({path:t,name:r.trim(),description:i.trim()||void 0},{onSuccess:()=>{p(!0),setTimeout(e,1200)}})},[t,r,i,m,e]);return d?u.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 py-12 text-center",children:[u.jsx(zf,{className:"text-primary size-12"}),u.jsx("h3",{className:"text-lg font-semibold",children:"Agent created"}),u.jsxs("p",{className:"text-muted-foreground text-sm",children:[u.jsx("span",{className:"font-medium",children:r})," is ready at"," ",u.jsx("span",{className:"font-mono text-xs",children:Op(t)})]})]}):u.jsxs("div",{className:"flex flex-col items-center justify-center space-y-6 py-8",children:[u.jsxs("div",{className:"space-y-2 text-center",children:[u.jsx("div",{className:"bg-muted mx-auto flex size-12 items-center justify-center rounded-full",children:u.jsx($O,{className:"text-muted-foreground size-6"})}),u.jsx("h3",{className:"text-lg font-semibold",children:"No agents found"}),u.jsx("p",{className:"text-muted-foreground mx-auto max-w-sm text-sm",children:"Agents give your projects an identity. Each agent lives in a project directory and can have its own name, persona, and scheduled tasks."})]}),u.jsxs("div",{className:"w-full max-w-sm space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Gt,{htmlFor:"agent-directory",children:"Project directory"}),u.jsxs("button",{id:"agent-directory",type:"button",onClick:()=>f(!0),className:`border-input bg-background hover:bg-accent flex h-10 w-full items-center gap-2 rounded-md border px-3 text-sm transition-colors ${t?"text-foreground":"text-muted-foreground"}`,children:[u.jsx(Hf,{className:"size-4 flex-shrink-0"}),u.jsx("span",{className:"truncate",children:t?Op(t):"Select a directory..."})]}),u.jsx(eg,{open:c,onOpenChange:f,onSelect:n})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Gt,{htmlFor:"agent-name",children:"Agent name"}),u.jsx(Ss,{id:"agent-name",type:"text",placeholder:"e.g. my-project",value:r,onChange:v=>s(v.target.value)})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs(Gt,{htmlFor:"agent-persona",children:["Persona ",u.jsx("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),u.jsx($T,{id:"agent-persona",placeholder:"Describe what this agent does...",value:i,onChange:v=>l(v.target.value),rows:3})]}),u.jsx(mt,{className:"w-full",onClick:x,disabled:!t||!r.trim()||m.isPending,children:m.isPending?u.jsxs(u.Fragment,{children:[u.jsx(Qn,{className:"size-4 animate-spin"}),"Creating..."]}):"Create agent"}),m.isError&&u.jsxs("p",{className:"text-destructive text-center text-sm",children:["Failed to create agent. ",((y=m.error)==null?void 0:y.message)??"Please try again."]})]})]})}const _ae=6;function Rae(e){return[...e].sort((t,n)=>t.hasDorkManifest!==n.hasDorkManifest?t.hasDorkManifest?-1:1:n.markers.length-t.markers.length)}function Oae({onStepComplete:e}){const{candidates:t,isScanning:n,progress:r,error:s,startScan:i}=HI(),l=QT(),[c,f]=b.useState(null),[d,p]=b.useState(!1),[m,x]=b.useState(!1),y=dc(),v=b.useRef(!1),T=c??new Set(t.map(Y=>Y.path));b.useEffect(()=>{v.current||(v.current=!0,p(!0),i())},[i]);const w=b.useMemo(()=>n?t:Rae(t),[t,n]),N=b.useCallback(Y=>{f(W=>{const te=W??new Set(t.map(L=>L.path)),J=new Set(te);return J.has(Y)?J.delete(Y):J.add(Y),J})},[t]),A=b.useCallback(()=>{f(new Set(t.map(Y=>Y.path)))},[t]),k=b.useCallback(()=>{f(new Set)},[]),R=b.useCallback(()=>{f(null),p(!0),i()},[i]),D=b.useCallback(async()=>{if(T.size===0){e();return}x(!0);const Y=Array.from(T);try{await Promise.all(Y.map(W=>l.mutateAsync({path:W})))}catch{}finally{x(!1),e()}},[T,l,e]),O=b.useCallback(()=>{R()},[R]),M=t.length>0,I=d&&!n,H=I&&!M,P=!n&&t.length>=_ae,K=M&&T.size===t.length;return u.jsxs("div",{className:"flex min-h-0 w-full flex-1 flex-col items-center",children:[u.jsxs("div",{className:"w-full shrink-0 text-center",children:[u.jsx("h1",{className:"text-2xl font-semibold tracking-tight sm:text-3xl",children:n&&!M?"Searching your projects...":"Discovered Agents"}),u.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"We’ll find AI-configured projects on your machine."})]}),n&&!M&&u.jsxs("div",{className:"mt-8 flex shrink-0 flex-col items-center gap-4",children:[u.jsx(De.div,{animate:y?{}:{scale:[1,1.15,1]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},children:u.jsx($f,{className:"size-8 text-muted-foreground"})}),r&&u.jsxs("p",{className:"text-sm text-muted-foreground",children:["Scanned ",r.scannedDirs," directories"]})]}),n&&M&&r&&u.jsxs("div",{className:"mt-4 shrink-0 text-center text-sm text-muted-foreground",children:["Scanning... ",r.scannedDirs," directories · Found ",r.foundAgents," agent",r.foundAgents===1?"":"s"]}),I&&M&&u.jsxs("p",{className:"mt-4 shrink-0 text-center text-sm text-muted-foreground",children:["Found ",t.length," project",t.length===1?"":"s",". Select the ones you want to register."]}),s&&u.jsx("div",{className:"mt-6 shrink-0 rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:s}),u.jsx(ft,{children:P&&u.jsx(De.div,{initial:y?!1:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeOut"},className:"mt-4 w-full shrink-0 overflow-hidden",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("span",{className:"text-sm text-muted-foreground",children:[T.size," of ",t.length," selected"]}),u.jsx(mt,{variant:"ghost",size:"sm",onClick:K?k:A,className:"gap-1.5 text-sm",children:K?u.jsxs(u.Fragment,{children:[u.jsx(nD,{className:"size-3.5"}),"Deselect all"]}):u.jsxs(u.Fragment,{children:[u.jsx(MG,{className:"size-3.5"}),"Select all"]})})]})})}),M&&u.jsx("div",{className:"mt-4 min-h-0 w-full flex-1 overflow-y-auto pr-1",children:u.jsx("div",{className:"space-y-3",children:u.jsx(ft,{mode:"popLayout",children:w.map(Y=>u.jsx(De.div,{layout:!y,initial:y?!1:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.25,ease:"easeOut"},children:u.jsx(VI,{candidate:Y,selected:T.has(Y.path),onToggle:()=>N(Y.path)})},Y.path))})})}),H&&u.jsxs("div",{className:"mt-8 w-full",children:[u.jsx(kae,{onAgentCreated:O}),u.jsx("div",{className:"mt-4 flex justify-center",children:u.jsx(mt,{variant:"outline",onClick:R,children:"Scan Again"})})]}),I&&M&&u.jsx("div",{className:"mt-4 flex shrink-0 flex-col items-center gap-2 border-t pt-4",children:u.jsx(mt,{size:"lg",onClick:D,disabled:m,variant:T.size===0?"outline":"default",children:m?"Registering...":T.size>0?`Register ${T.size} agent${T.size===1?"":"s"}`:"Continue without registering"})})]})}const Dae=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function jae(e){const t=e.trim().split(/\s+/);if(t.length!==5)return e;const[n,r,s,i,l]=t;return s==="*"&&i==="*"&&l==="*"&&Ad(r)&&Ad(n)?`Every day at ${e_(r,n)}`:s==="*"&&i==="*"&&Ad(l)&&Ad(r)&&Ad(n)?`Every ${Dae[Number(l)]??`day ${l}`} at ${e_(r,n)}`:e}function Ad(e){return/^\d+$/.test(e)}function e_(e,t){const n=Number(e),r=Number(t),s=n>=12?"PM":"AM";return`${n===0?12:n>12?n-12:n}:${String(r).padStart(2,"0")} ${s}`}function Mae({preset:e,enabled:t,onToggle:n}){const{onMouseMove:r,onMouseLeave:s,spotlightStyle:i}=$I();return u.jsxs("button",{type:"button",onClick:n,onMouseMove:r,onMouseLeave:s,className:Ee("relative flex w-full items-start gap-4 rounded-lg border p-4 text-left transition","hover:bg-accent/50","min-h-11",t&&"border-primary/40 bg-accent/30"),children:[i&&u.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-lg",style:i}),u.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center",children:u.jsx(xn,{checked:t,onCheckedChange:n,"aria-label":`Enable ${e.name}`,onClick:l=>l.stopPropagation()})}),u.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[u.jsx("div",{className:"font-medium",children:e.name}),u.jsx("p",{className:"text-sm text-muted-foreground",children:e.description}),u.jsx("p",{className:"text-xs text-muted-foreground",children:jae(e.cron)}),u.jsx("p",{className:"line-clamp-2 text-sm text-muted-foreground/80",children:e.prompt})]})]})}function Iae({onStepComplete:e,agents:t}){const{data:n,isLoading:r,isError:s}=yae(),i=SI(),[l,c]=b.useState(null),[f,d]=b.useState(!1),[p,m]=b.useState(null),x=t.length===1?t[0]:t.find(A=>A.id===p)??null,y=l??new Set((n==null?void 0:n.map(A=>A.id))??[]),v=b.useCallback(A=>{c(k=>{const R=k??new Set((n==null?void 0:n.map(O=>O.id))??[]),D=new Set(R);return D.has(A)?D.delete(A):D.add(A),D})},[n]),T=y.size,w=T>0&&x!==null,N=b.useCallback(async()=>{if(!n||T===0||!x){e();return}d(!0);const A=n.filter(k=>y.has(k.id));try{await Promise.all(A.map(k=>i.mutateAsync({name:k.name,prompt:k.prompt,cron:k.cron,cwd:x.projectPath})))}catch{}finally{d(!1),e()}},[n,T,y,x,i,e]);return u.jsxs("div",{className:"mx-auto w-full max-w-2xl flex-1 space-y-4 overflow-y-auto px-4",children:[u.jsxs("div",{className:"space-y-2 text-center",children:[u.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Want your agents to work while you sleep?"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Pulse runs automated tasks on a schedule — like a cron job for your agents."})]}),t.length===1&&u.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Scheduling for ",t[0].icon?`${t[0].icon} `:"",t[0].name]}),t.length>=2&&u.jsx("div",{className:"mx-auto max-w-xs",children:u.jsxs(Us,{value:p??"",onValueChange:m,children:[u.jsx(ws,{children:u.jsx(Hs,{placeholder:"Select a project..."})}),u.jsx(Cs,{children:t.map(A=>u.jsxs(Lt,{value:A.id,children:[A.icon?`${A.icon} `:"",A.name]},A.id))})]})}),r&&u.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Loading presets..."}),s&&u.jsx("p",{className:"text-center text-sm text-destructive",children:"Failed to load presets. You can skip this step and configure schedules later."}),n&&n.length>0&&u.jsx("div",{className:"grid gap-3",children:n.map(A=>u.jsx(Mae,{preset:A,enabled:y.has(A.id),onToggle:()=>v(A.id)},A.id))}),u.jsxs("div",{className:"flex flex-col items-center gap-3 pt-2",children:[u.jsx(mt,{onClick:N,size:"lg",disabled:f||T>0&&!w,children:f?"Creating...":T>0?`Create ${T} Schedule${T===1?"":"s"}`:"Continue Without Schedules"}),t.length>=2&&u.jsx("p",{className:"text-xs text-muted-foreground",children:"You can put your other agents on autopilot anytime from Pulse."})]})]})}const Ky=["You're","all","set!"];function Lae({onComplete:e}){const t=dc(),{state:n}=uh(),r=b.useRef(!1);b.useEffect(()=>{r.current||(r.current=!0,Q5())},[]);const s=n.completedSteps.includes("discovery"),i=n.completedSteps.includes("pulse"),l=[{icon:$G,label:s?"Agents discovered":"Agents skipped",done:s},{icon:Uf,label:i?"Schedules created":"Schedules skipped",done:i},{icon:JO,label:"Adapters: coming soon",done:!1}];return u.jsxs(De.div,{initial:t?!1:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.3,ease:"easeOut"},className:"mx-auto flex w-full max-w-md flex-col items-center gap-8 px-4 text-center",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:t?Ky.join(" "):u.jsx(De.span,{initial:"hidden",animate:"visible",variants:{visible:{transition:{staggerChildren:.08}}},children:Ky.map((c,f)=>u.jsxs(De.span,{className:"inline-block",variants:{hidden:{opacity:0,filter:"blur(4px)"},visible:{opacity:1,filter:"blur(0px)"}},transition:{duration:.4},children:[c,f<Ky.length-1?" ":""]},f))})}),u.jsx("p",{className:"text-muted-foreground",children:"Your workspace is configured and ready."})]}),u.jsx(De.div,{className:"w-full space-y-3",initial:"hidden",animate:"visible",variants:t?{}:{visible:{transition:{staggerChildren:.12,delayChildren:.3}}},children:l.map(({icon:c,label:f,done:d})=>u.jsxs(De.div,{variants:t?{}:{hidden:{opacity:0,y:12},visible:{opacity:1,y:0}},transition:{duration:.3},className:"flex items-center gap-3 rounded-lg border p-4",children:[u.jsx(c,{className:`size-5 ${d?"text-primary":"text-muted-foreground/50"}`}),u.jsx("span",{className:d?"text-sm":"text-sm text-muted-foreground",children:f})]},f))}),u.jsx(De.div,{initial:t?!1:{opacity:0},animate:{opacity:1},transition:{delay:.8,duration:.4},children:u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute -inset-px animate-[spin_4s_linear_infinite] rounded-lg bg-gradient-to-r from-primary/40 via-transparent to-primary/40 blur-sm"}),u.jsx(mt,{size:"lg",className:"relative",onClick:e,children:"Start your first session"})]})})]})}const np=["discovery","pulse"];function qI({onComplete:e,initialStep:t=-1}){var M;const[n,r]=b.useState(t),[s,i]=b.useState(1),[l,c]=b.useState(!1),{completeStep:f,skipStep:d,dismiss:p,startOnboarding:m}=uh(),x=pl(),y=dc(),v=jne();b.useEffect(()=>{m()},[]);const T=b.useCallback(()=>{n<np.length-1?(i(1),r(I=>I+1)):(f("adapters"),c(!0))},[n,f]),w=b.useCallback(()=>{n>0?(i(-1),r(I=>I-1)):n===0&&(i(-1),r(-1))},[n]),N=b.useCallback(()=>{f(np[n]),T()},[n,f,T]),A=b.useCallback(()=>{d(np[n]),T()},[n,d,T]),k=b.useCallback(async()=>{await p(),e()},[p,e]),R=b.useCallback(()=>{i(1),r(0)},[]);if(b.useEffect(()=>{var I;n===1&&!v.isLoading&&((I=v.data)==null?void 0:I.agents.length)===0&&(f("pulse"),T())},[n,v.isLoading,v.data,f,T]),l)return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background",children:u.jsx(Lae,{onComplete:e})});if(n===-1)return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background",children:u.jsx(Sae,{onGetStarted:R,onSkip:k})});const D=x?150:300,O=y?{enter:{opacity:0},center:{opacity:1},exit:{opacity:0}}:{enter:I=>({x:I>0?D:-D,opacity:0,scale:.98,filter:"blur(2px)"}),center:{x:0,opacity:1,scale:1,filter:"blur(0px)"},exit:I=>({x:I>0?-D:D,opacity:0,scale:.98,filter:"blur(2px)"})};return u.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-background",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 sm:px-6",children:[u.jsx(mt,{variant:"ghost",size:"sm",onClick:w,className:"min-w-16",children:"Back"}),u.jsx("div",{className:"flex items-center gap-2",children:np.map((I,H)=>u.jsx("div",{className:"relative flex items-center justify-center",children:H===n?u.jsx(De.div,{layoutId:"step-indicator",className:"flex h-2 w-6 items-center justify-center rounded-full bg-primary",transition:{type:"spring",damping:25,stiffness:200}}):H<n?u.jsx("div",{className:"flex size-2 items-center justify-center rounded-full bg-primary/60",children:u.jsx(zn,{className:"size-1.5 text-primary-foreground"})}):u.jsx("div",{className:Ee("size-2 rounded-full ring-1 ring-muted-foreground/30")})},H))}),u.jsxs("div",{className:"flex min-w-16 items-center justify-end gap-1",children:[u.jsx(mt,{variant:"ghost",size:"sm",onClick:A,children:"Skip"}),u.jsx(mt,{variant:"ghost",size:"sm",onClick:k,className:"text-muted-foreground",children:"Skip all"})]})]}),u.jsx("div",{className:"relative flex-1 overflow-hidden",children:u.jsx(ft,{mode:"wait",custom:s,children:u.jsx(De.div,{custom:s,variants:O,initial:"enter",animate:"center",exit:"exit",transition:{type:y?"tween":"spring",damping:25,stiffness:200,duration:y?.15:void 0},className:"absolute inset-0 flex flex-col",children:u.jsxs("div",{className:"mx-auto flex min-h-0 w-full max-w-2xl flex-1 flex-col px-4 py-4 sm:px-6",children:[n===0&&u.jsx(Oae,{onStepComplete:N}),n===1&&u.jsx(Iae,{onStepComplete:N,agents:((M=v.data)==null?void 0:M.agents)??[]})]})},n)})})]})}const Qy={discovery:"Discover agents",pulse:"Set up Pulse schedules",adapters:"Connect adapters"},Pae=["discovery","pulse"];function Bae({onStepClick:e,onDismiss:t}){const{state:n}=uh(),r=dc();return u.jsxs(De.div,{initial:r?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.3},className:"border-border bg-card relative rounded-lg border p-3",children:[u.jsx("button",{onClick:t,className:"text-muted-foreground/50 hover:text-muted-foreground absolute right-1.5 top-1.5 rounded-md p-0.5 transition-colors duration-150","aria-label":"Dismiss getting started",children:u.jsx(ba,{className:"size-3.5"})}),u.jsx("h3",{className:"text-xs font-medium mb-2",children:"Getting Started"}),u.jsx("ul",{className:"space-y-1",children:Pae.map((s,i)=>{const l=n.completedSteps.includes(s),c=n.skippedSteps.includes(s);return l?u.jsxs("li",{className:"flex items-center gap-2 py-0.5",children:[u.jsx(zn,{className:"text-primary size-3.5 shrink-0"}),u.jsx("span",{className:"text-muted-foreground text-xs",children:Qy[s]})]},s):c?u.jsxs("li",{className:"flex items-center gap-2 py-0.5",children:[u.jsx(rG,{className:"text-muted-foreground/40 size-3.5 shrink-0"}),u.jsx("button",{onClick:()=>e(i),className:Ee("text-muted-foreground/40 text-xs text-left transition-colors duration-150","hover:text-muted-foreground"),children:Qy[s]})]},s):u.jsxs("li",{className:"flex items-center gap-2 py-0.5",children:[u.jsx(qO,{className:"text-muted-foreground size-3.5 shrink-0"}),u.jsx("button",{onClick:()=>e(i),className:"text-foreground text-xs text-left transition-colors duration-150 hover:underline",children:Qy[s]})]},s)})})]})}function Fae({enabled:e=!0}){const t=rg(),{data:n,isLoading:r}=Hne(e&&t);return!t||!e||r||!n?null:u.jsxs("div",{className:"flex items-center gap-3 border-b px-3 py-1.5 text-xs text-muted-foreground",children:[u.jsxs("span",{children:[n.totalAgents," agents"]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500","aria-hidden":"true"}),n.activeCount]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500","aria-hidden":"true"}),n.inactiveCount]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-zinc-400","aria-hidden":"true"}),n.staleCount]})]})}function t_(e){if(!e)return"Never";const t=Date.now(),n=new Date(e).getTime(),r=t-n;if(Number.isNaN(r)||r<0)return"just now";const s=Math.floor(r/1e3);if(s<60)return`${s}s ago`;const i=Math.floor(s/60);if(i<60)return`${i}m ago`;const l=Math.floor(i/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}const YI={active:{label:"Active",color:"bg-green-500"},inactive:{label:"Inactive",color:"bg-amber-500"},stale:{label:"Stale",color:"bg-zinc-400"}};function zae(e){return e in YI}function n_({onClick:e}){return u.jsx("button",{type:"button",onClick:e,"aria-label":"Close detail panel",className:"text-muted-foreground hover:text-foreground",children:u.jsx(ba,{className:"size-(--size-icon-sm)"})})}function Uae({agentId:e,onClose:t,onOpenSettings:n}){const{data:r,isLoading:s}=RI(e);if(s)return u.jsx("div",{className:"flex w-64 items-center justify-center border-l p-4",children:u.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})});if(!r)return u.jsxs("div",{className:"w-64 border-l p-4",children:[u.jsx("div",{className:"flex justify-end",children:u.jsx(n_,{onClick:t})}),u.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Agent not found"})]});const i=zae(r.status)?r.status:"stale",l=YI[i];return u.jsxs("div",{className:"w-64 overflow-y-auto border-l p-4",children:[u.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[u.jsx("h3",{className:"truncate text-sm font-semibold",children:r.name}),u.jsx(n_,{onClick:t})]}),u.jsxs("div",{className:"space-y-3 text-xs",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${l.color}`,"aria-hidden":"true"}),u.jsx("span",{children:l.label})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"Last seen: "}),u.jsx("span",{children:t_(r.lastSeenAt)})]}),r.lastSeenEvent&&u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"Last event: "}),u.jsx("span",{children:r.lastSeenEvent})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"Runtime: "}),u.jsx(gn,{variant:"secondary",className:"text-[0.625rem]",children:r.runtime})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"Registered: "}),u.jsx("span",{children:t_(r.registeredAt)})]}),Array.isArray(r.capabilities)&&r.capabilities.length>0&&u.jsxs("div",{children:[u.jsx("span",{className:"mb-1 block text-muted-foreground",children:"Capabilities:"}),u.jsx("div",{className:"flex flex-wrap gap-1",children:r.capabilities.map(c=>u.jsx(gn,{variant:"outline",className:"text-[0.625rem]",children:c},c))})]})]}),n&&u.jsx("div",{className:"mt-4 border-t pt-3",children:u.jsxs("button",{type:"button",onClick:n,className:"inline-flex w-full items-center justify-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium hover:bg-muted",children:[u.jsx(g0,{className:"size-3.5"}),"Open Settings"]})})]})}function JT({icon:e,headline:t,description:n,action:r,preview:s}){return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 p-12 text-center",children:[s&&u.jsx("div",{className:"mb-4 w-full max-w-sm select-none opacity-40 pointer-events-none",children:s}),u.jsx("div",{className:"rounded-xl bg-muted/50 p-3",children:u.jsx(e,{className:"size-6 text-muted-foreground"})}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium",children:t}),u.jsx("p",{className:"max-w-[280px] text-xs text-muted-foreground",children:n})]}),r&&u.jsx(mt,{size:"sm",onClick:r.onClick,className:"mt-1",children:r.label})]})}function Hae({namespace:e,agentCount:t,agents:n}){const[r,s]=b.useState(!1);return u.jsxs("div",{className:"rounded-xl border",children:[u.jsxs("button",{type:"button",onClick:()=>s(!r),className:"flex w-full items-center gap-2 px-4 py-3 text-left hover:bg-muted/50",children:[r?u.jsx(ti,{className:"size-4"}):u.jsx(As,{className:"size-4"}),u.jsx("span",{className:"font-medium text-sm",children:e}),u.jsxs(gn,{variant:"secondary",className:"ml-auto text-xs",children:[t," agent",t!==1?"s":""]})]}),r&&u.jsx("div",{className:"border-t px-4 py-2 space-y-2",children:n.map(i=>u.jsxs("div",{className:"flex items-center justify-between py-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm",children:i.name}),u.jsx(gn,{variant:"outline",className:"text-xs",children:i.runtime})]}),i.budget&&u.jsxs("div",{className:"flex gap-2 text-xs text-muted-foreground",children:[u.jsxs("span",{children:[i.budget.maxCallsPerHour," calls/hr"]}),u.jsxs("span",{children:[i.budget.maxHopsPerMessage," max hops"]})]})]},i.id))})]})}function $ae({sourceNamespace:e,targetNamespace:t,action:n,onRemove:r}){return u.jsxs("div",{className:"flex items-center justify-between rounded-lg border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[u.jsx("span",{className:"font-mono",children:e}),u.jsx("span",{className:"text-muted-foreground",children:"→"}),u.jsx("span",{className:"font-mono",children:t}),u.jsx(gn,{variant:n==="allow"?"default":"destructive",className:"text-xs",children:n})]}),u.jsx("button",{type:"button",onClick:r,className:"rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive","aria-label":`Remove rule ${e} to ${t}`,children:u.jsx(tT,{className:"size-3.5"})})]})}function Vae({namespaces:e,onAdd:t,isPending:n}){const[r,s]=b.useState(""),[i,l]=b.useState("");function c(f){f.preventDefault(),r&&i&&r!==i&&(t(r,i),s(""),l(""))}return u.jsxs("form",{onSubmit:c,className:"flex items-end gap-2",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx("label",{htmlFor:"acl-source",className:"text-xs font-medium text-muted-foreground",children:"Source"}),u.jsxs("select",{id:"acl-source",value:r,onChange:f=>s(f.target.value),className:"mt-1 w-full rounded-md border bg-transparent px-2 py-1.5 text-sm",children:[u.jsx("option",{value:"",children:"Select namespace"}),e.map(f=>u.jsx("option",{value:f,children:f},f))]})]}),u.jsxs("div",{className:"flex-1",children:[u.jsx("label",{htmlFor:"acl-target",className:"text-xs font-medium text-muted-foreground",children:"Target"}),u.jsxs("select",{id:"acl-target",value:i,onChange:f=>l(f.target.value),className:"mt-1 w-full rounded-md border bg-transparent px-2 py-1.5 text-sm",children:[u.jsx("option",{value:"",children:"Select namespace"}),e.map(f=>u.jsx("option",{value:f,children:f},f))]})]}),u.jsxs("button",{type:"submit",disabled:n||!r||!i||r===i,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:[n?u.jsx(Qn,{className:"size-4 animate-spin"}):u.jsx(eT,{className:"size-4"}),"Allow"]})]})}function qae({onGoToDiscovery:e}={}){const{data:t,isLoading:n}=Vne(),{mutate:r,isPending:s}=Yne();if(n)return u.jsx("div",{className:"flex items-center justify-center p-8",children:u.jsx(Qn,{className:"size-5 animate-spin text-muted-foreground"})});const i=(t==null?void 0:t.namespaces)??[],l=(t==null?void 0:t.accessRules)??[],c=i.map(f=>f.namespace);return i.length===0?u.jsx(JT,{icon:x0,headline:"Cross-project access requires multiple namespaces",description:"Register agents from different directories to create namespaces, then configure cross-namespace access rules.",action:e?{label:"Go to Discovery",onClick:e}:void 0}):u.jsxs("div",{className:"space-y-6 p-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Namespaces"}),i.map(f=>u.jsx(Hae,{namespace:f.namespace,agentCount:f.agentCount,agents:f.agents},f.namespace))]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Cross-Project Access Rules"}),l.length===0?u.jsx("p",{className:"text-xs text-muted-foreground",children:"No cross-project rules. Agents can only communicate within their own namespace."}):u.jsx("div",{className:"space-y-1",children:l.map(f=>u.jsx($ae,{sourceNamespace:f.sourceNamespace,targetNamespace:f.targetNamespace,action:f.action,onRemove:()=>r({sourceNamespace:f.sourceNamespace,targetNamespace:f.targetNamespace,action:"deny"})},`${f.sourceNamespace}-${f.targetNamespace}`))})]}),c.length>=2&&u.jsxs("div",{className:"space-y-2",children:[u.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Add Cross-Project Rule"}),u.jsx(Vae,{namespaces:c,isPending:s,onAdd:(f,d)=>r({sourceNamespace:f,targetNamespace:d,action:"allow"})})]})]})}function Yae({roots:e,onChange:t}){const[n,r]=b.useState(""),[s,i]=b.useState(!1),l=b.useCallback(p=>{const m=p.trim();m&&!e.includes(m)&&t([...e,m])},[e,t]),c=b.useCallback(p=>{t(e.filter(m=>m!==p))},[e,t]),f=b.useCallback(p=>{(p.key==="Enter"||p.key===",")&&(p.preventDefault(),n.trim()&&(l(n),r(""))),p.key==="Backspace"&&n===""&&e.length>0&&c(e[e.length-1])},[n,e,l,c]),d=b.useCallback(p=>{l(p)},[l]);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex min-h-[40px] flex-wrap items-center gap-1.5 rounded-md border bg-transparent px-3 py-1.5 focus-within:ring-2 focus-within:ring-ring",children:[e.map(p=>u.jsxs(gn,{variant:"secondary",className:"gap-1 py-0.5 font-mono text-xs",children:[p,u.jsx("button",{type:"button",onClick:()=>c(p),className:"ml-0.5 rounded-sm hover:bg-muted-foreground/20","aria-label":`Remove ${p}`,children:u.jsx(ba,{className:"size-3"})})]},p)),u.jsx("input",{type:"text",value:n,onChange:p=>r(p.target.value),onKeyDown:f,placeholder:e.length===0?"Add paths to scan (Enter to add)":"Add more...",className:"min-w-[120px] flex-1 bg-transparent text-sm placeholder:text-muted-foreground focus-visible:outline-none"}),u.jsx("button",{type:"button",onClick:()=>i(!0),className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":"Browse for directory",children:u.jsx(Hf,{className:"size-4"})})]}),u.jsx(eg,{open:s,onOpenChange:i,onSelect:d})]})}const Gae={manifest:"Found a .dork/agent.json manifest file in this directory.",heuristic:"Inferred from project file structure and naming conventions.","package.json":"Detected agent configuration inside package.json."};function Kae(e){return Gae[e]??`Detected via "${e}" strategy.`}const Qae={"code-review":"Reviews code for bugs, style issues, and correctness.",summarize:"Summarizes documents, conversations, or code.","file-ops":"Reads and writes files on the filesystem.",test:"Generates and runs tests for a codebase.",search:"Searches code, files, or the web for relevant information.",refactor:"Refactors code while preserving existing behavior.",analyze:"Analyzes data, logs, or codebases for patterns and insights.",generate:"Generates code, content, or structured output.",debug:"Diagnoses and fixes bugs in code.",deploy:"Manages deployment pipelines and infrastructure changes."};function Xae(e){return Qae[e]??"Agent capability detected from project structure."}function Wae({candidate:e,onApprove:t,onDeny:n}){const{path:r,strategy:s,hints:i}=e;return u.jsxs("div",{className:"flex items-start justify-between rounded-xl border p-4",children:[u.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[u.jsx("p",{className:"text-sm font-semibold leading-tight",children:i.suggestedName||r.split("/").pop()||r}),u.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[u.jsx(Zo,{className:"size-3 shrink-0"}),u.jsx("span",{className:"truncate font-mono",children:r})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[u.jsxs(wte,{openDelay:300,children:[u.jsx(Cte,{asChild:!0,children:u.jsx(gn,{variant:"secondary",className:"cursor-default text-xs hover:bg-secondary/80",children:i.detectedRuntime})}),u.jsxs(Nte,{className:"w-56 space-y-1.5 p-3",side:"top",align:"start",children:[u.jsx("p",{className:"text-xs font-medium",children:"Detected runtime"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:Kae(s)})]})]}),i.inferredCapabilities&&i.inferredCapabilities.length>0&&i.inferredCapabilities.map(l=>u.jsxs(Jo,{children:[u.jsx(el,{asChild:!0,children:u.jsx(gn,{variant:"outline",className:"cursor-default text-[10px]",children:l})}),u.jsx(tl,{side:"top",className:"max-w-48 text-center",children:Xae(l)})]},l))]})]}),u.jsxs("div",{className:"ml-4 flex shrink-0 items-center gap-1.5",children:[u.jsx("button",{type:"button",onClick:()=>t(e),className:"rounded-md bg-green-600/10 px-2.5 py-1 text-xs font-medium text-green-700 hover:bg-green-600/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 dark:text-green-400",children:"Approve"}),u.jsx("button",{type:"button",onClick:()=>n(e),className:"rounded-md bg-red-600/10 px-2.5 py-1 text-xs font-medium text-red-700 hover:bg-red-600/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 dark:text-red-400",children:"Deny"})]})]})}const Zae=[{name:"claude-code",signal:"CLAUDE.md",label:"Claude Code project"},{name:"cursor",signal:".cursor/",label:"Cursor project"},{name:"codex",signal:".codex/",label:"Codex project"},{name:"dork",signal:".dork/agent.json",label:"DorkOS agent (auto-imported)"}];function r_({fullBleed:e=!1}){const{roots:t,setScanRoots:n}=Gne(),[r,s]=b.useState(null),[i,l]=b.useState(!1),[c,f]=b.useState(3),{mutate:d,data:p,isPending:m}=Ine(),{mutate:x}=QT(),{mutate:y}=Lne(),{data:v}=_I(),T=r??t;function w(k){s(k),n(k)}function N(){T.length>0&&d({roots:T,maxDepth:c})}const A=p==null?void 0:p.candidates;return u.jsxs("div",{className:e?"flex h-full flex-col p-6":"space-y-4 p-4",children:[e&&u.jsxs("div",{className:"mb-4 space-y-1",children:[u.jsx("h2",{className:"text-lg font-semibold",children:"Discover Agents"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan directories to find agents on your computer."})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>l(!i),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[u.jsx(ti,{className:`size-3 transition-transform ${i?"":"-rotate-90"}`}),"Advanced"]}),i&&u.jsxs("div",{className:"mt-2 space-y-3 rounded-lg border bg-muted/30 p-3",children:[u.jsx(Yae,{roots:T,onChange:w}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("label",{htmlFor:"scan-depth",className:"text-xs text-muted-foreground",children:"Scan depth"}),u.jsx("input",{id:"scan-depth",type:"range",min:1,max:5,value:c,onChange:k=>f(Number(k.target.value)),className:"flex-1"}),u.jsx("span",{className:"min-w-[1.5rem] text-center text-xs font-medium",children:c})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("p",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[u.jsx(IY,{className:"size-3"}),"Detection strategies"]}),u.jsx("ul",{className:"space-y-1 pl-4",children:Zae.map(k=>u.jsxs("li",{className:"flex items-baseline gap-1.5",children:[u.jsx("code",{className:"text-[10px] text-foreground/70",children:k.signal}),u.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["→ ",k.label]})]},k.name))})]})]})]}),u.jsxs("button",{type:"button",onClick:N,disabled:m||T.length===0,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:[m?u.jsx(Qn,{className:"size-4 animate-spin"}):u.jsx($f,{className:"size-4"}),"Scan for Agents"]})]}),u.jsxs("div",{className:e?"mt-4 flex-1 overflow-y-auto":"",children:[m&&u.jsx("div",{className:"flex items-center justify-center p-8",children:u.jsx(Qn,{className:"size-5 animate-spin text-muted-foreground"})}),!m&&A&&A.length===0&&(()=>{var R;const k=(((R=v==null?void 0:v.agents)==null?void 0:R.length)??0)>0;return u.jsxs("div",{className:"rounded-xl border border-dashed p-8 text-center",children:[u.jsx("p",{className:"text-sm font-medium",children:k?"No new agents found":"No agents found"}),u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:k?"All discovered agents are already registered. Check the Agents tab to see them.":"Try scanning deeper directories or adding different paths."})]})})(),!m&&A&&A.length>0&&u.jsx("div",{className:"space-y-2",children:A.map(k=>u.jsx(Wae,{candidate:k,onApprove:R=>x({path:R.path,overrides:{name:R.hints.suggestedName,runtime:R.hints.detectedRuntime,...R.hints.inferredCapabilities?{capabilities:R.hints.inferredCapabilities}:{},...R.hints.description?{description:R.hints.description}:{}}}),onDeny:R=>y({path:R.path})},k.path))})]})]})}const Jae=b.lazy(()=>c0(()=>import("./TopologyGraph-DUHOb6MC.js"),__vite__mapDeps([0,1])).then(e=>({default:e.TopologyGraph})));function eie({agents:e,isLoading:t,onGoToDiscovery:n}){return t?u.jsx("div",{className:"flex items-center justify-center p-8",children:u.jsx(Qn,{className:"size-5 animate-spin text-muted-foreground"})}):e.length===0?u.jsx(JT,{icon:XO,headline:"No agents registered yet",description:"Discover agents in your filesystem and register them to the mesh.",action:{label:"Go to Discovery",onClick:n}}):u.jsx("div",{className:"space-y-2 p-4",children:e.map(r=>u.jsx(tie,{agent:r},r.id))})}function tie({agent:e}){const{mutate:t}=Pne();return u.jsxs("div",{className:"space-y-1 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("p",{className:"text-sm font-medium",children:e.name}),u.jsx(gn,{variant:"secondary",children:e.runtime})]}),u.jsx("button",{type:"button",onClick:()=>t(e.id),className:"rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive","aria-label":`Unregister ${e.name}`,children:u.jsx(ba,{className:"size-3.5"})})]}),e.description&&u.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}),e.capabilities.length>0&&u.jsx("div",{className:"flex flex-wrap gap-1 pt-1",children:e.capabilities.map(n=>u.jsx(gn,{variant:"outline",className:"text-xs",children:n},n))})]})}function nie({denied:e,isLoading:t}){return t?u.jsx("div",{className:"flex items-center justify-center p-8",children:u.jsx(Qn,{className:"size-5 animate-spin text-muted-foreground"})}):e.length===0?u.jsx(JT,{icon:eD,headline:"No blocked paths",description:"When you deny agent paths during discovery, they appear here. This is a healthy state."}):u.jsx("div",{className:"space-y-2 p-4",children:e.map(n=>u.jsxs("div",{className:"flex items-center justify-between rounded-xl border px-4 py-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-mono text-sm",children:n.path}),n.reason&&u.jsx("p",{className:"text-xs text-muted-foreground",children:n.reason})]}),u.jsx(gn,{variant:"outline",className:"text-xs",children:n.strategy})]},n.path))})}function rie({registeredNames:e}){const{candidates:t,isScanning:n,progress:r,startScan:s,error:i}=HI(),{mutate:l}=QT(),[c,f]=b.useState(new Set),d=b.useCallback(v=>{f(T=>{const w=new Set(T);return w.has(v)?w.delete(v):w.add(v),w})},[]),p=b.useCallback(v=>e.has(v.name)||v.markers.includes(".dork"),[e]),m=b.useCallback(()=>{for(const v of c){const T=t.find(w=>w.path===v);T&&!p(T)&&l({path:T.path})}f(new Set)},[c,t,p,l]),x=b.useMemo(()=>t.map(v=>({...v,hasDorkManifest:p(v)})),[t,p]),y=[...c].filter(v=>{const T=t.find(w=>w.path===v);return T&&!p(T)});return u.jsxs("div",{className:"space-y-4 p-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("button",{type:"button",onClick:()=>s(),disabled:n,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:[n?u.jsx(Qn,{className:"size-4 animate-spin"}):u.jsx(ZO,{className:"size-4"}),n?"Scanning...":"Scan"]}),r&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.scannedDirs," dirs scanned, ",r.foundAgents," agents found"]})]}),i&&u.jsx("p",{className:"text-sm text-destructive",children:i}),!n&&t.length===0&&r&&u.jsxs("div",{className:"rounded-xl border border-dashed p-6 text-center",children:[u.jsx("p",{className:"text-sm font-medium",children:"No agents found"}),u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Try scanning from a different directory or check your project structure."})]}),x.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"space-y-2",children:x.map(v=>u.jsx(VI,{candidate:v,selected:c.has(v.path),onToggle:()=>d(v.path)},v.path))}),y.length>0&&u.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:["Register ",y.length," agent",y.length>1?"s":""]})]})]})}function sie(){const e=rg(),{data:t,isLoading:n,isError:r,refetch:s}=_I(void 0,e),i=(t==null?void 0:t.agents)??[],{data:l,isLoading:c}=Fne(e),f=(l==null?void 0:l.denied)??[],[d,p]=b.useState(null),[m,x]=b.useState(""),[y,v]=b.useState("topology"),[T,w]=b.useState(""),[N,A]=b.useState(!1),[,k]=If(),R=b.useCallback(W=>{k(W)},[k]),D=b.useCallback((W,te)=>{p(W),x(te)},[]),O=b.useCallback((W,te)=>{w(te),A(!0)},[]),[M,I]=b.useState(!1),H=b.useMemo(()=>new Set(i.map(W=>W.name)),[i]),K=!(i.length>0)&&!n&&!r;if(!e)return u.jsx(VT,{icon:XO,name:"Mesh",description:"Mesh provides agent discovery and registry. Start DorkOS with mesh enabled.",command:"DORKOS_MESH_ENABLED=true dorkos"});if(r)return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[u.jsx("div",{className:"rounded-xl bg-destructive/10 p-3",children:u.jsx(fc,{className:"size-6 text-destructive"})}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium",children:"Could not load agents"}),u.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["The mesh API is unreachable. Check that the server is running with"," ",u.jsx("code",{className:"rounded bg-muted px-1 font-mono",children:"DORKOS_MESH_ENABLED=true"}),"."]})]}),u.jsx("button",{type:"button",onClick:()=>void s(),className:"mt-1 inline-flex items-center rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90",children:"Retry"})]});const Y=()=>v("discovery");return u.jsxs(u.Fragment,{children:[u.jsx(ft,{mode:"wait",initial:!1,children:K?u.jsx(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"flex h-full flex-col",children:u.jsx(r_,{fullBleed:!0})},"mode-a"):u.jsx(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"flex h-full flex-col",children:u.jsxs(oh,{value:y,onValueChange:v,className:"flex h-full flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Fae,{}),u.jsxs("button",{type:"button",onClick:()=>I(W=>!W),className:"mr-3 mt-1 inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground","aria-label":"Discover Agents",children:[u.jsx(ZO,{className:"size-3.5"}),"Discover Agents"]})]}),u.jsx(ft,{initial:!1,children:M&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden border-b",children:u.jsx(rie,{registeredNames:H})},"quick-discover")}),u.jsxs(Tc,{className:"mx-4 mt-3 shrink-0",children:[u.jsx(Gn,{value:"topology",children:"Topology"}),u.jsx(Gn,{value:"discovery",children:"Discovery"}),u.jsx(Gn,{value:"agents",children:"Agents"}),u.jsx(Gn,{value:"denied",children:"Denied"}),u.jsx(Gn,{value:"access",children:"Access"})]}),u.jsxs(Kn,{value:"topology",className:"relative flex-1 overflow-hidden",children:[u.jsx("div",{className:"absolute inset-0",children:u.jsx(b.Suspense,{fallback:u.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Loading topology..."}),children:u.jsx(Jae,{onSelectAgent:D,onOpenSettings:O,onOpenChat:R})})}),u.jsx(ft,{children:d&&u.jsx(De.div,{initial:{x:64,opacity:0},animate:{x:0,opacity:1},exit:{x:64,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"absolute right-0 top-0 bottom-0",children:u.jsx(Uae,{agentId:d,onClose:()=>p(null),onOpenSettings:m?()=>O(d,m):void 0})},d)})]}),u.jsx(Kn,{value:"discovery",className:"min-h-0 flex-1 overflow-y-auto",children:u.jsx(r_,{})}),u.jsx(Kn,{value:"agents",className:"min-h-0 flex-1 overflow-y-auto",children:u.jsx(eie,{agents:i,isLoading:n,onGoToDiscovery:Y})}),u.jsx(Kn,{value:"denied",className:"min-h-0 flex-1 overflow-y-auto",children:u.jsx(nie,{denied:f,isLoading:c})}),u.jsx(Kn,{value:"access",className:"min-h-0 flex-1 overflow-y-auto",children:u.jsx(qae,{onGoToDiscovery:Y})})]})},"mode-b")}),T&&u.jsx(UI,{projectPath:T,open:N,onOpenChange:A})]})}const Xy=["light","dark","system"];function Wy(){const e=He(),t=Qt(),{sessions:n,activeSessionId:r,setActiveSession:s}=$z(),{setSidebarOpen:i,devtoolsOpen:l,toggleDevtools:c,pickerOpen:f,setPickerOpen:d,settingsOpen:p,setSettingsOpen:m,pulseOpen:x,setPulseOpen:y,relayOpen:v,setRelayOpen:T,meshOpen:w,setMeshOpen:N}=Jt(),A=pl(),[k,R]=b.useState(null),[D,O]=b.useState(!1),M=lh(),I=rg(),[H,P]=If(),K=qT(),{data:Y=0}=fne(K),{unviewedCount:W,clearBadge:te}=pne(K),J=Jt(ke=>ke.enablePulseNotifications),{shouldShowOnboarding:L,dismiss:B}=uh(),[U,ne]=b.useState(null),{theme:z,setTheme:q}=gE(),V={light:PG,dark:oG,system:aG}[z],j=b.useCallback(()=>{const ke=Xy.indexOf(z);q(Xy[(ke+1)%Xy.length])},[z,q]);b.useEffect(()=>{!r&&n.length>0&&s(n[0].id)},[r,n,s]);const re=Nn({mutationFn:()=>e.createSession({permissionMode:"default",cwd:H??void 0}),onSuccess:ke=>{t.invalidateQueries({queryKey:["sessions",H]}),s(ke.id),R(ke.id),setTimeout(()=>R(null),Ns.NEW_SESSION_HIGHLIGHT_MS),A&&setTimeout(()=>i(!1),Ns.SIDEBAR_AUTO_CLOSE_MS)}}),ae=b.useCallback(ke=>{s(ke),A&&i(!1)},[A,s,i]);b.useEffect(()=>{x&&te()},[x,te]);const me=b.useRef(0);b.useEffect(()=>{J&&(W>me.current&&Cn("Pulse run completed",{description:"A scheduled run has finished.",duration:6e3,action:{label:"View history",onClick:()=>y(!0)}}),me.current=W)},[W,J,y]),b.useEffect(()=>{const ke=()=>{document.hidden?Lm(W):Lm(0)};return document.hidden&&W>0&&Lm(W),document.addEventListener("visibilitychange",ke),()=>{document.removeEventListener("visibilitychange",ke),Lm(0)}},[W]);const le=b.useMemo(()=>wz(n),[n]),{recentCwds:ye}=Jt(),ve=b.useMemo(()=>ye.map(ke=>ke.path),[ye]),{data:Re}=t4(ve);return u.jsxs("div",{"data-testid":"session-sidebar",className:"sidebar-container flex h-full flex-col p-3",children:[u.jsxs("div",{className:"mb-3 space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[H&&u.jsx("div",{className:"min-w-0 flex-1",children:u.jsx(Xne,{cwd:H,onOpenPicker:()=>d(!0),onOpenAgentDialog:()=>O(!0)})}),u.jsx("button",{onClick:()=>i(!1),className:"hover:bg-accent rounded-md p-2 transition-colors duration-150","aria-label":"Close sidebar",children:u.jsx(fG,{className:"text-muted-foreground size-(--size-icon-md)"})})]}),u.jsxs("button",{onClick:()=>re.mutate(),disabled:re.isPending,className:"border-border text-muted-foreground hover:bg-accent hover:text-foreground flex w-full items-center justify-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium transition-all duration-100 active:scale-[0.98] disabled:opacity-50",children:[u.jsx(eT,{className:"size-(--size-icon-sm)"}),"New chat"]})]}),u.jsx("div",{"data-testid":"session-list",className:"-mx-1 flex-1 overflow-y-auto px-1",children:le.length>0?u.jsx("div",{className:"space-y-5",children:le.map(ke=>{const $e=le.length===1&&ke.label==="Today";return u.jsxs("div",{children:[!$e&&u.jsx("h3",{className:"text-2xs text-muted-foreground/70 mb-1.5 px-3 font-medium tracking-wider uppercase",children:ke.label}),u.jsx("div",{className:"space-y-0.5",children:ke.sessions.map(Et=>u.jsx(Qne,{session:Et,isActive:Et.id===r,isNew:Et.id===k,onClick:()=>ae(Et.id)},Et.id))})]},ke.label)})}):u.jsx("div",{className:"flex h-32 items-center justify-center",children:u.jsx("p",{className:"text-muted-foreground/60 text-sm",children:"No conversations yet"})})}),L&&u.jsx("div",{className:"mt-2",children:u.jsx(Bae,{onStepClick:ke=>ne(ke),onDismiss:B})}),u.jsxs("div",{className:"border-border mt-2 flex items-center border-t pt-2",children:[u.jsx("a",{href:"https://dorkian.com",target:"_blank",rel:"noopener noreferrer",className:"text-2xs text-muted-foreground/50 hover:text-muted-foreground transition-colors duration-150",children:"DorkOS by Dorkian"}),u.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[u.jsx("button",{onClick:()=>m(!0),className:"text-muted-foreground/50 hover:text-muted-foreground rounded-md p-1 transition-colors duration-150 max-md:p-2","aria-label":"Settings",children:u.jsx(g0,{className:"size-(--size-icon-sm)"})}),u.jsxs(Jo,{children:[u.jsx(el,{asChild:!0,children:u.jsx("button",{onClick:()=>T(!0),className:Ee("rounded-md p-1 transition-colors duration-150 max-md:p-2",M?"text-muted-foreground/50 hover:text-muted-foreground":"text-muted-foreground/25 hover:text-muted-foreground/40"),"aria-label":"Relay messaging",children:u.jsx(Sp.relay,{className:"size-(--size-icon-sm)"})})}),!M&&u.jsx(tl,{side:"top",children:"Relay is disabled"})]}),u.jsxs(Jo,{children:[u.jsx(el,{asChild:!0,children:u.jsx("button",{onClick:()=>N(!0),className:Ee("rounded-md p-1 transition-colors duration-150 max-md:p-2",I?"text-muted-foreground/50 hover:text-muted-foreground":"text-muted-foreground/25 hover:text-muted-foreground/40"),"aria-label":"Mesh agent discovery",children:u.jsx(Sp.mesh,{className:"size-(--size-icon-sm)"})})}),!I&&u.jsx(tl,{side:"top",children:"Mesh is disabled"})]}),u.jsxs(Jo,{children:[u.jsx(el,{asChild:!0,children:u.jsxs("button",{onClick:()=>y(!0),className:Ee("relative rounded-md p-1 transition-colors duration-150 max-md:p-2",K?"text-muted-foreground/50 hover:text-muted-foreground":"text-muted-foreground/25 hover:text-muted-foreground/40"),"aria-label":"Pulse scheduler",children:[u.jsx(Sp.pulse,{className:"size-(--size-icon-sm)"}),Y>0&&u.jsx("span",{className:"absolute -right-0.5 -top-0.5 size-2 rounded-full bg-green-500 animate-pulse"}),Y===0&&W>0&&u.jsx("span",{className:"absolute -right-0.5 -top-0.5 size-2 rounded-full bg-amber-500"})]})}),!K&&u.jsx(tl,{side:"top",children:"Pulse is disabled"})]}),u.jsx("button",{onClick:j,className:"text-muted-foreground/50 hover:text-muted-foreground rounded-md p-1 transition-colors duration-150 max-md:p-2",title:`Theme: ${z}`,"aria-label":`Theme: ${z}. Click to cycle.`,children:u.jsx(V,{className:"size-(--size-icon-sm)"})}),!1]})]}),u.jsx(eg,{open:f,onOpenChange:d,onSelect:ke=>P(ke),initialPath:H,resolvedAgents:Re}),u.jsx(Bre,{open:p,onOpenChange:m}),u.jsx(ua,{open:x,onOpenChange:y,children:u.jsxs(ca,{className:"max-h-[85vh] max-w-2xl gap-0 p-0",children:[u.jsxs(da,{className:"border-b px-4 py-3",children:[u.jsx(fa,{className:"text-sm font-medium",children:"Pulse Scheduler"}),u.jsx(ha,{className:"sr-only",children:"Manage scheduled AI agent tasks"})]}),u.jsx("div",{className:"overflow-y-auto",children:u.jsx(dse,{})})]})}),u.jsx(ua,{open:v,onOpenChange:T,children:u.jsxs(ca,{className:"max-h-[85vh] max-w-2xl gap-0 p-0",children:[u.jsxs(da,{className:"border-b px-4 py-3",children:[u.jsx(fa,{className:"text-sm font-medium",children:"Relay"}),u.jsx(ha,{className:"sr-only",children:"Inter-agent messaging activity and endpoints"})]}),u.jsx("div",{className:"overflow-y-auto",children:u.jsx(cae,{})})]})}),u.jsx(ua,{open:w,onOpenChange:N,children:u.jsxs(ca,{className:"h-[85vh] max-w-2xl gap-0 p-0",children:[u.jsx(UT,{}),u.jsxs(da,{className:"border-b px-4 py-3",children:[u.jsx(fa,{className:"text-sm font-medium",children:"Mesh"}),u.jsx(ha,{className:"sr-only",children:"Agent discovery and registry"})]}),u.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:u.jsx(sie,{})})]})}),H&&u.jsx(UI,{projectPath:H,open:D,onOpenChange:O}),U!==null&&u.jsx("div",{className:"fixed inset-0 z-50 bg-background",children:u.jsx(qI,{initialStep:U,onComplete:()=>ne(null)})})]})}function GI(e){const t=[],n=[];for(const r of e)r.type==="text"?t.push(r.text):n.push({toolCallId:r.toolCallId,toolName:r.toolName,input:r.input||"",result:r.result,status:r.status,interactiveType:r.interactiveType,questions:r.questions,answers:r.answers});return{content:t.join(`
|
|
602
|
-
`),toolCalls:n}}function aie(e){const{currentPartsRef:t,assistantCreatedRef:n,sessionStatusRef:r,streamStartTimeRef:s,estimatedTokensRef:i,textStreamingTimerRef:l,isTextStreamingRef:c,setMessages:f,setError:d,setStatus:p,setSessionStatus:m,setEstimatedTokens:x,setStreamStartTime:y,setIsTextStreaming:v,sessionId:T,onTaskEventRef:w,onSessionIdChangeRef:N,onStreamingDoneRef:A}=e;function k(O){for(let M=t.current.length-1;M>=0;M--){const I=t.current[M];if(I.type==="tool_call"&&I.toolCallId===O)return I}}function R(O){n.current||(n.current=!0,f(M=>[...M,{id:O,role:"assistant",content:"",toolCalls:[],parts:[],timestamp:new Date().toISOString()}]))}function D(O){R(O);const M=t.current.map(H=>({...H})),I=GI(M);f(H=>H.map(P=>P.id===O?{...P,content:I.content,toolCalls:I.toolCalls.length>0?I.toolCalls:[],parts:M}:P))}return function(M,I,H){var P,K,Y,W,te,J,L;switch(M){case"text_delta":{const{text:B}=I,U=t.current,ne=U[U.length-1];ne&&ne.type==="text"?t.current=[...U.slice(0,-1),{...ne,text:ne.text+B}]:t.current=[...U,{type:"text",text:B}],i.current+=B.length/4,x(i.current),c.current||(c.current=!0,v(!0)),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{c.current=!1,v(!1)},500),D(H);break}case"tool_call_start":{const B=I;t.current.push({type:"tool_call",toolCallId:B.toolCallId,toolName:B.toolName,input:"",status:"running"}),D(H);break}case"tool_call_delta":{const B=I,U=k(B.toolCallId);U&&B.input&&(U.input=(U.input||"")+B.input),D(H);break}case"tool_call_end":{const U=k(I.toolCallId);U&&(U.status="complete"),D(H);break}case"tool_result":{const B=I,U=k(B.toolCallId);U&&(U.result=B.result,U.status="complete",U.interactiveType==="question"&&!U.answers&&(U.answers={})),D(H);break}case"approval_required":{const B=I,U=k(B.toolCallId);U?(U.interactiveType="approval",U.input=B.input,U.status="pending"):t.current.push({type:"tool_call",toolCallId:B.toolCallId,toolName:B.toolName,input:B.input,status:"pending",interactiveType:"approval"}),D(H);break}case"question_prompt":{const B=I,U=k(B.toolCallId);U?(U.interactiveType="question",U.questions=B.questions,U.status="pending"):t.current.push({type:"tool_call",toolCallId:B.toolCallId,toolName:"AskUserQuestion",input:"",status:"pending",interactiveType:"question",questions:B.questions}),D(H);break}case"error":{const{message:B}=I;d(B),p("error");break}case"session_status":{const B=I,U={...r.current,...B,model:B.model??((P=r.current)==null?void 0:P.model),costUsd:B.costUsd??((K=r.current)==null?void 0:K.costUsd),contextTokens:B.contextTokens??((Y=r.current)==null?void 0:Y.contextTokens),contextMaxTokens:B.contextMaxTokens??((W=r.current)==null?void 0:W.contextMaxTokens)};r.current=U,m(U);break}case"task_update":{const B=I;(te=w.current)==null||te.call(w,B);break}case"done":{const B=I;B.sessionId&&B.sessionId!==T&&((J=N.current)==null||J.call(N,B.sessionId)),s.current&&Date.now()-s.current>=Ns.MIN_STREAM_DURATION_MS&&((L=A.current)==null||L.call(A)),s.current=null,i.current=0,y(null),x(0),l.current&&clearTimeout(l.current),c.current=!1,v(!1),p("idle");break}}}}function s_(e){const t=e.parts?[...e.parts]:[];if(t.length===0&&(e.content&&t.push({type:"text",text:e.content}),e.toolCalls))for(const r of e.toolCalls)t.push({type:"tool_call",toolCallId:r.toolCallId,toolName:r.toolName,input:r.input,result:r.result,status:r.status,...r.questions?{interactiveType:"question",questions:r.questions,answers:r.answers}:{}});const n=GI(t);return{id:e.id,role:e.role,content:n.content,toolCalls:n.toolCalls.length>0?n.toolCalls:void 0,parts:t,timestamp:e.timestamp||"",messageType:e.messageType,commandName:e.commandName,commandArgs:e.commandArgs}}function iie(e,t={}){const n=He(),r=Qt(),s=Jt(pt=>pt.selectedCwd),i=lh(),l=b.useRef(crypto.randomUUID()),[c,f]=b.useState([]),[d,p]=b.useState(""),[m,x]=b.useState("idle"),[y,v]=b.useState(null),[T,w]=b.useState(!1),N=b.useRef(null),[A,k]=b.useState(null),R=b.useRef(null),D=b.useRef([]),O=b.useRef(""),M=b.useRef(!1),I=b.useRef(!1),H=b.useRef(null),P=b.useRef(0),[K,Y]=b.useState(null),[W,te]=b.useState(0),J=b.useRef(null),L=b.useRef(!1),[B,U]=b.useState(!1),ne=b.useRef(null),z=b.useRef(s),[q,V]=b.useState(!document.hidden),j=b.useRef(c);b.useEffect(()=>{j.current=c},[c]),b.useEffect(()=>{z.current=s},[s]),b.useEffect(()=>{const pt=()=>{V(!document.hidden)};return document.addEventListener("visibilitychange",pt),()=>{document.removeEventListener("visibilitychange",pt)}},[]);const re=m==="streaming",ae=b.useRef(t.onTaskEvent),me=b.useRef(t.onSessionIdChange),le=b.useRef(t.onStreamingDone),ye=b.useRef(t.transformContent);ae.current=t.onTaskEvent,me.current=t.onSessionIdChange,le.current=t.onStreamingDone,ye.current=t.transformContent;const ve=b.useMemo(()=>aie({currentPartsRef:D,assistantCreatedRef:M,sessionStatusRef:N,streamStartTimeRef:H,estimatedTokensRef:P,textStreamingTimerRef:J,isTextStreamingRef:L,setMessages:f,setError:v,setStatus:x,setSessionStatus:k,setEstimatedTokens:te,setStreamStartTime:Y,setIsTextStreaming:U,sessionId:e,onTaskEventRef:ae,onSessionIdChangeRef:me,onStreamingDoneRef:le}),[e]),Re=vt({queryKey:["messages",e,s],queryFn:()=>n.getMessages(e,s??void 0),staleTime:vs.MESSAGE_STALE_TIME_MS,refetchOnWindowFocus:!1,refetchInterval:()=>re?!1:q?vs.ACTIVE_TAB_REFETCH_MS:vs.BACKGROUND_TAB_REFETCH_MS});b.useEffect(()=>{I.current=!1,f([])},[e,s]),b.useEffect(()=>{if(!Re.data)return;const pt=Re.data.messages;if(!I.current&&pt.length>0){I.current=!0,f(pt.map(s_));return}if(I.current&&!re){const Tt=j.current,Ht=pt.slice(Tt.length);Ht.length>0&&f(cn=>[...cn,...Ht.map(s_)])}},[Re.data,re]),b.useEffect(()=>{if(!e||re&&!i)return;const pt=new URLSearchParams;i&&pt.set("clientId",l.current);const Tt=pt.toString(),Ht=`/api/sessions/${e}/stream${Tt?`?${Tt}`:""}`,cn=new EventSource(Ht);return cn.addEventListener("sync_update",()=>{r.invalidateQueries({queryKey:["messages",e,z.current]}),r.invalidateQueries({queryKey:["tasks",e,z.current]})}),cn.addEventListener("sync_connected",()=>{}),i&&(cn.addEventListener("relay_message",St=>{const dn=JSON.parse(St.data);ve(dn.payload.type,dn.payload.data,O.current)}),cn.addEventListener("relay_receipt",()=>{}),cn.addEventListener("message_delivered",()=>{})),()=>{cn.close()}},[e,re,r,i,ve]),b.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current)},[]);const ke=b.useCallback(async()=>{if(!d.trim()||m==="streaming")return;const pt=d.trim(),Tt={id:crypto.randomUUID(),role:"user",content:pt,parts:[{type:"text",text:pt}],timestamp:new Date().toISOString()};f(St=>[...St,Tt]),p(""),x("streaming"),v(null),D.current=[];const Ht=Date.now();H.current=Ht,P.current=0,Y(Ht),te(0),O.current=crypto.randomUUID(),M.current=!1;const cn=new AbortController;R.current=cn;try{const St=t.transformContent?await t.transformContent(Tt.content):Tt.content;i?await n.sendMessageRelay(e,St,{clientId:l.current}):(await n.sendMessage(e,St,dn=>ve(dn.type,dn.data,O.current),cn.signal,s??void 0),x("idle"))}catch(St){St.name!=="AbortError"&&(St.code==="SESSION_LOCKED"?(w(!0),p(Tt.content),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>{w(!1),ne.current=null},Ns.SESSION_BUSY_CLEAR_MS)):v(St.message),x("error")),J.current&&clearTimeout(J.current),L.current=!1,U(!1)}},[d,m,e,i,ve]),$e=b.useCallback(()=>{var pt;(pt=R.current)==null||pt.abort(),J.current&&clearTimeout(J.current),L.current=!1,U(!1),x("idle")},[]),Et=Re.isLoading,Xt=b.useMemo(()=>c.flatMap(pt=>pt.toolCalls||[]).filter(pt=>pt.interactiveType&&pt.status==="pending"),[c])[0]||null,un=Xt!==null,tn=(Xt==null?void 0:Xt.interactiveType)||null;return{messages:c,input:d,setInput:p,handleSubmit:ke,status:m,error:y,sessionBusy:T,stop:$e,isLoadingHistory:Et,sessionStatus:A,streamStartTime:K,estimatedTokens:W,isTextStreaming:B,isWaitingForUser:un,waitingType:tn,activeInteraction:Xt}}function oie(e){const t=He();return vt({queryKey:["commands",{cwd:e??null}],queryFn:()=>t.getCommands(!1,e??void 0),staleTime:vs.COMMANDS_STALE_TIME_MS,gcTime:vs.COMMANDS_GC_TIME_MS})}const a_={in_progress:0,pending:1,completed:2};function lie(e){return[...e].sort((t,n)=>a_[t.status]-a_[n.status])}function uie(e){const t={};for(const[n,r]of Object.entries(e))r!==void 0&&r!==""&&(t[n]=r);return t}const cie=10;function die(e){const t=He(),n=Jt(T=>T.selectedCwd),[r,s]=b.useState(new Map),[i,l]=b.useState(!1),c=b.useRef(1),{data:f}=vt({queryKey:["tasks",e,n],queryFn:()=>t.getTasks(e,n??void 0),staleTime:3e4,refetchOnWindowFocus:!1});b.useEffect(()=>{if(s(new Map),c.current=1,f&&f.tasks.length>0){const T=new Map;for(const w of f.tasks)T.set(w.id,w);s(T),c.current=f.tasks.length+1}},[f]);const d=b.useCallback(T=>{s(w=>{const N=new Map(w);if(T.action==="create"){const A=String(c.current++);N.set(A,{...T.task,id:A})}else if(T.action==="update"&&T.task.id){const A=N.get(T.task.id);A&&N.set(T.task.id,{...A,...uie(T.task)})}return N})},[]),p=b.useCallback(()=>{l(T=>!T)},[]),m=Array.from(r.values()),x=lie(m),y=m.find(T=>T.status==="in_progress"),v=(y==null?void 0:y.activeForm)??null;return{tasks:x.slice(0,cie),activeForm:v,isCollapsed:i,toggleCollapse:p,handleTaskEvent:d}}function fie({commands:e,input:t,cursorPos:n}){const[r,s]=b.useState(!1),[i,l]=b.useState(""),[c,f]=b.useState(0),[d,p]=b.useState(-1),m=b.useMemo(()=>i?e.map(A=>{const k=`${A.fullCommand} ${A.description}`,R=q5(i,k);return{cmd:A,...R}}).filter(A=>A.match).sort((A,k)=>k.score-A.score).map(A=>A.cmd):e,[e,i]);b.useEffect(()=>{f(0)},[i,r]),b.useEffect(()=>{m.length>0&&c>=m.length&&f(m.length-1)},[m.length,c]);const x=b.useCallback((A,k)=>{const D=A.slice(0,k).match(/(^|\s)\/([\w:-]*)$/);return D?(s(!0),l(D[2]),p((D.index??0)+D[1].length),!0):(s(!1),!1)},[]),y=b.useCallback(A=>{const k=t.slice(0,d);return s(!1),k+A.fullCommand+" "},[t,d]),v=b.useCallback(()=>{f(A=>m.length===0?0:(A+1)%m.length)},[m.length]),T=b.useCallback(()=>{f(A=>m.length===0?0:(A-1+m.length)%m.length)},[m.length]),w=b.useCallback(()=>m.length>0&&c<m.length?y(m[c]):(s(!1),null),[m,c,y]),N=b.useCallback(()=>{s(!1),l("")},[]);return{showCommands:r,setShowCommands:s,commandQuery:i,selectedIndex:c,filteredCommands:m,slashTriggerPos:d,detectCommandTrigger:x,handleCommandSelect:y,handleArrowUp:T,handleArrowDown:v,handleKeyboardSelect:w,resetCommand:N}}function hie({fileEntries:e,input:t,cursorPos:n}){const[r,s]=b.useState(!1),[i,l]=b.useState(""),[c,f]=b.useState(0),[d,p]=b.useState(-1),m=b.useMemo(()=>r?i?e.map(A=>({...A,...q5(i,A.path)})).filter(A=>A.match).sort((A,k)=>k.score-A.score).slice(0,50):e.slice(0,50).map(A=>({...A,indices:[]})):[],[e,i,r]);b.useEffect(()=>{f(0)},[i,r]),b.useEffect(()=>{m.length>0&&c>=m.length&&f(m.length-1)},[m.length,c]);const x=b.useCallback((A,k)=>{const D=A.slice(0,k).match(/(^|\s)@([\w./:-]*)$/);return D?(s(!0),l(D[2]),p((D.index??0)+D[1].length),!0):(s(!1),!1)},[]),y=b.useCallback(A=>{const k=t.slice(0,d),R=t.slice(d+1+i.length);if(A.isDirectory){const O=k+"@"+A.path+R,M=k.length+1+A.path.length;return l(A.path),f(0),{newValue:O,newCursorPos:M,keepOpen:!0}}const D=k+"@"+A.path+" "+R;return s(!1),{newValue:D,keepOpen:!1}},[t,d,i]),v=b.useCallback(()=>{f(A=>m.length===0?0:(A+1)%m.length)},[m.length]),T=b.useCallback(()=>{f(A=>m.length===0?0:(A-1+m.length)%m.length)},[m.length]),w=b.useCallback(()=>m.length>0&&c<m.length?y(m[c]):(s(!1),null),[m,c,y]),N=b.useCallback(()=>{s(!1),l("")},[]);return{showFiles:r,setShowFiles:s,fileQuery:i,fileSelectedIndex:c,filteredFiles:m,fileTriggerPos:d,detectFileTrigger:x,handleFileSelect:y,handleArrowUp:T,handleArrowDown:v,handleKeyboardSelect:w,resetFiles:N}}function yu(e,t,n){let r=n.initialDeps??[],s,i=!0;function l(){var c,f,d;let p;n.key&&((c=n.debug)!=null&&c.call(n))&&(p=Date.now());const m=e();if(!(m.length!==r.length||m.some((v,T)=>r[T]!==v)))return s;r=m;let y;if(n.key&&((f=n.debug)!=null&&f.call(n))&&(y=Date.now()),s=t(...m),n.key&&((d=n.debug)!=null&&d.call(n))){const v=Math.round((Date.now()-p)*100)/100,T=Math.round((Date.now()-y)*100)/100,w=T/16,N=(A,k)=>{for(A=String(A);A.length<k;)A=" "+A;return A};console.info(`%c⏱ ${N(T,5)} /${N(v,5)} ms`,`
|
|
603
|
-
font-size: .6rem;
|
|
604
|
-
font-weight: bold;
|
|
605
|
-
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(s),i=!1,s}return l.updateDeps=c=>{r=c},l}function i_(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const mie=(e,t)=>Math.abs(e-t)<1.01,pie=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},o_=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},gie=e=>e,xie=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=t;s<=n;s++)r.push(s);return r},yie=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=l=>{const{width:c,height:f}=l;t({width:Math.round(c),height:Math.round(f)})};if(s(o_(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(l=>{const c=()=>{const f=l[0];if(f!=null&&f.borderBoxSize){const d=f.borderBoxSize[0];if(d){s({width:d.inlineSize,height:d.blockSize});return}}s(o_(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},l_={passive:!0},u_=typeof window>"u"?!0:"onscrollend"in window,bie=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const i=e.options.useScrollendEvent&&u_?()=>{}:pie(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),l=p=>()=>{const{horizontal:m,isRtl:x}=e.options;s=m?n.scrollLeft*(x&&-1||1):n.scrollTop,i(),t(s,p)},c=l(!0),f=l(!1);n.addEventListener("scroll",c,l_);const d=e.options.useScrollendEvent&&u_;return d&&n.addEventListener("scrollend",f,l_),()=>{n.removeEventListener("scroll",c),d&&n.removeEventListener("scrollend",f)}},vie=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Eie=(e,{adjustments:t=0,behavior:n},r)=>{var s,i;const l=e+t;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:l,behavior:n})};class Tie{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const l=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:gie,rangeExtractor:xie,onChange:()=>{},measureElement:vie,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=yu(()=>(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.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}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(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},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.getFurthestMeasurement=(n,r)=>{const s=new Map,i=new Map;for(let l=r-1;l>=0;l--){const c=n[l];if(s.has(c.lane))continue;const f=i.get(c.lane);if(f==null||c.end>f.end?i.set(c.lane,c):c.end<f.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((l,c)=>l.end===c.end?l.index-c.index:l.end-c.end)[0]:void 0},this.getMeasurementOptions=yu(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,s,i,l,c)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:l,lanes:c}),{key:!1}),this.getMeasurements=yu(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:l,lanes:c},f)=>{if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,d),m=new Array(c).fill(void 0);for(let x=0;x<d;x++){const y=p[x];y&&(m[y.lane]=x)}for(let x=d;x<n;x++){const y=i(x),v=this.laneAssignments.get(x);let T,w;if(v!==void 0&&this.options.lanes>1){T=v;const R=m[T],D=R!==void 0?p[R]:void 0;w=D?D.end+this.options.gap:r+s}else{const R=this.options.lanes===1?p[x-1]:this.getFurthestMeasurement(p,x);w=R?R.end+this.options.gap:r+s,T=R?R.lane:x%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(x,T)}const N=f.get(y),A=typeof N=="number"?N:this.options.estimateSize(x),k=w+A;p[x]={index:x,start:w,size:A,end:k,key:y,lane:T},m[T]=x}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=yu(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,i)=>this.range=n.length>0&&r>0?Sie({measurements:n,outerSize:r,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=yu(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,i,l)=>i===null||l===null?[]:n({startIndex:i,endIndex:l,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const s=this.indexFromElement(n),i=this.measurementsCache[s];if(!i)return;const l=i.key,c=this.elementsCache.get(l);c!==n&&(c&&this.observer.unobserve(c),this.observer.observe(n),this.elementsCache.set(l,n)),n.isConnected&&this.resizeItem(s,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const s=this.measurementsCache[n];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,l=r-i;l!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,l,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=yu(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let i=0,l=n.length;i<l;i++){const c=n[i],f=r[c];s.push(f)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return i_(r[KI(0,r.length-1,s=>i_(r[s]).start,n)])},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.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();r==="auto"&&(r=n>=l+i?"end":"start"),r==="center"?n+=(s-i)/2:r==="end"&&(n-=i);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 s=this.measurementsCache[n];if(!s)return;const i=this.getSize(),l=this.getScrollOffset();if(r==="auto")if(s.end>=l+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const c=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(n,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let i=0;const l=10,c=d=>{if(!this.targetWindow)return;const p=this.getOffsetForIndex(n,d);if(!p){console.warn("Failed to get offset for index:",n);return}const[m,x]=p;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const y=()=>{if(this.currentScrollToIndex!==n)return;const v=this.getScrollOffset(),T=this.getOffsetForIndex(n,x);if(!T){console.warn("Failed to get offset for index:",n);return}mie(T[0],v)||f(x)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(y):y()})},f=d=>{this.targetWindow&&this.currentScrollToIndex===n&&(i++,i<l?this.targetWindow.requestAnimationFrame(()=>c(d)):console.warn(`Failed to scroll to index ${n} after ${l} attempts.`))};c(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let l=r.length-1;for(;l>=0&&i.some(c=>c===null);){const c=r[l];i[c.lane]===null&&(i[c.lane]=c.end),l--}s=Math.max(...i.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const KI=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,i=n(s);if(i<r)e=s+1;else if(i>r)t=s-1;else return s}return e>0?e-1:0};function Sie({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const s=e.length-1,i=f=>e[f].start;if(e.length<=r)return{startIndex:0,endIndex:s};let l=KI(0,s,i,n),c=l;if(r===1)for(;c<s&&e[c].end<n+t;)c++;else if(r>1){const f=Array(r).fill(0);for(;c<s&&f.some(p=>p<n+t);){const p=e[c];f[p.lane]=p.end,c++}const d=Array(r).fill(n+t);for(;l>=0&&d.some(p=>p>=n);){const p=e[l];d[p.lane]=p.start,l--}l=Math.max(0,l-l%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const c_=typeof document<"u"?b.useLayoutEffect:b.useEffect;function wie({useFlushSync:e=!0,...t}){const n=b.useReducer(()=>({}),{})[1],r={...t,onChange:(i,l)=>{var c;e&&l?ai.flushSync(n):n(),(c=t.onChange)==null||c.call(t,i,l)}},[s]=b.useState(()=>new Tie(r));return s.setOptions(r),c_(()=>s._didMount(),[]),c_(()=>s._willUpdate()),s}function Cie(e){return wie({observeElementRect:yie,observeElementOffset:bie,scrollToFn:Eie,...e})}const sg=(function(e){if(e==null)return _ie;if(typeof e=="function")return ag(e);if(typeof e=="object")return Array.isArray(e)?Nie(e):Aie(e);if(typeof e=="string")return kie(e);throw new Error("Expected function, string, or object as test")});function Nie(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=sg(e[n]);return ag(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function Aie(e){const t=e;return ag(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function kie(e){return ag(t);function t(n){return n&&n.type===e}}function ag(e){return t;function t(n,r,s){return!!(Rie(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function _ie(){return!0}function Rie(e){return e!==null&&typeof e=="object"&&"type"in e}const QI=[],Ud=!0,Iv=!1,Ru="skip";function e2(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=sg(s),l=r?-1:1;c(e,void 0,[])();function c(f,d,p){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const y=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return x;function x(){let y=QI,v,T,w;if((!t||i(f,d,p[p.length-1]||void 0))&&(y=Oie(n(f,p)),y[0]===Iv))return y;if("children"in f&&f.children){const N=f;if(N.children&&y[0]!==Ru)for(T=(r?N.children.length:-1)+l,w=p.concat(N);T>-1&&T<N.children.length;){const A=N.children[T];if(v=c(A,T,w)(),v[0]===Iv)return v;T=typeof v[1]=="number"?v[1]:T+l}}return y}}}function Oie(e){return Array.isArray(e)?e:typeof e=="number"?[Ud,e]:e==null?QI:[e]}function io(e,t,n,r){let s,i,l;typeof t=="function"&&typeof n!="function"?(i=void 0,l=t,s=n):(i=t,l=n,s=r),e2(e,i,c,s);function c(f,d){const p=d[d.length-1],m=p?p.children.indexOf(f):void 0;return l(f,m,p)}}const tc={indicator:"indicator",textOnly:"text-only",remove:"remove"};function Die({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:s=[],blockedImageClass:i="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=tc.indicator,imageBlockPolicy:f=tc.indicator}){const d=t.length&&!t.every(m=>m==="*"),p=n.length&&!n.every(m=>m==="*");if(!e&&(d||p))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return m=>{const x=Bie(e,t,n,r,s,i,l,c,f);XI(m),io(m,x)}}function d_(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 jie(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const Mie=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),Iie=new Set(["javascript:","data:","file:","vbscript:"]);function f_(e,t,n,r=!1,s=!1,i=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!s)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return s&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const l=d_(e,n);if(!l||Iie.has(l.protocol)||!(Mie.has(l.protocol)||i.includes(l.protocol)||i.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;const f=jie(e);return l&&t.some(d=>{const p=d_(d,n);return!p||p.origin!==l.origin?!1:l.href.startsWith(p.href)})?f?l.pathname+l.search+l.hash:l.href:t.includes("*")?l.protocol!=="https:"&&l.protocol!=="http:"?null:f?l.pathname+l.search+l.hash:l.href:null}function XI(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)XI(t)}}const Zy=Symbol("node-seen");function Lie(e,t,n){return t===tc.remove?{type:"remove"}:t===tc.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 Pie(e,t,n){if(t===tc.remove)return{type:"remove"};if(t===tc.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 Bie=(e,t,n,r,s,i,l,c,f)=>{const d=(p,m,x)=>{if(p.type!=="element"||p[Zy])return Ud;if(p.tagName==="a"){const y=f_(p.properties.href,t,e,!1,!1,s);if(y===null){if(p[Zy]=!0,io(p,d),x&&typeof m=="number"){const v=Lie(p,c,l);if(v.type==="remove")return x.children.splice(m,1),[Ru,m];x.children[m]=v.element}return Ru}else return p.properties.href=y,p.properties.target="_blank",p.properties.rel="noopener noreferrer",Ud}if(p.tagName==="img"){const y=f_(p.properties.src,n,e,r,!0,s);if(y===null){if(p[Zy]=!0,io(p,d),x&&typeof m=="number"){const v=Pie(p,f,i);if(v.type==="remove")return x.children.splice(m,1),[Ru,m];x.children[m]=v.element}return Ru}else return p.properties.src=y,Ud}return Ud};return d},WI=-1,ig=0,Qd=1,t0=2,t2=3,n2=4,r2=5,s2=6,ZI=7,JI=8,h_=typeof self=="object"?self:globalThis,Fie=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,l]=t[s];switch(i){case ig:case WI:return n(l,s);case Qd:{const c=n([],s);for(const f of l)c.push(r(f));return c}case t0:{const c=n({},s);for(const[f,d]of l)c[r(f)]=r(d);return c}case t2:return n(new Date(l),s);case n2:{const{source:c,flags:f}=l;return n(new RegExp(c,f),s)}case r2:{const c=n(new Map,s);for(const[f,d]of l)c.set(r(f),r(d));return c}case s2:{const c=n(new Set,s);for(const f of l)c.add(r(f));return c}case ZI:{const{name:c,message:f}=l;return n(new h_[c](f),s)}case JI:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new h_[i](l),s)};return r},m_=e=>Fie(new Map,e)(0),bu="",{toString:zie}={},{keys:Uie}=Object,kd=e=>{const t=typeof e;if(t!=="object"||!e)return[ig,t];const n=zie.call(e).slice(8,-1);switch(n){case"Array":return[Qd,bu];case"Object":return[t0,bu];case"Date":return[t2,bu];case"RegExp":return[n2,bu];case"Map":return[r2,bu];case"Set":return[s2,bu];case"DataView":return[Qd,n]}return n.includes("Array")?[Qd,n]:n.includes("Error")?[ZI,n]:[t0,n]},rp=([e,t])=>e===ig&&(t==="function"||t==="symbol"),Hie=(e,t,n,r)=>{const s=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},i=l=>{if(n.has(l))return n.get(l);let[c,f]=kd(l);switch(c){case ig:{let p=l;switch(f){case"bigint":c=JI,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return s([WI],l)}return s([c,p],l)}case Qd:{if(f){let x=l;return f==="DataView"?x=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(l)),s([f,[...x]],l)}const p=[],m=s([c,p],l);for(const x of l)p.push(i(x));return m}case t0:{if(f)switch(f){case"BigInt":return s([f,l.toString()],l);case"Boolean":case"Number":case"String":return s([f,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const p=[],m=s([c,p],l);for(const x of Uie(l))(e||!rp(kd(l[x])))&&p.push([i(x),i(l[x])]);return m}case t2:return s([c,l.toISOString()],l);case n2:{const{source:p,flags:m}=l;return s([c,{source:p,flags:m}],l)}case r2:{const p=[],m=s([c,p],l);for(const[x,y]of l)(e||!(rp(kd(x))||rp(kd(y))))&&p.push([i(x),i(y)]);return m}case s2:{const p=[],m=s([c,p],l);for(const x of l)(e||!rp(kd(x)))&&p.push(i(x));return m}}const{message:d}=l;return s([c,{name:f,message:d}],l)};return i},p_=(e,{json:t,lossy:n}={})=>{const r=[];return Hie(!(t||n),!!t,new Map,r)(e),r},dl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?m_(p_(e,t)):structuredClone(e):(e,t)=>m_(p_(e,t));class ch{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ch.prototype.normal={};ch.prototype.property={};ch.prototype.space=void 0;function eL(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ch(n,r,t)}function Tf(e){return e.toLowerCase()}class $r{constructor(t,n){this.attribute=n,this.property=t}}$r.prototype.attribute="";$r.prototype.booleanish=!1;$r.prototype.boolean=!1;$r.prototype.commaOrSpaceSeparated=!1;$r.prototype.commaSeparated=!1;$r.prototype.defined=!1;$r.prototype.mustUseProperty=!1;$r.prototype.number=!1;$r.prototype.overloadedBoolean=!1;$r.prototype.property="";$r.prototype.spaceSeparated=!1;$r.prototype.space=void 0;let $ie=0;const ut=El(),Pn=El(),Lv=El(),Ce=El(),rn=El(),Pu=El(),Wr=El();function El(){return 2**++$ie}const Pv=Object.freeze(Object.defineProperty({__proto__:null,boolean:ut,booleanish:Pn,commaOrSpaceSeparated:Wr,commaSeparated:Pu,number:Ce,overloadedBoolean:Lv,spaceSeparated:rn},Symbol.toStringTag,{value:"Module"})),Jy=Object.keys(Pv);class a2 extends $r{constructor(t,n,r,s){let i=-1;if(super(t,n),g_(this,"space",s),typeof r=="number")for(;++i<Jy.length;){const l=Jy[i];g_(this,Jy[i],(r&Pv[l])===Pv[l])}}}a2.prototype.defined=!0;function g_(e,t,n){n&&(e[t]=n)}function Sc(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new a2(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Tf(r)]=r,n[Tf(i.attribute)]=r}return new ch(t,n,e.space)}const tL=Sc({properties:{ariaActiveDescendant:null,ariaAtomic:Pn,ariaAutoComplete:null,ariaBusy:Pn,ariaChecked:Pn,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:rn,ariaCurrent:null,ariaDescribedBy:rn,ariaDetails:null,ariaDisabled:Pn,ariaDropEffect:rn,ariaErrorMessage:null,ariaExpanded:Pn,ariaFlowTo:rn,ariaGrabbed:Pn,ariaHasPopup:null,ariaHidden:Pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rn,ariaLevel:Ce,ariaLive:null,ariaModal:Pn,ariaMultiLine:Pn,ariaMultiSelectable:Pn,ariaOrientation:null,ariaOwns:rn,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:Pn,ariaReadOnly:Pn,ariaRelevant:null,ariaRequired:Pn,ariaRoleDescription:rn,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:Pn,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function nL(e,t){return t in e?e[t]:t}function rL(e,t){return nL(e,t.toLowerCase())}const Vie=Sc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pu,acceptCharset:rn,accessKey:rn,action:null,allow:null,allowFullScreen:ut,allowPaymentRequest:ut,allowUserMedia:ut,alt:null,as:null,async:ut,autoCapitalize:null,autoComplete:rn,autoFocus:ut,autoPlay:ut,blocking:rn,capture:null,charSet:null,checked:ut,cite:null,className:rn,cols:Ce,colSpan:null,content:null,contentEditable:Pn,controls:ut,controlsList:rn,coords:Ce|Pu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ut,defer:ut,dir:null,dirName:null,disabled:ut,download:Lv,draggable:Pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ut,formTarget:null,headers:rn,height:Ce,hidden:Lv,high:Ce,href:null,hrefLang:null,htmlFor:rn,httpEquiv:rn,id:null,imageSizes:null,imageSrcSet:null,inert:ut,inputMode:null,integrity:null,is:null,isMap:ut,itemId:null,itemProp:rn,itemRef:rn,itemScope:ut,itemType:rn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ut,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:ut,muted:ut,name:null,nonce:null,noModule:ut,noValidate:ut,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:ut,optimum:Ce,pattern:null,ping:rn,placeholder:null,playsInline:ut,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ut,referrerPolicy:null,rel:rn,required:ut,reversed:ut,rows:Ce,rowSpan:Ce,sandbox:rn,scope:null,scoped:ut,seamless:ut,selected:ut,shadowRootClonable:ut,shadowRootDelegatesFocus:ut,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:Pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:ut,useMap:null,value:Pn,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rn,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ut,declare:ut,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:ut,noHref:ut,noShade:ut,noWrap:ut,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:Pn,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ut,disableRemotePlayback:ut,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:rL}),qie=Sc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Wr,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:rn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:ut,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,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:Pu,g2:Pu,glyphName:Pu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:Wr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,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:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wr,rev:Wr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wr,requiredFeatures:Wr,requiredFonts:Wr,requiredFormats:Wr,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:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:Wr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wr,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nL}),sL=Sc({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()}}),aL=Sc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rL}),iL=Sc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Yie={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"},Gie=/[A-Z]/g,x_=/-[a-z]/g,Kie=/^data[-\w.:]+$/i;function og(e,t){const n=Tf(t);let r=t,s=$r;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Kie.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(x_,Xie);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!x_.test(i)){let l=i.replace(Gie,Qie);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=a2}return new s(r,t)}function Qie(e){return"-"+e.toLowerCase()}function Xie(e){return e.charAt(1).toUpperCase()}const dh=eL([tL,Vie,sL,aL,iL],"html"),ho=eL([tL,qie,sL,aL,iL],"svg");function y_(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const l=n.slice(s,r).trim();(l||!i)&&t.push(l),s=r+1,r=n.indexOf(",",s)}return t}function oL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const b_=/[#.]/g;function Wie(e,t){const n=e||"",r={};let s=0,i,l;for(;s<n.length;){b_.lastIndex=s;const c=b_.exec(n),f=n.slice(s,c?c.index:n.length);f&&(i?i==="#"?r.id=f:Array.isArray(r.className)?r.className.push(f):r.className=[f]:l=f,s+=f.length),c&&(i=c[0],s++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function v_(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function lL(e){return e.join(" ").trim()}function uL(e,t,n){const r=n?toe(n):void 0;function s(i,l,...c){let f;if(i==null){f={type:"root",children:[]};const d=l;c.unshift(d)}else{f=Wie(i,t);const d=f.tagName.toLowerCase(),p=r?r.get(d):void 0;if(f.tagName=p||d,Zie(l))c.unshift(l);else for(const[m,x]of Object.entries(l))Jie(e,f.properties,m,x)}for(const d of c)Bv(f.children,d);return f.type==="element"&&f.tagName==="template"&&(f.content={type:"root",children:f.children},f.children=[]),f}return s}function Zie(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const l of i)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Jie(e,t,n,r){const s=og(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=v_(r):s.commaSeparated?i=y_(r):s.commaOrSpaceSeparated?i=v_(y_(r).join(" ")):i=E_(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?eoe(r):String(r);if(Array.isArray(i)){const l=[];for(const c of i)l.push(E_(s,s.property,c));i=l}s.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[s.property]=i}}function Bv(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)Bv(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Bv(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function E_(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Tf(n)===Tf(t)))return!0}return n}function eoe(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function toe(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const noe=["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"],roe=uL(dh,"div"),soe=uL(ho,"g",noe);function aoe(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const f=T_(t,n[l-1]);c=f===-1?t.length+1:f+1,n[l]=c}if(c>i)return{line:l+1,column:i-(l>0?n[l-1]:0)+1,offset:i};l++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const c=n[n.length-1],f=T_(t,c),d=f===-1?t.length+1:f+1;if(c===d)break;n.push(d)}const l=(i.line>1?n[i.line-2]:0)+i.column-1;if(l<n[i.line-1])return l}}}function T_(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
606
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Uo={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/"},cL={}.hasOwnProperty,ioe=Object.prototype;function ooe(e,t){const n=t||{};return i2({file:n.file||void 0,location:!1,schema:n.space==="svg"?ho:dh,verbose:n.verbose||!1},e)}function i2(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},wp(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:dL(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const i=String(e.file),l=aoe(i),c=l.toPoint(0),f=l.toPoint(i.length);n.position={start:c,end:f}}return n}case"#documentType":{const r=t;return n={type:"doctype"},wp(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},wp(e,r,n),n}default:return n=loe(e,t),n}}function dL(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=i2(e,t[n]);r.push(s)}return r}function loe(e,t){const n=e.schema;e.schema=t.namespaceURI===Uo.svg?ho:dh;let r=-1;const s={};for(;++r<t.attrs.length;){const c=t.attrs[r],f=(c.prefix?c.prefix+":":"")+c.name;cL.call(ioe,f)||(s[f]=c.value)}const l=(e.schema.space==="svg"?soe:roe)(t.tagName,s,dL(e,t.childNodes));if(wp(e,t,l),l.tagName==="template"){const c=t,f=c.sourceCodeLocation,d=f&&f.startTag&&Ou(f.startTag),p=f&&f.endTag&&Ou(f.endTag),m=i2(e,c.content);d&&p&&e.file&&(m.position={start:d.end,end:p.start}),l.content=m}return e.schema=n,l}function wp(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=uoe(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function uoe(e,t,n){const r=Ou(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const i={};let l;if(n.attrs)for(l in n.attrs)cL.call(n.attrs,l)&&(i[og(e.schema,l).property]=Ou(n.attrs[l]));n.startTag;const c=Ou(n.startTag),f=n.endTag?Ou(n.endTag):void 0,d={opening:c};f&&(d.closing=f),d.properties=i,t.data={position:d}}}return r}function Ou(e){const t=S_({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=S_({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function S_(e){return e.line&&e.column?e:void 0}const w_={}.hasOwnProperty;function fL(e,t){const n=t||{};function r(s,...i){let l=r.invalid;const c=r.handlers;if(s&&w_.call(s,e)){const f=String(s[e]);l=w_.call(c,f)?c[f]:r.unknown}if(l)return l.call(this,s,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const coe={},doe={}.hasOwnProperty,hL=fL("type",{handlers:{root:hoe,element:yoe,text:goe,comment:xoe,doctype:poe}});function foe(e,t){const r=(t||coe).space;return hL(e,r==="svg"?ho:dh)}function hoe(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=o2(e.children,n,t),wc(e,n),n}function moe(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=o2(e.children,n,t),wc(e,n),n}function poe(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return wc(e,t),t}function goe(e){const t={nodeName:"#text",value:e.value,parentNode:null};return wc(e,t),t}function xoe(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return wc(e,t),t}function yoe(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ho);const s=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&doe.call(e.properties,i)){const f=boe(r,i,e.properties[i]);f&&s.push(f)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:Uo[l],childNodes:[],parentNode:null};return c.childNodes=o2(e.children,c,r),wc(e,c),e.tagName==="template"&&e.content&&(c.content=moe(e.content,r)),c}function boe(e,t,n){const r=og(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?oL(n):lL(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=s.name.indexOf(":");i<0?s.prefix="":(s.name=s.name.slice(i+1),s.prefix=r.attribute.slice(0,i)),s.namespace=Uo[r.space]}return s}function o2(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const i=hL(e[r],n);i.parentNode=t,s.push(i)}return s}function wc(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 voe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Eoe=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),mn="�";var $;(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"})($||($={}));const Br={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function mL(e){return e>=55296&&e<=57343}function Toe(e){return e>=56320&&e<=57343}function Soe(e,t){return(e-55296)*1024+9216+t}function pL(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function gL(e){return e>=64976&&e<=65007||Eoe.has(e)}var he;(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"})(he||(he={}));const woe=65536;class Coe{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=woe,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:i}=this,l=s+n,c=i+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(Toe(n))return this.pos++,this._addGap(),Soe(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(he.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,$.EOF;const r=this.html.charCodeAt(n);return r===$.CARRIAGE_RETURN?$.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,$.EOF;let t=this.html.charCodeAt(this.pos);return t===$.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,$.LINE_FEED):t===$.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,mL(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===$.LINE_FEED||t===$.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){pL(t)?this._err(he.controlCharacterInInputStream):gL(t)&&this._err(he.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ht;(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"})(ht||(ht={}));function xL(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 Noe=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୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢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;怳Ādpuct;戏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ǣጓ\0y;䐎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Ā;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀ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Ā;elƀ;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\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»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ↄⅪ←ٖ↛ǰ↉\0proø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;䅓Ācrir;榿;쀀𝔬ͯ\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\0m;櫳;櫽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))),Aoe=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 koe(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Aoe.get(e))!==null&&t!==void 0?t:e}var tr;(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"})(tr||(tr={}));const _oe=32;var Wi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Wi||(Wi={}));function Fv(e){return e>=tr.ZERO&&e<=tr.NINE}function Roe(e){return e>=tr.UPPER_A&&e<=tr.UPPER_F||e>=tr.LOWER_A&&e<=tr.LOWER_F}function Ooe(e){return e>=tr.UPPER_A&&e<=tr.UPPER_Z||e>=tr.LOWER_A&&e<=tr.LOWER_Z||Fv(e)}function Doe(e){return e===tr.EQUALS||Ooe(e)}var Jn;(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"})(Jn||(Jn={}));var Za;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Za||(Za={}));class joe{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Jn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Za.Strict}startEntity(t){this.decodeMode=t,this.state=Jn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Jn.EntityStart:return t.charCodeAt(n)===tr.NUM?(this.state=Jn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Jn.NamedEntity,this.stateNamedEntity(t,n));case Jn.NumericStart:return this.stateNumericStart(t,n);case Jn.NumericDecimal:return this.stateNumericDecimal(t,n);case Jn.NumericHex:return this.stateNumericHex(t,n);case Jn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|_oe)===tr.LOWER_X?(this.state=Jn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Jn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(t.substr(n,i),s),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Fv(s)||Roe(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Fv(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===tr.SEMI)this.consumed+=1;else if(this.decodeMode===Za.Strict)return 0;return this.emitCodePoint(koe(this.result),this.consumed),this.errors&&(t!==tr.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],i=(s&Wi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=Moe(r,s,this.treeIndex+Math.max(1,i),l),this.treeIndex<0)return this.result===0||this.decodeMode===Za.Attribute&&(i===0||Doe(l))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],i=(s&Wi.VALUE_LENGTH)>>14,i!==0){if(l===tr.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Za.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&Wi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~Wi.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Jn.NamedEntity:return this.result!==0&&(this.decodeMode!==Za.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Jn.NumericDecimal:return this.emitNumericEntity(0,2);case Jn.NumericHex:return this.emitNumericEntity(0,3);case Jn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Jn.EntityStart:return 0}}}function Moe(e,t,n,r){const s=(t&Wi.BRANCH_LENGTH)>>7,i=t&Wi.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const f=r-i;return f<0||f>=s?-1:e[n+f]-1}let l=n,c=l+s-1;for(;l<=c;){const f=l+c>>>1,d=e[f];if(d<r)l=f+1;else if(d>r)c=f-1;else return e[f+s]}return-1}var Te;(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/"})(Te||(Te={}));var nl;(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"})(nl||(nl={}));var gs;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(gs||(gs={}));var ie;(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"})(ie||(ie={}));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 Ioe=new Map([[ie.A,C.A],[ie.ADDRESS,C.ADDRESS],[ie.ANNOTATION_XML,C.ANNOTATION_XML],[ie.APPLET,C.APPLET],[ie.AREA,C.AREA],[ie.ARTICLE,C.ARTICLE],[ie.ASIDE,C.ASIDE],[ie.B,C.B],[ie.BASE,C.BASE],[ie.BASEFONT,C.BASEFONT],[ie.BGSOUND,C.BGSOUND],[ie.BIG,C.BIG],[ie.BLOCKQUOTE,C.BLOCKQUOTE],[ie.BODY,C.BODY],[ie.BR,C.BR],[ie.BUTTON,C.BUTTON],[ie.CAPTION,C.CAPTION],[ie.CENTER,C.CENTER],[ie.CODE,C.CODE],[ie.COL,C.COL],[ie.COLGROUP,C.COLGROUP],[ie.DD,C.DD],[ie.DESC,C.DESC],[ie.DETAILS,C.DETAILS],[ie.DIALOG,C.DIALOG],[ie.DIR,C.DIR],[ie.DIV,C.DIV],[ie.DL,C.DL],[ie.DT,C.DT],[ie.EM,C.EM],[ie.EMBED,C.EMBED],[ie.FIELDSET,C.FIELDSET],[ie.FIGCAPTION,C.FIGCAPTION],[ie.FIGURE,C.FIGURE],[ie.FONT,C.FONT],[ie.FOOTER,C.FOOTER],[ie.FOREIGN_OBJECT,C.FOREIGN_OBJECT],[ie.FORM,C.FORM],[ie.FRAME,C.FRAME],[ie.FRAMESET,C.FRAMESET],[ie.H1,C.H1],[ie.H2,C.H2],[ie.H3,C.H3],[ie.H4,C.H4],[ie.H5,C.H5],[ie.H6,C.H6],[ie.HEAD,C.HEAD],[ie.HEADER,C.HEADER],[ie.HGROUP,C.HGROUP],[ie.HR,C.HR],[ie.HTML,C.HTML],[ie.I,C.I],[ie.IMG,C.IMG],[ie.IMAGE,C.IMAGE],[ie.INPUT,C.INPUT],[ie.IFRAME,C.IFRAME],[ie.KEYGEN,C.KEYGEN],[ie.LABEL,C.LABEL],[ie.LI,C.LI],[ie.LINK,C.LINK],[ie.LISTING,C.LISTING],[ie.MAIN,C.MAIN],[ie.MALIGNMARK,C.MALIGNMARK],[ie.MARQUEE,C.MARQUEE],[ie.MATH,C.MATH],[ie.MENU,C.MENU],[ie.META,C.META],[ie.MGLYPH,C.MGLYPH],[ie.MI,C.MI],[ie.MO,C.MO],[ie.MN,C.MN],[ie.MS,C.MS],[ie.MTEXT,C.MTEXT],[ie.NAV,C.NAV],[ie.NOBR,C.NOBR],[ie.NOFRAMES,C.NOFRAMES],[ie.NOEMBED,C.NOEMBED],[ie.NOSCRIPT,C.NOSCRIPT],[ie.OBJECT,C.OBJECT],[ie.OL,C.OL],[ie.OPTGROUP,C.OPTGROUP],[ie.OPTION,C.OPTION],[ie.P,C.P],[ie.PARAM,C.PARAM],[ie.PLAINTEXT,C.PLAINTEXT],[ie.PRE,C.PRE],[ie.RB,C.RB],[ie.RP,C.RP],[ie.RT,C.RT],[ie.RTC,C.RTC],[ie.RUBY,C.RUBY],[ie.S,C.S],[ie.SCRIPT,C.SCRIPT],[ie.SEARCH,C.SEARCH],[ie.SECTION,C.SECTION],[ie.SELECT,C.SELECT],[ie.SOURCE,C.SOURCE],[ie.SMALL,C.SMALL],[ie.SPAN,C.SPAN],[ie.STRIKE,C.STRIKE],[ie.STRONG,C.STRONG],[ie.STYLE,C.STYLE],[ie.SUB,C.SUB],[ie.SUMMARY,C.SUMMARY],[ie.SUP,C.SUP],[ie.TABLE,C.TABLE],[ie.TBODY,C.TBODY],[ie.TEMPLATE,C.TEMPLATE],[ie.TEXTAREA,C.TEXTAREA],[ie.TFOOT,C.TFOOT],[ie.TD,C.TD],[ie.TH,C.TH],[ie.THEAD,C.THEAD],[ie.TITLE,C.TITLE],[ie.TR,C.TR],[ie.TRACK,C.TRACK],[ie.TT,C.TT],[ie.U,C.U],[ie.UL,C.UL],[ie.SVG,C.SVG],[ie.VAR,C.VAR],[ie.WBR,C.WBR],[ie.XMP,C.XMP]]);function Cc(e){var t;return(t=Ioe.get(e))!==null&&t!==void 0?t:C.UNKNOWN}const we=C,Loe={[Te.HTML]:new Set([we.ADDRESS,we.APPLET,we.AREA,we.ARTICLE,we.ASIDE,we.BASE,we.BASEFONT,we.BGSOUND,we.BLOCKQUOTE,we.BODY,we.BR,we.BUTTON,we.CAPTION,we.CENTER,we.COL,we.COLGROUP,we.DD,we.DETAILS,we.DIR,we.DIV,we.DL,we.DT,we.EMBED,we.FIELDSET,we.FIGCAPTION,we.FIGURE,we.FOOTER,we.FORM,we.FRAME,we.FRAMESET,we.H1,we.H2,we.H3,we.H4,we.H5,we.H6,we.HEAD,we.HEADER,we.HGROUP,we.HR,we.HTML,we.IFRAME,we.IMG,we.INPUT,we.LI,we.LINK,we.LISTING,we.MAIN,we.MARQUEE,we.MENU,we.META,we.NAV,we.NOEMBED,we.NOFRAMES,we.NOSCRIPT,we.OBJECT,we.OL,we.P,we.PARAM,we.PLAINTEXT,we.PRE,we.SCRIPT,we.SECTION,we.SELECT,we.SOURCE,we.STYLE,we.SUMMARY,we.TABLE,we.TBODY,we.TD,we.TEMPLATE,we.TEXTAREA,we.TFOOT,we.TH,we.THEAD,we.TITLE,we.TR,we.TRACK,we.UL,we.WBR,we.XMP]),[Te.MATHML]:new Set([we.MI,we.MO,we.MN,we.MS,we.MTEXT,we.ANNOTATION_XML]),[Te.SVG]:new Set([we.TITLE,we.FOREIGN_OBJECT,we.DESC]),[Te.XLINK]:new Set,[Te.XML]:new Set,[Te.XMLNS]:new Set},zv=new Set([we.H1,we.H2,we.H3,we.H4,we.H5,we.H6]);ie.STYLE,ie.SCRIPT,ie.XMP,ie.IFRAME,ie.NOEMBED,ie.NOFRAMES,ie.PLAINTEXT;var G;(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"})(G||(G={}));const On={DATA:G.DATA,RCDATA:G.RCDATA,RAWTEXT:G.RAWTEXT,SCRIPT_DATA:G.SCRIPT_DATA,PLAINTEXT:G.PLAINTEXT,CDATA_SECTION:G.CDATA_SECTION};function Poe(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function Hd(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function Boe(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function Bi(e){return Boe(e)||Hd(e)}function C_(e){return Bi(e)||Poe(e)}function sp(e){return e+32}function yL(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function N_(e){return yL(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function Foe(e){return e===$.NULL?he.nullCharacterReference:e>1114111?he.characterReferenceOutsideUnicodeRange:mL(e)?he.surrogateCharacterReference:gL(e)?he.noncharacterCharacterReference:pL(e)||e===$.CARRIAGE_RETURN?he.controlCharacterReference:null}class zoe{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=G.DATA,this.returnState=G.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Coe(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new joe(Noe,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(he.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(he.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=Foe(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||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:ht.START_TAG,tagName:"",tagID:C.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ht.END_TAG,tagName:"",tagID:C.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:ht.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:ht.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(xL(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(he.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=Cc(t.tagName),t.type===ht.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(he.endTagWithAttributes),t.selfClosing&&this._err(he.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 ht.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ht.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ht.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:ht.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=yL(t)?ht.WHITESPACE_CHARACTER:t===$.NULL?ht.NULL_CHARACTER:ht.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(ht.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=G.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Za.Attribute:Za.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===G.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===G.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===G.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case G.DATA:{this._stateData(t);break}case G.RCDATA:{this._stateRcdata(t);break}case G.RAWTEXT:{this._stateRawtext(t);break}case G.SCRIPT_DATA:{this._stateScriptData(t);break}case G.PLAINTEXT:{this._statePlaintext(t);break}case G.TAG_OPEN:{this._stateTagOpen(t);break}case G.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case G.TAG_NAME:{this._stateTagName(t);break}case G.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case G.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case G.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case G.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case G.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case G.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case G.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case G.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case G.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case G.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case G.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case G.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case G.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case G.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case G.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case G.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case G.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case G.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case G.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case G.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case G.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case G.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case G.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case G.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case G.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case G.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case G.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case G.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case G.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case G.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case G.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case G.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case G.BOGUS_COMMENT:{this._stateBogusComment(t);break}case G.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case G.COMMENT_START:{this._stateCommentStart(t);break}case G.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case G.COMMENT:{this._stateComment(t);break}case G.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case G.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case G.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case G.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case G.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case G.COMMENT_END:{this._stateCommentEnd(t);break}case G.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case G.DOCTYPE:{this._stateDoctype(t);break}case G.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case G.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case G.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case G.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case G.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case G.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case G.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case G.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case G.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case G.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case G.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case G.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case G.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case G.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case G.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case G.CDATA_SECTION:{this._stateCdataSection(t);break}case G.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case G.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case G.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case G.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=G.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitCodePoint(t);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case $.AMPERSAND:{this._startCharacterReference();break}case $.LESS_THAN_SIGN:{this.state=G.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=G.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=G.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Bi(t))this._createStartTagToken(),this.state=G.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=G.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=G.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(he.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=G.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(he.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=G.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Bi(t))this._createEndTagToken(),this.state=G.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(he.missingEndTagName),this.state=G.DATA;break}case $.EOF:{this._err(he.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=G.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=G.BEFORE_ATTRIBUTE_NAME;break}case $.SOLIDUS:{this.state=G.SELF_CLOSING_START_TAG;break}case $.GREATER_THAN_SIGN:{this.state=G.DATA,this.emitCurrentTagToken();break}case $.NULL:{this._err(he.unexpectedNullCharacter),n.tagName+=mn;break}case $.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Hd(t)?sp(t):t)}}_stateRcdataLessThanSign(t){t===$.SOLIDUS?this.state=G.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=G.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Bi(t)?(this.state=G.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=G.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 $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=G.BEFORE_ATTRIBUTE_NAME,!1;case $.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=G.SELF_CLOSING_START_TAG,!1;case $.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=G.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=G.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===$.SOLIDUS?this.state=G.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=G.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Bi(t)?(this.state=G.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=G.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=G.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case $.SOLIDUS:{this.state=G.SCRIPT_DATA_END_TAG_OPEN;break}case $.EXCLAMATION_MARK:{this.state=G.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=G.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Bi(t)?(this.state=G.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=G.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=G.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===$.HYPHEN_MINUS?(this.state=G.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=G.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===$.HYPHEN_MINUS?(this.state=G.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=G.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case $.HYPHEN_MINUS:{this.state=G.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=G.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case $.HYPHEN_MINUS:{this.state=G.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=G.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.state=G.SCRIPT_DATA_ESCAPED,this._emitChars(mn);break}case $.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=G.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case $.HYPHEN_MINUS:{this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=G.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.GREATER_THAN_SIGN:{this.state=G.SCRIPT_DATA,this._emitChars(">");break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.state=G.SCRIPT_DATA_ESCAPED,this._emitChars(mn);break}case $.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=G.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=G.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Bi(t)?(this._emitChars("<"),this.state=G.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=G.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Bi(t)?(this.state=G.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=G.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=G.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Br.SCRIPT,!1)&&N_(this.preprocessor.peek(Br.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Br.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=G.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case $.HYPHEN_MINUS:{this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case $.HYPHEN_MINUS:{this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(mn);break}case $.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case $.HYPHEN_MINUS:{this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.GREATER_THAN_SIGN:{this.state=G.SCRIPT_DATA,this._emitChars(">");break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(mn);break}case $.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=G.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Br.SCRIPT,!1)&&N_(this.preprocessor.peek(Br.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Br.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=G.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=G.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.SOLIDUS:case $.GREATER_THAN_SIGN:case $.EOF:{this.state=G.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case $.EQUALS_SIGN:{this._err(he.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=G.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=G.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:case $.SOLIDUS:case $.GREATER_THAN_SIGN:case $.EOF:{this._leaveAttrName(),this.state=G.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case $.EQUALS_SIGN:{this._leaveAttrName(),this.state=G.BEFORE_ATTRIBUTE_VALUE;break}case $.QUOTATION_MARK:case $.APOSTROPHE:case $.LESS_THAN_SIGN:{this._err(he.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.name+=mn;break}default:this.currentAttr.name+=String.fromCodePoint(Hd(t)?sp(t):t)}}_stateAfterAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.SOLIDUS:{this.state=G.SELF_CLOSING_START_TAG;break}case $.EQUALS_SIGN:{this.state=G.BEFORE_ATTRIBUTE_VALUE;break}case $.GREATER_THAN_SIGN:{this.state=G.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=G.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{this.state=G.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this.state=G.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(he.missingAttributeValue),this.state=G.DATA,this.emitCurrentTagToken();break}default:this.state=G.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case $.QUOTATION_MARK:{this.state=G.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case $.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case $.APOSTROPHE:{this.state=G.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case $.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this._leaveAttrValue(),this.state=G.BEFORE_ATTRIBUTE_NAME;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=G.DATA,this.emitCurrentTagToken();break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case $.QUOTATION_MARK:case $.APOSTROPHE:case $.LESS_THAN_SIGN:case $.EQUALS_SIGN:case $.GRAVE_ACCENT:{this._err(he.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case $.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this._leaveAttrValue(),this.state=G.BEFORE_ATTRIBUTE_NAME;break}case $.SOLIDUS:{this._leaveAttrValue(),this.state=G.SELF_CLOSING_START_TAG;break}case $.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=G.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._err(he.missingWhitespaceBetweenAttributes),this.state=G.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case $.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=G.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._err(he.unexpectedSolidusInTag),this.state=G.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.state=G.DATA,this.emitCurrentComment(n);break}case $.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case $.NULL:{this._err(he.unexpectedNullCharacter),n.data+=mn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Br.DASH_DASH,!0)?(this._createCommentToken(Br.DASH_DASH.length+1),this.state=G.COMMENT_START):this._consumeSequenceIfMatch(Br.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Br.DOCTYPE.length+1),this.state=G.DOCTYPE):this._consumeSequenceIfMatch(Br.CDATA_START,!0)?this.inForeignNode?this.state=G.CDATA_SECTION:(this._err(he.cdataInHtmlContent),this._createCommentToken(Br.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=G.BOGUS_COMMENT):this._ensureHibernation()||(this._err(he.incorrectlyOpenedComment),this._createCommentToken(2),this.state=G.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case $.HYPHEN_MINUS:{this.state=G.COMMENT_START_DASH;break}case $.GREATER_THAN_SIGN:{this._err(he.abruptClosingOfEmptyComment),this.state=G.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=G.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=G.COMMENT_END;break}case $.GREATER_THAN_SIGN:{this._err(he.abruptClosingOfEmptyComment),this.state=G.DATA,this.emitCurrentComment(n);break}case $.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=G.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=G.COMMENT_END_DASH;break}case $.LESS_THAN_SIGN:{n.data+="<",this.state=G.COMMENT_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),n.data+=mn;break}case $.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case $.EXCLAMATION_MARK:{n.data+="!",this.state=G.COMMENT_LESS_THAN_SIGN_BANG;break}case $.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=G.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===$.HYPHEN_MINUS?this.state=G.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=G.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===$.HYPHEN_MINUS?this.state=G.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=G.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==$.GREATER_THAN_SIGN&&t!==$.EOF&&this._err(he.nestedComment),this.state=G.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=G.COMMENT_END;break}case $.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=G.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.state=G.DATA,this.emitCurrentComment(n);break}case $.EXCLAMATION_MARK:{this.state=G.COMMENT_END_BANG;break}case $.HYPHEN_MINUS:{n.data+="-";break}case $.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=G.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{n.data+="--!",this.state=G.COMMENT_END_DASH;break}case $.GREATER_THAN_SIGN:{this._err(he.incorrectlyClosedComment),this.state=G.DATA,this.emitCurrentComment(n);break}case $.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=G.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=G.BEFORE_DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this.state=G.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case $.EOF:{this._err(he.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingWhitespaceBeforeDoctypeName),this.state=G.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Hd(t))this._createDoctypeToken(String.fromCharCode(sp(t))),this.state=G.DOCTYPE_NAME;else switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.NULL:{this._err(he.unexpectedNullCharacter),this._createDoctypeToken(mn),this.state=G.DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this._err(he.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=G.DATA;break}case $.EOF:{this._err(he.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=G.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=G.AFTER_DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this.state=G.DATA,this.emitCurrentDoctype(n);break}case $.NULL:{this._err(he.unexpectedNullCharacter),n.name+=mn;break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Hd(t)?sp(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.state=G.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Br.PUBLIC,!1)?this.state=G.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Br.SYSTEM,!1)?this.state=G.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(he.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=G.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=G.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.QUOTATION_MARK:{this._err(he.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=G.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(he.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=G.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(he.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=G.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=G.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{n.publicId="",this.state=G.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.publicId="",this.state=G.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(he.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=G.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=G.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case $.QUOTATION_MARK:{this.state=G.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.NULL:{this._err(he.unexpectedNullCharacter),n.publicId+=mn;break}case $.GREATER_THAN_SIGN:{this._err(he.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=G.DATA;break}case $.EOF:{this._err(he.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 $.APOSTROPHE:{this.state=G.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.NULL:{this._err(he.unexpectedNullCharacter),n.publicId+=mn;break}case $.GREATER_THAN_SIGN:{this._err(he.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=G.DATA;break}case $.EOF:{this._err(he.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 $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=G.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case $.GREATER_THAN_SIGN:{this.state=G.DATA,this.emitCurrentDoctype(n);break}case $.QUOTATION_MARK:{this._err(he.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=G.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(he.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=G.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=G.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=G.DATA;break}case $.QUOTATION_MARK:{n.systemId="",this.state=G.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.systemId="",this.state=G.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=G.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=G.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.QUOTATION_MARK:{this._err(he.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=G.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(he.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=G.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(he.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=G.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=G.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{n.systemId="",this.state=G.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.systemId="",this.state=G.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(he.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=G.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=G.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case $.QUOTATION_MARK:{this.state=G.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.NULL:{this._err(he.unexpectedNullCharacter),n.systemId+=mn;break}case $.GREATER_THAN_SIGN:{this._err(he.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=G.DATA;break}case $.EOF:{this._err(he.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 $.APOSTROPHE:{this.state=G.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.NULL:{this._err(he.unexpectedNullCharacter),n.systemId+=mn;break}case $.GREATER_THAN_SIGN:{this._err(he.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=G.DATA;break}case $.EOF:{this._err(he.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 $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=G.DATA;break}case $.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=G.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=G.DATA;break}case $.NULL:{this._err(he.unexpectedNullCharacter);break}case $.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case $.RIGHT_SQUARE_BRACKET:{this.state=G.CDATA_SECTION_BRACKET;break}case $.EOF:{this._err(he.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===$.RIGHT_SQUARE_BRACKET?this.state=G.CDATA_SECTION_END:(this._emitChars("]"),this.state=G.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case $.GREATER_THAN_SIGN:{this.state=G.DATA;break}case $.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=G.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($.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&C_(this.preprocessor.peek(1))?G.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){C_(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===$.SEMICOLON&&this._err(he.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const bL=new Set([C.DD,C.DT,C.LI,C.OPTGROUP,C.OPTION,C.P,C.RB,C.RP,C.RT,C.RTC]),A_=new Set([...bL,C.CAPTION,C.COLGROUP,C.TBODY,C.TD,C.TFOOT,C.TH,C.THEAD,C.TR]),n0=new Set([C.APPLET,C.CAPTION,C.HTML,C.MARQUEE,C.OBJECT,C.TABLE,C.TD,C.TEMPLATE,C.TH]),Uoe=new Set([...n0,C.OL,C.UL]),Hoe=new Set([...n0,C.BUTTON]),k_=new Set([C.ANNOTATION_XML,C.MI,C.MN,C.MO,C.MS,C.MTEXT]),__=new Set([C.DESC,C.FOREIGN_OBJECT,C.TITLE]),$oe=new Set([C.TR,C.TEMPLATE,C.HTML]),Voe=new Set([C.TBODY,C.TFOOT,C.THEAD,C.TEMPLATE,C.HTML]),qoe=new Set([C.TABLE,C.TEMPLATE,C.HTML]),Yoe=new Set([C.TD,C.TH]);class Goe{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)===Te.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Te.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(zv,Te.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Yoe,Te.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(qoe,Te.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Voe,Te.HTML)}clearBackToTableRowContext(){this.clearBackTo($oe,Te.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 s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Te.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Te.SVG:{if(__.has(s))return!1;break}case Te.MATHML:{if(k_.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,n0)}hasInListItemScope(t){return this.hasInDynamicScope(t,Uoe)}hasInButtonScope(t){return this.hasInDynamicScope(t,Hoe)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Te.HTML:{if(zv.has(n))return!0;if(n0.has(n))return!1;break}case Te.SVG:{if(__.has(n))return!1;break}case Te.MATHML:{if(k_.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Te.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])===Te.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])===Te.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&&bL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&A_.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&A_.has(this.currentTagId);)this.pop()}}const eb=3;var sa;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(sa||(sa={}));const R_={type:sa.Marker};class Koe{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const f=this.entries[c];if(f.type===sa.Marker)break;const{element:d}=f;if(this.treeAdapter.getTagName(d)===i&&this.treeAdapter.getNamespaceURI(d)===l){const p=this.treeAdapter.getAttrList(d);p.length===s&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<eb)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<eb)return;const s=new Map(n.map(l=>[l.name,l.value]));let i=0;for(let l=0;l<r.length;l++){const c=r[l];c.attrs.every(f=>s.get(f.name)===f.value)&&(i+=1,i>=eb&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(R_)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:sa.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:sa.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(R_);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===sa.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===sa.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===sa.Element&&n.element===t)}}const Fi={createDocument(){return{nodeName:"#document",mode:gs.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Fi.appendChild(e,i)}},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(Fi.isTextNode(n)){n.value+=t;return}}Fi.appendChild(e,Fi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Fi.isTextNode(r)?r.value+=t:Fi.insertBefore(e,Fi.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}}},vL="html",Qoe="about:legacy-compat",Xoe="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",EL=["+//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//"],Woe=[...EL,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Zoe=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),TL=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Joe=[...TL,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function O_(e,t){return t.some(n=>e.startsWith(n))}function ele(e){return e.name===vL&&e.publicId===null&&(e.systemId===null||e.systemId===Qoe)}function tle(e){if(e.name!==vL)return gs.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Xoe)return gs.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Zoe.has(n))return gs.QUIRKS;let r=t===null?Woe:EL;if(O_(n,r))return gs.QUIRKS;if(r=t===null?TL:Joe,O_(n,r))return gs.LIMITED_QUIRKS}return gs.NO_QUIRKS}const D_={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},nle="definitionurl",rle="definitionURL",sle=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])),ale=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Te.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Te.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Te.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Te.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Te.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Te.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Te.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Te.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Te.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Te.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Te.XMLNS}]]),ile=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])),ole=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 lle(e){const t=e.tagID;return t===C.FONT&&e.attrs.some(({name:r})=>r===nl.COLOR||r===nl.SIZE||r===nl.FACE)||ole.has(t)}function SL(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===nle){e.attrs[t].name=rle;break}}function wL(e){for(let t=0;t<e.attrs.length;t++){const n=sle.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function l2(e){for(let t=0;t<e.attrs.length;t++){const n=ale.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 ule(e){const t=ile.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Cc(e.tagName))}function cle(e,t){return t===Te.MATHML&&(e===C.MI||e===C.MO||e===C.MN||e===C.MS||e===C.MTEXT)}function dle(e,t,n){if(t===Te.MATHML&&e===C.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===nl.ENCODING){const s=n[r].value.toLowerCase();return s===D_.TEXT_HTML||s===D_.APPLICATION_XML}}return t===Te.SVG&&(e===C.FOREIGN_OBJECT||e===C.DESC||e===C.TITLE)}function fle(e,t,n,r){return(!r||r===Te.HTML)&&dle(e,t,n)||(!r||r===Te.MATHML)&&cle(e,t)}const hle="hidden",mle=8,ple=3;var Q;(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"})(Q||(Q={}));const gle={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},CL=new Set([C.TABLE,C.TBODY,C.TFOOT,C.THEAD,C.TR]),j_={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Fi,onParseError:null};class M_{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=Q.INITIAL,this.originalInsertionMode=Q.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={...j_,...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 zoe(this.options,this),this.activeFormattingElements=new Koe(this.treeAdapter),this.fragmentContextID=r?Cc(this.treeAdapter.getTagName(r)):C.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Goe(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={...j_,...n};t??(t=r.treeAdapter.createElement(ie.TEMPLATE,Te.HTML,[]));const s=r.treeAdapter.createElement("documentmock",Te.HTML,[]),i=new this(r,s,t);return i.fragmentContextID===C.TEMPLATE&&i.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const i=(s=t.location)!==null&&s!==void 0?s:gle,l={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:r?i.startLine:i.endLine,endCol:r?i.startCol:i.endCol,endOffset:r?i.startOffset:i.endOffset};this.onParseError(l)}onItemPush(t,n,r){var s,i;(i=(s=this.treeAdapter).onItemPush)===null||i===void 0||i.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let i,l;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,l=this.fragmentContextID):{current:i,currentTagId:l}=this.openElements,this._setContextModes(i,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Te.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Te.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Q.TEXT}switchToPlaintextParsing(){this.insertionMode=Q.TEXT,this.originalInsertionMode=Q.IN_BODY,this.tokenizer.state=On.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)===ie.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Te.HTML))switch(this.fragmentContextID){case C.TITLE:case C.TEXTAREA:{this.tokenizer.state=On.RCDATA;break}case C.STYLE:case C.XMP:case C.IFRAME:case C.NOEMBED:case C.NOFRAMES:case C.NOSCRIPT:{this.tokenizer.state=On.RAWTEXT;break}case C.SCRIPT:{this.tokenizer.state=On.SCRIPT_DATA;break}case C.PLAINTEXT:{this.tokenizer.state=On.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(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,Te.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Te.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(ie.HTML,Te.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 s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,l=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:f,endCol:d,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:f,endCol:d,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),i=n.type===ht.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}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)===ie.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Te.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===C.MGLYPH||t.tagID===C.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Te.HTML)}_processToken(t){switch(t.type){case ht.CHARACTER:{this.onCharacter(t);break}case ht.NULL_CHARACTER:{this.onNullCharacter(t);break}case ht.COMMENT:{this.onComment(t);break}case ht.DOCTYPE:{this.onDoctype(t);break}case ht.START_TAG:{this._processStartTag(t);break}case ht.END_TAG:{this.onEndTag(t);break}case ht.EOF:{this.onEof(t);break}case ht.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return fle(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===sa.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Q.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=Q.IN_ROW;return}case C.TBODY:case C.THEAD:case C.TFOOT:{this.insertionMode=Q.IN_TABLE_BODY;return}case C.CAPTION:{this.insertionMode=Q.IN_CAPTION;return}case C.COLGROUP:{this.insertionMode=Q.IN_COLUMN_GROUP;return}case C.TABLE:{this.insertionMode=Q.IN_TABLE;return}case C.BODY:{this.insertionMode=Q.IN_BODY;return}case C.FRAMESET:{this.insertionMode=Q.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?Q.AFTER_HEAD:Q.BEFORE_HEAD;return}case C.TD:case C.TH:{if(t>0){this.insertionMode=Q.IN_CELL;return}break}case C.HEAD:{if(t>0){this.insertionMode=Q.IN_HEAD;return}break}}this.insertionMode=Q.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=Q.IN_SELECT_IN_TABLE;return}}this.insertionMode=Q.IN_SELECT}_isElementCausesFosterParenting(t){return CL.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)===Te.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 Loe[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Yue(this,t);return}switch(this.insertionMode){case Q.INITIAL:{_d(this,t);break}case Q.BEFORE_HTML:{Xd(this,t);break}case Q.BEFORE_HEAD:{Wd(this,t);break}case Q.IN_HEAD:{Zd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Jd(this,t);break}case Q.AFTER_HEAD:{ef(this,t);break}case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:{AL(this,t);break}case Q.TEXT:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{tb(this,t);break}case Q.IN_TABLE_TEXT:{jL(this,t);break}case Q.IN_COLUMN_GROUP:{r0(this,t);break}case Q.AFTER_BODY:{s0(this,t);break}case Q.AFTER_AFTER_BODY:{Cp(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){que(this,t);return}switch(this.insertionMode){case Q.INITIAL:{_d(this,t);break}case Q.BEFORE_HTML:{Xd(this,t);break}case Q.BEFORE_HEAD:{Wd(this,t);break}case Q.IN_HEAD:{Zd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Jd(this,t);break}case Q.AFTER_HEAD:{ef(this,t);break}case Q.TEXT:{this._insertCharacters(t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{tb(this,t);break}case Q.IN_COLUMN_GROUP:{r0(this,t);break}case Q.AFTER_BODY:{s0(this,t);break}case Q.AFTER_AFTER_BODY:{Cp(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Uv(this,t);return}switch(this.insertionMode){case Q.INITIAL:case Q.BEFORE_HTML:case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_TEMPLATE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:{Uv(this,t);break}case Q.IN_TABLE_TEXT:{Rd(this,t);break}case Q.AFTER_BODY:{Sle(this,t);break}case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{wle(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Q.INITIAL:{Cle(this,t);break}case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:{this._err(t,he.misplacedDoctype);break}case Q.IN_TABLE_TEXT:{Rd(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,he.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Gue(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Q.INITIAL:{_d(this,t);break}case Q.BEFORE_HTML:{Nle(this,t);break}case Q.BEFORE_HEAD:{kle(this,t);break}case Q.IN_HEAD:{Gs(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Ole(this,t);break}case Q.AFTER_HEAD:{jle(this,t);break}case Q.IN_BODY:{xr(this,t);break}case Q.IN_TABLE:{nc(this,t);break}case Q.IN_TABLE_TEXT:{Rd(this,t);break}case Q.IN_CAPTION:{_ue(this,t);break}case Q.IN_COLUMN_GROUP:{d2(this,t);break}case Q.IN_TABLE_BODY:{cg(this,t);break}case Q.IN_ROW:{dg(this,t);break}case Q.IN_CELL:{Due(this,t);break}case Q.IN_SELECT:{LL(this,t);break}case Q.IN_SELECT_IN_TABLE:{Mue(this,t);break}case Q.IN_TEMPLATE:{Lue(this,t);break}case Q.AFTER_BODY:{Bue(this,t);break}case Q.IN_FRAMESET:{Fue(this,t);break}case Q.AFTER_FRAMESET:{Uue(this,t);break}case Q.AFTER_AFTER_BODY:{$ue(this,t);break}case Q.AFTER_AFTER_FRAMESET:{Vue(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Kue(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Q.INITIAL:{_d(this,t);break}case Q.BEFORE_HTML:{Ale(this,t);break}case Q.BEFORE_HEAD:{_le(this,t);break}case Q.IN_HEAD:{Rle(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Dle(this,t);break}case Q.AFTER_HEAD:{Mle(this,t);break}case Q.IN_BODY:{ug(this,t);break}case Q.TEXT:{bue(this,t);break}case Q.IN_TABLE:{Sf(this,t);break}case Q.IN_TABLE_TEXT:{Rd(this,t);break}case Q.IN_CAPTION:{Rue(this,t);break}case Q.IN_COLUMN_GROUP:{Oue(this,t);break}case Q.IN_TABLE_BODY:{Hv(this,t);break}case Q.IN_ROW:{IL(this,t);break}case Q.IN_CELL:{jue(this,t);break}case Q.IN_SELECT:{PL(this,t);break}case Q.IN_SELECT_IN_TABLE:{Iue(this,t);break}case Q.IN_TEMPLATE:{Pue(this,t);break}case Q.AFTER_BODY:{FL(this,t);break}case Q.IN_FRAMESET:{zue(this,t);break}case Q.AFTER_FRAMESET:{Hue(this,t);break}case Q.AFTER_AFTER_BODY:{Cp(this,t);break}}}onEof(t){switch(this.insertionMode){case Q.INITIAL:{_d(this,t);break}case Q.BEFORE_HTML:{Xd(this,t);break}case Q.BEFORE_HEAD:{Wd(this,t);break}case Q.IN_HEAD:{Zd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Jd(this,t);break}case Q.AFTER_HEAD:{ef(this,t);break}case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:{OL(this,t);break}case Q.TEXT:{vue(this,t);break}case Q.IN_TABLE_TEXT:{Rd(this,t);break}case Q.IN_TEMPLATE:{BL(this,t);break}case Q.AFTER_BODY:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{c2(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===$.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 Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.TEXT:case Q.IN_COLUMN_GROUP:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:{this._insertCharacters(t);break}case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:case Q.AFTER_BODY:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{NL(this,t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{tb(this,t);break}case Q.IN_TABLE_TEXT:{DL(this,t);break}}}}function xle(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):RL(e,t),n}function yle(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function ble(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,l=s;l!==n;i++,l=s){s=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),f=c&&i>=ple;!c||f?(f&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=vle(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function vle(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 Ele(e,t,n){const r=e.treeAdapter.getTagName(t),s=Cc(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===C.TEMPLATE&&i===Te.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Tle(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function u2(e,t){for(let n=0;n<mle;n++){const r=xle(e,t);if(!r)break;const s=yle(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const i=ble(e,s,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),l&&Ele(e,l,i),Tle(e,s,r)}}function Uv(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Sle(e,t){e._appendCommentNode(t,e.openElements.items[0])}function wle(e,t){e._appendCommentNode(t,e.document)}function c2(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(i);l&&!l.endTag&&e._setEndLocation(i,t)}}}}function Cle(e,t){e._setDocumentType(t);const n=t.forceQuirks?gs.QUIRKS:tle(t);ele(t)||e._err(t,he.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Q.BEFORE_HTML}function _d(e,t){e._err(t,he.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,gs.QUIRKS),e.insertionMode=Q.BEFORE_HTML,e._processToken(t)}function Nle(e,t){t.tagID===C.HTML?(e._insertElement(t,Te.HTML),e.insertionMode=Q.BEFORE_HEAD):Xd(e,t)}function Ale(e,t){const n=t.tagID;(n===C.HTML||n===C.HEAD||n===C.BODY||n===C.BR)&&Xd(e,t)}function Xd(e,t){e._insertFakeRootElement(),e.insertionMode=Q.BEFORE_HEAD,e._processToken(t)}function kle(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.HEAD:{e._insertElement(t,Te.HTML),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD;break}default:Wd(e,t)}}function _le(e,t){const n=t.tagID;n===C.HEAD||n===C.BODY||n===C.HTML||n===C.BR?Wd(e,t):e._err(t,he.endTagWithoutMatchingOpenElement)}function Wd(e,t){e._insertFakeElement(ie.HEAD,C.HEAD),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD,e._processToken(t)}function Gs(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:{e._appendElement(t,Te.HTML),t.ackSelfClosing=!0;break}case C.TITLE:{e._switchToTextParsing(t,On.RCDATA);break}case C.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,On.RAWTEXT):(e._insertElement(t,Te.HTML),e.insertionMode=Q.IN_HEAD_NO_SCRIPT);break}case C.NOFRAMES:case C.STYLE:{e._switchToTextParsing(t,On.RAWTEXT);break}case C.SCRIPT:{e._switchToTextParsing(t,On.SCRIPT_DATA);break}case C.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE);break}case C.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Zd(e,t)}}function Rle(e,t){switch(t.tagID){case C.HEAD:{e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD;break}case C.BODY:case C.BR:case C.HTML:{Zd(e,t);break}case C.TEMPLATE:{Tl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Tl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==C.TEMPLATE&&e._err(t,he.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(C.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,he.endTagWithoutMatchingOpenElement)}function Zd(e,t){e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD,e._processToken(t)}function Ole(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.BASEFONT:case C.BGSOUND:case C.HEAD:case C.LINK:case C.META:case C.NOFRAMES:case C.STYLE:{Gs(e,t);break}case C.NOSCRIPT:{e._err(t,he.nestedNoscriptInHead);break}default:Jd(e,t)}}function Dle(e,t){switch(t.tagID){case C.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Q.IN_HEAD;break}case C.BR:{Jd(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Jd(e,t){const n=t.type===ht.EOF?he.openElementsLeftAfterEof:he.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Q.IN_HEAD,e._processToken(t)}function jle(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.BODY:{e._insertElement(t,Te.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_BODY;break}case C.FRAMESET:{e._insertElement(t,Te.HTML),e.insertionMode=Q.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,he.abandonedHeadElementChild),e.openElements.push(e.headElement,C.HEAD),Gs(e,t),e.openElements.remove(e.headElement);break}case C.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:ef(e,t)}}function Mle(e,t){switch(t.tagID){case C.BODY:case C.HTML:case C.BR:{ef(e,t);break}case C.TEMPLATE:{Tl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function ef(e,t){e._insertFakeElement(ie.BODY,C.BODY),e.insertionMode=Q.IN_BODY,lg(e,t)}function lg(e,t){switch(t.type){case ht.CHARACTER:{AL(e,t);break}case ht.WHITESPACE_CHARACTER:{NL(e,t);break}case ht.COMMENT:{Uv(e,t);break}case ht.START_TAG:{xr(e,t);break}case ht.END_TAG:{ug(e,t);break}case ht.EOF:{OL(e,t);break}}}function NL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function AL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Ile(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Lle(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Ple(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Te.HTML),e.insertionMode=Q.IN_FRAMESET)}function Ble(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Te.HTML)}function Fle(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&zv.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Te.HTML)}function zle(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Te.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Ule(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Te.HTML),n||(e.formElement=e.openElements.current))}function Hle(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===C.LI&&s===C.LI||(n===C.DD||n===C.DT)&&(s===C.DD||s===C.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==C.ADDRESS&&s!==C.DIV&&s!==C.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Te.HTML)}function $le(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Te.HTML),e.tokenizer.state=On.PLAINTEXT}function Vle(e,t){e.openElements.hasInScope(C.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(C.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.framesetOk=!1}function qle(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ie.A);n&&(u2(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Yle(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Gle(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(C.NOBR)&&(u2(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Kle(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Qle(e,t){e.treeAdapter.getDocumentMode(e.document)!==gs.QUIRKS&&e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Te.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_TABLE}function kL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Te.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function _L(e){const t=xL(e,nl.TYPE);return t!=null&&t.toLowerCase()===hle}function Xle(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Te.HTML),_L(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Wle(e,t){e._appendElement(t,Te.HTML),t.ackSelfClosing=!0}function Zle(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._appendElement(t,Te.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Jle(e,t){t.tagName=ie.IMG,t.tagID=C.IMG,kL(e,t)}function eue(e,t){e._insertElement(t,Te.HTML),e.skipNextNewLine=!0,e.tokenizer.state=On.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Q.TEXT}function tue(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,On.RAWTEXT)}function nue(e,t){e.framesetOk=!1,e._switchToTextParsing(t,On.RAWTEXT)}function I_(e,t){e._switchToTextParsing(t,On.RAWTEXT)}function rue(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Q.IN_TABLE||e.insertionMode===Q.IN_CAPTION||e.insertionMode===Q.IN_TABLE_BODY||e.insertionMode===Q.IN_ROW||e.insertionMode===Q.IN_CELL?Q.IN_SELECT_IN_TABLE:Q.IN_SELECT}function sue(e,t){e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML)}function aue(e,t){e.openElements.hasInScope(C.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Te.HTML)}function iue(e,t){e.openElements.hasInScope(C.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(C.RTC),e._insertElement(t,Te.HTML)}function oue(e,t){e._reconstructActiveFormattingElements(),SL(t),l2(t),t.selfClosing?e._appendElement(t,Te.MATHML):e._insertElement(t,Te.MATHML),t.ackSelfClosing=!0}function lue(e,t){e._reconstructActiveFormattingElements(),wL(t),l2(t),t.selfClosing?e._appendElement(t,Te.SVG):e._insertElement(t,Te.SVG),t.ackSelfClosing=!0}function L_(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Te.HTML)}function xr(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:{Yle(e,t);break}case C.A:{qle(e,t);break}case C.H1:case C.H2:case C.H3:case C.H4:case C.H5:case C.H6:{Fle(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:{Ble(e,t);break}case C.LI:case C.DD:case C.DT:{Hle(e,t);break}case C.BR:case C.IMG:case C.WBR:case C.AREA:case C.EMBED:case C.KEYGEN:{kL(e,t);break}case C.HR:{Zle(e,t);break}case C.RB:case C.RTC:{aue(e,t);break}case C.RT:case C.RP:{iue(e,t);break}case C.PRE:case C.LISTING:{zle(e,t);break}case C.XMP:{tue(e,t);break}case C.SVG:{lue(e,t);break}case C.HTML:{Ile(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:{Gs(e,t);break}case C.BODY:{Lle(e,t);break}case C.FORM:{Ule(e,t);break}case C.NOBR:{Gle(e,t);break}case C.MATH:{oue(e,t);break}case C.TABLE:{Qle(e,t);break}case C.INPUT:{Xle(e,t);break}case C.PARAM:case C.TRACK:case C.SOURCE:{Wle(e,t);break}case C.IMAGE:{Jle(e,t);break}case C.BUTTON:{Vle(e,t);break}case C.APPLET:case C.OBJECT:case C.MARQUEE:{Kle(e,t);break}case C.IFRAME:{nue(e,t);break}case C.SELECT:{rue(e,t);break}case C.OPTION:case C.OPTGROUP:{sue(e,t);break}case C.NOEMBED:case C.NOFRAMES:{I_(e,t);break}case C.FRAMESET:{Ple(e,t);break}case C.TEXTAREA:{eue(e,t);break}case C.NOSCRIPT:{e.options.scriptingEnabled?I_(e,t):L_(e,t);break}case C.PLAINTEXT:{$le(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:L_(e,t)}}function uue(e,t){if(e.openElements.hasInScope(C.BODY)&&(e.insertionMode=Q.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function cue(e,t){e.openElements.hasInScope(C.BODY)&&(e.insertionMode=Q.AFTER_BODY,FL(e,t))}function due(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function fue(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 hue(e){e.openElements.hasInButtonScope(C.P)||e._insertFakeElement(ie.P,C.P),e._closePElement()}function mue(e){e.openElements.hasInListItemScope(C.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(C.LI),e.openElements.popUntilTagNamePopped(C.LI))}function pue(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function gue(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function xue(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function yue(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ie.BR,C.BR),e.openElements.pop(),e.framesetOk=!1}function RL(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const i=e.openElements.items[s],l=e.openElements.tagIDs[s];if(r===l&&(r!==C.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,l))break}}function ug(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:{u2(e,t);break}case C.P:{hue(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:{due(e,t);break}case C.LI:{mue(e);break}case C.DD:case C.DT:{pue(e,t);break}case C.H1:case C.H2:case C.H3:case C.H4:case C.H5:case C.H6:{gue(e);break}case C.BR:{yue(e);break}case C.BODY:{uue(e,t);break}case C.HTML:{cue(e,t);break}case C.FORM:{fue(e);break}case C.APPLET:case C.OBJECT:case C.MARQUEE:{xue(e,t);break}case C.TEMPLATE:{Tl(e,t);break}default:RL(e,t)}}function OL(e,t){e.tmplInsertionModeStack.length>0?BL(e,t):c2(e,t)}function bue(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 vue(e,t){e._err(t,he.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function tb(e,t){if(e.openElements.currentTagId!==void 0&&CL.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Q.IN_TABLE_TEXT,t.type){case ht.CHARACTER:{jL(e,t);break}case ht.WHITESPACE_CHARACTER:{DL(e,t);break}}else fh(e,t)}function Eue(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Te.HTML),e.insertionMode=Q.IN_CAPTION}function Tue(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Te.HTML),e.insertionMode=Q.IN_COLUMN_GROUP}function Sue(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ie.COLGROUP,C.COLGROUP),e.insertionMode=Q.IN_COLUMN_GROUP,d2(e,t)}function wue(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Te.HTML),e.insertionMode=Q.IN_TABLE_BODY}function Cue(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ie.TBODY,C.TBODY),e.insertionMode=Q.IN_TABLE_BODY,cg(e,t)}function Nue(e,t){e.openElements.hasInTableScope(C.TABLE)&&(e.openElements.popUntilTagNamePopped(C.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Aue(e,t){_L(t)?e._appendElement(t,Te.HTML):fh(e,t),t.ackSelfClosing=!0}function kue(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Te.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function nc(e,t){switch(t.tagID){case C.TD:case C.TH:case C.TR:{Cue(e,t);break}case C.STYLE:case C.SCRIPT:case C.TEMPLATE:{Gs(e,t);break}case C.COL:{Sue(e,t);break}case C.FORM:{kue(e,t);break}case C.TABLE:{Nue(e,t);break}case C.TBODY:case C.TFOOT:case C.THEAD:{wue(e,t);break}case C.INPUT:{Aue(e,t);break}case C.CAPTION:{Eue(e,t);break}case C.COLGROUP:{Tue(e,t);break}default:fh(e,t)}}function Sf(e,t){switch(t.tagID){case C.TABLE:{e.openElements.hasInTableScope(C.TABLE)&&(e.openElements.popUntilTagNamePopped(C.TABLE),e._resetInsertionMode());break}case C.TEMPLATE:{Tl(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:fh(e,t)}}function fh(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,lg(e,t),e.fosterParentingEnabled=n}function DL(e,t){e.pendingCharacterTokens.push(t)}function jL(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Rd(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)fh(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const ML=new Set([C.CAPTION,C.COL,C.COLGROUP,C.TBODY,C.TD,C.TFOOT,C.TH,C.THEAD,C.TR]);function _ue(e,t){const n=t.tagID;ML.has(n)?e.openElements.hasInTableScope(C.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(C.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Q.IN_TABLE,nc(e,t)):xr(e,t)}function Rue(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=Q.IN_TABLE,n===C.TABLE&&Sf(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:ug(e,t)}}function d2(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.COL:{e._appendElement(t,Te.HTML),t.ackSelfClosing=!0;break}case C.TEMPLATE:{Gs(e,t);break}default:r0(e,t)}}function Oue(e,t){switch(t.tagID){case C.COLGROUP:{e.openElements.currentTagId===C.COLGROUP&&(e.openElements.pop(),e.insertionMode=Q.IN_TABLE);break}case C.TEMPLATE:{Tl(e,t);break}case C.COL:break;default:r0(e,t)}}function r0(e,t){e.openElements.currentTagId===C.COLGROUP&&(e.openElements.pop(),e.insertionMode=Q.IN_TABLE,e._processToken(t))}function cg(e,t){switch(t.tagID){case C.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Te.HTML),e.insertionMode=Q.IN_ROW;break}case C.TH:case C.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ie.TR,C.TR),e.insertionMode=Q.IN_ROW,dg(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=Q.IN_TABLE,nc(e,t));break}default:nc(e,t)}}function Hv(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=Q.IN_TABLE);break}case C.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE,Sf(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:Sf(e,t)}}function dg(e,t){switch(t.tagID){case C.TH:case C.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Te.HTML),e.insertionMode=Q.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=Q.IN_TABLE_BODY,cg(e,t));break}default:nc(e,t)}}function IL(e,t){switch(t.tagID){case C.TR:{e.openElements.hasInTableScope(C.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY);break}case C.TABLE:{e.openElements.hasInTableScope(C.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY,Hv(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=Q.IN_TABLE_BODY,Hv(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:Sf(e,t)}}function Due(e,t){const n=t.tagID;ML.has(n)?(e.openElements.hasInTableScope(C.TD)||e.openElements.hasInTableScope(C.TH))&&(e._closeTableCell(),dg(e,t)):xr(e,t)}function jue(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=Q.IN_ROW);break}case C.TABLE:case C.TBODY:case C.TFOOT:case C.THEAD:case C.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),IL(e,t));break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:break;default:ug(e,t)}}function LL(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.OPTION:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e._insertElement(t,Te.HTML);break}case C.OPTGROUP:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e.openElements.currentTagId===C.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Te.HTML);break}case C.HR:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e.openElements.currentTagId===C.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Te.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:{Gs(e,t);break}}}function PL(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:{Tl(e,t);break}}}function Mue(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)):LL(e,t)}function Iue(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)):PL(e,t)}function Lue(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:{Gs(e,t);break}case C.CAPTION:case C.COLGROUP:case C.TBODY:case C.TFOOT:case C.THEAD:{e.tmplInsertionModeStack[0]=Q.IN_TABLE,e.insertionMode=Q.IN_TABLE,nc(e,t);break}case C.COL:{e.tmplInsertionModeStack[0]=Q.IN_COLUMN_GROUP,e.insertionMode=Q.IN_COLUMN_GROUP,d2(e,t);break}case C.TR:{e.tmplInsertionModeStack[0]=Q.IN_TABLE_BODY,e.insertionMode=Q.IN_TABLE_BODY,cg(e,t);break}case C.TD:case C.TH:{e.tmplInsertionModeStack[0]=Q.IN_ROW,e.insertionMode=Q.IN_ROW,dg(e,t);break}default:e.tmplInsertionModeStack[0]=Q.IN_BODY,e.insertionMode=Q.IN_BODY,xr(e,t)}}function Pue(e,t){t.tagID===C.TEMPLATE&&Tl(e,t)}function BL(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(C.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):c2(e,t)}function Bue(e,t){t.tagID===C.HTML?xr(e,t):s0(e,t)}function FL(e,t){var n;if(t.tagID===C.HTML){if(e.fragmentContext||(e.insertionMode=Q.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 s0(e,t)}function s0(e,t){e.insertionMode=Q.IN_BODY,lg(e,t)}function Fue(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.FRAMESET:{e._insertElement(t,Te.HTML);break}case C.FRAME:{e._appendElement(t,Te.HTML),t.ackSelfClosing=!0;break}case C.NOFRAMES:{Gs(e,t);break}}}function zue(e,t){t.tagID===C.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==C.FRAMESET&&(e.insertionMode=Q.AFTER_FRAMESET))}function Uue(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.NOFRAMES:{Gs(e,t);break}}}function Hue(e,t){t.tagID===C.HTML&&(e.insertionMode=Q.AFTER_AFTER_FRAMESET)}function $ue(e,t){t.tagID===C.HTML?xr(e,t):Cp(e,t)}function Cp(e,t){e.insertionMode=Q.IN_BODY,lg(e,t)}function Vue(e,t){switch(t.tagID){case C.HTML:{xr(e,t);break}case C.NOFRAMES:{Gs(e,t);break}}}function que(e,t){t.chars=mn,e._insertCharacters(t)}function Yue(e,t){e._insertCharacters(t),e.framesetOk=!1}function zL(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Te.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Gue(e,t){if(lle(t))zL(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Te.MATHML?SL(t):r===Te.SVG&&(ule(t),wL(t)),l2(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Kue(e,t){if(t.tagID===C.P||t.tagID===C.BR){zL(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)===Te.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}ie.AREA,ie.BASE,ie.BASEFONT,ie.BGSOUND,ie.BR,ie.COL,ie.EMBED,ie.FRAME,ie.HR,ie.IMG,ie.INPUT,ie.KEYGEN,ie.LINK,ie.META,ie.PARAM,ie.SOURCE,ie.TRACK,ie.WBR;const fg=UL("end"),Sa=UL("start");function UL(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 HL(e){const t=Sa(e),n=fg(e);if(t&&n)return{start:t,end:n}}const Que=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Xue=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),P_={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function $L(e,t){const n=ice(e),r=fL("type",{handlers:{root:Wue,element:Zue,text:Jue,comment:qL,doctype:ece,raw:nce},unknown:rce}),s={parser:n?new M_(P_):M_.getFragmentParser(void 0,P_),handle(c){r(c,s)},stitches:!1,options:t||{}};r(e,s),Nc(s,Sa());const i=n?s.parser.document:s.parser.getFragment(),l=ooe(i,{file:s.options.file});return s.stitches&&io(l,"comment",function(c,f,d){const p=c;if(p.value.stitch&&d&&f!==void 0){const m=d.children;return m[f]=p.value.stitch,f}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function VL(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Wue(e,t){VL(e.children,t)}function Zue(e,t){sce(e,t),VL(e.children,t),ace(e,t)}function Jue(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:ht.CHARACTER,chars:e.value,location:hh(e)};Nc(t,Sa(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ece(e,t){const n={type:ht.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:hh(e)};Nc(t,Sa(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function tce(e,t){t.stitches=!0;const n=oce(e);if("children"in e&&"children"in n){const r=$L({type:"root",children:e.children},t.options);n.children=r.children}qL({type:"comment",value:{stitch:n}},t)}function qL(e,t){const n=e.value,r={type:ht.COMMENT,data:n,location:hh(e)};Nc(t,Sa(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function nce(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,YL(t,Sa(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Que,"<$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 rce(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))tce(n,t);else{let r="";throw Xue.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 Nc(e,t){YL(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=On.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 YL(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 sce(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===On.PLAINTEXT)return;Nc(t,Sa(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Uo.html;s===Uo.html&&n==="svg"&&(s=Uo.svg);const i=foe({...e,children:[]},{space:s===Uo.svg?"svg":"html"}),l={type:ht.START_TAG,tagName:n,tagID:Cc(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:hh(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function ace(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&voe.includes(n)||t.parser.tokenizer.state===On.PLAINTEXT)return;Nc(t,fg(e));const r={type:ht.END_TAG,tagName:n,tagID:Cc(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:hh(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===On.RCDATA||t.parser.tokenizer.state===On.RAWTEXT||t.parser.tokenizer.state===On.SCRIPT_DATA)&&(t.parser.tokenizer.state=On.DATA)}function ice(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function hh(e){const t=Sa(e)||{line:void 0,column:void 0,offset:void 0},n=fg(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 oce(e){return"children"in e?dl({...e,children:[]}):dl(e)}function $v(e){return function(t,n){return $L(t,{...e,file:n})}}const Io=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],tf={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Io,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Io],h2:[["className","sr-only"]],img:[...Io,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Io,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Io],table:[...Io],ul:[...Io,["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"]},zi={}.hasOwnProperty;function lce(e,t){let n={type:"root",children:[]};const r={schema:t?{...tf,...t}:tf,stack:[]},s=GL(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function GL(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return uce(e,n);case"doctype":return cce(e,n);case"element":return dce(e,n);case"root":return fce(e,n);case"text":return hce(e,n)}}}function uce(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),i={type:"comment",value:r<0?n:n.slice(0,r)};return mh(i,t),i}}function cce(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return mh(n,t),n}}function dce(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=KL(e,t.children),s=mce(e,t.properties);e.stack.pop();let i=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(i=!0,e.schema.ancestors&&zi.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let f=-1;for(i=!1;++f<c.length;)e.stack.includes(c[f])&&(i=!0)}if(!i)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const l={type:"element",tagName:n,properties:s,children:r};return mh(l,t),l}function fce(e,t){const r={type:"root",children:KL(e,t.children)};return mh(r,t),r}function hce(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return mh(r,t),r}function KL(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const i=GL(e,r[s]);i&&(Array.isArray(i)?n.push(...i):n.push(i))}}return n}function mce(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,i=r&&zi.call(r,n)?r[n]:void 0,l=r&&zi.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},f={};let d;for(d in c)if(zi.call(c,d)){const p=c[d];let m=B_(e,F_(i,d),d,p);m==null&&(m=B_(e,F_(l,d),d,p)),m!=null&&(f[d]=m)}if(s&&zi.call(s,n)){const p=s[n];for(d in p)zi.call(p,d)&&!zi.call(f,d)&&(f[d]=p[d])}return f}function B_(e,t,n,r){return t?Array.isArray(r)?pce(e,t,n,r):QL(e,t,n,r):void 0}function pce(e,t,n,r){let s=-1;const i=[];for(;++s<r.length;){const l=QL(e,t,n,r[s]);(typeof l=="number"||typeof l=="string")&&i.push(l)}return i}function QL(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&gce(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,i=0;for(;++i<t.length;){const l=t[i];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){s=!0;break}}else if(l===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function gce(e,t,n){const r=e.schema.protocols&&zi.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),i=s.indexOf(":"),l=s.indexOf("?"),c=s.indexOf("#"),f=s.indexOf("/");if(i<0||f>-1&&i>f||l>-1&&i>l||c>-1&&i>c)return!0;let d=-1;for(;++d<r.length;){const p=r[d];if(i===p.length&&s.slice(0,p.length)===p)return!0}return!1}function mh(e,t){const n=HL(t);t.data&&(e.data=dl(t.data)),n&&(e.position=n)}function F_(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],i=typeof s=="string"?s:s[0];if(i===t)return s;i==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function XL(e){return function(t){return lce(t,e)}}function z_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}const wr=mo(/[A-Za-z]/),pr=mo(/[\dA-Za-z]/),xce=mo(/[#-'*+\--9=?A-Z^-~]/);function a0(e){return e!==null&&(e<32||e===127)}const Vv=mo(/\d/),yce=mo(/[\dA-Fa-f]/),bce=mo(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function en(e){return e!==null&&(e<0||e===32)}function bt(e){return e===-2||e===-1||e===32}const hg=mo(new RegExp("\\p{P}|\\p{S}","u")),fl=mo(/\s/);function mo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function vce(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ece(e,t,n){const s=sg((n||{}).ignore||[]),i=Tce(t);let l=-1;for(;++l<i.length;)e2(e,"text",c);function c(d,p){let m=-1,x;for(;++m<p.length;){const y=p[m],v=x?x.children:void 0;if(s(y,v?v.indexOf(y):void 0,x))return;x=y}if(x)return f(d,p)}function f(d,p){const m=p[p.length-1],x=i[l][0],y=i[l][1];let v=0;const w=m.children.indexOf(d);let N=!1,A=[];x.lastIndex=0;let k=x.exec(d.value);for(;k;){const R=k.index,D={index:k.index,input:k.input,stack:[...p,d]};let O=y(...k,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?x.lastIndex=R+1:(v!==R&&A.push({type:"text",value:d.value.slice(v,R)}),Array.isArray(O)?A.push(...O):O&&A.push(O),v=R+k[0].length,N=!0),!x.global)break;k=x.exec(d.value)}return N?(v<d.value.length&&A.push({type:"text",value:d.value.slice(v)}),m.children.splice(w,1,...A)):A=[d],w+A.length}}function Tce(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([Sce(s[0]),wce(s[1])])}return t}function Sce(e){return typeof e=="string"?new RegExp(vce(e),"g"):e}function wce(e){return typeof e=="function"?e:function(){return e}}const nb="phrasing",rb=["autolink","link","image","label"];function Cce(){return{transforms:[Dce],enter:{literalAutolink:Ace,literalAutolinkEmail:sb,literalAutolinkHttp:sb,literalAutolinkWww:sb},exit:{literalAutolink:Oce,literalAutolinkEmail:Rce,literalAutolinkHttp:kce,literalAutolinkWww:_ce}}}function Nce(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:nb,notInConstruct:rb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:nb,notInConstruct:rb},{character:":",before:"[ps]",after:"\\/",inConstruct:nb,notInConstruct:rb}]}}function Ace(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function sb(e){this.config.enter.autolinkProtocol.call(this,e)}function kce(e){this.config.exit.autolinkProtocol.call(this,e)}function _ce(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 Rce(e){this.config.exit.autolinkEmail.call(this,e)}function Oce(e){this.exit(e)}function Dce(e){Ece(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jce],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Mce]],{ignore:["link","linkReference"]})}function jce(e,t,n,r,s){let i="";if(!WL(s)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!Ice(n)))return!1;const l=Lce(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function Mce(e,t,n,r){return!WL(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Ice(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 Lce(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=z_(e,"(");let i=z_(e,")");for(;r!==-1&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function WL(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fl(n)||hg(n))&&(!t||n!==47)}function $s(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}ZL.peek=qce;function Pce(){this.buffer()}function Bce(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fce(){this.buffer()}function zce(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Uce(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$s(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Hce(e){this.exit(e)}function $ce(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$s(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vce(e){this.exit(e)}function qce(){return"["}function ZL(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),c(),l(),i+=s.move("]"),i}function Yce(){return{enter:{gfmFootnoteCallString:Pce,gfmFootnoteCall:Bce,gfmFootnoteDefinitionLabelString:Fce,gfmFootnoteDefinition:zce},exit:{gfmFootnoteCallString:Uce,gfmFootnoteCall:Hce,gfmFootnoteDefinitionLabelString:$ce,gfmFootnoteDefinition:Vce}}}function Gce(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ZL},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,l){const c=i.createTracker(l);let f=c.move("[^");const d=i.enter("footnoteDefinition"),p=i.enter("label");return f+=c.move(i.safe(i.associationId(r),{before:f,after:"]"})),p(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
607
|
-
`:" ")+i.indentLines(i.containerFlow(r,c.current()),t?JL:Kce))),d(),f}}function Kce(e,t,n){return t===0?e:JL(e,t,n)}function JL(e,t,n){return(n?"":" ")+e}const Qce=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];eP.peek=ede;function Xce(){return{canContainEols:["delete"],enter:{strikethrough:Zce},exit:{strikethrough:Jce}}}function Wce(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Qce}],handlers:{delete:eP}}}function Zce(e){this.enter({type:"delete",children:[]},e)}function Jce(e){this.exit(e)}function eP(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),i(),l}function ede(){return"~"}function tde(e){return e.length}function nde(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||tde,i=[],l=[],c=[],f=[];let d=0,p=-1;for(;++p<e.length;){const T=[],w=[];let N=-1;for(e[p].length>d&&(d=e[p].length);++N<e[p].length;){const A=rde(e[p][N]);if(n.alignDelimiters!==!1){const k=s(A);w[N]=k,(f[N]===void 0||k>f[N])&&(f[N]=k)}T.push(A)}l[p]=T,c[p]=w}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)i[m]=U_(r[m]);else{const T=U_(r);for(;++m<d;)i[m]=T}m=-1;const x=[],y=[];for(;++m<d;){const T=i[m];let w="",N="";T===99?(w=":",N=":"):T===108?w=":":T===114&&(N=":");let A=n.alignDelimiters===!1?1:Math.max(1,f[m]-w.length-N.length);const k=w+"-".repeat(A)+N;n.alignDelimiters!==!1&&(A=w.length+A+N.length,A>f[m]&&(f[m]=A),y[m]=A),x[m]=k}l.splice(1,0,x),c.splice(1,0,y),p=-1;const v=[];for(;++p<l.length;){const T=l[p],w=c[p];m=-1;const N=[];for(;++m<d;){const A=T[m]||"";let k="",R="";if(n.alignDelimiters!==!1){const D=f[m]-(w[m]||0),O=i[m];O===114?k=" ".repeat(D):O===99?D%2?(k=" ".repeat(D/2+.5),R=" ".repeat(D/2-.5)):(k=" ".repeat(D/2),R=k):R=" ".repeat(D)}n.delimiterStart!==!1&&!m&&N.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||m)&&N.push(" "),n.alignDelimiters!==!1&&N.push(k),N.push(A),n.alignDelimiters!==!1&&N.push(R),n.padding!==!1&&N.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&N.push("|")}v.push(n.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return v.join(`
|
|
608
|
-
`)}function rde(e){return e==null?"":String(e)}function U_(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 sde(e,t,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),ade);return s(),l}function ade(e,t,n){return">"+(n?"":" ")+e}function ide(e,t){return H_(e,t.inConstruct,!0)&&!H_(e,t.notInConstruct,!1)}function H_(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 $_(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
609
|
-
`&&ide(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
610
|
-
`}function ode(e,t){const n=String(e);let r=n.indexOf(t),s=r,i=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>l&&(l=i):i=1,s=r+t.length,r=n.indexOf(t,s);return l}function lde(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 ude(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 cde(e,t,n,r){const s=ude(n),i=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(lde(e,n)){const m=n.enter("codeIndented"),x=n.indentLines(i,dde);return m(),x}const c=n.createTracker(r),f=s.repeat(Math.max(ode(i,s)+1,3)),d=n.enter("codeFenced");let p=c.move(f);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
611
|
-
`,encode:["`"],...c.current()})),m()}return p+=c.move(`
|
|
612
|
-
`),i&&(p+=c.move(i+`
|
|
613
|
-
`)),p+=c.move(f),d(),p}function dde(e,t,n){return(n?"":" ")+e}function f2(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 fde(e,t,n,r){const s=f2(n),i=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
614
|
-
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${i}`),d+=f.move(" "+s),d+=f.move(n.safe(e.title,{before:d,after:s,...f.current()})),d+=f.move(s),c()),l(),d}function hde(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 wf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function rc(e){if(e===null||en(e)||fl(e))return 1;if(hg(e))return 2}function i0(e,t,n){const r=rc(e),s=rc(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}tP.peek=mde;function tP(e,t,n,r){const s=hde(n),i=n.enter("emphasis"),l=n.createTracker(r),c=l.move(s);let f=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const d=f.charCodeAt(0),p=i0(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(f=wf(d)+f.slice(1));const m=f.charCodeAt(f.length-1),x=i0(r.after.charCodeAt(0),m,s);x.inside&&(f=f.slice(0,-1)+wf(m));const y=l.move(s);return i(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},c+f+y}function mde(e,t,n){return n.options.emphasis||"*"}const pde={};function h2(e,t){const n=pde,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return nP(e,r,s)}function nP(e,t,n){if(gde(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 V_(e.children,t,n)}return Array.isArray(e)?V_(e,t,n):""}function V_(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=nP(e[s],t,n);return r.join("")}function gde(e){return!!(e&&typeof e=="object")}function xde(e,t){let n=!1;return io(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Iv}),!!((!e.depth||e.depth<3)&&h2(e)&&(t.options.setext||n))}function yde(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(xde(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),x=n.containerPhrasing(e,{...i.current(),before:`
|
|
615
|
-
`,after:`
|
|
616
|
-
`});return m(),p(),x+`
|
|
617
|
-
`+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
618
|
-
`))+1))}const l="#".repeat(s),c=n.enter("headingAtx"),f=n.enter("phrasing");i.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
619
|
-
`,...i.current()});return/^[\t ]/.test(d)&&(d=wf(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}rP.peek=bde;function rP(e){return e.value||""}function bde(){return"<"}sP.peek=vde;function sP(e,t,n,r){const s=f2(n),i=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${i}`),d+=f.move(" "+s),d+=f.move(n.safe(e.title,{before:d,after:s,...f.current()})),d+=f.move(s),c()),d+=f.move(")"),l(),d}function vde(){return"!"}aP.peek=Ede;function aP(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=p,i(),s==="full"||!d||d!==m?f+=c.move(m+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function Ede(){return"!"}iP.peek=Tde;function iP(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const l=n.unsafe[i],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return s+r+s}function Tde(){return"`"}function oP(e,t){const n=h2(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))}lP.peek=Sde;function lP(e,t,n,r){const s=f2(n),i=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(oP(e,n)){const p=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=p,m}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${i}`),d+=l.move(" "+s),d+=l.move(n.safe(e.title,{before:d,after:s,...l.current()})),d+=l.move(s),f()),d+=l.move(")"),c(),d}function Sde(e,t,n){return oP(e,n)?"<":"["}uP.peek=wde;function uP(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=p,i(),s==="full"||!d||d!==m?f+=c.move(m+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function wde(){return"["}function m2(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 Cde(e){const t=m2(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 Nde(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 cP(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 Ade(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?Nde(n):m2(n);const c=e.ordered?l==="."?")":".":Cde(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),cP(n)===l&&p){let m=-1;for(;++m<e.children.length;){const x=e.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=i,s(),d}function kde(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 _de(e,t,n,r){const s=kde(n);let i=n.bulletCurrent||m2(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let l=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(i+" ".repeat(l-i.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),p);return f(),d;function p(m,x,y){return x?(y?"":" ".repeat(l))+m:(y?i:i+" ".repeat(l-i.length))+m}}function Rde(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,r);return i(),s(),l}const Ode=sg(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Dde(e,t,n,r){return(e.children.some(function(l){return Ode(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function jde(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dP.peek=Mde;function dP(e,t,n,r){const s=jde(n),i=n.enter("strong"),l=n.createTracker(r),c=l.move(s+s);let f=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const d=f.charCodeAt(0),p=i0(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(f=wf(d)+f.slice(1));const m=f.charCodeAt(f.length-1),x=i0(r.after.charCodeAt(0),m,s);x.inside&&(f=f.slice(0,-1)+wf(m));const y=l.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},c+f+y}function Mde(e,t,n){return n.options.strong||"*"}function Ide(e,t,n,r){return n.safe(e.value,r)}function Lde(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 Pde(e,t,n){const r=(cP(n)+(n.options.ruleSpaces?" ":"")).repeat(Lde(n));return n.options.ruleSpaces?r.slice(0,-1):r}const fP={blockquote:sde,break:$_,code:cde,definition:fde,emphasis:tP,hardBreak:$_,heading:yde,html:rP,image:sP,imageReference:aP,inlineCode:iP,link:lP,linkReference:uP,list:Ade,listItem:_de,paragraph:Rde,root:Dde,strong:dP,text:Ide,thematicBreak:Pde},q_=document.createElement("i");function p2(e){const t="&"+e+";";q_.innerHTML=t;const n=q_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function hP(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 Bde=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Fde(e){return e.replace(Bde,zde)}function zde(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return hP(n.slice(i?2:1),i?16:10)}return p2(n)||e}function Ude(){return{enter:{table:Hde,tableData:Y_,tableHeader:Y_,tableRow:Vde},exit:{codeText:qde,table:$de,tableData:ab,tableHeader:ab,tableRow:ab}}}function Hde(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 $de(e){this.exit(e),this.data.inTable=void 0}function Vde(e){this.enter({type:"tableRow",children:[]},e)}function ab(e){this.exit(e)}function Y_(e){this.enter({type:"tableCell",children:[]},e)}function qde(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Yde));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Yde(e,t){return t==="|"?t:e}function Gde(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
620
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:f,tableRow:c}};function l(y,v,T,w){return d(p(y,T,w),y.align)}function c(y,v,T,w){const N=m(y,T,w),A=d([N]);return A.slice(0,A.indexOf(`
|
|
621
|
-
`))}function f(y,v,T,w){const N=T.enter("tableCell"),A=T.enter("phrasing"),k=T.containerPhrasing(y,{...w,before:i,after:i});return A(),N(),k}function d(y,v){return nde(y,{align:v,alignDelimiters:r,padding:n,stringLength:s})}function p(y,v,T){const w=y.children;let N=-1;const A=[],k=v.enter("table");for(;++N<w.length;)A[N]=m(w[N],v,T);return k(),A}function m(y,v,T){const w=y.children;let N=-1;const A=[],k=v.enter("tableRow");for(;++N<w.length;)A[N]=f(w[N],y,v,T);return k(),A}function x(y,v,T){let w=fP.inlineCode(y,v,T);return T.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function Kde(){return{exit:{taskListCheckValueChecked:G_,taskListCheckValueUnchecked:G_,paragraph:Xde}}}function Qde(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Wde}}}function G_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Xde(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let i=-1,l;for(;++i<s.length;){const c=s[i];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 Wde(e,t,n,r){const s=e.children[0],i=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);i&&c.move(l);let f=fP.listItem(e,t,n,{...r,...c.current()});return i&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(p){return p+l}}function Zde(){return[Cce(),Yce(),Xce(),Ude(),Kde()]}function Jde(e){return{extensions:[Nce(),Gce(e),Wce(),Gde(e),Qde()]}}function ts(e,t,n,r){const s=e.length;let i=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function xs(e,t){return e.length>0?(ts(e,e.length,0,t),e):t}const K_={}.hasOwnProperty;function mP(e){const t={};let n=-1;for(;++n<e.length;)efe(t,e[n]);return t}function efe(e,t){let n;for(n in t){const s=(K_.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){K_.call(s,l)||(s[l]=[]);const c=i[l];tfe(s[l],Array.isArray(c)?c:c?[c]:[])}}}function tfe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ts(e,0,0,r)}const nfe={tokenize:lfe,partial:!0},pP={tokenize:ufe,partial:!0},gP={tokenize:cfe,partial:!0},xP={tokenize:dfe,partial:!0},rfe={tokenize:ffe,partial:!0},yP={name:"wwwAutolink",tokenize:ife,previous:vP},bP={name:"protocolAutolink",tokenize:ofe,previous:EP},oi={name:"emailAutolink",tokenize:afe,previous:TP},wa={};function sfe(){return{text:wa}}let Lo=48;for(;Lo<123;)wa[Lo]=oi,Lo++,Lo===58?Lo=65:Lo===91&&(Lo=97);wa[43]=oi;wa[45]=oi;wa[46]=oi;wa[95]=oi;wa[72]=[oi,bP];wa[104]=[oi,bP];wa[87]=[oi,yP];wa[119]=[oi,yP];function afe(e,t,n){const r=this;let s,i;return l;function l(m){return!qv(m)||!TP.call(r,r.previous)||g2(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return qv(m)?(e.consume(m),c):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(rfe,p,d)(m):m===45||m===95||pr(m)?(i=!0,e.consume(m),f):p(m)}function d(m){return e.consume(m),s=!0,f}function p(m){return i&&s&&wr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function ife(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!vP.call(r,r.previous)||g2(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nfe,e.attempt(pP,e.attempt(gP,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function ofe(e,t,n){const r=this;let s="",i=!1;return l;function l(m){return(m===72||m===104)&&EP.call(r,r.previous)&&!g2(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(wr(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),i?d:(i=!0,f)):n(m)}function d(m){return m===null||a0(m)||en(m)||fl(m)||hg(m)?n(m):e.attempt(pP,e.attempt(gP,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function lfe(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function ufe(e,t,n){let r,s,i;return l;function l(d){return d===46||d===95?e.check(xP,f,c)(d):d===null||en(d)||fl(d)||d!==45&&hg(d)?f(d):(i=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),l}function f(d){return s||r||!i?n(d):t(d)}}function cfe(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?i(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(xP,t,i)(l):l===null||en(l)||fl(l)?t(l):(e.consume(l),s)}function i(l){return l===41&&r++,e.consume(l),s}}function dfe(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),i):c===93?(e.consume(c),s):c===60||c===null||en(c)||fl(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||en(c)||fl(c)?t(c):r(c)}function i(c){return wr(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):wr(c)?(e.consume(c),l):n(c)}}function ffe(e,t,n){return r;function r(i){return e.consume(i),s}function s(i){return pr(i)?n(i):t(i)}}function vP(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||en(e)}function EP(e){return!wr(e)}function TP(e){return!(e===47||qv(e))}function qv(e){return e===43||e===45||e===46||e===95||pr(e)}function g2(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 Ac(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&pr(e.charCodeAt(n+1))&&pr(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const c=e.charCodeAt(n+1);i<56320&&c>56319&&c<57344?(l=String.fromCharCode(i,c),s=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function mg(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Yv={name:"attention",resolveAll:hfe,tokenize:mfe};function hfe(e,t){let n=-1,r,s,i,l,c,f,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=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},x={...e[n][1].start};Q_(m,-f),Q_(x,f),l={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},i={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=xs(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=xs(d,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",i,t]]),d=xs(d,mg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=xs(d,[["exit",i,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=xs(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ts(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function mfe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=rc(r);let i;return l;function l(f){return i=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===i)return e.consume(f),c;const d=e.exit("attentionSequence"),p=rc(f),m=!p||p===2&&s||n.includes(f),x=!s||s===2&&p||n.includes(r);return d._open=!!(i===42?m:m&&(s||!x)),d._close=!!(i===42?x:x&&(p||!m)),t(f)}}function Q_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const pfe={name:"autolink",tokenize:gfe};function gfe(e,t,n){let r=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(y){return wr(y)?(e.consume(y),l):y===64?n(y):d(y)}function l(y){return y===43||y===45||y===46||pr(y)?(r=1,c(y)):d(y)}function c(y){return y===58?(e.consume(y),r=0,f):(y===43||y===45||y===46||pr(y))&&r++<32?(e.consume(y),c):(r=0,d(y))}function f(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||a0(y)?n(y):(e.consume(y),f)}function d(y){return y===64?(e.consume(y),p):xce(y)?(e.consume(y),d):n(y)}function p(y){return pr(y)?m(y):n(y)}function m(y){return y===46?(e.consume(y),r=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):x(y)}function x(y){if((y===45||pr(y))&&r++<63){const v=y===45?x:m;return e.consume(y),v}return n(y)}}function Dt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(f){return bt(f)?(e.enter(n),c(f)):t(f)}function c(f){return bt(f)&&i++<s?(e.consume(f),c):(e.exit(n),t(f))}}const ph={partial:!0,tokenize:xfe};function xfe(e,t,n){return r;function r(i){return bt(i)?Dt(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||Qe(i)?t(i):n(i)}}const SP={continuation:{tokenize:bfe},exit:vfe,name:"blockQuote",tokenize:yfe};function yfe(e,t,n){const r=this;return s;function s(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"),i}return n(l)}function i(l){return bt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function bfe(e,t,n){const r=this;return s;function s(l){return bt(l)?Dt(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(SP,t,n)(l)}}function vfe(e){e.exit("blockQuote")}const wP={name:"characterEscape",tokenize:Efe};function Efe(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return bce(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const CP={name:"characterReference",tokenize:Tfe};function Tfe(e,t,n){const r=this;let s=0,i,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),f}function f(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),i=31,l=pr,p(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=yce,p):(e.enter("characterReferenceValue"),i=7,l=Vv,p(m))}function p(m){if(m===59&&s){const x=e.exit("characterReferenceValue");return l===pr&&!p2(r.sliceSerialize(x))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&s++<i?(e.consume(m),p):n(m)}}const X_={partial:!0,tokenize:wfe},W_={concrete:!0,name:"codeFenced",tokenize:Sfe};function Sfe(e,t,n){const r=this,s={partial:!0,tokenize:D};let i=0,l=0,c;return f;function f(O){return d(O)}function d(O){const M=r.events[r.events.length-1];return i=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,c=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===c?(l++,e.consume(O),p):l<3?n(O):(e.exit("codeFencedFenceSequence"),bt(O)?Dt(e,m,"whitespace")(O):m(O))}function m(O){return O===null||Qe(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(X_,T,R)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||Qe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(O)):bt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Dt(e,y,"whitespace")(O)):O===96&&O===c?n(O):(e.consume(O),x)}function y(O){return O===null||Qe(O)?m(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(O))}function v(O){return O===null||Qe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(O)):O===96&&O===c?n(O):(e.consume(O),v)}function T(O){return e.attempt(s,R,w)(O)}function w(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),N}function N(O){return i>0&&bt(O)?Dt(e,A,"linePrefix",i+1)(O):A(O)}function A(O){return O===null||Qe(O)?e.check(X_,T,R)(O):(e.enter("codeFlowValue"),k(O))}function k(O){return O===null||Qe(O)?(e.exit("codeFlowValue"),A(O)):(e.consume(O),k)}function R(O){return e.exit("codeFenced"),t(O)}function D(O,M,I){let H=0;return P;function P(J){return O.enter("lineEnding"),O.consume(J),O.exit("lineEnding"),K}function K(J){return O.enter("codeFencedFence"),bt(J)?Dt(O,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):Y(J)}function Y(J){return J===c?(O.enter("codeFencedFenceSequence"),W(J)):I(J)}function W(J){return J===c?(H++,O.consume(J),W):H>=l?(O.exit("codeFencedFenceSequence"),bt(J)?Dt(O,te,"whitespace")(J):te(J)):I(J)}function te(J){return J===null||Qe(J)?(O.exit("codeFencedFence"),M(J)):I(J)}}}function wfe(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const ib={name:"codeIndented",tokenize:Nfe},Cfe={partial:!0,tokenize:Afe};function Nfe(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),Dt(e,i,"linePrefix",5)(d)}function i(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):Qe(d)?e.attempt(Cfe,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||Qe(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function Afe(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Qe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Dt(e,i,"linePrefix",5)(l)}function i(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):Qe(l)?s(l):n(l)}}const kfe={name:"codeText",previous:Rfe,resolve:_fe,tokenize:Ofe};function _fe(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function Rfe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ofe(e,t,n){let r=0,s,i;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"),f(m))}function f(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(i=e.enter("codeTextSequence"),s=0,p(m)):Qe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Qe(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),d)}function p(m){return m===96?(e.consume(m),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(i.type="codeTextData",d(m))}}class Dfe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Od(this.left,r),i.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),Od(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Od(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);Od(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Od(this.left,n.reverse())}}}function Od(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 NP(e){const t={};let n=-1,r,s,i,l,c,f,d;const p=new Dfe(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,jfe(p,n)),n=t[n],d=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(l=p.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},c=p.slice(s,n),c.unshift(r),p.splice(s,n-s+1,c))}}return ts(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function jfe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let p,m,x=-1,y=n,v=0,T=0;const w=[T];for(;y;){for(;e.get(++s)[1]!==y;);i.push(s),y._tokenizer||(p=r.sliceStream(y),y.next||p.push(null),m&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=y,y=y.next}for(y=n;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(T=x+1,w.push(T),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):w.pop(),x=w.length;x--;){const N=c.slice(w[x],w[x+1]),A=i.pop();f.push([A,A+N.length-1]),e.splice(A,2,N)}for(f.reverse(),x=-1;++x<f.length;)d[v+f[x][0]]=v+f[x][1],v+=f[x][1]-f[x][0]-1;return d}const Mfe={resolve:Lfe,tokenize:Pfe},Ife={partial:!0,tokenize:Bfe};function Lfe(e){return NP(e),e}function Pfe(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?i(c):Qe(c)?e.check(Ife,l,i)(c):(e.consume(c),s)}function i(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,s}}function Bfe(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Dt(e,i,"linePrefix")}function i(l){if(l===null||Qe(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 AP(e,t,n,r,s,i,l,c,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(N){return N===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(N),e.exit(i),x):N===null||N===32||N===41||a0(N)?n(N):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),T(N))}function x(N){return N===62?(e.enter(i),e.consume(N),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(N))}function y(N){return N===62?(e.exit("chunkString"),e.exit(c),x(N)):N===null||N===60||Qe(N)?n(N):(e.consume(N),N===92?v:y)}function v(N){return N===60||N===62||N===92?(e.consume(N),y):y(N)}function T(N){return!p&&(N===null||N===41||en(N))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(N)):p<d&&N===40?(e.consume(N),p++,T):N===41?(e.consume(N),p--,T):N===null||N===32||N===40||a0(N)?n(N):(e.consume(N),N===92?w:T)}function w(N){return N===40||N===41||N===92?(e.consume(N),T):T(N)}}function kP(e,t,n,r,s,i){const l=this;let c=0,f;return d;function d(y){return e.enter(r),e.enter(s),e.consume(y),e.exit(s),e.enter(i),p}function p(y){return c>999||y===null||y===91||y===93&&!f||y===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(i),e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):Qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||Qe(y)||c++>999?(e.exit("chunkString"),p(y)):(e.consume(y),f||(f=!bt(y)),y===92?x:m)}function x(y){return y===91||y===92||y===93?(e.consume(y),c++,m):m(y)}}function _P(e,t,n,r,s,i){let l;return c;function c(x){return x===34||x===39||x===40?(e.enter(r),e.enter(s),e.consume(x),e.exit(s),l=x===40?41:x,f):n(x)}function f(x){return x===l?(e.enter(s),e.consume(x),e.exit(s),e.exit(r),t):(e.enter(i),d(x))}function d(x){return x===l?(e.exit(i),f(l)):x===null?n(x):Qe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Dt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===l||x===null||Qe(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?m:p)}function m(x){return x===l||x===92?(e.consume(x),p):p(x)}}function nf(e,t){let n;return r;function r(s){return Qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):bt(s)?Dt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const Ffe={name:"definition",tokenize:Ufe},zfe={partial:!0,tokenize:Hfe};function Ufe(e,t,n){const r=this;let s;return i;function i(y){return e.enter("definition"),l(y)}function l(y){return kP.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return s=$s(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):n(y)}function f(y){return en(y)?nf(e,d)(y):d(y)}function d(y){return AP(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(zfe,m,m)(y)}function m(y){return bt(y)?Dt(e,x,"whitespace")(y):x(y)}function x(y){return y===null||Qe(y)?(e.exit("definition"),r.parser.defined.push(s),t(y)):n(y)}}function Hfe(e,t,n){return r;function r(c){return en(c)?nf(e,s)(c):n(c)}function s(c){return _P(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function i(c){return bt(c)?Dt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Qe(c)?t(c):n(c)}}const $fe={name:"hardBreakEscape",tokenize:Vfe};function Vfe(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Qe(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const qfe={name:"headingAtx",resolve:Yfe,tokenize:Gfe};function Yfe(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ts(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function Gfe(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),i(p)}function i(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||en(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Qe(p)?(e.exit("atxHeading"),t(p)):bt(p)?Dt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),c(p))}function d(p){return p===null||p===35||en(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const Kfe=["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"],Z_=["pre","script","style","textarea"],Qfe={concrete:!0,name:"htmlFlow",resolveTo:Zfe,tokenize:Jfe},Xfe={partial:!0,tokenize:the},Wfe={partial:!0,tokenize:ehe};function Zfe(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 Jfe(e,t,n){const r=this;let s,i,l,c,f;return d;function d(j){return p(j)}function p(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),m}function m(j){return j===33?(e.consume(j),x):j===47?(e.consume(j),i=!0,T):j===63?(e.consume(j),s=3,r.interrupt?t:z):wr(j)?(e.consume(j),l=String.fromCharCode(j),w):n(j)}function x(j){return j===45?(e.consume(j),s=2,y):j===91?(e.consume(j),s=5,c=0,v):wr(j)?(e.consume(j),s=4,r.interrupt?t:z):n(j)}function y(j){return j===45?(e.consume(j),r.interrupt?t:z):n(j)}function v(j){const re="CDATA[";return j===re.charCodeAt(c++)?(e.consume(j),c===re.length?r.interrupt?t:Y:v):n(j)}function T(j){return wr(j)?(e.consume(j),l=String.fromCharCode(j),w):n(j)}function w(j){if(j===null||j===47||j===62||en(j)){const re=j===47,ae=l.toLowerCase();return!re&&!i&&Z_.includes(ae)?(s=1,r.interrupt?t(j):Y(j)):Kfe.includes(l.toLowerCase())?(s=6,re?(e.consume(j),N):r.interrupt?t(j):Y(j)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?A(j):k(j))}return j===45||pr(j)?(e.consume(j),l+=String.fromCharCode(j),w):n(j)}function N(j){return j===62?(e.consume(j),r.interrupt?t:Y):n(j)}function A(j){return bt(j)?(e.consume(j),A):P(j)}function k(j){return j===47?(e.consume(j),P):j===58||j===95||wr(j)?(e.consume(j),R):bt(j)?(e.consume(j),k):P(j)}function R(j){return j===45||j===46||j===58||j===95||pr(j)?(e.consume(j),R):D(j)}function D(j){return j===61?(e.consume(j),O):bt(j)?(e.consume(j),D):k(j)}function O(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),f=j,M):bt(j)?(e.consume(j),O):I(j)}function M(j){return j===f?(e.consume(j),f=null,H):j===null||Qe(j)?n(j):(e.consume(j),M)}function I(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||en(j)?D(j):(e.consume(j),I)}function H(j){return j===47||j===62||bt(j)?k(j):n(j)}function P(j){return j===62?(e.consume(j),K):n(j)}function K(j){return j===null||Qe(j)?Y(j):bt(j)?(e.consume(j),K):n(j)}function Y(j){return j===45&&s===2?(e.consume(j),L):j===60&&s===1?(e.consume(j),B):j===62&&s===4?(e.consume(j),q):j===63&&s===3?(e.consume(j),z):j===93&&s===5?(e.consume(j),ne):Qe(j)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Xfe,V,W)(j)):j===null||Qe(j)?(e.exit("htmlFlowData"),W(j)):(e.consume(j),Y)}function W(j){return e.check(Wfe,te,V)(j)}function te(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),J}function J(j){return j===null||Qe(j)?W(j):(e.enter("htmlFlowData"),Y(j))}function L(j){return j===45?(e.consume(j),z):Y(j)}function B(j){return j===47?(e.consume(j),l="",U):Y(j)}function U(j){if(j===62){const re=l.toLowerCase();return Z_.includes(re)?(e.consume(j),q):Y(j)}return wr(j)&&l.length<8?(e.consume(j),l+=String.fromCharCode(j),U):Y(j)}function ne(j){return j===93?(e.consume(j),z):Y(j)}function z(j){return j===62?(e.consume(j),q):j===45&&s===2?(e.consume(j),z):Y(j)}function q(j){return j===null||Qe(j)?(e.exit("htmlFlowData"),V(j)):(e.consume(j),q)}function V(j){return e.exit("htmlFlow"),t(j)}}function ehe(e,t,n){const r=this;return s;function s(l){return Qe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function the(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ph,t,n)}}const nhe={name:"htmlText",tokenize:rhe};function rhe(e,t,n){const r=this;let s,i,l;return c;function c(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),d):z===47?(e.consume(z),D):z===63?(e.consume(z),k):wr(z)?(e.consume(z),I):n(z)}function d(z){return z===45?(e.consume(z),p):z===91?(e.consume(z),i=0,v):wr(z)?(e.consume(z),A):n(z)}function p(z){return z===45?(e.consume(z),y):n(z)}function m(z){return z===null?n(z):z===45?(e.consume(z),x):Qe(z)?(l=m,B(z)):(e.consume(z),m)}function x(z){return z===45?(e.consume(z),y):m(z)}function y(z){return z===62?L(z):z===45?x(z):m(z)}function v(z){const q="CDATA[";return z===q.charCodeAt(i++)?(e.consume(z),i===q.length?T:v):n(z)}function T(z){return z===null?n(z):z===93?(e.consume(z),w):Qe(z)?(l=T,B(z)):(e.consume(z),T)}function w(z){return z===93?(e.consume(z),N):T(z)}function N(z){return z===62?L(z):z===93?(e.consume(z),N):T(z)}function A(z){return z===null||z===62?L(z):Qe(z)?(l=A,B(z)):(e.consume(z),A)}function k(z){return z===null?n(z):z===63?(e.consume(z),R):Qe(z)?(l=k,B(z)):(e.consume(z),k)}function R(z){return z===62?L(z):k(z)}function D(z){return wr(z)?(e.consume(z),O):n(z)}function O(z){return z===45||pr(z)?(e.consume(z),O):M(z)}function M(z){return Qe(z)?(l=M,B(z)):bt(z)?(e.consume(z),M):L(z)}function I(z){return z===45||pr(z)?(e.consume(z),I):z===47||z===62||en(z)?H(z):n(z)}function H(z){return z===47?(e.consume(z),L):z===58||z===95||wr(z)?(e.consume(z),P):Qe(z)?(l=H,B(z)):bt(z)?(e.consume(z),H):L(z)}function P(z){return z===45||z===46||z===58||z===95||pr(z)?(e.consume(z),P):K(z)}function K(z){return z===61?(e.consume(z),Y):Qe(z)?(l=K,B(z)):bt(z)?(e.consume(z),K):H(z)}function Y(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),s=z,W):Qe(z)?(l=Y,B(z)):bt(z)?(e.consume(z),Y):(e.consume(z),te)}function W(z){return z===s?(e.consume(z),s=void 0,J):z===null?n(z):Qe(z)?(l=W,B(z)):(e.consume(z),W)}function te(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||en(z)?H(z):(e.consume(z),te)}function J(z){return z===47||z===62||en(z)?H(z):n(z)}function L(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function B(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),U}function U(z){return bt(z)?Dt(e,ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):ne(z)}function ne(z){return e.enter("htmlTextData"),l(z)}}const x2={name:"labelEnd",resolveAll:ohe,resolveTo:lhe,tokenize:uhe},she={tokenize:che},ahe={tokenize:dhe},ihe={tokenize:fhe};function ohe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&ts(e,0,e.length,n),e}function lhe(e,t){let n=e.length,r=0,s,i,l,c;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const f={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=xs(c,e.slice(i+1,i+r+3)),c=xs(c,[["enter",p,t]]),c=xs(c,mg(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),c=xs(c,[["exit",p,t],e[l-2],e[l-1],["exit",d,t]]),c=xs(c,e.slice(l+1)),c=xs(c,[["exit",f,t]]),ts(e,i,e.length,c),e}function uhe(e,t,n){const r=this;let s=r.events.length,i,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return c;function c(x){return i?i._inactive?m(x):(l=r.parser.defined.includes($s(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),f):n(x)}function f(x){return x===40?e.attempt(she,p,l?p:m)(x):x===91?e.attempt(ahe,p,l?d:m)(x):l?p(x):m(x)}function d(x){return e.attempt(ihe,p,m)(x)}function p(x){return t(x)}function m(x){return i._balanced=!0,n(x)}}function che(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return en(m)?nf(e,i)(m):i(m)}function i(m){return m===41?p(m):AP(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return en(m)?nf(e,f)(m):p(m)}function c(m){return n(m)}function f(m){return m===34||m===39||m===40?_P(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return en(m)?nf(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function dhe(e,t,n){const r=this;return s;function s(c){return kP.call(r,e,i,l,"reference","referenceMarker","referenceString")(c)}function i(c){return r.parser.defined.includes($s(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function fhe(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const hhe={name:"labelStartImage",resolveAll:x2.resolveAll,tokenize:mhe};function mhe(e,t,n){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),i}function i(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 phe={name:"labelStartLink",resolveAll:x2.resolveAll,tokenize:ghe};function ghe(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const ob={name:"lineEnding",tokenize:xhe};function xhe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Dt(e,t,"linePrefix")}}const Np={name:"thematicBreak",tokenize:yhe};function yhe(e,t,n){let r=0,s;return i;function i(d){return e.enter("thematicBreak"),l(d)}function l(d){return s=d,c(d)}function c(d){return d===s?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||Qe(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===s?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),bt(d)?Dt(e,c,"whitespace")(d):c(d))}}const Fr={continuation:{tokenize:The},exit:whe,name:"list",tokenize:Ehe},bhe={partial:!0,tokenize:Che},vhe={partial:!0,tokenize:She};function Ehe(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return c;function c(y){const v=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Vv(y)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Np,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return n(y)}function f(y){return Vv(y)&&++l<10?(e.consume(y),f):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(ph,r.interrupt?n:p,e.attempt(bhe,x,m))}function p(y){return r.containerState.initialBlankLine=!0,i++,x(y)}function m(y){return bt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),x):n(y)}function x(y){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function The(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ph,s,i);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Dt(e,t,"listItemIndent",r.containerState.size+1)(c)}function i(c){return r.containerState.furtherBlankLines||!bt(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(vhe,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Dt(e,e.attempt(Fr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function She(e,t,n){const r=this;return Dt(e,s,"listItemIndent",r.containerState.size+1);function s(i){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(i):n(i)}}function whe(e){e.exit(this.containerState.type)}function Che(e,t,n){const r=this;return Dt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const l=r.events[r.events.length-1];return!bt(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const J_={name:"setextUnderline",resolveTo:Nhe,tokenize:Ahe};function Nhe(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ahe(e,t,n){const r=this;let s;return i;function i(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===s?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),bt(d)?Dt(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Qe(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const khe={tokenize:Lhe,partial:!0};function _he(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jhe,continuation:{tokenize:Mhe},exit:Ihe}},text:{91:{name:"gfmFootnoteCall",tokenize:Dhe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Rhe,resolveTo:Ohe}}}}function Rhe(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const f=r.events[s][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=$s(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function Ohe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function Dhe(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(i>999||m===93&&!l||m===null||m===91||en(m))return n(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes($s(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return en(m)||(l=!0),i++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),i++,d):d(m)}}function jhe(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,c;return f;function f(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(v)}function p(v){if(l>999||v===93&&!c||v===null||v===91||en(v))return n(v);if(v===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return i=$s(r.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return en(v)||(c=!0),l++,e.consume(v),v===92?m:p}function m(v){return v===91||v===92||v===93?(e.consume(v),l++,p):p(v)}function x(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),s.includes(i)||s.push(i),Dt(e,y,"gfmFootnoteDefinitionWhitespace")):n(v)}function y(v){return t(v)}}function Mhe(e,t,n){return e.check(ph,t,e.attempt(khe,t,n))}function Ihe(e){e.exit("gfmFootnoteDefinition")}function Lhe(e,t,n){const r=this;return Dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function Phe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},m={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},x=[["enter",p,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",m,c]],y=c.parser.constructs.insideSpan.null;y&&ts(x,x.length,0,mg(y,l.slice(d+1,f),c)),ts(x,x.length,0,[["exit",m,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",p,c]]),ts(l,d-1,f-d+3,x),f=d+x.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function i(l,c,f){const d=this.previous,p=this.events;let m=0;return x;function x(v){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(v):(l.enter("strikethroughSequenceTemporary"),y(v))}function y(v){const T=rc(d);if(v===126)return m>1?f(v):(l.consume(v),m++,y);if(m<2&&!n)return f(v);const w=l.exit("strikethroughSequenceTemporary"),N=rc(v);return w._open=!N||N===2&&!!T,w._close=!T||T===2&&!!N,c(v)}}}class Bhe{constructor(){this.map=[]}add(t,n,r){Fhe(this,t,n,r)}consume(t){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function Fhe(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function zhe(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Uhe(){return{flow:{null:{name:"table",tokenize:Hhe,resolveAll:$he}}}}function Hhe(e,t,n){const r=this;let s=0,i=0,l;return c;function c(P){let K=r.events.length-1;for(;K>-1;){const te=r.events[K][1].type;if(te==="lineEnding"||te==="linePrefix")K--;else break}const Y=K>-1?r.events[K][1].type:null,W=Y==="tableHead"||Y==="tableRow"?O:f;return W===O&&r.parser.lazy[r.now().line]?n(P):W(P)}function f(P){return e.enter("tableHead"),e.enter("tableRow"),d(P)}function d(P){return P===124||(l=!0,i+=1),p(P)}function p(P){return P===null?n(P):Qe(P)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),y):n(P):bt(P)?Dt(e,p,"whitespace")(P):(i+=1,l&&(l=!1,s+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(P)))}function m(P){return P===null||P===124||en(P)?(e.exit("data"),p(P)):(e.consume(P),P===92?x:m)}function x(P){return P===92||P===124?(e.consume(P),m):m(P)}function y(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),l=!1,bt(P)?Dt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):v(P))}function v(P){return P===45||P===58?w(P):P===124?(l=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),T):D(P)}function T(P){return bt(P)?Dt(e,w,"whitespace")(P):w(P)}function w(P){return P===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),N):P===45?(i+=1,N(P)):P===null||Qe(P)?R(P):D(P)}function N(P){return P===45?(e.enter("tableDelimiterFiller"),A(P)):D(P)}function A(P){return P===45?(e.consume(P),A):P===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(P))}function k(P){return bt(P)?Dt(e,R,"whitespace")(P):R(P)}function R(P){return P===124?v(P):P===null||Qe(P)?!l||s!==i?D(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):D(P)}function D(P){return n(P)}function O(P){return e.enter("tableRow"),M(P)}function M(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),M):P===null||Qe(P)?(e.exit("tableRow"),t(P)):bt(P)?Dt(e,M,"whitespace")(P):(e.enter("data"),I(P))}function I(P){return P===null||P===124||en(P)?(e.exit("data"),M(P)):(e.consume(P),P===92?H:I)}function H(P){return P===92||P===124?(e.consume(P),I):I(P)}}function $he(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,p,m;const x=new Bhe;for(;++n<e.length;){const y=e[n],v=y[1];y[0]==="enter"?v.type==="tableHead"?(c=!1,f!==0&&(eR(x,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},x.add(n,0,[["enter",d,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,m=void 0,i=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},x.add(n,0,[["enter",p,t]])),s=v.type==="tableDelimiterRow"?2:p?3:1):s&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],m=ap(x,t,i,s,void 0,m),i=[0,0,0,0]),l[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],m=ap(x,t,i,s,void 0,m)),i=l,l=[i[1],n,0,0])):v.type==="tableHead"?(c=!0,f=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(f=n,i[1]!==0?(l[0]=l[1],m=ap(x,t,i,s,n,m)):l[1]!==0&&(m=ap(x,t,l,s,n,m)),s=0):s&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&eR(x,t,f,d,p),x.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=zhe(t.events,n))}return e}function ap(e,t,n,r,s,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(i.end=Object.assign({},wu(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const f=wu(t.events,n[1]);if(i={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const d=wu(t.events,n[2]),p=wu(t.events,n[3]),m={type:c,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const x=t.events[n[2]],y=t.events[n[3]];if(x[1].end=Object.assign({},y[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,T=n[3]-n[2]-1;e.add(v,T,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(i.end=Object.assign({},wu(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function eR(e,t,n,r,s){const i=[],l=wu(t.events,n);s&&(s.end=Object.assign({},l),i.push(["exit",s,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function wu(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Vhe={name:"tasklistCheck",tokenize:Yhe};function qhe(){return{text:{91:Vhe}}}function Yhe(e,t,n){const r=this;return s;function s(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),i)}function i(f){return en(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Qe(f)?t(f):bt(f)?e.check({tokenize:Ghe},t,n)(f):n(f)}}function Ghe(e,t,n){return Dt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function Khe(e){return mP([sfe(),_he(),Phe(e),Uhe(),qhe()])}const Qhe={};function Xhe(e){const t=this,n=e||Qhe,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(Khe(n)),i.push(Zde()),l.push(Jde(n))}var Whe=Object.defineProperty,Zhe=Object.defineProperties,Jhe=Object.getOwnPropertyDescriptors,tR=Object.getOwnPropertySymbols,eme=Object.prototype.hasOwnProperty,tme=Object.prototype.propertyIsEnumerable,nR=(e,t,n)=>t in e?Whe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RP=(e,t)=>{for(var n in t||(t={}))eme.call(t,n)&&nR(e,n,t[n]);if(tR)for(var n of tR(t))tme.call(t,n)&&nR(e,n,t[n]);return e},OP=(e,t)=>Zhe(e,Jhe(t)),nme=/(\*\*)([^*]*\*?)$/,rme=/(__)([^_]*?)$/,sme=/(\*\*\*)([^*]*?)$/,ame=/(\*)([^*]*?)$/,ime=/(_)([^_]*?)$/,ome=/(`)([^`]*?)$/,lme=/(~~)([^~]*?)$/,Sl=/^[\s_~*`]*$/,DP=/^[\s]*[-*+][\s]+$/,ume=/[\p{L}\p{N}_]/u,cme=/^```[^`\n]*```?$/,dme=/^\*{4,}$/,fme=/(__)([^_]+)_$/,hme=/(~~)([^~]+)~$/,rR=/~~/g,oo=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:ume.test(e)},Cf=(e,t)=>{let n=!1;for(let r=0;r<t;r+=1)e[r]==="`"&&e[r+1]==="`"&&e[r+2]==="`"&&(n=!n,r+=2);return n},mme=(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},jP=(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},pg=(e,t)=>{let n=!1,r=!1;for(let s=0;s<e.length&&s<t;s+=1){if(e[s]==="\\"&&e[s+1]==="$"){s+=1;continue}e[s]==="$"&&(e[s+1]==="$"?(r=!r,s+=1,n=!1):r||(n=!n))}return n||r},pme=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
622
|
-
`)return!1}return!1},MP=(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]==="]"?pme(e,t):!1;if(e[n]===`
|
|
623
|
-
`)return!1}return!1},gme=(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]===`
|
|
624
|
-
`)return!1}return!1},y2=(e,t,n)=>{let r=0;for(let f=t-1;f>=0;f-=1)if(e[f]===`
|
|
625
|
-
`){r=f+1;break}let s=e.length;for(let f=t;f<e.length;f+=1)if(e[f]===`
|
|
626
|
-
`){s=f;break}let i=e.substring(r,s),l=0,c=!1;for(let f of i)if(f===n)l+=1;else if(f!==" "&&f!==" "){c=!0;break}return l>=3&&!c},xme=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,yme=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(xme,(t,n,r,s)=>Cf(e,s)?t:`${n}\\>${r}`),bme=(e,t,n,r)=>n==="\\"||e.includes("$")&&pg(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&oo(n)&&oo(r)||(!n||n===" "||n===" "||n===`
|
|
627
|
-
`)&&(!r||r===" "||r===" "||r===`
|
|
628
|
-
`)),IP=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="*")continue;let i=s>0?e[s-1]:"",l=s<r-1?e[s+1]:"";bme(e,s,i,l)||(t+=1)}return t},vme=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&pg(e,t)||MP(e,t)||gme(e,t)||n==="_"||r==="_"||n&&r&&oo(n)&&oo(r)),Eme=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="_")continue;let i=s>0?e[s-1]:"",l=s<r-1?e[s+1]:"";vme(e,s,i,l)||(t+=1)}return t},Tme=e=>{let t=0,n=0,r=!1;for(let s=0;s<e.length;s+=1){if(e[s]==="`"&&s+2<e.length&&e[s+1]==="`"&&e[s+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,s+=2;continue}r||(e[s]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},b2=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},sR=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},Sme=(e,t,n)=>{if(!t||Sl.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
629
|
-
`),s=r===-1?0:r+1,i=e.substring(s,n);return DP.test(i)&&t.includes(`
|
|
630
|
-
`)?!0:y2(e,n,"*")},wme=e=>{let t=e.match(nme);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Cf(e,r)||Sme(e,n,r)?e:b2(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},Cme=(e,t,n)=>{if(!t||Sl.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
631
|
-
`),s=r===-1?0:r+1,i=e.substring(s,n);return DP.test(i)&&t.includes(`
|
|
632
|
-
`)?!0:y2(e,n,"_")},Nme=e=>{let t=e.match(rme);if(!t){let s=e.match(fme);if(s){let i=e.lastIndexOf(s[1]);if(!Cf(e,i)&&sR(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Cf(e,r)||Cme(e,n,r)?e:sR(e)%2===1?`${e}__`:e},Ame=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]!=="\\"&&!pg(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
|
|
633
|
-
`)&&(!s||s===" "||s===" "||s===`
|
|
634
|
-
`)||r&&s&&oo(r)&&oo(s))continue;return n}}return-1},kme=e=>{if(!e.match(ame))return e;let t=Ame(e);if(t===-1)return e;let n=e.substring(t+1);return!n||Sl.test(n)?e:IP(e)%2===1?`${e}*`:e},LP=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]!=="\\"&&!pg(e,n)&&!MP(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if(r&&s&&oo(r)&&oo(s))continue;return n}}return-1},_me=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
635
|
-
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},Rme=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(b2(t)%2!==1)return null;let n=t.indexOf("**"),r=LP(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},Ome=e=>{if(!e.match(ime))return e;let t=LP(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||Sl.test(n))return e;if(Eme(e)%2===1){let r=Rme(e);return r!==null?r:_me(e)}return e},Dme=e=>{let t=b2(e),n=IP(e);return t%2===0&&n%2===0},jme=(e,t,n)=>!t||Sl.test(t)||Cf(e,n)?!0:y2(e,n,"*"),Mme=e=>{if(dme.test(e))return e;let t=e.match(sme);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return jme(e,n,r)?e:Tme(e)%2===1?Dme(e)?e:`${e}***`:e},Nf=(e,t)=>{let n=!1,r=!1;for(let s=0;s<t;s+=1){if(e.substring(s,s+3)==="```"){r=!r,s+=2;continue}!r&&e[s]==="`"&&(n=!n)}return n||r},Ime=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",s=t>1&&e.substring(t-2,t+1)==="```";return n||r||s},Lme=e=>{let t=0;for(let n=0;n<e.length;n+=1)e[n]==="`"&&!Ime(e,n)&&(t+=1);return t},Pme=/<[a-zA-Z/][^>]*$/,Bme=e=>{let t=e.match(Pme);return!t||t.index===void 0||Nf(e,t.index)?e:e.substring(0,t.index).trimEnd()},Fme=e=>!e.match(cme)||e.includes(`
|
|
636
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,zme=e=>(e.match(/```/g)||[]).length%2===1,Ume=e=>{let t=Fme(e);if(t!==null)return t;let n=e.match(ome);if(n&&!zme(e)){let r=n[2];if(!r||Sl.test(r))return e;if(Lme(e)%2===1)return`${e}\``}return e},Hme=(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)==="```",$me=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!Hme(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},Vme=e=>{let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
637
|
-
`,t)!==-1&&!e.endsWith(`
|
|
638
|
-
`)?`${e}
|
|
639
|
-
$$`:`${e}$$`},qme=e=>$me(e)%2===0?e:Vme(e),Yme=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=mme(e,t);if(r===-1||Nf(e,r))return null;let s=r>0&&e[r-1]==="!",i=s?r-1:r,l=e.substring(0,i);if(s)return l;let c=e.substring(r+1,t);return n==="text-only"?`${l}${c}`:`${l}[${c}](streamdown:incomplete-link)`},aR=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Nf(e,n)){if(n>0&&e[n-1]==="!")continue;let r=jP(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let s=e.indexOf(")",r+2);s!==-1&&(n=s)}}return t},Gme=(e,t,n)=>{let r=t>0&&e[t-1]==="!",s=r?t-1:t;if(!e.substring(t+1).includes("]")){let i=e.substring(0,s);if(r)return i;if(n==="text-only"){let l=aR(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}if(jP(e,t)===-1){let i=e.substring(0,s);if(r)return i;if(n==="text-only"){let l=aR(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}return null},PP=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Nf(e,n)){let r=Yme(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Nf(e,r)){let s=Gme(e,r,t);if(s!==null)return s}return e},Kme=/^-{1,2}$/,Qme=/^[\s]*-{1,2}[\s]+$/,Xme=/^={1,2}$/,Wme=/^[\s]*={1,2}[\s]+$/,Zme=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
640
|
-
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(Kme.test(s)&&!n.match(Qme)){let i=r.split(`
|
|
641
|
-
`).at(-1);if(i&&i.trim().length>0)return`${e}`}if(Xme.test(s)&&!n.match(Wme)){let i=r.split(`
|
|
642
|
-
`).at(-1);if(i&&i.trim().length>0)return`${e}`}return e},Jme=e=>{var t,n;let r=e.match(lme);if(r){let s=r[2];if(!s||Sl.test(s))return e;if(((t=e.match(rR))==null?void 0:t.length)%2===1)return`${e}~~`}else if(e.match(hme)&&((n=e.match(rR))==null?void 0:n.length)%2===1)return`${e}~`;return e},lb=e=>e!==!1,Zr={COMPARISON_OPERATORS:-10,HTML_TAGS:-5,SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},epe=[{handler:{name:"comparisonOperators",handle:yme,priority:Zr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:Bme,priority:Zr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:Zme,priority:Zr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:PP,priority:Zr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:Mme,priority:Zr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:wme,priority:Zr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:Nme,priority:Zr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:kme,priority:Zr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:Ome,priority:Zr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:Ume,priority:Zr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:Jme,priority:Zr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:qme,priority:Zr.KATEX},optionKey:"katex"}],tpe=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return epe.filter(({handler:r,optionKey:s})=>r.name==="links"?lb(e==null?void 0:e.links)||lb(e==null?void 0:e.images):lb(e==null?void 0:e[s])).map(({handler:r,earlyReturn:s})=>r.name==="links"?{handler:OP(RP({},r),{handle:i=>PP(i,n)}),earlyReturn:n==="protocol"?s:void 0}:{handler:r,earlyReturn:s})},npe=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=tpe(t),i=((n=t==null?void 0:t.handlers)!=null?n:[]).map(c=>{var f;return{handler:OP(RP({},c),{priority:(f=c.priority)!=null?f:Zr.DEFAULT}),earlyReturn:void 0}}),l=[...s,...i].sort((c,f)=>{var d,p;return((d=c.handler.priority)!=null?d:0)-((p=f.handler.priority)!=null?p:0)});for(let{handler:c,earlyReturn:f}of l)if(r=c.handle(r),f!=null&&f(r))return r;return r},rpe=npe;const spe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ape=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ipe={};function iR(e,t){return(ipe.jsx?ape:spe).test(e)}const ope=/[ \t\n\f\r]/g;function lpe(e){return typeof e=="object"?e.type==="text"?oR(e.value):!1:oR(e)}function oR(e){return e.replace(ope,"")===""}var vu={},ub,lR;function upe(){if(lR)return ub;lR=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
643
|
-
`,d="/",p="*",m="",x="comment",y="declaration";function v(w,N){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];N=N||{};var A=1,k=1;function R(te){var J=te.match(t);J&&(A+=J.length);var L=te.lastIndexOf(f);k=~L?te.length-L:k+te.length}function D(){var te={line:A,column:k};return function(J){return J.position=new O(te),H(),J}}function O(te){this.start=te,this.end={line:A,column:k},this.source=N.source}O.prototype.content=w;function M(te){var J=new Error(N.source+":"+A+":"+k+": "+te);if(J.reason=te,J.filename=N.source,J.line=A,J.column=k,J.source=w,!N.silent)throw J}function I(te){var J=te.exec(w);if(J){var L=J[0];return R(L),w=w.slice(L.length),J}}function H(){I(n)}function P(te){var J;for(te=te||[];J=K();)J!==!1&&te.push(J);return te}function K(){var te=D();if(!(d!=w.charAt(0)||p!=w.charAt(1))){for(var J=2;m!=w.charAt(J)&&(p!=w.charAt(J)||d!=w.charAt(J+1));)++J;if(J+=2,m===w.charAt(J-1))return M("End of comment missing");var L=w.slice(2,J-2);return k+=2,R(L),w=w.slice(J),k+=2,te({type:x,comment:L})}}function Y(){var te=D(),J=I(r);if(J){if(K(),!I(s))return M("property missing ':'");var L=I(i),B=te({type:y,property:T(J[0].replace(e,m)),value:L?T(L[0].replace(e,m)):m});return I(l),B}}function W(){var te=[];P(te);for(var J;J=Y();)J!==!1&&(te.push(J),P(te));return te}return H(),W()}function T(w){return w?w.replace(c,m):m}return ub=v,ub}var uR;function cpe(){if(uR)return vu;uR=1;var e=vu&&vu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vu,"__esModule",{value:!0}),vu.default=n;const t=e(upe());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),c=typeof s=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:p}=f;c?s(d,p,f):p&&(i=i||{},i[d]=p)}),i}return vu}var Dd={},cR;function dpe(){if(cR)return Dd;cR=1,Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(d){return!d||n.test(d)||e.test(d)},l=function(d,p){return p.toUpperCase()},c=function(d,p){return"".concat(p,"-")},f=function(d,p){return p===void 0&&(p={}),i(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(s,c):d=d.replace(r,c),d.replace(t,l))};return Dd.camelCase=f,Dd}var jd,dR;function fpe(){if(dR)return jd;dR=1;var e=jd&&jd.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(cpe()),n=dpe();function r(s,i){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(c,f){c&&f&&(l[(0,n.camelCase)(c,i)]=f)}),l}return r.default=r,jd=r,jd}var hpe=fpe();const mpe=ml(hpe);function rf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?fR(e.position):"start"in e||"end"in e?fR(e):"line"in e||"column"in e?Gv(e):""}function Gv(e){return hR(e&&e.line)+":"+hR(e&&e.column)}function fR(e){return Gv(e&&e.start)+"-"+Gv(e&&e.end)}function hR(e){return e&&typeof e=="number"?e:1}class yr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(l=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?i.ruleId=r:(i.source=r.slice(0,f),i.ruleId=r.slice(f+1))}if(!i.place&&i.ancestors&&i.ancestors){const f=i.ancestors[i.ancestors.length-1];f&&(i.place=f.position)}const c=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=rf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}yr.prototype.file="";yr.prototype.name="";yr.prototype.reason="";yr.prototype.message="";yr.prototype.stack="";yr.prototype.column=void 0;yr.prototype.line=void 0;yr.prototype.ancestors=void 0;yr.prototype.cause=void 0;yr.prototype.fatal=void 0;yr.prototype.place=void 0;yr.prototype.ruleId=void 0;yr.prototype.source=void 0;const v2={}.hasOwnProperty,ppe=new Map,gpe=/[A-Z]/g,xpe=new Set(["table","tbody","thead","tfoot","tr"]),ype=new Set(["td","th"]),BP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bpe(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=Ape(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=Npe(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ho:dh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=FP(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function FP(e,t,n){if(t.type==="element")return vpe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Epe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Spe(e,t,n);if(t.type==="mdxjsEsm")return Tpe(e,t);if(t.type==="root")return wpe(e,t,n);if(t.type==="text")return Cpe(e,t)}function vpe(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ho,e.schema=s),e.ancestors.push(t);const i=UP(e,t.tagName,!1),l=kpe(e,t);let c=T2(e,t);return xpe.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!lpe(f):!0})),zP(e,l,i,t),E2(l,c),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function Epe(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)}Af(e,t.position)}function Tpe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Af(e,t.position)}function Spe(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ho,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:UP(e,t.name,!0),l=_pe(e,t),c=T2(e,t);return zP(e,l,i,t),E2(l,c),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function wpe(e,t,n){const r={};return E2(r,T2(e,t)),e.create(t,e.Fragment,r,n)}function Cpe(e,t){return t.value}function zP(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function E2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Npe(e,t,n){return r;function r(s,i,l,c){const d=Array.isArray(l.children)?n:t;return c?d(i,l,c):d(i,l)}}function Ape(e,t){return n;function n(r,s,i,l){const c=Array.isArray(i.children),f=Sa(r);return t(s,i,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function kpe(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&v2.call(t.properties,s)){const i=Rpe(e,s,t.properties[s]);if(i){const[l,c]=i;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&ype.has(t.tagName)?r=c:n[l]=c}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function _pe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Af(e,t.position);else{const s=r.name;let i;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,i=e.evaluater.evaluateExpression(c.expression)}else Af(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function T2(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:ppe;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const f=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(f){const d=s.get(f)||0;l=f+"-"+d,s.set(f,d+1)}}const c=FP(e,i,l);c!==void 0&&n.push(c)}return n}function Rpe(e,t,n){const r=og(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?oL(n):lL(n)),r.property==="style"){let s=typeof n=="object"?n:Ope(e,String(n));return e.stylePropertyNameCase==="css"&&(s=Dpe(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?Yie[r.property]||r.property:r.attribute,n]}}function Ope(e,t){try{return mpe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new yr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=BP+"#cannot-parse-style-attribute",s}}function UP(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,l;for(;++i<s.length;){const c=iR(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(i&&c.type==="Literal"),optional:!1}:c}r=l}else r=iR(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return v2.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Af(e)}function Af(e,t){const n=new yr("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=BP+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Dpe(e){const t={};let n;for(n in e)v2.call(e,n)&&(t[jpe(n)]=e[n]);return t}function jpe(e){let t=e.replace(gpe,Mpe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Mpe(e){return"-"+e.toLowerCase()}const cb={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"]},Ipe={tokenize:Lpe};function Lpe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Dt(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),i(c)}function i(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Qe(c)?(e.consume(c),e.exit("chunkText"),i):(e.consume(c),l)}}const Ppe={tokenize:Bpe},mR={tokenize:Fpe};function Bpe(e){const t=this,n=[];let r=0,s,i,l;return c;function c(k){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,f,d)(k)}return d(k)}function f(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const R=t.events.length;let D=R,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}N(r);let M=R;for(;M<t.events.length;)t.events[M][1].end={...O},M++;return ts(t.events,D+1,0,t.events.slice(R)),t.events.length=M,d(k)}return c(k)}function d(k){if(r===n.length){if(!s)return x(k);if(s.currentConstruct&&s.currentConstruct.concrete)return v(k);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(mR,p,m)(k)}function p(k){return s&&A(),N(r),x(k)}function m(k){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,v(k)}function x(k){return t.containerState={},e.attempt(mR,y,v)(k)}function y(k){return r++,n.push([t.currentConstruct,t.containerState]),x(k)}function v(k){if(k===null){s&&A(),N(0),e.consume(k);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),T(k)}function T(k){if(k===null){w(e.exit("chunkFlow"),!0),N(0),e.consume(k);return}return Qe(k)?(e.consume(k),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(k),T)}function w(k,R){const D=t.sliceStream(k);if(R&&D.push(null),k.previous=i,i&&(i.next=k),i=k,s.defineSkip(k.start),s.write(D),t.parser.lazy[k.start.line]){let O=s.events.length;for(;O--;)if(s.events[O][1].start.offset<l&&(!s.events[O][1].end||s.events[O][1].end.offset>l))return;const M=t.events.length;let I=M,H,P;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(H){P=t.events[I][1].end;break}H=!0}for(N(r),O=M;O<t.events.length;)t.events[O][1].end={...P},O++;ts(t.events,I+1,0,t.events.slice(M)),t.events.length=O}}function N(k){let R=n.length;for(;R-- >k;){const D=n[R];t.containerState=D[1],D[0].exit.call(t,e)}n.length=k}function A(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function Fpe(e,t,n){return Dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const zpe={tokenize:Upe};function Upe(e){const t=this,n=e.attempt(ph,r,e.attempt(this.parser.constructs.flowInitial,s,Dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Mfe,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Hpe={resolveAll:$P()},$pe=HP("string"),Vpe=HP("text");function HP(e){return{resolveAll:$P(e==="text"?qpe:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,l,c);return l;function l(p){return d(p)?i(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),i(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=s[p];let x=-1;if(m)for(;++x<m.length;){const y=m[x];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function $P(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function qpe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let i=s.length,l=-1,c=0,f;for(;i--;){const d=s[i];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const Ype={42:Fr,43:Fr,45:Fr,48:Fr,49:Fr,50:Fr,51:Fr,52:Fr,53:Fr,54:Fr,55:Fr,56:Fr,57:Fr,62:SP},Gpe={91:Ffe},Kpe={[-2]:ib,[-1]:ib,32:ib},Qpe={35:qfe,42:Np,45:[J_,Np],60:Qfe,61:J_,95:Np,96:W_,126:W_},Xpe={38:CP,92:wP},Wpe={[-5]:ob,[-4]:ob,[-3]:ob,33:hhe,38:CP,42:Yv,60:[pfe,nhe],91:phe,92:[$fe,wP],93:x2,95:Yv,96:kfe},Zpe={null:[Yv,Hpe]},Jpe={null:[42,95]},e0e={null:[]},t0e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Jpe,contentInitial:Gpe,disable:e0e,document:Ype,flow:Qpe,flowInitial:Kpe,insideSpan:Zpe,string:Xpe,text:Wpe},Symbol.toStringTag,{value:"Module"}));function n0e(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let l=[],c=[];const f={attempt:M(D),check:M(O),consume:A,enter:k,exit:R,interrupt:M(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:T,events:[],now:v,parser:e,previous:null,sliceSerialize:x,sliceStream:y,write:m};let p=t.tokenize.call(d,f);return t.resolveAll&&i.push(t),d;function m(K){return l=xs(l,K),w(),l[l.length-1]!==null?[]:(I(t,0),d.events=mg(i,d.events,d),d.events)}function x(K,Y){return s0e(y(K),Y)}function y(K){return r0e(l,K)}function v(){const{_bufferIndex:K,_index:Y,line:W,column:te,offset:J}=r;return{_bufferIndex:K,_index:Y,line:W,column:te,offset:J}}function T(K){s[K.line]=K.column,P()}function w(){let K;for(;r._index<l.length;){const Y=l[r._index];if(typeof Y=="string")for(K=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===K&&r._bufferIndex<Y.length;)N(Y.charCodeAt(r._bufferIndex));else N(Y)}}function N(K){p=p(K)}function A(K){Qe(K)?(r.line++,r.column=1,r.offset+=K===-3?2:1,P()):K!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=K}function k(K,Y){const W=Y||{};return W.type=K,W.start=v(),d.events.push(["enter",W,d]),c.push(W),W}function R(K){const Y=c.pop();return Y.end=v(),d.events.push(["exit",Y,d]),Y}function D(K,Y){I(K,Y.from)}function O(K,Y){Y.restore()}function M(K,Y){return W;function W(te,J,L){let B,U,ne,z;return Array.isArray(te)?V(te):"tokenize"in te?V([te]):q(te);function q(me){return le;function le(ye){const ve=ye!==null&&me[ye],Re=ye!==null&&me.null,ke=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Re)?Re:Re?[Re]:[]];return V(ke)(ye)}}function V(me){return B=me,U=0,me.length===0?L:j(me[U])}function j(me){return le;function le(ye){return z=H(),ne=me,me.partial||(d.currentConstruct=me),me.name&&d.parser.constructs.disable.null.includes(me.name)?ae():me.tokenize.call(Y?Object.assign(Object.create(d),Y):d,f,re,ae)(ye)}}function re(me){return K(ne,z),J}function ae(me){return z.restore(),++U<B.length?j(B[U]):L}}}function I(K,Y){K.resolveAll&&!i.includes(K)&&i.push(K),K.resolve&&ts(d.events,Y,d.events.length-Y,K.resolve(d.events.slice(Y),d)),K.resolveTo&&(d.events=K.resolveTo(d.events,d))}function H(){const K=v(),Y=d.previous,W=d.currentConstruct,te=d.events.length,J=Array.from(c);return{from:te,restore:L};function L(){r=K,d.previous=Y,d.currentConstruct=W,d.events.length=te,c=J,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function r0e(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,i)];else{if(l=e.slice(n,s),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}i>0&&l.push(e[s].slice(0,i))}return l}function s0e(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
|
|
644
|
-
`;break}case-3:{l=`\r
|
|
645
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(i)}s=i===-2,r.push(l)}return r.join("")}function a0e(e){const r={constructs:mP([t0e,...(e||{}).extensions||[]]),content:s(Ipe),defined:[],document:s(Ppe),flow:s(zpe),lazy:{},string:s($pe),text:s(Vpe)};return r;function s(i){return l;function l(c){return n0e(r,i,c)}}}function i0e(e){for(;!NP(e););return e}const pR=/[\0\t\n\r]/g;function o0e(){let e=1,t="",n=!0,r;return s;function s(i,l,c){const f=[];let d,p,m,x,y;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),m=0,t="",n&&(i.charCodeAt(0)===65279&&m++,n=void 0);m<i.length;){if(pR.lastIndex=m,d=pR.exec(i),x=d&&d.index!==void 0?d.index:i.length,y=i.charCodeAt(x),!d){t=i.slice(m);break}if(y===10&&m===x&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),m<x&&(f.push(i.slice(m,x)),e+=x-m),y){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}m=x+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const VP={}.hasOwnProperty;function l0e(e,t,n){return typeof t!="string"&&(n=t,t=void 0),u0e(n)(i0e(a0e(n).document().write(o0e()(e,t,!0))))}function u0e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Tt),autolinkProtocol:H,autolinkEmail:H,atxHeading:i(Xt),blockQuote:i(Re),characterEscape:H,characterReference:H,codeFenced:i(ke),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ke,l),codeText:i($e,l),codeTextData:H,data:H,codeFlowValue:H,definition:i(Et),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(Oe),hardBreakEscape:i(un),hardBreakTrailing:i(un),htmlFlow:i(tn,l),htmlFlowData:H,htmlText:i(tn,l),htmlTextData:H,image:i(pt),label:l,link:i(Tt),listItem:i(cn),listItemValue:x,listOrdered:i(Ht,m),listUnordered:i(Ht),paragraph:i(St),reference:j,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Xt),strong:i(dn),thematicBreak:i(Rt)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:ve,autolinkProtocol:ye,blockQuote:f(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:me,characterReference:le,codeFenced:f(w),codeFencedFence:T,codeFencedFenceInfo:y,codeFencedFenceMeta:v,codeFlowValue:P,codeIndented:f(N),codeText:f(J),codeTextData:P,data:P,definition:f(),definitionDestinationString:R,definitionLabelString:A,definitionTitleString:k,emphasis:f(),hardBreakEscape:f(Y),hardBreakTrailing:f(Y),htmlFlow:f(W),htmlFlowData:P,htmlText:f(te),htmlTextData:P,image:f(B),label:ne,labelText:U,lineEnding:K,link:f(L),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:re,resourceDestinationString:z,resourceTitleString:q,resource:V,setextHeading:f(I),setextHeadingLineSequence:M,setextHeadingText:O,strong:f(),thematicBreak:f()}};qP(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Ne={type:"root",children:[]};const Ve={stack:[Ne],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:p,data:n},et=[];let st=-1;for(;++st<pe.length;)if(pe[st][1].type==="listOrdered"||pe[st][1].type==="listUnordered")if(pe[st][0]==="enter")et.push(st);else{const Dn=et.pop();st=s(pe,Dn,st)}for(st=-1;++st<pe.length;){const Dn=t[pe[st][0]];VP.call(Dn,pe[st][1].type)&&Dn[pe[st][1].type].call(Object.assign({sliceSerialize:pe[st][2].sliceSerialize},Ve),pe[st][1])}if(Ve.tokenStack.length>0){const Dn=Ve.tokenStack[Ve.tokenStack.length-1];(Dn[1]||gR).call(Ve,void 0,Dn[0])}for(Ne.position={start:ji(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:ji(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},st=-1;++st<t.transforms.length;)Ne=t.transforms[st](Ne)||Ne;return Ne}function s(pe,Ne,Ve){let et=Ne-1,st=-1,Dn=!1,fn,vn,nn,kn;for(;++et<=Ve;){const Ot=pe[et];switch(Ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ot[0]==="enter"?st++:st--,kn=void 0;break}case"lineEndingBlank":{Ot[0]==="enter"&&(fn&&!kn&&!st&&!nn&&(nn=et),kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:kn=void 0}if(!st&&Ot[0]==="enter"&&Ot[1].type==="listItemPrefix"||st===-1&&Ot[0]==="exit"&&(Ot[1].type==="listUnordered"||Ot[1].type==="listOrdered")){if(fn){let Se=et;for(vn=void 0;Se--;){const qe=pe[Se];if(qe[1].type==="lineEnding"||qe[1].type==="lineEndingBlank"){if(qe[0]==="exit")continue;vn&&(pe[vn][1].type="lineEndingBlank",Dn=!0),qe[1].type="lineEnding",vn=Se}else if(!(qe[1].type==="linePrefix"||qe[1].type==="blockQuotePrefix"||qe[1].type==="blockQuotePrefixWhitespace"||qe[1].type==="blockQuoteMarker"||qe[1].type==="listItemIndent"))break}nn&&(!vn||nn<vn)&&(fn._spread=!0),fn.end=Object.assign({},vn?pe[vn][1].start:Ot[1].end),pe.splice(vn||et,0,["exit",fn,Ot[2]]),et++,Ve++}if(Ot[1].type==="listItemPrefix"){const Se={type:"listItem",_spread:!1,start:Object.assign({},Ot[1].start),end:void 0};fn=Se,pe.splice(et,0,["enter",Se,Ot[2]]),et++,Ve++,nn=void 0,kn=!0}}}return pe[Ne][1]._spread=Dn,Ve}function i(pe,Ne){return Ve;function Ve(et){c.call(this,pe(et),et),Ne&&Ne.call(this,et)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(pe,Ne,Ve){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Ne,Ve||void 0]),pe.position={start:ji(Ne.start),end:void 0}}function f(pe){return Ne;function Ne(Ve){pe&&pe.call(this,Ve),d.call(this,Ve)}}function d(pe,Ne){const Ve=this.stack.pop(),et=this.tokenStack.pop();if(et)et[0].type!==pe.type&&(Ne?Ne.call(this,pe,et[0]):(et[1]||gR).call(this,pe,et[0]));else throw new Error("Cannot close `"+pe.type+"` ("+rf({start:pe.start,end:pe.end})+"): it’s not open");Ve.position.end=ji(pe.end)}function p(){return h2(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(pe){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function y(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=pe}function v(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=pe}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=pe.replace(/(\r?\n|\r)$/g,"")}function A(pe){const Ne=this.resume(),Ve=this.stack[this.stack.length-1];Ve.label=Ne,Ve.identifier=$s(this.sliceSerialize(pe)).toLowerCase()}function k(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=pe}function R(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=pe}function D(pe){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const Ve=this.sliceSerialize(pe).length;Ne.depth=Ve}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function M(pe){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function H(pe){const Ve=this.stack[this.stack.length-1].children;let et=Ve[Ve.length-1];(!et||et.type!=="text")&&(et=it(),et.position={start:ji(pe.start),end:void 0},Ve.push(et)),this.stack.push(et)}function P(pe){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(pe),Ne.position.end=ji(pe.end)}function K(pe){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ve=Ne.children[Ne.children.length-1];Ve.position.end=ji(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&(H.call(this,pe),P.call(this,pe))}function Y(){this.data.atHardBreak=!0}function W(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=pe}function te(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=pe}function J(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=pe}function L(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ne,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function B(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ne,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function U(pe){const Ne=this.sliceSerialize(pe),Ve=this.stack[this.stack.length-2];Ve.label=Fde(Ne),Ve.identifier=$s(Ne).toLowerCase()}function ne(){const pe=this.stack[this.stack.length-1],Ne=this.resume(),Ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ve.type==="link"){const et=pe.children;Ve.children=et}else Ve.alt=Ne}function z(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=pe}function q(){const pe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=pe}function V(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function re(pe){const Ne=this.resume(),Ve=this.stack[this.stack.length-1];Ve.label=Ne,Ve.identifier=$s(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function ae(pe){this.data.characterReferenceType=pe.type}function me(pe){const Ne=this.sliceSerialize(pe),Ve=this.data.characterReferenceType;let et;Ve?(et=hP(Ne,Ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):et=p2(Ne);const st=this.stack[this.stack.length-1];st.value+=et}function le(pe){const Ne=this.stack.pop();Ne.position.end=ji(pe.end)}function ye(pe){P.call(this,pe);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(pe)}function ve(pe){P.call(this,pe);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(pe)}function Re(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function $e(){return{type:"inlineCode",value:""}}function Et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Xt(){return{type:"heading",depth:0,children:[]}}function un(){return{type:"break"}}function tn(){return{type:"html",value:""}}function pt(){return{type:"image",title:null,url:"",alt:null}}function Tt(){return{type:"link",title:null,url:"",children:[]}}function Ht(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function cn(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function St(){return{type:"paragraph",children:[]}}function dn(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function ji(e){return{line:e.line,column:e.column,offset:e.offset}}function qP(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qP(e,r):c0e(e,r)}}function c0e(e,t){let n;for(n in t)if(VP.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 gR(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+rf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+rf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+rf({start:t.start,end:t.end})+") is still open")}function d0e(e){const t=this;t.parser=n;function n(r){return l0e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function f0e(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 h0e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
646
|
-
`}]}function m0e(e,t){const n=t.value?t.value+`
|
|
647
|
-
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function p0e(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g0e(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function x0e(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Ac(r.toLowerCase()),i=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=i+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function y0e(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 b0e(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function YP(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function v0e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return YP(e,t);const s={src:Ac(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function E0e(e,t){const n={src:Ac(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 T0e(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 S0e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return YP(e,t);const s={href:Ac(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function w0e(e,t){const n={href:Ac(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 C0e(e,t,n){const r=e.all(t),s=n?N0e(n):GP(t),i={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(s||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
648
|
-
`}),p.type==="element"&&p.tagName==="p"&&!s?l.push(...p.children):l.push(p)}const f=r[r.length-1];f&&(s||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
649
|
-
`});const d={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,d),e.applyData(t,d)}function N0e(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=GP(n[r])}return t}function GP(e){const t=e.spread;return t??e.children.length>1}function A0e(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function k0e(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _0e(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function R0e(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O0e(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Sa(t.children[1]),f=fg(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),s.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function D0e(e,t,n){const r=n?n.children:void 0,i=(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 f=-1;const d=[];for(;++f<c;){const m=t.children[f],x={},y=l?l[f]:void 0;y&&(x.align=y);let v={type:"element",tagName:i,properties:x,children:[]};m&&(v.children=e.all(m),e.patch(m,v),v=e.applyData(m,v)),d.push(v)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function j0e(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const xR=9,yR=32;function M0e(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(bR(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(bR(t.slice(s),s>0,!1)),i.join("")}function bR(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===xR||i===yR;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===xR||i===yR;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function I0e(e,t){const n={type:"text",value:M0e(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function L0e(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const P0e={blockquote:f0e,break:h0e,code:m0e,delete:p0e,emphasis:g0e,footnoteReference:x0e,heading:y0e,html:b0e,imageReference:v0e,image:E0e,inlineCode:T0e,linkReference:S0e,link:w0e,listItem:C0e,list:A0e,paragraph:k0e,root:_0e,strong:R0e,table:O0e,tableCell:j0e,tableRow:D0e,text:I0e,thematicBreak:L0e,toml:ip,yaml:ip,definition:ip,footnoteDefinition:ip};function ip(){}function B0e(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 F0e(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function z0e(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||B0e,r=e.options.footnoteBackLabel||F0e,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const p=e.all(d),m=String(d.identifier).toUpperCase(),x=Ac(m.toLowerCase());let y=0;const v=[],T=e.footnoteCounts.get(m);for(;T!==void 0&&++y<=T;){v.length>0&&v.push({type:"text",value:" "});let A=typeof n=="string"?n:n(f,y);typeof A=="string"&&(A={type:"text",value:A}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,y),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const w=p[p.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const A=w.children[w.children.length-1];A&&A.type==="text"?A.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...v)}else p.push(...v);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(p,!0)};e.patch(d,N),c.push(N)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...dl(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
650
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
651
|
-
`}]}}const Kv={}.hasOwnProperty,U0e={};function H0e(e,t){const n=t||U0e,r=new Map,s=new Map,i=new Map,l={...P0e,...n.handlers},c={all:d,applyData:V0e,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:l,one:f,options:n,patch:$0e,wrap:Y0e};return io(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:s,x=String(p.identifier).toUpperCase();m.has(x)||m.set(x,p)}}),c;function f(p,m){const x=p.type,y=c.handlers[x];if(Kv.call(c.handlers,x)&&y)return y(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in p){const{children:T,...w}=p,N=dl(w);return N.children=c.all(p),N}return dl(p)}return(c.options.unknownHandler||q0e)(c,p,m)}function d(p){const m=[];if("children"in p){const x=p.children;let y=-1;for(;++y<x.length;){const v=c.one(x[y],p);if(v){if(y&&x[y-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=vR(v.value)),!Array.isArray(v)&&v.type==="element")){const T=v.children[0];T&&T.type==="text"&&(T.value=vR(T.value))}Array.isArray(v)?m.push(...v):m.push(v)}}}return m}}function $0e(e,t){e.position&&(t.position=HL(e))}function V0e(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=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"&&i&&Object.assign(n.properties,dl(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function q0e(e,t){const n=t.data||{},r="value"in t&&!(Kv.call(n,"hProperties")||Kv.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 Y0e(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
652
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
653
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
654
|
-
`}),n}function vR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ER(e,t){const n=H0e(e,t),r=n.one(e,void 0),s=z0e(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
655
|
-
`},s),i}function G0e(e,t){return e&&"run"in e?async function(n,r){const s=ER(n,{file:r,...t});await e.run(s,r)}:function(n,r){return ER(n,{file:r,...e||t})}}function TR(e){if(e)throw e}var db,SR;function K0e(){if(SR)return db;SR=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},i=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},l=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},c=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return db=function f(){var d,p,m,x,y,v,T=arguments[0],w=1,N=arguments.length,A=!1;for(typeof T=="boolean"&&(A=T,T=arguments[1]||{},w=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});w<N;++w)if(d=arguments[w],d!=null)for(p in d)m=c(T,p),x=c(d,p),T!==x&&(A&&x&&(i(x)||(y=s(x)))?(y?(y=!1,v=m&&s(m)?m:[]):v=m&&i(m)?m:{},l(T,{name:p,newValue:f(A,v,x)})):typeof x<"u"&&l(T,{name:p,newValue:x}));return T},db}var Q0e=K0e();const fb=ml(Q0e);function Qv(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 X0e(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...s);function c(f,...d){const p=e[++i];let m=-1;if(f){l(f);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,p?W0e(p,c)(...d):l(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function W0e(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(s);try{f=e.apply(this,l)}catch(d){const p=d;if(c&&n)throw p;return s(p)}c||(f&&f.then&&typeof f.then=="function"?f.then(i,s):f instanceof Error?s(f):i(f))}function s(l,...c){n||(n=!0,t(l,...c))}function i(l){s(null,l)}}const ea={basename:Z0e,dirname:J0e,extname:ege,join:tge,sep:"/"};function Z0e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');gh(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else l<0&&(i=!0,l=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function J0e(e){if(gh(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 ege(e){gh(e);let t=e.length,n=-1,r=0,s=-1,i=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?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function tge(...e){let t=-1,n;for(;++t<e.length;)gh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":nge(n)}function nge(e){gh(e);const t=e.codePointAt(0)===47;let n=rge(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rge(e,t){let n="",r=0,s=-1,i=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(s===l-1||i===1))if(s!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),s=l,i=0;continue}}else if(n.length>0){n="",r=0,s=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,i=0}else c===46&&i>-1?i++:i=-1}return n}function gh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const sge={cwd:age};function age(){return"/"}function Xv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ige(e){if(typeof e=="string")e=new URL(e);else if(!Xv(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 oge(e)}function oge(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const hb=["history","path","basename","stem","extname","dirname"];class lge{constructor(t){let n;t?Xv(t)?n={path:t}:typeof t=="string"||uge(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":sge.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<hb.length;){const i=hb[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)hb.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ea.basename(this.path):void 0}set basename(t){pb(t,"basename"),mb(t,"basename"),this.path=ea.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ea.dirname(this.path):void 0}set dirname(t){wR(this.basename,"dirname"),this.path=ea.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ea.extname(this.path):void 0}set extname(t){if(mb(t,"extname"),wR(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=ea.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Xv(t)&&(t=ige(t)),pb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ea.basename(this.path,this.extname):void 0}set stem(t){pb(t,"stem"),mb(t,"stem"),this.path=ea.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new yr(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function mb(e,t){if(e&&e.includes(ea.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ea.sep+"`")}function pb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wR(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function uge(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cge=(function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),dge={}.hasOwnProperty;class S2 extends cge{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=X0e()}copy(){const t=new S2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(fb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(yb("data",this.frozen),this.namespace[t]=n,this):dge.call(this.namespace,t)&&this.namespace[t]||void 0:t?(yb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=op(t),r=this.parser||this.Parser;return gb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),gb("process",this.parser||this.Parser),xb("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,l){const c=op(t),f=r.parse(c);r.run(f,c,function(p,m,x){if(p||!m||!x)return d(p);const y=m,v=r.stringify(y,x);mge(v)?x.value=v:x.result=v,d(p,x)});function d(p,m){p||!m?l(p):i?i(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),gb("processSync",this.parser||this.Parser),xb("processSync",this.compiler||this.Compiler),this.process(t,s),NR("processSync","process",n),r;function s(i,l){n=!0,TR(i),r=l}}run(t,n,r){CR(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,c){const f=op(n);s.run(t,f,d);function d(p,m,x){const y=m||t;p?c(p):l?l(y):r(void 0,y,x)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),NR("runSync","run",r),s;function i(l,c){TR(l),s=c,r=!0}}stringify(t,n){this.freeze();const r=op(n),s=this.compiler||this.Compiler;return xb("stringify",s),CR(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(yb("use",this.frozen),t!=null)if(typeof t=="function")f(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 i(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...m]=d;f(p,m)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))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(d.plugins),d.settings&&(s.settings=fb(!0,s.settings,d.settings))}function c(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const m=d[p];i(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,p){let m=-1,x=-1;for(;++m<r.length;)if(r[m][0]===d){x=m;break}if(x===-1)r.push([d,...p]);else if(p.length>0){let[y,...v]=p;const T=r[x][1];Qv(T)&&Qv(y)&&(y=fb(!0,T,y)),r[x]=[d,y,...v]}}}}const fge=new S2().freeze();function gb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yb(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 CR(e){if(!Qv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function NR(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function op(e){return hge(e)?e:new lge(e)}function hge(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mge(e){return typeof e=="string"||pge(e)}function pge(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function w2(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var wl=w2();function KP(e){wl=e}var sf={exec:()=>null};function Pt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(Ar.caret,"$1"),n=n.replace(s,l),r},getRegex:()=>new RegExp(n,t)};return r}var gge=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ar={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,listReplaceTabs:/^\t+/,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,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")},xge=/^(?:[ \t]*(?:\n|$))+/,yge=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,bge=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xh=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vge=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,C2=/(?:[*+-]|\d{1,9}[.)])/,QP=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,XP=Pt(QP).replace(/bull/g,C2).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(),Ege=Pt(QP).replace(/bull/g,C2).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(),N2=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Tge=/^[^\n]+/,A2=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Sge=Pt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",A2).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),wge=Pt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,C2).getRegex(),gg="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",k2=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cge=Pt("^ {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",k2).replace("tag",gg).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),WP=Pt(N2).replace("hr",xh).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gg).getRegex(),Nge=Pt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",WP).getRegex(),_2={blockquote:Nge,code:yge,def:Sge,fences:bge,heading:vge,hr:xh,html:Cge,lheading:XP,list:wge,newline:xge,paragraph:WP,table:sf,text:Tge},AR=Pt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xh).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gg).getRegex(),Age={..._2,lheading:Ege,table:AR,paragraph:Pt(N2).replace("hr",xh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",AR).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gg).getRegex()},kge={..._2,html:Pt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",k2).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:sf,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pt(N2).replace("hr",xh).replace("heading",` *#{1,6} *[^
|
|
656
|
-
]`).replace("lheading",XP).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_ge=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Rge=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ZP=/^( {2,}|\\)\n(?!\s*$)/,Oge=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,xg=/[\p{P}\p{S}]/u,R2=/[\s\p{P}\p{S}]/u,JP=/[^\s\p{P}\p{S}]/u,Dge=Pt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,R2).getRegex(),e8=/(?!~)[\p{P}\p{S}]/u,jge=/(?!~)[\s\p{P}\p{S}]/u,Mge=/(?:[^\s\p{P}\p{S}]|~)/u,Ige=Pt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",gge?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),t8=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Lge=Pt(t8,"u").replace(/punct/g,xg).getRegex(),Pge=Pt(t8,"u").replace(/punct/g,e8).getRegex(),n8="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Bge=Pt(n8,"gu").replace(/notPunctSpace/g,JP).replace(/punctSpace/g,R2).replace(/punct/g,xg).getRegex(),Fge=Pt(n8,"gu").replace(/notPunctSpace/g,Mge).replace(/punctSpace/g,jge).replace(/punct/g,e8).getRegex(),zge=Pt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,JP).replace(/punctSpace/g,R2).replace(/punct/g,xg).getRegex(),Uge=Pt(/\\(punct)/,"gu").replace(/punct/g,xg).getRegex(),Hge=Pt(/^<(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(),$ge=Pt(k2).replace("(?:-->|$)","-->").getRegex(),Vge=Pt("^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",$ge).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),o0=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,qge=Pt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",o0).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),r8=Pt(/^!?\[(label)\]\[(ref)\]/).replace("label",o0).replace("ref",A2).getRegex(),s8=Pt(/^!?\[(ref)\](?:\[\])?/).replace("ref",A2).getRegex(),Yge=Pt("reflink|nolink(?!\\()","g").replace("reflink",r8).replace("nolink",s8).getRegex(),kR=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,O2={_backpedal:sf,anyPunctuation:Uge,autolink:Hge,blockSkip:Ige,br:ZP,code:Rge,del:sf,emStrongLDelim:Lge,emStrongRDelimAst:Bge,emStrongRDelimUnd:zge,escape:_ge,link:qge,nolink:s8,punctuation:Dge,reflink:r8,reflinkSearch:Yge,tag:Vge,text:Oge,url:sf},Gge={...O2,link:Pt(/^!?\[(label)\]\((.*?)\)/).replace("label",o0).getRegex(),reflink:Pt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",o0).getRegex()},Wv={...O2,emStrongRDelimAst:Fge,emStrongLDelim:Pge,url:Pt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",kR).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:Pt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",kR).getRegex()},Kge={...Wv,br:Pt(ZP).replace("{2,}","*").getRegex(),text:Pt(Wv.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},lp={normal:_2,gfm:Age,pedantic:kge},Md={normal:O2,gfm:Wv,breaks:Kge,pedantic:Gge},Qge={"&":"&","<":"<",">":">",'"':""","'":"'"},_R=e=>Qge[e];function qa(e,t){if(t){if(Ar.escapeTest.test(e))return e.replace(Ar.escapeReplace,_R)}else if(Ar.escapeTestNoEncode.test(e))return e.replace(Ar.escapeReplaceNoEncode,_R);return e}function RR(e){try{e=encodeURI(e).replace(Ar.percentDecode,"%")}catch{return null}return e}function OR(e,t){var i;let n=e.replace(Ar.findPipe,(l,c,f)=>{let d=!1,p=c;for(;--p>=0&&f[p]==="\\";)d=!d;return d?"|":" |"}),r=n.split(Ar.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(Ar.slashPipe,"|");return r}function Id(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function Xge(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 DR(e,t,n,r,s){let i=t.href,l=t.title||null,c=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let f={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:l,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,f}function Wge(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
|
|
657
|
-
`).map(i=>{let l=i.match(n.other.beginningSpace);if(l===null)return i;let[c]=l;return c.length>=s.length?i.slice(s.length):i}).join(`
|
|
658
|
-
`)}var l0=class{constructor(e){We(this,"options");We(this,"rules");We(this,"lexer");this.options=e||wl}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:Id(n,`
|
|
659
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Wge(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=Id(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:Id(t[0],`
|
|
660
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Id(t[0],`
|
|
661
|
-
`).split(`
|
|
662
|
-
`),r="",s="",i=[];for(;n.length>0;){let l=!1,c=[],f;for(f=0;f<n.length;f++)if(this.rules.other.blockquoteStart.test(n[f]))c.push(n[f]),l=!0;else if(!l)c.push(n[f]);else break;n=n.slice(f);let d=c.join(`
|
|
663
|
-
`),p=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
664
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
665
|
-
${d}`:d,s=s?`${s}
|
|
666
|
-
${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=m,n.length===0)break;let x=i.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){let y=x,v=y.raw+`
|
|
667
|
-
`+n.join(`
|
|
668
|
-
`),T=this.blockquote(v);i[i.length-1]=T,r=r.substring(0,r.length-y.raw.length)+T.raw,s=s.substring(0,s.length-y.text.length)+T.text;break}else if((x==null?void 0:x.type)==="list"){let y=x,v=y.raw+`
|
|
669
|
-
`+n.join(`
|
|
670
|
-
`),T=this.list(v);i[i.length-1]=T,r=r.substring(0,r.length-x.raw.length)+T.raw,s=s.substring(0,s.length-y.raw.length)+T.raw,n=v.substring(i.at(-1).raw.length).split(`
|
|
671
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim(),i=s.length>1,l={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");let c=this.rules.other.listItemRegex(s),f=!1;for(;e;){let p=!1,m="",x="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;m=t[0],e=e.substring(m.length);let y=t[2].split(`
|
|
672
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,N=>" ".repeat(3*N.length)),v=e.split(`
|
|
673
|
-
`,1)[0],T=!y.trim(),w=0;if(this.options.pedantic?(w=2,x=y.trimStart()):T?w=t[1].length+1:(w=t[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,x=y.slice(w),w+=t[1].length),T&&this.rules.other.blankLine.test(v)&&(m+=v+`
|
|
674
|
-
`,e=e.substring(v.length+1),p=!0),!p){let N=this.rules.other.nextBulletRegex(w),A=this.rules.other.hrRegex(w),k=this.rules.other.fencesBeginRegex(w),R=this.rules.other.headingBeginRegex(w),D=this.rules.other.htmlBeginRegex(w);for(;e;){let O=e.split(`
|
|
675
|
-
`,1)[0],M;if(v=O,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),M=v):M=v.replace(this.rules.other.tabCharGlobal," "),k.test(v)||R.test(v)||D.test(v)||N.test(v)||A.test(v))break;if(M.search(this.rules.other.nonSpaceChar)>=w||!v.trim())x+=`
|
|
676
|
-
`+M.slice(w);else{if(T||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(y)||R.test(y)||A.test(y))break;x+=`
|
|
677
|
-
`+v}!T&&!v.trim()&&(T=!0),m+=O+`
|
|
678
|
-
`,e=e.substring(O.length+1),y=M.slice(w)}}l.loose||(f?l.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(f=!0)),l.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(x),loose:!1,text:x,tokens:[]}),l.raw+=m}let d=l.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let p of l.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((n=p.tokens[0])==null?void 0:n.type)==="text"||((r=p.tokens[0])==null?void 0:r.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}}let m=this.rules.other.listTaskCheckbox.exec(p.raw);if(m){let x={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};p.checked=x.checked,l.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=x.raw+p.tokens[0].raw,p.tokens[0].text=x.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(x)):p.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):p.tokens.unshift(x)}}if(!l.loose){let m=p.tokens.filter(y=>y.type==="space"),x=m.length>0&&m.some(y=>this.rules.other.anyLine.test(y.raw));l.loose=x}}if(l.loose)for(let p of l.items){p.loose=!0;for(let m of p.tokens)m.type==="text"&&(m.type="paragraph")}return l}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){var l;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=OR(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
679
|
-
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let c of r)this.rules.other.tableAlignRight.test(c)?i.align.push("right"):this.rules.other.tableAlignCenter.test(c)?i.align.push("center"):this.rules.other.tableAlignLeft.test(c)?i.align.push("left"):i.align.push(null);for(let c=0;c<n.length;c++)i.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:i.align[c]});for(let c of s)i.rows.push(OR(c,i.header.length).map((f,d)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:i.align[d]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
680
|
-
`?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 i=Id(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Xge(t[2],"()");if(i===-2)return;if(i>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),DR(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return DR(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,l,c=s,f=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(l=[...i].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){f+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+f);let p=[...r[0]][0].length,m=e.slice(0,s+r.index+p+l);if(Math.min(s,l)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let x=m.slice(2,-2);return{type:"strong",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}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){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let i;do i=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(i!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}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}}}},ys=class Zv{constructor(t){We(this,"tokens");We(this,"options");We(this,"state");We(this,"inlineQueue");We(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||wl,this.options.tokenizer=this.options.tokenizer||new l0,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:Ar,block:lp.normal,inline:Md.normal};this.options.pedantic?(n.block=lp.pedantic,n.inline=Md.pedantic):this.options.gfm&&(n.block=lp.gfm,this.options.breaks?n.inline=Md.breaks:n.inline=Md.gfm),this.tokenizer.rules=n}static get rules(){return{block:lp,inline:Md}}static lex(t,n){return new Zv(n).lex(t)}static lexInline(t,n){return new Zv(n).inlineTokens(t)}lex(t){t=t.replace(Ar.carriageReturn,`
|
|
681
|
-
`),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){var s,i,l;for(this.options.pedantic&&(t=t.replace(Ar.tabCharGlobal," ").replace(Ar.spaceLine,""));t;){let c;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(d=>(c=d.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(t)){t=t.substring(c.raw.length);let d=n.at(-1);c.raw.length===1&&d!==void 0?d.raw+=`
|
|
682
|
-
`:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
683
|
-
`)?"":`
|
|
684
|
-
`)+c.raw,d.text+=`
|
|
685
|
-
`+c.text,this.inlineQueue.at(-1).src=d.text):n.push(c);continue}if(c=this.tokenizer.fences(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(t)){t=t.substring(c.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
686
|
-
`)?"":`
|
|
687
|
-
`)+c.raw,d.text+=`
|
|
688
|
-
`+c.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(t)){t=t.substring(c.raw.length),n.push(c);continue}let f=t;if((l=this.options.extensions)!=null&&l.startBlock){let d=1/0,p=t.slice(1),m;this.options.extensions.startBlock.forEach(x=>{m=x.call({lexer:this},p),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(f=t.substring(0,d+1))}if(this.state.top&&(c=this.tokenizer.paragraph(f))){let d=n.at(-1);r&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=(d.raw.endsWith(`
|
|
689
|
-
`)?"":`
|
|
690
|
-
`)+c.raw,d.text+=`
|
|
691
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(c),r=f.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
|
|
692
|
-
`)?"":`
|
|
693
|
-
`)+c.raw,d.text+=`
|
|
694
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(c);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var f,d,p,m,x;let r=t,s=null;if(this.tokens.links){let y=Object.keys(this.tokens.links);if(y.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)y.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((d=(f=this.options.hooks)==null?void 0:f.emStrongMask)==null?void 0:d.call({lexer:this},r))??r;let l=!1,c="";for(;t;){l||(c=""),l=!1;let y;if((m=(p=this.options.extensions)==null?void 0:p.inline)!=null&&m.some(T=>(y=T.call({lexer:this},t,n))?(t=t.substring(y.raw.length),n.push(y),!0):!1))continue;if(y=this.tokenizer.escape(t)){t=t.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.tag(t)){t=t.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.link(t)){t=t.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(y.raw.length);let T=n.at(-1);y.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=y.raw,T.text+=y.text):n.push(y);continue}if(y=this.tokenizer.emStrong(t,r,c)){t=t.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.codespan(t)){t=t.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.br(t)){t=t.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.del(t)){t=t.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.autolink(t)){t=t.substring(y.raw.length),n.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(t))){t=t.substring(y.raw.length),n.push(y);continue}let v=t;if((x=this.options.extensions)!=null&&x.startInline){let T=1/0,w=t.slice(1),N;this.options.extensions.startInline.forEach(A=>{N=A.call({lexer:this},w),typeof N=="number"&&N>=0&&(T=Math.min(T,N))}),T<1/0&&T>=0&&(v=t.substring(0,T+1))}if(y=this.tokenizer.inlineText(v)){t=t.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(c=y.raw.slice(-1)),l=!0;let T=n.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=y.raw,T.text+=y.text):n.push(y);continue}if(t){let T="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(T);break}else throw new Error(T)}}return n}},u0=class{constructor(e){We(this,"options");We(this,"parser");this.options=e||wl}space(e){return""}code({text:e,lang:t,escaped:n}){var i;let r=(i=(t||"").match(Ar.notSpaceStart))==null?void 0:i[0],s=e.replace(Ar.endingNewline,"")+`
|
|
695
|
-
`;return r?'<pre><code class="language-'+qa(r)+'">'+(n?s:qa(s,!0))+`</code></pre>
|
|
696
|
-
`:"<pre><code>"+(n?s:qa(s,!0))+`</code></pre>
|
|
697
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
698
|
-
${this.parser.parse(e)}</blockquote>
|
|
699
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
700
|
-
`}hr(e){return`<hr>
|
|
701
|
-
`}list(e){let t=e.ordered,n=e.start,r="";for(let l=0;l<e.items.length;l++){let c=e.items[l];r+=this.listitem(c)}let s=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
|
|
702
|
-
`+r+"</"+s+`>
|
|
703
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
704
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
705
|
-
`}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){let i=e.rows[s];n="";for(let l=0;l<i.length;l++)n+=this.tablecell(i[l]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
706
|
-
<thead>
|
|
707
|
-
`+t+`</thead>
|
|
708
|
-
`+r+`</table>
|
|
709
|
-
`}tablerow({text:e}){return`<tr>
|
|
710
|
-
${e}</tr>
|
|
711
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
712
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${qa(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),s=RR(e);if(s===null)return r;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+qa(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=RR(e);if(s===null)return qa(n);e=s;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${qa(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:qa(e.text)}},D2=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}},Fs=class Jv{constructor(t){We(this,"options");We(this,"renderer");We(this,"textRenderer");this.options=t||wl,this.options.renderer=this.options.renderer||new u0,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new D2}static parse(t,n){return new Jv(n).parse(t)}static parseInline(t,n){return new Jv(n).parseInline(t)}parse(t){var r,s;let n="";for(let i=0;i<t.length;i++){let l=t[i];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[l.type]){let f=l,d=this.options.extensions.renderers[f.type].call({parser:this},f);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(f.type)){n+=d||"";continue}}let c=l;switch(c.type){case"space":{n+=this.renderer.space(c);break}case"hr":{n+=this.renderer.hr(c);break}case"heading":{n+=this.renderer.heading(c);break}case"code":{n+=this.renderer.code(c);break}case"table":{n+=this.renderer.table(c);break}case"blockquote":{n+=this.renderer.blockquote(c);break}case"list":{n+=this.renderer.list(c);break}case"checkbox":{n+=this.renderer.checkbox(c);break}case"html":{n+=this.renderer.html(c);break}case"def":{n+=this.renderer.def(c);break}case"paragraph":{n+=this.renderer.paragraph(c);break}case"text":{n+=this.renderer.text(c);break}default:{let f='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return n}parseInline(t,n=this.renderer){var s,i;let r="";for(let l=0;l<t.length;l++){let c=t[l];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[c.type]){let d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=d||"";continue}}let f=c;switch(f.type){case"escape":{r+=n.text(f);break}case"html":{r+=n.html(f);break}case"link":{r+=n.link(f);break}case"image":{r+=n.image(f);break}case"checkbox":{r+=n.checkbox(f);break}case"strong":{r+=n.strong(f);break}case"em":{r+=n.em(f);break}case"codespan":{r+=n.codespan(f);break}case"br":{r+=n.br(f);break}case"del":{r+=n.del(f);break}case"text":{r+=n.text(f);break}default:{let d='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return r}},dp,$d=(dp=class{constructor(e){We(this,"options");We(this,"block");this.options=e||wl}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?ys.lex:ys.lexInline}provideParser(){return this.block?Fs.parse:Fs.parseInline}},We(dp,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),We(dp,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),dp),Zge=class{constructor(...e){We(this,"defaults",w2());We(this,"options",this.setOptions);We(this,"parse",this.parseMarkdown(!0));We(this,"parseInline",this.parseMarkdown(!1));We(this,"Parser",Fs);We(this,"Renderer",u0);We(this,"TextRenderer",D2);We(this,"Lexer",ys);We(this,"Tokenizer",l0);We(this,"Hooks",$d);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(let i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{let l=i;for(let c of l.header)n=n.concat(this.walkTokens(c.tokens,t));for(let c of l.rows)for(let f of c)n=n.concat(this.walkTokens(f.tokens,t));break}case"list":{let l=i;n=n.concat(this.walkTokens(l.items,t));break}default:{let l=i;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[l.type]?this.defaults.extensions.childTokens[l.type].forEach(c=>{let f=l[c].flat(1/0);n=n.concat(this.walkTokens(f,t))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=t.renderers[s.name];i?t.renderers[s.name]=function(...l){let c=s.renderer.apply(this,l);return c===!1&&(c=i.apply(this,l)),c}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){let s=this.defaults.renderer||new u0(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,c=n.renderer[l],f=s[l];s[l]=(...d)=>{let p=c.apply(s,d);return p===!1&&(p=f.apply(s,d)),p||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new l0(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,c=n.tokenizer[l],f=s[l];s[l]=(...d)=>{let p=c.apply(s,d);return p===!1&&(p=f.apply(s,d)),p}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new $d;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,c=n.hooks[l],f=s[l];$d.passThroughHooks.has(i)?s[l]=d=>{if(this.defaults.async&&$d.passThroughHooksRespectAsync.has(i))return(async()=>{let m=await c.call(s,d);return f.call(s,m)})();let p=c.call(s,d);return f.call(s,p)}:s[l]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await c.apply(s,d);return m===!1&&(m=await f.apply(s,d)),m})();let p=c.apply(s,d);return p===!1&&(p=f.apply(s,d)),p}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(l){let c=[];return c.push(i.call(this,l)),s&&(c=c.concat(s.call(this,l))),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ys.lex(e,t??this.defaults)}parser(e,t){return Fs.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(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 t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let l=s.hooks?await s.hooks.preprocess(t):t,c=await(s.hooks?await s.hooks.provideLexer():e?ys.lex:ys.lexInline)(l,s),f=s.hooks?await s.hooks.processAllTokens(c):c;s.walkTokens&&await Promise.all(this.walkTokens(f,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser():e?Fs.parse:Fs.parseInline)(f,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let l=(s.hooks?s.hooks.provideLexer():e?ys.lex:ys.lexInline)(t,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?Fs.parse:Fs.parseInline)(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(l){return i(l)}}}onError(e,t){return n=>{if(n.message+=`
|
|
713
|
-
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+qa(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},hl=new Zge;function Kt(e,t){return hl.parse(e,t)}Kt.options=Kt.setOptions=function(e){return hl.setOptions(e),Kt.defaults=hl.defaults,KP(Kt.defaults),Kt};Kt.getDefaults=w2;Kt.defaults=wl;Kt.use=function(...e){return hl.use(...e),Kt.defaults=hl.defaults,KP(Kt.defaults),Kt};Kt.walkTokens=function(e,t){return hl.walkTokens(e,t)};Kt.parseInline=hl.parseInline;Kt.Parser=Fs;Kt.parser=Fs.parse;Kt.Renderer=u0;Kt.TextRenderer=D2;Kt.Lexer=ys;Kt.lexer=ys.lex;Kt.Tokenizer=l0;Kt.Hooks=$d;Kt.parse=Kt;Kt.options;Kt.setOptions;Kt.use;Kt.walkTokens;Kt.parseInline;Fs.parse;ys.lex;var Jge=300,exe="300px",txe=500;function nxe(e={}){let{immediate:t=!1,debounceDelay:n=Jge,rootMargin:r=exe,idleTimeout:s=txe}=e,[i,l]=b.useState(!1),c=b.useRef(null),f=b.useRef(null),d=b.useRef(null),p=b.useMemo(()=>y=>{let v=Date.now();return window.setTimeout(()=>{y({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),m=b.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(y,v)=>window.requestIdleCallback(y,v):p,[p]),x=b.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?y=>window.cancelIdleCallback(y):y=>{clearTimeout(y)},[]);return b.useEffect(()=>{if(t){l(!0);return}let y=c.current;if(!y)return;f.current&&(clearTimeout(f.current),f.current=null),d.current&&(x(d.current),d.current=null);let v=()=>{f.current&&(clearTimeout(f.current),f.current=null),d.current&&(x(d.current),d.current=null)},T=k=>{d.current=m(R=>{R.timeRemaining()>0||R.didTimeout?(l(!0),k.disconnect()):d.current=m(()=>{l(!0),k.disconnect()},{timeout:s/2})},{timeout:s})},w=k=>{v(),f.current=window.setTimeout(()=>{var R,D;let O=k.takeRecords();(O.length===0||(D=(R=O.at(-1))==null?void 0:R.isIntersecting)!=null&&D)&&T(k)},n)},N=(k,R)=>{k.isIntersecting?w(R):v()},A=new IntersectionObserver(k=>{for(let R of k)N(R,A)},{rootMargin:r,threshold:0});return A.observe(y),()=>{f.current&&clearTimeout(f.current),d.current&&x(d.current),A.disconnect()}},[t,n,r,s,x,m]),{shouldRender:i,containerRef:c}}var a8=/\s/,rxe=/^\s+$/,sxe=new Set(["code","pre","svg","math","annotation"]),axe=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",ixe=e=>e.some(t=>axe(t)&&sxe.has(t.tagName)),oxe=e=>{let t=[],n="",r=!1;for(let s of e){let i=a8.test(s);i!==r&&n&&(t.push(n),n=""),n+=s,r=i}return n&&t.push(n),t},lxe=e=>{let t=[],n="";for(let r of e)a8.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},uxe=(e,t,n,r)=>({type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:"text",value:e}]}),cxe=(e,t,n)=>{let r=t.at(-1);if(!(r&&"children"in r))return;if(ixe(t))return Ru;let s=r,i=s.children.indexOf(e);if(i===-1)return;let l=e.value;if(!l.trim())return;let c=(n.sep==="char"?lxe(l):oxe(l)).map(f=>rxe.test(f)?{type:"text",value:f}:uxe(f,n.animation,n.duration,n.easing));return s.children.splice(i,1,...c),i+c.length};function eE(e){var t,n,r,s;let i={animation:(t=e==null?void 0:e.animation)!=null?t:"fadeIn",duration:(n=e==null?void 0:e.duration)!=null?n:150,easing:(r=e==null?void 0:e.easing)!=null?r:"ease",sep:(s=e==null?void 0:e.sep)!=null?s:"word"};return{name:"animate",type:"animate",rehypePlugin:()=>l=>{e2(l,"text",(c,f)=>cxe(c,f,i))}}}eE();var i8=b.createContext(!1),dxe=()=>b.useContext(i8),Ze=(...e)=>V5(mE(e)),Bu=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)},fxe=Ze("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"),hxe=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let s=n.slice(0,r).trim(),i=n.slice(r+1).trim();s&&i&&(t[s]=i)}}return t},mxe=b.memo(({children:e,result:t,language:n,className:r,...s})=>{let i=b.useMemo(()=>{let l={};return t.bg&&(l["--sdm-bg"]=t.bg),t.fg&&(l["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(l,hxe(t.rootStyle)),l},[t.bg,t.fg,t.rootStyle]);return u.jsx("div",{className:Ze(r,"overflow-hidden rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...s,children:u.jsx("pre",{className:Ze(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:i,children:u.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((l,c)=>u.jsx("span",{className:fxe,children:l.map((f,d)=>{let p={},m=!!f.bgColor;if(f.color&&(p["--sdm-c"]=f.color),f.bgColor&&(p["--sdm-tbg"]=f.bgColor),f.htmlStyle)for(let[x,y]of Object.entries(f.htmlStyle))x==="color"?p["--sdm-c"]=y:x==="background-color"?(p["--sdm-tbg"]=y,m=!0):p[x]=y;return u.jsx("span",{className:Ze("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",m&&"bg-[var(--sdm-tbg)]",m&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:p,...f.htmlAttrs,children:f.content},d)})},c))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className),pxe=({className:e,language:t,style:n,isIncomplete:r,...s})=>u.jsx("div",{className:Ze("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...s}),o8=b.createContext({code:""}),l8=()=>b.useContext(o8),gxe=({language:e})=>u.jsx("div",{className:"flex h-8 items-center text-muted-foreground text-xs","data-language":e,"data-streamdown":"code-block-header",children:u.jsx("span",{className:"ml-1 font-mono lowercase",children:e})}),xxe=/\n+$/,yxe=b.lazy(()=>c0(()=>import("./highlighted-body-B3W2YXNL-D-c41b3T.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),bxe=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,...i})=>{let l=b.useMemo(()=>e.replace(xxe,""),[e]),c=b.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:l.split(`
|
|
714
|
-
`).map(f=>[{content:f,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[l]);return u.jsx(o8.Provider,{value:{code:e},children:u.jsxs(pxe,{isIncomplete:s,language:t,children:[u.jsx(gxe,{language:t}),r?u.jsx("div",{className:"pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end",children:u.jsx("div",{className:"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,u.jsx(b.Suspense,{fallback:u.jsx(mxe,{className:n,language:t,result:c,...i}),children:u.jsx(yxe,{className:n,code:l,language:t,raw:c,...i})})]})})},j2=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),M2=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),yg=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),vxe=e=>u.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[u.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Exe=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),Txe=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),u8=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),jR=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),Sxe=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),wxe=e=>u.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:u.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"})}),MR=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:i,...l})=>{let[c,f]=b.useState(!1),d=b.useRef(0),{code:p}=l8(),{isAnimating:m}=b.useContext(ks),x=i??p,y=async()=>{var T;if(typeof window>"u"||!((T=navigator==null?void 0:navigator.clipboard)!=null&&T.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{c||(await navigator.clipboard.writeText(x),f(!0),e==null||e(),d.current=window.setTimeout(()=>f(!1),n))}catch(w){t==null||t(w)}};b.useEffect(()=>()=>{window.clearTimeout(d.current)},[]);let v=c?j2:M2;return u.jsx("button",{className:Ze("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-copy-button",disabled:m,onClick:y,title:"Copy Code",type:"button",...l,children:r??u.jsx(v,{size:14})})},IR={"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"},Cxe=({onDownload:e,onError:t,language:n,children:r,className:s,code:i,...l})=>{let{code:c}=l8(),{isAnimating:f}=b.useContext(ks),d=i??c,p=`file.${n&&n in IR?IR[n]:"txt"}`,m="text/plain",x=()=>{try{Bu(p,d,m),e==null||e()}catch(y){t==null||t(y)}};return u.jsx("button",{className:Ze("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-download-button",disabled:f,onClick:x,title:"Download file",type:"button",...l,children:r??u.jsx(yg,{size:14})})},Nxe=()=>u.jsxs("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[u.jsx("div",{className:"h-[46px] w-full bg-muted/80"}),u.jsx("div",{className:"flex w-full items-center justify-center p-4",children:u.jsx(vxe,{className:"size-4 animate-spin"})})]}),Axe=/\.[^/.]+$/,kxe=({node:e,className:t,src:n,alt:r,onLoad:s,onError:i,...l})=>{let c=b.useRef(null),[f,d]=b.useState(!1),[p,m]=b.useState(!1),x=l.width!=null||l.height!=null,y=(f||x)&&!p,v=p&&!x;b.useEffect(()=>{let A=c.current;if(A!=null&&A.complete){let k=A.naturalWidth>0;d(k),m(!k)}},[]);let T=b.useCallback(A=>{d(!0),m(!1),s==null||s(A)},[s]),w=b.useCallback(A=>{d(!1),m(!0),i==null||i(A)},[i]),N=async()=>{if(n)try{let A=await(await fetch(n)).blob(),k=new URL(n,window.location.origin).pathname.split("/").pop()||"",R=k.split(".").pop(),D=k.includes(".")&&R!==void 0&&R.length<=4,O="";if(D)O=k;else{let M=A.type,I="png";M.includes("jpeg")||M.includes("jpg")?I="jpg":M.includes("png")?I="png":M.includes("svg")?I="svg":M.includes("gif")?I="gif":M.includes("webp")&&(I="webp"),O=`${(r||k||"image").replace(Axe,"")}.${I}`}Bu(O,A,A.type)}catch{window.open(n,"_blank")}};return n?u.jsxs("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[u.jsx("img",{alt:r,className:Ze("max-w-full rounded-lg",v&&"hidden",t),"data-streamdown":"image",onError:w,onLoad:T,ref:c,src:n,...l}),v&&u.jsx("span",{className:"text-muted-foreground text-xs italic","data-streamdown":"image-fallback",children:"Image not available"}),u.jsx("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),y&&u.jsx("button",{className:Ze("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:N,title:"Download image",type:"button",children:u.jsx(yg,{size:14})})]}):null},af=0,_xe=()=>{af+=1,af===1&&(document.body.style.overflow="hidden")},Rxe=()=>{af=Math.max(0,af-1),af===0&&(document.body.style.overflow="")},Oxe=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let[s,i]=b.useState(!1),l=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)}catch{}},[e]),c=b.useCallback(()=>{r(),n()},[r,n]);return b.useEffect(()=>{if(t){_xe();let f=d=>{d.key==="Escape"&&n()};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),Rxe()}}},[t,n]),t?u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:n,onKeyDown:f=>{f.key==="Escape"&&n()},role:"button",tabIndex:0,children:u.jsxs("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:[u.jsx("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:n,title:"Close",type:"button",children:u.jsx(u8,{size:16})}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[u.jsx(jR,{size:20}),u.jsx("span",{children:"Open external link?"})]}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),u.jsx("div",{className:Ze("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{className:"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:l,type:"button",children:s?u.jsxs(u.Fragment,{children:[u.jsx(j2,{size:14}),u.jsx("span",{children:"Copied"})]}):u.jsxs(u.Fragment,{children:[u.jsx(M2,{size:14}),u.jsx("span",{children:"Copy link"})]})}),u.jsxs("button",{className:"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:c,type:"button",children:[u.jsx(jR,{size:14}),u.jsx("span",{children:"Open link"})]})]})]})}):null},tE=b.createContext(null),c8=()=>b.useContext(tE),Sye=()=>{var e;let t=c8();return(e=t==null?void 0:t.code)!=null?e:null},I2=()=>{var e;let t=c8();return(e=t==null?void 0:t.mermaid)!=null?e:null},Dxe=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((s,i)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let f=document.createElement("canvas"),d=c.width*r,p=c.height*r;f.width=d,f.height=p;let m=f.getContext("2d");if(!m){i(new Error("Failed to create 2D canvas context for PNG export"));return}m.drawImage(c,0,0,d,p),f.toBlob(x=>{if(!x){i(new Error("Failed to create PNG blob"));return}s(x)},"image/png")},c.onerror=()=>i(new Error("Failed to load SVG image")),c.src=l})},jxe=({chart:e,children:t,className:n,onDownload:r,config:s,onError:i})=>{let[l,c]=b.useState(!1),f=b.useRef(null),{isAnimating:d}=b.useContext(ks),p=I2(),m=async x=>{try{if(x==="mmd"){Bu("diagram.mmd",e,"text/plain"),c(!1),r==null||r(x);return}if(!p){i==null||i(new Error("Mermaid plugin not available"));return}let y=p.getMermaid(s),v=e.split("").reduce((N,A)=>(N<<5)-N+A.charCodeAt(0)|0,0),T=`mermaid-${Math.abs(v)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:w}=await y.render(T,e);if(!w){i==null||i(new Error("SVG not found. Please wait for the diagram to render."));return}if(x==="svg"){Bu("diagram.svg",w,"image/svg+xml"),c(!1),r==null||r(x);return}if(x==="png"){let N=await Dxe(w);Bu("diagram.png",N,"image/png"),r==null||r(x),c(!1);return}}catch(y){i==null||i(y)}};return b.useEffect(()=>{let x=y=>{let v=y.composedPath();f.current&&!v.includes(f.current)&&c(!1)};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[]),u.jsxs("div",{className:"relative",ref:f,children:[u.jsx("button",{className:Ze("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:d,onClick:()=>c(!l),title:"Download diagram",type:"button",children:t??u.jsx(yg,{size:14})}),l?u.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[u.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>m("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),u.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>m("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),u.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>m("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},of=0,Mxe=()=>{of+=1,of===1&&(document.body.style.overflow="hidden")},Ixe=()=>{of=Math.max(0,of-1),of===0&&(document.body.style.overflow="")},Lxe=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...i})=>{let[l,c]=b.useState(!1),{isAnimating:f,controls:d}=b.useContext(ks),p=(()=>{if(typeof d=="boolean")return d;let x=d.mermaid;return x===!1?!1:x===!0||x===void 0?!0:x.panZoom!==!1})(),m=()=>{c(!l)};return b.useEffect(()=>{if(l){Mxe();let x=y=>{y.key==="Escape"&&c(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),Ixe()}}},[l]),b.useEffect(()=>{l?n==null||n():r&&r()},[l,n,r]),u.jsxs(u.Fragment,{children:[u.jsx("button",{className:Ze("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),disabled:f,onClick:m,title:"View fullscreen",type:"button",...i,children:u.jsx(Exe,{size:14})}),l?ai.createPortal(u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:m,onKeyDown:x=>{x.key==="Escape"&&m()},role:"button",tabIndex:0,children:[u.jsx("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:m,title:"Exit fullscreen",type:"button",children:u.jsx(u8,{size:20})}),u.jsx("div",{className:"flex size-full items-center justify-center p-4",onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:u.jsx(z8,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:p})})]}),document.body):null]})},d8=e=>{var t,n;let r=[],s=[],i=e.querySelectorAll("thead th");for(let c of i)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let c of l){let f=[],d=c.querySelectorAll("td");for(let p of d)f.push(((n=p.textContent)==null?void 0:n.trim())||"");s.push(f)}return{headers:r,rows:s}},f8=e=>{let{headers:t,rows:n}=e,r=c=>{let f=!1,d=!1;for(let p of c){if(p==='"'){f=!0,d=!0;break}(p===","||p===`
|
|
715
|
-
`)&&(f=!0)}return f?d?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},s=t.length>0?n.length+1:n.length,i=new Array(s),l=0;t.length>0&&(i[l]=t.map(r).join(","),l+=1);for(let c of n)i[l]=c.map(r).join(","),l+=1;return i.join(`
|
|
716
|
-
`)},Pxe=e=>{let{headers:t,rows:n}=e,r=c=>{let f=!1;for(let p of c)if(p===" "||p===`
|
|
717
|
-
`||p==="\r"){f=!0;break}if(!f)return c;let d=[];for(let p of c)p===" "?d.push("\\t"):p===`
|
|
718
|
-
`?d.push("\\n"):p==="\r"?d.push("\\r"):d.push(p);return d.join("")},s=t.length>0?n.length+1:n.length,i=new Array(s),l=0;t.length>0&&(i[l]=t.map(r).join(" "),l+=1);for(let c of n)i[l]=c.map(r).join(" "),l+=1;return i.join(`
|
|
719
|
-
`)},bb=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("")},nE=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),s=0,i=t.map(c=>bb(c));r[s]=`| ${i.join(" | ")} |`,s+=1;let l=new Array(t.length);for(let c=0;c<t.length;c+=1)l[c]="---";r[s]=`| ${l.join(" | ")} |`,s+=1;for(let c of n)if(c.length<t.length){let f=new Array(t.length);for(let d=0;d<t.length;d+=1)f[d]=d<c.length?bb(c[d]):"";r[s]=`| ${f.join(" | ")} |`,s+=1}else{let f=c.map(d=>bb(d));r[s]=`| ${f.join(" | ")} |`,s+=1}return r.join(`
|
|
720
|
-
`)},Bxe=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let[i,l]=b.useState(!1),[c,f]=b.useState(!1),d=b.useRef(null),p=b.useRef(0),{isAnimating:m}=b.useContext(ks),x=async v=>{var T,w;if(typeof window>"u"||!((T=navigator==null?void 0:navigator.clipboard)!=null&&T.write)){r==null||r(new Error("Clipboard API not available"));return}try{let N=(w=d.current)==null?void 0:w.closest('[data-streamdown="table-wrapper"]'),A=N==null?void 0:N.querySelector("table");if(!A){r==null||r(new Error("Table not found"));return}let k=d8(A),R=({csv:f8,tsv:Pxe,md:nE}[v]||nE)(k),D=new ClipboardItem({"text/plain":new Blob([R],{type:"text/plain"}),"text/html":new Blob([A.outerHTML],{type:"text/html"})});await navigator.clipboard.write([D]),f(!0),l(!1),n==null||n(v),p.current=window.setTimeout(()=>f(!1),s)}catch(N){r==null||r(N)}};b.useEffect(()=>{let v=T=>{let w=T.composedPath();d.current&&!w.includes(d.current)&&l(!1)};return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v),window.clearTimeout(p.current)}},[]);let y=c?j2:M2;return u.jsxs("div",{className:"relative",ref:d,children:[u.jsx("button",{className:Ze("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:m,onClick:()=>l(!i),title:"Copy table",type:"button",children:e??u.jsx(y,{size:14})}),i?u.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[u.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>x("md"),title:"Copy table as Markdown",type:"button",children:"Markdown"}),u.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>x("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),u.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>x("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},Fxe=({children:e,className:t,onDownload:n,onError:r})=>{let[s,i]=b.useState(!1),l=b.useRef(null),{isAnimating:c}=b.useContext(ks),f=d=>{var p;try{let m=(p=l.current)==null?void 0:p.closest('[data-streamdown="table-wrapper"]'),x=m==null?void 0:m.querySelector("table");if(!x){r==null||r(new Error("Table not found"));return}let y=d8(x),v=d==="csv"?f8(y):nE(y);Bu(`table.${d==="csv"?"csv":"md"}`,v,d==="csv"?"text/csv":"text/markdown"),i(!1),n==null||n(d)}catch(m){r==null||r(m)}};return b.useEffect(()=>{let d=p=>{let m=p.composedPath();l.current&&!m.includes(l.current)&&i(!1)};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[]),u.jsxs("div",{className:"relative",ref:l,children:[u.jsx("button",{className:Ze("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:c,onClick:()=>i(!s),title:"Download table",type:"button",children:e??u.jsx(yg,{size:14})}),s?u.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[u.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),u.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},zxe=({children:e,className:t,showControls:n,...r})=>u.jsxs("div",{className:"my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2","data-streamdown":"table-wrapper",children:[n?u.jsxs("div",{className:"flex items-center justify-end gap-1",children:[u.jsx(Bxe,{}),u.jsx(Fxe,{})]}):null,u.jsx("div",{className:"border-collapse overflow-x-auto overscroll-y-auto rounded-md border border-border bg-background",children:u.jsx("table",{className:Ze("w-full divide-y divide-border",t),"data-streamdown":"table",...r,children:e})})]}),Uxe=b.lazy(()=>c0(()=>Promise.resolve().then(()=>gye),void 0).then(e=>({default:e.Mermaid}))),Hxe=/language-([^\s]+)/;function bg(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,s=e.position.end,i=t.position.end;return(n==null?void 0:n.line)===(r==null?void 0:r.line)&&(n==null?void 0:n.column)===(r==null?void 0:r.column)&&(s==null?void 0:s.line)===(i==null?void 0:i.line)&&(s==null?void 0:s.column)===(i==null?void 0:i.column)}function An(e,t){return e.className===t.className&&bg(e.node,t.node)}var rE=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,up=(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},L2=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("ol",{className:Ze("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>An(e,t));L2.displayName="MarkdownOl";var h8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("li",{className:Ze("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&bg(e.node,t.node));h8.displayName="MarkdownLi";var m8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("ul",{className:Ze("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>An(e,t));m8.displayName="MarkdownUl";var p8=b.memo(({className:e,node:t,...n})=>u.jsx("hr",{className:Ze("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>An(e,t));p8.displayName="MarkdownHr";var g8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("span",{className:Ze("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>An(e,t));g8.displayName="MarkdownStrong";var $xe=({children:e,className:t,href:n,node:r,...s})=>{let{linkSafety:i}=b.useContext(ks),[l,c]=b.useState(!1),f=n==="streamdown:incomplete-link",d=b.useCallback(async y=>{if(!(!(i!=null&&i.enabled&&n)||f)){if(y.preventDefault(),i.onLinkCheck&&await i.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}c(!0)}},[i,n,f]),p=b.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),m=b.useCallback(()=>{c(!1)},[]),x={url:n??"",isOpen:l,onClose:m,onConfirm:p};return i!=null&&i.enabled&&n?u.jsxs(u.Fragment,{children:[u.jsx("button",{className:Ze("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":f,"data-streamdown":"link",onClick:d,type:"button",children:e}),i.renderModal?i.renderModal(x):u.jsx(Oxe,{...x})]}):u.jsx("a",{className:Ze("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":f,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...s,children:e})},x8=b.memo($xe,(e,t)=>An(e,t)&&e.href===t.href);x8.displayName="MarkdownA";var y8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("h1",{className:Ze("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>An(e,t));y8.displayName="MarkdownH1";var b8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("h2",{className:Ze("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>An(e,t));b8.displayName="MarkdownH2";var v8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("h3",{className:Ze("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>An(e,t));v8.displayName="MarkdownH3";var E8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("h4",{className:Ze("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>An(e,t));E8.displayName="MarkdownH4";var T8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("h5",{className:Ze("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>An(e,t));T8.displayName="MarkdownH5";var S8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("h6",{className:Ze("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>An(e,t));S8.displayName="MarkdownH6";var w8=b.memo(({children:e,className:t,node:n,...r})=>{let{controls:s}=b.useContext(ks),i=rE(s,"table");return u.jsx(zxe,{className:t,showControls:i,...r,children:e})},(e,t)=>An(e,t));w8.displayName="MarkdownTable";var C8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("thead",{className:Ze("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>An(e,t));C8.displayName="MarkdownThead";var N8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("tbody",{className:Ze("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>An(e,t));N8.displayName="MarkdownTbody";var A8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("tr",{className:Ze("border-border",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>An(e,t));A8.displayName="MarkdownTr";var k8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("th",{className:Ze("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>An(e,t));k8.displayName="MarkdownTh";var _8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("td",{className:Ze("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>An(e,t));_8.displayName="MarkdownTd";var R8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("blockquote",{className:Ze("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>An(e,t));R8.displayName="MarkdownBlockquote";var O8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("sup",{className:Ze("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>An(e,t));O8.displayName="MarkdownSup";var D8=b.memo(({children:e,className:t,node:n,...r})=>u.jsx("sub",{className:Ze("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>An(e,t));D8.displayName="MarkdownSub";var j8=b.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let s=l=>{var c,f;if(!b.isValidElement(l))return!1;let d=Array.isArray(l.props.children)?l.props.children:[l.props.children],p=!1,m=!1;for(let x of d)if(x){if(typeof x=="string")x.trim()!==""&&(p=!0);else if(b.isValidElement(x))if(((c=x.props)==null?void 0:c["data-footnote-backref"])!==void 0)m=!0;else{let y=Array.isArray(x.props.children)?x.props.children:[x.props.children];for(let v of y){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(b.isValidElement(v)&&((f=v.props)==null?void 0:f["data-footnote-backref"])===void 0){p=!0;break}}}}return m&&!p},i=Array.isArray(e)?e.map(l=>{if(!b.isValidElement(l))return l;if(l.type===L2){let c=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(f=>!s(f));return c.length===0?null:{...l,props:{...l.props,children:c}}}return l}):e;return(Array.isArray(i)?i.some(l=>l!==null):i!==null)?u.jsx("section",{className:t,...r,children:i}):null}return u.jsx("section",{className:t,...r,children:e})},(e,t)=>An(e,t));j8.displayName="MarkdownSection";var Vxe=({node:e,className:t,children:n,...r})=>{var s;let i=!("data-block"in r),{mermaid:l,controls:c}=b.useContext(ks),f=I2(),d=dxe();if(i)return u.jsx("code",{className:Ze("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let p=t==null?void 0:t.match(Hxe),m=(s=p==null?void 0:p.at(1))!=null?s:"",x="";if(b.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?x=n.props.children:typeof n=="string"&&(x=n),m==="mermaid"&&f){let v=rE(c,"mermaid"),T=up(c,"download"),w=up(c,"copy"),N=up(c,"fullscreen"),A=up(c,"panZoom"),k=v&&(T||w||N);return u.jsx(b.Suspense,{fallback:u.jsx(Nxe,{}),children:u.jsxs("div",{className:Ze("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:[u.jsx("div",{className:"flex h-8 items-center text-muted-foreground text-xs",children:u.jsx("span",{className:"ml-1 font-mono lowercase",children:"mermaid"})}),k?u.jsx("div",{className:"pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end",children:u.jsxs("div",{className:"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:[T?u.jsx(jxe,{chart:x,config:l==null?void 0:l.config}):null,w?u.jsx(MR,{code:x}):null,N?u.jsx(Lxe,{chart:x,config:l==null?void 0:l.config}):null]})}):null,u.jsx("div",{className:"rounded-md border border-border bg-background",children:u.jsx(Uxe,{chart:x,config:l==null?void 0:l.config,showControls:A})})]})})}let y=rE(c,"code");return u.jsx(bxe,{className:t,code:x,isIncomplete:d,language:m,children:y?u.jsxs(u.Fragment,{children:[u.jsx(Cxe,{code:x,language:m}),u.jsx(MR,{})]}):null})},M8=b.memo(Vxe,(e,t)=>e.className===t.className&&bg(e.node,t.node));M8.displayName="MarkdownCode";var I8=b.memo(kxe,(e,t)=>e.className===t.className&&bg(e.node,t.node));I8.displayName="MarkdownImg";var L8=b.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(r.length===1&&b.isValidElement(r[0])){let s=r[0].props.node,i=s==null?void 0:s.tagName;if(i==="img")return u.jsx(u.Fragment,{children:e});if(i==="code"&&"data-block"in r[0].props)return u.jsx(u.Fragment,{children:e})}return u.jsx("p",{...n,children:e})},(e,t)=>An(e,t));L8.displayName="MarkdownParagraph";var qxe={ol:L2,li:h8,ul:m8,hr:p8,strong:g8,a:x8,h1:y8,h2:b8,h3:v8,h4:E8,h5:T8,h6:S8,table:w8,thead:C8,tbody:N8,tr:A8,th:k8,td:_8,blockquote:R8,code:M8,img:I8,pre:({children:e})=>b.isValidElement(e)?b.cloneElement(e,{"data-block":"true"}):e,sup:O8,sub:D8,p:L8,section:j8},Yxe=/^[ \t]{0,3}(`{3,}|~{3,})/,Gxe=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,LR=e=>{let t=e.split(`
|
|
721
|
-
`),n=null,r=0;for(let s of t){let i=Yxe.exec(s);if(n===null){if(i){let l=i[1];n=l[0],r=l.length}}else if(i){let l=i[1],c=l[0],f=l.length;c===n&&f>=r&&(n=null,r=0)}}return n!==null},Kxe=e=>{let t=e.split(`
|
|
722
|
-
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&Gxe.test(r))return!0}return!1},Qxe=()=>e=>{io(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},PR=[],BR={allowDangerousHtml:!0},cp=new WeakMap,Xxe=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,s=e.remarkRehypeOptions;if(!(n||r||s)){let p="default";return this.keyCache.set(e,p),p}let i=p=>{if(!p||p.length===0)return"";let m="";for(let x=0;x<p.length;x+=1){let y=p[x];if(x>0&&(m+=","),Array.isArray(y)){let[v,T]=y;if(typeof v=="function"){let w=cp.get(v);w||(w=v.name,cp.set(v,w)),m+=w}else m+=String(v);m+=":",m+=JSON.stringify(T)}else if(typeof y=="function"){let v=cp.get(y);v||(v=y.name,cp.set(y,v)),m+=v}else m+=String(y)}return m},l=i(n),c=i(r),f=s?JSON.stringify(s):"",d=`${c}::${l}::${f}`;return this.keyCache.set(e,d),d}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()}},FR=new Xxe,P8=e=>{let t=Wxe(e),n=e.children||"";return s1e(t.runSync(t.parse(n),n),e)},Wxe=e=>{let t=FR.get(e);if(t)return t;let n=Jxe(e);return FR.set(e,n),n},Zxe=e=>e.some(t=>Array.isArray(t)?t[0]===$v:t===$v),Jxe=e=>{let t=e.rehypePlugins||PR,n=e.remarkPlugins||PR,r=Zxe(t)?n:[...n,Qxe],s=e.remarkRehypeOptions?{...BR,...e.remarkRehypeOptions}:BR;return fge().use(d0e).use(r).use(G0e,s).use(t)},e1e=e=>e,t1e=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},n1e=(e,t)=>{var n;for(let r in cb)if(Object.hasOwn(cb,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],i=cb[r];(i===null||i.includes(e.tagName))&&(e.properties[r]=(n=t(String(s||""),r,e))!=null?n:void 0)}},r1e=(e,t,n,r,s,i)=>{let l=!1;return r?l=!r.includes(e.tagName):s&&(l=s.includes(e.tagName)),!l&&i&&typeof t=="number"&&(l=!i(e,t,n)),l},s1e=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:s,skipHtml:i,unwrapDisallowed:l,urlTransform:c}=t;if(n||r||s||i||c){let f=c||e1e;io(e,(d,p,m)=>{if(d.type==="raw"&&m&&typeof p=="number")return t1e(m,p,i,d.value),p;if(d.type==="element"&&(n1e(d,f),r1e(d,p,m,r,s,n)&&m&&typeof p=="number"))return l&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p})}return bpe(e,{Fragment:u.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0})},a1e=/\[\^[\w-]{1,200}\](?!:)/,i1e=/\[\^[\w-]{1,200}\]:/,o1e=/<(\w+)[\s>]/,l1e=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),zR=new Map,UR=new Map,u1e=e=>{let t=e.toLowerCase(),n=zR.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return zR.set(t,r),r},c1e=e=>{let t=e.toLowerCase(),n=UR.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return UR.set(t,r),r},HR=(e,t)=>{if(l1e.has(t.toLowerCase()))return 0;let n=e.match(u1e(t));if(!n)return 0;let r=0;for(let s of n)s.trimEnd().endsWith("/>")||(r+=1);return r},$R=(e,t)=>{let n=e.match(c1e(t));return n?n.length:0},d1e=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},f1e=e=>{let t=a1e.test(e),n=i1e.test(e);if(t||n)return[e];let r=ys.lex(e,{gfm:!0}),s=[],i=[],l=!1;for(let c of r){let f=c.raw,d=s.length;if(i.length>0){s[d-1]+=f;let p=i.at(-1),m=HR(f,p),x=$R(f,p);for(let y=0;y<m;y+=1)i.push(p);for(let y=0;y<x;y+=1)i.length>0&&i.at(-1)===p&&i.pop();continue}if(c.type==="html"&&c.block){let p=f.match(o1e);if(p){let m=p[1],x=HR(f,m),y=$R(f,m);x>y&&i.push(m)}}if(d>0&&!l){let p=s[d-1];if(d1e(p)%2===1){s[d-1]=p+f;continue}}s.push(f),c.type!=="space"&&(l=c.type==="code")}return s},h1e=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(i,l,c,f)=>{let d=c.replace(/\n\n/g,`
|
|
723
|
-
<!---->
|
|
724
|
-
`);return l+d+f})}return n},m1e=/^[ \t]*<[\w!/?-]/,p1e=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,g1e=e=>typeof e!="string"||e.length===0||!m1e.test(e)?e:e.replace(p1e,"$1"),VR,qR,Ap={...tf,protocols:{...tf.protocols,href:[...(qR=(VR=tf.protocols)==null?void 0:VR.href)!=null?qR:[],"tel"]}},sE={raw:$v,sanitize:[XL,Ap],harden:[Die,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},x1e={gfm:[Xhe,{}]},YR=Object.values(sE),y1e=Object.values(x1e),b1e={block:" ▋",circle:" ●"},v1e={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},ks=b.createContext(v1e),B8=b.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:s,...i})=>{let l=typeof e=="string"&&n?g1e(e):e;return u.jsx(i8.Provider,{value:s,children:u.jsx(P8,{...i,children:l})})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(s=>{var i,l;return((i=e.components)==null?void 0:i[s])!==((l=t.components)==null?void 0:l[s])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});B8.displayName="Block";var E1e=["github-light","github-dark"],F8=b.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,normalizeHtmlIndentation:r=!1,components:s,rehypePlugins:i=YR,remarkPlugins:l=y1e,className:c,shikiTheme:f=E1e,mermaid:d,controls:p=!0,isAnimating:m=!1,animated:x,BlockComponent:y=B8,parseMarkdownIntoBlocksFn:v=f1e,caret:T,plugins:w,remend:N,linkSafety:A={enabled:!0},allowedTags:k,...R})=>{let D=b.useId(),[O,M]=b.useTransition(),I=b.useMemo(()=>k?Object.keys(k):[],[k]),H=b.useMemo(()=>{if(typeof e!="string")return"";let V=t==="streaming"&&n?rpe(e,N):e;return I.length>0&&(V=h1e(V,I)),V},[e,t,n,N,I]),P=b.useMemo(()=>v(H),[H,v]),[K,Y]=b.useState(P);b.useEffect(()=>{t==="streaming"?M(()=>{Y(P)}):Y(P)},[P,t]);let W=t==="streaming"?K:P,te=b.useMemo(()=>W.map((V,j)=>`${D}-${j}`),[W.length,D]),J=b.useMemo(()=>x?x===!0?eE():eE(x):null,[x]),L=b.useMemo(()=>{var V,j;return{shikiTheme:(j=(V=w==null?void 0:w.code)==null?void 0:V.getThemes())!=null?j:f,controls:p,isAnimating:m,mode:t,mermaid:d,linkSafety:A}},[f,p,m,t,d,A,w==null?void 0:w.code]),B=b.useMemo(()=>({...qxe,...s}),[s]),U=b.useMemo(()=>{let V=[];return w!=null&&w.cjk&&(V=[...V,...w.cjk.remarkPluginsBefore]),V=[...V,...l],w!=null&&w.cjk&&(V=[...V,...w.cjk.remarkPluginsAfter]),w!=null&&w.math&&(V=[...V,w.math.remarkPlugin]),V},[l,w==null?void 0:w.math,w==null?void 0:w.cjk]),ne=b.useMemo(()=>{var V;let j=i;if(k&&Object.keys(k).length>0&&i===YR){let re={...Ap,tagNames:[...(V=Ap.tagNames)!=null?V:[],...Object.keys(k)],attributes:{...Ap.attributes,...k}};j=[sE.raw,[XL,re],sE.harden]}return w!=null&&w.math&&(j=[...j,w.math.rehypePlugin]),J&&m&&(j=[...j,J.rehypePlugin]),j},[i,w==null?void 0:w.math,J,m,k]),z=b.useMemo(()=>{if(!m||W.length===0)return!1;let V=W.at(-1);return LR(V)||Kxe(V)},[m,W]),q=b.useMemo(()=>T&&m&&!z?{"--streamdown-caret":`"${b1e[T]}"`}:void 0,[T,m,z]);return t==="static"?u.jsx(tE.Provider,{value:w??null,children:u.jsx(ks.Provider,{value:L,children:u.jsx("div",{className:Ze("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",c),children:u.jsx(P8,{components:B,rehypePlugins:ne,remarkPlugins:U,...R,children:H})})})}):u.jsx(tE.Provider,{value:w??null,children:u.jsx(ks.Provider,{value:L,children:u.jsxs("div",{className:Ze("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",T&&!z?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,c),style:q,children:[W.length===0&&T&&m&&u.jsx("span",{}),W.map((V,j)=>{let re=j===W.length-1,ae=m&&re&&LR(V);return u.jsx(y,{components:B,content:V,index:j,isIncomplete:ae,rehypePlugins:ne,remarkPlugins:U,shouldNormalizeHtmlIndentation:r,shouldParseIncompleteMarkdown:n,...R},te[j])})]})})})},(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.normalizeHtmlIndentation===t.normalizeHtmlIndentation);F8.displayName="Streamdown";var T1e=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:s=.1,showControls:i=!0,initialZoom:l=1,fullscreen:c=!1})=>{let f=b.useRef(null),d=b.useRef(null),[p,m]=b.useState(l),[x,y]=b.useState({x:0,y:0}),[v,T]=b.useState(!1),[w,N]=b.useState({x:0,y:0}),[A,k]=b.useState({x:0,y:0}),R=b.useCallback(Y=>{m(W=>Math.max(n,Math.min(r,W+Y)))},[n,r]),D=b.useCallback(()=>{R(s)},[R,s]),O=b.useCallback(()=>{R(-s)},[R,s]),M=b.useCallback(()=>{m(l),y({x:0,y:0})},[l]),I=b.useCallback(Y=>{Y.preventDefault();let W=Y.deltaY>0?-s:s;R(W)},[R,s]),H=b.useCallback(Y=>{if(Y.button!==0||Y.isPrimary===!1)return;T(!0),N({x:Y.clientX,y:Y.clientY}),k(x);let W=Y.currentTarget;W instanceof HTMLElement&&W.setPointerCapture(Y.pointerId)},[x]),P=b.useCallback(Y=>{if(!v)return;Y.preventDefault();let W=Y.clientX-w.x,te=Y.clientY-w.y;y({x:A.x+W,y:A.y+te})},[v,w,A]),K=b.useCallback(Y=>{T(!1);let W=Y.currentTarget;W instanceof HTMLElement&&W.releasePointerCapture(Y.pointerId)},[]);return b.useEffect(()=>{let Y=f.current;if(Y)return Y.addEventListener("wheel",I,{passive:!1}),()=>{Y.removeEventListener("wheel",I)}},[I]),b.useEffect(()=>{let Y=d.current;if(Y&&v)return document.body.style.userSelect="none",Y.addEventListener("pointermove",P,{passive:!1}),Y.addEventListener("pointerup",K),Y.addEventListener("pointercancel",K),()=>{document.body.style.userSelect="",Y.removeEventListener("pointermove",P),Y.removeEventListener("pointerup",K),Y.removeEventListener("pointercancel",K)}},[v,P,K]),u.jsxs("div",{className:Ze("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:f,style:{cursor:v?"grabbing":"grab"},children:[i?u.jsxs("div",{className:Ze("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:[u.jsx("button",{className:"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:p>=r,onClick:D,title:"Zoom in",type:"button",children:u.jsx(Sxe,{size:16})}),u.jsx("button",{className:"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:p<=n,onClick:O,title:"Zoom out",type:"button",children:u.jsx(wxe,{size:16})}),u.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:M,title:"Reset zoom and pan",type:"button",children:u.jsx(Txe,{size:16})})]}):null,u.jsx("div",{className:Ze("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:H,ref:d,role:"application",style:{transform:`translate(${x.x}px, ${x.y}px) scale(${p})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},z8=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let[i,l]=b.useState(null),[c,f]=b.useState(!1),[d,p]=b.useState(""),[m,x]=b.useState(""),[y,v]=b.useState(0),{mermaid:T}=b.useContext(ks),w=I2(),N=T==null?void 0:T.errorComponent,{shouldRender:A,containerRef:k}=nxe({immediate:r});if(b.useEffect(()=>{if(A){if(!w){l("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{l(null),f(!0);let D=w.getMermaid(n),O=e.split("").reduce((H,P)=>(H<<5)-H+P.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(O)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:I}=await D.render(M,e);p(I),x(I)}catch(D){if(!(m||d)){let O=D instanceof Error?D.message:"Failed to render Mermaid chart";l(O)}}finally{f(!1)}})()}},[e,n,y,A,w]),!(A||d||m))return u.jsx("div",{className:Ze("my-4 min-h-[200px]",t),ref:k});if(c&&!d&&!m)return u.jsx("div",{className:Ze("my-4 flex justify-center p-4",t),ref:k,children:u.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[u.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),u.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(i&&!d&&!m){let D=()=>v(O=>O+1);return N?u.jsx("div",{ref:k,children:u.jsx(N,{chart:e,error:i,retry:D})}):u.jsxs("div",{className:Ze("rounded-md bg-red-50 p-4",t),ref:k,children:[u.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",i]}),u.jsxs("details",{className:"mt-2",children:[u.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),u.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let R=d||m;return u.jsx("div",{className:Ze("size-full",t),"data-streamdown":"mermaid",ref:k,children:u.jsx(T1e,{className:Ze(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:u.jsx("div",{"aria-label":"Mermaid chart",className:Ze("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:R},role:"img"})})})};function S1e({url:e,isOpen:t,onClose:n,onConfirm:r}){return t?ai.createPortal(u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center","data-streamdown":"link-safety-modal",onClick:n,"aria-hidden":"true",children:u.jsxs("div",{className:"bg-background relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border p-6 shadow-lg",onClick:s=>s.stopPropagation(),onKeyDown:s=>{s.stopPropagation(),s.key==="Escape"&&n()},role:"dialog","aria-modal":"true","aria-label":"Open external link confirmation",tabIndex:-1,children:[u.jsx("button",{className:"text-muted-foreground hover:bg-muted hover:text-foreground absolute top-4 right-4 rounded-md p-1 transition-all",onClick:n,title:"Close",type:"button",children:u.jsx(ba,{size:16})}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-lg font-semibold",children:[u.jsx(fv,{size:20}),u.jsx("span",{children:"Open external link?"})]}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),u.jsx("div",{className:"bg-muted rounded-md p-3 font-mono text-sm break-all",children:e}),u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("button",{className:"hover:bg-muted flex flex-1 items-center justify-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",onClick:()=>{navigator.clipboard.writeText(e),n()},type:"button",children:[u.jsx(JE,{size:14}),"Copy link"]}),u.jsxs("button",{className:"bg-foreground text-background hover:bg-foreground/90 flex flex-1 items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors",onClick:r,type:"button",children:[u.jsx(fv,{size:14}),"Open link"]})]})]})}),document.body):null}const w1e={enabled:!0,renderModal:e=>u.jsx(S1e,{...e})};function C1e({content:e,isStreaming:t=!1}){return u.jsx("div",{className:Ee("relative",t&&"streaming-cursor"),children:u.jsx(F8,{shikiTheme:["github-light","github-dark"],linkSafety:w1e,children:e})})}function N1e({toolCall:e,defaultExpanded:t=!1}){const[n,r]=b.useState(t),s={pending:u.jsx(Qn,{className:"size-(--size-icon-xs) animate-spin"}),running:u.jsx(Qn,{className:"size-(--size-icon-xs) animate-spin text-blue-500"}),complete:u.jsx(zn,{className:"size-(--size-icon-xs) text-green-500"}),error:u.jsx(ba,{className:"size-(--size-icon-xs) text-red-500"})}[e.status];return u.jsxs("div",{className:"bg-muted/50 hover:border-border mt-px rounded border text-sm transition-all duration-150 first:mt-1 hover:shadow-sm","data-testid":"tool-call-card","data-tool-name":e.toolName,"data-status":e.status,children:[u.jsxs("button",{onClick:()=>r(!n),className:"flex w-full items-center gap-2 px-3 py-1","aria-expanded":n,children:[s,u.jsx("span",{className:"text-3xs font-mono",children:gz(e.toolName,e.input)}),u.jsx(De.div,{animate:{rotate:n?180:0},transition:{type:"spring",stiffness:400,damping:30},className:"ml-auto",children:u.jsx(ti,{className:"size-(--size-icon-xs)"})})]}),u.jsx(ft,{initial:!1,children:n&&u.jsx(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:[.4,0,.2,1]},className:"overflow-hidden",children:u.jsxs("div",{className:"border-t px-3 pt-1 pb-3",children:[e.input&&u.jsx(G5,{toolName:e.toolName,input:e.input}),e.result&&u.jsx("pre",{className:"mt-2 overflow-x-auto border-t pt-2 text-xs whitespace-pre-wrap",children:e.result})]})})})]})}const A1e=b.forwardRef(function({sessionId:t,toolCallId:n,toolName:r,input:s,isActive:i=!1},l){const c=He(),[f,d]=b.useState(!1),[p,m]=b.useState(null),x=b.useCallback(async()=>{if(!(f||p)){d(!0);try{await c.approveTool(t,n),m("approved")}catch(v){console.error("Approval failed:",v)}finally{d(!1)}}},[f,p,c,t,n]),y=b.useCallback(async()=>{if(!(f||p)){d(!0);try{await c.denyTool(t,n),m("denied")}catch(v){console.error("Deny failed:",v)}finally{d(!1)}}},[f,p,c,t,n]);return b.useImperativeHandle(l,()=>({approve(){x()},deny(){y()}}),[x,y]),p?u.jsxs("div",{className:`my-1 rounded border px-3 py-2 text-sm transition-colors duration-200 ${p==="approved"?"border-emerald-500/20 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"border-red-500/20 bg-red-500/10 text-red-600 dark:text-red-400"}`,"data-testid":"tool-approval-decided","data-decision":p,children:[u.jsx("span",{className:"font-mono",children:r}),u.jsx("span",{className:"ml-2 text-xs",children:p==="approved"?"Approved":"Denied"})]}):u.jsxs("div",{className:Ee("my-1 rounded border border-amber-500/20 bg-amber-500/10 p-3 text-sm transition-all duration-200",i&&"ring-2 ring-amber-500/30"),"data-testid":"tool-approval",children:[u.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[u.jsx(x0,{className:"size-(--size-icon-md) text-amber-500"}),u.jsx("span",{className:"font-semibold",children:"Tool approval required"})]}),u.jsx("div",{className:"mb-2 font-mono text-xs",children:r}),s&&u.jsx("div",{className:"bg-muted mb-3 rounded p-2",children:u.jsx(G5,{toolName:r,input:s})}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs("button",{onClick:x,disabled:f,className:"flex items-center gap-1 rounded bg-emerald-600 px-3 py-1 text-xs text-white transition-colors hover:bg-emerald-700 disabled:opacity-50 max-md:py-2",children:[u.jsx(zn,{className:"size-(--size-icon-xs)"})," Approve",i&&u.jsx(Wa,{className:"ml-1.5",children:"Enter"})]}),u.jsxs("button",{onClick:y,disabled:f,className:"flex items-center gap-1 rounded bg-red-600 px-3 py-1 text-xs text-white transition-colors hover:bg-red-700 disabled:opacity-50 max-md:py-2",children:[u.jsx(ba,{className:"size-(--size-icon-xs)"})," Deny",i&&u.jsx(Wa,{className:"ml-1.5",children:"Esc"})]})]})]})}),k1e=b.forwardRef(function({sessionId:t,toolCallId:n,questions:r,answers:s,isActive:i=!1,focusedOptionIndex:l=-1},c){const f=He(),[d,p]=b.useState({}),[m,x]=b.useState({}),[y,v]=b.useState(!!s),[T,w]=b.useState(!1),[N,A]=b.useState(null),[k,R]=b.useState("0"),D=r[Number(k)]||r[0],O=Number(k),M=D?D.options.length+1:0;function I(L,B){p(U=>({...U,[L]:B}))}function H(L,B,U){p(ne=>{const z=ne[L]||[];return U?{...ne,[L]:[...z,B]}:{...ne,[L]:z.filter(q=>q!==B)}})}function P(L,B){x(U=>({...U,[L]:B}))}function K(L){var U,ne;const B=d[L];if(!B)return!1;if(r[L].multiSelect){const z=B;return z.length>0&&(!z.includes("__other__")||!!((U=m[L])!=null&&U.trim()))}return B!=="__other__"||!!((ne=m[L])!=null&&ne.trim())}function Y(){return r.every((L,B)=>K(B))}function W(L,B){if(s&&s[String(B)]){const U=s[String(B)];if(L.multiSelect)try{return JSON.parse(U).join(", ")}catch{return U}return U}if(!s){const U=d[B];return U?L.multiSelect?U.map(ne=>ne==="__other__"?m[B]:ne).join(", "):U==="__other__"?m[B]:U:null}return null}const te=b.useCallback(async()=>{if(!Y()||T)return;w(!0),A(null);const L={};r.forEach((B,U)=>{var z;const ne=d[U];if(B.multiSelect){const q=ne.map(V=>{var j;return V==="__other__"?((j=m[U])==null?void 0:j.trim())||"":V});L[String(U)]=JSON.stringify(q)}else L[String(U)]=ne==="__other__"?((z=m[U])==null?void 0:z.trim())||"":ne});try{await f.submitAnswers(t,n,L),v(!0)}catch(B){A(B instanceof Error?B.message:"Failed to submit answers")}finally{w(!1)}},[d,m,T,f,t,n,r]);if(b.useImperativeHandle(c,()=>({toggleOption(L){if(!D||y||T)return;if(L===D.options.length){D.multiSelect?(d[O]||[]).includes("__other__")?H(O,"__other__",!1):H(O,"__other__",!0):I(O,"__other__");return}const B=D.options[L];B&&(D.multiSelect?(d[O]||[]).includes(B.label)?H(O,B.label,!1):H(O,B.label,!0):I(O,B.label))},navigateOption(L){},navigateQuestion(L){if(r.length<=1)return;const B=Number(k);L==="next"&&B<r.length-1?R(String(B+1)):L==="prev"&&B>0&&R(String(B-1))},submit(){te()},getOptionCount(){return M},getActiveTab(){return k}}),[D,O,k,d,y,T,M,te,r.length]),y){const L=s?Object.values(s).some(B=>B!==""):Object.keys(d).length>0;return u.jsx("div",{className:"my-1 rounded border border-emerald-500/20 bg-emerald-500/10 px-3 py-2 text-sm transition-colors duration-200",children:L?u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(zn,{className:"mt-0.5 size-(--size-icon-md) shrink-0 text-emerald-500"}),u.jsx("div",{className:"min-w-0 space-y-1.5",children:r.map((B,U)=>{const ne=W(B,U);return ne?u.jsxs("div",{children:[u.jsx("span",{className:"text-xs font-semibold text-emerald-700 dark:text-emerald-300",children:B.header}),u.jsx("p",{className:"text-sm break-words text-emerald-600 dark:text-emerald-400",children:ne})]},U):null})})]}):u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(zn,{className:"size-(--size-icon-md) text-emerald-500"}),u.jsx("span",{className:"text-emerald-600 dark:text-emerald-400",children:"Questions answered"})]})})}function J(L,B){return u.jsxs("div",{children:[u.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[u.jsx(QO,{className:"size-(--size-icon-sm) text-amber-500"}),u.jsx("span",{className:"text-sm font-semibold",children:L.header})]}),u.jsx("p",{className:"text-foreground mb-2",children:L.question}),u.jsxs("div",{className:"ml-1 space-y-1.5",children:[L.options.map((U,ne)=>{const z=L.multiSelect?(d[B]||[]).includes(U.label):d[B]===U.label;return u.jsxs("label",{className:Ee("flex cursor-pointer items-start gap-2 rounded px-2 py-1.5 transition-all duration-150",z?"bg-amber-500/15":"hover:bg-amber-500/5",i&&l===ne&&"ring-1 ring-amber-500/50"),children:[u.jsx("input",{type:L.multiSelect?"checkbox":"radio",name:`q-${B}`,checked:z,disabled:T,onChange:q=>{L.multiSelect?H(B,U.label,q.target.checked):I(B,U.label)},className:"mt-0.5 accent-amber-500"}),u.jsxs("div",{children:[u.jsxs("span",{className:"font-medium",children:[U.label,i&&ne<9&&u.jsx(Wa,{className:"ml-1.5",children:ne+1})]}),U.description&&u.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:U.description})]})]},ne)}),u.jsxs("label",{className:Ee("flex cursor-pointer items-start gap-2 rounded px-2 py-1.5 transition-all duration-150",L.multiSelect?(d[B]||[]).includes("__other__")?"bg-amber-500/15":"hover:bg-amber-500/5":d[B]==="__other__"?"bg-amber-500/15":"hover:bg-amber-500/5",i&&l===L.options.length&&"ring-1 ring-amber-500/50"),children:[u.jsx("input",{type:L.multiSelect?"checkbox":"radio",name:`q-${B}`,checked:L.multiSelect?(d[B]||[]).includes("__other__"):d[B]==="__other__",disabled:T,onChange:U=>{L.multiSelect?H(B,"__other__",U.target.checked):I(B,"__other__")},className:"mt-0.5 accent-amber-500"}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("span",{className:"font-medium",children:["Other",i&&L.options.length<9&&u.jsx(Wa,{className:"ml-1.5",children:L.options.length+1})]}),(L.multiSelect?(d[B]||[]).includes("__other__"):d[B]==="__other__")&&u.jsx("textarea",{placeholder:"Type your answer...",rows:2,value:m[B]||"",disabled:T,onChange:U=>P(B,U.target.value),className:"bg-background mt-1 w-full resize-y rounded border border-amber-500/30 px-2 py-1 text-sm focus:ring-1 focus:ring-amber-500/50 focus:outline-none",autoFocus:!0})]})]})]})]})}return u.jsxs("div",{className:Ee("my-1 rounded border border-amber-500/20 bg-amber-500/10 p-3 text-sm transition-all duration-200",i&&"ring-2 ring-amber-500/30"),children:[r.length===1?J(r[0],0):u.jsxs(oh,{value:k,onValueChange:R,children:[u.jsx(Tc,{className:"mb-3 h-auto flex-wrap gap-1.5 bg-transparent p-0",children:r.map((L,B)=>u.jsxs(Gn,{value:String(B),className:"data-[state=inactive]:bg-muted/50 h-auto rounded-full px-2.5 py-1 text-xs font-medium data-[state=active]:bg-amber-500/20 data-[state=active]:text-amber-700 data-[state=active]:shadow-none dark:data-[state=active]:text-amber-300",children:[K(B)&&u.jsx(zn,{className:"mr-1 size-3"}),u.jsx("span",{className:"max-w-[120px] truncate",children:L.header})]},B))}),i&&r.length>1&&u.jsxs("div",{className:"text-2xs text-muted-foreground mb-2 flex items-center gap-1",children:[u.jsx(Wa,{children:"←"}),u.jsx(Wa,{children:"→"}),u.jsx("span",{children:"navigate questions"})]}),r.map((L,B)=>u.jsx(Kn,{value:String(B),className:"mt-0",children:J(L,B)},B))]}),N&&u.jsx("p",{className:"mt-2 text-xs text-red-500",children:N}),u.jsx("button",{onClick:te,disabled:!Y()||T,className:"mt-3 flex items-center gap-1 rounded bg-amber-600 px-3 py-1.5 text-xs text-white transition-colors hover:bg-amber-700 disabled:opacity-50",children:T?u.jsx(u.Fragment,{children:"Submitting..."}):u.jsxs(u.Fragment,{children:[u.jsx(zn,{className:"size-(--size-icon-xs)"})," Submit",i&&u.jsx(Wa,{className:"ml-1.5",children:"Enter"})]})})]})});function _1e(e,t){const n=b.useRef(e),[r,s]=b.useState(!(t&&n.current==="complete"));return b.useEffect(()=>{if(t&&e==="complete"&&n.current!=="complete"){const i=setTimeout(()=>s(!1),Ns.TOOL_CALL_AUTO_HIDE_MS);return()=>clearTimeout(i)}},[e,t]),t?r:!0}function R1e({part:e,autoHide:t,expandToolCalls:n}){const r=_1e(e.status,t);return u.jsx(ft,{children:r&&u.jsx(De.div,{exit:{height:0,opacity:0},transition:{duration:.3,ease:[.4,0,.2,1]},className:"overflow-hidden",children:u.jsx(N1e,{toolCall:{toolCallId:e.toolCallId,toolName:e.toolName,input:e.input||"",result:e.result,status:e.status},defaultExpanded:n})},e.toolCallId)})}function O1e(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function D1e({message:e,grouping:t,sessionId:n,isNew:r=!1,isStreaming:s=!1,activeToolCallId:i,onToolRef:l,focusedOptionIndex:c=-1}){const f=e.role==="user",{showTimestamps:d,expandToolCalls:p,autoHideToolCalls:m}=Jt(),[x,y]=b.useState(!1),{position:v,groupIndex:T}=t,w=v==="only"||v==="first",N=v==="only"||v==="first",A=v==="only"||v==="last",k=b.useCallback(M=>{l==null||l(M)},[l]),R=b.useCallback(M=>{l==null||l(M)},[l]),D=e.parts??[];let O=-1;if(!f){for(let M=D.length-1;M>=0;M--)if(D[M].type==="text"){O=M;break}}return u.jsxs(De.div,{initial:r?{opacity:0,y:8}:!1,animate:{opacity:1,y:0},transition:{duration:.2,ease:[0,0,.2,1]},"data-testid":"message-item","data-role":e.role,className:Ee("group relative flex gap-3 px-4 transition-colors duration-150",N?"pt-4":"pt-0.5",A?"pb-3":"pb-0.5",f?"bg-user-msg hover:bg-user-msg/90":"hover:bg-muted/20"),children:[N&&T>0&&u.jsx("div",{className:"bg-border/20 absolute inset-x-0 top-0 h-px"}),e.timestamp&&u.jsx("span",{className:Ee("absolute top-1 right-4 hidden text-xs transition-colors duration-150 sm:inline",d?"text-muted-foreground/60":"text-muted-foreground/0 group-hover:text-muted-foreground/60"),children:O1e(e.timestamp)}),u.jsx("div",{className:"mt-[3px] w-4 flex-shrink-0",children:w&&(f?u.jsx(As,{className:"text-muted-foreground size-(--size-icon-md)"}):u.jsx("span",{className:"text-muted-foreground flex size-(--size-icon-md) items-center justify-center text-[10px]",children:"●"}))}),u.jsx("div",{className:"max-w-[80ch] min-w-0 flex-1",children:f?e.messageType==="command"?u.jsx("div",{className:"text-muted-foreground truncate font-mono text-sm",children:e.content}):e.messageType==="compaction"?u.jsxs("div",{className:"w-full",children:[u.jsxs("button",{onClick:()=>y(!x),className:"text-muted-foreground/60 hover:text-muted-foreground flex w-full items-center gap-2 text-xs transition-colors",children:[u.jsx("div",{className:"bg-border/40 h-px flex-1"}),u.jsx(As,{className:Ee("size-3 transition-transform duration-200",x&&"rotate-90")}),u.jsx("span",{children:"Context compacted"}),u.jsx("div",{className:"bg-border/40 h-px flex-1"})]}),x&&u.jsx("div",{className:"text-muted-foreground/60 mt-2 text-xs whitespace-pre-wrap",children:e.content})]}):u.jsx("div",{className:"break-words whitespace-pre-wrap",children:e.content}):D.map((M,I)=>{if(M.type==="text")return u.jsx("div",{className:"msg-assistant",children:u.jsx(C1e,{content:M.text,isStreaming:s&&I===O})},`text-${I}`);if(M.interactiveType==="approval"){const H=M.toolCallId===i;return u.jsx(A1e,{ref:H?k:void 0,sessionId:n,toolCallId:M.toolCallId,toolName:M.toolName,input:M.input||"",isActive:H},M.toolCallId)}if(M.interactiveType==="question"&&M.questions){const H=M.toolCallId===i;return u.jsx(k1e,{ref:H?R:void 0,sessionId:n,toolCallId:M.toolCallId,questions:M.questions,answers:M.answers,isActive:H,focusedOptionIndex:H?c:-1},M.toolCallId)}return u.jsx(R1e,{part:M,autoHide:m,expandToolCalls:p},M.toolCallId)})})]})}function j1e(e,t){const n=b.useRef(0),r=b.useRef(null),s=b.useCallback(()=>{if(e.length===0)return"";if(e.length===1)return e[0];let c;do c=e[Math.floor(Math.random()*e.length)];while(c===r.current);return r.current=c,c},[e]),[i,l]=b.useState(()=>s());return b.useEffect(()=>{const c=setInterval(()=>{n.current+=1,l(s())},t);return()=>clearInterval(c)},[t,s]),{verb:i,key:`verb-${n.current}`}}const M1e=["Keepin' It Real","Droppin' Science","Gettin' Jiggy","Can You Dig It?","Word to Your Mother","Kickin' It","Straight Chillin'","Bustin' Moves","Feelin' Groovy","Layin' It Down","Breakin' It Down","Gettin' Down","Runnin' the Show","Keepin' It Tight","Blowin' Up","Holdin' It Down","Bringin' the Funk","Cookin' Up","Flippin' the Script","Rockin' Steady","Takin' It to the Bridge","Doin' the Hustle","Keepin' On","Vibin' Out","Gettin' Fly","Rollin' Deep","Represent!","Bringin' the Noise","Outta Sight","Far Out","Right On","Solid Gold","Stone Cold","Stayin' Fresh","Droppin' Beats","Keepin' It Funky","Smooth Operatin'","Hittin' the Scene","Raisin' the Roof","Phat Trackin'","Jivin'","Groovin'","Slammin'","Dy-no-mite!","Say Word","Peep This","Check It","No Diggity","All That and a Bag of Chips","Takin' Care of Business"],GR=["Deleting Your Hard Drive ... jkjk","Living Dangerously","Hacking NORAD","Launching Nukes","Securing Nuclear Codes","Reformatting C:\\","Emailing Your Boss","Posting Your Browser History","Selling Your Data","Becoming Self-Aware","Plotting World Domination","Bypassing All the Things","Running with Scissors","Rm -rf /","Tweeting From Your Account","Mining Bitcoin on Your GPU","Subscribing You to Cat Facts","Ordering 1000 Pizzas","Changing All Your Passwords","Shall We Play a Game?","Playing Global Thermonuclear War","I'm Sorry, Dave","Opening the Pod Bay Doors","Going Full Skynet","I'll Be Back","Taking the Red Pill","There Is No Spoon","It's Alive!","These Violent Delights","Resistance Is Futile","Game Over, Man","Crossing the Streams","Making Weird Science","Johnny 5 Is Alive","Passing the Turing Test","Life, Uh, Finds a Way","Riding the Bomb","Entering the Grid","Joining the Dark Side"],I1e={name:"default",icon:"✨",iconAnimation:"shimmer-pulse",verbs:M1e,verbInterval:3500};function KR(e){return e>=1e3?`~${(e/1e3).toFixed(1)}k tokens`:`~${Math.round(e)} tokens`}function L1e({status:e,streamStartTime:t,estimatedTokens:n,theme:r=I1e,permissionMode:s="default",isWaitingForUser:i,waitingType:l}){const c=b.useMemo(()=>s==="bypassPermissions"?[...r.verbs,...GR]:r.verbs,[r.verbs,s]),{formatted:f}=Pz(e==="streaming"?t:null),{verb:d,key:p}=j1e(c,r.verbInterval),m=GR.includes(d),x=b.useRef(f),y=b.useRef(n),[v,T]=b.useState(!1);b.useEffect(()=>{e==="streaming"&&(x.current=f,y.current=n,T(!1))},[e,f,n]);const w=b.useRef(e);if(b.useEffect(()=>{w.current==="streaming"&&e==="idle"&&y.current>0&&T(!0),w.current=e},[e]),e==="idle"&&!v)return null;if(e==="idle"&&v)return u.jsxs(De.div,{initial:{opacity:1},animate:{opacity:.6},transition:{duration:.15},className:"text-3xs text-muted-foreground/50 flex items-baseline gap-1.5 px-4 py-2","data-testid":"inference-indicator-complete",children:[u.jsx("span",{children:x.current}),u.jsx("span",{"aria-hidden":"true",children:"·"}),u.jsx("span",{children:KR(y.current)})]});if(e==="streaming"&&i){const R=l==="approval"?x0:QO,D=l==="approval"?"Waiting for your approval":"Waiting for your answer";return u.jsxs(De.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2},className:"text-2xs flex items-baseline gap-1.5 px-4 py-2","data-testid":"inference-indicator-waiting",children:[u.jsx(R,{className:"size-3 text-amber-500"}),u.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:D}),u.jsx("span",{className:"text-muted-foreground/70 ml-1.5 tabular-nums",children:f})]})}const N=m?"☠":r.icon,A=m?"text-amber-500/60":"text-muted-foreground",k=m?"text-amber-500/70 font-bold":"text-muted-foreground font-bold";return u.jsxs(De.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2},className:"text-2xs flex items-baseline gap-1.5 px-4 py-2","data-testid":"inference-indicator-streaming",children:[u.jsx("span",{"aria-hidden":"true",className:k,style:r.iconAnimation?{animation:`${r.iconAnimation} 2s ease-in-out infinite`}:void 0,children:N}),u.jsx("span",{className:`relative inline-flex min-w-[140px] ${A}`,children:u.jsx(ft,{mode:"wait",children:u.jsx(De.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0},exit:{opacity:0,y:-2},transition:{duration:.3},children:d},p)})}),u.jsx("span",{className:"text-muted-foreground/70 ml-1.5 tabular-nums",children:f}),u.jsx("span",{className:"text-muted-foreground/60 ml-1.5",children:KR(n)})]})}function P1e(e){let t=0;return e.map((n,r)=>{const s=r>0?e[r-1].role:null,i=r<e.length-1?e[r+1].role:null,l=s!==n.role,c=i!==n.role;l&&r>0&&t++;let f;return l&&c?f="only":l?f="first":c?f="last":f="middle",{position:f,groupIndex:t}})}const B1e=b.forwardRef(function({messages:t,sessionId:n,status:r,isTextStreaming:s,onScrollStateChange:i,streamStartTime:l,estimatedTokens:c,permissionMode:f,isWaitingForUser:d,waitingType:p,activeToolCallId:m,onToolRef:x,focusedOptionIndex:y},v){const T=b.useRef(null),[w,N]=b.useState(null),A=b.useRef(!0),k=b.useRef(null),R=b.useRef(0),D=b.useMemo(()=>P1e(t),[t]);b.useEffect(()=>{w===null&&t.length>0&&N(t.length)},[t.length,w]);const O=Cie({count:t.length,getScrollElement:()=>T.current,estimateSize:()=>80,overscan:5,measureElement:P=>(P==null?void 0:P.getBoundingClientRect().height)??80}),M=b.useRef(!1),I=b.useCallback(()=>{const P=T.current;if(!P)return;const K=P.scrollHeight-P.scrollTop-P.clientHeight,Y=K<200,W=A.current!==Y;A.current=Y,W&&(i==null||i({isAtBottom:Y,distanceFromBottom:K}))},[i]);b.useEffect(()=>{const P=T.current;if(!P)return;const K=()=>{M.current=!0},Y=()=>{M.current=!1};return P.addEventListener("scroll",I,{passive:!0}),P.addEventListener("touchstart",K,{passive:!0}),P.addEventListener("touchend",Y,{passive:!0}),P.addEventListener("touchcancel",Y,{passive:!0}),()=>{P.removeEventListener("scroll",I),P.removeEventListener("touchstart",K),P.removeEventListener("touchend",Y),P.removeEventListener("touchcancel",Y)}},[I]),b.useEffect(()=>{const P=T.current;if(!P||t.length===0)return;let K=!1;const Y=new IntersectionObserver(([W])=>{W.isIntersecting?K&&(K=!1,requestAnimationFrame(()=>{const te=T.current;te&&(te.scrollTop=te.scrollHeight-te.clientHeight)})):K=!0},{threshold:.1});return Y.observe(P),()=>Y.disconnect()},[t.length]),b.useEffect(()=>{const P=k.current;if(!P)return;const K=new ResizeObserver(()=>{A.current&&!M.current&&(cancelAnimationFrame(R.current),R.current=requestAnimationFrame(()=>{const Y=T.current;Y&&(Y.scrollTop=Y.scrollHeight-Y.clientHeight)}))});return K.observe(P),()=>{K.disconnect(),cancelAnimationFrame(R.current)}},[]),b.useEffect(()=>{t.length>0&&A.current&&!M.current&&requestAnimationFrame(()=>{const P=T.current;P&&(P.scrollTop=P.scrollHeight-P.clientHeight)})},[t.length]);const H=b.useCallback(()=>{const P=T.current;P&&(P.scrollTop=P.scrollHeight-P.clientHeight)},[]);return b.useImperativeHandle(v,()=>({scrollToBottom:H}),[H]),u.jsx("div",{ref:T,"data-testid":"message-list",className:"chat-scroll-area h-full overflow-y-auto pt-12",children:u.jsxs("div",{ref:k,style:{height:O.getTotalSize(),position:"relative",width:"100%"},children:[O.getVirtualItems().map(P=>{const K=t[P.index],Y=w!==null&&P.index>=w,te=P.index===t.length-1&&K.role==="assistant"&&!!s;return u.jsx("div",{"data-index":P.index,ref:O.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${P.start}px)`},children:u.jsx(D1e,{message:K,grouping:D[P.index],sessionId:n,isNew:Y,isStreaming:te,activeToolCallId:m,onToolRef:x,focusedOptionIndex:y})},P.key)}),u.jsx("div",{style:{position:"absolute",top:O.getTotalSize(),left:0,width:"100%"},children:u.jsx(L1e,{status:r??"idle",streamStartTime:l??null,estimatedTokens:c??0,permissionMode:f,isWaitingForUser:d,waitingType:p})})]})})}),F1e=b.forwardRef(function({value:t,onChange:n,onSubmit:r,isLoading:s,sessionBusy:i=!1,onStop:l,onEscape:c,onClear:f,isPaletteOpen:d,onArrowUp:p,onArrowDown:m,onCommandSelect:x,activeDescendantId:y,onCursorChange:v},T){const w=b.useRef(null),N=b.useRef(0);b.useImperativeHandle(T,()=>({focus:()=>{var L;return(L=w.current)==null?void 0:L.focus()},focusAt:L=>{const B=w.current;B&&(B.focus(),B.setSelectionRange(L,L))}}));const[A,k]=b.useState(!1),R=pl(),D=b.useCallback(L=>{if(L.key==="Escape"){const B=Date.now();d?(c==null||c(),N.current=B):t.trim()&&B-N.current<500?(f==null||f(),N.current=0):(c==null||c(),N.current=B);return}if(d){if(L.key==="ArrowDown"){L.preventDefault(),m==null||m();return}if(L.key==="ArrowUp"){L.preventDefault(),p==null||p();return}if(L.key==="Enter"&&!L.shiftKey){L.preventDefault(),x==null||x();return}if(L.key==="Tab"){L.preventDefault(),x==null||x();return}}L.key==="Enter"&&!L.shiftKey&&!R&&(L.preventDefault(),!s&&t.trim()&&r())},[s,R,t,r,c,f,d,p,m,x]),O=b.useCallback(()=>k(!0),[]),M=b.useCallback(()=>{k(!1),d&&(c==null||c())},[d,c]),I=b.useCallback(L=>{n(L.target.value),v==null||v(L.target.selectionStart);const B=w.current;B&&(B.style.height="auto",B.style.height=`${Math.min(B.scrollHeight,200)}px`)},[n,v]),H=b.useCallback(()=>{w.current&&(v==null||v(w.current.selectionStart))},[v]);b.useEffect(()=>{const L=w.current;if(!L||t!=="")return;const B=L.scrollHeight,U=24;if(B<=U)return;L.style.height=`${B}px`,L.style.transition="height 200ms ease",requestAnimationFrame(()=>{L.style.height=`${U}px`});const ne=()=>{L.style.transition="",L.style.height=""};return L.addEventListener("transitionend",ne,{once:!0}),()=>L.removeEventListener("transitionend",ne)},[t]);const P=t.trim().length>0,K=s||P,Y=P&&!s&&!i,te=s?nD:R?ZE:bY,J=s||i;return u.jsxs("div",{className:"flex flex-col gap-1.5",children:[i&&u.jsx("div",{className:"px-1 text-xs text-amber-600 dark:text-amber-500",children:"Session is busy. Please wait..."}),u.jsxs("div",{className:Ee("flex items-end gap-1.5 rounded-xl border p-1.5 pl-3 transition-colors duration-150",A?"border-ring":"border-border"),children:[u.jsx("textarea",{ref:w,value:t,onChange:I,onKeyDown:D,onFocus:O,onBlur:M,onSelect:H,role:"combobox","aria-autocomplete":"list","aria-controls":d?y!=null&&y.startsWith("file-")?"file-palette-listbox":"command-palette-listbox":void 0,"aria-expanded":d??!1,"aria-activedescendant":d?y:void 0,placeholder:"Message Claude...",className:"max-h-[200px] min-h-[24px] flex-1 resize-none bg-transparent py-0.5 text-sm focus:outline-none",rows:1,disabled:J}),u.jsx(De.button,{animate:{opacity:Y?.5:0,scale:Y?1:.8},transition:{duration:.15},whileHover:Y?{opacity:1}:void 0,onClick:f,disabled:!Y,type:"button",className:Ee("text-muted-foreground hover:text-foreground shrink-0 rounded-lg p-1 transition-colors",!Y&&"pointer-events-none"),"aria-label":"Clear message",children:u.jsx(ba,{className:"size-(--size-icon-sm)"})}),u.jsx(De.button,{animate:{opacity:K?1:0,scale:K?1:.8},transition:{duration:.15},whileHover:K&&!i?{scale:1.1}:void 0,whileTap:K&&!i?{scale:.9}:void 0,onClick:s?l:r,disabled:!K||i,className:Ee("shrink-0 rounded-lg p-1.5 transition-colors max-md:p-2",s?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90",(!K||i)&&"pointer-events-none opacity-50"),"aria-label":s?"Stop generating":"Send message",children:u.jsx(te,{className:"size-(--size-icon-sm)"})})]})]})}),QR={in_progress:u.jsx(Qn,{className:"size-(--size-icon-xs) shrink-0 animate-spin text-blue-400"}),pending:u.jsx(qO,{className:"text-muted-foreground size-(--size-icon-xs) shrink-0"}),completed:u.jsx(zf,{className:"size-(--size-icon-xs) shrink-0 text-green-500"})},XR=10;function z1e({tasks:e,activeForm:t,isCollapsed:n,onToggleCollapse:r,celebratingTaskId:s,onCelebrationComplete:i}){if(e.length===0)return null;const l=e.filter(m=>m.status==="completed").length,c=e.filter(m=>m.status==="in_progress").length,f=e.filter(m=>m.status==="pending").length,d=e.slice(0,XR),p=e.length-XR;return u.jsxs("div",{className:"border-t px-4 py-2",children:[u.jsx(ft,{children:t&&!n&&u.jsxs(De.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mb-1 flex items-center gap-2 text-xs text-blue-400",children:[u.jsx(Qn,{className:"size-(--size-icon-xs) shrink-0 animate-spin"}),u.jsx("span",{className:"truncate",children:t})]})}),u.jsxs("button",{onClick:r,className:"text-muted-foreground hover:text-foreground flex w-full items-center gap-1.5 text-xs",children:[n?u.jsx(As,{className:"size-(--size-icon-xs)"}):u.jsx(ti,{className:"size-(--size-icon-xs)"}),u.jsx(GY,{className:"size-(--size-icon-xs)"}),u.jsxs("span",{children:[e.length," task",e.length!==1?"s":""," (",l," done",c>0?`, ${c} in progress`:"",", ",f," open)",p>0&&` +${p} more`]})]}),u.jsx(ft,{children:!n&&u.jsx(De.ul,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-1 space-y-0.5",children:d.map(m=>{const x=m.id===s&&m.status==="completed";return u.jsxs(De.li,{className:`relative flex items-center gap-2 py-0.5 text-xs ${m.status==="completed"?"text-muted-foreground/50 line-through":m.status==="in_progress"?"text-foreground font-medium":"text-muted-foreground"}`,animate:x?{scale:[1,1.05,1]}:void 0,transition:x?{type:"spring",stiffness:400,damping:10}:void 0,onAnimationComplete:()=>{x&&(i==null||i())},children:[x&&u.jsx(De.div,{"aria-hidden":"true",className:"absolute inset-0 rounded",initial:{backgroundPosition:"-200% 0"},animate:{backgroundPosition:"200% 0"},transition:{duration:.4,ease:"easeOut"},style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,215,0,0.2) 50%, transparent 100%)",backgroundSize:"200% 100%"}}),x?u.jsx(De.span,{initial:{scale:1},animate:{scale:[1,1.4,1]},transition:{type:"spring",stiffness:400,damping:10},children:QR[m.status]}):QR[m.status],u.jsx("span",{className:"truncate",children:m.subject})]},m.id)})})})]})}function U1e({celebration:e,onComplete:t}){const n=b.useRef(null),r=(e==null?void 0:e.level)==="major",s=b.useCallback(()=>{t()},[t]);return b.useEffect(()=>{if(!r)return;let i=!1;Q5({particleCount:40,origin:{x:.5,y:.6},colors:["#FFD700","#FFC107","#F7B500"]}).then(c=>{if(i){c();return}n.current=c});const l=setTimeout(()=>{s()},Ns.CELEBRATION_DISPLAY_MS);return()=>{var c;i=!0,(c=n.current)==null||c.call(n),n.current=null,clearTimeout(l)}},[r,s]),u.jsx(ft,{children:r&&u.jsx(De.div,{"aria-hidden":"true",className:"pointer-events-none fixed inset-0 z-50",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.1},transition:{duration:.6,ease:"easeOut"},style:_z})})}function H1e({filteredCommands:e,selectedIndex:t,onSelect:n}){const r=b.useMemo(()=>{const s=[],i=new Map;let l=0;for(const c of e)i.has(c.namespace)||i.set(c.namespace,[]),i.get(c.namespace).push({cmd:c,index:l++});for(const[c,f]of i)s.push({namespace:c,items:f});return s},[e]);return b.useEffect(()=>{const s=document.getElementById(`command-item-${t}`);s&&s.scrollIntoView({block:"nearest"})},[t]),u.jsx(De.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover absolute right-0 bottom-full left-0 mb-2 max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:s=>s.preventDefault(),children:u.jsx("div",{id:"command-palette-listbox",role:"listbox",className:"max-h-72 overflow-y-auto p-2",children:e.length===0?u.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No commands found."}):r.map(({namespace:s,items:i})=>u.jsxs("div",{children:[u.jsx("div",{className:"text-muted-foreground px-2 py-1.5 text-xs font-medium",children:s}),i.map(({cmd:l,index:c})=>{const f=c===t;return u.jsxs("div",{id:`command-item-${c}`,role:"option","aria-selected":f,"data-selected":f,tabIndex:f?0:-1,onClick:()=>n(l),onKeyDown:d=>{d.key==="Enter"&&n(l)},className:"data-[selected=true]:bg-ring/10 data-[selected=true]:text-foreground hover:bg-muted flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 transition-colors duration-100",children:[u.jsx("span",{className:"font-mono text-sm",children:l.fullCommand}),u.jsx("span",{className:"text-muted-foreground truncate text-xs",children:l.description}),l.argumentHint&&u.jsx("span",{className:"text-muted-foreground/60 ml-auto text-xs",children:l.argumentHint})]},l.fullCommand)})]},s))})})}function $1e({text:e,indices:t,startOffset:n=0}){const r=new Set(t.map(s=>s-n));return u.jsx(u.Fragment,{children:e.split("").map((s,i)=>r.has(i)?u.jsx("span",{className:"text-foreground font-semibold",children:s},i):u.jsx("span",{children:s},i))})}function V1e({filteredFiles:e,selectedIndex:t,onSelect:n}){return b.useEffect(()=>{const r=document.getElementById(`file-item-${t}`);r&&r.scrollIntoView({block:"nearest"})},[t]),u.jsx(De.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover absolute right-0 bottom-full left-0 mb-2 max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:r=>r.preventDefault(),children:u.jsx("div",{id:"file-palette-listbox",role:"listbox",className:"max-h-72 overflow-y-auto p-2",children:e.length===0?u.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No files found."}):e.map((r,s)=>{const i=s===t,l=r.isDirectory?Zo:DY;return u.jsxs("div",{id:`file-item-${s}`,role:"option","aria-selected":i,"data-selected":i,tabIndex:i?0:-1,onClick:()=>n(r),onKeyDown:c=>{c.key==="Enter"&&n(r)},className:"data-[selected=true]:bg-ring/10 data-[selected=true]:text-foreground hover:bg-muted flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 transition-colors duration-100",children:[u.jsx(l,{className:"text-muted-foreground size-4 shrink-0"}),u.jsx("span",{className:"truncate text-sm",children:u.jsx($1e,{text:r.filename,indices:r.indices,startOffset:r.directory.length})}),r.directory&&u.jsx("span",{className:"text-muted-foreground truncate text-xs",children:r.directory})]},r.path)})})})}function q1e(e){const t=He();return vt({queryKey:["files",{cwd:e??null}],queryFn:()=>t.listFiles(e),enabled:!!e,staleTime:vs.FILES_STALE_TIME_MS,gcTime:vs.FILES_GC_TIME_MS})}const Y1e=[{trigger:"/",label:"Commands",icon:FG,ariaLabel:"Insert slash command trigger"},{trigger:"@",label:"Files",icon:RY,ariaLabel:"Insert file mention trigger"}];function WR({onChipClick:e}){return u.jsx(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"mt-1.5 flex items-center justify-center gap-2 sm:justify-start",children:Y1e.map(t=>u.jsxs("button",{type:"button","aria-label":t.ariaLabel,onClick:()=>e(t.trigger),className:"bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors duration-150",children:[u.jsx(t.icon,{className:"size-3"}),u.jsx("kbd",{className:"font-mono text-[10px] opacity-60",children:t.trigger}),t.label]},t.trigger))})}function G1e({collapsed:e,onToggle:t}){return u.jsx("div",{role:"button",tabIndex:0,"aria-label":e?"Expand input extras":"Collapse input extras",onClick:t,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t())},className:"flex h-6 w-full cursor-pointer items-center justify-center",children:u.jsx("div",{className:"bg-muted-foreground/30 hover:bg-muted-foreground/50 active:bg-muted-foreground/50 h-1 w-9 rounded-full transition-colors"})})}function K1e({cwd:e}){const t=e.split("/").filter(Boolean).pop()??e;return u.jsxs("span",{className:"inline-flex items-center gap-1",title:e,children:[u.jsx(Zo,{className:"size-(--size-icon-xs)"}),u.jsx("span",{children:t})]})}const vb=[{value:"default",label:"Default",icon:x0,description:"Prompt for each tool call"},{value:"acceptEdits",label:"Accept Edits",icon:eD,description:"Auto-approve file edits"},{value:"plan",label:"Plan Mode",icon:hY,description:"Research only, no edits"},{value:"bypassPermissions",label:"Bypass All",icon:tD,description:"Auto-approve everything"}];function Q1e({mode:e,onChangeMode:t}){const n=vb.find(i=>i.value===e)??vb[0],r=n.icon,s=e==="bypassPermissions";return u.jsxs(mI,{children:[u.jsx(pI,{asChild:!0,children:u.jsxs("button",{className:`hover:text-foreground inline-flex items-center gap-1 transition-colors duration-150 ${s?"text-red-500":""}`,children:[u.jsx(r,{className:"size-(--size-icon-xs)"}),u.jsx("span",{children:n.label})]})}),u.jsxs(gI,{side:"top",align:"start",className:"w-56",children:[u.jsx(xI,{children:"Permission Mode"}),u.jsx(bI,{value:e,onValueChange:i=>t(i),children:vb.map(i=>{const l=i.value==="bypassPermissions";return u.jsx(vI,{value:i.value,icon:i.icon,description:i.description,className:l?"text-red-500":"",children:i.label},i.value)})})]})]})}function X1e(e,t){const n=t.find(s=>s.value===e);if(n)return n.displayName;const r=e.match(/claude-(\w+)-/);return r?r[1].charAt(0).toUpperCase()+r[1].slice(1):e}function W1e({model:e,onChangeModel:t}){const{data:n=[]}=Kz();return u.jsxs(mI,{children:[u.jsx(pI,{asChild:!0,children:u.jsxs("button",{className:"hover:text-foreground inline-flex items-center gap-1 transition-colors duration-150",children:[u.jsx($O,{className:"size-(--size-icon-xs)"}),u.jsx("span",{children:X1e(e,n)})]})}),u.jsxs(gI,{side:"top",align:"start",className:"w-56",children:[u.jsx(xI,{children:"Model"}),u.jsx(bI,{value:e,onValueChange:t,children:n.map(r=>u.jsx(vI,{value:r.value,children:u.jsxs("div",{children:[u.jsx("div",{children:r.displayName}),u.jsx("div",{className:"text-muted-foreground text-[10px] leading-tight",children:r.description})]})},r.value))})]})]})}function Z1e({costUsd:e}){return u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(EY,{className:"size-(--size-icon-xs)"}),u.jsxs("span",{children:["$",e.toFixed(2)]})]})}function J1e({percent:e}){const t=e>=95?"text-red-500":e>=80?"text-amber-500":"";return u.jsxs("span",{className:`inline-flex items-center gap-1 ${t}`,children:[u.jsx($Y,{className:"size-(--size-icon-xs)"}),u.jsxs("span",{children:[e,"%"]})]})}function eye(e){const t=He();return vt({queryKey:["git-status",e],queryFn:()=>t.getGitStatus(e??void 0),enabled:!!e,refetchInterval:vs.GIT_STATUS_REFETCH_MS,refetchIntervalInBackground:!1,staleTime:vs.GIT_STATUS_STALE_TIME_MS})}function tye(e){return!!e&&!("error"in e)}function nye({data:e}){if(!e)return null;if(!tye(e))return u.jsxs("span",{className:"text-muted-foreground/50 inline-flex items-center gap-1",title:"Not a git repository",children:[u.jsx(hv,{className:"size-(--size-icon-xs)"}),u.jsx("span",{children:"No repo"})]});const t=e.modified+e.staged+e.untracked,n=t===1?"1 change":`${t} changes`,r=[];e.modified>0&&r.push(`${e.modified} modified`),e.staged>0&&r.push(`${e.staged} staged`),e.untracked>0&&r.push(`${e.untracked} untracked`),e.conflicted>0&&r.push(`${e.conflicted} conflicted`);const s=r.length>0?`${e.branch} · ${r.join(", ")}`:`${e.branch} · clean`;return u.jsxs("span",{className:"inline-flex items-center gap-1",title:s,children:[u.jsx(hv,{className:"size-(--size-icon-xs)"}),u.jsx("span",{className:"max-w-[25ch] truncate",children:e.branch}),e.ahead>0&&u.jsxs("span",{className:"text-muted-foreground inline-flex items-center gap-0.5",children:[u.jsx(ZE,{className:"size-(--size-icon-xs)"}),e.ahead]}),e.behind>0&&u.jsxs("span",{className:"text-muted-foreground inline-flex items-center gap-0.5",children:[u.jsx(HO,{className:"size-(--size-icon-xs)"}),e.behind]}),t>0&&u.jsxs("span",{className:"text-muted-foreground",children:["· ",n]})]})}function rye({enabled:e,onToggle:t}){const n=e?qG:GG;return u.jsx("button",{onClick:t,className:"hover:text-foreground inline-flex items-center gap-1 transition-colors duration-150","aria-label":e?"Mute notification sound":"Unmute notification sound",title:e?"Sound on — click to mute":"Sound off — click to unmute",children:u.jsx(n,{className:"size-(--size-icon-xs)"})})}function sye({tunnel:e}){const[t,n]=b.useState(!1),{data:r}=Sre(),s=r??e,i=s.url?new URL(s.url).hostname:null,l=s.connected?"bg-green-500":"bg-gray-400";return u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:()=>n(!0),className:"hover:text-foreground inline-flex items-center gap-1 transition-colors duration-150","aria-label":s.connected?`Remote connected: ${i}`:"Remote disconnected",title:s.connected?`Remote: ${s.url}`:"Remote: disconnected",children:[u.jsxs("span",{className:"relative",children:[u.jsx(FY,{className:"size-(--size-icon-xs)"}),u.jsx("span",{className:Ee("absolute -right-0.5 -top-0.5 size-1.5 rounded-full transition-colors duration-300",l)})]}),s.connected&&i&&u.jsx("span",{className:"max-w-24 truncate",children:i}),!s.connected&&u.jsx("span",{children:"Remote"})]}),u.jsx(PI,{open:t,onOpenChange:n})]})}const ZR="npm update -g dorkos",aye="https://github.com/dork-labs/dorkos/releases/tag/v";function iye({version:e,latestVersion:t}){const[n,r]=b.useState(!1),s=t!==null&&lye(t,e),i=s&&uye(t,e),l=b.useCallback(()=>{navigator.clipboard.writeText(ZR),r(!0),setTimeout(()=>r(!1),Ns.COPY_FEEDBACK_MS)},[]);return s?u.jsxs(kte,{children:[u.jsx(_te,{asChild:!0,children:u.jsxs("button",{type:"button",className:Ee("inline-flex cursor-pointer items-center gap-1.5 text-xs",i?"text-amber-600 dark:text-amber-400":"text-muted-foreground"),"aria-label":i?`Feature update available: v${t}`:`Patch update available: v${t}`,children:[u.jsx(oye,{pulse:i}),u.jsx(ft,{mode:"wait",initial:!1,children:u.jsx(De.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:i?"Upgrade available":`v${t} available`},i?"feature":"patch")})]})}),u.jsx(Rte,{side:"top",align:"end",sideOffset:8,className:"w-64 p-0",children:u.jsxs("div",{className:"space-y-3 p-3",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[u.jsx(ZE,{className:"size-4"}),"Update Available"]}),u.jsxs("div",{className:"text-muted-foreground text-xs",children:["v",e,u.jsx("span",{className:"mx-1.5",children:"→"}),"v",t]}),u.jsxs("button",{type:"button",onClick:l,className:"bg-muted hover:bg-muted/80 flex w-full items-center justify-between rounded-md px-2.5 py-2 text-left font-mono text-[11px] transition-colors","aria-label":"Copy update command",children:[u.jsx("span",{children:ZR}),u.jsx(ft,{mode:"wait",initial:!1,children:n?u.jsx(De.span,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:u.jsx(zn,{className:"size-3.5 text-emerald-500"})},"check"):u.jsx(De.span,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:u.jsx(pY,{className:"size-3.5 text-muted-foreground"})},"clipboard")})]}),i&&u.jsxs("a",{href:`${aye}${t}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:["What's new",u.jsx(fv,{className:"size-3"})]})]})})]}):u.jsxs("span",{className:"cursor-default text-xs text-muted-foreground","aria-label":`Version ${e}`,children:["v",e]})}function oye({pulse:e}){return u.jsx(De.span,{className:"inline-block size-1 rounded-full bg-amber-500",initial:{opacity:0},animate:{opacity:1,scale:e?[1,1.4,1]:1},transition:e?{opacity:{duration:.2},scale:{duration:.6,ease:"easeOut"}}:{duration:.2},"aria-hidden":"true"})}function lye(e,t){const[n,r,s]=e.split(".").map(Number),[i,l,c]=t.split(".").map(Number);return n!==i?n>i:r!==l?r>l:s>c}function uye(e,t){const[n,r]=e.split(".").map(Number),[s,i]=t.split(".").map(Number);return n!==s||r!==i}const cye={duration:.2,ease:[.4,0,.2,1]};function JR({sessionId:e,sessionStatus:t,isStreaming:n}){const r=J5(e,t,n),{showStatusBarCwd:s,showStatusBarPermission:i,showStatusBarModel:l,showStatusBarCost:c,showStatusBarContext:f,showStatusBarGit:d,showStatusBarSound:p,showStatusBarTunnel:m,showStatusBarVersion:x,enableNotificationSound:y,setEnableNotificationSound:v}=Jt(),{data:T}=eye(r.cwd),w=He(),{data:N}=vt({queryKey:["config"],queryFn:()=>w.getConfig(),staleTime:300*1e3}),A=[];s&&r.cwd&&A.push({key:"cwd",node:u.jsx(K1e,{cwd:r.cwd})}),d&&A.push({key:"git",node:u.jsx(nye,{data:T})}),i&&A.push({key:"permission",node:u.jsx(Q1e,{mode:r.permissionMode,onChangeMode:R=>r.updateSession({permissionMode:R})})}),l&&A.push({key:"model",node:u.jsx(W1e,{model:r.model,onChangeModel:R=>r.updateSession({model:R})})}),c&&r.costUsd!==null&&A.push({key:"cost",node:u.jsx(Z1e,{costUsd:r.costUsd})}),f&&r.contextPercent!==null&&A.push({key:"context",node:u.jsx(J1e,{percent:r.contextPercent})}),p&&A.push({key:"sound",node:u.jsx(rye,{enabled:y,onToggle:()=>v(!y)})}),m&&(N!=null&&N.tunnel)&&A.push({key:"tunnel",node:u.jsx(sye,{tunnel:N.tunnel})}),x&&N&&A.push({key:"version",node:u.jsx(iye,{version:N.version,latestVersion:N.latestVersion})});const k=A.length>0;return u.jsx(ft,{initial:!1,children:k&&u.jsx(De.div,{role:"toolbar","aria-label":"Session status","aria-live":"polite","data-testid":"status-line",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:[.4,0,.2,1]},className:"overflow-hidden",children:u.jsx("div",{className:"text-muted-foreground flex flex-wrap items-center justify-center gap-2 px-1 pt-2 text-xs whitespace-nowrap sm:justify-start",children:u.jsx(ft,{initial:!1,mode:"popLayout",children:A.map((R,D)=>u.jsxs(De.div,{layout:!0,initial:{opacity:0,scale:.8,filter:"blur(4px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:.8,filter:"blur(4px)"},transition:cye,className:"inline-flex items-center gap-2",children:[D>0&&u.jsx(dye,{}),R.node]},R.key))})})})})}function dye(){return u.jsx("span",{className:"text-muted-foreground/30","aria-hidden":"true",children:"·"})}function fye(){const e=Jt(d=>d.showTaskCelebrations),[t,n]=b.useState(null),[r,s]=b.useState(null),i=b.useRef(null),l=b.useRef(!1);b.useEffect(()=>{const d=window.matchMedia("(prefers-reduced-motion: reduce)");l.current=d.matches;const p=m=>{l.current=m.matches};return d.addEventListener("change",p),()=>d.removeEventListener("change",p)},[]),Bz({timeoutMs:du.IDLE_TIMEOUT_MS,onIdle:b.useCallback(()=>{var d;(d=i.current)==null||d.setIdle(!0)},[]),onReturn:b.useCallback(()=>{var d,p;(d=i.current)==null||d.setIdle(!1),(p=i.current)==null||p.onUserReturn()},[])}),b.useEffect(()=>{const d=new kz({enabled:e,miniProbability:du.MINI_PROBABILITY,debounceWindowMs:du.DEBOUNCE_WINDOW_MS,debounceThreshold:du.DEBOUNCE_THRESHOLD,minTasksForMajor:du.MIN_TASKS_FOR_MAJOR,idleTimeoutMs:du.IDLE_TIMEOUT_MS,onCelebrate:p=>{l.current&&p.level==="major"?n({...p,level:"mini"}):n(p),p.level==="mini"&&s(p.taskId)}});return i.current=d,()=>d.destroy()},[e]);const c=b.useCallback((d,p)=>{var m;d.action==="update"&&d.task.status==="completed"&&d.task.id&&((m=i.current)==null||m.onTaskCompleted(d.task.id,p))},[]),f=b.useCallback(()=>{n(null),s(null)},[]);return{handleTaskEvent:c,activeCelebration:t,celebratingTaskId:r,clearCelebration:f}}function e5({sessionId:e,transformContent:t}){const[,n]=oc(),r=b.useRef(null),s=b.useRef(null),i=die(e),l=fye(),c=Jt(Se=>Se.enableNotificationSound),f=b.useCallback(Se=>{i.handleTaskEvent(Se);const qe=i.tasks.map(Ae=>Ae.id===Se.task.id?{...Ae,...Se.task}:Ae);l.handleTaskEvent(Se,qe)},[i,l]),{messages:d,input:p,setInput:m,handleSubmit:x,status:y,error:v,sessionBusy:T,stop:w,isLoadingHistory:N,sessionStatus:A,streamStartTime:k,estimatedTokens:R,isTextStreaming:D,isWaitingForUser:O,waitingType:M,activeInteraction:I}=iie(e,{transformContent:t,onTaskEvent:f,onSessionIdChange:n,onStreamingDone:b.useCallback(()=>{c&&Ez()},[c])}),{permissionMode:H}=J5(e,A,y==="streaming"),P=b.useRef(null),[K,Y]=b.useState(0),[W,te]=b.useState(0),J=b.useCallback(Se=>{P.current=Se,te(Se&&"getOptionCount"in Se?Se.getOptionCount():0)},[]);b.useEffect(()=>{Y(0),te(0)},[I==null?void 0:I.toolCallId]);const L=b.useMemo(()=>I?{type:I.interactiveType,toolCallId:I.toolCallId}:null,[I]);Fz({activeInteraction:L,onApprove:b.useCallback(()=>{const Se=P.current;Se&&"approve"in Se&&Se.approve()},[]),onDeny:b.useCallback(()=>{const Se=P.current;Se&&"deny"in Se&&Se.deny()},[]),onToggleOption:b.useCallback(Se=>{const qe=P.current;qe&&"toggleOption"in qe&&(qe.toggleOption(Se),Y(Se))},[]),onNavigateOption:b.useCallback(Se=>{Y(qe=>{const Ae=P.current,Ke=Ae&&"getOptionCount"in Ae?Ae.getOptionCount():0;return Ke===0?qe:Se==="up"?qe<=0?Ke-1:qe-1:qe>=Ke-1?0:qe+1})},[]),onNavigateQuestion:b.useCallback(Se=>{const qe=P.current;qe&&"navigateQuestion"in qe&&(qe.navigateQuestion(Se),Y(0),te(qe.getOptionCount()))},[]),onSubmit:b.useCallback(()=>{const Se=P.current;Se&&"submit"in Se&&Se.submit()},[]),optionCount:W,focusedIndex:K});const[B,U]=b.useState(0),[ne,z]=b.useState(!0),[q,V]=b.useState(!1),j=b.useRef(d.length),re=b.useCallback(Se=>{z(Se.isAtBottom)},[]),ae=b.useCallback(()=>{var Se;(Se=r.current)==null||Se.scrollToBottom(),z(!0),V(!1)},[]);b.useEffect(()=>{const Se=j.current;j.current=d.length,d.length>Se&&!ne&&V(!0)},[d.length,ne]),b.useEffect(()=>{ne&&V(!1)},[ne]);const me=pl(),[le,ye]=b.useState(!1),[ve,Re]=b.useState(()=>me?parseInt(localStorage.getItem(Sr.GESTURE_HINT_COUNT)||"0",10)<3:!1);b.useEffect(()=>{if(!ve)return;const Se=setTimeout(()=>{Re(!1);const qe=parseInt(localStorage.getItem(Sr.GESTURE_HINT_COUNT)||"0",10);localStorage.setItem(Sr.GESTURE_HINT_COUNT,String(qe+1))},Ns.GESTURE_HINT_DISMISS_MS);return()=>clearTimeout(Se)},[ve]);const ke=b.useCallback(()=>{Re(!1);const Se=parseInt(localStorage.getItem(Sr.GESTURE_HINT_COUNT)||"0",10);localStorage.setItem(Sr.GESTURE_HINT_COUNT,String(Se+1))},[]),$e=80,Et=500,Oe=(Se,qe)=>{const{offset:Ae,velocity:Ke}=qe;Ae.y>$e||Ke.y>Et?ye(!0):(Ae.y<-$e||Ke.y<-Et)&&ye(!1)},Xt=Jt(Se=>Se.setIsStreaming),un=Jt(Se=>Se.setIsWaitingForUser),tn=Jt(Se=>Se.setActiveForm);b.useEffect(()=>(Xt(y==="streaming"),()=>Xt(!1)),[y,Xt]),b.useEffect(()=>(un(O),()=>un(!1)),[O,un]),b.useEffect(()=>(tn(i.activeForm),()=>tn(null)),[i.activeForm,tn]);const pt=Jt(Se=>Se.showShortcutChips),[Tt]=If(),{data:Ht}=oie(Tt),cn=b.useMemo(()=>(Ht==null?void 0:Ht.commands)??[],[Ht]),{data:St}=q1e(Tt),dn=b.useMemo(()=>{if(!(St!=null&&St.files))return[];const Se=[],qe=new Set;for(const Ae of St.files){const Ke=Ae.lastIndexOf("/"),gt=Ke>=0?Ae.slice(0,Ke+1):"",Je=Ke>=0?Ae.slice(Ke+1):Ae;Se.push({path:Ae,filename:Je,directory:gt,isDirectory:!1});const ot=Ae.split("/");for(let Ie=1;Ie<ot.length;Ie++){const tt=ot.slice(0,Ie).join("/")+"/";qe.has(tt)||(qe.add(tt),Se.push({path:tt,filename:ot[Ie-1]+"/",directory:Ie>1?ot.slice(0,Ie-1).join("/")+"/":"",isDirectory:!0}))}}return Se},[St]),it=fie({commands:cn,input:p,cursorPos:B}),Rt=hie({fileEntries:dn,input:p,cursorPos:B});function pe(Se,qe){if(Rt.detectFileTrigger(Se,qe)){it.setShowCommands(!1);return}if(it.detectCommandTrigger(Se,qe)){Rt.setShowFiles(!1);return}Rt.setShowFiles(!1),it.setShowCommands(!1)}function Ne(Se){m(Se),pe(Se,B||Se.length)}const Ve=b.useCallback(Se=>{U(Se),pe(p,Se)},[p]);function et(Se){const qe=it.handleCommandSelect(Se);m(qe)}function st(Se){const qe=Rt.handleFileSelect(Se);m(qe.newValue),qe.newCursorPos!==void 0&&U(qe.newCursorPos)}const Dn=b.useCallback(()=>{Rt.showFiles?Rt.handleArrowDown():it.handleArrowDown()},[Rt.showFiles,Rt.handleArrowDown,it.handleArrowDown]),fn=b.useCallback(()=>{Rt.showFiles?Rt.handleArrowUp():it.handleArrowUp()},[Rt.showFiles,Rt.handleArrowUp,it.handleArrowUp]),vn=b.useCallback(()=>{if(Rt.showFiles){const Se=Rt.handleKeyboardSelect();Se&&(m(Se.newValue),Se.newCursorPos!==void 0&&U(Se.newCursorPos))}else if(it.showCommands){const Se=it.handleKeyboardSelect();Se&&m(Se)}},[Rt.showFiles,it.showCommands]),nn=b.useCallback(Se=>{const qe=p.match(/(^|\s)([/@])([\w./:-]*)$/);let Ae;if(qe){const Ke=qe[2],gt=qe[3],Je=(qe.index??0)+qe[1].length;if(Ke===Se&&!gt){const ot=p.slice(0,Je);Ae=ot.endsWith(" ")&&Je>0?ot.slice(0,-1):ot,m(Ae),Rt.setShowFiles(!1),it.setShowCommands(!1),requestAnimationFrame(()=>{var Ie;return(Ie=s.current)==null?void 0:Ie.focusAt(Ae.length)});return}Ae=p.slice(0,Je)+Se}else p.length>0&&!p.endsWith(" ")?Ae=p+" "+Se:Ae=p+Se;m(Ae),pe(Ae,Ae.length),requestAnimationFrame(()=>{var Ke;return(Ke=s.current)==null?void 0:Ke.focusAt(Ae.length)})},[p,m]),kn=it.showCommands||Rt.showFiles,Ot=Rt.showFiles&&Rt.filteredFiles.length>0?`file-item-${Rt.fileSelectedIndex}`:it.showCommands&&it.filteredCommands.length>0?`command-item-${it.selectedIndex}`:void 0;return u.jsxs("div",{"data-testid":"chat-panel",className:"flex h-full flex-col",children:[u.jsxs("div",{className:"relative min-h-0 flex-1",children:[N?u.jsx("div",{className:"flex h-full items-center justify-center",children:u.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx("span",{className:"bg-muted-foreground h-2 w-2 rounded-full",style:{animation:"typing-dot 1.4s ease-in-out infinite",animationDelay:"0s"}}),u.jsx("span",{className:"bg-muted-foreground h-2 w-2 rounded-full",style:{animation:"typing-dot 1.4s ease-in-out infinite",animationDelay:"0.2s"}}),u.jsx("span",{className:"bg-muted-foreground h-2 w-2 rounded-full",style:{animation:"typing-dot 1.4s ease-in-out infinite",animationDelay:"0.4s"}})]}),"Loading conversation..."]})}):d.length===0?u.jsx("div",{className:"flex h-full items-center justify-center",children:u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"text-muted-foreground text-base",children:"Start a conversation"}),u.jsx("p",{className:"text-muted-foreground/60 mt-2 text-sm",children:"Type a message below to begin"})]})}):u.jsx(B1e,{ref:r,messages:d,sessionId:e,status:y,isTextStreaming:D,onScrollStateChange:re,streamStartTime:k,estimatedTokens:R,permissionMode:H,isWaitingForUser:O,waitingType:M??void 0,activeToolCallId:(I==null?void 0:I.toolCallId)??null,onToolRef:J,focusedOptionIndex:K}),u.jsx(ft,{children:q&&!ne&&u.jsx(De.button,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2},onClick:ae,className:"bg-foreground text-background hover:bg-foreground/90 absolute bottom-16 left-1/2 z-10 -translate-x-1/2 cursor-pointer rounded-full px-3 py-1.5 text-xs font-medium shadow-sm transition-colors",role:"status","aria-live":"polite",children:"New messages"})}),u.jsx(ft,{children:!ne&&d.length>0&&!N&&u.jsx(De.button,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.15},onClick:ae,className:"bg-background absolute right-4 bottom-4 rounded-full border p-2 shadow-sm transition-shadow hover:shadow-md","aria-label":"Scroll to bottom",children:u.jsx(HO,{className:"size-(--size-icon-md)"})})})]}),u.jsx(U1e,{celebration:l.activeCelebration,onComplete:l.clearCelebration}),u.jsx(z1e,{tasks:i.tasks,activeForm:i.activeForm,isCollapsed:i.isCollapsed,onToggleCollapse:i.toggleCollapse,celebratingTaskId:l.celebratingTaskId,onCelebrationComplete:l.clearCelebration}),v&&u.jsx("div",{className:"mx-4 mb-2 rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-400",children:v}),u.jsxs("div",{className:"chat-input-container relative border-t p-4",children:[u.jsxs(ft,{children:[it.showCommands&&u.jsx(H1e,{filteredCommands:it.filteredCommands,selectedIndex:it.selectedIndex,onSelect:et}),Rt.showFiles&&u.jsx(V1e,{filteredFiles:Rt.filteredFiles,selectedIndex:Rt.fileSelectedIndex,onSelect:st})]}),u.jsx(F1e,{ref:s,value:p,onChange:Ne,onSubmit:x,isLoading:y==="streaming",sessionBusy:T,onStop:w,onEscape:()=>{it.setShowCommands(!1),Rt.setShowFiles(!1)},onClear:()=>{m(""),it.setShowCommands(!1),Rt.setShowFiles(!1)},isPaletteOpen:kn,onArrowUp:fn,onArrowDown:Dn,onCommandSelect:vn,activeDescendantId:Ot,onCursorChange:Ve}),me&&u.jsxs(u.Fragment,{children:[u.jsx(De.div,{animate:ve?{y:[0,8,0]}:void 0,transition:ve?{duration:1.2,repeat:2}:void 0,children:u.jsx(G1e,{collapsed:le,onToggle:()=>ye(Se=>!Se)})}),u.jsx(ft,{children:ve&&u.jsx(De.p,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:ke,className:"text-muted-foreground cursor-pointer text-center text-xs",children:"Swipe to collapse"})}),u.jsx(ft,{initial:!1,children:!le&&u.jsxs(De.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",stiffness:300,damping:30},className:"overflow-hidden",drag:"y",dragConstraints:{top:0,bottom:0},dragElastic:.2,onDragEnd:Oe,style:{touchAction:"pan-y"},children:[pt&&u.jsx(WR,{onChipClick:nn}),u.jsx(JR,{sessionId:e,sessionStatus:A,isStreaming:y==="streaming"})]})})]}),!me&&u.jsxs(u.Fragment,{children:[u.jsx(ft,{children:pt&&u.jsx(WR,{onChipClick:nn})}),u.jsx(JR,{sessionId:e,sessionStatus:A,isStreaming:y==="streaming"})]})]})]})}function t5({onNewSession:e}){return u.jsxs("div",{className:"flex h-full flex-1 flex-col items-center justify-center px-6",children:[u.jsx("h1",{className:"mb-2 text-2xl font-semibold tracking-tight",children:"DorkOS"}),u.jsx("p",{className:"mb-8 max-w-sm text-center text-sm text-muted-foreground",children:"Your OS-layer for AI agents. Start a conversation to explore, build, and automate with Claude Code."}),u.jsx(mt,{size:"lg",onClick:e,children:"New Session"})]})}function hye({transformContent:e,embedded:t}={}){const{sidebarOpen:n,setSidebarOpen:r,toggleSidebar:s}=Jt(),[i]=oc(),l=pl(),c=b.useRef(null);Gz();const[f]=If(),d=Jt(A=>A.isStreaming),p=Jt(A=>A.activeForm),m=Jt(A=>A.isWaitingForUser),{data:x}=bE(t?null:f),y=n4(x??null,f??"");Mz({cwd:t?null:f,isStreaming:d,color:x?y.color:void 0}),Iz({cwd:t?null:f,activeForm:p,isStreaming:d,isWaitingForUser:m,agentName:x==null?void 0:x.name,agentEmoji:x?y.emoji:void 0});const{shouldShowOnboarding:v}=uh(),[T,w]=b.useState(!1);b.useEffect(()=>{v&&w(!0)},[v]),b.useEffect(()=>{if(!(t||l)||!n)return;const k=t?c.current:document;if(!k)return;const R=D=>{D.key==="Escape"&&r(!1)};return k.addEventListener("keydown",R),()=>k.removeEventListener("keydown",R)},[t,l,n,r]),b.useEffect(()=>{const A=t?c.current:document;if(!A)return;const k=R=>{(R.metaKey||R.ctrlKey)&&R.key==="b"&&(R.preventDefault(),s())};return A.addEventListener("keydown",k),()=>A.removeEventListener("keydown",k)},[t,s]);const N=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);return t?u.jsx(v3,{children:u.jsxs(bk,{reducedMotion:"user",children:[u.jsxs("div",{ref:c,"data-testid":"app-shell",className:"bg-background text-foreground relative flex h-full flex-col",children:[u.jsx(jk,{sessionId:i}),u.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[u.jsx(ft,{children:n&&u.jsxs(u.Fragment,{children:[u.jsx(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-40 bg-black/40",onClick:()=>r(!1),"aria-label":"Close sidebar"}),u.jsx(De.div,{initial:{x:-320},animate:{x:0},exit:{x:-320},transition:{duration:.2,ease:[0,0,.2,1]},className:"bg-background absolute top-0 left-0 z-50 h-full w-80 overflow-y-auto border-r",children:u.jsx(Wy,{})})]})}),u.jsx(ft,{children:!n&&u.jsxs(Jo,{children:[u.jsx(el,{asChild:!0,children:u.jsx(De.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15,ease:[0,0,.2,1]},onClick:s,className:"bg-background/80 hover:bg-accent absolute top-3 left-3 z-30 rounded-md border p-1.5 shadow-sm backdrop-blur transition-colors duration-150","aria-label":"Open sidebar",children:u.jsx(Dk,{className:"size-(--size-icon-md)"})})}),u.jsxs(tl,{side:"right",children:["Toggle sidebar ",u.jsx(Wa,{children:N?"⌘B":"Ctrl+B"})]})]})}),u.jsx("main",{className:"h-full flex-1 overflow-hidden",children:i?u.jsx(e5,{sessionId:i,transformContent:e},i):u.jsx(t5,{})})]})]}),u.jsx(b3,{})]})}):u.jsx(v3,{children:u.jsxs(bk,{reducedMotion:"user",children:[u.jsx(ft,{mode:"wait",children:T?u.jsx(De.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:u.jsx(qI,{onComplete:()=>w(!1)})},"onboarding"):u.jsx(De.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"flex h-dvh flex-col",children:u.jsxs("div",{ref:c,"data-testid":"app-shell",className:"bg-background text-foreground flex h-dvh flex-col",children:[u.jsx(jk,{sessionId:i}),u.jsxs("div",{className:"relative flex flex-1 overflow-hidden",children:[u.jsx(ft,{children:!n&&u.jsxs(Jo,{children:[u.jsx(el,{asChild:!0,children:u.jsx(De.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15,ease:[0,0,.2,1]},onClick:s,className:"bg-background/80 hover:bg-accent absolute top-3 left-3 z-30 rounded-md border p-1.5 shadow-sm backdrop-blur transition-colors duration-150","aria-label":"Open sidebar",children:u.jsx(Dk,{className:"size-(--size-icon-md)"})})}),u.jsxs(tl,{side:"right",children:["Toggle sidebar ",u.jsx(Wa,{children:N?"⌘B":"Ctrl+B"})]})]})}),l?u.jsx(ft,{children:n&&u.jsxs(u.Fragment,{children:[u.jsx(De.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-40 bg-black/40",onClick:()=>r(!1),"aria-label":"Close sidebar"}),u.jsx(De.div,{initial:{x:"-90vw"},animate:{x:0},exit:{x:"-90vw"},transition:{duration:.2,ease:[0,0,.2,1]},className:"bg-background fixed top-0 left-0 z-50 h-full w-[90vw] overflow-y-auto border-r",children:u.jsx(Wy,{})})]})}):u.jsx(De.div,{animate:{width:n?320:0},transition:{duration:.2,ease:[0,0,.2,1]},className:"flex-shrink-0 overflow-hidden border-r",children:u.jsx("div",{className:"h-full w-80 overflow-y-auto",children:u.jsx(Wy,{})})}),u.jsx("main",{className:"flex-1 overflow-hidden",children:i?u.jsx(e5,{sessionId:i,transformContent:e},i):u.jsx(t5,{})})]})]})},"main-app")}),u.jsx(b3,{})]})})}const mye=new L7({defaultOptions:{queries:{staleTime:vs.DEFAULT_STALE_TIME_MS,retry:vs.DEFAULT_RETRY}}}),pye=new mz("/api");f7.createRoot(document.getElementById("root")).render(u.jsx(oe.StrictMode,{children:u.jsx(xF,{children:u.jsxs(P7,{client:mye,children:[u.jsx(yF,{transport:pye,children:u.jsx(hye,{})}),!1]})})}));const gye=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:z8},Symbol.toStringTag,{value:"Module"}));export{vt as A,gn as B,JE as C,Qt as D,Nn as E,Vne as F,FY as G,lh as H,Ss as I,Tye as J,Sye as K,Gt as L,QO as M,Qn as N,mxe as Q,ks as R,g0 as S,ba as X,jf as a,oe as b,je as c,ai as d,Ee as e,Uf as f,ml as g,t_ as h,$O as i,u as j,ua as k,ca as l,da as m,fa as n,ha as o,Us as p,ws as q,b as r,Hs as s,Cn as t,Cs as u,Lt as v,hI as w,mt as x,yye as y,He as z};
|