remote-codex 0.1.9 → 0.11.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/apps/supervisor-api/dist/index.js +11942 -6101
- package/apps/supervisor-web/dist/assets/{highlighted-body-OFNGDK62-BFD4Ytvg.js → highlighted-body-OFNGDK62-ChrwAL9u.js} +1 -1
- package/apps/supervisor-web/dist/assets/index-DHf2HOXx.js +381 -0
- package/apps/supervisor-web/dist/assets/index-DpWxXCgt.css +32 -0
- package/apps/supervisor-web/dist/assets/{xterm-CukFWbxr.js → xterm-D4sevve4.js} +1 -1
- package/apps/supervisor-web/dist/index.html +2 -2
- package/config/codex-model-pricing.json +63 -0
- package/package.json +5 -2
- package/packages/agent-runtime/src/index.ts +4 -0
- package/packages/agent-runtime/src/management-errors.ts +11 -0
- package/packages/agent-runtime/src/model-pricing.ts +312 -0
- package/packages/agent-runtime/src/registry.ts +19 -4
- package/packages/agent-runtime/src/runtime-errors.ts +97 -0
- package/packages/agent-runtime/src/types.ts +50 -4
- package/packages/agent-runtime/src/unavailable-runtime.ts +169 -0
- package/packages/claude/src/historyItems.ts +693 -0
- package/packages/claude/src/index.ts +2 -0
- package/packages/claude/src/runtimeAdapter.test.ts +2138 -0
- package/packages/claude/src/runtimeAdapter.ts +2145 -0
- package/packages/codex/src/appServerManager.ts +12 -3
- package/packages/codex/src/historyItems.test.ts +110 -0
- package/packages/codex/src/historyItems.ts +97 -16
- package/packages/codex/src/hookHistory.test.ts +59 -0
- package/packages/codex/src/index.ts +7 -0
- package/packages/codex/src/local-session-store.ts +390 -0
- package/packages/codex/src/management/codex-management-service.ts +454 -0
- package/packages/codex/src/management/codexHostConfig.test.ts +88 -0
- package/packages/codex/src/management/codexHostConfig.ts +188 -0
- package/packages/codex/src/management/errors.ts +20 -0
- package/packages/codex/src/modelPricing.test.ts +184 -0
- package/packages/codex/src/modelPricing.ts +9 -0
- package/packages/codex/src/runtime-errors.test.ts +72 -0
- package/packages/codex/src/runtime-errors.ts +37 -0
- package/packages/codex/src/runtimeAdapter.ts +25 -2
- package/packages/codex/src/thread-title.ts +1 -0
- package/packages/db/src/repositories.ts +30 -0
- package/packages/opencode/src/historyItems.test.ts +504 -0
- package/packages/opencode/src/historyItems.ts +896 -0
- package/packages/opencode/src/index.ts +2 -0
- package/packages/opencode/src/runtimeAdapter.test.ts +1355 -0
- package/packages/opencode/src/runtimeAdapter.ts +1469 -0
- package/packages/shared/src/agent-providers.ts +56 -0
- package/packages/shared/src/index.ts +174 -35
- package/apps/supervisor-web/dist/assets/index-CbIt0KnL.css +0 -32
- package/apps/supervisor-web/dist/assets/index-Rd2EBQac.js +0 -377
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-B12qg9BL.js","assets/ruby-Dw2BHqvy.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/just-Cw27pwNe.js","assets/perl-C0TMdlhV.js","assets/latex-CWtU0Tv5.js","assets/tex-idrVyKtj.js","assets/liquid-DYVedYrR.js","assets/marko-CnJfTvn9.js","assets/less-B1dDrJ26.js","assets/mdc-BMNejdWA.js","assets/nextflow-Zz6hmt5N.js","assets/nextflow-groovy-BeH2EWoN.js","assets/nginx-BpAMiNFr.js","assets/nim-CVrawwO9.js","assets/php-Dhbhpdrm.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-Uh8Bk_45.js","assets/csharp-COcwbKMJ.js","assets/rst-BrH8l1NY.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-C_ipcX3V.js","assets/templ-P3uqSqPl.js","assets/go-CxLEBnE3.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-DNn4PbVi.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var iA=Object.defineProperty;var lA=Object.getPrototypeOf;var oA=Reflect.get;var VE=e=>{throw TypeError(e)};var uA=(e,t,n)=>t in e?iA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t,n)=>uA(e,typeof t!="symbol"?t+"":t,n),Zp=(e,t,n)=>t.has(e)||VE("Cannot "+n);var Dr=(e,t,n)=>(Zp(e,t,"read from private field"),n?n.call(e):t.get(e)),Rl=(e,t,n)=>t.has(e)?VE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ya=(e,t,n,r)=>(Zp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Jp=(e,t,n)=>(Zp(e,t,"access private method"),n);var GE=(e,t,n)=>oA(lA(e),n,t);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Lh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var e0={exports:{}},sc={};/**
|
|
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 qE;function cA(){if(qE)return sc;qE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,l){var o=null;if(l!==void 0&&(o=""+l),i.key!==void 0&&(o=""+i.key),"key"in i){l={};for(var c in i)c!=="key"&&(l[c]=i[c])}else l=i;return i=l.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:l}}return sc.Fragment=t,sc.jsx=n,sc.jsxs=n,sc}var YE;function dA(){return YE||(YE=1,e0.exports=cA()),e0.exports}var f=dA(),t0={exports:{}},yt={};/**
|
|
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 WE;function fA(){if(WE)return yt;WE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function E(H){return H===null||typeof H!="object"?null:(H=y&&H[y]||H["@@iterator"],typeof H=="function"?H:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function S(H,te,O){this.props=H,this.context=te,this.refs=C,this.updater=O||v}S.prototype.isReactComponent={},S.prototype.setState=function(H,te){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,te,"setState")},S.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function N(){}N.prototype=S.prototype;function R(H,te,O){this.props=H,this.context=te,this.refs=C,this.updater=O||v}var M=R.prototype=new N;M.constructor=R,w(M,S.prototype),M.isPureReactComponent=!0;var Y=Array.isArray;function U(){}var P={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function le(H,te,O){var ve=O.ref;return{$$typeof:e,type:H,key:te,ref:ve!==void 0?ve:null,props:O}}function X(H,te){return le(H.type,te,H.props)}function fe(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function F(H){var te={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(O){return te[O]})}var Te=/\/+/g;function me(H,te){return typeof H=="object"&&H!==null&&H.key!=null?F(""+H.key):te.toString(36)}function ne(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(U,U):(H.status="pending",H.then(function(te){H.status==="pending"&&(H.status="fulfilled",H.value=te)},function(te){H.status==="pending"&&(H.status="rejected",H.reason=te)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function $(H,te,O,ve,Re){var Ne=typeof H;(Ne==="undefined"||Ne==="boolean")&&(H=null);var Qe=!1;if(H===null)Qe=!0;else switch(Ne){case"bigint":case"string":case"number":Qe=!0;break;case"object":switch(H.$$typeof){case e:case t:Qe=!0;break;case p:return Qe=H._init,$(Qe(H._payload),te,O,ve,Re)}}if(Qe)return Re=Re(H),Qe=ve===""?"."+me(H,0):ve,Y(Re)?(O="",Qe!=null&&(O=Qe.replace(Te,"$&/")+"/"),$(Re,te,O,"",function(tt){return tt})):Re!=null&&(fe(Re)&&(Re=X(Re,O+(Re.key==null||H&&H.key===Re.key?"":(""+Re.key).replace(Te,"$&/")+"/")+Qe)),te.push(Re)),1;Qe=0;var Ve=ve===""?".":ve+":";if(Y(H))for(var je=0;je<H.length;je++)ve=H[je],Ne=Ve+me(ve,je),Qe+=$(ve,te,O,Ne,Re);else if(je=E(H),typeof je=="function")for(H=je.call(H),je=0;!(ve=H.next()).done;)ve=ve.value,Ne=Ve+me(ve,je++),Qe+=$(ve,te,O,Ne,Re);else if(Ne==="object"){if(typeof H.then=="function")return $(ne(H),te,O,ve,Re);throw te=String(H),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return Qe}function z(H,te,O){if(H==null)return H;var ve=[],Re=0;return $(H,ve,"","",function(Ne){return te.call(O,Ne,Re++)}),ve}function Z(H){if(H._status===-1){var te=H._result;te=te(),te.then(function(O){(H._status===0||H._status===-1)&&(H._status=1,H._result=O)},function(O){(H._status===0||H._status===-1)&&(H._status=2,H._result=O)}),H._status===-1&&(H._status=0,H._result=te)}if(H._status===1)return H._result.default;throw H._result}var ce=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},A={map:z,forEach:function(H,te,O){z(H,function(){te.apply(this,arguments)},O)},count:function(H){var te=0;return z(H,function(){te++}),te},toArray:function(H){return z(H,function(te){return te})||[]},only:function(H){if(!fe(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return yt.Activity=g,yt.Children=A,yt.Component=S,yt.Fragment=n,yt.Profiler=i,yt.PureComponent=R,yt.StrictMode=r,yt.Suspense=d,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,yt.__COMPILER_RUNTIME={__proto__:null,c:function(H){return P.H.useMemoCache(H)}},yt.cache=function(H){return function(){return H.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(H,te,O){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var ve=w({},H.props),Re=H.key;if(te!=null)for(Ne in te.key!==void 0&&(Re=""+te.key),te)!q.call(te,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&te.ref===void 0||(ve[Ne]=te[Ne]);var Ne=arguments.length-2;if(Ne===1)ve.children=O;else if(1<Ne){for(var Qe=Array(Ne),Ve=0;Ve<Ne;Ve++)Qe[Ve]=arguments[Ve+2];ve.children=Qe}return le(H.type,Re,ve)},yt.createContext=function(H){return H={$$typeof:o,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:l,_context:H},H},yt.createElement=function(H,te,O){var ve,Re={},Ne=null;if(te!=null)for(ve in te.key!==void 0&&(Ne=""+te.key),te)q.call(te,ve)&&ve!=="key"&&ve!=="__self"&&ve!=="__source"&&(Re[ve]=te[ve]);var Qe=arguments.length-2;if(Qe===1)Re.children=O;else if(1<Qe){for(var Ve=Array(Qe),je=0;je<Qe;je++)Ve[je]=arguments[je+2];Re.children=Ve}if(H&&H.defaultProps)for(ve in Qe=H.defaultProps,Qe)Re[ve]===void 0&&(Re[ve]=Qe[ve]);return le(H,Ne,Re)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(H){return{$$typeof:c,render:H}},yt.isValidElement=fe,yt.lazy=function(H){return{$$typeof:p,_payload:{_status:-1,_result:H},_init:Z}},yt.memo=function(H,te){return{$$typeof:m,type:H,compare:te===void 0?null:te}},yt.startTransition=function(H){var te=P.T,O={};P.T=O;try{var ve=H(),Re=P.S;Re!==null&&Re(O,ve),typeof ve=="object"&&ve!==null&&typeof ve.then=="function"&&ve.then(U,ce)}catch(Ne){ce(Ne)}finally{te!==null&&O.types!==null&&(te.types=O.types),P.T=te}},yt.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},yt.use=function(H){return P.H.use(H)},yt.useActionState=function(H,te,O){return P.H.useActionState(H,te,O)},yt.useCallback=function(H,te){return P.H.useCallback(H,te)},yt.useContext=function(H){return P.H.useContext(H)},yt.useDebugValue=function(){},yt.useDeferredValue=function(H,te){return P.H.useDeferredValue(H,te)},yt.useEffect=function(H,te){return P.H.useEffect(H,te)},yt.useEffectEvent=function(H){return P.H.useEffectEvent(H)},yt.useId=function(){return P.H.useId()},yt.useImperativeHandle=function(H,te,O){return P.H.useImperativeHandle(H,te,O)},yt.useInsertionEffect=function(H,te){return P.H.useInsertionEffect(H,te)},yt.useLayoutEffect=function(H,te){return P.H.useLayoutEffect(H,te)},yt.useMemo=function(H,te){return P.H.useMemo(H,te)},yt.useOptimistic=function(H,te){return P.H.useOptimistic(H,te)},yt.useReducer=function(H,te,O){return P.H.useReducer(H,te,O)},yt.useRef=function(H){return P.H.useRef(H)},yt.useState=function(H){return P.H.useState(H)},yt.useSyncExternalStore=function(H,te,O){return P.H.useSyncExternalStore(H,te,O)},yt.useTransition=function(){return P.H.useTransition()},yt.version="19.2.5",yt}var QE;function c1(){return QE||(QE=1,t0.exports=fA()),t0.exports}var T=c1();const hA=Lh(T);var n0={exports:{}},ic={},r0={exports:{}},a0={};/**
|
|
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 XE;function mA(){return XE||(XE=1,(function(e){function t($,z){var Z=$.length;$.push(z);e:for(;0<Z;){var ce=Z-1>>>1,A=$[ce];if(0<i(A,z))$[ce]=z,$[Z]=A,Z=ce;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var z=$[0],Z=$.pop();if(Z!==z){$[0]=Z;e:for(var ce=0,A=$.length,H=A>>>1;ce<H;){var te=2*(ce+1)-1,O=$[te],ve=te+1,Re=$[ve];if(0>i(O,Z))ve<A&&0>i(Re,O)?($[ce]=Re,$[ve]=Z,ce=ve):($[ce]=O,$[te]=Z,ce=te);else if(ve<A&&0>i(Re,Z))$[ce]=Re,$[ve]=Z,ce=ve;else break e}}return z}function i($,z){var Z=$.sortIndex-z.sortIndex;return Z!==0?Z:$.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],m=[],p=1,g=null,y=3,E=!1,v=!1,w=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function M($){for(var z=n(m);z!==null;){if(z.callback===null)r(m);else if(z.startTime<=$)r(m),z.sortIndex=z.expirationTime,t(d,z);else break;z=n(m)}}function Y($){if(w=!1,M($),!v)if(n(d)!==null)v=!0,U||(U=!0,F());else{var z=n(m);z!==null&&ne(Y,z.startTime-$)}}var U=!1,P=-1,q=5,le=-1;function X(){return C?!0:!(e.unstable_now()-le<q)}function fe(){if(C=!1,U){var $=e.unstable_now();le=$;var z=!0;try{e:{v=!1,w&&(w=!1,N(P),P=-1),E=!0;var Z=y;try{t:{for(M($),g=n(d);g!==null&&!(g.expirationTime>$&&X());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,y=g.priorityLevel;var A=ce(g.expirationTime<=$);if($=e.unstable_now(),typeof A=="function"){g.callback=A,M($),z=!0;break t}g===n(d)&&r(d),M($)}else r(d);g=n(d)}if(g!==null)z=!0;else{var H=n(m);H!==null&&ne(Y,H.startTime-$),z=!1}}break e}finally{g=null,y=Z,E=!1}z=void 0}}finally{z?F():U=!1}}}var F;if(typeof R=="function")F=function(){R(fe)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,me=Te.port2;Te.port1.onmessage=fe,F=function(){me.postMessage(null)}}else F=function(){S(fe,0)};function ne($,z){P=S(function(){$(e.unstable_now())},z)}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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function($){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var Z=y;y=z;try{return $()}finally{y=Z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function($,z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Z=y;y=$;try{return z()}finally{y=Z}},e.unstable_scheduleCallback=function($,z,Z){var ce=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?ce+Z:ce):Z=ce,$){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=Z+A,$={id:p++,callback:z,priorityLevel:$,startTime:Z,expirationTime:A,sortIndex:-1},Z>ce?($.sortIndex=Z,t(m,$),n(d)===null&&$===n(m)&&(w?(N(P),P=-1):w=!0,ne(Y,Z-ce))):($.sortIndex=A,t(d,$),v||E||(v=!0,U||(U=!0,F()))),$},e.unstable_shouldYield=X,e.unstable_wrapCallback=function($){var z=y;return function(){var Z=y;y=z;try{return $.apply(this,arguments)}finally{y=Z}}}})(a0)),a0}var KE;function pA(){return KE||(KE=1,r0.exports=mA()),r0.exports}var s0={exports:{}},wr={};/**
|
|
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 ZE;function gA(){if(ZE)return wr;ZE=1;var e=c1();function t(d){var m="https://react.dev/errors/"+d;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(d,m,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:d,containerInfo:m,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,m){if(d==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return wr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,wr.createPortal=function(d,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(d,m,null,p)},wr.flushSync=function(d){var m=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=m,r.p=p,r.d.f()}},wr.preconnect=function(d,m){typeof d=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(d,m))},wr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},wr.preinit=function(d,m){if(typeof d=="string"&&m&&typeof m.as=="string"){var p=m.as,g=c(p,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,E=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?r.d.S(d,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:E}):p==="script"&&r.d.X(d,{crossOrigin:g,integrity:y,fetchPriority:E,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},wr.preinitModule=function(d,m){if(typeof d=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=c(m.as,m.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(d)},wr.preload=function(d,m){if(typeof d=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,g=c(p,m.crossOrigin);r.d.L(d,p,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},wr.preloadModule=function(d,m){if(typeof d=="string")if(m){var p=c(m.as,m.crossOrigin);r.d.m(d,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(d)},wr.requestFormReset=function(d){r.d.r(d)},wr.unstable_batchedUpdates=function(d,m){return d(m)},wr.useFormState=function(d,m,p){return o.H.useFormState(d,m,p)},wr.useFormStatus=function(){return o.H.useHostTransitionStatus()},wr.version="19.2.5",wr}var JE;function wv(){if(JE)return s0.exports;JE=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(),s0.exports=gA(),s0.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 e2;function bA(){if(e2)return ic;e2=1;var e=pA(),t=c1(),n=wv();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var s=a,u=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(u=s.return),a=s.return;while(a)}return s.tag===3?u:null}function o(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function c(a){if(a.tag===31){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function d(a){if(l(a)!==a)throw Error(r(188))}function m(a){var s=a.alternate;if(!s){if(s=l(a),s===null)throw Error(r(188));return s!==a?null:a}for(var u=a,h=s;;){var b=u.return;if(b===null)break;var x=b.alternate;if(x===null){if(h=b.return,h!==null){u=h;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===u)return d(b),a;if(x===h)return d(b),s;x=x.sibling}throw Error(r(188))}if(u.return!==h.return)u=b,h=x;else{for(var k=!1,L=b.child;L;){if(L===u){k=!0,u=b,h=x;break}if(L===h){k=!0,h=b,u=x;break}L=L.sibling}if(!k){for(L=x.child;L;){if(L===u){k=!0,u=x,h=b;break}if(L===h){k=!0,h=x,u=b;break}L=L.sibling}if(!k)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:s}function p(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=p(a),s!==null)return s;a=a.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),R=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),fe=Symbol.iterator;function F(a){return a===null||typeof a!="object"?null:(a=fe&&a[fe]||a["@@iterator"],typeof a=="function"?a:null)}var Te=Symbol.for("react.client.reference");function me(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===Te?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case Y:return"Suspense";case U:return"SuspenseList";case le:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case R:return a.displayName||"Context";case N:return(a._context.displayName||"Context")+".Consumer";case M:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case P:return s=a.displayName||null,s!==null?s:me(a.type)||"Memo";case q:s=a._payload,a=a._init;try{return me(a(s))}catch{}}return null}var ne=Array.isArray,$=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},ce=[],A=-1;function H(a){return{current:a}}function te(a){0>A||(a.current=ce[A],ce[A]=null,A--)}function O(a,s){A++,ce[A]=a.current,a.current=s}var ve=H(null),Re=H(null),Ne=H(null),Qe=H(null);function Ve(a,s){switch(O(Ne,s),O(Re,a),O(ve,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?hE(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=hE(s),a=mE(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}te(ve),O(ve,a)}function je(){te(ve),te(Re),te(Ne)}function tt(a){a.memoizedState!==null&&O(Qe,a);var s=ve.current,u=mE(s,a.type);s!==u&&(O(Re,a),O(ve,u))}function ut(a){Re.current===a&&(te(ve),te(Re)),Qe.current===a&&(te(Qe),tc._currentValue=Z)}var Ct,en;function nt(a){if(Ct===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);Ct=s&&s[1]||"",en=-1<u.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+Ct+a+en}var vt=!1;function st(a,s){if(!a||vt)return"";vt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(he){var ue=he}Reflect.construct(a,[],Ee)}else{try{Ee.call()}catch(he){ue=he}a.call(Ee.prototype)}}else{try{throw Error()}catch(he){ue=he}(Ee=a())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(he){if(he&&ue&&typeof he.stack=="string")return[he.stack,ue.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=h.DetermineComponentFrameRoot(),k=x[0],L=x[1];if(k&&L){var W=k.split(`
|
|
45
|
-
`),ie=L.split(`
|
|
46
|
-
`);for(b=h=0;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;for(;b<ie.length&&!ie[b].includes("DetermineComponentFrameRoot");)b++;if(h===W.length||b===ie.length)for(h=W.length-1,b=ie.length-1;1<=h&&0<=b&&W[h]!==ie[b];)b--;for(;1<=h&&0<=b;h--,b--)if(W[h]!==ie[b]){if(h!==1||b!==1)do if(h--,b--,0>b||W[h]!==ie[b]){var be=`
|
|
47
|
-
`+W[h].replace(" at new "," at ");return a.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",a.displayName)),be}while(1<=h&&0<=b);break}}}finally{vt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?nt(u):""}function xn(a,s){switch(a.tag){case 26:case 27:case 5:return nt(a.type);case 16:return nt("Lazy");case 13:return a.child!==s&&s!==null?nt("Suspense Fallback"):nt("Suspense");case 19:return nt("SuspenseList");case 0:case 15:return st(a.type,!1);case 11:return st(a.type.render,!1);case 1:return st(a.type,!0);case 31:return nt("Activity");default:return""}}function qe(a){try{var s="",u=null;do s+=xn(a,u),u=a,a=a.return;while(a);return s}catch(h){return`
|
|
48
|
-
Error generating stack: `+h.message+`
|
|
49
|
-
`+h.stack}}var Me=Object.prototype.hasOwnProperty,Nt=e.unstable_scheduleCallback,ln=e.unstable_cancelCallback,tn=e.unstable_shouldYield,Zn=e.unstable_requestPaint,Ye=e.unstable_now,Un=e.unstable_getCurrentPriorityLevel,ge=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Pe=e.unstable_NormalPriority,ct=e.unstable_LowPriority,bt=e.unstable_IdlePriority,yn=e.log,Gn=e.unstable_setDisableYieldValue,xe=null,Oe=null;function Je(a){if(typeof yn=="function"&&Gn(a),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(xe,a)}catch{}}var Be=Math.clz32?Math.clz32:_e,dt=Math.log,Q=Math.LN2;function _e(a){return a>>>=0,a===0?32:31-(dt(a)/Q|0)|0}var rt=256,He=262144,Fe=4194304;function mt(a){var s=a&42;if(s!==0)return s;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 Mt(a,s,u){var h=a.pendingLanes;if(h===0)return 0;var b=0,x=a.suspendedLanes,k=a.pingedLanes;a=a.warmLanes;var L=h&134217727;return L!==0?(h=L&~x,h!==0?b=mt(h):(k&=L,k!==0?b=mt(k):u||(u=L&~a,u!==0&&(b=mt(u))))):(L=h&~x,L!==0?b=mt(L):k!==0?b=mt(k):u||(u=h&~a,u!==0&&(b=mt(u)))),b===0?0:s!==0&&s!==b&&(s&x)===0&&(x=b&-b,u=s&-s,x>=u||x===32&&(u&4194048)!==0)?s:b}function at(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function Rt(a,s){switch(a){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Kt(){var a=Fe;return Fe<<=1,(Fe&62914560)===0&&(Fe=4194304),a}function Zt(a){for(var s=[],u=0;31>u;u++)s.push(a);return s}function En(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Hn(a,s,u,h,b,x){var k=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var L=a.entanglements,W=a.expirationTimes,ie=a.hiddenUpdates;for(u=k&~u;0<u;){var be=31-Be(u),Ee=1<<be;L[be]=0,W[be]=-1;var ue=ie[be];if(ue!==null)for(ie[be]=null,be=0;be<ue.length;be++){var he=ue[be];he!==null&&(he.lane&=-536870913)}u&=~Ee}h!==0&&Jn(a,h,0),x!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=x&~(k&~s))}function Jn(a,s,u){a.pendingLanes|=s,a.suspendedLanes&=~s;var h=31-Be(s);a.entangledLanes|=s,a.entanglements[h]=a.entanglements[h]|1073741824|u&261930}function nl(a,s){var u=a.entangledLanes|=s;for(a=a.entanglements;u;){var h=31-Be(u),b=1<<h;b&s|a[h]&s&&(a[h]|=s),u&=~b}}function li(a,s){var u=s&-s;return u=(u&42)!==0?1:ts(u),(u&(a.suspendedLanes|s))!==0?0:u}function ts(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 Xr(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function rl(){var a=z.p;return a!==0?a:(a=window.event,a===void 0?32:PE(a.type))}function ro(a,s){var u=z.p;try{return z.p=a,s()}finally{z.p=u}}var Kr=Math.random().toString(36).slice(2),hn="__reactFiber$"+Kr,Cn="__reactProps$"+Kr,ha="__reactContainer$"+Kr,er="__reactEvents$"+Kr,ks="__reactListeners$"+Kr,Lr="__reactHandles$"+Kr,Ut="__reactResources$"+Kr,ur="__reactMarker$"+Kr;function Zr(a){delete a[hn],delete a[Cn],delete a[er],delete a[ks],delete a[Lr]}function Ir(a){var s=a[hn];if(s)return s;for(var u=a.parentNode;u;){if(s=u[ha]||u[hn]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(a=_E(a);a!==null;){if(u=a[hn])return u;a=_E(a)}return s}a=u,u=a.parentNode}return null}function tr(a){if(a=a[hn]||a[ha]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function ma(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function nr(a){var s=a[Ut];return s||(s=a[Ut]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Sn(a){a[ur]=!0}var al=new Set,ws={};function Ur(a,s){Tr(a,s),Tr(a+"Capture",s)}function Tr(a,s){for(ws[a]=s,a=0;a<s.length;a++)al.add(s[a])}var ao=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]*$"),Jr={},oi={};function sl(a){return Me.call(oi,a)?!0:Me.call(Jr,a)?!1:ao.test(a)?oi[a]=!0:(Jr[a]=!0,!1)}function Hr(a,s,u){if(sl(s))if(u===null)a.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+u)}}function pa(a,s,u){if(u===null)a.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+u)}}function _n(a,s,u,h){if(h===null)a.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(s,u,""+h)}}function In(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ui(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function il(a,s,u){var h=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,x=h.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return b.call(this)},set:function(k){u=""+k,x.call(this,k)}}),Object.defineProperty(a,s,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Wt(a){if(!a._valueTracker){var s=ui(a)?"checked":"value";a._valueTracker=il(a,s,""+a[s])}}function ci(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return a&&(h=ui(a)?a.checked?"true":"false":a.value),a=h,a!==u?(s.setValue(a),!0):!1}function Pa(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 ns=/[\n"\\]/g;function On(a){return a.replace(ns,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Dn(a,s,u,h,b,x,k,L){a.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.type=k:a.removeAttribute("type"),s!=null?k==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+In(s)):a.value!==""+In(s)&&(a.value=""+In(s)):k!=="submit"&&k!=="reset"||a.removeAttribute("value"),s!=null?Ba(a,k,In(s)):u!=null?Ba(a,k,In(u)):h!=null&&a.removeAttribute("value"),b==null&&x!=null&&(a.defaultChecked=!!x),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+In(L):a.removeAttribute("name")}function rs(a,s,u,h,b,x,k,L){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.type=x),s!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){Wt(a);return}u=u!=null?""+In(u):"",s=s!=null?""+In(s):u,L||s===a.value||(a.value=s),a.defaultValue=s}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=L?a.checked:!!h,a.defaultChecked=!!h,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(a.name=k),Wt(a)}function Ba(a,s,u){s==="number"&&Pa(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function as(a,s,u,h){if(a=a.options,s){s={};for(var b=0;b<u.length;b++)s["$"+u[b]]=!0;for(u=0;u<a.length;u++)b=s.hasOwnProperty("$"+a[u].value),a[u].selected!==b&&(a[u].selected=b),b&&h&&(a[u].defaultSelected=!0)}else{for(u=""+In(u),s=null,b=0;b<a.length;b++){if(a[b].value===u){a[b].selected=!0,h&&(a[b].defaultSelected=!0);return}s!==null||a[b].disabled||(s=a[b])}s!==null&&(s.selected=!0)}}function ss(a,s,u){if(s!=null&&(s=""+In(s),s!==a.value&&(a.value=s),u==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=u!=null?""+In(u):""}function Qt(a,s,u,h){if(s==null){if(h!=null){if(u!=null)throw Error(r(92));if(ne(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),s=u}u=In(s),a.defaultValue=u,h=a.textContent,h===u&&h!==""&&h!==null&&(a.value=h),Wt(a)}function cr(a,s){if(s){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=s;return}}a.textContent=s}var Ua=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 ll(a,s,u){var h=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":h?a.setProperty(s,u):typeof u!="number"||u===0||Ua.has(s)?s==="float"?a.cssFloat=u:a[s]=(""+u).trim():a[s]=u+"px"}function so(a,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var b in s)h=s[b],s.hasOwnProperty(b)&&u[b]!==h&&ll(a,b,h)}else for(var x in s)s.hasOwnProperty(x)&&ll(a,x,s[x])}function Cs(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 ol=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"]]),ul=/^[\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 Ha(a){return ul.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function vr(){}var is=null;function di(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var za=null,Fa=null;function fi(a){var s=tr(a);if(s&&(a=s.stateNode)){var u=a[Cn]||null;e:switch(a=s.stateNode,s.type){case"input":if(Dn(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+On(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==a&&h.form===a.form){var b=h[Cn]||null;if(!b)throw Error(r(90));Dn(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)h=u[s],h.form===a.form&&ci(h)}break e;case"textarea":ss(a,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&as(a,!!u.multiple,s,!1)}}}var Ss=!1;function cl(a,s,u){if(Ss)return a(s,u);Ss=!0;try{var h=a(s);return h}finally{if(Ss=!1,(za!==null||Fa!==null)&&(Kd(),za&&(s=za,a=Fa,Fa=za=null,fi(s),a)))for(s=0;s<a.length;s++)fi(a[s])}}function ea(a,s){var u=a.stateNode;if(u===null)return null;var h=u[Cn]||null;if(h===null)return null;u=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var kr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hi=!1;if(kr)try{var ga={};Object.defineProperty(ga,"passive",{get:function(){hi=!0}}),window.addEventListener("test",ga,ga),window.removeEventListener("test",ga,ga)}catch{hi=!1}var ba=null,dl=null,Ns=null;function fl(){if(Ns)return Ns;var a,s=dl,u=s.length,h,b="value"in ba?ba.value:ba.textContent,x=b.length;for(a=0;a<u&&s[a]===b[a];a++);var k=u-a;for(h=1;h<=k&&s[u-h]===b[x-h];h++);return Ns=b.slice(a,1<h?1-h:void 0)}function As(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function mi(){return!0}function hl(){return!1}function rr(a){function s(u,h,b,x,k){this._reactName=u,this._targetInst=b,this.type=h,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var L in a)a.hasOwnProperty(L)&&(u=a[L],this[L]=u?u(x):x[L]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?mi:hl,this.isPropagationStopped=hl,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=mi)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),s}var dr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rs=rr(dr),$a=g({},dr,{view:0,detail:0}),V=rr($a),K,oe,Le,De=g({},$a,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ln,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!==Le&&(Le&&a.type==="mousemove"?(K=a.screenX-Le.screenX,oe=a.screenY-Le.screenY):oe=K=0,Le=a),K)},movementY:function(a){return"movementY"in a?a.movementY:oe}}),ft=rr(De),Ue=g({},De,{dataTransfer:0}),Tn=rr(Ue),Jt=g({},$a,{relatedTarget:0}),vn=rr(Jt),Ls=g({},dr,{animationName:0,elapsedTime:0,pseudoElement:0}),nn=rr(Ls),Gt=g({},dr,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Se=rr(Gt),Ze=g({},dr,{data:0}),gt=rr(Ze),mn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xt={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"},rn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fr(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=rn[a])?!!s[a]:!1}function Ln(){return fr}var Is=g({},$a,{key:function(a){if(a.key){var s=mn[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=As(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?xt[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ln,charCode:function(a){return a.type==="keypress"?As(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?As(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),ml=rr(Is),sm=g({},De,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ld=rr(sm),od=g({},$a,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ln}),im=rr(od),ud=g({},dr,{propertyName:0,elapsedTime:0,pseudoElement:0}),cd=rr(ud),dd=g({},De,{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}),fd=rr(dd),hd=g({},dr,{newState:0,oldState:0}),md=rr(hd),pd=[9,13,27,32],io=kr&&"CompositionEvent"in window,pi=null;kr&&"documentMode"in document&&(pi=document.documentMode);var gd=kr&&"TextEvent"in window&&!pi,_u=kr&&(!io||pi&&8<pi&&11>=pi),Tu=" ",vu=!1;function ku(a,s){switch(a){case"keyup":return pd.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function I(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var re=!1;function ke(a,s){switch(a){case"compositionend":return I(s);case"keypress":return s.which!==32?null:(vu=!0,Tu);case"textInput":return a=s.data,a===Tu&&vu?null:a;default:return null}}function Xe(a,s){if(re)return a==="compositionend"||!io&&ku(a,s)?(a=fl(),Ns=dl=ba=null,re=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return _u&&s.locale!=="ko"?null:s.data;default:return null}}var Ke={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 pt(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!Ke[a.type]:s==="textarea"}function ht(a,s,u,h){za?Fa?Fa.push(h):Fa=[h]:za=h,s=af(s,"onChange"),0<s.length&&(u=new Rs("onChange","change",null,u,h),a.push({event:u,listeners:s}))}var St=null,Et=null;function on(a){lE(a,0)}function jn(a){var s=ma(a);if(ci(s))return a}function zt(a,s){if(a==="change")return s}var xa=!1;if(kr){var Os;if(kr){var lo="oninput"in document;if(!lo){var Nb=document.createElement("div");Nb.setAttribute("oninput","return;"),lo=typeof Nb.oninput=="function"}Os=lo}else Os=!1;xa=Os&&(!document.documentMode||9<document.documentMode)}function Ab(){St&&(St.detachEvent("onpropertychange",Rb),Et=St=null)}function Rb(a){if(a.propertyName==="value"&&jn(Et)){var s=[];ht(s,Et,a,di(a)),cl(on,s)}}function DS(a,s,u){a==="focusin"?(Ab(),St=s,Et=u,St.attachEvent("onpropertychange",Rb)):a==="focusout"&&Ab()}function jS(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return jn(Et)}function MS(a,s){if(a==="click")return jn(s)}function PS(a,s){if(a==="input"||a==="change")return jn(s)}function BS(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var ta=typeof Object.is=="function"?Object.is:BS;function wu(a,s){if(ta(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var u=Object.keys(a),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var b=u[h];if(!Me.call(s,b)||!ta(a[b],s[b]))return!1}return!0}function Lb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ib(a,s){var u=Lb(a);a=0;for(var h;u;){if(u.nodeType===3){if(h=a+u.textContent.length,a<=s&&h>=s)return{node:u,offset:s-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Lb(u)}}function Ob(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Ob(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function Db(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=Pa(a.document);s instanceof a.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)a=s.contentWindow;else break;s=Pa(a.document)}return s}function lm(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}var US=kr&&"documentMode"in document&&11>=document.documentMode,oo=null,om=null,Cu=null,um=!1;function jb(a,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;um||oo==null||oo!==Pa(h)||(h=oo,"selectionStart"in h&&lm(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Cu&&wu(Cu,h)||(Cu=h,h=af(om,"onSelect"),0<h.length&&(s=new Rs("onSelect","select",null,s,u),a.push({event:s,listeners:h}),s.target=oo)))}function pl(a,s){var u={};return u[a.toLowerCase()]=s.toLowerCase(),u["Webkit"+a]="webkit"+s,u["Moz"+a]="moz"+s,u}var uo={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionrun:pl("Transition","TransitionRun"),transitionstart:pl("Transition","TransitionStart"),transitioncancel:pl("Transition","TransitionCancel"),transitionend:pl("Transition","TransitionEnd")},cm={},Mb={};kr&&(Mb=document.createElement("div").style,"AnimationEvent"in window||(delete uo.animationend.animation,delete uo.animationiteration.animation,delete uo.animationstart.animation),"TransitionEvent"in window||delete uo.transitionend.transition);function gl(a){if(cm[a])return cm[a];if(!uo[a])return a;var s=uo[a],u;for(u in s)if(s.hasOwnProperty(u)&&u in Mb)return cm[a]=s[u];return a}var Pb=gl("animationend"),Bb=gl("animationiteration"),Ub=gl("animationstart"),HS=gl("transitionrun"),zS=gl("transitionstart"),FS=gl("transitioncancel"),Hb=gl("transitionend"),zb=new Map,dm="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(" ");dm.push("scrollEnd");function Va(a,s){zb.set(a,s),Ur(s,[a])}var bd=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=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(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},ya=[],co=0,fm=0;function xd(){for(var a=co,s=fm=co=0;s<a;){var u=ya[s];ya[s++]=null;var h=ya[s];ya[s++]=null;var b=ya[s];ya[s++]=null;var x=ya[s];if(ya[s++]=null,h!==null&&b!==null){var k=h.pending;k===null?b.next=b:(b.next=k.next,k.next=b),h.pending=b}x!==0&&Fb(u,b,x)}}function yd(a,s,u,h){ya[co++]=a,ya[co++]=s,ya[co++]=u,ya[co++]=h,fm|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function hm(a,s,u,h){return yd(a,s,u,h),Ed(a)}function bl(a,s){return yd(a,null,null,s),Ed(a)}function Fb(a,s,u){a.lanes|=u;var h=a.alternate;h!==null&&(h.lanes|=u);for(var b=!1,x=a.return;x!==null;)x.childLanes|=u,h=x.alternate,h!==null&&(h.childLanes|=u),x.tag===22&&(a=x.stateNode,a===null||a._visibility&1||(b=!0)),a=x,x=x.return;return a.tag===3?(x=a.stateNode,b&&s!==null&&(b=31-Be(u),a=x.hiddenUpdates,h=a[b],h===null?a[b]=[s]:h.push(s),s.lane=u|536870912),x):null}function Ed(a){if(50<Wu)throw Wu=0,Tp=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var fo={};function $S(a,s,u,h){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(a,s,u,h){return new $S(a,s,u,h)}function mm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ds(a,s){var u=a.alternate;return u===null?(u=na(a.tag,s,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=s,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,s=a.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function $b(a,s){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,s=u.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function _d(a,s,u,h,b,x){var k=0;if(h=a,typeof a=="function")mm(a)&&(k=1);else if(typeof a=="string")k=WN(a,u,ve.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case le:return a=na(31,u,s,b),a.elementType=le,a.lanes=x,a;case w:return xl(u.children,b,x,s);case C:k=8,b|=24;break;case S:return a=na(12,u,s,b|2),a.elementType=S,a.lanes=x,a;case Y:return a=na(13,u,s,b),a.elementType=Y,a.lanes=x,a;case U:return a=na(19,u,s,b),a.elementType=U,a.lanes=x,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:k=10;break e;case N:k=9;break e;case M:k=11;break e;case P:k=14;break e;case q:k=16,h=null;break e}k=29,u=Error(r(130,a===null?"null":typeof a,"")),h=null}return s=na(k,u,s,b),s.elementType=a,s.type=h,s.lanes=x,s}function xl(a,s,u,h){return a=na(7,a,h,s),a.lanes=u,a}function pm(a,s,u){return a=na(6,a,null,s),a.lanes=u,a}function Vb(a){var s=na(18,null,null,0);return s.stateNode=a,s}function gm(a,s,u){return s=na(4,a.children!==null?a.children:[],a.key,s),s.lanes=u,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var Gb=new WeakMap;function Ea(a,s){if(typeof a=="object"&&a!==null){var u=Gb.get(a);return u!==void 0?u:(s={value:a,source:s,stack:qe(s)},Gb.set(a,s),s)}return{value:a,source:s,stack:qe(s)}}var ho=[],mo=0,Td=null,Su=0,_a=[],Ta=0,gi=null,ls=1,os="";function js(a,s){ho[mo++]=Su,ho[mo++]=Td,Td=a,Su=s}function qb(a,s,u){_a[Ta++]=ls,_a[Ta++]=os,_a[Ta++]=gi,gi=a;var h=ls;a=os;var b=32-Be(h)-1;h&=~(1<<b),u+=1;var x=32-Be(s)+b;if(30<x){var k=b-b%5;x=(h&(1<<k)-1).toString(32),h>>=k,b-=k,ls=1<<32-Be(s)+b|u<<b|h,os=x+a}else ls=1<<x|u<<b|h,os=a}function bm(a){a.return!==null&&(js(a,1),qb(a,1,0))}function xm(a){for(;a===Td;)Td=ho[--mo],ho[mo]=null,Su=ho[--mo],ho[mo]=null;for(;a===gi;)gi=_a[--Ta],_a[Ta]=null,os=_a[--Ta],_a[Ta]=null,ls=_a[--Ta],_a[Ta]=null}function Yb(a,s){_a[Ta++]=ls,_a[Ta++]=os,_a[Ta++]=gi,ls=s.id,os=s.overflow,gi=a}var xr=null,kn=null,Ht=!1,bi=null,va=!1,ym=Error(r(519));function xi(a){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Nu(Ea(s,a)),ym}function Wb(a){var s=a.stateNode,u=a.type,h=a.memoizedProps;switch(s[hn]=a,s[Cn]=h,u){case"dialog":Dt("cancel",s),Dt("close",s);break;case"iframe":case"object":case"embed":Dt("load",s);break;case"video":case"audio":for(u=0;u<Xu.length;u++)Dt(Xu[u],s);break;case"source":Dt("error",s);break;case"img":case"image":case"link":Dt("error",s),Dt("load",s);break;case"details":Dt("toggle",s);break;case"input":Dt("invalid",s),rs(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Dt("invalid",s);break;case"textarea":Dt("invalid",s),Qt(s,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||h.suppressHydrationWarning===!0||dE(s.textContent,u)?(h.popover!=null&&(Dt("beforetoggle",s),Dt("toggle",s)),h.onScroll!=null&&Dt("scroll",s),h.onScrollEnd!=null&&Dt("scrollend",s),h.onClick!=null&&(s.onclick=vr),s=!0):s=!1,s||xi(a,!0)}function Qb(a){for(xr=a.return;xr;)switch(xr.tag){case 5:case 31:case 13:va=!1;return;case 27:case 3:va=!0;return;default:xr=xr.return}}function po(a){if(a!==xr)return!1;if(!Ht)return Qb(a),Ht=!0,!1;var s=a.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Pp(a.type,a.memoizedProps)),u=!u),u&&kn&&xi(a),Qb(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));kn=EE(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));kn=EE(a)}else s===27?(s=kn,Ii(a.type)?(a=Fp,Fp=null,kn=a):kn=s):kn=xr?wa(a.stateNode.nextSibling):null;return!0}function yl(){kn=xr=null,Ht=!1}function Em(){var a=bi;return a!==null&&(Vr===null?Vr=a:Vr.push.apply(Vr,a),bi=null),a}function Nu(a){bi===null?bi=[a]:bi.push(a)}var _m=H(null),El=null,Ms=null;function yi(a,s,u){O(_m,s._currentValue),s._currentValue=u}function Ps(a){a._currentValue=_m.current,te(_m)}function Tm(a,s,u){for(;a!==null;){var h=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),a===u)break;a=a.return}}function vm(a,s,u,h){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var x=b.dependencies;if(x!==null){var k=b.child;x=x.firstContext;e:for(;x!==null;){var L=x;x=b;for(var W=0;W<s.length;W++)if(L.context===s[W]){x.lanes|=u,L=x.alternate,L!==null&&(L.lanes|=u),Tm(x.return,u,a),h||(k=null);break e}x=L.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(r(341));k.lanes|=u,x=k.alternate,x!==null&&(x.lanes|=u),Tm(k,u,a),k=null}else k=b.child;if(k!==null)k.return=b;else for(k=b;k!==null;){if(k===a){k=null;break}if(b=k.sibling,b!==null){b.return=k.return,k=b;break}k=k.return}b=k}}function go(a,s,u,h){a=null;for(var b=s,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var k=b.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var L=b.type;ta(b.pendingProps.value,k.value)||(a!==null?a.push(L):a=[L])}}else if(b===Qe.current){if(k=b.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(tc):a=[tc])}b=b.return}a!==null&&vm(s,a,u,h),s.flags|=262144}function vd(a){for(a=a.firstContext;a!==null;){if(!ta(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function _l(a){El=a,Ms=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function yr(a){return Xb(El,a)}function kd(a,s){return El===null&&_l(a),Xb(a,s)}function Xb(a,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Ms===null){if(a===null)throw Error(r(308));Ms=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else Ms=Ms.next=s;return u}var VS=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(u,h){a.push(h)}};this.abort=function(){s.aborted=!0,a.forEach(function(u){return u()})}},GS=e.unstable_scheduleCallback,qS=e.unstable_NormalPriority,qn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function km(){return{controller:new VS,data:new Map,refCount:0}}function Au(a){a.refCount--,a.refCount===0&&GS(qS,function(){a.controller.abort()})}var Ru=null,wm=0,bo=0,xo=null;function YS(a,s){if(Ru===null){var u=Ru=[];wm=0,bo=Np(),xo={status:"pending",value:void 0,then:function(h){u.push(h)}}}return wm++,s.then(Kb,Kb),s}function Kb(){if(--wm===0&&Ru!==null){xo!==null&&(xo.status="fulfilled");var a=Ru;Ru=null,bo=0,xo=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function WS(a,s){var u=[],h={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return a.then(function(){h.status="fulfilled",h.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(h.status="rejected",h.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),h}var Zb=$.S;$.S=function(a,s){jy=Ye(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&YS(a,s),Zb!==null&&Zb(a,s)};var Tl=H(null);function Cm(){var a=Tl.current;return a!==null?a:pn.pooledCache}function wd(a,s){s===null?O(Tl,Tl.current):O(Tl,s.pool)}function Jb(){var a=Cm();return a===null?null:{parent:qn._currentValue,pool:a}}var yo=Error(r(460)),Sm=Error(r(474)),Cd=Error(r(542)),Sd={then:function(){}};function ex(a){return a=a.status,a==="fulfilled"||a==="rejected"}function tx(a,s,u){switch(u=a[u],u===void 0?a.push(s):u!==s&&(s.then(vr,vr),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,rx(a),a;default:if(typeof s.status=="string")s.then(vr,vr);else{if(a=pn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(h){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=h}},function(h){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,rx(a),a}throw kl=s,yo}}function vl(a){try{var s=a._init;return s(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(kl=u,yo):u}}var kl=null;function nx(){if(kl===null)throw Error(r(459));var a=kl;return kl=null,a}function rx(a){if(a===yo||a===Cd)throw Error(r(483))}var Eo=null,Lu=0;function Nd(a){var s=Lu;return Lu+=1,Eo===null&&(Eo=[]),tx(Eo,a,s)}function Iu(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Ad(a,s){throw s.$$typeof===y?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function ax(a){function s(ee,J){if(a){var se=ee.deletions;se===null?(ee.deletions=[J],ee.flags|=16):se.push(J)}}function u(ee,J){if(!a)return null;for(;J!==null;)s(ee,J),J=J.sibling;return null}function h(ee){for(var J=new Map;ee!==null;)ee.key!==null?J.set(ee.key,ee):J.set(ee.index,ee),ee=ee.sibling;return J}function b(ee,J){return ee=Ds(ee,J),ee.index=0,ee.sibling=null,ee}function x(ee,J,se){return ee.index=se,a?(se=ee.alternate,se!==null?(se=se.index,se<J?(ee.flags|=67108866,J):se):(ee.flags|=67108866,J)):(ee.flags|=1048576,J)}function k(ee){return a&&ee.alternate===null&&(ee.flags|=67108866),ee}function L(ee,J,se,ye){return J===null||J.tag!==6?(J=pm(se,ee.mode,ye),J.return=ee,J):(J=b(J,se),J.return=ee,J)}function W(ee,J,se,ye){var et=se.type;return et===w?be(ee,J,se.props.children,ye,se.key):J!==null&&(J.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===q&&vl(et)===J.type)?(J=b(J,se.props),Iu(J,se),J.return=ee,J):(J=_d(se.type,se.key,se.props,null,ee.mode,ye),Iu(J,se),J.return=ee,J)}function ie(ee,J,se,ye){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=gm(se,ee.mode,ye),J.return=ee,J):(J=b(J,se.children||[]),J.return=ee,J)}function be(ee,J,se,ye,et){return J===null||J.tag!==7?(J=xl(se,ee.mode,ye,et),J.return=ee,J):(J=b(J,se),J.return=ee,J)}function Ee(ee,J,se){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=pm(""+J,ee.mode,se),J.return=ee,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case E:return se=_d(J.type,J.key,J.props,null,ee.mode,se),Iu(se,J),se.return=ee,se;case v:return J=gm(J,ee.mode,se),J.return=ee,J;case q:return J=vl(J),Ee(ee,J,se)}if(ne(J)||F(J))return J=xl(J,ee.mode,se,null),J.return=ee,J;if(typeof J.then=="function")return Ee(ee,Nd(J),se);if(J.$$typeof===R)return Ee(ee,kd(ee,J),se);Ad(ee,J)}return null}function ue(ee,J,se,ye){var et=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return et!==null?null:L(ee,J,""+se,ye);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case E:return se.key===et?W(ee,J,se,ye):null;case v:return se.key===et?ie(ee,J,se,ye):null;case q:return se=vl(se),ue(ee,J,se,ye)}if(ne(se)||F(se))return et!==null?null:be(ee,J,se,ye,null);if(typeof se.then=="function")return ue(ee,J,Nd(se),ye);if(se.$$typeof===R)return ue(ee,J,kd(ee,se),ye);Ad(ee,se)}return null}function he(ee,J,se,ye,et){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ee=ee.get(se)||null,L(J,ee,""+ye,et);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case E:return ee=ee.get(ye.key===null?se:ye.key)||null,W(J,ee,ye,et);case v:return ee=ee.get(ye.key===null?se:ye.key)||null,ie(J,ee,ye,et);case q:return ye=vl(ye),he(ee,J,se,ye,et)}if(ne(ye)||F(ye))return ee=ee.get(se)||null,be(J,ee,ye,et,null);if(typeof ye.then=="function")return he(ee,J,se,Nd(ye),et);if(ye.$$typeof===R)return he(ee,J,se,kd(J,ye),et);Ad(J,ye)}return null}function ze(ee,J,se,ye){for(var et=null,qt=null,We=J,kt=J=0,Bt=null;We!==null&&kt<se.length;kt++){We.index>kt?(Bt=We,We=null):Bt=We.sibling;var Yt=ue(ee,We,se[kt],ye);if(Yt===null){We===null&&(We=Bt);break}a&&We&&Yt.alternate===null&&s(ee,We),J=x(Yt,J,kt),qt===null?et=Yt:qt.sibling=Yt,qt=Yt,We=Bt}if(kt===se.length)return u(ee,We),Ht&&js(ee,kt),et;if(We===null){for(;kt<se.length;kt++)We=Ee(ee,se[kt],ye),We!==null&&(J=x(We,J,kt),qt===null?et=We:qt.sibling=We,qt=We);return Ht&&js(ee,kt),et}for(We=h(We);kt<se.length;kt++)Bt=he(We,ee,kt,se[kt],ye),Bt!==null&&(a&&Bt.alternate!==null&&We.delete(Bt.key===null?kt:Bt.key),J=x(Bt,J,kt),qt===null?et=Bt:qt.sibling=Bt,qt=Bt);return a&&We.forEach(function(Pi){return s(ee,Pi)}),Ht&&js(ee,kt),et}function lt(ee,J,se,ye){if(se==null)throw Error(r(151));for(var et=null,qt=null,We=J,kt=J=0,Bt=null,Yt=se.next();We!==null&&!Yt.done;kt++,Yt=se.next()){We.index>kt?(Bt=We,We=null):Bt=We.sibling;var Pi=ue(ee,We,Yt.value,ye);if(Pi===null){We===null&&(We=Bt);break}a&&We&&Pi.alternate===null&&s(ee,We),J=x(Pi,J,kt),qt===null?et=Pi:qt.sibling=Pi,qt=Pi,We=Bt}if(Yt.done)return u(ee,We),Ht&&js(ee,kt),et;if(We===null){for(;!Yt.done;kt++,Yt=se.next())Yt=Ee(ee,Yt.value,ye),Yt!==null&&(J=x(Yt,J,kt),qt===null?et=Yt:qt.sibling=Yt,qt=Yt);return Ht&&js(ee,kt),et}for(We=h(We);!Yt.done;kt++,Yt=se.next())Yt=he(We,ee,kt,Yt.value,ye),Yt!==null&&(a&&Yt.alternate!==null&&We.delete(Yt.key===null?kt:Yt.key),J=x(Yt,J,kt),qt===null?et=Yt:qt.sibling=Yt,qt=Yt);return a&&We.forEach(function(sA){return s(ee,sA)}),Ht&&js(ee,kt),et}function dn(ee,J,se,ye){if(typeof se=="object"&&se!==null&&se.type===w&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case E:e:{for(var et=se.key;J!==null;){if(J.key===et){if(et=se.type,et===w){if(J.tag===7){u(ee,J.sibling),ye=b(J,se.props.children),ye.return=ee,ee=ye;break e}}else if(J.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===q&&vl(et)===J.type){u(ee,J.sibling),ye=b(J,se.props),Iu(ye,se),ye.return=ee,ee=ye;break e}u(ee,J);break}else s(ee,J);J=J.sibling}se.type===w?(ye=xl(se.props.children,ee.mode,ye,se.key),ye.return=ee,ee=ye):(ye=_d(se.type,se.key,se.props,null,ee.mode,ye),Iu(ye,se),ye.return=ee,ee=ye)}return k(ee);case v:e:{for(et=se.key;J!==null;){if(J.key===et)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){u(ee,J.sibling),ye=b(J,se.children||[]),ye.return=ee,ee=ye;break e}else{u(ee,J);break}else s(ee,J);J=J.sibling}ye=gm(se,ee.mode,ye),ye.return=ee,ee=ye}return k(ee);case q:return se=vl(se),dn(ee,J,se,ye)}if(ne(se))return ze(ee,J,se,ye);if(F(se)){if(et=F(se),typeof et!="function")throw Error(r(150));return se=et.call(se),lt(ee,J,se,ye)}if(typeof se.then=="function")return dn(ee,J,Nd(se),ye);if(se.$$typeof===R)return dn(ee,J,kd(ee,se),ye);Ad(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,J!==null&&J.tag===6?(u(ee,J.sibling),ye=b(J,se),ye.return=ee,ee=ye):(u(ee,J),ye=pm(se,ee.mode,ye),ye.return=ee,ee=ye),k(ee)):u(ee,J)}return function(ee,J,se,ye){try{Lu=0;var et=dn(ee,J,se,ye);return Eo=null,et}catch(We){if(We===yo||We===Cd)throw We;var qt=na(29,We,null,ee.mode);return qt.lanes=ye,qt.return=ee,qt}finally{}}}var wl=ax(!0),sx=ax(!1),Ei=!1;function Nm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Am(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function _i(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Ti(a,s,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Xt&2)!==0){var b=h.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),h.pending=s,s=Ed(a),Fb(a,null,u),s}return yd(a,h,s,u),Ed(a)}function Ou(a,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var h=s.lanes;h&=a.pendingLanes,u|=h,s.lanes=u,nl(a,u)}}function Rm(a,s){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var b=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var k={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?b=x=k:x=x.next=k,u=u.next}while(u!==null);x===null?b=x=s:x=x.next=s}else b=x=s;u={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=s:a.next=s,u.lastBaseUpdate=s}var Lm=!1;function Du(){if(Lm){var a=xo;if(a!==null)throw a}}function ju(a,s,u,h){Lm=!1;var b=a.updateQueue;Ei=!1;var x=b.firstBaseUpdate,k=b.lastBaseUpdate,L=b.shared.pending;if(L!==null){b.shared.pending=null;var W=L,ie=W.next;W.next=null,k===null?x=ie:k.next=ie,k=W;var be=a.alternate;be!==null&&(be=be.updateQueue,L=be.lastBaseUpdate,L!==k&&(L===null?be.firstBaseUpdate=ie:L.next=ie,be.lastBaseUpdate=W))}if(x!==null){var Ee=b.baseState;k=0,be=ie=W=null,L=x;do{var ue=L.lane&-536870913,he=ue!==L.lane;if(he?(Pt&ue)===ue:(h&ue)===ue){ue!==0&&ue===bo&&(Lm=!0),be!==null&&(be=be.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var ze=a,lt=L;ue=s;var dn=u;switch(lt.tag){case 1:if(ze=lt.payload,typeof ze=="function"){Ee=ze.call(dn,Ee,ue);break e}Ee=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=lt.payload,ue=typeof ze=="function"?ze.call(dn,Ee,ue):ze,ue==null)break e;Ee=g({},Ee,ue);break e;case 2:Ei=!0}}ue=L.callback,ue!==null&&(a.flags|=64,he&&(a.flags|=8192),he=b.callbacks,he===null?b.callbacks=[ue]:he.push(ue))}else he={lane:ue,tag:L.tag,payload:L.payload,callback:L.callback,next:null},be===null?(ie=be=he,W=Ee):be=be.next=he,k|=ue;if(L=L.next,L===null){if(L=b.shared.pending,L===null)break;he=L,L=he.next,he.next=null,b.lastBaseUpdate=he,b.shared.pending=null}}while(!0);be===null&&(W=Ee),b.baseState=W,b.firstBaseUpdate=ie,b.lastBaseUpdate=be,x===null&&(b.shared.lanes=0),Si|=k,a.lanes=k,a.memoizedState=Ee}}function ix(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function lx(a,s){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)ix(u[a],s)}var _o=H(null),Rd=H(0);function ox(a,s){a=qs,O(Rd,a),O(_o,s),qs=a|s.baseLanes}function Im(){O(Rd,qs),O(_o,_o.current)}function Om(){qs=Rd.current,te(_o),te(Rd)}var ra=H(null),ka=null;function vi(a){var s=a.alternate;O(zn,zn.current&1),O(ra,a),ka===null&&(s===null||_o.current!==null||s.memoizedState!==null)&&(ka=a)}function Dm(a){O(zn,zn.current),O(ra,a),ka===null&&(ka=a)}function ux(a){a.tag===22?(O(zn,zn.current),O(ra,a),ka===null&&(ka=a)):ki()}function ki(){O(zn,zn.current),O(ra,ra.current)}function aa(a){te(ra),ka===a&&(ka=null),te(zn)}var zn=H(0);function Ld(a){for(var s=a;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Hp(u)||zp(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Bs=0,Tt=null,un=null,Yn=null,Id=!1,To=!1,Cl=!1,Od=0,Mu=0,vo=null,QS=0;function Mn(){throw Error(r(321))}function jm(a,s){if(s===null)return!1;for(var u=0;u<s.length&&u<a.length;u++)if(!ta(a[u],s[u]))return!1;return!0}function Mm(a,s,u,h,b,x){return Bs=x,Tt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,$.H=a===null||a.memoizedState===null?qx:Km,Cl=!1,x=u(h,b),Cl=!1,To&&(x=dx(s,u,h,b)),cx(a),x}function cx(a){$.H=Uu;var s=un!==null&&un.next!==null;if(Bs=0,Yn=un=Tt=null,Id=!1,Mu=0,vo=null,s)throw Error(r(300));a===null||Wn||(a=a.dependencies,a!==null&&vd(a)&&(Wn=!0))}function dx(a,s,u,h){Tt=a;var b=0;do{if(To&&(vo=null),Mu=0,To=!1,25<=b)throw Error(r(301));if(b+=1,Yn=un=null,a.updateQueue!=null){var x=a.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}$.H=Yx,x=s(u,h)}while(To);return x}function XS(){var a=$.H,s=a.useState()[0];return s=typeof s.then=="function"?Pu(s):s,a=a.useState()[0],(un!==null?un.memoizedState:null)!==a&&(Tt.flags|=1024),s}function Pm(){var a=Od!==0;return Od=0,a}function Bm(a,s,u){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~u}function Um(a){if(Id){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}Id=!1}Bs=0,Yn=un=Tt=null,To=!1,Mu=Od=0,vo=null}function Or(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?Tt.memoizedState=Yn=a:Yn=Yn.next=a,Yn}function Fn(){if(un===null){var a=Tt.alternate;a=a!==null?a.memoizedState:null}else a=un.next;var s=Yn===null?Tt.memoizedState:Yn.next;if(s!==null)Yn=s,un=a;else{if(a===null)throw Tt.alternate===null?Error(r(467)):Error(r(310));un=a,a={memoizedState:un.memoizedState,baseState:un.baseState,baseQueue:un.baseQueue,queue:un.queue,next:null},Yn===null?Tt.memoizedState=Yn=a:Yn=Yn.next=a}return Yn}function Dd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Pu(a){var s=Mu;return Mu+=1,vo===null&&(vo=[]),a=tx(vo,a,s),s=Tt,(Yn===null?s.memoizedState:Yn.next)===null&&(s=s.alternate,$.H=s===null||s.memoizedState===null?qx:Km),a}function jd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Pu(a);if(a.$$typeof===R)return yr(a)}throw Error(r(438,String(a)))}function Hm(a){var s=null,u=Tt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var h=Tt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Dd(),Tt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(a),h=0;h<a;h++)u[h]=X;return s.index++,u}function Us(a,s){return typeof s=="function"?s(a):s}function Md(a){var s=Fn();return zm(s,un,a)}function zm(a,s,u){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var b=a.baseQueue,x=h.pending;if(x!==null){if(b!==null){var k=b.next;b.next=x.next,x.next=k}s.baseQueue=b=x,h.pending=null}if(x=a.baseState,b===null)a.memoizedState=x;else{s=b.next;var L=k=null,W=null,ie=s,be=!1;do{var Ee=ie.lane&-536870913;if(Ee!==ie.lane?(Pt&Ee)===Ee:(Bs&Ee)===Ee){var ue=ie.revertLane;if(ue===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),Ee===bo&&(be=!0);else if((Bs&ue)===ue){ie=ie.next,ue===bo&&(be=!0);continue}else Ee={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},W===null?(L=W=Ee,k=x):W=W.next=Ee,Tt.lanes|=ue,Si|=ue;Ee=ie.action,Cl&&u(x,Ee),x=ie.hasEagerState?ie.eagerState:u(x,Ee)}else ue={lane:Ee,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},W===null?(L=W=ue,k=x):W=W.next=ue,Tt.lanes|=Ee,Si|=Ee;ie=ie.next}while(ie!==null&&ie!==s);if(W===null?k=x:W.next=L,!ta(x,a.memoizedState)&&(Wn=!0,be&&(u=xo,u!==null)))throw u;a.memoizedState=x,a.baseState=k,a.baseQueue=W,h.lastRenderedState=x}return b===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function Fm(a){var s=Fn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var h=u.dispatch,b=u.pending,x=s.memoizedState;if(b!==null){u.pending=null;var k=b=b.next;do x=a(x,k.action),k=k.next;while(k!==b);ta(x,s.memoizedState)||(Wn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,h]}function fx(a,s,u){var h=Tt,b=Fn(),x=Ht;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var k=!ta((un||b).memoizedState,u);if(k&&(b.memoizedState=u,Wn=!0),b=b.queue,Gm(px.bind(null,h,b,a),[a]),b.getSnapshot!==s||k||Yn!==null&&Yn.memoizedState.tag&1){if(h.flags|=2048,ko(9,{destroy:void 0},mx.bind(null,h,b,u,s),null),pn===null)throw Error(r(349));x||(Bs&127)!==0||hx(h,s,u)}return u}function hx(a,s,u){a.flags|=16384,a={getSnapshot:s,value:u},s=Tt.updateQueue,s===null?(s=Dd(),Tt.updateQueue=s,s.stores=[a]):(u=s.stores,u===null?s.stores=[a]:u.push(a))}function mx(a,s,u,h){s.value=u,s.getSnapshot=h,gx(s)&&bx(a)}function px(a,s,u){return u(function(){gx(s)&&bx(a)})}function gx(a){var s=a.getSnapshot;a=a.value;try{var u=s();return!ta(a,u)}catch{return!0}}function bx(a){var s=bl(a,2);s!==null&&Gr(s,a,2)}function $m(a){var s=Or();if(typeof a=="function"){var u=a;if(a=u(),Cl){Je(!0);try{u()}finally{Je(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:a},s}function xx(a,s,u,h){return a.baseState=u,zm(a,un,typeof h=="function"?h:Us)}function KS(a,s,u,h,b){if(Ud(a))throw Error(r(485));if(a=s.action,a!==null){var x={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};$.T!==null?u(!0):x.isTransition=!1,h(x),u=s.pending,u===null?(x.next=s.pending=x,yx(s,x)):(x.next=u.next,s.pending=u.next=x)}}function yx(a,s){var u=s.action,h=s.payload,b=a.state;if(s.isTransition){var x=$.T,k={};$.T=k;try{var L=u(b,h),W=$.S;W!==null&&W(k,L),Ex(a,s,L)}catch(ie){Vm(a,s,ie)}finally{x!==null&&k.types!==null&&(x.types=k.types),$.T=x}}else try{x=u(b,h),Ex(a,s,x)}catch(ie){Vm(a,s,ie)}}function Ex(a,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){_x(a,s,h)},function(h){return Vm(a,s,h)}):_x(a,s,u)}function _x(a,s,u){s.status="fulfilled",s.value=u,Tx(s),a.state=u,s=a.pending,s!==null&&(u=s.next,u===s?a.pending=null:(u=u.next,s.next=u,yx(a,u)))}function Vm(a,s,u){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=u,Tx(s),s=s.next;while(s!==h)}a.action=null}function Tx(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function vx(a,s){return s}function kx(a,s){if(Ht){var u=pn.formState;if(u!==null){e:{var h=Tt;if(Ht){if(kn){t:{for(var b=kn,x=va;b.nodeType!==8;){if(!x){b=null;break t}if(b=wa(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){kn=wa(b.nextSibling),h=b.data==="F!";break e}}xi(h)}h=!1}h&&(s=u[0])}}return u=Or(),u.memoizedState=u.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vx,lastRenderedState:s},u.queue=h,u=$x.bind(null,Tt,h),h.dispatch=u,h=$m(!1),x=Xm.bind(null,Tt,!1,h.queue),h=Or(),b={state:s,dispatch:null,action:a,pending:null},h.queue=b,u=KS.bind(null,Tt,b,x,u),b.dispatch=u,h.memoizedState=a,[s,u,!1]}function wx(a){var s=Fn();return Cx(s,un,a)}function Cx(a,s,u){if(s=zm(a,s,vx)[0],a=Md(Us)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=Pu(s)}catch(k){throw k===yo?Cd:k}else h=s;s=Fn();var b=s.queue,x=b.dispatch;return u!==s.memoizedState&&(Tt.flags|=2048,ko(9,{destroy:void 0},ZS.bind(null,b,u),null)),[h,x,a]}function ZS(a,s){a.action=s}function Sx(a){var s=Fn(),u=un;if(u!==null)return Cx(s,u,a);Fn(),s=s.memoizedState,u=Fn();var h=u.queue.dispatch;return u.memoizedState=a,[s,h,!1]}function ko(a,s,u,h){return a={tag:a,create:u,deps:h,inst:s,next:null},s=Tt.updateQueue,s===null&&(s=Dd(),Tt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=a.next=a:(h=u.next,u.next=a,a.next=h,s.lastEffect=a),a}function Nx(){return Fn().memoizedState}function Pd(a,s,u,h){var b=Or();Tt.flags|=a,b.memoizedState=ko(1|s,{destroy:void 0},u,h===void 0?null:h)}function Bd(a,s,u,h){var b=Fn();h=h===void 0?null:h;var x=b.memoizedState.inst;un!==null&&h!==null&&jm(h,un.memoizedState.deps)?b.memoizedState=ko(s,x,u,h):(Tt.flags|=a,b.memoizedState=ko(1|s,x,u,h))}function Ax(a,s){Pd(8390656,8,a,s)}function Gm(a,s){Bd(2048,8,a,s)}function JS(a){Tt.flags|=4;var s=Tt.updateQueue;if(s===null)s=Dd(),Tt.updateQueue=s,s.events=[a];else{var u=s.events;u===null?s.events=[a]:u.push(a)}}function Rx(a){var s=Fn().memoizedState;return JS({ref:s,nextImpl:a}),function(){if((Xt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Lx(a,s){return Bd(4,2,a,s)}function Ix(a,s){return Bd(4,4,a,s)}function Ox(a,s){if(typeof s=="function"){a=a();var u=s(a);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function Dx(a,s,u){u=u!=null?u.concat([a]):null,Bd(4,4,Ox.bind(null,s,a),u)}function qm(){}function jx(a,s){var u=Fn();s=s===void 0?null:s;var h=u.memoizedState;return s!==null&&jm(s,h[1])?h[0]:(u.memoizedState=[a,s],a)}function Mx(a,s){var u=Fn();s=s===void 0?null:s;var h=u.memoizedState;if(s!==null&&jm(s,h[1]))return h[0];if(h=a(),Cl){Je(!0);try{a()}finally{Je(!1)}}return u.memoizedState=[h,s],h}function Ym(a,s,u){return u===void 0||(Bs&1073741824)!==0&&(Pt&261930)===0?a.memoizedState=s:(a.memoizedState=u,a=Py(),Tt.lanes|=a,Si|=a,u)}function Px(a,s,u,h){return ta(u,s)?u:_o.current!==null?(a=Ym(a,u,h),ta(a,s)||(Wn=!0),a):(Bs&42)===0||(Bs&1073741824)!==0&&(Pt&261930)===0?(Wn=!0,a.memoizedState=u):(a=Py(),Tt.lanes|=a,Si|=a,s)}function Bx(a,s,u,h,b){var x=z.p;z.p=x!==0&&8>x?x:8;var k=$.T,L={};$.T=L,Xm(a,!1,s,u);try{var W=b(),ie=$.S;if(ie!==null&&ie(L,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var be=WS(W,h);Bu(a,s,be,la(a))}else Bu(a,s,h,la(a))}catch(Ee){Bu(a,s,{then:function(){},status:"rejected",reason:Ee},la())}finally{z.p=x,k!==null&&L.types!==null&&(k.types=L.types),$.T=k}}function eN(){}function Wm(a,s,u,h){if(a.tag!==5)throw Error(r(476));var b=Ux(a).queue;Bx(a,b,s,Z,u===null?eN:function(){return Hx(a),u(h)})}function Ux(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:Z},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:u},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function Hx(a){var s=Ux(a);s.next===null&&(s=a.alternate.memoizedState),Bu(a,s.next.queue,{},la())}function Qm(){return yr(tc)}function zx(){return Fn().memoizedState}function Fx(){return Fn().memoizedState}function tN(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var u=la();a=_i(u);var h=Ti(s,a,u);h!==null&&(Gr(h,s,u),Ou(h,s,u)),s={cache:km()},a.payload=s;return}s=s.return}}function nN(a,s,u){var h=la();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ud(a)?Vx(s,u):(u=hm(a,s,u,h),u!==null&&(Gr(u,a,h),Gx(u,s,h)))}function $x(a,s,u){var h=la();Bu(a,s,u,h)}function Bu(a,s,u,h){var b={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Ud(a))Vx(s,b);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var k=s.lastRenderedState,L=x(k,u);if(b.hasEagerState=!0,b.eagerState=L,ta(L,k))return yd(a,s,b,0),pn===null&&xd(),!1}catch{}finally{}if(u=hm(a,s,b,h),u!==null)return Gr(u,a,h),Gx(u,s,h),!0}return!1}function Xm(a,s,u,h){if(h={lane:2,revertLane:Np(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Ud(a)){if(s)throw Error(r(479))}else s=hm(a,u,h,2),s!==null&&Gr(s,a,2)}function Ud(a){var s=a.alternate;return a===Tt||s!==null&&s===Tt}function Vx(a,s){To=Id=!0;var u=a.pending;u===null?s.next=s:(s.next=u.next,u.next=s),a.pending=s}function Gx(a,s,u){if((u&4194048)!==0){var h=s.lanes;h&=a.pendingLanes,u|=h,s.lanes=u,nl(a,u)}}var Uu={readContext:yr,use:jd,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useLayoutEffect:Mn,useInsertionEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useSyncExternalStore:Mn,useId:Mn,useHostTransitionStatus:Mn,useFormState:Mn,useActionState:Mn,useOptimistic:Mn,useMemoCache:Mn,useCacheRefresh:Mn};Uu.useEffectEvent=Mn;var qx={readContext:yr,use:jd,useCallback:function(a,s){return Or().memoizedState=[a,s===void 0?null:s],a},useContext:yr,useEffect:Ax,useImperativeHandle:function(a,s,u){u=u!=null?u.concat([a]):null,Pd(4194308,4,Ox.bind(null,s,a),u)},useLayoutEffect:function(a,s){return Pd(4194308,4,a,s)},useInsertionEffect:function(a,s){Pd(4,2,a,s)},useMemo:function(a,s){var u=Or();s=s===void 0?null:s;var h=a();if(Cl){Je(!0);try{a()}finally{Je(!1)}}return u.memoizedState=[h,s],h},useReducer:function(a,s,u){var h=Or();if(u!==void 0){var b=u(s);if(Cl){Je(!0);try{u(s)}finally{Je(!1)}}}else b=s;return h.memoizedState=h.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},h.queue=a,a=a.dispatch=nN.bind(null,Tt,a),[h.memoizedState,a]},useRef:function(a){var s=Or();return a={current:a},s.memoizedState=a},useState:function(a){a=$m(a);var s=a.queue,u=$x.bind(null,Tt,s);return s.dispatch=u,[a.memoizedState,u]},useDebugValue:qm,useDeferredValue:function(a,s){var u=Or();return Ym(u,a,s)},useTransition:function(){var a=$m(!1);return a=Bx.bind(null,Tt,a.queue,!0,!1),Or().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,u){var h=Tt,b=Or();if(Ht){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),pn===null)throw Error(r(349));(Pt&127)!==0||hx(h,s,u)}b.memoizedState=u;var x={value:u,getSnapshot:s};return b.queue=x,Ax(px.bind(null,h,x,a),[a]),h.flags|=2048,ko(9,{destroy:void 0},mx.bind(null,h,x,u,s),null),u},useId:function(){var a=Or(),s=pn.identifierPrefix;if(Ht){var u=os,h=ls;u=(h&~(1<<32-Be(h)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Od++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=QS++,s="_"+s+"r_"+u.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:Qm,useFormState:kx,useActionState:kx,useOptimistic:function(a){var s=Or();s.memoizedState=s.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Xm.bind(null,Tt,!0,u),u.dispatch=s,[a,s]},useMemoCache:Hm,useCacheRefresh:function(){return Or().memoizedState=tN.bind(null,Tt)},useEffectEvent:function(a){var s=Or(),u={impl:a};return s.memoizedState=u,function(){if((Xt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Km={readContext:yr,use:jd,useCallback:jx,useContext:yr,useEffect:Gm,useImperativeHandle:Dx,useInsertionEffect:Lx,useLayoutEffect:Ix,useMemo:Mx,useReducer:Md,useRef:Nx,useState:function(){return Md(Us)},useDebugValue:qm,useDeferredValue:function(a,s){var u=Fn();return Px(u,un.memoizedState,a,s)},useTransition:function(){var a=Md(Us)[0],s=Fn().memoizedState;return[typeof a=="boolean"?a:Pu(a),s]},useSyncExternalStore:fx,useId:zx,useHostTransitionStatus:Qm,useFormState:wx,useActionState:wx,useOptimistic:function(a,s){var u=Fn();return xx(u,un,a,s)},useMemoCache:Hm,useCacheRefresh:Fx};Km.useEffectEvent=Rx;var Yx={readContext:yr,use:jd,useCallback:jx,useContext:yr,useEffect:Gm,useImperativeHandle:Dx,useInsertionEffect:Lx,useLayoutEffect:Ix,useMemo:Mx,useReducer:Fm,useRef:Nx,useState:function(){return Fm(Us)},useDebugValue:qm,useDeferredValue:function(a,s){var u=Fn();return un===null?Ym(u,a,s):Px(u,un.memoizedState,a,s)},useTransition:function(){var a=Fm(Us)[0],s=Fn().memoizedState;return[typeof a=="boolean"?a:Pu(a),s]},useSyncExternalStore:fx,useId:zx,useHostTransitionStatus:Qm,useFormState:Sx,useActionState:Sx,useOptimistic:function(a,s){var u=Fn();return un!==null?xx(u,un,a,s):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Hm,useCacheRefresh:Fx};Yx.useEffectEvent=Rx;function Zm(a,s,u,h){s=a.memoizedState,u=u(h,s),u=u==null?s:g({},s,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var Jm={enqueueSetState:function(a,s,u){a=a._reactInternals;var h=la(),b=_i(h);b.payload=s,u!=null&&(b.callback=u),s=Ti(a,b,h),s!==null&&(Gr(s,a,h),Ou(s,a,h))},enqueueReplaceState:function(a,s,u){a=a._reactInternals;var h=la(),b=_i(h);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=Ti(a,b,h),s!==null&&(Gr(s,a,h),Ou(s,a,h))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var u=la(),h=_i(u);h.tag=2,s!=null&&(h.callback=s),s=Ti(a,h,u),s!==null&&(Gr(s,a,u),Ou(s,a,u))}};function Wx(a,s,u,h,b,x,k){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,x,k):s.prototype&&s.prototype.isPureReactComponent?!wu(u,h)||!wu(b,x):!0}function Qx(a,s,u,h){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==a&&Jm.enqueueReplaceState(s,s.state,null)}function Sl(a,s){var u=s;if("ref"in s){u={};for(var h in s)h!=="ref"&&(u[h]=s[h])}if(a=a.defaultProps){u===s&&(u=g({},u));for(var b in a)u[b]===void 0&&(u[b]=a[b])}return u}function Xx(a){bd(a)}function Kx(a){console.error(a)}function Zx(a){bd(a)}function Hd(a,s){try{var u=a.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function Jx(a,s,u){try{var h=a.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function ep(a,s,u){return u=_i(u),u.tag=3,u.payload={element:null},u.callback=function(){Hd(a,s)},u}function ey(a){return a=_i(a),a.tag=3,a}function ty(a,s,u,h){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var x=h.value;a.payload=function(){return b(x)},a.callback=function(){Jx(s,u,h)}}var k=u.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(a.callback=function(){Jx(s,u,h),typeof b!="function"&&(Ni===null?Ni=new Set([this]):Ni.add(this));var L=h.stack;this.componentDidCatch(h.value,{componentStack:L!==null?L:""})})}function rN(a,s,u,h,b){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=u.alternate,s!==null&&go(s,u,b,!0),u=ra.current,u!==null){switch(u.tag){case 31:case 13:return ka===null?Zd():u.alternate===null&&Pn===0&&(Pn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,h===Sd?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([h]):s.add(h),wp(a,h,b)),!1;case 22:return u.flags|=65536,h===Sd?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([h]):u.add(h)),wp(a,h,b)),!1}throw Error(r(435,u.tag))}return wp(a,h,b),Zd(),!1}if(Ht)return s=ra.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,h!==ym&&(a=Error(r(422),{cause:h}),Nu(Ea(a,u)))):(h!==ym&&(s=Error(r(423),{cause:h}),Nu(Ea(s,u))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,h=Ea(h,u),b=ep(a.stateNode,h,b),Rm(a,b),Pn!==4&&(Pn=2)),!1;var x=Error(r(520),{cause:h});if(x=Ea(x,u),Yu===null?Yu=[x]:Yu.push(x),Pn!==4&&(Pn=2),s===null)return!0;h=Ea(h,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,a=b&-b,u.lanes|=a,a=ep(u.stateNode,h,a),Rm(u,a),!1;case 1:if(s=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ni===null||!Ni.has(x))))return u.flags|=65536,b&=-b,u.lanes|=b,b=ey(b),ty(b,a,u,h),Rm(u,b),!1}u=u.return}while(u!==null);return!1}var tp=Error(r(461)),Wn=!1;function Er(a,s,u,h){s.child=a===null?sx(s,null,u,h):wl(s,a.child,u,h)}function ny(a,s,u,h,b){u=u.render;var x=s.ref;if("ref"in h){var k={};for(var L in h)L!=="ref"&&(k[L]=h[L])}else k=h;return _l(s),h=Mm(a,s,u,k,x,b),L=Pm(),a!==null&&!Wn?(Bm(a,s,b),Hs(a,s,b)):(Ht&&L&&bm(s),s.flags|=1,Er(a,s,h,b),s.child)}function ry(a,s,u,h,b){if(a===null){var x=u.type;return typeof x=="function"&&!mm(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,ay(a,s,x,h,b)):(a=_d(u.type,null,h,s,s.mode,b),a.ref=s.ref,a.return=s,s.child=a)}if(x=a.child,!up(a,b)){var k=x.memoizedProps;if(u=u.compare,u=u!==null?u:wu,u(k,h)&&a.ref===s.ref)return Hs(a,s,b)}return s.flags|=1,a=Ds(x,h),a.ref=s.ref,a.return=s,s.child=a}function ay(a,s,u,h,b){if(a!==null){var x=a.memoizedProps;if(wu(x,h)&&a.ref===s.ref)if(Wn=!1,s.pendingProps=h=x,up(a,b))(a.flags&131072)!==0&&(Wn=!0);else return s.lanes=a.lanes,Hs(a,s,b)}return np(a,s,u,h,b)}function sy(a,s,u,h){var b=h.children,x=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,a!==null){for(h=s.child=a.child,b=0;h!==null;)b=b|h.lanes|h.childLanes,h=h.sibling;h=b&~x}else h=0,s.child=null;return iy(a,s,x,u,h)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&wd(s,x!==null?x.cachePool:null),x!==null?ox(s,x):Im(),ux(s);else return h=s.lanes=536870912,iy(a,s,x!==null?x.baseLanes|u:u,u,h)}else x!==null?(wd(s,x.cachePool),ox(s,x),ki(),s.memoizedState=null):(a!==null&&wd(s,null),Im(),ki());return Er(a,s,b,u),s.child}function Hu(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function iy(a,s,u,h,b){var x=Cm();return x=x===null?null:{parent:qn._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},a!==null&&wd(s,null),Im(),ux(s),a!==null&&go(a,s,h,!0),s.childLanes=b,null}function zd(a,s){return s=$d({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function ly(a,s,u){return wl(s,a.child,null,u),a=zd(s,s.pendingProps),a.flags|=2,aa(s),s.memoizedState=null,a}function aN(a,s,u){var h=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,a===null){if(Ht){if(h.mode==="hidden")return a=zd(s,h),s.lanes=536870912,Hu(null,a);if(Dm(s),(a=kn)?(a=yE(a,va),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:gi!==null?{id:ls,overflow:os}:null,retryLane:536870912,hydrationErrors:null},u=Vb(a),u.return=s,s.child=u,xr=s,kn=null)):a=null,a===null)throw xi(s);return s.lanes=536870912,null}return zd(s,h)}var x=a.memoizedState;if(x!==null){var k=x.dehydrated;if(Dm(s),b)if(s.flags&256)s.flags&=-257,s=ly(a,s,u);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(r(558));else if(Wn||go(a,s,u,!1),b=(u&a.childLanes)!==0,Wn||b){if(h=pn,h!==null&&(k=li(h,u),k!==0&&k!==x.retryLane))throw x.retryLane=k,bl(a,k),Gr(h,a,k),tp;Zd(),s=ly(a,s,u)}else a=x.treeContext,kn=wa(k.nextSibling),xr=s,Ht=!0,bi=null,va=!1,a!==null&&Yb(s,a),s=zd(s,h),s.flags|=4096;return s}return a=Ds(a.child,{mode:h.mode,children:h.children}),a.ref=s.ref,s.child=a,a.return=s,a}function Fd(a,s){var u=s.ref;if(u===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(s.flags|=4194816)}}function np(a,s,u,h,b){return _l(s),u=Mm(a,s,u,h,void 0,b),h=Pm(),a!==null&&!Wn?(Bm(a,s,b),Hs(a,s,b)):(Ht&&h&&bm(s),s.flags|=1,Er(a,s,u,b),s.child)}function oy(a,s,u,h,b,x){return _l(s),s.updateQueue=null,u=dx(s,h,u,b),cx(a),h=Pm(),a!==null&&!Wn?(Bm(a,s,x),Hs(a,s,x)):(Ht&&h&&bm(s),s.flags|=1,Er(a,s,u,x),s.child)}function uy(a,s,u,h,b){if(_l(s),s.stateNode===null){var x=fo,k=u.contextType;typeof k=="object"&&k!==null&&(x=yr(k)),x=new u(h,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Jm,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=h,x.state=s.memoizedState,x.refs={},Nm(s),k=u.contextType,x.context=typeof k=="object"&&k!==null?yr(k):fo,x.state=s.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(Zm(s,u,k,h),x.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&Jm.enqueueReplaceState(x,x.state,null),ju(s,h,x,b),Du(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(a===null){x=s.stateNode;var L=s.memoizedProps,W=Sl(u,L);x.props=W;var ie=x.context,be=u.contextType;k=fo,typeof be=="object"&&be!==null&&(k=yr(be));var Ee=u.getDerivedStateFromProps;be=typeof Ee=="function"||typeof x.getSnapshotBeforeUpdate=="function",L=s.pendingProps!==L,be||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(L||ie!==k)&&Qx(s,x,h,k),Ei=!1;var ue=s.memoizedState;x.state=ue,ju(s,h,x,b),Du(),ie=s.memoizedState,L||ue!==ie||Ei?(typeof Ee=="function"&&(Zm(s,u,Ee,h),ie=s.memoizedState),(W=Ei||Wx(s,u,W,h,ue,ie,k))?(be||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=ie),x.props=h,x.state=ie,x.context=k,h=W):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{x=s.stateNode,Am(a,s),k=s.memoizedProps,be=Sl(u,k),x.props=be,Ee=s.pendingProps,ue=x.context,ie=u.contextType,W=fo,typeof ie=="object"&&ie!==null&&(W=yr(ie)),L=u.getDerivedStateFromProps,(ie=typeof L=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==Ee||ue!==W)&&Qx(s,x,h,W),Ei=!1,ue=s.memoizedState,x.state=ue,ju(s,h,x,b),Du();var he=s.memoizedState;k!==Ee||ue!==he||Ei||a!==null&&a.dependencies!==null&&vd(a.dependencies)?(typeof L=="function"&&(Zm(s,u,L,h),he=s.memoizedState),(be=Ei||Wx(s,u,be,h,ue,he,W)||a!==null&&a.dependencies!==null&&vd(a.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,he,W),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,he,W)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===a.memoizedProps&&ue===a.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ue===a.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=he),x.props=h,x.state=he,x.context=W,h=be):(typeof x.componentDidUpdate!="function"||k===a.memoizedProps&&ue===a.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ue===a.memoizedState||(s.flags|=1024),h=!1)}return x=h,Fd(a,s),h=(s.flags&128)!==0,x||h?(x=s.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,a!==null&&h?(s.child=wl(s,a.child,null,b),s.child=wl(s,null,u,b)):Er(a,s,u,b),s.memoizedState=x.state,a=s.child):a=Hs(a,s,b),a}function cy(a,s,u,h){return yl(),s.flags|=256,Er(a,s,u,h),s.child}var rp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ap(a){return{baseLanes:a,cachePool:Jb()}}function sp(a,s,u){return a=a!==null?a.childLanes&~u:0,s&&(a|=ia),a}function dy(a,s,u){var h=s.pendingProps,b=!1,x=(s.flags&128)!==0,k;if((k=x)||(k=a!==null&&a.memoizedState===null?!1:(zn.current&2)!==0),k&&(b=!0,s.flags&=-129),k=(s.flags&32)!==0,s.flags&=-33,a===null){if(Ht){if(b?vi(s):ki(),(a=kn)?(a=yE(a,va),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:gi!==null?{id:ls,overflow:os}:null,retryLane:536870912,hydrationErrors:null},u=Vb(a),u.return=s,s.child=u,xr=s,kn=null)):a=null,a===null)throw xi(s);return zp(a)?s.lanes=32:s.lanes=536870912,null}var L=h.children;return h=h.fallback,b?(ki(),b=s.mode,L=$d({mode:"hidden",children:L},b),h=xl(h,b,u,null),L.return=s,h.return=s,L.sibling=h,s.child=L,h=s.child,h.memoizedState=ap(u),h.childLanes=sp(a,k,u),s.memoizedState=rp,Hu(null,h)):(vi(s),ip(s,L))}var W=a.memoizedState;if(W!==null&&(L=W.dehydrated,L!==null)){if(x)s.flags&256?(vi(s),s.flags&=-257,s=lp(a,s,u)):s.memoizedState!==null?(ki(),s.child=a.child,s.flags|=128,s=null):(ki(),L=h.fallback,b=s.mode,h=$d({mode:"visible",children:h.children},b),L=xl(L,b,u,null),L.flags|=2,h.return=s,L.return=s,h.sibling=L,s.child=h,wl(s,a.child,null,u),h=s.child,h.memoizedState=ap(u),h.childLanes=sp(a,k,u),s.memoizedState=rp,s=Hu(null,h));else if(vi(s),zp(L)){if(k=L.nextSibling&&L.nextSibling.dataset,k)var ie=k.dgst;k=ie,h=Error(r(419)),h.stack="",h.digest=k,Nu({value:h,source:null,stack:null}),s=lp(a,s,u)}else if(Wn||go(a,s,u,!1),k=(u&a.childLanes)!==0,Wn||k){if(k=pn,k!==null&&(h=li(k,u),h!==0&&h!==W.retryLane))throw W.retryLane=h,bl(a,h),Gr(k,a,h),tp;Hp(L)||Zd(),s=lp(a,s,u)}else Hp(L)?(s.flags|=192,s.child=a.child,s=null):(a=W.treeContext,kn=wa(L.nextSibling),xr=s,Ht=!0,bi=null,va=!1,a!==null&&Yb(s,a),s=ip(s,h.children),s.flags|=4096);return s}return b?(ki(),L=h.fallback,b=s.mode,W=a.child,ie=W.sibling,h=Ds(W,{mode:"hidden",children:h.children}),h.subtreeFlags=W.subtreeFlags&65011712,ie!==null?L=Ds(ie,L):(L=xl(L,b,u,null),L.flags|=2),L.return=s,h.return=s,h.sibling=L,s.child=h,Hu(null,h),h=s.child,L=a.child.memoizedState,L===null?L=ap(u):(b=L.cachePool,b!==null?(W=qn._currentValue,b=b.parent!==W?{parent:W,pool:W}:b):b=Jb(),L={baseLanes:L.baseLanes|u,cachePool:b}),h.memoizedState=L,h.childLanes=sp(a,k,u),s.memoizedState=rp,Hu(a.child,h)):(vi(s),u=a.child,a=u.sibling,u=Ds(u,{mode:"visible",children:h.children}),u.return=s,u.sibling=null,a!==null&&(k=s.deletions,k===null?(s.deletions=[a],s.flags|=16):k.push(a)),s.child=u,s.memoizedState=null,u)}function ip(a,s){return s=$d({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function $d(a,s){return a=na(22,a,null,s),a.lanes=0,a}function lp(a,s,u){return wl(s,a.child,null,u),a=ip(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function fy(a,s,u){a.lanes|=s;var h=a.alternate;h!==null&&(h.lanes|=s),Tm(a.return,s,u)}function op(a,s,u,h,b,x){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:b,treeForkCount:x}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=u,k.tailMode=b,k.treeForkCount=x)}function hy(a,s,u){var h=s.pendingProps,b=h.revealOrder,x=h.tail;h=h.children;var k=zn.current,L=(k&2)!==0;if(L?(k=k&1|2,s.flags|=128):k&=1,O(zn,k),Er(a,s,h,u),h=Ht?Su:0,!L&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&fy(a,u,s);else if(a.tag===19)fy(a,u,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(u=s.child,b=null;u!==null;)a=u.alternate,a!==null&&Ld(a)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),op(s,!1,b,u,x,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(a=b.alternate,a!==null&&Ld(a)===null){s.child=b;break}a=b.sibling,b.sibling=u,u=b,b=a}op(s,!0,u,null,x,h);break;case"together":op(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Hs(a,s,u){if(a!==null&&(s.dependencies=a.dependencies),Si|=s.lanes,(u&s.childLanes)===0)if(a!==null){if(go(a,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,u=Ds(a,a.pendingProps),s.child=u,u.return=s;a.sibling!==null;)a=a.sibling,u=u.sibling=Ds(a,a.pendingProps),u.return=s;u.sibling=null}return s.child}function up(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&vd(a)))}function sN(a,s,u){switch(s.tag){case 3:Ve(s,s.stateNode.containerInfo),yi(s,qn,a.memoizedState.cache),yl();break;case 27:case 5:tt(s);break;case 4:Ve(s,s.stateNode.containerInfo);break;case 10:yi(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Dm(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(vi(s),s.flags|=128,null):(u&s.child.childLanes)!==0?dy(a,s,u):(vi(s),a=Hs(a,s,u),a!==null?a.sibling:null);vi(s);break;case 19:var b=(a.flags&128)!==0;if(h=(u&s.childLanes)!==0,h||(go(a,s,u,!1),h=(u&s.childLanes)!==0),b){if(h)return hy(a,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),O(zn,zn.current),h)break;return null;case 22:return s.lanes=0,sy(a,s,u,s.pendingProps);case 24:yi(s,qn,a.memoizedState.cache)}return Hs(a,s,u)}function my(a,s,u){if(a!==null)if(a.memoizedProps!==s.pendingProps)Wn=!0;else{if(!up(a,u)&&(s.flags&128)===0)return Wn=!1,sN(a,s,u);Wn=(a.flags&131072)!==0}else Wn=!1,Ht&&(s.flags&1048576)!==0&&qb(s,Su,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(a=vl(s.elementType),s.type=a,typeof a=="function")mm(a)?(h=Sl(a,h),s.tag=1,s=uy(null,s,a,h,u)):(s.tag=0,s=np(null,s,a,h,u));else{if(a!=null){var b=a.$$typeof;if(b===M){s.tag=11,s=ny(null,s,a,h,u);break e}else if(b===P){s.tag=14,s=ry(null,s,a,h,u);break e}}throw s=me(a)||a,Error(r(306,s,""))}}return s;case 0:return np(a,s,s.type,s.pendingProps,u);case 1:return h=s.type,b=Sl(h,s.pendingProps),uy(a,s,h,b,u);case 3:e:{if(Ve(s,s.stateNode.containerInfo),a===null)throw Error(r(387));h=s.pendingProps;var x=s.memoizedState;b=x.element,Am(a,s),ju(s,h,null,u);var k=s.memoizedState;if(h=k.cache,yi(s,qn,h),h!==x.cache&&vm(s,[qn],u,!0),Du(),h=k.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:k.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=cy(a,s,h,u);break e}else if(h!==b){b=Ea(Error(r(424)),s),Nu(b),s=cy(a,s,h,u);break e}else{switch(a=s.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(kn=wa(a.firstChild),xr=s,Ht=!0,bi=null,va=!0,u=sx(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(yl(),h===b){s=Hs(a,s,u);break e}Er(a,s,h,u)}s=s.child}return s;case 26:return Fd(a,s),a===null?(u=wE(s.type,null,s.pendingProps,null))?s.memoizedState=u:Ht||(u=s.type,a=s.pendingProps,h=sf(Ne.current).createElement(u),h[hn]=s,h[Cn]=a,_r(h,u,a),Sn(h),s.stateNode=h):s.memoizedState=wE(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return tt(s),a===null&&Ht&&(h=s.stateNode=TE(s.type,s.pendingProps,Ne.current),xr=s,va=!0,b=kn,Ii(s.type)?(Fp=b,kn=wa(h.firstChild)):kn=b),Er(a,s,s.pendingProps.children,u),Fd(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&Ht&&((b=h=kn)&&(h=jN(h,s.type,s.pendingProps,va),h!==null?(s.stateNode=h,xr=s,kn=wa(h.firstChild),va=!1,b=!0):b=!1),b||xi(s)),tt(s),b=s.type,x=s.pendingProps,k=a!==null?a.memoizedProps:null,h=x.children,Pp(b,x)?h=null:k!==null&&Pp(b,k)&&(s.flags|=32),s.memoizedState!==null&&(b=Mm(a,s,XS,null,null,u),tc._currentValue=b),Fd(a,s),Er(a,s,h,u),s.child;case 6:return a===null&&Ht&&((a=u=kn)&&(u=MN(u,s.pendingProps,va),u!==null?(s.stateNode=u,xr=s,kn=null,a=!0):a=!1),a||xi(s)),null;case 13:return dy(a,s,u);case 4:return Ve(s,s.stateNode.containerInfo),h=s.pendingProps,a===null?s.child=wl(s,null,h,u):Er(a,s,h,u),s.child;case 11:return ny(a,s,s.type,s.pendingProps,u);case 7:return Er(a,s,s.pendingProps,u),s.child;case 8:return Er(a,s,s.pendingProps.children,u),s.child;case 12:return Er(a,s,s.pendingProps.children,u),s.child;case 10:return h=s.pendingProps,yi(s,s.type,h.value),Er(a,s,h.children,u),s.child;case 9:return b=s.type._context,h=s.pendingProps.children,_l(s),b=yr(b),h=h(b),s.flags|=1,Er(a,s,h,u),s.child;case 14:return ry(a,s,s.type,s.pendingProps,u);case 15:return ay(a,s,s.type,s.pendingProps,u);case 19:return hy(a,s,u);case 31:return aN(a,s,u);case 22:return sy(a,s,u,s.pendingProps);case 24:return _l(s),h=yr(qn),a===null?(b=Cm(),b===null&&(b=pn,x=km(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=u),b=x),s.memoizedState={parent:h,cache:b},Nm(s),yi(s,qn,b)):((a.lanes&u)!==0&&(Am(a,s),ju(s,null,null,u),Du()),b=a.memoizedState,x=s.memoizedState,b.parent!==h?(b={parent:h,cache:h},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),yi(s,qn,h)):(h=x.cache,yi(s,qn,h),h!==b.cache&&vm(s,[qn],u,!0))),Er(a,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function zs(a){a.flags|=4}function cp(a,s,u,h,b){if((s=(a.mode&32)!==0)&&(s=!1),s){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(zy())a.flags|=8192;else throw kl=Sd,Sm}else a.flags&=-16777217}function py(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!RE(s))if(zy())a.flags|=8192;else throw kl=Sd,Sm}function Vd(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?Kt():536870912,a.lanes|=s,No|=s)}function zu(a,s){if(!Ht)switch(a.tailMode){case"hidden":s=a.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function wn(a){var s=a.alternate!==null&&a.alternate.child===a.child,u=0,h=0;if(s)for(var b=a.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=h,a.childLanes=u,s}function iN(a,s,u){var h=s.pendingProps;switch(xm(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wn(s),null;case 1:return wn(s),null;case 3:return u=s.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ps(qn),je(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(po(s)?zs(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Em())),wn(s),null;case 26:var b=s.type,x=s.memoizedState;return a===null?(zs(s),x!==null?(wn(s),py(s,x)):(wn(s),cp(s,b,null,h,u))):x?x!==a.memoizedState?(zs(s),wn(s),py(s,x)):(wn(s),s.flags&=-16777217):(a=a.memoizedProps,a!==h&&zs(s),wn(s),cp(s,b,a,h,u)),null;case 27:if(ut(s),u=Ne.current,b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&zs(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return wn(s),null}a=ve.current,po(s)?Wb(s):(a=TE(b,h,u),s.stateNode=a,zs(s))}return wn(s),null;case 5:if(ut(s),b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&zs(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return wn(s),null}if(x=ve.current,po(s))Wb(s);else{var k=sf(Ne.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof h.is=="string"?k.createElement("select",{is:h.is}):k.createElement("select"),h.multiple?x.multiple=!0:h.size&&(x.size=h.size);break;default:x=typeof h.is=="string"?k.createElement(b,{is:h.is}):k.createElement(b)}}x[hn]=s,x[Cn]=h;e:for(k=s.child;k!==null;){if(k.tag===5||k.tag===6)x.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===s)break e;for(;k.sibling===null;){if(k.return===null||k.return===s)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}s.stateNode=x;e:switch(_r(x,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&zs(s)}}return wn(s),cp(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,u),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==h&&zs(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(a=Ne.current,po(s)){if(a=s.stateNode,u=s.memoizedProps,h=null,b=xr,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}a[hn]=s,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||dE(a.nodeValue,u)),a||xi(s,!0)}else a=sf(a).createTextNode(h),a[hn]=s,s.stateNode=a}return wn(s),null;case 31:if(u=s.memoizedState,a===null||a.memoizedState!==null){if(h=po(s),u!==null){if(a===null){if(!h)throw Error(r(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[hn]=s}else yl(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;wn(s),a=!1}else u=Em(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return s.flags&256?(aa(s),s):(aa(s),null);if((s.flags&128)!==0)throw Error(r(558))}return wn(s),null;case 13:if(h=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=po(s),h!==null&&h.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[hn]=s}else yl(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;wn(s),b=!1}else b=Em(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(aa(s),s):(aa(s),null)}return aa(s),(s.flags&128)!==0?(s.lanes=u,s):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=s.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==b&&(h.flags|=2048)),u!==a&&u&&(s.child.flags|=8192),Vd(s,s.updateQueue),wn(s),null);case 4:return je(),a===null&&Ip(s.stateNode.containerInfo),wn(s),null;case 10:return Ps(s.type),wn(s),null;case 19:if(te(zn),h=s.memoizedState,h===null)return wn(s),null;if(b=(s.flags&128)!==0,x=h.rendering,x===null)if(b)zu(h,!1);else{if(Pn!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(x=Ld(a),x!==null){for(s.flags|=128,zu(h,!1),a=x.updateQueue,s.updateQueue=a,Vd(s,a),s.subtreeFlags=0,a=u,u=s.child;u!==null;)$b(u,a),u=u.sibling;return O(zn,zn.current&1|2),Ht&&js(s,h.treeForkCount),s.child}a=a.sibling}h.tail!==null&&Ye()>Qd&&(s.flags|=128,b=!0,zu(h,!1),s.lanes=4194304)}else{if(!b)if(a=Ld(x),a!==null){if(s.flags|=128,b=!0,a=a.updateQueue,s.updateQueue=a,Vd(s,a),zu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!Ht)return wn(s),null}else 2*Ye()-h.renderingStartTime>Qd&&u!==536870912&&(s.flags|=128,b=!0,zu(h,!1),s.lanes=4194304);h.isBackwards?(x.sibling=s.child,s.child=x):(a=h.last,a!==null?a.sibling=x:s.child=x,h.last=x)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=Ye(),a.sibling=null,u=zn.current,O(zn,b?u&1|2:u&1),Ht&&js(s,h.treeForkCount),a):(wn(s),null);case 22:case 23:return aa(s),Om(),h=s.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(u&536870912)!==0&&(s.flags&128)===0&&(wn(s),s.subtreeFlags&6&&(s.flags|=8192)):wn(s),u=s.updateQueue,u!==null&&Vd(s,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==u&&(s.flags|=2048),a!==null&&te(Tl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Ps(qn),wn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function lN(a,s){switch(xm(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Ps(qn),je(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return ut(s),null;case 31:if(s.memoizedState!==null){if(aa(s),s.alternate===null)throw Error(r(340));yl()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(aa(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));yl()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return te(zn),null;case 4:return je(),null;case 10:return Ps(s.type),null;case 22:case 23:return aa(s),Om(),a!==null&&te(Tl),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return Ps(qn),null;case 25:return null;default:return null}}function gy(a,s){switch(xm(s),s.tag){case 3:Ps(qn),je();break;case 26:case 27:case 5:ut(s);break;case 4:je();break;case 31:s.memoizedState!==null&&aa(s);break;case 13:aa(s);break;case 19:te(zn);break;case 10:Ps(s.type);break;case 22:case 23:aa(s),Om(),a!==null&&te(Tl);break;case 24:Ps(qn)}}function Fu(a,s){try{var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var b=h.next;u=b;do{if((u.tag&a)===a){h=void 0;var x=u.create,k=u.inst;h=x(),k.destroy=h}u=u.next}while(u!==b)}}catch(L){sn(s,s.return,L)}}function wi(a,s,u){try{var h=s.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var x=b.next;h=x;do{if((h.tag&a)===a){var k=h.inst,L=k.destroy;if(L!==void 0){k.destroy=void 0,b=s;var W=u,ie=L;try{ie()}catch(be){sn(b,W,be)}}}h=h.next}while(h!==x)}}catch(be){sn(s,s.return,be)}}function by(a){var s=a.updateQueue;if(s!==null){var u=a.stateNode;try{lx(s,u)}catch(h){sn(a,a.return,h)}}}function xy(a,s,u){u.props=Sl(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){sn(a,s,h)}}function $u(a,s){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(b){sn(a,s,b)}}function us(a,s){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(b){sn(a,s,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){sn(a,s,b)}else u.current=null}function yy(a){var s=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(b){sn(a,a.return,b)}}function dp(a,s,u){try{var h=a.stateNode;AN(h,a.type,u,s),h[Cn]=s}catch(b){sn(a,a.return,b)}}function Ey(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ii(a.type)||a.tag===4}function fp(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Ey(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&&Ii(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 hp(a,s,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(a),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=vr));else if(h!==4&&(h===27&&Ii(a.type)&&(u=a.stateNode,s=null),a=a.child,a!==null))for(hp(a,s,u),a=a.sibling;a!==null;)hp(a,s,u),a=a.sibling}function Gd(a,s,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?u.insertBefore(a,s):u.appendChild(a);else if(h!==4&&(h===27&&Ii(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Gd(a,s,u),a=a.sibling;a!==null;)Gd(a,s,u),a=a.sibling}function _y(a){var s=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);_r(s,h,u),s[hn]=a,s[Cn]=u}catch(x){sn(a,a.return,x)}}var Fs=!1,Qn=!1,mp=!1,Ty=typeof WeakSet=="function"?WeakSet:Set,hr=null;function oN(a,s){if(a=a.containerInfo,jp=hf,a=Db(a),lm(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var b=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var k=0,L=-1,W=-1,ie=0,be=0,Ee=a,ue=null;t:for(;;){for(var he;Ee!==u||b!==0&&Ee.nodeType!==3||(L=k+b),Ee!==x||h!==0&&Ee.nodeType!==3||(W=k+h),Ee.nodeType===3&&(k+=Ee.nodeValue.length),(he=Ee.firstChild)!==null;)ue=Ee,Ee=he;for(;;){if(Ee===a)break t;if(ue===u&&++ie===b&&(L=k),ue===x&&++be===h&&(W=k),(he=Ee.nextSibling)!==null)break;Ee=ue,ue=Ee.parentNode}Ee=he}u=L===-1||W===-1?null:{start:L,end:W}}else u=null}u=u||{start:0,end:0}}else u=null;for(Mp={focusedElem:a,selectionRange:u},hf=!1,hr=s;hr!==null;)if(s=hr,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,hr=a;else for(;hr!==null;){switch(s=hr,x=s.alternate,a=s.flags,s.tag){case 0:if((a&4)!==0&&(a=s.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)b=a[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&x!==null){a=void 0,u=s,b=x.memoizedProps,x=x.memoizedState,h=u.stateNode;try{var ze=Sl(u.type,b);a=h.getSnapshotBeforeUpdate(ze,x),h.__reactInternalSnapshotBeforeUpdate=a}catch(lt){sn(u,u.return,lt)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,u=a.nodeType,u===9)Up(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Up(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=s.sibling,a!==null){a.return=s.return,hr=a;break}hr=s.return}}function vy(a,s,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Vs(a,u),h&4&&Fu(5,u);break;case 1:if(Vs(a,u),h&4)if(a=u.stateNode,s===null)try{a.componentDidMount()}catch(k){sn(u,u.return,k)}else{var b=Sl(u.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(b,s,a.__reactInternalSnapshotBeforeUpdate)}catch(k){sn(u,u.return,k)}}h&64&&by(u),h&512&&$u(u,u.return);break;case 3:if(Vs(a,u),h&64&&(a=u.updateQueue,a!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{lx(a,s)}catch(k){sn(u,u.return,k)}}break;case 27:s===null&&h&4&&_y(u);case 26:case 5:Vs(a,u),s===null&&h&4&&yy(u),h&512&&$u(u,u.return);break;case 12:Vs(a,u);break;case 31:Vs(a,u),h&4&&Cy(a,u);break;case 13:Vs(a,u),h&4&&Sy(a,u),h&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=bN.bind(null,u),PN(a,u))));break;case 22:if(h=u.memoizedState!==null||Fs,!h){s=s!==null&&s.memoizedState!==null||Qn,b=Fs;var x=Qn;Fs=h,(Qn=s)&&!x?Gs(a,u,(u.subtreeFlags&8772)!==0):Vs(a,u),Fs=b,Qn=x}break;case 30:break;default:Vs(a,u)}}function ky(a){var s=a.alternate;s!==null&&(a.alternate=null,ky(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&Zr(s)),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 Nn=null,zr=!1;function $s(a,s,u){for(u=u.child;u!==null;)wy(a,s,u),u=u.sibling}function wy(a,s,u){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(xe,u)}catch{}switch(u.tag){case 26:Qn||us(u,s),$s(a,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Qn||us(u,s);var h=Nn,b=zr;Ii(u.type)&&(Nn=u.stateNode,zr=!1),$s(a,s,u),Zu(u.stateNode),Nn=h,zr=b;break;case 5:Qn||us(u,s);case 6:if(h=Nn,b=zr,Nn=null,$s(a,s,u),Nn=h,zr=b,Nn!==null)if(zr)try{(Nn.nodeType===9?Nn.body:Nn.nodeName==="HTML"?Nn.ownerDocument.body:Nn).removeChild(u.stateNode)}catch(x){sn(u,s,x)}else try{Nn.removeChild(u.stateNode)}catch(x){sn(u,s,x)}break;case 18:Nn!==null&&(zr?(a=Nn,bE(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Mo(a)):bE(Nn,u.stateNode));break;case 4:h=Nn,b=zr,Nn=u.stateNode.containerInfo,zr=!0,$s(a,s,u),Nn=h,zr=b;break;case 0:case 11:case 14:case 15:wi(2,u,s),Qn||wi(4,u,s),$s(a,s,u);break;case 1:Qn||(us(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"&&xy(u,s,h)),$s(a,s,u);break;case 21:$s(a,s,u);break;case 22:Qn=(h=Qn)||u.memoizedState!==null,$s(a,s,u),Qn=h;break;default:$s(a,s,u)}}function Cy(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Mo(a)}catch(u){sn(s,s.return,u)}}}function Sy(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Mo(a)}catch(u){sn(s,s.return,u)}}function uN(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new Ty),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new Ty),s;default:throw Error(r(435,a.tag))}}function qd(a,s){var u=uN(a);s.forEach(function(h){if(!u.has(h)){u.add(h);var b=xN.bind(null,a,h);h.then(b,b)}})}function Fr(a,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var b=u[h],x=a,k=s,L=k;e:for(;L!==null;){switch(L.tag){case 27:if(Ii(L.type)){Nn=L.stateNode,zr=!1;break e}break;case 5:Nn=L.stateNode,zr=!1;break e;case 3:case 4:Nn=L.stateNode.containerInfo,zr=!0;break e}L=L.return}if(Nn===null)throw Error(r(160));wy(x,k,b),Nn=null,zr=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Ny(s,a),s=s.sibling}var Ga=null;function Ny(a,s){var u=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Fr(s,a),$r(a),h&4&&(wi(3,a,a.return),Fu(3,a),wi(5,a,a.return));break;case 1:Fr(s,a),$r(a),h&512&&(Qn||u===null||us(u,u.return)),h&64&&Fs&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var b=Ga;if(Fr(s,a),$r(a),h&512&&(Qn||u===null||us(u,u.return)),h&4){var x=u!==null?u.memoizedState:null;if(h=a.memoizedState,u===null)if(h===null)if(a.stateNode===null){e:{h=a.type,u=a.memoizedProps,b=b.ownerDocument||b;t:switch(h){case"title":x=b.getElementsByTagName("title")[0],(!x||x[ur]||x[hn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(h),b.head.insertBefore(x,b.querySelector("head > title"))),_r(x,h,u),x[hn]=a,Sn(x),h=x;break e;case"link":var k=NE("link","href",b).get(h+(u.href||""));if(k){for(var L=0;L<k.length;L++)if(x=k[L],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){k.splice(L,1);break t}}x=b.createElement(h),_r(x,h,u),b.head.appendChild(x);break;case"meta":if(k=NE("meta","content",b).get(h+(u.content||""))){for(L=0;L<k.length;L++)if(x=k[L],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){k.splice(L,1);break t}}x=b.createElement(h),_r(x,h,u),b.head.appendChild(x);break;default:throw Error(r(468,h))}x[hn]=a,Sn(x),h=x}a.stateNode=h}else AE(b,a.type,a.stateNode);else a.stateNode=SE(b,h,a.memoizedProps);else x!==h?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,h===null?AE(b,a.type,a.stateNode):SE(b,h,a.memoizedProps)):h===null&&a.stateNode!==null&&dp(a,a.memoizedProps,u.memoizedProps)}break;case 27:Fr(s,a),$r(a),h&512&&(Qn||u===null||us(u,u.return)),u!==null&&h&4&&dp(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Fr(s,a),$r(a),h&512&&(Qn||u===null||us(u,u.return)),a.flags&32){b=a.stateNode;try{cr(b,"")}catch(ze){sn(a,a.return,ze)}}h&4&&a.stateNode!=null&&(b=a.memoizedProps,dp(a,b,u!==null?u.memoizedProps:b)),h&1024&&(mp=!0);break;case 6:if(Fr(s,a),$r(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,u=a.stateNode;try{u.nodeValue=h}catch(ze){sn(a,a.return,ze)}}break;case 3:if(uf=null,b=Ga,Ga=lf(s.containerInfo),Fr(s,a),Ga=b,$r(a),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Mo(s.containerInfo)}catch(ze){sn(a,a.return,ze)}mp&&(mp=!1,Ay(a));break;case 4:h=Ga,Ga=lf(a.stateNode.containerInfo),Fr(s,a),$r(a),Ga=h;break;case 12:Fr(s,a),$r(a);break;case 31:Fr(s,a),$r(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,qd(a,h)));break;case 13:Fr(s,a),$r(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Wd=Ye()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,qd(a,h)));break;case 22:b=a.memoizedState!==null;var W=u!==null&&u.memoizedState!==null,ie=Fs,be=Qn;if(Fs=ie||b,Qn=be||W,Fr(s,a),Qn=be,Fs=ie,$r(a),h&8192)e:for(s=a.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||W||Fs||Qn||Nl(a)),u=null,s=a;;){if(s.tag===5||s.tag===26){if(u===null){W=u=s;try{if(x=W.stateNode,b)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{L=W.stateNode;var Ee=W.memoizedProps.style,ue=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;L.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(ze){sn(W,W.return,ze)}}}else if(s.tag===6){if(u===null){W=s;try{W.stateNode.nodeValue=b?"":W.memoizedProps}catch(ze){sn(W,W.return,ze)}}}else if(s.tag===18){if(u===null){W=s;try{var he=W.stateNode;b?xE(he,!0):xE(W.stateNode,!1)}catch(ze){sn(W,W.return,ze)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=a.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,qd(a,u))));break;case 19:Fr(s,a),$r(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,qd(a,h)));break;case 30:break;case 21:break;default:Fr(s,a),$r(a)}}function $r(a){var s=a.flags;if(s&2){try{for(var u,h=a.return;h!==null;){if(Ey(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,x=fp(a);Gd(a,x,b);break;case 5:var k=u.stateNode;u.flags&32&&(cr(k,""),u.flags&=-33);var L=fp(a);Gd(a,L,k);break;case 3:case 4:var W=u.stateNode.containerInfo,ie=fp(a);hp(a,ie,W);break;default:throw Error(r(161))}}catch(be){sn(a,a.return,be)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function Ay(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;Ay(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function Vs(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)vy(a,s.alternate,s),s=s.sibling}function Nl(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:wi(4,s,s.return),Nl(s);break;case 1:us(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&xy(s,s.return,u),Nl(s);break;case 27:Zu(s.stateNode);case 26:case 5:us(s,s.return),Nl(s);break;case 22:s.memoizedState===null&&Nl(s);break;case 30:Nl(s);break;default:Nl(s)}a=a.sibling}}function Gs(a,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,b=a,x=s,k=x.flags;switch(x.tag){case 0:case 11:case 15:Gs(b,x,u),Fu(4,x);break;case 1:if(Gs(b,x,u),h=x,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ie){sn(h,h.return,ie)}if(h=x,b=h.updateQueue,b!==null){var L=h.stateNode;try{var W=b.shared.hiddenCallbacks;if(W!==null)for(b.shared.hiddenCallbacks=null,b=0;b<W.length;b++)ix(W[b],L)}catch(ie){sn(h,h.return,ie)}}u&&k&64&&by(x),$u(x,x.return);break;case 27:_y(x);case 26:case 5:Gs(b,x,u),u&&h===null&&k&4&&yy(x),$u(x,x.return);break;case 12:Gs(b,x,u);break;case 31:Gs(b,x,u),u&&k&4&&Cy(b,x);break;case 13:Gs(b,x,u),u&&k&4&&Sy(b,x);break;case 22:x.memoizedState===null&&Gs(b,x,u),$u(x,x.return);break;case 30:break;default:Gs(b,x,u)}s=s.sibling}}function pp(a,s){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&Au(u))}function gp(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Au(a))}function qa(a,s,u,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Ry(a,s,u,h),s=s.sibling}function Ry(a,s,u,h){var b=s.flags;switch(s.tag){case 0:case 11:case 15:qa(a,s,u,h),b&2048&&Fu(9,s);break;case 1:qa(a,s,u,h);break;case 3:qa(a,s,u,h),b&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Au(a)));break;case 12:if(b&2048){qa(a,s,u,h),a=s.stateNode;try{var x=s.memoizedProps,k=x.id,L=x.onPostCommit;typeof L=="function"&&L(k,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){sn(s,s.return,W)}}else qa(a,s,u,h);break;case 31:qa(a,s,u,h);break;case 13:qa(a,s,u,h);break;case 23:break;case 22:x=s.stateNode,k=s.alternate,s.memoizedState!==null?x._visibility&2?qa(a,s,u,h):Vu(a,s):x._visibility&2?qa(a,s,u,h):(x._visibility|=2,wo(a,s,u,h,(s.subtreeFlags&10256)!==0||!1)),b&2048&&pp(k,s);break;case 24:qa(a,s,u,h),b&2048&&gp(s.alternate,s);break;default:qa(a,s,u,h)}}function wo(a,s,u,h,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=a,k=s,L=u,W=h,ie=k.flags;switch(k.tag){case 0:case 11:case 15:wo(x,k,L,W,b),Fu(8,k);break;case 23:break;case 22:var be=k.stateNode;k.memoizedState!==null?be._visibility&2?wo(x,k,L,W,b):Vu(x,k):(be._visibility|=2,wo(x,k,L,W,b)),b&&ie&2048&&pp(k.alternate,k);break;case 24:wo(x,k,L,W,b),b&&ie&2048&&gp(k.alternate,k);break;default:wo(x,k,L,W,b)}s=s.sibling}}function Vu(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=a,h=s,b=h.flags;switch(h.tag){case 22:Vu(u,h),b&2048&&pp(h.alternate,h);break;case 24:Vu(u,h),b&2048&&gp(h.alternate,h);break;default:Vu(u,h)}s=s.sibling}}var Gu=8192;function Co(a,s,u){if(a.subtreeFlags&Gu)for(a=a.child;a!==null;)Ly(a,s,u),a=a.sibling}function Ly(a,s,u){switch(a.tag){case 26:Co(a,s,u),a.flags&Gu&&a.memoizedState!==null&&QN(u,Ga,a.memoizedState,a.memoizedProps);break;case 5:Co(a,s,u);break;case 3:case 4:var h=Ga;Ga=lf(a.stateNode.containerInfo),Co(a,s,u),Ga=h;break;case 22:a.memoizedState===null&&(h=a.alternate,h!==null&&h.memoizedState!==null?(h=Gu,Gu=16777216,Co(a,s,u),Gu=h):Co(a,s,u));break;default:Co(a,s,u)}}function Iy(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function qu(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];hr=h,Dy(h,a)}Iy(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Oy(a),a=a.sibling}function Oy(a){switch(a.tag){case 0:case 11:case 15:qu(a),a.flags&2048&&wi(9,a,a.return);break;case 3:qu(a);break;case 12:qu(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,Yd(a)):qu(a);break;default:qu(a)}}function Yd(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];hr=h,Dy(h,a)}Iy(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:wi(8,s,s.return),Yd(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Yd(s));break;default:Yd(s)}a=a.sibling}}function Dy(a,s){for(;hr!==null;){var u=hr;switch(u.tag){case 0:case 11:case 15:wi(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Au(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,hr=h;else e:for(u=a;hr!==null;){h=hr;var b=h.sibling,x=h.return;if(ky(h),h===u){hr=null;break e}if(b!==null){b.return=x,hr=b;break e}hr=x}}}var cN={getCacheForType:function(a){var s=yr(qn),u=s.data.get(a);return u===void 0&&(u=a(),s.data.set(a,u)),u},cacheSignal:function(){return yr(qn).controller.signal}},dN=typeof WeakMap=="function"?WeakMap:Map,Xt=0,pn=null,Ot=null,Pt=0,an=0,sa=null,Ci=!1,So=!1,bp=!1,qs=0,Pn=0,Si=0,Al=0,xp=0,ia=0,No=0,Yu=null,Vr=null,yp=!1,Wd=0,jy=0,Qd=1/0,Xd=null,Ni=null,ar=0,Ai=null,Ao=null,Ys=0,Ep=0,_p=null,My=null,Wu=0,Tp=null;function la(){return(Xt&2)!==0&&Pt!==0?Pt&-Pt:$.T!==null?Np():rl()}function Py(){if(ia===0)if((Pt&536870912)===0||Ht){var a=He;He<<=1,(He&3932160)===0&&(He=262144),ia=a}else ia=536870912;return a=ra.current,a!==null&&(a.flags|=32),ia}function Gr(a,s,u){(a===pn&&(an===2||an===9)||a.cancelPendingCommit!==null)&&(Ro(a,0),Ri(a,Pt,ia,!1)),En(a,u),((Xt&2)===0||a!==pn)&&(a===pn&&((Xt&2)===0&&(Al|=u),Pn===4&&Ri(a,Pt,ia,!1)),cs(a))}function By(a,s,u){if((Xt&6)!==0)throw Error(r(327));var h=!u&&(s&127)===0&&(s&a.expiredLanes)===0||at(a,s),b=h?mN(a,s):kp(a,s,!0),x=h;do{if(b===0){So&&!h&&Ri(a,s,0,!1);break}else{if(u=a.current.alternate,x&&!fN(u)){b=kp(a,s,!1),x=!1;continue}if(b===2){if(x=s,a.errorRecoveryDisabledLanes&x)var k=0;else k=a.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){s=k;e:{var L=a;b=Yu;var W=L.current.memoizedState.isDehydrated;if(W&&(Ro(L,k).flags|=256),k=kp(L,k,!1),k!==2){if(bp&&!W){L.errorRecoveryDisabledLanes|=x,Al|=x,b=4;break e}x=Vr,Vr=b,x!==null&&(Vr===null?Vr=x:Vr.push.apply(Vr,x))}b=k}if(x=!1,b!==2)continue}}if(b===1){Ro(a,0),Ri(a,s,0,!0);break}e:{switch(h=a,x=b,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Ri(h,s,ia,!Ci);break e;case 2:Vr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=Wd+300-Ye(),10<b)){if(Ri(h,s,ia,!Ci),Mt(h,0,!0)!==0)break e;Ys=s,h.timeoutHandle=pE(Uy.bind(null,h,u,Vr,Xd,yp,s,ia,Al,No,Ci,x,"Throttled",-0,0),b);break e}Uy(h,u,Vr,Xd,yp,s,ia,Al,No,Ci,x,null,-0,0)}}break}while(!0);cs(a)}function Uy(a,s,u,h,b,x,k,L,W,ie,be,Ee,ue,he){if(a.timeoutHandle=-1,Ee=s.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vr},Ly(s,x,Ee);var ze=(x&62914560)===x?Wd-Ye():(x&4194048)===x?jy-Ye():0;if(ze=XN(Ee,ze),ze!==null){Ys=x,a.cancelPendingCommit=ze(Yy.bind(null,a,s,x,u,h,b,k,L,W,be,Ee,null,ue,he)),Ri(a,x,k,!ie);return}}Yy(a,s,x,u,h,b,k,L,W)}function fN(a){for(var s=a;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var b=u[h],x=b.getSnapshot;b=b.value;try{if(!ta(x(),b))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ri(a,s,u,h){s&=~xp,s&=~Al,a.suspendedLanes|=s,a.pingedLanes&=~s,h&&(a.warmLanes|=s),h=a.expirationTimes;for(var b=s;0<b;){var x=31-Be(b),k=1<<x;h[x]=-1,b&=~k}u!==0&&Jn(a,u,s)}function Kd(){return(Xt&6)===0?(Qu(0),!1):!0}function vp(){if(Ot!==null){if(an===0)var a=Ot.return;else a=Ot,Ms=El=null,Um(a),Eo=null,Lu=0,a=Ot;for(;a!==null;)gy(a.alternate,a),a=a.return;Ot=null}}function Ro(a,s){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,IN(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),Ys=0,vp(),pn=a,Ot=u=Ds(a.current,null),Pt=s,an=0,sa=null,Ci=!1,So=at(a,s),bp=!1,No=ia=xp=Al=Si=Pn=0,Vr=Yu=null,yp=!1,(s&8)!==0&&(s|=s&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=s;0<h;){var b=31-Be(h),x=1<<b;s|=a[b],h&=~x}return qs=s,xd(),u}function Hy(a,s){Tt=null,$.H=Uu,s===yo||s===Cd?(s=nx(),an=3):s===Sm?(s=nx(),an=4):an=s===tp?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,sa=s,Ot===null&&(Pn=1,Hd(a,Ea(s,a.current)))}function zy(){var a=ra.current;return a===null?!0:(Pt&4194048)===Pt?ka===null:(Pt&62914560)===Pt||(Pt&536870912)!==0?a===ka:!1}function Fy(){var a=$.H;return $.H=Uu,a===null?Uu:a}function $y(){var a=$.A;return $.A=cN,a}function Zd(){Pn=4,Ci||(Pt&4194048)!==Pt&&ra.current!==null||(So=!0),(Si&134217727)===0&&(Al&134217727)===0||pn===null||Ri(pn,Pt,ia,!1)}function kp(a,s,u){var h=Xt;Xt|=2;var b=Fy(),x=$y();(pn!==a||Pt!==s)&&(Xd=null,Ro(a,s)),s=!1;var k=Pn;e:do try{if(an!==0&&Ot!==null){var L=Ot,W=sa;switch(an){case 8:vp(),k=6;break e;case 3:case 2:case 9:case 6:ra.current===null&&(s=!0);var ie=an;if(an=0,sa=null,Lo(a,L,W,ie),u&&So){k=0;break e}break;default:ie=an,an=0,sa=null,Lo(a,L,W,ie)}}hN(),k=Pn;break}catch(be){Hy(a,be)}while(!0);return s&&a.shellSuspendCounter++,Ms=El=null,Xt=h,$.H=b,$.A=x,Ot===null&&(pn=null,Pt=0,xd()),k}function hN(){for(;Ot!==null;)Vy(Ot)}function mN(a,s){var u=Xt;Xt|=2;var h=Fy(),b=$y();pn!==a||Pt!==s?(Xd=null,Qd=Ye()+500,Ro(a,s)):So=at(a,s);e:do try{if(an!==0&&Ot!==null){s=Ot;var x=sa;t:switch(an){case 1:an=0,sa=null,Lo(a,s,x,1);break;case 2:case 9:if(ex(x)){an=0,sa=null,Gy(s);break}s=function(){an!==2&&an!==9||pn!==a||(an=7),cs(a)},x.then(s,s);break e;case 3:an=7;break e;case 4:an=5;break e;case 7:ex(x)?(an=0,sa=null,Gy(s)):(an=0,sa=null,Lo(a,s,x,7));break;case 5:var k=null;switch(Ot.tag){case 26:k=Ot.memoizedState;case 5:case 27:var L=Ot;if(k?RE(k):L.stateNode.complete){an=0,sa=null;var W=L.sibling;if(W!==null)Ot=W;else{var ie=L.return;ie!==null?(Ot=ie,Jd(ie)):Ot=null}break t}}an=0,sa=null,Lo(a,s,x,5);break;case 6:an=0,sa=null,Lo(a,s,x,6);break;case 8:vp(),Pn=6;break e;default:throw Error(r(462))}}pN();break}catch(be){Hy(a,be)}while(!0);return Ms=El=null,$.H=h,$.A=b,Xt=u,Ot!==null?0:(pn=null,Pt=0,xd(),Pn)}function pN(){for(;Ot!==null&&!tn();)Vy(Ot)}function Vy(a){var s=my(a.alternate,a,qs);a.memoizedProps=a.pendingProps,s===null?Jd(a):Ot=s}function Gy(a){var s=a,u=s.alternate;switch(s.tag){case 15:case 0:s=oy(u,s,s.pendingProps,s.type,void 0,Pt);break;case 11:s=oy(u,s,s.pendingProps,s.type.render,s.ref,Pt);break;case 5:Um(s);default:gy(u,s),s=Ot=$b(s,qs),s=my(u,s,qs)}a.memoizedProps=a.pendingProps,s===null?Jd(a):Ot=s}function Lo(a,s,u,h){Ms=El=null,Um(s),Eo=null,Lu=0;var b=s.return;try{if(rN(a,b,s,u,Pt)){Pn=1,Hd(a,Ea(u,a.current)),Ot=null;return}}catch(x){if(b!==null)throw Ot=b,x;Pn=1,Hd(a,Ea(u,a.current)),Ot=null;return}s.flags&32768?(Ht||h===1?a=!0:So||(Pt&536870912)!==0?a=!1:(Ci=a=!0,(h===2||h===9||h===3||h===6)&&(h=ra.current,h!==null&&h.tag===13&&(h.flags|=16384))),qy(s,a)):Jd(s)}function Jd(a){var s=a;do{if((s.flags&32768)!==0){qy(s,Ci);return}a=s.return;var u=iN(s.alternate,s,qs);if(u!==null){Ot=u;return}if(s=s.sibling,s!==null){Ot=s;return}Ot=s=a}while(s!==null);Pn===0&&(Pn=5)}function qy(a,s){do{var u=lN(a.alternate,a);if(u!==null){u.flags&=32767,Ot=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(a=a.sibling,a!==null)){Ot=a;return}Ot=a=u}while(a!==null);Pn=6,Ot=null}function Yy(a,s,u,h,b,x,k,L,W){a.cancelPendingCommit=null;do ef();while(ar!==0);if((Xt&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=fm,Hn(a,u,x,k,L,W),a===pn&&(Ot=pn=null,Pt=0),Ao=s,Ai=a,Ys=u,Ep=x,_p=b,My=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,yN(Pe,function(){return Zy(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=$.T,$.T=null,b=z.p,z.p=2,k=Xt,Xt|=4;try{oN(a,s,u)}finally{Xt=k,z.p=b,$.T=h}}ar=1,Wy(),Qy(),Xy()}}function Wy(){if(ar===1){ar=0;var a=Ai,s=Ao,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=$.T,$.T=null;var h=z.p;z.p=2;var b=Xt;Xt|=4;try{Ny(s,a);var x=Mp,k=Db(a.containerInfo),L=x.focusedElem,W=x.selectionRange;if(k!==L&&L&&L.ownerDocument&&Ob(L.ownerDocument.documentElement,L)){if(W!==null&&lm(L)){var ie=W.start,be=W.end;if(be===void 0&&(be=ie),"selectionStart"in L)L.selectionStart=ie,L.selectionEnd=Math.min(be,L.value.length);else{var Ee=L.ownerDocument||document,ue=Ee&&Ee.defaultView||window;if(ue.getSelection){var he=ue.getSelection(),ze=L.textContent.length,lt=Math.min(W.start,ze),dn=W.end===void 0?lt:Math.min(W.end,ze);!he.extend&<>dn&&(k=dn,dn=lt,lt=k);var ee=Ib(L,lt),J=Ib(L,dn);if(ee&&J&&(he.rangeCount!==1||he.anchorNode!==ee.node||he.anchorOffset!==ee.offset||he.focusNode!==J.node||he.focusOffset!==J.offset)){var se=Ee.createRange();se.setStart(ee.node,ee.offset),he.removeAllRanges(),lt>dn?(he.addRange(se),he.extend(J.node,J.offset)):(se.setEnd(J.node,J.offset),he.addRange(se))}}}}for(Ee=[],he=L;he=he.parentNode;)he.nodeType===1&&Ee.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Ee.length;L++){var ye=Ee[L];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}hf=!!jp,Mp=jp=null}finally{Xt=b,z.p=h,$.T=u}}a.current=s,ar=2}}function Qy(){if(ar===2){ar=0;var a=Ai,s=Ao,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=$.T,$.T=null;var h=z.p;z.p=2;var b=Xt;Xt|=4;try{vy(a,s.alternate,s)}finally{Xt=b,z.p=h,$.T=u}}ar=3}}function Xy(){if(ar===4||ar===3){ar=0,Zn();var a=Ai,s=Ao,u=Ys,h=My;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ar=5:(ar=0,Ao=Ai=null,Ky(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Ni=null),Xr(u),s=s.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(xe,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=$.T,b=z.p,z.p=2,$.T=null;try{for(var x=a.onRecoverableError,k=0;k<h.length;k++){var L=h[k];x(L.value,{componentStack:L.stack})}}finally{$.T=s,z.p=b}}(Ys&3)!==0&&ef(),cs(a),b=a.pendingLanes,(u&261930)!==0&&(b&42)!==0?a===Tp?Wu++:(Wu=0,Tp=a):Wu=0,Qu(0)}}function Ky(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Au(s)))}function ef(){return Wy(),Qy(),Xy(),Zy()}function Zy(){if(ar!==5)return!1;var a=Ai,s=Ep;Ep=0;var u=Xr(Ys),h=$.T,b=z.p;try{z.p=32>u?32:u,$.T=null,u=_p,_p=null;var x=Ai,k=Ys;if(ar=0,Ao=Ai=null,Ys=0,(Xt&6)!==0)throw Error(r(331));var L=Xt;if(Xt|=4,Oy(x.current),Ry(x,x.current,k,u),Xt=L,Qu(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(xe,x)}catch{}return!0}finally{z.p=b,$.T=h,Ky(a,s)}}function Jy(a,s,u){s=Ea(u,s),s=ep(a.stateNode,s,2),a=Ti(a,s,2),a!==null&&(En(a,2),cs(a))}function sn(a,s,u){if(a.tag===3)Jy(a,a,u);else for(;s!==null;){if(s.tag===3){Jy(s,a,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ni===null||!Ni.has(h))){a=Ea(u,a),u=ey(2),h=Ti(s,u,2),h!==null&&(ty(u,h,s,a),En(h,2),cs(h));break}}s=s.return}}function wp(a,s,u){var h=a.pingCache;if(h===null){h=a.pingCache=new dN;var b=new Set;h.set(s,b)}else b=h.get(s),b===void 0&&(b=new Set,h.set(s,b));b.has(u)||(bp=!0,b.add(u),a=gN.bind(null,a,s,u),s.then(a,a))}function gN(a,s,u){var h=a.pingCache;h!==null&&h.delete(s),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,pn===a&&(Pt&u)===u&&(Pn===4||Pn===3&&(Pt&62914560)===Pt&&300>Ye()-Wd?(Xt&2)===0&&Ro(a,0):xp|=u,No===Pt&&(No=0)),cs(a)}function eE(a,s){s===0&&(s=Kt()),a=bl(a,s),a!==null&&(En(a,s),cs(a))}function bN(a){var s=a.memoizedState,u=0;s!==null&&(u=s.retryLane),eE(a,u)}function xN(a,s){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,b=a.memoizedState;b!==null&&(u=b.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),eE(a,u)}function yN(a,s){return Nt(a,s)}var tf=null,Io=null,Cp=!1,nf=!1,Sp=!1,Li=0;function cs(a){a!==Io&&a.next===null&&(Io===null?tf=Io=a:Io=Io.next=a),nf=!0,Cp||(Cp=!0,_N())}function Qu(a,s){if(!Sp&&nf){Sp=!0;do for(var u=!1,h=tf;h!==null;){if(a!==0){var b=h.pendingLanes;if(b===0)var x=0;else{var k=h.suspendedLanes,L=h.pingedLanes;x=(1<<31-Be(42|a)+1)-1,x&=b&~(k&~L),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,aE(h,x))}else x=Pt,x=Mt(h,h===pn?x:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(x&3)===0||at(h,x)||(u=!0,aE(h,x));h=h.next}while(u);Sp=!1}}function EN(){tE()}function tE(){nf=Cp=!1;var a=0;Li!==0&&LN()&&(a=Li);for(var s=Ye(),u=null,h=tf;h!==null;){var b=h.next,x=nE(h,s);x===0?(h.next=null,u===null?tf=b:u.next=b,b===null&&(Io=u)):(u=h,(a!==0||(x&3)!==0)&&(nf=!0)),h=b}ar!==0&&ar!==5||Qu(a),Li!==0&&(Li=0)}function nE(a,s){for(var u=a.suspendedLanes,h=a.pingedLanes,b=a.expirationTimes,x=a.pendingLanes&-62914561;0<x;){var k=31-Be(x),L=1<<k,W=b[k];W===-1?((L&u)===0||(L&h)!==0)&&(b[k]=Rt(L,s)):W<=s&&(a.expiredLanes|=L),x&=~L}if(s=pn,u=Pt,u=Mt(a,a===s?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,u===0||a===s&&(an===2||an===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&ln(h),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||at(a,u)){if(s=u&-u,s===a.callbackPriority)return s;switch(h!==null&&ln(h),Xr(u)){case 2:case 8:u=Ce;break;case 32:u=Pe;break;case 268435456:u=bt;break;default:u=Pe}return h=rE.bind(null,a),u=Nt(u,h),a.callbackPriority=s,a.callbackNode=u,s}return h!==null&&h!==null&&ln(h),a.callbackPriority=2,a.callbackNode=null,2}function rE(a,s){if(ar!==0&&ar!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(ef()&&a.callbackNode!==u)return null;var h=Pt;return h=Mt(a,a===pn?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(By(a,h,s),nE(a,Ye()),a.callbackNode!=null&&a.callbackNode===u?rE.bind(null,a):null)}function aE(a,s){if(ef())return null;By(a,s,!0)}function _N(){ON(function(){(Xt&6)!==0?Nt(ge,EN):tE()})}function Np(){if(Li===0){var a=bo;a===0&&(a=rt,rt<<=1,(rt&261888)===0&&(rt=256)),Li=a}return Li}function sE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ha(""+a)}function iE(a,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,a.id&&u.setAttribute("form",a.id),s.parentNode.insertBefore(u,s),a=new FormData(a),u.parentNode.removeChild(u),a}function TN(a,s,u,h,b){if(s==="submit"&&u&&u.stateNode===b){var x=sE((b[Cn]||null).action),k=h.submitter;k&&(s=(s=k[Cn]||null)?sE(s.formAction):k.getAttribute("formAction"),s!==null&&(x=s,k=null));var L=new Rs("action","action",null,h,b);a.push({event:L,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Li!==0){var W=k?iE(b,k):new FormData(b);Wm(u,{pending:!0,data:W,method:b.method,action:x},null,W)}}else typeof x=="function"&&(L.preventDefault(),W=k?iE(b,k):new FormData(b),Wm(u,{pending:!0,data:W,method:b.method,action:x},x,W))},currentTarget:b}]})}}for(var Ap=0;Ap<dm.length;Ap++){var Rp=dm[Ap],vN=Rp.toLowerCase(),kN=Rp[0].toUpperCase()+Rp.slice(1);Va(vN,"on"+kN)}Va(Pb,"onAnimationEnd"),Va(Bb,"onAnimationIteration"),Va(Ub,"onAnimationStart"),Va("dblclick","onDoubleClick"),Va("focusin","onFocus"),Va("focusout","onBlur"),Va(HS,"onTransitionRun"),Va(zS,"onTransitionStart"),Va(FS,"onTransitionCancel"),Va(Hb,"onTransitionEnd"),Tr("onMouseEnter",["mouseout","mouseover"]),Tr("onMouseLeave",["mouseout","mouseover"]),Tr("onPointerEnter",["pointerout","pointerover"]),Tr("onPointerLeave",["pointerout","pointerover"]),Ur("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ur("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ur("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ur("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ur("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ur("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xu="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(" "),wN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xu));function lE(a,s){s=(s&4)!==0;for(var u=0;u<a.length;u++){var h=a[u],b=h.event;h=h.listeners;e:{var x=void 0;if(s)for(var k=h.length-1;0<=k;k--){var L=h[k],W=L.instance,ie=L.currentTarget;if(L=L.listener,W!==x&&b.isPropagationStopped())break e;x=L,b.currentTarget=ie;try{x(b)}catch(be){bd(be)}b.currentTarget=null,x=W}else for(k=0;k<h.length;k++){if(L=h[k],W=L.instance,ie=L.currentTarget,L=L.listener,W!==x&&b.isPropagationStopped())break e;x=L,b.currentTarget=ie;try{x(b)}catch(be){bd(be)}b.currentTarget=null,x=W}}}}function Dt(a,s){var u=s[er];u===void 0&&(u=s[er]=new Set);var h=a+"__bubble";u.has(h)||(oE(s,a,2,!1),u.add(h))}function Lp(a,s,u){var h=0;s&&(h|=4),oE(u,a,h,s)}var rf="_reactListening"+Math.random().toString(36).slice(2);function Ip(a){if(!a[rf]){a[rf]=!0,al.forEach(function(u){u!=="selectionchange"&&(wN.has(u)||Lp(u,!1,a),Lp(u,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[rf]||(s[rf]=!0,Lp("selectionchange",!1,s))}}function oE(a,s,u,h){switch(PE(s)){case 2:var b=JN;break;case 8:b=eA;break;default:b=Yp}u=b.bind(null,s,u,a),b=void 0,!hi||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),h?b!==void 0?a.addEventListener(s,u,{capture:!0,passive:b}):a.addEventListener(s,u,!0):b!==void 0?a.addEventListener(s,u,{passive:b}):a.addEventListener(s,u,!1)}function Op(a,s,u,h,b){var x=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var L=h.stateNode.containerInfo;if(L===b)break;if(k===4)for(k=h.return;k!==null;){var W=k.tag;if((W===3||W===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;L!==null;){if(k=Ir(L),k===null)return;if(W=k.tag,W===5||W===6||W===26||W===27){h=x=k;continue e}L=L.parentNode}}h=h.return}cl(function(){var ie=x,be=di(u),Ee=[];e:{var ue=zb.get(a);if(ue!==void 0){var he=Rs,ze=a;switch(a){case"keypress":if(As(u)===0)break e;case"keydown":case"keyup":he=ml;break;case"focusin":ze="focus",he=vn;break;case"focusout":ze="blur",he=vn;break;case"beforeblur":case"afterblur":he=vn;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=ft;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=Tn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=im;break;case Pb:case Bb:case Ub:he=nn;break;case Hb:he=cd;break;case"scroll":case"scrollend":he=V;break;case"wheel":he=fd;break;case"copy":case"cut":case"paste":he=Se;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=ld;break;case"toggle":case"beforetoggle":he=md}var lt=(s&4)!==0,dn=!lt&&(a==="scroll"||a==="scrollend"),ee=lt?ue!==null?ue+"Capture":null:ue;lt=[];for(var J=ie,se;J!==null;){var ye=J;if(se=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||se===null||ee===null||(ye=ea(J,ee),ye!=null&<.push(Ku(J,ye,se))),dn)break;J=J.return}0<lt.length&&(ue=new he(ue,ze,null,u,be),Ee.push({event:ue,listeners:lt}))}}if((s&7)===0){e:{if(ue=a==="mouseover"||a==="pointerover",he=a==="mouseout"||a==="pointerout",ue&&u!==is&&(ze=u.relatedTarget||u.fromElement)&&(Ir(ze)||ze[ha]))break e;if((he||ue)&&(ue=be.window===be?be:(ue=be.ownerDocument)?ue.defaultView||ue.parentWindow:window,he?(ze=u.relatedTarget||u.toElement,he=ie,ze=ze?Ir(ze):null,ze!==null&&(dn=l(ze),lt=ze.tag,ze!==dn||lt!==5&<!==27&<!==6)&&(ze=null)):(he=null,ze=ie),he!==ze)){if(lt=ft,ye="onMouseLeave",ee="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(lt=ld,ye="onPointerLeave",ee="onPointerEnter",J="pointer"),dn=he==null?ue:ma(he),se=ze==null?ue:ma(ze),ue=new lt(ye,J+"leave",he,u,be),ue.target=dn,ue.relatedTarget=se,ye=null,Ir(be)===ie&&(lt=new lt(ee,J+"enter",ze,u,be),lt.target=se,lt.relatedTarget=dn,ye=lt),dn=ye,he&&ze)t:{for(lt=CN,ee=he,J=ze,se=0,ye=ee;ye;ye=lt(ye))se++;ye=0;for(var et=J;et;et=lt(et))ye++;for(;0<se-ye;)ee=lt(ee),se--;for(;0<ye-se;)J=lt(J),ye--;for(;se--;){if(ee===J||J!==null&&ee===J.alternate){lt=ee;break t}ee=lt(ee),J=lt(J)}lt=null}else lt=null;he!==null&&uE(Ee,ue,he,lt,!1),ze!==null&&dn!==null&&uE(Ee,dn,ze,lt,!0)}}e:{if(ue=ie?ma(ie):window,he=ue.nodeName&&ue.nodeName.toLowerCase(),he==="select"||he==="input"&&ue.type==="file")var qt=zt;else if(pt(ue))if(xa)qt=PS;else{qt=jS;var We=DS}else he=ue.nodeName,!he||he.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ie&&Cs(ie.elementType)&&(qt=zt):qt=MS;if(qt&&(qt=qt(a,ie))){ht(Ee,qt,u,be);break e}We&&We(a,ue,ie),a==="focusout"&&ie&&ue.type==="number"&&ie.memoizedProps.value!=null&&Ba(ue,"number",ue.value)}switch(We=ie?ma(ie):window,a){case"focusin":(pt(We)||We.contentEditable==="true")&&(oo=We,om=ie,Cu=null);break;case"focusout":Cu=om=oo=null;break;case"mousedown":um=!0;break;case"contextmenu":case"mouseup":case"dragend":um=!1,jb(Ee,u,be);break;case"selectionchange":if(US)break;case"keydown":case"keyup":jb(Ee,u,be)}var kt;if(io)e:{switch(a){case"compositionstart":var Bt="onCompositionStart";break e;case"compositionend":Bt="onCompositionEnd";break e;case"compositionupdate":Bt="onCompositionUpdate";break e}Bt=void 0}else re?ku(a,u)&&(Bt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Bt="onCompositionStart");Bt&&(_u&&u.locale!=="ko"&&(re||Bt!=="onCompositionStart"?Bt==="onCompositionEnd"&&re&&(kt=fl()):(ba=be,dl="value"in ba?ba.value:ba.textContent,re=!0)),We=af(ie,Bt),0<We.length&&(Bt=new gt(Bt,a,null,u,be),Ee.push({event:Bt,listeners:We}),kt?Bt.data=kt:(kt=I(u),kt!==null&&(Bt.data=kt)))),(kt=gd?ke(a,u):Xe(a,u))&&(Bt=af(ie,"onBeforeInput"),0<Bt.length&&(We=new gt("onBeforeInput","beforeinput",null,u,be),Ee.push({event:We,listeners:Bt}),We.data=kt)),TN(Ee,a,ie,u,be)}lE(Ee,s)})}function Ku(a,s,u){return{instance:a,listener:s,currentTarget:u}}function af(a,s){for(var u=s+"Capture",h=[];a!==null;){var b=a,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=ea(a,u),b!=null&&h.unshift(Ku(a,b,x)),b=ea(a,s),b!=null&&h.push(Ku(a,b,x))),a.tag===3)return h;a=a.return}return[]}function CN(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function uE(a,s,u,h,b){for(var x=s._reactName,k=[];u!==null&&u!==h;){var L=u,W=L.alternate,ie=L.stateNode;if(L=L.tag,W!==null&&W===h)break;L!==5&&L!==26&&L!==27||ie===null||(W=ie,b?(ie=ea(u,x),ie!=null&&k.unshift(Ku(u,ie,W))):b||(ie=ea(u,x),ie!=null&&k.push(Ku(u,ie,W)))),u=u.return}k.length!==0&&a.push({event:s,listeners:k})}var SN=/\r\n?/g,NN=/\u0000|\uFFFD/g;function cE(a){return(typeof a=="string"?a:""+a).replace(SN,`
|
|
50
|
-
`).replace(NN,"")}function dE(a,s){return s=cE(s),cE(a)===s}function cn(a,s,u,h,b,x){switch(u){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||cr(a,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&cr(a,""+h);break;case"className":pa(a,"class",h);break;case"tabIndex":pa(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":pa(a,u,h);break;case"style":so(a,h,x);break;case"data":if(s!=="object"){pa(a,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||u!=="href")){a.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=Ha(""+h),a.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(u==="formAction"?(s!=="input"&&cn(a,s,"name",b.name,b,null),cn(a,s,"formEncType",b.formEncType,b,null),cn(a,s,"formMethod",b.formMethod,b,null),cn(a,s,"formTarget",b.formTarget,b,null)):(cn(a,s,"encType",b.encType,b,null),cn(a,s,"method",b.method,b,null),cn(a,s,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=Ha(""+h),a.setAttribute(u,h);break;case"onClick":h!=null&&(a.onclick=vr);break;case"onScroll":h!=null&&Dt("scroll",a);break;case"onScrollEnd":h!=null&&Dt("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}u=Ha(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""+h):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":h===!0?a.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,h):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(u,h):a.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(u):a.setAttribute(u,h);break;case"popover":Dt("beforetoggle",a),Dt("toggle",a),Hr(a,"popover",h);break;case"xlinkActuate":_n(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":_n(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":_n(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":_n(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":_n(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":_n(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":_n(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":_n(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":_n(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Hr(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=ol.get(u)||u,Hr(a,u,h))}}function Dp(a,s,u,h,b,x){switch(u){case"style":so(a,h,x);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof h=="string"?cr(a,h):(typeof h=="number"||typeof h=="bigint")&&cr(a,""+h);break;case"onScroll":h!=null&&Dt("scroll",a);break;case"onScrollEnd":h!=null&&Dt("scrollend",a);break;case"onClick":h!=null&&(a.onclick=vr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ws.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),x=a[Cn]||null,x=x!=null?x[u]:null,typeof x=="function"&&a.removeEventListener(s,x,b),typeof h=="function")){typeof x!="function"&&x!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(s,h,b);break e}u in a?a[u]=h:h===!0?a.setAttribute(u,""):Hr(a,u,h)}}}function _r(a,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Dt("error",a),Dt("load",a);var h=!1,b=!1,x;for(x in u)if(u.hasOwnProperty(x)){var k=u[x];if(k!=null)switch(x){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:cn(a,s,x,k,u,null)}}b&&cn(a,s,"srcSet",u.srcSet,u,null),h&&cn(a,s,"src",u.src,u,null);return;case"input":Dt("invalid",a);var L=x=k=b=null,W=null,ie=null;for(h in u)if(u.hasOwnProperty(h)){var be=u[h];if(be!=null)switch(h){case"name":b=be;break;case"type":k=be;break;case"checked":W=be;break;case"defaultChecked":ie=be;break;case"value":x=be;break;case"defaultValue":L=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,s));break;default:cn(a,s,h,be,u,null)}}rs(a,x,L,W,ie,k,b,!1);return;case"select":Dt("invalid",a),h=k=x=null;for(b in u)if(u.hasOwnProperty(b)&&(L=u[b],L!=null))switch(b){case"value":x=L;break;case"defaultValue":k=L;break;case"multiple":h=L;default:cn(a,s,b,L,u,null)}s=x,u=k,a.multiple=!!h,s!=null?as(a,!!h,s,!1):u!=null&&as(a,!!h,u,!0);return;case"textarea":Dt("invalid",a),x=b=h=null;for(k in u)if(u.hasOwnProperty(k)&&(L=u[k],L!=null))switch(k){case"value":h=L;break;case"defaultValue":b=L;break;case"children":x=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:cn(a,s,k,L,u,null)}Qt(a,h,b,x);return;case"option":for(W in u)if(u.hasOwnProperty(W)&&(h=u[W],h!=null))switch(W){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:cn(a,s,W,h,u,null)}return;case"dialog":Dt("beforetoggle",a),Dt("toggle",a),Dt("cancel",a),Dt("close",a);break;case"iframe":case"object":Dt("load",a);break;case"video":case"audio":for(h=0;h<Xu.length;h++)Dt(Xu[h],a);break;case"image":Dt("error",a),Dt("load",a);break;case"details":Dt("toggle",a);break;case"embed":case"source":case"link":Dt("error",a),Dt("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(ie in u)if(u.hasOwnProperty(ie)&&(h=u[ie],h!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:cn(a,s,ie,h,u,null)}return;default:if(Cs(s)){for(be in u)u.hasOwnProperty(be)&&(h=u[be],h!==void 0&&Dp(a,s,be,h,u,void 0));return}}for(L in u)u.hasOwnProperty(L)&&(h=u[L],h!=null&&cn(a,s,L,h,u,null))}function AN(a,s,u,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,k=null,L=null,W=null,ie=null,be=null;for(he in u){var Ee=u[he];if(u.hasOwnProperty(he)&&Ee!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":W=Ee;default:h.hasOwnProperty(he)||cn(a,s,he,null,h,Ee)}}for(var ue in h){var he=h[ue];if(Ee=u[ue],h.hasOwnProperty(ue)&&(he!=null||Ee!=null))switch(ue){case"type":x=he;break;case"name":b=he;break;case"checked":ie=he;break;case"defaultChecked":be=he;break;case"value":k=he;break;case"defaultValue":L=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,s));break;default:he!==Ee&&cn(a,s,ue,he,h,Ee)}}Dn(a,k,L,W,ie,be,x,b);return;case"select":he=k=L=ue=null;for(x in u)if(W=u[x],u.hasOwnProperty(x)&&W!=null)switch(x){case"value":break;case"multiple":he=W;default:h.hasOwnProperty(x)||cn(a,s,x,null,h,W)}for(b in h)if(x=h[b],W=u[b],h.hasOwnProperty(b)&&(x!=null||W!=null))switch(b){case"value":ue=x;break;case"defaultValue":L=x;break;case"multiple":k=x;default:x!==W&&cn(a,s,b,x,h,W)}s=L,u=k,h=he,ue!=null?as(a,!!u,ue,!1):!!h!=!!u&&(s!=null?as(a,!!u,s,!0):as(a,!!u,u?[]:"",!1));return;case"textarea":he=ue=null;for(L in u)if(b=u[L],u.hasOwnProperty(L)&&b!=null&&!h.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:cn(a,s,L,null,h,b)}for(k in h)if(b=h[k],x=u[k],h.hasOwnProperty(k)&&(b!=null||x!=null))switch(k){case"value":ue=b;break;case"defaultValue":he=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==x&&cn(a,s,k,b,h,x)}ss(a,ue,he);return;case"option":for(var ze in u)if(ue=u[ze],u.hasOwnProperty(ze)&&ue!=null&&!h.hasOwnProperty(ze))switch(ze){case"selected":a.selected=!1;break;default:cn(a,s,ze,null,h,ue)}for(W in h)if(ue=h[W],he=u[W],h.hasOwnProperty(W)&&ue!==he&&(ue!=null||he!=null))switch(W){case"selected":a.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:cn(a,s,W,ue,h,he)}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 lt in u)ue=u[lt],u.hasOwnProperty(lt)&&ue!=null&&!h.hasOwnProperty(lt)&&cn(a,s,lt,null,h,ue);for(ie in h)if(ue=h[ie],he=u[ie],h.hasOwnProperty(ie)&&ue!==he&&(ue!=null||he!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:cn(a,s,ie,ue,h,he)}return;default:if(Cs(s)){for(var dn in u)ue=u[dn],u.hasOwnProperty(dn)&&ue!==void 0&&!h.hasOwnProperty(dn)&&Dp(a,s,dn,void 0,h,ue);for(be in h)ue=h[be],he=u[be],!h.hasOwnProperty(be)||ue===he||ue===void 0&&he===void 0||Dp(a,s,be,ue,h,he);return}}for(var ee in u)ue=u[ee],u.hasOwnProperty(ee)&&ue!=null&&!h.hasOwnProperty(ee)&&cn(a,s,ee,null,h,ue);for(Ee in h)ue=h[Ee],he=u[Ee],!h.hasOwnProperty(Ee)||ue===he||ue==null&&he==null||cn(a,s,Ee,ue,h,he)}function fE(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function RN(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var b=u[h],x=b.transferSize,k=b.initiatorType,L=b.duration;if(x&&L&&fE(k)){for(k=0,L=b.responseEnd,h+=1;h<u.length;h++){var W=u[h],ie=W.startTime;if(ie>L)break;var be=W.transferSize,Ee=W.initiatorType;be&&fE(Ee)&&(W=W.responseEnd,k+=be*(W<L?1:(L-ie)/(W-ie)))}if(--h,s+=8*(x+k)/(b.duration/1e3),a++,10<a)break}}if(0<a)return s/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var jp=null,Mp=null;function sf(a){return a.nodeType===9?a:a.ownerDocument}function hE(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 mE(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function Pp(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Bp=null;function LN(){var a=window.event;return a&&a.type==="popstate"?a===Bp?!1:(Bp=a,!0):(Bp=null,!1)}var pE=typeof setTimeout=="function"?setTimeout:void 0,IN=typeof clearTimeout=="function"?clearTimeout:void 0,gE=typeof Promise=="function"?Promise:void 0,ON=typeof queueMicrotask=="function"?queueMicrotask:typeof gE<"u"?function(a){return gE.resolve(null).then(a).catch(DN)}:pE;function DN(a){setTimeout(function(){throw a})}function Ii(a){return a==="head"}function bE(a,s){var u=s,h=0;do{var b=u.nextSibling;if(a.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(h===0){a.removeChild(b),Mo(s);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Zu(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Zu(u);for(var x=u.firstChild;x;){var k=x.nextSibling,L=x.nodeName;x[ur]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=k}}else u==="body"&&Zu(a.ownerDocument.body);u=b}while(u);Mo(s)}function xE(a,s){var u=a;a=0;do{var h=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=h}while(u)}function Up(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Up(u),Zr(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function jN(a,s,u,h){for(;a.nodeType===1;){var b=u;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[ur])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(x=a.getAttribute("rel"),x==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(x!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(x=a.getAttribute("src"),(x!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===x)return a}else return a;if(a=wa(a.nextSibling),a===null)break}return null}function MN(a,s,u){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=wa(a.nextSibling),a===null))return null;return a}function yE(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=wa(a.nextSibling),a===null))return null;return a}function Hp(a){return a.data==="$?"||a.data==="$~"}function zp(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function PN(a,s){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||u.readyState!=="loading")s();else{var h=function(){s(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function wa(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return a}var Fp=null;function EE(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(s===0)return wa(a.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}a=a.nextSibling}return null}function _E(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return a;s--}else u!=="/$"&&u!=="/&"||s++}a=a.previousSibling}return null}function TE(a,s,u){switch(s=sf(u),a){case"html":if(a=s.documentElement,!a)throw Error(r(452));return a;case"head":if(a=s.head,!a)throw Error(r(453));return a;case"body":if(a=s.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Zu(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);Zr(a)}var Ca=new Map,vE=new Set;function lf(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ws=z.d;z.d={f:BN,r:UN,D:HN,C:zN,L:FN,m:$N,X:GN,S:VN,M:qN};function BN(){var a=Ws.f(),s=Kd();return a||s}function UN(a){var s=tr(a);s!==null&&s.tag===5&&s.type==="form"?Hx(s):Ws.r(a)}var Oo=typeof document>"u"?null:document;function kE(a,s,u){var h=Oo;if(h&&typeof s=="string"&&s){var b=On(s);b='link[rel="'+a+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),vE.has(b)||(vE.add(b),a={rel:a,crossOrigin:u,href:s},h.querySelector(b)===null&&(s=h.createElement("link"),_r(s,"link",a),Sn(s),h.head.appendChild(s)))}}function HN(a){Ws.D(a),kE("dns-prefetch",a,null)}function zN(a,s){Ws.C(a,s),kE("preconnect",a,s)}function FN(a,s,u){Ws.L(a,s,u);var h=Oo;if(h&&a&&s){var b='link[rel="preload"][as="'+On(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+On(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+On(u.imageSizes)+'"]')):b+='[href="'+On(a)+'"]';var x=b;switch(s){case"style":x=Do(a);break;case"script":x=jo(a)}Ca.has(x)||(a=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:a,as:s},u),Ca.set(x,a),h.querySelector(b)!==null||s==="style"&&h.querySelector(Ju(x))||s==="script"&&h.querySelector(ec(x))||(s=h.createElement("link"),_r(s,"link",a),Sn(s),h.head.appendChild(s)))}}function $N(a,s){Ws.m(a,s);var u=Oo;if(u&&a){var h=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+On(h)+'"][href="'+On(a)+'"]',x=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=jo(a)}if(!Ca.has(x)&&(a=g({rel:"modulepreload",href:a},s),Ca.set(x,a),u.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(ec(x)))return}h=u.createElement("link"),_r(h,"link",a),Sn(h),u.head.appendChild(h)}}}function VN(a,s,u){Ws.S(a,s,u);var h=Oo;if(h&&a){var b=nr(h).hoistableStyles,x=Do(a);s=s||"default";var k=b.get(x);if(!k){var L={loading:0,preload:null};if(k=h.querySelector(Ju(x)))L.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":s},u),(u=Ca.get(x))&&$p(a,u);var W=k=h.createElement("link");Sn(W),_r(W,"link",a),W._p=new Promise(function(ie,be){W.onload=ie,W.onerror=be}),W.addEventListener("load",function(){L.loading|=1}),W.addEventListener("error",function(){L.loading|=2}),L.loading|=4,of(k,s,h)}k={type:"stylesheet",instance:k,count:1,state:L},b.set(x,k)}}}function GN(a,s){Ws.X(a,s);var u=Oo;if(u&&a){var h=nr(u).hoistableScripts,b=jo(a),x=h.get(b);x||(x=u.querySelector(ec(b)),x||(a=g({src:a,async:!0},s),(s=Ca.get(b))&&Vp(a,s),x=u.createElement("script"),Sn(x),_r(x,"link",a),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(b,x))}}function qN(a,s){Ws.M(a,s);var u=Oo;if(u&&a){var h=nr(u).hoistableScripts,b=jo(a),x=h.get(b);x||(x=u.querySelector(ec(b)),x||(a=g({src:a,async:!0,type:"module"},s),(s=Ca.get(b))&&Vp(a,s),x=u.createElement("script"),Sn(x),_r(x,"link",a),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(b,x))}}function wE(a,s,u,h){var b=(b=Ne.current)?lf(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=Do(u.href),u=nr(b).hoistableStyles,h=u.get(s),h||(h={type:"style",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Do(u.href);var x=nr(b).hoistableStyles,k=x.get(a);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(a,k),(x=b.querySelector(Ju(a)))&&!x._p&&(k.instance=x,k.state.loading=5),Ca.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ca.set(a,u),x||YN(b,a,u,k.state))),s&&h===null)throw Error(r(528,""));return k}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=jo(u),u=nr(b).hoistableScripts,h=u.get(s),h||(h={type:"script",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Do(a){return'href="'+On(a)+'"'}function Ju(a){return'link[rel="stylesheet"]['+a+"]"}function CE(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function YN(a,s,u,h){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=a.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),_r(s,"link",u),Sn(s),a.head.appendChild(s))}function jo(a){return'[src="'+On(a)+'"]'}function ec(a){return"script[async]"+a}function SE(a,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var h=a.querySelector('style[data-href~="'+On(u.href)+'"]');if(h)return s.instance=h,Sn(h),h;var b=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Sn(h),_r(h,"style",b),of(h,u.precedence,a),s.instance=h;case"stylesheet":b=Do(u.href);var x=a.querySelector(Ju(b));if(x)return s.state.loading|=4,s.instance=x,Sn(x),x;h=CE(u),(b=Ca.get(b))&&$p(h,b),x=(a.ownerDocument||a).createElement("link"),Sn(x);var k=x;return k._p=new Promise(function(L,W){k.onload=L,k.onerror=W}),_r(x,"link",h),s.state.loading|=4,of(x,u.precedence,a),s.instance=x;case"script":return x=jo(u.src),(b=a.querySelector(ec(x)))?(s.instance=b,Sn(b),b):(h=u,(b=Ca.get(x))&&(h=g({},u),Vp(h,b)),a=a.ownerDocument||a,b=a.createElement("script"),Sn(b),_r(b,"link",h),a.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,of(h,u.precedence,a));return s.instance}function of(a,s,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,x=b,k=0;k<h.length;k++){var L=h[k];if(L.dataset.precedence===s)x=L;else if(x!==b)break}x?x.parentNode.insertBefore(a,x.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(a,s.firstChild))}function $p(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function Vp(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var uf=null;function NE(a,s,u){if(uf===null){var h=new Map,b=uf=new Map;b.set(u,h)}else b=uf,h=b.get(u),h||(h=new Map,b.set(u,h));if(h.has(a))return h;for(h.set(a,null),u=u.getElementsByTagName(a),b=0;b<u.length;b++){var x=u[b];if(!(x[ur]||x[hn]||a==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(s)||"";k=a+k;var L=h.get(k);L?L.push(x):h.set(k,[x])}}return h}function AE(a,s,u){a=a.ownerDocument||a,a.head.insertBefore(u,s==="title"?a.querySelector("head > title"):null)}function WN(a,s,u){if(u===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function RE(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function QN(a,s,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Do(h.href),x=s.querySelector(Ju(b));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=cf.bind(a),s.then(a,a)),u.state.loading|=4,u.instance=x,Sn(x);return}x=s.ownerDocument||s,h=CE(h),(b=Ca.get(b))&&$p(h,b),x=x.createElement("link"),Sn(x);var k=x;k._p=new Promise(function(L,W){k.onload=L,k.onerror=W}),_r(x,"link",h),u.instance=x}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=cf.bind(a),s.addEventListener("load",u),s.addEventListener("error",u))}}var Gp=0;function XN(a,s){return a.stylesheets&&a.count===0&&ff(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var h=setTimeout(function(){if(a.stylesheets&&ff(a,a.stylesheets),a.unsuspend){var x=a.unsuspend;a.unsuspend=null,x()}},6e4+s);0<a.imgBytes&&Gp===0&&(Gp=62500*RN());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&ff(a,a.stylesheets),a.unsuspend)){var x=a.unsuspend;a.unsuspend=null,x()}},(a.imgBytes>Gp?50:800)+s);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ff(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var df=null;function ff(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,df=new Map,s.forEach(KN,a),df=null,cf.call(a))}function KN(a,s){if(!(s.state.loading&4)){var u=df.get(a);if(u)var h=u.get(null);else{u=new Map,df.set(a,u);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var k=b[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(u.set(k.dataset.precedence,k),h=k)}h&&u.set(null,h)}b=s.instance,k=b.getAttribute("data-precedence"),x=u.get(k)||h,x===h&&u.set(null,b),u.set(k,b),this.count++,h=cf.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),x?x.parentNode.insertBefore(b,x.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),s.state.loading|=4}}var tc={$$typeof:R,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function ZN(a,s,u,h,b,x,k,L,W){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=Zt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zt(0),this.hiddenUpdates=Zt(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function LE(a,s,u,h,b,x,k,L,W,ie,be,Ee){return a=new ZN(a,s,u,k,W,ie,be,Ee,L),s=1,x===!0&&(s|=24),x=na(3,null,null,s),a.current=x,x.stateNode=a,s=km(),s.refCount++,a.pooledCache=s,s.refCount++,x.memoizedState={element:h,isDehydrated:u,cache:s},Nm(x),a}function IE(a){return a?(a=fo,a):fo}function OE(a,s,u,h,b,x){b=IE(b),h.context===null?h.context=b:h.pendingContext=b,h=_i(s),h.payload={element:u},x=x===void 0?null:x,x!==null&&(h.callback=x),u=Ti(a,h,s),u!==null&&(Gr(u,a,s),Ou(u,a,s))}function DE(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<s?u:s}}function qp(a,s){DE(a,s),(a=a.alternate)&&DE(a,s)}function jE(a){if(a.tag===13||a.tag===31){var s=bl(a,67108864);s!==null&&Gr(s,a,67108864),qp(a,67108864)}}function ME(a){if(a.tag===13||a.tag===31){var s=la();s=ts(s);var u=bl(a,s);u!==null&&Gr(u,a,s),qp(a,s)}}var hf=!0;function JN(a,s,u,h){var b=$.T;$.T=null;var x=z.p;try{z.p=2,Yp(a,s,u,h)}finally{z.p=x,$.T=b}}function eA(a,s,u,h){var b=$.T;$.T=null;var x=z.p;try{z.p=8,Yp(a,s,u,h)}finally{z.p=x,$.T=b}}function Yp(a,s,u,h){if(hf){var b=Wp(h);if(b===null)Op(a,s,h,mf,u),BE(a,h);else if(nA(b,a,s,u,h))h.stopPropagation();else if(BE(a,h),s&4&&-1<tA.indexOf(a)){for(;b!==null;){var x=tr(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=mt(x.pendingLanes);if(k!==0){var L=x;for(L.pendingLanes|=2,L.entangledLanes|=2;k;){var W=1<<31-Be(k);L.entanglements[1]|=W,k&=~W}cs(x),(Xt&6)===0&&(Qd=Ye()+500,Qu(0))}}break;case 31:case 13:L=bl(x,2),L!==null&&Gr(L,x,2),Kd(),qp(x,2)}if(x=Wp(h),x===null&&Op(a,s,h,mf,u),x===b)break;b=x}b!==null&&h.stopPropagation()}else Op(a,s,h,null,u)}}function Wp(a){return a=di(a),Qp(a)}var mf=null;function Qp(a){if(mf=null,a=Ir(a),a!==null){var s=l(a);if(s===null)a=null;else{var u=s.tag;if(u===13){if(a=o(s),a!==null)return a;a=null}else if(u===31){if(a=c(s),a!==null)return a;a=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return mf=a,null}function PE(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(Un()){case ge:return 2;case Ce:return 8;case Pe:case ct:return 32;case bt:return 268435456;default:return 32}default:return 32}}var Xp=!1,Oi=null,Di=null,ji=null,nc=new Map,rc=new Map,Mi=[],tA="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 BE(a,s){switch(a){case"focusin":case"focusout":Oi=null;break;case"dragenter":case"dragleave":Di=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":nc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":rc.delete(s.pointerId)}}function ac(a,s,u,h,b,x){return a===null||a.nativeEvent!==x?(a={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[b]},s!==null&&(s=tr(s),s!==null&&jE(s)),a):(a.eventSystemFlags|=h,s=a.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),a)}function nA(a,s,u,h,b){switch(s){case"focusin":return Oi=ac(Oi,a,s,u,h,b),!0;case"dragenter":return Di=ac(Di,a,s,u,h,b),!0;case"mouseover":return ji=ac(ji,a,s,u,h,b),!0;case"pointerover":var x=b.pointerId;return nc.set(x,ac(nc.get(x)||null,a,s,u,h,b)),!0;case"gotpointercapture":return x=b.pointerId,rc.set(x,ac(rc.get(x)||null,a,s,u,h,b)),!0}return!1}function UE(a){var s=Ir(a.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=o(u),s!==null){a.blockedOn=s,ro(a.priority,function(){ME(u)});return}}else if(s===31){if(s=c(u),s!==null){a.blockedOn=s,ro(a.priority,function(){ME(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function pf(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var u=Wp(a.nativeEvent);if(u===null){u=a.nativeEvent;var h=new u.constructor(u.type,u);is=h,u.target.dispatchEvent(h),is=null}else return s=tr(u),s!==null&&jE(s),a.blockedOn=u,!1;s.shift()}return!0}function HE(a,s,u){pf(a)&&u.delete(s)}function rA(){Xp=!1,Oi!==null&&pf(Oi)&&(Oi=null),Di!==null&&pf(Di)&&(Di=null),ji!==null&&pf(ji)&&(ji=null),nc.forEach(HE),rc.forEach(HE)}function gf(a,s){a.blockedOn===s&&(a.blockedOn=null,Xp||(Xp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,rA)))}var bf=null;function zE(a){bf!==a&&(bf=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bf===a&&(bf=null);for(var s=0;s<a.length;s+=3){var u=a[s],h=a[s+1],b=a[s+2];if(typeof h!="function"){if(Qp(h||u)===null)continue;break}var x=tr(u);x!==null&&(a.splice(s,3),s-=3,Wm(x,{pending:!0,data:b,method:u.method,action:h},h,b))}}))}function Mo(a){function s(W){return gf(W,a)}Oi!==null&&gf(Oi,a),Di!==null&&gf(Di,a),ji!==null&&gf(ji,a),nc.forEach(s),rc.forEach(s);for(var u=0;u<Mi.length;u++){var h=Mi[u];h.blockedOn===a&&(h.blockedOn=null)}for(;0<Mi.length&&(u=Mi[0],u.blockedOn===null);)UE(u),u.blockedOn===null&&Mi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var b=u[h],x=u[h+1],k=b[Cn]||null;if(typeof x=="function")k||zE(u);else if(k){var L=null;if(x&&x.hasAttribute("formAction")){if(b=x,k=x[Cn]||null)L=k.formAction;else if(Qp(b)!==null)continue}else L=k.action;typeof L=="function"?u[h+1]=L:(u.splice(h,3),h-=3),zE(u)}}}function FE(){function a(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function Kp(a){this._internalRoot=a}xf.prototype.render=Kp.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,h=la();OE(u,h,a,s,null,null)},xf.prototype.unmount=Kp.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;OE(a.current,2,null,a,null,null),Kd(),s[ha]=null}};function xf(a){this._internalRoot=a}xf.prototype.unstable_scheduleHydration=function(a){if(a){var s=rl();a={blockedOn:null,target:a,priority:s};for(var u=0;u<Mi.length&&s!==0&&s<Mi[u].priority;u++);Mi.splice(u,0,a),u===0&&UE(a)}};var $E=t.version;if($E!=="19.2.5")throw Error(r(527,$E,"19.2.5"));z.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=m(s),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var aA={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yf.isDisabled&&yf.supportsFiber)try{xe=yf.inject(aA),Oe=yf}catch{}}return ic.createRoot=function(a,s){if(!i(a))throw Error(r(299));var u=!1,h="",b=Xx,x=Kx,k=Zx;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError)),s=LE(a,1,!1,null,null,u,h,null,b,x,k,FE),a[ha]=s.current,Ip(a),new Kp(s)},ic.hydrateRoot=function(a,s,u){if(!i(a))throw Error(r(299));var h=!1,b="",x=Xx,k=Kx,L=Zx,W=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(L=u.onRecoverableError),u.formState!==void 0&&(W=u.formState)),s=LE(a,1,!0,s,u??null,h,b,W,x,k,L,FE),s.context=IE(null),u=s.current,h=la(),h=ts(h),b=_i(h),b.callback=null,Ti(u,b,h),u=h,s.current.lanes=u,En(s,u),cs(s),a[ha]=s.current,Ip(a),new xf(s)},ic.version="19.2.5",ic}var t2;function xA(){if(t2)return n0.exports;t2=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(),n0.exports=bA(),n0.exports}var yA=xA();const EA=Lh(yA);/**
|
|
51
|
-
* react-router v7.14.0
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Remix Software Inc.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
-
*
|
|
58
|
-
* @license MIT
|
|
59
|
-
*/var n2="popstate";function r2(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function _A(e={}){function t(r,i){var m;let l=(m=i.state)==null?void 0:m.masked,{pathname:o,search:c,hash:d}=l||r.location;return ug("",{pathname:o,search:c,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:Bc(i)}return vA(t,n,null,e)}function Rn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Da(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function TA(){return Math.random().toString(36).substring(2,10)}function a2(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ug(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?iu(t):t,state:n,key:t&&t.key||r||TA(),unstable_mask:i}}function Bc({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function iu(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function vA(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:l=!1}=r,o=i.history,c="POP",d=null,m=p();m==null&&(m=0,o.replaceState({...o.state,idx:m},""));function p(){return(o.state||{idx:null}).idx}function g(){c="POP";let C=p(),S=C==null?null:C-m;m=C,d&&d({action:c,location:w.location,delta:S})}function y(C,S){c="PUSH";let N=r2(C)?C:ug(w.location,C,S);m=p()+1;let R=a2(N,m),M=w.createHref(N.unstable_mask||N);try{o.pushState(R,"",M)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;i.location.assign(M)}l&&d&&d({action:c,location:w.location,delta:1})}function E(C,S){c="REPLACE";let N=r2(C)?C:ug(w.location,C,S);m=p();let R=a2(N,m),M=w.createHref(N.unstable_mask||N);o.replaceState(R,"",M),l&&d&&d({action:c,location:w.location,delta:0})}function v(C){return kA(C)}let w={get action(){return c},get location(){return e(i,o)},listen(C){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(n2,g),d=C,()=>{i.removeEventListener(n2,g),d=null}},createHref(C){return t(i,C)},createURL:v,encodeLocation(C){let S=v(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:E,go(C){return o.go(C)}};return w}function kA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Rn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Bc(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Cv(e,t,n="/"){return wA(e,t,n,!1)}function wA(e,t,n,r){let i=typeof t=="string"?iu(t):t,l=ri(i.pathname||"/",n);if(l==null)return null;let o=Sv(e);CA(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let m=PA(l);c=jA(o[d],m,r)}return c}function Sv(e,t=[],n=[],r="",i=!1){let l=(o,c,d=i,m)=>{let p={relativePath:m===void 0?o.path||"":m,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&d)return;Rn(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let g=gs([r,p.relativePath]),y=n.concat(p);o.children&&o.children.length>0&&(Rn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Sv(o.children,t,y,g,d)),!(o.path==null&&!o.index)&&t.push({path:g,score:OA(g,o.index),routesMeta:y})};return e.forEach((o,c)=>{var d;if(o.path===""||!((d=o.path)!=null&&d.includes("?")))l(o,c);else for(let m of Nv(o.path))l(o,c,!0,m)}),t}function Nv(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let o=Nv(r.join("/")),c=[];return c.push(...o.map(d=>d===""?l:[l,d].join("/"))),i&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function CA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:DA(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var SA=/^:[\w-]+$/,NA=3,AA=2,RA=1,LA=10,IA=-2,s2=e=>e==="*";function OA(e,t){let n=e.split("/"),r=n.length;return n.some(s2)&&(r+=IA),t&&(r+=AA),n.filter(i=>!s2(i)).reduce((i,l)=>i+(SA.test(l)?NA:l===""?RA:LA),r)}function DA(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function jA(e,t,n=!1){let{routesMeta:r}=e,i={},l="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],m=c===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",g=ah({path:d.relativePath,caseSensitive:d.caseSensitive,end:m},p),y=d.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=ah({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!g)return null;Object.assign(i,g.params),o.push({params:i,pathname:gs([l,g.pathname]),pathnameBase:zA(gs([l,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(l=gs([l,g.pathnameBase]))}return o}function ah(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=MA(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],o=l.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((m,{paramName:p,isOptional:g},y)=>{if(p==="*"){let v=c[y]||"";o=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const E=c[y];return g&&!E?m[p]=void 0:m[p]=(E||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:o,pattern:e}}function MA(e,t=!1,n=!0){Da(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d,m,p)=>{if(r.push({paramName:c,isOptional:d!=null}),d){let g=p.charAt(m+o.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function PA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Da(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ri(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var BA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function UA(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?iu(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=i2(n.substring(1),"/"):l=i2(n,t)):l=t,{pathname:l,search:FA(r),hash:$A(i)}}function i2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function i0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function HA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function d1(e){let t=HA(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Ih(e,t,n,r=!1){let i;typeof e=="string"?i=iu(e):(i={...e},Rn(!i.pathname||!i.pathname.includes("?"),i0("?","pathname","search",i)),Rn(!i.pathname||!i.pathname.includes("#"),i0("#","pathname","hash",i)),Rn(!i.search||!i.search.includes("#"),i0("#","search","hash",i)));let l=e===""||i.pathname==="",o=l?"/":i.pathname,c;if(o==null)c=n;else{let g=t.length-1;if(!r&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),g-=1;i.pathname=y.join("/")}c=g>=0?t[g]:"/"}let d=UA(i,c),m=o&&o!=="/"&&o.endsWith("/"),p=(l||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(m||p)&&(d.pathname+="/"),d}var gs=e=>e.join("/").replace(/\/\/+/g,"/"),zA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$A=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,VA=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function GA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function qA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Av=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rv(e,t){let n=e;if(typeof n!="string"||!BA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Av)try{let l=new URL(window.location.href),o=n.startsWith("//")?new URL(l.protocol+n):new URL(n),c=ri(o.pathname,t);o.origin===l.origin&&c!=null?n=c+o.search+o.hash:i=!0}catch{Da(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Lv=["POST","PUT","PATCH","DELETE"];new Set(Lv);var YA=["GET",...Lv];new Set(YA);var lu=T.createContext(null);lu.displayName="DataRouter";var Oh=T.createContext(null);Oh.displayName="DataRouterState";var Iv=T.createContext(!1);function WA(){return T.useContext(Iv)}var Ov=T.createContext({isTransitioning:!1});Ov.displayName="ViewTransition";var QA=T.createContext(new Map);QA.displayName="Fetchers";var XA=T.createContext(null);XA.displayName="Await";var da=T.createContext(null);da.displayName="Navigation";var Qc=T.createContext(null);Qc.displayName="Location";var Ma=T.createContext({outlet:null,matches:[],isDataRoute:!1});Ma.displayName="Route";var f1=T.createContext(null);f1.displayName="RouteError";var Dv="REACT_ROUTER_ERROR",KA="REDIRECT",ZA="ROUTE_ERROR_RESPONSE";function JA(e){if(e.startsWith(`${Dv}:${KA}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function e5(e){if(e.startsWith(`${Dv}:${ZA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new VA(t.status,t.statusText,t.data)}catch{}}function t5(e,{relative:t}={}){Rn(ou(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(da),{hash:i,pathname:l,search:o}=Xc(e,{relative:t}),c=l;return n!=="/"&&(c=l==="/"?n:gs([n,l])),r.createHref({pathname:c,search:o,hash:i})}function ou(){return T.useContext(Qc)!=null}function fa(){return Rn(ou(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(Qc).location}var jv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Mv(e){T.useContext(da).static||T.useLayoutEffect(e)}function Za(){let{isDataRoute:e}=T.useContext(Ma);return e?b5():n5()}function n5(){Rn(ou(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(lu),{basename:t,navigator:n}=T.useContext(da),{matches:r}=T.useContext(Ma),{pathname:i}=fa(),l=JSON.stringify(d1(r)),o=T.useRef(!1);return Mv(()=>{o.current=!0}),T.useCallback((d,m={})=>{if(Da(o.current,jv),!o.current)return;if(typeof d=="number"){n.go(d);return}let p=Ih(d,JSON.parse(l),i,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:gs([t,p.pathname])),(m.replace?n.replace:n.push)(p,m.state,m)},[t,n,l,i,e])}var r5=T.createContext(null);function a5(e){let t=T.useContext(Ma).outlet;return T.useMemo(()=>t&&T.createElement(r5.Provider,{value:e},t),[t,e])}function s5(){let{matches:e}=T.useContext(Ma),t=e[e.length-1];return t?t.params:{}}function Xc(e,{relative:t}={}){let{matches:n}=T.useContext(Ma),{pathname:r}=fa(),i=JSON.stringify(d1(n));return T.useMemo(()=>Ih(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function i5(e,t){return Pv(e,t)}function Pv(e,t,n){var C;Rn(ou(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(da),{matches:i}=T.useContext(Ma),l=i[i.length-1],o=l?l.params:{},c=l?l.pathname:"/",d=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";Uv(c,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=fa(),g;if(t){let S=typeof t=="string"?iu(t):t;Rn(d==="/"||((C=S.pathname)==null?void 0:C.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${S.pathname}" was given in the \`location\` prop.`),g=S}else g=p;let y=g.pathname||"/",E=y;if(d!=="/"){let S=d.replace(/^\//,"").split("/");E="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=Cv(e,{pathname:E});Da(m||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Da(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=d5(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:gs([d,r.encodeLocation?r.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?d:gs([d,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,n);return t&&w?T.createElement(Qc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},w):w}function l5(){let e=g5(),t=GA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:l},"ErrorBoundary")," or"," ",T.createElement("code",{style:l},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:i},n):null,o)}var o5=T.createElement(l5,null),Bv=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=e5(e.digest);n&&(e=n)}let t=e!==void 0?T.createElement(Ma.Provider,{value:this.props.routeContext},T.createElement(f1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(u5,{error:e},t):t}};Bv.contextType=Iv;var l0=new WeakMap;function u5({children:e,error:t}){let{basename:n}=T.useContext(da);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=JA(t.digest);if(r){let i=l0.get(t);if(i)throw i;let l=Rv(r.location,n);if(Av&&!l0.get(t))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw l0.set(t,o),o}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function c5({routeContext:e,match:t,children:n}){let r=T.useContext(lu);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(Ma.Provider,{value:e},n)}function d5(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,l=r==null?void 0:r.errors;if(l!=null){let p=i.findIndex(g=>g.route.id&&(l==null?void 0:l[g.route.id])!==void 0);Rn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,p+1))}let o=!1,c=-1;if(n&&r){o=r.renderFallback;for(let p=0;p<i.length;p++){let g=i[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=p),g.route.id){let{loaderData:y,errors:E}=r,v=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!E||E[g.route.id]===void 0);if(g.route.lazy||v){n.isStatic&&(o=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let d=n==null?void 0:n.onError,m=r&&d?(p,g)=>{var y,E;d(p,{location:r.location,params:((E=(y=r.matches)==null?void 0:y[0])==null?void 0:E.params)??{},unstable_pattern:qA(r.matches),errorInfo:g})}:void 0;return i.reduceRight((p,g,y)=>{let E,v=!1,w=null,C=null;r&&(E=l&&g.route.id?l[g.route.id]:void 0,w=g.route.errorElement||o5,o&&(c<0&&y===0?(Uv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,C=null):c===y&&(v=!0,C=g.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,y+1)),N=()=>{let R;return E?R=w:v?R=C:g.route.Component?R=T.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=p,T.createElement(c5,{match:g,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:R})};return r&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?T.createElement(Bv,{location:r.location,revalidation:r.revalidation,component:w,error:E,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):N()},null)}function h1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function f5(e){let t=T.useContext(lu);return Rn(t,h1(e)),t}function h5(e){let t=T.useContext(Oh);return Rn(t,h1(e)),t}function m5(e){let t=T.useContext(Ma);return Rn(t,h1(e)),t}function m1(e){let t=m5(e),n=t.matches[t.matches.length-1];return Rn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function p5(){return m1("useRouteId")}function g5(){var r;let e=T.useContext(f1),t=h5("useRouteError"),n=m1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function b5(){let{router:e}=f5("useNavigate"),t=m1("useNavigate"),n=T.useRef(!1);return Mv(()=>{n.current=!0}),T.useCallback(async(i,l={})=>{Da(n.current,jv),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var l2={};function Uv(e,t,n){!t&&!l2[e]&&(l2[e]=!0,Da(!1,n))}T.memo(x5);function x5({routes:e,future:t,state:n,isStatic:r,onError:i}){return Pv(e,void 0,{state:n,isStatic:r,onError:i})}function y5({to:e,replace:t,state:n,relative:r}){Rn(ou(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=T.useContext(da);Da(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=T.useContext(Ma),{pathname:o}=fa(),c=Za(),d=Ih(e,d1(l),o,r==="path"),m=JSON.stringify(d);return T.useEffect(()=>{c(JSON.parse(m),{replace:t,state:n,relative:r})},[c,m,r,t,n]),null}function E5(e){return a5(e.context)}function Zs(e){Rn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function _5({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:l=!1,unstable_useTransitions:o}){Rn(!ou(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=T.useMemo(()=>({basename:c,navigator:i,static:l,unstable_useTransitions:o,future:{}}),[c,i,l,o]);typeof n=="string"&&(n=iu(n));let{pathname:m="/",search:p="",hash:g="",state:y=null,key:E="default",unstable_mask:v}=n,w=T.useMemo(()=>{let C=ri(m,c);return C==null?null:{location:{pathname:C,search:p,hash:g,state:y,key:E,unstable_mask:v},navigationType:r}},[c,m,p,g,y,E,r,v]);return Da(w!=null,`<Router basename="${c}"> is not able to match the URL "${m}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:T.createElement(da.Provider,{value:d},T.createElement(Qc.Provider,{children:t,value:w}))}function T5({children:e,location:t}){return i5(cg(e),t)}function cg(e,t=[]){let n=[];return T.Children.forEach(e,(r,i)=>{if(!T.isValidElement(r))return;let l=[...t,i];if(r.type===T.Fragment){n.push.apply(n,cg(r.props.children,l));return}Rn(r.type===Zs,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Rn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=cg(r.props.children,l)),n.push(o)}),n}var Yf="get",Wf="application/x-www-form-urlencoded";function Dh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function v5(e){return Dh(e)&&e.tagName.toLowerCase()==="button"}function k5(e){return Dh(e)&&e.tagName.toLowerCase()==="form"}function w5(e){return Dh(e)&&e.tagName.toLowerCase()==="input"}function C5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function S5(e,t){return e.button===0&&(!t||t==="_self")&&!C5(e)}function dg(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function N5(e,t){let n=dg(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}var Ef=null;function A5(){if(Ef===null)try{new FormData(document.createElement("form"),0),Ef=!1}catch{Ef=!0}return Ef}var R5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function o0(e){return e!=null&&!R5.has(e)?(Da(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wf}"`),null):e}function L5(e,t){let n,r,i,l,o;if(k5(e)){let c=e.getAttribute("action");r=c?ri(c,t):null,n=e.getAttribute("method")||Yf,i=o0(e.getAttribute("enctype"))||Wf,l=new FormData(e)}else if(v5(e)||w5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?ri(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Yf,i=o0(e.getAttribute("formenctype"))||o0(c.getAttribute("enctype"))||Wf,l=new FormData(c,e),!A5()){let{name:m,type:p,value:g}=e;if(p==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,g)}}else{if(Dh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Yf,r=null,i=Wf,o=e}return l&&i==="text/plain"&&(o=l,l=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:l,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function p1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hv(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&ri(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function I5(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function O5(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function D5(e,t,n){let r=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let o=await I5(l,n);return o.links?o.links():[]}return[]}));return B5(r.flat(1).filter(O5).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function o2(e,t,n,r,i,l){let o=(d,m)=>n[m]?d.route.id!==n[m].route.id:!0,c=(d,m)=>{var p;return n[m].pathname!==d.pathname||((p=n[m].route.path)==null?void 0:p.endsWith("*"))&&n[m].params["*"]!==d.params["*"]};return l==="assets"?t.filter((d,m)=>o(d,m)||c(d,m)):l==="data"?t.filter((d,m)=>{var g;let p=r.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(o(d,m)||c(d,m))return!0;if(d.route.shouldRevalidate){let y=d.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function j5(e,t,{includeHydrateFallback:n}={}){return M5(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function M5(e){return[...new Set(e)]}function P5(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function B5(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let l=JSON.stringify(P5(i));return n.has(l)||(n.add(l),r.push({key:l,link:i})),r},[])}function g1(){let e=T.useContext(lu);return p1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function U5(){let e=T.useContext(Oh);return p1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var b1=T.createContext(void 0);b1.displayName="FrameworkContext";function x1(){let e=T.useContext(b1);return p1(e,"You must render this element inside a <HydratedRouter> element"),e}function H5(e,t){let n=T.useContext(b1),[r,i]=T.useState(!1),[l,o]=T.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:m,onMouseLeave:p,onTouchStart:g}=t,y=T.useRef(null);T.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=S=>{S.forEach(N=>{o(N.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),T.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let E=()=>{i(!0)},v=()=>{i(!1),o(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:lc(c,E),onBlur:lc(d,v),onMouseEnter:lc(m,E),onMouseLeave:lc(p,v),onTouchStart:lc(g,E)}]:[!1,y,{}]}function lc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function z5({page:e,...t}){let n=WA(),{router:r}=g1(),i=T.useMemo(()=>Cv(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?T.createElement($5,{page:e,matches:i,...t}):T.createElement(V5,{page:e,matches:i,...t}):null}function F5(e){let{manifest:t,routeModules:n}=x1(),[r,i]=T.useState([]);return T.useEffect(()=>{let l=!1;return D5(e,t,n).then(o=>{l||i(o)}),()=>{l=!0}},[e,t,n]),r}function $5({page:e,matches:t,...n}){let r=fa(),{future:i}=x1(),{basename:l}=g1(),o=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let c=Hv(e,l,i.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,m=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?d=!0:m.push(p.route.id);return d&&m.length>0&&c.searchParams.set("_routes",m.join(",")),[c.pathname+c.search]},[l,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return T.createElement(T.Fragment,null,o.map(c=>T.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...n})))}function V5({page:e,matches:t,...n}){let r=fa(),{future:i,manifest:l,routeModules:o}=x1(),{basename:c}=g1(),{loaderData:d,matches:m}=U5(),p=T.useMemo(()=>o2(e,t,m,l,r,"data"),[e,t,m,l,r]),g=T.useMemo(()=>o2(e,t,m,l,r,"assets"),[e,t,m,l,r]),y=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(N=>{var M;let R=l.routes[N.route.id];!R||!R.hasLoader||(!p.some(Y=>Y.route.id===N.route.id)&&N.route.id in d&&((M=o[N.route.id])!=null&&M.shouldRevalidate)||R.hasClientLoader?C=!0:w.add(N.route.id))}),w.size===0)return[];let S=Hv(e,c,i.unstable_trailingSlashAwareDataRequests,"data");return C&&w.size>0&&S.searchParams.set("_routes",t.filter(N=>w.has(N.route.id)).map(N=>N.route.id).join(",")),[S.pathname+S.search]},[c,i.unstable_trailingSlashAwareDataRequests,d,r,l,p,t,e,o]),E=T.useMemo(()=>j5(g,l),[g,l]),v=F5(g);return T.createElement(T.Fragment,null,y.map(w=>T.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),E.map(w=>T.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),v.map(({key:w,link:C})=>T.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function G5(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var q5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{q5&&(window.__reactRouterVersion="7.14.0")}catch{}function Y5({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=T.useRef();i.current==null&&(i.current=_A({window:r,v5Compat:!0}));let l=i.current,[o,c]=T.useState({action:l.action,location:l.location}),d=T.useCallback(m=>{n===!1?c(m):T.startTransition(()=>c(m))},[n]);return T.useLayoutEffect(()=>l.listen(d),[l,d]),T.createElement(_5,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var zv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ai=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:l,replace:o,unstable_mask:c,state:d,target:m,to:p,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:E,...v},w){let{basename:C,navigator:S,unstable_useTransitions:N}=T.useContext(da),R=typeof p=="string"&&zv.test(p),M=Rv(p,C);p=M.to;let Y=t5(p,{relative:i}),U=fa(),P=null;if(c){let ne=Ih(c,[],U.unstable_mask?U.unstable_mask.pathname:"/",!0);C!=="/"&&(ne.pathname=ne.pathname==="/"?C:gs([C,ne.pathname])),P=S.createHref(ne)}let[q,le,X]=H5(r,v),fe=K5(p,{replace:o,unstable_mask:c,state:d,target:m,preventScrollReset:g,relative:i,viewTransition:y,unstable_defaultShouldRevalidate:E,unstable_useTransitions:N});function F(ne){t&&t(ne),ne.defaultPrevented||fe(ne)}let Te=!(M.isExternal||l),me=T.createElement("a",{...v,...X,href:(Te?P:void 0)||M.absoluteURL||Y,onClick:Te?F:t,ref:G5(w,le),target:m,"data-discover":!R&&n==="render"?"true":void 0});return q&&!R?T.createElement(T.Fragment,null,me,T.createElement(z5,{page:Y})):me});ai.displayName="Link";var W5=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:l,to:o,viewTransition:c,children:d,...m},p){let g=Xc(o,{relative:m.relative}),y=fa(),E=T.useContext(Oh),{navigator:v,basename:w}=T.useContext(da),C=E!=null&&n6(g)&&c===!0,S=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,N=y.pathname,R=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(N=N.toLowerCase(),R=R?R.toLowerCase():null,S=S.toLowerCase()),R&&w&&(R=ri(R,w)||R);const M=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let Y=N===S||!i&&N.startsWith(S)&&N.charAt(M)==="/",U=R!=null&&(R===S||!i&&R.startsWith(S)&&R.charAt(S.length)==="/"),P={isActive:Y,isPending:U,isTransitioning:C},q=Y?t:void 0,le;typeof r=="function"?le=r(P):le=[r,Y?"active":null,U?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let X=typeof l=="function"?l(P):l;return T.createElement(ai,{...m,"aria-current":q,className:le,ref:p,style:X,to:o,viewTransition:c},typeof d=="function"?d(P):d)});W5.displayName="NavLink";var Q5=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:l,method:o=Yf,action:c,onSubmit:d,relative:m,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:y,...E},v)=>{let{unstable_useTransitions:w}=T.useContext(da),C=e6(),S=t6(c,{relative:m}),N=o.toLowerCase()==="get"?"get":"post",R=typeof c=="string"&&zv.test(c),M=Y=>{if(d&&d(Y),Y.defaultPrevented)return;Y.preventDefault();let U=Y.nativeEvent.submitter,P=(U==null?void 0:U.getAttribute("formmethod"))||o,q=()=>C(U||Y.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:l,relative:m,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:y});w&&n!==!1?T.startTransition(()=>q()):q()};return T.createElement("form",{ref:v,method:N,action:S,onSubmit:r?d:M,...E,"data-discover":!R&&e==="render"?"true":void 0})});Q5.displayName="Form";function X5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fv(e){let t=T.useContext(lu);return Rn(t,X5(e)),t}function K5(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:m}={}){let p=Za(),g=fa(),y=Xc(e,{relative:o});return T.useCallback(E=>{if(S5(E,t)){E.preventDefault();let v=n!==void 0?n:Bc(g)===Bc(y),w=()=>p(e,{replace:v,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d});m?T.startTransition(()=>w()):w()}},[g,p,y,n,r,i,t,e,l,o,c,d,m])}function $v(e){Da(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=T.useRef(dg(e)),n=T.useRef(!1),r=fa(),i=T.useMemo(()=>N5(r.search,n.current?null:t.current),[r.search]),l=Za(),o=T.useCallback((c,d)=>{const m=dg(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,l("?"+m,d)},[l,i]);return[i,o]}var Z5=0,J5=()=>`__${String(++Z5)}__`;function e6(){let{router:e}=Fv("useSubmit"),{basename:t}=T.useContext(da),n=p5(),r=e.fetch,i=e.navigate;return T.useCallback(async(l,o={})=>{let{action:c,method:d,encType:m,formData:p,body:g}=L5(l,t);if(o.navigate===!1){let y=o.fetcherKey||J5();await r(y,n,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||d,formEncType:o.encType||m,flushSync:o.flushSync})}else await i(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||d,formEncType:o.encType||m,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function t6(e,{relative:t}={}){let{basename:n}=T.useContext(da),r=T.useContext(Ma);Rn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),l={...Xc(e||".",{relative:t})},o=fa();if(e==null){l.search=o.search;let c=new URLSearchParams(l.search),d=c.getAll("index");if(d.some(p=>p==="")){c.delete("index"),d.filter(g=>g).forEach(g=>c.append("index",g));let p=c.toString();l.search=p?`?${p}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:gs([n,l.pathname])),Bc(l)}function n6(e,{relative:t}={}){let n=T.useContext(Ov);Rn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Fv("useViewTransitionState"),i=Xc(e,{relative:t});if(!n.isTransitioning)return!1;let l=ri(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ri(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ah(i.pathname,o)!=null||ah(i.pathname,l)!=null}var uu=wv();const Vv=T.createContext(null);function Kl(){return T.useContext(Vv)}class Vt extends Error{constructor(t,n){super(n.message),this.statusCode=t,this.payload=n}}async function ot(e,t){const n=new Headers(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!(t.body instanceof FormData)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const r=await fetch(e,{headers:n,...t});if(!r.ok){const i=await r.json();throw new Vt(r.status,i)}return await r.json()}function r6(e){const t=String(e);return t.includes("/exports/pdf")?t.includes("format=html")?"remote-codex-transcript.html":"remote-codex-transcript.pdf":"download"}function a6(e){var i;if(!e)return null;const t=e.match(/filename\*=UTF-8''([^;]+)/i);if(t!=null&&t[1])try{return decodeURIComponent(t[1].trim())}catch{return t[1].trim()}const n=e.match(/filename="([^"]+)"/i);if(n!=null&&n[1])return n[1].trim();const r=e.match(/filename=([^;]+)/i);return((i=r==null?void 0:r[1])==null?void 0:i.trim())??null}async function s6(e,t){const n=await fetch(e,t);if(!n.ok){let i=null;try{i=await n.json()}catch{i=null}throw new Vt(n.status,i??{code:"internal_error",message:"Unable to download file."})}const r=a6(n.headers.get("content-disposition"))??r6(e);return{blob:await n.blob(),filename:r}}function u2(e,t){const n=e.originalName.trim();if(n)return n;const r=e.file.name.trim();return r||(e.kind==="photo"?`photo-${t+1}.jpg`:`file-${t+1}`)}function i6(){return ot("/api/config/runtime")}function Gv(){return ot("/api/config/workspace-settings",{cache:"no-store"})}function l6(e){return ot("/api/config/workspace-settings",{method:"PATCH",body:JSON.stringify(e)})}function qv(){return ot("/api/agent-runtimes",{cache:"no-store"})}function Yv(e){return ot(`/api/agent-runtimes/${encodeURIComponent(e)}/status`,{cache:"no-store"})}function o6(e){return ot(`/api/agent-runtimes/${encodeURIComponent(e)}/restart`,{method:"POST"})}function fg(e){return ot(`/api/agent-runtimes/${encodeURIComponent(e)}/models`,{cache:"no-store"})}function hg(e,t){return ot(`/api/config/providers/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{cache:"no-store"})}function mg(e,t,n){return ot(`/api/config/providers/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}function u6(e){return ot(`/api/config/providers/${encodeURIComponent(e)}/archives`,{cache:"no-store"})}function c6(e,t={}){return ot(`/api/config/providers/${encodeURIComponent(e)}/archives`,{method:"POST",body:JSON.stringify(t)})}function d6(e,t,n){return ot(`/api/config/providers/${encodeURIComponent(e)}/archives/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(n)})}function f6(e,t){return ot(`/api/config/providers/${encodeURIComponent(e)}/archives/${encodeURIComponent(t)}/apply`,{method:"POST"})}function h6(e){return ot(`/api/agent-runtimes/${encodeURIComponent(e)}/build-restart`,{method:"POST"})}function m6(){return ot("/healthz",{cache:"no-store"})}function y1(){return ot("/api/workspaces")}function Wv(){return ot("/api/threads")}function c2(e,t={}){const n=new URLSearchParams;return t.limit!==void 0&&n.set("limit",String(t.limit)),t.beforeTurnId&&n.set("beforeTurnId",t.beforeTurnId),ot(`/api/threads/${e}${n.size>0?`?${n.toString()}`:""}`)}function p6(e,t){return ot(`/api/threads/${e}/items/${encodeURIComponent(t)}/detail`)}function g6(e){return ot(`/api/threads/${e}/export-turns`,{cache:"no-store"})}function b6(e,t){var r,i,l;const n=new URLSearchParams;return t.format!==void 0&&n.set("format",t.format),n.set("mode",t.mode),t.limit!==void 0&&n.set("limit",String(t.limit)),t.turnIds!==void 0&&n.set("turnIds",t.turnIds.join(",")),t.profile!==void 0&&n.set("profile",t.profile),((r=t.options)==null?void 0:r.includeTokenAndPrice)!==void 0&&n.set("includeTokenAndPrice",String(t.options.includeTokenAndPrice)),((i=t.options)==null?void 0:i.includeCommandOutput)!==void 0&&n.set("includeCommandOutput",String(t.options.includeCommandOutput)),((l=t.options)==null?void 0:l.includeAbsolutePaths)!==void 0&&n.set("includeAbsolutePaths",String(t.options.includeAbsolutePaths)),`/api/threads/${encodeURIComponent(e)}/exports/pdf?${n.toString()}`}function x6(e,t){return s6(b6(e,t),{cache:"no-store"})}function y6(e){return ot(`/api/threads/${e}/shell`)}function E6(e){return ot("/api/threads/start",{method:"POST",body:JSON.stringify(e)})}function _6(e){return ot("/api/threads/import",{method:"POST",body:JSON.stringify({sessionId:e})})}function T6(e,t={}){return ot(`/api/threads/${e}/shell`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function v6(e){return ot(`/api/shells/${e}/terminate`,{method:"POST"})}function d2(e,t={}){return ot(`/api/threads/${e}/resume`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function k6(e){return ot(`/api/threads/${e}/disconnect`,{method:"POST"})}function w6(e,t){const n=t.attachments??[];if(n.length===0)return ot(`/api/threads/${e}/prompt`,{method:"POST",body:JSON.stringify(t)});const r=new FormData;r.append("prompt",t.prompt),t.clientRequestId!==void 0&&r.append("clientRequestId",t.clientRequestId),t.model!==void 0&&r.append("model",t.model),t.reasoningEffort!==void 0&&t.reasoningEffort!==null&&r.append("reasoningEffort",t.reasoningEffort),t.collaborationMode!==void 0&&r.append("collaborationMode",t.collaborationMode),t.sandboxMode!==void 0&&t.sandboxMode!==null&&r.append("sandboxMode",t.sandboxMode);const i=n.map((l,o)=>({clientId:l.clientId,kind:l.kind,originalName:u2(l,o),placeholder:l.placeholder}));r.append("attachmentManifest",JSON.stringify(i));for(const[l,o]of n.entries())r.append("attachments",o.file,u2(o,l));return ot(`/api/threads/${e}/prompt`,{method:"POST",body:r})}function f2(e,t={}){return ot(`/api/threads/${e}/interrupt`,{method:"POST",body:JSON.stringify(t)})}function Qv(e,t){return ot(`/api/threads/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function C6(e){return ot(`/api/threads/${e}`,{method:"DELETE"})}function S6(e,t){return ot(`/api/threads/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}function N6(e){return ot(`/api/threads/${e}/compact`,{method:"POST"})}function A6(e){return ot(`/api/threads/${e}/goal`,{cache:"no-store"})}function R6(e,t){return ot(`/api/threads/${e}/goal`,{method:"PATCH",body:JSON.stringify(t)})}function L6(e){return ot(`/api/threads/${e}/goal`,{method:"DELETE"})}function I6(e){return ot(`/api/threads/${e}/fork-turns`,{cache:"no-store"})}function h2(e,t){return ot(`/api/threads/${e}/fork`,{method:"POST",body:JSON.stringify(t)})}function O6(e){return ot(`/api/threads/${e}/skills`,{cache:"no-store"})}function D6(e){return ot(`/api/threads/${e}/mcp-servers`,{cache:"no-store"})}function j6(e){return ot(`/api/threads/${e}/hooks`,{cache:"no-store"})}function M6(e,t){return ot(`/api/threads/${e}/hooks`,{method:"POST",body:JSON.stringify(t)})}function P6(e,t){return ot(`/api/threads/${e}/hooks`,{method:"PUT",body:JSON.stringify(t)})}function B6(e,t){return ot(`/api/threads/${e}/hooks/trust`,{method:"POST",body:JSON.stringify(t)})}function U6(e,t){return ot(`/api/threads/${e}/hooks/untrust`,{method:"POST",body:JSON.stringify(t)})}function H6(e,t,n){return ot(`/api/threads/${e}/requests/${encodeURIComponent(t)}/respond`,{method:"POST",body:JSON.stringify(n)})}function z6(e){return ot("/api/workspaces",{method:"POST",body:JSON.stringify(e)})}function F6(e,t){return ot(`/api/workspaces/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function $6(e){return ot(`/api/workspaces/${e}`,{method:"DELETE"})}function V6(e,t){return ot(`/api/workspaces/${e}/favorite`,{method:"POST",body:JSON.stringify(t)})}function Xv(e){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host,r=new WebSocket(`${t}//${n}/ws`);return r.addEventListener("message",i=>{try{const l=JSON.parse(i.data);"threadId"in l&&l.type.startsWith("thread.")&&e(l)}catch{}}),r}function G6(e={}){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host,r=new WebSocket(`${t}//${n}/ws`);return r.addEventListener("message",i=>{var l,o;try{const c=JSON.parse(i.data);if(c.type==="supervisor.connected"){(l=e.onConnected)==null||l.call(e,c);return}"shellId"in c&&c.type.startsWith("shell.")&&((o=e.onShellEvent)==null||o.call(e,c))}catch{}}),{socket:r,send(i){r.send(JSON.stringify(i))}}}function q6(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M2 3.25h12v1.5H2Zm0 4h12v1.5H2Zm0 4h12v1.5H2Z"})})}function pg(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})}function m2(e=!1){return`flex w-full items-center rounded-[0.95rem] px-3 py-2 text-left text-sm transition ${e?"cursor-not-allowed bg-[var(--theme-muted)] text-[var(--theme-fg-muted)]":"text-[var(--theme-fg)] hover:bg-[var(--theme-hover)]"}`}const Y6=[{value:"light",label:"Light",description:"Always use the bright theme."},{value:"dark",label:"Dark",description:"Always use the dark theme."},{value:"system",label:"System",description:"Follow the operating system appearance."}],Kv={hostConfigFiles:[],toolboxItems:[],hookCommandTemplates:[],providerConfigFormat:"none",mcpConfigFormat:"none",configArchives:!1,buildRestart:!1};function p2(e,t){return{provider:e,displayName:t,description:`${t} backend descriptor is not available.`,enabled:!1,isDefault:e==="codex",status:{state:"stopped",transport:e==="claude"?"sdk":"none",lastStartedAt:null,lastError:"Backend descriptor is not available.",restartCount:0},capabilities:{sessions:{list:!1,read:!1,resume:!1,importLocal:!1},turns:{start:!1,streamInput:!1,steer:!1,interrupt:!1,compact:!1},branching:{fork:!1,hardRollback:!1,resumeAt:!1,rewindFiles:!1},controls:{planMode:!1,permissionRequests:!1,sandboxMode:!1,performanceMode:!1,goals:!1},management:{models:!1,mcpStatus:!1,skills:!1,hooks:!1,hookTrust:!1,hostConfigFiles:!1,providerSettings:!1},usage:{contextWindow:!1,tokenUsage:!1,costUsd:!1}},managementSchema:Kv}}const Go=[p2("codex","Codex"),p2("claude","Claude")];function W6(e){var t;return((t=Go.find(n=>n.provider===e))==null?void 0:t.managementSchema)??Kv}function Q6(e){const t=e.filter(r=>r.enabled).length,n=e.length;return t>1?"New threads use the selected backend. Each backend exposes its own tools and settings.":n>t?"New threads use the selected backend. Additional backends appear here when configured.":"New threads use the selected backend."}function X6(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function oc(e){return{path:e,exists:!1,originalContent:"",draftContent:"",loading:!1,saving:!1,error:null,saveMessage:null}}function E1({className:e=""}){const t=Kl();return t?f.jsx("button",{type:"button","aria-label":t.navOpen?"Close Navigation":"Open Navigation","aria-expanded":t.navOpen,"aria-controls":"app-shell-navigation-menu",onClick:t.toggleNav,className:`inline-flex h-10 w-10 shrink-0 items-center justify-center text-[var(--theme-fg)] transition hover:text-[var(--theme-fg-soft)] ${e}`.trim(),children:t.navOpen?f.jsx(pg,{}):f.jsx(q6,{})}):null}function _1({className:e=""}){const t=Kl(),n=fa(),r=Za(),i=T.useRef(null),l=n.pathname==="/workspaces";return T.useEffect(()=>{if(!(t!=null&&t.navOpen))return;const o=t;function c(d){const m=d.target;if(!m)return;const p=i.current;p!=null&&p.contains(m)||m instanceof Element&&m.closest('[aria-controls="app-shell-navigation-menu"]')||o.closeNav()}return document.addEventListener("pointerdown",c),()=>{document.removeEventListener("pointerdown",c)}},[t]),t!=null&&t.navOpen?f.jsxs("div",{ref:i,id:"app-shell-navigation-menu",onPointerDown:o=>{o.stopPropagation()},onMouseDown:o=>{o.stopPropagation()},onTouchStart:o=>{o.stopPropagation()},className:`rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] p-4 shadow-2xl shadow-black/15 backdrop-blur ${e}`.trim(),children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-base font-semibold tracking-wide text-[var(--theme-accent-strong)]",children:"Remote Codex"}),f.jsx("p",{className:"mt-1 text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Navigation"})]}),f.jsxs("nav",{className:"mt-4 flex flex-col gap-1.5 text-sm",children:[f.jsx("button",{type:"button",disabled:l,onClick:()=>{l||(t.closeNav(),r("/workspaces"))},className:m2(l),children:"Workspaces"}),f.jsx("button",{type:"button",onClick:()=>{t.openSettings()},className:m2(),children:"Settings"})]})]}):null}function K6(){const e=Kl(),[t,n]=T.useState(null),[r,i]=T.useState({}),l=t?r[t]:null,[o,c]=T.useState({busy:!1,message:null,error:null}),[d,m]=T.useState([]),[p,g]=T.useState(Go),[y,E]=T.useState({loading:!1,saving:!1,error:null}),[v,w]=T.useState(null),[C,S]=T.useState({devHomeDraft:"",backendDraft:"codex",loading:!1,saving:!1,message:null,error:null}),[N,R]=T.useState({loading:!1,creating:!1,applyingId:null,renamingId:null,renameDraft:"",message:null,error:null}),M=(e==null?void 0:e.themeMode)??"system",Y=(e==null?void 0:e.effectiveTheme)??"dark",U=(e==null?void 0:e.defaultBackend)??"codex",P=p.find(z=>z.provider===U)??Go.find(z=>z.provider===U)??Go[0],q=P.managementSchema??W6(P.provider),le=q.hostConfigFiles;T.useEffect(()=>{if(!(e!=null&&e.settingsOpen)||!q.configArchives)return;const z=e;function Z(ce){ce.key==="Escape"&&z.closeSettings()}return window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let z=!1;return E(Z=>({...Z,loading:!0,error:null})),qv().then(Z=>{if(z)return;const ce=[...Z,...Go.filter(A=>!Z.some(H=>H.provider===A.provider))];g(ce),E(A=>({...A,loading:!1}))}).catch(Z=>{z||(g(Go),E(ce=>({...ce,loading:!1,error:Z instanceof Vt?Z.message:"Unable to load backend settings."})))}),()=>{z=!0}},[e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let z=!1;return S(Z=>({...Z,loading:!0,message:null,error:null})),Gv().then(Z=>{z||(w(Z),e.setDefaultBackend(Z.defaultBackend),S(ce=>({...ce,devHomeDraft:Z.devHome,backendDraft:Z.defaultBackend,loading:!1})))}).catch(Z=>{z||S(ce=>({...ce,loading:!1,error:Z instanceof Vt?Z.message:"Unable to load workspace settings."}))}),()=>{z=!0}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen)||!P.capabilities.management.hostConfigFiles)return;let z=!1;async function Z(){i(A=>{const H={...A};for(const te of le)H[te.name]={...oc(te.name),...A[te.name],loading:!0,saving:!1,error:null,saveMessage:null};return H});const ce=await Promise.allSettled(le.map(async A=>({name:A.name,result:await hg(P.provider,A.name)})));z||i(A=>{var te,O;const H={...A};for(const ve of ce){if(ve.status==="fulfilled"){const{name:Qe,result:Ve}=ve.value;H[Qe]={path:Ve.path,exists:Ve.exists,originalContent:Ve.content,draftContent:Ve.content,loading:!1,saving:!1,error:null,saveMessage:null};continue}const Re=ve.reason instanceof Vt?ve.reason.message:"Unable to load the file.",Ne=((te=le[ce.indexOf(ve)])==null?void 0:te.name)??((O=le[0])==null?void 0:O.name);Ne&&(H[Ne]={...oc(Ne),...H[Ne],loading:!1,saving:!1,error:Re,saveMessage:null})}return H})}return Z(),()=>{z=!0}},[P.capabilities.management.hostConfigFiles,P.provider,le,e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let z=!1;async function Z(){R(ce=>({...ce,loading:!0,error:null,message:null}));try{const ce=await u6(P.provider);if(z)return;m(ce),R(A=>({...A,loading:!1}))}catch(ce){if(z)return;R(A=>({...A,loading:!1,error:ce instanceof Vt?ce.message:"Unable to load config archives."}))}}return Z(),()=>{z=!0}},[P.provider,q.configArchives,e==null?void 0:e.settingsOpen]);async function X(){if(!o.busy){c({busy:!0,message:null,error:null});try{const z=await o6(P.provider);c({busy:!1,message:z.status.state==="ready"?`${z.displayName} backend restarted.`:`${z.displayName} backend state: ${z.status.state}`,error:null}),g(Z=>Z.map(ce=>ce.provider===z.provider?z:ce))}catch(z){c({busy:!1,message:null,error:z instanceof Vt?z.message:"Unable to restart the app server."})}}}async function fe(){if(!o.busy){c({busy:!0,message:null,error:null});try{await h6(P.provider),c({busy:!1,message:"Build and restart launched. The page may disconnect briefly.",error:null})}catch(z){c({busy:!1,message:null,error:z instanceof Vt?z.message:"Unable to launch build and restart."})}}}async function F(){const z=C.devHomeDraft.trim();if(!(!z||C.saving)){S(Z=>({...Z,saving:!0,message:null,error:null}));try{const Z=await l6({devHome:z,defaultBackend:C.backendDraft});w(Z),e==null||e.setDefaultBackend(Z.defaultBackend),S(ce=>({...ce,devHomeDraft:Z.devHome,backendDraft:Z.defaultBackend,saving:!1,message:"Workspace defaults saved."}))}catch(Z){S(ce=>({...ce,saving:!1,error:Z instanceof Vt?Z.message:"Unable to save workspace settings."}))}}}async function Te(z){const Z=r[z];if(!(!Z||Z.saving)){i(ce=>({...ce,[z]:{...oc(z),...ce[z],saving:!0,error:null,saveMessage:null}}));try{const ce=await mg(P.provider,z,{content:Z.draftContent});i(A=>({...A,[z]:{path:ce.path,exists:ce.exists,originalContent:ce.content,draftContent:ce.content,loading:!1,saving:!1,error:null,saveMessage:"Saved"}}))}catch(ce){i(A=>({...A,[z]:{...oc(z),...A[z],saving:!1,error:ce instanceof Vt?ce.message:"Unable to save the file.",saveMessage:null}}))}}}async function me(){if(!N.creating){R(z=>({...z,creating:!0,message:null,error:null}));try{const z=await c6(P.provider);m(Z=>[z,...Z]),R(Z=>({...Z,creating:!1,message:"Backup created."}))}catch(z){R(Z=>({...Z,creating:!1,error:z instanceof Vt?z.message:"Unable to create a config backup."}))}}}async function ne(z){if(!N.applyingId){R(Z=>({...Z,applyingId:z.id,message:null,error:null}));try{const Z=await f6(P.provider,z.id);R(ce=>({...ce,applyingId:null,message:Z.status.state==="ready"?`Applied "${Z.archive.label}" and restarted ${P.displayName}.`:`Applied "${Z.archive.label}". ${P.displayName} state: ${Z.status.state}.`}))}catch(Z){R(ce=>({...ce,applyingId:null,error:Z instanceof Vt?Z.message:"Unable to apply the config archive."}))}}}async function $(z){const Z=N.renameDraft.trim();if(!(!Z||N.renamingId!==z.id)){R(ce=>({...ce,message:null,error:null}));try{const ce=await d6(P.provider,z.id,{label:Z});m(A=>A.map(H=>H.id===z.id?ce:H)),R(A=>({...A,renamingId:null,renameDraft:"",message:"Backup renamed."}))}catch(ce){R(A=>({...A,error:ce instanceof Vt?ce.message:"Unable to rename the config backup."}))}}}return e!=null&&e.settingsOpen?f.jsxs("div",{className:"fixed inset-0 z-[70] flex items-start justify-center p-4 pt-[max(env(safe-area-inset-top),1rem)] sm:items-center",children:[f.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"ui-overlay-scrim absolute inset-0 backdrop-blur-sm"}),f.jsxs("section",{role:"dialog","aria-modal":"true","aria-label":"Settings",className:"relative z-10 flex max-h-[calc(100vh-2rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/20",children:[f.jsx("div",{className:"shrink-0 p-5 pb-0",children:f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Settings"}),f.jsx("h2",{className:"mt-2 text-xl font-semibold text-[var(--theme-fg)]",children:"Settings"}),f.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Choose the default backend and manage host-side runtime files."})]}),f.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:f.jsx(pg,{})})]})}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5 pt-5",children:f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Appearance"}),f.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:["Choose light, dark, or follow the system setting. Active: ",Y,"."]})]})}),f.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-3",children:Y6.map(z=>{const Z=M===z.value;return f.jsxs("button",{type:"button",onClick:()=>e.setThemeMode(z.value),className:`block rounded-[1rem] border px-3 py-2.5 text-left transition ${Z?"border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)]":"border-[var(--theme-border)] bg-[var(--theme-surface-strong)] hover:bg-[var(--theme-hover)]"}`,children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:z.label}),Z?f.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Active"}):null]}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:z.description})]},z.value)})})]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Backend"}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:Q6(p)})]}),y.loading?f.jsx("span",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Loading"}):null]}),f.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:p.map(z=>{const Z=C.backendDraft===z.provider;return f.jsxs("button",{type:"button",disabled:!z.enabled,onClick:()=>{S(ce=>({...ce,backendDraft:z.provider,message:null,error:null}))},className:`block rounded-[1rem] border px-3 py-2.5 text-left transition disabled:cursor-not-allowed disabled:opacity-60 ${Z?"border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)]":"border-[var(--theme-border)] bg-[var(--theme-surface-strong)] hover:bg-[var(--theme-hover)]"}`,children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:z.displayName}),f.jsx("span",{className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:z.enabled?z.status.state:"Unavailable"})]}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:z.description})]},z.provider)})}),y.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:y.error}):null]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Workspace defaults"}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Git projects clone into dev home. New workspace directories can create one missing child under this path."})]})}),f.jsxs("div",{className:"mt-3 grid gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Workspace root"}),f.jsx("p",{title:(v==null?void 0:v.workspaceRoot)??"Loading workspace root",className:"mt-1 truncate rounded-[0.9rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-2 font-mono text-xs text-[var(--theme-fg-soft)]",children:C.loading&&!v?"Loading...":(v==null?void 0:v.workspaceRoot)??"Unavailable"})]}),f.jsxs("div",{children:[f.jsx("label",{htmlFor:"settings-dev-home",className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Dev home"}),f.jsxs("div",{className:"mt-1 flex flex-col gap-2 sm:flex-row",children:[f.jsx("input",{id:"settings-dev-home",value:C.devHomeDraft,onChange:z=>S(Z=>({...Z,devHomeDraft:z.target.value,message:null,error:null})),placeholder:"/Users/name/dev",className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-2 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),f.jsx("input",{type:"hidden",value:C.backendDraft,readOnly:!0}),f.jsx("button",{type:"button","aria-label":"Save workspace defaults",onClick:()=>void F(),disabled:C.loading||C.saving||!C.devHomeDraft.trim(),className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:C.saving?"Saving...":"Save"})]})]})]}),C.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:C.error}):C.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:C.message}):null]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsxs("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:[P.displayName," runtime"]}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Restart the selected backend after editing host configuration to force a fresh reload."})]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:()=>void X(),disabled:o.busy,className:"rounded-full border border-sky-400/35 bg-sky-400/10 px-3 py-1.5 text-xs font-medium text-sky-500 transition hover:bg-sky-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:o.busy?"Restarting...":"Restart"}),q.buildRestart?f.jsx("button",{type:"button",onClick:()=>void fe(),disabled:o.busy,className:"rounded-full border border-amber-400/35 bg-amber-400/10 px-3 py-1.5 text-xs font-medium text-amber-500 transition hover:bg-amber-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:o.busy?"Working...":"Build and restart"}):null]})]}),o.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:o.error}):o.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:o.message}):null]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Provider host files"}),f.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:[P.displayName," exposes these editable files through its backend schema."]})]})}),f.jsxs("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:[le.map(z=>{const Z=r[z.name]??{path:z.name,exists:!1,originalContent:"",draftContent:"",loading:!1},ce=Z.draftContent!==Z.originalContent;return f.jsx("button",{type:"button",onClick:()=>n(z.name),className:"block rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-left transition hover:bg-[var(--theme-hover)]",children:f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:z.label}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:z.description})]}),f.jsx("div",{className:"shrink-0",children:Z.loading?f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-[var(--theme-fg-muted)]",children:"Loading"}):ce?f.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Unsaved"}):Z.exists?f.jsx("span",{className:"rounded-full border border-emerald-400/25 bg-emerald-400/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-emerald-600 dark:text-emerald-100",children:"Ready"}):f.jsx("span",{className:"rounded-full border border-sky-300/25 bg-sky-300/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-600 dark:text-sky-100",children:"New"})})]})},z.name)}),le.length===0?f.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"This backend does not expose editable host files."}):null]})]}),q.configArchives?f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Config archives"}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Backup the selected backend host files, then apply a saved archive with a backend restart."})]}),f.jsx("button",{type:"button",onClick:()=>void me(),disabled:N.creating,className:"shrink-0 rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-strong)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:N.creating?"Creating...":"Create backup"})]}),N.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:N.error}):N.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:N.message}):null,f.jsx("div",{className:"mt-3 space-y-2",children:N.loading?f.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"Loading backups..."}):d.length===0?f.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No config backups yet."}):d.map(z=>{const Z=N.renamingId===z.id;return f.jsx("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3",children:f.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[f.jsxs("div",{className:"min-w-0",children:[Z?f.jsxs("div",{className:"flex max-w-xl gap-2",children:[f.jsx("input",{"aria-label":`Rename ${z.label}`,value:N.renameDraft,onChange:ce=>R(A=>({...A,renameDraft:ce.target.value,error:null,message:null})),className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),f.jsx("button",{type:"button","aria-label":`Save archive name ${z.label}`,onClick:()=>void $(z),className:"rounded-full bg-[var(--theme-accent-solid)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"Save"}),f.jsx("button",{type:"button",onClick:()=>R(ce=>({...ce,renamingId:null,renameDraft:""})),className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)]",children:"Cancel"})]}):f.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:z.label}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-[var(--theme-fg-muted)]",children:[f.jsxs("span",{children:["Created ",X6(z.createdAt)]}),le.map(ce=>{var A;return f.jsxs("span",{className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-2 py-0.5 font-mono",children:[ce.name,": ",(A=z.files[ce.name])!=null&&A.exists?"saved":"missing"]},ce.name)})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[f.jsx("button",{type:"button",onClick:()=>R(ce=>({...ce,renamingId:z.id,renameDraft:z.label,message:null,error:null})),disabled:Z,className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:text-[var(--theme-fg-muted)]",children:"Rename"}),f.jsx("button",{type:"button",onClick:()=>void ne(z),disabled:N.applyingId!==null,className:"rounded-full border border-emerald-400/35 bg-emerald-400/10 px-3 py-1.5 text-xs font-medium text-emerald-600 transition hover:bg-emerald-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)] dark:text-emerald-100",children:N.applyingId===z.id?"Applying...":"Apply"})]})]})},z.id)})})]}):null]})})]}),t&&l?f.jsx("div",{className:"pointer-events-none fixed inset-0 z-[71] flex items-center justify-center p-4",children:f.jsxs("div",{className:"pointer-events-auto relative z-10 flex max-h-[min(88vh,56rem)] w-full max-w-3xl flex-col overflow-hidden rounded-[1.6rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/25",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--theme-border)] px-4 py-3 sm:px-5",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:t}),f.jsx("p",{className:"mt-1 break-all font-mono text-xs text-[var(--theme-fg-muted)]",children:l.path})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[l.error?f.jsx("span",{className:"text-xs text-rose-300",children:l.error}):l.saveMessage?f.jsx("span",{className:"text-xs text-emerald-300",children:l.saveMessage}):null,f.jsx("button",{type:"button","aria-label":`Save ${t}`,onClick:()=>void Te(t),disabled:l.loading||l.saving||l.draftContent===l.originalContent,className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-sm font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:l.saving?"Saving...":"Save"}),f.jsx("button",{type:"button","aria-label":"Close File Editor",onClick:()=>n(null),className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:f.jsx(pg,{})})]})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 sm:p-5",children:f.jsx("textarea",{"aria-label":`Edit ${t}`,value:l.draftContent,onChange:z=>i(Z=>({...Z,[t]:{...oc(t),...Z[t],draftContent:z.target.value,error:null,saveMessage:null}})),spellCheck:!1,className:"min-h-[28rem] w-full rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 font-mono text-[13px] leading-6 text-[var(--theme-fg)] outline-none transition focus:border-[var(--theme-accent-border)]",placeholder:l.loading?"Loading...":`Edit ${t} here`})})]})}):null]}):null}function u0({eyebrow:e,title:t,description:n}){return f.jsxs("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 p-5 shadow-2xl shadow-stone-950/20",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:e}),f.jsx("h2",{className:"mt-3 text-xl font-semibold text-stone-100",children:t}),f.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]})}function Z6(){const[e,t]=T.useState(null),[n,r]=T.useState(null);return T.useEffect(()=>{i6().then(t).catch(i=>{r(i instanceof Error?i.message:"Unable to load runtime config.")})},[]),f.jsx("div",{className:"min-h-screen bg-stone-950 px-4 py-8 text-stone-100 sm:px-6",children:f.jsx("div",{className:"mx-auto max-w-7xl",children:f.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.2fr_0.8fr]",children:[f.jsxs("section",{className:"rounded-[2rem] border border-stone-800 bg-stone-900 p-8 shadow-2xl shadow-stone-950/20 sm:p-10",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.35em] text-amber-300",children:"Local Supervisor"}),f.jsx("h1",{className:"mt-4 max-w-3xl text-4xl font-semibold tracking-tight text-stone-100 sm:text-6xl",children:"Bring your local workspaces into a mobile-ready control surface."}),f.jsx("p",{className:"mt-6 max-w-2xl text-base leading-7 text-stone-400 sm:text-lg",children:"Phase 1 focuses on a stable supervisor shell: runtime config, workspace onboarding, database bootstrap, and a read-only file tree that already respects workspace root boundaries."}),f.jsxs("div",{className:"mt-8 flex flex-wrap gap-4",children:[f.jsx(ai,{to:"/workspaces",className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200",children:"Enter Workspace Console"}),f.jsx(ai,{to:"/workspaces/new",className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:border-stone-500 hover:bg-stone-800",children:"Add First Workspace"})]})]}),f.jsxs("section",{className:"grid gap-4",children:[f.jsx(u0,{eyebrow:"Health",title:n?"API unavailable":"Supervisor reachable",description:n??`Connected to ${(e==null?void 0:e.appName)??"Remote Codex Supervisor"} ${(e==null?void 0:e.appVersion)??""}`.trim()}),f.jsx(u0,{eyebrow:"Workspace Root",title:(e==null?void 0:e.workspaceRoot)??"Loading root path",description:"The file tree and workspace creation flow stay inside this boundary in Phase 1."}),f.jsx(u0,{eyebrow:"Environment",title:(e==null?void 0:e.environment)??"Loading environment",description:e?`${e.host}:${e.port}`:"Runtime metadata appears here after bootstrap."})]})]})})})}function J6(e){if(!e)return"No time";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function e4(e){switch(e){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function t4({open:e,busy:t=!1,turnsState:n,onCancel:r,onLoadTurns:i,onExport:l}){var M,Y,U;const o=((M=n.data)==null?void 0:M.turns)??[],c=T.useMemo(()=>o.slice(0,10).map(P=>P.turnId),[o]),[d,m]=T.useState("latest"),[p,g]=T.useState(()=>new Set),[y,E]=T.useState(!0),[v,w]=T.useState("pdf");if(T.useEffect(()=>{e&&(m("latest"),w("pdf"),E(!0),i())},[i,e]),T.useEffect(()=>{e&&o.length>0&&g(new Set(c))},[c,e,o.length]),T.useEffect(()=>{if(!e)return;function P(q){q.key==="Escape"&&!t&&r()}return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[t,r,e]),!e)return null;const C=d==="latest"?Math.min(10,((Y=n.data)==null?void 0:Y.totalTurnCount)??10):p.size,S=!t&&(d==="latest"||p.size>0);function N(P){g(q=>{const le=new Set(q);return le.has(P)?le.delete(P):le.add(P),le})}function R(){const P={format:v,mode:d,...d==="latest"?{limit:10}:{turnIds:[...p]},profile:"review",options:{includeTokenAndPrice:y}};l(P)}return uu.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[96] flex items-center justify-center p-3 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close export dialog",onClick:r,disabled:t,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),f.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Export transcript",className:"relative z-[1] flex max-h-[min(46rem,calc(100vh-2rem))] w-full max-w-2xl flex-col rounded-[1.6rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-stone-800 px-5 py-4",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-semibold text-stone-100",children:"Export transcript"}),f.jsx("p",{className:"mt-1 text-xs text-stone-500",children:"Default review copy summarizes command batches and file changes."})]}),f.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,disabled:t,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),f.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[f.jsx("div",{className:"inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["latest","Latest 10"],["selected","Custom selection"]].map(([P,q])=>f.jsx("button",{type:"button",onClick:()=>m(P),className:`rounded-full px-3 py-1.5 text-sm transition ${d===P?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:q},P))}),f.jsx("div",{className:"mt-4 inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["pdf","PDF"],["html","HTML"]].map(([P,q])=>f.jsx("button",{type:"button",onClick:()=>w(P),className:`rounded-full px-3 py-1.5 text-sm transition ${v===P?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:q},P))}),d==="selected"?f.jsxs("div",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-stone-800 px-3 py-2.5",children:[f.jsxs("p",{className:"text-xs text-stone-400",children:["Selected ",p.size," of ",((U=n.data)==null?void 0:U.totalTurnCount)??o.length]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",onClick:()=>g(new Set(o.map(P=>P.turnId))),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Select all"}),f.jsx("button",{type:"button",onClick:()=>g(new Set),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Clear"})]})]}),n.status==="loading"?f.jsx("p",{className:"px-3 py-6 text-sm text-stone-400",children:"Loading turns..."}):n.status==="failed"?f.jsx("p",{className:"px-3 py-6 text-sm text-rose-100",children:n.error}):f.jsx("div",{className:"max-h-80 overflow-auto p-2",children:o.map(P=>f.jsxs("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl px-2.5 py-2 text-sm transition hover:bg-stone-800/70",children:[f.jsx("input",{type:"checkbox",checked:p.has(P.turnId),onChange:()=>N(P.turnId),className:"h-4 w-4 accent-amber-300"}),f.jsxs("span",{className:"shrink-0 text-xs font-medium text-stone-300",children:["Turn ",P.turnNumber]}),f.jsx("span",{className:"shrink-0 text-xs text-stone-500",children:J6(P.startedAt)}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-stone-200",children:P.userPromptPreview}),f.jsx("span",{className:"hidden shrink-0 rounded-full border border-stone-700 px-2 py-0.5 text-[10px] text-stone-400 sm:inline",children:e4(P.status)})]},P.turnId))})]}):f.jsx("p",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40 px-3 py-3 text-sm text-stone-300",children:"Exports the latest 10 turns in chronological order."}),f.jsxs("div",{className:"mt-4 grid gap-2 text-sm text-stone-300 sm:grid-cols-2",children:[f.jsxs("label",{className:"flex items-center gap-2 rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2",children:[f.jsx("input",{type:"checkbox",checked:y,onChange:P=>E(P.target.checked),className:"h-4 w-4 accent-amber-300"}),"Token and price"]}),f.jsx("p",{className:"flex items-center rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2 text-xs text-stone-500",children:v==="html"?"HTML keeps the chat timeline styling and omits raw command output.":"Review exports keep message text readable and omit tool activity."})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-stone-800 px-5 py-4",children:[f.jsxs("p",{className:"min-w-0 text-xs text-stone-500",children:[C," ",C===1?"turn":"turns"," will be exported."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),f.jsx("button",{type:"button",onClick:R,disabled:!S,className:"ui-status-warning rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:t?"Exporting...":`Export ${v.toUpperCase()}`})]})]})]})]}),document.body)}const Qf=[{value:"preToolUse",label:"PreToolUse",matcherHint:"Bash"},{value:"permissionRequest",label:"PermissionRequest",matcherHint:"Bash"},{value:"postToolUse",label:"PostToolUse",matcherHint:"Bash"},{value:"sessionStart",label:"SessionStart",matcherHint:"startup|resume"},{value:"userPromptSubmit",label:"UserPromptSubmit",matcherHint:""},{value:"stop",label:"Stop",matcherHint:""},{value:"preCompact",label:"PreCompact",matcherHint:""},{value:"postCompact",label:"PostCompact",matcherHint:""}],c0=`node -e "process.stdin.resume(); process.stdin.on('end', () => console.error('hook ran'))"`;function g2(e){return e.replace(/\u00a0/g," ")}function n4(e){if(!e)return"";const t=document.createElement("div");return t.innerHTML=e,t.textContent??""}function r4(e){return!!e.querySelector("[style], font")}function a4(e,t){if(!e)return[];const n=[],r=[...t].sort((o,c)=>c.placeholder.length-o.placeholder.length);let i=0,l=0;for(;i<e.length;){const o=r.find(m=>e.startsWith(m.placeholder,i));if(o){n.push({type:"attachment",key:`${o.clientId}-${i}`,attachment:o}),i+=o.placeholder.length;continue}let c=e.length;for(const m of r){const p=e.indexOf(m.placeholder,i);p!==-1&&p<c&&(c=p)}const d=e.slice(i,c);d&&(n.push({type:"text",key:`text-${l}`,text:d}),l+=1),i=c}return n}function b2(e){if(!e)return"Auto";switch(e){case"xhigh":return"xhigh";default:return e}}function s4(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"m4 5 2 2-2 2"}),f.jsx("path",{d:"M7.75 9.5h4.25"})]})}function i4(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",children:f.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function l4(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M10.75 2.5 5.25 13.5"}),f.jsx("path",{d:"M4.25 5.25h2.25"}),f.jsx("path",{d:"M9.5 10.75h2.25"})]})}function o4(e){switch(e){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function u4(e){switch(e){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function c4(e){var t;return((t=Qf.find(n=>n.value===e))==null?void 0:t.label)??e}function d4(e){var t;switch(e){case"cloudRequirements":return"Cloud";case"legacyManagedConfigFile":case"legacyManagedConfigMdm":return"Managed";case"sessionFlags":return"Session";default:return((t=e[0])==null?void 0:t.toUpperCase())+e.slice(1)}}function f4(e){switch(e){case"managed":return"Managed";case"modified":return"Modified";case"trusted":return"Trusted";case"untrusted":return"Review"}}function h4(e){switch(e){case"preToolUse":return"PreToolUse";case"permissionRequest":return"PermissionRequest";case"postToolUse":return"PostToolUse";case"preCompact":return"PreCompact";case"postCompact":return"PostCompact";case"sessionStart":return"SessionStart";case"userPromptSubmit":return"UserPromptSubmit";case"stop":return"Stop"}}function m4(e){return e.source==="user"?"global":e.source==="project"?"project":null}function x2(e){const t=m4(e);return!t||e.handlerType!=="command"||!e.command||e.isManaged?null:{scope:t,eventName:e.eventName,matcher:e.matcher,command:e.command,timeoutSec:e.timeoutSec,statusMessage:e.statusMessage}}function p4(e){switch(e){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return e}}function g4(e){const t=e.trim();if(!t)return null;const n=Number(t);return!Number.isFinite(n)||n<=0?Number.NaN:Math.round(n*1e3)}function b4(e){if(!e)return"";const t=e/1e3;return Number.isInteger(t)?String(t):String(Number(t.toFixed(1)))}function gg(e){return e.replace(/\r\n/g,`
|
|
62
|
-
`)}function x4(e){const t=e.trim();return/^[A-Za-z0-9_-]+$/.test(t)?t:null}function y4(e){const n=gg(e).split(`
|
|
63
|
-
`).map(i=>i.trim()).filter(Boolean).find(i=>/^\[mcp_servers\.[^\]]+\]$/.test(i));if(!n)return null;const r=n.match(/^\[mcp_servers\.([A-Za-z0-9_-]+)\]$/);return(r==null?void 0:r[1])??null}function E4(e,t){return`[mcp_servers.${e}]
|
|
64
|
-
url = ${JSON.stringify(t.trim())}
|
|
65
|
-
`}function y2(e,t,n){var g,y;const r=gg(e),i=`${gg(n).trim()}
|
|
66
|
-
`,l=r.split(`
|
|
67
|
-
`),o=`[mcp_servers.${t}]`,c=`[mcp_servers.${t}.`;let d=-1,m=l.length;for(let E=0;E<l.length;E+=1)if((((g=l[E])==null?void 0:g.trim())??"")===o){d=E;break}if(d>=0){for(let w=d+1;w<l.length;w+=1){const C=((y=l[w])==null?void 0:y.trim())??"";if(C.startsWith("[")&&!(C===o||C.startsWith(c))){m=w;break}}const E=l.slice(0,d).join(`
|
|
68
|
-
`).trimEnd(),v=l.slice(m).join(`
|
|
69
|
-
`).trim();return[E,i.trimEnd(),v].filter(Boolean).join(`
|
|
70
|
-
|
|
71
|
-
`).replace(/\n{3,}/g,`
|
|
72
|
-
|
|
73
|
-
`).concat(`
|
|
74
|
-
`)}const p=r.trimEnd();return p?`${p}
|
|
75
|
-
|
|
76
|
-
${i}`:i}function Zv(e){return typeof e!="number"||Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))}function d0(e){const t=e/1e3;return Number.isInteger(t)?`${t}k`:`${Number(t.toFixed(1))}k`}function _4(e,t){if(!e)return"Select model";if((t==null?void 0:t.availability)!=="available"||typeof t.tokensInContextWindow!="number"||typeof t.modelContextWindow!="number")return`${e} · context unavailable`;const n=Math.max(t.tokensInContextWindow,0),r=Math.max(t.modelContextWindow,0),i=Math.max(r-n,0);return[e,`${d0(n)} used / ${d0(r)}`,`${d0(i)} left`,`${Zv(t.remainingPercent)}% context left`].join(" · ")}function T4({contextUsage:e}){const t=(e==null?void 0:e.availability)??"unavailable",n=Zv(e==null?void 0:e.remainingPercent),r=t==="available"?n:100,i=t!=="available"?"rgba(120,113,108,0.55)":n<=20?"rgba(251,113,133,0.95)":n<=40?"rgba(252,211,77,0.94)":"rgba(125,211,252,0.95)";return f.jsx("span",{"aria-hidden":"true",className:"thread-context-progress-frame pointer-events-none absolute inset-0",style:{"--context-ring-progress":`${r}%`,"--context-ring-color":i}})}function E2(e,t){const n=e.name.trim();if(n)return n;const r=t==="photo"?e.type.includes("png")?".png":e.type.includes("heic")?".heic":e.type.includes("heif")?".heif":e.type.includes("webp")?".webp":".jpg":"";return`${t==="photo"?"photo":"file"}-${Date.now()}${r}`}function _2(e){return e.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function f0(e){return e.type.startsWith("image/")?"photo":"file"}function bg(e,t){const n=[];if(e)for(const r of Array.from(e)){if(r.kind!=="file")continue;const i=r.getAsFile();i&&n.push(i)}return n.length>0?n:t?Array.from(t):[]}function T2(e,t){return bg(e,t).length>0}function Ll(e){return e instanceof HTMLElement&&e.dataset.segmentType==="attachment"&&e.dataset.placeholder?e.dataset.placeholder:e.textContent??""}function v4(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function v2(e){const t=e.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return t!=null&&t[1]?t[1]:v4(e.originalName)}function k4(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M3 4.5A1.75 1.75 0 0 1 4.75 2.75h6.5A1.75 1.75 0 0 1 13 4.5v4A1.75 1.75 0 0 1 11.25 10.25H8l-2.75 2v-2H4.75A1.75 1.75 0 0 1 3 8.5v-4Z"})})}function w4(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:[f.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),f.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),f.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function h0(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M5.5 3.25h5"}),f.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function Il({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-50":"border-stone-700/90 bg-stone-900/80 text-stone-100";return f.jsx("span",{className:`inline-flex min-w-[3rem] items-center justify-center rounded-full border px-2 py-1.5 text-[10px] font-medium tracking-[0.12em] ${n}`,children:e})}function m0({activeView:e,edgeToEdgeMobile:t=!1,busy:n=!1,settingsBusy:r=!1,compactBusy:i=!1,error:l,model:o=null,reasoningEffort:c=null,fastMode:d=!1,collaborationMode:m="default",modelOptions:p=[],contextUsage:g=null,capabilities:y=null,toolboxItems:E=null,hookCommandTemplates:v=null,mcpConfigFormat:w="none",followTail:C=!1,threadConnected:S=!0,disabled:N=!1,disabledPlaceholder:R,shellControlState:M=null,draftPrompt:Y,draftAttachments:U,skillsState:P={status:"idle",data:null,error:null},mcpState:q={status:"idle",data:null,error:null},hooksState:le={status:"idle",data:null,error:null},goalState:X={status:"idle",data:null,error:null},forkTurnOptionsState:fe={status:"idle",data:null,error:null},onDraftChange:F,onSubmit:Te,onInterrupt:me,onCompact:ne,onOpenSkills:$,onOpenMcp:z,onOpenHooks:Z,onCreateHook:ce,onUpdateHook:A,onTrustHook:H,onUntrustHook:te,onOpenGoal:O,onUpdateGoal:ve,onOpenForkTurns:Re,onForkLatest:Ne,onForkTurn:Qe,onReadProviderConfig:Ve,onWriteProviderConfig:je,onToggleFollow:tt,onUpdateSettings:ut,onToggleView:Ct,onShellCopy:en,onShellControl:nt,canInterrupt:vt=!1}){var cd,dd,fd,hd,md,pd,io,pi,gd,_u,Tu,vu,ku;const[st,xn]=T.useState({prompt:"",attachments:[]}),[qe,Me]=T.useState(null),[Nt,ln]=T.useState("root"),[tn,Zn]=T.useState("list"),[Ye,Un]=T.useState("list"),[ge,Ce]=T.useState("project"),Pe=T.useMemo(()=>({fast:(y==null?void 0:y.controls.performanceMode)??!1,compact:(y==null?void 0:y.turns.compact)??!1,goal:(y==null?void 0:y.controls.goals)??!1,fork:(y==null?void 0:y.branching.fork)??!1,skills:(y==null?void 0:y.management.skills)??!1,mcp:(y==null?void 0:y.management.mcpStatus)??!1,hooks:(y==null?void 0:y.management.hooks)??!1,hostConfigFiles:(y==null?void 0:y.management.hostConfigFiles)??!1,mcpConfigEditing:w==="codex-toml"&&!!(y!=null&&y.management.hostConfigFiles)&&!!Ve&&!!je,hookTrust:(y==null?void 0:y.management.hookTrust)??!1}),[y,w,Ve,je]),ct=T.useMemo(()=>(E??[]).filter(I=>{switch(I.action){case"fast":return Pe.fast;case"compact":return Pe.compact;case"goal":return Pe.goal;case"fork":return Pe.fork;case"skills":return Pe.skills;case"mcp":return Pe.mcp;case"hooks":return Pe.hooks;default:return!1}}),[Pe,E]),bt=T.useMemo(()=>{const I=new Map;for(const re of v??[])I.set(re.eventName,re.command);return I},[v]),yn=I=>bt.get(I)??bt.get("preToolUse")??c0,Gn=T.useMemo(()=>new Set([c0,...bt.values()]),[bt]),[xe,Oe]=T.useState("preToolUse"),[Je,Be]=T.useState("Bash"),[dt,Q]=T.useState(c0),[_e,rt]=T.useState("30"),[He,Fe]=T.useState("Running hook"),[mt,Mt]=T.useState(null),[at,Rt]=T.useState(!1),[Kt,Zt]=T.useState(null),[En,Hn]=T.useState(null),[Jn,nl]=T.useState(""),[li,ts]=T.useState(""),[Xr,rl]=T.useState(""),[ro,Kr]=T.useState(null),[hn,Cn]=T.useState(!1),[ha,er]=T.useState(null),[ks,Lr]=T.useState(null),[Ut,ur]=T.useState(null),[Zr,Ir]=T.useState(!1),[tr,ma]=T.useState(!1),[nr,Sn]=T.useState(""),[al,ws]=T.useState(!1),[Ur,Tr]=T.useState(null),ao=T.useRef(null),Jr=T.useRef(null),oi=T.useRef(null),sl=T.useRef(null),Hr=T.useRef(null),pa=T.useRef([]),_n=T.useRef(null),In=T.useRef(new Map),ui=T.useRef(""),il=T.useRef(0),Wt=e==="shell",ci=!!(Wt&&(M!=null&&M.isMobileShell)),Pa=(M==null?void 0:M.promptLabel)??null,[ns,On]=T.useState({}),[Dn,rs]=T.useState(!1),[Ba,as]=T.useState(0),ss=!Wt&&Y!==void 0&&U!==void 0&&typeof F=="function",Qt=ss?Y:st.prompt,cr=ss?U:st.attachments;T.useEffect(()=>{qe!=="slash"&&(ln("root"),Zn("list"),er(null),Lr(null),Un("list"),Zt(null),Hn(null))},[qe]),T.useEffect(()=>{Nt!=="mcp"&&(Zn("list"),er(null),Lr(null))},[Nt]),T.useEffect(()=>{Nt!=="forkTurns"&&Ir(!1)},[Nt]),T.useEffect(()=>{Nt!=="hooks"&&(Un("list"),Zt(null),Hn(null))},[Nt]),T.useEffect(()=>{const I=Qf.find(re=>re.value===xe);Be(re=>{const ke=re.trim(),Xe=new Set(Qf.map(Ke=>Ke.matcherHint).filter(Boolean));return ke&&!Xe.has(ke)?re:(I==null?void 0:I.matcherHint)??""}),Q(re=>Gn.has(re.trim())?yn(xe):re)},[Gn,xe,bt]),T.useEffect(()=>{if(!Ut)return;const I=window.setTimeout(()=>{ur(re=>re===Ut?null:re)},1400);return()=>{window.clearTimeout(I)}},[Ut]);function Ua(I){if(ss){F==null||F(re=>I({prompt:re.prompt,attachments:re.attachments}));return}xn(re=>I(re))}function ll(I){Ua(re=>{if(typeof I=="function"){const ke=I(re.prompt,re.attachments);return{prompt:ke.prompt,attachments:ke.attachments??re.attachments}}return{prompt:I,attachments:re.attachments}})}async function so(I){try{await navigator.clipboard.writeText(`$${I}`),ur(I)}catch{ur(null)}}async function Cs(){if(Ne){Ir(!0);try{await Ne(),Me(null)}finally{Ir(!1)}}}async function ol(I){if(Qe){Ir(!0);try{await Qe(I),Me(null)}finally{Ir(!1)}}}async function ul(){const I=Qt.trim();if(!I){Tr("Goal objective cannot be empty.");return}const re=nr.trim(),ke=g4(re);if(re.length>0&&(ke===null||!Number.isInteger(ke)||ke<=0)){Tr("Token budget must be a positive number in thousands.");return}if(!ve){Tr("/goal is unavailable in this view.");return}ws(!0),Tr(null);try{await ve({objective:I,status:"active",tokenBudget:ke}),Sn(""),ma(!1),Ua(()=>({prompt:"",attachments:[]}))}catch(Xe){Tr(Xe instanceof Error?Xe.message:"Unable to set goal.")}finally{ws(!1)}}function Ha(){var I;Me(null),ln("root"),ma(!0),Sn(b4((I=X.data)==null?void 0:I.tokenBudget)),Tr(null),O==null||O(),requestAnimationFrame(()=>{var re;(re=Jr.current)==null||re.focus()})}function vr(){ma(!1),Tr(null)}const is=T.useMemo(()=>p.find(I=>I.model===o)??null,[o,p]),di=_4(o,g),za=(is==null?void 0:is.supportedReasoningEfforts)??[],Fa=T.useMemo(()=>a4(Qt,cr),[cr,Qt]),fi=T.useMemo(()=>Object.entries(ns).sort(([I],[re])=>I.localeCompare(re)).map(([I,re])=>`${I}:${re}`).join("|"),[ns]);async function Ss(){if(!Pe.hostConfigFiles||!Ve)throw new Error("Provider config editing is unavailable for this thread.");const I=await Ve();return Kr(I.path),I}async function cl(I){if(!Pe.hostConfigFiles||!je)throw new Error("Provider config editing is unavailable for this thread.");const re=await je(I);return Kr(re.path),re}function ea(I){switch(I.action){case"fast":return d?"On":"Off";case"compact":return i?"Busy":"Run";case"goal":return tr?"Composing":X.data?p4(X.data.status):"Open";case"fork":return n?"Idle only":"Open";case"skills":case"mcp":case"hooks":return"View";default:return""}}function kr(I){switch(I.action){case"fast":return r;case"compact":return i||n;case"fork":return n||Zr;default:return!1}}function hi(I){var ke;return`${I.action==="fast"&&d||I.action==="goal"&&(tr||((ke=X.data)==null?void 0:ke.status)==="active")?"ui-status-warning":"thread-composer-menu-item"} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`}function ga(I,re){switch(re.stopPropagation(),I.action){case"fast":Ln({fastMode:!d});break;case"compact":Me(null),ne==null||ne();break;case"goal":tr?(vr(),Me(null)):Ha();break;case"fork":ln("fork");break;case"skills":ln("skills"),$==null||$();break;case"mcp":ln("mcp"),z==null||z();break;case"hooks":ln("hooks"),Z==null||Z();break}}function ba(){Mt(null),Ce("project"),Oe("preToolUse"),Be("Bash"),Q(yn("preToolUse")),rt("30"),Fe("Running hook")}function dl(I){const re=x2(I);if(!re){Zt("Only command hooks in global or project hooks.json can be edited here.");return}Mt(re),Ce(re.scope),Oe(re.eventName),Be(re.matcher??""),Q(re.command),rt(re.timeoutSec?String(re.timeoutSec):""),Fe(re.statusMessage??""),Zt(null),Hn(null),Un("edit")}async function Ns(){const I=x4(Jn),re=li.trim();if(!I){er("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(re)){er("HTTP MCP URL must start with http:// or https://");return}Cn(!0),er(null),Lr(null);try{const ke=await Ss(),Xe=y2(ke.content,I,E4(I,re));await cl(Xe),Lr("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Zn("list"),nl(""),ts(""),z==null||z()}catch(ke){er(ke instanceof Error?ke.message:"Unable to update provider config.")}finally{Cn(!1)}}async function fl(){Cn(!0),er(null),Lr(null);try{await Ss(),Xr.trim()||rl(`[mcp_servers.example_stdio]
|
|
77
|
-
command = "npx"
|
|
78
|
-
args = ["-y", "your-mcp-server"]
|
|
79
|
-
`),Zn("stdio")}catch(I){er(I instanceof Error?I.message:"Unable to load provider config.")}finally{Cn(!1)}}async function As(){const I=y4(Xr);if(!I){er("The raw MCP block must start with a header like [mcp_servers.name].");return}Cn(!0),er(null),Lr(null);try{const re=await Ss(),ke=y2(re.content,I,Xr);await cl(ke),Lr("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Zn("list"),z==null||z()}catch(re){er(re instanceof Error?re.message:"Unable to update provider config.")}finally{Cn(!1)}}async function mi(){if(Ye==="edit"&&!A){Zt("Hook editing is unavailable in this view.");return}if(Ye!=="edit"&&!ce){Zt("Hook editing is unavailable in this view.");return}if(Ye==="edit"&&!mt){Zt("Select a hook to edit first.");return}const I=dt.trim();if(!I){Zt("Hook command cannot be empty.");return}const re=_e.trim(),ke=re?Number(re):null;if(re&&(ke===null||!Number.isInteger(ke)||ke<=0)){Zt("Timeout must be a positive number of seconds.");return}Rt(!0),Zt(null),Hn(null);try{const Xe={scope:ge,eventName:xe,matcher:Je.trim()||null,command:I,timeoutSec:ke,statusMessage:He.trim()||null};Ye==="edit"?await(A==null?void 0:A({...Xe,target:mt})):await(ce==null?void 0:ce(Xe)),Hn(`${ge==="project"?"Project":"Global"} hook ${Ye==="edit"?"updated":"written"} in hooks.json and trusted.`),Un("list"),Mt(null)}catch(Xe){Zt(Xe instanceof Error?Xe.message:"Unable to write hooks.json.")}finally{Rt(!1)}}async function hl(I){if(!H||!I.currentHash){Zt("Hook trust is unavailable in this view.");return}Rt(!0),Zt(null),Hn(null);try{await H({key:I.key,currentHash:I.currentHash}),Hn("Hook trusted.")}catch(re){Zt(re instanceof Error?re.message:"Unable to trust hook.")}finally{Rt(!1)}}async function rr(I){if(!te){Zt("Hook trust is unavailable in this view.");return}Rt(!0),Zt(null),Hn(null);try{await te({key:I.key}),Hn("Hook untrusted.")}catch(re){Zt(re instanceof Error?re.message:"Unable to untrust hook.")}finally{Rt(!1)}}T.useEffect(()=>{if(Wt){On({});return}const I={},re=new Set;for(const ke of cr){if(ke.kind!=="photo")continue;re.add(ke.clientId);let Xe=In.current.get(ke.clientId);Xe||(Xe=URL.createObjectURL(ke.file),In.current.set(ke.clientId,Xe)),I[ke.clientId]=Xe}for(const[ke,Xe]of In.current.entries())re.has(ke)||(URL.revokeObjectURL(Xe),In.current.delete(ke));On(I)},[cr,Wt]),T.useEffect(()=>()=>{for(const I of In.current.values())URL.revokeObjectURL(I);In.current.clear()},[]);function dr(){const I=Jr.current,re=window.getSelection();if(!I||!re||re.rangeCount===0)return null;const ke=re.getRangeAt(0);return!I.contains(ke.startContainer)||!I.contains(ke.endContainer)?null:{start:Rs(I,ke.startContainer,ke.startOffset),end:Rs(I,ke.endContainer,ke.endOffset)}}function Rs(I,re,ke){var St;let Xe=null,Ke=ke;if(re===I){const Et=Array.from(I.childNodes);let on=0;for(let jn=0;jn<Math.min(ke,Et.length);jn+=1){const zt=Et[jn];zt&&(on+=Ll(zt).length)}return on}if(re.nodeType===Node.TEXT_NODE)Xe=re;else{const Et=Array.from(I.childNodes).find(on=>on.contains(re));if(!Et)return oe().length;if(Xe=Et,Et instanceof HTMLElement&&Et.dataset.segmentType==="attachment"){const on=document.createRange();on.selectNodeContents(Et);const jn=Ll(Et).length;try{on.setEnd(re,ke);const zt=on.toString().length,xa=((St=Et.textContent)==null?void 0:St.length)??0;xa===0?Ke=jn:Ke=Math.round(Math.min(1,zt/xa)*jn)}catch{Ke=jn}}else{const on=document.createRange();on.selectNodeContents(Et);try{on.setEnd(re,ke),Ke=on.toString().length}catch{Ke=Ll(Et).length}}}const pt=Array.from(I.childNodes);let ht=0;for(const Et of pt){if(Et===Xe)return Et.nodeType===Node.TEXT_NODE?ht+Ke:ht+Math.min(Ke,Ll(Et).length);ht+=Ll(Et).length}return ht}function $a(I,re){let ke=Math.max(0,re);const Xe=Array.from(I.childNodes);for(const[Ke,pt]of Xe.entries()){const St=Ll(pt).length;if(pt.nodeType===Node.TEXT_NODE){if(ke<=St)return{node:pt,offset:ke};ke-=St;continue}if(pt instanceof HTMLElement&&pt.dataset.segmentType==="attachment"){if(ke===0)return{node:I,offset:Ke};if(ke<=St){const Et=Xe[Ke+1];return ke===St&&(Et==null?void 0:Et.nodeType)===Node.TEXT_NODE?{node:Et,offset:0}:{node:I,offset:Ke+1}}ke-=St;continue}if(ke<=St)return{node:I,offset:Ke+1};ke-=St}return{node:I,offset:I.childNodes.length}}function V(I){const re=Jr.current;if(!re||!I)return;const ke=$a(re,I.start),Xe=$a(re,I.end),Ke=document.createRange();Ke.setStart(ke.node,ke.offset),Ke.setEnd(Xe.node,Xe.offset);const pt=window.getSelection();pt==null||pt.removeAllRanges(),pt==null||pt.addRange(Ke)}function K(I){const re=pa.current;if(re.length===0)return!1;const ke=re.at(-1);if(!ke)return!1;const Xe=Array.from(I.childNodes).find(St=>St instanceof HTMLElement&&St.dataset.segmentType==="attachment"&&St.dataset.clientId===ke);if(!(Xe instanceof HTMLElement))return!1;const Ke=document.createRange(),pt=Xe.nextSibling;(pt==null?void 0:pt.nodeType)===Node.TEXT_NODE?Ke.setStart(pt,0):Ke.setStartAfter(Xe),Ke.collapse(!0);const ht=window.getSelection();return ht==null||ht.removeAllRanges(),ht==null||ht.addRange(Ke),!0}function oe(){const I=Jr.current;if(!I)return Qt;let re="";for(const ke of Array.from(I.childNodes))re+=Ll(ke);return g2(re)}function Le(I,re,ke){const Xe=I==="photo"?"PHOTO":"FILE";let Ke=0;for(;;){const pt=Ke===0?re:`${re} (${Ke+1})`,ht=`[${Xe} ${pt}]`;if(!ke.has(ht))return ht;Ke+=1}}function De(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function ft(I,re,ke){const Xe=re.start>0?I[re.start-1]:"",Ke=re.end<I.length?I[re.end]:"",pt=!!(Xe&&!/\s/.test(Xe)),ht=!Ke||!/\s/.test(Ke);return`${pt?" ":""}${ke.join(" ")}${ht?" ":""}`}function Ue(I,re){if(!I||I.length===0)return;const ke=Array.from(I),Xe=new Set(cr.map(zt=>zt.placeholder)),Ke=ke.map(zt=>{const xa=E2(zt,re),Os=Le(re,_2(xa),Xe);return Xe.add(Os),{clientId:De(),kind:re,originalName:xa,placeholder:Os,file:zt}}),pt=dr()??_n.current,ht=pt?{start:pt.start,end:pt.end}:{start:Qt.length,end:Qt.length},St=ft(Qt,ht,Ke.map(zt=>zt.placeholder)),Et=`${Qt.slice(0,ht.start)}${St}${Qt.slice(ht.end)}`;Ua(zt=>({prompt:Et,attachments:[...zt.attachments,...Ke]}));const on=St.endsWith(" ")?1:0,jn=ht.start+St.length-on;Hr.current={start:jn,end:jn},_n.current={start:jn,end:jn},pa.current=Ke.map(zt=>zt.clientId),Me(null)}function Tn(I){if(I.length===0)return;const re={photo:I.filter(zt=>f0(zt)==="photo"),file:I.filter(zt=>f0(zt)==="file")},ke=[...re.photo,...re.file],Xe=new Set(cr.map(zt=>zt.placeholder)),Ke=ke.map(zt=>{const xa=f0(zt),Os=E2(zt,xa),lo=Le(xa,_2(Os),Xe);return Xe.add(lo),{clientId:De(),kind:xa,originalName:Os,placeholder:lo,file:zt}}),pt=dr()??_n.current,ht=pt?{start:pt.start,end:pt.end}:{start:Qt.length,end:Qt.length},St=ft(Qt,ht,Ke.map(zt=>zt.placeholder)),Et=`${Qt.slice(0,ht.start)}${St}${Qt.slice(ht.end)}`;Ua(zt=>({prompt:Et,attachments:[...zt.attachments,...Ke]}));const on=St.endsWith(" ")?1:0,jn=ht.start+St.length-on;Hr.current={start:jn,end:jn},_n.current={start:jn,end:jn},pa.current=Ke.map(zt=>zt.clientId),Me(null)}function Jt(I){if(!I)return;const re=dr()??_n.current,ke=(re==null?void 0:re.start)??Qt.length,Xe=(re==null?void 0:re.end)??ke,Ke=g2(I),pt=`${Qt.slice(0,ke)}${Ke}${Qt.slice(Xe)}`;Ua(St=>({prompt:pt,attachments:St.attachments}));const ht=ke+Ke.length;Hr.current={start:ht,end:ht},_n.current={start:ht,end:ht}}T.useEffect(()=>{function I(re){(typeof re.composedPath=="function"?re.composedPath():[]).some(Ke=>Ke instanceof HTMLElement&&(Ke.dataset.composerMenuSurface==="true"||Ke.dataset.composerMenuTrigger==="true"))||qe&&Me(null)}if(qe)return window.addEventListener("pointerdown",I),()=>{window.removeEventListener("pointerdown",I)}},[qe]),T.useLayoutEffect(()=>{const I=Jr.current;if(!I||Wt)return;const re=Hr.current,ke=oe()!==Qt||ui.current!==fi||il.current!==Ba;if(ke){const Xe=document.createDocumentFragment();for(const Ke of Fa){if(Ke.type==="text"){Xe.append(document.createTextNode(Ke.text===" "?" ":Ke.text));continue}const pt=Ke.attachment,ht=document.createElement("span");if(ht.dataset.segmentType="attachment",ht.dataset.clientId=pt.clientId,ht.dataset.placeholder=pt.placeholder,ht.contentEditable="false",ht.className="mx-[0.12rem] inline-flex max-w-full align-baseline",pt.kind==="photo"){ht.classList.add("rounded-[0.95rem]","border","border-sky-300/35","bg-sky-300/10","p-1","shadow-sm","shadow-stone-950/20");const St=ns[pt.clientId];if(St){const on=document.createElement("img");on.src=St,on.alt=pt.originalName||"Pasted image",on.className="h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-950 object-contain",on.draggable=!1,ht.append(on)}else{const on=document.createElement("span");on.className="inline-block h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-900/80",on.setAttribute("aria-hidden","true"),ht.append(on)}const Et=document.createElement("span");Et.className="ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",Et.textContent=v2(pt),ht.append(Et)}else{ht.classList.add("items-center","gap-2","rounded-[0.95rem]","border","border-emerald-300/35","bg-emerald-300/10","px-2.5","py-2","text-[10px]","font-medium","tracking-[0.08em]","text-emerald-50","shadow-sm","shadow-stone-950/20");const St=document.createElement("span");St.className="inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/25 bg-emerald-300/12 text-[9px]",St.textContent="FILE";const Et=document.createElement("span");Et.className="inline-flex max-w-[10rem] truncate",Et.textContent=v2(pt),ht.append(St,Et)}Xe.append(ht)}I.replaceChildren(Xe),ui.current=fi,il.current=Ba}re!==null?(I.focus(),K(I)||V(re),_n.current=re):document.activeElement===I&&ke&&V(_n.current),Hr.current=null,pa.current=[]},[ns,Ba,Wt,fi,Qt,Fa]);function vn(){var I;(I=Jr.current)==null||I.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function Ls(){var I;if(vn(),Me(null),!!((I=navigator.clipboard)!=null&&I.readText))try{const re=await navigator.clipboard.readText();Jt(re)}catch{return}}async function nn(){if(tr&&!Wt){await ul();return}if(!Wt&&!Qt.trim())return;const I=Wt?Qt:Qt.trim(),re=Wt?[]:cr.filter(ke=>I.includes(ke.placeholder));await Te(re.length>0?{prompt:I,attachments:re}:{prompt:I}),Ua(()=>({prompt:"",attachments:[]}))}async function Gt(I){I.preventDefault(),await nn()}function Se(){const I=oe(),re=dr();_n.current=re;const ke=Jr.current;(ke?r4(ke):!1)&&(Hr.current=re,as(Ke=>Ke+1)),Ua(Ke=>({prompt:I,attachments:Ke.attachments.filter(pt=>I.includes(pt.placeholder))}))}function Ze(I){var ke,Xe,Ke,pt;const re=bg((ke=I.clipboardData)==null?void 0:ke.items,(Xe=I.clipboardData)==null?void 0:Xe.files);if(re.length===0){const ht=((Ke=I.clipboardData)==null?void 0:Ke.getData("text/plain"))??"",St=((pt=I.clipboardData)==null?void 0:pt.getData("text/html"))??"",Et=ht||n4(St);if(!Et&&!St)return;I.preventDefault(),Jt(Et);return}I.preventDefault(),Tn(re)}function gt(I){var re,ke;T2((re=I.dataTransfer)==null?void 0:re.items,(ke=I.dataTransfer)==null?void 0:ke.files)&&(I.preventDefault(),rs(!0))}function mn(I){var re,ke;T2((re=I.dataTransfer)==null?void 0:re.items,(ke=I.dataTransfer)==null?void 0:ke.files)&&(I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),rs(!0))}function xt(I){I.currentTarget.contains(I.relatedTarget)||rs(!1)}function rn(I){var ke,Xe;const re=bg((ke=I.dataTransfer)==null?void 0:ke.items,(Xe=I.dataTransfer)==null?void 0:Xe.files);re.length!==0&&(I.preventDefault(),rs(!1),Tn(re))}function fr(I){I.key==="Enter"&&(!I.metaKey&&!I.ctrlKey||(I.preventDefault(),!(n||N)&&nn()))}async function Ln(I){await(ut==null?void 0:ut(I)),Me(null)}const Is=tr?"Describe the goal the backend should continue working toward...":R??(Wt?"Send shell input to the attached terminal...":"Ask the backend to inspect, modify, or explain code..."),ml=Wt?"Send Ctrl-C":"Stop Current Turn",sm=tr?al?"Setting...":"Set goal":!S&&n?"Connecting...":S&&n&&!Wt?"Sending...":"Send",ld=S?tr?"ui-action-info":"ui-action-primary":"ui-action-danger",od=r,im=t||ci?"relative z-20 shrink-0 bg-transparent px-3 pb-0 pt-3 sm:p-4":"relative z-20 shrink-0 bg-transparent px-3 pb-3 pt-0 sm:px-4 sm:pb-4 sm:pt-0",ud=`thread-composer-input min-h-[7.25rem] w-full rounded-[1.25rem] border px-4 pr-14 pt-2.5 outline-none transition sm:min-h-[6.25rem] ${Dn?"is-drag-target border-sky-300/80 bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":"border-stone-700 focus-within:border-[var(--theme-accent-border)]"}`;return f.jsxs("div",{className:"relative z-20 shrink-0",children:[f.jsx("input",{ref:oi,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{Ue(I.target.files,"photo"),I.target.value=""}}),f.jsx("input",{ref:sl,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{Ue(I.target.files,"file"),I.target.value=""}}),e==="chat"&&f.jsx("button",{type:"button","aria-label":"Jump to latest",title:C?"Latest turn is in view":"Jump to the latest messages",onClick:()=>tt==null?void 0:tt(),className:"absolute left-1/2 top-3 z-40 inline-flex h-9 min-w-[5.75rem] -translate-x-1/2 -translate-y-[62%] items-start justify-center bg-transparent pt-1 touch-manipulation sm:top-4",children:f.jsx("span",{className:`thread-jump-latest-badge pointer-events-none inline-flex h-4 min-w-[3.75rem] items-center justify-center rounded-[0.7rem] border shadow-sm transition ${C?"is-active border-sky-300/36 bg-sky-300/[0.03] text-sky-100/86":"border-stone-500/70 bg-stone-950/[0.08] text-stone-200/86"}`,children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m4 6 4 4 4-4"})})})}),f.jsxs("form",{ref:ao,onSubmit:Gt,className:im,children:[f.jsxs("div",{className:"thread-composer-toolbar relative z-30 mb-0 flex items-center gap-2 rounded-full border px-2.5 py-1.5 text-xs shadow-lg shadow-stone-950/8",children:[f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!Wt&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Open slash toolbox",title:"Open slash toolbox",onClick:()=>Me(I=>I==="slash"?null:"slash"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:f.jsx(l4,{})}),qe==="slash"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute bottom-full left-0 z-40 mb-2 w-72 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20 backdrop-blur-xl",onClick:I=>{I.stopPropagation()},onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:Nt==="root"?f.jsxs("div",{className:"p-2",children:[ct.map((I,re)=>f.jsx("button",{type:"button",disabled:kr(I),onClick:ke=>ga(I,ke),className:`${hi(I)} ${re===0?"mt-0":""}`,title:I.description??I.label,children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:I.command}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:ea(I)})]})},`${I.action}:${I.command}`)),ct.length===0?f.jsx("p",{className:"px-3 py-2 text-sm text-stone-400",children:"No backend tools are available for this thread."}):null]}):f.jsx("div",{className:"max-h-80 overflow-auto",children:Nt==="fork"?f.jsxs("div",{className:"p-2",children:[f.jsx("button",{type:"button",disabled:n||Zr,onClick:()=>void Cs(),className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"Fork from latest"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:Zr?"Forking":"Run"})]})}),f.jsx("button",{type:"button",disabled:n||Zr,onClick:I=>{I.stopPropagation(),ln("forkTurns"),Re==null||Re()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"Fork from selected turn"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"Pick"})]})}),n?f.jsx("p",{className:"mt-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Fork is only available while the thread is idle."}):null]}):Nt==="forkTurns"?f.jsxs("div",{className:"p-2",children:[fe.status==="loading"&&!fe.data?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading turns…"}):null,fe.error?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:fe.error}):null,(cd=fe.data)!=null&&cd.length?f.jsx("div",{className:"space-y-2",children:fe.data.map(I=>f.jsx("button",{type:"button",disabled:Zr,onClick:()=>void ol(I.turnId),className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-60",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"text-sm text-stone-100",children:["Turn ",I.turnIndex]}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:Zr?"Forking":I.status})]})},I.turnId))}):null,fe.status!=="loading"&&!fe.error&&(((dd=fe.data)==null?void 0:dd.length)??0)===0?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No turns available to fork yet."}):null]}):Nt==="skills"?f.jsxs("div",{className:"p-2",children:[P.status==="loading"&&!P.data?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading skills…"}):null,P.error?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:P.error}):null,(fd=P.data)!=null&&fd.skills.length?f.jsx("div",{className:"space-y-2",children:P.data.skills.map(I=>{var re,ke;return f.jsx("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:((re=I.interface)==null?void 0:re.displayName)??I.name}),f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em]",children:[f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1 text-stone-400",children:u4(I.scope)}),f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 rounded-full border px-2 py-1 normal-case tracking-normal transition ${Ut===I.name?"border-emerald-400/45 bg-emerald-400/12 text-emerald-100":"thread-composer-chip-button border-stone-700 text-stone-300 hover:border-stone-500"}`,onClick:()=>void so(I.name),title:`Copy $${I.name}`,"aria-label":`Copy $${I.name}`,children:[f.jsx(h0,{}),"$",I.name]})]}),f.jsx("p",{className:"text-xs leading-5 text-stone-400",children:((ke=I.interface)==null?void 0:ke.shortDescription)??I.shortDescription??I.description})]})},I.path)})}):null,(hd=P.data)!=null&&hd.errors.length?f.jsx("div",{className:"mt-2 space-y-2",children:P.data.errors.map(I=>f.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:[f.jsx("p",{className:"font-medium",children:I.message}),f.jsx("p",{className:"mt-1 break-all text-amber-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,P.status!=="loading"&&!P.error&&(((md=P.data)==null?void 0:md.skills.length)??0)===0&&(((pd=P.data)==null?void 0:pd.errors.length)??0)===0?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No skills available right now."}):null]}):Nt==="hooks"?f.jsxs("div",{className:"p-2",children:[f.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs text-stone-400",children:"Hook config sources"}),f.jsx("p",{className:"truncate text-[11px] text-stone-500",children:((io=le.data)==null?void 0:io.projectHooksPath)??"<workspace hooks config>"})]}),Ye==="list"&&Pe.hostConfigFiles?f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),ba(),Un("add"),Zt(null),Hn(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add Hook"}):null]}),le.status==="loading"&&!le.data?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading hooks…"}):null,le.error?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:le.error}):null,Kt?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:Kt}):null,En?f.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:En}):null,Ye==="add"||Ye==="edit"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[Ye==="edit"?f.jsxs("p",{className:"rounded-lg border border-stone-800 bg-stone-950 px-3 py-2 text-[11px] text-stone-400",children:["Editing ",h4((mt==null?void 0:mt.eventName)??xe)," in"," ",(mt==null?void 0:mt.scope)==="global"?"global":"project"," hooks.json"]}):null,f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsxs("label",{className:"block text-xs text-stone-400",children:["Scope",f.jsxs("select",{"aria-label":"Hook scope",value:ge,onChange:I=>Ce(I.target.value),disabled:Ye==="edit",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:[f.jsx("option",{value:"project",children:"Project"}),f.jsx("option",{value:"global",children:"Global"})]})]}),f.jsxs("label",{className:"block text-xs text-stone-400",children:["Event",f.jsx("select",{"aria-label":"Hook event",value:xe,onChange:I=>Oe(I.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:Qf.map(I=>f.jsx("option",{value:I.value,children:I.label},I.value))})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Matcher"}),f.jsx("input",{"aria-label":"Hook matcher",value:Je,onChange:I=>Be(I.target.value),placeholder:"Bash",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Command"}),f.jsx("textarea",{"aria-label":"Hook command",value:dt,onChange:I=>Q(I.target.value),rows:3,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 font-mono text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsxs("label",{className:"block text-xs text-stone-400",children:["Timeout",f.jsx("input",{"aria-label":"Hook timeout seconds",value:_e,onChange:I=>rt(I.target.value),inputMode:"numeric",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]}),f.jsxs("label",{className:"block text-xs text-stone-400",children:["Status message",f.jsx("input",{"aria-label":"Hook status message",value:He,onChange:I=>Fe(I.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>{Un("list"),Mt(null)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),f.jsx("button",{type:"button",onClick:()=>void mi(),disabled:at,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:at?"Saving…":Ye==="edit"?"Update Hook":"Write Hook"})]})]}):null,Ye==="list"&&((pi=le.data)!=null&&pi.warnings.length)?f.jsx("div",{className:"mb-2 space-y-2",children:le.data.warnings.map(I=>f.jsx("p",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:I},I))}):null,Ye==="list"&&((gd=le.data)!=null&&gd.errors.length)?f.jsx("div",{className:"mb-2 space-y-2",children:le.data.errors.map(I=>f.jsxs("div",{className:"rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-2 text-xs text-rose-100/90",children:[f.jsx("p",{className:"font-medium",children:I.message}),f.jsx("p",{className:"mt-1 break-all text-rose-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,Ye==="list"&&((_u=le.data)!=null&&_u.hooks.length)?f.jsx("div",{className:"space-y-2",children:le.data.hooks.map(I=>f.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsxs("p",{className:"truncate text-sm font-medium text-stone-100",children:[c4(I.eventName),I.matcher?` · ${I.matcher}`:""]}),f.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-stone-400",children:I.command??I.handlerType}),I.statusMessage?f.jsx("p",{className:"mt-1 truncate text-[11px] text-stone-500",children:I.statusMessage}):null]}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.08em] text-stone-500",children:[x2(I)?f.jsx("button",{type:"button",onClick:re=>{re.stopPropagation(),dl(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-sky-100 transition hover:border-sky-300/35 hover:bg-sky-300/10",children:"Edit"}):null,Pe.hookTrust&&I.trustStatus==="trusted"&&!I.isManaged?f.jsx("button",{type:"button",disabled:at,onClick:re=>{re.stopPropagation(),rr(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-amber-100 transition hover:border-amber-300/35 hover:bg-amber-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Untrust"}):null,(I.trustStatus==="untrusted"||I.trustStatus==="modified")&&!I.isManaged&&Pe.hookTrust?f.jsx("button",{type:"button",disabled:at||!I.currentHash,onClick:re=>{re.stopPropagation(),hl(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-emerald-100 transition hover:border-emerald-300/35 hover:bg-emerald-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Trust"}):null,f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-0.5 text-stone-300",children:f4(I.trustStatus)})]}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em] text-stone-500",children:[f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:d4(I.source)}),f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:I.enabled?"Enabled":"Disabled"}),f.jsxs("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:[I.timeoutSec,"s"]})]})]},I.key))}):null,Ye==="list"&&le.status!=="loading"&&!le.error&&(((Tu=le.data)==null?void 0:Tu.hooks.length)??0)===0?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No hooks configured for this workspace."}):null]}):f.jsxs("div",{className:"p-2",children:[f.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs text-stone-400",children:"MCP config source"}),f.jsx("p",{className:"truncate text-[11px] text-stone-500",children:ro??"<provider config>"})]}),tn==="list"&&Pe.mcpConfigEditing?f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Zn("add"),er(null),Lr(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add MCP"}):null]}),q.status==="loading"&&!q.data?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading MCP servers…"}):null,q.error?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:q.error}):null,ha?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:ha}):null,ks?f.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:ks}):null,tn==="add"?f.jsxs("div",{className:"space-y-2",children:[f.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),Zn("http"),er(null),Lr(null)},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm text-stone-100",children:"HTTP / Streamable HTTP"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"Form"})]}),f.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Add an MCP server with a name and URL, then write the matching block into provider config."})]}),f.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),fl()},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm text-stone-100",children:"stdio / raw block"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"TOML"})]}),f.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Write a single `[mcp_servers.name]` block, then save it back into provider config."})]})]}):null,tn==="http"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"MCP name"}),f.jsx("input",{"aria-label":"MCP name",value:Jn,onChange:I=>nl(I.target.value),placeholder:"openaiDeveloperDocs",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"URL"}),f.jsx("input",{"aria-label":"URL",value:li,onChange:I=>ts(I.target.value),placeholder:"https://developers.openai.com/mcp",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>Zn("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),f.jsx("button",{type:"button",onClick:()=>void Ns(),disabled:hn,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:hn?"Saving…":"Write HTTP MCP"})]})]}):null,tn==="stdio"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[f.jsx("label",{className:"block text-xs text-stone-400",children:"MCP block for provider config"}),f.jsx("textarea",{"aria-label":"MCP block for provider config",value:Xr,onChange:I=>rl(I.target.value),rows:8,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>Zn("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),f.jsx("button",{type:"button",onClick:()=>void As(),disabled:hn,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:hn?"Saving…":"Write raw block"})]})]}):null,tn==="list"&&((vu=q.data)!=null&&vu.servers.length)?f.jsx("div",{className:"space-y-2",children:q.data.servers.map(I=>f.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:I.name}),f.jsxs("p",{className:"mt-0.5 text-xs text-stone-400",children:[I.tools.length," tools · ",I.resourceCount," ","resources · ",I.resourceTemplateCount," templates"]})]}),f.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:o4(I.authStatus)})]}),I.tools.length>0?f.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-stone-500",children:I.tools.slice(0,4).map(re=>re.title??re.name).join(" · ")}):null]},I.name))}):null,tn==="list"&&q.status!=="loading"&&!q.error&&(((ku=q.data)==null?void 0:ku.servers.length)??0)===0?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No MCP servers available right now."}):null]})})})]}),!Wt&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Add attachment",title:"Add attachment",onClick:()=>Me(I=>I==="attachments"?null:"attachments"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:f.jsx(i4,{})}),qe==="attachments"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute left-0 top-full mt-2 w-32 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20",children:f.jsxs("div",{className:"p-2",children:[f.jsx("button",{type:"button",onClick:()=>{var I;vn(),(I=oi.current)==null||I.click()},className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"Photo"}),f.jsx("button",{type:"button",onClick:()=>{var I;vn(),(I=sl.current)==null||I.click()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"File"})]})})]}),f.jsx("button",{type:"button","aria-label":Wt?"Switch to chat":"Switch to shell",title:Wt?"Switch to chat":"Switch to shell",onClick:()=>Ct==null?void 0:Ct(),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:Wt?f.jsx(k4,{}):f.jsx(s4,{})})]}),f.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-1.5",children:[Wt&&Pa&&f.jsx("span",{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:Pa,children:Pa}),ci&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":qe==="shellTools"?"Close shell tools":"Open shell tools","aria-haspopup":"menu","aria-expanded":qe==="shellTools",title:qe==="shellTools"?"Close shell tools":"Open shell tools",onClick:()=>{vn(),Me(I=>I==="shellTools"?null:"shellTools")},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:f.jsx(w4,{})}),qe==="shellTools"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"absolute right-0 top-full z-40 mt-2 w-[11.5rem] max-w-[calc(100vw-1.5rem)] rounded-[1rem] border border-stone-700/90 bg-stone-950/96 p-2 shadow-2xl shadow-stone-950/40 sm:w-48",onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsx("button",{type:"button",onClick:()=>void Ls(),className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2 py-2 text-sky-50",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(h0,{}),f.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),f.jsx("button",{type:"button",onClick:()=>{vn(),Me(null),en==null||en()},className:"inline-flex items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-2 text-stone-100",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(h0,{}),f.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),f.jsx("button",{type:"button",disabled:n,onClick:()=>{vn(),Me(null),Te({prompt:"clear"})},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Il,{label:"CLEAR",tone:"sky"})}),f.jsx("button",{type:"button",disabled:!(M!=null&&M.shellInputEnabled)||!(M!=null&&M.isCommandRunning),onClick:()=>{vn(),Me(null),nt==null||nt("ctrl_c")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Il,{label:"CTRL-C",tone:"rose"})}),f.jsx("button",{type:"button",disabled:!(M!=null&&M.shellInputEnabled),onClick:()=>{vn(),Me(null),nt==null||nt("ctrl_d")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Il,{label:"CTRL-D"})}),f.jsx("button",{type:"button",disabled:!(M!=null&&M.shellInputEnabled),onClick:()=>{vn(),Me(null),nt==null||nt("esc")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Il,{label:"ESC"})}),f.jsx("button",{type:"button",disabled:!(M!=null&&M.shellInputEnabled),onClick:()=>{vn(),Me(null),nt==null||nt("tab")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Il,{label:"TAB"})}),f.jsx("button",{type:"button",disabled:!(M!=null&&M.shellInputEnabled),onClick:()=>{vn(),Me(null),nt==null||nt("up")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Il,{label:"UP"})}),f.jsx("button",{type:"button",disabled:!(M!=null&&M.shellInputEnabled),onClick:()=>{vn(),Me(null),nt==null||nt("down")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Il,{label:"DOWN"})})]})})]})]})]}),tr&&!Wt&&f.jsxs("div",{className:"relative z-20 mb-1.5 flex flex-wrap items-center gap-2 rounded-2xl border border-sky-300/25 bg-sky-300/[0.07] px-3 py-2 text-xs text-sky-50 shadow-sm shadow-stone-950/10",children:[f.jsx("span",{className:"font-medium uppercase tracking-[0.16em] text-sky-100/90",children:"Goal"}),f.jsxs("label",{className:"flex items-center gap-2 text-stone-300",children:[f.jsx("span",{children:"Max tokens (k)"}),f.jsx("input",{"aria-label":"Goal token budget",value:nr,onChange:I=>Sn(I.target.value),inputMode:"numeric",placeholder:"Optional",className:"h-7 w-24 rounded-full border border-sky-300/25 bg-stone-950/60 px-3 text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/70"})]}),Ur?f.jsx("span",{className:"min-w-0 flex-1 text-rose-200",children:Ur}):null,f.jsx("button",{type:"button",onClick:vr,className:"rounded-full border border-stone-700/80 px-2.5 py-1 text-[11px] text-stone-300 transition hover:bg-stone-800",children:"Cancel"})]}),f.jsxs("div",{className:"relative",children:[Wt?f.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:Qt,onChange:I=>ll(I.target.value),onKeyDown:fr,rows:2,placeholder:Is,className:`${ud} resize-y pb-10`}):f.jsxs("div",{className:ud,children:[Qt.length===0&&f.jsx("span",{className:"pointer-events-none absolute left-4 top-2.5 text-stone-500",children:Is}),f.jsx("div",{ref:Jr,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!N,suppressContentEditableWarning:!0,onInput:()=>Se(),onPaste:Ze,onKeyDown:fr,onKeyUp:()=>{_n.current=dr()},onMouseUp:()=>{_n.current=dr()},onBlur:()=>{_n.current=dr(),rs(!1)},onDragEnter:gt,onDragOver:mn,onDragLeave:xt,onDrop:rn,className:`relative z-[1] min-h-[5.75rem] whitespace-pre-wrap break-words pb-10 outline-none sm:min-h-[4.875rem] ${N?"cursor-not-allowed text-stone-500":""}`})]}),f.jsx("button",{type:"button","aria-label":ml,title:ml,onClick:()=>void(me==null?void 0:me()),disabled:!vt,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${vt?"border-rose-300/55 bg-rose-300/[0.14] text-rose-50 shadow-lg shadow-rose-950/20 hover:bg-rose-300/[0.22]":"cursor-not-allowed border-stone-700/30 bg-stone-400/[0.02] text-stone-500/55 opacity-55"}`,children:f.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}),f.jsx("button",{type:"submit","aria-label":tr&&!Wt?"Set goal":Wt?"Send Shell Input":"Send Prompt",onMouseDown:I=>{I.preventDefault()},onPointerDown:I=>{I.preventDefault()},onTouchStart:I=>{I.preventDefault()},disabled:al||n||(e==="chat"?N:!1),className:`absolute bottom-2.5 right-2.5 rounded-full px-3.5 py-1.5 text-sm font-medium shadow-lg shadow-stone-950/30 transition disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300 ${ld}`,children:sm}),!Wt&&f.jsxs("div",{className:"absolute bottom-2.5 left-3 z-30 flex max-w-[calc(100%-7rem)] items-center gap-1.5 text-xs",children:[f.jsxs("div",{className:"relative min-w-0",children:[f.jsxs("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":qe==="model","aria-label":o??"Select model",disabled:od||p.length===0,onClick:()=>Me(I=>I==="model"?null:"model"),title:d?`Fast mode is on. Turn it off from the slash toolbox to edit model. ${di}`:di,className:"thread-composer-inline-toggle relative inline-flex min-w-0 max-w-[8.75rem] items-center overflow-hidden rounded-full px-2.5 py-1 text-left text-stone-300 transition disabled:cursor-not-allowed disabled:text-stone-600 sm:max-w-[11rem]",children:[o?f.jsx(T4,{contextUsage:g}):null,f.jsx("span",{className:"relative z-[1] block min-w-0 truncate whitespace-nowrap [direction:rtl]",children:o??"Select model"})]}),qe==="model"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[9rem] max-w-[14rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:f.jsx("div",{className:"max-h-72 overflow-auto p-2",children:p.map(I=>f.jsx("button",{type:"button",onClick:()=>void Ln({model:I.model,reasoningEffort:I.defaultReasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.model===o?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:f.jsx("p",{className:"text-sm font-medium",children:I.model})},I.id))})})]}),f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":qe==="effort",disabled:od||za.length===0,onClick:()=>Me(I=>I==="effort"?null:"effort"),title:d?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":void 0,className:"thread-composer-inline-toggle rounded-full px-2 py-1 text-stone-500 transition disabled:cursor-not-allowed disabled:text-stone-700",children:b2(c)}),qe==="effort"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[8rem] max-w-[12rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:f.jsx("div",{className:"max-h-72 overflow-auto p-2",children:za.map(I=>f.jsx("button",{type:"button",onClick:()=>void Ln({reasoningEffort:I.reasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.reasoningEffort===c?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:f.jsx("p",{className:"text-sm font-medium",children:b2(I.reasoningEffort)})},I.reasoningEffort))})})]}),f.jsx("button",{type:"button","aria-pressed":m==="plan",disabled:r,onClick:()=>void Ln({collaborationMode:m==="plan"?"default":"plan"}),className:`thread-composer-inline-toggle rounded-full px-2.5 py-1 transition ${m==="plan"?"bg-sky-300/18 text-sky-100":"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"})]})]}),l&&f.jsx("div",{className:"mt-2 rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l})]})]})}const C4="modulepreload",S4=function(e){return"/"+e},k2={},D=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=o(n.map(m=>{if(m=S4(m),m in k2)return;k2[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=p?"stylesheet":C4,p||(y.as="script"),y.crossOrigin="",y.href=m,d&&y.setAttribute("nonce",d),document.head.appendChild(y),p)return new Promise((E,v)=>{y.addEventListener("load",E),y.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&l(c.reason);return t().catch(l)})};function w2(e){return{background:e==="light"?"#f2ede5":"#0c1117",foreground:e==="light"?"#3f3a36":"#d6dde6",cursor:e==="light"?"#3f3a36":"#d6dde6",black:e==="light"?"#d8cfc2":"#0f1720",brightBlack:e==="light"?"#8a7f73":"#475569",red:"#f87171",brightRed:"#fb7185",green:e==="light"?"#16a34a":"#86efac",brightGreen:e==="light"?"#22c55e":"#4ade80",yellow:"#fbbf24",brightYellow:"#fcd34d",blue:e==="light"?"#2563eb":"#93c5fd",brightBlue:e==="light"?"#3b82f6":"#60a5fa",magenta:e==="light"?"#7c3aed":"#c4b5fd",brightMagenta:e==="light"?"#8b5cf6":"#a78bfa",cyan:e==="light"?"#0891b2":"#67e8f9",brightCyan:e==="light"?"#06b6d4":"#22d3ee",white:e==="light"?"#5b5148":"#e2e8f0",brightWhite:e==="light"?"#2c2723":"#f8fafc"}}function N4(e){switch(e){case"not_created":return"Not created";case"creating":return"Creating";case"running":return"Running";case"attached":return"Attached";case"detached":return"Detached";case"exited":return"Exited";case"not_found":return"Missing";case"workspace_missing":return"Workspace missing"}}function C2(e,t,n,r,i){const l=t.replace(/\r\n/g,`
|
|
80
|
-
`).replace(/\r/g,`
|
|
81
|
-
`),o=l.split(`
|
|
82
|
-
`);l.endsWith(`
|
|
83
|
-
`)&&o.at(-1)===""&&o.pop();let d=o.join(`\r
|
|
84
|
-
`);if(n!==void 0&&r!==void 0){const p=(i!==void 0?Math.max(0,o.length-i):0)+r,g=Math.max(0,o.length-p-1);g>0&&(d+=`\x1B[${g}A`),d+=`\r\x1B[${n+1}G`}e.reset(),e.write(d,()=>{e.scrollToBottom()})}function A4(e){return/^[a-z]$/i.test(e)?String.fromCharCode(e.toUpperCase().charCodeAt(0)-64):null}function p0(e){return e?Array.from(e.querySelectorAll(".xterm-rows > div")).map(n=>n.textContent??"").filter((n,r,i)=>n.length>0||r<i.length-1).join(`
|
|
85
|
-
`).trimEnd():""}function Jv(e){return e.replace(/\r\n/g,`
|
|
86
|
-
`).replace(/\r/g,`
|
|
87
|
-
`)}function S2(e){const t=Jv(e),n=t.split(`
|
|
88
|
-
`);return t.endsWith(`
|
|
89
|
-
`)&&n.at(-1)===""&&n.pop(),n}function R4(e){const t=e.trim();return t?/(?:[$%#>])\s*$/.test(t):!1}function L4(e,t){const n=t.trim();if(!n||e.length===0)return e;const[r,...i]=e;if(r===void 0)return e;const l=r.trim();return l===n||l.endsWith(` ${n}`)||l.endsWith(`$ ${n}`)||l.endsWith(`% ${n}`)||l.endsWith(`# ${n}`)||l.endsWith(`> ${n}`)?i:e}function I4(e,t,n){var d,m;const r=S2(e),i=S2(t);let l=0;for(;l<r.length&&l<i.length&&r[l]===i[l];)l+=1;let o=0;for(;o<r.length-l&&o<i.length-l&&r[r.length-1-o]===i[i.length-1-o];)o+=1;let c=i.slice(l,i.length-o);for(c=L4(c,n);c.length>0&&((d=c[0])==null?void 0:d.trim())==="";)c.shift();for(;c.length>0&&(((m=c.at(-1))==null?void 0:m.trim())===""||R4(c.at(-1)??""));)c.pop();return c.join(`
|
|
90
|
-
`).trimEnd()}function g0(e){if(!e)return"";const t=e.replace(/[\\/]+$/,"");return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function b0(e,t){const n=[t==null?void 0:t.trim(),e==null?void 0:e.trim()].filter(Boolean);return n.length>0?n.join(" "):null}function O4(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4 fill-current",children:[f.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),f.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),f.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function D4({connected:e}){return e?f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}):f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9"})})}function N2(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M5.5 3.25h5"}),f.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function Ol({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-600 dark:text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-600 dark:text-sky-50":"shell-control-chip border";return f.jsx("span",{className:`inline-flex min-w-[3.45rem] items-center justify-center rounded-full border px-2.5 py-1.5 text-[11px] font-medium tracking-[0.12em] ${n}`,children:e})}function j4(e){switch(e){case"ctrl_c":return"";case"ctrl_d":return"";case"esc":return"\x1B";case"tab":return" ";case"up":return"\x1B[A";case"down":return"\x1B[B"}}const M4=T.forwardRef(function({threadId:t,isVisible:n=!0,showHeader:r=!0,showFloatingToolbox:i=!0,onStateChange:l},o){var yn,Gn;const c=Kl(),d=T.useRef(null),m=T.useRef(null),p=T.useRef(null),g=T.useRef(null),y=T.useRef(null),E=T.useRef(null),v=T.useRef(0),w=T.useRef(""),C=T.useRef(null),S=T.useRef(""),N=T.useRef(null),R=T.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),M=T.useRef(!1),Y=T.useRef(null),[U,P]=T.useState(null),[q,le]=T.useState(null),[X,fe]=T.useState(!0),[F,Te]=T.useState(!1),[me,ne]=T.useState(null),[$,z]=T.useState(0),[Z,ce]=T.useState(!1),[A,H]=T.useState(!1),[te,O]=T.useState(!1),[ve,Re]=T.useState(null),[Ne,Qe]=T.useState(!1),[Ve,je]=T.useState(null),tt=(c==null?void 0:c.effectiveTheme)??"dark",ut=T.useCallback((xe,Oe)=>{je({tone:xe,text:Oe}),Y.current!==null&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>{je(null),Y.current=null},1800)},[]),Ct=T.useCallback(xe=>{var dt;const Oe=p.current,Je=y.current,Be=g.current;return!Oe||!Je||!Be?!1:(Oe.send({type:"shell.input",shellId:Je,viewerId:Be,data:xe}),A||(dt=d.current)==null||dt.focus(),!0)},[A]),en=T.useCallback(()=>{var Be;const xe=p.current,Oe=y.current,Je=g.current;return!xe||!Oe||!Je?!1:(xe.send({type:"shell.clear",shellId:Oe,viewerId:Je}),A||(Be=d.current)==null||Be.focus(),!0)},[A]),nt=T.useCallback(xe=>{const Oe=d.current,Je=m.current;!Oe||!Je||(Je.fit(),w.current&&!p0(U)?C2(Oe,w.current,R.current.cursorX,R.current.cursorY,R.current.paneHeight):Oe.scrollToBottom(),xe!=null&&xe.focus&&!A&&Oe.focus())},[A,U]),vt=(q==null?void 0:q.state)??"not_created",st=T.useMemo(()=>(q==null?void 0:q.shell)??null,[q==null?void 0:q.shell]),xn=!!(g.current&&st),qe=T.useMemo(()=>b0(g0(st==null?void 0:st.cwd),null),[st==null?void 0:st.cwd]),Me=ve??qe,Nt=F||X||vt==="creating"||vt==="workspace_missing",ln=vt==="attached"?"border-emerald-300/45 bg-emerald-300/18 text-emerald-50 ring-1 ring-emerald-300/20 hover:bg-emerald-300/24":vt==="exited"||vt==="not_found"?"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800":vt==="workspace_missing"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800",tn=vt==="attached"?"Disconnect shell":vt==="exited"||vt==="not_found"?"Restart shell":st?"Connect shell":"Create shell",Zn=(Ve==null?void 0:Ve.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(Ve==null?void 0:Ve.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",Ye=T.useCallback(async()=>{fe(!0);try{const xe=await y6(t);le(xe),ne(null)}catch(xe){ne(xe instanceof Error?xe.message:"Unable to load shell state.")}finally{fe(!1)}},[t]);T.useEffect(()=>{Ye()},[Ye]),T.useEffect(()=>{var xe;y.current=((xe=q==null?void 0:q.shell)==null?void 0:xe.id)??null},[(yn=q==null?void 0:q.shell)==null?void 0:yn.id]),T.useEffect(()=>{E.current=q},[q]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const xe=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),Oe=()=>{H(xe.matches),xe.matches||O(!1)};return Oe(),xe.addEventListener("change",Oe),()=>{xe.removeEventListener("change",Oe)}},[]),T.useEffect(()=>()=>{Y.current!==null&&window.clearTimeout(Y.current)},[]),T.useEffect(()=>{if(!U||d.current)return;let xe=!1,Oe=null;return(async()=>{const[{Terminal:Je},{FitAddon:Be}]=await Promise.all([D(()=>import("./xterm-CukFWbxr.js").then(_e=>_e.x),[]),D(()=>import("./addon-fit-YJmn1quW.js"),[])]);if(xe||!U)return;const dt=new Je({cursorBlink:!0,disableStdin:A,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:w2(tt)}),Q=new Be;dt.loadAddon(Q),dt.open(U),Q.fit(),dt.attachCustomKeyEventHandler(_e=>{if(A||_e.type!=="keydown")return!0;if(_e.ctrlKey&&!_e.altKey&&!_e.metaKey&&!_e.shiftKey){const rt=A4(_e.key);return rt&&Ct(rt)?(_e.preventDefault(),!1):!0}return!0}),d.current=dt,m.current=Q,ce(!0),N.current=new ResizeObserver(()=>{nt(),p.current&&y.current&&g.current&&p.current.send({type:"shell.resize",shellId:y.current,viewerId:g.current,cols:dt.cols,rows:dt.rows})}),N.current.observe(U),Oe=dt.onData(_e=>{A||Ct(_e)})})(),()=>{var Je,Be;xe=!0,Oe==null||Oe.dispose(),(Je=N.current)==null||Je.disconnect(),N.current=null,ce(!1),(Be=d.current)==null||Be.dispose(),d.current=null,m.current=null}},[A,nt,Ct,U]),T.useEffect(()=>{if(!n||!Z)return;let xe=window.requestAnimationFrame(()=>{nt({focus:!0})});return()=>{window.cancelAnimationFrame(xe)}},[n,nt,Z]),T.useEffect(()=>{const xe=d.current;xe&&(xe.options.disableStdin=A)},[A]),T.useEffect(()=>{var Q;const xe=E.current,Oe=(Q=xe==null?void 0:xe.shell)==null?void 0:Q.id;if(!Oe)return;const Je=xe==null?void 0:xe.state;if(Je==="not_created"||Je==="workspace_missing"||Je==="creating"||Je==="not_found"||Je==="exited")return;const Be=d.current;if(!Be||!Z||$===v.current)return;v.current=$,Be.reset(),ne(null),g.current=null,Be.focus();const dt=G6({onConnected:()=>{dt.send({type:"shell.attach",shellId:Oe,cols:Be.cols,rows:Be.rows})},onShellEvent:_e=>{if(_e.shellId!==Oe)return;if(_e.type==="shell.connected"){const He=String(_e.payload.viewerId??"");g.current=He||null,le(Fe=>Fe&&{...Fe,state:"attached",shell:Fe.shell?{...Fe.shell,status:"attached",attachedViewerId:He}:Fe.shell});return}if(_e.type==="shell.output"){const He=typeof _e.payload.data=="string"?_e.payload.data:"",Fe=_e.payload.replace===!0,mt=typeof _e.payload.cursorX=="number"?_e.payload.cursorX:void 0,Mt=typeof _e.payload.cursorY=="number"?_e.payload.cursorY:void 0,at=typeof _e.payload.paneHeight=="number"?_e.payload.paneHeight:void 0,Rt=typeof _e.payload.cwdBaseName=="string"?_e.payload.cwdBaseName:null,Kt=typeof _e.payload.envPrefix=="string"?_e.payload.envPrefix:null,Zt=b0(Rt??g0(st==null?void 0:st.cwd),Kt),En=_e.payload.isCommandRunning===!0;if(R.current={cursorX:mt,cursorY:Mt,paneHeight:at},Re(Zt),Qe(En),M.current=En,He)if(Fe){const Hn=Jv(He);w.current=Hn,C2(Be,He,mt,Mt,at),!En&&C.current&&(S.current=I4(C.current.beforeSnapshot,Hn,C.current.command),C.current=null)}else Be.write(He);return}if(_e.type==="shell.error"){ne(String(_e.payload.message??"Shell connection failed.")),_e.payload.code==="viewer_conflict"&&le(He=>He&&{...He,state:"detached",shell:He.shell?{...He.shell,status:"detached",attachedViewerId:null}:He.shell});return}if(_e.type==="shell.detached"){const He=String(_e.payload.viewerId??""),Fe=String(_e.payload.reason??"");He&&He===g.current&&(g.current=null,le(mt=>mt&&{...mt,state:"detached",shell:mt.shell?{...mt.shell,status:"detached",attachedViewerId:null}:mt.shell}),ne(Fe==="replaced"?"This shell connection was taken over by another device.":null),Qe(!1),M.current=!1,dt.socket.close());return}if(_e.type==="shell.exited"){g.current=null,Qe(!1),M.current=!1;const He=_e.payload.state==="exited"?"exited":"not_found";le(Fe=>Fe&&{...Fe,state:He,shell:Fe.shell?{...Fe.shell,status:He,attachedViewerId:null}:Fe.shell});return}const rt=_e.payload.state;rt&&(rt!=="attached"&&(g.current=null,Qe(!1),M.current=!1),le(He=>He&&{...He,state:rt,shell:He.shell?{...He.shell,status:rt==="attached"||rt==="detached"?rt:He.shell.status,attachedViewerId:rt==="attached"?He.shell.attachedViewerId:null}:He.shell}))}});return p.current=dt,dt.socket.addEventListener("close",()=>{var _e;((_e=p.current)==null?void 0:_e.socket)===dt.socket&&(p.current=null)}),()=>{var rt;const _e=g.current;_e&&dt.send({type:"shell.detach",shellId:Oe,viewerId:_e}),g.current=null,dt.socket.close(),((rt=p.current)==null?void 0:rt.socket)===dt.socket&&(p.current=null)}},[$,st==null?void 0:st.cwd,(Gn=q==null?void 0:q.shell)==null?void 0:Gn.id,Z]);const Un=T.useCallback(async()=>{Te(!0);try{const xe=d.current,Oe=await T6(t,{...(xe==null?void 0:xe.cols)!==void 0?{cols:xe.cols}:{},...(xe==null?void 0:xe.rows)!==void 0?{rows:xe.rows}:{}});le(Oe),z(Je=>Je+1),ne(null)}catch(xe){ne(xe instanceof Vt?xe.payload.message:"Unable to create shell.")}finally{Te(!1)}},[t]),ge=T.useCallback(async()=>{if(vt==="exited"||vt==="not_found"){await Un();return}ne(null),z(xe=>xe+1)},[Un,vt]),Ce=T.useCallback(async()=>{if(q!=null&&q.shell){Te(!0);try{await v6(q.shell.id),await Ye(),ne(null)}catch(xe){ne(xe instanceof Vt?xe.payload.message:"Unable to terminate shell.")}finally{Te(!1)}}},[Ye,q==null?void 0:q.shell]),Pe=T.useCallback(()=>{var Be;const xe=p.current,Oe=y.current,Je=g.current;!xe||!Oe||(Je&&xe.send({type:"shell.detach",shellId:Oe,viewerId:Je}),g.current=null,xe.socket.close(),((Be=p.current)==null?void 0:Be.socket)===xe.socket&&(p.current=null),ne(null),le(dt=>dt&&{...dt,state:"detached",shell:dt.shell?{...dt.shell,status:"detached",attachedViewerId:null}:dt.shell}))},[tt]);T.useEffect(()=>{d.current&&(d.current.options.theme=w2(tt))},[tt]);const ct=T.useCallback(async()=>{if(!(F||X||vt==="creating"||vt==="workspace_missing")){if(vt==="attached"){Pe();return}if(vt==="exited"||vt==="not_found"||!st){await Un();return}await ge()}},[F,Un,Pe,ge,X,st,vt]),bt=T.useCallback(async()=>{var xe,Oe,Je,Be;try{const dt=((Oe=(xe=d.current)==null?void 0:xe.getSelection())==null?void 0:Oe.trim())||((Be=(Je=window.getSelection)==null?void 0:Je.call(window))==null?void 0:Be.toString().trim())||p0(U);return dt?(await navigator.clipboard.writeText(dt),ut("done","Copied"),!0):(ut("failed","Nothing to copy"),!1)}catch{return ut("failed","Copy failed"),!1}},[U,ut]);return T.useEffect(()=>{if(!(st!=null&&st.cwd)){Re(null);return}Re(xe=>xe??b0(g0(st.cwd),null))},[st==null?void 0:st.cwd]),T.useEffect(()=>{l==null||l({status:vt,connectionButtonDisabled:Nt,connectionButtonLabel:tn,shellInputEnabled:xn,isCommandRunning:Ne,promptLabel:Me,isMobileShell:A,hasShell:!!st,busy:F,loading:X,error:me})},[F,Nt,tn,me,A,Ne,X,l,Me,st,xn,vt]),T.useImperativeHandle(o,()=>({async toggleConnection(){await ct()},sendInput(xe){return Ct(xe)},sendCommand(xe){const Oe={command:xe,beforeSnapshot:w.current};if(C.current=Oe,xe.trim()==="clear"){const dt=en();return!dt&&C.current===Oe&&(C.current=null),dt}const Je=xe.endsWith(`
|
|
91
|
-
`)?xe:`${xe}
|
|
92
|
-
`,Be=Ct(Je);return!Be&&C.current===Oe&&(C.current=null),Be},sendControl(xe){return xe==="clear"?en():Ct(j4(xe))},async copyLastCommandOutput(){const xe=S.current.trim()||p0(U);if(!xe)return ut("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(xe),ut("done","Copied"),!0}catch{return ut("failed","Copy failed"),!1}},async terminate(){await Ce()},focus(){var xe;(xe=d.current)==null||xe.focus()},refreshLayout(xe){nt(xe)}}),[ct,Ce,nt,en,Ct,ut,U]),f.jsxs("div",{className:"shell-panel flex min-h-0 flex-1 flex-col",children:[r&&f.jsxs("div",{className:"shell-header shrink-0 border-b px-3 py-3 sm:px-5",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Shell"}),f.jsx("p",{className:"mt-1 truncate text-sm text-[var(--theme-fg-soft)]",children:Me??(st==null?void 0:st.cwd)??"Create a durable shell for this thread."})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{type:"button","aria-label":tn,title:`${tn} (${N4(vt)})`,disabled:Nt,onClick:()=>void ct(),className:`inline-flex h-10 w-10 items-center justify-center rounded-full border shadow-lg shadow-stone-950/25 transition disabled:cursor-not-allowed disabled:opacity-60 ${ln}`,children:f.jsx(D4,{connected:vt==="attached"})}),st&&f.jsx("button",{type:"button",disabled:F,onClick:()=>void Ce(),className:"rounded-full border border-rose-300/35 bg-rose-300/12 px-3 py-2 text-sm text-rose-600 transition hover:bg-rose-300/18 dark:text-rose-100 disabled:cursor-not-allowed disabled:opacity-60",children:"Terminate"})]})]}),(me||X||(q==null?void 0:q.workspacePathStatus)==="missing")&&f.jsxs("div",{className:"shell-banner mt-3 rounded-2xl border px-3 py-3 text-sm",children:[X&&f.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!X&&(q==null?void 0:q.workspacePathStatus)==="missing"&&f.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!X&&me&&f.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:me})]})]}),f.jsx("div",{className:"min-h-0 flex-1",children:vt==="not_created"||vt==="workspace_missing"?f.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:f.jsxs("div",{className:"shell-empty-state max-w-md rounded-[1.6rem] border px-6 py-8",children:[f.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Durable thread shell"}),f.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"The shell runs under supervisor-managed tmux and survives browser disconnects. Create it explicitly when you want to inspect or take over the workspace."})]})}):f.jsx("div",{className:"h-full min-h-0 p-2 sm:p-3",children:f.jsxs("div",{className:"shell-terminal-frame relative h-full rounded-[1.4rem] border shadow-inner",children:[!r&&(me||X||(q==null?void 0:q.workspacePathStatus)==="missing")&&f.jsxs("div",{className:"shell-banner absolute left-2 right-2 top-2 z-10 rounded-2xl border px-3 py-3 text-sm backdrop-blur sm:left-3 sm:right-3 sm:top-3",children:[X&&f.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!X&&(q==null?void 0:q.workspacePathStatus)==="missing"&&f.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!X&&me&&f.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:me})]}),f.jsx("div",{ref:P,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${A?"mobile-shell-selectable":""}`,onMouseDown:()=>{var xe;(xe=d.current)==null||xe.focus()}}),i&&A&&f.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[Ve&&f.jsx("div",{className:`pointer-events-auto rounded-full border px-3 py-1.5 text-[11px] shadow-lg shadow-stone-950/30 backdrop-blur ${Zn}`,children:Ve.text}),te&&f.jsx("div",{className:"shell-toolbox pointer-events-auto rounded-[1.2rem] border p-2 shadow-2xl backdrop-blur",children:f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsx("button",{type:"button",onClick:()=>{ut("idle","Use the prompt box tools to paste")},className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2.5 py-2 text-sky-600 dark:text-sky-50",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(N2,{}),f.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),f.jsx("button",{type:"button",onClick:()=>void bt(),className:"shell-toolbox-copy inline-flex items-center justify-center rounded-full border px-2.5 py-2",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(N2,{}),f.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Copy"})]})}),f.jsx("button",{type:"button",disabled:!xn,onClick:()=>{en()?ut("done","Cleared"):ut("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Ol,{label:"CLEAR",tone:"sky"})}),f.jsx("button",{type:"button",disabled:!xn||!Ne,onClick:()=>{Ct("")?ut("done","Sent Ctrl-C"):ut("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Ol,{label:"CTRL-C",tone:"rose"})}),f.jsx("button",{type:"button",disabled:!xn,onClick:()=>{Ct("")?ut("done","Sent Ctrl-D"):ut("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Ol,{label:"CTRL-D",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!xn,onClick:()=>{Ct("\x1B")?ut("done","Sent Esc"):ut("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Ol,{label:"ESC",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!xn,onClick:()=>{Ct(" ")?ut("done","Sent Tab"):ut("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Ol,{label:"TAB",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!xn,onClick:()=>{Ct("\x1B[A")?ut("done","Sent Up"):ut("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Ol,{label:"UP",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!xn,onClick:()=>{Ct("\x1B[B")?ut("done","Sent Down"):ut("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(Ol,{label:"DOWN",tone:"stone"})})]})}),f.jsx("button",{type:"button","aria-expanded":te,"aria-label":te?"Close shell tools":"Open shell tools",onClick:()=>O(xe=>!xe),className:"shell-toolbox-trigger pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-2xl backdrop-blur transition",children:f.jsx(O4,{})})]})]})})})]})});let Kn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function P4(e){return T1(e)}function T1(e){return Array.isArray(e)?B4(e):e instanceof RegExp?e:typeof e=="object"?U4(e):e}function B4(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=T1(e[n]);return t}function U4(e){let t={};for(let n in e)t[n]=T1(e[n]);return t}function ek(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function tk(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?tk(e.substring(0,e.length-1)):e.substr(~t+1)}var x0=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,_f=class{static hasCaptures(e){return e===null?!1:(x0.lastIndex=0,x0.test(e))}static replaceCaptures(e,t,n){return e.replace(x0,(r,i,l,o)=>{let c=n[parseInt(i||l,10)];if(c){let d=t.substring(c.start,c.end);for(;d[0]===".";)d=d.substring(1);switch(o){case"downcase":return d.toLowerCase();case"upcase":return d.toUpperCase();default:return d}}else return r})}};function nk(e,t){return e<t?-1:e>t?1:0}function rk(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let l=nk(e[i],t[i]);if(l!==0)return l}return 0}return n-r}function A2(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ak(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var sk=class{constructor(e){de(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},sh=class{constructor(e,t,n){de(this,"_cachedMatchRoot",new sk(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(F4(e),t)}static createFromParsedTheme(e,t){return V4(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>H4(e.parent,i.parentScopes));return r?new ik(r.fontStyle,r.foreground,r.background):null}},y0=class Xf{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Xf(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Xf(n,t[r]);return n}push(t){return new Xf(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function H4(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!z4(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function z4(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var ik=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function F4(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,l=t.length;i<l;i++){let o=t[i];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let g=o.scope;g=g.replace(/^[,]+/,""),g=g.replace(/[,]+$/,""),c=g.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let d=-1;if(typeof o.settings.fontStyle=="string"){d=0;let g=o.settings.fontStyle.split(" ");for(let y=0,E=g.length;y<E;y++)switch(g[y]){case"italic":d=d|1;break;case"bold":d=d|2;break;case"underline":d=d|4;break;case"strikethrough":d=d|8;break}}let m=null;typeof o.settings.foreground=="string"&&A2(o.settings.foreground)&&(m=o.settings.foreground);let p=null;typeof o.settings.background=="string"&&A2(o.settings.background)&&(p=o.settings.background);for(let g=0,y=c.length;g<y;g++){let v=c[g].trim().split(" "),w=v[v.length-1],C=null;v.length>1&&(C=v.slice(0,v.length-1),C.reverse()),n[r++]=new $4(w,C,i,d,m,p)}}return n}var $4=class{constructor(e,t,n,r,i,l){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=l}},Sr=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Sr||{});function V4(e,t){e.sort((d,m)=>{let p=nk(d.scope,m.scope);return p!==0||(p=rk(d.parentScopes,m.parentScopes),p!==0)?p:d.index-m.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let d=e.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(r=d.foreground),d.background!==null&&(i=d.background)}let l=new G4(t),o=new ik(n,l.getId(r),l.getId(i)),c=new Y4(new xg(0,null,-1,0,0),[]);for(let d=0,m=e.length;d<m;d++){let p=e[d];c.insert(0,p.scope,p.parentScopes,p.fontStyle,l.getId(p.foreground),l.getId(p.background))}return new sh(l,o,c)}var G4=class{constructor(e){de(this,"_isFrozen");de(this,"_lastColorId");de(this,"_id2color");de(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},q4=Object.freeze([]),xg=class lk{constructor(t,n,r,i,l){de(this,"scopeDepth");de(this,"parentScopes");de(this,"fontStyle");de(this,"foreground");de(this,"background");this.scopeDepth=t,this.parentScopes=n||q4,this.fontStyle=r,this.foreground=i,this.background=l}clone(){return new lk(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},Y4=class yg{constructor(t,n=[],r={}){de(this,"_rulesWithParentScopes");this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const l=n.parentScopes[i].length-t.parentScopes[r].length;if(l!==0)return l;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,l;if(r===-1?(i=t,l=""):(i=t.substring(0,r),l=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(l)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(yg._cmpBySpecificity),n}insert(t,n,r,i,l,o){if(n===""){this._doInsertHere(t,r,i,l,o);return}let c=n.indexOf("."),d,m;c===-1?(d=n,m=""):(d=n.substring(0,c),m=n.substring(c+1));let p;this._children.hasOwnProperty(d)?p=this._children[d]:(p=new yg(this._mainRule.clone(),xg.cloneArr(this._rulesWithParentScopes)),this._children[d]=p),p.insert(t+1,m,r,i,l,o)}_doInsertHere(t,n,r,i,l){if(n===null){this._mainRule.acceptOverwrite(t,r,i,l);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let d=this._rulesWithParentScopes[o];if(rk(d.parentScopes,n)===0){d.acceptOverwrite(t,r,i,l);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new xg(t,n,r,i,l))}},nu=class Sa{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Sa.getLanguageId(t),r=Sa.getTokenType(t),i=Sa.getFontStyle(t),l=Sa.getForeground(t),o=Sa.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:l,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,l,o,c){let d=Sa.getLanguageId(t),m=Sa.getTokenType(t),p=Sa.containsBalancedBrackets(t)?1:0,g=Sa.getFontStyle(t),y=Sa.getForeground(t),E=Sa.getBackground(t);return n!==0&&(d=n),r!==8&&(m=r),i!==null&&(p=i?1:0),l!==-1&&(g=l),o!==0&&(y=o),c!==0&&(E=c),(d<<0|m<<8|p<<10|g<<11|y<<15|E<<24)>>>0}};function ih(e,t){const n=[],r=W4(e);let i=r.next();for(;i!==null;){let d=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":d=1;break;case"L":d=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let m=o();if(n.push({matcher:m,priority:d}),i!==",")break;i=r.next()}return n;function l(){if(i==="-"){i=r.next();const d=l();return m=>!!d&&!d(m)}if(i==="("){i=r.next();const d=c();return i===")"&&(i=r.next()),d}if(R2(i)){const d=[];do d.push(i),i=r.next();while(R2(i));return m=>t(d,m)}return null}function o(){const d=[];let m=l();for(;m;)d.push(m),m=l();return p=>d.every(g=>g(p))}function c(){const d=[];let m=o();for(;m&&(d.push(m),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");m=o()}return p=>d.some(g=>g(p))}}function R2(e){return!!e&&!!e.match(/[\w\.:]+/)}function W4(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function ok(e){typeof e.dispose=="function"&&e.dispose()}var Uc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Q4=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},X4=class{constructor(){de(this,"_references",[]);de(this,"_seenReferenceKeys",new Set);de(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},K4=class{constructor(e,t){de(this,"seenFullScopeRequests",new Set);de(this,"seenPartialScopeRequests",new Set);de(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Uc(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new X4;for(const n of e)Z4(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Uc){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Z4(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=n.lookup(t);e instanceof Uc?Kf({baseGrammar:l,selfGrammar:i},r):Eg(e.ruleName,{baseGrammar:l,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const c of o)r.add(new Uc(c))}function Eg(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];lh([r],t,n)}}function Kf(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&lh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&lh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function lh(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?ek({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&lh(r.patterns,{...t,repository:i},n);const l=r.include;if(!l)continue;const o=uk(l);switch(o.kind){case 0:Kf({...t,selfGrammar:t.baseGrammar},n);break;case 1:Kf(t,n);break;case 2:Eg(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const c=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(c){const d={baseGrammar:t.baseGrammar,selfGrammar:c,repository:i};o.kind===4?Eg(o.ruleName,d,n):Kf(d,n)}else o.kind===4?n.add(new Q4(o.scopeName,o.ruleName)):n.add(new Uc(o.scopeName));break}}}var J4=class{constructor(){de(this,"kind",0)}},eR=class{constructor(){de(this,"kind",1)}},tR=class{constructor(e){de(this,"kind",2);this.ruleName=e}},nR=class{constructor(e){de(this,"kind",3);this.scopeName=e}},rR=class{constructor(e,t){de(this,"kind",4);this.scopeName=e,this.ruleName=t}};function uk(e){if(e==="$base")return new J4;if(e==="$self")return new eR;const t=e.indexOf("#");if(t===-1)return new nR(e);if(t===0)return new tR(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new rR(n,r)}}var aR=/\\(\d+)/,L2=/\\(\d+)/g,sR=-1,ck=-2;var Kc=class{constructor(e,t,n,r){de(this,"$location");de(this,"id");de(this,"_nameIsCapturing");de(this,"_name");de(this,"_contentNameIsCapturing");de(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=_f.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=_f.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${tk(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:_f.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:_f.replaceCaptures(this._contentName,e,t)}},iR=class extends Kc{constructor(t,n,r,i,l){super(t,n,r,i);de(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=l}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,r,i){throw new Error("Not supported!")}},lR=class extends Kc{constructor(t,n,r,i,l){super(t,n,r,null);de(this,"_match");de(this,"captures");de(this,"_cachedCompiledPatterns");this._match=new Hc(i,this.id),this.captures=l,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new zc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},I2=class extends Kc{constructor(t,n,r,i,l){super(t,n,r,i);de(this,"hasMissingPatterns");de(this,"patterns");de(this,"_cachedCompiledPatterns");this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const r of this.patterns)t.getRule(r).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new zc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_g=class extends Kc{constructor(t,n,r,i,l,o,c,d,m,p){super(t,n,r,i);de(this,"_begin");de(this,"beginCaptures");de(this,"_end");de(this,"endHasBackReferences");de(this,"endCaptures");de(this,"applyEndPatternLast");de(this,"hasMissingPatterns");de(this,"patterns");de(this,"_cachedCompiledPatterns");this._begin=new Hc(l,this.id),this.beginCaptures=o,this._end=new Hc(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=m||!1,this.patterns=p.patterns,this.hasMissingPatterns=p.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t,n).compileAG(t,r,i)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new zc;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},oh=class extends Kc{constructor(t,n,r,i,l,o,c,d,m){super(t,n,r,i);de(this,"_begin");de(this,"beginCaptures");de(this,"whileCaptures");de(this,"_while");de(this,"whileHasBackReferences");de(this,"hasMissingPatterns");de(this,"patterns");de(this,"_cachedCompiledPatterns");de(this,"_cachedCompiledWhilePatterns");this._begin=new Hc(l,this.id),this.beginCaptures=o,this.whileCaptures=d,this._while=new Hc(c,ck),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=m.patterns,this.hasMissingPatterns=m.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new zc;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,r,i){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,r,i)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new zc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},dk=class Cr{static createCaptureRule(t,n,r,i,l){return t.registerRule(o=>new iR(n,o,r,i,l))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new lR(t.$vscodeTextmateLocation,t.id,t.name,t.match,Cr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=ek({},r,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new I2(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Cr._compilePatterns(l,n,r))}return t.while?new oh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Cr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Cr._compileCaptures(t.whileCaptures||t.captures,n,r),Cr._compilePatterns(t.patterns,n,r)):new _g(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Cr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Cr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Cr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let l=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>l&&(l=c)}for(let o=0;o<=l;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let d=0;t[o].patterns&&(d=Cr.getCompiledRuleId(t[o],n,r)),i[c]=Cr.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,d)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let l=0,o=t.length;l<o;l++){const c=t[l];let d=-1;if(c.include){const m=uk(c.include);switch(m.kind){case 0:case 1:d=Cr.getCompiledRuleId(r[c.include],n,r);break;case 2:let p=r[m.ruleName];p&&(d=Cr.getCompiledRuleId(p,n,r));break;case 3:case 4:const g=m.scopeName,y=m.kind===4?m.ruleName:null,E=n.getExternalGrammar(g,r);if(E)if(y){let v=E.repository[y];v&&(d=Cr.getCompiledRuleId(v,n,E.repository))}else d=Cr.getCompiledRuleId(E.repository.$self,n,E.repository);break}}else d=Cr.getCompiledRuleId(c,n,r);if(d!==-1){const m=n.getRule(d);let p=!1;if((m instanceof I2||m instanceof _g||m instanceof oh)&&m.hasMissingPatterns&&m.patterns.length===0&&(p=!0),p)continue;i.push(d)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Hc=class fk{constructor(t,n){de(this,"source");de(this,"ruleId");de(this,"hasAnchor");de(this,"hasBackReferences");de(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let i=0,l=[],o=!1;for(let c=0;c<r;c++)if(t.charAt(c)==="\\"&&c+1<r){const m=t.charAt(c+1);m==="z"?(l.push(t.substring(i,c)),l.push("$(?!\\n)(?<!\\n)"),i=c+2):(m==="A"||m==="G")&&(o=!0),c++}this.hasAnchor=o,i===0?this.source=t:(l.push(t.substring(i,r)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=aR.test(this.source):this.hasBackReferences=!1}clone(){return new fk(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return L2.lastIndex=0,this.source.replace(L2,(i,l)=>ak(r[parseInt(l,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],l,o,c,d;for(l=0,o=this.source.length;l<o;l++)c=this.source.charAt(l),t[l]=c,n[l]=c,r[l]=c,i[l]=c,c==="\\"&&l+1<o&&(d=this.source.charAt(l+1),d==="A"?(t[l+1]="",n[l+1]="",r[l+1]="A",i[l+1]="A"):d==="G"?(t[l+1]="",n[l+1]="G",r[l+1]="",i[l+1]="G"):(t[l+1]=d,n[l+1]=d,r[l+1]=d,i[l+1]=d),l++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},zc=class{constructor(){de(this,"_items");de(this,"_hasAnchors");de(this,"_cached");de(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new O2(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new O2(e,r,this._items.map(i=>i.ruleId))}},O2=class{constructor(e,t,n){de(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
93
|
-
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},E0=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ti,oR=(ti=class{constructor(t,n){de(this,"_defaultAttributes");de(this,"_embeddedLanguagesMatcher");de(this,"_getBasicScopeAttributes",new sk(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new E0(n,r)}));this._defaultAttributes=new E0(t,8),this._embeddedLanguagesMatcher=new uR(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?ti._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(ti.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},de(ti,"_NULL_SCOPE_METADATA",new E0(0,0)),de(ti,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ti),uR=class{constructor(e){de(this,"values");de(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>ak(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},D2=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function hk(e,t,n,r,i,l,o,c){const d=t.content.length;let m=!1,p=-1;if(o){const E=cR(e,t,n,r,i,l);i=E.stack,r=E.linePos,n=E.isFirstLine,p=E.anchorPosition}const g=Date.now();for(;!m;){if(c!==0&&Date.now()-g>c)return new D2(i,!0);y()}return new D2(i,!1);function y(){const E=dR(e,t,n,r,i,p);if(!E){l.produce(i,d),m=!0;return}const v=E.captureIndices,w=E.matchedRuleId,C=v&&v.length>0?v[0].end>r:!1;if(w===sR){const S=i.getRule(e);l.produce(i,v[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ec(e,t,n,i,l,S.endCaptures,v),l.produce(i,v[0].end);const N=i;if(i=i.parent,p=N.getAnchorPos(),!C&&N.getEnterPos()===r){i=N,l.produce(i,d),m=!0;return}}else{const S=e.getRule(w);l.produce(i,v[0].start);const N=i,R=S.getName(t.content,v),M=i.contentNameScopesList.pushAttributed(R,e);if(i=i.push(w,r,p,v[0].end===d,null,M,M),S instanceof _g){const Y=S;Ec(e,t,n,i,l,Y.beginCaptures,v),l.produce(i,v[0].end),p=v[0].end;const U=Y.getContentName(t.content,v),P=M.pushAttributed(U,e);if(i=i.withContentNameScopesList(P),Y.endHasBackReferences&&(i=i.withEndRule(Y.getEndWithResolvedBackReferences(t.content,v))),!C&&N.hasSameRuleAs(i)){i=i.pop(),l.produce(i,d),m=!0;return}}else if(S instanceof oh){const Y=S;Ec(e,t,n,i,l,Y.beginCaptures,v),l.produce(i,v[0].end),p=v[0].end;const U=Y.getContentName(t.content,v),P=M.pushAttributed(U,e);if(i=i.withContentNameScopesList(P),Y.whileHasBackReferences&&(i=i.withEndRule(Y.getWhileWithResolvedBackReferences(t.content,v))),!C&&N.hasSameRuleAs(i)){i=i.pop(),l.produce(i,d),m=!0;return}}else if(Ec(e,t,n,i,l,S.captures,v),l.produce(i,v[0].end),i=i.pop(),!C){i=i.safePop(),l.produce(i,d),m=!0;return}}v[0].end>r&&(r=v[0].end,n=!1)}}function cR(e,t,n,r,i,l){let o=i.beginRuleCapturedEOL?0:-1;const c=[];for(let d=i;d;d=d.pop()){const m=d.getRule(e);m instanceof oh&&c.push({rule:m,stack:d})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:m,findOptions:p}=mR(d.rule,e,d.stack.endRule,n,r===o),g=m.findNextMatchSync(t,r,p);if(g){if(g.ruleId!==ck){i=d.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(l.produce(d.stack,g.captureIndices[0].start),Ec(e,t,n,d.stack,l,d.rule.whileCaptures,g.captureIndices),l.produce(d.stack,g.captureIndices[0].end),o=g.captureIndices[0].end,g.captureIndices[0].end>r&&(r=g.captureIndices[0].end,n=!1))}else{i=d.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function dR(e,t,n,r,i,l){const o=fR(e,t,n,r,i,l),c=e.getInjections();if(c.length===0)return o;const d=hR(c,e,t,n,r,i,l);if(!d)return o;if(!o)return d;const m=o.captureIndices[0].start,p=d.captureIndices[0].start;return p<m||d.priorityMatch&&p===m?d:o}function fR(e,t,n,r,i,l){const o=i.getRule(e),{ruleScanner:c,findOptions:d}=mk(o,e,i.endRule,n,r===l),m=c.findNextMatchSync(t,r,d);return m?{captureIndices:m.captureIndices,matchedRuleId:m.ruleId}:null}function hR(e,t,n,r,i,l,o){let c=Number.MAX_VALUE,d=null,m,p=0;const g=l.contentNameScopesList.getScopeNames();for(let y=0,E=e.length;y<E;y++){const v=e[y];if(!v.matcher(g))continue;const w=t.getRule(v.ruleId),{ruleScanner:C,findOptions:S}=mk(w,t,null,r,i===o),N=C.findNextMatchSync(n,i,S);if(!N)continue;const R=N.captureIndices[0].start;if(!(R>=c)&&(c=R,d=N.captureIndices,m=N.ruleId,p=v.priority,c===i))break}return d?{priorityMatch:p===-1,captureIndices:d,matchedRuleId:m}:null}function mk(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function mR(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Ec(e,t,n,r,i,l,o){if(l.length===0)return;const c=t.content,d=Math.min(l.length,o.length),m=[],p=o[0].end;for(let g=0;g<d;g++){const y=l[g];if(y===null)continue;const E=o[g];if(E.length===0)continue;if(E.start>p)break;for(;m.length>0&&m[m.length-1].endPos<=E.start;)i.produceFromScopes(m[m.length-1].scopes,m[m.length-1].endPos),m.pop();if(m.length>0?i.produceFromScopes(m[m.length-1].scopes,E.start):i.produce(r,E.start),y.retokenizeCapturedWithRuleId){const w=y.getName(c,o),C=r.contentNameScopesList.pushAttributed(w,e),S=y.getContentName(c,o),N=C.pushAttributed(S,e),R=r.push(y.retokenizeCapturedWithRuleId,E.start,-1,!1,null,C,N),M=e.createOnigString(c.substring(0,E.end));hk(e,M,n&&E.start===0,E.start,R,i,!1,0),ok(M);continue}const v=y.getName(c,o);if(v!==null){const C=(m.length>0?m[m.length-1].scopes:r.contentNameScopesList).pushAttributed(v,e);m.push(new pR(C,E.end))}}for(;m.length>0;)i.produceFromScopes(m[m.length-1].scopes,m[m.length-1].endPos),m.pop()}var pR=class{constructor(e,t){de(this,"scopes");de(this,"endPos");this.scopes=e,this.endPos=t}};function gR(e,t,n,r,i,l,o,c){return new xR(e,t,n,r,i,l,o,c)}function j2(e,t,n,r,i){const l=ih(t,uh),o=dk.getCompiledRuleId(n,r,i.repository);for(const c of l)e.push({debugSelector:t,matcher:c.matcher,ruleId:o,grammar:i,priority:c.priority})}function uh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(bR(t[i],r))return n=i+1,!0;return!1})}function bR(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var xR=class{constructor(e,t,n,r,i,l,o,c){de(this,"_rootId");de(this,"_lastRuleId");de(this,"_ruleId2desc");de(this,"_includedGrammars");de(this,"_grammarRepository");de(this,"_grammar");de(this,"_injections");de(this,"_basicScopeAttributesProvider");de(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=c,this._basicScopeAttributesProvider=new oR(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=M2(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const d of Object.keys(i)){const m=ih(d,uh);for(const p of m)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[d]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)j2(t,o,i[o],this,r);const l=this._grammarRepository.injections(n);l&&l.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const d=c.injectionSelector;d&&j2(t,d,c,this,c)}})}return t.sort((i,l)=>i.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=M2(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=dk.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Tg.NULL){i=!0;const m=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),g=nu.set(0,m.languageId,m.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),y=this.getRule(this._rootId).getName(null,null);let E;y?E=Cc.createRootAndLookUpScopeName(y,g,this):E=Cc.createRoot("unknown",g),t=new Tg(null,this._rootId,-1,-1,!1,null,E,E)}else i=!1,t.reset();e=e+`
|
|
94
|
-
`;const l=this.createOnigString(e),o=l.content.length,c=new ER(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),d=hk(this,l,i,0,t,c,!0,r);return ok(l),{lineLength:o,lineTokens:c,ruleStack:d.stack,stoppedEarly:d.stoppedEarly}}};function M2(e,t){return e=P4(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Cc=class ds{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=(t==null?void 0:t.scopePath)??null;for(const l of n)i=y0.push(i,l.scopeNames),r=new ds(r,i,l.encodedTokenAttributes);return r}static createRoot(t,n){return new ds(null,new y0(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),l=new y0(null,t),o=r.themeProvider.themeMatch(l),c=ds.mergeAttributes(n,i,o);return new ds(null,l,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ds.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,l=0,o=0;return r!==null&&(i=r.fontStyle,l=r.foregroundId,o=r.backgroundId),nu.set(t,n.languageId,n.tokenType,null,i,l,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ds._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const l of r)i=ds._pushAttributed(i,l,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),l=t.scopePath.push(n),o=r.themeProvider.themeMatch(l),c=ds.mergeAttributes(t.tokenAttributes,i,o);return new ds(t,l,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var i;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((i=r.parent)==null?void 0:i.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},La,Tg=(La=class{constructor(t,n,r,i,l,o,c,d){de(this,"_stackElementBrand");de(this,"_enterPos");de(this,"_anchorPos");de(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=l,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=d,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(t){return t===null?!1:La._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Cc.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){La._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,l,o,c){return new La(this,t,n,r,i,l,o,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var r,i;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(i=this.contentNameScopesList)==null?void 0:i.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new La(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const r=Cc.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new La(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Cc.fromExtension(r,n.contentNameScopesList))}},de(La,"NULL",new La(null,0,0,0,!1,null,null,null)),La),yR=class{constructor(e,t){de(this,"balancedBracketScopes");de(this,"unbalancedBracketScopes");de(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):ih(n,uh).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>ih(n,uh).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ER=class{constructor(e,t,n,r){de(this,"_emitBinaryTokens");de(this,"_lineText");de(this,"_tokens");de(this,"_binaryTokens");de(this,"_lastTokenEndIndex");de(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var r;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=(e==null?void 0:e.tokenAttributes)??0,l=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(l=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=(e==null?void 0:e.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(o)&&(i=nu.set(i,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(l=this.balancedBracketSelectors.match(o))}if(l&&(i=nu.set(i,0,8,l,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},_R=class{constructor(e,t){de(this,"_grammars",new Map);de(this,"_rawGrammars",new Map);de(this,"_injectionGrammars",new Map);de(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,gR(e,l,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},TR=class{constructor(t){de(this,"_options");de(this,"_syncRegistry");de(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new _R(sh.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(sh.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new yR(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,l){const o=new K4(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(c=>this._loadSingleGrammar(c.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,l)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,l=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,l)}},vg=Tg.NULL;const pk=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Zc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Zc.prototype.normal={};Zc.prototype.property={};Zc.prototype.space=void 0;function gk(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Zc(n,r,t)}function Fc(e){return e.toLowerCase()}class Qr{constructor(t,n){this.attribute=n,this.property=t}}Qr.prototype.attribute="";Qr.prototype.booleanish=!1;Qr.prototype.boolean=!1;Qr.prototype.commaOrSpaceSeparated=!1;Qr.prototype.commaSeparated=!1;Qr.prototype.defined=!1;Qr.prototype.mustUseProperty=!1;Qr.prototype.number=!1;Qr.prototype.overloadedBoolean=!1;Qr.prototype.property="";Qr.prototype.spaceSeparated=!1;Qr.prototype.space=void 0;let vR=0;const wt=Zl(),Xn=Zl(),kg=Zl(),Ie=Zl(),bn=Zl(),Zo=Zl(),oa=Zl();function Zl(){return 2**++vR}const wg=Object.freeze(Object.defineProperty({__proto__:null,boolean:wt,booleanish:Xn,commaOrSpaceSeparated:oa,commaSeparated:Zo,number:Ie,overloadedBoolean:kg,spaceSeparated:bn},Symbol.toStringTag,{value:"Module"})),_0=Object.keys(wg);class v1 extends Qr{constructor(t,n,r,i){let l=-1;if(super(t,n),P2(this,"space",i),typeof r=="number")for(;++l<_0.length;){const o=_0[l];P2(this,_0[l],(r&wg[o])===wg[o])}}}v1.prototype.defined=!0;function P2(e,t,n){n&&(e[t]=n)}function cu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new v1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Fc(r)]=r,n[Fc(l.attribute)]=r}return new Zc(t,n,e.space)}const bk=cu({properties:{ariaActiveDescendant:null,ariaAtomic:Xn,ariaAutoComplete:null,ariaBusy:Xn,ariaChecked:Xn,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:bn,ariaCurrent:null,ariaDescribedBy:bn,ariaDetails:null,ariaDisabled:Xn,ariaDropEffect:bn,ariaErrorMessage:null,ariaExpanded:Xn,ariaFlowTo:bn,ariaGrabbed:Xn,ariaHasPopup:null,ariaHidden:Xn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bn,ariaLevel:Ie,ariaLive:null,ariaModal:Xn,ariaMultiLine:Xn,ariaMultiSelectable:Xn,ariaOrientation:null,ariaOwns:bn,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:Xn,ariaReadOnly:Xn,ariaRelevant:null,ariaRequired:Xn,ariaRoleDescription:bn,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:Xn,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function xk(e,t){return t in e?e[t]:t}function yk(e,t){return xk(e,t.toLowerCase())}const kR=cu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zo,acceptCharset:bn,accessKey:bn,action:null,allow:null,allowFullScreen:wt,allowPaymentRequest:wt,allowUserMedia:wt,alt:null,as:null,async:wt,autoCapitalize:null,autoComplete:bn,autoFocus:wt,autoPlay:wt,blocking:bn,capture:null,charSet:null,checked:wt,cite:null,className:bn,cols:Ie,colSpan:null,content:null,contentEditable:Xn,controls:wt,controlsList:bn,coords:Ie|Zo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wt,defer:wt,dir:null,dirName:null,disabled:wt,download:kg,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wt,formTarget:null,headers:bn,height:Ie,hidden:kg,high:Ie,href:null,hrefLang:null,htmlFor:bn,httpEquiv:bn,id:null,imageSizes:null,imageSrcSet:null,inert:wt,inputMode:null,integrity:null,is:null,isMap:wt,itemId:null,itemProp:bn,itemRef:bn,itemScope:wt,itemType:bn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wt,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:wt,muted:wt,name:null,nonce:null,noModule:wt,noValidate:wt,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:wt,optimum:Ie,pattern:null,ping:bn,placeholder:null,playsInline:wt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wt,referrerPolicy:null,rel:bn,required:wt,reversed:wt,rows:Ie,rowSpan:Ie,sandbox:bn,scope:null,scoped:wt,seamless:wt,selected:wt,shadowRootClonable:wt,shadowRootDelegatesFocus:wt,shadowRootMode:null,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:Xn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:wt,useMap:null,value:Xn,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bn,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:wt,declare:wt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:wt,noHref:wt,noShade:wt,noWrap:wt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:Xn,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:wt,disableRemotePlayback:wt,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:yk}),wR=cu({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:oa,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:bn,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:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:wt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,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:Zo,g2:Zo,glyphName:Zo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:oa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,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:Ie,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:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:oa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:oa,rev:oa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:oa,requiredFeatures:oa,requiredFonts:oa,requiredFormats:oa,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:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:oa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:oa,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:oa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:xk}),Ek=cu({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()}}),_k=cu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yk}),Tk=cu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),CR={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"},SR=/[A-Z]/g,B2=/-[a-z]/g,NR=/^data[-\w.:]+$/i;function Jc(e,t){const n=Fc(t);let r=t,i=Qr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&NR.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(B2,RR);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!B2.test(l)){let o=l.replace(SR,AR);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=v1}return new i(r,t)}function AR(e){return"-"+e.toLowerCase()}function RR(e){return e.charAt(1).toUpperCase()}const du=gk([bk,kR,Ek,_k,Tk],"html"),ys=gk([bk,wR,Ek,_k,Tk],"svg"),U2={}.hasOwnProperty;function k1(e,t){const n=t||{};function r(i,...l){let o=r.invalid;const c=r.handlers;if(i&&U2.call(i,e)){const d=String(i[e]);o=U2.call(c,d)?c[d]:r.unknown}if(o)return o.call(this,i,...l)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const LR=/["&'<>`]/g,IR=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,OR=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,DR=/[|\\{}()[\]^$+*?.]/g,H2=new WeakMap;function jR(e,t){if(e=e.replace(t.subset?MR(t.subset):LR,r),t.subset||t.escapeOnly)return e;return e.replace(IR,n).replace(OR,r);function n(i,l,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(l+2),t)}function r(i,l,o){return t.format(i.charCodeAt(0),o.charCodeAt(l+1),t)}}function MR(e){let t=H2.get(e);return t||(t=PR(e),H2.set(e,t)),t}function PR(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(DR,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const BR=/[\dA-Fa-f]/;function UR(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!BR.test(String.fromCharCode(t))?r:r+";"}const HR=/\d/;function zR(e,t,n){const r="&#"+String(e);return n&&t&&!HR.test(String.fromCharCode(t))?r:r+";"}const FR=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],T0={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},$R=["cent","copy","divide","gt","lt","not","para","times"],vk={}.hasOwnProperty,Cg={};let Tf;for(Tf in T0)vk.call(T0,Tf)&&(Cg[T0[Tf]]=Tf);const VR=/[^\dA-Za-z]/;function GR(e,t,n,r){const i=String.fromCharCode(e);if(vk.call(Cg,i)){const l=Cg[i],o="&"+l;return n&&FR.includes(l)&&!$R.includes(l)&&(!r||t&&t!==61&&VR.test(String.fromCharCode(t)))?o:o+";"}return""}function qR(e,t,n){let r=UR(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=GR(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const l=zR(e,t,n.omitOptionalSemicolons);l.length<r.length&&(r=l)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Jo(e,t){return jR(e,Object.assign({format:qR},t))}const YR=/^>|^->|<!--|-->|--!>|<!-$/g,WR=[">"],QR=["<",">"];function XR(e,t,n,r){return r.settings.bogusComments?"<?"+Jo(e.value,Object.assign({},r.settings.characterReferences,{subset:WR}))+">":"<!--"+e.value.replace(YR,i)+"-->";function i(l){return Jo(l,Object.assign({},r.settings.characterReferences,{subset:QR}))}}function KR(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function ch(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function z2(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const o=n.slice(i,r).trim();(o||!l)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function w1(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function F2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function C1(e){return e.join(" ").trim()}const ZR=/[ \t\n\f\r]/g;function jh(e){return typeof e=="object"?e.type==="text"?$2(e.value):!1:$2(e)}function $2(e){return e.replace(ZR,"")===""}const or=wk(1),kk=wk(-1),JR=[];function wk(e){return t;function t(n,r,i){const l=n?n.children:JR;let o=(r||0)+e,c=l[o];if(!i)for(;c&&jh(c);)o+=e,c=l[o];return c}}const eL={}.hasOwnProperty;function Ck(e){return t;function t(n,r,i){return eL.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const S1=Ck({body:nL,caption:v0,colgroup:v0,dd:iL,dt:sL,head:v0,html:tL,li:aL,optgroup:lL,option:oL,p:rL,rp:V2,rt:V2,tbody:cL,td:G2,tfoot:dL,th:G2,thead:uL,tr:fL});function v0(e,t,n){const r=or(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&jh(r.value.charAt(0)))}function tL(e,t,n){const r=or(n,t);return!r||r.type!=="comment"}function nL(e,t,n){const r=or(n,t);return!r||r.type!=="comment"}function rL(e,t,n){const r=or(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function aL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&r.tagName==="li"}function sL(e,t,n){const r=or(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function iL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function V2(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function lL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function oL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function uL(e,t,n){const r=or(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function cL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function dL(e,t,n){return!or(n,t)}function fL(e,t,n){const r=or(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function G2(e,t,n){const r=or(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const hL=Ck({body:gL,colgroup:bL,head:pL,html:mL,tbody:xL});function mL(e){const t=or(e,-1);return!t||t.type!=="comment"}function pL(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function gL(e){const t=or(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&jh(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function bL(e,t,n){const r=kk(n,t),i=or(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&S1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function xL(e,t,n){const r=kk(n,t),i=or(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&S1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const vf={name:[[`
|
|
95
|
-
\f\r &/=>`.split(""),`
|
|
96
|
-
\f\r "&'/=>\``.split("")],[`\0
|
|
97
|
-
\f\r "&'/<=>`.split(""),`\0
|
|
98
|
-
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
99
|
-
\f\r &>`.split(""),`\0
|
|
100
|
-
\f\r "&'<=>\``.split("")],[`\0
|
|
101
|
-
\f\r "&'<=>\``.split(""),`\0
|
|
102
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function yL(e,t,n,r){const i=r.schema,l=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const c=[];let d;i.space==="html"&&e.tagName==="svg"&&(r.schema=ys);const m=EL(r,e.properties),p=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,p&&(o=!1),(m||!l||!hL(e,t,n))&&(c.push("<",e.tagName,m?" "+m:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(d=m.charAt(m.length-1),(!r.settings.tightSelfClosing||d==="/"||d&&d!=='"'&&d!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!o&&(!l||!S1(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function EL(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const l=_L(e,i,t[i]);l&&n.push(l)}}for(;++r<n.length;){const l=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&l!=='"'&&l!=="'"&&(n[r]+=" ")}return n.join("")}function _L(e,t,n){const r=Jc(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let o=e.quote,c;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const d=Jo(r.attribute,Object.assign({},e.settings.characterReferences,{subset:vf.name[i][l]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?w1:C1)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?d:(e.settings.preferUnquoted&&(c=Jo(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:vf.unquoted[i][l]}))),c!==n&&(e.settings.quoteSmart&&ch(n,o)>ch(n,e.alternative)&&(o=e.alternative),c=o+Jo(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?vf.single:vf.double)[i][l],attribute:!0}))+o),d+(c&&"="+c))}const TL=["<","&"];function Sk(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Jo(e.value,Object.assign({},r.settings.characterReferences,{subset:TL}))}function vL(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Sk(e,t,n,r)}function kL(e,t,n,r){return r.all(e)}const wL=k1("type",{invalid:CL,unknown:SL,handlers:{comment:XR,doctype:KR,element:yL,raw:vL,root:kL,text:Sk}});function CL(e){throw new Error("Expected node, not `"+e+"`")}function SL(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const NL={},AL={},RL=[];function LL(e,t){const n=t||NL,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:IL,all:OL,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||pk,characterReferences:n.characterReferences||AL,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ys:du,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function IL(e,t,n){return wL(e,t,n,this)}function OL(e){const t=[],n=e&&e.children||RL;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function dh(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,l]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof l=="string"?n[i]=l:i===r&&Object.assign(n,l);return n}function Xi(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function DL(e){return Array.isArray(e)?e:[e]}async function Nk(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function N1(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ak(e){return e==="ansi"||N1(e)}function A1(e){return e==="none"}function Rk(e){return A1(e)}function Lk(e,t){var r;if(!t)return e;e.properties||(e.properties={}),(r=e.properties).class||(r.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function Mh(e,t=!1){var l;if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let o=0;o<n.length;o+=2){const c=t?n[o]+(n[o+1]||""):n[o];i.push([c,r]),r+=n[o].length,r+=((l=n[o+1])==null?void 0:l.length)||0}return i}function jL(e){const t=Mh(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let l=i,o=0;for(const c of t){if(l<c.length)break;l-=c.length,o++}return{line:o,character:l}}function r(i,l){let o=0;for(let c=0;c<i;c++)o+=t[c].length;return o+=l,o}return{lines:t,indexToPos:n,posToIndex:r}}const R1="light-dark()",ML=["color","background-color"];function PL(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function BL(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const l=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,c)=>o-c);return l.length?PL(i,l):i})):e}function UL(e,t,n,r,i="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(p=>fh(e.variants[p])),c=new Set(o.flatMap(p=>Object.keys(p))),d={},m=(p,g)=>{const y=g==="color"?"":g==="background-color"?"-bg":`-${g}`;return n+t[p]+(g==="color"?"":y)};return o.forEach((p,g)=>{for(const y of c){const E=p[y]||"inherit";if(g===0&&r&&ML.includes(y))if(r===R1&&o.length>1){const v=t.findIndex(N=>N==="light"),w=t.findIndex(N=>N==="dark");if(v===-1||w===-1)throw new Kn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=o[v][y]||"inherit",S=o[w][y]||"inherit";d[y]=`light-dark(${C}, ${S})`,i==="css-vars"&&(d[m(g,y)]=E)}else d[y]=E;else i==="css-vars"&&(d[m(g,y)]=E)}}),l.htmlStyle=d,l}function fh(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Sr.Italic&&(t["font-style"]="italic"),e.fontStyle&Sr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Sr.Underline&&n.push("underline"),e.fontStyle&Sr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Sg(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const Ik=new WeakMap;function Ph(e,t){Ik.set(e,t)}function $c(e){return Ik.get(e)}class fu{constructor(...t){de(this,"_stacks",{});de(this,"lang");if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new fu(Object.fromEntries(DL(n).map(r=>[r,vg])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return HL(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function HL(e){const t=[],n=new Set;function r(i){var o;if(n.has(i))return;n.add(i);const l=(o=i==null?void 0:i.nameScopesList)==null?void 0:o.scopeName;l&&t.push(l),i.parent&&r(i.parent)}return r(e),t}function zL(e,t){if(!(e instanceof fu))throw new Kn("Invalid grammar state");return e.getInternalStack(t)}function FL(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Kn(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const c=i.lines[o.line];if(c===void 0)throw new Kn(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let d=o.character;if(d<0&&(d=c.length+d),d<0||d>c.length)throw new Kn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${c.length}`);return{...o,character:d,offset:i.posToIndex(o.line,d)}}};const i=jL(n.source),l=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));$L(l),e.set(n.meta,{decorations:l,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var o;if(!((o=this.options.decorations)!=null&&o.length))return;const i=t(this).decorations.flatMap(c=>[c.start.offset,c.end.offset]);return BL(n,i)},code(n){var p;if(!((p=this.options.decorations)!=null&&p.length))return;const r=t(this),i=Array.from(n.children).filter(g=>g.type==="element"&&g.tagName==="span");if(i.length!==r.converter.lines.length)throw new Kn(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function l(g,y,E,v){const w=i[g];let C="",S=-1,N=-1;if(y===0&&(S=0),E===0&&(N=0),E===Number.POSITIVE_INFINITY&&(N=w.children.length),S===-1||N===-1)for(let M=0;M<w.children.length;M++)C+=Ok(w.children[M]),S===-1&&C.length===y&&(S=M+1),N===-1&&C.length===E&&(N=M+1);if(S===-1)throw new Kn(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(N===-1)throw new Kn(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const R=w.children.slice(S,N);if(!v.alwaysWrap&&R.length===w.children.length)c(w,v,"line");else if(!v.alwaysWrap&&R.length===1&&R[0].type==="element")c(R[0],v,"token");else{const M={type:"element",tagName:"span",properties:{},children:R};c(M,v,"wrapper"),w.children.splice(S,R.length,M)}}function o(g,y){i[g]=c(i[g],y,"line")}function c(g,y,E){var C;const v=y.properties||{},w=y.transform||(S=>S);return g.tagName=y.tagName||"span",g.properties={...g.properties,...v,class:g.properties.class},(C=y.properties)!=null&&C.class&&Lk(g,y.properties.class),g=w(g,E)||g,g}const d=[],m=r.decorations.sort((g,y)=>y.start.offset-g.start.offset||g.end.offset-y.end.offset);for(const g of m){const{start:y,end:E}=g;if(y.line===E.line)l(y.line,y.character,E.character,g);else if(y.line<E.line){l(y.line,y.character,Number.POSITIVE_INFINITY,g);for(let v=y.line+1;v<E.line;v++)d.unshift(()=>o(v,g));l(E.line,0,E.character,g)}}d.forEach(g=>g())}}}function $L(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Kn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],l=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,c=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,d=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(l||o||c||d){if(l&&o||c&&d||c&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new Kn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function Ok(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Ok).join(""):""}const VL=[FL()];function hh(e){const t=GL(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...VL]}function GL(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var zl=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],k0={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function qL(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function q2(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function YL(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)k0[r]&&t.push({type:"setDecoration",value:k0[r]});else if(r<=29){const i=k0[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:zl[r-30]}});else if(r===38){const i=q2(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:zl[r-40]}});else if(r===48){const i=q2(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:zl[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:zl[r-100+8]}})}return t}function WL(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let l=0;do{const o=qL(r,l),c=o.sequence?r.substring(l,o.startPosition):r.substring(l);if(c.length>0&&i.push({value:c,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const d=YL(o.sequence);for(const m of d)m.type==="resetAll"?(e=null,t=null,n.clear()):m.type==="resetForegroundColor"?e=null:m.type==="resetBackgroundColor"?t=null:m.type==="resetDecoration"&&n.delete(m.value);for(const m of d)m.type==="setForegroundColor"?e=m.value:m.type==="setBackgroundColor"?t=m.value:m.type==="setDecoration"&&n.add(m.value)}l=o.position}while(l<r.length);return i}}}var QL={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function XL(e=QL){function t(c){return e[c]}function n(c){return`#${c.map(d=>Math.max(0,Math.min(d,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let m=0;m<zl.length;m++)r.push(t(zl[m]));let c=[0,95,135,175,215,255];for(let m=0;m<6;m++)for(let p=0;p<6;p++)for(let g=0;g<6;g++)r.push(n([c[m],c[p],c[g]]));let d=8;for(let m=0;m<24;m++,d+=10)r.push(n([d,d,d]));return r}function l(c){return i()[c]}function o(c){switch(c.type){case"named":return t(c.name);case"rgb":return n(c.rgb);case"table":return l(c.index)}}return{value:o}}const KL={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function ZL(e,t,n){const r=dh(e,n),i=Mh(t),l=Object.fromEntries(zl.map(d=>{var g;const m=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`,p=(g=e.colors)==null?void 0:g[m];return[d,p||KL[d]]})),o=XL(l),c=WL();return i.map(d=>c.parse(d[0]).map(m=>{let p,g;m.decorations.has("reverse")?(p=m.background?o.value(m.background):e.bg,g=m.foreground?o.value(m.foreground):e.fg):(p=m.foreground?o.value(m.foreground):e.fg,g=m.background?o.value(m.background):void 0),p=Xi(p,r),g=Xi(g,r),m.decorations.has("dim")&&(p=JL(p));let y=Sr.None;return m.decorations.has("bold")&&(y|=Sr.Bold),m.decorations.has("italic")&&(y|=Sr.Italic),m.decorations.has("underline")&&(y|=Sr.Underline),m.decorations.has("strikethrough")&&(y|=Sr.Strikethrough),{content:m.value,offset:d[1],color:p,bgColor:g,fontStyle:y}}))}function JL(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],l=r[1],o=r[2],c=r[3],d=Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${l}${l}${o}${o}${d}`}else if(r.length===3){const i=r[0],l=r[1],o=r[2];return`#${i}${i}${l}${l}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function L1(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(N1(i)||A1(r))return Mh(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:l,colorMap:o}=e.setTheme(r);if(i==="ansi")return ZL(l,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new Kn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(l.name))throw new Kn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${l.name}"`)}return tI(t,c,l,o,n)}function eI(...e){if(e.length===2)return $c(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:l=t.getLoadedThemes()[0]}=r;if(N1(i)||A1(l))throw new Kn("Plain language does not have grammar state");if(i==="ansi")throw new Kn("ANSI language does not have grammar state");const{theme:o,colorMap:c}=t.setTheme(l),d=t.getLanguage(i);return new fu(I1(n,d,o,c,r).stateStack,d.name,o.name)}function tI(e,t,n,r,i){const l=I1(e,t,n,r,i),o=new fu(l.stateStack,t.name,n.name);return Ph(l.tokens,o),l.tokens}function I1(e,t,n,r,i){const l=dh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:c=500}=i,d=Mh(e);let m=i.grammarState?zL(i.grammarState,n.name)??vg:i.grammarContextCode!=null?I1(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:vg,p=[];const g=[];for(let y=0,E=d.length;y<E;y++){const[v,w]=d[y];if(v===""){p=[],g.push([]);continue}if(o>0&&v.length>=o){p=[],g.push([{content:v,offset:w,color:"",fontStyle:0}]);continue}let C,S,N;i.includeExplanation&&(C=t.tokenizeLine(v,m,c),S=C.tokens,N=0);const R=t.tokenizeLine2(v,m,c),M=R.tokens.length/2;for(let Y=0;Y<M;Y++){const U=R.tokens[2*Y],P=Y+1<M?R.tokens[2*Y+2]:v.length;if(U===P)continue;const q=R.tokens[2*Y+1],le=Xi(r[nu.getForeground(q)],l),X=nu.getFontStyle(q),fe={content:v.substring(U,P),offset:w+U,color:le,fontStyle:X};if(i.includeExplanation){const F=[];if(i.includeExplanation!=="scopeName")for(const me of n.settings){let ne;switch(typeof me.scope){case"string":ne=me.scope.split(/,/).map($=>$.trim());break;case"object":ne=me.scope;break;default:continue}F.push({settings:me,selectors:ne.map($=>$.split(/ /))})}fe.explanation=[];let Te=0;for(;U+Te<P;){const me=S[N],ne=v.substring(me.startIndex,me.endIndex);Te+=ne.length,fe.explanation.push({content:ne,scopes:i.includeExplanation==="scopeName"?nI(me.scopes):rI(F,me.scopes)}),N+=1}}p.push(fe)}g.push(p),p=[],m=R.ruleStack}return{tokens:g,stateStack:m}}function nI(e){return e.map(t=>({scopeName:t}))}function rI(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const l=t[r];n[r]={scopeName:l,themeMatches:sI(e,l,t.slice(0,r))}}return n}function Y2(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function aI(e,t,n){if(!Y2(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Y2(e[r],n[i])&&(r-=1),i-=1;return r===-1}function sI(e,t,n){const r=[];for(const{selectors:i,settings:l}of e)for(const o of i)if(aI(o,t,n)){r.push(l);break}return r}function Dk(e,t,n){const r=Object.entries(n.themes).filter(d=>d[1]).map(d=>({color:d[0],theme:d[1]})),i=r.map(d=>{const m=L1(e,t,{...n,theme:d.theme}),p=$c(m),g=typeof d.theme=="string"?d.theme:d.theme.name;return{tokens:m,state:p,theme:g}}),l=iI(...i.map(d=>d.tokens)),o=l[0].map((d,m)=>d.map((p,g)=>{const y={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(y.explanation=p.explanation),l.forEach((E,v)=>{const{content:w,explanation:C,offset:S,...N}=E[m][g];y.variants[r[v].color]=N}),y})),c=i[0].state?new fu(Object.fromEntries(i.map(d=>{var m;return[d.theme,(m=d.state)==null?void 0:m.getInternalStack(d.theme)]})),i[0].state.lang):void 0;return c&&Ph(o,c),o}function iI(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(d=>d[r]),l=t.map(()=>[]);t.forEach((d,m)=>d.push(l[m]));const o=i.map(()=>0),c=i.map(d=>d[0]);for(;c.every(d=>d);){const d=Math.min(...c.map(m=>m.content.length));for(let m=0;m<n;m++){const p=c[m];p.content.length===d?(l[m].push(p),o[m]+=1,c[m]=i[m][o[m]]):(l[m].push({...p,content:p.content.slice(0,d)}),c[m]={...p,content:p.content.slice(d),offset:p.offset+d})}}}return t}function mh(e,t,n){let r,i,l,o,c,d;if("themes"in n){const{defaultColor:m="light",cssVariablePrefix:p="--shiki-",colorsRendering:g="css-vars"}=n,y=Object.entries(n.themes).filter(S=>S[1]).map(S=>({color:S[0],theme:S[1]})).sort((S,N)=>S.color===m?-1:N.color===m?1:0);if(y.length===0)throw new Kn("`themes` option must not be empty");const E=Dk(e,t,n);if(d=$c(E),m&&R1!==m&&!y.find(S=>S.color===m))throw new Kn(`\`themes\` option must contain the defaultColor key \`${m}\``);const v=y.map(S=>e.getTheme(S.theme)),w=y.map(S=>S.color);l=E.map(S=>S.map(N=>UL(N,w,p,m,g))),d&&Ph(l,d);const C=y.map(S=>dh(S.theme,n));i=W2(y,v,C,p,m,"fg",g),r=W2(y,v,C,p,m,"bg",g),o=`shiki-themes ${v.map(S=>S.name).join(" ")}`,c=m?void 0:[i,r].join(";")}else if("theme"in n){const m=dh(n.theme,n);l=L1(e,t,n);const p=e.getTheme(n.theme);r=Xi(p.bg,m),i=Xi(p.fg,m),o=p.name,d=$c(l)}else throw new Kn("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:i,bg:r,themeName:o,rootStyle:c,grammarState:d}}function W2(e,t,n,r,i,l,o){return e.map((c,d)=>{const m=Xi(t[d][l],n[d])||"inherit",p=`${r+c.color}${l==="bg"?"-bg":""}:${m}`;if(d===0&&i){if(i===R1&&e.length>1){const g=e.findIndex(w=>w.color==="light"),y=e.findIndex(w=>w.color==="dark");if(g===-1||y===-1)throw new Kn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=Xi(t[g][l],n[g])||"inherit",v=Xi(t[y][l],n[y])||"inherit";return`light-dark(${E}, ${v});${p}`}return m}return o==="css-vars"?p:null}).filter(c=>!!c).join(";")}function ph(e,t,n,r={meta:{},options:n,codeToHast:(i,l)=>ph(e,i,l),codeToTokens:(i,l)=>mh(e,i,l)}){var v,w;let i=t;for(const C of hh(n))i=((v=C.preprocess)==null?void 0:v.call(r,i,n))||i;let{tokens:l,fg:o,bg:c,themeName:d,rootStyle:m,grammarState:p}=mh(e,i,n);const{mergeWhitespaces:g=!0,mergeSameStyleTokens:y=!1}=n;g===!0?l=oI(l):g==="never"&&(l=uI(l)),y&&(l=cI(l));const E={...r,get source(){return i}};for(const C of hh(n))l=((w=C.tokens)==null?void 0:w.call(E,l))||l;return lI(l,{...n,fg:o,bg:c,themeName:d,rootStyle:n.rootStyle===!1?!1:n.rootStyle??m},E,p)}function lI(e,t,n,r=$c(e)){var w,C,S,N;const i=hh(t),l=[],o={type:"root",children:[]},{structure:c="classic",tabindex:d="0"}=t,m={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?m.style=t.rootStyle:m.style=`background-color:${t.bg};color:${t.fg}`),d!==!1&&d!=null&&(m.tabindex=d.toString());for(const[R,M]of Object.entries(t.meta||{}))R.startsWith("_")||(m[R]=M);let p={type:"element",tagName:"pre",properties:m,children:[],data:t.data},g={type:"element",tagName:"code",properties:{},children:l};const y=[],E={...n,structure:c,addClassToHast:Lk,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return p},get code(){return g},get lines(){return y}};if(e.forEach((R,M)=>{var P,q;M&&(c==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&l.push({type:"text",value:`
|
|
103
|
-
`}));let Y={type:"element",tagName:"span",properties:{class:"line"},children:[]},U=0;for(const le of R){let X={type:"element",tagName:"span",properties:{...le.htmlAttrs},children:[{type:"text",value:le.content}]};const fe=Sg(le.htmlStyle||fh(le));fe&&(X.properties.style=fe);for(const F of i)X=((P=F==null?void 0:F.span)==null?void 0:P.call(E,X,M+1,U,Y,le))||X;c==="inline"?o.children.push(X):c==="classic"&&Y.children.push(X),U+=le.content.length}if(c==="classic"){for(const le of i)Y=((q=le==null?void 0:le.line)==null?void 0:q.call(E,Y,M+1))||Y;y.push(Y),l.push(Y)}else c==="inline"&&y.push(Y)}),c==="classic"){for(const R of i)g=((w=R==null?void 0:R.code)==null?void 0:w.call(E,g))||g;p.children.push(g);for(const R of i)p=((C=R==null?void 0:R.pre)==null?void 0:C.call(E,p))||p;o.children.push(p)}else if(c==="inline"){const R=[];let M={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const P of o.children)P.type==="element"&&P.tagName==="br"?(R.push(M),M={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(P.type==="element"||P.type==="text")&&M.children.push(P);R.push(M);let U={type:"element",tagName:"code",properties:{},children:R};for(const P of i)U=((S=P==null?void 0:P.code)==null?void 0:S.call(E,U))||U;o.children=[];for(let P=0;P<U.children.length;P++){P>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const q=U.children[P];q.type==="element"&&o.children.push(...q.children)}}let v=o;for(const R of i)v=((N=R==null?void 0:R.root)==null?void 0:N.call(E,v))||v;return r&&Ph(v,r),v}function oI(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((l,o)=>{const d=!(l.fontStyle&&(l.fontStyle&Sr.Underline||l.fontStyle&Sr.Strikethrough));d&&l.content.match(/^\s+$/)&&t[o+1]?(i===void 0&&(i=l.offset),r+=l.content):r?(d?n.push({...l,offset:i,content:r+l.content}):n.push({content:r,offset:i},l),i=void 0,r=""):n.push(l)}),n})}function uI(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,l,o]=r;if(!i&&!o)return n;const c=[{...n,offset:n.offset+i.length,content:l}];return i&&c.unshift({content:i,offset:n.offset}),o&&c.push({content:o,offset:n.offset+i.length+l.length}),c}))}function cI(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],l=Sg(i.htmlStyle||fh(i)),o=Sg(r.htmlStyle||fh(r)),c=i.fontStyle&&(i.fontStyle&Sr.Underline||i.fontStyle&Sr.Strikethrough),d=r.fontStyle&&(r.fontStyle&Sr.Underline||r.fontStyle&Sr.Strikethrough);!c&&!d&&l===o?i.content+=r.content:n.push({...r})}return n})}const dI=LL;function fI(e,t,n){var l;const r={meta:{},options:n,codeToHast:(o,c)=>ph(e,o,c),codeToTokens:(o,c)=>mh(e,o,c)};let i=dI(ph(e,t,n,r));for(const o of hh(n))i=((l=o.postprocess)==null?void 0:l.call(r,i,n))||i;return i}const Q2={light:"#333333",dark:"#bbbbbb"},X2={light:"#fffffe",dark:"#1e1e1e"},K2="__shiki_resolved";function O1(e){var c,d,m,p,g;if(e!=null&&e[K2])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:r}=t;if(!n||!r){const y=t.settings?t.settings.find(E=>!E.name&&!E.scope):void 0;(c=y==null?void 0:y.settings)!=null&&c.foreground&&(r=y.settings.foreground),(d=y==null?void 0:y.settings)!=null&&d.background&&(n=y.settings.background),!r&&((m=t==null?void 0:t.colors)!=null&&m["editor.foreground"])&&(r=t.colors["editor.foreground"]),!n&&((p=t==null?void 0:t.colors)!=null&&p["editor.background"])&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?Q2.light:Q2.dark),n||(n=t.type==="light"?X2.light:X2.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const l=new Map;function o(y){var v;if(l.has(y))return l.get(y);i+=1;const E=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(v=t.colorReplacements)!=null&&v[`#${E}`]?o(y):(l.set(y,E),E)}t.settings=t.settings.map(y=>{var C,S;const E=((C=y.settings)==null?void 0:C.foreground)&&!y.settings.foreground.startsWith("#"),v=((S=y.settings)==null?void 0:S.background)&&!y.settings.background.startsWith("#");if(!E&&!v)return y;const w={...y,settings:{...y.settings}};if(E){const N=o(y.settings.foreground);t.colorReplacements[N]=y.settings.foreground,w.settings.foreground=N}if(v){const N=o(y.settings.background);t.colorReplacements[N]=y.settings.background,w.settings.background=N}return w});for(const y of Object.keys(t.colors||{}))if((y==="editor.foreground"||y==="editor.background"||y.startsWith("terminal.ansi"))&&!((g=t.colors[y])!=null&&g.startsWith("#"))){const E=o(t.colors[y]);t.colorReplacements[E]=t.colors[y],t.colors[y]=E}return Object.defineProperty(t,K2,{enumerable:!1,writable:!1,value:!0}),t}async function jk(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Ak(t)).map(async t=>await Nk(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Mk(e){return(await Promise.all(e.map(async n=>Rk(n)?null:O1(await Nk(n))))).filter(n=>!!n)}let hI=3;function mI(e,t=3){t>hI||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Qo=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Pk(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Qo(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class pI extends TR{constructor(n,r,i,l={}){super(n);de(this,"_resolvedThemes",new Map);de(this,"_resolvedGrammars",new Map);de(this,"_langMap",new Map);de(this,"_langGraph",new Map);de(this,"_textmateThemeCache",new WeakMap);de(this,"_loadedThemesCache",null);de(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=i,this._alias=l,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=O1(n);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let r=this._textmateThemeCache.get(n);r||(r=sh.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=Pk(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var o,c,d,m;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(p=>{var g;return(g=p.embeddedLangsLazy)==null?void 0:g.includes(n.name)}));this._resolver.addLanguage(n);const i={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const l=this.loadGrammarWithConfiguration(n.scopeName,1,i);if(l.name=n.name,this._resolvedGrammars.set(n.name,l),n.aliases&&n.aliases.forEach(p=>{this._alias[p]=n.name}),this._loadedLanguagesCache=null,r.size)for(const p of r)this._resolvedGrammars.delete(p.name),this._loadedLanguagesCache=null,(c=(o=this._syncRegistry)==null?void 0:o._injectionGrammars)==null||c.delete(p.scopeName),(m=(d=this._syncRegistry)==null?void 0:d._grammars)==null||m.delete(p.scopeName),this.loadLanguage(this._langMap.get(p.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const l of n)this.resolveEmbeddedLanguages(l);const r=Array.from(this._langGraph.entries()),i=r.filter(([l,o])=>!o);if(i.length){const l=r.filter(([o,c])=>{if(!c)return!1;const d=c.embeddedLanguages||c.embeddedLangs;return d==null?void 0:d.some(m=>i.map(([p])=>p).includes(m))}).filter(o=>!i.includes(o));throw new Qo(`Missing languages ${i.map(([o])=>`\`${o}\``).join(", ")}, required by ${l.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[l,o]of r)this._resolver.addLanguage(o);for(const[l,o]of r)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){this._langMap.set(n.name,n),this._langGraph.set(n.name,n);const r=n.embeddedLanguages??n.embeddedLangs;if(r)for(const i of r)this._langGraph.set(i,this._langMap.get(i))}}class gI{constructor(t,n){de(this,"_langs",new Map);de(this,"_scopeToLang",new Map);de(this,"_injections",new Map);de(this,"_onigLib");this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let i=1;i<=n.length;i++){const l=n.slice(0,i).join(".");r=[...r,...this._injections.get(l)||[]]}return r}}let uc=0;function bI(e){uc+=1,e.warnings!==!1&&uc>=10&&uc%10===0&&console.warn(`[Shiki] ${uc} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Qo("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(O1),i=new gI(e.engine,n),l=new pI(i,r,n,e.langAlias);let o;function c(R){return Pk(R,e.langAlias)}function d(R){S();const M=l.getGrammar(typeof R=="string"?R:R.name);if(!M)throw new Qo(`Language \`${R}\` not found, you may need to load it first`);return M}function m(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};S();const M=l.getTheme(R);if(!M)throw new Qo(`Theme \`${R}\` not found, you may need to load it first`);return M}function p(R){S();const M=m(R);o!==R&&(l.setTheme(M),o=R);const Y=l.getColorMap();return{theme:M,colorMap:Y}}function g(){return S(),l.getLoadedThemes()}function y(){return S(),l.getLoadedLanguages()}function E(...R){S(),l.loadLanguages(R.flat(1))}async function v(...R){return E(await jk(R))}function w(...R){S();for(const M of R.flat(1))l.loadTheme(M)}async function C(...R){return S(),w(await Mk(R))}function S(){if(t)throw new Qo("Shiki instance has been disposed")}function N(){t||(t=!0,l.dispose(),uc-=1)}return{setTheme:p,getTheme:m,getLanguage:d,getLoadedThemes:g,getLoadedLanguages:y,resolveLangAlias:c,loadLanguage:v,loadLanguageSync:E,loadTheme:C,loadThemeSync:w,dispose:N,[Symbol.dispose]:N}}async function xI(e){e.engine||mI("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Mk(e.themes||[]),jk(e.langs||[]),e.engine]);return bI({...e,themes:t,langs:n,engine:r})}async function yI(e){const t=await xI(e);return{getLastGrammarState:(...n)=>eI(t,...n),codeToTokensBase:(n,r)=>L1(t,n,r),codeToTokensWithThemes:(n,r)=>Dk(t,n,r),codeToTokens:(n,r)=>mh(t,n,r),codeToHast:(n,r)=>ph(t,n,r),codeToHtml:(n,r)=>fI(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function EI(e){const t=e.langs,n=e.themes,r=e.engine;async function i(l){function o(g){var y;if(typeof g=="string"){if(g=((y=l.langAlias)==null?void 0:y[g])||g,Ak(g))return[];const E=t[g];if(!E)throw new Kn(`Language \`${g}\` is not included in this bundle. You may want to load it from external source.`);return E}return g}function c(g){if(Rk(g))return"none";if(typeof g=="string"){const y=n[g];if(!y)throw new Kn(`Theme \`${g}\` is not included in this bundle. You may want to load it from external source.`);return y}return g}const d=(l.themes??[]).map(g=>c(g)),m=(l.langs??[]).map(g=>o(g)),p=await yI({engine:l.engine??r(),...l,themes:d,langs:m});return{...p,loadLanguage(...g){return p.loadLanguage(...g.map(o))},loadTheme(...g){return p.loadTheme(...g.map(c))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const D1=[{id:"abap",name:"ABAP",import:(()=>D(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>D(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>D(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>D(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>D(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>D(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>D(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>D(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>D(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>D(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>D(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>D(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>D(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>D(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>D(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>D(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>D(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>D(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>D(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>D(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>D(()=>import("./bird2-DPOp833l.js"),[]))},{id:"blade",name:"Blade",import:(()=>D(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>D(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>D(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>D(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>D(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>D(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>D(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>D(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>D(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>D(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>D(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>D(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>D(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>D(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>D(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>D(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>D(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>D(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>D(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>D(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>D(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>D(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>D(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>D(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>D(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>D(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>D(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>D(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>D(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>D(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>D(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>D(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>D(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>D(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>D(()=>import("./erb-B12qg9BL.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>D(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>D(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>D(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>D(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>D(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>D(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>D(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>D(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>D(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>D(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>D(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>D(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>D(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>D(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>D(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>D(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>D(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>D(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>D(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>D(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>D(()=>import("./go-CxLEBnE3.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>D(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>D(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>D(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>D(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>D(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>D(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>D(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>D(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>D(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>D(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>D(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>D(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>D(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>D(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>D(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>D(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>D(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>D(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>D(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>D(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>D(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>D(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>D(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>D(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>D(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>D(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>D(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>D(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>D(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>D(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>D(()=>import("./just-Cw27pwNe.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>D(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>D(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>D(()=>import("./kusto-DZf3V79B.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>D(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>D(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>D(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>D(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>D(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>D(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>D(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>D(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>D(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>D(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>D(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>D(()=>import("./marko-CnJfTvn9.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>D(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>D(()=>import("./mdc-BMNejdWA.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>D(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>D(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>D(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>D(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>D(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>D(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>D(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>D(()=>import("./nextflow-Zz6hmt5N.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>D(()=>import("./nextflow-groovy-BeH2EWoN.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>D(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>D(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>D(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>D(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>D(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>D(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>D(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>D(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>D(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>D(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>D(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>D(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>D(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>D(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>D(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>D(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>D(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>D(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>D(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>D(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>D(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>D(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>D(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>D(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>D(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>D(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>D(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>D(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>D(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>D(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>D(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>D(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>D(()=>import("./razor-Uh8Bk_45.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>D(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>D(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>D(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>D(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>D(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>D(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>D(()=>import("./rst-BrH8l1NY.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>D(()=>import("./ruby-Dw2BHqvy.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>D(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>D(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>D(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>D(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>D(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>D(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>D(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>D(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>D(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>D(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>D(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>D(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>D(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>D(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>D(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>D(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>D(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>D(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>D(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>D(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>D(()=>import("./svelte-C_ipcX3V.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>D(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>D(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>D(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>D(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>D(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>D(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>D(()=>import("./templ-P3uqSqPl.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>D(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>D(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>D(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>D(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>D(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>D(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>D(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>D(()=>import("./twig-DNn4PbVi.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>D(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>D(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>D(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>D(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>D(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>D(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>D(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>D(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>D(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>D(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>D(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>D(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>D(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>D(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>D(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>D(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>D(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>D(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>D(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>D(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>D(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>D(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>D(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>D(()=>import("./zig-VOosw3JB.js"),[]))}],_I=Object.fromEntries(D1.map(e=>[e.id,e.import])),TI=Object.fromEntries(D1.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))||[]})),Bk={..._I,...TI},vI=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>D(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>D(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>D(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>D(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>D(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>D(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>D(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>D(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>D(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>D(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>D(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>D(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>D(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>D(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>D(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>D(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>D(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>D(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>D(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>D(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>D(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>D(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>D(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>D(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>D(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>D(()=>import("./horizon-bright-Cn-bp-IR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>D(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>D(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>D(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>D(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>D(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>D(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>D(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>D(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>D(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>D(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>D(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>D(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>D(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>D(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>D(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>D(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>D(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>D(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>D(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>D(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>D(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>D(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>D(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>D(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>D(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>D(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>D(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>D(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>D(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>D(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>D(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>D(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>D(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>D(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>D(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>D(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],kI=Object.fromEntries(vI.map(e=>[e.id,e.import]));class j1 extends Error{constructor(t){super(t),this.name="ShikiError"}}function wI(){return 2147483648}function CI(){return typeof performance<"u"?performance.now():Date.now()}const SI=(e,t)=>e+(t-e%t)%t;async function NI(e){let t,n;const r={};function i(E){n=E,r.HEAPU8=new Uint8Array(E),r.HEAPU32=new Uint32Array(E)}function l(E,v,w){r.HEAPU8.copyWithin(E,v,v+w)}function o(E){try{return t.grow(E-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function c(E){const v=r.HEAPU8.length;E=E>>>0;const w=wI();if(E>w)return!1;for(let C=1;C<=4;C*=2){let S=v*(1+.2/C);S=Math.min(S,E+100663296);const N=Math.min(w,SI(Math.max(E,S),65536));if(o(N))return!0}return!1}const d=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function m(E,v,w=1024){const C=v+w;let S=v;for(;E[S]&&!(S>=C);)++S;if(S-v>16&&E.buffer&&d)return d.decode(E.subarray(v,S));let N="";for(;v<S;){let R=E[v++];if(!(R&128)){N+=String.fromCharCode(R);continue}const M=E[v++]&63;if((R&224)===192){N+=String.fromCharCode((R&31)<<6|M);continue}const Y=E[v++]&63;if((R&240)===224?R=(R&15)<<12|M<<6|Y:R=(R&7)<<18|M<<12|Y<<6|E[v++]&63,R<65536)N+=String.fromCharCode(R);else{const U=R-65536;N+=String.fromCharCode(55296|U>>10,56320|U&1023)}}return N}function p(E,v){return E?m(r.HEAPU8,E,v):""}const g={emscripten_get_now:CI,emscripten_memcpy_big:l,emscripten_resize_heap:c,fd_write:()=>0};async function y(){const v=await e({env:g,wasi_snapshot_preview1:g});t=v.memory,i(t.buffer),Object.assign(r,v),r.UTF8ToString=p}return await y(),r}var AI=Object.defineProperty,RI=(e,t,n)=>t in e?AI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ir=(e,t,n)=>RI(e,typeof t!="symbol"?t+"":t,n);let pr=null;function LI(e){throw new j1(e.UTF8ToString(e.getLastOnigError()))}class Bh{constructor(t){ir(this,"utf16Length"),ir(this,"utf8Length"),ir(this,"utf16Value"),ir(this,"utf8Value"),ir(this,"utf16OffsetToUtf8"),ir(this,"utf8OffsetToUtf16");const n=t.length,r=Bh._utf8ByteLength(t),i=r!==n,l=i?new Uint32Array(n+1):null;i&&(l[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const c=new Uint8Array(r);let d=0;for(let m=0;m<n;m++){const p=t.charCodeAt(m);let g=p,y=!1;if(p>=55296&&p<=56319&&m+1<n){const E=t.charCodeAt(m+1);E>=56320&&E<=57343&&(g=(p-55296<<10)+65536|E-56320,y=!0)}i&&(l[m]=d,y&&(l[m+1]=d),g<=127?o[d+0]=m:g<=2047?(o[d+0]=m,o[d+1]=m):g<=65535?(o[d+0]=m,o[d+1]=m,o[d+2]=m):(o[d+0]=m,o[d+1]=m,o[d+2]=m,o[d+3]=m)),g<=127?c[d++]=g:g<=2047?(c[d++]=192|(g&1984)>>>6,c[d++]=128|(g&63)>>>0):g<=65535?(c[d++]=224|(g&61440)>>>12,c[d++]=128|(g&4032)>>>6,c[d++]=128|(g&63)>>>0):(c[d++]=240|(g&1835008)>>>18,c[d++]=128|(g&258048)>>>12,c[d++]=128|(g&4032)>>>6,c[d++]=128|(g&63)>>>0),y&&m++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=c,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const l=t.charCodeAt(r);let o=l,c=!1;if(l>=55296&&l<=56319&&r+1<i){const d=t.charCodeAt(r+1);d>=56320&&d<=57343&&(o=(l-55296<<10)+65536|d-56320,c=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,c&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Uh=class fs{constructor(t){if(ir(this,"id",++fs.LAST_ID),ir(this,"_onigBinding"),ir(this,"content"),ir(this,"utf16Length"),ir(this,"utf8Length"),ir(this,"utf16OffsetToUtf8"),ir(this,"utf8OffsetToUtf16"),ir(this,"ptr"),!pr)throw new j1("Must invoke loadWasm first.");this._onigBinding=pr,this.content=t;const n=new Bh(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!fs._sharedPtrInUse?(fs._sharedPtr||(fs._sharedPtr=pr.omalloc(1e4)),fs._sharedPtrInUse=!0,pr.HEAPU8.set(n.utf8Value,fs._sharedPtr),this.ptr=fs._sharedPtr):this.ptr=n.createString(pr)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===fs._sharedPtr?fs._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};ir(Uh,"LAST_ID",0);ir(Uh,"_sharedPtr",0);ir(Uh,"_sharedPtrInUse",!1);let Uk=Uh;class II{constructor(t){if(ir(this,"_onigBinding"),ir(this,"_ptr"),!pr)throw new j1("Must invoke loadWasm first.");const n=[],r=[];for(let c=0,d=t.length;c<d;c++){const m=new Bh(t[c]);n[c]=m.createString(pr),r[c]=m.utf8Length}const i=pr.omalloc(4*t.length);pr.HEAPU32.set(n,i/4);const l=pr.omalloc(4*t.length);pr.HEAPU32.set(r,l/4);const o=pr.createOnigScanner(i,l,t.length);for(let c=0,d=t.length;c<d;c++)pr.ofree(n[c]);pr.ofree(l),pr.ofree(i),o===0&&LI(pr),this._onigBinding=pr,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new Uk(t);const l=this._findNextMatchSync(t,n,!1,i);return t.dispose(),l}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const l=this._onigBinding,o=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(o===0)return null;const c=l.HEAPU32;let d=o/4;const m=c[d++],p=c[d++],g=[];for(let y=0;y<p;y++){const E=t.convertUtf8OffsetToUtf16(c[d++]),v=t.convertUtf8OffsetToUtf16(c[d++]);g[y]={start:E,end:v,length:v-E}}return{index:m,captureIndices:g}}}function OI(e){return typeof e.instantiator=="function"}function DI(e){return typeof e.default=="function"}function jI(e){return typeof e.data<"u"}function MI(e){return typeof Response<"u"&&e instanceof Response}function PI(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let kf;function BI(e){if(kf)return kf;async function t(){pr=await NI(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),OI(r)?r=await r.instantiator(n):DI(r)?r=await r.default(n):(jI(r)&&(r=r.data),MI(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await UI(r)(n):r=await HI(r)(n):PI(r)?r=await w0(r)(n):r instanceof WebAssembly.Module?r=await w0(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await w0(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return kf=t(),kf}function w0(e){return t=>WebAssembly.instantiate(e,t)}function UI(e){return t=>WebAssembly.instantiateStreaming(e,t)}function HI(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function zI(e){return e&&await BI(e),{createScanner(t){return new II(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Uk(t)}}}const FI=EI({langs:Bk,themes:kI,engine:()=>zI(D(()=>import("./wasm-CG6Dc4jp.js"),[]))});function hu(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function $I(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const M1=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),gr=String.raw;function mu(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Hk=gr`\[\^?`,zk=`c.? | C(?:-.?)?|${gr`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${gr`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${gr`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${gr`o\{[^\}]*\}?`}|${gr`\d{1,3}`}`,P1=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,wf=new RegExp(gr`
|
|
104
|
-
\\ (?:
|
|
105
|
-
${zk}
|
|
106
|
-
| [gk]<[^>]*>?
|
|
107
|
-
| [gk]'[^']*'?
|
|
108
|
-
| .
|
|
109
|
-
)
|
|
110
|
-
| \( (?:
|
|
111
|
-
\? (?:
|
|
112
|
-
[:=!>({]
|
|
113
|
-
| <[=!]
|
|
114
|
-
| <[^>]*>
|
|
115
|
-
| '[^']*'
|
|
116
|
-
| ~\|?
|
|
117
|
-
| #(?:[^)\\]|\\.?)*
|
|
118
|
-
| [^:)]*[:)]
|
|
119
|
-
)?
|
|
120
|
-
| \*[^\)]*\)?
|
|
121
|
-
)?
|
|
122
|
-
| (?:${P1.source})+
|
|
123
|
-
| ${Hk}
|
|
124
|
-
| .
|
|
125
|
-
`.replace(/\s+/g,""),"gsu"),C0=new RegExp(gr`
|
|
126
|
-
\\ (?:
|
|
127
|
-
${zk}
|
|
128
|
-
| .
|
|
129
|
-
)
|
|
130
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
131
|
-
| ${Hk}
|
|
132
|
-
| &&
|
|
133
|
-
| .
|
|
134
|
-
`.replace(/\s+/g,""),"gsu");function VI(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=uO(n.flags),i=[r.extended],l={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(g){i.push(g)},replaceCurrentModX(g){i[i.length-1]=g},singleline:n.rules.singleline};let o=[],c;for(wf.lastIndex=0;c=wf.exec(e);){const g=GI(l,e,c[0],wf.lastIndex);g.tokens?o.push(...g.tokens):g.token&&o.push(g.token),g.lastIndex!==void 0&&(wf.lastIndex=g.lastIndex)}const d=[];let m=0;o.filter(g=>g.type==="GroupOpen").forEach(g=>{g.kind==="capturing"?g.number=++m:g.raw==="("&&d.push(g)}),m||d.forEach((g,y)=>{g.kind="capturing",g.number=y+1});const p=m||d.length;return{tokens:o.map(g=>g.type==="EscapedNumber"?dO(g,p):g).flat(),flags:r}}function GI(e,t,n,r){const[i,l]=n;if(n==="["||n==="[^"){const o=qI(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(l))return{token:Z2(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:nO(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:$k(n)}}if(l==="K")return{token:Vk("keep",n)};if(l==="N"||l==="R")return{token:Fl("newline",n,{negate:l==="N"})};if(l==="O")return{token:Fl("any",n)};if(l==="X")return{token:Fl("text_segment",n)};const o=Fk(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(l==="*")return{token:iO(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:sO(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:qo("group",n)};if(n==="(?>")return{token:qo("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:qo(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:qo("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:qo("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:JI(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
|
|
135
|
-
`,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:Fl("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":gr`\A`,$:gr`\Z`}[n]:n;return{token:Z2(o,n)}}return n==="|"?{token:WI(n)}:P1.test(n)?{tokens:fO(n)}:{token:ni(hu(n),n)}}function qI(e,t,n){const r=[J2(t[1]==="^",t)];let i=1,l;for(C0.lastIndex=n;l=C0.exec(e);){const o=l[0];if(o[0]==="["&&o[1]!==":")i++,r.push(J2(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(ni(93,o));else if(i--,r.push(QI(o)),!i)break}else{const c=YI(o);Array.isArray(c)?r.push(...c):r.push(c)}}return{tokens:r,lastIndex:C0.lastIndex||e.length}}function YI(e){if(e[0]==="\\")return Fk(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!M1.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Fl("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?XI(e):e==="&&"?KI(e):ni(hu(e),e)}function Fk(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return aO(e);if("dDhHsSwW".includes(n))return lO(e);if(e.startsWith(gr`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return oO(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),l=new TextEncoder;return[...i].map(o=>{const c=[...l.encode(o)].map(d=>`\\x${d.toString(16)}`).join("");return ni(hu(o),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return ni(cO(e),e);if(e_.has(n))return ni(e_.get(n),e);if(/\d/.test(n))return ZI(t,e);if(e==="\\")throw new Error(gr`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return ni(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function WI(e){return{type:"Alternator",raw:e}}function Z2(e,t){return{type:"Assertion",kind:e,raw:t}}function $k(e){return{type:"Backreference",raw:e}}function ni(e,t){return{type:"Character",value:e,raw:t}}function QI(e){return{type:"CharacterClassClose",raw:e}}function XI(e){return{type:"CharacterClassHyphen",raw:e}}function KI(e){return{type:"CharacterClassIntersector",raw:e}}function J2(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Fl(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Vk(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:mu(n.flags),raw:t}}function ZI(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function JI(e){return{type:"GroupClose",raw:e}}function qo(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function eO(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function tO(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function nO(e){return{type:"Subroutine",raw:e}}const rO=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),e_=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function aO(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return ni(hu(t.toUpperCase())-64,e)}function sO(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??(r="");const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),l=n_(n),o=n_(r),c={};if(l&&(c.enable=l),o&&(c.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),Vk("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,qo("group",e,{...(l||o)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function iO(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const l=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[o,c,d]=l,m=rO.has(n)?n.toLowerCase():"custom";switch(m){case"fail":case"mismatch":case"skip":if(l.length>0)throw new Error(`Named callout arguments not allowed "${l}"`);break;case"error":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!l.length||l.length>2)throw new Error(`Named callout must have one or two arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(l.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(l.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(l.length!==3)throw new Error(`Named callout must have three arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof d=="string"&&!/^[A-Za-z_]\w*$/.test(d))throw new Error(`Named callout argument three must be a tag or number "${d}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${m}"`)}return eO(m,r??null,(i==null?void 0:i.split(","))??null,e)}function t_(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:l}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||l&&+l>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=l===void 0?+i:l===""?1/0:+l,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return tO(t,n,r,e)}function lO(e){const t=e[1].toLowerCase();return Fl({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function oO(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Fl("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function n_(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function uO(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function cO(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function dO(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[$k(n)];const l=[],o=i.match(/^[0-7]+|\d/g);for(let c=0;c<o.length;c++){const d=o[c];let m;if(c===0&&d!=="8"&&d!=="9"){if(m=parseInt(d,8),m>127)throw new Error(gr`Octal encoded byte above 177 unsupported "${n}"`)}else m=hu(d);l.push(ni(m,(c===0?"\\":"")+d))}return l}function fO(e){const t=[],n=new RegExp(P1,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const l=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(l){const{min:o,max:c}=l.groups;if(+o>+c&&i.endsWith("?")){n.lastIndex--,t.push(t_(i.slice(0,-1)));continue}}}t.push(t_(i))}return t}function Gk(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function hO(e){return mO.has(e.type)}const mO=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function qk(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=VI(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(y,E)=>{const v=r.tokens[l.nextIndex];switch(l.parent=y,l.nextIndex++,v.type){case"Alternator":return Yl();case"Assertion":return pO(v);case"Backreference":return gO(v,l);case"Character":return Hh(v.value,{useLastValid:!!E.isCheckingRangeEnd});case"CharacterClassHyphen":return bO(v,l,E);case"CharacterClassOpen":return xO(v,l,E);case"CharacterSet":return yO(v,l);case"Directive":return wO(v.kind,{flags:v.flags});case"GroupOpen":return EO(v,l,E);case"NamedCallout":return SO(v.kind,v.tag,v.arguments);case"Quantifier":return _O(v,l);case"Subroutine":return TO(v,l);default:throw new Error(`Unexpected token type "${v.type}"`)}},l={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=AO(CO(r.flags));let c=o.body[0];for(;l.nextIndex<r.tokens.length;){const y=i(c,{});y.type==="Alternative"?(o.body.push(y),c=y):c.body.push(y)}const{capturingGroups:d,hasNumberedRef:m,namedGroupsByName:p,subroutines:g}=l;if(m&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of g)if(typeof y=="number"){if(y>d.length)throw new Error("Subroutine uses a group number that's not defined");y&&(d[y-1].isSubroutined=!0)}else if(p.has(y)){if(p.get(y).length>1)throw new Error(gr`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(gr`Subroutine uses a group name that's not defined "\g<${y}>"`);return o}function pO({kind:e}){return Ng(mu({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===gr`\B`||e===gr`\Y`})}function gO({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(l,o=!1)=>{const c=t.capturingGroups.length;let d=!1;if(l>c)if(t.skipBackrefValidation)d=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Ag(o?c+1-l:l,{orphan:d})};if(n){const l=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(l)return i(+l.groups.num,!!l.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Ag(r)}return i(+r)}function bO(e,t,n){const{tokens:r,walk:i}=t,l=t.parent,o=l.body.at(-1),c=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const d=i(l,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&d.type==="Character")return l.body.pop(),kO(o,d);throw new Error("Invalid character class range")}return Hh(hu("-"))}function xO({negate:e},t,n){const{tokens:r,walk:i}=t,l=r[t.nextIndex],o=[Zf()];let c=s_(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")o.push(Zf()),t.nextIndex++;else{const m=o.at(-1);m.body.push(i(m,n))}c=s_(r[t.nextIndex],l)}const d=Zf({negate:e});return o.length===1?d.body=o[0].body:(d.kind="intersection",d.body=o.map(m=>m.body.length===1?m.body[0]:m)),t.nextIndex++,d}function yO({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o}=r;if(e==="property"){const c=zh(n);if(M1.has(c)&&!(o!=null&&o.has(c)))e="posix",n=c;else return Yo(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o})}return e==="posix"?NO(n,{negate:t}):Rg(e,{negate:t})}function EO(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:l,skipLookbehindValidation:o,walk:c}=t,d=RO(e),m=d.type==="AbsenceFunction",p=a_(d),g=p&&d.negate;if(d.type==="CapturingGroup"&&(i.push(d),d.name&&$I(l,d.name,[]).push(d)),m&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=i_(r[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")d.body.push(Yl()),t.nextIndex++;else{const E=d.body.at(-1),v=c(E,{...n,isInAbsenceFunction:n.isInAbsenceFunction||m,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||g});if(E.body.push(v),(p||n.isInLookbehind)&&!o){const w="Lookbehind includes a pattern not allowed by Oniguruma";if(g||n.isInNegLookbehind){if(r_(v)||v.type==="CapturingGroup")throw new Error(w)}else if(r_(v)||a_(v)&&v.negate)throw new Error(w)}}y=i_(r[t.nextIndex])}return t.nextIndex++,d}function _O({kind:e,min:t,max:n},r){const i=r.parent,l=i.body.at(-1);if(!l||!hO(l))throw new Error("Quantifier requires a repeatable token");const o=Wk(e,t,n,l);return i.body.pop(),o}function TO({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const l=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(l){const c=+l.groups.num,d=n.length;if(t.hasNumberedRef=!0,i={"":c,"+":d+c,"-":d+1-c}[l.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=Qk(i);return r.push(o),o}function vO(e,t){return{type:"AbsenceFunction",kind:e,body:ed(t==null?void 0:t.body)}}function Yl(e){return{type:"Alternative",body:Xk(e==null?void 0:e.body)}}function Ng(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!(t!=null&&t.negate)),n}function Ag(e,t){const n=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Yk(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!LO(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:ed(t==null?void 0:t.body)}}function Hh(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function Zf(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Xk(e==null?void 0:e.body)}}function kO(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Rg(e,t){const n=!!(t!=null&&t.negate),r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function wO(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:mu(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function CO(e){return{type:"Flags",...e}}function Qa(e){const t=e==null?void 0:e.atomic,n=e==null?void 0:e.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:ed(e==null?void 0:e.body)}}function Bl(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:ed(e==null?void 0:e.body)}}function SO(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function NO(e,t){const n=!!(t!=null&&t.negate);if(!M1.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Wk(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function AO(e,t){return{type:"Regex",body:ed(t==null?void 0:t.body),flags:e}}function Qk(e){return{type:"Subroutine",ref:e}}function Yo(e,t){var i;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=(i=n.unicodePropertyMap)==null?void 0:i.get(zh(e));if(!r){if(n.normalizeUnknownPropertyNames)r=IO(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(gr`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function RO({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return vO("repeater");case"atomic":return Qa({atomic:!0});case"capturing":return Yk(i,{name:n});case"group":return Qa({flags:e});case"lookahead":case"lookbehind":return Bl({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function ed(e){if(e===void 0)e=[Yl()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function Xk(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function r_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function a_(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function LO(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function IO(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function zh(e){return e.replace(/[- _]+/g,"").toLowerCase()}function s_(e,t){return mu(e,`${(t==null?void 0:t.type)==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function i_(e){return mu(e,"Unclosed group")}function Sc(e,t,n=null){function r(l,o){for(let c=0;c<l.length;c++){const d=i(l[c],o,c,l);c=Math.max(-1,c+d)}}function i(l,o=null,c=null,d=null){var S,N;let m=0,p=!1;const g={node:l,parent:o,key:c,container:d,root:e,remove(){Cf(d).splice(Math.max(0,Po(c)+m),1),m--,p=!0},removeAllNextSiblings(){return Cf(d).splice(Po(c)+1)},removeAllPrevSiblings(){const R=Po(c)+m;return m-=R,Cf(d).splice(0,Math.max(0,R))},replaceWith(R,M={}){const Y=!!M.traverse;d?d[Math.max(0,Po(c)+m)]=R:mu(o,"Can't replace root node")[c]=R,Y&&i(R,o,c,d),p=!0},replaceWithMultiple(R,M={}){const Y=!!M.traverse;if(Cf(d).splice(Math.max(0,Po(c)+m),1,...R),m+=R.length-1,Y){let U=0;for(let P=0;P<R.length;P++)U+=i(R[P],o,Po(c)+P+U,d)}p=!0},skip(){p=!0}},{type:y}=l,E=t["*"],v=t[y],w=typeof E=="function"?E:E==null?void 0:E.enter,C=typeof v=="function"?v:v==null?void 0:v.enter;if(w==null||w(g,n),C==null||C(g,n),!p)switch(y){case"AbsenceFunction":case"CapturingGroup":case"Group":r(l.body,l);break;case"Alternative":case"CharacterClass":r(l.body,l);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(l.min,l,"min"),i(l.max,l,"max");break;case"LookaroundAssertion":r(l.body,l);break;case"Quantifier":i(l.body,l,"body");break;case"Regex":r(l.body,l),i(l.flags,l,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return(S=v==null?void 0:v.exit)==null||S.call(v,g,n),(N=E==null?void 0:E.exit)==null||N.call(E,g,n),m}return i(e),e}function Cf(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Po(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const OO=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function DO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function jO(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Oa=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function B1(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),l=[!1];let o=0,c="";for(const d of e.matchAll(i)){const{0:m,groups:{$skip:p}}=d;if(!p&&(!r||r===Oa.DEFAULT==!o)){n instanceof Function?c+=n(d,{context:o?Oa.CHAR_CLASS:Oa.DEFAULT,negated:l[l.length-1]}):c+=n;continue}m[0]==="["?(o++,l.push(m[1]==="^")):m==="]"&&o&&(o--,l.pop()),c+=m}return c}function Kk(e,t,n,r){B1(e,t,n,r)}function MO(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let l=0,o;for(;o=i.exec(e);){const{0:c,groups:{$skip:d}}=o;if(!d&&(!r||r===Oa.DEFAULT==!l))return o;c==="["?l++:c==="]"&&l&&l--,i.lastIndex==o.index&&i.lastIndex++}return null}function Sf(e,t,n){return!!MO(e,t,0,n)}function PO(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,l=1,o;for(;o=n.exec(e);){const[c]=o;if(c==="[")i++;else if(i)c==="]"&&i--;else if(c==="(")l++;else if(c===")"&&(l--,!l)){r=o.index;break}}return e.slice(t,r)}const l_=new RegExp(String.raw`(?<noncapturingStart>${OO})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function BO(e,t){const n=(t==null?void 0:t.hiddenCaptures)??[];let r=(t==null?void 0:t.captureTransfers)??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",l="(?:(?=(",o=[0],c=[];let d=0,m=0,p=NaN,g;do{g=!1;let y=0,E=0,v=!1,w;for(l_.lastIndex=Number.isNaN(p)?0:p+l.length;w=l_.exec(e);){const{0:C,index:S,groups:{capturingStart:N,noncapturingStart:R}}=w;if(C==="[")y++;else if(y)C==="]"&&y--;else if(C===i&&!v)p=S,v=!0;else if(v&&R)E++;else if(N)v?E++:(d++,o.push(d+m));else if(C===")"&&v){if(!E){m++;const M=d+m;if(e=`${e.slice(0,p)}${l}${e.slice(p+i.length,S)}))<$$${M}>)${e.slice(S+1)}`,g=!0,c.push(M),DO(n,M),r.size){const Y=new Map;r.forEach((U,P)=>{Y.set(P>=M?P+1:P,U.map(q=>q>=M?q+1:q))}),r=Y}break}E--}}}while(g);return n.push(...c),e=B1(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:E,wrappedBackrefNum:v}})=>{if(E){const w=+E;if(w>o.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${o[w]}`}return`\\${v}`},Oa.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Zk=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,S0=new RegExp(String.raw`
|
|
136
|
-
\\(?: \d+
|
|
137
|
-
| c[A-Za-z]
|
|
138
|
-
| [gk]<[^>]+>
|
|
139
|
-
| [pPu]\{[^\}]+\}
|
|
140
|
-
| u[A-Fa-f\d]{4}
|
|
141
|
-
| x[A-Fa-f\d]{2}
|
|
142
|
-
)
|
|
143
|
-
| \((?: \? (?: [:=!>]
|
|
144
|
-
| <(?:[=!]|[^>]+>)
|
|
145
|
-
| [A-Za-z\-]+:
|
|
146
|
-
| \(DEFINE\)
|
|
147
|
-
))?
|
|
148
|
-
| (?<qBase>${Zk})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
149
|
-
| \\?.
|
|
150
|
-
`.replace(/\s+/g,""),"gsu");function UO(e){if(!new RegExp(`${Zk}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",l=0,o;for(S0.lastIndex=0;o=S0.exec(e);){const{0:c,index:d,groups:{qBase:m,qMod:p,invalidQ:g}}=o;if(c==="[")l||(r=d),l++;else if(c==="]")l?l--:r=null;else if(!l)if(p==="+"&&i&&!i.startsWith("(")){if(g)throw new Error(`Invalid quantifier "${c}"`);let y=-1;if(/^\{\d+\}$/.test(m))e=jO(e,d+m.length,p,"");else{if(i===")"||i==="]"){const E=i===")"?n:r;if(E===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,E)}(?>${e.slice(E,d)}${m})${e.slice(d+c.length)}`}else e=`${e.slice(0,d-i.length)}(?>${i}${m})${e.slice(d+c.length)}`;y+=4}S0.lastIndex+=y}else c[0]==="("?t.push(d):c===")"&&(n=t.length?t.pop():null);i=c}return{pattern:e}}const Ia=String.raw,HO=Ia`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Lg=Ia`\(\?R=(?<rDepth>[^\)]+)\)|${HO}`,Fh=Ia`\(\?<(?![=!])(?<captureName>[^>]+)>`,Jk=Ia`${Fh}|(?<unnamed>\()(?!\?)`,Dl=new RegExp(Ia`${Fh}|${Lg}|\(\?|\\?.`,"gsu"),N0="Cannot use multiple overlapping recursions";function zO(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(Lg,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Sf(e,Ia`\(\?\(DEFINE\)`,Oa.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const l=[],o=Sf(e,Ia`\\[1-9]`,Oa.DEFAULT),c=new Map,d=[];let m=!1,p=0,g=0,y;for(Dl.lastIndex=0;y=Dl.exec(e);){const{0:E,groups:{captureName:v,rDepth:w,gRNameOrNum:C,gRDepth:S}}=y;if(E==="[")p++;else if(p)E==="]"&&p--;else if(w){if(o_(w),m)throw new Error(N0);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const N=e.slice(0,y.index),R=e.slice(Dl.lastIndex);if(Sf(R,Lg,Oa.DEFAULT))throw new Error(N0);const M=+w-1;e=u_(N,R,M,!1,n,l,g),i=d_(i,N,M,l.length,0,g);break}else if(C){o_(S);let N=!1;for(const F of d)if(F.name===C||F.num===+C){if(N=!0,F.hasRecursedWithin)throw new Error(N0);break}if(!N)throw new Error(Ia`Recursive \g cannot be used outside the referenced group "${r==="external"?C:Ia`\g<${C}&R=${S}>`}"`);const R=c.get(C),M=PO(e,R);if(o&&Sf(M,Ia`${Fh}|\((?!\?)`,Oa.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const Y=e.slice(R,y.index),U=M.slice(Y.length+E.length),P=l.length,q=+S-1,le=u_(Y,U,q,!0,n,l,g);i=d_(i,Y,q,l.length-P,P,g);const X=e.slice(0,R),fe=e.slice(R+M.length);e=`${X}${le}${fe}`,Dl.lastIndex+=le.length-E.length-Y.length-U.length,d.forEach(F=>F.hasRecursedWithin=!0),m=!0}else if(v)g++,c.set(String(g),Dl.lastIndex),c.set(v,Dl.lastIndex),d.push({num:g,name:v});else if(E[0]==="("){const N=E==="(";N&&(g++,c.set(String(g),Dl.lastIndex)),d.push(N?{num:g}:{})}else E===")"&&d.pop()}return n.push(...l),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function o_(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function u_(e,t,n,r,i,l,o){const c=new Set;r&&Kk(e+t,Fh,({groups:{captureName:m}})=>{c.add(m)},Oa.DEFAULT);const d=[n,r?c:null,i,l,o];return`${e}${c_(`(?:${e}`,"forward",...d)}(?:)${c_(`${t})`,"backward",...d)}${t}`}function c_(e,t,n,r,i,l,o){const d=p=>t==="forward"?p+2:n-p+2-1;let m="";for(let p=0;p<n;p++){const g=d(p);m+=B1(e,Ia`${Jk}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:E,unnamed:v,backref:w}})=>{if(w&&r&&!r.has(w))return y;const C=`_$${g}`;if(v||E){const S=o+l.length+1;return l.push(S),FO(i,S),v?y:`(?<${E}${C}>`}return Ia`\k<${w}${C}>`},Oa.DEFAULT)}return m}function FO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function d_(e,t,n,r,i,l){if(e.size&&r){let o=0;Kk(t,Jk,()=>o++,Oa.DEFAULT);const c=l-o+i,d=new Map;return e.forEach((m,p)=>{const g=(r-o*n)/n,y=o*n,E=p>c+o?p+r:p,v=[];for(const w of m)if(w<=c)v.push(w);else if(w>c+o+g)v.push(w+r);else if(w<=c+o)for(let C=0;C<=n;C++)v.push(w+o*C);else for(let C=0;C<=n;C++)v.push(w+y+g*C);d.set(E,v)}),d}return e}var lr=String.fromCodePoint,_t=String.raw,Xa={},$h=globalThis.RegExp;Xa.flagGroups=(()=>{try{new $h("(?i:)")}catch{return!1}return!0})();Xa.unicodeSets=(()=>{try{new $h("[[]]","v")}catch{return!1}return!0})();Xa.bugFlagVLiteralHyphenIsRange=Xa.unicodeSets?(()=>{try{new $h(_t`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Xa.bugNestedClassIgnoresNegation=Xa.unicodeSets&&new $h("[[^a]]","v").test("a");function gh(e,{enable:t,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(t!=null&&t.dotAll||e.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(t!=null&&t.ignoreCase||e.ignoreCase)}}function Vc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Ig(e,t){return f_[e]>=f_[t]}function $O(e,t){if(e==null)throw new Error(t??"Value expected");return e}var f_={ES2025:2025,ES2024:2024,ES2018:2018},VO={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function ew(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!VO[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=Xa.flagGroups?"ES2025":Xa.unicodeSets?"ES2024":"ES2018"),t}var GO="[ -\r ]",qO=new Set([lr(304),lr(305)]),Qs=_t`[\p{L}\p{M}\p{N}\p{Pc}]`;function tw(e){if(qO.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=QO.get(n),l=YO.get(n),o=WO.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),l&&t.add(l),[...t]}var U1=new Map(`C Other
|
|
151
|
-
Cc Control cntrl
|
|
152
|
-
Cf Format
|
|
153
|
-
Cn Unassigned
|
|
154
|
-
Co Private_Use
|
|
155
|
-
Cs Surrogate
|
|
156
|
-
L Letter
|
|
157
|
-
LC Cased_Letter
|
|
158
|
-
Ll Lowercase_Letter
|
|
159
|
-
Lm Modifier_Letter
|
|
160
|
-
Lo Other_Letter
|
|
161
|
-
Lt Titlecase_Letter
|
|
162
|
-
Lu Uppercase_Letter
|
|
163
|
-
M Mark Combining_Mark
|
|
164
|
-
Mc Spacing_Mark
|
|
165
|
-
Me Enclosing_Mark
|
|
166
|
-
Mn Nonspacing_Mark
|
|
167
|
-
N Number
|
|
168
|
-
Nd Decimal_Number digit
|
|
169
|
-
Nl Letter_Number
|
|
170
|
-
No Other_Number
|
|
171
|
-
P Punctuation punct
|
|
172
|
-
Pc Connector_Punctuation
|
|
173
|
-
Pd Dash_Punctuation
|
|
174
|
-
Pe Close_Punctuation
|
|
175
|
-
Pf Final_Punctuation
|
|
176
|
-
Pi Initial_Punctuation
|
|
177
|
-
Po Other_Punctuation
|
|
178
|
-
Ps Open_Punctuation
|
|
179
|
-
S Symbol
|
|
180
|
-
Sc Currency_Symbol
|
|
181
|
-
Sk Modifier_Symbol
|
|
182
|
-
Sm Math_Symbol
|
|
183
|
-
So Other_Symbol
|
|
184
|
-
Z Separator
|
|
185
|
-
Zl Line_Separator
|
|
186
|
-
Zp Paragraph_Separator
|
|
187
|
-
Zs Space_Separator
|
|
188
|
-
ASCII
|
|
189
|
-
ASCII_Hex_Digit AHex
|
|
190
|
-
Alphabetic Alpha
|
|
191
|
-
Any
|
|
192
|
-
Assigned
|
|
193
|
-
Bidi_Control Bidi_C
|
|
194
|
-
Bidi_Mirrored Bidi_M
|
|
195
|
-
Case_Ignorable CI
|
|
196
|
-
Cased
|
|
197
|
-
Changes_When_Casefolded CWCF
|
|
198
|
-
Changes_When_Casemapped CWCM
|
|
199
|
-
Changes_When_Lowercased CWL
|
|
200
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
201
|
-
Changes_When_Titlecased CWT
|
|
202
|
-
Changes_When_Uppercased CWU
|
|
203
|
-
Dash
|
|
204
|
-
Default_Ignorable_Code_Point DI
|
|
205
|
-
Deprecated Dep
|
|
206
|
-
Diacritic Dia
|
|
207
|
-
Emoji
|
|
208
|
-
Emoji_Component EComp
|
|
209
|
-
Emoji_Modifier EMod
|
|
210
|
-
Emoji_Modifier_Base EBase
|
|
211
|
-
Emoji_Presentation EPres
|
|
212
|
-
Extended_Pictographic ExtPict
|
|
213
|
-
Extender Ext
|
|
214
|
-
Grapheme_Base Gr_Base
|
|
215
|
-
Grapheme_Extend Gr_Ext
|
|
216
|
-
Hex_Digit Hex
|
|
217
|
-
IDS_Binary_Operator IDSB
|
|
218
|
-
IDS_Trinary_Operator IDST
|
|
219
|
-
ID_Continue IDC
|
|
220
|
-
ID_Start IDS
|
|
221
|
-
Ideographic Ideo
|
|
222
|
-
Join_Control Join_C
|
|
223
|
-
Logical_Order_Exception LOE
|
|
224
|
-
Lowercase Lower
|
|
225
|
-
Math
|
|
226
|
-
Noncharacter_Code_Point NChar
|
|
227
|
-
Pattern_Syntax Pat_Syn
|
|
228
|
-
Pattern_White_Space Pat_WS
|
|
229
|
-
Quotation_Mark QMark
|
|
230
|
-
Radical
|
|
231
|
-
Regional_Indicator RI
|
|
232
|
-
Sentence_Terminal STerm
|
|
233
|
-
Soft_Dotted SD
|
|
234
|
-
Terminal_Punctuation Term
|
|
235
|
-
Unified_Ideograph UIdeo
|
|
236
|
-
Uppercase Upper
|
|
237
|
-
Variation_Selector VS
|
|
238
|
-
White_Space space
|
|
239
|
-
XID_Continue XIDC
|
|
240
|
-
XID_Start XIDS`.split(/\s/).map(e=>[zh(e),e])),YO=new Map([["s",lr(383)],[lr(383),"s"]]),WO=new Map([[lr(223),lr(7838)],[lr(107),lr(8490)],[lr(229),lr(8491)],[lr(969),lr(8486)]]),QO=new Map([zi(453),zi(456),zi(459),zi(498),...A0(8072,8079),...A0(8088,8095),...A0(8104,8111),zi(8124),zi(8140),zi(8188)]),XO=new Map([["alnum",_t`[\p{Alpha}\p{Nd}]`],["alpha",_t`\p{Alpha}`],["ascii",_t`\p{ASCII}`],["blank",_t`[\p{Zs}\t]`],["cntrl",_t`\p{Cc}`],["digit",_t`\p{Nd}`],["graph",_t`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",_t`\p{Lower}`],["print",_t`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",_t`[\p{P}\p{S}]`],["space",_t`\p{space}`],["upper",_t`\p{Upper}`],["word",_t`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",_t`\p{AHex}`]]);function KO(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function zi(e){const t=lr(e);return[t.toLowerCase(),t]}function A0(e,t){return KO(e,t).map(n=>zi(n))}var nw=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function ZO(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};rw(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Ig(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Sc(e,JO,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},l={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Sc(e,e8,l);const o={groupsByName:l.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:l.reffedNodesByReferencer};return Sc(e,t8,o),e._originMap=l.groupOriginByCopy,e._strategy=r.strategy,e}var JO={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const l=Qa();l.body[0].body.push(Bl({negate:!0,body:r}),Yo("Any"));const o=Qa();o.body[0].body.push(Wk("greedy",0,1/0,l)),n($n(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(l=>l.kind==="flags");for(let l=n+1;l<t.body.length;l++){const o=t.body[l];Vc(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=sw(t.get(e));if(r){const i=Qa({flags:r});i.body[0].body=e.body,e.body=[$n(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:l,replaceWith:o},c){const{kind:d,negate:m}=e,{asciiWordBoundaries:p,avoidSubclass:g,supportedGNodes:y,wordIsAscii:E}=c;if(d==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${m?"Y":"y"}"`);if(d==="line_end")o($n(Bl({body:[Yl({body:[Ng("string_end")]}),Yl({body:[Hh(10)]})]}),t));else if(d==="line_start")o($n(Xs(_t`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(d==="search_start")if(y.has(e))i.flags.sticky=!0,l();else{const v=r[n-1];if(v&&l8(v))o($n(Bl({negate:!0}),t));else{if(g)throw new Error(_t`Uses "\G" in a way that requires a subclass`);o(Fi(Ng("string_start"),t)),c.strategy="clip_search"}}else if(!(d==="string_end"||d==="string_start"))if(d==="string_end_newline")o($n(Xs(_t`(?=\n?\z)`),t));else if(d==="word_boundary"){if(!E&&!p){const v=`(?:(?<=${Qs})(?!${Qs})|(?<!${Qs})(?=${Qs}))`,w=`(?:(?<=${Qs})(?=${Qs})|(?<!${Qs})(?!${Qs}))`;o($n(Xs(m?w:v),t))}}else throw new Error(`Unexpected assertion kind "${d}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!L0(n)&&(n=R0(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!L0(r)&&(r=R0(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=Zf({body:[e]});n($n(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:l,spaceIsAscii:o,wordIsAscii:c}){const{kind:d,negate:m,value:p}=e;if(l&&(d==="digit"||p==="digit")){n(Fi(Rg("digit",{negate:m}),t));return}if(o&&(d==="space"||p==="space")){n($n(I0(Xs(GO),m),t));return}if(c&&(d==="word"||p==="word")){n(Fi(Rg("word",{negate:m}),t));return}if(d==="any")n(Fi(Yo("Any"),t));else if(d==="digit")n(Fi(Yo("Nd",{negate:m}),t));else if(d!=="dot")if(d==="text_segment"){if(r==="strict")throw new Error(_t`Use of "\X" requires non-strict accuracy`);const g="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",y=_t`\p{RI}{2}|${g}(?:\u200D${g})*`;n($n(Xs(_t`(?>\r\n|${i?_t`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(d==="hex")n(Fi(Yo("AHex",{negate:m}),t));else if(d==="newline")n($n(Xs(m?`[^
|
|
241
|
-
]`:`(?>\r
|
|
242
|
-
?|[
|
|
243
|
-
\v\f
\u2028\u2029])`),t));else if(d==="posix")if(!i&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let g={graph:"!-~",print:" -~"}[p];m&&(g=`\0-${lr(g.codePointAt(0)-1)}${lr(g.codePointAt(2)+1)}-`),n($n(Xs(`[${g}]`),t))}else n($n(I0(Xs(XO.get(p)),m),t));else if(d==="property")U1.has(zh(p))||(e.key="sc");else if(d==="space")n(Fi(Yo("space",{negate:m}),t));else if(d==="word")n($n(I0(Xs(Qs),m),t));else throw new Error(`Unexpected character set kind "${d}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:l,removeAllNextSiblings:o}){const{kind:c,flags:d}=e;if(c==="flags")if(!d.enable&&!d.disable)r();else{const m=Qa({flags:d});m.body[0].body=o(),i($n(m,t),{traverse:!0})}else if(c==="keep"){const m=n.body[0],g=n.body.length===1&&Gk(m,{type:"Group"})&&m.body[0].body.length===1?m.body[0]:n;if(t.parent!==g||g.body.length>1)throw new Error(_t`Uses "\K" in a way that's unsupported`);const y=Bl({behind:!0});y.body[0].body=l(),i($n(y,t))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n($n(Bl({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Qa();t.body[0].body.push(e.body),e.body=$n(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const l of e.body)if(l.body.length===1&&l.body[0].kind==="search_start")l.body.pop();else{const o=lw(l.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(l=>t.add(l))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(_t`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!L0(n)&&(n=R0(n,t),e.ref=n)}},e8={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:l})=>l)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:l,multiplexCapturesToLeftByRef:o,openRefs:c,reffedNodesByReferencer:d}){const m=i.get(e);if(m&&c.has(e.number)){const g=Fi(h_(e.number),t);d.set(g,c.get(e.number)),n(g);return}c.set(e.number,e),o.set(e.number,[]),e.name&&Vc(o,e.name,[]);const p=o.get(e.name??e.number);for(let g=0;g<p.length;g++){const y=p[g];if(m===y.node||m&&m===y.origin||e===y.origin){p.splice(g,1);break}}if(o.get(e.number).push({node:e,origin:m}),e.name&&o.get(e.name).push({node:e,origin:m}),e.name){const g=Vc(l,e.name,new Map);let y=!1;if(m)y=!0;else for(const E of g.values())if(!E.hasDuplicateNameToRemove){y=!0;break}l.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=gh(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:i,ref:l}=e;if(i){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===l||p.number===l)););r.reffedNodesByReferencer.set(e,p);return}const o=r.subroutineRefMap.get(l),c=l===0,d=c?h_(0):aw(o,r.groupOriginByCopy,null);let m=d;if(!c){const p=sw(a8(o,y=>y.type==="Group"&&!!y.flags)),g=p?gh(r.globalFlags,p):r.globalFlags;n8(g,r.currentFlags)||(m=Qa({flags:s8(g)}),m.body[0].body.push(d))}n($n(m,t),{traverse:!c})}},t8={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const l=r.reffedNodesByReferencer.get(e).filter(o=>r8(o,e));if(!l.length)n($n(Bl({negate:!0}),t));else if(l.length>1){const o=Qa({atomic:!0,body:l.reverse().map(c=>Yl({body:[Ag(c.number)]}))});n($n(o,t))}else e.ref=l[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const i=Yk();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function rw(e){Sc(e,{"*"({node:t,parent:n}){t.parent=n}})}function n8(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function r8(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=iw(n.parent);for(const i of r){if(i===n)break;if(i===e||ow(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function aw(e,t,n,r){const i=Array.isArray(e)?[]:{};for(const[l,o]of Object.entries(e))l==="parent"?i.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?i[l]=aw(o,t,i,n):(l==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[l]=o);return i}function h_(e){const t=Qk(e);return t.isRecursive=!0,t}function a8(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function R0(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function sw(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(i=>{var l,o;(l=r.enable)!=null&&l[i]&&(delete n.disable[i],n.enable[i]=!0),(o=r.disable)!=null&&o[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function s8({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function iw(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function lw(e){const t=e.find(n=>n.kind==="search_start"||o8(n,{negate:!1})||!i8(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=lw(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function ow(e,t){const n=iw(e)??[];for(const r of n)if(r===t||ow(r,t))return!0;return!1}function i8({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function l8(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function o8(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Gk(e.body[0],{type:"Assertion",kind:"search_start"})}function L0(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Xs(e,t){const r=qk(e,{...t,unicodePropertyMap:U1}).body;return r.length>1||r[0].body.length>1?Qa({body:r}):r[0].body[0]}function I0(e,t){return e.negate=t,e}function Fi(e,t){return e.parent=t,e}function $n(e,t){return rw(e),e.parent=t,e}function u8(e,t){const n=ew(t),r=Ig(n.target,"ES2024"),i=Ig(n.target,"ES2025"),l=n.rules.recursionLimit;if(!Number.isInteger(l)||l<2||l>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,c=null;if(!i){const E=[e.flags.ignoreCase];Sc(e,c8,{getCurrentModI:()=>E.at(-1),popModI(){E.pop()},pushModI(v){E.push(v)},setHasCasedChar(){E.at(-1)?o=!0:c=!0}})}const d={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!c)};let m=e;const p={accuracy:n.accuracy,appliedGlobalFlags:d,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:m,originMap:e._originMap,recursionLimit:l,useAppliedIgnoreCase:!!(!i&&o&&c),useFlagMods:i,useFlagV:r,verbose:n.verbose};function g(E){return p.lastNode=m,m=E,$O(d8[E.type],`Unexpected node type "${E.type}"`)(E,p,g)}const y={pattern:e.body.map(g).join("|"),flags:g(e.flags),options:{...e.options}};return r||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],p.captureMap.forEach((E,v)=>{E.hidden&&y._hiddenCaptures.push(v),E.transferTo&&Vc(y._captureTransfers,E.transferTo,[]).push(v)}),y}var c8={"*":{enter({node:e},t){if(p_(e)){const n=t.getCurrentModI();t.pushModI(e.flags?gh({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){p_(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){H1(lr(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),uw(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&nw.has(e.value)&&t.setHasCasedChar()}},d8={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?_t`\B`:_t`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:l}=e,o={ignoreCase:t.currentFlags.ignoreCase},c=t.originMap.get(e);return c&&(o.hidden=!0,l>c.number&&(o.transferTo=c.number)),t.captureMap.set(l,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=lr(e),r=Bo(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&H1(n)){const i=tw(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:l}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Xa.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(g_)&&(o=[Hh(45),...o.filter(m=>!g_(m))]);const c=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Xa.bugNestedClassIgnoresNegation)&&!i){const p=o.filter(g=>g.type==="CharacterClass"&&g.kind==="union"&&g.negate);if(p.length){const g=Qa(),y=g.body[0];return g.parent=l,y.parent=g,o=o.filter(E=>!p.includes(E)),e.body=o,o.length?(e.parent=y,y.body.push(e)):g.body.pop(),p.forEach(E=>{const v=Yl({body:[E]});E.parent=v,v.parent=g,g.body.push(v)}),n(g)}}t.inCharClass=!0;const m=c();return t.inCharClass=!1,m}const d=o[0];if(r==="union"&&!i&&d&&((!t.useFlagV||!t.verbose)&&l.kind==="union"&&!(Xa.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&l.kind==="intersection"&&o.length===1&&d.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&l.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},l=Bo(n,i),o=Bo(r,i),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const d=uw(e);g8(d).forEach(p=>{c.add(Array.isArray(p)?`${Bo(p[0],i)}-${Bo(p[1],i)}`:Bo(p,i))})}return`${l}-${o}${[...c].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":_t`[^\n]`;if(e==="digit")return t?_t`\D`:_t`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&nw.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?_t`\P`:_t`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?_t`\W`:_t`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,l){const o=i.currentFlags;n&&(i.currentFlags=gh(o,n));const c=t.map(l).join("|"),d=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?c:`(?${b8(e,n,i.useFlagMods)}${c})`;return i.currentFlags=o,d},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+x8(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:_t`\g<${t}&R=${r}>`}},f8=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),h8=new Set(["-","\\","]","^","["]),m8=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),m_=new Map([[9,_t`\t`],[10,_t`\n`],[11,_t`\v`],[12,_t`\f`],[13,_t`\r`],[8232,_t`\u2028`],[8233,_t`\u2029`],[65279,_t`\uFEFF`]]),p8=new RegExp("^\\p{Cased}$","u");function H1(e){return p8.test(e)}function uw(e,t){const n=!!(t!=null&&t.firstOnly),r=e.min.value,i=e.max.value,l=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return l;for(let o=r;o<=i;o++){const c=lr(o);if(!H1(c))continue;const d=tw(c).filter(m=>{const p=m.codePointAt(0);return p<r||p>i});if(d.length&&(l.push(...d),n))break}return l}function Bo(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(m_.has(e))return m_.get(e);if(e<32||e>126&&e<160||e>262143||t&&y8(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?m8:h8:f8,l=lr(e);return(i.has(l)?"\\":"")+l}function g8(e){const t=e.map(i=>i.codePointAt(0)).sort((i,l)=>i-l),n=[];let r=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?r??(r=t[i]):r===null?n.push(t[i]):(n.push([r,t[i]]),r=null);return n}function b8(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:i,disable:l}=t;r=(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")+(l?"-":"")+(l!=null&&l.ignoreCase?"i":"")+(l!=null&&l.dotAll?"s":"")}return`${r}:`}function x8({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function p_({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function y8(e){return e>47&&e<58}function g_({type:e,value:t}){return e==="Character"&&t===45}var Yi,Js,Vl,Wi,Gl,Wc,Og,Ki,E8=(Ki=class extends RegExp{constructor(n,r,i){var t=(...aW)=>(super(...aW),Rl(this,Wc),Rl(this,Yi,new Map),Rl(this,Js,null),Rl(this,Vl),Rl(this,Wi,null),Rl(this,Gl,null),de(this,"rawOptions",{}),this);const l=!!(i!=null&&i.lazyCompile);if(n instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const o=n;t(o,r),Ya(this,Vl,o.source),o instanceof Ki&&(Ya(this,Yi,Dr(o,Yi)),Ya(this,Wi,Dr(o,Wi)),Ya(this,Gl,Dr(o,Gl)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};t(l?"":n,r),Ya(this,Vl,n),Ya(this,Yi,T8(o.hiddenCaptures,o.transfers)),Ya(this,Gl,o.strategy),this.rawOptions=i??{}}l||Ya(this,Js,this)}get source(){return Dr(this,Vl)||"(?:)"}exec(n){if(!Dr(this,Js)){const{lazyCompile:l,...o}=this.rawOptions;Ya(this,Js,new Ki(Dr(this,Vl),this.flags,o))}const r=this.global||this.sticky,i=this.lastIndex;if(Dr(this,Gl)==="clip_search"&&r&&i){this.lastIndex=0;const l=Jp(this,Wc,Og).call(this,n.slice(i));return l&&(_8(l,i,n,this.hasIndices),this.lastIndex+=i),l}return Jp(this,Wc,Og).call(this,n)}},Yi=new WeakMap,Js=new WeakMap,Vl=new WeakMap,Wi=new WeakMap,Gl=new WeakMap,Wc=new WeakSet,Og=function(n){Dr(this,Js).lastIndex=this.lastIndex;const r=GE(Ki.prototype,this,"exec").call(Dr(this,Js),n);if(this.lastIndex=Dr(this,Js).lastIndex,!r||!Dr(this,Yi).size)return r;const i=[...r];r.length=1;let l;this.hasIndices&&(l=[...r.indices],r.indices.length=1);const o=[0];for(let c=1;c<i.length;c++){const{hidden:d,transferTo:m}=Dr(this,Yi).get(c)??{};if(d?o.push(null):(o.push(r.length),r.push(i[c]),this.hasIndices&&r.indices.push(l[c])),m&&i[c]!==void 0){const p=o[m];if(!p)throw new Error(`Invalid capture transfer to "${p}"`);if(r[p]=i[c],this.hasIndices&&(r.indices[p]=l[c]),r.groups){Dr(this,Wi)||Ya(this,Wi,v8(this.source));const g=Dr(this,Wi).get(m);g&&(r.groups[g]=i[c],this.hasIndices&&(r.indices.groups[g]=l[c]))}}}return r},Ki);function _8(e,t,n,r){if(e.index+=t,e.input=n,r){const i=e.indices;for(let o=0;o<i.length;o++){const c=i[o];c&&(i[o]=[c[0]+t,c[1]+t])}const l=i.groups;l&&Object.keys(l).forEach(o=>{const c=l[o];c&&(l[o]=[c[0]+t,c[1]+t])})}}function T8(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const l of i)Vc(n,l,{}).transferTo=r;return n}function v8(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,l;for(;l=t.exec(e);){const{0:o,groups:{capture:c,name:d}}=l;o==="["?r++:r?o==="]"&&r--:c&&(i++,d&&n.set(i,d))}return n}function k8(e,t){const n=w8(e,t);return n.options?new E8(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function w8(e,t){const n=ew(t),r=qk(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:U1}),i=ZO(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),l=u8(i,n),o=zO(l.pattern,{captureTransfers:l._captureTransfers,hiddenCaptures:l._hiddenCaptures,mode:"external"}),c=UO(o.pattern),d=BO(c.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),m={pattern:d.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${l.flags}${l.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=d.hiddenCaptures.sort((v,w)=>v-w),g=Array.from(d.captureTransfers),y=i._strategy,E=m.pattern.length>=n.lazyCompileLength;(p.length||g.length||y||E)&&(m.options={...p.length&&{hiddenCaptures:p},...g.length&&{transfers:g},...y&&{strategy:y},...E&&{lazyCompile:E}})}return m}const b_=4294967295;class C8{constructor(t,n={}){de(this,"regexps");this.patterns=t,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:l}=n;if(!l)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;const c=i==null?void 0:i.get(o);if(c){if(c instanceof RegExp)return c;if(r)return null;throw c}try{const d=l(o);return i==null||i.set(o,d),d}catch(d){if(i==null||i.set(o,d),r)return null;throw d}})}findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,l=[];function o(c,d,m=0){return{index:c,captureIndices:d.indices.map(p=>p==null?{start:b_,end:b_,length:0}:{start:p[0]+m,end:p[1]+m,length:p[1]-p[0]})}}for(let c=0;c<this.regexps.length;c++){const d=this.regexps[c];if(d)try{d.lastIndex=n;const m=d.exec(i);if(!m)continue;if(m.index===n)return o(c,m,0);l.push([c,m,0])}catch(m){if(this.options.forgiving)continue;throw m}}if(l.length){const c=Math.min(...l.map(d=>d[1].index));for(const[d,m,p]of l)if(m.index===c)return o(d,m,p)}return null}}function S8(e,t){return k8(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function N8(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=n=>S8(n,{target:t.target})),{createScanner(n){return new C8(n,t)},createString(n){return{content:n}}}}var A8=N8({forgiving:!0}),R8=Object.fromEntries(D1.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(n=>[n,e.id])})),Jf=new Set(Object.keys(Bk)),x_=e=>{let t=e.trim().toLowerCase();return R8[t]||(Jf.has(t),t)},O0=new Map,D0=new Map,Uo=new Map,bh=e=>{var t;return typeof e=="string"?e:(t=e.name)!=null?t:"custom"},L8=(e,t)=>`${e}-${bh(t[0])}-${bh(t[1])}`,I8=(e,t,n)=>{let r=e.slice(0,100),i=e.length>100?e.slice(-100):"";return`${t}:${n[0]}:${n[1]}:${e.length}:${r}:${i}`},O8=(e,t)=>{let n=L8(e,t);if(O0.has(n))return O0.get(n);let r=FI({themes:t,langs:[e],engine:A8});return O0.set(n,r),r};function D8(e={}){var t;let n=(t=e.themes)!=null?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(r){let i=x_(r);return Jf.has(i)},getSupportedLanguages(){return Array.from(Jf)},getThemes(){return n},highlight({code:r,language:i,themes:l},o){let c=x_(i),d=[bh(l[0]),bh(l[1])],m=I8(r,c,d);if(D0.has(m))return D0.get(m);o&&(Uo.has(m)||Uo.set(m,new Set),Uo.get(m).add(o));let p=Jf.has(c)?c:"text";return O8(p,l).then(g=>{let y=g.getLoadedLanguages().includes(c)?c:"text",E=g.codeToTokens(r,{lang:y,themes:{light:d[0],dark:d[1]}});D0.set(m,E);let v=Uo.get(m);if(v){for(let w of v)w(E);Uo.delete(m)}}).catch(g=>{console.error("[Streamdown Code] Failed to highlight code:",g),Uo.delete(m)}),null}}}var j8=D8();const Vh=(function(e){if(e==null)return U8;if(typeof e=="function")return Gh(e);if(typeof e=="object")return Array.isArray(e)?M8(e):P8(e);if(typeof e=="string")return B8(e);throw new Error("Expected function, string, or object as test")});function M8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Vh(e[n]);return Gh(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function P8(e){const t=e;return Gh(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function B8(e){return Gh(t);function t(n){return n&&n.type===e}}function Gh(e){return t;function t(n,r,i){return!!(H8(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function U8(){return!0}function H8(e){return e!==null&&typeof e=="object"&&"type"in e}const cw=[],_c=!0,Dg=!1,Xo="skip";function z1(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=Vh(i),o=r?-1:1;c(e,void 0,[])();function c(d,m,p){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const E=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(E?"<"+E+">":""))+")"})}return y;function y(){let E=cw,v,w,C;if((!t||l(d,m,p[p.length-1]||void 0))&&(E=z8(n(d,p)),E[0]===Dg))return E;if("children"in d&&d.children){const S=d;if(S.children&&E[0]!==Xo)for(w=(r?S.children.length:-1)+o,C=p.concat(S);w>-1&&w<S.children.length;){const N=S.children[w];if(v=c(N,w,C)(),v[0]===Dg)return v;w=typeof v[1]=="number"?v[1]:w+o}}return E}}}function z8(e){return Array.isArray(e)?e:typeof e=="number"?[_c,e]:e==null?cw:[e]}function bs(e,t,n,r){let i,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,i=n):(l=t,o=n,i=r),z1(e,l,c,i);function c(d,m){const p=m[m.length-1],g=p?p.children.indexOf(d):void 0;return o(d,g,p)}}const ru={indicator:"indicator",textOnly:"text-only",remove:"remove"};function F8({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:l="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:o="text-gray-500",linkBlockPolicy:c=ru.indicator,imageBlockPolicy:d=ru.indicator}){const m=t.length&&!t.every(g=>g==="*"),p=n.length&&!n.every(g=>g==="*");if(!e&&(m||p))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return g=>{const y=W8(e,t,n,r,i,l,o,c,d);dw(g),bs(g,y)}}function y_(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 $8(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const V8=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),G8=new Set(["javascript:","data:","file:","vbscript:"]);function E_(e,t,n,r=!1,i=!1,l=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const o=y_(e,n);if(!o||G8.has(o.protocol)||!(V8.has(o.protocol)||l.includes(o.protocol)||l.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const d=$8(e);return o&&t.some(m=>{const p=y_(m,n);return!p||p.origin!==o.origin?!1:o.href.startsWith(p.href)})?d?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:d?o.pathname+o.search+o.hash:o.href:null}function dw(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)dw(t)}}const j0=Symbol("node-seen");function q8(e,t,n){return t===ru.remove?{type:"remove"}:t===ru.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 Y8(e,t,n){if(t===ru.remove)return{type:"remove"};if(t===ru.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 W8=(e,t,n,r,i,l,o,c,d)=>{const m=(p,g,y)=>{if(p.type!=="element"||p[j0])return _c;if(p.tagName==="a"){const E=E_(p.properties.href,t,e,!1,!1,i);if(E===null){if(p[j0]=!0,bs(p,m),y&&typeof g=="number"){const v=q8(p,c,o);if(v.type==="remove")return y.children.splice(g,1),[Xo,g];y.children[g]=v.element}return Xo}else return p.properties.href=E,p.properties.target="_blank",p.properties.rel="noopener noreferrer",_c}if(p.tagName==="img"){const E=E_(p.properties.src,n,e,r,!0,i);if(E===null){if(p[j0]=!0,bs(p,m),y&&typeof g=="number"){const v=Y8(p,d,l);if(v.type==="remove")return y.children.splice(g,1),[Xo,g];y.children[g]=v.element}return Xo}else return p.properties.src=E,_c}return _c};return m},fw=-1,qh=0,Nc=1,xh=2,F1=3,$1=4,V1=5,G1=6,hw=7,mw=8,__=typeof self=="object"?self:globalThis,Q8=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=t[i];switch(l){case qh:case fw:return n(o,i);case Nc:{const c=n([],i);for(const d of o)c.push(r(d));return c}case xh:{const c=n({},i);for(const[d,m]of o)c[r(d)]=r(m);return c}case F1:return n(new Date(o),i);case $1:{const{source:c,flags:d}=o;return n(new RegExp(c,d),i)}case V1:{const c=n(new Map,i);for(const[d,m]of o)c.set(r(d),r(m));return c}case G1:{const c=n(new Set,i);for(const d of o)c.add(r(d));return c}case hw:{const{name:c,message:d}=o;return n(new __[c](d),i)}case mw:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new __[l](o),i)};return r},T_=e=>Q8(new Map,e)(0),Ho="",{toString:X8}={},{keys:K8}=Object,cc=e=>{const t=typeof e;if(t!=="object"||!e)return[qh,t];const n=X8.call(e).slice(8,-1);switch(n){case"Array":return[Nc,Ho];case"Object":return[xh,Ho];case"Date":return[F1,Ho];case"RegExp":return[$1,Ho];case"Map":return[V1,Ho];case"Set":return[G1,Ho];case"DataView":return[Nc,n]}return n.includes("Array")?[Nc,n]:n.includes("Error")?[hw,n]:[xh,n]},Nf=([e,t])=>e===qh&&(t==="function"||t==="symbol"),Z8=(e,t,n,r)=>{const i=(o,c)=>{const d=r.push(o)-1;return n.set(c,d),d},l=o=>{if(n.has(o))return n.get(o);let[c,d]=cc(o);switch(c){case qh:{let p=o;switch(d){case"bigint":c=mw,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([fw],o)}return i([c,p],o)}case Nc:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],g=i([c,p],o);for(const y of o)p.push(l(y));return g}case xh:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const p=[],g=i([c,p],o);for(const y of K8(o))(e||!Nf(cc(o[y])))&&p.push([l(y),l(o[y])]);return g}case F1:return i([c,o.toISOString()],o);case $1:{const{source:p,flags:g}=o;return i([c,{source:p,flags:g}],o)}case V1:{const p=[],g=i([c,p],o);for(const[y,E]of o)(e||!(Nf(cc(y))||Nf(cc(E))))&&p.push([l(y),l(E)]);return g}case G1:{const p=[],g=i([c,p],o);for(const y of o)(e||!Nf(cc(y)))&&p.push(l(y));return g}}const{message:m}=o;return i([c,{name:d,message:m}],o)};return l},v_=(e,{json:t,lossy:n}={})=>{const r=[];return Z8(!(t||n),!!t,new Map,r)(e),r},Wl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?T_(v_(e,t)):structuredClone(e):(e,t)=>T_(v_(e,t));const k_=/[#.]/g;function J8(e,t){const n=e||"",r={};let i=0,l,o;for(;i<n.length;){k_.lastIndex=i;const c=k_.exec(n),d=n.slice(i,c?c.index:n.length);d&&(l?l==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:o=d,i+=d.length),c&&(l=c[0],i++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function pw(e,t,n){const r=n?rD(n):void 0;function i(l,o,...c){let d;if(l==null){d={type:"root",children:[]};const m=o;c.unshift(m)}else{d=J8(l,t);const m=d.tagName.toLowerCase(),p=r?r.get(m):void 0;if(d.tagName=p||m,eD(o))c.unshift(o);else for(const[g,y]of Object.entries(o))tD(e,d.properties,g,y)}for(const m of c)jg(d.children,m);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return i}function eD(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const l=i;for(const o of l)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function tD(e,t,n,r){const i=Jc(e,n);let l;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;l=r}else typeof r=="boolean"?l=r:typeof r=="string"?i.spaceSeparated?l=F2(r):i.commaSeparated?l=z2(r):i.commaOrSpaceSeparated?l=F2(z2(r).join(" ")):l=w_(i,i.property,r):Array.isArray(r)?l=[...r]:l=i.property==="style"?nD(r):String(r);if(Array.isArray(l)){const o=[];for(const c of l)o.push(w_(i,i.property,c));l=o}i.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[i.property]=l}}function jg(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)jg(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?jg(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function w_(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Fc(n)===Fc(t)))return!0}return n}function nD(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function rD(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const aD=["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"],sD=pw(du,"div"),iD=pw(ys,"g",aD);function lD(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(l){if(typeof l=="number"&&l>-1&&l<=t.length){let o=0;for(;;){let c=n[o];if(c===void 0){const d=C_(t,n[o-1]);c=d===-1?t.length+1:d+1,n[o]=c}if(c>l)return{line:o+1,column:l-(o>0?n[o-1]:0)+1,offset:l};o++}}}function i(l){if(l&&typeof l.line=="number"&&typeof l.column=="number"&&!Number.isNaN(l.line)&&!Number.isNaN(l.column)){for(;n.length<l.line;){const c=n[n.length-1],d=C_(t,c),m=d===-1?t.length+1:d+1;if(c===m)break;n.push(m)}const o=(l.line>1?n[l.line-2]:0)+l.column-1;if(o<n[l.line-1])return o}}}function C_(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
244
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const $l={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/"},gw={}.hasOwnProperty,oD=Object.prototype;function uD(e,t){const n=t||{};return q1({file:n.file||void 0,location:!1,schema:n.space==="svg"?ys:du,verbose:n.verbose||!1},e)}function q1(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},eh(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:bw(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const l=String(e.file),o=lD(l),c=o.toPoint(0),d=o.toPoint(l.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},eh(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},eh(e,r,n),n}default:return n=cD(e,t),n}}function bw(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=q1(e,t[n]);r.push(i)}return r}function cD(e,t){const n=e.schema;e.schema=t.namespaceURI===$l.svg?ys:du;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;gw.call(oD,d)||(i[d]=c.value)}const o=(e.schema.space==="svg"?iD:sD)(t.tagName,i,bw(e,t.childNodes));if(eh(e,t,o),o.tagName==="template"){const c=t,d=c.sourceCodeLocation,m=d&&d.startTag&&Ko(d.startTag),p=d&&d.endTag&&Ko(d.endTag),g=q1(e,c.content);m&&p&&e.file&&(g.position={start:m.end,end:p.start}),o.content=g}return e.schema=n,o}function eh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=dD(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function dD(e,t,n){const r=Ko(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const l={};let o;if(n.attrs)for(o in n.attrs)gw.call(n.attrs,o)&&(l[Jc(e.schema,o).property]=Ko(n.attrs[o]));n.startTag;const c=Ko(n.startTag),d=n.endTag?Ko(n.endTag):void 0,m={opening:c};d&&(m.closing=d),m.properties=l,t.data={position:m}}}return r}function Ko(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 fD={},hD={}.hasOwnProperty,xw=k1("type",{handlers:{root:pD,element:ED,text:xD,comment:yD,doctype:bD}});function mD(e,t){const r=(t||fD).space;return xw(e,r==="svg"?ys:du)}function pD(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Y1(e.children,n,t),pu(e,n),n}function gD(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Y1(e.children,n,t),pu(e,n),n}function bD(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return pu(e,t),t}function xD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return pu(e,t),t}function yD(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return pu(e,t),t}function ED(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ys);const i=[];let l;if(e.properties){for(l in e.properties)if(l!=="children"&&hD.call(e.properties,l)){const d=_D(r,l,e.properties[l]);d&&i.push(d)}}const o=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:$l[o],childNodes:[],parentNode:null};return c.childNodes=Y1(e.children,c,r),pu(e,c),e.tagName==="template"&&e.content&&(c.content=gD(e.content,r)),c}function _D(e,t,n){const r=Jc(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?w1(n):C1(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const l=i.name.indexOf(":");l<0?i.prefix="":(i.name=i.name.slice(l+1),i.prefix=r.attribute.slice(0,l)),i.namespace=$l[r.space]}return i}function Y1(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const l=xw(e[r],n);l.parentNode=t,i.push(l)}return i}function pu(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 TD=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]),An="�";var j;(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"})(j||(j={}));const qr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function yw(e){return e>=55296&&e<=57343}function vD(e){return e>=56320&&e<=57343}function kD(e,t){return(e-55296)*1024+9216+t}function Ew(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function _w(e){return e>=64976&&e<=65007||TD.has(e)}var pe;(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"})(pe||(pe={}));const wD=65536;class CD{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=wD,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:l}=this,o=i+n,c=l+n;return{code:t,startLine:r,endLine:r,startCol:o,endCol:o,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(vD(n))return this.pos++,this._addGap(),kD(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,j.EOF;return this._err(pe.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,j.EOF;const r=this.html.charCodeAt(n);return r===j.CARRIAGE_RETURN?j.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,j.EOF;let t=this.html.charCodeAt(this.pos);return t===j.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,j.LINE_FEED):t===j.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,yw(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===j.LINE_FEED||t===j.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Ew(t)?this._err(pe.controlCharacterInInputStream):_w(t)&&this._err(pe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Lt;(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"})(Lt||(Lt={}));function Tw(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 SD=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))),ND=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 AD(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ND.get(e))!==null&&t!==void 0?t:e}var br;(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"})(br||(br={}));const RD=32;var Qi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Qi||(Qi={}));function Mg(e){return e>=br.ZERO&&e<=br.NINE}function LD(e){return e>=br.UPPER_A&&e<=br.UPPER_F||e>=br.LOWER_A&&e<=br.LOWER_F}function ID(e){return e>=br.UPPER_A&&e<=br.UPPER_Z||e>=br.LOWER_A&&e<=br.LOWER_Z||Mg(e)}function OD(e){return e===br.EQUALS||ID(e)}var mr;(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"})(mr||(mr={}));var ei;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ei||(ei={}));class DD{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=mr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ei.Strict}startEntity(t){this.decodeMode=t,this.state=mr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case mr.EntityStart:return t.charCodeAt(n)===br.NUM?(this.state=mr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=mr.NamedEntity,this.stateNamedEntity(t,n));case mr.NumericStart:return this.stateNumericStart(t,n);case mr.NumericDecimal:return this.stateNumericDecimal(t,n);case mr.NumericHex:return this.stateNumericHex(t,n);case mr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|RD)===br.LOWER_X?(this.state=mr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=mr.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const l=r-n;this.result=this.result*Math.pow(i,l)+Number.parseInt(t.substr(n,l),i),this.consumed+=l}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Mg(i)||LD(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Mg(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===br.SEMI)this.consumed+=1;else if(this.decodeMode===ei.Strict)return 0;return this.emitCodePoint(AD(this.result),this.consumed),this.errors&&(t!==br.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],l=(i&Qi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=jD(r,i,this.treeIndex+Math.max(1,l),o),this.treeIndex<0)return this.result===0||this.decodeMode===ei.Attribute&&(l===0||OD(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],l=(i&Qi.VALUE_LENGTH)>>14,l!==0){if(o===br.SEMI)return this.emitNamedEntityData(this.treeIndex,l,this.consumed+this.excess);this.decodeMode!==ei.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Qi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Qi.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case mr.NamedEntity:return this.result!==0&&(this.decodeMode!==ei.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case mr.NumericDecimal:return this.emitNumericEntity(0,2);case mr.NumericHex:return this.emitNumericEntity(0,3);case mr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case mr.EntityStart:return 0}}}function jD(e,t,n,r){const i=(t&Qi.BRANCH_LENGTH)>>7,l=t&Qi.JUMP_TABLE;if(i===0)return l!==0&&r===l?n:-1;if(l){const d=r-l;return d<0||d>=i?-1:e[n+d]-1}let o=n,c=o+i-1;for(;o<=c;){const d=o+c>>>1,m=e[d];if(m<r)o=d+1;else if(m>r)c=d-1;else return e[d+i]}return-1}var we;(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/"})(we||(we={}));var ql;(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"})(ql||(ql={}));var Na;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Na||(Na={}));var ae;(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"})(ae||(ae={}));var _;(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"})(_||(_={}));const MD=new Map([[ae.A,_.A],[ae.ADDRESS,_.ADDRESS],[ae.ANNOTATION_XML,_.ANNOTATION_XML],[ae.APPLET,_.APPLET],[ae.AREA,_.AREA],[ae.ARTICLE,_.ARTICLE],[ae.ASIDE,_.ASIDE],[ae.B,_.B],[ae.BASE,_.BASE],[ae.BASEFONT,_.BASEFONT],[ae.BGSOUND,_.BGSOUND],[ae.BIG,_.BIG],[ae.BLOCKQUOTE,_.BLOCKQUOTE],[ae.BODY,_.BODY],[ae.BR,_.BR],[ae.BUTTON,_.BUTTON],[ae.CAPTION,_.CAPTION],[ae.CENTER,_.CENTER],[ae.CODE,_.CODE],[ae.COL,_.COL],[ae.COLGROUP,_.COLGROUP],[ae.DD,_.DD],[ae.DESC,_.DESC],[ae.DETAILS,_.DETAILS],[ae.DIALOG,_.DIALOG],[ae.DIR,_.DIR],[ae.DIV,_.DIV],[ae.DL,_.DL],[ae.DT,_.DT],[ae.EM,_.EM],[ae.EMBED,_.EMBED],[ae.FIELDSET,_.FIELDSET],[ae.FIGCAPTION,_.FIGCAPTION],[ae.FIGURE,_.FIGURE],[ae.FONT,_.FONT],[ae.FOOTER,_.FOOTER],[ae.FOREIGN_OBJECT,_.FOREIGN_OBJECT],[ae.FORM,_.FORM],[ae.FRAME,_.FRAME],[ae.FRAMESET,_.FRAMESET],[ae.H1,_.H1],[ae.H2,_.H2],[ae.H3,_.H3],[ae.H4,_.H4],[ae.H5,_.H5],[ae.H6,_.H6],[ae.HEAD,_.HEAD],[ae.HEADER,_.HEADER],[ae.HGROUP,_.HGROUP],[ae.HR,_.HR],[ae.HTML,_.HTML],[ae.I,_.I],[ae.IMG,_.IMG],[ae.IMAGE,_.IMAGE],[ae.INPUT,_.INPUT],[ae.IFRAME,_.IFRAME],[ae.KEYGEN,_.KEYGEN],[ae.LABEL,_.LABEL],[ae.LI,_.LI],[ae.LINK,_.LINK],[ae.LISTING,_.LISTING],[ae.MAIN,_.MAIN],[ae.MALIGNMARK,_.MALIGNMARK],[ae.MARQUEE,_.MARQUEE],[ae.MATH,_.MATH],[ae.MENU,_.MENU],[ae.META,_.META],[ae.MGLYPH,_.MGLYPH],[ae.MI,_.MI],[ae.MO,_.MO],[ae.MN,_.MN],[ae.MS,_.MS],[ae.MTEXT,_.MTEXT],[ae.NAV,_.NAV],[ae.NOBR,_.NOBR],[ae.NOFRAMES,_.NOFRAMES],[ae.NOEMBED,_.NOEMBED],[ae.NOSCRIPT,_.NOSCRIPT],[ae.OBJECT,_.OBJECT],[ae.OL,_.OL],[ae.OPTGROUP,_.OPTGROUP],[ae.OPTION,_.OPTION],[ae.P,_.P],[ae.PARAM,_.PARAM],[ae.PLAINTEXT,_.PLAINTEXT],[ae.PRE,_.PRE],[ae.RB,_.RB],[ae.RP,_.RP],[ae.RT,_.RT],[ae.RTC,_.RTC],[ae.RUBY,_.RUBY],[ae.S,_.S],[ae.SCRIPT,_.SCRIPT],[ae.SEARCH,_.SEARCH],[ae.SECTION,_.SECTION],[ae.SELECT,_.SELECT],[ae.SOURCE,_.SOURCE],[ae.SMALL,_.SMALL],[ae.SPAN,_.SPAN],[ae.STRIKE,_.STRIKE],[ae.STRONG,_.STRONG],[ae.STYLE,_.STYLE],[ae.SUB,_.SUB],[ae.SUMMARY,_.SUMMARY],[ae.SUP,_.SUP],[ae.TABLE,_.TABLE],[ae.TBODY,_.TBODY],[ae.TEMPLATE,_.TEMPLATE],[ae.TEXTAREA,_.TEXTAREA],[ae.TFOOT,_.TFOOT],[ae.TD,_.TD],[ae.TH,_.TH],[ae.THEAD,_.THEAD],[ae.TITLE,_.TITLE],[ae.TR,_.TR],[ae.TRACK,_.TRACK],[ae.TT,_.TT],[ae.U,_.U],[ae.UL,_.UL],[ae.SVG,_.SVG],[ae.VAR,_.VAR],[ae.WBR,_.WBR],[ae.XMP,_.XMP]]);function gu(e){var t;return(t=MD.get(e))!==null&&t!==void 0?t:_.UNKNOWN}const Ae=_,PD={[we.HTML]:new Set([Ae.ADDRESS,Ae.APPLET,Ae.AREA,Ae.ARTICLE,Ae.ASIDE,Ae.BASE,Ae.BASEFONT,Ae.BGSOUND,Ae.BLOCKQUOTE,Ae.BODY,Ae.BR,Ae.BUTTON,Ae.CAPTION,Ae.CENTER,Ae.COL,Ae.COLGROUP,Ae.DD,Ae.DETAILS,Ae.DIR,Ae.DIV,Ae.DL,Ae.DT,Ae.EMBED,Ae.FIELDSET,Ae.FIGCAPTION,Ae.FIGURE,Ae.FOOTER,Ae.FORM,Ae.FRAME,Ae.FRAMESET,Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6,Ae.HEAD,Ae.HEADER,Ae.HGROUP,Ae.HR,Ae.HTML,Ae.IFRAME,Ae.IMG,Ae.INPUT,Ae.LI,Ae.LINK,Ae.LISTING,Ae.MAIN,Ae.MARQUEE,Ae.MENU,Ae.META,Ae.NAV,Ae.NOEMBED,Ae.NOFRAMES,Ae.NOSCRIPT,Ae.OBJECT,Ae.OL,Ae.P,Ae.PARAM,Ae.PLAINTEXT,Ae.PRE,Ae.SCRIPT,Ae.SECTION,Ae.SELECT,Ae.SOURCE,Ae.STYLE,Ae.SUMMARY,Ae.TABLE,Ae.TBODY,Ae.TD,Ae.TEMPLATE,Ae.TEXTAREA,Ae.TFOOT,Ae.TH,Ae.THEAD,Ae.TITLE,Ae.TR,Ae.TRACK,Ae.UL,Ae.WBR,Ae.XMP]),[we.MATHML]:new Set([Ae.MI,Ae.MO,Ae.MN,Ae.MS,Ae.MTEXT,Ae.ANNOTATION_XML]),[we.SVG]:new Set([Ae.TITLE,Ae.FOREIGN_OBJECT,Ae.DESC]),[we.XLINK]:new Set,[we.XML]:new Set,[we.XMLNS]:new Set},Pg=new Set([Ae.H1,Ae.H2,Ae.H3,Ae.H4,Ae.H5,Ae.H6]);ae.STYLE,ae.SCRIPT,ae.XMP,ae.IFRAME,ae.NOEMBED,ae.NOFRAMES,ae.PLAINTEXT;var B;(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"})(B||(B={}));const Vn={DATA:B.DATA,RCDATA:B.RCDATA,RAWTEXT:B.RAWTEXT,SCRIPT_DATA:B.SCRIPT_DATA,PLAINTEXT:B.PLAINTEXT,CDATA_SECTION:B.CDATA_SECTION};function BD(e){return e>=j.DIGIT_0&&e<=j.DIGIT_9}function Tc(e){return e>=j.LATIN_CAPITAL_A&&e<=j.LATIN_CAPITAL_Z}function UD(e){return e>=j.LATIN_SMALL_A&&e<=j.LATIN_SMALL_Z}function $i(e){return UD(e)||Tc(e)}function N_(e){return $i(e)||BD(e)}function Af(e){return e+32}function vw(e){return e===j.SPACE||e===j.LINE_FEED||e===j.TABULATION||e===j.FORM_FEED}function A_(e){return vw(e)||e===j.SOLIDUS||e===j.GREATER_THAN_SIGN}function HD(e){return e===j.NULL?pe.nullCharacterReference:e>1114111?pe.characterReferenceOutsideUnicodeRange:yw(e)?pe.surrogateCharacterReference:_w(e)?pe.noncharacterCharacterReference:Ew(e)||e===j.CARRIAGE_RETURN?pe.controlCharacterReference:null}class zD{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=B.DATA,this.returnState=B.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new CD(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new DD(SD,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(pe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(pe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=HD(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==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:Lt.START_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Lt.END_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Lt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Lt.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(Tw(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(pe.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=gu(t.tagName),t.type===Lt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(pe.endTagWithAttributes),t.selfClosing&&this._err(pe.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 Lt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Lt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Lt.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:Lt.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=vw(t)?Lt.WHITESPACE_CHARACTER:t===j.NULL?Lt.NULL_CHARACTER:Lt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Lt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=B.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ei.Attribute:ei.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===B.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case B.DATA:{this._stateData(t);break}case B.RCDATA:{this._stateRcdata(t);break}case B.RAWTEXT:{this._stateRawtext(t);break}case B.SCRIPT_DATA:{this._stateScriptData(t);break}case B.PLAINTEXT:{this._statePlaintext(t);break}case B.TAG_OPEN:{this._stateTagOpen(t);break}case B.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case B.TAG_NAME:{this._stateTagName(t);break}case B.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case B.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case B.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case B.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case B.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case B.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case B.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case B.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case B.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case B.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case B.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case B.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case B.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case B.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case B.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case B.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case B.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case B.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case B.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case B.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case B.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case B.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case B.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case B.BOGUS_COMMENT:{this._stateBogusComment(t);break}case B.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case B.COMMENT_START:{this._stateCommentStart(t);break}case B.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case B.COMMENT:{this._stateComment(t);break}case B.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case B.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case B.COMMENT_END:{this._stateCommentEnd(t);break}case B.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case B.DOCTYPE:{this._stateDoctype(t);break}case B.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case B.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case B.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case B.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case B.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case B.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case B.CDATA_SECTION:{this._stateCdataSection(t);break}case B.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case B.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case B.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case B.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.TAG_OPEN;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitCodePoint(t);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case j.AMPERSAND:{this._startCharacterReference();break}case j.LESS_THAN_SIGN:{this.state=B.RCDATA_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(An);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.RAWTEXT_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(An);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(An);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(An);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if($i(t))this._createStartTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case j.EXCLAMATION_MARK:{this.state=B.MARKUP_DECLARATION_OPEN;break}case j.SOLIDUS:{this.state=B.END_TAG_OPEN;break}case j.QUESTION_MARK:{this._err(pe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t);break}case j.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=B.DATA,this._stateData(t)}}_stateEndTagOpen(t){if($i(t))this._createEndTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case j.GREATER_THAN_SIGN:{this._err(pe.missingEndTagName),this.state=B.DATA;break}case j.EOF:{this._err(pe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(pe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.tagName+=An;break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Tc(t)?Af(t):t)}}_stateRcdataLessThanSign(t){t===j.SOLIDUS?this.state=B.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=B.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){$i(t)?(this.state=B.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=B.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 j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=B.BEFORE_ATTRIBUTE_NAME,!1;case j.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=B.SELF_CLOSING_START_TAG,!1;case j.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=B.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===j.SOLIDUS?this.state=B.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){$i(t)?(this.state=B.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case j.SOLIDUS:{this.state=B.SCRIPT_DATA_END_TAG_OPEN;break}case j.EXCLAMATION_MARK:{this.state=B.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=B.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){$i(t)?(this.state=B.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===j.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===j.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(An);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(An);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case j.HYPHEN_MINUS:{this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.GREATER_THAN_SIGN:{this.state=B.SCRIPT_DATA,this._emitChars(">");break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(An);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===j.SOLIDUS?this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:$i(t)?(this._emitChars("<"),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){$i(t)?(this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(qr.SCRIPT,!1)&&A_(this.preprocessor.peek(qr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<qr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this._emitChars(An);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(An);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case j.HYPHEN_MINUS:{this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.GREATER_THAN_SIGN:{this.state=B.SCRIPT_DATA,this._emitChars(">");break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(An);break}case j.EOF:{this._err(pe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===j.SOLIDUS?(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(qr.SCRIPT,!1)&&A_(this.preprocessor.peek(qr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<qr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.SOLIDUS:case j.GREATER_THAN_SIGN:case j.EOF:{this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case j.EQUALS_SIGN:{this._err(pe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=B.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:case j.SOLIDUS:case j.GREATER_THAN_SIGN:case j.EOF:{this._leaveAttrName(),this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case j.EQUALS_SIGN:{this._leaveAttrName(),this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case j.QUOTATION_MARK:case j.APOSTROPHE:case j.LESS_THAN_SIGN:{this._err(pe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.name+=An;break}default:this.currentAttr.name+=String.fromCodePoint(Tc(t)?Af(t):t)}}_stateAfterAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case j.EQUALS_SIGN:{this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{this.state=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this.state=B.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingAttributeValue),this.state=B.DATA,this.emitCurrentTagToken();break}default:this.state=B.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=An;break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case j.APOSTROPHE:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=An;break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),this.currentAttr.value+=An;break}case j.QUOTATION_MARK:case j.APOSTROPHE:case j.LESS_THAN_SIGN:case j.EQUALS_SIGN:case j.GRAVE_ACCENT:{this._err(pe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.SOLIDUS:{this._leaveAttrValue(),this.state=B.SELF_CLOSING_START_TAG;break}case j.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBetweenAttributes),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case j.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(pe.eofInTag),this._emitEOFToken();break}default:this._err(pe.unexpectedSolidusInTag),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=An;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(qr.DASH_DASH,!0)?(this._createCommentToken(qr.DASH_DASH.length+1),this.state=B.COMMENT_START):this._consumeSequenceIfMatch(qr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(qr.DOCTYPE.length+1),this.state=B.DOCTYPE):this._consumeSequenceIfMatch(qr.CDATA_START,!0)?this.inForeignNode?this.state=B.CDATA_SECTION:(this._err(pe.cdataInHtmlContent),this._createCommentToken(qr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=B.BOGUS_COMMENT):this._ensureHibernation()||(this._err(pe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_START_DASH;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=B.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptClosingOfEmptyComment),this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END_DASH;break}case j.LESS_THAN_SIGN:{n.data+="<",this.state=B.COMMENT_LESS_THAN_SIGN;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.data+=An;break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case j.EXCLAMATION_MARK:{n.data+="!",this.state=B.COMMENT_LESS_THAN_SIGN_BANG;break}case j.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===j.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=B.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===j.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=B.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==j.GREATER_THAN_SIGN&&t!==j.EOF&&this._err(pe.nestedComment),this.state=B.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case j.EXCLAMATION_MARK:{this.state=B.COMMENT_END_BANG;break}case j.HYPHEN_MINUS:{n.data+="-";break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{n.data+="--!",this.state=B.COMMENT_END_DASH;break}case j.GREATER_THAN_SIGN:{this._err(pe.incorrectlyClosedComment),this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this._err(pe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=B.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case j.EOF:{this._err(pe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingWhitespaceBeforeDoctypeName),this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Tc(t))this._createDoctypeToken(String.fromCharCode(Af(t))),this.state=B.DOCTYPE_NAME;else switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.NULL:{this._err(pe.unexpectedNullCharacter),this._createDoctypeToken(An),this.state=B.DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(pe.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=B.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.AFTER_DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.name+=An;break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Tc(t)?Af(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(qr.PUBLIC,!1)?this.state=B.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(qr.SYSTEM,!1)?this.state=B.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(pe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=An;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(pe.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 j.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.publicId+=An;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(pe.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 j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.QUOTATION_MARK:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(pe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.QUOTATION_MARK:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(pe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(pe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=An;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(pe.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 j.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.NULL:{this._err(pe.unexpectedNullCharacter),n.systemId+=An;break}case j.GREATER_THAN_SIGN:{this._err(pe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(pe.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 j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(pe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(pe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.NULL:{this._err(pe.unexpectedNullCharacter);break}case j.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case j.RIGHT_SQUARE_BRACKET:{this.state=B.CDATA_SECTION_BRACKET;break}case j.EOF:{this._err(pe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===j.RIGHT_SQUARE_BRACKET?this.state=B.CDATA_SECTION_END:(this._emitChars("]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA;break}case j.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=B.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(j.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&N_(this.preprocessor.peek(1))?B.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){N_(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===j.SEMICOLON&&this._err(pe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const kw=new Set([_.DD,_.DT,_.LI,_.OPTGROUP,_.OPTION,_.P,_.RB,_.RP,_.RT,_.RTC]),R_=new Set([...kw,_.CAPTION,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]),yh=new Set([_.APPLET,_.CAPTION,_.HTML,_.MARQUEE,_.OBJECT,_.TABLE,_.TD,_.TEMPLATE,_.TH]),FD=new Set([...yh,_.OL,_.UL]),$D=new Set([...yh,_.BUTTON]),L_=new Set([_.ANNOTATION_XML,_.MI,_.MN,_.MO,_.MS,_.MTEXT]),I_=new Set([_.DESC,_.FOREIGN_OBJECT,_.TITLE]),VD=new Set([_.TR,_.TEMPLATE,_.HTML]),GD=new Set([_.TBODY,_.TFOOT,_.THEAD,_.TEMPLATE,_.HTML]),qD=new Set([_.TABLE,_.TEMPLATE,_.HTML]),YD=new Set([_.TD,_.TH]);class WD{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=_.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===_.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===we.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==we.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(Pg,we.HTML)}popUntilTableCellPopped(){this.popUntilPopped(YD,we.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(qD,we.HTML)}clearBackToTableBodyContext(){this.clearBackTo(GD,we.HTML)}clearBackToTableRowContext(){this.clearBackTo(VD,we.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]===_.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]===_.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case we.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case we.SVG:{if(I_.has(i))return!1;break}case we.MATHML:{if(L_.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,yh)}hasInListItemScope(t){return this.hasInDynamicScope(t,FD)}hasInButtonScope(t){return this.hasInDynamicScope(t,$D)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case we.HTML:{if(Pg.has(n))return!0;if(yh.has(n))return!1;break}case we.SVG:{if(I_.has(n))return!1;break}case we.MATHML:{if(L_.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===we.HTML)switch(this.tagIDs[n]){case t:return!0;case _.TABLE:case _.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===we.HTML)switch(this.tagIDs[t]){case _.TBODY:case _.THEAD:case _.TFOOT:return!0;case _.TABLE:case _.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===we.HTML)switch(this.tagIDs[n]){case t:return!0;case _.OPTION:case _.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&kw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&R_.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&R_.has(this.currentTagId);)this.pop()}}const M0=3;var ps;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ps||(ps={}));const O_={type:ps.Marker};class QD{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,l=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===ps.Marker)break;const{element:m}=d;if(this.treeAdapter.getTagName(m)===l&&this.treeAdapter.getNamespaceURI(m)===o){const p=this.treeAdapter.getAttrList(m);p.length===i&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<M0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<M0)return;const i=new Map(n.map(o=>[o.name,o.value]));let l=0;for(let o=0;o<r.length;o++){const c=r[o];c.attrs.every(d=>i.get(d.name)===d.value)&&(l+=1,l>=M0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(O_)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ps.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ps.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(O_);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ps.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ps.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ps.Element&&n.element===t)}}const Vi={createDocument(){return{nodeName:"#document",mode:Na.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(l=>l.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const l={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Vi.appendChild(e,l)}},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(Vi.isTextNode(n)){n.value+=t;return}}Vi.appendChild(e,Vi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Vi.isTextNode(r)?r.value+=t:Vi.insertBefore(e,Vi.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}}},ww="html",XD="about:legacy-compat",KD="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Cw=["+//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//"],ZD=[...Cw,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],JD=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Sw=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],ej=[...Sw,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function D_(e,t){return t.some(n=>e.startsWith(n))}function tj(e){return e.name===ww&&e.publicId===null&&(e.systemId===null||e.systemId===XD)}function nj(e){if(e.name!==ww)return Na.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===KD)return Na.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),JD.has(n))return Na.QUIRKS;let r=t===null?ZD:Cw;if(D_(n,r))return Na.QUIRKS;if(r=t===null?Sw:ej,D_(n,r))return Na.LIMITED_QUIRKS}return Na.NO_QUIRKS}const j_={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},rj="definitionurl",aj="definitionURL",sj=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])),ij=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:we.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:we.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:we.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:we.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:we.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:we.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:we.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:we.XML}],["xml:space",{prefix:"xml",name:"space",namespace:we.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:we.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:we.XMLNS}]]),lj=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])),oj=new Set([_.B,_.BIG,_.BLOCKQUOTE,_.BODY,_.BR,_.CENTER,_.CODE,_.DD,_.DIV,_.DL,_.DT,_.EM,_.EMBED,_.H1,_.H2,_.H3,_.H4,_.H5,_.H6,_.HEAD,_.HR,_.I,_.IMG,_.LI,_.LISTING,_.MENU,_.META,_.NOBR,_.OL,_.P,_.PRE,_.RUBY,_.S,_.SMALL,_.SPAN,_.STRONG,_.STRIKE,_.SUB,_.SUP,_.TABLE,_.TT,_.U,_.UL,_.VAR]);function uj(e){const t=e.tagID;return t===_.FONT&&e.attrs.some(({name:r})=>r===ql.COLOR||r===ql.SIZE||r===ql.FACE)||oj.has(t)}function Nw(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===rj){e.attrs[t].name=aj;break}}function Aw(e){for(let t=0;t<e.attrs.length;t++){const n=sj.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function W1(e){for(let t=0;t<e.attrs.length;t++){const n=ij.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 cj(e){const t=lj.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=gu(e.tagName))}function dj(e,t){return t===we.MATHML&&(e===_.MI||e===_.MO||e===_.MN||e===_.MS||e===_.MTEXT)}function fj(e,t,n){if(t===we.MATHML&&e===_.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ql.ENCODING){const i=n[r].value.toLowerCase();return i===j_.TEXT_HTML||i===j_.APPLICATION_XML}}return t===we.SVG&&(e===_.FOREIGN_OBJECT||e===_.DESC||e===_.TITLE)}function hj(e,t,n,r){return(!r||r===we.HTML)&&fj(e,t,n)||(!r||r===we.MATHML)&&dj(e,t)}const mj="hidden",pj=8,gj=3;var G;(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"})(G||(G={}));const bj={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Rw=new Set([_.TABLE,_.TBODY,_.TFOOT,_.THEAD,_.TR]),M_={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Vi,onParseError:null};class P_{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=G.INITIAL,this.originalInsertionMode=G.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={...M_,...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 zD(this.options,this),this.activeFormattingElements=new QD(this.treeAdapter),this.fragmentContextID=r?gu(this.treeAdapter.getTagName(r)):_.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new WD(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={...M_,...n};t??(t=r.treeAdapter.createElement(ae.TEMPLATE,we.HTML,[]));const i=r.treeAdapter.createElement("documentmock",we.HTML,[]),l=new this(r,i,t);return l.fragmentContextID===_.TEMPLATE&&l.tmplInsertionModeStack.unshift(G.IN_TEMPLATE),l._initTokenizerForFragmentParsing(),l._insertFakeRootElement(),l._resetInsertionMode(),l._findFormInFragmentContext(),l}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const l=(i=t.location)!==null&&i!==void 0?i:bj,o={code:n,startLine:l.startLine,startCol:l.startCol,startOffset:l.startOffset,endLine:r?l.startLine:l.endLine,endCol:r?l.startCol:l.endCol,endOffset:r?l.startOffset:l.endOffset};this.onParseError(o)}onItemPush(t,n,r){var i,l;(l=(i=this.treeAdapter).onItemPush)===null||l===void 0||l.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let l,o;this.openElements.stackTop===0&&this.fragmentContext?(l=this.fragmentContext,o=this.fragmentContextID):{current:l,currentTagId:o}=this.openElements,this._setContextModes(l,o)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===we.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,we.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=G.TEXT}switchToPlaintextParsing(){this.insertionMode=G.TEXT,this.originalInsertionMode=G.IN_BODY,this.tokenizer.state=Vn.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)===ae.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==we.HTML))switch(this.fragmentContextID){case _.TITLE:case _.TEXTAREA:{this.tokenizer.state=Vn.RCDATA;break}case _.STYLE:case _.XMP:case _.IFRAME:case _.NOEMBED:case _.NOFRAMES:case _.NOSCRIPT:{this.tokenizer.state=Vn.RAWTEXT;break}case _.SCRIPT:{this.tokenizer.state=Vn.SCRIPT_DATA;break}case _.PLAINTEXT:{this.tokenizer.state=Vn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));o&&this.treeAdapter.setNodeSourceCodeLocation(o,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,we.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,we.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(ae.HTML,we.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,_.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),l=r?i.lastIndexOf(r):i.length,o=i[l-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:d,endCol:m,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:d,endCol:m,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),l=n.type===Lt.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,l)}}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===_.SVG&&this.treeAdapter.getTagName(n)===ae.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===we.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===_.MGLYPH||t.tagID===_.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,we.HTML)}_processToken(t){switch(t.type){case Lt.CHARACTER:{this.onCharacter(t);break}case Lt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Lt.COMMENT:{this.onComment(t);break}case Lt.DOCTYPE:{this.onDoctype(t);break}case Lt.START_TAG:{this._processStartTag(t);break}case Lt.END_TAG:{this.onEndTag(t);break}case Lt.EOF:{this.onEof(t);break}case Lt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),l=this.treeAdapter.getAttrList(n);return hj(t,i,l,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ps.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const l=this.activeFormattingElements.entries[i];this._insertElement(l.token,this.treeAdapter.getNamespaceURI(l.element)),l.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=G.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(_.P),this.openElements.popUntilTagNamePopped(_.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case _.TR:{this.insertionMode=G.IN_ROW;return}case _.TBODY:case _.THEAD:case _.TFOOT:{this.insertionMode=G.IN_TABLE_BODY;return}case _.CAPTION:{this.insertionMode=G.IN_CAPTION;return}case _.COLGROUP:{this.insertionMode=G.IN_COLUMN_GROUP;return}case _.TABLE:{this.insertionMode=G.IN_TABLE;return}case _.BODY:{this.insertionMode=G.IN_BODY;return}case _.FRAMESET:{this.insertionMode=G.IN_FRAMESET;return}case _.SELECT:{this._resetInsertionModeForSelect(t);return}case _.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case _.HTML:{this.insertionMode=this.headElement?G.AFTER_HEAD:G.BEFORE_HEAD;return}case _.TD:case _.TH:{if(t>0){this.insertionMode=G.IN_CELL;return}break}case _.HEAD:{if(t>0){this.insertionMode=G.IN_HEAD;return}break}}this.insertionMode=G.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===_.TEMPLATE)break;if(r===_.TABLE){this.insertionMode=G.IN_SELECT_IN_TABLE;return}}this.insertionMode=G.IN_SELECT}_isElementCausesFosterParenting(t){return Rw.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 _.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===we.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case _.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 PD[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Y9(this,t);return}switch(this.insertionMode){case G.INITIAL:{dc(this,t);break}case G.BEFORE_HTML:{Ac(this,t);break}case G.BEFORE_HEAD:{Rc(this,t);break}case G.IN_HEAD:{Lc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Ic(this,t);break}case G.AFTER_HEAD:{Oc(this,t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:{Iw(this,t);break}case G.TEXT:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{P0(this,t);break}case G.IN_TABLE_TEXT:{Bw(this,t);break}case G.IN_COLUMN_GROUP:{Eh(this,t);break}case G.AFTER_BODY:{_h(this,t);break}case G.AFTER_AFTER_BODY:{th(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){q9(this,t);return}switch(this.insertionMode){case G.INITIAL:{dc(this,t);break}case G.BEFORE_HTML:{Ac(this,t);break}case G.BEFORE_HEAD:{Rc(this,t);break}case G.IN_HEAD:{Lc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Ic(this,t);break}case G.AFTER_HEAD:{Oc(this,t);break}case G.TEXT:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{P0(this,t);break}case G.IN_COLUMN_GROUP:{Eh(this,t);break}case G.AFTER_BODY:{_h(this,t);break}case G.AFTER_AFTER_BODY:{th(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Bg(this,t);return}switch(this.insertionMode){case G.INITIAL:case G.BEFORE_HTML:case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_TEMPLATE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{Bg(this,t);break}case G.IN_TABLE_TEXT:{fc(this,t);break}case G.AFTER_BODY:{kj(this,t);break}case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{wj(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case G.INITIAL:{Cj(this,t);break}case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:{this._err(t,pe.misplacedDoctype);break}case G.IN_TABLE_TEXT:{fc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,pe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?W9(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{dc(this,t);break}case G.BEFORE_HTML:{Sj(this,t);break}case G.BEFORE_HEAD:{Aj(this,t);break}case G.IN_HEAD:{Ja(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Ij(this,t);break}case G.AFTER_HEAD:{Dj(this,t);break}case G.IN_BODY:{Ar(this,t);break}case G.IN_TABLE:{au(this,t);break}case G.IN_TABLE_TEXT:{fc(this,t);break}case G.IN_CAPTION:{R9(this,t);break}case G.IN_COLUMN_GROUP:{K1(this,t);break}case G.IN_TABLE_BODY:{Qh(this,t);break}case G.IN_ROW:{Xh(this,t);break}case G.IN_CELL:{O9(this,t);break}case G.IN_SELECT:{zw(this,t);break}case G.IN_SELECT_IN_TABLE:{j9(this,t);break}case G.IN_TEMPLATE:{P9(this,t);break}case G.AFTER_BODY:{U9(this,t);break}case G.IN_FRAMESET:{H9(this,t);break}case G.AFTER_FRAMESET:{F9(this,t);break}case G.AFTER_AFTER_BODY:{V9(this,t);break}case G.AFTER_AFTER_FRAMESET:{G9(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Q9(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{dc(this,t);break}case G.BEFORE_HTML:{Nj(this,t);break}case G.BEFORE_HEAD:{Rj(this,t);break}case G.IN_HEAD:{Lj(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Oj(this,t);break}case G.AFTER_HEAD:{jj(this,t);break}case G.IN_BODY:{Wh(this,t);break}case G.TEXT:{E9(this,t);break}case G.IN_TABLE:{Gc(this,t);break}case G.IN_TABLE_TEXT:{fc(this,t);break}case G.IN_CAPTION:{L9(this,t);break}case G.IN_COLUMN_GROUP:{I9(this,t);break}case G.IN_TABLE_BODY:{Ug(this,t);break}case G.IN_ROW:{Hw(this,t);break}case G.IN_CELL:{D9(this,t);break}case G.IN_SELECT:{Fw(this,t);break}case G.IN_SELECT_IN_TABLE:{M9(this,t);break}case G.IN_TEMPLATE:{B9(this,t);break}case G.AFTER_BODY:{Vw(this,t);break}case G.IN_FRAMESET:{z9(this,t);break}case G.AFTER_FRAMESET:{$9(this,t);break}case G.AFTER_AFTER_BODY:{th(this,t);break}}}onEof(t){switch(this.insertionMode){case G.INITIAL:{dc(this,t);break}case G.BEFORE_HTML:{Ac(this,t);break}case G.BEFORE_HEAD:{Rc(this,t);break}case G.IN_HEAD:{Lc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Ic(this,t);break}case G.AFTER_HEAD:{Oc(this,t);break}case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{Mw(this,t);break}case G.TEXT:{_9(this,t);break}case G.IN_TABLE_TEXT:{fc(this,t);break}case G.IN_TEMPLATE:{$w(this,t);break}case G.AFTER_BODY:case G.IN_FRAMESET:case G.AFTER_FRAMESET:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{X1(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===j.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 G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.TEXT:case G.IN_COLUMN_GROUP:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{this._insertCharacters(t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:case G.AFTER_BODY:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{Lw(this,t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{P0(this,t);break}case G.IN_TABLE_TEXT:{Pw(this,t);break}}}}function xj(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):jw(e,t),n}function yj(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Ej(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let l=0,o=i;o!==n;l++,o=i){i=e.openElements.getCommonAncestor(o);const c=e.activeFormattingElements.getElementEntry(o),d=c&&l>=gj;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(o)):(o=_j(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function _j(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 Tj(e,t,n){const r=e.treeAdapter.getTagName(t),i=gu(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const l=e.treeAdapter.getNamespaceURI(t);i===_.TEMPLATE&&l===we.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function vj(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,l=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,l),e.treeAdapter.appendChild(t,l),e.activeFormattingElements.insertElementAfterBookmark(l,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,l,i.tagID)}function Q1(e,t){for(let n=0;n<pj;n++){const r=xj(e,t);if(!r)break;const i=yj(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const l=Ej(e,i,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(l),o&&Tj(e,o,l),vj(e,i,r)}}function Bg(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function kj(e,t){e._appendCommentNode(t,e.openElements.items[0])}function wj(e,t){e._appendCommentNode(t,e.document)}function X1(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const l=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(l);o&&!o.endTag&&e._setEndLocation(l,t)}}}}function Cj(e,t){e._setDocumentType(t);const n=t.forceQuirks?Na.QUIRKS:nj(t);tj(t)||e._err(t,pe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=G.BEFORE_HTML}function dc(e,t){e._err(t,pe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Na.QUIRKS),e.insertionMode=G.BEFORE_HTML,e._processToken(t)}function Sj(e,t){t.tagID===_.HTML?(e._insertElement(t,we.HTML),e.insertionMode=G.BEFORE_HEAD):Ac(e,t)}function Nj(e,t){const n=t.tagID;(n===_.HTML||n===_.HEAD||n===_.BODY||n===_.BR)&&Ac(e,t)}function Ac(e,t){e._insertFakeRootElement(),e.insertionMode=G.BEFORE_HEAD,e._processToken(t)}function Aj(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.HEAD:{e._insertElement(t,we.HTML),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD;break}default:Rc(e,t)}}function Rj(e,t){const n=t.tagID;n===_.HEAD||n===_.BODY||n===_.HTML||n===_.BR?Rc(e,t):e._err(t,pe.endTagWithoutMatchingOpenElement)}function Rc(e,t){e._insertFakeElement(ae.HEAD,_.HEAD),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD,e._processToken(t)}function Ja(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:{e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case _.TITLE:{e._switchToTextParsing(t,Vn.RCDATA);break}case _.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Vn.RAWTEXT):(e._insertElement(t,we.HTML),e.insertionMode=G.IN_HEAD_NO_SCRIPT);break}case _.NOFRAMES:case _.STYLE:{e._switchToTextParsing(t,Vn.RAWTEXT);break}case _.SCRIPT:{e._switchToTextParsing(t,Vn.SCRIPT_DATA);break}case _.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=G.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(G.IN_TEMPLATE);break}case _.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:Lc(e,t)}}function Lj(e,t){switch(t.tagID){case _.HEAD:{e.openElements.pop(),e.insertionMode=G.AFTER_HEAD;break}case _.BODY:case _.BR:case _.HTML:{Lc(e,t);break}case _.TEMPLATE:{Jl(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Jl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==_.TEMPLATE&&e._err(t,pe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,pe.endTagWithoutMatchingOpenElement)}function Lc(e,t){e.openElements.pop(),e.insertionMode=G.AFTER_HEAD,e._processToken(t)}function Ij(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.BASEFONT:case _.BGSOUND:case _.HEAD:case _.LINK:case _.META:case _.NOFRAMES:case _.STYLE:{Ja(e,t);break}case _.NOSCRIPT:{e._err(t,pe.nestedNoscriptInHead);break}default:Ic(e,t)}}function Oj(e,t){switch(t.tagID){case _.NOSCRIPT:{e.openElements.pop(),e.insertionMode=G.IN_HEAD;break}case _.BR:{Ic(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Ic(e,t){const n=t.type===Lt.EOF?pe.openElementsLeftAfterEof:pe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=G.IN_HEAD,e._processToken(t)}function Dj(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.BODY:{e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=G.IN_BODY;break}case _.FRAMESET:{e._insertElement(t,we.HTML),e.insertionMode=G.IN_FRAMESET;break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{e._err(t,pe.abandonedHeadElementChild),e.openElements.push(e.headElement,_.HEAD),Ja(e,t),e.openElements.remove(e.headElement);break}case _.HEAD:{e._err(t,pe.misplacedStartTagForHeadElement);break}default:Oc(e,t)}}function jj(e,t){switch(t.tagID){case _.BODY:case _.HTML:case _.BR:{Oc(e,t);break}case _.TEMPLATE:{Jl(e,t);break}default:e._err(t,pe.endTagWithoutMatchingOpenElement)}}function Oc(e,t){e._insertFakeElement(ae.BODY,_.BODY),e.insertionMode=G.IN_BODY,Yh(e,t)}function Yh(e,t){switch(t.type){case Lt.CHARACTER:{Iw(e,t);break}case Lt.WHITESPACE_CHARACTER:{Lw(e,t);break}case Lt.COMMENT:{Bg(e,t);break}case Lt.START_TAG:{Ar(e,t);break}case Lt.END_TAG:{Wh(e,t);break}case Lt.EOF:{Mw(e,t);break}}}function Lw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Iw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Mj(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Pj(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Bj(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,we.HTML),e.insertionMode=G.IN_FRAMESET)}function Uj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function Hj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Pg.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,we.HTML)}function zj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Fj(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,we.HTML),n||(e.formElement=e.openElements.current))}function $j(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===_.LI&&i===_.LI||(n===_.DD||n===_.DT)&&(i===_.DD||i===_.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==_.ADDRESS&&i!==_.DIV&&i!==_.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function Vj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.tokenizer.state=Vn.PLAINTEXT}function Gj(e,t){e.openElements.hasInScope(_.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.framesetOk=!1}function qj(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ae.A);n&&(Q1(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Yj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Wj(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(_.NOBR)&&(Q1(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Qj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Xj(e,t){e.treeAdapter.getDocumentMode(e.document)!==Na.QUIRKS&&e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=G.IN_TABLE}function Ow(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Dw(e){const t=Tw(e,ql.TYPE);return t!=null&&t.toLowerCase()===mj}function Kj(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),Dw(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Zj(e,t){e._appendElement(t,we.HTML),t.ackSelfClosing=!0}function Jj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function e9(e,t){t.tagName=ae.IMG,t.tagID=_.IMG,Ow(e,t)}function t9(e,t){e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Vn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=G.TEXT}function n9(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Vn.RAWTEXT)}function r9(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Vn.RAWTEXT)}function B_(e,t){e._switchToTextParsing(t,Vn.RAWTEXT)}function a9(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===G.IN_TABLE||e.insertionMode===G.IN_CAPTION||e.insertionMode===G.IN_TABLE_BODY||e.insertionMode===G.IN_ROW||e.insertionMode===G.IN_CELL?G.IN_SELECT_IN_TABLE:G.IN_SELECT}function s9(e,t){e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function i9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,we.HTML)}function l9(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(_.RTC),e._insertElement(t,we.HTML)}function o9(e,t){e._reconstructActiveFormattingElements(),Nw(t),W1(t),t.selfClosing?e._appendElement(t,we.MATHML):e._insertElement(t,we.MATHML),t.ackSelfClosing=!0}function u9(e,t){e._reconstructActiveFormattingElements(),Aw(t),W1(t),t.selfClosing?e._appendElement(t,we.SVG):e._insertElement(t,we.SVG),t.ackSelfClosing=!0}function U_(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function Ar(e,t){switch(t.tagID){case _.I:case _.S:case _.B:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.SMALL:case _.STRIKE:case _.STRONG:{Yj(e,t);break}case _.A:{qj(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{Hj(e,t);break}case _.P:case _.DL:case _.OL:case _.UL:case _.DIV:case _.DIR:case _.NAV:case _.MAIN:case _.MENU:case _.ASIDE:case _.CENTER:case _.FIGURE:case _.FOOTER:case _.HEADER:case _.HGROUP:case _.DIALOG:case _.DETAILS:case _.ADDRESS:case _.ARTICLE:case _.SEARCH:case _.SECTION:case _.SUMMARY:case _.FIELDSET:case _.BLOCKQUOTE:case _.FIGCAPTION:{Uj(e,t);break}case _.LI:case _.DD:case _.DT:{$j(e,t);break}case _.BR:case _.IMG:case _.WBR:case _.AREA:case _.EMBED:case _.KEYGEN:{Ow(e,t);break}case _.HR:{Jj(e,t);break}case _.RB:case _.RTC:{i9(e,t);break}case _.RT:case _.RP:{l9(e,t);break}case _.PRE:case _.LISTING:{zj(e,t);break}case _.XMP:{n9(e,t);break}case _.SVG:{u9(e,t);break}case _.HTML:{Mj(e,t);break}case _.BASE:case _.LINK:case _.META:case _.STYLE:case _.TITLE:case _.SCRIPT:case _.BGSOUND:case _.BASEFONT:case _.TEMPLATE:{Ja(e,t);break}case _.BODY:{Pj(e,t);break}case _.FORM:{Fj(e,t);break}case _.NOBR:{Wj(e,t);break}case _.MATH:{o9(e,t);break}case _.TABLE:{Xj(e,t);break}case _.INPUT:{Kj(e,t);break}case _.PARAM:case _.TRACK:case _.SOURCE:{Zj(e,t);break}case _.IMAGE:{e9(e,t);break}case _.BUTTON:{Gj(e,t);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{Qj(e,t);break}case _.IFRAME:{r9(e,t);break}case _.SELECT:{a9(e,t);break}case _.OPTION:case _.OPTGROUP:{s9(e,t);break}case _.NOEMBED:case _.NOFRAMES:{B_(e,t);break}case _.FRAMESET:{Bj(e,t);break}case _.TEXTAREA:{t9(e,t);break}case _.NOSCRIPT:{e.options.scriptingEnabled?B_(e,t):U_(e,t);break}case _.PLAINTEXT:{Vj(e,t);break}case _.COL:case _.TH:case _.TD:case _.TR:case _.HEAD:case _.FRAME:case _.TBODY:case _.TFOOT:case _.THEAD:case _.CAPTION:case _.COLGROUP:break;default:U_(e,t)}}function c9(e,t){if(e.openElements.hasInScope(_.BODY)&&(e.insertionMode=G.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function d9(e,t){e.openElements.hasInScope(_.BODY)&&(e.insertionMode=G.AFTER_BODY,Vw(e,t))}function f9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function h9(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(_.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(_.FORM):n&&e.openElements.remove(n))}function m9(e){e.openElements.hasInButtonScope(_.P)||e._insertFakeElement(ae.P,_.P),e._closePElement()}function p9(e){e.openElements.hasInListItemScope(_.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(_.LI),e.openElements.popUntilTagNamePopped(_.LI))}function g9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function b9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function x9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function y9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ae.BR,_.BR),e.openElements.pop(),e.framesetOk=!1}function jw(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const l=e.openElements.items[i],o=e.openElements.tagIDs[i];if(r===o&&(r!==_.UNKNOWN||e.treeAdapter.getTagName(l)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(l,o))break}}function Wh(e,t){switch(t.tagID){case _.A:case _.B:case _.I:case _.S:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.NOBR:case _.SMALL:case _.STRIKE:case _.STRONG:{Q1(e,t);break}case _.P:{m9(e);break}case _.DL:case _.UL:case _.OL:case _.DIR:case _.DIV:case _.NAV:case _.PRE:case _.MAIN:case _.MENU:case _.ASIDE:case _.BUTTON:case _.CENTER:case _.FIGURE:case _.FOOTER:case _.HEADER:case _.HGROUP:case _.DIALOG:case _.ADDRESS:case _.ARTICLE:case _.DETAILS:case _.SEARCH:case _.SECTION:case _.SUMMARY:case _.LISTING:case _.FIELDSET:case _.BLOCKQUOTE:case _.FIGCAPTION:{f9(e,t);break}case _.LI:{p9(e);break}case _.DD:case _.DT:{g9(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{b9(e);break}case _.BR:{y9(e);break}case _.BODY:{c9(e,t);break}case _.HTML:{d9(e,t);break}case _.FORM:{h9(e);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{x9(e,t);break}case _.TEMPLATE:{Jl(e,t);break}default:jw(e,t)}}function Mw(e,t){e.tmplInsertionModeStack.length>0?$w(e,t):X1(e,t)}function E9(e,t){var n;t.tagID===_.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function _9(e,t){e._err(t,pe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function P0(e,t){if(e.openElements.currentTagId!==void 0&&Rw.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=G.IN_TABLE_TEXT,t.type){case Lt.CHARACTER:{Bw(e,t);break}case Lt.WHITESPACE_CHARACTER:{Pw(e,t);break}}else td(e,t)}function T9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,we.HTML),e.insertionMode=G.IN_CAPTION}function v9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=G.IN_COLUMN_GROUP}function k9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.COLGROUP,_.COLGROUP),e.insertionMode=G.IN_COLUMN_GROUP,K1(e,t)}function w9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=G.IN_TABLE_BODY}function C9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.TBODY,_.TBODY),e.insertionMode=G.IN_TABLE_BODY,Qh(e,t)}function S9(e,t){e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function N9(e,t){Dw(t)?e._appendElement(t,we.HTML):td(e,t),t.ackSelfClosing=!0}function A9(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,we.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function au(e,t){switch(t.tagID){case _.TD:case _.TH:case _.TR:{C9(e,t);break}case _.STYLE:case _.SCRIPT:case _.TEMPLATE:{Ja(e,t);break}case _.COL:{k9(e,t);break}case _.FORM:{A9(e,t);break}case _.TABLE:{S9(e,t);break}case _.TBODY:case _.TFOOT:case _.THEAD:{w9(e,t);break}case _.INPUT:{N9(e,t);break}case _.CAPTION:{T9(e,t);break}case _.COLGROUP:{v9(e,t);break}default:td(e,t)}}function Gc(e,t){switch(t.tagID){case _.TABLE:{e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode());break}case _.TEMPLATE:{Jl(e,t);break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TBODY:case _.TD:case _.TFOOT:case _.TH:case _.THEAD:case _.TR:break;default:td(e,t)}}function td(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Yh(e,t),e.fosterParentingEnabled=n}function Pw(e,t){e.pendingCharacterTokens.push(t)}function Bw(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function fc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)td(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Uw=new Set([_.CAPTION,_.COL,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]);function R9(e,t){const n=t.tagID;Uw.has(n)?e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,au(e,t)):Ar(e,t)}function L9(e,t){const n=t.tagID;switch(n){case _.CAPTION:case _.TABLE:{e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,n===_.TABLE&&Gc(e,t));break}case _.BODY:case _.COL:case _.COLGROUP:case _.HTML:case _.TBODY:case _.TD:case _.TFOOT:case _.TH:case _.THEAD:case _.TR:break;default:Wh(e,t)}}function K1(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.COL:{e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case _.TEMPLATE:{Ja(e,t);break}default:Eh(e,t)}}function I9(e,t){switch(t.tagID){case _.COLGROUP:{e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case _.TEMPLATE:{Jl(e,t);break}case _.COL:break;default:Eh(e,t)}}function Eh(e,t){e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE,e._processToken(t))}function Qh(e,t){switch(t.tagID){case _.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,we.HTML),e.insertionMode=G.IN_ROW;break}case _.TH:case _.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ae.TR,_.TR),e.insertionMode=G.IN_ROW,Xh(e,t);break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,au(e,t));break}default:au(e,t)}}function Ug(e,t){const n=t.tagID;switch(t.tagID){case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case _.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,Gc(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:case _.TR:break;default:Gc(e,t)}}function Xh(e,t){switch(t.tagID){case _.TH:case _.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,we.HTML),e.insertionMode=G.IN_CELL,e.activeFormattingElements.insertMarker();break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Qh(e,t));break}default:au(e,t)}}function Hw(e,t){switch(t.tagID){case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY);break}case _.TABLE:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Ug(e,t));break}case _.TBODY:case _.TFOOT:case _.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(_.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Ug(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:break;default:Gc(e,t)}}function O9(e,t){const n=t.tagID;Uw.has(n)?(e.openElements.hasInTableScope(_.TD)||e.openElements.hasInTableScope(_.TH))&&(e._closeTableCell(),Xh(e,t)):Ar(e,t)}function D9(e,t){const n=t.tagID;switch(n){case _.TD:case _.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_ROW);break}case _.TABLE:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Hw(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:break;default:Wh(e,t)}}function zw(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._insertElement(t,we.HTML);break}case _.OPTGROUP:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._insertElement(t,we.HTML);break}case _.HR:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case _.INPUT:case _.KEYGEN:case _.TEXTAREA:case _.SELECT:{e.openElements.hasInSelectScope(_.SELECT)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),t.tagID!==_.SELECT&&e._processStartTag(t));break}case _.SCRIPT:case _.TEMPLATE:{Ja(e,t);break}}}function Fw(e,t){switch(t.tagID){case _.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===_.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===_.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop();break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop();break}case _.SELECT:{e.openElements.hasInSelectScope(_.SELECT)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode());break}case _.TEMPLATE:{Jl(e,t);break}}}function j9(e,t){const n=t.tagID;n===_.CAPTION||n===_.TABLE||n===_.TBODY||n===_.TFOOT||n===_.THEAD||n===_.TR||n===_.TD||n===_.TH?(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),e._processStartTag(t)):zw(e,t)}function M9(e,t){const n=t.tagID;n===_.CAPTION||n===_.TABLE||n===_.TBODY||n===_.TFOOT||n===_.THEAD||n===_.TR||n===_.TD||n===_.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Fw(e,t)}function P9(e,t){switch(t.tagID){case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{Ja(e,t);break}case _.CAPTION:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.tmplInsertionModeStack[0]=G.IN_TABLE,e.insertionMode=G.IN_TABLE,au(e,t);break}case _.COL:{e.tmplInsertionModeStack[0]=G.IN_COLUMN_GROUP,e.insertionMode=G.IN_COLUMN_GROUP,K1(e,t);break}case _.TR:{e.tmplInsertionModeStack[0]=G.IN_TABLE_BODY,e.insertionMode=G.IN_TABLE_BODY,Qh(e,t);break}case _.TD:case _.TH:{e.tmplInsertionModeStack[0]=G.IN_ROW,e.insertionMode=G.IN_ROW,Xh(e,t);break}default:e.tmplInsertionModeStack[0]=G.IN_BODY,e.insertionMode=G.IN_BODY,Ar(e,t)}}function B9(e,t){t.tagID===_.TEMPLATE&&Jl(e,t)}function $w(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):X1(e,t)}function U9(e,t){t.tagID===_.HTML?Ar(e,t):_h(e,t)}function Vw(e,t){var n;if(t.tagID===_.HTML){if(e.fragmentContext||(e.insertionMode=G.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===_.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 _h(e,t)}function _h(e,t){e.insertionMode=G.IN_BODY,Yh(e,t)}function H9(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.FRAMESET:{e._insertElement(t,we.HTML);break}case _.FRAME:{e._appendElement(t,we.HTML),t.ackSelfClosing=!0;break}case _.NOFRAMES:{Ja(e,t);break}}}function z9(e,t){t.tagID===_.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==_.FRAMESET&&(e.insertionMode=G.AFTER_FRAMESET))}function F9(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.NOFRAMES:{Ja(e,t);break}}}function $9(e,t){t.tagID===_.HTML&&(e.insertionMode=G.AFTER_AFTER_FRAMESET)}function V9(e,t){t.tagID===_.HTML?Ar(e,t):th(e,t)}function th(e,t){e.insertionMode=G.IN_BODY,Yh(e,t)}function G9(e,t){switch(t.tagID){case _.HTML:{Ar(e,t);break}case _.NOFRAMES:{Ja(e,t);break}}}function q9(e,t){t.chars=An,e._insertCharacters(t)}function Y9(e,t){e._insertCharacters(t),e.framesetOk=!1}function Gw(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==we.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function W9(e,t){if(uj(t))Gw(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===we.MATHML?Nw(t):r===we.SVG&&(cj(t),Aw(t)),W1(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Q9(e,t){if(t.tagID===_.P||t.tagID===_.BR){Gw(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)===we.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}ae.AREA,ae.BASE,ae.BASEFONT,ae.BGSOUND,ae.BR,ae.COL,ae.EMBED,ae.FRAME,ae.HR,ae.IMG,ae.INPUT,ae.KEYGEN,ae.LINK,ae.META,ae.PARAM,ae.SOURCE,ae.TRACK,ae.WBR;const Kh=qw("end"),Es=qw("start");function qw(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 Yw(e){const t=Es(e),n=Kh(e);if(t&&n)return{start:t,end:n}}const X9=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,K9=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),H_={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Ww(e,t){const n=lM(e),r=k1("type",{handlers:{root:Z9,element:J9,text:eM,comment:Xw,doctype:tM,raw:rM},unknown:aM}),i={parser:n?new P_(H_):P_.getFragmentParser(void 0,H_),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),bu(i,Es());const l=n?i.parser.document:i.parser.getFragment(),o=uD(l,{file:i.options.file});return i.stitches&&bs(o,"comment",function(c,d,m){const p=c;if(p.value.stitch&&m&&d!==void 0){const g=m.children;return g[d]=p.value.stitch,d}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function Qw(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Z9(e,t){Qw(e.children,t)}function J9(e,t){sM(e,t),Qw(e.children,t),iM(e,t)}function eM(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Lt.CHARACTER,chars:e.value,location:nd(e)};bu(t,Es(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function tM(e,t){const n={type:Lt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:nd(e)};bu(t,Es(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function nM(e,t){t.stitches=!0;const n=oM(e);if("children"in e&&"children"in n){const r=Ww({type:"root",children:e.children},t.options);n.children=r.children}Xw({type:"comment",value:{stitch:n}},t)}function Xw(e,t){const n=e.value,r={type:Lt.COMMENT,data:n,location:nd(e)};bu(t,Es(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function rM(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,Kw(t,Es(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(X9,"<$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 aM(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))nM(n,t);else{let r="";throw K9.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 bu(e,t){Kw(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=Vn.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 Kw(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 sM(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Vn.PLAINTEXT)return;bu(t,Es(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:$l.html;i===$l.html&&n==="svg"&&(i=$l.svg);const l=mD({...e,children:[]},{space:i===$l.svg?"svg":"html"}),o={type:Lt.START_TAG,tagName:n,tagID:gu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in l?l.attrs:[],location:nd(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function iM(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&pk.includes(n)||t.parser.tokenizer.state===Vn.PLAINTEXT)return;bu(t,Kh(e));const r={type:Lt.END_TAG,tagName:n,tagID:gu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:nd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Vn.RCDATA||t.parser.tokenizer.state===Vn.RAWTEXT||t.parser.tokenizer.state===Vn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Vn.DATA)}function lM(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function nd(e){const t=Es(e)||{line:void 0,column:void 0,offset:void 0},n=Kh(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 oM(e){return"children"in e?Wl({...e,children:[]}):Wl(e)}function Hg(e){return function(t,n){return Ww(t,{...e,file:n})}}const jl=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Ul={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...jl,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...jl],h2:[["className","sr-only"]],img:[...jl,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...jl,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...jl],table:[...jl],ul:[...jl,["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"]},Gi={}.hasOwnProperty;function uM(e,t){let n={type:"root",children:[]};const r={schema:t?{...Ul,...t}:Ul,stack:[]},i=Zw(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function Zw(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return cM(e,n);case"doctype":return dM(e,n);case"element":return fM(e,n);case"root":return hM(e,n);case"text":return mM(e,n)}}}function cM(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),l={type:"comment",value:r<0?n:n.slice(0,r)};return rd(l,t),l}}function dM(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return rd(n,t),n}}function fM(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Jw(e,t.children),i=pM(e,t.properties);e.stack.pop();let l=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(l=!0,e.schema.ancestors&&Gi.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(l=!1;++d<c.length;)e.stack.includes(c[d])&&(l=!0)}if(!l)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:i,children:r};return rd(o,t),o}function hM(e,t){const r={type:"root",children:Jw(e,t.children)};return rd(r,t),r}function mM(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return rd(r,t),r}function Jw(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const l=Zw(e,r[i]);l&&(Array.isArray(l)?n.push(...l):n.push(l))}}return n}function pM(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,l=r&&Gi.call(r,n)?r[n]:void 0,o=r&&Gi.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let m;for(m in c)if(Gi.call(c,m)){const p=c[m];let g=z_(e,F_(l,m),m,p);g==null&&(g=z_(e,F_(o,m),m,p)),g!=null&&(d[m]=g)}if(i&&Gi.call(i,n)){const p=i[n];for(m in p)Gi.call(p,m)&&!Gi.call(d,m)&&(d[m]=p[m])}return d}function z_(e,t,n,r){return t?Array.isArray(r)?gM(e,t,n,r):e3(e,t,n,r):void 0}function gM(e,t,n,r){let i=-1;const l=[];for(;++i<r.length;){const o=e3(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&l.push(o)}return l}function e3(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&bM(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,l=0;for(;++l<t.length;){const o=t[l];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){i=!0;break}}else if(o===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function bM(e,t,n){const r=e.schema.protocols&&Gi.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),l=i.indexOf(":"),o=i.indexOf("?"),c=i.indexOf("#"),d=i.indexOf("/");if(l<0||d>-1&&l>d||o>-1&&l>o||c>-1&&l>c)return!0;let m=-1;for(;++m<r.length;){const p=r[m];if(l===p.length&&i.slice(0,p.length)===p)return!0}return!1}function rd(e,t){const n=Yw(t);t.data&&(e.data=Wl(t.data)),n&&(e.position=n)}function F_(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],l=typeof i=="string"?i:i[0];if(l===t)return i;l==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function t3(e){return function(t){return uM(t,e)}}const Mr=el(/[A-Za-z]/),Nr=el(/[\dA-Za-z]/),xM=el(/[#-'*+\--9=?A-Z^-~]/);function Th(e){return e!==null&&(e<32||e===127)}const zg=el(/\d/),yM=el(/[\dA-Fa-f]/),EM=el(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function gn(e){return e!==null&&(e<0||e===32)}function jt(e){return e===-2||e===-1||e===32}const Zh=el(new RegExp("\\p{P}|\\p{S}","u")),Ql=el(/\s/);function el(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _M(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function TM(e,t,n){const i=Vh((n||{}).ignore||[]),l=vM(t);let o=-1;for(;++o<l.length;)z1(e,"text",c);function c(m,p){let g=-1,y;for(;++g<p.length;){const E=p[g],v=y?y.children:void 0;if(i(E,v?v.indexOf(E):void 0,y))return;y=E}if(y)return d(m,p)}function d(m,p){const g=p[p.length-1],y=l[o][0],E=l[o][1];let v=0;const C=g.children.indexOf(m);let S=!1,N=[];y.lastIndex=0;let R=y.exec(m.value);for(;R;){const M=R.index,Y={index:R.index,input:R.input,stack:[...p,m]};let U=E(...R,Y);if(typeof U=="string"&&(U=U.length>0?{type:"text",value:U}:void 0),U===!1?y.lastIndex=M+1:(v!==M&&N.push({type:"text",value:m.value.slice(v,M)}),Array.isArray(U)?N.push(...U):U&&N.push(U),v=M+R[0].length,S=!0),!y.global)break;R=y.exec(m.value)}return S?(v<m.value.length&&N.push({type:"text",value:m.value.slice(v)}),g.children.splice(C,1,...N)):N=[m],C+N.length}}function vM(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([kM(i[0]),wM(i[1])])}return t}function kM(e){return typeof e=="string"?new RegExp(_M(e),"g"):e}function wM(e){return typeof e=="function"?e:function(){return e}}const B0="phrasing",U0=["autolink","link","image","label"];function CM(){return{transforms:[OM],enter:{literalAutolink:NM,literalAutolinkEmail:H0,literalAutolinkHttp:H0,literalAutolinkWww:H0},exit:{literalAutolink:IM,literalAutolinkEmail:LM,literalAutolinkHttp:AM,literalAutolinkWww:RM}}}function SM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:B0,notInConstruct:U0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:B0,notInConstruct:U0},{character:":",before:"[ps]",after:"\\/",inConstruct:B0,notInConstruct:U0}]}}function NM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function H0(e){this.config.enter.autolinkProtocol.call(this,e)}function AM(e){this.config.exit.autolinkProtocol.call(this,e)}function RM(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 LM(e){this.config.exit.autolinkEmail.call(this,e)}function IM(e){this.exit(e)}function OM(e){TM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),jM]],{ignore:["link","linkReference"]})}function DM(e,t,n,r,i){let l="";if(!n3(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!MM(n)))return!1;const o=PM(n+r);if(!o[0])return!1;const c={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function jM(e,t,n,r){return!n3(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function MM(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 PM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ch(e,"(");let l=ch(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function n3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ql(n)||Zh(n))&&(!t||n!==47)}function Ka(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}r3.peek=qM;function BM(){this.buffer()}function UM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function HM(){this.buffer()}function zM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function FM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ka(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $M(e){this.exit(e)}function VM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ka(this.sliceSerialize(e)).toLowerCase(),n.label=t}function GM(e){this.exit(e)}function qM(){return"["}function r3(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),o(),l+=i.move("]"),l}function YM(){return{enter:{gfmFootnoteCallString:BM,gfmFootnoteCall:UM,gfmFootnoteDefinitionLabelString:HM,gfmFootnoteDefinition:zM},exit:{gfmFootnoteCallString:FM,gfmFootnoteCall:$M,gfmFootnoteDefinitionLabelString:VM,gfmFootnoteDefinition:GM}}}function WM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:r3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,o){const c=l.createTracker(o);let d=c.move("[^");const m=l.enter("footnoteDefinition"),p=l.enter("label");return d+=c.move(l.safe(l.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
|
|
245
|
-
`:" ")+l.indentLines(l.containerFlow(r,c.current()),t?a3:QM))),m(),d}}function QM(e,t,n){return t===0?e:a3(e,t,n)}function a3(e,t,n){return(n?"":" ")+e}const XM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];s3.peek=t7;function KM(){return{canContainEols:["delete"],enter:{strikethrough:JM},exit:{strikethrough:e7}}}function ZM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XM}],handlers:{delete:s3}}}function JM(e){this.enter({type:"delete",children:[]},e)}function e7(e){this.exit(e)}function s3(e,t,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function t7(){return"~"}function n7(e){return e.length}function r7(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||n7,l=[],o=[],c=[],d=[];let m=0,p=-1;for(;++p<e.length;){const w=[],C=[];let S=-1;for(e[p].length>m&&(m=e[p].length);++S<e[p].length;){const N=a7(e[p][S]);if(n.alignDelimiters!==!1){const R=i(N);C[S]=R,(d[S]===void 0||R>d[S])&&(d[S]=R)}w.push(N)}o[p]=w,c[p]=C}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<m;)l[g]=$_(r[g]);else{const w=$_(r);for(;++g<m;)l[g]=w}g=-1;const y=[],E=[];for(;++g<m;){const w=l[g];let C="",S="";w===99?(C=":",S=":"):w===108?C=":":w===114&&(S=":");let N=n.alignDelimiters===!1?1:Math.max(1,d[g]-C.length-S.length);const R=C+"-".repeat(N)+S;n.alignDelimiters!==!1&&(N=C.length+N+S.length,N>d[g]&&(d[g]=N),E[g]=N),y[g]=R}o.splice(1,0,y),c.splice(1,0,E),p=-1;const v=[];for(;++p<o.length;){const w=o[p],C=c[p];g=-1;const S=[];for(;++g<m;){const N=w[g]||"";let R="",M="";if(n.alignDelimiters!==!1){const Y=d[g]-(C[g]||0),U=l[g];U===114?R=" ".repeat(Y):U===99?Y%2?(R=" ".repeat(Y/2+.5),M=" ".repeat(Y/2-.5)):(R=" ".repeat(Y/2),M=R):M=" ".repeat(Y)}n.delimiterStart!==!1&&!g&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||g)&&S.push(" "),n.alignDelimiters!==!1&&S.push(R),S.push(N),n.alignDelimiters!==!1&&S.push(M),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||g!==m-1)&&S.push("|")}v.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
|
|
246
|
-
`)}function a7(e){return e==null?"":String(e)}function $_(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 s7(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),i7);return i(),o}function i7(e,t,n){return">"+(n?"":" ")+e}function l7(e,t){return V_(e,t.inConstruct,!0)&&!V_(e,t.notInConstruct,!1)}function V_(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 G_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
247
|
-
`&&l7(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
248
|
-
`}function o7(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>o&&(o=l):l=1,i=r+t.length,r=n.indexOf(t,i);return o}function u7(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 c7(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 d7(e,t,n,r){const i=c7(n),l=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(u7(e,n)){const g=n.enter("codeIndented"),y=n.indentLines(l,f7);return g(),y}const c=n.createTracker(r),d=i.repeat(Math.max(o7(l,i)+1,3)),m=n.enter("codeFenced");let p=c.move(d);if(e.lang){const g=n.enter(`codeFencedLang${o}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${o}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
249
|
-
`,encode:["`"],...c.current()})),g()}return p+=c.move(`
|
|
250
|
-
`),l&&(p+=c.move(l+`
|
|
251
|
-
`)),p+=c.move(d),m(),p}function f7(e,t,n){return(n?"":" ")+e}function Z1(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 h7(e,t,n,r){const i=Z1(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("[");return m+=d.move(n.safe(n.associationId(e),{before:m,after:"]",...d.current()})),m+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":`
|
|
252
|
-
`,...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),c()),o(),m}function m7(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 qc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function su(e){if(e===null||gn(e)||Ql(e))return 1;if(Zh(e))return 2}function vh(e,t,n){const r=su(e),i=su(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}i3.peek=p7;function i3(e,t,n,r){const i=m7(n),l=n.enter("emphasis"),o=n.createTracker(r),c=o.move(i);let d=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const m=d.charCodeAt(0),p=vh(r.before.charCodeAt(r.before.length-1),m,i);p.inside&&(d=qc(m)+d.slice(1));const g=d.charCodeAt(d.length-1),y=vh(r.after.charCodeAt(0),g,i);y.inside&&(d=d.slice(0,-1)+qc(g));const E=o.move(i);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+E}function p7(e,t,n){return n.options.emphasis||"*"}const g7={};function J1(e,t){const n=g7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return l3(e,r,i)}function l3(e,t,n){if(b7(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 q_(e.children,t,n)}return Array.isArray(e)?q_(e,t,n):""}function q_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=l3(e[i],t,n);return r.join("")}function b7(e){return!!(e&&typeof e=="object")}function x7(e,t){let n=!1;return bs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Dg}),!!((!e.depth||e.depth<3)&&J1(e)&&(t.options.setext||n))}function y7(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(x7(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),y=n.containerPhrasing(e,{...l.current(),before:`
|
|
253
|
-
`,after:`
|
|
254
|
-
`});return g(),p(),y+`
|
|
255
|
-
`+(i===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
256
|
-
`))+1))}const o="#".repeat(i),c=n.enter("headingAtx"),d=n.enter("phrasing");l.move(o+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
|
|
257
|
-
`,...l.current()});return/^[\t ]/.test(m)&&(m=qc(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,n.options.closeAtx&&(m+=" "+o),d(),c(),m}o3.peek=E7;function o3(e){return e.value||""}function E7(){return"<"}u3.peek=_7;function u3(e,t,n,r){const i=Z1(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("![");return m+=d.move(n.safe(e.alt,{before:m,after:"]",...d.current()})),m+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),c()),m+=d.move(")"),o(),m}function _7(){return"!"}c3.peek=T7;function c3(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const m=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=p,l(),i==="full"||!m||m!==g?d+=c.move(g+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function T7(){return"!"}d3.peek=v7;function d3(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const o=n.unsafe[l],c=n.compilePattern(o);let d;if(o.atBreak)for(;d=c.exec(r);){let m=d.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(d.index+1)}}return i+r+i}function v7(){return"`"}function f3(e,t){const n=J1(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))}h3.peek=k7;function h3(e,t,n,r){const i=Z1(n),l=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let c,d;if(f3(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let g=o.move("<");return g+=o.move(n.containerPhrasing(e,{before:g,after:">",...o.current()})),g+=o.move(">"),c(),n.stack=p,g}c=n.enter("link"),d=n.enter("label");let m=o.move("[");return m+=o.move(n.containerPhrasing(e,{before:m,after:"](",...o.current()})),m+=o.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(n.safe(e.url,{before:m,after:">",...o.current()})),m+=o.move(">")):(d=n.enter("destinationRaw"),m+=o.move(n.safe(e.url,{before:m,after:e.title?" ":")",...o.current()}))),d(),e.title&&(d=n.enter(`title${l}`),m+=o.move(" "+i),m+=o.move(n.safe(e.title,{before:m,after:i,...o.current()})),m+=o.move(i),d()),m+=o.move(")"),c(),m}function k7(e,t,n){return f3(e,n)?"<":"["}m3.peek=w7;function m3(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const m=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=p,l(),i==="full"||!m||m!==g?d+=c.move(g+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function w7(){return"["}function eb(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 C7(e){const t=eb(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 S7(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 p3(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 N7(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?S7(n):eb(n);const c=e.ordered?o==="."?")":".":C7(n);let d=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),p3(n)===o&&p){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(o=c),n.bulletCurrent=o;const m=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,i(),m}function A7(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 R7(e,t,n,r){const i=A7(n);let l=n.bulletCurrent||eb(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(r);c.move(l+" ".repeat(o-l.length)),c.shift(o);const d=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,c.current()),p);return d(),m;function p(g,y,E){return y?(E?"":" ".repeat(o))+g:(E?l:l+" ".repeat(o-l.length))+g}}function L7(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),i(),o}const I7=Vh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function O7(e,t,n,r){return(e.children.some(function(o){return I7(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function D7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}g3.peek=j7;function g3(e,t,n,r){const i=D7(n),l=n.enter("strong"),o=n.createTracker(r),c=o.move(i+i);let d=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const m=d.charCodeAt(0),p=vh(r.before.charCodeAt(r.before.length-1),m,i);p.inside&&(d=qc(m)+d.slice(1));const g=d.charCodeAt(d.length-1),y=vh(r.after.charCodeAt(0),g,i);y.inside&&(d=d.slice(0,-1)+qc(g));const E=o.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+E}function j7(e,t,n){return n.options.strong||"*"}function M7(e,t,n,r){return n.safe(e.value,r)}function P7(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 B7(e,t,n){const r=(p3(n)+(n.options.ruleSpaces?" ":"")).repeat(P7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const b3={blockquote:s7,break:G_,code:d7,definition:h7,emphasis:i3,hardBreak:G_,heading:y7,html:o3,image:u3,imageReference:c3,inlineCode:d3,link:h3,linkReference:m3,list:N7,listItem:R7,paragraph:L7,root:O7,strong:g3,text:M7,thematicBreak:B7},Y_=document.createElement("i");function tb(e){const t="&"+e+";";Y_.innerHTML=t;const n=Y_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function x3(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 U7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function H7(e){return e.replace(U7,z7)}function z7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return x3(n.slice(l?2:1),l?16:10)}return tb(n)||e}function F7(){return{enter:{table:$7,tableData:W_,tableHeader:W_,tableRow:G7},exit:{codeText:q7,table:V7,tableData:z0,tableHeader:z0,tableRow:z0}}}function $7(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 V7(e){this.exit(e),this.data.inTable=void 0}function G7(e){this.enter({type:"tableRow",children:[]},e)}function z0(e){this.exit(e)}function W_(e){this.enter({type:"tableCell",children:[]},e)}function q7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Y7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Y7(e,t){return t==="|"?t:e}function W7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
258
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:d,tableRow:c}};function o(E,v,w,C){return m(p(E,w,C),E.align)}function c(E,v,w,C){const S=g(E,w,C),N=m([S]);return N.slice(0,N.indexOf(`
|
|
259
|
-
`))}function d(E,v,w,C){const S=w.enter("tableCell"),N=w.enter("phrasing"),R=w.containerPhrasing(E,{...C,before:l,after:l});return N(),S(),R}function m(E,v){return r7(E,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function p(E,v,w){const C=E.children;let S=-1;const N=[],R=v.enter("table");for(;++S<C.length;)N[S]=g(C[S],v,w);return R(),N}function g(E,v,w){const C=E.children;let S=-1;const N=[],R=v.enter("tableRow");for(;++S<C.length;)N[S]=d(C[S],E,v,w);return R(),N}function y(E,v,w){let C=b3.inlineCode(E,v,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function Q7(){return{exit:{taskListCheckValueChecked:Q_,taskListCheckValueUnchecked:Q_,paragraph:K7}}}function X7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Z7}}}function Q_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function K7(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,o;for(;++l<i.length;){const c=i[l];if(c.type==="paragraph"){o=c;break}}o===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 Z7(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);l&&c.move(o);let d=b3.listItem(e,t,n,{...r,...c.current()});return l&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),d;function m(p){return p+o}}function J7(){return[CM(),YM(),KM(),F7(),Q7()]}function eP(e){return{extensions:[SM(),WM(e),ZM(),W7(e),X7()]}}function ua(e,t,n,r){const i=e.length;let l=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<r.length;)o=r.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function Aa(e,t){return e.length>0?(ua(e,e.length,0,t),e):t}const X_={}.hasOwnProperty;function y3(e){const t={};let n=-1;for(;++n<e.length;)tP(t,e[n]);return t}function tP(e,t){let n;for(n in t){const i=(X_.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){X_.call(i,o)||(i[o]=[]);const c=l[o];nP(i[o],Array.isArray(c)?c:c?[c]:[])}}}function nP(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ua(e,0,0,r)}const rP={tokenize:uP,partial:!0},E3={tokenize:cP,partial:!0},_3={tokenize:dP,partial:!0},T3={tokenize:fP,partial:!0},aP={tokenize:hP,partial:!0},v3={name:"wwwAutolink",tokenize:lP,previous:w3},k3={name:"protocolAutolink",tokenize:oP,previous:C3},si={name:"emailAutolink",tokenize:iP,previous:S3},_s={};function sP(){return{text:_s}}let Ml=48;for(;Ml<123;)_s[Ml]=si,Ml++,Ml===58?Ml=65:Ml===91&&(Ml=97);_s[43]=si;_s[45]=si;_s[46]=si;_s[95]=si;_s[72]=[si,k3];_s[104]=[si,k3];_s[87]=[si,v3];_s[119]=[si,v3];function iP(e,t,n){const r=this;let i,l;return o;function o(g){return!Fg(g)||!S3.call(r,r.previous)||nb(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return Fg(g)?(e.consume(g),c):g===64?(e.consume(g),d):n(g)}function d(g){return g===46?e.check(aP,p,m)(g):g===45||g===95||Nr(g)?(l=!0,e.consume(g),d):p(g)}function m(g){return e.consume(g),i=!0,d}function p(g){return l&&i&&Mr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function lP(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!w3.call(r,r.previous)||nb(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rP,e.attempt(E3,e.attempt(_3,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function oP(e,t,n){const r=this;let i="",l=!1;return o;function o(g){return(g===72||g===104)&&C3.call(r,r.previous)&&!nb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(Mr(g)&&i.length<5)return i+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const y=i.toLowerCase();if(y==="http"||y==="https")return e.consume(g),d}return n(g)}function d(g){return g===47?(e.consume(g),l?m:(l=!0,d)):n(g)}function m(g){return g===null||Th(g)||gn(g)||Ql(g)||Zh(g)?n(g):e.attempt(E3,e.attempt(_3,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function uP(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function cP(e,t,n){let r,i,l;return o;function o(m){return m===46||m===95?e.check(T3,d,c)(m):m===null||gn(m)||Ql(m)||m!==45&&Zh(m)?d(m):(l=!0,e.consume(m),o)}function c(m){return m===95?r=!0:(i=r,r=void 0),e.consume(m),o}function d(m){return i||r||!l?n(m):t(m)}}function dP(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(T3,t,l)(o):o===null||gn(o)||Ql(o)?t(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function fP(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),l):c===93?(e.consume(c),i):c===60||c===null||gn(c)||Ql(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||gn(c)||Ql(c)?t(c):r(c)}function l(c){return Mr(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),r):Mr(c)?(e.consume(c),o):n(c)}}function hP(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return Nr(l)?n(l):t(l)}}function w3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gn(e)}function C3(e){return!Mr(e)}function S3(e){return!(e===47||Fg(e))}function Fg(e){return e===43||e===45||e===46||e===95||Nr(e)}function nb(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 xu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Nr(e.charCodeAt(n+1))&&Nr(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),i=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Jh(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const $g={name:"attention",resolveAll:mP,tokenize:pP};function mP(e,t){let n=-1,r,i,l,o,c,d,m,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},y={...e[n][1].start};K_(g,-d),K_(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=Aa(m,[["enter",e[r][1],t],["exit",e[r][1],t]])),m=Aa(m,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",l,t]]),m=Aa(m,Jh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),m=Aa(m,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,m=Aa(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ua(e,r-1,n-r+3,m),n=r+m.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function pP(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=su(r);let l;return o;function o(d){return l=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===l)return e.consume(d),c;const m=e.exit("attentionSequence"),p=su(d),g=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return m._open=!!(l===42?g:g&&(i||!y)),m._close=!!(l===42?y:y&&(p||!g)),t(d)}}function K_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const gP={name:"autolink",tokenize:bP};function bP(e,t,n){let r=0;return i;function i(E){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(E){return Mr(E)?(e.consume(E),o):E===64?n(E):m(E)}function o(E){return E===43||E===45||E===46||Nr(E)?(r=1,c(E)):m(E)}function c(E){return E===58?(e.consume(E),r=0,d):(E===43||E===45||E===46||Nr(E))&&r++<32?(e.consume(E),c):(r=0,m(E))}function d(E){return E===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):E===null||E===32||E===60||Th(E)?n(E):(e.consume(E),d)}function m(E){return E===64?(e.consume(E),p):xM(E)?(e.consume(E),m):n(E)}function p(E){return Nr(E)?g(E):n(E)}function g(E){return E===46?(e.consume(E),r=0,p):E===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):y(E)}function y(E){if((E===45||Nr(E))&&r++<63){const v=E===45?y:g;return e.consume(E),v}return n(E)}}function Ft(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(d){return jt(d)?(e.enter(n),c(d)):t(d)}function c(d){return jt(d)&&l++<i?(e.consume(d),c):(e.exit(n),t(d))}}const ad={partial:!0,tokenize:xP};function xP(e,t,n){return r;function r(l){return jt(l)?Ft(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||it(l)?t(l):n(l)}}const N3={continuation:{tokenize:EP},exit:_P,name:"blockQuote",tokenize:yP};function yP(e,t,n){const r=this;return i;function i(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return jt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function EP(e,t,n){const r=this;return i;function i(o){return jt(o)?Ft(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(N3,t,n)(o)}}function _P(e){e.exit("blockQuote")}const A3={name:"characterEscape",tokenize:TP};function TP(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return EM(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const R3={name:"characterReference",tokenize:vP};function vP(e,t,n){const r=this;let i=0,l,o;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,o=Nr,p(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=yM,p):(e.enter("characterReferenceValue"),l=7,o=zg,p(g))}function p(g){if(g===59&&i){const y=e.exit("characterReferenceValue");return o===Nr&&!tb(r.sliceSerialize(y))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(g)&&i++<l?(e.consume(g),p):n(g)}}const Z_={partial:!0,tokenize:wP},J_={concrete:!0,name:"codeFenced",tokenize:kP};function kP(e,t,n){const r=this,i={partial:!0,tokenize:Y};let l=0,o=0,c;return d;function d(U){return m(U)}function m(U){const P=r.events[r.events.length-1];return l=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,c=U,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(U)}function p(U){return U===c?(o++,e.consume(U),p):o<3?n(U):(e.exit("codeFencedFenceSequence"),jt(U)?Ft(e,g,"whitespace")(U):g(U))}function g(U){return U===null||it(U)?(e.exit("codeFencedFence"),r.interrupt?t(U):e.check(Z_,w,M)(U)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(U))}function y(U){return U===null||it(U)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(U)):jt(U)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ft(e,E,"whitespace")(U)):U===96&&U===c?n(U):(e.consume(U),y)}function E(U){return U===null||it(U)?g(U):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(U))}function v(U){return U===null||it(U)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(U)):U===96&&U===c?n(U):(e.consume(U),v)}function w(U){return e.attempt(i,M,C)(U)}function C(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),S}function S(U){return l>0&&jt(U)?Ft(e,N,"linePrefix",l+1)(U):N(U)}function N(U){return U===null||it(U)?e.check(Z_,w,M)(U):(e.enter("codeFlowValue"),R(U))}function R(U){return U===null||it(U)?(e.exit("codeFlowValue"),N(U)):(e.consume(U),R)}function M(U){return e.exit("codeFenced"),t(U)}function Y(U,P,q){let le=0;return X;function X(ne){return U.enter("lineEnding"),U.consume(ne),U.exit("lineEnding"),fe}function fe(ne){return U.enter("codeFencedFence"),jt(ne)?Ft(U,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):F(ne)}function F(ne){return ne===c?(U.enter("codeFencedFenceSequence"),Te(ne)):q(ne)}function Te(ne){return ne===c?(le++,U.consume(ne),Te):le>=o?(U.exit("codeFencedFenceSequence"),jt(ne)?Ft(U,me,"whitespace")(ne):me(ne)):q(ne)}function me(ne){return ne===null||it(ne)?(U.exit("codeFencedFence"),P(ne)):q(ne)}}}function wP(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const F0={name:"codeIndented",tokenize:SP},CP={partial:!0,tokenize:NP};function SP(e,t,n){const r=this;return i;function i(m){return e.enter("codeIndented"),Ft(e,l,"linePrefix",5)(m)}function l(m){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(m):n(m)}function o(m){return m===null?d(m):it(m)?e.attempt(CP,o,d)(m):(e.enter("codeFlowValue"),c(m))}function c(m){return m===null||it(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),c)}function d(m){return e.exit("codeIndented"),t(m)}}function NP(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ft(e,l,"linePrefix",5)(o)}function l(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):it(o)?i(o):n(o)}}const AP={name:"codeText",previous:LP,resolve:RP,tokenize:IP};function RP(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function LP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function IP(e,t,n){let r=0,i,l;return o;function o(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(l=e.enter("codeTextSequence"),i=0,p(g)):it(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||it(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),m)}function p(g){return g===96?(e.consume(g),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",m(g))}}class OP{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&hc(this.left,r),l.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),hc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),hc(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);hc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);hc(this.left,n.reverse())}}}function hc(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 L3(e){const t={};let n=-1,r,i,l,o,c,d,m;const p=new OP(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,DP(p,n)),n=t[n],m=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(o=p.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return ua(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!m}function DP(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,d=[],m={};let p,g,y=-1,E=n,v=0,w=0;const C=[w];for(;E;){for(;e.get(++i)[1]!==E;);l.push(i),E._tokenizer||(p=r.sliceStream(E),E.next||p.push(null),g&&o.defineSkip(E.start),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),g=E,E=E.next}for(E=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(w=y+1,C.push(w),E._tokenizer=void 0,E.previous=void 0,E=E.next);for(o.events=[],E?(E._tokenizer=void 0,E.previous=void 0):C.pop(),y=C.length;y--;){const S=c.slice(C[y],C[y+1]),N=l.pop();d.push([N,N+S.length-1]),e.splice(N,2,S)}for(d.reverse(),y=-1;++y<d.length;)m[v+d[y][0]]=v+d[y][1],v+=d[y][1]-d[y][0]-1;return m}const jP={resolve:PP,tokenize:BP},MP={partial:!0,tokenize:UP};function PP(e){return L3(e),e}function BP(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?l(c):it(c)?e.check(MP,o,l)(c):(e.consume(c),i)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function UP(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ft(e,l,"linePrefix")}function l(o){if(o===null||it(o))return n(o);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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function I3(e,t,n,r,i,l,o,c,d){const m=d||Number.POSITIVE_INFINITY;let p=0;return g;function g(S){return S===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||Th(S)?n(S):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),E(S))}function E(S){return S===62?(e.exit("chunkString"),e.exit(c),y(S)):S===null||S===60||it(S)?n(S):(e.consume(S),S===92?v:E)}function v(S){return S===60||S===62||S===92?(e.consume(S),E):E(S)}function w(S){return!p&&(S===null||S===41||gn(S))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(S)):p<m&&S===40?(e.consume(S),p++,w):S===41?(e.consume(S),p--,w):S===null||S===32||S===40||Th(S)?n(S):(e.consume(S),S===92?C:w)}function C(S){return S===40||S===41||S===92?(e.consume(S),w):w(S)}}function O3(e,t,n,r,i,l){const o=this;let c=0,d;return m;function m(E){return e.enter(r),e.enter(i),e.consume(E),e.exit(i),e.enter(l),p}function p(E){return c>999||E===null||E===91||E===93&&!d||E===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(E):E===93?(e.exit(l),e.enter(i),e.consume(E),e.exit(i),e.exit(r),t):it(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||E===91||E===93||it(E)||c++>999?(e.exit("chunkString"),p(E)):(e.consume(E),d||(d=!jt(E)),E===92?y:g)}function y(E){return E===91||E===92||E===93?(e.consume(E),c++,g):g(E)}}function D3(e,t,n,r,i,l){let o;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(l),m(y))}function m(y){return y===o?(e.exit(l),d(o)):y===null?n(y):it(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Ft(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||it(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?g:p)}function g(y){return y===o||y===92?(e.consume(y),p):p(y)}}function Dc(e,t){let n;return r;function r(i){return it(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):jt(i)?Ft(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const HP={name:"definition",tokenize:FP},zP={partial:!0,tokenize:$P};function FP(e,t,n){const r=this;let i;return l;function l(E){return e.enter("definition"),o(E)}function o(E){return O3.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(E)}function c(E){return i=Ka(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),d):n(E)}function d(E){return gn(E)?Dc(e,m)(E):m(E)}function m(E){return I3(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(E)}function p(E){return e.attempt(zP,g,g)(E)}function g(E){return jt(E)?Ft(e,y,"whitespace")(E):y(E)}function y(E){return E===null||it(E)?(e.exit("definition"),r.parser.defined.push(i),t(E)):n(E)}}function $P(e,t,n){return r;function r(c){return gn(c)?Dc(e,i)(c):n(c)}function i(c){return D3(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return jt(c)?Ft(e,o,"whitespace")(c):o(c)}function o(c){return c===null||it(c)?t(c):n(c)}}const VP={name:"hardBreakEscape",tokenize:GP};function GP(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return it(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const qP={name:"headingAtx",resolve:YP,tokenize:WP};function YP(e,t){let n=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ua(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function WP(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||gn(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||it(p)?(e.exit("atxHeading"),t(p)):jt(p)?Ft(e,c,"whitespace")(p):(e.enter("atxHeadingText"),m(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function m(p){return p===null||p===35||gn(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),m)}}const QP=["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"],eT=["pre","script","style","textarea"],XP={concrete:!0,name:"htmlFlow",resolveTo:JP,tokenize:eB},KP={partial:!0,tokenize:nB},ZP={partial:!0,tokenize:tB};function JP(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 eB(e,t,n){const r=this;let i,l,o,c,d;return m;function m(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),l=!0,w):O===63?(e.consume(O),i=3,r.interrupt?t:A):Mr(O)?(e.consume(O),o=String.fromCharCode(O),C):n(O)}function y(O){return O===45?(e.consume(O),i=2,E):O===91?(e.consume(O),i=5,c=0,v):Mr(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function E(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function v(O){const ve="CDATA[";return O===ve.charCodeAt(c++)?(e.consume(O),c===ve.length?r.interrupt?t:F:v):n(O)}function w(O){return Mr(O)?(e.consume(O),o=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||gn(O)){const ve=O===47,Re=o.toLowerCase();return!ve&&!l&&eT.includes(Re)?(i=1,r.interrupt?t(O):F(O)):QP.includes(o.toLowerCase())?(i=6,ve?(e.consume(O),S):r.interrupt?t(O):F(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):l?N(O):R(O))}return O===45||Nr(O)?(e.consume(O),o+=String.fromCharCode(O),C):n(O)}function S(O){return O===62?(e.consume(O),r.interrupt?t:F):n(O)}function N(O){return jt(O)?(e.consume(O),N):X(O)}function R(O){return O===47?(e.consume(O),X):O===58||O===95||Mr(O)?(e.consume(O),M):jt(O)?(e.consume(O),R):X(O)}function M(O){return O===45||O===46||O===58||O===95||Nr(O)?(e.consume(O),M):Y(O)}function Y(O){return O===61?(e.consume(O),U):jt(O)?(e.consume(O),Y):R(O)}function U(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,P):jt(O)?(e.consume(O),U):q(O)}function P(O){return O===d?(e.consume(O),d=null,le):O===null||it(O)?n(O):(e.consume(O),P)}function q(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||gn(O)?Y(O):(e.consume(O),q)}function le(O){return O===47||O===62||jt(O)?R(O):n(O)}function X(O){return O===62?(e.consume(O),fe):n(O)}function fe(O){return O===null||it(O)?F(O):jt(O)?(e.consume(O),fe):n(O)}function F(O){return O===45&&i===2?(e.consume(O),$):O===60&&i===1?(e.consume(O),z):O===62&&i===4?(e.consume(O),H):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),ce):it(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(KP,te,Te)(O)):O===null||it(O)?(e.exit("htmlFlowData"),Te(O)):(e.consume(O),F)}function Te(O){return e.check(ZP,me,te)(O)}function me(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ne}function ne(O){return O===null||it(O)?Te(O):(e.enter("htmlFlowData"),F(O))}function $(O){return O===45?(e.consume(O),A):F(O)}function z(O){return O===47?(e.consume(O),o="",Z):F(O)}function Z(O){if(O===62){const ve=o.toLowerCase();return eT.includes(ve)?(e.consume(O),H):F(O)}return Mr(O)&&o.length<8?(e.consume(O),o+=String.fromCharCode(O),Z):F(O)}function ce(O){return O===93?(e.consume(O),A):F(O)}function A(O){return O===62?(e.consume(O),H):O===45&&i===2?(e.consume(O),A):F(O)}function H(O){return O===null||it(O)?(e.exit("htmlFlowData"),te(O)):(e.consume(O),H)}function te(O){return e.exit("htmlFlow"),t(O)}}function tB(e,t,n){const r=this;return i;function i(o){return it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function nB(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ad,t,n)}}const rB={name:"htmlText",tokenize:aB};function aB(e,t,n){const r=this;let i,l,o;return c;function c(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),Y):A===63?(e.consume(A),R):Mr(A)?(e.consume(A),q):n(A)}function m(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),l=0,v):Mr(A)?(e.consume(A),N):n(A)}function p(A){return A===45?(e.consume(A),E):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),y):it(A)?(o=g,z(A)):(e.consume(A),g)}function y(A){return A===45?(e.consume(A),E):g(A)}function E(A){return A===62?$(A):A===45?y(A):g(A)}function v(A){const H="CDATA[";return A===H.charCodeAt(l++)?(e.consume(A),l===H.length?w:v):n(A)}function w(A){return A===null?n(A):A===93?(e.consume(A),C):it(A)?(o=w,z(A)):(e.consume(A),w)}function C(A){return A===93?(e.consume(A),S):w(A)}function S(A){return A===62?$(A):A===93?(e.consume(A),S):w(A)}function N(A){return A===null||A===62?$(A):it(A)?(o=N,z(A)):(e.consume(A),N)}function R(A){return A===null?n(A):A===63?(e.consume(A),M):it(A)?(o=R,z(A)):(e.consume(A),R)}function M(A){return A===62?$(A):R(A)}function Y(A){return Mr(A)?(e.consume(A),U):n(A)}function U(A){return A===45||Nr(A)?(e.consume(A),U):P(A)}function P(A){return it(A)?(o=P,z(A)):jt(A)?(e.consume(A),P):$(A)}function q(A){return A===45||Nr(A)?(e.consume(A),q):A===47||A===62||gn(A)?le(A):n(A)}function le(A){return A===47?(e.consume(A),$):A===58||A===95||Mr(A)?(e.consume(A),X):it(A)?(o=le,z(A)):jt(A)?(e.consume(A),le):$(A)}function X(A){return A===45||A===46||A===58||A===95||Nr(A)?(e.consume(A),X):fe(A)}function fe(A){return A===61?(e.consume(A),F):it(A)?(o=fe,z(A)):jt(A)?(e.consume(A),fe):le(A)}function F(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,Te):it(A)?(o=F,z(A)):jt(A)?(e.consume(A),F):(e.consume(A),me)}function Te(A){return A===i?(e.consume(A),i=void 0,ne):A===null?n(A):it(A)?(o=Te,z(A)):(e.consume(A),Te)}function me(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||gn(A)?le(A):(e.consume(A),me)}function ne(A){return A===47||A===62||gn(A)?le(A):n(A)}function $(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function z(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),Z}function Z(A){return jt(A)?Ft(e,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):ce(A)}function ce(A){return e.enter("htmlTextData"),o(A)}}const rb={name:"labelEnd",resolveAll:oB,resolveTo:uB,tokenize:cB},sB={tokenize:dB},iB={tokenize:fB},lB={tokenize:hB};function oB(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ua(e,0,e.length,n),e}function uB(e,t){let n=e.length,r=0,i,l,o,c;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",d,t],["enter",m,t]],c=Aa(c,e.slice(l+1,l+r+3)),c=Aa(c,[["enter",p,t]]),c=Aa(c,Jh(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),c=Aa(c,[["exit",p,t],e[o-2],e[o-1],["exit",m,t]]),c=Aa(c,e.slice(o+1)),c=Aa(c,[["exit",d,t]]),ua(e,l,e.length,c),e}function cB(e,t,n){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return c;function c(y){return l?l._inactive?g(y):(o=r.parser.defined.includes(Ka(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(sB,p,o?p:g)(y):y===91?e.attempt(iB,p,o?m:g)(y):o?p(y):g(y)}function m(y){return e.attempt(lB,p,g)(y)}function p(y){return t(y)}function g(y){return l._balanced=!0,n(y)}}function dB(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),i}function i(g){return gn(g)?Dc(e,l)(g):l(g)}function l(g){return g===41?p(g):I3(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function o(g){return gn(g)?Dc(e,d)(g):p(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?D3(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function m(g){return gn(g)?Dc(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function fB(e,t,n){const r=this;return i;function i(c){return O3.call(r,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return r.parser.defined.includes(Ka(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function hB(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const mB={name:"labelStartImage",resolveAll:rb.resolveAll,tokenize:pB};function pB(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const gB={name:"labelStartLink",resolveAll:rb.resolveAll,tokenize:bB};function bB(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const $0={name:"lineEnding",tokenize:xB};function xB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ft(e,t,"linePrefix")}}const nh={name:"thematicBreak",tokenize:yB};function yB(e,t,n){let r=0,i;return l;function l(m){return e.enter("thematicBreak"),o(m)}function o(m){return i=m,c(m)}function c(m){return m===i?(e.enter("thematicBreakSequence"),d(m)):r>=3&&(m===null||it(m))?(e.exit("thematicBreak"),t(m)):n(m)}function d(m){return m===i?(e.consume(m),r++,d):(e.exit("thematicBreakSequence"),jt(m)?Ft(e,c,"whitespace")(m):c(m))}}const Yr={continuation:{tokenize:vB},exit:wB,name:"list",tokenize:TB},EB={partial:!0,tokenize:CB},_B={partial:!0,tokenize:kB};function TB(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return c;function c(E){const v=r.containerState.type||(E===42||E===43||E===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||E===r.containerState.marker:zg(E)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),E===42||E===45?e.check(nh,n,m)(E):m(E);if(!r.interrupt||E===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(E)}return n(E)}function d(E){return zg(E)&&++o<10?(e.consume(E),d):(!r.interrupt||o<2)&&(r.containerState.marker?E===r.containerState.marker:E===41||E===46)?(e.exit("listItemValue"),m(E)):n(E)}function m(E){return e.enter("listItemMarker"),e.consume(E),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||E,e.check(ad,r.interrupt?n:p,e.attempt(EB,y,g))}function p(E){return r.containerState.initialBlankLine=!0,l++,y(E)}function g(E){return jt(E)?(e.enter("listItemPrefixWhitespace"),e.consume(E),e.exit("listItemPrefixWhitespace"),y):n(E)}function y(E){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(E)}}function vB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ad,i,l);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ft(e,t,"listItemIndent",r.containerState.size+1)(c)}function l(c){return r.containerState.furtherBlankLines||!jt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(_B,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ft(e,e.attempt(Yr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function kB(e,t,n){const r=this;return Ft(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function wB(e){e.exit(this.containerState.type)}function CB(e,t,n){const r=this;return Ft(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!jt(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const tT={name:"setextUnderline",resolveTo:SB,tokenize:NB};function SB(e,t){let n=e.length,r,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function NB(e,t,n){const r=this;let i;return l;function l(m){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),i=m,o(m)):n(m)}function o(m){return e.enter("setextHeadingLineSequence"),c(m)}function c(m){return m===i?(e.consume(m),c):(e.exit("setextHeadingLineSequence"),jt(m)?Ft(e,d,"lineSuffix")(m):d(m))}function d(m){return m===null||it(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const AB={tokenize:PB,partial:!0};function RB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:DB,continuation:{tokenize:jB},exit:MB}},text:{91:{name:"gfmFootnoteCall",tokenize:OB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:LB,resolveTo:IB}}}}function LB(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const d=r.events[i][1];if(d.type==="labelImage"){o=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!o||!o._balanced)return n(d);const m=Ka(r.sliceSerialize({start:o.end,end:r.now()}));return m.codePointAt(0)!==94||!l.includes(m.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function IB(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function OB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(g){if(l>999||g===93&&!o||g===null||g===91||gn(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return i.includes(Ka(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return gn(g)||(o=!0),l++,e.consume(g),g===92?p:m}function p(g){return g===91||g===92||g===93?(e.consume(g),l++,m):m(g)}}function DB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,c;return d;function d(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(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(o>999||v===93&&!c||v===null||v===91||gn(v))return n(v);if(v===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=Ka(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return gn(v)||(c=!0),o++,e.consume(v),v===92?g:p}function g(v){return v===91||v===92||v===93?(e.consume(v),o++,p):p(v)}function y(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(l)||i.push(l),Ft(e,E,"gfmFootnoteDefinitionWhitespace")):n(v)}function E(v){return t(v)}}function jB(e,t,n){return e.check(ad,t,e.attempt(AB,t,n))}function MB(e){e.exit("gfmFootnoteDefinition")}function PB(e,t,n){const r=this;return Ft(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function BB(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,c){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let m=d;for(;m--;)if(o[m][0]==="exit"&&o[m][1].type==="strikethroughSequenceTemporary"&&o[m][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[m][1].end.offset-o[m][1].start.offset){o[d][1].type="strikethroughSequence",o[m][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[m][1].start),end:Object.assign({},o[d][1].end)},g={type:"strikethroughText",start:Object.assign({},o[m][1].end),end:Object.assign({},o[d][1].start)},y=[["enter",p,c],["enter",o[m][1],c],["exit",o[m][1],c],["enter",g,c]],E=c.parser.constructs.insideSpan.null;E&&ua(y,y.length,0,Jh(E,o.slice(m+1,d),c)),ua(y,y.length,0,[["exit",g,c],["enter",o[d][1],c],["exit",o[d][1],c],["exit",p,c]]),ua(o,m-1,d-m+3,y),d=m+y.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function l(o,c,d){const m=this.previous,p=this.events;let g=0;return y;function y(v){return m===126&&p[p.length-1][1].type!=="characterEscape"?d(v):(o.enter("strikethroughSequenceTemporary"),E(v))}function E(v){const w=su(m);if(v===126)return g>1?d(v):(o.consume(v),g++,E);if(g<2&&!n)return d(v);const C=o.exit("strikethroughSequenceTemporary"),S=su(v);return C._open=!S||S===2&&!!w,C._close=!w||w===2&&!!S,c(v)}}}class UB{constructor(){this.map=[]}add(t,n,r){HB(this,t,n,r)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0}}function HB(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function zB(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function FB(){return{flow:{null:{name:"table",tokenize:$B,resolveAll:VB}}}}function $B(e,t,n){const r=this;let i=0,l=0,o;return c;function c(X){let fe=r.events.length-1;for(;fe>-1;){const me=r.events[fe][1].type;if(me==="lineEnding"||me==="linePrefix")fe--;else break}const F=fe>-1?r.events[fe][1].type:null,Te=F==="tableHead"||F==="tableRow"?U:d;return Te===U&&r.parser.lazy[r.now().line]?n(X):Te(X)}function d(X){return e.enter("tableHead"),e.enter("tableRow"),m(X)}function m(X){return X===124||(o=!0,l+=1),p(X)}function p(X){return X===null?n(X):it(X)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(X),e.exit("lineEnding"),E):n(X):jt(X)?Ft(e,p,"whitespace")(X):(l+=1,o&&(o=!1,i+=1),X===124?(e.enter("tableCellDivider"),e.consume(X),e.exit("tableCellDivider"),o=!0,p):(e.enter("data"),g(X)))}function g(X){return X===null||X===124||gn(X)?(e.exit("data"),p(X)):(e.consume(X),X===92?y:g)}function y(X){return X===92||X===124?(e.consume(X),g):g(X)}function E(X){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(X):(e.enter("tableDelimiterRow"),o=!1,jt(X)?Ft(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):v(X))}function v(X){return X===45||X===58?C(X):X===124?(o=!0,e.enter("tableCellDivider"),e.consume(X),e.exit("tableCellDivider"),w):Y(X)}function w(X){return jt(X)?Ft(e,C,"whitespace")(X):C(X)}function C(X){return X===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(X),e.exit("tableDelimiterMarker"),S):X===45?(l+=1,S(X)):X===null||it(X)?M(X):Y(X)}function S(X){return X===45?(e.enter("tableDelimiterFiller"),N(X)):Y(X)}function N(X){return X===45?(e.consume(X),N):X===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(X),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(X))}function R(X){return jt(X)?Ft(e,M,"whitespace")(X):M(X)}function M(X){return X===124?v(X):X===null||it(X)?!o||i!==l?Y(X):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(X)):Y(X)}function Y(X){return n(X)}function U(X){return e.enter("tableRow"),P(X)}function P(X){return X===124?(e.enter("tableCellDivider"),e.consume(X),e.exit("tableCellDivider"),P):X===null||it(X)?(e.exit("tableRow"),t(X)):jt(X)?Ft(e,P,"whitespace")(X):(e.enter("data"),q(X))}function q(X){return X===null||X===124||gn(X)?(e.exit("data"),P(X)):(e.consume(X),X===92?le:q)}function le(X){return X===92||X===124?(e.consume(X),q):q(X)}}function VB(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,d=0,m,p,g;const y=new UB;for(;++n<e.length;){const E=e[n],v=E[1];E[0]==="enter"?v.type==="tableHead"?(c=!1,d!==0&&(nT(y,t,d,m,p),p=void 0,d=0),m={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(n,0,[["enter",m,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,g=void 0,l=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(n,0,[["enter",p,t]])),i=v.type==="tableDelimiterRow"?2:p?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],g=Rf(y,t,l,i,void 0,g),l=[0,0,0,0]),o[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],g=Rf(y,t,l,i,void 0,g)),l=o,o=[l[1],n,0,0])):v.type==="tableHead"?(c=!0,d=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(d=n,l[1]!==0?(o[0]=o[1],g=Rf(y,t,l,i,n,g)):o[1]!==0&&(g=Rf(y,t,o,i,n,g)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(o[3]=n)}for(d!==0&&nT(y,t,d,m,p),y.consume(t.events),n=-1;++n<t.events.length;){const E=t.events[n];E[0]==="enter"&&E[1].type==="table"&&(E[1]._align=zB(t.events,n))}return e}function Rf(e,t,n,r,i,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},Wo(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const d=Wo(t.events,n[1]);if(l={type:o,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const m=Wo(t.events,n[2]),p=Wo(t.events,n[3]),g={type:c,start:Object.assign({},m),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const y=t.events[n[2]],E=t.events[n[3]];if(y[1].end=Object.assign({},E[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,w=n[3]-n[2]-1;e.add(v,w,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return i!==void 0&&(l.end=Object.assign({},Wo(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function nT(e,t,n,r,i){const l=[],o=Wo(t.events,n);i&&(i.end=Object.assign({},o),l.push(["exit",i,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function Wo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const GB={name:"tasklistCheck",tokenize:YB};function qB(){return{text:{91:GB}}}function YB(e,t,n){const r=this;return i;function i(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),l)}function l(d){return gn(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),o):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),o):n(d)}function o(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return it(d)?t(d):jt(d)?e.check({tokenize:WB},t,n)(d):n(d)}}function WB(e,t,n){return Ft(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function QB(e){return y3([sP(),RB(),BB(e),FB(),qB()])}const XB={};function KB(e){const t=this,n=e||XB,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(QB(n)),l.push(J7()),o.push(eP(n))}var ZB=Object.defineProperty,JB=Object.defineProperties,eU=Object.getOwnPropertyDescriptors,rT=Object.getOwnPropertySymbols,tU=Object.prototype.hasOwnProperty,nU=Object.prototype.propertyIsEnumerable,aT=(e,t,n)=>t in e?ZB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j3=(e,t)=>{for(var n in t||(t={}))tU.call(t,n)&&aT(e,n,t[n]);if(rT)for(var n of rT(t))nU.call(t,n)&&aT(e,n,t[n]);return e},M3=(e,t)=>JB(e,eU(t)),Br=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},rU=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},aU=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!rU(e,n)&&(t+=1)}return t},Zi=(e,t)=>{let n=!1,r=!1,i=-1;for(let l=0;l<e.length;l+=1){if(e[l]==="\\"&&l+1<e.length&&e[l+1]==="`"){l+=1;continue}if(e.substring(l,l+3)==="```"){r=!r,l+=2;continue}if(!r&&e[l]==="`")if(n){if(i<t&&t<l)return!0;n=!1,i=-1}else n=!0,i=l}return!1},sU=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,iU=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(sU,(t,n,r,i)=>Br(e,i)?t:`${n}\\>${r}`),lU=/(\*\*)([^*]*\*?)$/,oU=/(__)([^_]*?)$/,uU=/(\*\*\*)([^*]*?)$/,cU=/(\*)([^*]*?)$/,dU=/(_)([^_]*?)$/,fU=/(`)([^`]*?)$/,hU=/(~~)([^~]*?)$/,eo=/^[\s_~*`]*$/,P3=/^[\s]*[-*+][\s]+$/,mU=/[\p{L}\p{N}_]/u,pU=/^```[^`\n]*```?$/,gU=/^\*{4,}$/,bU=/(__)([^_]+)_$/,xU=/(~~)([^~]+)~$/,sT=/~~/g,Ji=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:mU.test(e)},yU=(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},B3=(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},em=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},EU=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
260
|
-
`)return!1}return!1},U3=(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]==="]"?EU(e,t):!1;if(e[n]===`
|
|
261
|
-
`)return!1}return!1},_U=(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]===`
|
|
262
|
-
`)return!1}return!1},ab=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
|
|
263
|
-
`){r=d+1;break}let i=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
|
|
264
|
-
`){i=d;break}let l=e.substring(r,i),o=0,c=!1;for(let d of l)if(d===n)o+=1;else if(d!==" "&&d!==" "){c=!0;break}return o>=3&&!c},TU=(e,t,n,r)=>n==="\\"||e.includes("$")&&em(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&Ji(n)&&Ji(r)||(!n||n===" "||n===" "||n===`
|
|
265
|
-
`)&&(!r||r===" "||r===" "||r===`
|
|
266
|
-
`)),H3=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let l=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";TU(e,i,l,o)||(t+=1)}return t},vU=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&em(e,t)||U3(e,t)||_U(e,t)||n==="_"||r==="_"||n&&r&&Ji(n)&&Ji(r)),kU=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let l=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";vU(e,i,l,o)||(t+=1)}return t},wU=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},sb=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},iT=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},CU=(e,t,n)=>{if(!t||eo.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
267
|
-
`),i=r===-1?0:r+1,l=e.substring(i,n);return P3.test(l)&&t.includes(`
|
|
268
|
-
`)?!0:ab(e,n,"*")},SU=e=>{let t=e.match(lU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Br(e,r)||Zi(e,r)||CU(e,n,r)?e:sb(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},NU=(e,t,n)=>{if(!t||eo.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
269
|
-
`),i=r===-1?0:r+1,l=e.substring(i,n);return P3.test(l)&&t.includes(`
|
|
270
|
-
`)?!0:ab(e,n,"_")},AU=e=>{let t=e.match(oU);if(!t){let i=e.match(bU);if(i){let l=e.lastIndexOf(i[1]);if(!(Br(e,l)||Zi(e,l))&&iT(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Br(e,r)||Zi(e,r)||NU(e,n,r)?e:iT(e)%2===1?`${e}__`:e},RU=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]!=="\\"&&!em(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
|
|
271
|
-
`)&&(!i||i===" "||i===" "||i===`
|
|
272
|
-
`)||r&&i&&Ji(r)&&Ji(i))continue;return n}}return-1},LU=e=>{if(!e.match(cU))return e;let t=RU(e);if(t===-1||Br(e,t)||Zi(e,t))return e;let n=e.substring(t+1);return!n||eo.test(n)?e:H3(e)%2===1?`${e}*`:e},z3=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]!=="\\"&&!em(e,n)&&!U3(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&Ji(r)&&Ji(i))continue;return n}}return-1},IU=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
273
|
-
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},OU=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(sb(t)%2!==1)return null;let n=t.indexOf("**"),r=z3(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},DU=e=>{if(!e.match(dU))return e;let t=z3(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||eo.test(n)||Br(e,t)||Zi(e,t))return e;if(kU(e)%2===1){let r=OU(e);return r!==null?r:IU(e)}return e},jU=e=>{let t=sb(e),n=H3(e);return t%2===0&&n%2===0},MU=(e,t,n)=>!t||eo.test(t)||Br(e,n)||Zi(e,n)?!0:ab(e,n,"*"),PU=e=>{if(gU.test(e))return e;let t=e.match(uU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return MU(e,n,r)?e:wU(e)%2===1?jU(e)?e:`${e}***`:e},BU=/<[a-zA-Z/][^>]*$/,UU=e=>{let t=e.match(BU);return!t||t.index===void 0||Br(e,t.index)?e:e.substring(0,t.index).trimEnd()},HU=e=>!e.match(pU)||e.includes(`
|
|
274
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,zU=e=>(e.match(/```/g)||[]).length%2===1,FU=e=>{let t=HU(e);if(t!==null)return t;let n=e.match(fU);if(n&&!zU(e)){let r=n[2];if(!r||eo.test(r))return e;if(aU(e)%2===1)return`${e}\``}return e},F3=(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)==="```",$U=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!F3(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},VU=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!F3(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},GU=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
275
|
-
`,t)!==-1&&!e.endsWith(`
|
|
276
|
-
`)?`${e}
|
|
277
|
-
$$`:`${e}$$`},qU=e=>$U(e)%2===0?e:GU(e),YU=e=>VU(e)%2===1?`${e}$`:e,WU=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=yU(e,t);if(r===-1||Br(e,r))return null;let i=r>0&&e[r-1]==="!",l=i?r-1:r,o=e.substring(0,l);if(i)return o;let c=e.substring(r+1,t);return n==="text-only"?`${o}${c}`:`${o}[${c}](streamdown:incomplete-link)`},lT=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Br(e,n)){if(n>0&&e[n-1]==="!")continue;let r=B3(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},QU=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let l=e.substring(0,i);if(r)return l;if(n==="text-only"){let o=lT(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(B3(e,t)===-1){let l=e.substring(0,i);if(r)return l;if(n==="text-only"){let o=lT(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},$3=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Br(e,n)){let r=WU(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Br(e,r)){let i=QU(e,r,t);if(i!==null)return i}return e},XU=/^-{1,2}$/,KU=/^[\s]*-{1,2}[\s]+$/,ZU=/^={1,2}$/,JU=/^[\s]*={1,2}[\s]+$/,eH=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
278
|
-
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(XU.test(i)&&!n.match(KU)){let l=r.split(`
|
|
279
|
-
`).at(-1);if(l&&l.trim().length>0)return`${e}`}if(ZU.test(i)&&!n.match(JU)){let l=r.split(`
|
|
280
|
-
`).at(-1);if(l&&l.trim().length>0)return`${e}`}return e},tH=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),nH=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(tH,(t,n)=>Br(e,n)?t:"\\~"),rH=e=>{var t,n;let r=e.match(hU);if(r){let i=r[2];if(!i||eo.test(i))return e;let l=e.lastIndexOf(r[1]);if(Br(e,l)||Zi(e,l))return e;if(((t=e.match(sT))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(xU);if(i){let l=e.lastIndexOf(i[0].slice(0,2));if(Br(e,l)||Zi(e,l))return e;if(((n=e.match(sT))==null?void 0:n.length)%2===1)return`${e}~`}}return e},V0=e=>e!==!1,aH=e=>e===!0,jr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},sH=[{handler:{name:"singleTilde",handle:nH,priority:jr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:iU,priority:jr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:UU,priority:jr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:eH,priority:jr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:$3,priority:jr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:PU,priority:jr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:SU,priority:jr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:AU,priority:jr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:LU,priority:jr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:DU,priority:jr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:FU,priority:jr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:rH,priority:jr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:qU,priority:jr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:YU,priority:jr.INLINE_KATEX},optionKey:"inlineKatex"}],iH=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return sH.filter(({handler:r,optionKey:i})=>r.name==="links"?V0(e==null?void 0:e.links)||V0(e==null?void 0:e.images):r.name==="inlineKatex"?aH(e==null?void 0:e.inlineKatex):V0(e==null?void 0:e[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:M3(j3({},r),{handle:l=>$3(l,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},lH=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=iH(t),l=((n=t==null?void 0:t.handlers)!=null?n:[]).map(c=>{var d;return{handler:M3(j3({},c),{priority:(d=c.priority)!=null?d:jr.DEFAULT}),earlyReturn:void 0}}),o=[...i,...l].sort((c,d)=>{var m,p;return((m=c.handler.priority)!=null?m:0)-((p=d.handler.priority)!=null?p:0)});for(let{handler:c,earlyReturn:d}of o)if(r=c.handle(r),d!=null&&d(r))return r;return r},oH=lH;function V3(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=V3(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function G3(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=V3(e))&&(r&&(r+=" "),r+=t);return r}const uH=(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},cH=(e,t)=>({classGroupId:e,validator:t}),q3=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),kh="-",oT=[],dH="arbitrary..",fH=e=>{const t=mH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return hH(o);const c=o.split(kh),d=c[0]===""&&c.length>1?1:0;return Y3(c,d,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const d=r[o],m=n[o];return d?m?uH(m,d):d:m||oT}return n[o]||oT}}},Y3=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],l=n.nextPart.get(i);if(l){const m=Y3(e,t+1,l);if(m)return m}const o=n.validators;if(o===null)return;const c=t===0?e.join(kh):e.slice(t).join(kh),d=o.length;for(let m=0;m<d;m++){const p=o[m];if(p.validator(c))return p.classGroupId}},hH=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?dH+r:void 0})(),mH=e=>{const{theme:t,classGroups:n}=e;return pH(n,t)},pH=(e,t)=>{const n=q3();for(const r in e){const i=e[r];ib(i,n,r,t)}return n},ib=(e,t,n,r)=>{const i=e.length;for(let l=0;l<i;l++){const o=e[l];gH(o,t,n,r)}},gH=(e,t,n,r)=>{if(typeof e=="string"){bH(e,t,n);return}if(typeof e=="function"){xH(e,t,n,r);return}yH(e,t,n,r)},bH=(e,t,n)=>{const r=e===""?t:W3(t,e);r.classGroupId=n},xH=(e,t,n,r)=>{if(EH(e)){ib(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(cH(n,e))},yH=(e,t,n,r)=>{const i=Object.entries(e),l=i.length;for(let o=0;o<l;o++){const[c,d]=i[o];ib(d,W3(t,c),n,r)}},W3=(e,t)=>{let n=e;const r=t.split(kh),i=r.length;for(let l=0;l<i;l++){const o=r[l];let c=n.nextPart.get(o);c||(c=q3(),n.nextPart.set(o,c)),n=c}return n},EH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,_H=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(l,o)=>{n[l]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let o=n[l];if(o!==void 0)return o;if((o=r[l])!==void 0)return i(l,o),o},set(l,o){l in n?n[l]=o:i(l,o)}}},Vg="!",uT=":",TH=[],cT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),vH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const l=[];let o=0,c=0,d=0,m;const p=i.length;for(let w=0;w<p;w++){const C=i[w];if(o===0&&c===0){if(C===uT){l.push(i.slice(d,w)),d=w+1;continue}if(C==="/"){m=w;continue}}C==="["?o++:C==="]"?o--:C==="("?c++:C===")"&&c--}const g=l.length===0?i:i.slice(d);let y=g,E=!1;g.endsWith(Vg)?(y=g.slice(0,-1),E=!0):g.startsWith(Vg)&&(y=g.slice(1),E=!0);const v=m&&m>d?m-d:void 0;return cT(l,E,y,v)};if(t){const i=t+uT,l=r;r=o=>o.startsWith(i)?l(o.slice(i.length)):cT(TH,!1,o,void 0,!0)}if(n){const i=r;r=l=>n({className:l,parseClassName:i})}return r},kH=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let l=0;l<n.length;l++){const o=n[l],c=o[0]==="[",d=t.has(o);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},wH=e=>({cache:_H(e.cacheSize),parseClassName:vH(e),sortModifiers:kH(e),...fH(e)}),CH=/\s+/,SH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:l}=t,o=[],c=e.trim().split(CH);let d="";for(let m=c.length-1;m>=0;m-=1){const p=c[m],{isExternal:g,modifiers:y,hasImportantModifier:E,baseClassName:v,maybePostfixModifierPosition:w}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let C=!!w,S=r(C?v.substring(0,w):v);if(!S){if(!C){d=p+(d.length>0?" "+d:d);continue}if(S=r(v),!S){d=p+(d.length>0?" "+d:d);continue}C=!1}const N=y.length===0?"":y.length===1?y[0]:l(y).join(":"),R=E?N+Vg:N,M=R+S;if(o.indexOf(M)>-1)continue;o.push(M);const Y=i(S,C);for(let U=0;U<Y.length;++U){const P=Y[U];o.push(R+P)}d=p+(d.length>0?" "+d:d)}return d},NH=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=Q3(n))&&(i&&(i+=" "),i+=r);return i},Q3=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Q3(e[r]))&&(n&&(n+=" "),n+=t);return n},AH=(e,...t)=>{let n,r,i,l;const o=d=>{const m=t.reduce((p,g)=>g(p),e());return n=wH(m),r=n.cache.get,i=n.cache.set,l=c,c(d)},c=d=>{const m=r(d);if(m)return m;const p=SH(d,n);return i(d,p),p};return l=o,(...d)=>l(NH(...d))},RH=[],sr=e=>{const t=n=>n[e]||RH;return t.isThemeGetter=!0,t},X3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,LH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,IH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OH=/\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$/,DH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bi=e=>LH.test(e),At=e=>!!e&&!Number.isNaN(Number(e)),Ui=e=>!!e&&Number.isInteger(Number(e)),G0=e=>e.endsWith("%")&&At(e.slice(0,-1)),Ks=e=>IH.test(e),Z3=()=>!0,PH=e=>OH.test(e)&&!DH.test(e),lb=()=>!1,BH=e=>jH.test(e),UH=e=>MH.test(e),HH=e=>!$e(e)&&!Ge(e),zH=e=>tl(e,tC,lb),$e=e=>X3.test(e),Pl=e=>tl(e,nC,PH),dT=e=>tl(e,QH,At),FH=e=>tl(e,aC,Z3),$H=e=>tl(e,rC,lb),fT=e=>tl(e,J3,lb),VH=e=>tl(e,eC,UH),Lf=e=>tl(e,sC,BH),Ge=e=>K3.test(e),mc=e=>to(e,nC),GH=e=>to(e,rC),hT=e=>to(e,J3),qH=e=>to(e,tC),YH=e=>to(e,eC),If=e=>to(e,sC,!0),WH=e=>to(e,aC,!0),tl=(e,t,n)=>{const r=X3.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},to=(e,t,n=!1)=>{const r=K3.exec(e);return r?r[1]?t(r[1]):n:!1},J3=e=>e==="position"||e==="percentage",eC=e=>e==="image"||e==="url",tC=e=>e==="length"||e==="size"||e==="bg-size",nC=e=>e==="length",QH=e=>e==="number",rC=e=>e==="family-name",aC=e=>e==="number"||e==="weight",sC=e=>e==="shadow",XH=()=>{const e=sr("color"),t=sr("font"),n=sr("text"),r=sr("font-weight"),i=sr("tracking"),l=sr("leading"),o=sr("breakpoint"),c=sr("container"),d=sr("spacing"),m=sr("radius"),p=sr("shadow"),g=sr("inset-shadow"),y=sr("text-shadow"),E=sr("drop-shadow"),v=sr("blur"),w=sr("perspective"),C=sr("aspect"),S=sr("ease"),N=sr("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...M(),Ge,$e],U=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],q=()=>[Ge,$e,d],le=()=>[Bi,"full","auto",...q()],X=()=>[Ui,"none","subgrid",Ge,$e],fe=()=>["auto",{span:["full",Ui,Ge,$e]},Ui,Ge,$e],F=()=>[Ui,"auto",Ge,$e],Te=()=>["auto","min","max","fr",Ge,$e],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...q()],z=()=>[Bi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...q()],Z=()=>[Bi,"screen","full","dvw","lvw","svw","min","max","fit",...q()],ce=()=>[Bi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...q()],A=()=>[e,Ge,$e],H=()=>[...M(),hT,fT,{position:[Ge,$e]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",qH,zH,{size:[Ge,$e]}],ve=()=>[G0,mc,Pl],Re=()=>["","none","full",m,Ge,$e],Ne=()=>["",At,mc,Pl],Qe=()=>["solid","dashed","dotted","double"],Ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],je=()=>[At,G0,hT,fT],tt=()=>["","none",v,Ge,$e],ut=()=>["none",At,Ge,$e],Ct=()=>["none",At,Ge,$e],en=()=>[At,Ge,$e],nt=()=>[Bi,"full",...q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ks],breakpoint:[Ks],color:[Z3],container:[Ks],"drop-shadow":[Ks],ease:["in","out","in-out"],font:[HH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ks],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ks],shadow:[Ks],spacing:["px",At],text:[Ks],"text-shadow":[Ks],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bi,$e,Ge,C]}],container:["container"],columns:[{columns:[At,$e,Ge,c]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:Y()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{"inset-s":le(),start:le()}],end:[{"inset-e":le(),end:le()}],"inset-bs":[{"inset-bs":le()}],"inset-be":[{"inset-be":le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[Ui,"auto",Ge,$e]}],basis:[{basis:[Bi,"full","auto",c,...q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,Bi,"auto","initial","none",$e]}],grow:[{grow:["",At,Ge,$e]}],shrink:[{shrink:["",At,Ge,$e]}],order:[{order:[Ui,"first","last","none",Ge,$e]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:fe()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:fe()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Te()}],"auto-rows":[{"auto-rows":Te()}],gap:[{gap:q()}],"gap-x":[{"gap-x":q()}],"gap-y":[{"gap-y":q()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:q()}],px:[{px:q()}],py:[{py:q()}],ps:[{ps:q()}],pe:[{pe:q()}],pbs:[{pbs:q()}],pbe:[{pbe:q()}],pt:[{pt:q()}],pr:[{pr:q()}],pb:[{pb:q()}],pl:[{pl:q()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":q()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...ce()]}],"min-block-size":[{"min-block":["auto",...ce()]}],"max-block-size":[{"max-block":["none",...ce()]}],w:[{w:[c,"screen",...z()]}],"min-w":[{"min-w":[c,"screen","none",...z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,mc,Pl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,WH,FH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",G0,$e]}],"font-family":[{font:[GH,$H,t]}],"font-features":[{"font-features":[$e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ge,$e]}],"line-clamp":[{"line-clamp":[At,"none",Ge,dT]}],leading:[{leading:[l,...q()]}],"list-image":[{"list-image":["none",Ge,$e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,$e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Qe(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Ge,Pl]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[At,"auto",Ge,$e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,$e]}],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",Ge,$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ui,Ge,$e],radial:["",Ge,$e],conic:[Ui,Ge,$e]},YH,VH]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:ve()}],"gradient-via-pos":[{via:ve()}],"gradient-to-pos":[{to:ve()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:Re()}],"rounded-s":[{"rounded-s":Re()}],"rounded-e":[{"rounded-e":Re()}],"rounded-t":[{"rounded-t":Re()}],"rounded-r":[{"rounded-r":Re()}],"rounded-b":[{"rounded-b":Re()}],"rounded-l":[{"rounded-l":Re()}],"rounded-ss":[{"rounded-ss":Re()}],"rounded-se":[{"rounded-se":Re()}],"rounded-ee":[{"rounded-ee":Re()}],"rounded-es":[{"rounded-es":Re()}],"rounded-tl":[{"rounded-tl":Re()}],"rounded-tr":[{"rounded-tr":Re()}],"rounded-br":[{"rounded-br":Re()}],"rounded-bl":[{"rounded-bl":Re()}],"border-w":[{border:Ne()}],"border-w-x":[{"border-x":Ne()}],"border-w-y":[{"border-y":Ne()}],"border-w-s":[{"border-s":Ne()}],"border-w-e":[{"border-e":Ne()}],"border-w-bs":[{"border-bs":Ne()}],"border-w-be":[{"border-be":Ne()}],"border-w-t":[{"border-t":Ne()}],"border-w-r":[{"border-r":Ne()}],"border-w-b":[{"border-b":Ne()}],"border-w-l":[{"border-l":Ne()}],"divide-x":[{"divide-x":Ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Qe(),"hidden","none"]}],"divide-style":[{divide:[...Qe(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...Qe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Ge,$e]}],"outline-w":[{outline:["",At,mc,Pl]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",p,If,Lf]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,If,Lf]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[At,Pl]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":Ne()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",y,If,Lf]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[At,Ge,$e]}],"mix-blend":[{"mix-blend":[...Ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ve()}],"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":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":je()}],"mask-image-linear-to-pos":[{"mask-linear-to":je()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":je()}],"mask-image-t-to-pos":[{"mask-t-to":je()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":je()}],"mask-image-r-to-pos":[{"mask-r-to":je()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":je()}],"mask-image-b-to-pos":[{"mask-b-to":je()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":je()}],"mask-image-l-to-pos":[{"mask-l-to":je()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":je()}],"mask-image-x-to-pos":[{"mask-x-to":je()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":je()}],"mask-image-y-to-pos":[{"mask-y-to":je()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ge,$e]}],"mask-image-radial-from-pos":[{"mask-radial-from":je()}],"mask-image-radial-to-pos":[{"mask-radial-to":je()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":je()}],"mask-image-conic-to-pos":[{"mask-conic-to":je()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,$e]}],filter:[{filter:["","none",Ge,$e]}],blur:[{blur:tt()}],brightness:[{brightness:[At,Ge,$e]}],contrast:[{contrast:[At,Ge,$e]}],"drop-shadow":[{"drop-shadow":["","none",E,If,Lf]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",At,Ge,$e]}],"hue-rotate":[{"hue-rotate":[At,Ge,$e]}],invert:[{invert:["",At,Ge,$e]}],saturate:[{saturate:[At,Ge,$e]}],sepia:[{sepia:["",At,Ge,$e]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,$e]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[At,Ge,$e]}],"backdrop-contrast":[{"backdrop-contrast":[At,Ge,$e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Ge,$e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Ge,$e]}],"backdrop-invert":[{"backdrop-invert":["",At,Ge,$e]}],"backdrop-opacity":[{"backdrop-opacity":[At,Ge,$e]}],"backdrop-saturate":[{"backdrop-saturate":[At,Ge,$e]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Ge,$e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":q()}],"border-spacing-x":[{"border-spacing-x":q()}],"border-spacing-y":[{"border-spacing-y":q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,$e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Ge,$e]}],ease:[{ease:["linear","initial",S,Ge,$e]}],delay:[{delay:[At,Ge,$e]}],animate:[{animate:["none",N,Ge,$e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ge,$e]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:ut()}],"rotate-x":[{"rotate-x":ut()}],"rotate-y":[{"rotate-y":ut()}],"rotate-z":[{"rotate-z":ut()}],scale:[{scale:Ct()}],"scale-x":[{"scale-x":Ct()}],"scale-y":[{"scale-y":Ct()}],"scale-z":[{"scale-z":Ct()}],"scale-3d":["scale-3d"],skew:[{skew:en()}],"skew-x":[{"skew-x":en()}],"skew-y":[{"skew-y":en()}],transform:[{transform:[Ge,$e,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:nt()}],"translate-x":[{"translate-x":nt()}],"translate-y":[{"translate-y":nt()}],"translate-z":[{"translate-z":nt()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Ge,$e]}],"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":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-mbs":[{"scroll-mbs":q()}],"scroll-mbe":[{"scroll-mbe":q()}],"scroll-mt":[{"scroll-mt":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-ps":[{"scroll-ps":q()}],"scroll-pe":[{"scroll-pe":q()}],"scroll-pbs":[{"scroll-pbs":q()}],"scroll-pbe":[{"scroll-pbe":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"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",Ge,$e]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[At,mc,Pl,dT]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},iC=AH(XH),KH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JH={};function mT(e,t){return(JH.jsx?ZH:KH).test(e)}var zo={},q0,pT;function ez(){if(pT)return q0;pT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
281
|
-
`,m="/",p="*",g="",y="comment",E="declaration";function v(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var N=1,R=1;function M(me){var ne=me.match(t);ne&&(N+=ne.length);var $=me.lastIndexOf(d);R=~$?me.length-$:R+me.length}function Y(){var me={line:N,column:R};return function(ne){return ne.position=new U(me),le(),ne}}function U(me){this.start=me,this.end={line:N,column:R},this.source=S.source}U.prototype.content=C;function P(me){var ne=new Error(S.source+":"+N+":"+R+": "+me);if(ne.reason=me,ne.filename=S.source,ne.line=N,ne.column=R,ne.source=C,!S.silent)throw ne}function q(me){var ne=me.exec(C);if(ne){var $=ne[0];return M($),C=C.slice($.length),ne}}function le(){q(n)}function X(me){var ne;for(me=me||[];ne=fe();)ne!==!1&&me.push(ne);return me}function fe(){var me=Y();if(!(m!=C.charAt(0)||p!=C.charAt(1))){for(var ne=2;g!=C.charAt(ne)&&(p!=C.charAt(ne)||m!=C.charAt(ne+1));)++ne;if(ne+=2,g===C.charAt(ne-1))return P("End of comment missing");var $=C.slice(2,ne-2);return R+=2,M($),C=C.slice(ne),R+=2,me({type:y,comment:$})}}function F(){var me=Y(),ne=q(r);if(ne){if(fe(),!q(i))return P("property missing ':'");var $=q(l),z=me({type:E,property:w(ne[0].replace(e,g)),value:$?w($[0].replace(e,g)):g});return q(o),z}}function Te(){var me=[];X(me);for(var ne;ne=F();)ne!==!1&&(me.push(ne),X(me));return me}return le(),Te()}function w(C){return C?C.replace(c,g):g}return q0=v,q0}var gT;function tz(){if(gT)return zo;gT=1;var e=zo&&zo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zo,"__esModule",{value:!0}),zo.default=n;const t=e(ez());function n(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,t.default)(r),c=typeof i=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:m,value:p}=d;c?i(m,p,d):p&&(l=l||{},l[m]=p)}),l}return zo}var pc={},bT;function nz(){if(bT)return pc;bT=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},o=function(m,p){return p.toUpperCase()},c=function(m,p){return"".concat(p,"-")},d=function(m,p){return p===void 0&&(p={}),l(m)?m:(m=m.toLowerCase(),p.reactCompat?m=m.replace(i,c):m=m.replace(r,c),m.replace(t,o))};return pc.camelCase=d,pc}var gc,xT;function rz(){if(xT)return gc;xT=1;var e=gc&&gc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(tz()),n=nz();function r(i,l){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(o[(0,n.camelCase)(c,l)]=d)}),o}return r.default=r,gc=r,gc}var az=rz();const sz=Lh(az);function jc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yT(e.position):"start"in e||"end"in e?yT(e):"line"in e||"column"in e?Gg(e):""}function Gg(e){return ET(e&&e.line)+":"+ET(e&&e.column)}function yT(e){return Gg(e&&e.start)+"-"+Gg(e&&e.end)}function ET(e){return e&&typeof e=="number"?e:1}class Rr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(o=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?l.ruleId=r:(l.source=r.slice(0,d),l.ruleId=r.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=jc(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Rr.prototype.file="";Rr.prototype.name="";Rr.prototype.reason="";Rr.prototype.message="";Rr.prototype.stack="";Rr.prototype.column=void 0;Rr.prototype.line=void 0;Rr.prototype.ancestors=void 0;Rr.prototype.cause=void 0;Rr.prototype.fatal=void 0;Rr.prototype.place=void 0;Rr.prototype.ruleId=void 0;Rr.prototype.source=void 0;const ob={}.hasOwnProperty,iz=new Map,lz=/[A-Z]/g,oz=new Set(["table","tbody","thead","tfoot","tr"]),uz=new Set(["td","th"]),lC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cz(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=xz(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=bz(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ys:du,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=oC(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function oC(e,t,n){if(t.type==="element")return dz(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fz(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return mz(e,t,n);if(t.type==="mdxjsEsm")return hz(e,t);if(t.type==="root")return pz(e,t,n);if(t.type==="text")return gz(e,t)}function dz(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ys,e.schema=i),e.ancestors.push(t);const l=cC(e,t.tagName,!1),o=yz(e,t);let c=cb(e,t);return oz.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!jh(d):!0})),uC(e,o,l,t),ub(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function fz(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)}Yc(e,t.position)}function hz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Yc(e,t.position)}function mz(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ys,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:cC(e,t.name,!0),o=Ez(e,t),c=cb(e,t);return uC(e,o,l,t),ub(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function pz(e,t,n){const r={};return ub(r,cb(e,t)),e.create(t,e.Fragment,r,n)}function gz(e,t){return t.value}function uC(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ub(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function bz(e,t,n){return r;function r(i,l,o,c){const m=Array.isArray(o.children)?n:t;return c?m(l,o,c):m(l,o)}}function xz(e,t){return n;function n(r,i,l,o){const c=Array.isArray(l.children),d=Es(r);return t(i,l,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function yz(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ob.call(t.properties,i)){const l=_z(e,i,t.properties[i]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&uz.has(t.tagName)?r=c:n[o]=c}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Ez(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Yc(e,t.position);else{const i=r.name;let l;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,l=e.evaluater.evaluateExpression(c.expression)}else Yc(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function cb(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:iz;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const m=i.get(d)||0;o=d+"-"+m,i.set(d,m+1)}}const c=oC(e,l,o);c!==void 0&&n.push(c)}return n}function _z(e,t,n){const r=Jc(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?w1(n):C1(n)),r.property==="style"){let i=typeof n=="object"?n:Tz(e,String(n));return e.stylePropertyNameCase==="css"&&(i=vz(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?CR[r.property]||r.property:r.attribute,n]}}function Tz(e,t){try{return sz(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Rr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=lC+"#cannot-parse-style-attribute",i}}function cC(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,o;for(;++l<i.length;){const c=mT(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}r=o}else r=mT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ob.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yc(e)}function Yc(e,t){const n=new Rr("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=lC+"#cannot-handle-mdx-estrees-without-createevaluater",n}function vz(e){const t={};let n;for(n in e)ob.call(e,n)&&(t[kz(n)]=e[n]);return t}function kz(e){let t=e.replace(lz,wz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function wz(e){return"-"+e.toLowerCase()}const Y0={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"]},Cz={tokenize:Sz};function Sz(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ft(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),l(c)}function l(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return it(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const Nz={tokenize:Az},_T={tokenize:Rz};function Az(e){const t=this,n=[];let r=0,i,l,o;return c;function c(R){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,d,m)(R)}return m(R)}function d(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&N();const M=t.events.length;let Y=M,U;for(;Y--;)if(t.events[Y][0]==="exit"&&t.events[Y][1].type==="chunkFlow"){U=t.events[Y][1].end;break}S(r);let P=M;for(;P<t.events.length;)t.events[P][1].end={...U},P++;return ua(t.events,Y+1,0,t.events.slice(M)),t.events.length=P,m(R)}return c(R)}function m(R){if(r===n.length){if(!i)return y(R);if(i.currentConstruct&&i.currentConstruct.concrete)return v(R);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_T,p,g)(R)}function p(R){return i&&N(),S(r),y(R)}function g(R){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,v(R)}function y(R){return t.containerState={},e.attempt(_T,E,v)(R)}function E(R){return r++,n.push([t.currentConstruct,t.containerState]),y(R)}function v(R){if(R===null){i&&N(),S(0),e.consume(R);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),w(R)}function w(R){if(R===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(R);return}return it(R)?(e.consume(R),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(R),w)}function C(R,M){const Y=t.sliceStream(R);if(M&&Y.push(null),R.previous=l,l&&(l.next=R),l=R,i.defineSkip(R.start),i.write(Y),t.parser.lazy[R.start.line]){let U=i.events.length;for(;U--;)if(i.events[U][1].start.offset<o&&(!i.events[U][1].end||i.events[U][1].end.offset>o))return;const P=t.events.length;let q=P,le,X;for(;q--;)if(t.events[q][0]==="exit"&&t.events[q][1].type==="chunkFlow"){if(le){X=t.events[q][1].end;break}le=!0}for(S(r),U=P;U<t.events.length;)t.events[U][1].end={...X},U++;ua(t.events,q+1,0,t.events.slice(P)),t.events.length=U}}function S(R){let M=n.length;for(;M-- >R;){const Y=n[M];t.containerState=Y[1],Y[0].exit.call(t,e)}n.length=R}function N(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Rz(e,t,n){return Ft(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const Lz={tokenize:Iz};function Iz(e){const t=this,n=e.attempt(ad,r,e.attempt(this.parser.constructs.flowInitial,i,Ft(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jP,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Oz={resolveAll:fC()},Dz=dC("string"),jz=dC("text");function dC(e){return{resolveAll:fC(e==="text"?Mz:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,o,c);return o;function o(p){return m(p)?l(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return m(p)?(n.exit("data"),l(p)):(n.consume(p),d)}function m(p){if(p===null)return!0;const g=i[p];let y=-1;if(g)for(;++y<g.length;){const E=g[y];if(!E.previous||E.previous.call(r,r.previous))return!0}return!1}}}function fC(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function Mz(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let l=i.length,o=-1,c=0,d;for(;l--;){const m=i[l];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(m===-2)d=!0,c++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const m={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const Pz={42:Yr,43:Yr,45:Yr,48:Yr,49:Yr,50:Yr,51:Yr,52:Yr,53:Yr,54:Yr,55:Yr,56:Yr,57:Yr,62:N3},Bz={91:HP},Uz={[-2]:F0,[-1]:F0,32:F0},Hz={35:qP,42:nh,45:[tT,nh],60:XP,61:tT,95:nh,96:J_,126:J_},zz={38:R3,92:A3},Fz={[-5]:$0,[-4]:$0,[-3]:$0,33:mB,38:R3,42:$g,60:[gP,rB],91:gB,92:[VP,A3],93:rb,95:$g,96:AP},$z={null:[$g,Oz]},Vz={null:[42,95]},Gz={null:[]},qz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Vz,contentInitial:Bz,disable:Gz,document:Pz,flow:Hz,flowInitial:Uz,insideSpan:$z,string:zz,text:Fz},Symbol.toStringTag,{value:"Module"}));function Yz(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let o=[],c=[];const d={attempt:P(Y),check:P(U),consume:N,enter:R,exit:M,interrupt:P(U,{interrupt:!0})},m={code:null,containerState:{},defineSkip:w,events:[],now:v,parser:e,previous:null,sliceSerialize:y,sliceStream:E,write:g};let p=t.tokenize.call(m,d);return t.resolveAll&&l.push(t),m;function g(fe){return o=Aa(o,fe),C(),o[o.length-1]!==null?[]:(q(t,0),m.events=Jh(l,m.events,m),m.events)}function y(fe,F){return Qz(E(fe),F)}function E(fe){return Wz(o,fe)}function v(){const{_bufferIndex:fe,_index:F,line:Te,column:me,offset:ne}=r;return{_bufferIndex:fe,_index:F,line:Te,column:me,offset:ne}}function w(fe){i[fe.line]=fe.column,X()}function C(){let fe;for(;r._index<o.length;){const F=o[r._index];if(typeof F=="string")for(fe=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===fe&&r._bufferIndex<F.length;)S(F.charCodeAt(r._bufferIndex));else S(F)}}function S(fe){p=p(fe)}function N(fe){it(fe)?(r.line++,r.column=1,r.offset+=fe===-3?2:1,X()):fe!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=fe}function R(fe,F){const Te=F||{};return Te.type=fe,Te.start=v(),m.events.push(["enter",Te,m]),c.push(Te),Te}function M(fe){const F=c.pop();return F.end=v(),m.events.push(["exit",F,m]),F}function Y(fe,F){q(fe,F.from)}function U(fe,F){F.restore()}function P(fe,F){return Te;function Te(me,ne,$){let z,Z,ce,A;return Array.isArray(me)?te(me):"tokenize"in me?te([me]):H(me);function H(Ne){return Qe;function Qe(Ve){const je=Ve!==null&&Ne[Ve],tt=Ve!==null&&Ne.null,ut=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(tt)?tt:tt?[tt]:[]];return te(ut)(Ve)}}function te(Ne){return z=Ne,Z=0,Ne.length===0?$:O(Ne[Z])}function O(Ne){return Qe;function Qe(Ve){return A=le(),ce=Ne,Ne.partial||(m.currentConstruct=Ne),Ne.name&&m.parser.constructs.disable.null.includes(Ne.name)?Re():Ne.tokenize.call(F?Object.assign(Object.create(m),F):m,d,ve,Re)(Ve)}}function ve(Ne){return fe(ce,A),ne}function Re(Ne){return A.restore(),++Z<z.length?O(z[Z]):$}}}function q(fe,F){fe.resolveAll&&!l.includes(fe)&&l.push(fe),fe.resolve&&ua(m.events,F,m.events.length-F,fe.resolve(m.events.slice(F),m)),fe.resolveTo&&(m.events=fe.resolveTo(m.events,m))}function le(){const fe=v(),F=m.previous,Te=m.currentConstruct,me=m.events.length,ne=Array.from(c);return{from:me,restore:$};function $(){r=fe,m.previous=F,m.currentConstruct=Te,m.events.length=me,c=ne,X()}}function X(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Wz(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,l)];else{if(o=e.slice(n,i),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Qz(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
282
|
-
`;break}case-3:{o=`\r
|
|
283
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Xz(e){const r={constructs:y3([qz,...(e||{}).extensions||[]]),content:i(Cz),defined:[],document:i(Nz),flow:i(Lz),lazy:{},string:i(Dz),text:i(jz)};return r;function i(l){return o;function o(c){return Yz(r,l,c)}}}function Kz(e){for(;!L3(e););return e}const TT=/[\0\t\n\r]/g;function Zz(){let e=1,t="",n=!0,r;return i;function i(l,o,c){const d=[];let m,p,g,y,E;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),g=0,t="",n&&(l.charCodeAt(0)===65279&&g++,n=void 0);g<l.length;){if(TT.lastIndex=g,m=TT.exec(l),y=m&&m.index!==void 0?m.index:l.length,E=l.charCodeAt(y),!m){t=l.slice(g);break}if(E===10&&g===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<y&&(d.push(l.slice(g,y)),e+=y-g),E){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const hC={}.hasOwnProperty;function Jz(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),eF(n)(Kz(Xz(n).document().write(Zz()(e,t,!0))))}function eF(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Me),autolinkProtocol:le,autolinkEmail:le,atxHeading:l(vt),blockQuote:l(tt),characterEscape:le,characterReference:le,codeFenced:l(ut),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(ut,o),codeText:l(Ct,o),codeTextData:le,data:le,codeFlowValue:le,definition:l(en),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(nt),hardBreakEscape:l(st),hardBreakTrailing:l(st),htmlFlow:l(xn,o),htmlFlowData:le,htmlText:l(xn,o),htmlTextData:le,image:l(qe),label:o,link:l(Me),listItem:l(ln),listItemValue:y,listOrdered:l(Nt,g),listUnordered:l(Nt),paragraph:l(tn),reference:O,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(vt),strong:l(Zn),thematicBreak:l(Un)},exit:{atxHeading:d(),atxHeadingSequence:Y,autolink:d(),autolinkEmail:je,autolinkProtocol:Ve,blockQuote:d(),characterEscapeValue:X,characterReferenceMarkerHexadecimal:Re,characterReferenceMarkerNumeric:Re,characterReferenceValue:Ne,characterReference:Qe,codeFenced:d(C),codeFencedFence:w,codeFencedFenceInfo:E,codeFencedFenceMeta:v,codeFlowValue:X,codeIndented:d(S),codeText:d(ne),codeTextData:X,data:X,definition:d(),definitionDestinationString:M,definitionLabelString:N,definitionTitleString:R,emphasis:d(),hardBreakEscape:d(F),hardBreakTrailing:d(F),htmlFlow:d(Te),htmlFlowData:X,htmlText:d(me),htmlTextData:X,image:d(z),label:ce,labelText:Z,lineEnding:fe,link:d($),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ve,resourceDestinationString:A,resourceTitleString:H,resource:te,setextHeading:d(q),setextHeadingLineSequence:P,setextHeadingText:U,strong:d(),thematicBreak:d()}};mC(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ge){let Ce={type:"root",children:[]};const Pe={stack:[Ce],tokenStack:[],config:t,enter:c,exit:m,buffer:o,resume:p,data:n},ct=[];let bt=-1;for(;++bt<ge.length;)if(ge[bt][1].type==="listOrdered"||ge[bt][1].type==="listUnordered")if(ge[bt][0]==="enter")ct.push(bt);else{const yn=ct.pop();bt=i(ge,yn,bt)}for(bt=-1;++bt<ge.length;){const yn=t[ge[bt][0]];hC.call(yn,ge[bt][1].type)&&yn[ge[bt][1].type].call(Object.assign({sliceSerialize:ge[bt][2].sliceSerialize},Pe),ge[bt][1])}if(Pe.tokenStack.length>0){const yn=Pe.tokenStack[Pe.tokenStack.length-1];(yn[1]||vT).call(Pe,void 0,yn[0])}for(Ce.position={start:Hi(ge.length>0?ge[0][1].start:{line:1,column:1,offset:0}),end:Hi(ge.length>0?ge[ge.length-2][1].end:{line:1,column:1,offset:0})},bt=-1;++bt<t.transforms.length;)Ce=t.transforms[bt](Ce)||Ce;return Ce}function i(ge,Ce,Pe){let ct=Ce-1,bt=-1,yn=!1,Gn,xe,Oe,Je;for(;++ct<=Pe;){const Be=ge[ct];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?bt++:bt--,Je=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(Gn&&!Je&&!bt&&!Oe&&(Oe=ct),Je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Je=void 0}if(!bt&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||bt===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(Gn){let dt=ct;for(xe=void 0;dt--;){const Q=ge[dt];if(Q[1].type==="lineEnding"||Q[1].type==="lineEndingBlank"){if(Q[0]==="exit")continue;xe&&(ge[xe][1].type="lineEndingBlank",yn=!0),Q[1].type="lineEnding",xe=dt}else if(!(Q[1].type==="linePrefix"||Q[1].type==="blockQuotePrefix"||Q[1].type==="blockQuotePrefixWhitespace"||Q[1].type==="blockQuoteMarker"||Q[1].type==="listItemIndent"))break}Oe&&(!xe||Oe<xe)&&(Gn._spread=!0),Gn.end=Object.assign({},xe?ge[xe][1].start:Be[1].end),ge.splice(xe||ct,0,["exit",Gn,Be[2]]),ct++,Pe++}if(Be[1].type==="listItemPrefix"){const dt={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};Gn=dt,ge.splice(ct,0,["enter",dt,Be[2]]),ct++,Pe++,Oe=void 0,Je=!0}}}return ge[Ce][1]._spread=yn,Pe}function l(ge,Ce){return Pe;function Pe(ct){c.call(this,ge(ct),ct),Ce&&Ce.call(this,ct)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(ge,Ce,Pe){this.stack[this.stack.length-1].children.push(ge),this.stack.push(ge),this.tokenStack.push([Ce,Pe||void 0]),ge.position={start:Hi(Ce.start),end:void 0}}function d(ge){return Ce;function Ce(Pe){ge&&ge.call(this,Pe),m.call(this,Pe)}}function m(ge,Ce){const Pe=this.stack.pop(),ct=this.tokenStack.pop();if(ct)ct[0].type!==ge.type&&(Ce?Ce.call(this,ge,ct[0]):(ct[1]||vT).call(this,ge,ct[0]));else throw new Error("Cannot close `"+ge.type+"` ("+jc({start:ge.start,end:ge.end})+"): it’s not open");Pe.position.end=Hi(ge.end)}function p(){return J1(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(ge){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(ge),10),this.data.expectingFirstListItemValue=void 0}}function E(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=ge}function v(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=ge}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ge.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ge.replace(/(\r?\n|\r)$/g,"")}function N(ge){const Ce=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=Ce,Pe.identifier=Ka(this.sliceSerialize(ge)).toLowerCase()}function R(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=ge}function M(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=ge}function Y(ge){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Pe=this.sliceSerialize(ge).length;Ce.depth=Pe}}function U(){this.data.setextHeadingSlurpLineEnding=!0}function P(ge){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(ge).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function le(ge){const Pe=this.stack[this.stack.length-1].children;let ct=Pe[Pe.length-1];(!ct||ct.type!=="text")&&(ct=Ye(),ct.position={start:Hi(ge.start),end:void 0},Pe.push(ct)),this.stack.push(ct)}function X(ge){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(ge),Ce.position.end=Hi(ge.end)}function fe(ge){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=Ce.children[Ce.children.length-1];Pe.position.end=Hi(ge.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(le.call(this,ge),X.call(this,ge))}function F(){this.data.atHardBreak=!0}function Te(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ge}function me(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ge}function ne(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ge}function $(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=Ce,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function z(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=Ce,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function Z(ge){const Ce=this.sliceSerialize(ge),Pe=this.stack[this.stack.length-2];Pe.label=H7(Ce),Pe.identifier=Ka(Ce).toLowerCase()}function ce(){const ge=this.stack[this.stack.length-1],Ce=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const ct=ge.children;Pe.children=ct}else Pe.alt=Ce}function A(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=ge}function H(){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=ge}function te(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ve(ge){const Ce=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=Ce,Pe.identifier=Ka(this.sliceSerialize(ge)).toLowerCase(),this.data.referenceType="full"}function Re(ge){this.data.characterReferenceType=ge.type}function Ne(ge){const Ce=this.sliceSerialize(ge),Pe=this.data.characterReferenceType;let ct;Pe?(ct=x3(Ce,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ct=tb(Ce);const bt=this.stack[this.stack.length-1];bt.value+=ct}function Qe(ge){const Ce=this.stack.pop();Ce.position.end=Hi(ge.end)}function Ve(ge){X.call(this,ge);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(ge)}function je(ge){X.call(this,ge);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(ge)}function tt(){return{type:"blockquote",children:[]}}function ut(){return{type:"code",lang:null,meta:null,value:""}}function Ct(){return{type:"inlineCode",value:""}}function en(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function nt(){return{type:"emphasis",children:[]}}function vt(){return{type:"heading",depth:0,children:[]}}function st(){return{type:"break"}}function xn(){return{type:"html",value:""}}function qe(){return{type:"image",title:null,url:"",alt:null}}function Me(){return{type:"link",title:null,url:"",children:[]}}function Nt(ge){return{type:"list",ordered:ge.type==="listOrdered",start:null,spread:ge._spread,children:[]}}function ln(ge){return{type:"listItem",spread:ge._spread,checked:null,children:[]}}function tn(){return{type:"paragraph",children:[]}}function Zn(){return{type:"strong",children:[]}}function Ye(){return{type:"text",value:""}}function Un(){return{type:"thematicBreak"}}}function Hi(e){return{line:e.line,column:e.column,offset:e.offset}}function mC(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?mC(e,r):tF(e,r)}}function tF(e,t){let n;for(n in t)if(hC.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 vT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+jc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+jc({start:t.start,end:t.end})+") is still open")}function nF(e){const t=this;t.parser=n;function n(r){return Jz(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function rF(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 aF(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
284
|
-
`}]}function sF(e,t){const n=t.value?t.value+`
|
|
285
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function iF(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lF(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oF(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=xu(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const m={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,m),e.applyData(t,m)}function uF(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 cF(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function pC(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function dF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pC(e,t);const i={src:xu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function fF(e,t){const n={src:xu(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 hF(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 mF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pC(e,t);const i={href:xu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function pF(e,t){const n={href:xu(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 gF(e,t,n){const r=e.all(t),i=n?bF(n):gC(t),l={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
286
|
-
`}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
287
|
-
`});const m={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,m),e.applyData(t,m)}function bF(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=gC(n[r])}return t}function gC(e){const t=e.spread;return t??e.children.length>1}function xF(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function yF(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EF(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _F(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TF(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Es(t.children[1]),d=Kh(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function vF(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let d=-1;const m=[];for(;++d<c;){const g=t.children[d],y={},E=o?o[d]:void 0;E&&(y.align=E);let v={type:"element",tagName:l,properties:y,children:[]};g&&(v.children=e.all(g),e.patch(g,v),v=e.applyData(g,v)),m.push(v)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,p),e.applyData(t,p)}function kF(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const kT=9,wT=32;function wF(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(CT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(CT(t.slice(i),i>0,!1)),l.join("")}function CT(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===kT||l===wT;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===kT||l===wT;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function CF(e,t){const n={type:"text",value:wF(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function SF(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const NF={blockquote:rF,break:aF,code:sF,delete:iF,emphasis:lF,footnoteReference:oF,heading:uF,html:cF,imageReference:dF,image:fF,inlineCode:hF,linkReference:mF,link:pF,listItem:gF,list:xF,paragraph:yF,root:EF,strong:_F,table:TF,tableCell:kF,tableRow:vF,text:CF,thematicBreak:SF,toml:Of,yaml:Of,definition:Of,footnoteDefinition:Of};function Of(){}function AF(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 RF(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function LF(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||AF,r=e.options.footnoteBackLabel||RF,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[d]);if(!m)continue;const p=e.all(m),g=String(m.identifier).toUpperCase(),y=xu(g.toLowerCase());let E=0;const v=[],w=e.footnoteCounts.get(g);for(;w!==void 0&&++E<=w;){v.length>0&&v.push({type:"text",value:" "});let N=typeof n=="string"?n:n(d,E);typeof N=="string"&&(N={type:"text",value:N}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(E>1?"-"+E:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,E),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const N=C.children[C.children.length-1];N&&N.type==="text"?N.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...v)}else p.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(m,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Wl(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
288
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
289
|
-
`}]}}const qg={}.hasOwnProperty,IF={};function OF(e,t){const n=t||IF,r=new Map,i=new Map,l=new Map,o={...NF,...n.handlers},c={all:m,applyData:jF,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:d,options:n,patch:DF,wrap:PF};return bs(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();g.has(y)||g.set(y,p)}}),c;function d(p,g){const y=p.type,E=c.handlers[y];if(qg.call(c.handlers,y)&&E)return E(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:w,...C}=p,S=Wl(C);return S.children=c.all(p),S}return Wl(p)}return(c.options.unknownHandler||MF)(c,p,g)}function m(p){const g=[];if("children"in p){const y=p.children;let E=-1;for(;++E<y.length;){const v=c.one(y[E],p);if(v){if(E&&y[E-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=ST(v.value)),!Array.isArray(v)&&v.type==="element")){const w=v.children[0];w&&w.type==="text"&&(w.value=ST(w.value))}Array.isArray(v)?g.push(...v):g.push(v)}}}return g}}function DF(e,t){e.position&&(t.position=Yw(e))}function jF(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,Wl(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function MF(e,t){const n=t.data||{},r="value"in t&&!(qg.call(n,"hProperties")||qg.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 PF(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
290
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
291
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
292
|
-
`}),n}function ST(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function NT(e,t){const n=OF(e,t),r=n.one(e,void 0),i=LF(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
293
|
-
`},i),l}function BF(e,t){return e&&"run"in e?async function(n,r){const i=NT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return NT(n,{file:r,...e||t})}}function AT(e){if(e)throw e}var W0,RT;function UF(){if(RT)return W0;RT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},l=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var p=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!p&&!g)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},o=function(m,p){n&&p.name==="__proto__"?n(m,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):m[p.name]=p.newValue},c=function(m,p){if(p==="__proto__")if(e.call(m,p)){if(r)return r(m,p).value}else return;return m[p]};return W0=function d(){var m,p,g,y,E,v,w=arguments[0],C=1,S=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<S;++C)if(m=arguments[C],m!=null)for(p in m)g=c(w,p),y=c(m,p),w!==y&&(N&&y&&(l(y)||(E=i(y)))?(E?(E=!1,v=g&&i(g)?g:[]):v=g&&l(g)?g:{},o(w,{name:p,newValue:d(N,v,y)})):typeof y<"u"&&o(w,{name:p,newValue:y}));return w},W0}var HF=UF();const Q0=Lh(HF);function Yg(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 zF(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...i);function c(d,...m){const p=e[++l];let g=-1;if(d){o(d);return}for(;++g<i.length;)(m[g]===null||m[g]===void 0)&&(m[g]=i[g]);i=m,p?FF(p,c)(...m):o(null,...m)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function FF(e,t){let n;return r;function r(...o){const c=e.length>o.length;let d;c&&o.push(i);try{d=e.apply(this,o)}catch(m){const p=m;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(l,i):d instanceof Error?i(d):l(d))}function i(o,...c){n||(n=!0,t(o,...c))}function l(o){i(null,o)}}const ms={basename:$F,dirname:VF,extname:GF,join:qF,sep:"/"};function $F(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');sd(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else o<0&&(l=!0,o=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function VF(e){if(sd(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 GF(e){sd(e);let t=e.length,n=-1,r=0,i=-1,l=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function qF(...e){let t=-1,n;for(;++t<e.length;)sd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":YF(n)}function YF(e){sd(e);const t=e.codePointAt(0)===47;let n=WF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function WF(e,t){let n="",r=0,i=-1,l=0,o=-1,c,d;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,l=0;continue}}else if(n.length>0){n="",r=0,i=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,l=0}else c===46&&l>-1?l++:l=-1}return n}function sd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const QF={cwd:XF};function XF(){return"/"}function Wg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function KF(e){if(typeof e=="string")e=new URL(e);else if(!Wg(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 ZF(e)}function ZF(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const X0=["history","path","basename","stem","extname","dirname"];class JF{constructor(t){let n;t?Wg(t)?n={path:t}:typeof t=="string"||e$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":QF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<X0.length;){const l=X0[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)X0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ms.basename(this.path):void 0}set basename(t){Z0(t,"basename"),K0(t,"basename"),this.path=ms.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ms.dirname(this.path):void 0}set dirname(t){LT(this.basename,"dirname"),this.path=ms.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ms.extname(this.path):void 0}set extname(t){if(K0(t,"extname"),LT(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=ms.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Wg(t)&&(t=KF(t)),Z0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ms.basename(this.path,this.extname):void 0}set stem(t){Z0(t,"stem"),K0(t,"stem"),this.path=ms.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Rr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function K0(e,t){if(e&&e.includes(ms.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ms.sep+"`")}function Z0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function LT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function e$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const t$=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),n$={}.hasOwnProperty;class db extends t${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=zF()}copy(){const t=new db;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Q0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(tg("data",this.frozen),this.namespace[t]=n,this):n$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(tg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Df(t),r=this.parser||this.Parser;return J0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),J0("process",this.parser||this.Parser),eg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,o){const c=Df(t),d=r.parse(c);r.run(d,c,function(p,g,y){if(p||!g||!y)return m(p);const E=g,v=r.stringify(E,y);s$(v)?y.value=v:y.result=v,m(p,y)});function m(p,g){p||!g?o(p):l?l(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),J0("processSync",this.parser||this.Parser),eg("processSync",this.compiler||this.Compiler),this.process(t,i),OT("processSync","process",n),r;function i(l,o){n=!0,AT(l),r=o}}run(t,n,r){IT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,c){const d=Df(n);i.run(t,d,m);function m(p,g,y){const E=g||t;p?c(p):o?o(E):r(void 0,E,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),OT("runSync","run",r),i;function l(o,c){AT(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=Df(n),i=this.compiler||this.Compiler;return eg("stringify",i),IT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(tg("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")d(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[p,...g]=m;d(p,g)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(m){if(!("plugins"in m)&&!("settings"in m))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(m.plugins),m.settings&&(i.settings=Q0(!0,i.settings,m.settings))}function c(m){let p=-1;if(m!=null)if(Array.isArray(m))for(;++p<m.length;){const g=m[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function d(m,p){let g=-1,y=-1;for(;++g<r.length;)if(r[g][0]===m){y=g;break}if(y===-1)r.push([m,...p]);else if(p.length>0){let[E,...v]=p;const w=r[y][1];Yg(w)&&Yg(E)&&(E=Q0(!0,w,E)),r[y]=[m,E,...v]}}}}const r$=new db().freeze();function J0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function eg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function tg(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 IT(e){if(!Yg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Df(e){return a$(e)?e:new JF(e)}function a$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function s$(e){return typeof e=="string"||i$(e)}function i$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function fb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var no=fb();function bC(e){no=e}var Hl={exec:()=>null};function $t(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,l)=>{let o=typeof l=="string"?l:l.source;return o=o.replace(Pr.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var l$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Pr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},o$=/^(?:[ \t]*(?:\n|$))+/,u$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,c$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,id=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hb=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yC=$t(xC).replace(/bull/g,hb).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(),f$=$t(xC).replace(/bull/g,hb).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(),mb=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h$=/^[^\n]+/,pb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,m$=$t(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),p$=$t(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hb).getRegex(),tm="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",gb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,g$=$t("^ {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",gb).replace("tag",tm).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),EC=$t(mb).replace("hr",id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tm).getRegex(),b$=$t(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",EC).getRegex(),bb={blockquote:b$,code:u$,def:m$,fences:c$,heading:d$,hr:id,html:g$,lheading:yC,list:p$,newline:o$,paragraph:EC,table:Hl,text:h$},DT=$t("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tm).getRegex(),x$={...bb,lheading:f$,table:DT,paragraph:$t(mb).replace("hr",id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",DT).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tm).getRegex()},y$={...bb,html:$t(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gb).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:Hl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$t(mb).replace("hr",id).replace("heading",` *#{1,6} *[^
|
|
294
|
-
]`).replace("lheading",yC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},E$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_C=/^( {2,}|\\)\n(?!\s*$)/,T$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,yu=/[\p{P}\p{S}]/u,nm=/[\s\p{P}\p{S}]/u,xb=/[^\s\p{P}\p{S}]/u,v$=$t(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,nm).getRegex(),TC=/(?!~)[\p{P}\p{S}]/u,k$=/(?!~)[\s\p{P}\p{S}]/u,w$=/(?:[^\s\p{P}\p{S}]|~)/u,C$=$t(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",l$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),vC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,S$=$t(vC,"u").replace(/punct/g,yu).getRegex(),N$=$t(vC,"u").replace(/punct/g,TC).getRegex(),kC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",A$=$t(kC,"gu").replace(/notPunctSpace/g,xb).replace(/punctSpace/g,nm).replace(/punct/g,yu).getRegex(),R$=$t(kC,"gu").replace(/notPunctSpace/g,w$).replace(/punctSpace/g,k$).replace(/punct/g,TC).getRegex(),L$=$t("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xb).replace(/punctSpace/g,nm).replace(/punct/g,yu).getRegex(),I$=$t(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,yu).getRegex(),O$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",D$=$t(O$,"gu").replace(/notPunctSpace/g,xb).replace(/punctSpace/g,nm).replace(/punct/g,yu).getRegex(),j$=$t(/\\(punct)/,"gu").replace(/punct/g,yu).getRegex(),M$=$t(/^<(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(),P$=$t(gb).replace("(?:-->|$)","-->").getRegex(),B$=$t("^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",P$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,U$=$t(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",wh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wC=$t(/^!?\[(label)\]\[(ref)\]/).replace("label",wh).replace("ref",pb).getRegex(),CC=$t(/^!?\[(ref)\](?:\[\])?/).replace("ref",pb).getRegex(),H$=$t("reflink|nolink(?!\\()","g").replace("reflink",wC).replace("nolink",CC).getRegex(),jT=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,yb={_backpedal:Hl,anyPunctuation:j$,autolink:M$,blockSkip:C$,br:_C,code:_$,del:Hl,delLDelim:Hl,delRDelim:Hl,emStrongLDelim:S$,emStrongRDelimAst:A$,emStrongRDelimUnd:L$,escape:E$,link:U$,nolink:CC,punctuation:v$,reflink:wC,reflinkSearch:H$,tag:B$,text:T$,url:Hl},z$={...yb,link:$t(/^!?\[(label)\]\((.*?)\)/).replace("label",wh).getRegex(),reflink:$t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wh).getRegex()},Qg={...yb,emStrongRDelimAst:R$,emStrongLDelim:N$,delLDelim:I$,delRDelim:D$,url:$t(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",jT).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:$t(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",jT).getRegex()},F$={...Qg,br:$t(_C).replace("{2,}","*").getRegex(),text:$t(Qg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},jf={normal:bb,gfm:x$,pedantic:y$},bc={normal:yb,gfm:Qg,breaks:F$,pedantic:z$},$$={"&":"&","<":"<",">":">",'"':""","'":"'"},MT=e=>$$[e];function hs(e,t){if(t){if(Pr.escapeTest.test(e))return e.replace(Pr.escapeReplace,MT)}else if(Pr.escapeTestNoEncode.test(e))return e.replace(Pr.escapeReplaceNoEncode,MT);return e}function PT(e){try{e=encodeURI(e).replace(Pr.percentDecode,"%")}catch{return null}return e}function BT(e,t){var l;let n=e.replace(Pr.findPipe,(o,c,d)=>{let m=!1,p=c;for(;--p>=0&&d[p]==="\\";)m=!m;return m?"|":" |"}),r=n.split(Pr.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((l=r.at(-1))!=null&&l.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Pr.slashPipe,"|");return r}function xc(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function V$(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 G$(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let l=4-n%4;r+=" ".repeat(l),n+=l}else r+=i,n++;return r}function UT(e,t,n,r,i){let l=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:o,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,d}function q$(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
295
|
-
`).map(l=>{let o=l.match(n.other.beginningSpace);if(o===null)return l;let[c]=o;return c.length>=i.length?l.slice(i.length):l}).join(`
|
|
296
|
-
`)}var Ch=class{constructor(e){de(this,"options");de(this,"rules");de(this,"lexer");this.options=e||no}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:xc(n,`
|
|
297
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=q$(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=xc(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:xc(t[0],`
|
|
298
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=xc(t[0],`
|
|
299
|
-
`).split(`
|
|
300
|
-
`),r="",i="",l=[];for(;n.length>0;){let o=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),o=!0;else if(!o)c.push(n[d]);else break;n=n.slice(d);let m=c.join(`
|
|
301
|
-
`),p=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
302
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
303
|
-
${m}`:m,i=i?`${i}
|
|
304
|
-
${p}`:p;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,l,!0),this.lexer.state.top=g,n.length===0)break;let y=l.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let E=y,v=E.raw+`
|
|
305
|
-
`+n.join(`
|
|
306
|
-
`),w=this.blockquote(v);l[l.length-1]=w,r=r.substring(0,r.length-E.raw.length)+w.raw,i=i.substring(0,i.length-E.text.length)+w.text;break}else if((y==null?void 0:y.type)==="list"){let E=y,v=E.raw+`
|
|
307
|
-
`+n.join(`
|
|
308
|
-
`),w=this.list(v);l[l.length-1]=w,r=r.substring(0,r.length-y.raw.length)+w.raw,i=i.substring(0,i.length-E.raw.length)+w.raw,n=v.substring(l.at(-1).raw.length).split(`
|
|
309
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:i}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim(),l=i.length>1,o={type:"list",raw:"",ordered:l,start:l?+i.slice(0,-1):"",loose:!1,items:[]};i=l?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=l?i:"[*+-]");let c=this.rules.other.listItemRegex(i),d=!1;for(;e;){let p=!1,g="",y="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;g=t[0],e=e.substring(g.length);let E=G$(t[2].split(`
|
|
310
|
-
`,1)[0],t[1].length),v=e.split(`
|
|
311
|
-
`,1)[0],w=!E.trim(),C=0;if(this.options.pedantic?(C=2,y=E.trimStart()):w?C=t[1].length+1:(C=E.search(this.rules.other.nonSpaceChar),C=C>4?1:C,y=E.slice(C),C+=t[1].length),w&&this.rules.other.blankLine.test(v)&&(g+=v+`
|
|
312
|
-
`,e=e.substring(v.length+1),p=!0),!p){let S=this.rules.other.nextBulletRegex(C),N=this.rules.other.hrRegex(C),R=this.rules.other.fencesBeginRegex(C),M=this.rules.other.headingBeginRegex(C),Y=this.rules.other.htmlBeginRegex(C),U=this.rules.other.blockquoteBeginRegex(C);for(;e;){let P=e.split(`
|
|
313
|
-
`,1)[0],q;if(v=P,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),q=v):q=v.replace(this.rules.other.tabCharGlobal," "),R.test(v)||M.test(v)||Y.test(v)||U.test(v)||S.test(v)||N.test(v))break;if(q.search(this.rules.other.nonSpaceChar)>=C||!v.trim())y+=`
|
|
314
|
-
`+q.slice(C);else{if(w||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||R.test(E)||M.test(E)||N.test(E))break;y+=`
|
|
315
|
-
`+v}w=!v.trim(),g+=P+`
|
|
316
|
-
`,e=e.substring(P.length+1),E=q.slice(C)}}o.loose||(d?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(d=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=g}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p of o.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 y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(p.raw);if(g){let y={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};p.checked=y.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=y.raw+p.tokens[0].raw,p.tokens[0].text=y.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(y)):p.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):p.tokens.unshift(y)}}if(!o.loose){let g=p.tokens.filter(E=>E.type==="space"),y=g.length>0&&g.some(E=>this.rules.other.anyLine.test(E.raw));o.loose=y}}if(o.loose)for(let p of o.items){p.loose=!0;for(let g of p.tokens)g.type==="text"&&(g.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){var o;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=BT(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=t[3])!=null&&o.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
317
|
-
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let c of r)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<n.length;c++)l.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:l.align[c]});for(let c of i)l.rows.push(BT(c,l.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:l.align[m]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
318
|
-
`?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 l=xc(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=V$(t[2],"()");if(l===-2)return;if(l>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],i=l[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),UT(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return UT(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,l,o,c=i,d=0,m=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+i);(r=m.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(o=[...l].length,r[3]||r[4]){c+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){d+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+d);let p=[...r[0]][0].length,g=e.slice(0,i+r.index+p+o);if(Math.min(i,o)%2){let E=g.slice(1,-1);return{type:"em",raw:g,text:E,tokens:this.lexer.inlineTokens(E)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,l,o,c=i,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l||(o=[...l].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let m=[...r[0]][0].length,p=e.slice(0,i+r.index+m+o),g=p.slice(i,-i);return{type:"del",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}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,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let l;do l=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(l!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,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}}}},Ra=class Xg{constructor(t){de(this,"tokens");de(this,"options");de(this,"state");de(this,"inlineQueue");de(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||no,this.options.tokenizer=this.options.tokenizer||new Ch,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Pr,block:jf.normal,inline:bc.normal};this.options.pedantic?(n.block=jf.pedantic,n.inline=bc.pedantic):this.options.gfm&&(n.block=jf.gfm,this.options.breaks?n.inline=bc.breaks:n.inline=bc.gfm),this.tokenizer.rules=n}static get rules(){return{block:jf,inline:bc}}static lex(t,n){return new Xg(n).lex(t)}static lexInline(t,n){return new Xg(n).inlineTokens(t)}lex(t){t=t.replace(Pr.carriageReturn,`
|
|
319
|
-
`),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 i,l,o;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Pr.tabCharGlobal," ").replace(Pr.spaceLine,""));t;){let c;if((l=(i=this.options.extensions)==null?void 0:i.block)!=null&&l.some(m=>(c=m.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 m=n.at(-1);c.raw.length===1&&m!==void 0?m.raw+=`
|
|
320
|
-
`:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
321
|
-
`)?"":`
|
|
322
|
-
`)+c.raw,m.text+=`
|
|
323
|
-
`+c.text,this.inlineQueue.at(-1).src=m.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 m=n.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
324
|
-
`)?"":`
|
|
325
|
-
`)+c.raw,m.text+=`
|
|
326
|
-
`+c.raw,this.inlineQueue.at(-1).src=m.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 d=t;if((o=this.options.extensions)!=null&&o.startBlock){let m=1/0,p=t.slice(1),g;this.options.extensions.startBlock.forEach(y=>{g=y.call({lexer:this},p),typeof g=="number"&&g>=0&&(m=Math.min(m,g))}),m<1/0&&m>=0&&(d=t.substring(0,m+1))}if(this.state.top&&(c=this.tokenizer.paragraph(d))){let m=n.at(-1);r&&(m==null?void 0:m.type)==="paragraph"?(m.raw+=(m.raw.endsWith(`
|
|
327
|
-
`)?"":`
|
|
328
|
-
`)+c.raw,m.text+=`
|
|
329
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):n.push(c),r=d.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
|
|
330
|
-
`)?"":`
|
|
331
|
-
`)+c.raw,m.text+=`
|
|
332
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):n.push(c);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var d,m,p,g,y;this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)E.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)l=i[2]?i[2].length:0,r=r.slice(0,i.index+l)+"["+"a".repeat(i[0].length-l-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((m=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:m.call({lexer:this},r))??r;let o=!1,c="";for(;t;){o||(c=""),o=!1;let E;if((g=(p=this.options.extensions)==null?void 0:p.inline)!=null&&g.some(w=>(E=w.call({lexer:this},t,n))?(t=t.substring(E.raw.length),n.push(E),!0):!1))continue;if(E=this.tokenizer.escape(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.tag(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.link(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(E.raw.length);let w=n.at(-1);E.type==="text"&&(w==null?void 0:w.type)==="text"?(w.raw+=E.raw,w.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(t)){t=t.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(t))){t=t.substring(E.raw.length),n.push(E);continue}let v=t;if((y=this.options.extensions)!=null&&y.startInline){let w=1/0,C=t.slice(1),S;this.options.extensions.startInline.forEach(N=>{S=N.call({lexer:this},C),typeof S=="number"&&S>=0&&(w=Math.min(w,S))}),w<1/0&&w>=0&&(v=t.substring(0,w+1))}if(E=this.tokenizer.inlineText(v)){t=t.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(c=E.raw.slice(-1)),o=!0;let w=n.at(-1);(w==null?void 0:w.type)==="text"?(w.raw+=E.raw,w.text+=E.text):n.push(E);continue}if(t){let w="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(w);break}else throw new Error(w)}}return n}},Sh=class{constructor(t){de(this,"options");de(this,"parser");this.options=t||no}space(t){return""}code({text:t,lang:n,escaped:r}){var o;let i=(o=(n||"").match(Pr.notSpaceStart))==null?void 0:o[0],l=t.replace(Pr.endingNewline,"")+`
|
|
333
|
-
`;return i?'<pre><code class="language-'+hs(i)+'">'+(r?l:hs(l,!0))+`</code></pre>
|
|
334
|
-
`:"<pre><code>"+(r?l:hs(l,!0))+`</code></pre>
|
|
335
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
336
|
-
${this.parser.parse(t)}</blockquote>
|
|
337
|
-
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
|
|
338
|
-
`}hr(t){return`<hr>
|
|
339
|
-
`}list(t){let n=t.ordered,r=t.start,i="";for(let c=0;c<t.items.length;c++){let d=t.items[c];i+=this.listitem(d)}let l=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+l+o+`>
|
|
340
|
-
`+i+"</"+l+`>
|
|
341
|
-
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
342
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
343
|
-
`}table(t){let n="",r="";for(let l=0;l<t.header.length;l++)r+=this.tablecell(t.header[l]);n+=this.tablerow({text:r});let i="";for(let l=0;l<t.rows.length;l++){let o=t.rows[l];r="";for(let c=0;c<o.length;c++)r+=this.tablecell(o[c]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
344
|
-
<thead>
|
|
345
|
-
`+n+`</thead>
|
|
346
|
-
`+i+`</table>
|
|
347
|
-
`}tablerow({text:t}){return`<tr>
|
|
348
|
-
${t}</tr>
|
|
349
|
-
`}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
|
|
350
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${hs(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),l=PT(t);if(l===null)return i;t=l;let o='<a href="'+t+'"';return n&&(o+=' title="'+hs(n)+'"'),o+=">"+i+"</a>",o}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let l=PT(t);if(l===null)return hs(r);t=l;let o=`<img src="${t}" alt="${hs(r)}"`;return n&&(o+=` title="${hs(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:hs(t.text)}},Eb=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}},Wa=class Kg{constructor(t){de(this,"options");de(this,"renderer");de(this,"textRenderer");this.options=t||no,this.options.renderer=this.options.renderer||new Sh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Eb}static parse(t,n){return new Kg(n).parse(t)}static parseInline(t,n){return new Kg(n).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let n="";for(let l=0;l<t.length;l++){let o=t[l];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[o.type]){let d=o,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=m||"";continue}}let c=o;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 d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(t,n=this.renderer){var i,l;this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let c=t[o];if((l=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&l[c.type]){let m=this.options.extensions.renderers[c.type].call({parser:this},c);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=m||"";continue}}let d=c;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return r}},qf,vc=(qf=class{constructor(e){de(this,"options");de(this,"block");this.options=e||no}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ra.lex:Ra.lexInline}provideParser(e=this.block){return e?Wa.parse:Wa.parseInline}},de(qf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),de(qf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),qf),Y$=class{constructor(...t){de(this,"defaults",fb());de(this,"options",this.setOptions);de(this,"parse",this.parseMarkdown(!0));de(this,"parseInline",this.parseMarkdown(!1));de(this,"Parser",Wa);de(this,"Renderer",Sh);de(this,"TextRenderer",Eb);de(this,"Lexer",Ra);de(this,"Tokenizer",Ch);de(this,"Hooks",vc);this.use(...t)}walkTokens(t,n){var i,l;let r=[];for(let o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let c=o;for(let d of c.header)r=r.concat(this.walkTokens(d.tokens,n));for(let d of c.rows)for(let m of d)r=r.concat(this.walkTokens(m.tokens,n));break}case"list":{let c=o;r=r.concat(this.walkTokens(c.items,n));break}default:{let c=o;(l=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&l[c.type]?this.defaults.extensions.childTokens[c.type].forEach(d=>{let m=c[d].flat(1/0);r=r.concat(this.walkTokens(m,n))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let o=n.renderers[l.name];o?n.renderers[l.name]=function(...c){let d=l.renderer.apply(this,c);return d===!1&&(d=o.apply(this,c)),d}:n.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[l.level];o?o.unshift(l.tokenizer):n[l.level]=[l.tokenizer],l.start&&(l.level==="block"?n.startBlock?n.startBlock.push(l.start):n.startBlock=[l.start]:l.level==="inline"&&(n.startInline?n.startInline.push(l.start):n.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(n.childTokens[l.name]=l.childTokens)}),i.extensions=n),r.renderer){let l=this.defaults.renderer||new Sh(this.defaults);for(let o in r.renderer){if(!(o in l))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let c=o,d=r.renderer[c],m=l[c];l[c]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g||""}}i.renderer=l}if(r.tokenizer){let l=this.defaults.tokenizer||new Ch(this.defaults);for(let o in r.tokenizer){if(!(o in l))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let c=o,d=r.tokenizer[c],m=l[c];l[c]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}i.tokenizer=l}if(r.hooks){let l=this.defaults.hooks||new vc;for(let o in r.hooks){if(!(o in l))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let c=o,d=r.hooks[c],m=l[c];vc.passThroughHooks.has(o)?l[c]=p=>{if(this.defaults.async&&vc.passThroughHooksRespectAsync.has(o))return(async()=>{let y=await d.call(l,p);return m.call(l,y)})();let g=d.call(l,p);return m.call(l,g)}:l[c]=(...p)=>{if(this.defaults.async)return(async()=>{let y=await d.apply(l,p);return y===!1&&(y=await m.apply(l,p)),y})();let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}i.hooks=l}if(r.walkTokens){let l=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(c){let d=[];return d.push(o.call(this,c)),l&&(d=d.concat(l.call(this,c))),d}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Ra.lex(t,n??this.defaults)}parser(t,n){return Wa.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},l={...this.defaults,...i},o=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let c=l.hooks?await l.hooks.preprocess(n):n,d=await(l.hooks?await l.hooks.provideLexer(t):t?Ra.lex:Ra.lexInline)(c,l),m=l.hooks?await l.hooks.processAllTokens(d):d;l.walkTokens&&await Promise.all(this.walkTokens(m,l.walkTokens));let p=await(l.hooks?await l.hooks.provideParser(t):t?Wa.parse:Wa.parseInline)(m,l);return l.hooks?await l.hooks.postprocess(p):p})().catch(o);try{l.hooks&&(n=l.hooks.preprocess(n));let c=(l.hooks?l.hooks.provideLexer(t):t?Ra.lex:Ra.lexInline)(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let d=(l.hooks?l.hooks.provideParser(t):t?Wa.parse:Wa.parseInline)(c,l);return l.hooks&&(d=l.hooks.postprocess(d)),d}catch(c){return o(c)}}}onError(t,n){return r=>{if(r.message+=`
|
|
351
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+hs(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},Xl=new Y$;function fn(e,t){return Xl.parse(e,t)}fn.options=fn.setOptions=function(e){return Xl.setOptions(e),fn.defaults=Xl.defaults,bC(fn.defaults),fn};fn.getDefaults=fb;fn.defaults=no;fn.use=function(...e){return Xl.use(...e),fn.defaults=Xl.defaults,bC(fn.defaults),fn};fn.walkTokens=function(e,t){return Xl.walkTokens(e,t)};fn.parseInline=Xl.parseInline;fn.Parser=Wa;fn.parser=Wa.parse;fn.Renderer=Sh;fn.TextRenderer=Eb;fn.Lexer=Ra;fn.lexer=Ra.lex;fn.Tokenizer=Ch;fn.Hooks=vc;fn.parse=fn;fn.options;fn.setOptions;fn.use;fn.walkTokens;fn.parseInline;Wa.parse;Ra.lex;var W$=300,Q$="300px",X$=500;function K$(e={}){let{immediate:t=!1,debounceDelay:n=W$,rootMargin:r=Q$,idleTimeout:i=X$}=e,[l,o]=T.useState(!1),c=T.useRef(null),d=T.useRef(null),m=T.useRef(null),p=T.useMemo(()=>E=>{let v=Date.now();return window.setTimeout(()=>{E({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),g=T.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(E,v)=>window.requestIdleCallback(E,v):p,[p]),y=T.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?E=>window.cancelIdleCallback(E):E=>{clearTimeout(E)},[]);return T.useEffect(()=>{if(t){o(!0);return}let E=c.current;if(!E)return;d.current&&(clearTimeout(d.current),d.current=null),m.current&&(y(m.current),m.current=null);let v=()=>{d.current&&(clearTimeout(d.current),d.current=null),m.current&&(y(m.current),m.current=null)},w=R=>{m.current=g(M=>{M.timeRemaining()>0||M.didTimeout?(o(!0),R.disconnect()):m.current=g(()=>{o(!0),R.disconnect()},{timeout:i/2})},{timeout:i})},C=R=>{v(),d.current=window.setTimeout(()=>{var M,Y;let U=R.takeRecords();(U.length===0||(Y=(M=U.at(-1))==null?void 0:M.isIntersecting)!=null&&Y)&&w(R)},n)},S=(R,M)=>{R.isIntersecting?C(M):v()},N=new IntersectionObserver(R=>{for(let M of R)S(M,N)},{rootMargin:r,threshold:0});return N.observe(E),()=>{d.current&&clearTimeout(d.current),m.current&&y(m.current),N.disconnect()}},[t,n,r,i,y,g]),{shouldRender:l,containerRef:c}}var SC=/\s/,Z$=/^\s+$/,J$=new Set(["code","pre","svg","math","annotation"]),eV=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",tV=e=>e.some(t=>eV(t)&&J$.has(t.tagName)),nV=e=>{let t=[],n="",r=!1;for(let i of e){let l=SC.test(i);l!==r&&n&&(t.push(n),n=""),n+=i,r=l}return n&&t.push(n),t},rV=e=>{let t=[],n="";for(let r of e)SC.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},aV=(e,t,n,r,i,l)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return l&&(o+=`;--sd-delay:${l}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:o},children:[{type:"text",value:e}]}},sV=(e,t,n,r,i)=>{let l=t.at(-1);if(!(l&&"children"in l))return;if(tV(t))return Xo;let o=l,c=o.children.indexOf(e);if(c===-1)return;let d=e.value;if(!d.trim()){i.count+=d.length;return}let m=n.sep==="char"?rV(d):nV(d),p=r.prevContentLength,g=m.map(y=>{let E=i.count;if(i.count+=y.length,Z$.test(y))return{type:"text",value:y};let v=p>0&&E<p,w=v?0:i.newIndex++*n.stagger;return aV(y,n.animation,n.duration,n.easing,v,w)});return o.children.splice(c,1,...g),c+g.length},iV=0;function Zg(e){var t,n,r,i,l;let o={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:(i=e==null?void 0:e.sep)!=null?i:"word",stagger:(l=e==null?void 0:e.stagger)!=null?l:40},c={prevContentLength:0,lastRenderCharCount:0},d=iV++,m=()=>p=>{let g={count:0,newIndex:0};z1(p,"text",(y,E)=>sV(y,E,o,c,g)),c.lastRenderCharCount=g.count,c.prevContentLength=0};return Object.defineProperty(m,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:m,setPrevContentLength(p){c.prevContentLength=p},getLastRenderCharCount(){let p=c.lastRenderCharCount;return c.lastRenderCharCount=0,p}}}Zg();var NC=T.createContext(!1),lV=()=>T.useContext(NC),_b=(...e)=>iC(G3(e)),oV=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},uV=e=>e?(...t)=>oV(e,iC(G3(t))):_b,eu=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,l=URL.createObjectURL(i),o=document.createElement("a");o.href=l,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(l)},Jg=T.createContext(_b),It=()=>T.useContext(Jg),cV=_b("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"),dV=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),l=n.slice(r+1).trim();i&&l&&(t[i]=l)}}return t},fV=T.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:l=!0,...o})=>{let c=It(),d=T.useMemo(()=>c(cV),[c]),m=T.useMemo(()=>{let p={};return t.bg&&(p["--sdm-bg"]=t.bg),t.fg&&(p["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(p,dV(t.rootStyle)),p},[t.bg,t.fg,t.rootStyle]);return f.jsx("div",{className:c(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...o,children:f.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:m,children:f.jsx("code",{className:l?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:l&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((p,g)=>f.jsx("span",{className:l?d:void 0,children:p.length===0||p.length===1&&p[0].content===""?`
|
|
352
|
-
`:p.map((y,E)=>{let v={},w=!!y.bgColor;if(y.color&&(v["--sdm-c"]=y.color),y.bgColor&&(v["--sdm-tbg"]=y.bgColor),y.htmlStyle)for(let[C,S]of Object.entries(y.htmlStyle))C==="color"?v["--sdm-c"]=S:C==="background-color"?(v["--sdm-tbg"]=S,w=!0):v[C]=S;return f.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",w&&"bg-[var(--sdm-tbg)]",w&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...y.htmlAttrs,children:y.content},E)})},g))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),hV=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let l=It();return f.jsx("div",{className:l("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},AC=T.createContext({code:""}),RC=()=>T.useContext(AC),mV=({language:e})=>{let t=It();return f.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:f.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},pV=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
353
|
-
`;)t--;return e.slice(0,t)},gV=T.lazy(()=>D(()=>import("./highlighted-body-OFNGDK62-BFD4Ytvg.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),bV=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:l,lineNumbers:o,...c})=>{let d=It(),m=T.useMemo(()=>pV(e),[e]),p=T.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:m.split(`
|
|
354
|
-
`).map(g=>[{content:g,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[m]);return f.jsx(AC.Provider,{value:{code:e},children:f.jsxs(hV,{isIncomplete:i,language:t,children:[f.jsx(mV,{language:t}),r?f.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsx("div",{className:d("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,f.jsx(T.Suspense,{fallback:f.jsx(fV,{className:n,language:t,lineNumbers:o,result:p,startLine:l,...c}),children:f.jsx(gV,{className:n,code:m,language:t,lineNumbers:o,raw:p,startLine:l,...c})})]})})},xV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),yV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),EV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),_V=e=>f.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),TV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),vV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),kV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),wV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),CV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),SV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),kc={CheckIcon:xV,CopyIcon:yV,DownloadIcon:EV,ExternalLinkIcon:wV,Loader2Icon:_V,Maximize2Icon:TV,RotateCcwIcon:vV,XIcon:kV,ZoomInIcon:CV,ZoomOutIcon:SV},LC=T.createContext(kc),NV=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},HT=({icons:e,children:t})=>{let n=T.useRef(e),r=T.useRef(e?{...kc,...e}:kc);NV(n.current,e)||(n.current=e,r.current=e?{...kc,...e}:kc);let i=r.current;return f.jsx(LC.Provider,{value:i,children:t})},es=()=>T.useContext(LC),IC={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},e1=T.createContext(IC),ii=()=>T.useContext(e1),zT=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:l,...o})=>{let c=It(),[d,m]=T.useState(!1),p=T.useRef(0),{code:g}=RC(),{isAnimating:y}=T.useContext(ca),E=ii(),v=l??g,w=async()=>{var N;if(typeof window>"u"||!((N=navigator==null?void 0:navigator.clipboard)!=null&&N.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(v),m(!0),e==null||e(),p.current=window.setTimeout(()=>m(!1),n))}catch(R){t==null||t(R)}};T.useEffect(()=>()=>{window.clearTimeout(p.current)},[]);let C=es(),S=d?C.CheckIcon:C.CopyIcon;return f.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:y,onClick:w,title:E.copyCode,type:"button",...o,children:r??f.jsx(S,{size:14})})},FT={"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"},AV=({onDownload:e,onError:t,language:n,children:r,className:i,code:l,...o})=>{let c=It(),{code:d}=RC(),{isAnimating:m}=T.useContext(ca),p=ii(),g=es(),y=l??d,E=`file.${n&&n in FT?FT[n]:"txt"}`,v="text/plain",w=()=>{try{eu(E,y,v),e==null||e()}catch(C){t==null||t(C)}};return f.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:m,onClick:w,title:p.downloadFile,type:"button",...o,children:r??f.jsx(g.DownloadIcon,{size:14})})},$T=()=>{let{Loader2Icon:e}=es(),t=It();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},RV=/\.[^/.]+$/,LV=({node:e,className:t,src:n,alt:r,onLoad:i,onError:l,...o})=>{let{DownloadIcon:c}=es(),d=It(),m=T.useRef(null),[p,g]=T.useState(!1),[y,E]=T.useState(!1),v=ii(),w=o.width!=null||o.height!=null,C=(p||w)&&!y,S=y&&!w;T.useEffect(()=>{let Y=m.current;if(Y!=null&&Y.complete){let U=Y.naturalWidth>0;g(U),E(!U)}},[]);let N=T.useCallback(Y=>{g(!0),E(!1),i==null||i(Y)},[i]),R=T.useCallback(Y=>{g(!1),E(!0),l==null||l(Y)},[l]),M=async()=>{if(n)try{let Y=await(await fetch(n)).blob(),U=new URL(n,window.location.origin).pathname.split("/").pop()||"",P=U.split(".").pop(),q=U.includes(".")&&P!==void 0&&P.length<=4,le="";if(q)le=U;else{let X=Y.type,fe="png";X.includes("jpeg")||X.includes("jpg")?fe="jpg":X.includes("png")?fe="png":X.includes("svg")?fe="svg":X.includes("gif")?fe="gif":X.includes("webp")&&(fe="webp"),le=`${(r||U||"image").replace(RV,"")}.${fe}`}eu(le,Y,Y.type)}catch{window.open(n,"_blank")}};return n?f.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:R,onLoad:N,ref:m,src:n,...o}),S&&f.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),f.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),C&&f.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:M,title:v.downloadImage,type:"button",children:f.jsx(c,{size:14})})]}):null},Mc=0,Tb=()=>{Mc+=1,Mc===1&&(document.body.style.overflow="hidden")},vb=()=>{Mc=Math.max(0,Mc-1),Mc===0&&(document.body.style.overflow="")},IV=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:l,ExternalLinkIcon:o,XIcon:c}=es(),d=It(),[m,p]=T.useState(!1),g=ii(),y=T.useCallback(async()=>{try{await navigator.clipboard.writeText(e),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},[e]),E=T.useCallback(()=>{r(),n()},[r,n]);return T.useEffect(()=>{if(t){Tb();let v=w=>{w.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),vb()}}},[t,n]),t?f.jsx("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:f.jsxs("div",{className:d("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[f.jsx("button",{className:d("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:g.close,type:"button",children:f.jsx(c,{size:16})}),f.jsxs("div",{className:d("flex flex-col gap-2"),children:[f.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(o,{size:20}),f.jsx("span",{children:g.openExternalLink})]}),f.jsx("p",{className:d("text-muted-foreground text-sm"),children:g.externalLinkWarning})]}),f.jsx("div",{className:d("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),f.jsxs("div",{className:d("flex gap-2"),children:[f.jsx("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:y,type:"button",children:m?f.jsxs(f.Fragment,{children:[f.jsx(i,{size:14}),f.jsx("span",{children:g.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(l,{size:14}),f.jsx("span",{children:g.copyLink})]})}),f.jsxs("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:E,type:"button",children:[f.jsx(o,{size:14}),f.jsx("span",{children:g.openLink})]})]})]})}):null},t1=T.createContext(null),kb=()=>T.useContext(t1),vY=()=>{var e;let t=kb();return(e=t==null?void 0:t.code)!=null?e:null},wb=()=>{var e;let t=kb();return(e=t==null?void 0:t.mermaid)!=null?e:null},OV=e=>{var t;let n=kb();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},DV=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,l)=>{let o="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let d=document.createElement("canvas"),m=c.width*r,p=c.height*r;d.width=m,d.height=p;let g=d.getContext("2d");if(!g){l(new Error("Failed to create 2D canvas context for PNG export"));return}g.drawImage(c,0,0,m,p),d.toBlob(y=>{if(!y){l(new Error("Failed to create PNG blob"));return}i(y)},"image/png")},c.onerror=()=>l(new Error("Failed to load SVG image")),c.src=o})},jV=({chart:e,children:t,className:n,onDownload:r,config:i,onError:l})=>{let o=It(),[c,d]=T.useState(!1),m=T.useRef(null),{isAnimating:p}=T.useContext(ca),g=es(),y=wb(),E=ii(),v=async w=>{try{if(w==="mmd"){eu("diagram.mmd",e,"text/plain"),d(!1),r==null||r(w);return}if(!y){l==null||l(new Error("Mermaid plugin not available"));return}let C=y.getMermaid(i),S=e.split("").reduce((M,Y)=>(M<<5)-M+Y.charCodeAt(0)|0,0),N=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:R}=await C.render(N,e);if(!R){l==null||l(new Error("SVG not found. Please wait for the diagram to render."));return}if(w==="svg"){eu("diagram.svg",R,"image/svg+xml"),d(!1),r==null||r(w);return}if(w==="png"){let M=await DV(R);eu("diagram.png",M,"image/png"),r==null||r(w),d(!1);return}}catch(C){l==null||l(C)}};return T.useEffect(()=>{let w=C=>{let S=C.composedPath();m.current&&!S.includes(m.current)&&d(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]),f.jsxs("div",{className:o("relative"),ref:m,children:[f.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:p,onClick:()=>d(!c),title:E.downloadDiagram,type:"button",children:t??f.jsx(g.DownloadIcon,{size:14})}),c?f.jsxs("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:E.downloadDiagramAsSvg,type:"button",children:E.mermaidFormatSvg}),f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:E.downloadDiagramAsPng,type:"button",children:E.mermaidFormatPng}),f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:E.downloadDiagramAsMmd,type:"button",children:E.mermaidFormatMmd})]}):null]})},MV=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...l})=>{let{Maximize2Icon:o,XIcon:c}=es(),d=It(),[m,p]=T.useState(!1),{isAnimating:g,controls:y}=T.useContext(ca),E=ii(),v=(()=>{if(typeof y=="boolean")return y;let C=y.mermaid;return C===!1?!1:C===!0||C===void 0?!0:C.panZoom!==!1})(),w=()=>{p(!m)};return T.useEffect(()=>{if(m){Tb();let C=S=>{S.key==="Escape"&&p(!1)};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C),vb()}}},[m]),T.useEffect(()=>{m?n==null||n():r&&r()},[m,n,r]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:g,onClick:w,title:E.viewFullscreen,type:"button",...l,children:f.jsx(o,{size:14})}),m?uu.createPortal(f.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:w,onKeyDown:C=>{C.key==="Escape"&&w()},role:"button",tabIndex:0,children:[f.jsx("button",{className:d("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:w,title:E.exitFullscreen,type:"button",children:f.jsx(c,{size:20})}),f.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),role:"presentation",children:f.jsx(mS,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},OC=e=>{var t,n;let r=[],i=[],l=e.querySelectorAll("thead th");for(let c of l)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let o=e.querySelectorAll("tbody tr");for(let c of o){let d=[],m=c.querySelectorAll("td");for(let p of m)d.push(((n=p.textContent)==null?void 0:n.trim())||"");i.push(d)}return{headers:r,rows:i}},DC=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1,m=!1;for(let p of c){if(p==='"'){d=!0,m=!0;break}(p===","||p===`
|
|
355
|
-
`)&&(d=!0)}return d?m?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},i=t.length>0?n.length+1:n.length,l=new Array(i),o=0;t.length>0&&(l[o]=t.map(r).join(","),o+=1);for(let c of n)l[o]=c.map(r).join(","),o+=1;return l.join(`
|
|
356
|
-
`)},PV=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1;for(let p of c)if(p===" "||p===`
|
|
357
|
-
`||p==="\r"){d=!0;break}if(!d)return c;let m=[];for(let p of c)p===" "?m.push("\\t"):p===`
|
|
358
|
-
`?m.push("\\n"):p==="\r"?m.push("\\r"):m.push(p);return m.join("")},i=t.length>0?n.length+1:n.length,l=new Array(i),o=0;t.length>0&&(l[o]=t.map(r).join(" "),o+=1);for(let c of n)l[o]=c.map(r).join(" "),o+=1;return l.join(`
|
|
359
|
-
`)},ng=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("")},n1=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,l=t.map(c=>ng(c));r[i]=`| ${l.join(" | ")} |`,i+=1;let o=new Array(t.length);for(let c=0;c<t.length;c+=1)o[c]="---";r[i]=`| ${o.join(" | ")} |`,i+=1;for(let c of n)if(c.length<t.length){let d=new Array(t.length);for(let m=0;m<t.length;m+=1)d[m]=m<c.length?ng(c[m]):"";r[i]=`| ${d.join(" | ")} |`,i+=1}else{let d=c.map(m=>ng(m));r[i]=`| ${d.join(" | ")} |`,i+=1}return r.join(`
|
|
360
|
-
`)},jC=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let l=It(),[o,c]=T.useState(!1),[d,m]=T.useState(!1),p=T.useRef(null),g=T.useRef(0),{isAnimating:y}=T.useContext(ca),E=ii(),v=async S=>{var N,R;if(typeof window>"u"||!((N=navigator==null?void 0:navigator.clipboard)!=null&&N.write)){r==null||r(new Error("Clipboard API not available"));return}try{let M=(R=p.current)==null?void 0:R.closest('[data-streamdown="table-wrapper"]'),Y=M==null?void 0:M.querySelector("table");if(!Y){r==null||r(new Error("Table not found"));return}let U=OC(Y),P=({csv:DC,tsv:PV,md:n1}[S]||n1)(U),q=new ClipboardItem({"text/plain":new Blob([P],{type:"text/plain"}),"text/html":new Blob([Y.outerHTML],{type:"text/html"})});await navigator.clipboard.write([q]),m(!0),c(!1),n==null||n(S),g.current=window.setTimeout(()=>m(!1),i)}catch(M){r==null||r(M)}};T.useEffect(()=>{let S=N=>{let R=N.composedPath();p.current&&!R.includes(p.current)&&c(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(g.current)}},[]);let w=es(),C=d?w.CheckIcon:w.CopyIcon;return f.jsxs("div",{className:l("relative"),ref:p,children:[f.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:y,onClick:()=>c(!o),title:E.copyTable,type:"button",children:e??f.jsx(C,{height:14,width:14})}),o?f.jsxs("div",{className:l("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:E.copyTableAsMarkdown,type:"button",children:E.tableFormatMarkdown}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:E.copyTableAsCsv,type:"button",children:E.tableFormatCsv}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:E.copyTableAsTsv,type:"button",children:E.tableFormatTsv})]}):null]})},MC=({children:e,className:t,onDownload:n,onError:r})=>{let i=It(),[l,o]=T.useState(!1),c=T.useRef(null),{isAnimating:d}=T.useContext(ca),m=ii(),p=es(),g=y=>{var E;try{let v=(E=c.current)==null?void 0:E.closest('[data-streamdown="table-wrapper"]'),w=v==null?void 0:v.querySelector("table");if(!w){r==null||r(new Error("Table not found"));return}let C=OC(w),S=y==="csv"?DC(C):n1(C);eu(`table.${y==="csv"?"csv":"md"}`,S,y==="csv"?"text/csv":"text/markdown"),o(!1),n==null||n(y)}catch(v){r==null||r(v)}};return T.useEffect(()=>{let y=E=>{let v=E.composedPath();c.current&&!v.includes(c.current)&&o(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]),f.jsxs("div",{className:i("relative"),ref:c,children:[f.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>o(!l),title:m.downloadTable,type:"button",children:e??f.jsx(p.DownloadIcon,{size:14})}),l?f.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("csv"),title:m.downloadTableAsCsv,type:"button",children:m.tableFormatCsv}),f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("markdown"),title:m.downloadTableAsMarkdown,type:"button",children:m.tableFormatMarkdown})]}):null]})},BV=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:l}=es(),o=It(),[c,d]=T.useState(!1),{isAnimating:m}=T.useContext(ca),p=ii(),g=()=>{d(!0)},y=()=>{d(!1)};return T.useEffect(()=>{if(c){Tb();let E=v=>{v.key==="Escape"&&d(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),vb()}}},[c]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:m,onClick:g,title:p.viewFullscreen,type:"button",children:f.jsx(i,{size:14})}),c?uu.createPortal(f.jsx("div",{"aria-label":p.viewFullscreen,"aria-modal":"true",className:o("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:y,onKeyDown:E=>{E.key==="Escape"&&y()},role:"dialog",children:f.jsxs("div",{className:o("flex h-full flex-col"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(jC,{}):null,r?f.jsx(MC,{}):null,f.jsx("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:y,title:p.exitFullscreen,type:"button",children:f.jsx(l,{size:20})})]}),f.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},UV=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:l=!0,...o})=>{let c=It(),d=n&&r,m=n&&i,p=n&&l,g=d||m||p;return f.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[g?f.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[d?f.jsx(jC,{}):null,m?f.jsx(MC,{}):null,p?f.jsx(BV,{showCopy:d,showDownload:m,children:e}):null]}):null,f.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:f.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},HV=/startLine=(\d+)/,zV=/\bnoLineNumbers\b/,FV=T.lazy(()=>D(()=>Promise.resolve().then(()=>gY),void 0).then(e=>({default:e.Mermaid}))),$V=/language-([^\s]+)/;function rm(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,l=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)&&(i==null?void 0:i.line)===(l==null?void 0:l.line)&&(i==null?void 0:i.column)===(l==null?void 0:l.column)}function Bn(e,t){return e.className===t.className&&rm(e.node,t.node)}var r1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,rg=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},VT=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Mf=(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},Cb=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Bn(e,t));Cb.displayName="MarkdownOl";var PC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&rm(e.node,t.node));PC.displayName="MarkdownLi";var BC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Bn(e,t));BC.displayName="MarkdownUl";var UC=T.memo(({className:e,node:t,...n})=>{let r=It();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Bn(e,t));UC.displayName="MarkdownHr";var HC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Bn(e,t));HC.displayName="MarkdownStrong";var VV=({children:e,className:t,href:n,node:r,...i})=>{let l=It(),{linkSafety:o}=T.useContext(ca),[c,d]=T.useState(!1),m=n==="streamdown:incomplete-link",p=T.useCallback(async v=>{if(!(!(o!=null&&o.enabled&&n)||m)){if(v.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[o,n,m]),g=T.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),y=T.useCallback(()=>{d(!1)},[]),E={url:n??"",isOpen:c,onClose:y,onConfirm:g};return o!=null&&o.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:l("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":m,"data-streamdown":"link",onClick:p,type:"button",children:e}),o.renderModal?o.renderModal(E):f.jsx(IV,{...E})]}):f.jsx("a",{className:l("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":m,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},zC=T.memo(VV,(e,t)=>Bn(e,t)&&e.href===t.href);zC.displayName="MarkdownA";var FC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Bn(e,t));FC.displayName="MarkdownH1";var $C=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Bn(e,t));$C.displayName="MarkdownH2";var VC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Bn(e,t));VC.displayName="MarkdownH3";var GC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Bn(e,t));GC.displayName="MarkdownH4";var qC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Bn(e,t));qC.displayName="MarkdownH5";var YC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Bn(e,t));YC.displayName="MarkdownH6";var WC=T.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=T.useContext(ca),l=r1(i,"table"),o=rg(i,"copy"),c=rg(i,"download"),d=rg(i,"fullscreen");return f.jsx(UV,{className:t,showControls:l,showCopy:o,showDownload:c,showFullscreen:d,...r,children:e})},(e,t)=>Bn(e,t));WC.displayName="MarkdownTable";var QC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Bn(e,t));QC.displayName="MarkdownThead";var XC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Bn(e,t));XC.displayName="MarkdownTbody";var KC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Bn(e,t));KC.displayName="MarkdownTr";var ZC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>Bn(e,t));ZC.displayName="MarkdownTh";var JC=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Bn(e,t));JC.displayName="MarkdownTd";var eS=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>Bn(e,t));eS.displayName="MarkdownBlockquote";var tS=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Bn(e,t));tS.displayName="MarkdownSup";var nS=T.memo(({children:e,className:t,node:n,...r})=>{let i=It();return f.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Bn(e,t));nS.displayName="MarkdownSub";var rS=T.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=o=>{var c,d;if(!T.isValidElement(o))return!1;let m=Array.isArray(o.props.children)?o.props.children:[o.props.children],p=!1,g=!1;for(let y of m)if(y){if(typeof y=="string")y.trim()!==""&&(p=!0);else if(T.isValidElement(y))if(((c=y.props)==null?void 0:c["data-footnote-backref"])!==void 0)g=!0;else{let E=Array.isArray(y.props.children)?y.props.children:[y.props.children];for(let v of E){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(T.isValidElement(v)&&((d=v.props)==null?void 0:d["data-footnote-backref"])===void 0){p=!0;break}}}}return g&&!p},l=Array.isArray(e)?e.map(o=>{if(!T.isValidElement(o))return o;if(o.type===Cb){let c=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(d=>!i(d));return c.length===0?null:{...o,props:{...o.props,children:c}}}return o}):e;return(Array.isArray(l)?l.some(o=>o!==null):l!==null)?f.jsx("section",{className:t,...r,children:l}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>Bn(e,t));rS.displayName="MarkdownSection";var GV=({node:e,className:t,children:n,...r})=>{var i,l;let o=It(),c=!("data-block"in r),{mermaid:d,controls:m,lineNumbers:p}=T.useContext(ca),g=wb(),y=lV(),E=t==null?void 0:t.match($V),v=(i=E==null?void 0:E.at(1))!=null?i:"",w=OV(v);if(c)return f.jsx("code",{className:o("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let C=(l=e==null?void 0:e.properties)==null?void 0:l.metastring,S=C==null?void 0:C.match(HV),N=S?Number.parseInt(S[1],10):void 0,R=N!==void 0&&N>=1?N:void 0,M=!(C&&zV.test(C))&&p!==!1,Y="";if(T.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?Y=n.props.children:typeof n=="string"&&(Y=n),w){let le=w.component;return f.jsx(T.Suspense,{fallback:f.jsx($T,{}),children:f.jsx(le,{code:Y,isIncomplete:y,language:v,meta:C})})}if(v==="mermaid"&&g){let le=r1(m,"mermaid"),X=Mf(m,"download"),fe=Mf(m,"copy"),F=Mf(m,"fullscreen"),Te=Mf(m,"panZoom"),me=le&&(X||fe||F);return f.jsx(T.Suspense,{fallback:f.jsx($T,{}),children:f.jsxs("div",{className:o("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[f.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),me?f.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsxs("div",{className:o("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:[X?f.jsx(jV,{chart:Y,config:d==null?void 0:d.config}):null,fe?f.jsx(zT,{code:Y}):null,F?f.jsx(MV,{chart:Y,config:d==null?void 0:d.config}):null]})}):null,f.jsx("div",{className:o("rounded-md border border-border bg-background"),children:f.jsx(FV,{chart:Y,config:d==null?void 0:d.config,showControls:Te})})]})})}let U=r1(m,"code"),P=VT(m,"download"),q=VT(m,"copy");return f.jsx(bV,{className:t,code:Y,isIncomplete:y,language:v,lineNumbers:M,startLine:R,children:U?f.jsxs(f.Fragment,{children:[P?f.jsx(AV,{code:Y,language:v}):null,q?f.jsx(zT,{}):null]}):null})},aS=T.memo(GV,(e,t)=>e.className===t.className&&rm(e.node,t.node));aS.displayName="MarkdownCode";var sS=T.memo(LV,(e,t)=>e.className===t.className&&rm(e.node,t.node));sS.displayName="MarkdownImg";var iS=T.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&T.isValidElement(r[0])){let i=r[0].props.node,l=i==null?void 0:i.tagName;if(l==="img")return f.jsx(f.Fragment,{children:e});if(l==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>Bn(e,t));iS.displayName="MarkdownParagraph";var qV={ol:Cb,li:PC,ul:BC,hr:UC,strong:HC,a:zC,h1:FC,h2:$C,h3:VC,h4:GC,h5:qC,h6:YC,table:WC,thead:QC,tbody:XC,tr:KC,th:ZC,td:JC,blockquote:eS,code:aS,img:sS,pre:({children:e})=>T.isValidElement(e)?T.cloneElement(e,{"data-block":"true"}):e,sup:tS,sub:nS,p:iS,section:rS},YV=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,WV=new RegExp("\\p{L}","u");function GT(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(YV.test(n))return"rtl";if(WV.test(n))return"ltr"}return"ltr"}var QV=/^[ \t]{0,3}(`{3,}|~{3,})/,XV=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,qT=e=>{let t=e.split(`
|
|
361
|
-
`),n=null,r=0;for(let i of t){let l=QV.exec(i);if(n===null){if(l){let o=l[1];n=o[0],r=o.length}}else if(l){let o=l[1],c=o[0],d=o.length;c===n&&d>=r&&(n=null,r=0)}}return n!==null},KV=e=>{let t=e.split(`
|
|
362
|
-
`);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&XV.test(r))return!0}return!1},ZV=()=>e=>{bs(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},YT=[],WT={allowDangerousHtml:!0},Pf=new WeakMap,JV=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let p="default";return this.keyCache.set(e,p),p}let l=p=>{if(!p||p.length===0)return"";let g="";for(let y=0;y<p.length;y+=1){let E=p[y];if(y>0&&(g+=","),Array.isArray(E)){let[v,w]=E;if(typeof v=="function"){let C=Pf.get(v);C||(C=v.name,Pf.set(v,C)),g+=C}else g+=String(v);g+=":",g+=JSON.stringify(w)}else if(typeof E=="function"){let v=Pf.get(E);v||(v=E.name,Pf.set(E,v)),g+=v}else g+=String(E)}return g},o=l(n),c=l(r),d=i?JSON.stringify(i):"",m=`${c}::${o}::${d}`;return this.keyCache.set(e,m),m}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()}},QT=new JV,lS=e=>{let t=eG(e),n=e.children||"",r=t.runSync(t.parse(n),n);return lG(r,e)},eG=e=>{let t=QT.get(e);if(t)return t;let n=nG(e);return QT.set(e,n),n},tG=e=>e.some(t=>Array.isArray(t)?t[0]===Hg:t===Hg),nG=e=>{let t=e.rehypePlugins||YT,n=e.remarkPlugins||YT,r=tG(t)?n:[...n,ZV],i=e.remarkRehypeOptions?{...WT,...e.remarkRehypeOptions}:WT;return r$().use(nF).use(r).use(BF,i).use(t)},rG=e=>e,aG=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},sG=(e,t)=>{var n;for(let r in Y0)if(Object.hasOwn(Y0,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],l=Y0[r];(l===null||l.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},iG=(e,t,n,r,i,l)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&l&&typeof t=="number"&&(o=!l(e,t,n)),o},lG=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:l,unwrapDisallowed:o,urlTransform:c}=t;if(n||r||i||l||c){let d=c||rG;bs(e,(m,p,g)=>{if(m.type==="raw"&&g&&typeof p=="number")return aG(g,p,l,m.value),p;if(m.type==="element"&&(sG(m,d),iG(m,p,g,r,i,n)&&g&&typeof p=="number"))return o&&m.children?g.children.splice(p,1,...m.children):g.children.splice(p,1),p})}return cz(e,{Fragment:f.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0})},oG=/\[\^[\w-]{1,200}\](?!:)/,uG=/\[\^[\w-]{1,200}\]:/,cG=/<(\w+)[\s>]/,dG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),XT=new Map,KT=new Map,fG=e=>{let t=e.toLowerCase(),n=XT.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return XT.set(t,r),r},hG=e=>{let t=e.toLowerCase(),n=KT.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return KT.set(t,r),r},ZT=(e,t)=>{if(dG.has(t.toLowerCase()))return 0;let n=e.match(fG(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},JT=(e,t)=>{let n=e.match(hG(t));return n?n.length:0},mG=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},pG=e=>{let t=oG.test(e),n=uG.test(e);if(t||n)return[e];let r=Ra.lex(e,{gfm:!0}),i=[],l=[],o=!1;for(let c of r){let d=c.raw,m=i.length;if(l.length>0){i[m-1]+=d;let p=l.at(-1),g=ZT(d,p),y=JT(d,p);for(let E=0;E<g;E+=1)l.push(p);for(let E=0;E<y;E+=1)l.length>0&&l.at(-1)===p&&l.pop();continue}if(c.type==="html"&&c.block){let p=d.match(cG);if(p){let g=p[1],y=ZT(d,g),E=JT(d,g);y>E&&l.push(g)}}if(m>0&&!o){let p=i[m-1];if(mG(p)%2===1){i[m-1]=p+d;continue}}i.push(d),c.type!=="space"&&(o=c.type==="code")}return i},gG=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(l,o,c,d)=>{if(!c.includes(`
|
|
363
|
-
|
|
364
|
-
`))return o+c+d;let m=c.replace(/\n\n/g,`
|
|
365
|
-
<!---->
|
|
366
|
-
`),p=(m.startsWith(`
|
|
367
|
-
`)?"":`
|
|
368
|
-
`)+m+(m.endsWith(`
|
|
369
|
-
`)?"":`
|
|
370
|
-
`);return`${o}${p}${d}
|
|
371
|
-
|
|
372
|
-
`})}return n},bG=/([\\`*_~[\]|])/g,xG=e=>e.replace(bG,"\\$1"),yG=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(l,o,c,d)=>{let m=xG(c).replace(/\n\n/g," ");return o+m+d})}return n},oS=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(oS).join(""):"",EG=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));bs(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=oS(r);r.children=i?[{type:"text",value:i}]:[]}})},_G=()=>e=>{bs(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},TG=/^[ \t]*<[\w!/?-]/,vG=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,kG=e=>typeof e!="string"||e.length===0||!TG.test(e)?e:e.replace(vG,"$1"),ev,tv,nv,rv,rh={...Ul,protocols:{...Ul.protocols,href:[...(tv=(ev=Ul.protocols)==null?void 0:ev.href)!=null?tv:[],"tel"]},attributes:{...Ul.attributes,code:[...(rv=(nv=Ul.attributes)==null?void 0:nv.code)!=null?rv:[],"metastring"]}},a1={raw:Hg,sanitize:[t3,rh],harden:[F8,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},uS={gfm:[KB,{}],codeMeta:_G},av=Object.values(a1),wG=Object.values(uS),CG={block:" ▋",circle:" ●"},cS=["github-light","github-dark"],dS={enabled:!0},SG={shikiTheme:cS,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:dS},ca=T.createContext(SG),fS=T.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:l,animatePlugin:o,...c})=>{if(o){let p=o.getLastRenderCharCount();o.setPrevContentLength(p)}let d=typeof e=="string"&&n?kG(e):e,m=f.jsx(lS,{...c,children:d});return f.jsx(NC.Provider,{value:i,children:l?f.jsx("div",{dir:l,style:{display:"contents"},children:m}):m})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var l,o;return((l=e.components)==null?void 0:l[i])!==((o=t.components)==null?void 0:o[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});fS.displayName="Block";var hS=T.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:l,rehypePlugins:o=av,remarkPlugins:c=wG,className:d,shikiTheme:m=cS,mermaid:p,controls:g=!0,isAnimating:y=!1,animated:E,BlockComponent:v=fS,parseMarkdownIntoBlocksFn:w=pG,caret:C,plugins:S,remend:N,linkSafety:R=dS,lineNumbers:M=!0,allowedTags:Y,literalTagContent:U,translations:P,icons:q,prefix:le,onAnimationStart:X,onAnimationEnd:fe,...F})=>{let Te=T.useId(),[me,ne]=T.useTransition(),$=T.useMemo(()=>uV(le),[le]),z=T.useRef(null),Z=T.useRef(X),ce=T.useRef(fe);Z.current=X,ce.current=fe,T.useEffect(()=>{var qe,Me,Nt;if(t==="static")return;let ln=z.current;if(z.current=y,ln===null){y&&((qe=Z.current)==null||qe.call(Z));return}y&&!ln?(Me=Z.current)==null||Me.call(Z):!y&&ln&&((Nt=ce.current)==null||Nt.call(ce))},[y,t]);let A=T.useMemo(()=>Y?Object.keys(Y):[],[Y]),H=T.useMemo(()=>{if(typeof e!="string")return"";let qe=t==="streaming"&&r?oH(e,N):e;return U&&U.length>0&&(qe=yG(qe,U)),A.length>0&&(qe=gG(qe,A)),qe},[e,t,r,N,A,U]),te=T.useMemo(()=>w(H),[H,w]),[O,ve]=T.useState(te);T.useEffect(()=>{t==="streaming"&&!je?ne(()=>{ve(te)}):ve(te)},[te,t]);let Re=t==="streaming"?O:te,Ne=T.useMemo(()=>n==="auto"?Re.map(GT):void 0,[Re,n]),Qe=T.useMemo(()=>Re.map((qe,Me)=>`${Te}-${Me}`),[Re.length,Te]),Ve=T.useMemo(()=>E===!0?"true":E?JSON.stringify(E):"",[E]),je=T.useMemo(()=>Ve?Ve==="true"?Zg():Zg(E):null,[Ve]),tt=T.useMemo(()=>{var qe,Me;return{shikiTheme:(Me=(qe=S==null?void 0:S.code)==null?void 0:qe.getThemes())!=null?Me:m,controls:g,isAnimating:y,lineNumbers:M,mode:t,mermaid:p,linkSafety:R}},[m,g,y,M,t,p,R,S==null?void 0:S.code]),ut=T.useMemo(()=>P?JSON.stringify(P):"",[P]),Ct=T.useMemo(()=>({...IC,...P}),[ut]),en=T.useMemo(()=>{let{inlineCode:qe,...Me}=l??{},Nt={...qV,...Me};if(qe){let ln=Nt.code;Nt.code=tn=>"data-block"in tn?ln?T.createElement(ln,tn):null:T.createElement(qe,tn)}return Nt},[l]),nt=T.useMemo(()=>{let qe=[];return S!=null&&S.cjk&&(qe=[...qe,...S.cjk.remarkPluginsBefore]),qe=[...qe,...c],S!=null&&S.cjk&&(qe=[...qe,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(qe=[...qe,S.math.remarkPlugin]),qe},[c,S==null?void 0:S.math,S==null?void 0:S.cjk]),vt=T.useMemo(()=>{var qe;let Me=o;if(Y&&Object.keys(Y).length>0&&o===av){let Nt={...rh,tagNames:[...(qe=rh.tagNames)!=null?qe:[],...Object.keys(Y)],attributes:{...rh.attributes,...Y}};Me=[a1.raw,[t3,Nt],a1.harden]}return U&&U.length>0&&(Me=[...Me,[EG,U]]),S!=null&&S.math&&(Me=[...Me,S.math.rehypePlugin]),je&&y&&(Me=[...Me,je.rehypePlugin]),Me},[o,S==null?void 0:S.math,je,y,Y,U]),st=T.useMemo(()=>{if(!y||Re.length===0)return!1;let qe=Re.at(-1);return qT(qe)||KV(qe)},[y,Re]),xn=T.useMemo(()=>C&&y&&!st?{"--streamdown-caret":`"${CG[C]}"`}:void 0,[C,y,st]);return t==="static"?f.jsx(e1.Provider,{value:Ct,children:f.jsx(t1.Provider,{value:S??null,children:f.jsx(ca.Provider,{value:tt,children:f.jsx(HT,{icons:q,children:f.jsx(Jg.Provider,{value:$,children:f.jsx("div",{className:$("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?GT(H):n,children:f.jsx(lS,{components:en,rehypePlugins:vt,remarkPlugins:nt,...F,children:H})})})})})})}):f.jsx(e1.Provider,{value:Ct,children:f.jsx(t1.Provider,{value:S??null,children:f.jsx(ca.Provider,{value:tt,children:f.jsx(HT,{icons:q,children:f.jsx(Jg.Provider,{value:$,children:f.jsxs("div",{className:$("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",C&&!st?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:xn,children:[Re.length===0&&C&&y&&f.jsx("span",{}),Re.map((qe,Me)=>{var Nt;let ln=Me===Re.length-1,tn=y&&ln&&qT(qe);return f.jsx(v,{animatePlugin:je,components:en,content:qe,dir:(Nt=Ne==null?void 0:Ne[Me])!=null?Nt:n!=="auto"?n:void 0,index:Me,isIncomplete:tn,rehypePlugins:vt,remarkPlugins:nt,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...F},Qe[Me])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);hS.displayName="Streamdown";var NG=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:l=!0,initialZoom:o=1,fullscreen:c=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:m,ZoomOutIcon:p}=es(),g=It(),y=T.useRef(null),E=T.useRef(null),[v,w]=T.useState(o),[C,S]=T.useState({x:0,y:0}),[N,R]=T.useState(!1),[M,Y]=T.useState({x:0,y:0}),[U,P]=T.useState({x:0,y:0}),q=T.useCallback($=>{w(z=>Math.max(n,Math.min(r,z+$)))},[n,r]),le=T.useCallback(()=>{q(i)},[q,i]),X=T.useCallback(()=>{q(-i)},[q,i]),fe=T.useCallback(()=>{w(o),S({x:0,y:0})},[o]),F=T.useCallback($=>{$.preventDefault();let z=$.deltaY>0?-i:i;q(z)},[q,i]),Te=T.useCallback($=>{if($.button!==0||$.isPrimary===!1)return;R(!0),Y({x:$.clientX,y:$.clientY}),P(C);let z=$.currentTarget;z instanceof HTMLElement&&z.setPointerCapture($.pointerId)},[C]),me=T.useCallback($=>{if(!N)return;$.preventDefault();let z=$.clientX-M.x,Z=$.clientY-M.y;S({x:U.x+z,y:U.y+Z})},[N,M,U]),ne=T.useCallback($=>{R(!1);let z=$.currentTarget;z instanceof HTMLElement&&z.releasePointerCapture($.pointerId)},[]);return T.useEffect(()=>{let $=y.current;if($)return $.addEventListener("wheel",F,{passive:!1}),()=>{$.removeEventListener("wheel",F)}},[F]),T.useEffect(()=>{let $=E.current;if($&&N)return document.body.style.userSelect="none",$.addEventListener("pointermove",me,{passive:!1}),$.addEventListener("pointerup",ne),$.addEventListener("pointercancel",ne),()=>{document.body.style.userSelect="",$.removeEventListener("pointermove",me),$.removeEventListener("pointerup",ne),$.removeEventListener("pointercancel",ne)}},[N,me,ne]),f.jsxs("div",{className:g("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:y,style:{cursor:N?"grabbing":"grab"},children:[l?f.jsxs("div",{className:g("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:[f.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v>=r,onClick:le,title:"Zoom in",type:"button",children:f.jsx(m,{size:16})}),f.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v<=n,onClick:X,title:"Zoom out",type:"button",children:f.jsx(p,{size:16})}),f.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:fe,title:"Reset zoom and pan",type:"button",children:f.jsx(d,{size:16})})]}):null,f.jsx("div",{className:g("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:Te,ref:E,role:"application",style:{transform:`translate(${C.x}px, ${C.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},mS=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let l=It(),[o,c]=T.useState(null),[d,m]=T.useState(!1),[p,g]=T.useState(""),[y,E]=T.useState(""),[v,w]=T.useState(0),{mermaid:C}=T.useContext(ca),S=wb(),N=C==null?void 0:C.errorComponent,{shouldRender:R,containerRef:M}=K$({immediate:r});if(T.useEffect(()=>{if(R){if(!S){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),m(!0);let U=S.getMermaid(n),P=e.split("").reduce((X,fe)=>(X<<5)-X+fe.charCodeAt(0)|0,0),q=`mermaid-${Math.abs(P)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:le}=await U.render(q,e);g(le),E(le)}catch(U){if(!(y||p)){let P=U instanceof Error?U.message:"Failed to render Mermaid chart";c(P)}}finally{m(!1)}})()}},[e,n,v,R,S]),!(R||p||y))return f.jsx("div",{className:l("my-4 min-h-[200px]",t),ref:M});if(d&&!p&&!y)return f.jsx("div",{className:l("my-4 flex justify-center p-4",t),ref:M,children:f.jsxs("div",{className:l("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:l("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:l("text-sm"),children:"Loading diagram..."})]})});if(o&&!p&&!y){let U=()=>w(P=>P+1);return N?f.jsx("div",{ref:M,children:f.jsx(N,{chart:e,error:o,retry:U})}):f.jsxs("div",{className:l("rounded-md bg-red-50 p-4",t),ref:M,children:[f.jsxs("p",{className:l("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),f.jsxs("details",{className:l("mt-2"),children:[f.jsx("summary",{className:l("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.jsx("pre",{className:l("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let Y=p||y;return f.jsx("div",{className:l("size-full",t),"data-streamdown":"mermaid",ref:M,children:f.jsx(NG,{className:l(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:f.jsx("div",{"aria-label":"Mermaid chart",className:l("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:Y},role:"img"})})})};function pS({open:e,title:t,text:n,onClose:r}){return T.useEffect(()=>{if(!e)return;function i(l){l.key==="Escape"&&r()}return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[r,e]),e?uu.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close full text",onClick:r,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm"}),f.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] flex max-h-[min(82vh,52rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-stone-800 px-4 py-3 sm:px-5",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:t}),f.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4 sm:px-5",children:f.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-200",children:n})})]})]}),document.body):null}const AG=[/^(?: {0,3})#{1,6}\s+\S/m,/^(?: {0,3})>{1,}\s*\S/m,/^(?: {0,3})(?:[-+*]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?\S/m,/^(?: {0,3})(?:```|~~~)/m,/^(?: {0,3})(?:[-*_]\s*){3,}$/m],RG=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,LG=/!?\[[^\]\n]+\]\([^)]+\)/,IG=/`[^`\n]+`/,OG=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,DG=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,jG=/~~[^~\n]+~~/;function MG(e){const t=e.trim();return t?AG.some(n=>n.test(t))||RG.test(t)?!0:/[`[\]*_~!]/.test(t)?LG.test(t)||IG.test(t)||OG.test(t)||DG.test(t)||jG.test(t):!1:!1}function am(e){return e?new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"Time unavailable"}function tu(e){return e?new Date(e).toLocaleString():"Time unavailable"}function gS(e){switch(e){case"idle":return"Idle";case"running":return"Running";case"interrupted":return"Interrupted";case"failed":return"Failed";case"not_loaded":return"Not Loaded";case"system_error":return"System Error"}}function PG(e){switch(e){case"idle":return"ui-status-neutral";case"running":return"ui-status-info";case"interrupted":return"ui-status-warning";case"failed":case"system_error":return"ui-status-danger";case"not_loaded":return"ui-status-neutral"}}function bS(e){switch(e){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function Ts(e){switch(e){case"userMessage":return"timeline-kind-user";case"agentMessage":return"timeline-kind-agent";case"image":return"timeline-kind-action";case"contextCompaction":return"timeline-kind-action";case"commandExecution":return"timeline-kind-command";case"webSearch":return"timeline-kind-search";case"reasoning":return"timeline-kind-reasoning";case"toolCall":return"timeline-kind-action";case"plan":return"timeline-kind-plan";case"fileChange":return"timeline-kind-file";case"hook":return"timeline-kind-action";case"other":return"ui-status-neutral"}}function xS(e){switch(e){case"userMessage":return"User";case"agentMessage":return"Agent";case"image":return"Image";case"contextCompaction":return"Context";case"commandExecution":return"Command";case"webSearch":return"Web Search";case"reasoning":return"Reasoning";case"toolCall":return"Tool";case"plan":return"Plan";case"fileChange":return"File Change";case"hook":return"Hook";case"other":return"Other"}}function BG(e){return e==="commandExecution"||e==="reasoning"}const sv=10,UG=10,s1=80;function vs(e){switch(e){case"userMessage":return"timeline-user";case"agentMessage":return"timeline-agent";case"image":return"timeline-action";case"contextCompaction":return"timeline-action";case"commandExecution":return"timeline-command";case"webSearch":return"timeline-search";case"reasoning":return"timeline-reasoning";case"toolCall":return"timeline-action";case"plan":return"timeline-plan";case"fileChange":return"timeline-file-change";case"hook":return"timeline-action";case"other":return"timeline-other"}}function ja(e){switch(e){case"user":return"timeline-overlay-badge timeline-overlay-badge-user";case"agent":return"timeline-overlay-badge timeline-overlay-badge-agent";case"command":return"timeline-overlay-badge timeline-overlay-badge-command";case"search":return"timeline-overlay-badge timeline-overlay-badge-search";case"action":return"timeline-overlay-badge timeline-overlay-badge-action"}}function iv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M3.5 5.25h9"}),f.jsx("path",{d:"M5 8h6"}),f.jsx("path",{d:"M6.5 10.75h3"})]})}function HG(e){var n;const t=e.replace(/\r\n/g,`
|
|
373
|
-
`).split(`
|
|
374
|
-
`);for(;t.length>1&&((n=t.at(-1))==null?void 0:n.trim())==="";)t.pop();return t}function lv(e){return e.replace(/"/g,'"').replace(/'/g,"'").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function Eu(e){const t=HG(e);return t.length===1?{firstLine:t[0]??"",showGap:!1,isTruncated:!1}:{firstLine:t[0]??"",showGap:!0,isTruncated:!0}}function i1(e){const t=e.trim().match(/^<hook_prompt(?:\s+hook_run_id="([^"]+)")?>([\s\S]*)<\/hook_prompt>$/);if(!t)return null;const n=t[1]?lv(t[1]):null,r=lv(t[2]??"").trim(),i=(n==null?void 0:n.split(":")[0])??"hook",l=i==="stop"?"Stop":i,o=(n==null?void 0:n.split(":").slice(2).join(":"))||null;return{id:`live-hook-prompt:${n??"unknown"}`,kind:"hook",text:`${l} hook`,previewText:r||`${l} hook`,detailText:r||null,status:"Completed",hookEventName:i,hookEventLabel:l,hookHandlerType:"command",hookScope:"turn",hookSource:o?"project":null,hookSourcePath:o,hookStatusMessage:null,hookOutputEntries:r?[{kind:"warning",text:r}]:[]}}function ov(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function zG(e){var l;if(!e)return[];const t=/\[(PHOTO|FILE)\s+([^\]]+)\]/g,n=[];let r=0,i=0;for(const o of e.matchAll(t)){const c=o.index??0;c>r&&(n.push({type:"text",key:`text-${i}`,text:e.slice(r,c)}),i+=1);const d=o[1],m=((l=o[2])==null?void 0:l.trim())??"";d==="PHOTO"&&m?n.push({type:"photo",key:`photo-${i}`,path:m}):d==="FILE"&&m?n.push({type:"file",key:`file-${i}`,path:m}):n.push({type:"text",key:`text-${i}`,text:o[0]}),i+=1,r=c+o[0].length}return r<e.length&&n.push({type:"text",key:`text-${i}`,text:e.slice(r)}),n}function yS(e,t=42){const n=e.trim();if(!n)return"";const r=n.match(/(, \+\d+ more.*)$/),i=(r==null?void 0:r[1])??"",l=i?n.slice(0,-i.length):n;if(l.length<=t)return`${l}${i}`;const c=l.replace(/\\/g,"/").split("/").filter(Boolean);if(c.length>1){const d=[];let m=i.length+4;for(let p=c.length-1;p>=0;p-=1){const g=c[p],y=m+g.length+(d.length>0?1:0);if(d.length>0&&y>t)break;d.unshift(g),m=y}if(d.length>0)return`.../${d.join("/")}${i}`}return`...${l.slice(-(t-i.length-3))}${i}`}function FG(e){var r;const t=[];if(typeof e.changedFiles=="number"&&e.changedFiles>0&&t.push(`${e.changedFiles} ${e.changedFiles===1?"file":"files"}`),typeof e.addedLines=="number"&&e.addedLines>0&&t.push(`+${e.addedLines}`),typeof e.removedLines=="number"&&e.removedLines>0&&t.push(`-${e.removedLines}`),t.length>0)return t;const n=(r=e.previewText)==null?void 0:r.trim();return n?n.replace(/\bfiles changed\b/gi,"files").replace(/\bfile changed\b/gi,"file").split("·").map(i=>i.trim()).filter(Boolean):[]}function $G(e){return e==="userMessage"||e==="agentMessage"}function VG(e){return e==="commandExecution"||e==="webSearch"||e==="fileChange"||e==="image"||e==="contextCompaction"}function GG(e){return e==="agentMessage"||e==="reasoning"||e==="toolCall"||e==="plan"}function qG(e,t){if(!t)return e;const n=[...e],r=n.findIndex(l=>l.kind==="userMessage");if(r<0)return n;for(let l=r+1;l<n.length;l+=1){const o=n[l];if(!o||o.kind!=="userMessage")continue;let c=l+1;for(;c<n.length&&VG(n[c].kind);)c+=1;if(c===l+1)continue;const[d]=n.splice(l,1);n.splice(c-1,0,d),l=c-1}let i=!1;return n.map((l,o)=>l.kind!=="userMessage"?l:i?n.slice(o+1).some(d=>GG(d.kind))?l:{...l,status:"Awaiting response"}:(i=!0,l))}function qi(e){return typeof e.sequence=="number"&&Number.isFinite(e.sequence)}function Bf(e){return qi(e)?e.sequence:Number.POSITIVE_INFINITY}function uv(e){var m;const t=[];let n=0;for(;n<e.length&&((m=e[n])==null?void 0:m.kind)==="userMessage"&&!qi(e[n]);)t.push(e[n]),n+=1;const r=e.slice(n);if(!r.some(qi))return e;const i=r.map(p=>Bf(p)).filter(Number.isFinite),l=i.length>0?Math.max(...i):0,o=[];let c=0;for(;c<r.length;){const p=r[c];if(qi(p)){o.push({item:p,index:c,order:Bf(p)}),c+=1;continue}const g=c;for(;c<r.length&&!qi(r[c]);)c+=1;const y=r.slice(g,c),E=[...r.slice(0,g)].reverse().find(qi),v=r.slice(c).find(qi),w=E?Bf(E):null,C=v?Bf(v):null;y.forEach((S,N)=>{let R;if(w===null&&C!==null)R=C-(y.length-N)/(y.length+1);else if(w!==null&&C!==null&&C>w){const M=C-w;R=w+(N+1)/(y.length+1)*M}else R=l+1+N/(y.length+1);o.push({item:S,index:g+N,order:R})})}const d=o.sort((p,g)=>{const y=p.order-g.order;return y===0?p.index-g.index:y}).map(p=>p.item);return[...t,...d]}function YG(e,t){if(!t||t.length===0)return uv(e);const n=new Map(t.map(l=>[l.id,l])),r=e.map(l=>{const o=n.get(l.id);if(!o)return l;n.delete(l.id);const c={...l,...o,text:o.text||l.text},d=o.detailText??l.detailText,m=o.previewText??l.previewText,p=o.status??l.status,g=o.sequence??l.sequence;return d!==void 0&&(c.detailText=d),m!==void 0&&(c.previewText=m),p!==void 0&&(c.status=p),g!==void 0&&(c.sequence=g),c}),i=[...n.values()];return i.length===0&&!r.some(qi)||(r.push(...i),!r.some(l=>typeof l.sequence=="number"&&Number.isFinite(l.sequence)))?r:uv(r)}function WG(e,t){if(!e)return"";const n=t.filter(d=>d.kind==="agentMessage").map(d=>d.text).filter(d=>d.length>0),r=n.at(-1)??"";if(r){const d=e.lastIndexOf(r);if(d>=0){const m=e.slice(d+r.length);return m.trim()?m:""}}const i=n.join("");if(!i)return e;const l=Math.min(e.length,i.length);let o=0;for(;o<l&&e[o]===i[o];)o+=1;if(o===0)return e;const c=e.slice(o);return c.trim()?c:""}function xs(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("running")||t.includes("inprogress")||t.includes("in_progress")}function Nh(e){return e==="inProgress"||e==="sending"}function ag(e,t=s1){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function QG(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Math.max(n.top,r.top),l=Math.min(n.bottom,r.bottom);return Math.max(0,l-i)>0}function XG(e){var r;const t=[];let n=0;for(;n<e.length;){const i=e[n];if(!i)break;if(i.kind!=="commandExecution"&&i.kind!=="fileChange"&&i.kind!=="webSearch"){t.push({kind:"item",key:i.id,item:i}),n+=1;continue}const l=[];for(;n<e.length&&((r=e[n])==null?void 0:r.kind)===i.kind;)l.push(e[n]),n+=1;if(l.length===1){t.push({kind:"item",key:l[0].id,item:l[0]});continue}const o=l.map(c=>c.id).join(":");if(i.kind==="commandExecution"){t.push({kind:"commandGroup",key:o,items:l});continue}if(i.kind==="fileChange"){t.push({kind:"fileChangeGroup",key:o,items:l});continue}t.push({kind:"searchGroup",key:o,items:l})}return t}function cv({kind:e}){return e==="userMessage"?f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M8 8a2.75 2.75 0 1 0 0-5.5A2.75 2.75 0 0 0 8 8Z"}),f.jsx("path",{d:"M3.5 13.25a4.5 4.5 0 0 1 9 0"})]}):f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"3.25",y:"3",width:"9.5",height:"7.5",rx:"2"}),f.jsx("path",{d:"M5.5 6.75h.01M10.5 6.75h.01M6.5 12.25h3"}),f.jsx("path",{d:"M6 10.5v1.75M10 10.5v1.75"})]})}function dv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"m4 5 2 2-2 2"}),f.jsx("path",{d:"M7.75 9.5h4.25"})]})}function l1(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M6.25 4.25 3.5 7l2.75 2.75"}),f.jsx("path",{d:"M9.75 4.25 12.5 7 9.75 9.75"}),f.jsx("path",{d:"M8.9 3.5 7.1 10.5"}),f.jsx("path",{d:"M3 12.25h10"})]})}function fv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M6.25 4.5v4.25a2.75 2.75 0 1 0 2.75 2.75V7.25"}),f.jsx("path",{d:"M9 7.25a2.75 2.75 0 1 0-2.75-2.75"})]})}function hv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"2.75",y:"3",width:"8.5",height:"3",rx:"1.1"}),f.jsx("rect",{x:"4.25",y:"6.5",width:"8.5",height:"3",rx:"1.1"}),f.jsx("rect",{x:"5.75",y:"10",width:"7.5",height:"3",rx:"1.1"}),f.jsx("path",{d:"m6.25 4.5 1 1-1 1"}),f.jsx("path",{d:"M7.9 5.5h1.7"}),f.jsx("path",{d:"m7.75 8 1 1-1 1"}),f.jsx("path",{d:"M9.4 9h1.7"})]})}function mv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("circle",{cx:"7",cy:"7",r:"3.75"}),f.jsx("path",{d:"m10.25 10.25 3 3"})]})}function pv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("circle",{cx:"6",cy:"6",r:"2.3"}),f.jsx("path",{d:"m8 8 1.6 1.6"}),f.jsx("circle",{cx:"9.3",cy:"8.8",r:"2"}),f.jsx("path",{d:"m10.75 10.25 1.65 1.65"}),f.jsx("circle",{cx:"11.2",cy:"4.75",r:"1.8"}),f.jsx("path",{d:"m12.45 6 1.1 1.1"})]})}function gv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"2.75",y:"3",width:"10.5",height:"9.5",rx:"1.5"}),f.jsx("circle",{cx:"6.1",cy:"6.1",r:"1.1"}),f.jsx("path",{d:"m4.5 10 2.2-2.2 1.9 1.9 1.1-1.1 1.8 1.8"})]})}function Ah(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),f.jsx("path",{d:"M9 2.75v2h2"}),f.jsx("path",{d:"M6.2 8h3.6"}),f.jsx("path",{d:"M6.2 10h1.7"})]})}function KG(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M4.25 4.75h7.5"}),f.jsx("path",{d:"M4.25 8h7.5"}),f.jsx("path",{d:"M4.25 11.25h4.5"}),f.jsx("path",{d:"M2.25 4.75h.01M2.25 8h.01M2.25 11.25h.01"})]})}function ZG(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:f.jsx("path",{d:"m13.28 7.78 3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 0 0 1.06 1.06ZM2 17.25v-4.5a.75.75 0 0 1 1.5 0v2.69l3.22-3.22a.75.75 0 0 1 1.06 1.06L4.56 16.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.747.747 0 0 1-.75-.75ZM12.22 13.28l3.22 3.22h-2.69a.75.75 0 0 0 0 1.5h4.5a.747.747 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v2.69l-3.22-3.22a.75.75 0 1 0-1.06 1.06ZM3.5 4.56l3.22 3.22a.75.75 0 0 0 1.06-1.06L4.56 3.5h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0V4.56Z"})})}function JG(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"5.25",y:"3.25",width:"7.5",height:"9",rx:"1.5"}),f.jsx("path",{d:"M10.75 12.75H4.5a1.25 1.25 0 0 1-1.25-1.25V4.75A1.25 1.25 0 0 1 4.5 3.5h.75"})]})}function Wr({tone:e="amber"}){const t=e==="emerald"?"bg-sky-200/90":e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return f.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>f.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${t}`,style:{animationDelay:`${n*180}ms`}},n))})}function o1(e){const t=e.trim().toLowerCase();return t==="completed"||t==="done"||t==="complete"?"completed":t==="in_progress"||t==="in progress"||t==="inprogress"||t==="running"||t==="active"?"in_progress":t==="pending"||t==="todo"||t==="not_started"||t==="not started"||t==="queued"?"pending":t==="failed"||t==="error"?"failed":"other"}function eq(e){switch(e.kind){case"fileChange":case"webSearch":case"image":case"contextCompaction":return!0;case"commandExecution":case"toolCall":return!xs(e.status);default:return!1}}function tq(e,t,n){if(!e||!Nh(n))return e;const r=e.plan.findIndex(c=>o1(c.status)==="in_progress");if(r<0)return e;const i=e.plan.findIndex((c,d)=>d>r&&o1(c.status)==="pending");if(i<0||!t.some(c=>eq(c)))return e;const o=e.plan.map((c,d)=>d===r?{...c,status:"completed"}:d===i?{...c,status:"in_progress"}:c);return{...e,plan:o}}function nq(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),f.jsx("path",{d:"M8 5.25v2.9l2.05 1.2"})]})}function rq({status:e}){const t=o1(e),n=t==="completed"?"Plan step status: Completed":t==="in_progress"?"Plan step status: In progress":t==="pending"?"Plan step status: Pending":t==="failed"?"Plan step status: Failed":`Plan step status: ${e}`,r=t==="completed"?"ui-status-success":t==="in_progress"?"ui-status-info":t==="pending"?"border-stone-700/90 bg-stone-900/80 text-stone-300":t==="failed"?"border-rose-300/30 bg-rose-300/10 text-rose-100":"border-stone-700/90 bg-stone-900/80 text-stone-300";return f.jsx("span",{"aria-label":n,title:n.replace("Plan step status: ",""),className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border ${r}`,children:t==="completed"?f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):t==="in_progress"?f.jsx(Wr,{tone:"sky"}):t==="pending"?f.jsx(nq,{}):t==="failed"?f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})}):f.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function bv({status:e}){const t=bS(e);return e==="completed"?f.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-success inline-flex h-4 w-4 items-center justify-center",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})})}):e==="failed"?f.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-failed inline-flex h-4 w-4 items-center justify-center",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})})}):e==="interrupted"?f.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-warning inline-flex h-4 w-4 items-center justify-center",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M6 4.5v7M10 4.5v7"})})}):f.jsx("span",{"aria-label":t,title:t,className:"inline-flex min-w-[1.25rem] items-center justify-center text-sky-200",children:f.jsx(Wr,{tone:"emerald"})})}function xv({turn:e,variant:t="header"}){const n=bS(e.status),r=dq(e),i=uq(e),l=_S(e),o=Nh(e.status),c=e.status==="failed"?"border-rose-300/20 bg-rose-300/[0.06] text-rose-100":o?"border-sky-300/22 bg-sky-300/[0.08] text-sky-100":"border-stone-700/90 bg-stone-900/70 text-stone-200";if(t==="footer")return f.jsxs("div",{className:`flex w-full flex-col gap-1.5 rounded-[0.95rem] border px-3 py-2 text-xs ${c}`,children:[f.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx(bv,{status:e.status}),f.jsx("span",{className:"timeline-soft-text min-w-0 truncate",children:r})]}),e.startedAt&&f.jsx("time",{dateTime:e.startedAt,title:tu(e.startedAt),className:"timeline-meta-text shrink-0 text-[11px]",children:am(e.startedAt)})]}),(l||i.length>0)&&f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[l?f.jsx("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${l.className}`,title:l.title,children:l.label}):null,i.map(m=>f.jsxs("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${m.className}`,title:m.title,children:[m.icon?f.jsx("span",{className:"mr-1",children:m.icon}):null,m.label]},m.id))]})]});const d=`${n} · ${r}`;return f.jsxs("span",{className:`inline-flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 text-[10px] sm:text-[11px] ${c}`,title:d,children:[f.jsx(bv,{status:e.status}),f.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:r})]})}function aq(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M8 2.75v8"}),f.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.5"})]})}function sq(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M8 13.25v-8"}),f.jsx("path",{d:"m11.25 8.5-3.25-3.25L4.75 8.5"})]})}function iq(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M3.25 5.25 8 2.75l4.75 2.5L8 7.75l-4.75-2.5Z"}),f.jsx("path",{d:"M3.25 8 8 10.5 12.75 8"}),f.jsx("path",{d:"M3.25 10.75 8 13.25l4.75-2.5"}),f.jsx("path",{d:"M3.25 5.25v5.5"}),f.jsx("path",{d:"M12.75 5.25v5.5"})]})}function lq(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M6.2 3.2a2.3 2.3 0 0 0-2.95 3.5A2.4 2.4 0 0 0 4.5 11h.2c.25 1.1 1.1 1.8 2.3 1.8h1.8c1.2 0 2.05-.7 2.3-1.8h.2A2.4 2.4 0 0 0 12.75 6.7 2.3 2.3 0 0 0 9.8 3.2"}),f.jsx("path",{d:"M6.3 6.15c.45-.42 1.02-.65 1.7-.65s1.25.23 1.7.65"}),f.jsx("path",{d:"M8 5.5v4.75"}),f.jsx("path",{d:"M6.75 9.05 8 10.25l1.25-1.2"})]})}function Uf(e){if(!Number.isFinite(e)||e<=0)return"0";if(e>=1e6){const t=e>=1e7?Math.round(e/1e6):e/1e6;return`${String(t.toFixed(1)).replace(/\.0$/,"")}m`}if(e>=1e3){const t=e>=1e4?Math.round(e/1e3):e/1e3;return`${String(t.toFixed(1)).replace(/\.0$/,"")}k`}return String(Math.round(e))}function oq(e){return!Number.isFinite(e)||e<=0?"$0":e>=100?`$${Math.round(e)}`:e>=10?`$${String(e.toFixed(1)).replace(/\.0$/,"")}`:e>=1?`$${String(e.toFixed(2)).replace(/0$/,"").replace(/\.$/,"")}`:e>=.1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>=.001?`$${e.toFixed(4)}`:"<$0.001"}function wc(e){return!Number.isFinite(e)||e<=0?"$0.0000":`$${e.toFixed(4)}`}function Hf(e,t,n){const r=e??null;return!Number.isFinite(r??NaN)||r===null||t<=0||n<=0?null:r*n/t}function ES(e){var c,d,m,p,g;const t=(c=e.tokenUsage)==null?void 0:c.total;if(!t)return[];const n=Math.max(t.inputTokens-t.cachedInputTokens,0),r=Math.max(t.cachedInputTokens,0),i=Math.max(t.reasoningOutputTokens,0),l=Math.max(t.outputTokens-i,0);return[n>0?{id:"in",label:"Input",tokenCompactValue:Uf(n),tokenRawValue:n,usdCompactValue:e.priceEstimate?wc(e.priceEstimate.inputUsd):"--",usdRawValue:((d=e.priceEstimate)==null?void 0:d.inputUsd)??null,className:"token-badge-in",icon:f.jsx(aq,{})}:null,r>0?{id:"cache",label:"Cached input",tokenCompactValue:Uf(r),tokenRawValue:r,usdCompactValue:e.priceEstimate?wc(e.priceEstimate.cachedInputUsd):"--",usdRawValue:((m=e.priceEstimate)==null?void 0:m.cachedInputUsd)??null,className:"token-badge-cache",icon:f.jsx(iq,{})}:null,l>0?{id:"out",label:"Output",tokenCompactValue:Uf(l),tokenRawValue:l,usdCompactValue:e.priceEstimate?wc(Hf(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),l)??0):"--",usdRawValue:Hf((p=e.priceEstimate)==null?void 0:p.outputUsd,Math.max(t.outputTokens,0),l),className:"token-badge-out",icon:f.jsx(sq,{})}:null,i>0?{id:"reason",label:"Reasoning",tokenCompactValue:Uf(i),tokenRawValue:i,usdCompactValue:e.priceEstimate?wc(Hf(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),i)??0):"--",usdRawValue:Hf((g=e.priceEstimate)==null?void 0:g.outputUsd,Math.max(t.outputTokens,0),i),className:"token-badge-reason",icon:f.jsx(lq,{})}:null].filter(y=>y!==null)}function uq(e){return ES(e).map(t=>({id:t.id,label:t.tokenCompactValue,title:`${t.label}: ${t.tokenRawValue} tokens`,className:t.className,icon:t.icon}))}function _S(e){return{label:e.priceEstimate?oq(e.priceEstimate.totalUsd):"--",title:e.priceEstimate===null||e.priceEstimate===void 0?"Price estimate unavailable for this model.":`Estimated cost: ${wc(e.priceEstimate.totalUsd)}`,className:e.priceEstimate?"token-badge-total":"token-badge-empty"}}const sg="inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-normal leading-none sm:text-[11px]";function cq({turn:e}){const t=ES(e),n=_S(e),[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,d]=T.useState(0),m=T.useRef(null),p=T.useRef(null),g=T.useRef(null);if(T.useLayoutEffect(()=>{if(!r||t.length===0){d(0);return}const E=()=>{const v=m.current,w=g.current;if(!v||!w)return;const C=v.getBoundingClientRect(),S=w.offsetWidth||w.getBoundingClientRect().width;if(S<=0)return;const N=window.innerWidth||document.documentElement.clientWidth,R=12,M=C.left+C.width/2-S/2,Y=R,U=Math.max(Y,N-R-S),P=Math.min(Math.max(M,Y),U);d(Math.round(P-M))};return E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[t.length,r]),T.useEffect(()=>{if(!r&&!l)return;const E=v=>{v.target instanceof Node&&(m.current&&!m.current.contains(v.target)&&i(!1),p.current&&!p.current.contains(v.target)&&o(!1))};return document.addEventListener("pointerdown",E),()=>{document.removeEventListener("pointerdown",E)}},[l,r]),!n&&t.length===0)return null;const y=()=>f.jsx("div",{className:"thread-token-popover min-w-[12rem] rounded-2xl border p-2.5 shadow-2xl shadow-black/20 backdrop-blur",children:f.jsx("div",{className:"space-y-1",children:t.map(E=>f.jsxs("div",{className:"thread-token-popover-row flex items-center justify-between gap-3 rounded-xl border px-2.5 py-1.5 text-[11px]",title:`${E.label}: ${E.tokenRawValue} tokens`,children:[f.jsxs("span",{className:"thread-token-popover-text inline-flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"inline-flex shrink-0",children:E.icon}),f.jsx("span",{className:"thread-token-popover-strong font-medium",children:E.usdCompactValue})]}),f.jsx("span",{className:"thread-token-popover-text shrink-0 font-medium",children:E.tokenCompactValue})]},E.id))})});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 md:inline-flex",children:[n?f.jsxs("div",{ref:p,className:"relative shrink-0",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[f.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":l,onFocus:()=>o(!0),onBlur:()=>o(!1),className:`${sg} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}),l&&t.length>0?f.jsx("div",{className:"absolute left-1/2 top-full z-30 mt-1.5 -translate-x-1/2",children:y()}):null]}):null,t.map(E=>f.jsxs("span",{className:`${sg} ${E.className}`,title:`${E.label}: ${E.usdCompactValue}, ${E.tokenRawValue} tokens`,children:[E.icon,f.jsx("span",{className:"font-medium text-stone-100",children:E.tokenCompactValue})]},E.id))]}),f.jsxs("div",{ref:m,className:"relative shrink-0 md:hidden",children:[n?f.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":r,onClick:()=>i(E=>!E),className:`${sg} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}):null,r&&t.length>0?f.jsx("div",{ref:g,className:"absolute left-1/2 top-full z-30 mt-1.5",style:{transform:`translateX(${c}px) translateX(-50%)`},children:y()}):null]})]})}function dq(e){var r;const t=(r=e.model)!=null&&r.trim()?e.model.trim():"--";let n="--";return e.reasoningEffortAvailable===null||e.reasoningEffortAvailable===void 0?n="--":e.reasoningEffortAvailable===!1?n="-":n=e.reasoningEffort??"--",[t,n].join(" · ")}function fq({text:e,className:t="agent-markdown"}){return f.jsx(hS,{mode:"static",plugins:{code:j8},controls:!1,lineNumbers:!1,remarkPlugins:mq,className:t,children:e})}function hq(){return e=>{TS(e)}}const mq=[...Object.values(uS),hq];function TS(e){if(!Array.isArray(e.children))return;const t=[];for(const n of e.children){if(n.type==="text"&&typeof n.value=="string"&&n.value.includes(`
|
|
375
|
-
`)){n.value.split(`
|
|
376
|
-
`).forEach((i,l)=>{l>0&&t.push({type:"break"}),i&&t.push({...n,value:i})});continue}TS(n),t.push(n)}e.children=t}const pq=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,gq=/[),.;:!?]+$/;function bq(e){return e.startsWith("www.")?`https://${e}`:e}function Rh({text:e}){var r;const t=[];let n=0;for(const i of e.matchAll(pq)){const l=i[0],o=i.index??0,c=((r=l.match(gq))==null?void 0:r[0])??"",d=c?l.slice(0,-c.length):l;d&&(o>n&&t.push(e.slice(n,o)),t.push(f.jsx("a",{href:bq(d),target:"_blank",rel:"noreferrer",className:"thread-inline-link",children:d},`${o}-${d}`)),c&&t.push(c),n=o+l.length)}return n<e.length&&t.push(e.slice(n)),f.jsx(f.Fragment,{children:t.length>0?t:e})}function vS({text:e,scrollRootRef:t,streaming:n=!1,containerClassName:r="",plainTextClassName:i="whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-100",markdownClassName:l="agent-markdown"}){const o=T.useRef(null),c=MG(e),[d,m]=T.useState(n||typeof IntersectionObserver>"u");return T.useEffect(()=>{if(n||typeof IntersectionObserver>"u"){m(!0);return}if(d||!o.current)return;const p=new IntersectionObserver(g=>{for(const y of g)if(y.isIntersecting){m(!0),p.disconnect();break}},{root:t.current,threshold:0});return p.observe(o.current),()=>{p.disconnect()}},[d,t,n]),f.jsx("div",{ref:o,className:r,children:d&&c?f.jsx(fq,{text:e,className:l}):f.jsx("p",{className:i,children:f.jsx(Rh,{text:e})})})}function xq({text:e,scrollRootRef:t,streaming:n=!1}){return f.jsx(vS,{text:e,scrollRootRef:t,streaming:n,containerClassName:"thread-message-prose"})}function yq({threadId:e,text:t}){const n=T.useMemo(()=>zG(t),[t]);return f.jsx("div",{className:"thread-message-prose whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-300",children:n.map(r=>{if(r.type==="text")return f.jsx("span",{children:r.text},r.key);if(r.type==="photo"){const l=e?`/api/threads/${e}/assets/image?path=${encodeURIComponent(r.path)}`:null,o=ov(r.path)||"Attached image";return f.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:f.jsxs("span",{className:"inline-flex max-w-full flex-col rounded-[1rem] border border-sky-300/28 bg-sky-300/[0.08] p-1.5 shadow-sm shadow-stone-950/20",children:[l?f.jsx("img",{src:l,alt:o,className:"h-[4.5rem] w-[6rem] rounded-[0.75rem] bg-stone-950 object-contain",loading:"lazy"}):f.jsx("span",{className:"inline-flex h-[4.5rem] w-[6rem] items-center justify-center rounded-[0.75rem] bg-stone-950 text-[10px] text-sky-100",children:"PHOTO"}),f.jsx("span",{className:"mt-1 max-w-[7rem] truncate text-[10px] font-medium tracking-[0.08em] text-sky-50",title:r.path,children:o})]})},r.key)}const i=ov(r.path)||"Attached file";return f.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:f.jsxs("span",{className:"inline-flex max-w-[12rem] items-center gap-2 rounded-[0.95rem] border border-emerald-300/28 bg-emerald-300/[0.08] px-2.5 py-2 text-[10px] font-medium tracking-[0.08em] text-emerald-50 shadow-sm shadow-stone-950/20",title:r.path,children:[f.jsx("span",{className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/20 bg-emerald-300/12 text-[9px]",children:"FILE"}),f.jsx("span",{className:"min-w-0 truncate",children:i})]})},r.key)})})}function kS(e){return e==="completed"?"timeline-command-status-complete":"timeline-command-status-pending"}function wS({status:e}){return e==="completed"?f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):f.jsx(Wr,{tone:"emerald"})}const Pc=T.memo(function({threadId:t,item:n,scrollRootRef:r,streaming:i=!1}){const[l,o]=T.useState("idle"),c=T.useRef(null),d=n.kind==="userMessage"?"thread-message-icon thread-message-icon-user":"thread-message-icon thread-message-icon-agent",m=n.kind==="userMessage"&&(n.status==="Steering"||n.status==="Accepted"||n.status==="Awaiting response"),p=n.status==="Steering"?"ui-status-warning":n.status==="Accepted"?"ui-status-success":"ui-status-info";T.useEffect(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);async function g(){try{await navigator.clipboard.writeText(n.text),o("copied"),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>o("idle"),1200)}catch{o("failed"),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>o("idle"),1600)}}return f.jsxs("div",{className:`timeline-item-frame ${n.kind==="agentMessage"?"timeline-has-corner-copy":""} relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(n.kind)} ${vs(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[m&&f.jsxs("span",{className:`absolute right-2.5 top-2.5 z-[1] inline-flex items-center gap-1 rounded-full border px-2 py-1 text-[10px] font-medium tracking-[0.12em] shadow-sm shadow-stone-950/20 ${p}`,children:[f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M3.25 8A4.75 4.75 0 0 1 8 3.25h2.75"}),f.jsx("path",{d:"m9.5 1.75 1.75 1.5-1.75 1.5"}),f.jsx("path",{d:"M12.75 8A4.75 4.75 0 0 1 8 12.75H5.25"}),f.jsx("path",{d:"m6.5 14.25-1.75-1.5 1.75-1.5"})]}),f.jsx("span",{children:n.status})]}),f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${d}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(cv,{kind:n.kind})})}),f.jsxs("div",{className:"timeline-message-content timeline-mobile-bubble-content flex min-w-0 items-start gap-0 pt-2 sm:gap-2.5 sm:pt-0",children:[f.jsxs("div",{className:"hidden",children:[f.jsx("span",{className:`hidden h-6 w-6 items-center justify-center rounded-full border sm:inline-flex ${d}`,children:f.jsx(cv,{kind:n.kind})}),i&&n.kind==="agentMessage"&&f.jsx("span",{className:"hidden sm:inline-flex",children:f.jsx(Wr,{tone:"emerald"})})]}),f.jsxs("div",{className:"min-w-0 flex-1",children:[n.kind==="agentMessage"?f.jsx(xq,{text:n.text,scrollRootRef:r,streaming:i}):f.jsx(yq,{threadId:t,text:n.text}),n.status&&!m&&f.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]}),i&&n.kind==="agentMessage"&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Wr,{tone:"emerald"})}),n.kind==="agentMessage"&&f.jsx("button",{type:"button","aria-label":"Copy agent reply",title:l==="copied"?"Copied":l==="failed"?"Copy failed":"Copy agent reply",onClick:()=>void g(),className:"timeline-corner-copy absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center transition",children:f.jsx("span",{className:`timeline-corner-copy-visual inline-flex items-center justify-center border shadow-sm shadow-stone-950/25 backdrop-blur transition ${l==="copied"?"ui-status-info":l==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:f.jsx(JG,{})})})]})}),Eq=T.memo(function({item:t,onOpen:n}){const r=Eu(t.text);return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("command")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(dv,{})})}),xs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Wr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-amber-300/25 bg-amber-300/10 text-amber-200",children:f.jsx(dv,{})}),xs(t.status)&&f.jsx(Wr,{})]}),f.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-label":t.status?`Command status: ${t.status}`:"Command status",title:t.status??"Command status",onClick:()=>n(t,"Command Output"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${kS(t.status)} hover:brightness-110`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(wS,{status:t.status})})}),f.jsx("button",{type:"button","aria-label":"Open full command",onClick:()=>n(t,"Command Output"),className:"block w-full text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),_q=T.memo(function({item:t,onOpen:n}){const r=Eu(t.text);return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(l1,{})})}),xs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Wr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-100",children:f.jsx(l1,{})}),xs(t.status)&&f.jsx(Wr,{})]}),f.jsxs("div",{className:"timeline-item-inner relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-label":t.status?`Tool status: ${t.status}`:"Tool status",title:t.status??"Tool status",onClick:()=>n(t,"Tool Call Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${kS(t.status)} hover:brightness-110`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(wS,{status:t.status})})}),f.jsx("button",{type:"button","aria-label":"Open full tool call",onClick:()=>n(t,"Tool Call Details"),className:"block w-full text-left",children:f.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Tq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.filter(c=>xs(c.status)).length,o=t.length===1?"1 command":`${t.length} commands`;return f.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-warning px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("command")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(hv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-amber-300/30 bg-amber-300/[0.14] text-amber-100 shadow-sm shadow-stone-950/20",children:[f.jsx(hv,{}),f.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-amber-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-amber-100",children:t.length})]}),l>0&&f.jsx(Wr,{})]}),f.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} command entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.jsx("span",{className:"rounded-full border border-amber-300/28 bg-amber-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-amber-100",children:"Batch"}),f.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:o}),l>0&&f.jsx("span",{className:"inline-flex items-center text-xs text-amber-100/90",children:f.jsx(Wr,{})})]})}),n&&f.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-amber-300/12 pt-3 sm:space-y-2",children:t.map((c,d)=>{const m=Eu(c.text);return f.jsxs("button",{type:"button","aria-label":`Open grouped command ${d+1}`,onClick:()=>i(c,`Command Output ${d+1}`),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs("span",{className:"rounded-full border border-amber-300/18 bg-amber-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-amber-100",children:["Step ",d+1]}),c.status&&f.jsx("span",{className:"timeline-meta-text text-xs",children:c.status})]}),f.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:m.firstLine}),m.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},c.id)})})]})]})]})}),vq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.length===1?"1 search":`${t.length} searches`;return f.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-info px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(pv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-sky-300/30 bg-sky-300/[0.14] text-sky-100 shadow-sm shadow-stone-950/20",children:[f.jsx(pv,{}),f.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-sky-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-sky-100",children:t.length})]})}),f.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} web search entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.jsx("span",{className:"rounded-full border border-sky-300/28 bg-sky-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-sky-100",children:"Batch"}),f.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l})]})}),n&&f.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-sky-300/12 pt-3 sm:space-y-2",children:t.map((o,c)=>{var g,y;const d=((g=o.previewText)==null?void 0:g.trim())||o.text||"Web search",m=Eu(d),p=((y=o.detailText)==null?void 0:y.trim())||o.text||"Web search";return f.jsxs("button",{type:"button","aria-label":`Open grouped web search ${c+1}`,onClick:()=>i(`Web Search ${c+1}`,p),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs("span",{className:"rounded-full border border-sky-300/18 bg-sky-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-100",children:["Search ",c+1]}),o.status&&f.jsx("span",{className:"timeline-meta-text text-xs",children:o.status})]}),f.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:m.firstLine}),m.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},o.id)})})]})]})]})}),kq=T.memo(function({item:t,scrollRootRef:n}){return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(KG,{})})}),f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("span",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:xS(t.kind)}),t.status&&f.jsx("span",{className:"timeline-meta-text text-xs",children:t.status})]}),f.jsx("div",{className:"mt-1.5",children:f.jsx(vS,{text:t.text,scrollRootRef:n,plainTextClassName:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-300",markdownClassName:"agent-markdown text-sm"})})]})}),wq=T.memo(function({item:t}){const n=xs(t.status)||t.text==="Compacting context",r=n?"Compacting context":"Context compacted",i=t.detailText&&t.detailText!==r?t.detailText:null;return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:"absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border border-teal-300/30 bg-teal-300/12 text-[10px] text-teal-100 shadow-sm shadow-stone-950/20 sm:hidden",children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(iv,{})})}),f.jsxs("div",{className:"flex min-w-0 items-center gap-2 pt-2 sm:pt-0",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 sm:flex",children:f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-teal-300/25 bg-teal-300/10 text-teal-100",children:f.jsx(iv,{})})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("p",{className:"timeline-primary-text truncate text-[13px] font-medium sm:text-sm",children:r}),n?f.jsx(Wr,{tone:"emerald"}):null]}),i?f.jsx("p",{className:"timeline-meta-text mt-0.5 truncate text-[11px] sm:text-xs",title:i,children:i}):null]})]})]})}),Cq=T.memo(function({item:t,onOpen:n}){var o,c;const r=((o=t.previewText)==null?void 0:o.trim())||t.text||"Web search",i=((c=t.detailText)==null?void 0:c.trim())||t.text||"Web search",l=Eu(r);return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(mv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-sky-300/25 bg-sky-300/10 text-sky-100",children:f.jsx(mv,{})})}),f.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-label":"Expand web search",title:"Expand web search",onClick:()=>n("Web Search Details",i),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${ja("action")} hover:bg-stone-800`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(ZG,{})})}),t.status&&f.jsx("p",{className:"timeline-meta-text pr-8 text-xs sm:pr-10",children:t.status}),f.jsx("button",{type:"button","aria-label":"Open full web search",onClick:()=>n("Web Search Details",i),className:"block w-full text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:l.firstLine}),l.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),Sq=T.memo(function({threadId:t,item:n,onOpen:r}){const i=n.assetPath??n.detailText??null,l=t&&i?`/api/threads/${t}/assets/image?path=${encodeURIComponent(i)}`:null;return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(n.kind)} ${vs(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(gv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-indigo-300/25 bg-indigo-300/10 text-indigo-100",children:f.jsx(gv,{})})}),f.jsxs("div",{className:"min-w-0 w-full flex-1",children:[l?f.jsx("button",{type:"button",onClick:()=>r("Image Path",i??n.text),className:"block w-full text-left",children:f.jsx("img",{src:l,alt:n.text||"Image preview",className:"max-h-[24rem] w-full rounded-xl border border-stone-700/80 bg-stone-950 object-contain",loading:"lazy"})}):f.jsx("div",{className:"timeline-item-inner rounded-xl border px-3 py-3 text-sm",children:n.text}),i&&f.jsx("button",{type:"button",onClick:()=>r("Image Path",i),className:"timeline-meta-text mt-2 block max-w-full truncate text-left text-xs hover:text-[var(--theme-fg)]",title:i,children:i}),n.status&&f.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]})]})}),Nq=T.memo(function({item:t,onOpen:n}){var d,m,p;const r=(d=t.previewText)!=null&&d.trim()&&t.text.trim()!==t.previewText.trim()?t.text.trim():null,i=((m=t.detailText)==null?void 0:m.trim())||null,l=yS(r??((p=t.previewText)==null?void 0:p.trim())??t.text,48),o=FG(t),c=i?"button":"div";return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(Ah,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-lime-300/25 bg-lime-300/10 text-lime-100",children:f.jsx(Ah,{})})}),f.jsx(c,{...i?{type:"button","aria-label":"Open file change details",onClick:()=>n("File Change Details",i)}:{},className:`timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2.5 py-2 text-left sm:rounded-xl sm:px-3 ${i?"transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]":""}`,children:f.jsxs("div",{className:"timeline-mobile-file-line flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip text-sm",title:r??l,children:l}),o.length>0&&f.jsx("div",{className:"inline-flex shrink-0 items-center justify-end gap-1.5 text-xs",children:o.map(g=>f.jsx("span",{className:`timeline-delta-badge border ${g.startsWith("+")?"timeline-delta-badge-add text-emerald-300":g.startsWith("-")?"timeline-delta-badge-remove text-rose-300":"timeline-delta-badge-neutral"}`,children:g},g))})]})})]})]})}),Aq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.reduce((m,p)=>m+(p.changedFiles??0),0),o=t.reduce((m,p)=>m+(p.addedLines??0),0),c=t.reduce((m,p)=>m+(p.removedLines??0),0),d=t.length===1?"1 file change":`${t.length} file changes`;return f.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-success px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(Ah,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-lime-300/30 bg-lime-300/[0.14] text-lime-100 shadow-sm shadow-stone-950/20",children:[f.jsx(Ah,{}),f.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-lime-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-lime-100",children:t.length})]})}),f.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsxs("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} file change entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:[f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.jsx("span",{className:"rounded-full border border-lime-300/28 bg-lime-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-lime-100",children:"Batch"}),f.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:d}),l>0&&f.jsxs("span",{className:"timeline-meta-text text-xs",children:[l," files"]})]}),f.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[o>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",o]}),c>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",c]})]})]}),n&&f.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-lime-300/12 pt-3 sm:space-y-2",children:t.map((m,p)=>{var E,v,w,C;const g=((E=m.detailText)==null?void 0:E.trim())||((v=m.previewText)==null?void 0:v.trim())||m.text,y=(w=m.previewText)!=null&&w.trim()&&m.text.trim()!==m.previewText.trim()?m.text.trim():((C=m.previewText)==null?void 0:C.trim())||m.text;return f.jsx("button",{type:"button","aria-label":`Open grouped file change ${p+1}`,onClick:()=>i(`File Change ${p+1}`,g),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 text-sm leading-6",title:y,children:yS(y,34)}),f.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(m.addedLines??0)>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",m.addedLines]}),(m.removedLines??0)>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",m.removedLines]})]})]})},m.id)})})]})]})]})}),Rq=T.memo(function({item:t}){return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(l1,{})})}),f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[f.jsx("span",{className:"timeline-meta-text text-[10px] uppercase tracking-[0.16em]",children:xS(t.kind)}),t.status&&f.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),f.jsx("pre",{className:`timeline-soft-text mt-1 whitespace-pre-wrap break-words text-[13px] leading-5 ${BG(t.kind)?"max-h-56 overflow-auto":""}`,children:f.jsx(Rh,{text:t.text})})]})}),Lq=T.memo(function({item:t}){var d,m;const n=((d=t.hookOutputEntries)==null?void 0:d.map(p=>p.text.trim()).filter(Boolean).join(`
|
|
377
|
-
`).trim())??"",r=t.hookEventLabel?`${t.hookEventLabel} hook`:t.text,i=((m=t.hookStatusMessage)==null?void 0:m.trim())||(t.previewText&&t.previewText!==t.hookStatusMessage?t.previewText.trim():"")||t.text.trim(),o=Eu(n||(i&&i!==r?i:r)),c=!!(n&&o.showGap);return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${Ts(t.kind)} ${vs(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${ja("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(fv,{})})}),xs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Wr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-200",children:f.jsx(fv,{})}),xs(t.status)&&f.jsx(Wr,{})]}),f.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[f.jsxs("span",{className:"timeline-meta-text min-w-0 truncate text-[10px] uppercase tracking-[0.16em]",children:["Hook · ",t.hookEventLabel??t.text]}),t.status&&f.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),f.jsxs("div",{className:"timeline-mobile-dense-line mt-1.5 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:n?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"timeline-meta-text mr-2 font-sans text-[11px] uppercase tracking-[0.12em]",children:r}),f.jsx(Rh,{text:o.firstLine})]}):f.jsx(Rh,{text:o.firstLine&&o.firstLine!==r?`${r} · ${o.firstLine}`:r})}),c?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]})]})]})}),u1=T.memo(function({threadId:t,item:n,scrollRootRef:r,onOpenExpandedText:i,onOpenCommandDetail:l,onOpenToolCallDetail:o}){return $G(n.kind)?f.jsx(Pc,{threadId:t,item:n,scrollRootRef:r}):n.kind==="commandExecution"?f.jsx(Eq,{item:n,onOpen:l}):n.kind==="toolCall"?f.jsx(_q,{item:n,onOpen:o}):n.kind==="webSearch"?f.jsx(Cq,{item:n,onOpen:i}):n.kind==="image"?f.jsx(Sq,{threadId:t,item:n,onOpen:i}):n.kind==="plan"?f.jsx(kq,{item:n,scrollRootRef:r}):n.kind==="fileChange"?f.jsx(Nq,{item:n,onOpen:i}):n.kind==="contextCompaction"?f.jsx(wq,{item:n}):n.kind==="hook"?f.jsx(Lq,{item:n}):f.jsx(Rq,{item:n})});function zf({request:e,busy:t=!1,onRespond:n}){const[r,i]=T.useState({}),[l,o]=T.useState({}),[c,d]=T.useState(null),m=e.questions[0]??null,p="__other__",g=e.kind==="planDecision"?"Plan":e.kind==="requestUserInput"?"Answer Required":e.title;function y(w){const C=/\s*\(recommended\)\s*$/i.test(w);return{rawLabel:w,displayLabel:w.replace(/\s*\(recommended\)\s*$/i,"").trim(),recommended:C}}function E(w){m&&(d(w),n==null||n(e.id,{answers:{[m.id]:{answers:[w]}}}))}function v(w){const C=r[w.id]??"";return C===p?(l[w.id]??"").trim():C.trim()}return f.jsxs("div",{className:"timeline-pending-card w-full rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem] sm:px-4",children:[f.jsx("div",{className:"flex items-center justify-between gap-3",children:f.jsxs("div",{children:[f.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:g}),e.kind!=="planDecision"&&e.description&&f.jsx("p",{className:"timeline-soft-text mt-1 text-[13px] leading-5",children:e.description})]})}),f.jsx("div",{className:"mt-3 space-y-3",children:e.questions.map(w=>f.jsxs("div",{className:"timeline-question-section rounded-xl border p-2.5 sm:p-3",children:[f.jsx("p",{className:"timeline-meta-text text-xs uppercase tracking-[0.2em]",children:w.header}),f.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5 sm:text-sm",children:w.question}),e.kind==="planDecision"&&w.options&&w.options.length>0?f.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:w.options.map((C,S)=>{const N=y(C.label),R=N.displayLabel.toLowerCase()==="implement";return f.jsxs("button",{type:"button",disabled:t,onClick:()=>E(C.label),className:`relative rounded-2xl border px-2.5 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${S===0?"ui-action-info":"border-stone-700 text-stone-200 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:C.description,children:[N.recommended?f.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/18 text-[10px] leading-none text-current",children:"✦"}):null,t&&c===C.label?R?"Starting...":"Saving...":N.displayLabel]},C.label)})}):w.options&&w.options.length>0?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[w.options.map(C=>{const S=y(C.label);return f.jsxs("button",{type:"button",disabled:t,onClick:()=>i(N=>({...N,[w.id]:C.label})),className:`relative rounded-2xl border px-3 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${r[w.id]===C.label?"ui-status-warning":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:C.description,children:[S.recommended?f.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/10 text-[10px] leading-none text-amber-100/90",children:"✦"}):null,S.displayLabel]},C.label)}),w.isOther&&f.jsx("button",{type:"button",disabled:t,onClick:()=>i(C=>({...C,[w.id]:p})),className:`rounded-2xl border px-3 py-1.5 text-[12px] leading-4 transition sm:text-[13px] ${r[w.id]===p?"ui-status-info":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Not from above"})]}),w.isOther&&r[w.id]===p&&f.jsx("input",{"aria-label":`${w.header} custom answer`,value:l[w.id]??"",onChange:C=>o(S=>({...S,[w.id]:C.target.value})),placeholder:"Enter a custom answer",className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-sky-300"})]}):f.jsx("input",{"aria-label":w.header,value:r[w.id]??"",onChange:C=>i(S=>({...S,[w.id]:C.target.value})),className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-amber-300"})]},w.id))}),e.kind!=="planDecision"&&f.jsx("div",{className:"mt-3 flex justify-end",children:f.jsx("button",{type:"button",disabled:t||e.questions.some(w=>!v(w)),onClick:()=>void(n==null?void 0:n(e.id,{answers:Object.fromEntries(e.questions.map(w=>[w.id,{answers:[v(w)]}]))})),className:"ui-action-info rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:t?"Submitting...":"Submit"})})]})}function Ff({note:e}){return f.jsxs("div",{className:"timeline-note-card w-full rounded-2xl border px-3 py-2.5",children:[f.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:e.title}),f.jsx("div",{className:"mt-1 space-y-1",children:e.summaryLines.map((t,n)=>f.jsxs("p",{className:"timeline-primary-text text-[13px] leading-5",children:["You selected ",t]},`${e.id}-${n}`))})]})}function Fo({note:e,onOpenThread:t}){const n=e.kind==="forkCreated"?"Fork":e.kind==="forkSource"?"Fork source":"System",r=e.kind==="forkCreated"?`Thread forked from Turn ${e.turnIndex??"?"}`:e.kind==="forkSource"?`Forked from ${e.linkedThreadTitle??"source thread"} at Turn ${e.turnIndex??"?"}`:e.text??"";return f.jsxs("div",{className:"timeline-activity-card w-full rounded-2xl border px-3 py-2.5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:n}),f.jsx("time",{dateTime:e.createdAt,title:tu(e.createdAt),className:"timeline-meta-text text-[10px]",children:am(e.createdAt)})]}),f.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5",children:r}),e.linkedThreadId?f.jsx("button",{type:"button",onClick:()=>{if(t){t(e.linkedThreadId);return}typeof window<"u"&&window.location.assign(`/threads/${e.linkedThreadId}`)},className:"relative z-10 mt-2 inline-flex cursor-pointer rounded-full border border-amber-300/30 px-3 py-1.5 text-xs text-amber-100 transition hover:bg-amber-300/10",children:e.kind==="forkCreated"?"Open fork":"Back to source"}):null]})}const yv=T.memo(function({threadId:t,turn:n,absoluteIndex:r,isCollapsed:i,livePlan:l,liveItems:o,liveOutput:c,onToggleCollapse:d,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g,scrollRootRef:y,articleRef:E}){const v=T.useMemo(()=>YG(n.items,o),[o,n.items]),w=T.useMemo(()=>tq(l,v,n.status),[l,v,n.status]),C=T.useMemo(()=>qG(v,Nh(n.status)),[v,n.status]),S=T.useMemo(()=>XG(C),[C]),N=T.useMemo(()=>WG(c,v),[c,v]),R=T.useMemo(()=>i1(N),[N]),[M,Y]=T.useState({}),U=T.useCallback(P=>{Y(q=>({...q,[P]:!q[P]}))},[]);return f.jsxs("article",{ref:E,className:"px-2 py-1.5 sm:px-6 sm:py-2",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-1.5",children:[f.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden",children:[f.jsxs("span",{className:"timeline-meta-text rounded-[0.6rem] border border-stone-700 px-1.5 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Turn ",r]}),f.jsx("time",{dateTime:n.startedAt??void 0,title:tu(n.startedAt),className:"timeline-meta-text shrink-0 text-[10px] sm:text-[11px]",children:am(n.startedAt)}),f.jsx(xv,{turn:n}),n.error&&f.jsx("p",{className:"hidden truncate text-[11px] text-rose-200 sm:block",children:n.error})]}),f.jsx(cq,{turn:n})]}),f.jsx("button",{type:"button","aria-label":`${i?"Expand":"Collapse"} turn ${r}`,title:i?"Expand turn":"Collapse turn",onClick:()=>d(n.id),className:"timeline-compact-action timeline-meta-text inline-flex h-5 w-5 shrink-0 items-center justify-center transition hover:text-[var(--theme-fg)]",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:i?f.jsx("path",{d:"m4.5 10 3.5-3.5L11.5 10"}):f.jsx("path",{d:"m4.5 6 3.5 3.5L11.5 6"})})})]}),n.error&&f.jsx("p",{className:"mt-1 text-[11px] text-rose-200 sm:hidden",children:n.error}),!i&&f.jsxs("div",{className:"mt-1.5 space-y-1.5",children:[S.map(P=>P.kind==="commandGroup"?f.jsx(Tq,{items:P.items,expanded:M[P.key]??!1,onToggleExpanded:()=>U(P.key),onOpen:p},P.key):P.kind==="fileChangeGroup"?f.jsx(Aq,{items:P.items,expanded:M[P.key]??!1,onToggleExpanded:()=>U(P.key),onOpen:m},P.key):P.kind==="searchGroup"?f.jsx(vq,{items:P.items,expanded:M[P.key]??!1,onToggleExpanded:()=>U(P.key),onOpen:m},P.key):f.jsx(u1,{threadId:t,item:P.item,scrollRootRef:y,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g},P.key)),w&&f.jsxs("div",{className:"timeline-live-plan-card rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem]",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:"Plan update"}),f.jsx("span",{className:"rounded-full border border-sky-300/40 px-2 py-1 text-[11px] uppercase tracking-[0.2em] text-sky-200",children:"Live"})]}),w.explanation&&f.jsx("p",{className:"timeline-soft-text mt-3 text-sm",children:w.explanation}),f.jsx("div",{className:"mt-3 space-y-2",children:w.plan.map((P,q)=>f.jsxs("div",{className:"timeline-live-plan-step flex items-center justify-between gap-3 rounded-xl border px-3 py-2 text-sm",children:[f.jsx("span",{className:"timeline-primary-text min-w-0 flex-1",children:P.step}),f.jsx(rq,{status:P.status})]},`${w.turnId}-${q}`))})]}),R?f.jsx(u1,{threadId:t,item:R,scrollRootRef:y,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g}):N?f.jsx(Pc,{item:{id:"live-agent-message",kind:"agentMessage",text:N},scrollRootRef:y,streaming:!0}):null,Nh(n.status)&&f.jsx(xv,{turn:n,variant:"footer"})]})]})});function Iq({threadId:e,turns:t,totalTurnCount:n,pendingRequests:r=[],pendingSteers:i=[],livePlan:l=null,liveItems:o=null,respondingRequestId:c=null,onRespondToRequest:d,liveOutput:m,scrollRequestKey:p=0,bottomSpacer:g=0,className:y="",onTailVisibilityChange:E,loadingEarlier:v=!1,onLoadEarlier:w,ephemeralUserNote:C=null,answeredRequestNotes:S=[],activityNotes:N=[],optimisticSteers:R=[],optimisticTurn:M=null,onLoadHistoryItemDetail:Y,onOpenThread:U}){var Je,Be,dt;const P=T.useRef(null),q=T.useRef(null),le=T.useRef(p),X=T.useRef(null),fe=T.useRef(g),F=T.useRef(0),Te=T.useRef(null),me=T.useRef(!0),ne=T.useRef(!0),$=T.useRef(0),z=T.useRef(new Map),[Z,ce]=T.useState(sv),[A,H]=T.useState(0),[te,O]=T.useState(null),[ve,Re]=T.useState({}),[Ne,Qe]=T.useState(!0),Ve=T.useMemo(()=>JSON.stringify({turns:t.map(Q=>({id:Q.id,status:Q.status,startedAt:Q.startedAt,error:Q.error,items:Q.items.map(_e=>({id:_e.id,kind:_e.kind,status:_e.status,textLength:_e.text.length}))})),pendingRequests:r.map(Q=>({id:Q.id,turnId:Q.turnId,title:Q.title})),pendingSteers:i.map(Q=>({id:Q.id,turnId:Q.turnId,prompt:Q.prompt,clientRequestId:Q.clientRequestId})),optimisticSteers:R.map(Q=>({id:Q.id,turnId:Q.turnId,prompt:Q.prompt,status:Q.status})),liveOutputLength:m.length,livePlan:l===null?null:{turnId:l.turnId,explanation:l.explanation,steps:l.plan.map(Q=>`${Q.status}:${Q.step}`)},liveItems:o===null?null:{turnId:o.turnId,items:o.items.map(Q=>({id:Q.id,kind:Q.kind,status:Q.status,textLength:Q.text.length}))},optimisticTurn:M===null?null:{id:M.id,status:M.status,error:M.error,items:M.items.map(Q=>({id:Q.id,kind:Q.kind,textLength:Q.text.length}))},answeredRequestNotes:S.map(Q=>({id:Q.id,turnId:Q.turnId??null,title:Q.title,createdAt:Q.createdAt??"",summaryLines:Q.summaryLines})),activityNotes:N.map(Q=>({id:Q.id,kind:Q.kind,text:Q.text,createdAt:Q.createdAt})),ephemeralUserNote:C,bottomSpacer:g}),[N,S,g,C,m,o,l,R,M,i,r,t]),je=typeof w=="function"||n!==void 0,tt=T.useCallback(Q=>{Re(_e=>({..._e,[Q]:!_e[Q]}))},[]),ut=T.useCallback((Q,_e)=>{O({title:Q,text:_e})},[]),Ct=T.useCallback(async(Q,_e)=>{var mt;const rt=((mt=Q.detailText)==null?void 0:mt.trim())||Q.text||"Command output";if(!Q.hasDeferredDetail||!Y){O({title:_e,text:rt});return}const He=z.current.get(Q.id);if(He){O({title:He.title,text:He.text});return}const Fe=$.current+1;$.current=Fe,O({title:_e,text:"Loading full command output..."});try{const Mt=await Y(Q.id);if(z.current.set(Q.id,Mt),$.current!==Fe)return;O({title:Mt.title,text:Mt.text})}catch(Mt){if($.current!==Fe)return;O({title:_e,text:Mt instanceof Error?Mt.message:"Unable to load full command output."})}},[Y]),en=T.useCallback(async(Q,_e)=>{var mt;const rt=((mt=Q.detailText)==null?void 0:mt.trim())||Q.text||"Tool call";if(!Q.hasDeferredDetail||!Y){O({title:_e,text:rt});return}const He=z.current.get(Q.id);if(He){O({title:He.title,text:He.text});return}const Fe=$.current+1;$.current=Fe,O({title:_e,text:"Loading full tool call details..."});try{const Mt=await Y(Q.id);if(z.current.set(Q.id,Mt),$.current!==Fe)return;O({title:Mt.title,text:Mt.text})}catch(Mt){if($.current!==Fe)return;O({title:_e,text:Mt instanceof Error?Mt.message:"Unable to load full tool call details."})}},[Y]),nt=T.useCallback(()=>{const Q=P.current,_e=Te.current;if(!Q)return;const rt=_e?QG(Q,_e):ag(Q);me.current=rt,Qe(rt)},[]),vt=T.useCallback(()=>{const Q=P.current;Q&&(ne.current=ag(Q,s1)),nt()},[nt]),st=T.useCallback(()=>{const Q=P.current;Q&&(Q.scrollTop=Q.scrollHeight,F.current=Q.scrollHeight,me.current=!0,Qe(!0),ne.current=!0)},[]);T.useEffect(()=>{ce(Q=>Q>=t.length-1?t.length:Math.max(Q,sv))},[t.length]),T.useEffect(()=>{const Q=P.current;Q&&(F.current=Q.scrollHeight,ne.current=ag(Q,s1)),nt()},[g,S,C,m,o,l,r.length,nt,t.length,Z]),T.useEffect(()=>{const Q=p!==le.current,_e=X.current!==Ve;if(X.current=Ve,!(Q||_e&&(Ne||ne.current)))return;const He=window.requestAnimationFrame(()=>{st()});return p!==le.current&&(le.current=p),()=>{window.cancelAnimationFrame(He)}},[Ve,Ne,st,p]),T.useEffect(()=>{const Q=P.current,_e=q.current;if(!Q||!_e||typeof ResizeObserver>"u")return;F.current=Q.scrollHeight;const rt=new ResizeObserver(()=>{const He=Q.scrollHeight,Fe=F.current;F.current=He,!(He<=Fe)&&(ne.current||me.current)&&window.requestAnimationFrame(()=>{st()})});return rt.observe(_e),()=>{rt.disconnect()}},[st]),T.useEffect(()=>{if(!Ne){fe.current=g;return}if(g===fe.current)return;fe.current=g;const Q=window.requestAnimationFrame(()=>{st()});return()=>{window.cancelAnimationFrame(Q)}},[g,Ne,st]),T.useEffect(()=>{E==null||E(Ne)},[Ne,E]);const xn=n??t.length,qe=Math.max(0,t.length-Z),Me=je?t:t.slice(qe),Nt=je?Math.max(0,xn-t.length):qe,ln=xn+1,tn=je?Math.max(0,xn-t.length):t.length-Me.length,Zn=!je&&tn>0&&A>=2,Ye=m&&Me.length>0?Me.findLastIndex(Q=>xs(Q.status)):-1,Un=Ye<0&&!!m&&!!M&&M.status!=="failed",ge=Ye>=0||Un,Ce=new Set(Me.map(Q=>Q.id)),Pe=S.reduce((Q,_e)=>{if(!_e.turnId||!Ce.has(_e.turnId))return Q;const rt=Q.get(_e.turnId)??[];return rt.push(_e),Q.set(_e.turnId,rt),Q},new Map),ct=r.reduce((Q,_e)=>{if(!_e.turnId||!Ce.has(_e.turnId))return Q;const rt=Q.get(_e.turnId)??[];return rt.push(_e),Q.set(_e.turnId,rt),Q},new Map),bt=[...i.map(Q=>({id:Q.id,prompt:Q.prompt,status:"Accepted",createdAt:Q.createdAt})),...R.map(Q=>({id:Q.id,prompt:Q.prompt,status:Q.status==="steering"?"Steering":null,createdAt:Q.createdAt}))].sort((Q,_e)=>Q.createdAt.localeCompare(_e.createdAt)),yn=S.filter(Q=>!Q.turnId||!Ce.has(Q.turnId)),Gn=r.filter(Q=>!Q.turnId||!Ce.has(Q.turnId)),xe=T.useMemo(()=>{const Q=[...Me.map(Fe=>({id:Fe.id,startedAt:Fe.startedAt??""})),...M?[{id:M.id,startedAt:M.startedAt??""}]:[]],_e=new Map,rt=[],He=[...yn.map(Fe=>({kind:"note",id:Fe.id,createdAt:Fe.createdAt??"",note:Fe})),...Gn.map(Fe=>({kind:"request",id:Fe.id,createdAt:Fe.createdAt,request:Fe}))].sort((Fe,mt)=>Fe.createdAt.localeCompare(mt.createdAt));for(const Fe of He){const mt=Q.find(at=>Fe.createdAt&&at.startedAt&&Fe.createdAt.localeCompare(at.startedAt)<=0);if(!mt){rt.push(Fe);continue}const Mt=_e.get(mt.id)??[];Mt.push(Fe),_e.set(mt.id,Mt)}return{beforeTurnId:_e,trailing:rt}},[M,r,yn,Gn,Me]),Oe=T.useMemo(()=>{const Q=[...N].sort((Rt,Kt)=>Rt.createdAt.localeCompare(Kt.createdAt)),_e=[...Me.map(Rt=>({id:Rt.id,startedAt:Rt.startedAt??""})),...M?[{id:M.id,startedAt:M.startedAt??""}]:[]],rt=[],He=new Map,Fe=new Map,mt=[],at=_e.map(Rt=>Rt.startedAt).filter(Rt=>!!Rt).sort().at(-1)??null;for(const Rt of Q){if(Rt.anchorTurnId==="__leading__"){rt.push(Rt);continue}if(Rt.anchorTurnId){if(_e.some(En=>En.id===Rt.anchorTurnId)){const En=Fe.get(Rt.anchorTurnId)??[];En.push(Rt),Fe.set(Rt.anchorTurnId,En)}else rt.push(Rt);continue}const Kt=_e.find(En=>En.startedAt&&Rt.createdAt.localeCompare(En.startedAt)<=0);if(!Kt){!at||Rt.createdAt.localeCompare(at)<=0?rt.push(Rt):mt.push(Rt);continue}const Zt=He.get(Kt.id)??[];Zt.push(Rt),He.set(Kt.id,Zt)}return{leading:rt,beforeTurnId:He,afterTurnId:Fe,trailing:mt}},[N,M,Me]);return f.jsxs(f.Fragment,{children:[f.jsx("section",{className:`flex min-h-0 flex-1 flex-col ${y}`.trim(),children:f.jsx("div",{ref:P,"data-testid":"thread-scroll-container",onScroll:vt,className:"thread-scroll-container min-h-0 flex-1 overflow-y-auto overscroll-contain",style:g>0?{paddingBottom:g}:void 0,children:f.jsxs("div",{ref:q,children:[t.length>0&&f.jsx("div",{className:"px-2.5 pb-1 pt-2 sm:px-6 sm:pb-1.5 sm:pt-3",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-xs sm:text-sm",children:[tn>0&&f.jsx("button",{type:"button",onClick:()=>{if(je){w==null||w();return}ce(Q=>Math.min(t.length,Q+UG)),H(Q=>Q+1)},disabled:v,className:"rounded-full border border-stone-700 px-2.5 py-1.5 text-stone-300 transition hover:bg-stone-800",children:v?"Loading earlier...":"Load 10 earlier"}),Zn&&f.jsx("button",{type:"button",onClick:()=>ce(t.length),className:"rounded-full border border-amber-300/40 px-2.5 py-1.5 text-amber-200 transition hover:bg-amber-300/10",children:"Load full history"}),f.jsxs("p",{className:"timeline-meta-text",children:["Showing ",Me.length," of ",xn," turns",tn>0?` · ${tn} earlier hidden`:""]})]})}),t.length===0&&!m&&!M&&f.jsx("div",{className:"timeline-meta-text px-2.5 py-8 text-sm sm:px-6",children:"Send the first prompt to start the thread."}),(Me.length>0||M||Oe.leading.length>0||Oe.trailing.length>0)&&f.jsxs("div",{className:"divide-y divide-stone-800/80",children:[Oe.leading.length>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:Oe.leading.map(Q=>f.jsx(Fo,{note:Q,onOpenThread:U},Q.id))}):null,Me.map((Q,_e)=>{var rt,He,Fe,mt,Mt;return f.jsxs("div",{children:[(((rt=Oe.beforeTurnId.get(Q.id))==null?void 0:rt.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.beforeTurnId.get(Q.id)??[]).map(at=>f.jsx(Fo,{note:at,onOpenThread:U},at.id))}):null,(((He=xe.beforeTurnId.get(Q.id))==null?void 0:He.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(xe.beforeTurnId.get(Q.id)??[]).map(at=>at.kind==="note"?f.jsx(Ff,{note:at.note},at.id):f.jsx(zf,{request:at.request,busy:c===at.request.id,onRespond:d??void 0},at.id))}):null,f.jsx(yv,{threadId:e,turn:Q,absoluteIndex:Nt+_e+1,isCollapsed:ve[Q.id]??!1,livePlan:(l==null?void 0:l.turnId)===Q.id?l:null,liveItems:(o==null?void 0:o.turnId)===Q.id?o.items:null,liveOutput:_e===Ye?m:"",onToggleCollapse:tt,onOpenExpandedText:ut,onOpenCommandDetail:Ct,onOpenToolCallDetail:en,scrollRootRef:P,articleRef:void 0}),(((Fe=Oe.afterTurnId.get(Q.id))==null?void 0:Fe.length)??0)>0?f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.afterTurnId.get(Q.id)??[]).map(at=>f.jsx(Fo,{note:at},at.id))}):null,(mt=Pe.get(Q.id))!=null&&mt.length||(Mt=ct.get(Q.id))!=null&&Mt.length?f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...(Pe.get(Q.id)??[]).map(at=>({kind:"note",id:at.id,createdAt:at.createdAt??"",note:at})),...(ct.get(Q.id)??[]).map(at=>({kind:"request",id:at.id,createdAt:at.createdAt,request:at}))].sort((at,Rt)=>at.createdAt.localeCompare(Rt.createdAt)).map(at=>at.kind==="note"?f.jsx(Ff,{note:at.note},at.id):f.jsx(zf,{request:at.request,busy:c===at.request.id,onRespond:d??void 0},at.id))}):null]},Q.id)}),M&&f.jsxs(f.Fragment,{children:[(((Je=Oe.beforeTurnId.get(M.id))==null?void 0:Je.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.beforeTurnId.get(M.id)??[]).map(Q=>f.jsx(Fo,{note:Q,onOpenThread:U},Q.id))}):null,(((Be=xe.beforeTurnId.get(M.id))==null?void 0:Be.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(xe.beforeTurnId.get(M.id)??[]).map(Q=>Q.kind==="note"?f.jsx(Ff,{note:Q.note},Q.id):f.jsx(zf,{request:Q.request,busy:c===Q.request.id,onRespond:d??void 0},Q.id))}):null,f.jsx(yv,{threadId:e,turn:M,absoluteIndex:ln,isCollapsed:ve[M.id]??!1,livePlan:null,liveItems:null,liveOutput:Un?m:"",onToggleCollapse:tt,onOpenExpandedText:ut,onOpenCommandDetail:Ct,onOpenToolCallDetail:en,scrollRootRef:P}),(((dt=Oe.afterTurnId.get(M.id))==null?void 0:dt.length)??0)>0?f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Oe.afterTurnId.get(M.id)??[]).map(Q=>f.jsx(Fo,{note:Q,onOpenThread:U},Q.id))}):null]})]}),bt.length>0&&f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:bt.map(Q=>f.jsx(Pc,{threadId:e,item:{id:Q.id,kind:"userMessage",text:Q.prompt,status:Q.status},scrollRootRef:P},Q.id))}),(xe.trailing.length>0||Oe.trailing.length>0)&&f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...Oe.trailing.map(Q=>({kind:"activity",id:Q.id,createdAt:Q.createdAt,note:Q})),...xe.trailing].sort((Q,_e)=>Q.createdAt.localeCompare(_e.createdAt)).map(Q=>Q.kind==="activity"?f.jsx(Fo,{note:Q.note,onOpenThread:U},Q.id):Q.kind==="note"?f.jsx(Ff,{note:Q.note},Q.id):f.jsx(zf,{request:Q.request,busy:c===Q.request.id,onRespond:d??void 0},Q.id))}),C&&f.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:f.jsx(Pc,{threadId:e,item:{id:"ephemeral-plan-decision-note",kind:"userMessage",text:C},scrollRootRef:P})}),m&&!ge&&f.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:i1(m)?f.jsx(u1,{threadId:e,item:i1(m),scrollRootRef:P,onOpenExpandedText:ut,onOpenCommandDetail:Ct,onOpenToolCallDetail:en}):f.jsx(Pc,{threadId:e,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:m},scrollRootRef:P,streaming:!0})}),f.jsx("div",{ref:Te,"aria-hidden":"true",className:"h-px w-full"})]})})}),f.jsx(pS,{open:te!==null,title:(te==null?void 0:te.title)??"Full text",text:(te==null?void 0:te.text)??"",onClose:()=>{$.current+=1,O(null)}})]})}function Sb({open:e,title:t,label:n,value:r,busy:i=!1,onChange:l,onCancel:o,onSubmit:c}){if(T.useEffect(()=>{if(!e)return;function m(p){p.key==="Escape"&&!i&&o()}return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[i,o,e]),!e)return null;function d(m){m.preventDefault(),c()}return uu.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close rename dialog",onClick:o,disabled:i,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),f.jsxs("form",{role:"dialog","aria-modal":"true","aria-label":t,onSubmit:d,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),f.jsx("p",{className:"mt-1 text-sm text-stone-500",children:"Changes are saved only after confirmation."})]}),f.jsx("button",{type:"button","aria-label":"Close dialog",onClick:o,disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),f.jsxs("div",{className:"mt-5",children:[f.jsx("label",{htmlFor:"rename-dialog-input",className:"text-sm font-medium text-stone-200",children:n}),f.jsx("input",{id:"rename-dialog-input","aria-label":n,autoFocus:!0,value:r,onChange:m=>l(m.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),f.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),f.jsx("button",{type:"submit",disabled:i||!r.trim(),className:"ui-action-success rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:"Save"})]})]})]}),document.body)}function Oq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",children:f.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Dq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function jq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Z"})})}function Ev({title:e,defaultOpen:t=!1,children:n}){const[r,i]=T.useState(t);return f.jsxs("section",{className:"border-t border-[var(--theme-border)] pt-4 first:border-t-0 first:pt-0",children:[f.jsxs("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":r,className:"flex w-full items-center justify-between gap-3 text-left",children:[f.jsx("span",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:e}),f.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:r?"Hide":"Show"})]}),r&&f.jsx("div",{className:"mt-3",children:n})]})}function Mq({thread:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,showDeleteButton:c=!1,showSessionCopyButton:d=!1}){const[m,p]=T.useState("idle"),g=T.useRef(null),y=r[e.workspaceId],E=t===e.id;T.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);async function v(){const w=e.providerSessionId;if(w)try{await navigator.clipboard.writeText(w),p("copied"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1200)}catch{p("failed"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1600)}}return f.jsxs("div",{role:"link",tabIndex:0,onClick:()=>i(e.id),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),i(e.id))},className:`thread-sidebar-card relative block rounded-[1.2rem] border px-3 py-2.5 transition ${E?"thread-sidebar-card-active shadow-lg shadow-stone-950/12":""} ${d&&e.providerSessionId?"pb-4":""}`,children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("p",{className:"min-w-0 w-fit max-w-[calc(100%-2rem)] truncate text-[13px] font-medium leading-5 text-[var(--theme-fg)]",title:e.title,children:e.title}),f.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),l(e)},"aria-label":`Rename thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition hover:text-[var(--theme-fg)]",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})}),c&&o&&f.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),o(e)},"aria-label":`Delete thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-rose-300/90 transition hover:text-rose-200",children:f.jsx(jq,{})})]}),y&&!n&&f.jsx("p",{className:"mt-1 truncate text-xs text-[var(--theme-fg-muted)]",children:y})]}),f.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[9px] uppercase tracking-[0.18em] ${PG(e.status)}`,children:gS(e.status)})]}),f.jsxs("div",{className:`mt-2 flex items-center justify-between gap-3 text-[11px] text-[var(--theme-fg-muted)] ${d&&e.providerSessionId?"pr-9":""}`,children:[f.jsx("time",{dateTime:e.lastTurnStartedAt??e.updatedAt,children:am(e.lastTurnStartedAt??e.updatedAt)}),f.jsx("span",{children:e.model??"No model"})]}),d&&e.providerSessionId&&f.jsx("button",{type:"button","aria-label":"Copy session ID",title:m==="copied"?"Copied":m==="failed"?"Copy failed":"Copy session ID",onClick:w=>{w.stopPropagation(),v()},className:`absolute bottom-2.5 right-2.5 inline-flex h-7 w-7 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${m==="copied"?"border-sky-300/40 bg-sky-300/16 text-sky-100":m==="failed"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg-soft)] hover:bg-[var(--theme-hover)]"}`,children:f.jsx(Dq,{})})]})}function CS({threads:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,scrollable:c=!1,maxHeightClassName:d="max-h-full",showDeleteButton:m=!1,showSessionCopyButton:p=!1}){const g=c?`min-h-0 overflow-y-auto overscroll-contain pr-1 ${d}`:"";return f.jsx("div",{className:g,children:f.jsx("div",{className:"space-y-1.5",children:e.map(y=>f.jsx(Mq,{thread:y,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r,onOpenThread:i,onBeginRenameThread:l,showDeleteButton:m,showSessionCopyButton:p,...o?{onDeleteThread:o}:{}},y.id))})})}function SS({threads:e,status:t,loading:n=!1,error:r,viewportConstrained:i=!1,showMobileAppMenu:l=!0,showMobileThreadNavToggle:o=!0,showMobileNewThreadShortcut:c=!0,mobileHeaderAction:d,currentThreadId:m,currentThreadLabel:p=null,currentWorkspaceId:g=null,currentWorkspaceLabel:y=null,workspaceLabels:E={},metaContent:v,settingsContent:w,onRenameThread:C,children:S}){const[N,R]=T.useState(!1),[M,Y]=T.useState(null),[U,P]=T.useState(""),[q,le]=T.useState(null),X=Za(),fe=Kl(),F=T.useMemo(()=>[...g?e.filter(te=>te.workspaceId===g):e].sort((te,O)=>{if(te.id===m)return-1;if(O.id===m)return 1;const ve=Date.parse(te.lastTurnStartedAt??te.updatedAt);return Date.parse(O.lastTurnStartedAt??O.updatedAt)-ve}),[m,g,e]),Te=y??(g?"Current workspace":"All threads"),me=p&&p.trim()?`${Te} / ${p.trim()}`:Te,ne=g?`/threads/new?workspaceId=${encodeURIComponent(g)}`:"/threads/new";async function $(H){if(!C)return;const te=U.trim();if(te){le(H);try{await C(H,te),Y(null),P("")}finally{le(null)}}}function z(H){Y(H.id),P(H.title)}function Z(){Y(null),P("")}function ce(H){X(`/threads/${H}`),R(!1),fe==null||fe.closeNav()}function A(){return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("section",{children:[f.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:"Thread List"}),f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:"Refreshing..."}),f.jsx(ai,{to:ne,onClick:()=>{R(!1),fe==null||fe.closeNav()},className:"inline-flex h-7 items-center rounded-full bg-[var(--theme-accent-solid)] px-2.5 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"New Thread"})]})]}),r&&f.jsx("div",{className:"rounded-2xl border border-rose-500/30 bg-rose-500/10 px-3 py-3 text-sm text-rose-100",children:r}),!r&&F.length===0&&!n&&f.jsx("div",{className:"rounded-2xl border border-dashed border-[var(--theme-border)] bg-[var(--theme-surface)] px-4 py-6 text-sm text-[var(--theme-fg-muted)]",children:"No threads available in this view."}),F.length>0&&f.jsx(CS,{threads:F,currentThreadId:m,currentWorkspaceId:g,workspaceLabels:E,onOpenThread:ce,onBeginRenameThread:z})]}),f.jsx(Ev,{title:"Thread Meta",defaultOpen:!0,children:v??f.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"Select a thread to inspect metadata."})}),f.jsx(Ev,{title:"Settings",children:w??f.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"No thread settings available."})})]})}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:i?"flex h-full max-h-full min-h-0 flex-col gap-2 overflow-hidden overscroll-none sm:gap-4 lg:grid lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]":"flex min-h-[calc(100dvh-2rem)] flex-col gap-4 lg:grid lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]",children:[f.jsx("div",{className:"lg:hidden",children:f.jsxs("div",{className:"relative",children:[f.jsxs("div",{className:`thread-topbar-surface grid h-10 items-center gap-1.5 border-b px-2.5 backdrop-blur ${l&&(c||d)?"grid-cols-[2.5rem_minmax(0,1fr)_auto]":l?"grid-cols-[2.5rem_minmax(0,1fr)]":"grid-cols-[minmax(0,1fr)]"}`,children:[l&&f.jsx(E1,{}),o?f.jsxs("button",{type:"button",onClick:()=>R(H=>!H),"aria-expanded":N,"aria-label":N?"Collapse thread navigation":"Expand thread navigation",className:"inline-flex min-w-0 items-center justify-center gap-1 px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:me,children:[f.jsx("span",{className:"min-w-0 truncate",children:me}),f.jsx("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition ${N?"rotate-180":""}`,children:f.jsx("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m4.5 6.25 3.5 3.5 3.5-3.5"})})})]}):f.jsx("p",{className:"min-w-0 truncate px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:me,children:me}),l&&(d||(c?f.jsxs(ai,{to:ne,onClick:()=>{fe==null||fe.closeNav(),R(!1)},"aria-label":"New Thread",className:"inline-flex h-8 min-w-0 shrink-0 items-center justify-center gap-1 rounded-full bg-[var(--theme-accent-solid)] px-2 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:[f.jsx(Oq,{}),f.jsx("span",{className:"hidden sm:inline",children:"New"})]}):null))]}),l&&f.jsx(_1,{className:"absolute left-2 top-[calc(100%+0.45rem)] z-20 w-[min(18rem,calc(100vw-1rem))]"}),o&&N&&f.jsx("aside",{className:"thread-sidebar-surface absolute inset-x-2 top-[calc(100%+0.35rem)] z-10 max-h-[40dvh] overflow-y-auto rounded-[1.35rem] border p-4 shadow-2xl shadow-stone-950/18 backdrop-blur",children:A()})]})}),f.jsx("aside",{className:"hidden min-h-0 lg:block",children:f.jsx("div",{className:`thread-sidebar-surface sticky top-4 rounded-[2rem] border p-4 shadow-2xl shadow-stone-950/12 backdrop-blur ${i?"h-full max-h-full overflow-y-auto":""}`,children:A()})}),f.jsx("section",{className:i?"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden":"min-w-0",children:S})]}),f.jsx(Sb,{open:M!==null,title:"Rename Thread",label:"Thread Title",value:U,busy:q!==null,onChange:P,onCancel:Z,onSubmit:()=>M?$(M):void 0})]})}const _v=10,Pq=1e3,Bq=2e3,ig=5500,Uq=3e3,lg=0,$o=1,$f=3,Hq=["read-only","workspace-write","danger-full-access"];function zq(e){return e.sandboxMode??(e.approvalMode==="guarded"?"workspace-write":"danger-full-access")}function Fq(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}function Vo(e,t){const n=new Set(t.map(r=>r.id));return[...e.filter(r=>!n.has(r.id)),...t]}function yc(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}function NS(e){return`${e.threadId}:${e.objective}:${e.createdAt}`}function $q(e,t){const n=Date.parse(e.updatedAt)||0,i=(Date.parse(t.updatedAt)||0)>=n?t:e,l=i===t?e:t;return{...i,localGoalId:i.localGoalId??l.localGoalId??null}}function AS(e){const t=new Map;for(const n of e){const r=NS(n),i=t.get(r);t.set(r,i?$q(i,n):n)}return[...t.values()].sort((n,r)=>Date.parse(r.updatedAt)-Date.parse(n.updatedAt))}function Vf(e,t){return AS([t,...e])}function Vq(e){const t=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});return e.tokenBudget===null?`${t.format(e.tokensUsed)} tok`:`${t.format(e.tokensUsed)}/${t.format(e.tokenBudget)} tok`}function Gq(e){const t=Math.max(0,Math.floor(e/60)),n=Math.floor(t/60),r=t%60;return n>0?`${n}h ${r}m`:`${t}m`}function Tv(e,t){if(!t)return null;const n=e.find(r=>r.model===t);return n?n.supportedReasoningEfforts.length>1:null}function qq(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`client-${Date.now()}-${Math.random().toString(16).slice(2,10)}`}function Yq(e,t){return(e==null?void 0:e.items.some(n=>n.kind==="userMessage"&&n.text.trim()===t))??!1}function Wq(e,t,n,r){let i=!1;const l=e.map(o=>o.id!==t?o:(i=!0,{...o,tokenUsage:n,priceEstimate:r}));return i?l:e}function Qq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function Xq(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M4.25 2.25h5.2l2.3 2.3v9.2h-7.5a2 2 0 0 1-2-2v-7.5a2 2 0 0 1 2-2Z"}),f.jsx("path",{d:"M9.25 2.5v2.25h2.25"}),f.jsx("path",{d:"M7 6.75v4"}),f.jsx("path",{d:"m5.45 9.35 1.55 1.55 1.55-1.55"})]})}function Gf({status:e}){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M2.5 6.75A8.22 8.22 0 0 1 8 4.5c2.14 0 4.1.8 5.5 2.25"}),f.jsx("path",{d:"M4.75 9a4.95 4.95 0 0 1 6.5 0"}),f.jsx("path",{d:"M6.9 11.3a1.9 1.9 0 0 1 2.2 0"}),e==="connected"?f.jsx("path",{d:"m6.7 13.2.9.9 1.7-2"}):e==="offline"?f.jsx("path",{d:"M3 3l10 10"}):e==="detached"?null:f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M11.8 11.1a2.2 2.2 0 0 1-1.8 2.7"}),f.jsx("path",{d:"m10.7 11.35 1.3-.55-.55-1.3"})]})]})}function Kq(e,t){if(!e)return"Thread disconnected";switch(t.status){case"connected":return"Realtime updates connected";case"reconnecting":return"Realtime updates reconnecting";case"offline":return"Browser offline";case"checking":return"Checking realtime connection"}}function Zq(){var $a;const{id:e=""}=s5(),t=Za(),n=T.useRef(""),r=T.useRef(null),i=T.useRef(null),l=T.useRef(null),o=T.useRef(!1),c=T.useRef(null),d=T.useRef(null),m=T.useRef(typeof navigator>"u"?!0:navigator.onLine),p=T.useRef(!1),g=T.useRef(null),y=T.useRef(null),E=T.useRef(0),v=T.useRef(0),w=T.useRef(null),C=T.useRef(null),S=T.useRef(null),[N,R]=T.useState(null),[M,Y]=T.useState([]),[U,P]=T.useState([]),[q,le]=T.useState(null),[X,fe]=T.useState(null),[F,Te]=T.useState(null),[me,ne]=T.useState(""),[$,z]=T.useState(null),[Z,ce]=T.useState(null),[A,H]=T.useState(!0),[te,O]=T.useState(0),[ve,Re]=T.useState(!0),[Ne,Qe]=T.useState(!1),[Ve,je]=T.useState(!1),[tt,ut]=T.useState("chat"),[Ct,en]=T.useState({prompt:"",attachments:[]}),[nt,vt]=T.useState(!1),[st,xn]=T.useState(0),[qe,Me]=T.useState(0),[Nt,ln]=T.useState(0),[tn,Zn]=T.useState(!1),[Ye,Un]=T.useState(null),[ge,Ce]=T.useState(!1),[Pe,ct]=T.useState(!1),[bt,yn]=T.useState(!1),[Gn,xe]=T.useState(null),[Oe,Je]=T.useState("idle"),[Be,dt]=T.useState({status:m.current?"checking":"offline",browserOnline:m.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null}),[Q,_e]=T.useState(null),[rt,He]=T.useState([]),[Fe,mt]=T.useState({status:"idle",data:null,error:null}),[Mt,at]=T.useState({status:"idle",data:null,error:null}),[Rt,Kt]=T.useState({status:"idle",data:null,error:null}),[Zt,En]=T.useState({status:"idle",data:null,error:null}),[Hn,Jn]=T.useState({status:"idle",data:null,error:null}),[nl,li]=T.useState(!1),[ts,Xr]=T.useState(!1),[rl,ro]=T.useState(()=>new Set),[Kr,hn]=T.useState(!1),[Cn,ha]=T.useState(!1),[er,ks]=T.useState({status:"idle",data:null,error:null}),[Lr,Ut]=T.useState(null),ur=(($a=F==null?void 0:F.hostConfigFiles.find(V=>{var K;return(K=V.roles)==null?void 0:K.includes("mcp")}))==null?void 0:$a.name)??null,Zr=T.useCallback(()=>{const V=n.current;n.current="",r.current=null,V&&ne(K=>K+V)},[]),Ir=T.useCallback(V=>{n.current+=V,r.current===null&&(r.current=window.requestAnimationFrame(()=>{Zr()}))},[Zr]),tr=T.useCallback((V,K)=>{ce(oe=>{const De=[...((oe==null?void 0:oe.turnId)===V?oe.items:[]).filter(ft=>ft.id!==K.id),K];return{turnId:V,items:De,updatedAt:new Date().toISOString()}})},[]),ma=T.useCallback((V,K,oe,Le)=>{ce(De=>{const ft=(De==null?void 0:De.turnId)===V?De.items:[],Ue=ft.find(Jt=>Jt.id===K),Tn=(Ue==null?void 0:Ue.kind)==="agentMessage"?{...Ue,text:`${Ue.text}${oe}`,sequence:Le??Ue.sequence??null}:{id:K,kind:"agentMessage",text:oe,sequence:Le};return{turnId:V,items:[...ft.filter(Jt=>Jt.id!==K),Tn],updatedAt:new Date().toISOString()}})},[]),nr=T.useCallback(()=>{n.current="",r.current!==null&&(window.cancelAnimationFrame(r.current),r.current=null)},[]);T.useEffect(()=>{mt({status:"idle",data:null,error:null}),at({status:"idle",data:null,error:null}),Kt({status:"idle",data:null,error:null}),En({status:"idle",data:null,error:null}),Jn({status:"idle",data:null,error:null}),hn(!1),ks({status:"idle",data:null,error:null})},[e]);const Sn=T.useCallback(async()=>{if(e){ks(V=>({status:"loading",data:V.data,error:null}));try{const V=await g6(e);ks({status:"ready",data:V,error:null})}catch(V){const K=V instanceof Vt?V.payload.message:"Unable to load export turns.";ks(oe=>({status:"failed",data:oe.data,error:K}))}}},[e]);async function al(V){if(e){Ut(null),ha(!0);try{const{blob:K,filename:oe}=await x6(e,V),Le=URL.createObjectURL(K),De=document.createElement("a");De.href=Le,De.download=oe,document.body.append(De),De.click(),De.remove(),window.setTimeout(()=>URL.revokeObjectURL(Le),3e4),hn(!1)}catch(K){const oe=K instanceof Vt?K.payload.message:"Unable to export transcript.";Ut(oe)}finally{ha(!1)}}}async function ws(){if(e){Jn(V=>{var K;return{status:"loading",data:V.data??((K=C.current)==null?void 0:K.goal)??null,error:null}});try{const V=await A6(e);Jn({status:"ready",data:V.goal,error:null}),R(K=>K&&(V.goal?{...K,goal:V.goal,goalHistory:Vf(K.goalHistory??[],V.goal)}:{...K,goal:V.goal}))}catch(V){Jn(K=>({status:"failed",data:K.data,error:V instanceof Vt?V.payload.message:"Unable to load goal."}))}}}async function Ur(V){if(e){Jn(K=>{var oe;return{status:"loading",data:K.data??((oe=C.current)==null?void 0:oe.goal)??null,error:null}});try{const K=await R6(e,V);Jn({status:"ready",data:K.goal,error:null}),R(oe=>oe&&(K.goal?{...oe,goal:K.goal,goalHistory:Vf(oe.goalHistory??[],K.goal)}:{...oe,goal:K.goal}))}catch(K){throw Jn(oe=>({status:"failed",data:oe.data,error:K instanceof Vt?K.payload.message:"Unable to update goal."})),K}}}async function Tr(){if(e){Jn(V=>{var K;return{status:"loading",data:V.data??((K=C.current)==null?void 0:K.goal)??null,error:null}});try{const V=await L6(e);Jn({status:"ready",data:null,error:null}),R(K=>K&&(V.goalHistory?{...K,goal:null,goalHistory:V.goalHistory}:{...K,goal:null}))}catch(V){throw Jn(K=>({status:"failed",data:K.data,error:V instanceof Vt?V.payload.message:"Unable to clear goal."})),V}}}async function ao(V){Xr(!0);try{await Ur({status:V})}finally{Xr(!1)}}async function Jr(){Xr(!0);try{await Tr()}finally{Xr(!1)}}async function oi(){if(e){mt(V=>({status:"loading",data:V.data,error:null}));try{const V=await O6(e);mt({status:"ready",data:V,error:null})}catch(V){mt(K=>({status:"failed",data:K.data,error:V instanceof Vt?V.payload.message:"Unable to load skills."}))}}}async function sl(){if(e){at(V=>({status:"loading",data:V.data,error:null}));try{const V=await D6(e);at({status:"ready",data:V,error:null})}catch(V){at(K=>({status:"failed",data:K.data,error:V instanceof Vt?V.payload.message:"Unable to load MCP servers."}))}}}async function Hr(){if(e){Kt(V=>({status:"loading",data:V.data,error:null}));try{const V=await j6(e);Kt({status:"ready",data:V,error:null})}catch(V){Kt(K=>({status:"failed",data:K.data,error:V instanceof Vt?V.payload.message:"Unable to load hooks."}))}}}async function pa(V){if(e){Kt(K=>({status:"loading",data:K.data,error:null}));try{const K=await M6(e,V);Kt({status:"ready",data:K,error:null})}catch(K){throw Kt(oe=>({status:"failed",data:oe.data,error:K instanceof Vt?K.payload.message:"Unable to create hook."})),K}}}async function _n(V){if(e){Kt(K=>({status:"loading",data:K.data,error:null}));try{const K=await P6(e,V);Kt({status:"ready",data:K,error:null})}catch(K){throw Kt(oe=>({status:"failed",data:oe.data,error:K instanceof Vt?K.payload.message:"Unable to update hook."})),K}}}async function In(V){if(e){Kt(K=>({status:"loading",data:K.data,error:null}));try{const K=await B6(e,V);Kt({status:"ready",data:K,error:null})}catch(K){throw Kt(oe=>({status:"failed",data:oe.data,error:K instanceof Vt?K.payload.message:"Unable to trust hook."})),K}}}async function ui(V){if(e){Kt(K=>({status:"loading",data:K.data,error:null}));try{const K=await U6(e,V);Kt({status:"ready",data:K,error:null})}catch(K){throw Kt(oe=>({status:"failed",data:oe.data,error:K instanceof Vt?K.payload.message:"Unable to untrust hook."})),K}}}async function il(){if(e){En(V=>({status:"loading",data:V.data,error:null}));try{const V=await I6(e);En({status:"ready",data:V,error:null})}catch(V){En(K=>({status:"failed",data:K.data,error:V instanceof Vt?V.payload.message:"Unable to load turns for forking."}))}}}async function Wt(){if(!e)return;const V=await h2(e,{mode:"latest"});Y(K=>yc(K,V.thread.thread)),t(`/threads/${V.thread.thread.id}`)}async function ci(V){if(!e)return;const K=await h2(e,{mode:"turn",turnId:V});Y(oe=>yc(oe,K.thread.thread)),t(`/threads/${K.thread.thread.id}`)}const Pa=T.useCallback(V=>{const K=S.current,oe=K&&Object.keys(K).length>0?{...V,thread:{...V.thread,...K}}:V;C.current=oe,z(oe.livePlan??null),ce(oe.liveItems??null),Jn(Ue=>Ue.status==="idle"?Ue:{...Ue,data:oe.goal??null});const Le=oe.thread.activeTurnId===null&&oe.thread.status!=="running";R(Ue=>Ue&&!oe.goalHistory?{...oe,turns:Vo(Ue.turns,oe.turns),...Ue.goalHistory?{goalHistory:Ue.goalHistory}:{}}:Ue?{...oe,turns:Vo(Ue.turns,oe.turns)}:oe),Y(Ue=>yc(Ue,oe.thread));const De=new Map(oe.turns.map(Ue=>[Ue.id,Ue])),ft=new Set((oe.pendingSteers??[]).map(Ue=>Ue.clientRequestId).filter(Ue=>!!Ue));He(Ue=>Ue.filter(Tn=>{if(ft.has(Tn.clientRequestId))return!1;const Jt=De.get(Tn.turnId);return!(!Jt||Yq(Jt,Tn.prompt)||oe.thread.activeTurnId!==Tn.turnId&&Jt.status!=="inProgress")})),_e(Ue=>{if(!Ue)return Ue;const Tn=Ue.serverTurnId??Ue.id;return oe.turns.some(vn=>vn.id===Tn)?null:Ue}),(Le||w.current&&oe.turns.some(Ue=>Ue.id===w.current))&&(w.current=null,nr(),ne(""),z(null),ce(null))},[nr]);T.useEffect(()=>{C.current=N},[N]);const ns=T.useCallback(async({seedThread:V}={})=>{var ft,Ue;const K=v.current+1;v.current=K;const[oe,Le,De]=await Promise.allSettled([Wv(),Yv((V==null?void 0:V.provider)??((ft=C.current)==null?void 0:ft.thread.provider)??"codex"),fg((V==null?void 0:V.provider)??((Ue=C.current)==null?void 0:Ue.thread.provider)??"codex")]);v.current===K&&(oe.status==="fulfilled"?Y(V?yc(oe.value,V):oe.value):V&&Y(Tn=>yc(Tn,V)),Le.status==="fulfilled"&&(le(Le.value.status),fe(Le.value.capabilities),Te(Le.value.managementSchema)),De.status==="fulfilled"&&P(De.value))},[]),On=T.useCallback(async({showLoading:V=!0,clearError:K=!0,reportError:oe=!0}={})=>{const Le=E.current+1;E.current=Le,V&&Re(!0),K&&Ut(null);try{const De=await c2(e,{limit:_v});if(E.current!==Le)return;Pa(De)}catch(De){if(E.current!==Le||!oe)return;Ut(De instanceof Error?De.message:"Unable to load thread detail.")}finally{E.current===Le&&Re(!1)}},[Pa,e,ns]),Dn=T.useCallback(()=>{var Tn;const V=((Tn=i.current)==null?void 0:Tn.readyState)??$f,K=V===$o,oe=m.current,Le=Date.now(),De=c.current!==null&&Le-Date.parse(c.current)<=ig,ft=d.current!==null&&Le-d.current<=ig;let Ue;oe?K&&De&&ft?Ue="connected":V===lg||l.current!==null||De||ft||o.current?Ue="reconnecting":Ue="checking":Ue="offline",dt(Jt=>Jt.status===Ue&&Jt.browserOnline===oe&&Jt.healthOk===De&&Jt.socketOpen===K&&Jt.lastHealthyAt===c.current?Jt:{status:Ue,browserOnline:oe,healthOk:De,socketOpen:K,lastHealthyAt:c.current})},[]);T.useEffect(()=>{E.current+=1,v.current+=1,R(null),en({prompt:"",attachments:[]}),Qe(!1),Je("idle"),_e(null),He([]),ce(null),S.current=null,w.current=null,c.current=null,d.current=null,p.current=!1,m.current=typeof navigator>"u"?!0:navigator.onLine,dt({status:m.current?"checking":"offline",browserOnline:m.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null})},[e]),T.useEffect(()=>{if(Oe==="idle")return;const V=window.setTimeout(()=>{Je("idle")},Oe==="copied"?1200:1600);return()=>{window.clearTimeout(V)}},[Oe]),T.useEffect(()=>{if(typeof document>"u")return;const{documentElement:V,body:K}=document;return V.classList.add("thread-detail-scroll-locked"),K.classList.add("thread-detail-scroll-locked"),()=>{V.classList.remove("thread-detail-scroll-locked"),K.classList.remove("thread-detail-scroll-locked")}},[]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const V=window.matchMedia("(max-width: 639px)"),K=()=>vt(V.matches);return K(),V.addEventListener("change",K),()=>{V.removeEventListener("change",K)}},[]),T.useEffect(()=>{var K,oe;if(typeof window>"u")return;const V=()=>{const Le=window.visualViewport,De=Le?Math.max(0,Math.round(window.innerHeight-Le.height-Le.offsetTop)):0;ln(De),document.documentElement.style.setProperty("--thread-detail-keyboard-inset",`${De}px`)};return V(),(K=window.visualViewport)==null||K.addEventListener("resize",V),(oe=window.visualViewport)==null||oe.addEventListener("scroll",V),window.addEventListener("resize",V),()=>{var Le,De;(Le=window.visualViewport)==null||Le.removeEventListener("resize",V),(De=window.visualViewport)==null||De.removeEventListener("scroll",V),window.removeEventListener("resize",V),document.documentElement.style.removeProperty("--thread-detail-keyboard-inset")}},[]),T.useEffect(()=>{if(typeof document>"u")return;const V=()=>{const K=document.activeElement,oe=y.current,Le=oe==null?void 0:oe.querySelector('[aria-label="Prompt"]');Zn(!!(K&&Le&&(K===Le||Le.contains(K))))};return V(),document.addEventListener("focusin",V),document.addEventListener("focusout",V),()=>{document.removeEventListener("focusin",V),document.removeEventListener("focusout",V)}},[tt,N==null?void 0:N.thread.id,nt]),T.useEffect(()=>{const V=y.current;if(!V||typeof ResizeObserver>"u")return;const K=V.querySelector("form")??V,oe=()=>{xn(Math.max(V.getBoundingClientRect().height,K.getBoundingClientRect().height))};oe();const Le=new ResizeObserver(()=>{oe()});return Le.observe(K),()=>{Le.disconnect()}},[tt,nt]),T.useEffect(()=>{var Le,De;const V=y.current;if(!V||!nt||tt!=="chat"){Me(0);return}const K=()=>{const ft=V.getBoundingClientRect();Me(Math.max(0,Math.ceil(window.innerHeight-ft.top)))};K(),window.addEventListener("resize",K),(Le=window.visualViewport)==null||Le.addEventListener("resize",K),(De=window.visualViewport)==null||De.addEventListener("scroll",K);let oe=null;return typeof ResizeObserver<"u"&&(oe=new ResizeObserver(K),oe.observe(V)),()=>{var ft,Ue;window.removeEventListener("resize",K),(ft=window.visualViewport)==null||ft.removeEventListener("resize",K),(Ue=window.visualViewport)==null||Ue.removeEventListener("scroll",K),oe==null||oe.disconnect()}},[tt,N==null?void 0:N.thread.id,nt,Nt,tn]),T.useEffect(()=>{On({showLoading:!0}),ns()},[ns,On]),T.useEffect(()=>{let V=!1,K=null;const oe=()=>{On({showLoading:!1,clearError:!1,reportError:!1})},Le=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},De=()=>{V||!m.current||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,!V&&Jt()},Pq),Dn())},ft=()=>{const Se=i.current;if(i.current=null,Se)try{Se.close()}catch{}},Ue=Se=>{if(Se.threadId===e){if(Se.type==="thread.output.delta"&&typeof Se.payload.delta=="string"){const Ze=typeof Se.payload.turnId=="string"?Se.payload.turnId:null,gt=typeof Se.payload.itemId=="string"?Se.payload.itemId:null,mn=typeof Se.payload.sequence=="number"&&Number.isFinite(Se.payload.sequence)?Se.payload.sequence:null;Ir(Se.payload.delta),Ze&>&&ma(Ze,gt,Se.payload.delta,mn),Ze&&_e(xt=>xt&&(xt.serverTurnId===null||xt.serverTurnId===Ze)?{...xt,serverTurnId:Ze,id:Ze,status:xt.status==="failed"?xt.status:"inProgress",tokenUsage:xt.tokenUsage}:xt)}if(Se.type==="thread.context.updated"){const Ze=Se.payload.contextUsage&&typeof Se.payload.contextUsage=="object"?Se.payload.contextUsage:null;if(Ze){const gt=Ze;R(mn=>mn&&{...mn,thread:{...mn.thread,contextUsage:gt}}),Y(mn=>mn.map(xt=>xt.id===e?{...xt,contextUsage:gt}:xt))}}if(Se.type==="thread.turn.token.updated"&&typeof Se.payload.turnId=="string"&&Se.payload.tokenUsage&&typeof Se.payload.tokenUsage=="object"){const Ze=Se.payload.turnId,gt=Se.payload.tokenUsage,mn=Se.payload.priceEstimate&&typeof Se.payload.priceEstimate=="object"?Se.payload.priceEstimate:null;R(xt=>{if(!xt)return xt;const rn=Wq(xt.turns,Ze,gt,mn);return rn===xt.turns?xt:{...xt,turns:rn}}),_e(xt=>xt&&(xt.serverTurnId===Ze||xt.id===Ze)?{...xt,tokenUsage:gt,priceEstimate:mn}:xt)}if(Se.type==="thread.turn.started"||Se.type==="thread.turn.completed"||Se.type==="thread.turn.failed"||Se.type==="thread.updated"||Se.type==="thread.goal.updated"||Se.type==="thread.goal.cleared"||Se.type==="thread.request.created"||Se.type==="thread.request.resolved"){if(Se.type==="thread.goal.updated"){const Ze=Se.payload.goal&&typeof Se.payload.goal=="object"?Se.payload.goal:null,gt=Array.isArray(Se.payload.goalHistory)?Se.payload.goalHistory:null;Jn({status:"ready",data:Ze,error:null}),R(mn=>mn&&(gt?{...mn,goal:Ze,goalHistory:gt}:Ze?{...mn,goal:Ze,goalHistory:Vf(mn.goalHistory??[],Ze)}:{...mn,goal:Ze}))}if(Se.type==="thread.goal.cleared"){const Ze=Array.isArray(Se.payload.goalHistory)?Se.payload.goalHistory:null;Jn({status:"ready",data:null,error:null}),R(gt=>gt&&(Ze?{...gt,goal:null,goalHistory:Ze}:{...gt,goal:null}))}if(oe(),Se.type==="thread.turn.started"){nr(),ne(""),ce(null),w.current=null;const Ze=typeof Se.payload.turnId=="string"?Se.payload.turnId:null;Ze&&_e(gt=>gt&&{...gt,serverTurnId:Ze,id:Ze,status:gt.status==="failed"?gt.status:"inProgress",error:null,tokenUsage:gt.tokenUsage})}if(Se.type==="thread.turn.completed"||Se.type==="thread.turn.failed"){ce(null);const Ze=typeof Se.payload.turnId=="string"?Se.payload.turnId:null;Ze&&(w.current=Ze,Se.type==="thread.turn.failed"&&_e(gt=>gt&&(gt.serverTurnId===Ze||gt.id===Ze)?{...gt,status:"failed",error:typeof Se.payload.error=="string"?Se.payload.error:"Unable to complete the turn.",tokenUsage:gt.tokenUsage}:gt))}}if((Se.type==="thread.item.started"||Se.type==="thread.item.completed")&&Se.payload.item&&typeof Se.payload.item=="object"&&typeof Se.payload.turnId=="string"){const Ze=Se.payload.turnId,gt=Se.payload.item;typeof gt.id=="string"&&typeof gt.text=="string"&&tr(Ze,gt)}Se.type==="thread.plan.updated"&&Array.isArray(Se.payload.plan)&&z({turnId:String(Se.payload.turnId??""),explanation:typeof Se.payload.explanation=="string"?Se.payload.explanation:null,plan:Se.payload.plan})}},Tn=()=>{const Se=i.current;if(!(!Se||Se.readyState!==$o))try{Se.send(JSON.stringify({type:"supervisor.ping",timestamp:new Date().toISOString()}))}catch{p.current=!0,ft(),De(),Dn()}},Jt=()=>{var gt;if(V||!m.current){Dn();return}const Se=((gt=i.current)==null?void 0:gt.readyState)??$f;if(Se===lg||Se===$o){Dn();return}const Ze=Xv(Ue);i.current=Ze,Dn(),Ze.addEventListener("message",mn=>{if(i.current===Ze)try{const xt=JSON.parse(mn.data);(xt.type==="supervisor.connected"||xt.type==="supervisor.pong")&&(d.current=Date.now(),Dn())}catch{}}),Ze.addEventListener("open",()=>{i.current===Ze&&(p.current=!0,oe(),Tn(),Dn())}),Ze.addEventListener("close",()=>{i.current===Ze&&(i.current=null),p.current=!0,De(),Dn()}),Ze.addEventListener("error",()=>{i.current===Ze&&(i.current=null),p.current=!0,De(),Dn()})},vn=async()=>{var Se;if(!(V||!m.current||o.current)){o.current=!0,Dn();try{await m6();const Ze=p.current;c.current=new Date().toISOString(),Ze&&(p.current=!1,oe()),(((Se=i.current)==null?void 0:Se.readyState)??$f)!==$o&&Jt()}catch{c.current=null,p.current=!0,De()}finally{o.current=!1,Dn()}}},Ls=()=>{m.current=!0,p.current=!0,Dn(),Jt(),vn()},nn=()=>{m.current=!1,c.current=null,d.current=null,p.current=!0,Le(),ft(),Dn()},Gt=()=>{var gt;if(V||!m.current){Dn();return}const Se=((gt=i.current)==null?void 0:gt.readyState)??$f,Ze=d.current===null?null:Date.now()-d.current;Se===$o&&Ze!==null&&Ze>ig?(p.current=!0,ft(),De()):Se===$o?Tn():Se!==lg&&Jt(),vn(),Dn()};return window.addEventListener("online",Ls),window.addEventListener("offline",nn),Jt(),vn(),K=window.setInterval(Gt,Bq),()=>{V=!0,window.removeEventListener("online",Ls),window.removeEventListener("offline",nn),Le(),K!==null&&window.clearInterval(K),nr(),ft()}},[ma,nr,e,On,Ir,Dn,tr]),T.useEffect(()=>{if(!((N==null?void 0:N.thread.activeTurnId)!==null||(N==null?void 0:N.thread.status)==="running"||Q!==null||rt.length>0||me.length>0||$!==null||Z!==null))return;const K=window.setInterval(()=>{On({showLoading:!1,clearError:!1,reportError:!1})},Uq);return()=>{window.clearInterval(K)}},[N==null?void 0:N.thread.activeTurnId,N==null?void 0:N.thread.status,me.length,Z,$,On,rt.length,Q]);async function rs(){var V;if(!(!N||N.turns.length===0||Ne)){Qe(!0),Ut(null);try{const K=(V=N.turns[0])==null?void 0:V.id,oe=await c2(e,{limit:_v,...K?{beforeTurnId:K}:{}});R(Le=>Le?{...oe,turns:Fq(Le.turns,oe.turns)}:oe),Y(Le=>Le.map(De=>De.id===oe.thread.id?oe.thread:De))}catch(K){Ut(K instanceof Error?K.message:"Unable to load earlier turns.")}finally{Qe(!1)}}}async function Ba(V){var vn,Ls;if(tt==="shell"){if((N==null?void 0:N.thread.isLoaded)===!1){await ss({attachShell:!0});return}const nn=((vn=g.current)==null?void 0:vn.sendCommand(V.prompt))??!1;Ut(nn?null:"Connect the shell before sending commands.");return}je(!0),Ut(null),O(nn=>nn+1);const K=C.current,oe=K?{...K.thread,...S.current??{}}:null,Le=(oe==null?void 0:oe.model)??null,De=(oe==null?void 0:oe.reasoningEffort)??null,ft=qq(),Ue=`optimistic-${Date.now()}`,Tn=`optimistic-steer-${ft}`,Jt=new Date().toISOString();try{let nn=C.current;if(nn&&!nn.thread.isLoaded){const rn={...nn.thread,...S.current??{}},fr=await d2(e,{...nn.thread.model?{model:nn.thread.model}:{},...nn.thread.sandboxMode?{sandboxMode:nn.thread.sandboxMode}:{}}),Ln={...fr,thread:{...fr.thread,model:rn.model??fr.thread.model,reasoningEffort:rn.reasoningEffort??fr.thread.reasoningEffort,collaborationMode:rn.collaborationMode??fr.thread.collaborationMode,sandboxMode:rn.sandboxMode??fr.thread.sandboxMode??null}};nn=Ln,C.current=Ln,R(Is=>Is?{...Ln,turns:Vo(Is.turns,Ln.turns)}:Ln),Y(Is=>Is.map(ml=>ml.id===Ln.thread.id?Ln.thread:ml))}const Gt=nn?{...nn.thread,...S.current??{}}:null,Se=(Gt==null?void 0:Gt.status)==="running"?Gt.activeTurnId:null,Ze=tt==="chat"&&!!Se;Ze&&Se?He(rn=>[...rn,{id:Tn,clientRequestId:ft,turnId:Se,prompt:V.prompt,createdAt:Jt,status:"steering"}]):(nr(),ne(""),_e({id:Ue,serverTurnId:null,startedAt:Jt,status:"sending",error:null,prompt:V.prompt,model:Le,reasoningEffort:De,reasoningEffortAvailable:Tv(U,Le),tokenUsage:null,priceEstimate:null}));const gt={prompt:V.prompt,clientRequestId:ft,...Gt!=null&&Gt.model?{model:Gt.model}:{},...Gt!=null&&Gt.reasoningEffort?{reasoningEffort:Gt.reasoningEffort}:{},...Gt!=null&&Gt.collaborationMode?{collaborationMode:Gt.collaborationMode}:{},...Gt!=null&&Gt.sandboxMode?{sandboxMode:Gt.sandboxMode}:{},...(Ls=V.attachments)!=null&&Ls.length?{attachments:V.attachments}:{}},mn=await w6(e,gt),xt=S.current&&Object.keys(S.current).length>0?{...mn,...S.current}:mn;R(rn=>rn&&{...rn,thread:xt}),Y(rn=>rn.map(fr=>fr.id===xt.id?xt:fr)),Ze&&Se?xt.activeTurnId!==null&&xt.activeTurnId!==Se&&xt.lastTurnStartedAt!==(Gt==null?void 0:Gt.lastTurnStartedAt)?(nr(),ne(""),z(null),He(fr=>fr.filter(Ln=>Ln.id!==Tn)),_e({id:Ue,serverTurnId:xt.activeTurnId,startedAt:xt.lastTurnStartedAt??Jt,status:"inProgress",error:null,prompt:V.prompt,model:Le,reasoningEffort:De,reasoningEffortAvailable:Tv(U,Le),tokenUsage:null,priceEstimate:null})):He(fr=>fr.map(Ln=>Ln.id===Tn?{...Ln,turnId:xt.activeTurnId??Ln.turnId,status:"accepted"}:Ln)):(_e(rn=>rn&&rn.id===Ue?{...rn,id:xt.activeTurnId??rn.id,serverTurnId:xt.activeTurnId??rn.serverTurnId,status:"inProgress",error:null,tokenUsage:rn.tokenUsage,priceEstimate:rn.priceEstimate}:rn),z(null)),en({prompt:"",attachments:[]})}catch(nn){const Gt=nn instanceof Vt?nn.payload.message:nn instanceof Error?nn.message:"Unable to send prompt.";nn instanceof Vt?Ut(nn.payload.message):Ut(Gt),He(Se=>Se.filter(Ze=>Ze.clientRequestId!==ft)),_e(Se=>Se&&Se.id===Ue?{...Se,status:"failed",error:Gt}:Se)}finally{je(!1)}}async function as(){const V=N==null?void 0:N.thread.providerSessionId;if(V)try{await navigator.clipboard.writeText(V),Je("copied")}catch{Je("failed")}}async function ss(V){if(N){je(!0),Ut(null),nr(),ne("");try{if(N.thread.isLoaded){const oe=await k6(e);R(Le=>Le?{...oe,turns:Vo(Le.turns,oe.turns)}:oe),Un(null),Y(Le=>Le.map(De=>De.id===oe.thread.id?oe.thread:De)),Ce(!1);return}const K=await d2(e,{...N.thread.model?{model:N.thread.model}:{},...N.thread.sandboxMode?{sandboxMode:N.thread.sandboxMode}:{}});R(oe=>oe?{...K,turns:Vo(oe.turns,K.turns)}:K),Y(oe=>oe.map(Le=>Le.id===K.thread.id?K.thread:Le)),V!=null&&V.attachShell&&tt==="shell"&&Ce(!0)}catch(K){Ut(K instanceof Error?K.message:"Unable to change connection state.")}finally{je(!1)}}}async function Qt(){var V;if(tt==="shell"){const K=((V=g.current)==null?void 0:V.sendControl("ctrl_c"))??!1;Ut(K?null:"Connect the shell before sending Ctrl-C.");return}je(!0),Ut(null);try{const K=N!=null&&N.thread.activeTurnId?await f2(e,{turnId:N.thread.activeTurnId}):await f2(e);R(oe=>oe&&{...oe,thread:K}),Y(oe=>oe.map(Le=>Le.id===K.id?K:Le)),nr(),ne("")}catch(K){Ut(K instanceof Error?K.message:"Unable to interrupt turn.")}finally{je(!1)}}async function cr(V){if(!N)return;const K=N,oe={...S.current??{},...V.model!==void 0?{model:V.model}:{},...V.reasoningEffort!==void 0?{reasoningEffort:V.reasoningEffort}:{},...V.fastMode!==void 0?{fastMode:V.fastMode}:{},...V.collaborationMode!==void 0?{collaborationMode:V.collaborationMode}:{},...V.sandboxMode!==void 0?{sandboxMode:V.sandboxMode}:{}},Le={...N.thread,...oe};ct(!0),S.current=oe,C.current={...N,thread:Le},R(De=>De&&{...De,thread:Le}),Y(De=>De.map(ft=>ft.id===Le.id?{...ft,...Le}:ft));try{const De=await S6(e,{...V.model!==void 0?{model:V.model}:{},...V.reasoningEffort!==void 0?{reasoningEffort:V.reasoningEffort}:{},...V.fastMode!==void 0?{fastMode:V.fastMode}:{},...V.collaborationMode!==void 0?{collaborationMode:V.collaborationMode}:{},...V.sandboxMode!==void 0?{sandboxMode:V.sandboxMode}:{}});S.current=null,C.current=K?{...K,thread:De}:null,R(ft=>ft&&{...ft,thread:De}),Y(ft=>ft.map(Ue=>Ue.id===De.id?De:Ue))}catch(De){S.current=null,C.current=K,R(K),Y(ft=>ft.map(Ue=>Ue.id===K.thread.id?K.thread:Ue)),Ut(De instanceof Error?De.message:"Unable to update thread settings.")}finally{ct(!1)}}async function Ua(V,K){xe(V),Ut(null);try{const oe=await H6(e,V,K);R(Le=>Le?{...oe,turns:Vo(Le.turns,oe.turns)}:oe),z(oe.livePlan??null),ce(oe.liveItems??null)}catch(oe){Ut(oe instanceof Error?oe.message:"Unable to answer this request.")}finally{xe(null)}}async function ll(){if(N){yn(!0),Ut(null);try{const V=await N6(e);R(K=>K&&{...K,thread:V}),Y(K=>K.map(oe=>oe.id===V.id?V:oe))}catch(V){Ut(V instanceof Error?V.message:"Unable to compact this thread context.")}finally{yn(!1)}}}async function so(V,K){try{const oe=await Qv(V,{title:K});Y(Le=>Le.map(De=>De.id===oe.id?{...De,title:oe.title,updatedAt:oe.updatedAt}:De)),R(Le=>Le&&Le.thread.id===oe.id?{...Le,thread:{...Le.thread,title:oe.title,updatedAt:oe.updatedAt}}:Le)}catch(oe){throw Ut(oe instanceof Error?oe.message:"Unable to rename thread."),oe}}function Cs(){ut(V=>V==="chat"?(N!=null&&N.thread.isLoaded&&Ce(!0),"shell"):"chat")}async function ol(){var K;const V=await((K=g.current)==null?void 0:K.copyLastCommandOutput());Ut(V?null:"Unable to copy the last shell command output.")}function ul(V){var oe,Le;const K=V==="clear"?((oe=g.current)==null?void 0:oe.sendCommand("clear"))??!1:((Le=g.current)==null?void 0:Le.sendControl(V))??!1;Ut(K?null:"Connect the shell before sending control input.")}T.useEffect(()=>{if(!(!ge||tt!=="shell"||!g.current||(N==null?void 0:N.thread.isLoaded)===!1||(Ye==null?void 0:Ye.loading)!==!1)){if((Ye==null?void 0:Ye.status)==="attached"){Ce(!1);return}Ce(!1),g.current.toggleConnection()}},[tt,N==null?void 0:N.thread.isLoaded,ge,Ye==null?void 0:Ye.loading,Ye==null?void 0:Ye.status]),T.useEffect(()=>{if(tt!=="shell")return;const V=window.requestAnimationFrame(()=>{var K;(K=g.current)==null||K.refreshLayout({focus:!0})});return()=>{window.cancelAnimationFrame(V)}},[tt]);const Ha=N&&N.workspacePathStatus==="missing"?"Restore this workspace path on the current machine before continuing.":null,vr=nt&&tt==="chat",is=vr&&tn?Nt:0,di=Math.max(st,144),za=Math.max(qe,di+is),Fa=vr?za+12:0,fi=N?f.jsxs("dl",{className:"space-y-4 text-sm",children:[f.jsxs("div",{className:"relative pr-9",children:[f.jsx("dt",{className:"text-stone-500",children:"Session ID"}),f.jsx("dd",{className:"mt-1 break-all text-stone-100",children:N.thread.providerSessionId??"Unavailable"}),N.thread.providerSessionId&&f.jsx("button",{type:"button","aria-label":"Copy session ID",title:Oe==="copied"?"Copied":Oe==="failed"?"Copy failed":"Copy session ID",onClick:()=>void as(),className:`thread-mobile-hit-target absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${Oe==="copied"?"ui-status-info":Oe==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:f.jsx("span",{className:"scale-[0.72]",children:f.jsx(Qq,{})})})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Source"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.thread.source==="local_codex_import"?`Imported local ${N.thread.provider} session`:`${N.thread.provider} supervisor thread`})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Status"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:gS(N.thread.status)})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Created"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:tu(N.thread.createdAt)})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Workspace"}),f.jsx("dd",{className:"mt-1 break-words text-stone-100",children:N.workspace.absPath})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Workspace path"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.workspacePathStatus==="present"?"Present":"Missing on this machine"})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Active turn"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.thread.activeTurnId??"None"})]})]}):null,Ss=N?f.jsx("div",{className:"space-y-3",children:f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-stone-500",children:"Sandbox Mode"}),f.jsx("div",{className:"mt-2 space-y-1.5",children:Hq.map(V=>{const K=zq(N.thread)===V;return f.jsx("button",{type:"button",disabled:Pe,onClick:()=>void cr({sandboxMode:V}),className:`block w-full rounded-xl border px-3 py-2 text-left text-sm transition ${K?"ui-status-warning":"border-stone-800 bg-stone-950/40 text-stone-300 hover:bg-stone-800/80"} disabled:cursor-not-allowed disabled:opacity-60`,children:V},V)})})]})}):null,cl=Q&&!(N!=null&&N.turns.some(V=>V.id===(Q.serverTurnId??Q.id)))?{id:Q.id,startedAt:Q.startedAt,status:Q.status,error:Q.error,model:Q.model,reasoningEffort:Q.reasoningEffort,reasoningEffortAvailable:Q.reasoningEffortAvailable,tokenUsage:Q.tokenUsage,priceEstimate:Q.priceEstimate,items:[{id:`${Q.id}-user-message`,kind:"userMessage",text:Q.prompt}]}:null,ea=(N==null?void 0:N.thread.isLoaded)??!1,kr=ea?Be.status==="connected"?"ui-action-success shadow-lg shadow-stone-950/20":Be.status==="reconnecting"?"thread-live-connection-reconnecting ui-status-success shadow-lg shadow-stone-950/20":Be.status==="offline"?"ui-status-danger shadow-lg shadow-stone-950/20":"ui-status-warning shadow-lg shadow-stone-950/20":"border border-stone-700/90 bg-stone-900/85 text-stone-400 shadow-lg shadow-stone-950/20",hi=Kq(ea,Be),ga=[hi,ea?null:"Tap to connect this thread",Be.lastHealthyAt?`Last healthy ${tu(Be.lastHealthyAt)}`:null].filter(Boolean).join(" · "),ba=ea?f.jsx("div",{role:"status","aria-live":"polite","aria-label":hi,title:ga,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${kr}`,children:f.jsx(Gf,{status:Be.status})}):f.jsx("button",{type:"button",onClick:()=>void ss(),disabled:Ve||!N,"aria-label":Ve?"Connecting thread":"Connect thread",title:Ve?"Connecting thread":ga,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${kr}`,children:f.jsx(Gf,{status:"detached"})}),dl=ea?f.jsx("div",{title:ga,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${kr}`,children:f.jsx(Gf,{status:Be.status})}):f.jsx("button",{type:"button",onClick:()=>void ss(),disabled:Ve||!N,title:Ve?"Connecting thread":ga,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${kr}`,children:f.jsx(Gf,{status:"detached"})}),Ns=Hn.data??(N==null?void 0:N.goal)??null,fl=(N==null?void 0:N.goalHistory)??[],As=Ns?Vf(fl,Ns):AS(fl),mi=f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),f.jsx("circle",{cx:"8",cy:"8",r:"2"}),f.jsx("path",{d:"M8 1.7v2M8 12.3v2M1.7 8h2M12.3 8h2"})]}),hl=nl?f.jsxs("div",{className:"w-96 max-w-[calc(100vw-1.5rem)] rounded-3xl border border-stone-700/80 bg-stone-950/92 p-3 text-left text-stone-100 shadow-2xl shadow-stone-950/35 backdrop-blur-xl",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-semibold",children:"Goal monitor"}),f.jsx("p",{className:"text-xs text-stone-500",children:"Current thread only"})]}),f.jsx("button",{type:"button",onClick:()=>li(!1),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Close"})]}),Hn.error?f.jsx("p",{className:"mt-3 rounded-2xl border border-rose-400/30 bg-rose-400/10 px-3 py-2 text-xs text-rose-100",children:Hn.error}):null,f.jsx("div",{className:"mt-3 max-h-[28rem] space-y-2 overflow-auto pr-1",children:As.length===0?f.jsx("p",{className:"rounded-2xl border border-stone-800 bg-stone-900/60 px-3 py-3 text-sm text-stone-400",children:"No goals in this thread yet."}):As.map(V=>{const K=NS(V),oe=rl.has(K),Le=["active","paused","budgetLimited"].includes(V.status);return f.jsxs("div",{className:`rounded-2xl border px-3 py-3 ${Le?"ui-status-info":"border-stone-800 bg-stone-900/60"}`,children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsx("button",{type:"button",onClick:()=>ro(De=>{const ft=new Set(De);return ft.has(K)?ft.delete(K):ft.add(K),ft}),className:"min-w-0 flex-1 text-left",children:f.jsx("p",{className:`text-sm font-medium leading-5 ${oe?"":"line-clamp-2"}`,children:V.objective})}),f.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:V.status})]}),f.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] text-stone-400",children:[f.jsx("span",{children:Gq(V.timeUsedSeconds)}),f.jsx("span",{children:Vq(V)}),f.jsxs("span",{title:tu(V.updatedAt),children:["Updated ",new Date(V.updatedAt).toLocaleTimeString()]})]}),Le?f.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[f.jsx("button",{type:"button",disabled:ts||V.status==="active",onClick:()=>void ao("active"),className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-50",children:"Continue"}),f.jsx("button",{type:"button",disabled:ts||V.status==="paused",onClick:()=>void ao("paused"),className:"rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50",children:"Pause"}),f.jsx("button",{type:"button",disabled:ts,onClick:()=>void Jr(),className:"rounded-full border border-rose-400/35 px-3 py-1.5 text-xs text-rose-100 transition hover:bg-rose-400/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Terminate"})]}):null]},K)})})]}):null,rr=f.jsx("button",{type:"button","aria-label":"Open goal monitor",title:"Open goal monitor",onClick:()=>{li(V=>!V),ws()},className:"ui-status-info inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full shadow-lg shadow-stone-950/20 transition lg:h-9 lg:w-9",children:mi}),dr=f.jsx("button",{type:"button","aria-label":"Export transcript",title:"Export transcript",onClick:()=>hn(!0),disabled:!N,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/85 text-stone-300 shadow-lg shadow-stone-950/20 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50 lg:h-9 lg:w-9",children:f.jsx(Xq,{})}),Rs=f.jsxs("div",{className:"relative flex items-center justify-end gap-1.5",children:[dr,rr,ba]});return f.jsx(SS,{threads:M,status:q,loading:ve,error:ve?null:Lr,viewportConstrained:!0,currentThreadId:N==null?void 0:N.thread.id,currentThreadLabel:N==null?void 0:N.thread.title,currentWorkspaceId:N==null?void 0:N.thread.workspaceId,currentWorkspaceLabel:N==null?void 0:N.workspace.label,metaContent:fi,settingsContent:Ss,showMobileNewThreadShortcut:!1,mobileHeaderAction:Rs,onRenameThread:so,children:f.jsxs("div",{className:"thread-detail-surface relative flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded-none border-y shadow-2xl shadow-stone-950/20 sm:flex-none sm:rounded-[2rem] sm:border",children:[f.jsx("div",{className:"pointer-events-none absolute right-4 top-4 z-30 hidden lg:block",children:f.jsx("div",{className:"pointer-events-auto flex flex-col items-end gap-2",children:f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[dr,rr,dl]})})}),hl?f.jsx("div",{className:"fixed right-3 top-20 z-50 lg:absolute lg:top-16 lg:right-4",children:hl}):null,Lr&&!ve&&f.jsx("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:Lr}),ve?f.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Loading thread detail..."}):N?f.jsxs(f.Fragment,{children:[N.workspacePathStatus==="missing"&&f.jsxs("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:[f.jsx("p",{className:"font-medium text-rose-50",children:"Workspace path missing"}),f.jsx("p",{className:"mt-1 break-words text-rose-100/90",children:N.workspace.absPath})]}),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:tt==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:[f.jsx(Iq,{threadId:N.thread.id,turns:N.turns,totalTurnCount:N.totalTurnCount??N.turns.length,pendingRequests:N.pendingRequests,livePlan:$,liveItems:Z,respondingRequestId:Gn,onRespondToRequest:Ua,liveOutput:me,scrollRequestKey:te,bottomSpacer:Fa,className:"thread-timeline-surface min-h-0 flex-1",onTailVisibilityChange:H,loadingEarlier:Ne,onLoadEarlier:rs,onLoadHistoryItemDetail:V=>p6(N.thread.id,V),answeredRequestNotes:N.answeredRequestNotes??[],activityNotes:N.activityNotes??[],pendingSteers:N.pendingSteers??[],optimisticSteers:rt,optimisticTurn:cl}),vr?f.jsx("div",{ref:y,className:"fixed inset-x-0 bottom-0 z-30 sm:hidden",style:{bottom:`${is}px`,paddingBottom:"env(safe-area-inset-bottom)"},children:f.jsx(m0,{activeView:tt,edgeToEdgeMobile:!0,busy:tt==="chat"?Ve:!1,settingsBusy:Pe,error:null,model:N.thread.model,reasoningEffort:N.thread.reasoningEffort,fastMode:N.thread.fastMode??!1,collaborationMode:N.thread.collaborationMode,modelOptions:U,contextUsage:N.thread.contextUsage,capabilities:X,toolboxItems:(F==null?void 0:F.toolboxItems)??[],hookCommandTemplates:(F==null?void 0:F.hookCommandTemplates)??[],mcpConfigFormat:(F==null?void 0:F.mcpConfigFormat)??"none",followTail:A,threadConnected:N.thread.isLoaded,disabled:!!Ha,disabledPlaceholder:Ha??void 0,shellControlState:Ye,draftPrompt:Ct.prompt,draftAttachments:Ct.attachments,onDraftChange:en,canInterrupt:!!N.thread.activeTurnId,onSubmit:Ba,onInterrupt:Qt,onCompact:ll,onOpenForkTurns:il,onForkLatest:Wt,onForkTurn:ci,onOpenSkills:oi,onOpenMcp:sl,onOpenHooks:Hr,onCreateHook:pa,onUpdateHook:_n,onTrustHook:In,onUntrustHook:ui,goalState:Hn,onOpenGoal:ws,onUpdateGoal:Ur,onReadProviderConfig:ur?()=>hg(N.thread.provider,ur):void 0,onWriteProviderConfig:ur?V=>mg(N.thread.provider,ur,{content:V}):void 0,onToggleFollow:()=>O(V=>V+1),onUpdateSettings:cr,onToggleView:Cs,onShellCopy:ol,onShellControl:ul,compactBusy:bt,skillsState:Fe,mcpState:Mt,hooksState:Rt,forkTurnOptionsState:Zt})}):f.jsx("div",{ref:y,children:f.jsx(m0,{activeView:tt,busy:tt==="chat"?Ve:!1,settingsBusy:Pe,error:null,model:N.thread.model,reasoningEffort:N.thread.reasoningEffort,fastMode:N.thread.fastMode??!1,collaborationMode:N.thread.collaborationMode,modelOptions:U,contextUsage:N.thread.contextUsage,capabilities:X,toolboxItems:(F==null?void 0:F.toolboxItems)??[],hookCommandTemplates:(F==null?void 0:F.hookCommandTemplates)??[],mcpConfigFormat:(F==null?void 0:F.mcpConfigFormat)??"none",followTail:A,threadConnected:N.thread.isLoaded,disabled:!!Ha,disabledPlaceholder:Ha??void 0,shellControlState:Ye,draftPrompt:Ct.prompt,draftAttachments:Ct.attachments,onDraftChange:en,canInterrupt:!!N.thread.activeTurnId,onSubmit:Ba,onInterrupt:Qt,onCompact:ll,onOpenForkTurns:il,onForkLatest:Wt,onForkTurn:ci,onOpenSkills:oi,onOpenMcp:sl,onOpenHooks:Hr,onCreateHook:pa,onUpdateHook:_n,onTrustHook:In,onUntrustHook:ui,goalState:Hn,onOpenGoal:ws,onUpdateGoal:Ur,onReadProviderConfig:ur?()=>hg(N.thread.provider,ur):void 0,onWriteProviderConfig:ur?V=>mg(N.thread.provider,ur,{content:V}):void 0,onToggleFollow:()=>O(V=>V+1),onUpdateSettings:cr,onToggleView:Cs,onShellCopy:ol,onShellControl:ul,compactBusy:bt,skillsState:Fe,mcpState:Mt,hooksState:Rt,forkTurnOptionsState:Zt})})]}),f.jsxs("div",{className:tt==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[N.thread.isLoaded&&f.jsx(M4,{ref:g,threadId:N.thread.id,isVisible:tt==="shell",showHeader:!1,showFloatingToolbox:!1,onStateChange:Un}),tt==="shell"&&!N.thread.isLoaded&&f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:f.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[f.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Thread disconnected"}),f.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Reconnect this thread before creating or attaching a shell."})]})}),tt==="shell"&&f.jsx(m0,{activeView:tt,busy:Ve,settingsBusy:!1,error:N.thread.isLoaded?(Ye==null?void 0:Ye.error)??null:null,followTail:!1,capabilities:X,toolboxItems:(F==null?void 0:F.toolboxItems)??[],hookCommandTemplates:(F==null?void 0:F.hookCommandTemplates)??[],mcpConfigFormat:(F==null?void 0:F.mcpConfigFormat)??"none",threadConnected:N.thread.isLoaded,shellControlState:Ye,canInterrupt:!!(N.thread.isLoaded&&(Ye!=null&&Ye.isCommandRunning)),onSubmit:Ba,onInterrupt:Qt,onToggleView:Cs,onShellCopy:ol,onShellControl:ul})]})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Unable to resolve this thread."}),f.jsx(t4,{open:Kr,busy:Cn,turnsState:er,onCancel:()=>{Cn||hn(!1)},onLoadTurns:Sn,onExport:al})]})})}function Jq(){const e=Za(),[t,n]=T.useState(""),[r,i]=T.useState(!1),[l,o]=T.useState(null);async function c(d){d.preventDefault();const m=t.trim();if(!m){o("Session ID is required.");return}i(!0),o(null);try{const p=await _6(m);e(`/threads/${p.thread.id}`)}catch(p){p instanceof Vt?o(p.payload.message):o(p instanceof Error?p.message:"Unable to import session.")}finally{i(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Import Session"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Bring in a local Codex session"}),f.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-6 text-stone-400",children:"Paste a session ID from this machine. Supervisor will recover the workspace path, reuse an existing workspace when possible, or create one with the last folder name as the default label."}),f.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-stone-500",children:"Imported history appears immediately, but sending a new prompt still requires a manual Resume / Connect."})]}),f.jsxs("form",{onSubmit:c,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"session-id",className:"text-sm font-medium text-stone-200",children:"Local session ID"}),f.jsx("input",{id:"session-id",value:t,onChange:d=>n(d.target.value),placeholder:"019d6fb7-7033-7a30-a2c7-74d0919e87d4",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),l&&f.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l}),f.jsx("div",{className:"flex flex-wrap items-center gap-3",children:f.jsx("button",{type:"submit",disabled:r,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:r?"Importing...":"Import Session"})})]})]})}function og(e){return e.enabled&&e.capabilities.sessions.resume&&e.capabilities.turns.start}function eY(){const e=Za(),t=Kl(),[n]=$v(),[r,i]=T.useState([]),[l,o]=T.useState([]),[c,d]=T.useState([]),[m,p]=T.useState((t==null?void 0:t.defaultBackend)??"codex"),[g,y]=T.useState(""),[E,v]=T.useState(""),[w,C]=T.useState(""),[S,N]=T.useState("yolo"),[R,M]=T.useState(!0),[Y,U]=T.useState(!1),[P,q]=T.useState(null),le=n.get("workspaceId");T.useEffect(()=>{Promise.all([y1(),Gv(),qv()]).then(async([F,Te,me])=>{var A,H,te,O;const ne=me.filter(og),$=((A=ne[0])==null?void 0:A.provider)??"codex",z=ne.some(ve=>ve.provider===Te.defaultBackend)?Te.defaultBackend:$;t==null||t.setDefaultBackend(z),p(z),o(me);const Z=await fg(z);i(F),d(Z);const ce=F.some(ve=>ve.id===le)?le:((H=F[0])==null?void 0:H.id)??"";y(ce),v(((te=Z.find(ve=>ve.isDefault))==null?void 0:te.model)??((O=Z[0])==null?void 0:O.model)??"")}).catch(F=>{q(F instanceof Error?F.message:"Unable to load creation form data.")}).finally(()=>{M(!1)})},[le,t]),T.useEffect(()=>{if(!m)return;let F=!1;return fg(m).then(Te=>{var me,ne;F||(d(Te),v(((me=Te.find($=>$.isDefault))==null?void 0:me.model)??((ne=Te[0])==null?void 0:ne.model)??""))}).catch(Te=>{F||q(Te instanceof Error?Te.message:"Unable to load backend models.")}),()=>{F=!0}},[m]);function X(){if(window.history.length>1){e(-1);return}if(le){e(`/threads?workspaceId=${encodeURIComponent(le)}`);return}e("/workspaces")}async function fe(F){F.preventDefault(),U(!0),q(null);try{const Te=await E6(w.trim()?{workspaceId:g,provider:m,model:E,approvalMode:S,title:w.trim()}:{workspaceId:g,provider:m,model:E,approvalMode:S});e(`/threads/${Te.id}`)}catch(Te){Te instanceof Vt?q(Te.payload.message):q(Te instanceof Error?Te.message:"Unable to create thread.")}finally{U(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"New Thread"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Start a backend session"}),f.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Choose the workspace, model, and approval mode that should back the new thread."})]}),R?f.jsx("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 px-6 py-12 text-center text-stone-400",children:"Loading creation form..."}):f.jsxs("form",{onSubmit:fe,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-backend",children:"Backend"}),f.jsx("select",{id:"thread-backend",value:m,onChange:F=>{const Te=F.target.value;p(Te),t==null||t.setDefaultBackend(Te)},className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:l.map(F=>f.jsxs("option",{value:F.provider,disabled:!og(F),children:[F.displayName,og(F)?"":" (not available)"]},F.provider))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-workspace",children:"Workspace"}),f.jsx("select",{id:"thread-workspace",value:g,onChange:F=>y(F.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:r.map(F=>f.jsxs("option",{value:F.id,children:[F.label," · ",F.absPath]},F.id))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-model",children:"Model"}),f.jsx("select",{id:"thread-model",value:E,onChange:F=>v(F.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:c.map(F=>f.jsxs("option",{value:F.model,children:[F.displayName," · ",F.model]},F.id))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-title",children:"Title"}),f.jsx("input",{id:"thread-title",value:w,onChange:F=>C(F.target.value),placeholder:"Optional. Falls back to first prompt.",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-approval-mode",children:"Approval mode"}),f.jsxs("select",{id:"thread-approval-mode",value:S,onChange:F=>N(F.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:[f.jsx("option",{value:"yolo",children:"yolo"}),f.jsx("option",{value:"guarded",children:"guarded"})]})]}),P&&f.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:P}),f.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[f.jsx("button",{type:"submit",disabled:Y||!g||!E,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:Y?"Creating...":"Create Thread"}),f.jsx("button",{type:"button",onClick:X,disabled:Y,className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:border-stone-800 disabled:text-stone-500",children:"Cancel"})]})]})]})}function RS({open:e,title:t,description:n,confirmLabel:r="Delete",busy:i=!1,onCancel:l,onConfirm:o}){return T.useEffect(()=>{if(!e)return;function c(d){d.key==="Escape"&&!i&&l()}return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[i,l,e]),e?uu.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close confirmation dialog",onClick:l,disabled:i,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),f.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),f.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]}),f.jsx("button",{type:"button","aria-label":"Close dialog",onClick:l,disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),f.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:l,disabled:i,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),f.jsx("button",{type:"button",onClick:()=>void o(),disabled:i,className:"ui-action-danger rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:i?"Deleting...":r})]})]})]}),document.body):null}function tY(e){const t=e.replace(/\s+/g," ").trim(),n=Array.from(t);return n.length<=15?t:`${n.slice(0,15).join("")}...`}function nY(){const[e]=$v(),t=Za(),n=Kl(),r=e.get("workspaceId"),[i,l]=T.useState([]),[o,c]=T.useState([]),[d,m]=T.useState(null),[p,g]=T.useState(!0),[y,E]=T.useState(null),[v,w]=T.useState(null),[C,S]=T.useState(""),[N,R]=T.useState(null),[M,Y]=T.useState(null),[U,P]=T.useState(!1);async function q(){g(!0),E(null);try{const[Z,ce,A]=await Promise.all([Yv((n==null?void 0:n.defaultBackend)??"codex").then(H=>H.status),Wv(),y1()]);m(Z),l(ce),c(A)}catch(Z){E(Z instanceof Error?Z.message:"Unable to load threads.")}finally{g(!1)}}T.useEffect(()=>{if(r===null)return;q();const Z=Xv(ce=>{l(A=>A.map(H=>H.id===ce.threadId?{...H,status:typeof ce.payload.status=="string"?ce.payload.status:H.status,lastError:typeof ce.payload.error=="string"?ce.payload.error:H.lastError,title:typeof ce.payload.title=="string"?ce.payload.title:H.title}:H))});return()=>{Z.close()}},[r,n==null?void 0:n.defaultBackend]);const le=Object.fromEntries(o.map(Z=>[Z.id,Z.label])),X=o.find(Z=>Z.id===r)??null,fe=T.useMemo(()=>r?i.filter(Z=>Z.workspaceId===r):[],[r,i]),F=fe.filter(Z=>Z.status==="running").length,Te=r?`/threads/new?workspaceId=${encodeURIComponent(r)}`:"/threads/new";if(r===null)return f.jsx(y5,{to:"/workspaces",replace:!0});function me(){switch(d==null?void 0:d.state){case"ready":return"bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.14)]";case"starting":return"bg-amber-300 shadow-[0_0_0_3px_rgba(252,211,77,0.12)]";case"degraded":case"failed":return"bg-rose-400 shadow-[0_0_0_3px_rgba(251,113,133,0.14)]";default:return"bg-stone-500 shadow-[0_0_0_3px_rgba(120,113,108,0.14)]"}}async function ne(Z,ce){try{const A=await Qv(Z,{title:ce});l(H=>H.map(te=>te.id===A.id?{...te,title:A.title,updatedAt:A.updatedAt}:te))}catch(A){throw E(A instanceof Error?A.message:"Unable to rename thread."),A}}async function $(){if(!v)return;const Z=C.trim();if(Z){R(v);try{await ne(v,Z),w(null),S("")}finally{R(null)}}}async function z(){if(M){P(!0);try{await C6(M.id),l(Z=>Z.filter(ce=>ce.id!==M.id)),Y(null)}catch(Z){E(Z instanceof Error?Z.message:"Unable to delete thread.")}finally{P(!1)}}}return f.jsx(SS,{threads:i,workspaceLabels:le,status:d,loading:p,error:y,viewportConstrained:r!==null,showMobileAppMenu:!0,showMobileThreadNavToggle:!1,showMobileNewThreadShortcut:!1,currentWorkspaceId:r,currentWorkspaceLabel:(X==null?void 0:X.label)??null,onRenameThread:ne,children:f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-[2rem] border border-stone-800 bg-stone-900/85 shadow-2xl shadow-stone-950/20",children:[f.jsx("div",{className:"border-b border-stone-800 px-4 py-3 sm:px-6 sm:py-4",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("h2",{className:"min-w-0 truncate text-base font-semibold text-stone-100 sm:text-lg",title:X?`${X.label} threads`:"All threads",children:X?X.label:"All Threads"}),f.jsx(ai,{to:Te,className:"inline-flex h-9 shrink-0 items-center rounded-full bg-amber-300 px-3.5 text-xs font-medium uppercase tracking-[0.18em] text-stone-950 transition hover:bg-amber-200",children:"New Thread"})]})}),f.jsx("div",{className:"px-4 py-3 sm:px-6 sm:py-4",children:f.jsxs("article",{className:"inline-flex min-w-[12rem] max-w-full items-center gap-3 rounded-[1.25rem] border border-stone-800 bg-stone-950/70 px-3.5 py-2.5",children:[f.jsx("span",{"aria-hidden":"true",className:`h-2.5 w-2.5 shrink-0 rounded-full ${me()}`}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.22em] text-stone-500",children:"Supervisor"}),f.jsx("p",{className:"truncate text-sm text-stone-200",children:(d==null?void 0:d.lastError)??((d==null?void 0:d.state)==="ready"?"Ready":(d==null?void 0:d.state)??"Checking")})]})]})}),!p&&!y&&fe.length>0&&f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-stone-800 px-4 py-4 sm:px-6 sm:py-5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-stone-500",children:"Recent Threads"}),f.jsxs("span",{className:"rounded-full border border-amber-300/30 bg-amber-300/10 px-2 py-0.5 text-[11px] font-medium uppercase tracking-[0.18em] text-amber-200",children:[fe.length," total"]}),F>0&&f.jsxs("span",{className:"text-xs text-stone-500",children:["· ",F," running"]})]}),f.jsx("div",{className:"mt-3 min-h-0 flex-1",children:f.jsx(CS,{threads:fe,currentWorkspaceId:r,workspaceLabels:le,onOpenThread:Z=>t(`/threads/${Z}`),onBeginRenameThread:Z=>{w(Z.id),S(Z.title)},onDeleteThread:Z=>Y(Z),scrollable:!0,maxHeightClassName:"max-h-full",showDeleteButton:!0,showSessionCopyButton:!0})})]}),!p&&!y&&fe.length===0&&f.jsx("div",{className:"border-t border-stone-800 px-4 py-6 text-sm text-stone-500 sm:px-6",children:"No threads available in this workspace."})]}),f.jsx(Sb,{open:v!==null,title:"Rename Thread",label:"Thread Title",value:C,busy:N!==null,onChange:S,onCancel:()=>{w(null),S("")},onSubmit:()=>void $()}),f.jsx(RS,{open:M!==null,title:"Delete Thread",description:M?`Delete ${tY(M.title)} from supervisor. The backend session id will no longer appear in this workspace list.`:"",confirmLabel:"Delete Thread",busy:U,onCancel:()=>{U||Y(null)},onConfirm:()=>void z()})]})})}function vv(e){const t=e.trim(),n=t.replace(/[\\/]+$/,"");if(!n)return"";if(LS(t)){const i=(n.split(/[?#]/)[0]??n).split(/[/:]/).filter(Boolean).at(-1)??"";return i.endsWith(".git")?i.slice(0,-4):i}return n.split(/[\\/]/).filter(Boolean).at(-1)??""}function LS(e){const t=e.trim();return/^https?:\/\/.+/i.test(t)||/^ssh:\/\/.+/i.test(t)||/^git@[^:]+:.+/.test(t)}function rY({initialPath:e="",initialLabel:t="",submitLabel:n="Save Workspace",error:r,busy:i=!1,onSubmit:l}){const o=vv(e),[c,d]=T.useState(e),[m,p]=T.useState(t||o),[g,y]=T.useState(null),E=T.useRef(o);T.useEffect(()=>{const w=vv(c);p(C=>!C.trim()||C===E.current?w:C),E.current=w},[c]);async function v(w){w.preventDefault();const C=c.trim();if(!C){y("Workspace path or Git URL is required.");return}y(null);const S=m.trim(),N=LS(C)?"gitUrl":"absPath";await l(S?{[N]:C,label:S}:{[N]:C})}return f.jsxs("form",{onSubmit:v,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"workspace-path",className:"text-sm font-medium text-stone-200",children:"Path or Git URL"}),f.jsx("input",{id:"workspace-path",name:"absPath",value:c,onChange:w=>d(w.target.value),placeholder:"/Users/name/project or https://github.com/owner/repo.git",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),f.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Absolute paths register local directories. Git URLs clone into the configured dev home."})]}),f.jsxs("div",{children:[f.jsx("label",{htmlFor:"workspace-label",className:"text-sm font-medium text-stone-200",children:"Display label"}),f.jsx("input",{id:"workspace-label",name:"label",value:m,onChange:w=>p(w.target.value),placeholder:"Optional override",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),f.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Defaults to the last folder name. You can override it."})]}),(g||r)&&f.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:g??r}),f.jsx("button",{type:"submit",disabled:i,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:i?"Saving...":n})]})}function aY(){const e=Za(),[t,n]=T.useState(null),[r,i]=T.useState(!1);async function l(o){i(!0),n(null);try{const c=await z6(o);e(`/threads?workspaceId=${encodeURIComponent(c.id)}`)}catch(c){c instanceof Vt?n(c.payload.message):n(c instanceof Error?c.message:"Unable to create workspace.")}finally{i(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Add Workspace"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Create a workspace"}),f.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Register an existing local directory, create one missing child directory under dev home, or clone a Git repository into dev home."})]}),f.jsx(rY,{busy:r,error:t,submitLabel:"Create Workspace",onSubmit:l})]})}function kv(e){return Date.parse(e.lastOpenedAt??e.createdAt)}function sY(e,t){return e.isFavorite!==t.isFavorite?e.isFavorite?-1:1:kv(t)-kv(e)}function iY(e){return e?new Date(e).toLocaleString():"Never opened"}function lY(e,t=28){return e.length<=t?e:`...${e.slice(-(t-3))}`}function oY({active:e}){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:`h-3.5 w-3.5 fill-current ${e?"rotate-[18deg]":"rotate-[8deg]"}`,children:f.jsx("path",{d:"M10.7 1.75c.34 0 .62.28.62.63v1.24l1.43 1.42c.24.24.24.62 0 .86l-1.1 1.1v2.02c0 .17-.07.33-.19.45l-1.5 1.5v2.28c0 .28-.18.53-.44.6a.62.62 0 0 1-.69-.24L7.2 12.4l-2.83 2.83a.625.625 0 1 1-.88-.88l2.83-2.83-2.2-1.62a.62.62 0 0 1-.24-.69c.08-.26.32-.44.6-.44h2.28l1.5-1.5a.64.64 0 0 1 .45-.18h2.02l1.1-1.11-1.42-1.42H9.07a.63.63 0 0 1-.62-.63c0-.34.28-.62.62-.62h1.63Z"})})}function uY(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Zm1.53 1.32c.35 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Zm2.82 0c.34 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Z"})})}function cY(){const e=Za(),[t,n]=T.useState([]),[r,i]=T.useState(!0),[l,o]=T.useState(null),[c,d]=T.useState(null),[m,p]=T.useState(""),[g,y]=T.useState(null),[E,v]=T.useState(null),[w,C]=T.useState(null),[S,N]=T.useState(!1);async function R(){i(!0),o(null);try{n(await y1())}catch(F){o(F instanceof Error?F.message:"Unable to load workspaces.")}finally{i(!1)}}T.useEffect(()=>{R()},[]);async function M(F){const Te={...F,isFavorite:!F.isFavorite};n(me=>me.map(ne=>ne.id===F.id?Te:ne));try{const me=await V6(F.id,{isFavorite:!F.isFavorite});n(ne=>ne.map($=>$.id===me.id?me:$))}catch(me){n(ne=>ne.map($=>$.id===F.id?F:$)),o(me instanceof Error?me.message:"Unable to update workspace.")}}async function Y(F){const Te=m.trim();if(Te){y(F);try{const me=await F6(F,{label:Te});n(ne=>ne.map($=>$.id===me.id?me:$)),d(null),p("")}catch(me){o(me instanceof Error?me.message:"Unable to rename workspace.")}finally{y(null)}}}function U(F){d(F.id),p(F.label)}function P(){d(null),p("")}function q(F){e(`/threads?workspaceId=${encodeURIComponent(F)}`)}async function le(){if(w){N(!0);try{await $6(w.id),n(F=>F.filter(Te=>Te.id!==w.id)),C(null)}catch(F){o(F instanceof Error?F.message:"Unable to delete workspace.")}finally{N(!1)}}}function X(F,Te){(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),q(Te))}const fe=T.useMemo(()=>[...t].sort(sY),[t]);return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"sticky top-[env(safe-area-inset-top)] z-20 -mx-4 border-b border-stone-800/90 bg-stone-950/96 px-2.5 py-2 backdrop-blur sm:mx-0 sm:rounded-[1.4rem] sm:border sm:px-4",children:f.jsxs("div",{className:"relative",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 sm:gap-2",children:[f.jsx(E1,{}),f.jsx(ai,{to:"/threads/import",className:"inline-flex h-8 shrink-0 items-center rounded-full border border-sky-400/30 bg-sky-400/10 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-sky-100 transition hover:border-sky-300/45 hover:bg-sky-400/16 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Import"}),f.jsx(ai,{to:"/workspaces/new",className:"inline-flex h-8 shrink-0 items-center rounded-full bg-amber-300 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-stone-950 transition hover:bg-amber-200 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Create"}),f.jsx("div",{className:"min-w-0 flex-1 text-right",children:f.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.24em] text-stone-500",children:"Workspaces"})})]}),f.jsx(_1,{className:"absolute left-0 top-[calc(100%+0.5rem)] z-30 w-[min(22rem,calc(100vw-1rem))]"})]})}),r&&f.jsx("div",{className:"rounded-[1.6rem] border border-stone-800 bg-stone-900/85 px-6 py-12 text-center text-stone-400",children:"Loading workspace registry..."}),l&&f.jsx("div",{className:"rounded-[1.4rem] border border-rose-500/30 bg-rose-500/10 px-4 py-4 text-rose-100",children:l}),!r&&!l&&t.length===0&&f.jsxs("div",{className:"rounded-[1.6rem] border border-dashed border-stone-700 bg-stone-900/80 px-6 py-12 text-center",children:[f.jsx("p",{className:"text-lg font-medium text-stone-100",children:"No workspaces yet"}),f.jsx("p",{className:"mt-2 text-sm text-stone-500",children:"Add a local directory inside the configured workspace root to start building the registry."})]}),!r&&fe.length>0&&f.jsx("div",{className:"space-y-2 overflow-x-hidden",children:fe.map(F=>f.jsxs("article",{role:"link",tabIndex:0,onClick:()=>q(F.id),onKeyDown:Te=>X(Te,F.id),className:"relative overflow-hidden rounded-[1.35rem] border border-stone-800 bg-stone-900/88 px-4 py-3 shadow-lg shadow-stone-950/10 transition hover:border-stone-700 hover:bg-stone-900",children:[f.jsxs("div",{className:"absolute right-2.5 top-2.5 flex items-center gap-1.5",children:[f.jsx("button",{type:"button","aria-label":`Delete workspace ${F.label}`,title:"Delete workspace",onClick:Te=>{Te.stopPropagation(),C(F)},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-rose-400/20 bg-rose-400/10 text-rose-200 transition hover:bg-rose-400/18",children:f.jsx(uY,{})}),f.jsx("button",{type:"button","aria-label":F.isFavorite?`Unpin workspace ${F.label}`:`Pin workspace ${F.label}`,title:F.isFavorite?"Unpin workspace":"Pin workspace",onClick:Te=>{Te.stopPropagation(),M(F)},className:`inline-flex h-7 w-7 items-center justify-center rounded-full border transition ${F.isFavorite?"border-amber-300/40 bg-amber-300/15 text-amber-200":"border-stone-700 bg-stone-900/72 text-stone-500 hover:text-stone-200"}`,children:f.jsx(oY,{active:F.isFavorite})})]}),f.jsx("div",{className:"flex min-w-0 items-start gap-3 pr-[4.6rem]",children:f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[f.jsx("p",{className:"min-w-0 max-w-full truncate text-base font-semibold text-stone-100 sm:text-lg",title:F.label,children:F.label}),f.jsx("button",{type:"button",onClick:Te=>{Te.stopPropagation(),U(F)},"aria-label":`Rename workspace ${F.label}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-stone-500 transition hover:text-stone-100",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})})]}),f.jsx("button",{type:"button","aria-label":F.absPath,title:F.absPath,onClick:Te=>{Te.stopPropagation(),v(F.absPath)},className:"mt-1 inline-block max-w-full overflow-hidden whitespace-nowrap text-left text-[9px] leading-4 text-stone-500 transition hover:text-stone-300",children:lY(F.absPath)}),f.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-stone-500",children:f.jsxs("span",{className:"min-w-0 truncate",children:["Last opened: ",iY(F.lastOpenedAt)]})})]})})]},F.id))}),f.jsx(Sb,{open:c!==null,title:"Rename Workspace",label:"Workspace Label",value:m,busy:g!==null,onChange:p,onCancel:P,onSubmit:()=>c?Y(c):void 0}),f.jsx(pS,{open:E!==null,title:"Workspace Path",text:E??"",onClose:()=>v(null)}),f.jsx(RS,{open:w!==null,title:"Delete Workspace",description:w?`Delete ${w.label} from supervisor. This also removes its threads and local supervisor metadata.`:"",confirmLabel:"Delete Workspace",busy:S,onCancel:()=>{S||C(null)},onConfirm:()=>void le()})]})}const IS="remote-codex-theme-mode",OS="remote-codex-default-backend";function dY(){if(typeof window>"u")return"system";const e=window.localStorage.getItem(IS);return e==="light"||e==="dark"||e==="system"?e:"system"}function fY(){return typeof window>"u"?"codex":window.localStorage.getItem(OS)==="claude"?"claude":"codex"}function hY(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function mY({themeMode:e,setThemeMode:t,effectiveTheme:n}){const[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,d]=T.useState(fY),m=fa(),p=/^\/threads\/[^/]+$/.test(m.pathname),g=m.pathname==="/threads",y=p||g,E=g||p,v=m.pathname==="/workspaces",w=v||g;T.useEffect(()=>{i(!1)},[m.pathname,m.search]);function C(S){d(S),window.localStorage.setItem(OS,S)}return f.jsxs(Vv.Provider,{value:{navOpen:r,openNav:()=>i(!0),toggleNav:()=>i(S=>!S),closeNav:()=>i(!1),settingsOpen:l,openSettings:()=>{i(!1),o(!0)},closeSettings:()=>o(!1),themeMode:e,setThemeMode:t,effectiveTheme:n,defaultBackend:c,setDefaultBackend:C},children:[f.jsxs("div",{className:`bg-[var(--app-bg)] text-[var(--app-fg)] ${y?"fixed inset-0 overflow-hidden overscroll-none":"min-h-screen"}`,children:[!w&&f.jsxs("div",{className:`fixed left-4 top-4 z-50 ${p?"hidden sm:block":""}`,children:[f.jsx(E1,{}),f.jsx(_1,{className:"mt-3 w-[min(22rem,calc(100vw-2rem))]"})]}),f.jsx("main",{className:`mx-auto w-full max-w-[1600px] ${y?"absolute inset-0 pb-0 sm:pb-4":"pb-4"} ${E?p||g?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-[calc(env(safe-area-inset-top)+4rem)] sm:pt-4":v?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-4"} ${y?"overflow-hidden overscroll-none px-0 sm:px-6":"px-4 sm:px-6"}`,children:f.jsx("section",{className:`min-w-0 ${y?"h-full overflow-hidden overscroll-none":""}`,children:f.jsx(E5,{})})})]}),f.jsx(K6,{})]})}function pY(){const[e,t]=T.useState(()=>dY()),[n,r]=T.useState(()=>hY()),i=e==="system"?n:e;return T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>{r(l.matches?"dark":"light")};return o(),typeof l.addEventListener=="function"?l.addEventListener("change",o):l.addListener(o),()=>{typeof l.removeEventListener=="function"?l.removeEventListener("change",o):l.removeListener(o)}},[]),T.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(IS,e)},[e]),T.useEffect(()=>{const l=document.documentElement;l.dataset.themeMode=e,l.dataset.themeEffective=i,l.style.colorScheme=i},[i,e]),f.jsx("div",{className:"theme-shell theme-scrollbar",children:f.jsx(Y5,{children:f.jsxs(T5,{children:[f.jsx(Zs,{path:"/",element:f.jsx(Z6,{})}),f.jsxs(Zs,{element:f.jsx(mY,{themeMode:e,setThemeMode:t,effectiveTheme:i}),children:[f.jsx(Zs,{path:"/workspaces",element:f.jsx(cY,{})}),f.jsx(Zs,{path:"/workspaces/new",element:f.jsx(aY,{})}),f.jsx(Zs,{path:"/threads",element:f.jsx(nY,{})}),f.jsx(Zs,{path:"/threads/import",element:f.jsx(Jq,{})}),f.jsx(Zs,{path:"/threads/new",element:f.jsx(eY,{})}),f.jsx(Zs,{path:"/threads/:id",element:f.jsx(Zq,{})})]})]})})})}EA.createRoot(document.getElementById("root")).render(f.jsx(hA.StrictMode,{children:f.jsx(pY,{})}));const gY=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:mS},Symbol.toStringTag,{value:"Module"}));export{fV as A,vY as L,ca as R,Lh as g,f as j,T as r};
|