const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-LfdN0zeE.js","assets/html-C2L_23MC.js","assets/javascript-ySlJ1b_l.js","assets/css-BPhBrDlE.js","assets/angular-ts-CKsD7JZE.js","assets/scss-C31hgJw-.js","assets/apl-BBq3IX1j.js","assets/xml-e3z08dGr.js","assets/java-xI-RfyKK.js","assets/json-BQoSv7ci.js","assets/astro-CqkE3fuf.js","assets/typescript-Dj6nwHGl.js","assets/postcss-B3ZDOciz.js","assets/blade-a8OxSdnT.js","assets/sql-COK4E0Yg.js","assets/bsl-Dgyn0ogV.js","assets/sdbl-BLhTXw86.js","assets/cairo--RitsXJZ.js","assets/python-DhUJRlN_.js","assets/cobol-PTqiYgYu.js","assets/coffee-dyiR41kL.js","assets/cpp-BksuvNSY.js","assets/regexp-DWJ3fJO_.js","assets/glsl-DBO2IWDn.js","assets/c-C3t2pwGQ.js","assets/crystal-DtDmRg-F.js","assets/shellscript-atvbtKCR.js","assets/edge-D5gP-w-T.js","assets/html-derivative-CSfWNPLT.js","assets/elixir-CLiX3zqd.js","assets/elm-CmHSxxaM.js","assets/erb-BYTLMnw6.js","assets/ruby-DeZ3UC14.js","assets/haml-B2EZWmdv.js","assets/graphql-cDcHW_If.js","assets/jsx-BAng5TT0.js","assets/tsx-B6W0miNI.js","assets/lua-CvWAzNxB.js","assets/yaml-CVw76BM1.js","assets/fortran-fixed-form-TqA4NnZg.js","assets/fortran-free-form-DKXYxT9g.js","assets/fsharp-XplgxFYe.js","assets/markdown-UIAJJxZW.js","assets/gdresource-BHYsBjWJ.js","assets/gdshader-SKMF96pI.js","assets/gdscript-DfxzS6Rs.js","assets/git-commit-i4q6IMui.js","assets/diff-BgYniUM_.js","assets/git-rebase-B-v9cOL2.js","assets/glimmer-js-D-cwc0-E.js","assets/glimmer-ts-pgjy16dm.js","assets/hack-D1yCygmZ.js","assets/handlebars-BQGss363.js","assets/http-FRrOvY1W.js","assets/hxml-TIA70rKU.js","assets/haxe-C5wWYbrZ.js","assets/imba-bv_oIlVt.js","assets/jinja-DGy0s7-h.js","assets/jison-BqZprYcd.js","assets/julia-BBuGR-5E.js","assets/r-CwjWoCRV.js","assets/latex-C-cWTeAZ.js","assets/tex-rYs2v40G.js","assets/liquid-D3W5UaiH.js","assets/marko-z0MBrx5-.js","assets/less-BfCpw3nA.js","assets/mdc-DB_EDNY_.js","assets/nginx-D_VnBJ67.js","assets/nim-ZlGxZxc3.js","assets/perl-CHQXSrWU.js","assets/php-B5ebYQev.js","assets/pug-CM9l7STV.js","assets/qml-D8XfuvdV.js","assets/razor-CNLDkMZG.js","assets/csharp-D9R-vmeu.js","assets/rst-4NLicBqY.js","assets/cmake-DbXoA79R.js","assets/sas-BmTFh92c.js","assets/shaderlab-B7qAK45m.js","assets/hlsl-ifBTmRxC.js","assets/shellsession-C_rIy8kc.js","assets/soy-C-lX7w71.js","assets/sparql-bYkjHRlG.js","assets/turtle-BMR_PYu6.js","assets/stata-DorPZHa4.js","assets/svelte-MSaWC3Je.js","assets/templ-dwX3ZSMB.js","assets/go-B1SYOhNW.js","assets/ts-tags-CipyTH0X.js","assets/twig-NC5TFiHP.js","assets/vue-BuYVFjOK.js","assets/vue-html-xdeiXROB.js","assets/xsl-Dd0NUgwM.js"])))=>i.map(i=>d[i]);
var Dj=Object.defineProperty;var Rj=(e,t,n)=>t in e?Dj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ie=(e,t,n)=>Rj(e,typeof t!="symbol"?t+"":t,n);(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 s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Vp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function p1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x9={exports:{}},g1={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Oj=Symbol.for("react.transitional.element"),jj=Symbol.for("react.fragment");function w9(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:Oj,type:e,key:r,ref:t!==void 0?t:null,props:n}}g1.Fragment=jj;g1.jsx=w9;g1.jsxs=w9;x9.exports=g1;var h=x9.exports,k9={exports:{}},jt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var lw=Symbol.for("react.transitional.element"),Lj=Symbol.for("react.portal"),Bj=Symbol.for("react.fragment"),zj=Symbol.for("react.strict_mode"),Pj=Symbol.for("react.profiler"),$j=Symbol.for("react.consumer"),Uj=Symbol.for("react.context"),Hj=Symbol.for("react.forward_ref"),qj=Symbol.for("react.suspense"),Fj=Symbol.for("react.memo"),_9=Symbol.for("react.lazy"),Vj=Symbol.for("react.activity"),O5=Symbol.iterator;function Gj(e){return e===null||typeof e!="object"?null:(e=O5&&e[O5]||e["@@iterator"],typeof e=="function"?e:null)}var S9={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T9=Object.assign,C9={};function Xd(e,t,n){this.props=e,this.context=t,this.refs=C9,this.updater=n||S9}Xd.prototype.isReactComponent={};Xd.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Xd.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function E9(){}E9.prototype=Xd.prototype;function cw(e,t,n){this.props=e,this.context=t,this.refs=C9,this.updater=n||S9}var uw=cw.prototype=new E9;uw.constructor=cw;T9(uw,Xd.prototype);uw.isPureReactComponent=!0;var j5=Array.isArray;function g4(){}var Pn={H:null,A:null,T:null,S:null},A9=Object.prototype.hasOwnProperty;function dw(e,t,n){var r=n.ref;return{$$typeof:lw,type:e,key:t,ref:r!==void 0?r:null,props:n}}function Wj(e,t){return dw(e.type,t,e.props)}function hw(e){return typeof e=="object"&&e!==null&&e.$$typeof===lw}function Kj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var L5=/\/+/g;function qy(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Kj(""+e.key):t.toString(36)}function Yj(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(g4,g4):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Lu(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case lw:case Lj:a=!0;break;case _9:return a=e._init,Lu(a(e._payload),t,n,r,i)}}if(a)return i=i(e),a=r===""?"."+qy(e,0):r,j5(i)?(n="",a!=null&&(n=a.replace(L5,"$&/")+"/"),Lu(i,t,n,"",function(c){return c})):i!=null&&(hw(i)&&(i=Wj(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(L5,"$&/")+"/")+a)),t.push(i)),1;a=0;var o=r===""?".":r+":";if(j5(e))for(var l=0;l<e.length;l++)r=e[l],s=o+qy(r,l),a+=Lu(r,t,n,s,i);else if(l=Gj(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,s=o+qy(r,l++),a+=Lu(r,t,n,s,i);else if(s==="object"){if(typeof e.then=="function")return Lu(Yj(e),t,n,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function im(e,t,n){if(e==null)return e;var r=[],i=0;return Lu(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Xj(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var B5=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Qj={map:im,forEach:function(e,t,n){im(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return im(e,function(){t++}),t},toArray:function(e){return im(e,function(t){return t})||[]},only:function(e){if(!hw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};jt.Activity=Vj;jt.Children=Qj;jt.Component=Xd;jt.Fragment=Bj;jt.Profiler=Pj;jt.PureComponent=cw;jt.StrictMode=zj;jt.Suspense=qj;jt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pn;jt.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Pn.H.useMemoCache(e)}};jt.cache=function(e){return function(){return e.apply(null,arguments)}};jt.cacheSignal=function(){return null};jt.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=T9({},e.props),i=e.key;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)!A9.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(r[s]=t[s]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var a=Array(s),o=0;o<s;o++)a[o]=arguments[o+2];r.children=a}return dw(e.type,i,r)};jt.createContext=function(e){return e={$$typeof:Uj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:$j,_context:e},e};jt.createElement=function(e,t,n){var r,i={},s=null;if(t!=null)for(r in t.key!==void 0&&(s=""+t.key),t)A9.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];i.children=o}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return dw(e,s,i)};jt.createRef=function(){return{current:null}};jt.forwardRef=function(e){return{$$typeof:Hj,render:e}};jt.isValidElement=hw;jt.lazy=function(e){return{$$typeof:_9,_payload:{_status:-1,_result:e},_init:Xj}};jt.memo=function(e,t){return{$$typeof:Fj,type:e,compare:t===void 0?null:t}};jt.startTransition=function(e){var t=Pn.T,n={};Pn.T=n;try{var r=e(),i=Pn.S;i!==null&&i(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(g4,B5)}catch(s){B5(s)}finally{t!==null&&n.types!==null&&(t.types=n.types),Pn.T=t}};jt.unstable_useCacheRefresh=function(){return Pn.H.useCacheRefresh()};jt.use=function(e){return Pn.H.use(e)};jt.useActionState=function(e,t,n){return Pn.H.useActionState(e,t,n)};jt.useCallback=function(e,t){return Pn.H.useCallback(e,t)};jt.useContext=function(e){return Pn.H.useContext(e)};jt.useDebugValue=function(){};jt.useDeferredValue=function(e,t){return Pn.H.useDeferredValue(e,t)};jt.useEffect=function(e,t){return Pn.H.useEffect(e,t)};jt.useEffectEvent=function(e){return Pn.H.useEffectEvent(e)};jt.useId=function(){return Pn.H.useId()};jt.useImperativeHandle=function(e,t,n){return Pn.H.useImperativeHandle(e,t,n)};jt.useInsertionEffect=function(e,t){return Pn.H.useInsertionEffect(e,t)};jt.useLayoutEffect=function(e,t){return Pn.H.useLayoutEffect(e,t)};jt.useMemo=function(e,t){return Pn.H.useMemo(e,t)};jt.useOptimistic=function(e,t){return Pn.H.useOptimistic(e,t)};jt.useReducer=function(e,t,n){return Pn.H.useReducer(e,t,n)};jt.useRef=function(e){return Pn.H.useRef(e)};jt.useState=function(e){return Pn.H.useState(e)};jt.useSyncExternalStore=function(e,t,n){return Pn.H.useSyncExternalStore(e,t,n)};jt.useTransition=function(){return Pn.H.useTransition()};jt.version="19.2.4";k9.exports=jt;var v=k9.exports;const Jj=p1(v);var M9={exports:{}},y1={},N9={exports:{}},I9={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(e){function t(q,W){var $=q.length;q.push(W);e:for(;0<$;){var Z=$-1>>>1,M=q[Z];if(0<i(M,W))q[Z]=W,q[$]=M,$=Z;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var W=q[0],$=q.pop();if($!==W){q[0]=$;e:for(var Z=0,M=q.length,X=M>>>1;Z<X;){var H=2*(Z+1)-1,O=q[H],se=H+1,ke=q[se];if(0>i(O,$))se<M&&0>i(ke,O)?(q[Z]=ke,q[se]=$,Z=se):(q[Z]=O,q[H]=$,Z=H);else if(se<M&&0>i(ke,$))q[Z]=ke,q[se]=$,Z=se;else break e}}return W}function i(q,W){var $=q.sortIndex-W.sortIndex;return $!==0?$:q.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],c=[],u=1,d=null,f=3,m=!1,p=!1,b=!1,x=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function C(q){for(var W=n(c);W!==null;){if(W.callback===null)r(c);else if(W.startTime<=q)r(c),W.sortIndex=W.expirationTime,t(l,W);else break;W=n(c)}}function E(q){if(b=!1,C(q),!p)if(n(l)!==null)p=!0,S||(S=!0,N());else{var W=n(c);W!==null&&J(E,W.startTime-q)}}var S=!1,T=-1,j=5,z=-1;function R(){return x?!0:!(e.unstable_now()-z<j)}function D(){if(x=!1,S){var q=e.unstable_now();z=q;var W=!0;try{e:{p=!1,b&&(b=!1,y(T),T=-1),m=!0;var $=f;try{t:{for(C(q),d=n(l);d!==null&&!(d.expirationTime>q&&R());){var Z=d.callback;if(typeof Z=="function"){d.callback=null,f=d.priorityLevel;var M=Z(d.expirationTime<=q);if(q=e.unstable_now(),typeof M=="function"){d.callback=M,C(q),W=!0;break t}d===n(l)&&r(l),C(q)}else r(l);d=n(l)}if(d!==null)W=!0;else{var X=n(c);X!==null&&J(E,X.startTime-q),W=!1}}break e}finally{d=null,f=$,m=!1}W=void 0}}finally{W?N():S=!1}}}var N;if(typeof w=="function")N=function(){w(D)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,P=B.port2;B.port1.onmessage=D,N=function(){P.postMessage(null)}}else N=function(){g(D,0)};function J(q,W){T=g(function(){q(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(q){switch(f){case 1:case 2:case 3:var W=3;break;default:W=f}var $=f;f=W;try{return q()}finally{f=$}},e.unstable_requestPaint=function(){x=!0},e.unstable_runWithPriority=function(q,W){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var $=f;f=q;try{return W()}finally{f=$}},e.unstable_scheduleCallback=function(q,W,$){var Z=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?Z+$:Z):$=Z,q){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=$+M,q={id:u++,callback:W,priorityLevel:q,startTime:$,expirationTime:M,sortIndex:-1},$>Z?(q.sortIndex=$,t(c,q),n(l)===null&&q===n(c)&&(b?(y(T),T=-1):b=!0,J(E,$-Z))):(q.sortIndex=M,t(l,q),p||m||(p=!0,S||(S=!0,N()))),q},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(q){var W=f;return function(){var $=f;f=W;try{return q.apply(this,arguments)}finally{f=$}}}})(I9);N9.exports=I9;var Zj=N9.exports,D9={exports:{}},Mi={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var eL=v;function R9(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Jo(){}var Ti={d:{f:Jo,r:function(){throw Error(R9(522))},D:Jo,C:Jo,L:Jo,m:Jo,X:Jo,S:Jo,M:Jo},p:0,findDOMNode:null},tL=Symbol.for("react.portal");function nL(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:tL,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var lf=eL.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b1(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Mi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ti;Mi.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(R9(299));return nL(e,t,null,n)};Mi.flushSync=function(e){var t=lf.T,n=Ti.p;try{if(lf.T=null,Ti.p=2,e)return e()}finally{lf.T=t,Ti.p=n,Ti.d.f()}};Mi.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Ti.d.C(e,t))};Mi.prefetchDNS=function(e){typeof e=="string"&&Ti.d.D(e)};Mi.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=b1(n,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,s=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Ti.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:s}):n==="script"&&Ti.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:s,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Mi.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=b1(t.as,t.crossOrigin);Ti.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Ti.d.M(e)};Mi.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=b1(n,t.crossOrigin);Ti.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Mi.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=b1(t.as,t.crossOrigin);Ti.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Ti.d.m(e)};Mi.requestFormReset=function(e){Ti.d.r(e)};Mi.unstable_batchedUpdates=function(e,t){return e(t)};Mi.useFormState=function(e,t,n){return lf.H.useFormState(e,t,n)};Mi.useFormStatus=function(){return lf.H.useHostTransitionStatus()};Mi.version="19.2.4";function O9(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(O9)}catch(e){console.error(e)}}O9(),D9.exports=Mi;var fw=D9.exports;/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Or=Zj,j9=v,rL=fw;function fe(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function L9(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function w0(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function B9(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function z9(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function z5(e){if(w0(e)!==e)throw Error(fe(188))}function iL(e){var t=e.alternate;if(!t){if(t=w0(e),t===null)throw Error(fe(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return z5(i),e;if(s===r)return z5(i),t;s=s.sibling}throw Error(fe(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a)throw Error(fe(189))}}if(n.alternate!==r)throw Error(fe(190))}if(n.tag!==3)throw Error(fe(188));return n.stateNode.current===n?e:t}function P9(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=P9(e),t!==null)return t;e=e.sibling}return null}var Un=Object.assign,sL=Symbol.for("react.element"),sm=Symbol.for("react.transitional.element"),Gh=Symbol.for("react.portal"),qu=Symbol.for("react.fragment"),$9=Symbol.for("react.strict_mode"),y4=Symbol.for("react.profiler"),U9=Symbol.for("react.consumer"),bo=Symbol.for("react.context"),mw=Symbol.for("react.forward_ref"),b4=Symbol.for("react.suspense"),v4=Symbol.for("react.suspense_list"),pw=Symbol.for("react.memo"),sl=Symbol.for("react.lazy"),x4=Symbol.for("react.activity"),aL=Symbol.for("react.memo_cache_sentinel"),P5=Symbol.iterator;function _h(e){return e===null||typeof e!="object"?null:(e=P5&&e[P5]||e["@@iterator"],typeof e=="function"?e:null)}var oL=Symbol.for("react.client.reference");function w4(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oL?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case qu:return"Fragment";case y4:return"Profiler";case $9:return"StrictMode";case b4:return"Suspense";case v4:return"SuspenseList";case x4:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Gh:return"Portal";case bo:return e.displayName||"Context";case U9:return(e._context.displayName||"Context")+".Consumer";case mw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pw:return t=e.displayName||null,t!==null?t:w4(e.type)||"Memo";case sl:t=e._payload,e=e._init;try{return w4(e(t))}catch{}}return null}var Wh=Array.isArray,_t=j9.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,dn=rL.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Bc={pending:!1,data:null,method:null,action:null},k4=[],Fu=-1;function Ha(e){return{current:e}}function Fr(e){0>Fu||(e.current=k4[Fu],k4[Fu]=null,Fu--)}function On(e,t){Fu++,k4[Fu]=e.current,e.current=t}var za=Ha(null),Bf=Ha(null),Cl=Ha(null),Gp=Ha(null);function Wp(e,t){switch(On(Cl,t),On(Bf,e),On(za,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?V_(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=V_(t),e=oA(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fr(za),On(za,e)}function _d(){Fr(za),Fr(Bf),Fr(Cl)}function _4(e){e.memoizedState!==null&&On(Gp,e);var t=za.current,n=oA(t,e.type);t!==n&&(On(Bf,e),On(za,n))}function Kp(e){Bf.current===e&&(Fr(za),Fr(Bf)),Gp.current===e&&(Fr(Gp),Kf._currentValue=Bc)}var Fy,$5;function bc(e){if(Fy===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Fy=t&&t[1]||"",$5=-1<n.stack.indexOf(`
    at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Fy+e+$5}var Vy=!1;function Gy(e,t){if(!e||Vy)return"";Vy=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(m){var f=m}Reflect.construct(e,[],d)}else{try{d.call()}catch(m){f=m}e.call(d.prototype)}}else{try{throw Error()}catch(m){f=m}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(m){if(m&&f&&typeof m.stack=="string")return[m.stack,f.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=r.DetermineComponentFrameRoot(),a=s[0],o=s[1];if(a&&o){var l=a.split(`
`),c=o.split(`
`);for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===c.length)for(r=l.length-1,i=c.length-1;1<=r&&0<=i&&l[r]!==c[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==c[i]){if(r!==1||i!==1)do if(r--,i--,0>i||l[r]!==c[i]){var u=`
`+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Vy=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?bc(n):""}function lL(e,t){switch(e.tag){case 26:case 27:case 5:return bc(e.type);case 16:return bc("Lazy");case 13:return e.child!==t&&t!==null?bc("Suspense Fallback"):bc("Suspense");case 19:return bc("SuspenseList");case 0:case 15:return Gy(e.type,!1);case 11:return Gy(e.type.render,!1);case 1:return Gy(e.type,!0);case 31:return bc("Activity");default:return""}}function U5(e){try{var t="",n=null;do t+=lL(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
Error generating stack: `+r.message+`
`+r.stack}}var S4=Object.prototype.hasOwnProperty,gw=Or.unstable_scheduleCallback,Wy=Or.unstable_cancelCallback,cL=Or.unstable_shouldYield,uL=Or.unstable_requestPaint,os=Or.unstable_now,dL=Or.unstable_getCurrentPriorityLevel,H9=Or.unstable_ImmediatePriority,q9=Or.unstable_UserBlockingPriority,Yp=Or.unstable_NormalPriority,hL=Or.unstable_LowPriority,F9=Or.unstable_IdlePriority,fL=Or.log,mL=Or.unstable_setDisableYieldValue,k0=null,ls=null;function pl(e){if(typeof fL=="function"&&mL(e),ls&&typeof ls.setStrictMode=="function")try{ls.setStrictMode(k0,e)}catch{}}var cs=Math.clz32?Math.clz32:yL,pL=Math.log,gL=Math.LN2;function yL(e){return e>>>=0,e===0?32:31-(pL(e)/gL|0)|0}var am=256,om=262144,lm=4194304;function vc(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function v1(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var o=r&134217727;return o!==0?(r=o&~s,r!==0?i=vc(r):(a&=o,a!==0?i=vc(a):n||(n=o&~e,n!==0&&(i=vc(n))))):(o=r&~s,o!==0?i=vc(o):a!==0?i=vc(a):n||(n=r&~e,n!==0&&(i=vc(n)))),i===0?0:t!==0&&t!==i&&!(t&s)&&(s=i&-i,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:i}function _0(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function bL(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 V9(){var e=lm;return lm<<=1,!(lm&62914560)&&(lm=4194304),e}function Ky(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function S0(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vL(e,t,n,r,i,s){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=a&~n;0<n;){var u=31-cs(n),d=1<<u;o[u]=0,l[u]=-1;var f=c[u];if(f!==null)for(c[u]=null,u=0;u<f.length;u++){var m=f[u];m!==null&&(m.lane&=-536870913)}n&=~d}r!==0&&G9(e,r,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(a&~t))}function G9(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-cs(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function W9(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-cs(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function K9(e,t){var n=t&-t;return n=n&42?1:yw(n),n&(e.suspendedLanes|t)?0:n}function yw(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bw(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Y9(){var e=dn.p;return e!==0?e:(e=window.event,e===void 0?32:bA(e.type))}function H5(e,t){var n=dn.p;try{return dn.p=e,t()}finally{dn.p=n}}var Jl=Math.random().toString(36).slice(2),Qr="__reactFiber$"+Jl,Fi="__reactProps$"+Jl,Qd="__reactContainer$"+Jl,T4="__reactEvents$"+Jl,xL="__reactListeners$"+Jl,wL="__reactHandles$"+Jl,q5="__reactResources$"+Jl,T0="__reactMarker$"+Jl;function vw(e){delete e[Qr],delete e[Fi],delete e[T4],delete e[xL],delete e[wL]}function Vu(e){var t=e[Qr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qd]||n[Qr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=X_(e);e!==null;){if(n=e[Qr])return n;e=X_(e)}return t}e=n,n=e.parentNode}return null}function Jd(e){if(e=e[Qr]||e[Qd]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Kh(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(fe(33))}function ld(e){var t=e[q5];return t||(t=e[q5]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ur(e){e[T0]=!0}var X9=new Set,Q9={};function iu(e,t){Sd(e,t),Sd(e+"Capture",t)}function Sd(e,t){for(Q9[e]=t,e=0;e<t.length;e++)X9.add(t[e])}var kL=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]*$"),F5={},V5={};function _L(e){return S4.call(V5,e)?!0:S4.call(F5,e)?!1:kL.test(e)?V5[e]=!0:(F5[e]=!0,!1)}function hp(e,t,n){if(_L(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function cm(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function to(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function Es(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function J9(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function SL(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function C4(e){if(!e._valueTracker){var t=J9(e)?"checked":"value";e._valueTracker=SL(e,t,""+e[t])}}function Z9(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=J9(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var TL=/[\n"\\]/g;function Rs(e){return e.replace(TL,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function E4(e,t,n,r,i,s,a,o){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Es(t)):e.value!==""+Es(t)&&(e.value=""+Es(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?A4(e,a,Es(t)):n!=null?A4(e,a,Es(n)):r!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Es(o):e.removeAttribute("name")}function eC(e,t,n,r,i,s,a,o){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){C4(e);return}n=n!=null?""+Es(n):"",t=t!=null?""+Es(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=o?e.checked:!!r,e.defaultChecked=!!r,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),C4(e)}function A4(e,t,n){t==="number"&&Xp(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function cd(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Es(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function tC(e,t,n){if(t!=null&&(t=""+Es(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Es(n):""}function nC(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(fe(92));if(Wh(r)){if(1<r.length)throw Error(fe(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Es(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),C4(e)}function Td(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var CL=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 G5(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||CL.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function rC(e,t,n){if(t!=null&&typeof t!="object")throw Error(fe(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&G5(e,i,r)}else for(var s in t)t.hasOwnProperty(s)&&G5(e,s,t[s])}function xw(e){if(e.indexOf("-")===-1)return!1;switch(e){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 EL=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"]]),AL=/^[\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 fp(e){return AL.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function vo(){}var M4=null;function ww(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gu=null,ud=null;function W5(e){var t=Jd(e);if(t&&(e=t.stateNode)){var n=e[Fi]||null;e:switch(e=t.stateNode,t.type){case"input":if(E4(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Rs(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Fi]||null;if(!i)throw Error(fe(90));E4(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Z9(r)}break e;case"textarea":tC(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&cd(e,!!n.multiple,t,!1)}}}var Yy=!1;function iC(e,t,n){if(Yy)return e(t,n);Yy=!0;try{var r=e(t);return r}finally{if(Yy=!1,(Gu!==null||ud!==null)&&(I1(),Gu&&(t=Gu,e=ud,ud=Gu=null,W5(t),e)))for(t=0;t<e.length;t++)W5(e[t])}}function zf(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Fi]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(fe(231,t,typeof n));return n}var No=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),N4=!1;if(No)try{var Sh={};Object.defineProperty(Sh,"passive",{get:function(){N4=!0}}),window.addEventListener("test",Sh,Sh),window.removeEventListener("test",Sh,Sh)}catch{N4=!1}var gl=null,kw=null,mp=null;function sC(){if(mp)return mp;var e,t=kw,n=t.length,r,i="value"in gl?gl.value:gl.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[s-r];r++);return mp=i.slice(e,1<r?1-r:void 0)}function pp(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function um(){return!0}function K5(){return!1}function Gi(e){function t(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?um:K5,this.isPropagationStopped=K5,this}return Un(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=um)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=um)},persist:function(){},isPersistent:um}),t}var su={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},x1=Gi(su),C0=Un({},su,{view:0,detail:0}),ML=Gi(C0),Xy,Qy,Th,w1=Un({},C0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_w,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Th&&(Th&&e.type==="mousemove"?(Xy=e.screenX-Th.screenX,Qy=e.screenY-Th.screenY):Qy=Xy=0,Th=e),Xy)},movementY:function(e){return"movementY"in e?e.movementY:Qy}}),Y5=Gi(w1),NL=Un({},w1,{dataTransfer:0}),IL=Gi(NL),DL=Un({},C0,{relatedTarget:0}),Jy=Gi(DL),RL=Un({},su,{animationName:0,elapsedTime:0,pseudoElement:0}),OL=Gi(RL),jL=Un({},su,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),LL=Gi(jL),BL=Un({},su,{data:0}),X5=Gi(BL),zL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PL={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"},$L={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UL(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$L[e])?!!t[e]:!1}function _w(){return UL}var HL=Un({},C0,{key:function(e){if(e.key){var t=zL[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?PL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_w,charCode:function(e){return e.type==="keypress"?pp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qL=Gi(HL),FL=Un({},w1,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Q5=Gi(FL),VL=Un({},C0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_w}),GL=Gi(VL),WL=Un({},su,{propertyName:0,elapsedTime:0,pseudoElement:0}),KL=Gi(WL),YL=Un({},w1,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),XL=Gi(YL),QL=Un({},su,{newState:0,oldState:0}),JL=Gi(QL),ZL=[9,13,27,32],Sw=No&&"CompositionEvent"in window,cf=null;No&&"documentMode"in document&&(cf=document.documentMode);var eB=No&&"TextEvent"in window&&!cf,aC=No&&(!Sw||cf&&8<cf&&11>=cf),J5=" ",Z5=!1;function oC(e,t){switch(e){case"keyup":return ZL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wu=!1;function tB(e,t){switch(e){case"compositionend":return lC(t);case"keypress":return t.which!==32?null:(Z5=!0,J5);case"textInput":return e=t.data,e===J5&&Z5?null:e;default:return null}}function nB(e,t){if(Wu)return e==="compositionend"||!Sw&&oC(e,t)?(e=sC(),mp=kw=gl=null,Wu=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return aC&&t.locale!=="ko"?null:t.data;default:return null}}var rB={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 e_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rB[e.type]:t==="textarea"}function cC(e,t,n,r){Gu?ud?ud.push(r):ud=[r]:Gu=r,t=mg(t,"onChange"),0<t.length&&(n=new x1("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var uf=null,Pf=null;function iB(e){iA(e,0)}function k1(e){var t=Kh(e);if(Z9(t))return e}function t_(e,t){if(e==="change")return t}var uC=!1;if(No){var Zy;if(No){var eb="oninput"in document;if(!eb){var n_=document.createElement("div");n_.setAttribute("oninput","return;"),eb=typeof n_.oninput=="function"}Zy=eb}else Zy=!1;uC=Zy&&(!document.documentMode||9<document.documentMode)}function r_(){uf&&(uf.detachEvent("onpropertychange",dC),Pf=uf=null)}function dC(e){if(e.propertyName==="value"&&k1(Pf)){var t=[];cC(t,Pf,e,ww(e)),iC(iB,t)}}function sB(e,t,n){e==="focusin"?(r_(),uf=t,Pf=n,uf.attachEvent("onpropertychange",dC)):e==="focusout"&&r_()}function aB(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return k1(Pf)}function oB(e,t){if(e==="click")return k1(t)}function lB(e,t){if(e==="input"||e==="change")return k1(t)}function cB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fs=typeof Object.is=="function"?Object.is:cB;function $f(e,t){if(fs(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!S4.call(t,i)||!fs(e[i],t[i]))return!1}return!0}function i_(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function s_(e,t){var n=i_(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=i_(n)}}function hC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fC(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xp(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xp(e.document)}return t}function Tw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var uB=No&&"documentMode"in document&&11>=document.documentMode,Ku=null,I4=null,df=null,D4=!1;function a_(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;D4||Ku==null||Ku!==Xp(r)||(r=Ku,"selectionStart"in r&&Tw(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),df&&$f(df,r)||(df=r,r=mg(I4,"onSelect"),0<r.length&&(t=new x1("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ku)))}function uc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Yu={animationend:uc("Animation","AnimationEnd"),animationiteration:uc("Animation","AnimationIteration"),animationstart:uc("Animation","AnimationStart"),transitionrun:uc("Transition","TransitionRun"),transitionstart:uc("Transition","TransitionStart"),transitioncancel:uc("Transition","TransitionCancel"),transitionend:uc("Transition","TransitionEnd")},tb={},mC={};No&&(mC=document.createElement("div").style,"AnimationEvent"in window||(delete Yu.animationend.animation,delete Yu.animationiteration.animation,delete Yu.animationstart.animation),"TransitionEvent"in window||delete Yu.transitionend.transition);function au(e){if(tb[e])return tb[e];if(!Yu[e])return e;var t=Yu[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in mC)return tb[e]=t[n];return e}var pC=au("animationend"),gC=au("animationiteration"),yC=au("animationstart"),dB=au("transitionrun"),hB=au("transitionstart"),fB=au("transitioncancel"),bC=au("transitionend"),vC=new Map,R4="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(" ");R4.push("scrollEnd");function oa(e,t){vC.set(e,t),iu(t,[e])}var Qp=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Cs=[],Xu=0,Cw=0;function _1(){for(var e=Xu,t=Cw=Xu=0;t<e;){var n=Cs[t];Cs[t++]=null;var r=Cs[t];Cs[t++]=null;var i=Cs[t];Cs[t++]=null;var s=Cs[t];if(Cs[t++]=null,r!==null&&i!==null){var a=r.pending;a===null?i.next=i:(i.next=a.next,a.next=i),r.pending=i}s!==0&&xC(n,i,s)}}function S1(e,t,n,r){Cs[Xu++]=e,Cs[Xu++]=t,Cs[Xu++]=n,Cs[Xu++]=r,Cw|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ew(e,t,n,r){return S1(e,t,n,r),Jp(e)}function ou(e,t){return S1(e,null,null,t),Jp(e)}function xC(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,s=e.return;s!==null;)s.childLanes|=n,r=s.alternate,r!==null&&(r.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-cs(n),e=s.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),s):null}function Jp(e){if(50<xf)throw xf=0,ex=null,Error(fe(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qu={};function mB(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rs(e,t,n,r){return new mB(e,t,n,r)}function Aw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function So(e,t){var n=e.alternate;return n===null?(n=rs(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function wC(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function gp(e,t,n,r,i,s){var a=0;if(r=e,typeof e=="function")Aw(e)&&(a=1);else if(typeof e=="string")a=vz(e,n,za.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case x4:return e=rs(31,n,t,i),e.elementType=x4,e.lanes=s,e;case qu:return zc(n.children,i,s,t);case $9:a=8,i|=24;break;case y4:return e=rs(12,n,t,i|2),e.elementType=y4,e.lanes=s,e;case b4:return e=rs(13,n,t,i),e.elementType=b4,e.lanes=s,e;case v4:return e=rs(19,n,t,i),e.elementType=v4,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bo:a=10;break e;case U9:a=9;break e;case mw:a=11;break e;case pw:a=14;break e;case sl:a=16,r=null;break e}a=29,n=Error(fe(130,e===null?"null":typeof e,"")),r=null}return t=rs(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function zc(e,t,n,r){return e=rs(7,e,r,t),e.lanes=n,e}function nb(e,t,n){return e=rs(6,e,null,t),e.lanes=n,e}function kC(e){var t=rs(18,null,null,0);return t.stateNode=e,t}function rb(e,t,n){return t=rs(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var o_=new WeakMap;function Os(e,t){if(typeof e=="object"&&e!==null){var n=o_.get(e);return n!==void 0?n:(t={value:e,source:t,stack:U5(t)},o_.set(e,t),t)}return{value:e,source:t,stack:U5(t)}}var Ju=[],Zu=0,Zp=null,Uf=0,As=[],Ms=0,Bl=null,Ia=1,Da="";function uo(e,t){Ju[Zu++]=Uf,Ju[Zu++]=Zp,Zp=e,Uf=t}function _C(e,t,n){As[Ms++]=Ia,As[Ms++]=Da,As[Ms++]=Bl,Bl=e;var r=Ia;e=Da;var i=32-cs(r)-1;r&=~(1<<i),n+=1;var s=32-cs(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Ia=1<<32-cs(t)+i|n<<i|r,Da=s+e}else Ia=1<<s|n<<i|r,Da=e}function Mw(e){e.return!==null&&(uo(e,1),_C(e,1,0))}function Nw(e){for(;e===Zp;)Zp=Ju[--Zu],Ju[Zu]=null,Uf=Ju[--Zu],Ju[Zu]=null;for(;e===Bl;)Bl=As[--Ms],As[Ms]=null,Da=As[--Ms],As[Ms]=null,Ia=As[--Ms],As[Ms]=null}function SC(e,t){As[Ms++]=Ia,As[Ms++]=Da,As[Ms++]=Bl,Ia=t.id,Da=t.overflow,Bl=e}var Jr=null,zn=null,Yt=!1,El=null,js=!1,O4=Error(fe(519));function zl(e){var t=Error(fe(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hf(Os(t,e)),O4}function l_(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Qr]=e,t[Fi]=r,n){case"dialog":Ft("cancel",t),Ft("close",t);break;case"iframe":case"object":case"embed":Ft("load",t);break;case"video":case"audio":for(n=0;n<Gf.length;n++)Ft(Gf[n],t);break;case"source":Ft("error",t);break;case"img":case"image":case"link":Ft("error",t),Ft("load",t);break;case"details":Ft("toggle",t);break;case"input":Ft("invalid",t),eC(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ft("invalid",t);break;case"textarea":Ft("invalid",t),nC(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||aA(t.textContent,n)?(r.popover!=null&&(Ft("beforetoggle",t),Ft("toggle",t)),r.onScroll!=null&&Ft("scroll",t),r.onScrollEnd!=null&&Ft("scrollend",t),r.onClick!=null&&(t.onclick=vo),t=!0):t=!1,t||zl(e,!0)}function c_(e){for(Jr=e.return;Jr;)switch(Jr.tag){case 5:case 31:case 13:js=!1;return;case 27:case 3:js=!0;return;default:Jr=Jr.return}}function Nu(e){if(e!==Jr)return!1;if(!Yt)return c_(e),Yt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||sx(e.type,e.memoizedProps)),n=!n),n&&zn&&zl(e),c_(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(fe(317));zn=Y_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(fe(317));zn=Y_(e)}else t===27?(t=zn,Zl(e.type)?(e=cx,cx=null,zn=e):zn=t):zn=Jr?Us(e.stateNode.nextSibling):null;return!0}function Kc(){zn=Jr=null,Yt=!1}function ib(){var e=El;return e!==null&&(Li===null?Li=e:Li.push.apply(Li,e),El=null),e}function Hf(e){El===null?El=[e]:El.push(e)}var j4=Ha(null),lu=null,xo=null;function ul(e,t,n){On(j4,t._currentValue),t._currentValue=n}function To(e){e._currentValue=j4.current,Fr(j4)}function L4(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function B4(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var a=i.child;s=s.firstContext;e:for(;s!==null;){var o=s;s=i;for(var l=0;l<t.length;l++)if(o.context===t[l]){s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),L4(s.return,n,e),r||(a=null);break e}s=o.next}}else if(i.tag===18){if(a=i.return,a===null)throw Error(fe(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),L4(a,n,e),a=null}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}}function Zd(e,t,n,r){e=null;for(var i=t,s=!1;i!==null;){if(!s){if(i.flags&524288)s=!0;else if(i.flags&262144)break}if(i.tag===10){var a=i.alternate;if(a===null)throw Error(fe(387));if(a=a.memoizedProps,a!==null){var o=i.type;fs(i.pendingProps.value,a.value)||(e!==null?e.push(o):e=[o])}}else if(i===Gp.current){if(a=i.alternate,a===null)throw Error(fe(387));a.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Kf):e=[Kf])}i=i.return}e!==null&&B4(t,e,n,r),t.flags|=262144}function eg(e){for(e=e.firstContext;e!==null;){if(!fs(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yc(e){lu=e,xo=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zr(e){return TC(lu,e)}function dm(e,t){return lu===null&&Yc(e),TC(e,t)}function TC(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},xo===null){if(e===null)throw Error(fe(308));xo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xo=xo.next=t;return n}var pB=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},gB=Or.unstable_scheduleCallback,yB=Or.unstable_NormalPriority,br={$$typeof:bo,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Iw(){return{controller:new pB,data:new Map,refCount:0}}function E0(e){e.refCount--,e.refCount===0&&gB(yB,function(){e.controller.abort()})}var hf=null,z4=0,Cd=0,dd=null;function bB(e,t){if(hf===null){var n=hf=[];z4=0,Cd=n3(),dd={status:"pending",value:void 0,then:function(r){n.push(r)}}}return z4++,t.then(u_,u_),t}function u_(){if(--z4===0&&hf!==null){dd!==null&&(dd.status="fulfilled");var e=hf;hf=null,Cd=0,dd=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function vB(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),r}var d_=_t.S;_t.S=function(e,t){PE=os(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&bB(e,t),d_!==null&&d_(e,t)};var Pc=Ha(null);function Dw(){var e=Pc.current;return e!==null?e:Mn.pooledCache}function yp(e,t){t===null?On(Pc,Pc.current):On(Pc,t.pool)}function CC(){var e=Dw();return e===null?null:{parent:br._currentValue,pool:e}}var eh=Error(fe(460)),Rw=Error(fe(474)),T1=Error(fe(542)),tg={then:function(){}};function h_(e){return e=e.status,e==="fulfilled"||e==="rejected"}function EC(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(vo,vo),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,m_(e),e;default:if(typeof t.status=="string")t.then(vo,vo);else{if(e=Mn,e!==null&&100<e.shellSuspendCounter)throw Error(fe(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,m_(e),e}throw $c=t,eh}}function xc(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?($c=n,eh):n}}var $c=null;function f_(){if($c===null)throw Error(fe(459));var e=$c;return $c=null,e}function m_(e){if(e===eh||e===T1)throw Error(fe(483))}var hd=null,qf=0;function hm(e){var t=qf;return qf+=1,hd===null&&(hd=[]),EC(hd,e,t)}function Ch(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fm(e,t){throw t.$$typeof===sL?Error(fe(525)):(e=Object.prototype.toString.call(t),Error(fe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function AC(e){function t(g,y){if(e){var w=g.deletions;w===null?(g.deletions=[y],g.flags|=16):w.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g){for(var y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function i(g,y){return g=So(g,y),g.index=0,g.sibling=null,g}function s(g,y,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<y?(g.flags|=67108866,y):w):(g.flags|=67108866,y)):(g.flags|=1048576,y)}function a(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,y,w,C){return y===null||y.tag!==6?(y=nb(w,g.mode,C),y.return=g,y):(y=i(y,w),y.return=g,y)}function l(g,y,w,C){var E=w.type;return E===qu?u(g,y,w.props.children,C,w.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===sl&&xc(E)===y.type)?(y=i(y,w.props),Ch(y,w),y.return=g,y):(y=gp(w.type,w.key,w.props,null,g.mode,C),Ch(y,w),y.return=g,y)}function c(g,y,w,C){return y===null||y.tag!==4||y.stateNode.containerInfo!==w.containerInfo||y.stateNode.implementation!==w.implementation?(y=rb(w,g.mode,C),y.return=g,y):(y=i(y,w.children||[]),y.return=g,y)}function u(g,y,w,C,E){return y===null||y.tag!==7?(y=zc(w,g.mode,C,E),y.return=g,y):(y=i(y,w),y.return=g,y)}function d(g,y,w){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=nb(""+y,g.mode,w),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case sm:return w=gp(y.type,y.key,y.props,null,g.mode,w),Ch(w,y),w.return=g,w;case Gh:return y=rb(y,g.mode,w),y.return=g,y;case sl:return y=xc(y),d(g,y,w)}if(Wh(y)||_h(y))return y=zc(y,g.mode,w,null),y.return=g,y;if(typeof y.then=="function")return d(g,hm(y),w);if(y.$$typeof===bo)return d(g,dm(g,y),w);fm(g,y)}return null}function f(g,y,w,C){var E=y!==null?y.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return E!==null?null:o(g,y,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case sm:return w.key===E?l(g,y,w,C):null;case Gh:return w.key===E?c(g,y,w,C):null;case sl:return w=xc(w),f(g,y,w,C)}if(Wh(w)||_h(w))return E!==null?null:u(g,y,w,C,null);if(typeof w.then=="function")return f(g,y,hm(w),C);if(w.$$typeof===bo)return f(g,y,dm(g,w),C);fm(g,w)}return null}function m(g,y,w,C,E){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return g=g.get(w)||null,o(y,g,""+C,E);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case sm:return g=g.get(C.key===null?w:C.key)||null,l(y,g,C,E);case Gh:return g=g.get(C.key===null?w:C.key)||null,c(y,g,C,E);case sl:return C=xc(C),m(g,y,w,C,E)}if(Wh(C)||_h(C))return g=g.get(w)||null,u(y,g,C,E,null);if(typeof C.then=="function")return m(g,y,w,hm(C),E);if(C.$$typeof===bo)return m(g,y,w,dm(y,C),E);fm(y,C)}return null}function p(g,y,w,C){for(var E=null,S=null,T=y,j=y=0,z=null;T!==null&&j<w.length;j++){T.index>j?(z=T,T=null):z=T.sibling;var R=f(g,T,w[j],C);if(R===null){T===null&&(T=z);break}e&&T&&R.alternate===null&&t(g,T),y=s(R,y,j),S===null?E=R:S.sibling=R,S=R,T=z}if(j===w.length)return n(g,T),Yt&&uo(g,j),E;if(T===null){for(;j<w.length;j++)T=d(g,w[j],C),T!==null&&(y=s(T,y,j),S===null?E=T:S.sibling=T,S=T);return Yt&&uo(g,j),E}for(T=r(T);j<w.length;j++)z=m(T,g,j,w[j],C),z!==null&&(e&&z.alternate!==null&&T.delete(z.key===null?j:z.key),y=s(z,y,j),S===null?E=z:S.sibling=z,S=z);return e&&T.forEach(function(D){return t(g,D)}),Yt&&uo(g,j),E}function b(g,y,w,C){if(w==null)throw Error(fe(151));for(var E=null,S=null,T=y,j=y=0,z=null,R=w.next();T!==null&&!R.done;j++,R=w.next()){T.index>j?(z=T,T=null):z=T.sibling;var D=f(g,T,R.value,C);if(D===null){T===null&&(T=z);break}e&&T&&D.alternate===null&&t(g,T),y=s(D,y,j),S===null?E=D:S.sibling=D,S=D,T=z}if(R.done)return n(g,T),Yt&&uo(g,j),E;if(T===null){for(;!R.done;j++,R=w.next())R=d(g,R.value,C),R!==null&&(y=s(R,y,j),S===null?E=R:S.sibling=R,S=R);return Yt&&uo(g,j),E}for(T=r(T);!R.done;j++,R=w.next())R=m(T,g,j,R.value,C),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?j:R.key),y=s(R,y,j),S===null?E=R:S.sibling=R,S=R);return e&&T.forEach(function(N){return t(g,N)}),Yt&&uo(g,j),E}function x(g,y,w,C){if(typeof w=="object"&&w!==null&&w.type===qu&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case sm:e:{for(var E=w.key;y!==null;){if(y.key===E){if(E=w.type,E===qu){if(y.tag===7){n(g,y.sibling),C=i(y,w.props.children),C.return=g,g=C;break e}}else if(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===sl&&xc(E)===y.type){n(g,y.sibling),C=i(y,w.props),Ch(C,w),C.return=g,g=C;break e}n(g,y);break}else t(g,y);y=y.sibling}w.type===qu?(C=zc(w.props.children,g.mode,C,w.key),C.return=g,g=C):(C=gp(w.type,w.key,w.props,null,g.mode,C),Ch(C,w),C.return=g,g=C)}return a(g);case Gh:e:{for(E=w.key;y!==null;){if(y.key===E)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){n(g,y.sibling),C=i(y,w.children||[]),C.return=g,g=C;break e}else{n(g,y);break}else t(g,y);y=y.sibling}C=rb(w,g.mode,C),C.return=g,g=C}return a(g);case sl:return w=xc(w),x(g,y,w,C)}if(Wh(w))return p(g,y,w,C);if(_h(w)){if(E=_h(w),typeof E!="function")throw Error(fe(150));return w=E.call(w),b(g,y,w,C)}if(typeof w.then=="function")return x(g,y,hm(w),C);if(w.$$typeof===bo)return x(g,y,dm(g,w),C);fm(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,y!==null&&y.tag===6?(n(g,y.sibling),C=i(y,w),C.return=g,g=C):(n(g,y),C=nb(w,g.mode,C),C.return=g,g=C),a(g)):n(g,y)}return function(g,y,w,C){try{qf=0;var E=x(g,y,w,C);return hd=null,E}catch(T){if(T===eh||T===T1)throw T;var S=rs(29,T,null,g.mode);return S.lanes=C,S.return=g,S}finally{}}}var Xc=AC(!0),MC=AC(!1),al=!1;function Ow(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function P4(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Al(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ml(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,cn&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Jp(e),xC(e,null,n),t}return S1(e,r,t,n),Jp(e)}function ff(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,W9(e,n)}}function sb(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var $4=!1;function mf(){if($4){var e=dd;if(e!==null)throw e}}function pf(e,t,n,r){$4=!1;var i=e.updateQueue;al=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var u=e.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;a=0,u=c=l=null,o=s;do{var f=o.lane&-536870913,m=f!==o.lane;if(m?(Kt&f)===f:(r&f)===f){f!==0&&f===Cd&&($4=!0),u!==null&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,b=o;f=t;var x=n;switch(b.tag){case 1:if(p=b.payload,typeof p=="function"){d=p.call(x,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=b.payload,f=typeof p=="function"?p.call(x,d,f):p,f==null)break e;d=Un({},d,f);break e;case 2:al=!0}}f=o.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=m,l=d):u=u.next=m,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;m=o,o=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,s===null&&(i.shared.lanes=0),$l|=a,e.lanes=a,e.memoizedState=d}}function NC(e,t){if(typeof e!="function")throw Error(fe(191,e));e.call(t)}function IC(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)NC(n[e],t)}var Ed=Ha(null),ng=Ha(0);function p_(e,t){e=Oo,On(ng,e),On(Ed,t),Oo=e|t.baseLanes}function U4(){On(ng,Oo),On(Ed,Ed.current)}function jw(){Oo=ng.current,Fr(Ed),Fr(ng)}var ms=Ha(null),$s=null;function dl(e){var t=e.alternate;On(dr,dr.current&1),On(ms,e),$s===null&&(t===null||Ed.current!==null||t.memoizedState!==null)&&($s=e)}function H4(e){On(dr,dr.current),On(ms,e),$s===null&&($s=e)}function DC(e){e.tag===22?(On(dr,dr.current),On(ms,e),$s===null&&($s=e)):hl()}function hl(){On(dr,dr.current),On(ms,ms.current)}function ts(e){Fr(ms),$s===e&&($s=null),Fr(dr)}var dr=Ha(0);function rg(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ox(n)||lx(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Io=0,Lt=null,kn=null,pr=null,ig=!1,fd=!1,Qc=!1,sg=0,Ff=0,md=null,xB=0;function rr(){throw Error(fe(321))}function Lw(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!fs(e[n],t[n]))return!1;return!0}function Bw(e,t,n,r,i,s){return Io=s,Lt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_t.H=e===null||e.memoizedState===null?cE:Kw,Qc=!1,s=n(r,i),Qc=!1,fd&&(s=OC(t,n,r,i)),RC(e),s}function RC(e){_t.H=Vf;var t=kn!==null&&kn.next!==null;if(Io=0,pr=kn=Lt=null,ig=!1,Ff=0,md=null,t)throw Error(fe(300));e===null||vr||(e=e.dependencies,e!==null&&eg(e)&&(vr=!0))}function OC(e,t,n,r){Lt=e;var i=0;do{if(fd&&(md=null),Ff=0,fd=!1,25<=i)throw Error(fe(301));if(i+=1,pr=kn=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}_t.H=uE,s=t(n,r)}while(fd);return s}function wB(){var e=_t.H,t=e.useState()[0];return t=typeof t.then=="function"?A0(t):t,e=e.useState()[0],(kn!==null?kn.memoizedState:null)!==e&&(Lt.flags|=1024),t}function zw(){var e=sg!==0;return sg=0,e}function Pw(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $w(e){if(ig){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ig=!1}Io=0,pr=kn=Lt=null,fd=!1,Ff=sg=0,md=null}function bi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pr===null?Lt.memoizedState=pr=e:pr=pr.next=e,pr}function hr(){if(kn===null){var e=Lt.alternate;e=e!==null?e.memoizedState:null}else e=kn.next;var t=pr===null?Lt.memoizedState:pr.next;if(t!==null)pr=t,kn=e;else{if(e===null)throw Lt.alternate===null?Error(fe(467)):Error(fe(310));kn=e,e={memoizedState:kn.memoizedState,baseState:kn.baseState,baseQueue:kn.baseQueue,queue:kn.queue,next:null},pr===null?Lt.memoizedState=pr=e:pr=pr.next=e}return pr}function C1(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function A0(e){var t=Ff;return Ff+=1,md===null&&(md=[]),e=EC(md,e,t),t=Lt,(pr===null?t.memoizedState:pr.next)===null&&(t=t.alternate,_t.H=t===null||t.memoizedState===null?cE:Kw),e}function E1(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return A0(e);if(e.$$typeof===bo)return Zr(e)}throw Error(fe(438,String(e)))}function Uw(e){var t=null,n=Lt.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Lt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=C1(),Lt.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=aL;return t.index++,n}function Do(e,t){return typeof t=="function"?t(e):t}function bp(e){var t=hr();return Hw(t,kn,e)}function Hw(e,t,n){var r=e.queue;if(r===null)throw Error(fe(311));r.lastRenderedReducer=n;var i=e.baseQueue,s=r.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}t.baseQueue=i=s,r.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var o=a=null,l=null,c=t,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(Kt&d)===d:(Io&d)===d){var f=c.revertLane;if(f===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===Cd&&(u=!0);else if((Io&f)===f){c=c.next,f===Cd&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=d,a=s):l=l.next=d,Lt.lanes|=f,$l|=f;d=c.action,Qc&&n(s,d),s=c.hasEagerState?c.eagerState:n(s,d)}else f={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=f,a=s):l=l.next=f,Lt.lanes|=d,$l|=d;c=c.next}while(c!==null&&c!==t);if(l===null?a=s:l.next=o,!fs(s,e.memoizedState)&&(vr=!0,u&&(n=dd,n!==null)))throw n;e.memoizedState=s,e.baseState=a,e.baseQueue=l,r.lastRenderedState=s}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ab(e){var t=hr(),n=t.queue;if(n===null)throw Error(fe(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=e(s,a.action),a=a.next;while(a!==i);fs(s,t.memoizedState)||(vr=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function jC(e,t,n){var r=Lt,i=hr(),s=Yt;if(s){if(n===void 0)throw Error(fe(407));n=n()}else n=t();var a=!fs((kn||i).memoizedState,n);if(a&&(i.memoizedState=n,vr=!0),i=i.queue,qw(zC.bind(null,r,i,e),[e]),i.getSnapshot!==t||a||pr!==null&&pr.memoizedState.tag&1){if(r.flags|=2048,Ad(9,{destroy:void 0},BC.bind(null,r,i,n,t),null),Mn===null)throw Error(fe(349));s||Io&127||LC(r,t,n)}return n}function LC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Lt.updateQueue,t===null?(t=C1(),Lt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function BC(e,t,n,r){t.value=n,t.getSnapshot=r,PC(t)&&$C(e)}function zC(e,t,n){return n(function(){PC(t)&&$C(e)})}function PC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fs(e,n)}catch{return!0}}function $C(e){var t=ou(e,2);t!==null&&Hi(t,e,2)}function q4(e){var t=bi();if(typeof e=="function"){var n=e;if(e=n(),Qc){pl(!0);try{n()}finally{pl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:e},t}function UC(e,t,n,r){return e.baseState=n,Hw(e,kn,typeof r=="function"?r:Do)}function kB(e,t,n,r,i){if(M1(e))throw Error(fe(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){s.listeners.push(a)}};_t.T!==null?n(!0):s.isTransition=!1,r(s),n=t.pending,n===null?(s.next=t.pending=s,HC(t,s)):(s.next=n.next,t.pending=n.next=s)}}function HC(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var s=_t.T,a={};_t.T=a;try{var o=n(i,r),l=_t.S;l!==null&&l(a,o),g_(e,t,o)}catch(c){F4(e,t,c)}finally{s!==null&&a.types!==null&&(s.types=a.types),_t.T=s}}else try{s=n(i,r),g_(e,t,s)}catch(c){F4(e,t,c)}}function g_(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){y_(e,t,r)},function(r){return F4(e,t,r)}):y_(e,t,n)}function y_(e,t,n){t.status="fulfilled",t.value=n,qC(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,HC(e,n)))}function F4(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,qC(t),t=t.next;while(t!==r)}e.action=null}function qC(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function FC(e,t){return t}function b_(e,t){if(Yt){var n=Mn.formState;if(n!==null){e:{var r=Lt;if(Yt){if(zn){t:{for(var i=zn,s=js;i.nodeType!==8;){if(!s){i=null;break t}if(i=Us(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){zn=Us(i.nextSibling),r=i.data==="F!";break e}}zl(r)}r=!1}r&&(t=n[0])}}return n=bi(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:FC,lastRenderedState:t},n.queue=r,n=aE.bind(null,Lt,r),r.dispatch=n,r=q4(!1),s=Ww.bind(null,Lt,!1,r.queue),r=bi(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=kB.bind(null,Lt,i,s,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function v_(e){var t=hr();return VC(t,kn,e)}function VC(e,t,n){if(t=Hw(e,t,FC)[0],e=bp(Do)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=A0(t)}catch(a){throw a===eh?T1:a}else r=t;t=hr();var i=t.queue,s=i.dispatch;return n!==t.memoizedState&&(Lt.flags|=2048,Ad(9,{destroy:void 0},_B.bind(null,i,n),null)),[r,s,e]}function _B(e,t){e.action=t}function x_(e){var t=hr(),n=kn;if(n!==null)return VC(t,n,e);hr(),t=t.memoizedState,n=hr();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ad(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Lt.updateQueue,t===null&&(t=C1(),Lt.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function GC(){return hr().memoizedState}function vp(e,t,n,r){var i=bi();Lt.flags|=e,i.memoizedState=Ad(1|t,{destroy:void 0},n,r===void 0?null:r)}function A1(e,t,n,r){var i=hr();r=r===void 0?null:r;var s=i.memoizedState.inst;kn!==null&&r!==null&&Lw(r,kn.memoizedState.deps)?i.memoizedState=Ad(t,s,n,r):(Lt.flags|=e,i.memoizedState=Ad(1|t,s,n,r))}function w_(e,t){vp(8390656,8,e,t)}function qw(e,t){A1(2048,8,e,t)}function SB(e){Lt.flags|=4;var t=Lt.updateQueue;if(t===null)t=C1(),Lt.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function WC(e){var t=hr().memoizedState;return SB({ref:t,nextImpl:e}),function(){if(cn&2)throw Error(fe(440));return t.impl.apply(void 0,arguments)}}function KC(e,t){return A1(4,2,e,t)}function YC(e,t){return A1(4,4,e,t)}function XC(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function QC(e,t,n){n=n!=null?n.concat([e]):null,A1(4,4,XC.bind(null,t,e),n)}function Fw(){}function JC(e,t){var n=hr();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Lw(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ZC(e,t){var n=hr();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Lw(t,r[1]))return r[0];if(r=e(),Qc){pl(!0);try{e()}finally{pl(!1)}}return n.memoizedState=[r,t],r}function Vw(e,t,n){return n===void 0||Io&1073741824&&!(Kt&261930)?e.memoizedState=t:(e.memoizedState=n,e=UE(),Lt.lanes|=e,$l|=e,n)}function eE(e,t,n,r){return fs(n,t)?n:Ed.current!==null?(e=Vw(e,n,r),fs(e,t)||(vr=!0),e):!(Io&42)||Io&1073741824&&!(Kt&261930)?(vr=!0,e.memoizedState=n):(e=UE(),Lt.lanes|=e,$l|=e,t)}function tE(e,t,n,r,i){var s=dn.p;dn.p=s!==0&&8>s?s:8;var a=_t.T,o={};_t.T=o,Ww(e,!1,t,n);try{var l=i(),c=_t.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=vB(l,r);gf(e,t,u,us(e))}else gf(e,t,r,us(e))}catch(d){gf(e,t,{then:function(){},status:"rejected",reason:d},us())}finally{dn.p=s,a!==null&&o.types!==null&&(a.types=o.types),_t.T=a}}function TB(){}function V4(e,t,n,r){if(e.tag!==5)throw Error(fe(476));var i=nE(e).queue;tE(e,i,t,Bc,n===null?TB:function(){return rE(e),n(r)})}function nE(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Bc,baseState:Bc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:Bc},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rE(e){var t=nE(e);t.next===null&&(t=e.alternate.memoizedState),gf(e,t.next.queue,{},us())}function Gw(){return Zr(Kf)}function iE(){return hr().memoizedState}function sE(){return hr().memoizedState}function CB(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=us();e=Al(n);var r=Ml(t,e,n);r!==null&&(Hi(r,t,n),ff(r,t,n)),t={cache:Iw()},e.payload=t;return}t=t.return}}function EB(e,t,n){var r=us();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},M1(e)?oE(t,n):(n=Ew(e,t,n,r),n!==null&&(Hi(n,e,r),lE(n,t,r)))}function aE(e,t,n){var r=us();gf(e,t,n,r)}function gf(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(M1(e))oE(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,fs(o,a))return S1(e,t,i,0),Mn===null&&_1(),!1}catch{}finally{}if(n=Ew(e,t,i,r),n!==null)return Hi(n,e,r),lE(n,t,r),!0}return!1}function Ww(e,t,n,r){if(r={lane:2,revertLane:n3(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},M1(e)){if(t)throw Error(fe(479))}else t=Ew(e,n,r,2),t!==null&&Hi(t,e,2)}function M1(e){var t=e.alternate;return e===Lt||t!==null&&t===Lt}function oE(e,t){fd=ig=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lE(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,W9(e,n)}}var Vf={readContext:Zr,use:E1,useCallback:rr,useContext:rr,useEffect:rr,useImperativeHandle:rr,useLayoutEffect:rr,useInsertionEffect:rr,useMemo:rr,useReducer:rr,useRef:rr,useState:rr,useDebugValue:rr,useDeferredValue:rr,useTransition:rr,useSyncExternalStore:rr,useId:rr,useHostTransitionStatus:rr,useFormState:rr,useActionState:rr,useOptimistic:rr,useMemoCache:rr,useCacheRefresh:rr};Vf.useEffectEvent=rr;var cE={readContext:Zr,use:E1,useCallback:function(e,t){return bi().memoizedState=[e,t===void 0?null:t],e},useContext:Zr,useEffect:w_,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,vp(4194308,4,XC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vp(4194308,4,e,t)},useInsertionEffect:function(e,t){vp(4,2,e,t)},useMemo:function(e,t){var n=bi();t=t===void 0?null:t;var r=e();if(Qc){pl(!0);try{e()}finally{pl(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=bi();if(n!==void 0){var i=n(t);if(Qc){pl(!0);try{n(t)}finally{pl(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=EB.bind(null,Lt,e),[r.memoizedState,e]},useRef:function(e){var t=bi();return e={current:e},t.memoizedState=e},useState:function(e){e=q4(e);var t=e.queue,n=aE.bind(null,Lt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Fw,useDeferredValue:function(e,t){var n=bi();return Vw(n,e,t)},useTransition:function(){var e=q4(!1);return e=tE.bind(null,Lt,e.queue,!0,!1),bi().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Lt,i=bi();if(Yt){if(n===void 0)throw Error(fe(407));n=n()}else{if(n=t(),Mn===null)throw Error(fe(349));Kt&127||LC(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,w_(zC.bind(null,r,s,e),[e]),r.flags|=2048,Ad(9,{destroy:void 0},BC.bind(null,r,s,n,t),null),n},useId:function(){var e=bi(),t=Mn.identifierPrefix;if(Yt){var n=Da,r=Ia;n=(r&~(1<<32-cs(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=sg++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=xB++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Gw,useFormState:b_,useActionState:b_,useOptimistic:function(e){var t=bi();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ww.bind(null,Lt,!0,n),n.dispatch=t,[e,t]},useMemoCache:Uw,useCacheRefresh:function(){return bi().memoizedState=CB.bind(null,Lt)},useEffectEvent:function(e){var t=bi(),n={impl:e};return t.memoizedState=n,function(){if(cn&2)throw Error(fe(440));return n.impl.apply(void 0,arguments)}}},Kw={readContext:Zr,use:E1,useCallback:JC,useContext:Zr,useEffect:qw,useImperativeHandle:QC,useInsertionEffect:KC,useLayoutEffect:YC,useMemo:ZC,useReducer:bp,useRef:GC,useState:function(){return bp(Do)},useDebugValue:Fw,useDeferredValue:function(e,t){var n=hr();return eE(n,kn.memoizedState,e,t)},useTransition:function(){var e=bp(Do)[0],t=hr().memoizedState;return[typeof e=="boolean"?e:A0(e),t]},useSyncExternalStore:jC,useId:iE,useHostTransitionStatus:Gw,useFormState:v_,useActionState:v_,useOptimistic:function(e,t){var n=hr();return UC(n,kn,e,t)},useMemoCache:Uw,useCacheRefresh:sE};Kw.useEffectEvent=WC;var uE={readContext:Zr,use:E1,useCallback:JC,useContext:Zr,useEffect:qw,useImperativeHandle:QC,useInsertionEffect:KC,useLayoutEffect:YC,useMemo:ZC,useReducer:ab,useRef:GC,useState:function(){return ab(Do)},useDebugValue:Fw,useDeferredValue:function(e,t){var n=hr();return kn===null?Vw(n,e,t):eE(n,kn.memoizedState,e,t)},useTransition:function(){var e=ab(Do)[0],t=hr().memoizedState;return[typeof e=="boolean"?e:A0(e),t]},useSyncExternalStore:jC,useId:iE,useHostTransitionStatus:Gw,useFormState:x_,useActionState:x_,useOptimistic:function(e,t){var n=hr();return kn!==null?UC(n,kn,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Uw,useCacheRefresh:sE};uE.useEffectEvent=WC;function ob(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Un({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var G4={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=us(),i=Al(r);i.payload=t,n!=null&&(i.callback=n),t=Ml(e,i,r),t!==null&&(Hi(t,e,r),ff(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=us(),i=Al(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ml(e,i,r),t!==null&&(Hi(t,e,r),ff(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=us(),r=Al(n);r.tag=2,t!=null&&(r.callback=t),t=Ml(e,r,n),t!==null&&(Hi(t,e,n),ff(t,e,n))}};function k_(e,t,n,r,i,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!$f(n,r)||!$f(i,s):!0}function __(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&G4.enqueueReplaceState(t,t.state,null)}function Jc(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=Un({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function dE(e){Qp(e)}function hE(e){console.error(e)}function fE(e){Qp(e)}function ag(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function S_(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function W4(e,t,n){return n=Al(n),n.tag=3,n.payload={element:null},n.callback=function(){ag(e,t)},n}function mE(e){return e=Al(e),e.tag=3,e}function pE(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=r.value;e.payload=function(){return i(s)},e.callback=function(){S_(t,n,r)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){S_(t,n,r),typeof i!="function"&&(Nl===null?Nl=new Set([this]):Nl.add(this));var o=r.stack;this.componentDidCatch(r.value,{componentStack:o!==null?o:""})})}function AB(e,t,n,r,i){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Zd(t,n,i,!0),n=ms.current,n!==null){switch(n.tag){case 31:case 13:return $s===null?dg():n.alternate===null&&sr===0&&(sr=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===tg?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bb(e,r,i)),!1;case 22:return n.flags|=65536,r===tg?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bb(e,r,i)),!1}throw Error(fe(435,n.tag))}return bb(e,r,i),dg(),!1}if(Yt)return t=ms.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==O4&&(e=Error(fe(422),{cause:r}),Hf(Os(e,n)))):(r!==O4&&(t=Error(fe(423),{cause:r}),Hf(Os(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Os(r,n),i=W4(e.stateNode,r,i),sb(e,i),sr!==4&&(sr=2)),!1;var s=Error(fe(520),{cause:r});if(s=Os(s,n),vf===null?vf=[s]:vf.push(s),sr!==4&&(sr=2),t===null)return!0;r=Os(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=W4(n.stateNode,r,e),sb(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Nl===null||!Nl.has(s))))return n.flags|=65536,i&=-i,n.lanes|=i,i=mE(i),pE(i,e,n,r),sb(n,i),!1}n=n.return}while(n!==null);return!1}var Yw=Error(fe(461)),vr=!1;function Kr(e,t,n,r){t.child=e===null?MC(t,null,n,r):Xc(t,e.child,n,r)}function T_(e,t,n,r,i){n=n.render;var s=t.ref;if("ref"in r){var a={};for(var o in r)o!=="ref"&&(a[o]=r[o])}else a=r;return Yc(t),r=Bw(e,t,n,a,s,i),o=zw(),e!==null&&!vr?(Pw(e,t,i),Ro(e,t,i)):(Yt&&o&&Mw(t),t.flags|=1,Kr(e,t,r,i),t.child)}function C_(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Aw(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,gE(e,t,s,r,i)):(e=gp(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Xw(e,i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:$f,n(a,r)&&e.ref===t.ref)return Ro(e,t,i)}return t.flags|=1,e=So(s,r),e.ref=t.ref,e.return=t,t.child=e}function gE(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if($f(s,r)&&e.ref===t.ref)if(vr=!1,t.pendingProps=r=s,Xw(e,i))e.flags&131072&&(vr=!0);else return t.lanes=e.lanes,Ro(e,t,i)}return K4(e,t,n,r,i)}function yE(e,t,n,r){var i=r.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if(t.flags&128){if(s=s!==null?s.baseLanes|n:n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~s}else r=0,t.child=null;return E_(e,t,s,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&yp(t,s!==null?s.cachePool:null),s!==null?p_(t,s):U4(),DC(t);else return r=t.lanes=536870912,E_(e,t,s!==null?s.baseLanes|n:n,n,r)}else s!==null?(yp(t,s.cachePool),p_(t,s),hl(),t.memoizedState=null):(e!==null&&yp(t,null),U4(),hl());return Kr(e,t,i,n),t.child}function Yh(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function E_(e,t,n,r,i){var s=Dw();return s=s===null?null:{parent:br._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&yp(t,null),U4(),DC(t),e!==null&&Zd(e,t,r,!0),t.childLanes=i,null}function xp(e,t){return t=og({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function A_(e,t,n){return Xc(t,e.child,null,n),e=xp(t,t.pendingProps),e.flags|=2,ts(t),t.memoizedState=null,e}function MB(e,t,n){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Yt){if(r.mode==="hidden")return e=xp(t,r),t.lanes=536870912,Yh(null,e);if(H4(t),(e=zn)?(e=cA(e,js),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bl!==null?{id:Ia,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},n=kC(e),n.return=t,t.child=n,Jr=t,zn=null)):e=null,e===null)throw zl(t);return t.lanes=536870912,null}return xp(t,r)}var s=e.memoizedState;if(s!==null){var a=s.dehydrated;if(H4(t),i)if(t.flags&256)t.flags&=-257,t=A_(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(fe(558));else if(vr||Zd(e,t,n,!1),i=(n&e.childLanes)!==0,vr||i){if(r=Mn,r!==null&&(a=K9(r,n),a!==0&&a!==s.retryLane))throw s.retryLane=a,ou(e,a),Hi(r,e,a),Yw;dg(),t=A_(e,t,n)}else e=s.treeContext,zn=Us(a.nextSibling),Jr=t,Yt=!0,El=null,js=!1,e!==null&&SC(t,e),t=xp(t,r),t.flags|=4096;return t}return e=So(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function wp(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(fe(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function K4(e,t,n,r,i){return Yc(t),n=Bw(e,t,n,r,void 0,i),r=zw(),e!==null&&!vr?(Pw(e,t,i),Ro(e,t,i)):(Yt&&r&&Mw(t),t.flags|=1,Kr(e,t,n,i),t.child)}function M_(e,t,n,r,i,s){return Yc(t),t.updateQueue=null,n=OC(t,r,n,i),RC(e),r=zw(),e!==null&&!vr?(Pw(e,t,s),Ro(e,t,s)):(Yt&&r&&Mw(t),t.flags|=1,Kr(e,t,n,s),t.child)}function N_(e,t,n,r,i){if(Yc(t),t.stateNode===null){var s=Qu,a=n.contextType;typeof a=="object"&&a!==null&&(s=Zr(a)),s=new n(r,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=G4,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=r,s.state=t.memoizedState,s.refs={},Ow(t),a=n.contextType,s.context=typeof a=="object"&&a!==null?Zr(a):Qu,s.state=t.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(ob(t,n,a,r),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(a=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),a!==s.state&&G4.enqueueReplaceState(s,s.state,null),pf(t,r,s,i),mf(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){s=t.stateNode;var o=t.memoizedProps,l=Jc(n,o);s.props=l;var c=s.context,u=n.contextType;a=Qu,typeof u=="object"&&u!==null&&(a=Zr(u));var d=n.getDerivedStateFromProps;u=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o||c!==a)&&__(t,s,r,a),al=!1;var f=t.memoizedState;s.state=f,pf(t,r,s,i),mf(),c=t.memoizedState,o||f!==c||al?(typeof d=="function"&&(ob(t,n,d,r),c=t.memoizedState),(l=al||k_(t,n,l,r,f,c,a))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=a,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,P4(e,t),a=t.memoizedProps,u=Jc(n,a),s.props=u,d=t.pendingProps,f=s.context,c=n.contextType,l=Qu,typeof c=="object"&&c!==null&&(l=Zr(c)),o=n.getDerivedStateFromProps,(c=typeof o=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&__(t,s,r,l),al=!1,f=t.memoizedState,s.state=f,pf(t,r,s,i),mf();var m=t.memoizedState;a!==d||f!==m||al||e!==null&&e.dependencies!==null&&eg(e.dependencies)?(typeof o=="function"&&(ob(t,n,o,r),m=t.memoizedState),(u=al||k_(t,n,u,r,f,m,l)||e!==null&&e.dependencies!==null&&eg(e.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return s=r,wp(e,t),r=(t.flags&128)!==0,s||r?(s=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&r?(t.child=Xc(t,e.child,null,i),t.child=Xc(t,null,n,i)):Kr(e,t,n,i),t.memoizedState=s.state,e=t.child):e=Ro(e,t,i),e}function I_(e,t,n,r){return Kc(),t.flags|=256,Kr(e,t,n,r),t.child}var lb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cb(e){return{baseLanes:e,cachePool:CC()}}function ub(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ss),e}function bE(e,t,n){var r=t.pendingProps,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(dr.current&2)!==0),a&&(i=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(Yt){if(i?dl(t):hl(),(e=zn)?(e=cA(e,js),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bl!==null?{id:Ia,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},n=kC(e),n.return=t,t.child=n,Jr=t,zn=null)):e=null,e===null)throw zl(t);return lx(e)?t.lanes=32:t.lanes=536870912,null}var o=r.children;return r=r.fallback,i?(hl(),i=t.mode,o=og({mode:"hidden",children:o},i),r=zc(r,i,n,null),o.return=t,r.return=t,o.sibling=r,t.child=o,r=t.child,r.memoizedState=cb(n),r.childLanes=ub(e,a,n),t.memoizedState=lb,Yh(null,r)):(dl(t),Y4(t,o))}var l=e.memoizedState;if(l!==null&&(o=l.dehydrated,o!==null)){if(s)t.flags&256?(dl(t),t.flags&=-257,t=db(e,t,n)):t.memoizedState!==null?(hl(),t.child=e.child,t.flags|=128,t=null):(hl(),o=r.fallback,i=t.mode,r=og({mode:"visible",children:r.children},i),o=zc(o,i,n,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,Xc(t,e.child,null,n),r=t.child,r.memoizedState=cb(n),r.childLanes=ub(e,a,n),t.memoizedState=lb,t=Yh(null,r));else if(dl(t),lx(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var c=a.dgst;a=c,r=Error(fe(419)),r.stack="",r.digest=a,Hf({value:r,source:null,stack:null}),t=db(e,t,n)}else if(vr||Zd(e,t,n,!1),a=(n&e.childLanes)!==0,vr||a){if(a=Mn,a!==null&&(r=K9(a,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ou(e,r),Hi(a,e,r),Yw;ox(o)||dg(),t=db(e,t,n)}else ox(o)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,zn=Us(o.nextSibling),Jr=t,Yt=!0,El=null,js=!1,e!==null&&SC(t,e),t=Y4(t,r.children),t.flags|=4096);return t}return i?(hl(),o=r.fallback,i=t.mode,l=e.child,c=l.sibling,r=So(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,c!==null?o=So(c,o):(o=zc(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,Yh(null,r),r=t.child,o=e.child.memoizedState,o===null?o=cb(n):(i=o.cachePool,i!==null?(l=br._currentValue,i=i.parent!==l?{parent:l,pool:l}:i):i=CC(),o={baseLanes:o.baseLanes|n,cachePool:i}),r.memoizedState=o,r.childLanes=ub(e,a,n),t.memoizedState=lb,Yh(e.child,r)):(dl(t),n=e.child,e=n.sibling,n=So(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=n,t.memoizedState=null,n)}function Y4(e,t){return t=og({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function og(e,t){return e=rs(22,e,null,t),e.lanes=0,e}function db(e,t,n){return Xc(t,e.child,null,n),e=Y4(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function D_(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),L4(e.return,t,n)}function hb(e,t,n,r,i,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.treeForkCount=s)}function vE(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;r=r.children;var a=dr.current,o=(a&2)!==0;if(o?(a=a&1|2,t.flags|=128):a&=1,On(dr,a),Kr(e,t,r,n),r=Yt?Uf:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&D_(e,n,t);else if(e.tag===19)D_(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&rg(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),hb(t,!1,i,n,s,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&rg(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}hb(t,!0,n,null,s,r);break;case"together":hb(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ro(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$l|=t.lanes,!(n&t.childLanes))if(e!==null){if(Zd(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(fe(153));if(t.child!==null){for(e=t.child,n=So(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=So(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Xw(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&eg(e)))}function NB(e,t,n){switch(t.tag){case 3:Wp(t,t.stateNode.containerInfo),ul(t,br,e.memoizedState.cache),Kc();break;case 27:case 5:_4(t);break;case 4:Wp(t,t.stateNode.containerInfo);break;case 10:ul(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,H4(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(dl(t),t.flags|=128,null):n&t.child.childLanes?bE(e,t,n):(dl(t),e=Ro(e,t,n),e!==null?e.sibling:null);dl(t);break;case 19:var i=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Zd(e,t,n,!1),r=(n&t.childLanes)!==0),i){if(r)return vE(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),On(dr,dr.current),r)break;return null;case 22:return t.lanes=0,yE(e,t,n,t.pendingProps);case 24:ul(t,br,e.memoizedState.cache)}return Ro(e,t,n)}function xE(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)vr=!0;else{if(!Xw(e,n)&&!(t.flags&128))return vr=!1,NB(e,t,n);vr=!!(e.flags&131072)}else vr=!1,Yt&&t.flags&1048576&&_C(t,Uf,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=xc(t.elementType),t.type=e,typeof e=="function")Aw(e)?(r=Jc(e,r),t.tag=1,t=N_(null,t,e,r,n)):(t.tag=0,t=K4(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===mw){t.tag=11,t=T_(null,t,e,r,n);break e}else if(i===pw){t.tag=14,t=C_(null,t,e,r,n);break e}}throw t=w4(e)||e,Error(fe(306,t,""))}}return t;case 0:return K4(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Jc(r,t.pendingProps),N_(e,t,r,i,n);case 3:e:{if(Wp(t,t.stateNode.containerInfo),e===null)throw Error(fe(387));r=t.pendingProps;var s=t.memoizedState;i=s.element,P4(e,t),pf(t,r,null,n);var a=t.memoizedState;if(r=a.cache,ul(t,br,r),r!==s.cache&&B4(t,[br],n,!0),mf(),r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=I_(e,t,r,n);break e}else if(r!==i){i=Os(Error(fe(424)),t),Hf(i),t=I_(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(zn=Us(e.firstChild),Jr=t,Yt=!0,El=null,js=!0,n=MC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Kc(),r===i){t=Ro(e,t,n);break e}Kr(e,t,r,n)}t=t.child}return t;case 26:return wp(e,t),e===null?(n=J_(t.type,null,t.pendingProps,null))?t.memoizedState=n:Yt||(n=t.type,e=t.pendingProps,r=pg(Cl.current).createElement(n),r[Qr]=t,r[Fi]=e,ti(r,n,e),Ur(r),t.stateNode=r):t.memoizedState=J_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _4(t),e===null&&Yt&&(r=t.stateNode=uA(t.type,t.pendingProps,Cl.current),Jr=t,js=!0,i=zn,Zl(t.type)?(cx=i,zn=Us(r.firstChild)):zn=i),Kr(e,t,t.pendingProps.children,n),wp(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Yt&&((i=r=zn)&&(r=az(r,t.type,t.pendingProps,js),r!==null?(t.stateNode=r,Jr=t,zn=Us(r.firstChild),js=!1,i=!0):i=!1),i||zl(t)),_4(t),i=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,r=s.children,sx(i,s)?r=null:a!==null&&sx(i,a)&&(t.flags|=32),t.memoizedState!==null&&(i=Bw(e,t,wB,null,null,n),Kf._currentValue=i),wp(e,t),Kr(e,t,r,n),t.child;case 6:return e===null&&Yt&&((e=n=zn)&&(n=oz(n,t.pendingProps,js),n!==null?(t.stateNode=n,Jr=t,zn=null,e=!0):e=!1),e||zl(t)),null;case 13:return bE(e,t,n);case 4:return Wp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Xc(t,null,r,n):Kr(e,t,r,n),t.child;case 11:return T_(e,t,t.type,t.pendingProps,n);case 7:return Kr(e,t,t.pendingProps,n),t.child;case 8:return Kr(e,t,t.pendingProps.children,n),t.child;case 12:return Kr(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ul(t,t.type,r.value),Kr(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Yc(t),i=Zr(i),r=r(i),t.flags|=1,Kr(e,t,r,n),t.child;case 14:return C_(e,t,t.type,t.pendingProps,n);case 15:return gE(e,t,t.type,t.pendingProps,n);case 19:return vE(e,t,n);case 31:return MB(e,t,n);case 22:return yE(e,t,n,t.pendingProps);case 24:return Yc(t),r=Zr(br),e===null?(i=Dw(),i===null&&(i=Mn,s=Iw(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=n),i=s),t.memoizedState={parent:r,cache:i},Ow(t),ul(t,br,i)):(e.lanes&n&&(P4(e,t),pf(t,null,null,n),mf()),i=e.memoizedState,s=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ul(t,br,r)):(r=s.cache,ul(t,br,r),r!==i.cache&&B4(t,[br],n,!0))),Kr(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(fe(156,t.tag))}function no(e){e.flags|=4}function fb(e,t,n,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(FE())e.flags|=8192;else throw $c=tg,Rw}else e.flags&=-16777217}function R_(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!fA(t))if(FE())e.flags|=8192;else throw $c=tg,Rw}function mm(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?V9():536870912,e.lanes|=t,Md|=t)}function Eh(e,t){if(!Yt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function IB(e,t,n){var r=t.pendingProps;switch(Nw(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bn(t),null;case 1:return Bn(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),To(br),_d(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Nu(t)?no(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ib())),Bn(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(no(t),s!==null?(Bn(t),R_(t,s)):(Bn(t),fb(t,i,null,r,n))):s?s!==e.memoizedState?(no(t),Bn(t),R_(t,s)):(Bn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&no(t),Bn(t),fb(t,i,e,r,n)),null;case 27:if(Kp(t),n=Cl.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&no(t);else{if(!r){if(t.stateNode===null)throw Error(fe(166));return Bn(t),null}e=za.current,Nu(t)?l_(t):(e=uA(i,r,n),t.stateNode=e,no(t))}return Bn(t),null;case 5:if(Kp(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&no(t);else{if(!r){if(t.stateNode===null)throw Error(fe(166));return Bn(t),null}if(s=za.current,Nu(t))l_(t);else{var a=pg(Cl.current);switch(s){case 1:s=a.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=a.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=a.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=a.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":s=a.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof r.is=="string"?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s=typeof r.is=="string"?a.createElement(i,{is:r.is}):a.createElement(i)}}s[Qr]=t,s[Fi]=r;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)s.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(ti(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&no(t)}}return Bn(t),fb(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&no(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(fe(166));if(e=Cl.current,Nu(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Jr,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Qr]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||aA(e.nodeValue,n)),e||zl(t,!0)}else e=pg(e).createTextNode(r),e[Qr]=t,t.stateNode=e}return Bn(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Nu(t),n!==null){if(e===null){if(!r)throw Error(fe(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(fe(557));e[Qr]=t}else Kc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bn(t),e=!1}else n=ib(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ts(t),t):(ts(t),null);if(t.flags&128)throw Error(fe(558))}return Bn(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Nu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(fe(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(fe(317));i[Qr]=t}else Kc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bn(t),i=!1}else i=ib(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ts(t),t):(ts(t),null)}return ts(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),mm(t,t.updateQueue),Bn(t),null);case 4:return _d(),e===null&&r3(t.stateNode.containerInfo),Bn(t),null;case 10:return To(t.type),Bn(t),null;case 19:if(Fr(dr),r=t.memoizedState,r===null)return Bn(t),null;if(i=(t.flags&128)!==0,s=r.rendering,s===null)if(i)Eh(r,!1);else{if(sr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=rg(e),s!==null){for(t.flags|=128,Eh(r,!1),e=s.updateQueue,t.updateQueue=e,mm(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)wC(n,e),n=n.sibling;return On(dr,dr.current&1|2),Yt&&uo(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&os()>cg&&(t.flags|=128,i=!0,Eh(r,!1),t.lanes=4194304)}else{if(!i)if(e=rg(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,mm(t,e),Eh(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!Yt)return Bn(t),null}else 2*os()-r.renderingStartTime>cg&&n!==536870912&&(t.flags|=128,i=!0,Eh(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(e=r.last,e!==null?e.sibling=s:t.child=s,r.last=s)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=os(),e.sibling=null,n=dr.current,On(dr,i?n&1|2:n&1),Yt&&uo(t,r.treeForkCount),e):(Bn(t),null);case 22:case 23:return ts(t),jw(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bn(t),t.subtreeFlags&6&&(t.flags|=8192)):Bn(t),n=t.updateQueue,n!==null&&mm(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Fr(Pc),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),To(br),Bn(t),null;case 25:return null;case 30:return null}throw Error(fe(156,t.tag))}function DB(e,t){switch(Nw(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return To(br),_d(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Kp(t),null;case 31:if(t.memoizedState!==null){if(ts(t),t.alternate===null)throw Error(fe(340));Kc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ts(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(fe(340));Kc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fr(dr),null;case 4:return _d(),null;case 10:return To(t.type),null;case 22:case 23:return ts(t),jw(),e!==null&&Fr(Pc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return To(br),null;case 25:return null;default:return null}}function wE(e,t){switch(Nw(t),t.tag){case 3:To(br),_d();break;case 26:case 27:case 5:Kp(t);break;case 4:_d();break;case 31:t.memoizedState!==null&&ts(t);break;case 13:ts(t);break;case 19:Fr(dr);break;case 10:To(t.type);break;case 22:case 23:ts(t),jw(),e!==null&&Fr(Pc);break;case 24:To(br)}}function M0(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,a=n.inst;r=s(),a.destroy=r}n=n.next}while(n!==i)}}catch(o){xn(t,t.return,o)}}function Pl(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var s=i.next;r=s;do{if((r.tag&e)===e){var a=r.inst,o=a.destroy;if(o!==void 0){a.destroy=void 0,i=t;var l=n,c=o;try{c()}catch(u){xn(i,l,u)}}}r=r.next}while(r!==s)}}catch(u){xn(t,t.return,u)}}function kE(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{IC(t,n)}catch(r){xn(e,e.return,r)}}}function _E(e,t,n){n.props=Jc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){xn(e,t,r)}}function yf(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){xn(e,t,i)}}function Ra(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){xn(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){xn(e,t,i)}else n.current=null}function SE(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){xn(e,e.return,i)}}function mb(e,t,n){try{var r=e.stateNode;ez(r,e.type,n,t),r[Fi]=t}catch(i){xn(e,e.return,i)}}function TE(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zl(e.type)||e.tag===4}function pb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||TE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function X4(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vo));else if(r!==4&&(r===27&&Zl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(X4(e,t,n),e=e.sibling;e!==null;)X4(e,t,n),e=e.sibling}function lg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(lg(e,t,n),e=e.sibling;e!==null;)lg(e,t,n),e=e.sibling}function CE(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ti(t,r,n),t[Qr]=e,t[Fi]=n}catch(s){xn(e,e.return,s)}}var mo=!1,gr=!1,gb=!1,O_=typeof WeakSet=="function"?WeakSet:Set,$r=null;function RB(e,t){if(e=e.containerInfo,rx=vg,e=fC(e),Tw(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==s||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++c===i&&(o=a),f===s&&++u===r&&(l=a),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(ix={focusedElem:e,selectionRange:n},vg=!1,$r=t;$r!==null;)if(t=$r,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$r=e;else for(;$r!==null;){switch(t=$r,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&s!==null){e=void 0,n=t,i=s.memoizedProps,s=s.memoizedState,r=n.stateNode;try{var p=Jc(n.type,i);e=r.getSnapshotBeforeUpdate(p,s),r.__reactInternalSnapshotBeforeUpdate=e}catch(b){xn(n,n.return,b)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ax(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ax(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(fe(163))}if(e=t.sibling,e!==null){e.return=t.return,$r=e;break}$r=t.return}}function EE(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:io(e,n),r&4&&M0(5,n);break;case 1:if(io(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(a){xn(n,n.return,a)}else{var i=Jc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){xn(n,n.return,a)}}r&64&&kE(n),r&512&&yf(n,n.return);break;case 3:if(io(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{IC(e,t)}catch(a){xn(n,n.return,a)}}break;case 27:t===null&&r&4&&CE(n);case 26:case 5:io(e,n),t===null&&r&4&&SE(n),r&512&&yf(n,n.return);break;case 12:io(e,n);break;case 31:io(e,n),r&4&&NE(e,n);break;case 13:io(e,n),r&4&&IE(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=HB.bind(null,n),lz(e,n))));break;case 22:if(r=n.memoizedState!==null||mo,!r){t=t!==null&&t.memoizedState!==null||gr,i=mo;var s=gr;mo=r,(gr=t)&&!s?co(e,n,(n.subtreeFlags&8772)!==0):io(e,n),mo=i,gr=s}break;case 30:break;default:io(e,n)}}function AE(e){var t=e.alternate;t!==null&&(e.alternate=null,AE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vw(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var qn=null,ji=!1;function ro(e,t,n){for(n=n.child;n!==null;)ME(e,t,n),n=n.sibling}function ME(e,t,n){if(ls&&typeof ls.onCommitFiberUnmount=="function")try{ls.onCommitFiberUnmount(k0,n)}catch{}switch(n.tag){case 26:gr||Ra(n,t),ro(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:gr||Ra(n,t);var r=qn,i=ji;Zl(n.type)&&(qn=n.stateNode,ji=!1),ro(e,t,n),wf(n.stateNode),qn=r,ji=i;break;case 5:gr||Ra(n,t);case 6:if(r=qn,i=ji,qn=null,ro(e,t,n),qn=r,ji=i,qn!==null)if(ji)try{(qn.nodeType===9?qn.body:qn.nodeName==="HTML"?qn.ownerDocument.body:qn).removeChild(n.stateNode)}catch(s){xn(n,t,s)}else try{qn.removeChild(n.stateNode)}catch(s){xn(n,t,s)}break;case 18:qn!==null&&(ji?(e=qn,W_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Rd(e)):W_(qn,n.stateNode));break;case 4:r=qn,i=ji,qn=n.stateNode.containerInfo,ji=!0,ro(e,t,n),qn=r,ji=i;break;case 0:case 11:case 14:case 15:Pl(2,n,t),gr||Pl(4,n,t),ro(e,t,n);break;case 1:gr||(Ra(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&_E(n,t,r)),ro(e,t,n);break;case 21:ro(e,t,n);break;case 22:gr=(r=gr)||n.memoizedState!==null,ro(e,t,n),gr=r;break;default:ro(e,t,n)}}function NE(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rd(e)}catch(n){xn(t,t.return,n)}}}function IE(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rd(e)}catch(n){xn(t,t.return,n)}}function OB(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new O_),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new O_),t;default:throw Error(fe(435,e.tag))}}function pm(e,t){var n=OB(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var i=qB.bind(null,e,r);r.then(i,i)}})}function Ii(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],s=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 27:if(Zl(o.type)){qn=o.stateNode,ji=!1;break e}break;case 5:qn=o.stateNode,ji=!1;break e;case 3:case 4:qn=o.stateNode.containerInfo,ji=!0;break e}o=o.return}if(qn===null)throw Error(fe(160));ME(s,a,i),qn=null,ji=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)DE(t,e),t=t.sibling}var ta=null;function DE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ii(t,e),Di(e),r&4&&(Pl(3,e,e.return),M0(3,e),Pl(5,e,e.return));break;case 1:Ii(t,e),Di(e),r&512&&(gr||n===null||Ra(n,n.return)),r&64&&mo&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=ta;if(Ii(t,e),Di(e),r&512&&(gr||n===null||Ra(n,n.return)),r&4){var s=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":s=i.getElementsByTagName("title")[0],(!s||s[T0]||s[Qr]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(r),i.head.insertBefore(s,i.querySelector("head > title"))),ti(s,r,n),s[Qr]=e,Ur(s),r=s;break e;case"link":var a=e6("link","href",i).get(r+(n.href||""));if(a){for(var o=0;o<a.length;o++)if(s=a[o],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(o,1);break t}}s=i.createElement(r),ti(s,r,n),i.head.appendChild(s);break;case"meta":if(a=e6("meta","content",i).get(r+(n.content||""))){for(o=0;o<a.length;o++)if(s=a[o],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(o,1);break t}}s=i.createElement(r),ti(s,r,n),i.head.appendChild(s);break;default:throw Error(fe(468,r))}s[Qr]=e,Ur(s),r=s}e.stateNode=r}else t6(i,e.type,e.stateNode);else e.stateNode=Z_(i,r,e.memoizedProps);else s!==r?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,r===null?t6(i,e.type,e.stateNode):Z_(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&mb(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ii(t,e),Di(e),r&512&&(gr||n===null||Ra(n,n.return)),n!==null&&r&4&&mb(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ii(t,e),Di(e),r&512&&(gr||n===null||Ra(n,n.return)),e.flags&32){i=e.stateNode;try{Td(i,"")}catch(p){xn(e,e.return,p)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,mb(e,i,n!==null?n.memoizedProps:i)),r&1024&&(gb=!0);break;case 6:if(Ii(t,e),Di(e),r&4){if(e.stateNode===null)throw Error(fe(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(p){xn(e,e.return,p)}}break;case 3:if(Sp=null,i=ta,ta=gg(t.containerInfo),Ii(t,e),ta=i,Di(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rd(t.containerInfo)}catch(p){xn(e,e.return,p)}gb&&(gb=!1,RE(e));break;case 4:r=ta,ta=gg(e.stateNode.containerInfo),Ii(t,e),Di(e),ta=r;break;case 12:Ii(t,e),Di(e);break;case 31:Ii(t,e),Di(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pm(e,r)));break;case 13:Ii(t,e),Di(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(N1=os()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pm(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=mo,u=gr;if(mo=c||i,gr=u||l,Ii(t,e),gr=u,mo=c,Di(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||mo||gr||wc(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(s=l.stateNode,i)a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{o=l.stateNode;var d=l.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;o.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(p){xn(l,l.return,p)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(p){xn(l,l.return,p)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?K_(m,!0):K_(l.stateNode,!1)}catch(p){xn(l,l.return,p)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,pm(e,n))));break;case 19:Ii(t,e),Di(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pm(e,r)));break;case 30:break;case 21:break;default:Ii(t,e),Di(e)}}function Di(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(TE(r)){n=r;break}r=r.return}if(n==null)throw Error(fe(160));switch(n.tag){case 27:var i=n.stateNode,s=pb(e);lg(e,s,i);break;case 5:var a=n.stateNode;n.flags&32&&(Td(a,""),n.flags&=-33);var o=pb(e);lg(e,o,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=pb(e);X4(e,c,l);break;default:throw Error(fe(161))}}catch(u){xn(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function RE(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;RE(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function io(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)EE(e,t.alternate,t),t=t.sibling}function wc(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Pl(4,t,t.return),wc(t);break;case 1:Ra(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&_E(t,t.return,n),wc(t);break;case 27:wf(t.stateNode);case 26:case 5:Ra(t,t.return),wc(t);break;case 22:t.memoizedState===null&&wc(t);break;case 30:wc(t);break;default:wc(t)}e=e.sibling}}function co(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,s=t,a=s.flags;switch(s.tag){case 0:case 11:case 15:co(i,s,n),M0(4,s);break;case 1:if(co(i,s,n),r=s,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(c){xn(r,r.return,c)}if(r=s,i=r.updateQueue,i!==null){var o=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)NC(l[i],o)}catch(c){xn(r,r.return,c)}}n&&a&64&&kE(s),yf(s,s.return);break;case 27:CE(s);case 26:case 5:co(i,s,n),n&&r===null&&a&4&&SE(s),yf(s,s.return);break;case 12:co(i,s,n);break;case 31:co(i,s,n),n&&a&4&&NE(i,s);break;case 13:co(i,s,n),n&&a&4&&IE(i,s);break;case 22:s.memoizedState===null&&co(i,s,n),yf(s,s.return);break;case 30:break;default:co(i,s,n)}t=t.sibling}}function Qw(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&E0(n))}function Jw(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&E0(e))}function Qs(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)OE(e,t,n,r),t=t.sibling}function OE(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Qs(e,t,n,r),i&2048&&M0(9,t);break;case 1:Qs(e,t,n,r);break;case 3:Qs(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&E0(e)));break;case 12:if(i&2048){Qs(e,t,n,r),e=t.stateNode;try{var s=t.memoizedProps,a=s.id,o=s.onPostCommit;typeof o=="function"&&o(a,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){xn(t,t.return,l)}}else Qs(e,t,n,r);break;case 31:Qs(e,t,n,r);break;case 13:Qs(e,t,n,r);break;case 23:break;case 22:s=t.stateNode,a=t.alternate,t.memoizedState!==null?s._visibility&2?Qs(e,t,n,r):bf(e,t):s._visibility&2?Qs(e,t,n,r):(s._visibility|=2,Bu(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Qw(a,t);break;case 24:Qs(e,t,n,r),i&2048&&Jw(t.alternate,t);break;default:Qs(e,t,n,r)}}function Bu(e,t,n,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,a=t,o=n,l=r,c=a.flags;switch(a.tag){case 0:case 11:case 15:Bu(s,a,o,l,i),M0(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?Bu(s,a,o,l,i):bf(s,a):(u._visibility|=2,Bu(s,a,o,l,i)),i&&c&2048&&Qw(a.alternate,a);break;case 24:Bu(s,a,o,l,i),i&&c&2048&&Jw(a.alternate,a);break;default:Bu(s,a,o,l,i)}t=t.sibling}}function bf(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:bf(n,r),i&2048&&Qw(r.alternate,r);break;case 24:bf(n,r),i&2048&&Jw(r.alternate,r);break;default:bf(n,r)}t=t.sibling}}var Xh=8192;function Iu(e,t,n){if(e.subtreeFlags&Xh)for(e=e.child;e!==null;)jE(e,t,n),e=e.sibling}function jE(e,t,n){switch(e.tag){case 26:Iu(e,t,n),e.flags&Xh&&e.memoizedState!==null&&xz(n,ta,e.memoizedState,e.memoizedProps);break;case 5:Iu(e,t,n);break;case 3:case 4:var r=ta;ta=gg(e.stateNode.containerInfo),Iu(e,t,n),ta=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Xh,Xh=16777216,Iu(e,t,n),Xh=r):Iu(e,t,n));break;default:Iu(e,t,n)}}function LE(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ah(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$r=r,zE(r,e)}LE(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)BE(e),e=e.sibling}function BE(e){switch(e.tag){case 0:case 11:case 15:Ah(e),e.flags&2048&&Pl(9,e,e.return);break;case 3:Ah(e);break;case 12:Ah(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kp(e)):Ah(e);break;default:Ah(e)}}function kp(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$r=r,zE(r,e)}LE(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Pl(8,t,t.return),kp(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kp(t));break;default:kp(t)}e=e.sibling}}function zE(e,t){for(;$r!==null;){var n=$r;switch(n.tag){case 0:case 11:case 15:Pl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:E0(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$r=r;else e:for(n=e;$r!==null;){r=$r;var i=r.sibling,s=r.return;if(AE(r),r===n){$r=null;break e}if(i!==null){i.return=s,$r=i;break e}$r=s}}}var jB={getCacheForType:function(e){var t=Zr(br),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zr(br).controller.signal}},LB=typeof WeakMap=="function"?WeakMap:Map,cn=0,Mn=null,Vt=null,Kt=0,bn=0,Zi=null,yl=!1,th=!1,Zw=!1,Oo=0,sr=0,$l=0,Uc=0,e3=0,ss=0,Md=0,vf=null,Li=null,Q4=!1,N1=0,PE=0,cg=1/0,ug=null,Nl=null,Dr=0,Il=null,Nd=null,Co=0,J4=0,Z4=null,$E=null,xf=0,ex=null;function us(){return cn&2&&Kt!==0?Kt&-Kt:_t.T!==null?n3():Y9()}function UE(){if(ss===0)if(!(Kt&536870912)||Yt){var e=om;om<<=1,!(om&3932160)&&(om=262144),ss=e}else ss=536870912;return e=ms.current,e!==null&&(e.flags|=32),ss}function Hi(e,t,n){(e===Mn&&(bn===2||bn===9)||e.cancelPendingCommit!==null)&&(Id(e,0),bl(e,Kt,ss,!1)),S0(e,n),(!(cn&2)||e!==Mn)&&(e===Mn&&(!(cn&2)&&(Uc|=n),sr===4&&bl(e,Kt,ss,!1)),qa(e))}function HE(e,t,n){if(cn&6)throw Error(fe(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||_0(e,t),i=r?PB(e,t):yb(e,t,!0),s=r;do{if(i===0){th&&!r&&bl(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!BB(n)){i=yb(e,t,!1),s=!1;continue}if(i===2){if(s=t,e.errorRecoveryDisabledLanes&s)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var o=e;i=vf;var l=o.current.memoizedState.isDehydrated;if(l&&(Id(o,a).flags|=256),a=yb(o,a,!1),a!==2){if(Zw&&!l){o.errorRecoveryDisabledLanes|=s,Uc|=s,i=4;break e}s=Li,Li=i,s!==null&&(Li===null?Li=s:Li.push.apply(Li,s))}i=a}if(s=!1,i!==2)continue}}if(i===1){Id(e,0),bl(e,t,0,!0);break}e:{switch(r=e,s=i,s){case 0:case 1:throw Error(fe(345));case 4:if((t&4194048)!==t)break;case 6:bl(r,t,ss,!yl);break e;case 2:Li=null;break;case 3:case 5:break;default:throw Error(fe(329))}if((t&62914560)===t&&(i=N1+300-os(),10<i)){if(bl(r,t,ss,!yl),v1(r,0,!0)!==0)break e;Co=t,r.timeoutHandle=lA(j_.bind(null,r,n,Li,ug,Q4,t,ss,Uc,Md,yl,s,"Throttled",-0,0),i);break e}j_(r,n,Li,ug,Q4,t,ss,Uc,Md,yl,s,null,-0,0)}}break}while(!0);qa(e)}function j_(e,t,n,r,i,s,a,o,l,c,u,d,f,m){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vo},jE(t,s,d);var p=(s&62914560)===s?N1-os():(s&4194048)===s?PE-os():0;if(p=wz(d,p),p!==null){Co=s,e.cancelPendingCommit=p(B_.bind(null,e,t,s,n,r,i,a,o,l,u,d,null,f,m)),bl(e,s,a,!c);return}}B_(e,t,s,n,r,i,a,o,l)}function BB(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!fs(s(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bl(e,t,n,r){t&=~e3,t&=~Uc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var s=31-cs(i),a=1<<s;r[s]=-1,i&=~a}n!==0&&G9(e,n,t)}function I1(){return cn&6?!0:(N0(0),!1)}function t3(){if(Vt!==null){if(bn===0)var e=Vt.return;else e=Vt,xo=lu=null,$w(e),hd=null,qf=0,e=Vt;for(;e!==null;)wE(e.alternate,e),e=e.return;Vt=null}}function Id(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,rz(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Co=0,t3(),Mn=e,Vt=n=So(e.current,null),Kt=t,bn=0,Zi=null,yl=!1,th=_0(e,t),Zw=!1,Md=ss=e3=Uc=$l=sr=0,Li=vf=null,Q4=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-cs(r),s=1<<i;t|=e[i],r&=~s}return Oo=t,_1(),n}function qE(e,t){Lt=null,_t.H=Vf,t===eh||t===T1?(t=f_(),bn=3):t===Rw?(t=f_(),bn=4):bn=t===Yw?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Zi=t,Vt===null&&(sr=1,ag(e,Os(t,e.current)))}function FE(){var e=ms.current;return e===null?!0:(Kt&4194048)===Kt?$s===null:(Kt&62914560)===Kt||Kt&536870912?e===$s:!1}function VE(){var e=_t.H;return _t.H=Vf,e===null?Vf:e}function GE(){var e=_t.A;return _t.A=jB,e}function dg(){sr=4,yl||(Kt&4194048)!==Kt&&ms.current!==null||(th=!0),!($l&134217727)&&!(Uc&134217727)||Mn===null||bl(Mn,Kt,ss,!1)}function yb(e,t,n){var r=cn;cn|=2;var i=VE(),s=GE();(Mn!==e||Kt!==t)&&(ug=null,Id(e,t)),t=!1;var a=sr;e:do try{if(bn!==0&&Vt!==null){var o=Vt,l=Zi;switch(bn){case 8:t3(),a=6;break e;case 3:case 2:case 9:case 6:ms.current===null&&(t=!0);var c=bn;if(bn=0,Zi=null,ed(e,o,l,c),n&&th){a=0;break e}break;default:c=bn,bn=0,Zi=null,ed(e,o,l,c)}}zB(),a=sr;break}catch(u){qE(e,u)}while(!0);return t&&e.shellSuspendCounter++,xo=lu=null,cn=r,_t.H=i,_t.A=s,Vt===null&&(Mn=null,Kt=0,_1()),a}function zB(){for(;Vt!==null;)WE(Vt)}function PB(e,t){var n=cn;cn|=2;var r=VE(),i=GE();Mn!==e||Kt!==t?(ug=null,cg=os()+500,Id(e,t)):th=_0(e,t);e:do try{if(bn!==0&&Vt!==null){t=Vt;var s=Zi;t:switch(bn){case 1:bn=0,Zi=null,ed(e,t,s,1);break;case 2:case 9:if(h_(s)){bn=0,Zi=null,L_(t);break}t=function(){bn!==2&&bn!==9||Mn!==e||(bn=7),qa(e)},s.then(t,t);break e;case 3:bn=7;break e;case 4:bn=5;break e;case 7:h_(s)?(bn=0,Zi=null,L_(t)):(bn=0,Zi=null,ed(e,t,s,7));break;case 5:var a=null;switch(Vt.tag){case 26:a=Vt.memoizedState;case 5:case 27:var o=Vt;if(a?fA(a):o.stateNode.complete){bn=0,Zi=null;var l=o.sibling;if(l!==null)Vt=l;else{var c=o.return;c!==null?(Vt=c,D1(c)):Vt=null}break t}}bn=0,Zi=null,ed(e,t,s,5);break;case 6:bn=0,Zi=null,ed(e,t,s,6);break;case 8:t3(),sr=6;break e;default:throw Error(fe(462))}}$B();break}catch(u){qE(e,u)}while(!0);return xo=lu=null,_t.H=r,_t.A=i,cn=n,Vt!==null?0:(Mn=null,Kt=0,_1(),sr)}function $B(){for(;Vt!==null&&!cL();)WE(Vt)}function WE(e){var t=xE(e.alternate,e,Oo);e.memoizedProps=e.pendingProps,t===null?D1(e):Vt=t}function L_(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=M_(n,t,t.pendingProps,t.type,void 0,Kt);break;case 11:t=M_(n,t,t.pendingProps,t.type.render,t.ref,Kt);break;case 5:$w(t);default:wE(n,t),t=Vt=wC(t,Oo),t=xE(n,t,Oo)}e.memoizedProps=e.pendingProps,t===null?D1(e):Vt=t}function ed(e,t,n,r){xo=lu=null,$w(t),hd=null,qf=0;var i=t.return;try{if(AB(e,i,t,n,Kt)){sr=1,ag(e,Os(n,e.current)),Vt=null;return}}catch(s){if(i!==null)throw Vt=i,s;sr=1,ag(e,Os(n,e.current)),Vt=null;return}t.flags&32768?(Yt||r===1?e=!0:th||Kt&536870912?e=!1:(yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ms.current,r!==null&&r.tag===13&&(r.flags|=16384))),KE(t,e)):D1(t)}function D1(e){var t=e;do{if(t.flags&32768){KE(t,yl);return}e=t.return;var n=IB(t.alternate,t,Oo);if(n!==null){Vt=n;return}if(t=t.sibling,t!==null){Vt=t;return}Vt=t=e}while(t!==null);sr===0&&(sr=5)}function KE(e,t){do{var n=DB(e.alternate,e);if(n!==null){n.flags&=32767,Vt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Vt=e;return}Vt=e=n}while(e!==null);sr=6,Vt=null}function B_(e,t,n,r,i,s,a,o,l){e.cancelPendingCommit=null;do R1();while(Dr!==0);if(cn&6)throw Error(fe(327));if(t!==null){if(t===e.current)throw Error(fe(177));if(s=t.lanes|t.childLanes,s|=Cw,vL(e,n,s,a,o,l),e===Mn&&(Vt=Mn=null,Kt=0),Nd=t,Il=e,Co=n,J4=s,Z4=i,$E=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,FB(Yp,function(){return ZE(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=_t.T,_t.T=null,i=dn.p,dn.p=2,a=cn,cn|=4;try{RB(e,t,n)}finally{cn=a,dn.p=i,_t.T=r}}Dr=1,YE(),XE(),QE()}}function YE(){if(Dr===1){Dr=0;var e=Il,t=Nd,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=_t.T,_t.T=null;var r=dn.p;dn.p=2;var i=cn;cn|=4;try{DE(t,e);var s=ix,a=fC(e.containerInfo),o=s.focusedElem,l=s.selectionRange;if(a!==o&&o&&o.ownerDocument&&hC(o.ownerDocument.documentElement,o)){if(l!==null&&Tw(o)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var d=o.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var m=f.getSelection(),p=o.textContent.length,b=Math.min(l.start,p),x=l.end===void 0?b:Math.min(l.end,p);!m.extend&&b>x&&(a=x,x=b,b=a);var g=s_(o,b),y=s_(o,x);if(g&&y&&(m.rangeCount!==1||m.anchorNode!==g.node||m.anchorOffset!==g.offset||m.focusNode!==y.node||m.focusOffset!==y.offset)){var w=d.createRange();w.setStart(g.node,g.offset),m.removeAllRanges(),b>x?(m.addRange(w),m.extend(y.node,y.offset)):(w.setEnd(y.node,y.offset),m.addRange(w))}}}}for(d=[],m=o;m=m.parentNode;)m.nodeType===1&&d.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<d.length;o++){var C=d[o];C.element.scrollLeft=C.left,C.element.scrollTop=C.top}}vg=!!rx,ix=rx=null}finally{cn=i,dn.p=r,_t.T=n}}e.current=t,Dr=2}}function XE(){if(Dr===2){Dr=0;var e=Il,t=Nd,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=_t.T,_t.T=null;var r=dn.p;dn.p=2;var i=cn;cn|=4;try{EE(e,t.alternate,t)}finally{cn=i,dn.p=r,_t.T=n}}Dr=3}}function QE(){if(Dr===4||Dr===3){Dr=0,uL();var e=Il,t=Nd,n=Co,r=$E;t.subtreeFlags&10256||t.flags&10256?Dr=5:(Dr=0,Nd=Il=null,JE(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Nl=null),bw(n),t=t.stateNode,ls&&typeof ls.onCommitFiberRoot=="function")try{ls.onCommitFiberRoot(k0,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=_t.T,i=dn.p,dn.p=2,_t.T=null;try{for(var s=e.onRecoverableError,a=0;a<r.length;a++){var o=r[a];s(o.value,{componentStack:o.stack})}}finally{_t.T=t,dn.p=i}}Co&3&&R1(),qa(e),i=e.pendingLanes,n&261930&&i&42?e===ex?xf++:(xf=0,ex=e):xf=0,N0(0)}}function JE(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,E0(t)))}function R1(){return YE(),XE(),QE(),ZE()}function ZE(){if(Dr!==5)return!1;var e=Il,t=J4;J4=0;var n=bw(Co),r=_t.T,i=dn.p;try{dn.p=32>n?32:n,_t.T=null,n=Z4,Z4=null;var s=Il,a=Co;if(Dr=0,Nd=Il=null,Co=0,cn&6)throw Error(fe(331));var o=cn;if(cn|=4,BE(s.current),OE(s,s.current,a,n),cn=o,N0(0,!1),ls&&typeof ls.onPostCommitFiberRoot=="function")try{ls.onPostCommitFiberRoot(k0,s)}catch{}return!0}finally{dn.p=i,_t.T=r,JE(e,t)}}function z_(e,t,n){t=Os(n,t),t=W4(e.stateNode,t,2),e=Ml(e,t,2),e!==null&&(S0(e,2),qa(e))}function xn(e,t,n){if(e.tag===3)z_(e,e,n);else for(;t!==null;){if(t.tag===3){z_(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Nl===null||!Nl.has(r))){e=Os(n,e),n=mE(2),r=Ml(t,n,2),r!==null&&(pE(n,r,t,e),S0(r,2),qa(r));break}}t=t.return}}function bb(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new LB;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Zw=!0,i.add(n),e=UB.bind(null,e,t,n),t.then(e,e))}function UB(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Mn===e&&(Kt&n)===n&&(sr===4||sr===3&&(Kt&62914560)===Kt&&300>os()-N1?!(cn&2)&&Id(e,0):e3|=n,Md===Kt&&(Md=0)),qa(e)}function eA(e,t){t===0&&(t=V9()),e=ou(e,t),e!==null&&(S0(e,t),qa(e))}function HB(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),eA(e,n)}function qB(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(fe(314))}r!==null&&r.delete(t),eA(e,n)}function FB(e,t){return gw(e,t)}var hg=null,zu=null,tx=!1,fg=!1,vb=!1,vl=0;function qa(e){e!==zu&&e.next===null&&(zu===null?hg=zu=e:zu=zu.next=e),fg=!0,tx||(tx=!0,GB())}function N0(e,t){if(!vb&&fg){vb=!0;do for(var n=!1,r=hg;r!==null;){if(e!==0){var i=r.pendingLanes;if(i===0)var s=0;else{var a=r.suspendedLanes,o=r.pingedLanes;s=(1<<31-cs(42|e)+1)-1,s&=i&~(a&~o),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,P_(r,s))}else s=Kt,s=v1(r,r===Mn?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(s&3)||_0(r,s)||(n=!0,P_(r,s));r=r.next}while(n);vb=!1}}function VB(){tA()}function tA(){fg=tx=!1;var e=0;vl!==0&&nz()&&(e=vl);for(var t=os(),n=null,r=hg;r!==null;){var i=r.next,s=nA(r,t);s===0?(r.next=null,n===null?hg=i:n.next=i,i===null&&(zu=n)):(n=r,(e!==0||s&3)&&(fg=!0)),r=i}Dr!==0&&Dr!==5||N0(e),vl!==0&&(vl=0)}function nA(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var a=31-cs(s),o=1<<a,l=i[a];l===-1?(!(o&n)||o&r)&&(i[a]=bL(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}if(t=Mn,n=Kt,n=v1(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(bn===2||bn===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Wy(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||_0(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Wy(r),bw(n)){case 2:case 8:n=q9;break;case 32:n=Yp;break;case 268435456:n=F9;break;default:n=Yp}return r=rA.bind(null,e),n=gw(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Wy(r),e.callbackPriority=2,e.callbackNode=null,2}function rA(e,t){if(Dr!==0&&Dr!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(R1()&&e.callbackNode!==n)return null;var r=Kt;return r=v1(e,e===Mn?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(HE(e,r,t),nA(e,os()),e.callbackNode!=null&&e.callbackNode===n?rA.bind(null,e):null)}function P_(e,t){if(R1())return null;HE(e,t,!0)}function GB(){iz(function(){cn&6?gw(H9,VB):tA()})}function n3(){if(vl===0){var e=Cd;e===0&&(e=am,am<<=1,!(am&261888)&&(am=256)),vl=e}return vl}function $_(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fp(""+e)}function U_(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function WB(e,t,n,r,i){if(t==="submit"&&n&&n.stateNode===i){var s=$_((i[Fi]||null).action),a=r.submitter;a&&(t=(t=a[Fi]||null)?$_(t.formAction):a.getAttribute("formAction"),t!==null&&(s=t,a=null));var o=new x1("action","action",null,r,i);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(vl!==0){var l=a?U_(i,a):new FormData(i);V4(n,{pending:!0,data:l,method:i.method,action:s},null,l)}}else typeof s=="function"&&(o.preventDefault(),l=a?U_(i,a):new FormData(i),V4(n,{pending:!0,data:l,method:i.method,action:s},s,l))},currentTarget:i}]})}}for(var xb=0;xb<R4.length;xb++){var wb=R4[xb],KB=wb.toLowerCase(),YB=wb[0].toUpperCase()+wb.slice(1);oa(KB,"on"+YB)}oa(pC,"onAnimationEnd");oa(gC,"onAnimationIteration");oa(yC,"onAnimationStart");oa("dblclick","onDoubleClick");oa("focusin","onFocus");oa("focusout","onBlur");oa(dB,"onTransitionRun");oa(hB,"onTransitionStart");oa(fB,"onTransitionCancel");oa(bC,"onTransitionEnd");Sd("onMouseEnter",["mouseout","mouseover"]);Sd("onMouseLeave",["mouseout","mouseover"]);Sd("onPointerEnter",["pointerout","pointerover"]);Sd("onPointerLeave",["pointerout","pointerover"]);iu("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));iu("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));iu("onBeforeInput",["compositionend","keypress","textInput","paste"]);iu("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));iu("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));iu("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),XB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gf));function iA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;s=o,i.currentTarget=c;try{s(i)}catch(u){Qp(u)}i.currentTarget=null,s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;s=o,i.currentTarget=c;try{s(i)}catch(u){Qp(u)}i.currentTarget=null,s=l}}}}function Ft(e,t){var n=t[T4];n===void 0&&(n=t[T4]=new Set);var r=e+"__bubble";n.has(r)||(sA(t,e,2,!1),n.add(r))}function kb(e,t,n){var r=0;t&&(r|=4),sA(n,e,r,t)}var gm="_reactListening"+Math.random().toString(36).slice(2);function r3(e){if(!e[gm]){e[gm]=!0,X9.forEach(function(n){n!=="selectionchange"&&(XB.has(n)||kb(n,!1,e),kb(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[gm]||(t[gm]=!0,kb("selectionchange",!1,t))}}function sA(e,t,n,r){switch(bA(t)){case 2:var i=Sz;break;case 8:i=Tz;break;default:i=o3}n=i.bind(null,t,n,e),i=void 0,!N4||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function _b(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===i)return;a=a.return}for(;o!==null;){if(a=Vu(o),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){r=s=a;continue e}o=o.parentNode}}r=r.return}iC(function(){var c=s,u=ww(n),d=[];e:{var f=vC.get(e);if(f!==void 0){var m=x1,p=e;switch(e){case"keypress":if(pp(n)===0)break e;case"keydown":case"keyup":m=qL;break;case"focusin":p="focus",m=Jy;break;case"focusout":p="blur",m=Jy;break;case"beforeblur":case"afterblur":m=Jy;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Y5;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=IL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=GL;break;case pC:case gC:case yC:m=OL;break;case bC:m=KL;break;case"scroll":case"scrollend":m=ML;break;case"wheel":m=XL;break;case"copy":case"cut":case"paste":m=LL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Q5;break;case"toggle":case"beforetoggle":m=JL}var b=(t&4)!==0,x=!b&&(e==="scroll"||e==="scrollend"),g=b?f!==null?f+"Capture":null:f;b=[];for(var y=c,w;y!==null;){var C=y;if(w=C.stateNode,C=C.tag,C!==5&&C!==26&&C!==27||w===null||g===null||(C=zf(y,g),C!=null&&b.push(Wf(y,C,w))),x)break;y=y.return}0<b.length&&(f=new m(f,p,null,n,u),d.push({event:f,listeners:b}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==M4&&(p=n.relatedTarget||n.fromElement)&&(Vu(p)||p[Qd]))break e;if((m||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=c,p=p?Vu(p):null,p!==null&&(x=w0(p),b=p.tag,p!==x||b!==5&&b!==27&&b!==6)&&(p=null)):(m=null,p=c),m!==p)){if(b=Y5,C="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(b=Q5,C="onPointerLeave",g="onPointerEnter",y="pointer"),x=m==null?f:Kh(m),w=p==null?f:Kh(p),f=new b(C,y+"leave",m,n,u),f.target=x,f.relatedTarget=w,C=null,Vu(u)===c&&(b=new b(g,y+"enter",p,n,u),b.target=w,b.relatedTarget=x,C=b),x=C,m&&p)t:{for(b=QB,g=m,y=p,w=0,C=g;C;C=b(C))w++;C=0;for(var E=y;E;E=b(E))C++;for(;0<w-C;)g=b(g),w--;for(;0<C-w;)y=b(y),C--;for(;w--;){if(g===y||y!==null&&g===y.alternate){b=g;break t}g=b(g),y=b(y)}b=null}else b=null;m!==null&&H_(d,f,m,b,!1),p!==null&&x!==null&&H_(d,x,p,b,!0)}}e:{if(f=c?Kh(c):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var S=t_;else if(e_(f))if(uC)S=lB;else{S=aB;var T=sB}else m=f.nodeName,!m||m.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?c&&xw(c.elementType)&&(S=t_):S=oB;if(S&&(S=S(e,c))){cC(d,S,n,u);break e}T&&T(e,f,c),e==="focusout"&&c&&f.type==="number"&&c.memoizedProps.value!=null&&A4(f,"number",f.value)}switch(T=c?Kh(c):window,e){case"focusin":(e_(T)||T.contentEditable==="true")&&(Ku=T,I4=c,df=null);break;case"focusout":df=I4=Ku=null;break;case"mousedown":D4=!0;break;case"contextmenu":case"mouseup":case"dragend":D4=!1,a_(d,n,u);break;case"selectionchange":if(uB)break;case"keydown":case"keyup":a_(d,n,u)}var j;if(Sw)e:{switch(e){case"compositionstart":var z="onCompositionStart";break e;case"compositionend":z="onCompositionEnd";break e;case"compositionupdate":z="onCompositionUpdate";break e}z=void 0}else Wu?oC(e,n)&&(z="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(z="onCompositionStart");z&&(aC&&n.locale!=="ko"&&(Wu||z!=="onCompositionStart"?z==="onCompositionEnd"&&Wu&&(j=sC()):(gl=u,kw="value"in gl?gl.value:gl.textContent,Wu=!0)),T=mg(c,z),0<T.length&&(z=new X5(z,e,null,n,u),d.push({event:z,listeners:T}),j?z.data=j:(j=lC(n),j!==null&&(z.data=j)))),(j=eB?tB(e,n):nB(e,n))&&(z=mg(c,"onBeforeInput"),0<z.length&&(T=new X5("onBeforeInput","beforeinput",null,n,u),d.push({event:T,listeners:z}),T.data=j)),WB(d,e,c,n,u)}iA(d,t)})}function Wf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function mg(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=zf(e,n),i!=null&&r.unshift(Wf(e,i,s)),i=zf(e,t),i!=null&&r.push(Wf(e,i,s))),e.tag===3)return r;e=e.return}return[]}function QB(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function H_(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===r)break;o!==5&&o!==26&&o!==27||c===null||(l=c,i?(c=zf(n,s),c!=null&&a.unshift(Wf(n,c,l))):i||(c=zf(n,s),c!=null&&a.push(Wf(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var JB=/\r\n?/g,ZB=/\u0000|\uFFFD/g;function q_(e){return(typeof e=="string"?e:""+e).replace(JB,`
`).replace(ZB,"")}function aA(e,t){return t=q_(t),q_(e)===t}function wn(e,t,n,r,i,s){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Td(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Td(e,""+r);break;case"className":cm(e,"class",r);break;case"tabIndex":cm(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":cm(e,n,r);break;case"style":rC(e,r,s);break;case"data":if(t!=="object"){cm(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=fp(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(t!=="input"&&wn(e,t,"name",i.name,i,null),wn(e,t,"formEncType",i.formEncType,i,null),wn(e,t,"formMethod",i.formMethod,i,null),wn(e,t,"formTarget",i.formTarget,i,null)):(wn(e,t,"encType",i.encType,i,null),wn(e,t,"method",i.method,i,null),wn(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=fp(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=vo);break;case"onScroll":r!=null&&Ft("scroll",e);break;case"onScrollEnd":r!=null&&Ft("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(fe(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(fe(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=fp(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Ft("beforetoggle",e),Ft("toggle",e),hp(e,"popover",r);break;case"xlinkActuate":to(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":to(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":to(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":to(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":to(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":to(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":to(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":to(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":to(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":hp(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=EL.get(n)||n,hp(e,n,r))}}function nx(e,t,n,r,i,s){switch(n){case"style":rC(e,r,s);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(fe(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(fe(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Td(e,r):(typeof r=="number"||typeof r=="bigint")&&Td(e,""+r);break;case"onScroll":r!=null&&Ft("scroll",e);break;case"onScrollEnd":r!=null&&Ft("scrollend",e);break;case"onClick":r!=null&&(e.onclick=vo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Q9.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),s=e[Fi]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,i),typeof r=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):hp(e,n,r)}}}function ti(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ft("error",e),Ft("load",e);var r=!1,i=!1,s;for(s in n)if(n.hasOwnProperty(s)){var a=n[s];if(a!=null)switch(s){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(fe(137,t));default:wn(e,t,s,a,n,null)}}i&&wn(e,t,"srcSet",n.srcSet,n,null),r&&wn(e,t,"src",n.src,n,null);return;case"input":Ft("invalid",e);var o=s=a=i=null,l=null,c=null;for(r in n)if(n.hasOwnProperty(r)){var u=n[r];if(u!=null)switch(r){case"name":i=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":o=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(fe(137,t));break;default:wn(e,t,r,u,n,null)}}eC(e,s,o,l,c,a,i,!1);return;case"select":Ft("invalid",e),r=a=s=null;for(i in n)if(n.hasOwnProperty(i)&&(o=n[i],o!=null))switch(i){case"value":s=o;break;case"defaultValue":a=o;break;case"multiple":r=o;default:wn(e,t,i,o,n,null)}t=s,n=a,e.multiple=!!r,t!=null?cd(e,!!r,t,!1):n!=null&&cd(e,!!r,n,!0);return;case"textarea":Ft("invalid",e),s=i=r=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":r=o;break;case"defaultValue":i=o;break;case"children":s=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(fe(91));break;default:wn(e,t,a,o,n,null)}nC(e,r,i,s);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:wn(e,t,l,r,n,null)}return;case"dialog":Ft("beforetoggle",e),Ft("toggle",e),Ft("cancel",e),Ft("close",e);break;case"iframe":case"object":Ft("load",e);break;case"video":case"audio":for(r=0;r<Gf.length;r++)Ft(Gf[r],e);break;case"image":Ft("error",e),Ft("load",e);break;case"details":Ft("toggle",e);break;case"embed":case"source":case"link":Ft("error",e),Ft("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(r=n[c],r!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(fe(137,t));default:wn(e,t,c,r,n,null)}return;default:if(xw(t)){for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!==void 0&&nx(e,t,u,r,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(r=n[o],r!=null&&wn(e,t,o,r,n,null))}function ez(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,o=null,l=null,c=null,u=null;for(m in n){var d=n[m];if(n.hasOwnProperty(m)&&d!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":l=d;default:r.hasOwnProperty(m)||wn(e,t,m,null,r,d)}}for(var f in r){var m=r[f];if(d=n[f],r.hasOwnProperty(f)&&(m!=null||d!=null))switch(f){case"type":s=m;break;case"name":i=m;break;case"checked":c=m;break;case"defaultChecked":u=m;break;case"value":a=m;break;case"defaultValue":o=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(fe(137,t));break;default:m!==d&&wn(e,t,f,m,r,d)}}E4(e,a,o,l,c,u,s,i);return;case"select":m=a=o=f=null;for(s in n)if(l=n[s],n.hasOwnProperty(s)&&l!=null)switch(s){case"value":break;case"multiple":m=l;default:r.hasOwnProperty(s)||wn(e,t,s,null,r,l)}for(i in r)if(s=r[i],l=n[i],r.hasOwnProperty(i)&&(s!=null||l!=null))switch(i){case"value":f=s;break;case"defaultValue":o=s;break;case"multiple":a=s;default:s!==l&&wn(e,t,i,s,r,l)}t=o,n=a,r=m,f!=null?cd(e,!!n,f,!1):!!r!=!!n&&(t!=null?cd(e,!!n,t,!0):cd(e,!!n,n?[]:"",!1));return;case"textarea":m=f=null;for(o in n)if(i=n[o],n.hasOwnProperty(o)&&i!=null&&!r.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:wn(e,t,o,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(i!=null||s!=null))switch(a){case"value":f=i;break;case"defaultValue":m=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(fe(91));break;default:i!==s&&wn(e,t,a,i,r,s)}tC(e,f,m);return;case"option":for(var p in n)if(f=n[p],n.hasOwnProperty(p)&&f!=null&&!r.hasOwnProperty(p))switch(p){case"selected":e.selected=!1;break;default:wn(e,t,p,null,r,f)}for(l in r)if(f=r[l],m=n[l],r.hasOwnProperty(l)&&f!==m&&(f!=null||m!=null))switch(l){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:wn(e,t,l,f,r,m)}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 b in n)f=n[b],n.hasOwnProperty(b)&&f!=null&&!r.hasOwnProperty(b)&&wn(e,t,b,null,r,f);for(c in r)if(f=r[c],m=n[c],r.hasOwnProperty(c)&&f!==m&&(f!=null||m!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(fe(137,t));break;default:wn(e,t,c,f,r,m)}return;default:if(xw(t)){for(var x in n)f=n[x],n.hasOwnProperty(x)&&f!==void 0&&!r.hasOwnProperty(x)&&nx(e,t,x,void 0,r,f);for(u in r)f=r[u],m=n[u],!r.hasOwnProperty(u)||f===m||f===void 0&&m===void 0||nx(e,t,u,f,r,m);return}}for(var g in n)f=n[g],n.hasOwnProperty(g)&&f!=null&&!r.hasOwnProperty(g)&&wn(e,t,g,null,r,f);for(d in r)f=r[d],m=n[d],!r.hasOwnProperty(d)||f===m||f==null&&m==null||wn(e,t,d,f,r,m)}function F_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tz(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var i=n[r],s=i.transferSize,a=i.initiatorType,o=i.duration;if(s&&o&&F_(a)){for(a=0,o=i.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>o)break;var u=l.transferSize,d=l.initiatorType;u&&F_(d)&&(l=l.responseEnd,a+=u*(l<o?1:(o-c)/(l-c)))}if(--r,t+=8*(s+a)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var rx=null,ix=null;function pg(e){return e.nodeType===9?e:e.ownerDocument}function V_(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function oA(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function sx(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sb=null;function nz(){var e=window.event;return e&&e.type==="popstate"?e===Sb?!1:(Sb=e,!0):(Sb=null,!1)}var lA=typeof setTimeout=="function"?setTimeout:void 0,rz=typeof clearTimeout=="function"?clearTimeout:void 0,G_=typeof Promise=="function"?Promise:void 0,iz=typeof queueMicrotask=="function"?queueMicrotask:typeof G_<"u"?function(e){return G_.resolve(null).then(e).catch(sz)}:lA;function sz(e){setTimeout(function(){throw e})}function Zl(e){return e==="head"}function W_(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(i),Rd(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")wf(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,wf(n);for(var s=n.firstChild;s;){var a=s.nextSibling,o=s.nodeName;s[T0]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=a}}else n==="body"&&wf(e.ownerDocument.body);n=i}while(n);Rd(t)}function K_(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function ax(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":ax(n),vw(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function az(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[T0])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Us(e.nextSibling),e===null)break}return null}function oz(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Us(e.nextSibling),e===null))return null;return e}function cA(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Us(e.nextSibling),e===null))return null;return e}function ox(e){return e.data==="$?"||e.data==="$~"}function lx(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function lz(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Us(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var cx=null;function Y_(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Us(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function X_(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function uA(e,t,n){switch(t=pg(n),e){case"html":if(e=t.documentElement,!e)throw Error(fe(452));return e;case"head":if(e=t.head,!e)throw Error(fe(453));return e;case"body":if(e=t.body,!e)throw Error(fe(454));return e;default:throw Error(fe(451))}}function wf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vw(e)}var qs=new Map,Q_=new Set;function gg(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var zo=dn.d;dn.d={f:cz,r:uz,D:dz,C:hz,L:fz,m:mz,X:gz,S:pz,M:yz};function cz(){var e=zo.f(),t=I1();return e||t}function uz(e){var t=Jd(e);t!==null&&t.tag===5&&t.type==="form"?rE(t):zo.r(e)}var nh=typeof document>"u"?null:document;function dA(e,t,n){var r=nh;if(r&&typeof t=="string"&&t){var i=Rs(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Q_.has(i)||(Q_.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),ti(t,"link",e),Ur(t),r.head.appendChild(t)))}}function dz(e){zo.D(e),dA("dns-prefetch",e,null)}function hz(e,t){zo.C(e,t),dA("preconnect",e,t)}function fz(e,t,n){zo.L(e,t,n);var r=nh;if(r&&e&&t){var i='link[rel="preload"][as="'+Rs(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Rs(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Rs(n.imageSizes)+'"]')):i+='[href="'+Rs(e)+'"]';var s=i;switch(t){case"style":s=Dd(e);break;case"script":s=rh(e)}qs.has(s)||(e=Un({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),qs.set(s,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(I0(s))||t==="script"&&r.querySelector(D0(s))||(t=r.createElement("link"),ti(t,"link",e),Ur(t),r.head.appendChild(t)))}}function mz(e,t){zo.m(e,t);var n=nh;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Rs(r)+'"][href="'+Rs(e)+'"]',s=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=rh(e)}if(!qs.has(s)&&(e=Un({rel:"modulepreload",href:e},t),qs.set(s,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(D0(s)))return}r=n.createElement("link"),ti(r,"link",e),Ur(r),n.head.appendChild(r)}}}function pz(e,t,n){zo.S(e,t,n);var r=nh;if(r&&e){var i=ld(r).hoistableStyles,s=Dd(e);t=t||"default";var a=i.get(s);if(!a){var o={loading:0,preload:null};if(a=r.querySelector(I0(s)))o.loading=5;else{e=Un({rel:"stylesheet",href:e,"data-precedence":t},n),(n=qs.get(s))&&i3(e,n);var l=a=r.createElement("link");Ur(l),ti(l,"link",e),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,_p(a,t,r)}a={type:"stylesheet",instance:a,count:1,state:o},i.set(s,a)}}}function gz(e,t){zo.X(e,t);var n=nh;if(n&&e){var r=ld(n).hoistableScripts,i=rh(e),s=r.get(i);s||(s=n.querySelector(D0(i)),s||(e=Un({src:e,async:!0},t),(t=qs.get(i))&&s3(e,t),s=n.createElement("script"),Ur(s),ti(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(i,s))}}function yz(e,t){zo.M(e,t);var n=nh;if(n&&e){var r=ld(n).hoistableScripts,i=rh(e),s=r.get(i);s||(s=n.querySelector(D0(i)),s||(e=Un({src:e,async:!0,type:"module"},t),(t=qs.get(i))&&s3(e,t),s=n.createElement("script"),Ur(s),ti(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(i,s))}}function J_(e,t,n,r){var i=(i=Cl.current)?gg(i):null;if(!i)throw Error(fe(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Dd(n.href),n=ld(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Dd(n.href);var s=ld(i).hoistableStyles,a=s.get(e);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,a),(s=i.querySelector(I0(e)))&&!s._p&&(a.instance=s,a.state.loading=5),qs.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},qs.set(e,n),s||bz(i,e,n,a.state))),t&&r===null)throw Error(fe(528,""));return a}if(t&&r!==null)throw Error(fe(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=rh(n),n=ld(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(fe(444,e))}}function Dd(e){return'href="'+Rs(e)+'"'}function I0(e){return'link[rel="stylesheet"]['+e+"]"}function hA(e){return Un({},e,{"data-precedence":e.precedence,precedence:null})}function bz(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),ti(t,"link",n),Ur(t),e.head.appendChild(t))}function rh(e){return'[src="'+Rs(e)+'"]'}function D0(e){return"script[async]"+e}function Z_(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Rs(n.href)+'"]');if(r)return t.instance=r,Ur(r),r;var i=Un({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Ur(r),ti(r,"style",i),_p(r,n.precedence,e),t.instance=r;case"stylesheet":i=Dd(n.href);var s=e.querySelector(I0(i));if(s)return t.state.loading|=4,t.instance=s,Ur(s),s;r=hA(n),(i=qs.get(i))&&i3(r,i),s=(e.ownerDocument||e).createElement("link"),Ur(s);var a=s;return a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),ti(s,"link",r),t.state.loading|=4,_p(s,n.precedence,e),t.instance=s;case"script":return s=rh(n.src),(i=e.querySelector(D0(s)))?(t.instance=i,Ur(i),i):(r=n,(i=qs.get(s))&&(r=Un({},n),s3(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Ur(i),ti(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(fe(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,_p(r,n.precedence,e));return t.instance}function _p(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,s=i,a=0;a<r.length;a++){var o=r[a];if(o.dataset.precedence===t)s=o;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function i3(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function s3(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Sp=null;function e6(e,t,n){if(Sp===null){var r=new Map,i=Sp=new Map;i.set(n,r)}else i=Sp,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var s=n[i];if(!(s[T0]||s[Qr]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var a=s.getAttribute(t)||"";a=e+a;var o=r.get(a);o?o.push(s):r.set(a,[s])}}return r}function t6(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function vz(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function fA(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function xz(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var i=Dd(r.href),s=t.querySelector(I0(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=yg.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ur(s);return}s=t.ownerDocument||t,r=hA(r),(i=qs.get(i))&&i3(r,i),s=s.createElement("link"),Ur(s);var a=s;a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),ti(s,"link",r),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=yg.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Tb=0;function wz(e,t){return e.stylesheets&&e.count===0&&Tp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Tp(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Tb===0&&(Tb=62500*tz());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Tp(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Tb?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function yg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bg=null;function Tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bg=new Map,t.forEach(kz,e),bg=null,yg.call(e))}function kz(e,t){if(!(t.state.loading&4)){var n=bg.get(e);if(n)var r=n.get(null);else{n=new Map,bg.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var a=i[s];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}i=t.instance,a=i.getAttribute("data-precedence"),s=n.get(a)||r,s===r&&n.set(null,i),n.set(a,i),this.count++,r=yg.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Kf={$$typeof:bo,Provider:null,Consumer:null,_currentValue:Bc,_currentValue2:Bc,_threadCount:0};function _z(e,t,n,r,i,s,a,o,l){this.tag=1,this.containerInfo=e,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=Ky(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ky(0),this.hiddenUpdates=Ky(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function mA(e,t,n,r,i,s,a,o,l,c,u,d){return e=new _z(e,t,n,a,l,c,u,d,o),t=1,s===!0&&(t|=24),s=rs(3,null,null,t),e.current=s,s.stateNode=e,t=Iw(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:r,isDehydrated:n,cache:t},Ow(s),e}function pA(e){return e?(e=Qu,e):Qu}function gA(e,t,n,r,i,s){i=pA(i),r.context===null?r.context=i:r.pendingContext=i,r=Al(t),r.payload={element:n},s=s===void 0?null:s,s!==null&&(r.callback=s),n=Ml(e,r,t),n!==null&&(Hi(n,e,t),ff(n,e,t))}function n6(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function a3(e,t){n6(e,t),(e=e.alternate)&&n6(e,t)}function yA(e){if(e.tag===13||e.tag===31){var t=ou(e,67108864);t!==null&&Hi(t,e,67108864),a3(e,67108864)}}function r6(e){if(e.tag===13||e.tag===31){var t=us();t=yw(t);var n=ou(e,t);n!==null&&Hi(n,e,t),a3(e,t)}}var vg=!0;function Sz(e,t,n,r){var i=_t.T;_t.T=null;var s=dn.p;try{dn.p=2,o3(e,t,n,r)}finally{dn.p=s,_t.T=i}}function Tz(e,t,n,r){var i=_t.T;_t.T=null;var s=dn.p;try{dn.p=8,o3(e,t,n,r)}finally{dn.p=s,_t.T=i}}function o3(e,t,n,r){if(vg){var i=ux(r);if(i===null)_b(e,t,r,xg,n),i6(e,r);else if(Ez(i,e,t,n,r))r.stopPropagation();else if(i6(e,r),t&4&&-1<Cz.indexOf(e)){for(;i!==null;){var s=Jd(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var a=vc(s.pendingLanes);if(a!==0){var o=s;for(o.pendingLanes|=2,o.entangledLanes|=2;a;){var l=1<<31-cs(a);o.entanglements[1]|=l,a&=~l}qa(s),!(cn&6)&&(cg=os()+500,N0(0))}}break;case 31:case 13:o=ou(s,2),o!==null&&Hi(o,s,2),I1(),a3(s,2)}if(s=ux(r),s===null&&_b(e,t,r,xg,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else _b(e,t,r,null,n)}}function ux(e){return e=ww(e),l3(e)}var xg=null;function l3(e){if(xg=null,e=Vu(e),e!==null){var t=w0(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=B9(t),e!==null)return e;e=null}else if(n===31){if(e=z9(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xg=e,null}function bA(e){switch(e){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(dL()){case H9:return 2;case q9:return 8;case Yp:case hL:return 32;case F9:return 268435456;default:return 32}default:return 32}}var dx=!1,Dl=null,Rl=null,Ol=null,Yf=new Map,Xf=new Map,fl=[],Cz="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 i6(e,t){switch(e){case"focusin":case"focusout":Dl=null;break;case"dragenter":case"dragleave":Rl=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":Yf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xf.delete(t.pointerId)}}function Mh(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Jd(t),t!==null&&yA(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ez(e,t,n,r,i){switch(t){case"focusin":return Dl=Mh(Dl,e,t,n,r,i),!0;case"dragenter":return Rl=Mh(Rl,e,t,n,r,i),!0;case"mouseover":return Ol=Mh(Ol,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Yf.set(s,Mh(Yf.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Xf.set(s,Mh(Xf.get(s)||null,e,t,n,r,i)),!0}return!1}function vA(e){var t=Vu(e.target);if(t!==null){var n=w0(t);if(n!==null){if(t=n.tag,t===13){if(t=B9(n),t!==null){e.blockedOn=t,H5(e.priority,function(){r6(n)});return}}else if(t===31){if(t=z9(n),t!==null){e.blockedOn=t,H5(e.priority,function(){r6(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Cp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ux(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);M4=r,n.target.dispatchEvent(r),M4=null}else return t=Jd(n),t!==null&&yA(t),e.blockedOn=n,!1;t.shift()}return!0}function s6(e,t,n){Cp(e)&&n.delete(t)}function Az(){dx=!1,Dl!==null&&Cp(Dl)&&(Dl=null),Rl!==null&&Cp(Rl)&&(Rl=null),Ol!==null&&Cp(Ol)&&(Ol=null),Yf.forEach(s6),Xf.forEach(s6)}function ym(e,t){e.blockedOn===t&&(e.blockedOn=null,dx||(dx=!0,Or.unstable_scheduleCallback(Or.unstable_NormalPriority,Az)))}var bm=null;function a6(e){bm!==e&&(bm=e,Or.unstable_scheduleCallback(Or.unstable_NormalPriority,function(){bm===e&&(bm=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(l3(r||n)===null)continue;break}var s=Jd(n);s!==null&&(e.splice(t,3),t-=3,V4(s,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rd(e){function t(l){return ym(l,e)}Dl!==null&&ym(Dl,e),Rl!==null&&ym(Rl,e),Ol!==null&&ym(Ol,e),Yf.forEach(t),Xf.forEach(t);for(var n=0;n<fl.length;n++){var r=fl[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<fl.length&&(n=fl[0],n.blockedOn===null);)vA(n),n.blockedOn===null&&fl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],s=n[r+1],a=i[Fi]||null;if(typeof s=="function")a||a6(n);else if(a){var o=null;if(s&&s.hasAttribute("formAction")){if(i=s,a=s[Fi]||null)o=a.formAction;else if(l3(i)!==null)continue}else o=a.action;typeof o=="function"?n[r+1]=o:(n.splice(r,3),r-=3),a6(n)}}}function xA(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(a){return i=a})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function c3(e){this._internalRoot=e}O1.prototype.render=c3.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(fe(409));var n=t.current,r=us();gA(n,r,e,t,null,null)};O1.prototype.unmount=c3.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gA(e.current,2,null,e,null,null),I1(),t[Qd]=null}};function O1(e){this._internalRoot=e}O1.prototype.unstable_scheduleHydration=function(e){if(e){var t=Y9();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fl.length&&t!==0&&t<fl[n].priority;n++);fl.splice(n,0,e),n===0&&vA(e)}};var o6=j9.version;if(o6!=="19.2.4")throw Error(fe(527,o6,"19.2.4"));dn.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(fe(188)):(e=Object.keys(e).join(","),Error(fe(268,e)));return e=iL(t),e=e!==null?P9(e):null,e=e===null?null:e.stateNode,e};var Mz={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_t,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vm.isDisabled&&vm.supportsFiber)try{k0=vm.inject(Mz),ls=vm}catch{}}y1.createRoot=function(e,t){if(!L9(e))throw Error(fe(299));var n=!1,r="",i=dE,s=hE,a=fE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=mA(e,1,!1,null,null,n,r,null,i,s,a,xA),e[Qd]=t.current,r3(e),new c3(t)};y1.hydrateRoot=function(e,t,n){if(!L9(e))throw Error(fe(299));var r=!1,i="",s=dE,a=hE,o=fE,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=mA(e,1,!0,t,n??null,r,i,l,s,a,o,xA),t.context=pA(null),n=t.current,r=us(),r=yw(r),i=Al(r),i.callback=null,Ml(n,i,r),n=r,t.current.lanes=n,S0(t,n),qa(t),e[Qd]=t.current,r3(e),new O1(t)};y1.version="19.2.4";function wA(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wA)}catch(e){console.error(e)}}wA(),M9.exports=y1;var Nz=M9.exports;const Iz=p1(Nz);/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */const Dz="agent";function Rz(e){return e===Dz}var Oz=3e4,jz=new Set(["authorized","expired","error","cancelled"]),Lz=class{constructor(e){this.client=e}async start(e){let t=await this.client.startDeviceFlow(e),n=this.client;return{deviceFlowId:t.deviceFlowId,providerId:t.providerId,userCode:t.userCode,verificationUri:t.verificationUri,verificationUriComplete:t.verificationUriComplete,expiresAt:t.expiresAt,intervalMs:t.intervalMs,attached:t.attached,cancel:()=>n.cancelDeviceFlow(t.deviceFlowId,{clientId:e.clientId}),awaitCompletion:async(r={})=>await Bz(n,t,e.clientId,r)}}status(e,t){return this.client.getDeviceFlow(e,t)}cancel(e,t){return this.client.cancelDeviceFlow(e,t)}};async function Bz(e,t,n,r){return await zz(e,t,n,r)}async function l6(e,t,n,r){try{return await e.getDeviceFlow(t.deviceFlowId,{clientId:n,signal:r})}catch(i){if(i instanceof Od&&i.status===404)return{deviceFlowId:t.deviceFlowId,providerId:t.providerId,status:"error",errorKind:"not_found_or_evicted",hint:"device-flow not found on daemon (evicted past terminal grace, daemon restart, or unknown deviceFlowId)",createdAt:Date.now()};throw i}}function c6(e,t={}){if(e!==void 0&&Number.isFinite(e)&&!(t.allowZero?e<0:e<=0))return e}async function zz(e,t,n,r){var u;let i=r.signal,s=c6(r.timeoutMs,{allowZero:!0}),a=c6(r.pollOverrideMs),o=s!==void 0?Date.now()+s:t.expiresAt+Oz,l=Math.max(1e3,a??t.intervalMs??5e3),c=l;for(;;){if(i!=null&&i.aborted)throw hx(i);if(Date.now()>=o)return await l6(e,t,n,i);let d=await l6(e,t,n,i);if(d.intervalMs&&d.intervalMs!==c&&(c=d.intervalMs,l=d.intervalMs,(u=r.onThrottled)==null||u.call(r,d.intervalMs)),jz.has(d.status))return d;await Pz(l,i)}}async function Pz(e,t){if(t!=null&&t.aborted)throw hx(t);await new Promise((n,r)=>{let i=setTimeout(()=>{a(),n()},e),s=()=>{a(),r(hx(t))};function a(){clearTimeout(i),t==null||t.removeEventListener("abort",s)}t&&t.addEventListener("abort",s,{once:!0})})}function hx(e){let t=e==null?void 0:e.reason;return t instanceof Error?t:typeof t=="string"?new Error(t):new Error("aborted")}var Od=class extends Error{constructor(t,n,r){super(r);ie(this,"status");ie(this,"body");this.name="DaemonHttpError",this.status=t,this.body=n}},u6=class extends Error{constructor(e){super(e??"Transport connection closed"),this.name="DaemonTransportClosedError"}},$z=class extends Error{constructor(e){super(e),this.name="SseFramingError"}},d6=16*1024*1024;async function*Uz(e,t){let n=e.getReader(),r=new TextDecoder,i="",s;t&&(s=()=>{n.cancel().catch(()=>{})},t.aborted?s():t.addEventListener("abort",s,{once:!0}));try{for(;;){if(t!=null&&t.aborted)return;let a,o;try{({value:a,done:o}=await n.read())}catch(c){if(t!=null&&t.aborted)return;throw c}if(o){if(i+=r.decode(),i.length>0){let c=h6(i);for(let u of c.frames){let d=Cb(u);d&&(yield d)}if(c.tail.length>0){let u=Cb(c.tail);u&&(yield u)}}return}if(i+=r.decode(a,{stream:!0}),i.length>d6)throw new $z(`parseSseStream: unread buffer exceeded ${d6} UTF-16 code units without a frame separator — upstream likely not SSE`);let l=h6(i);if(l.frames.length>0)for(let c of l.frames){let u=Cb(c);u&&(yield u)}i=l.tail}}finally{t&&s&&t.removeEventListener("abort",s);try{await n.cancel()}catch{}}}function h6(e){let t=[],n=0;for(;n<e.length;){let r=e.indexOf(`

`,n);if(r===-1){let s=e.indexOf(`\r
\r
`,n);if(s===-1)break;t.push(e.slice(n,s)),n=s+4;continue}let i=e.slice(n,r).indexOf(`\r
\r
`);if(i!==-1){let s=n+i;t.push(e.slice(n,s)),n=s+4}else t.push(e.slice(n,r)),n=r+2}return{frames:t,tail:e.slice(n)}}function Cb(e){if(!e)return;let t=[];for(let r of e.split(/\r?\n/)){if(!r.startsWith("data:"))continue;let i=r.slice(5);t.push(i.startsWith(" ")?i.slice(1):i)}if(t.length===0)return;let n=t.join(`
`);try{let r=JSON.parse(n);if(typeof r!="object"||r===null||Array.isArray(r)||r.v!==1||typeof r.type!="string")return;let i=r.id;return i!==void 0&&(!Number.isSafeInteger(i)||i<1)?void 0:r}catch{return}}var Hz=class{constructor(e,t,n){ie(this,"baseUrl");ie(this,"token");ie(this,"_fetch");ie(this,"_disposed",!1);ie(this,"type","rest");ie(this,"supportsReplay",!0);this.baseUrl=e,this.token=t,this._fetch=n}get connected(){return!this._disposed}async fetch(e,t,n){if(this._disposed)throw new u6;return this._fetch(e,t)}async*subscribeEvents(e,t={}){var u;if(this._disposed)throw new u6;let n={Accept:"text/event-stream"};this.token&&(n.Authorization=`Bearer ${this.token}`),t.lastEventId!==void 0&&(n["Last-Event-ID"]=String(t.lastEventId));let r=new AbortController,i,s=t.connectTimeoutMs;s&&Number.isFinite(s)&&(i=setTimeout(()=>r.abort(new DOMException("Initial connect timed out","TimeoutError")),s),typeof i=="object"&&i&&"unref"in i&&i.unref());let a=t.signal?qz([t.signal,r.signal]):r.signal,o=`${this.baseUrl}/session/${encodeURIComponent(e)}/events`;t.maxQueued!==void 0&&(o+=`?maxQueued=${encodeURIComponent(String(t.maxQueued))}`);let l;try{l=await this._fetch(o,{headers:n,signal:a})}finally{i!==void 0&&clearTimeout(i)}if(!l.ok){let d;try{let m=await l.text();try{d=JSON.parse(m)}catch{d=m}}catch{}let f=d&&typeof d=="object"&&"error"in d?String(d.error):`HTTP ${l.status}`;throw new Od(l.status,d,`GET /session/:id/events: ${f}`)}let c=l.headers.get("content-type")??"";if(!c.toLowerCase().includes("text/event-stream")){try{await((u=l.body)==null?void 0:u.cancel())}catch{}throw new Od(l.status,c,`GET /session/:id/events: expected content-type text/event-stream, got "${c}"`)}if(!l.body)throw new Error("No SSE body");yield*Uz(l.body,t.signal)}dispose(){this._disposed=!0}};function qz(e){let t=AbortSignal.any;if(typeof t=="function")return t.call(AbortSignal,e);let n=new AbortController,r=[],i=()=>{for(;r.length>0;){let s=r.pop();try{s==null||s()}catch{}}};for(let s of e){if(s.aborted)return n.abort(s.reason),i(),n.signal;let a=()=>{n.abort(s.reason),i()};s.addEventListener("abort",a,{once:!0}),r.push(()=>s.removeEventListener("abort",a))}return n.signal.addEventListener("abort",i,{once:!0}),n.signal}var Fz=3e4,Vz=5,Nh=33e4,Gz="X-Qwen-Client-Id";function kA(e){if(e===void 0)return Vz;if(e===null||e===0||e===1/0)return 1/0;if(!Number.isInteger(e)||e<0)throw new TypeError("bad maxPendingPromptsPerSession");return e}function Wz(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===47;)t--;return t===e.length?e:e.slice(0,t)}function Kz(){var e,t;try{let n=(t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.QWEN_SERVER_TOKEN;if(typeof n!="string")return;let r=n.trim();return r.length===0?void 0:r}catch{return}}var f6=class extends Error{constructor(e,t,n){super(`Pending prompts full: "${e}" (${n}/${t})`),this.name="DaemonPendingPromptLimitError",this.sessionId=e,this.limit=t,this.pendingCount=n}};function _A(e){return typeof e=="object"&&e!==null&&e._daemonTurnError===!0}var SA=class{constructor(e){ie(this,"baseUrl");ie(this,"token");ie(this,"_fetch");ie(this,"fetchTimeoutMs");ie(this,"promptLimit");ie(this,"promptCounts",Object.create(null));ie(this,"transport");ie(this,"_authFlow");this.baseUrl=Wz(e.baseUrl),this.token=e.token??Kz(),this._fetch=e.fetch??globalThis.fetch.bind(globalThis);let t=e.fetchTimeoutMs??Fz;this.fetchTimeoutMs=Number.isFinite(t)&&t>0?t:0,this.promptLimit=kA(e.maxPendingPromptsPerSession),this.transport=e.transport??new Hz(this.baseUrl,this.token,this._fetch)}get auth(){return this._authFlow||(this._authFlow=new Lz(this)),this._authFlow}get maxPendingPromptsPerSession(){return this.promptLimit}reservePromptSlot(e,t=this.promptLimit){if(t===1/0)return()=>{};let n=this.promptCounts,r=n[e]??0;if(r>=t)throw new f6(e,t,r);n[e]=r+1;let i;return()=>{i||(i=!0,(n[e]??0)<=1?delete n[e]:--n[e])}}async fetchWithTimeout(e,t={},n,r){let i=this.fetchTimeoutMs;if(r!==void 0&&Number.isFinite(r)&&r>=0&&(i=r),!i||!Number.isFinite(i)){let c=await this.transport.fetch(e,t);return n?n(c):c}let s=new AbortController,a=setTimeout(()=>{s.abort(new DOMException("timeout","TimeoutError"))},i);typeof a=="object"&&a&&"unref"in a&&a.unref();let o=t.signal??void 0,l=o?m6([o,s.signal]):s.signal;try{let c=await this.transport.fetch(e,{...t,signal:l});return n?await n(c):c}finally{clearTimeout(a)}}headers(e={},t){let n={...e};return this.token&&(n.Authorization=`Bearer ${this.token}`),t&&(n[Gz]=t),n}async failOnError(e,t,n){let r;try{let s=await e.text();if(s.length>0)try{r=JSON.parse(s)}catch{r=s}}catch{}let i=r&&typeof r=="object"&&"error"in r?String(r.error):`HTTP ${e.status}`;if(n&&e.status===503&&r&&typeof r=="object"){let s=r;if(s.code==="prompt_queue_full")return new f6(typeof s.sessionId=="string"?s.sessionId:n,typeof s.limit=="number"?s.limit:0,typeof s.pendingCount=="number"?s.pendingCount:0)}return new Od(e.status,r,`${t}: ${i}`)}async jsonRequest(e,t,n={}){let r=n.body!==void 0;return await this.fetchWithTimeout(`${this.baseUrl}${e}`,{...n.method?{method:n.method}:{},headers:this.headers(r?{"Content-Type":"application/json"}:{},n.clientId),...r?{body:JSON.stringify(n.body)}:{}},async i=>{if(!i.ok)throw await this.failOnError(i,t);return await i.json()})}async health(){return await this.fetchWithTimeout(`${this.baseUrl}/health`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /health");return await e.json()})}async capabilities(){return await this.fetchWithTimeout(`${this.baseUrl}/capabilities`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /capabilities");return await e.json()})}async workspaceMcp(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/mcp`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/mcp");return await e.json()})}async workspaceMcpTools(e){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/mcp/${encodeURIComponent(e)}/tools`,{headers:this.headers()},async t=>{if(!t.ok)throw await this.failOnError(t,"GET /workspace/mcp/:server/tools");return await t.json()})}async workspaceSkills(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/skills`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/skills");return await e.json()})}async workspaceProviders(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/providers`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/providers");return await e.json()})}async workspaceHooks(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/hooks`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/hooks");return await e.json()})}async sessionHooks(e){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/hooks`,{headers:this.headers()},async t=>{if(!t.ok)throw await this.failOnError(t,"GET /session/:id/hooks");return await t.json()})}async workspaceExtensions(){return await this.jsonRequest("/workspace/extensions","GET /workspace/extensions")}async installExtension(e,t){return await this.jsonRequest("/workspace/extensions/install","POST /workspace/extensions/install",{method:"POST",body:e,clientId:t})}async checkExtensionUpdates(e){return await this.jsonRequest("/workspace/extensions/check-updates","POST /workspace/extensions/check-updates",{method:"POST",body:{},clientId:e})}async refreshExtensions(e){return await this.jsonRequest("/workspace/extensions/refresh","POST /workspace/extensions/refresh",{method:"POST",body:{},clientId:e})}async enableExtension(e,t,n){return await this.jsonRequest(`/workspace/extensions/${encodeURIComponent(e)}/enable`,"POST /workspace/extensions/:name/enable",{method:"POST",body:t,clientId:n})}async disableExtension(e,t,n){return await this.jsonRequest(`/workspace/extensions/${encodeURIComponent(e)}/disable`,"POST /workspace/extensions/:name/disable",{method:"POST",body:t,clientId:n})}async updateExtension(e,t){return await this.jsonRequest(`/workspace/extensions/${encodeURIComponent(e)}/update`,"POST /workspace/extensions/:name/update",{method:"POST",body:{},clientId:t})}async uninstallExtension(e,t){return await this.jsonRequest(`/workspace/extensions/${encodeURIComponent(e)}`,"DELETE /workspace/extensions/:name",{method:"DELETE",clientId:t})}async readWorkspaceFile(e,t={},n){let r=new URL(`${this.baseUrl}/file`);return r.searchParams.set("path",e),t.maxBytes!==void 0&&r.searchParams.set("maxBytes",String(t.maxBytes)),t.line!==void 0&&r.searchParams.set("line",String(t.line)),t.limit!==void 0&&r.searchParams.set("limit",String(t.limit)),await this.fetchWithTimeout(r.toString(),{headers:this.headers({},n)},async i=>{if(!i.ok)throw await this.failOnError(i,"GET /file");return await i.json()})}async readWorkspaceFileBytes(e,t={},n){let r=new URL(`${this.baseUrl}/file/bytes`);return r.searchParams.set("path",e),t.offset!==void 0&&r.searchParams.set("offset",String(t.offset)),t.maxBytes!==void 0&&r.searchParams.set("maxBytes",String(t.maxBytes)),await this.fetchWithTimeout(r.toString(),{headers:this.headers({},n)},async i=>{if(!i.ok)throw await this.failOnError(i,"GET /file/bytes");return await i.json()})}async fileStat(e){let t=new URL(`${this.baseUrl}/stat`);return t.searchParams.set("path",e),await this.fetchWithTimeout(t.toString(),{headers:this.headers()},async n=>{if(!n.ok)throw await this.failOnError(n,"GET /stat");return await n.json()})}async dirList(e){let t=new URL(`${this.baseUrl}/list`);return t.searchParams.set("path",e),await this.fetchWithTimeout(t.toString(),{headers:this.headers()},async n=>{if(!n.ok)throw await this.failOnError(n,"GET /list");return await n.json()})}async glob(e){let t=new URL(`${this.baseUrl}/glob`);return t.searchParams.set("pattern",e),await this.fetchWithTimeout(t.toString(),{headers:this.headers()},async n=>{if(!n.ok)throw await this.failOnError(n,"GET /glob");return await n.json()})}async writeWorkspaceFile(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/file/write`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:JSON.stringify(e)},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /file/write");return await n.json()})}async editWorkspaceFile(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/file/edit`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:JSON.stringify(e)},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /file/edit");return await n.json()})}async workspaceMemory(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/memory`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/memory");return await e.json()})}async writeWorkspaceMemory(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/memory`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:JSON.stringify(e)},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /workspace/memory");return await n.json()})}async listWorkspaceAgents(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/agents`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/agents");return await e.json()})}async createWorkspaceAgent(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/agents`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:JSON.stringify(e)},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /workspace/agents");return await n.json()})}async generateWorkspaceAgent(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/agents/generate`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:JSON.stringify({description:e})},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /workspace/agents/generate");return await n.json()},Nh)}async getWorkspaceAgent(e){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/agents/${encodeURIComponent(e)}`,{headers:this.headers()},async t=>{if(!t.ok)throw await this.failOnError(t,"GET /workspace/agents/:agentType");return await t.json()})}async updateWorkspaceAgent(e,t,n={},r){let i=n.scope?`${this.baseUrl}/workspace/agents/${encodeURIComponent(e)}?scope=${encodeURIComponent(n.scope)}`:`${this.baseUrl}/workspace/agents/${encodeURIComponent(e)}`;return await this.fetchWithTimeout(i,{method:"POST",headers:this.headers({"Content-Type":"application/json"},r),body:JSON.stringify(t)},async s=>{if(!s.ok)throw await this.failOnError(s,"POST /workspace/agents/:agentType");return await s.json()})}async deleteWorkspaceAgent(e,t={},n){let r=t.scope?`${this.baseUrl}/workspace/agents/${encodeURIComponent(e)}?scope=${encodeURIComponent(t.scope)}`:`${this.baseUrl}/workspace/agents/${encodeURIComponent(e)}`;return await this.fetchWithTimeout(r,{method:"DELETE",headers:this.headers({},n)},async i=>{var s;if(i.status===204){try{await((s=i.body)==null?void 0:s.cancel())}catch{}return}if(i.status===404){let a=await this.failOnError(i,"DELETE /workspace/agents/:agentType"),o=a.body;if(o&&o.code==="agent_not_found")return;throw a}throw await this.failOnError(i,"DELETE /workspace/agents/:agentType")})}async workspaceEnv(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/env`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/env");return await e.json()})}async workspacePreflight(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/preflight`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/preflight");return await e.json()})}async workspaceTools(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/tools`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/tools");return await e.json()})}async createOrAttachSession(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/session`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:JSON.stringify({cwd:e.workspaceCwd,...e.modelServiceId?{modelServiceId:e.modelServiceId}:{},...e.sessionScope!==void 0?{sessionScope:e.sessionScope}:{}})},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /session");return await n.json()})}async listWorkspaceSessions(e){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/${encodeURIComponent(e)}/sessions`,{headers:this.headers()},async t=>{if(!t.ok)throw await this.failOnError(t,"GET /workspace/:id/sessions");return(await t.json()).sessions})}async loadSession(e,t={},n){return this.restoreSession("load",e,t,n)}async resumeSession(e,t={},n){return this.restoreSession("resume",e,t,n)}async branchSession(e,t={},n){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/branch`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n),body:JSON.stringify({name:t.name})},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /session/:id/branch");return await r.json()})}async forkSession(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/fork`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n),body:JSON.stringify({directive:t.directive})},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /session/:id/fork");return await r.json()})}async sessionContext(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/context`,{headers:this.headers({},t)},async n=>{if(!n.ok)throw await this.failOnError(n,"GET /session/:id/context");return await n.json()})}async sessionContextUsage(e,t={},n){let r=new URLSearchParams;t.detail===!0&&r.set("detail","true");let i=r.toString();return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/context-usage${i?`?${i}`:""}`,{headers:this.headers({},n)},async s=>{if(!s.ok)throw await this.failOnError(s,"GET /session/:id/context-usage");return await s.json()})}async sessionSupportedCommands(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/supported-commands`,{headers:this.headers({},t)},async n=>{if(!n.ok)throw await this.failOnError(n,"GET /session/:id/supported-commands");return await n.json()})}async sessionTasks(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/tasks`,{headers:this.headers({},t)},async n=>{if(!n.ok)throw await this.failOnError(n,"GET /session/:id/tasks");return await n.json()})}async sessionTaskCancel(e,t,n,r){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/cancel`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},r),body:JSON.stringify({kind:n})},async i=>{if(!i.ok)throw await this.failOnError(i,"POST /session/:id/tasks/:taskId/cancel");return await i.json()})}async sessionGoalClear(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/goal/clear`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:JSON.stringify({})},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /session/:id/goal/clear");return await n.json()})}async sessionStats(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/stats`,{headers:this.headers({},t)},async n=>{if(!n.ok)throw await this.failOnError(n,"GET /session/:id/stats");return await n.json()})}async restoreSession(e,t,n,r){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(t)}/${e}`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},r),body:JSON.stringify({cwd:n.workspaceCwd})},async i=>{if(!i.ok)throw await this.failOnError(i,`POST /session/:id/${e}`);return await i.json()})}async setSessionApprovalMode(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/approval-mode`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n==null?void 0:n.clientId),body:JSON.stringify({mode:t,...(n==null?void 0:n.persist)===!0?{persist:!0}:{}})},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /session/:id/approval-mode");return await r.json()})}async getRewindSnapshots(e){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/rewind/snapshots`,{method:"GET",headers:this.headers()},async t=>{if(!t.ok)throw await this.failOnError(t,"GET /session/:id/rewind/snapshots");return await t.json()})}async rewindSession(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/rewind`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n==null?void 0:n.clientId),body:JSON.stringify({promptId:t})},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /session/:id/rewind");return await r.json()})}async recapSession(e,t){let n=await this.transport.fetch(`${this.baseUrl}/session/${encodeURIComponent(e)}/recap`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t==null?void 0:t.clientId),body:"{}",signal:t==null?void 0:t.signal});if(!n.ok)throw await this.failOnError(n,"POST /session/:id/recap");return await n.json()}async btwSession(e,t,n){let r=await this.transport.fetch(`${this.baseUrl}/session/${encodeURIComponent(e)}/btw`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n==null?void 0:n.clientId),body:JSON.stringify({question:t}),signal:n==null?void 0:n.signal});if(!r.ok)throw await this.failOnError(r,"POST /session/:id/btw");return await r.json()}async enqueueMidTurnMessage(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/mid-turn-message`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n==null?void 0:n.clientId),body:JSON.stringify({message:t}),signal:n==null?void 0:n.signal},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /session/:id/mid-turn-message");return await r.json()})}async shellCommand(e,t,n){let r=await this.transport.fetch(`${this.baseUrl}/session/${encodeURIComponent(e)}/shell`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n==null?void 0:n.clientId),body:JSON.stringify({command:t}),signal:n==null?void 0:n.signal});if(!r.ok)throw await this.failOnError(r,"POST /session/:id/shell");return await r.json()}async setWorkspaceToolEnabled(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/tools/${encodeURIComponent(e)}/enable`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n==null?void 0:n.clientId),body:JSON.stringify({enabled:t})},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /workspace/tools/:name/enable");return await r.json()})}async workspaceSettings(e){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/settings`,{method:"GET",headers:this.headers({},e==null?void 0:e.clientId)},async t=>{if(!t.ok)throw await this.failOnError(t,"GET /workspace/settings");return await t.json()})}async setWorkspaceSetting(e,t,n,r){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/settings`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},r==null?void 0:r.clientId),body:JSON.stringify({scope:e,key:t,value:n})},async i=>{if(!i.ok)throw await this.failOnError(i,"POST /workspace/settings");return await i.json()})}async restartMcpServer(e,t){let n=(t==null?void 0:t.entryIndex)===void 0?"":`?entryIndex=${encodeURIComponent(String(t.entryIndex))}`;return await this.fetchWithTimeout(`${this.baseUrl}/workspace/mcp/${encodeURIComponent(e)}/restart${n}`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t==null?void 0:t.clientId),body:"{}"},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /workspace/mcp/:server/restart");return await r.json()},(t==null?void 0:t.timeoutMs)??Nh)}async reload(e){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/reload`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},e==null?void 0:e.clientId),body:"{}"},async t=>{if(!t.ok)throw await this.failOnError(t,"POST /workspace/reload");return await t.json()},e==null?void 0:e.timeoutMs)}async manageMcpServer(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/mcp/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n==null?void 0:n.clientId),body:"{}"},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /workspace/mcp/:server/:action");return await r.json()},(n==null?void 0:n.timeoutMs)??Nh)}async addRuntimeMcpServer(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/mcp/servers`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t==null?void 0:t.clientId),body:JSON.stringify(e)},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /workspace/mcp/servers");return await n.json()},(t==null?void 0:t.timeoutMs)??Nh)}async removeRuntimeMcpServer(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/mcp/servers/${encodeURIComponent(e)}`,{method:"DELETE",headers:this.headers({},t==null?void 0:t.clientId)},async n=>{if(!n.ok)throw await this.failOnError(n,"DELETE /workspace/mcp/servers/:name");return await n.json()},(t==null?void 0:t.timeoutMs)??Nh)}async initWorkspace(e){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/init`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},e==null?void 0:e.clientId),body:JSON.stringify((e==null?void 0:e.force)===!0?{force:!0}:{})},async t=>{if(!t.ok)throw await this.failOnError(t,"POST /workspace/init");return await t.json()})}async setSessionModel(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/model`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n),body:JSON.stringify({modelId:t})},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /session/:id/model");return await r.json()})}async setSessionLanguage(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/language`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n==null?void 0:n.clientId),body:JSON.stringify({language:t,syncOutputLanguage:(n==null?void 0:n.syncOutputLanguage)??!1})},async r=>{if(!r.ok)throw await this.failOnError(r,"POST /session/:id/language");return await r.json()})}async prompt(e,t,n,r){n==null||n.throwIfAborted();let i=this.reservePromptSlot(e),s=!0;try{let a=await this.transport.fetch(`${this.baseUrl}/session/${encodeURIComponent(e)}/prompt`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},r),body:JSON.stringify(t),signal:n});if(a.status===202){let o=await a.json();s=!1;try{return await this._awaitTurnComplete(e,o.promptId,o.lastEventId,n,r)}finally{i()}}if(!a.ok)throw await this.failOnError(a,"POST /session/:id/prompt",e);return await a.json()}finally{s&&i()}}async promptNonBlocking(e,t,n,r){let i=await this.transport.fetch(`${this.baseUrl}/session/${encodeURIComponent(e)}/prompt`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},r),body:JSON.stringify(t),signal:n});if(i.status===202)return await i.json();if(!i.ok)throw await this.failOnError(i,"POST /session/:id/prompt",e);return await i.json()}async _awaitTurnComplete(e,t,n,r,i){let s=new AbortController,a=r?m6([r,s.signal]):s.signal;try{let o=this.subscribeEvents(e,{lastEventId:n,signal:a});for await(let l of o){let c=u3(l,t);if(c!==void 0)return c}throw new Error("SSE stream ended")}catch(o){throw r!=null&&r.aborted&&o instanceof DOMException&&o.name==="AbortError"&&this.cancel(e,i).catch(()=>{}),o}finally{s.signal.aborted||s.abort()}}async heartbeat(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/heartbeat`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:"{}"},async n=>{if(!n.ok)throw await this.failOnError(n,"POST /session/:id/heartbeat");return await n.json()})}async cancel(e,t){await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/cancel`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:"{}"},async n=>{var r;if(!n.ok&&n.status!==204)throw await this.failOnError(n,"POST /session/:id/cancel");try{await((r=n.body)==null?void 0:r.cancel())}catch{}})}async*subscribeEvents(e,t={}){yield*this.transport.subscribeEvents(e,{lastEventId:t.lastEventId,maxQueued:t.maxQueued,signal:t.signal,connectTimeoutMs:this.fetchTimeoutMs||void 0})}async respondToPermission(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/permission/${encodeURIComponent(e)}`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},n),body:JSON.stringify(t)},async r=>{var i,s;if(r.status===200){try{await((i=r.body)==null?void 0:i.cancel())}catch{}return!0}if(r.status===404){try{await((s=r.body)==null?void 0:s.cancel())}catch{}return!1}throw await this.failOnError(r,"POST /permission/:requestId")})}async respondToSessionPermission(e,t,n,r){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/permission/${encodeURIComponent(t)}`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},r),body:JSON.stringify(n)},async i=>{var s,a;if(i.status===200){try{await((s=i.body)==null?void 0:s.cancel())}catch{}return!0}if(i.status===404){try{await((a=i.body)==null?void 0:a.cancel())}catch{}return!1}throw await this.failOnError(i,"POST /session/:id/permission/:requestId")})}async closeSession(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}`,{method:"DELETE",headers:this.headers({},t)},async n=>{var r;if(n.status===204||n.status===404){try{await((r=n.body)==null?void 0:r.cancel())}catch{}return}throw await this.failOnError(n,"DELETE /session/:id")})}async deleteSessionsData(e,t){return await this.fetchWithTimeout(`${this.baseUrl}/sessions/delete`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},t),body:JSON.stringify({sessionIds:e})},async n=>{if(n.ok)return await n.json();throw await this.failOnError(n,"POST /sessions/delete")})}async startDeviceFlow(e){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/auth/device-flow`,{method:"POST",headers:this.headers({"Content-Type":"application/json"},e.clientId),body:JSON.stringify({providerId:e.providerId})},async t=>{if(t.status!==200&&t.status!==201)throw await this.failOnError(t,"POST /workspace/auth/device-flow");return await t.json()})}async getDeviceFlow(e,t={}){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/auth/device-flow/${encodeURIComponent(e)}`,{headers:this.headers({},t.clientId),signal:t.signal},async n=>{if(!n.ok)throw await this.failOnError(n,"GET /workspace/auth/device-flow/:id");return await n.json()})}async cancelDeviceFlow(e,t={}){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/auth/device-flow/${encodeURIComponent(e)}`,{method:"DELETE",headers:this.headers({},t.clientId)},async n=>{var r;if(n.status===204||n.status===404){try{await((r=n.body)==null?void 0:r.cancel())}catch{}return}throw await this.failOnError(n,"DELETE /workspace/auth/device-flow/:id")})}async getAuthStatus(e={}){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/auth/status`,{headers:this.headers({},e.clientId)},async t=>{if(!t.ok)throw await this.failOnError(t,"GET /workspace/auth/status");return await t.json()})}async getAuthProviders(){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/auth/providers`,{headers:this.headers()},async e=>{if(!e.ok)throw await this.failOnError(e,"GET /workspace/auth/providers");return await e.json()})}async installAuthProvider(e){return await this.fetchWithTimeout(`${this.baseUrl}/workspace/auth/provider`,{method:"POST",headers:this.headers({"Content-Type":"application/json"}),body:JSON.stringify(e)},async t=>{if(!t.ok)throw await this.failOnError(t,"POST /workspace/auth/provider");return await t.json()})}dispose(){this.transport.dispose()}async updateSessionMetadata(e,t,n){return await this.fetchWithTimeout(`${this.baseUrl}/session/${encodeURIComponent(e)}/metadata`,{method:"PATCH",headers:this.headers({"Content-Type":"application/json"},n),body:JSON.stringify(t)},async r=>{if(r.status===200){let i=await r.json();return typeof i.displayName=="string"?{displayName:i.displayName}:{}}throw await this.failOnError(r,"PATCH /session/:id/metadata")})}};function m6(e){let t=AbortSignal.any;if(typeof t=="function")return t.call(AbortSignal,e);let n=new AbortController,r=[],i=()=>{for(;r.length>0;){let s=r.pop();try{s==null||s()}catch{}}};for(let s of e){if(s.aborted)return n.abort(s.reason),i(),n.signal;let a=()=>{n.abort(s.reason),i()};s.addEventListener("abort",a,{once:!0}),r.push(()=>s.removeEventListener("abort",a))}return n.signal.addEventListener("abort",i,{once:!0}),n.signal}function u3(e,t){if(e.type==="turn_complete"){let n=e.data;if(n.promptId===t)return{stopReason:n.stopReason??"end_turn"}}if(e.type==="turn_error"){let n=e.data;if(n.promptId===t)throw Object.assign(new Od(500,n.code??"turn_error",n.message??"Prompt failed"),{_daemonTurnError:!0})}}function TA(e){return"promptId"in e&&"lastEventId"in e}var xm=class Ep{constructor(t){ie(this,"client");ie(this,"session");ie(this,"state");ie(this,"replaySnapshot");ie(this,"lastSeenEventId");ie(this,"subscriptionActive",!1);ie(this,"promptLimit");ie(this,"_pendingPrompts",new Map);this.client=t.client,this.session={...t.session},this.state={...t.state??{}},this.replaySnapshot=t.replaySnapshot??{compactedReplay:[],liveJournal:[]},this.lastSeenEventId=wm(t.lastEventId),this.promptLimit=t.maxPendingPromptsPerSession===void 0?t.client.maxPendingPromptsPerSession:kA(t.maxPendingPromptsPerSession)}static async createOrAttach(t,n={},r){let i=await t.createOrAttachSession(n,r),s=!i.attached||n.modelServiceId?0:void 0;return new Ep({client:t,session:i,lastEventId:s})}static async load(t,n,r={},i){let{state:s,compactedReplay:a,liveJournal:o,lastEventId:l,...c}=await t.loadSession(n,r,i);return new Ep({client:t,session:c,state:s,lastEventId:l??0,replaySnapshot:{compactedReplay:a??[],liveJournal:o??[]}})}static async resume(t,n,r={},i){let{state:s,lastEventId:a,...o}=await t.resumeSession(n,r,i);return new Ep({client:t,session:o,state:s,lastEventId:a??0})}get sessionId(){return this.session.sessionId}get workspaceCwd(){return this.session.workspaceCwd}get attached(){return this.session.attached}get clientId(){return this.session.clientId}get lastEventId(){return this.lastSeenEventId}setLastEventId(t){this.lastSeenEventId=wm(t)}async prompt(t,n){if(n==null||n.throwIfAborted(),!this.subscriptionActive)return await this.client.prompt(this.sessionId,t,n,this.clientId);let r=this.client.reservePromptSlot(this.sessionId,this.promptLimit),i;try{if(i=await this.client.promptNonBlocking(this.sessionId,t,n,this.clientId),!TA(i))return r(),i;if(!this.subscriptionActive)throw Error("SSE stream ended")}catch(s){throw r(),s}return new Promise((s,a)=>{let o=()=>{let c=this._pendingPrompts.get(i.promptId);c&&this._pendingPrompts.delete(i.promptId)&&(this.client.cancel(this.sessionId,this.clientId).catch(()=>{}),c.reject(n.reason??new DOMException("Aborted","AbortError")))},l=()=>n==null?void 0:n.removeEventListener("abort",o);this._pendingPrompts.set(i.promptId,{resolve:c=>{l(),r(),s(c)},reject:c=>{l(),r(),a(c)}}),n!=null&&n.aborted?o():n==null||n.addEventListener("abort",o,{once:!0})})}async cancel(){await this.client.cancel(this.sessionId,this.clientId)}async heartbeat(){return await this.client.heartbeat(this.sessionId,this.clientId)}async setModel(t){return await this.client.setSessionModel(this.sessionId,t,this.clientId)}async getRewindSnapshots(){return await this.client.getRewindSnapshots(this.sessionId)}async rewind(t){return await this.client.rewindSession(this.sessionId,t,{clientId:this.clientId})}async fork(t){return await this.client.forkSession(this.sessionId,{directive:t},this.clientId)}async recap(t){return await this.client.recapSession(this.sessionId,{...t!=null&&t.signal?{signal:t.signal}:{},...this.clientId?{clientId:this.clientId}:{}})}async btw(t,n){return await this.client.btwSession(this.sessionId,t,{...n!=null&&n.signal?{signal:n.signal}:{},...this.clientId?{clientId:this.clientId}:{}})}async enqueueMidTurnMessage(t,n){return await this.client.enqueueMidTurnMessage(this.sessionId,t,{...n!=null&&n.signal?{signal:n.signal}:{},...this.clientId?{clientId:this.clientId}:{}})}async shellCommand(t,n){return await this.client.shellCommand(this.sessionId,t,{...n?{signal:n}:{},...this.clientId?{clientId:this.clientId}:{}})}async context(){return await this.client.sessionContext(this.sessionId,this.clientId)}async contextUsage(t={}){return await this.client.sessionContextUsage(this.sessionId,t,this.clientId)}async supportedCommands(){return await this.client.sessionSupportedCommands(this.sessionId,this.clientId)}async tasks(){return await this.client.sessionTasks(this.sessionId,this.clientId)}async cancelTask(t,n){return await this.client.sessionTaskCancel(this.sessionId,t,n,this.clientId)}async clearGoal(){return await this.client.sessionGoalClear(this.sessionId,this.clientId)}async stats(){return await this.client.sessionStats(this.sessionId,this.clientId)}async respondToPermission(t,n){return await this.client.respondToPermission(t,n,this.clientId)}async respondToSessionPermission(t,n){return await this.client.respondToSessionPermission(this.sessionId,t,n,this.clientId)}async close(){return await this.client.closeSession(this.sessionId,this.clientId)}async updateMetadata(t){return await this.client.updateSessionMetadata(this.sessionId,t,this.clientId)}events(t={}){return this.openEventSubscription(t)}subscribeEvents(t={}){return this.openEventSubscription(t)}openEventSubscription(t){let n=wm(t.lastEventId),r=!1,i=!1,s=()=>{i||(i=!0,this.subscriptionActive=!1)},a=()=>{if(!r){if(this.subscriptionActive)throw new Error("subscription active");this.subscriptionActive=!0,r=!0}},o=this.iterateEvents({...t,lastEventId:n},s);return{next:async l=>(i||a(),await o.next(l)),return:async()=>{try{return await o.return(void 0)}finally{s()}},throw:async l=>{try{return await o.throw(l)}finally{s()}},[Symbol.asyncIterator](){return this}}}async*iterateEvents(t,n){try{let{resume:r=!0,...i}=t,s=i.lastEventId??(r?this.lastSeenEventId:void 0);for await(let a of this.client.subscribeEvents(this.sessionId,{...i,lastEventId:s}))this._dispatchTurnEvent(a),yield a,a.id!==void 0&&(this.lastSeenEventId=Math.max(this.lastSeenEventId??0,wm(a.id)))}finally{this._rejectAllPending(new Error("SSE stream ended")),n()}}_dispatchTurnEvent(t){var i;if(t.type!=="turn_complete"&&t.type!=="turn_error")return;let n=(i=t.data)==null?void 0:i.promptId;if(!n)return;let r=this._pendingPrompts.get(n);if(r){this._pendingPrompts.delete(n);try{let s=u3(t,n);s!==void 0&&r.resolve(s)}catch(s){r.reject(s)}}}_rejectAllPending(t){for(let[,n]of this._pendingPrompts)n.reject(t);this._pendingPrompts.clear()}};function wm(e){if(e!==void 0){if(!Number.isInteger(e)||e<0)throw new TypeError("invalid lastEventId");return e}}var CA="mid_turn_message_injected",Yz=["session_update","permission_request","permission_resolved","permission_already_resolved","model_switched","model_switch_failed","session_died","session_closed","session_metadata_updated",CA,"client_evicted","slow_client_warning","stream_error","state_resync_required","mcp_budget_warning","mcp_child_refused_batch","memory_changed","agent_changed","auth_device_flow_started","auth_device_flow_throttled","auth_device_flow_authorized","auth_device_flow_failed","auth_device_flow_cancelled","approval_mode_changed","tool_toggled","settings_changed","workspace_initialized","mcp_server_restarted","mcp_server_restart_refused","settings_reloaded","mcp_server_added","mcp_server_removed","extensions_changed","permission_partial_vote","permission_forbidden","prompt_cancelled","replay_complete","followup_suggestion","user_shell_command","user_shell_result","turn_complete","turn_error","session_rewound","session_branched","session_snapshot"];new Set(Yz);var Xz=["missing_binary","blocked_egress","auth_env_error","init_timeout","protocol_error","missing_file","parse_error","budget_exhausted","mcp_budget_would_exceed","mcp_server_spawn_failed","invalid_config","prompt_deadline_exceeded","writer_idle_timeout"],d3=["plan","default","auto-edit","auto","yolo"],fx="daemon-plan";function nt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _e(e,t){if(!nt(e))return;let n=e[t];return typeof n=="string"?n:void 0}function sn(e,t){if(nt(e))for(let n of t){let r=e[n];if(typeof r=="string"&&r.trim().length>0)return r}}function Ul(e){if(e===void 0)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function jo(e){return Ul(wo(e))}function wo(e,t=0){return t>16?"[truncated]":Array.isArray(e)?e.map(n=>wo(n,t+1)):nt(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,EA(n)?"[redacted]":wo(r,t+1)])):e}function EA(e){let t=e.toLowerCase().replace(/[^a-z0-9]/g,"");return t==="authorization"||t==="auth"||t==="cookie"||t==="setcookie"||t==="credential"||t==="credentials"||t==="passphrase"||t==="xauthkey"||t.endsWith("password")||t.endsWith("token")||t.endsWith("secret")||t.endsWith("secretkey")||t.endsWith("accesskey")||t.endsWith("apikey")||t.endsWith("privatekey")||t.includes("accesstoken")||t.includes("refreshtoken")||t.includes("bearertoken")||t.includes("personalaccesstoken")}function Eb(e){if(typeof e=="string")return e;if(!nt(e))return"";let t=e.text;return typeof t=="string"?t:""}function Qz(e){if(typeof e=="string")return{kind:"text",text:e};if(!nt(e))return;let t=e.type;if(t==="text"||t===void 0){let n=e.text;return typeof n=="string"?{kind:"text",text:n}:void 0}if(t==="image"){let n=nt(e.source)?e.source:void 0,r,i;return n&&(r=typeof n.url=="string"?n.url:void 0,i=typeof n.data=="string"?n.data:void 0),!r&&!i&&(i=typeof e.data=="string"?e.data:void 0,r=typeof e.url=="string"?e.url:void 0),!r&&!i?void 0:{kind:"image",mediaType:(typeof e.mediaType=="string"?e.mediaType:void 0)??(typeof e.mimeType=="string"?e.mimeType:void 0)??(typeof e.media_type=="string"?e.media_type:void 0)??(n&&typeof n.mediaType=="string"?n.mediaType:void 0)??"image/*",source:{...r?{url:r}:{},...i?{data:i}:{}}}}if(t==="audio"){let n=nt(e.source)?e.source:void 0;if(!n)return;let r=(typeof e.mediaType=="string"?e.mediaType:void 0)??"audio/*",i=typeof n.url=="string"?n.url:void 0,s=typeof n.data=="string"?n.data:void 0;return!i&&!s?void 0:{kind:"audio",mediaType:r,source:{...i?{url:i}:{},...s?{data:s}:{}}}}if(t==="resource"||t==="resource_link"){let n=typeof e.uri=="string"?e.uri:void 0;if(!n)return;let r=typeof e.mediaType=="string"?e.mediaType:void 0,i=typeof e.description=="string"?e.description:void 0;return{kind:"resource",uri:n,...r?{mediaType:r}:{},...i?{description:i}:{}}}}var Jz=64;function wg(e,t=0){if(t>Jz)return"[output truncated]";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(r=>wg(r,t+1)).filter(Boolean).join(`
`);if(!nt(e))return e===void 0?"":Ul(e);for(let r of["text","output","stdout","stderr","rawOutput"]){let i=e[r];if(typeof i=="string")return i}let n=e.content;if(n!==void 0){let r=wg(n,t+1);if(r)return r}return Ul(e)}var Zz=new Set(Xz),AA=new Set(["qwen","qwen-oauth"]),eP=new Set(["in_flight","disabled","budget_would_exceed"]),p6=4096;function tP(e,t={}){let n=aP(e,t);switch(e.type){case"session_update":return lP(e,n,t);case"shell_output":{let r=wg(e.data),i=px(e.data),s=gx(e.data);return r?[{...n,type:s==="user-shell"?"user.shell.output":"shell.output",text:r,...i?{stream:i}:{}}]:[]}case"permission_request":return pP(e,n);case"permission_resolved":case"permission_already_resolved":return gP(e,n);case"model_switched":return[{...n,type:"model.changed",modelId:_e(e.data,"modelId")??"unknown"}];case"model_switch_failed":return[{...n,type:"error",recoverable:!0,text:_e(e.data,"error")??"Model switch failed (no details available)"}];case"session_died":{let r=y6(_e(e.data,"errorKind"));return[{...n,type:"error",recoverable:!1,...r?{errorKind:r}:{},text:_e(e.data,"reason")??"Session died (no details available)"}]}case"session_closed":return[{...n,type:"status",text:`Session closed: ${_e(e.data,"reason")??"closed"}`}];case"client_evicted":return[{...n,type:"error",recoverable:!0,text:_e(e.data,"reason")??"SSE client evicted (no details available)"}];case"slow_client_warning":return[{...n,type:"status",text:"SSE stream is lagging"}];case"stream_error":{let r=y6(_e(e.data,"errorKind"));return[{...n,type:"error",recoverable:!0,...r?{errorKind:r}:{},text:_e(e.data,"error")??"SSE stream error (no details available)"}]}case"turn_error":{let r=_e(e.data,"code"),i=_e(e.data,"promptId");return[{...n,type:"error",source:"turn_error",recoverable:!0,...r?{code:r}:{},...i?{promptId:i}:{},text:_e(e.data,"message")??"Prompt failed (no details available)"}]}case"state_resync_required":return nP(e,n);case"session_rewound":return rP(e,n);case"session_branched":return iP(e,n);case"prompt_cancelled":{let r=PP(e.data,"reason");return[{...n,type:"prompt.cancelled",...r?{reason:r}:{}}]}case"followup_suggestion":return sP(e,n);case"user_shell_command":{let r=_e(e.data,"command"),i=_e(e.data,"cwd");return r?[{...n,type:"user.shell.command",command:r,...i?{cwd:i}:{}},{...n,type:"user.text.delta",text:`$ ${r}`}]:[]}case"user_shell_result":{let r=Gn(e.data,"exitCode"),i=nt(e.data)&&e.data.aborted===!0?"Shell command was aborted":`Shell command exited with code ${r??"unknown"}`;return[{...n,type:"status",text:i}]}case"replay_complete":{let r=Gn(e.data,"replayedCount")??0,i=Gn(e.data,"lastReplayedEventId")??Gn(e.data,"lastEventId");return[{...n,type:"session.replay_complete",replayedCount:r,...i!==void 0?{lastReplayedEventId:i}:{}}]}case"session_metadata_updated":return wP(e,n);case"approval_mode_changed":return kP(e,n);case"memory_changed":return _P(e,n);case"agent_changed":return SP(e,n);case"tool_toggled":return TP(e,n);case"settings_changed":return CP(e,n);case"workspace_initialized":return EP(e,n);case"mcp_budget_warning":return AP(e,n);case"mcp_child_refused_batch":return MP(e,n);case"mcp_server_restarted":return NP(e,n);case"mcp_server_restart_refused":return IP(e,n);case"extensions_changed":return DP(e,n);case"auth_device_flow_started":return RP(e,n);case"auth_device_flow_throttled":return OP(e,n);case"auth_device_flow_authorized":return jP(e,n);case"auth_device_flow_failed":return LP(e,n);case"auth_device_flow_cancelled":return zP(e,n);default:return[{...n,type:"debug",text:`${e.type} (unrecognized daemon event): ${jo(e.data)}`}]}}function nP(e,t){let n=_e(e.data,"reason"),r=Gn(e.data,"lastDeliveredId"),i=Gn(e.data,"earliestAvailableId");return!n||r===void 0||i===void 0?Jn(e,t,"malformed state_resync_required payload"):[{...t,type:"session.state_resync_required",reason:n,lastDeliveredId:r,earliestAvailableId:i}]}function rP(e,t){let n=_e(e.data,"promptId"),r=Gn(e.data,"targetTurnIndex");if(!n||r===void 0)return Jn(e,t,"malformed session_rewound payload");let i=_e(e.data,"sessionId");return[{...t,type:"session.rewound",promptId:n,targetTurnIndex:r,...i?{sessionId:i}:{}}]}function iP(e,t){let n=_e(e.data,"sourceSessionId"),r=_e(e.data,"newSessionId"),i=_e(e.data,"displayName");return!n||!r||!i?Jn(e,t,"malformed session_branched payload"):[{...t,type:"session.branched",sourceSessionId:n,newSessionId:r,displayName:i}]}function sP(e,t){let n=_e(e.data,"sessionId"),r=_e(e.data,"suggestion"),i=_e(e.data,"promptId");return!n||!r||!i?Jn(e,t,"malformed followup_suggestion payload"):[{...t,type:"followup.suggestion",sessionId:n,suggestion:r,promptId:i}]}function aP(e,t){let n=oP(e);return{...e.id!==void 0?{eventId:e.id}:{},...n!==void 0?{serverTimestamp:n}:{},...e.originatorClientId?{originatorClientId:e.originatorClientId}:{},...t.includeRawEvent?{rawEvent:{...e,data:wo(e.data)}}:{}}}function oP(e){let t=e.serverTimestamp;if(typeof t=="number"&&Number.isFinite(t))return t;let n=e._meta;if(nt(n)){let r=n.serverTimestamp;if(typeof r=="number"&&Number.isFinite(r))return r}if(nt(e.data)){let r=e.data._meta;if(nt(r)){let s=r.serverTimestamp;if(typeof s=="number"&&Number.isFinite(s))return s}let i=e.data.update;if(nt(i)){let s=i._meta;if(nt(s)){let a=s.serverTimestamp;if(typeof a=="number"&&Number.isFinite(a))return a;let o=s.timestamp;if(typeof o=="number"&&Number.isFinite(o))return o}}}}function lP(e,t,n){let r=yP(e.data);if(!r)return[{...t,type:"debug",text:`session_update: ${jo(e.data)}`}];let i=_e(r,"sessionUpdate");switch(i){case"user_message_chunk":{if(n.suppressOwnUserEcho&&n.clientId&&e.originatorClientId===n.clientId)return[];let s=r.content,a=Qz(s);if(a){if(a.kind==="image"){let l=a.source.data,c=a.mediaType||"image/*";if(c==="image/*"&&l){let u=(l.startsWith("data:")?l.split(",")[1]??"":l).slice(0,10);u.startsWith("iVBORw0KGg")?c="image/png":u.startsWith("/9j/")?c="image/jpeg":u.startsWith("R0lGOD")?c="image/gif":u.startsWith("UklGR")&&(c="image/webp")}return l?[{...t,type:"user.image.delta",data:l,mimeType:c}]:[]}return a.kind==="text"?a.text?[{...t,type:"user.text.delta",text:a.text}]:[]:[]}let o=Eb(s);return o?[{...t,type:"user.text.delta",text:o}]:[]}case"agent_message_chunk":{let s=Eb(r.content),a=g6(r),o=[];s&&o.push({...t,type:"assistant.text.delta",text:s,...a?{parentToolCallId:a}:{}});let l=cP(r);return l&&o.push({...t,type:"assistant.usage",usage:l,...a?{parentToolCallId:a}:{}}),o}case"agent_thought_chunk":{let s=Eb(r.content);if(!s)return[];let a=g6(r);return[{...t,type:"thought.text.delta",text:s,...a?{parentToolCallId:a}:{}}]}case"tool_call":case"tool_call_update":return[uP(r,t)];case"shell_output":case"tool_output":{let s=wg(r),a=px(r)??px(e.data),o=gx(r)??gx(e.data);return s?[{...t,type:o==="user-shell"?"user.shell.output":"shell.output",text:s,...a?{stream:a}:{}}]:[]}case"available_commands_update":{let s=(Array.isArray(r.availableCommands)?r.availableCommands:[]).filter(nt);return[{...t,type:"session.available_commands",count:s.length,commands:s}]}case"plan":return[dP(r,t)];case"current_mode_update":return[];default:return[{...t,type:"debug",text:`${i??"session_update"}: ${jo(r)}`}]}}function g6(e){let t=nt(e._meta)?e._meta:void 0;return t?_e(t,"parentToolCallId"):void 0}function cP(e){let t=nt(e._meta)?e._meta:void 0,n=t&&nt(t.usage)?t.usage:void 0;if(!n)return;let r=Gn(n,"inputTokens"),i=Gn(n,"outputTokens");if(r===void 0&&i===void 0)return;let s=Gn(n,"cachedReadTokens");return{inputTokens:r??0,outputTokens:i??0,...s!==void 0?{cachedTokens:s}:{}}}function uP(e,t){let n=nt(e._meta)?e._meta:void 0,r=_e(e,"toolName")??_e(e,"name")??(n?_e(n,"toolName"):void 0)??(n?_e(n,"name"):void 0),i=_e(e,"kind"),s=_e(e,"title")??r??i,a=e.rawInput??e.input??e.args,o=e.rawOutput??e.output??e.result,l=a!==void 0?wo(a):void 0,c=o!==void 0?wo(o):void 0,u=e.content!==void 0?wo(e.content):void 0,d=e.locations!==void 0?wo(e.locations):void 0,f=_e(e,"toolCallId"),m=_e(e,"status");if(!f)return{...t,type:"error",code:"daemon.protocol.tool_update_missing_tool_call_id",recoverable:!0,text:`Tool update missing toolCallId${s?` (${s})`:""}`};let{provenance:p,serverId:b}=mP(e,r),x=_e(e,"parentToolCallId")??(n?_e(n,"parentToolCallId"):void 0),g=x&&x!==f?x:void 0,y=_e(e,"subagentType")??(n?_e(n,"subagentType"):void 0);return{...t,type:"tool.update",toolCallId:f,...m?{status:m}:{},...s?{title:s}:{},...r?{toolName:r}:{},...i?{toolKind:i}:{},...u!==void 0?{content:u}:{},...d!==void 0?{locations:d}:{},...p?{provenance:p}:{},...b?{serverId:b}:{},...g?{parentToolCallId:g}:{},...y?{subagentType:y}:{},...l!==void 0?{rawInput:l}:{},...c!==void 0?{rawOutput:c}:{},...l!==void 0?{details:mx(jo(l))}:c!==void 0?{details:mx(jo(c))}:{}}}function dP(e,t){let n=Array.isArray(e.entries)?e.entries:[],r=mx(hP(n)),i=t.eventId!==void 0?`${fx}-${t.eventId}`:fx,s=nt(e._meta)?e._meta:void 0,a=s&&nt(s.stats)?s.stats:void 0;return{...t,type:"tool.update",toolCallId:i,title:"Updated Plan",status:"completed",toolName:"todo_write",toolKind:"updated_plan",content:[{type:"content",content:{type:"text",text:r}}],rawOutput:a?{entries:n,stats:a}:{entries:n}}}function hP(e){return e.flatMap(t=>{if(!nt(t))return[];let n=_e(t,"content");return n?[`- [${fP(_e(t,"status"))}] ${n}`]:[]}).join(`
`)}function fP(e){switch(e){case"completed":return"x";case"in_progress":return"-";default:return" "}}function mP(e,t){let n=_e(e,"provenance"),r=_e(e,"serverId");if(n==="builtin"||n==="mcp"||n==="subagent")return{provenance:n,...n==="mcp"&&r?{serverId:r}:{}};if(t&&t.startsWith("mcp__")){let i=t.slice(5),s=i.indexOf("__");if(s>0)return{provenance:"mcp",serverId:i.slice(0,s)}}return{}}function y6(e){if(e)return Zz.has(e)?e:void 0}function mx(e){return e.length<=p6?e:`${e.slice(0,p6)}... [truncated]`}function pP(e,t){if(!nt(e.data))return[{...t,type:"debug",text:`permission_request: ${jo(e.data)}`}];let n=_e(e.data,"requestId");if(!n)return[{...t,type:"debug",text:`permission_request: ${jo(e.data)}`}];let r=e.data.toolCall!==void 0?wo(e.data.toolCall):void 0;return[{...t,type:"permission.request",requestId:n,sessionId:_e(e.data,"sessionId"),title:xP(r),options:bP(e.data.options),toolCall:r}]}function gP(e,t){let n=_e(e.data,"requestId");if(!n)return[{...t,type:"debug",text:`${e.type}: ${jo(e.data)}`}];let r=_e(e.data,"voterClientId")??t.originatorClientId;return[{...t,type:"permission.resolved",requestId:n,outcome:vP(e.data),...r?{voterClientId:r}:{}}]}function yP(e){if(!nt(e))return;let t=e.update;return nt(t)?t:e}function bP(e){return Array.isArray(e)?e.flatMap(t=>{if(!nt(t))return[];let n=_e(t,"optionId");return n?[{optionId:n,label:_e(t,"label")??_e(t,"title")??_e(t,"name")??n,..._e(t,"description")?{description:_e(t,"description")}:{},raw:t}]:[]}):[]}function vP(e){if(!nt(e))return Ul(e);let t=e.outcome;if(typeof t=="string")return t;if(nt(t)){let n=_e(t,"outcome")??"selected",r=_e(t,"optionId");return r?`${n}:${r}`:n}return sn(e,["status","reason"])??Ul(e)}function xP(e){return nt(e)?_e(e,"title")??_e(e,"name")??_e(e,"kind")??_e(e,"toolName")??"Tool permission":"Tool permission"}function px(e){let t=_e(e,"stream");return t==="stdout"||t==="stderr"?t:void 0}function gx(e){if(!nt(e))return;let t=_e(e,"source");if(t)return t;let n=e._meta;return nt(n)?_e(n,"source"):void 0}function Jn(e,t,n){return[{...t,type:"debug",text:`${e.type}: ${n}`}]}function wP(e,t){let n=_e(e.data,"sessionId");if(!n)return Jn(e,t,"missing sessionId");let r=_e(e.data,"displayName");return[{...t,type:"session.metadata.changed",sessionId:n,...r!==void 0?{displayName:r}:{}}]}function kP(e,t){let n=_e(e.data,"sessionId"),r=_e(e.data,"previous"),i=_e(e.data,"next");if(!n||!r||!i)return Jn(e,t,"missing sessionId / previous / next");let s=nt(e.data)&&typeof e.data.persisted=="boolean"?e.data.persisted:!1;return[{...t,type:"session.approval_mode.changed",sessionId:n,previous:r,next:i,persisted:s}]}function _P(e,t){let n=_e(e.data,"scope"),r=_e(e.data,"filePath"),i=_e(e.data,"mode"),s=Gn(nt(e.data)?e.data:void 0,"bytesWritten");return n!=="workspace"&&n!=="global"||!r||i!=="append"&&i!=="replace"||s===void 0?Jn(e,t,"malformed memory_changed payload"):[{...t,type:"workspace.memory.changed",scope:n,filePath:r,mode:i,bytesWritten:s}]}function SP(e,t){let n=_e(e.data,"change"),r=_e(e.data,"name"),i=_e(e.data,"level");return n!=="created"&&n!=="updated"&&n!=="deleted"||!r||i!=="project"&&i!=="user"?Jn(e,t,"malformed agent_changed payload"):[{...t,type:"workspace.agent.changed",change:n,name:r,level:i}]}function TP(e,t){let n=_e(e.data,"toolName"),r=nt(e.data)&&typeof e.data.enabled=="boolean"?e.data.enabled:void 0;return!n||r===void 0?Jn(e,t,"malformed tool_toggled payload"):[{...t,type:"workspace.tool.toggled",toolName:n,enabled:r}]}function CP(e,t){let n=_e(e.data,"key"),r=_e(e.data,"scope");return n?[{...t,type:"workspace.settings.changed",key:n,scope:r??"workspace",value:nt(e.data)?e.data.value:void 0}]:Jn(e,t,"malformed settings_changed payload")}function EP(e,t){let n=_e(e.data,"path"),r=_e(e.data,"action");return!n||r!=="created"&&r!=="overwrote"&&r!=="noop"?Jn(e,t,"malformed workspace_initialized payload"):[{...t,type:"workspace.initialized",path:n,action:r}]}function AP(e,t){if(!nt(e.data))return Jn(e,t,"non-object payload");let n=Gn(e.data,"liveCount"),r=Gn(e.data,"reservedCount"),i=Gn(e.data,"budget"),s=Gn(e.data,"thresholdRatio"),a=_e(e.data,"mode");return n===void 0||r===void 0||i===void 0||s===void 0||a!=="warn"&&a!=="enforce"?Jn(e,t,"malformed mcp_budget_warning payload"):[{...t,type:"workspace.mcp.budget_warning",liveCount:n,reservedCount:r,budget:i,thresholdRatio:s,mode:a}]}function MP(e,t){if(!nt(e.data))return Jn(e,t,"non-object payload");let n=Array.isArray(e.data.refusedServers)?e.data.refusedServers.filter(nt).map(a=>{let o=_e(a,"name"),l=_e(a,"transport"),c=_e(a,"reason");return!o||!l||c!=="budget_exhausted"?null:{name:o,transport:l,reason:"budget_exhausted"}}).filter(a=>a!==null):[],r=Gn(e.data,"budget"),i=Gn(e.data,"liveCount"),s=Gn(e.data,"reservedCount");return n.length===0||r===void 0||i===void 0||s===void 0?Jn(e,t,"malformed mcp_child_refused_batch payload"):[{...t,type:"workspace.mcp.child_refused",refusedServers:n,budget:r,liveCount:i,reservedCount:s}]}function NP(e,t){let n=_e(e.data,"serverName"),r=Gn(e.data,"durationMs");return!n||r===void 0?Jn(e,t,"malformed mcp_server_restarted payload"):[{...t,type:"workspace.mcp.server_restarted",serverName:n,durationMs:r}]}function IP(e,t){let n=_e(e.data,"serverName"),r=_e(e.data,"reason");return!n||!r||!eP.has(r)?Jn(e,t,"malformed mcp_server_restart_refused payload"):[{...t,type:"workspace.mcp.server_restart_refused",serverName:n,reason:r}]}function DP(e,t){let n=Gn(e.data,"refreshed"),r=Gn(e.data,"failed"),i=_e(e.data,"status"),s=_e(e.data,"source"),a=_e(e.data,"name"),o=_e(e.data,"version"),l=_e(e.data,"error");return n===void 0||r===void 0||i!==void 0&&i!=="installed"&&i!=="enabled"&&i!=="disabled"&&i!=="updated"&&i!=="uninstalled"&&i!=="failed"?Jn(e,t,"malformed extensions_changed payload"):[{...t,type:"workspace.extensions.changed",refreshed:n,failed:r,...i?{status:i}:{},...s?{source:s}:{},...a?{name:a}:{},...o?{version:o}:{},...l?{error:l}:{}}]}function RP(e,t){let n=_e(e.data,"deviceFlowId"),r=_e(e.data,"providerId"),i=Gn(e.data,"expiresAt");return!n||!r||!AA.has(r)||i===void 0?Jn(e,t,"malformed auth_device_flow_started payload"):[{...t,type:"auth.device_flow.started",deviceFlowId:n,providerId:r,expiresAt:i}]}function OP(e,t){let n=_e(e.data,"deviceFlowId"),r=Gn(e.data,"intervalMs");return!n||r===void 0?Jn(e,t,"malformed auth_device_flow_throttled payload"):[{...t,type:"auth.device_flow.throttled",deviceFlowId:n,intervalMs:r}]}function jP(e,t){let n=_e(e.data,"deviceFlowId"),r=_e(e.data,"providerId");if(!n||!r||!AA.has(r))return Jn(e,t,"malformed auth_device_flow_authorized payload");let i=Gn(e.data,"expiresAt"),s=_e(e.data,"accountAlias");return[{...t,type:"auth.device_flow.authorized",deviceFlowId:n,providerId:r,...i!==void 0?{expiresAt:i}:{},...s?{accountAlias:s}:{}}]}function LP(e,t){let n=_e(e.data,"deviceFlowId"),r=_e(e.data,"errorKind");if(!n||!BP(r))return Jn(e,t,"malformed auth_device_flow_failed payload");let i=_e(e.data,"hint");return[{...t,type:"auth.device_flow.failed",deviceFlowId:n,errorKind:r,...i?{hint:i}:{}}]}function BP(e){return typeof e=="string"&&e.trim().length>0}function zP(e,t){let n=_e(e.data,"deviceFlowId");return n?[{...t,type:"auth.device_flow.cancelled",deviceFlowId:n}]:Jn(e,t,"malformed auth_device_flow_cancelled payload")}function Gn(e,t){if(!nt(e))return;let n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function PP(e,t){if(!nt(e))return;let n=e[t];return typeof n=="string"&&n.length>0?n:void 0}var $P=8;function kg(e,t={},n=0){if(n>$P){let p=t.title??t.toolName??t.toolKind;return{kind:"generic",...p?{summary:p}:{}}}if(nt(e)){let p=e.rawInput??e.input??e.args;if(p!==void 0&&p!==e){let b=kg(p,{title:t.title??sn(e,["title"]),toolName:t.toolName??sn(e,["toolName","name"]),toolKind:t.toolKind??sn(e,["kind"])},n+1);if(b.kind!=="generic"||!b.summary)return b}}let r=VP(e);if(r.length>0)return{kind:"ask_user_question",questions:r};let i=FP(e,t);if(i)return i;let s=YP(e,t);if(s)return s;let a=XP(e,t);if(a)return a;let o=QP(e,t);if(o)return o;let l=UP(e,t);if(l)return l;let c=HP(e,t);if(c)return c;let u=qP(e);if(u)return u;let d=JP(e,t);if(d)return d;let f=ZP(e);if(f)return f;if(nt(e)){let p=sn(e,["command","cmd"]);if(p){let x=sn(e,["cwd","directory","workingDirectory"]);return{kind:"command",command:p,...x?{cwd:x}:{}}}let b=WP(e);if(b.length>0)return{kind:"key_value",rows:b}}let m=t.title??t.toolName??t.toolKind;return{kind:"generic",...m?{summary:m}:{}}}function UP(e,t={}){if(!nt(e))return;let n=sn(e,["path","filePath","file_path","absolutePath"]);if(!n)return;let r=sn(e,["oldText","old_text","old_str","oldString"]),i=sn(e,["newText","new_text","new_str","newString"]),s=(t.toolName??"").toLowerCase(),a=/(?:^|[_-])(write|create|edit|replace|save|update|overwrite|modify|patch|generate)(?:$|[_-])/.test(s)||!!r,o=i===void 0&&a?sn(e,["content"]):void 0,l=i??o,c=sn(e,["patch","diff","unified_diff"]);if(!(!r&&!l&&!c))return{kind:"file_diff",path:n,...r?{oldText:r}:{},...l?{newText:l}:{},...c?{patch:c}:{}}}function HP(e,t){if(!nt(e))return;let n=sn(e,["path","filePath","file_path","absolutePath"]);if(!n)return;let r=t.toolName??sn(e,["toolName","name"]),i=r!==void 0&&/read|view|cat/i.test(r),s=e.lineRange??e.line_range??e.range,a;if(Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number")a=[s[0],s[1]];else{let o=e.offset,l=e.limit;typeof o=="number"&&typeof l=="number"&&l>0&&(a=[o+1,o+l])}if(!(!i&&!a))return{kind:"file_read",path:n,...a?{range:a}:{}}}function qP(e){if(!nt(e))return;let t=sn(e,["url","uri","href"]);if(!t||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t))return;let n=sn(e,["method","httpMethod"]);return{kind:"web_fetch",url:t,...n?{method:n}:{}}}function FP(e,t){let n=t.toolName??(nt(e)?sn(e,["toolName","name"]):void 0);if(!n||!n.startsWith("mcp__"))return;let r=n.slice(5),i=r.indexOf("__");if(i<=0)return;let s=r.slice(0,i),a=r.slice(i+2),o;if(nt(e)){let l=e.arguments??e.args??e;if(nt(l)){let c=Object.entries(l).filter(([u])=>u!=="name"&&u!=="toolName").slice(0,1).map(([u,d])=>{let f=typeof d=="string"?d:JSON.stringify(d),m=f.length>60?`${f.slice(0,60)}…`:f;return`${u}=${m}`})[0];c&&(o=c)}}return{kind:"mcp_invocation",serverId:s,toolName:a,...o?{argsSummary:o}:{}}}function VP(e){return!nt(e)||!Array.isArray(e.questions)?[]:e.questions.filter(nt).map(t=>{let n=sn(t,["header","title","label"]),r=sn(t,["question","prompt","text"])??"Question",i=Array.isArray(t.options)?t.options.filter(nt).map(GP):[];return{...n?{header:n}:{},question:r,options:i,raw:t}})}function GP(e){let t=sn(e,["label","title","value"])??"Option",n=sn(e,["description","detail","text"]);return{label:t,...n?{description:n}:{},raw:e}}function WP(e){let t=[],n=[["Path",["path","filePath","file_path","absolutePath"]],["Cwd",["cwd","directory","workingDirectory"]],["Query",["query","pattern","search"]],["Note",["description","reason"]]];for(let[r,i]of n){let s=sn(e,i);s&&t.push({label:r,value:s})}if(t.length>0)return t;for(let[r,i]of Object.entries(e).slice(0,4))i==null||Array.isArray(i)||nt(i)||t.push({label:r,value:EA(r)?"[redacted]":jo(i)});return t}var b6=50,KP=5;function YP(e,t){let n=t.toolName??"";if(!(/^task$/i.test(n)||/(?:^|_)(?:delegate|subagent|spawn[_-]?task)$/i.test(n)||/agent/i.test(t.toolKind??""))||!nt(e))return;let r=sn(e,["subagent_type","agent","agentName","agent_name","subagent"]),i=sn(e,["prompt","task","description","instruction","query"]);if(!r&&!i)return;let s=sn(e,["parentDelegationId","parent_delegation_id","parent_id"]);return{kind:"subagent_delegation",agentName:r??"subagent",task:i??"(no task description)",...s?{parentDelegationId:s}:{}}}function XP(e,t){if(!nt(e))return;let n=sn(e,["query","pattern","search","q"]);if(!n)return;let r=t.toolName??"";if(!(/(grep|search|find|ripgrep|rg|glob|lookup)/i.test(r)||typeof e.resultCount=="number"||Array.isArray(e.results)||Array.isArray(e.matches)))return;let i=typeof e.resultCount=="number"?e.resultCount:typeof e.total=="number"?e.total:Array.isArray(e.results)?e.results.length:Array.isArray(e.matches)?e.matches.length:void 0,s,a=e.results??e.matches;return Array.isArray(a)&&(s=a.slice(0,KP).map(o=>typeof o=="string"?o:nt(o)?sn(o,["path","file","name","title","text"])??Ul(o).slice(0,120):String(o)).filter(Boolean),s.length===0&&(s=void 0)),{kind:"search",query:n,...i!==void 0?{resultCount:i}:{},...s?{top:s}:{}}}function QP(e,t){let n=t.toolName??"";if(!/(image[_-]?gen|generate[_-]?image|diffusion|dalle|imagen|flux|stable[_-]?diffusion|midjourney|sora)/i.test(n)||!nt(e))return;let r=sn(e,["prompt","description","query"]);if(!r)return;let i=sn(e,["thumbnailUrl","thumbnail","url","imageUrl","preview"]),s=sn(e,["model","modelId","model_name"]);return{kind:"image_generation",prompt:r,...i?{thumbnailUrl:i}:{},...s?{model:s}:{}}}function JP(e,t){if(!nt(e))return;let n=sn(e,["code","snippet","source"]);if(!n)return;let r=sn(e,["language","lang","codeLanguage","syntax"]),i=t.toolName??"",s=/(repl|format|prettier|eslint|tsc|compile|exec[_-]?code)/i.test(i);if(!r&&!s)return;let a=sn(e,["origin","source_location","path"]);return{kind:"code_block",code:n,...r?{language:r}:{},...a?{origin:a}:{}}}function ZP(e){if(!nt(e))return;let t=e.columns,n=e.rows;if(Array.isArray(t)&&Array.isArray(n)){let i=t.filter(a=>typeof a=="string").slice(0,30);if(i.length===0)return;let s=n.slice(0,b6).map(a=>Array.isArray(a)?a.map(o=>typeof o=="string"?o:Ul(o).slice(0,80)):[]);return{kind:"tabular",columns:i,rows:s,...n.length>s.length?{totalRows:n.length}:{}}}let r=e.data??e.records;if(Array.isArray(r)&&r.length>0&&nt(r[0])){let i=Object.keys(r[0]).slice(0,30);if(i.length===0)return;let s=r.slice(0,b6).map(a=>{let o=a;return i.map(l=>{let c=o[l];return typeof c=="string"?c:Ul(c).slice(0,80)})});return{kind:"tabular",columns:i,rows:s,...r.length>s.length?{totalRows:r.length}:{}}}}var e$=1e3,Hc="__trimmed_tool_block__",j1="__trimmed_permission_block__",yx=1e5,v6=`
[truncated]
`,t$=16;function n$(e={}){return{blocks:[],blockIndexById:{},toolBlockByCallId:{},trimmedToolNotificationByCallId:{},permissionBlockByRequestId:{},activeAssistantBlockByParent:{},activeThoughtBlockByParent:{},toolProgress:{},awaitingResync:!1,resyncRequiredCount:0,nextOrdinal:1,now:e.now??Date.now(),maxBlocks:e.maxBlocks??e$}}var h3=new Set(["pending","confirming","running","in_progress"]),r$=new Set(["completed","success","failed","error","canceled","cancelled"]),i$=new Set(["session.state_resync_required","assistant.done","status","debug","error"]);function s$(e,t,n={}){let r=DA(e,n);g3(r);let i=y3(r,"user",t);return n.images&&n.images.length>0&&(i.images=[...n.images]),Fa(r,i),r.activeUserBlockId=i.id,RA(r)}function a$(e,t,n={}){if(t.length===0)return e;let r=DA(e,n);for(let s of t)o$(r,s);let i=RA(r);return Object.freeze(i.blocks),i}function f3(e){let t={};return e.forEach((n,r)=>{t[n.id]=r}),t}function o$(e,t){var n;if(t.eventId!==void 0&&(e.lastEventId=Math.max(e.lastEventId??0,t.eventId)),e.awaitingResync&&!i$.has(t.type)){typeof console<"u"&&((n=console.warn)==null||n.call(console,`[daemon-ui] dropping event \`${t.type}\` while awaitingResync; state may be stale until session reconnect (lastResyncRequired: ${e.lastResyncRequired?JSON.stringify(e.lastResyncRequired):"unknown"})`));return}switch(t.type){case"user.shell.command":e.pendingUserShellCommand={command:t.command,...t.cwd?{cwd:t.cwd}:{}};break;case"user.text.delta":e.activeUserBlockId||(e.lastFollowupSuggestion=void 0),Ab(e,"user","activeUserBlockId",t.text,t);break;case"user.image.delta":{if(e.activeUserBlockId){let r=Fs(e,e.activeUserBlockId);r&&r.kind==="user"&&(r.images=[...r.images??[],{data:t.data,mimeType:t.mimeType}])}else{let r=y3(e,"user","");r.images=[{data:t.data,mimeType:t.mimeType}],Fa(e,r),e.activeUserBlockId=r.id}break}case"assistant.text.delta":Ab(e,"assistant","activeAssistantBlockId",t.text,t);break;case"assistant.done":g3(e),(t.reason==="cancelled"||t.reason==="error")&&bx(e);break;case"assistant.usage":u$(e,t);break;case"thought.text.delta":Ab(e,"thought","activeThoughtBlockId",t.text,t);break;case"tool.update":IA(e,t);break;case"shell.output":h$(e,t);break;case"user.shell.output":f$(e,t);break;case"permission.request":m$(e,t);break;case"permission.resolved":p$(e,t);break;case"model.changed":kf(e,"status",`Model switched: ${t.modelId}`,t);break;case"status":case"debug":case"error":kf(e,t.type,t.text,t);break;case"session.approval_mode.changed":e.approvalMode=t.next;break;case"session.metadata.changed":case"session.available_commands":break;case"session.state_resync_required":l$(e,t);break;case"prompt.cancelled":bx(e),t.reason!=="forward_failed"&&g$(e,t);break;case"followup.suggestion":e.lastFollowupSuggestion={suggestion:t.suggestion,promptId:t.promptId};break;case"session.replay_complete":break;case"session.rewound":b$(e,t.targetTurnIndex);break;case"session.branched":kf(e,"status",`Branched conversation "${t.displayName}". You are now in the branch.`,t);break}}function l$(e,t){e.awaitingResync=!0,e.resyncRequiredCount+=1,e.lastResyncRequired={reason:t.reason,lastDeliveredId:t.lastDeliveredId,earliestAvailableId:t.earliestAvailableId},bx(e),kf(e,"error",`State resync required: ${c$(t.lastDeliveredId,t.earliestAvailableId)}.`,t)}function c$(e,t){let n=e+1,r=t-1;return r<n?"no events lost (resync requested without gap)":r===n?`missed 1 daemon event (id ${n})`:`missed daemon events ${n}-${r}`}function L1(e,t){let n=Fs(e,t);((n==null?void 0:n.kind)==="assistant"||(n==null?void 0:n.kind)==="thought")&&(n.streaming=!1,n.updatedAt=e.now)}function MA(e){L1(e,e.activeAssistantBlockId),e.activeAssistantBlockId=void 0}function u$(e,t){let n=Fs(e,e.activeAssistantBlockId);if(!n||n.kind!=="assistant")return;let r=n.usage;n.usage={inputTokens:((r==null?void 0:r.inputTokens)??0)+t.usage.inputTokens,outputTokens:((r==null?void 0:r.outputTokens)??0)+t.usage.outputTokens,cachedTokens:((r==null?void 0:r.cachedTokens)??0)+(t.usage.cachedTokens??0)},n.updatedAt=e.now}function NA(e){L1(e,e.activeThoughtBlockId),e.activeThoughtBlockId=void 0}function m3(e,t){L1(e,e.activeAssistantBlockByParent[t]),delete e.activeAssistantBlockByParent[t]}function p3(e,t){L1(e,e.activeThoughtBlockByParent[t]),delete e.activeThoughtBlockByParent[t]}function Ab(e,t,n,r,i){let s=t!=="user"&&"parentToolCallId"in i?i.parentToolCallId:void 0,a=s!=null?t==="assistant"?e.activeAssistantBlockByParent:t==="thought"?e.activeThoughtBlockByParent:void 0:void 0,o=a&&s!=null?a[s]:e[n],l=Fs(e,o);if(l&&l.kind===t){l.text=v3(l.text,r),l.updatedAt=e.now,i.eventId!==void 0&&(l.eventId=i.eventId),i.serverTimestamp!==void 0&&(l.serverTimestamp=i.serverTimestamp),(t==="assistant"||t==="thought")&&(l.streaming=!0);return}let c=y3(e,t,r,i.eventId,i.serverTimestamp);(t==="assistant"||t==="thought")&&(c.streaming=!0),t==="thought"&&(c.collapsed=!0),s!=null&&(c.parentToolCallId=s),Fa(e,c),a&&s!=null?a[s]=c.id:e[n]=c.id,s!=null?(t==="assistant"&&p3(e,s),t==="thought"&&m3(e,s)):(t!=="user"&&(e.activeUserBlockId=void 0),t!=="assistant"&&MA(e),t!=="thought"&&NA(e))}function g3(e){MA(e);for(let t of Object.keys(e.activeAssistantBlockByParent))m3(e,t);for(let t of Object.keys(e.activeThoughtBlockByParent))p3(e,t);NA(e)}function IA(e,t){let n=e.toolBlockByCallId[t.toolCallId];if(n===Hc){if(y$(t))return delete e.toolBlockByCallId[t.toolCallId],delete e.trimmedToolNotificationByCallId[t.toolCallId],IA(e,t);e.trimmedToolNotificationByCallId[t.toolCallId]||(e.trimmedToolNotificationByCallId[t.toolCallId]=!0,kf(e,"error",`Tool ${t.toolCallId} output trimmed (max blocks reached)`,t,{clearActiveText:!1}));return}let r=Fs(e,n);if((r==null?void 0:r.kind)==="tool"){if(t.title!==void 0&&(r.title=t.title),t.status!==void 0&&(r.status=t.status),t.rawInput!==void 0&&(r.preview=kg(t.rawInput,{title:t.title,toolName:t.toolName,toolKind:t.toolKind})),r.updatedAt=e.now,t.eventId!==void 0&&(r.eventId=t.eventId),t.details&&(r.details=t.details),t.content!==void 0&&(r.content=t.content),t.locations!==void 0&&(r.locations=t.locations),t.rawInput!==void 0&&(r.rawInput=t.rawInput),t.rawOutput!==void 0&&(r.rawOutput=t.rawOutput),t.toolName&&(r.toolName=t.toolName),t.toolKind&&(r.toolKind=t.toolKind),t.parentToolCallId&&!r.parentToolCallId&&(r.parentToolCallId=t.parentToolCallId),r.parentToolCallId&&!r.parentBlockId){let a=e.toolBlockByCallId[r.parentToolCallId];a&&a!==Hc&&(r.parentBlockId=a)}t.subagentType&&!r.subagentType&&(r.subagentType=t.subagentType),x6(e,t.toolCallId,t.status);return}let i=t.parentToolCallId&&e.toolBlockByCallId[t.parentToolCallId]!==Hc?e.toolBlockByCallId[t.parentToolCallId]:void 0,s={id:ec(e,"tool"),kind:"tool",toolCallId:t.toolCallId,title:t.title??t.toolName??t.toolKind??"Tool",status:t.status??"pending",preview:kg(t.rawInput,{title:t.title,toolName:t.toolName,toolKind:t.toolKind}),clientReceivedAt:e.now,createdAt:e.now,updatedAt:e.now,...t.eventId!==void 0?{eventId:t.eventId}:{},...t.serverTimestamp!==void 0?{serverTimestamp:t.serverTimestamp}:{},...t.details?{details:t.details}:{},...t.content!==void 0?{content:t.content}:{},...t.locations!==void 0?{locations:t.locations}:{},...t.rawInput!==void 0?{rawInput:t.rawInput}:{},...t.rawOutput!==void 0?{rawOutput:t.rawOutput}:{},...t.toolName?{toolName:t.toolName}:{},...t.toolKind?{toolKind:t.toolKind}:{},...t.parentToolCallId?{parentToolCallId:t.parentToolCallId}:{},...t.subagentType?{subagentType:t.subagentType}:{},...i?{parentBlockId:i}:{}};Fa(e,s),e.toolBlockByCallId[t.toolCallId]=s.id;for(let a of e.blocks)if(a.kind==="tool"&&a.parentToolCallId===t.toolCallId&&!a.parentBlockId){let o=Fs(e,a.id);(o==null?void 0:o.kind)==="tool"&&(o.parentBlockId=s.id)}x6(e,t.toolCallId,t.status??"pending"),cu(e,t.parentToolCallId)}function x6(e,t,n){if(n!==void 0){if(h3.has(n)){e.currentToolCallId=t;return}if(r$.has(n)){e.currentToolCallId===t&&(e.currentToolCallId=d$(e));return}}}function d$(e){for(let t=e.blocks.length-1;t>=0;t-=1){let n=e.blocks[t];if((n==null?void 0:n.kind)==="tool"&&h3.has(n.status))return n.toolCallId}}function bx(e){for(let t of Object.values(e.toolBlockByCallId)){if(t===Hc)continue;let n=Fs(e,t);!n||n.kind!=="tool"||h3.has(n.status)&&(n.status="cancelled",n.updatedAt=e.now)}e.currentToolCallId=void 0}function h$(e,t){if(!t.text)return;let n=e.blocks[e.blocks.length-1];if((n==null?void 0:n.kind)==="shell"&&n.stream===t.stream){let i=Fs(e,n.id);(i==null?void 0:i.kind)==="shell"&&(i.text=v3(i.text,t.text),i.updatedAt=e.now,t.eventId!==void 0&&(i.eventId=t.eventId));return}let r={id:ec(e,"shell"),kind:"shell",text:R0(t.text),clientReceivedAt:e.now,createdAt:e.now,updatedAt:e.now,...t.eventId!==void 0?{eventId:t.eventId}:{},...t.serverTimestamp!==void 0?{serverTimestamp:t.serverTimestamp}:{},...t.stream?{stream:t.stream}:{}};Fa(e,r),cu(e)}function f$(e,t){if(!t.text)return;let n=e.blocks[e.blocks.length-1];if((n==null?void 0:n.kind)==="user_shell"&&n.stream===t.stream&&!e.pendingUserShellCommand){let a=Fs(e,n.id);(a==null?void 0:a.kind)==="user_shell"&&(a.text=v3(a.text,t.text),a.updatedAt=e.now,t.eventId!==void 0&&(a.eventId=t.eventId));return}let r=e.pendingUserShellCommand,i=(n==null?void 0:n.kind)==="user_shell"?n:void 0,s={id:ec(e,"user-shell"),kind:"user_shell",text:R0(t.text),command:(r==null?void 0:r.command)??(i==null?void 0:i.command)??"",...r!=null&&r.cwd||i!=null&&i.cwd?{cwd:(r==null?void 0:r.cwd)??(i==null?void 0:i.cwd)}:{},clientReceivedAt:e.now,createdAt:e.now,updatedAt:e.now,...t.eventId!==void 0?{eventId:t.eventId}:{},...t.serverTimestamp!==void 0?{serverTimestamp:t.serverTimestamp}:{},...t.stream?{stream:t.stream}:{}};e.pendingUserShellCommand=void 0,Fa(e,s),cu(e)}function m$(e,t){let n=e.permissionBlockByRequestId[t.requestId];if(n===j1)return;let r=Fs(e,n),i=kg(t.toolCall,{title:t.title});if((r==null?void 0:r.kind)==="permission"){r.title=t.title,r.options=t.options.map(a=>({...a})),r.toolCall=t.toolCall,r.preview=i,r.updatedAt=e.now,t.eventId!==void 0&&(r.eventId=t.eventId);return}let s={id:ec(e,"permission"),kind:"permission",requestId:t.requestId,title:t.title,options:t.options.map(a=>({...a})),preview:i,clientReceivedAt:e.now,createdAt:e.now,updatedAt:e.now,...t.eventId!==void 0?{eventId:t.eventId}:{},...t.serverTimestamp!==void 0?{serverTimestamp:t.serverTimestamp}:{},...t.sessionId?{sessionId:t.sessionId}:{},...t.toolCall!==void 0?{toolCall:t.toolCall}:{}};Fa(e,s),e.permissionBlockByRequestId[t.requestId]=s.id,cu(e)}function p$(e,t){let n=e.permissionBlockByRequestId[t.requestId];if(n===void 0||n===j1)return;let r=Fs(e,n);if((r==null?void 0:r.kind)==="permission"){r.resolved=t.outcome,r.updatedAt=e.now,t.eventId!==void 0&&(r.eventId=t.eventId);return}let i={id:ec(e,"permission"),kind:"permission",requestId:t.requestId,title:`Permission resolved: ${t.requestId}`,options:[],preview:{kind:"generic",summary:t.outcome},resolved:t.outcome,clientReceivedAt:e.now,createdAt:e.now,updatedAt:e.now,...t.eventId!==void 0?{eventId:t.eventId}:{},...t.serverTimestamp!==void 0?{serverTimestamp:t.serverTimestamp}:{}};Fa(e,i),e.permissionBlockByRequestId[t.requestId]=i.id,cu(e)}function kf(e,t,n,r,i={}){let s={id:ec(e,t),kind:t,text:R0(n),clientReceivedAt:e.now,createdAt:e.now,updatedAt:e.now,...(r==null?void 0:r.eventId)!==void 0?{eventId:r.eventId}:{},...(r==null?void 0:r.serverTimestamp)!==void 0?{serverTimestamp:r.serverTimestamp}:{},...(r==null?void 0:r.type)==="error"&&r.code?{code:r.code}:{},...(r==null?void 0:r.type)==="error"&&r.promptId?{promptId:r.promptId}:{},...(r==null?void 0:r.type)==="error"&&r.source?{source:r.source}:{},...((r==null?void 0:r.type)==="status"||(r==null?void 0:r.type)==="debug")&&r.source?{source:r.source}:{},...((r==null?void 0:r.type)==="status"||(r==null?void 0:r.type)==="debug")&&r.data!==void 0?{data:r.data}:{},...(r==null?void 0:r.type)==="session.branched"?{source:"session_branched",data:{sourceSessionId:r.sourceSessionId,newSessionId:r.newSessionId,displayName:r.displayName}}:{}};Fa(e,s),i.clearActiveText!==!1&&cu(e)}function g$(e,t){let n={id:ec(e,"prompt_cancelled"),kind:"prompt_cancelled",clientReceivedAt:e.now,createdAt:e.now,updatedAt:e.now,...t.reason?{reason:t.reason}:{},...t.eventId!==void 0?{eventId:t.eventId}:{},...t.serverTimestamp!==void 0?{serverTimestamp:t.serverTimestamp}:{}};Fa(e,n),cu(e)}function y3(e,t,n,r,i){return{id:ec(e,t),kind:t,text:R0(n),clientReceivedAt:e.now,createdAt:e.now,updatedAt:e.now,...r!==void 0?{eventId:r}:{},...i!==void 0?{serverTimestamp:i}:{}}}function DA(e,t){return{...e,now:t.now??Date.now(),maxBlocks:t.maxBlocks??e.maxBlocks,blocks:e.blocks,blockIndexById:e.blockIndexById,toolBlockByCallId:{...e.toolBlockByCallId},activeAssistantBlockByParent:{...e.activeAssistantBlockByParent},activeThoughtBlockByParent:{...e.activeThoughtBlockByParent},trimmedToolNotificationByCallId:{...e.trimmedToolNotificationByCallId},permissionBlockByRequestId:{...e.permissionBlockByRequestId},toolProgress:Object.fromEntries(Object.entries(e.toolProgress).map(([n,r])=>[n,{...r}])),lastResyncRequired:e.lastResyncRequired!==void 0?{...e.lastResyncRequired}:void 0,lastFollowupSuggestion:e.lastFollowupSuggestion}}function RA(e){if(e.blocks.length<=e.maxBlocks)return e;let t=e.blocks.slice(-e.maxBlocks),n=new Set(t.map(r=>r.id));e.blocks=t,e.blockIndexById=f3(t),_g.set(e,e.blocks);for(let[r,i]of Object.entries(e.toolBlockByCallId))n.has(i)||(e.toolBlockByCallId[r]=Hc);x$(e);for(let[r]of Object.entries(e.trimmedToolNotificationByCallId))e.toolBlockByCallId[r]!==Hc&&delete e.trimmedToolNotificationByCallId[r];for(let[r,i]of Object.entries(e.permissionBlockByRequestId))n.has(i)||(e.permissionBlockByRequestId[r]=j1);w$(e);for(let r of e.blocks)if(r.kind==="tool"&&r.parentBlockId&&!n.has(r.parentBlockId)){let i=Fs(e,r.id);(i==null?void 0:i.kind)==="tool"&&(i.parentBlockId=void 0)}n.has(e.activeUserBlockId??"")||(e.activeUserBlockId=void 0),n.has(e.activeAssistantBlockId??"")||(e.activeAssistantBlockId=void 0),n.has(e.activeThoughtBlockId??"")||(e.activeThoughtBlockId=void 0);for(let[r,i]of Object.entries(e.activeAssistantBlockByParent))n.has(i)||delete e.activeAssistantBlockByParent[r];for(let[r,i]of Object.entries(e.activeThoughtBlockByParent))n.has(i)||delete e.activeThoughtBlockByParent[r];return e}function y$(e){return e.toolCallId===fx||e.toolKind==="updated_plan"}var _g=new WeakMap;function b3(e){_g.get(e)!==e.blocks&&(e.blocks=[...e.blocks],e.blockIndexById={...e.blockIndexById},_g.set(e,e.blocks))}function b$(e,t){var i;let n=0,r=-1;for(let s=0;s<e.blocks.length;s+=1)if(((i=e.blocks[s])==null?void 0:i.kind)==="user"){if(r=s,n===t){w6(e,s);return}n+=1}r>=0&&t>=n&&w6(e,r)}function w6(e,t){b3(e),e.blocks=e.blocks.slice(0,t),_g.set(e,e.blocks),e.blockIndexById=f3(e.blocks),e.toolBlockByCallId={},e.permissionBlockByRequestId={};for(let n of e.blocks)n.kind==="tool"&&(e.toolBlockByCallId[n.toolCallId]=n.id),n.kind==="permission"&&(e.permissionBlockByRequestId[n.requestId]=n.id);e.trimmedToolNotificationByCallId={},e.activeUserBlockId=void 0,e.activeAssistantBlockId=void 0,e.activeThoughtBlockId=void 0,e.activeAssistantBlockByParent={},e.activeThoughtBlockByParent={},e.currentToolCallId=void 0,e.pendingUserShellCommand=void 0,e.lastFollowupSuggestion=void 0,e.toolProgress={}}function Fa(e,t){b3(e),e.blockIndexById[t.id]=e.blocks.length,e.blocks.push(t)}function Fs(e,t){if(!t)return;let n=e.blockIndexById[t];if(n===void 0)return;let r=e.blocks[n];if(!r||r.id!==t)return;let i=v$(r);return b3(e),e.blocks[n]=i,i}function v$(e){return e.kind==="permission"?{...e,options:e.options.map(t=>Ca(t)),toolCall:Ca(e.toolCall),preview:Ca(e.preview)}:e.kind==="tool"?{...e,preview:Ca(e.preview),content:Ca(e.content),locations:Ca(e.locations),rawInput:Ca(e.rawInput),rawOutput:Ca(e.rawOutput)}:{...e}}function ec(e,t){let n=`${t}-${e.nextOrdinal}`;return e.nextOrdinal+=1,n}function cu(e,t){t?(m3(e,t),p3(e,t)):(g3(e),e.activeUserBlockId=void 0)}function v3(e,t){return e.length>=yx?e:R0(e+t)}function R0(e){if(e.length<=yx)return e;let t=Math.max(0,yx-v6.length);return`${e.slice(0,t)}${v6}`}function x$(e){let t=Math.max(0,e.maxBlocks),n=Object.entries(e.toolBlockByCallId).filter(([,i])=>i===Hc).map(([i])=>i),r=n.length-t;if(!(r<=0))for(let i of n.slice(0,r))delete e.toolBlockByCallId[i],delete e.trimmedToolNotificationByCallId[i]}function w$(e){let t=Math.max(0,e.maxBlocks),n=Object.entries(e.permissionBlockByRequestId).filter(([,i])=>i===j1).map(([i])=>i),r=n.length-t;if(!(r<=0))for(let i of n.slice(0,r))delete e.permissionBlockByRequestId[i]}function Ca(e,t=0){return t>t$?e:Array.isArray(e)?e.map(n=>Ca(n,t+1)):nt(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Ca(r,t+1)])):e}function k$(e={}){let t=k6(e),n=new Set,r=!1,i=()=>{for(let a of n)try{a()}catch(o){_$(o)}},s=()=>{r||(r=!0,queueMicrotask(()=>{r=!1,i()}))};return{getSnapshot(){return t},subscribe(a){return n.add(a),()=>{n.delete(a)}},dispatch(a){let o=Array.isArray(a)?a:[a];o.length!==0&&(t=a$(t,o),s())},appendLocalUserMessage(a,o){t=s$(t,a,{images:o}),s()},reset(a={}){t=k6({maxBlocks:a.maxBlocks??t.maxBlocks,...a}),s()},clearAwaitingResync(){t.awaitingResync&&(t={...t,awaitingResync:!1},s())},clearFollowupSuggestion(){t.lastFollowupSuggestion!==void 0&&(t={...t,lastFollowupSuggestion:void 0},s())}}}function _$(e){var r;let t=globalThis.reportError;if(typeof t=="function"){t(e);return}let n=(r=globalThis.console)==null?void 0:r.error;typeof n=="function"&&n.call(globalThis.console,e)}function k6(e){let t=e.blocks?[...e.blocks]:[];return{...n$({maxBlocks:e.maxBlocks,now:e.now}),...e,blocks:t,blockIndexById:f3(t),toolBlockByCallId:{...e.toolBlockByCallId??{}},trimmedToolNotificationByCallId:{...e.trimmedToolNotificationByCallId??{}},permissionBlockByRequestId:{...e.permissionBlockByRequestId??{}},toolProgress:{...e.toolProgress??{}},activeAssistantBlockByParent:{...e.activeAssistantBlockByParent??{}},activeThoughtBlockByParent:{...e.activeThoughtBlockByParent??{}},lastResyncRequired:e.lastResyncRequired!==void 0?{...e.lastResyncRequired}:void 0,lastFollowupSuggestion:e.lastFollowupSuggestion!==void 0?{...e.lastFollowupSuggestion}:void 0}}var S$="web-shell:goal-status:v1:";/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function T$(e){var t;if(!e)return{models:[]};const n=new Set,r=[];let i=(t=e.current)==null?void 0:t.modelId,s;for(const a of e.providers)for(const o of a.models){!i&&o.isCurrent&&(i=o.modelId),s===void 0&&(o.isCurrent||o.modelId===i)&&(s=o.contextLimit);const l=[a.authType,o.modelId,o.baseUrl??"",o.envKey??""].join("\0");n.has(l)||(n.add(l),r.push({id:o.modelId,baseModelId:o.baseModelId,label:o.name||o.modelId,authType:a.authType,...o.contextLimit!==void 0?{contextWindow:o.contextLimit}:{},...o.modalities!==void 0?{modalities:o.modalities}:{},...o.baseUrl!==void 0?{baseUrl:o.baseUrl}:{},...o.envKey!==void 0?{envKey:o.envKey}:{},...o.isRuntime?{isRuntime:!0}:{}}))}return{models:r,currentModel:i,contextWindow:s}}function C$(e){var t;const n=si((t=e==null?void 0:e.state)==null?void 0:t.models);if(!n)return;const r=yr(n,"currentModelId")??yr(n,"currentModel"),i=n.availableModels,s=[];let a;if(Array.isArray(i))for(const o of i){const l=si(o),c=yr(l,"modelId")??yr(l,"id")??yr(l,"value");if(!c)continue;const u=si(l==null?void 0:l._meta),d=Qh(u,"contextLimit")??Qh(u,"contextWindow")??Qh(l,"contextLimit")??Qh(l,"contextWindow");a===void 0&&r!==void 0&&c===r&&(a=d),s.push({id:c,baseModelId:yr(l,"baseModelId")??D$(c),label:yr(l,"name")??yr(l,"label")??c,...d!==void 0?{contextWindow:d}:{}})}if(!(!r&&s.length===0))return{models:s,currentModel:r,contextWindow:a}}function OA(e){if(!e)return{commands:[],skills:[]};const t=e.availableCommands.map(r=>{var i;return{name:r.name,description:r.description||"",...(i=r.input)!=null&&i.hint?{argumentHint:r.input.hint}:{},...BA(r._meta),raw:r}}),n=e.availableSkills.map(r=>({name:r,description:"",raw:{name:r,description:"",input:null,_meta:{source:"skill"}}}));return{commands:jA(t,n),skills:e.availableSkills}}function jA(...e){const t=new Map;for(const n of e)for(const r of n){const i=t.get(r.name);i?t.set(r.name,{...i,...r,description:r.description||i.description,argumentHint:r.argumentHint??i.argumentHint,raw:r.raw}):t.set(r.name,r)}return[...t.values()]}function E$(e,t){var n;if(e.type==="session_update"){const r=si((n=si(e.data))==null?void 0:n.update),i=LA(r);if(i&&t(s=>({...s,tokenUsage:i,tokenCount:x3(i)})),yr(r,"sessionUpdate")==="available_commands_update"){const{commands:s,skills:a}=I$(r);t(o=>({...o,commands:s.length>0?s:o.commands,skills:a}))}return}switch(e.type){case"session_metadata_updated":{const r=si(e.data);Object.prototype.hasOwnProperty.call(r??{},"displayName")&&t(i=>({...i,displayName:yr(r,"displayName")}));break}case"model_switched":{const r=yr(si(e.data),"modelId");r&&t(i=>({...i,currentModel:r}));break}case"approval_mode_changed":{const r=si(e.data),i=yr(r,"next")??yr(r,"mode");i&&t(s=>({...s,currentMode:i}));break}}}function A$(e){const t=yr(e,"displayName");return t!=null&&t.trim()?t:void 0}function M$(e){var t;const n=si((t=e==null?void 0:e.state)==null?void 0:t.modes);return yr(n,"currentModeId")??yr(n,"currentMode")}function x3(e){const t=(e==null?void 0:e.inputTokens)??(e==null?void 0:e.totalTokens);if(t!==void 0&&t>0)return t;if(!e)return;const n=Object.values(e).reduce((r,i)=>r+(typeof i=="number"?i:0),0);return n>0?n:void 0}function N$(e){var t;for(let n=e.length-1;n>=0;n--)try{const r=e[n];if(r.type!=="session_update")continue;const i=si((t=si(r.data))==null?void 0:t.update),s=LA(i);if(s)return s}catch{}}function LA(e){const t=si(e==null?void 0:e._meta);if((t==null?void 0:t.parentToolCallId)!==void 0)return;const n=si(t==null?void 0:t.usage),r={...Ih(n,"inputTokens"),...Ih(n,"outputTokens"),...Ih(n,"totalTokens"),...Ih(n,"thoughtTokens"),...Ih(n,"cachedReadTokens")};return x3(r)!==void 0?r:void 0}function Ih(e,t){const n=Qh(e,t);return n!==void 0&&n>=0?{[t]:n}:{}}function I$(e){if(!e)return{commands:[],skills:[]};const n=(Array.isArray(e.availableCommands)?e.availableCommands:[]).flatMap(s=>{var a;const o=si(s),l=yr(o,"name");if(!l)return[];const c=si(o==null?void 0:o.input),u={name:l,description:yr(o,"description")??"",input:c?{hint:yr(c,"hint")??""}:null,_meta:si(o==null?void 0:o._meta)??null};return[{name:l,description:u.description??"",...(a=u.input)!=null&&a.hint?{argumentHint:u.input.hint}:{},...BA(u._meta),raw:u}]}),r=Array.isArray(e.availableSkills)?e.availableSkills.filter(s=>typeof s=="string"):[],i=r.map(s=>({name:s,description:"",raw:{name:s,description:"",input:null,_meta:{source:"skill"}}}));return{commands:jA(n,i),skills:r}}function BA(e){const n=yr(e??void 0,"source");return{...n?{source:n}:{}}}function si(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function yr(e,t){const n=e==null?void 0:e[t];return typeof n=="string"&&n.length>0?n:void 0}function Qh(e,t){const n=e==null?void 0:e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function D$(e){const t=e.lastIndexOf(")"),n=e.lastIndexOf("(");return n>=0&&t===e.length-1&&n<t?e.slice(0,n):e}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function R$(e,t=[]){const n=[{type:"text",text:e}];for(const r of t){const i=r.mimeType??r.mediaType??r.media_type;i&&i!=="image/*"?n.push({type:"image",data:r.data,mimeType:i}):n.push({type:"image",data:r.data})}return n}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */const O$=3e4;function j$(e,t,n){const r=Number.isFinite(t)&&t>0?t:1e3,i=Number.isFinite(n)&&n>0?Math.max(r,n):r,s=r*2**Math.max(0,e-1),a=Math.min(s,i),o=.8+Math.random()*.4;return Math.min(i,Math.max(1,Math.round(a*o)))}async function Xe(e,t,n=O$){let r;try{return await Promise.race([e,new Promise((i,s)=>{r=setTimeout(()=>{s(new Error(`${t} after ${n}ms`))},n)})])}finally{r!==void 0&&clearTimeout(r)}}function L$(e,t){return e<=0||t.aborted?Promise.resolve():new Promise(n=>{const r=setTimeout(i,e);function i(){clearTimeout(r),t.removeEventListener("abort",i),n()}t.addEventListener("abort",i,{once:!0})})}function Er(e){e.current!==void 0&&(clearTimeout(e.current),e.current=void 0)}function B$(e,t,n="replay",r=80,i){Er(t),t.current=setTimeout(()=>{t.current=void 0,e.getSnapshot().activeAssistantBlockId&&(e.dispatch({type:"assistant.done",reason:n}),i==null||i())},r)}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */const z$="qwen-code-webui-client-id:session:";function _6(e,t){if(e)return e;if(typeof window>"u")return Mb();try{if(t){const n=window.sessionStorage.getItem(PA(t));if(n)return n}return Mb()}catch{return Mb()}}function zA(e,t){if(!(!e||!t||typeof window>"u"))try{window.sessionStorage.setItem(PA(t),e)}catch{}}async function S6(e){if(!e.clientId)return;const t={"X-Qwen-Client-Id":e.clientId};e.token&&(t.Authorization=`Bearer ${e.token}`);const n=`${P$(e.baseUrl)}/session/${encodeURIComponent(e.sessionId)}/detach`,r=await fetch(n,{method:"POST",headers:t,keepalive:!0});if(!(r.status===204||r.status===404))throw new Error(`Detach client failed (${r.status})`)}function Mb(){return`webui_${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`}function PA(e){return`${z$}${encodeURIComponent(e)}`}function P$(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===47;)t-=1;return t===e.length?e:e.slice(0,t)}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function $$({store:e,sessionRef:t,activePromptsRef:n,settledPromptsRef:r,pendingSessionLoadRef:i,pendingSessionLoadIdRef:s,heartbeatSupportedRef:a,passiveAssistantDoneTimerRef:o,addNotice:l,setConnection:c,setPromptStatus:u,setRestoreSessionId:d,setRestoreMode:f,setRestoreSessionNonce:m,setNewSessionNonce:p}){function b(x,g){const y=s.current+1;s.current=y,i.current&&(clearTimeout(i.current.timeout),i.current.reject(new DOMException(`Session ${g} superseded by a newer request`,"AbortError")));const w=new Promise((C,E)=>{const S=setTimeout(()=>{var T;((T=i.current)==null?void 0:T.id)===y&&(i.current=void 0,E(Cn(l,`${F$(g)} session failed`,new Error(`Session ${g} timed out`),g==="load"?"load_session":"resume_session")))},3e4);i.current={id:y,sessionId:x,mode:g,timeout:S,resolve:C,reject:E}});return u("idle"),r.current.clear(),Er(o),e.reset(),f(g),d(x),m(C=>C+1),w}return{async sendPrompt(x,g){var y,w,C,E;const S=tr(l,t.current,"Prompt failed","send_prompt"),T=S.sessionId;if(n.current.has(T))throw Cn(l,"Prompt failed","A prompt is already in progress","send_prompt");Er(o),u("waiting");const j=new AbortController;n.current.set(T,{controller:j});try{const z=((g==null?void 0:g.images)??[]).map(N=>({data:N.data,mimeType:N.mimeType||N.mediaType||N.media_type||"image/*"}));(g==null?void 0:g.optimisticUserMessage)!==!1&&e.appendLocalUserMessage(x,z);const R={prompt:R$(x,z)};g!=null&&g.retry&&(R.retry=!0);const D=await S.prompt(R,j.signal);return TA(D)?await U$(n.current,r.current,T,j,D.promptId):(((y=t.current)==null?void 0:y.sessionId)===T&&e.dispatch({type:"assistant.done",reason:D.stopReason}),D)}catch(z){if(Ap(z))return((w=t.current)==null?void 0:w.sessionId)===T&&e.dispatch({type:"assistant.done",reason:"cancelled"}),{stopReason:"cancelled"};throw((C=t.current)==null?void 0:C.sessionId)===T&&e.dispatch({type:"assistant.done",reason:"error"}),_A(z)?z:Cn(l,"Prompt failed",z,"send_prompt")}finally{const z=n.current.get(T);(z==null?void 0:z.controller)===j&&n.current.delete(T),((E=t.current)==null?void 0:E.sessionId)===T&&!n.current.has(T)&&u("idle")}},async cancel(){var x,g;const y=tr(l,t.current,"Cancel failed","cancel_prompt"),w=n.current.get(y.sessionId);w==null||w.controller.abort(),Er(o);const C=w?new AbortController:void 0;C&&n.current.set(y.sessionId,{controller:C});try{await Xe(y.cancel(),"Cancel timed out")}catch(E){throw Cn(l,"Cancel failed",E,"cancel_prompt")}finally{C&&((x=n.current.get(y.sessionId))==null?void 0:x.controller)===C&&n.current.delete(y.sessionId),((g=t.current)==null?void 0:g.sessionId)===y.sessionId&&!n.current.has(y.sessionId)&&u("idle")}},async setModel(x){const g=tr(l,t.current,"Set model failed","switch_model");try{const y=await Xe(g.setModel(x),"Set model timed out");return c(w=>({...w,currentModel:x})),y}catch(y){throw Cn(l,"Set model failed",y,"switch_model")}},async setApprovalMode(x,g){const y=tr(l,t.current,"Set approval mode failed","set_approval_mode");try{const w=await Xe(y.client.setSessionApprovalMode(y.sessionId,x,{persist:g==null?void 0:g.persist,clientId:y.clientId}),"Set approval mode timed out");return c(C=>({...C,currentMode:w.mode||x})),w}catch(w){throw Cn(l,"Set approval mode failed",w,"set_approval_mode")}},async respondToPermission(x,g){const y=tr(l,t.current,"Permission response failed","submit_permission");try{return await Xe(y.respondToSessionPermission(x,g),"Permission response timed out")}catch(w){throw Cn(l,"Permission response failed",w,"submit_permission")}},async submitPermission(x,g,y){const w=tr(l,t.current,"Permission response failed","submit_permission"),C=g!==void 0&&g.length>0?{outcome:{outcome:"selected",optionId:g},...y?{answers:y}:{}}:{outcome:{outcome:"cancelled"},...y?{answers:y}:{}};try{return await Xe(w.respondToSessionPermission(x,C),"Permission response timed out")}catch(E){throw Cn(l,"Permission response failed",E,"submit_permission")}},async heartbeat(){const x=t.current;if(!(!x||!a.current))return Xe(x.heartbeat(),"Heartbeat timed out")},async listSessions(){const x=t.current;if(!x)return[];try{return await Xe(x.client.listWorkspaceSessions(x.workspaceCwd),"List sessions timed out")}catch(g){throw Cn(l,"List sessions failed",g,"list_sessions")}},async loadSession(x){return b(x,"load")},async resumeSession(x){return b(x,"resume")},async newSession(){for(const[,x]of n.current)x.controller.abort();n.current.clear(),r.current.clear(),u("idle"),Er(o),i.current&&(clearTimeout(i.current.timeout),i.current.reject(new DOMException("New session requested","AbortError")),i.current=void 0),e.reset(),d(void 0),p(x=>x+1)},async releaseSession(x){try{const g=tr(l,t.current,"Release session failed","release_session");await Xe(g.client.closeSession(x),"Release session timed out")}catch(g){throw Cn(l,"Release session failed",g,"release_session")}},async closeSession(){const x=tr(l,t.current,"Close session failed","close_session");try{await Xe(x.close(),"Close session timed out")}catch(g){throw Cn(l,"Close session failed",g,"close_session")}},async refreshCommands(){const x=tr(l,t.current,"Refresh commands failed","refresh_commands");try{const g=await Xe(x.supportedCommands(),"Refresh commands timed out"),{commands:y,skills:w}=OA(g);c(C=>({...C,commands:y,skills:w,supportedCommands:g}))}catch(g){throw Cn(l,"Refresh commands failed",g,"refresh_commands")}},async getContext(){const x=tr(l,t.current,"Load context failed","load_context");try{const g=await Xe(x.context(),"Load context timed out");return c(y=>({...y,context:g,currentMode:H$(g)??y.currentMode})),g}catch(g){throw Cn(l,"Load context failed",g,"load_context")}},async getContextUsage(x){const g=tr(l,t.current,"Load context usage failed","load_context_usage");try{return await Xe(g.contextUsage(x),"Load context usage timed out")}catch(y){throw Cn(l,"Load context usage failed",y,"load_context_usage")}},async renameSession(x){const g=tr(l,t.current,"Rename session failed","rename_session");try{return await Xe(g.updateMetadata({displayName:x}),"Rename session timed out")}catch(y){throw Cn(l,"Rename session failed",y,"rename_session")}},async recapSession(){const x=tr(l,t.current,"Recap session failed","recap_session");try{return await Xe(x.recap(),"Recap session timed out")}catch(g){throw Cn(l,"Recap session failed",g,"recap_session")}},async btwSession(x,g){var y;const w=tr(l,t.current,"Side question failed","btw_session");try{return await Xe(w.btw(x,g),"Side question timed out")}catch(C){throw(y=g==null?void 0:g.signal)!=null&&y.aborted||Ap(C)?C:Cn(l,"Side question failed",C,"btw_session")}},async enqueueMidTurnMessage(x,g){const y=t.current;if(!y)return{accepted:!1};try{return await y.enqueueMidTurnMessage(x,g)}catch(w){return w instanceof DOMException&&w.name==="AbortError"||console.debug("[enqueueMidTurnMessage] push failed; kept for next turn",w),{accepted:!1}}},async sendShellCommand(x){var g,y;const w=tr(l,t.current,"Shell command failed","send_shell_command"),C=`${w.sessionId}:shell`;u("waiting");const E=new AbortController;n.current.set(C,{controller:E});try{return await w.shellCommand(x,E.signal)}catch(S){throw Cn(l,"Shell command failed",S,"send_shell_command")}finally{((g=n.current.get(C))==null?void 0:g.controller)===E&&n.current.delete(C),((y=t.current)==null?void 0:y.sessionId)===w.sessionId&&u("idle")}},async getTasks(){const x=tr(l,t.current,"Get tasks failed","load_tasks");try{return await Xe(x.tasks(),"Get tasks timed out")}catch(g){throw Cn(l,"Get tasks failed",g,"load_tasks")}},async cancelTask(x,g){const y=tr(l,t.current,"Cancel task failed","cancel_task");try{return await Xe(y.cancelTask(x,g),"Cancel task timed out")}catch(w){throw Cn(l,"Cancel task failed",w,"cancel_task")}},async clearGoal(){const x=tr(l,t.current,"Clear goal failed","clear_goal");try{return await Xe(x.clearGoal(),"Clear goal timed out")}catch(g){throw Cn(l,"Clear goal failed",g,"clear_goal")}},async getStats(){const x=tr(l,t.current,"Load stats failed","load_stats");try{return await Xe(x.stats(),"Load stats timed out")}catch(g){throw Cn(l,"Load stats failed",g,"load_stats")}},async respondToGlobalPermission(x,g){const y=tr(l,t.current,"Global permission response failed","submit_permission");try{return await Xe(y.client.respondToPermission(x,g),"Global permission response timed out")}catch(w){throw Cn(l,"Global permission response failed",w,"submit_permission")}},async branchSession(x){const g=tr(l,t.current,"Branch session failed","branch_session");try{const y=await Xe(g.client.branchSession(g.sessionId,{name:x},g.clientId),"Branch session timed out");return zA(y.clientId,y.sessionId),b(y.sessionId,"load").catch(w=>{Ap(w)||Cn(l,"Branch session failed",w,"branch_session")}),{sessionId:y.sessionId,displayName:y.displayName}}catch(y){throw Cn(l,"Branch session failed",y,"branch_session")}},async forkSession(x){const g=tr(l,t.current,"Fork session failed","fork_session");try{return await Xe(g.fork(x),"Fork session timed out")}catch(y){throw Cn(l,"Fork session failed",y,"fork_session")}}}}function U$(e,t,n,r,i){return new Promise((s,a)=>{const o=vx(n,i),l=t.get(o);if(l){t.delete(o),l.status==="resolved"?s(l.result):a(l.error);return}const c=e.get(n);if((c==null?void 0:c.controller)!==r){a(new DOMException("Aborted","AbortError"));return}if(c.promptId!==void 0&&c.promptId!==i){a(new Error(`Prompt accepted with unexpected id ${i}`));return}if(r.signal.aborted){e.delete(n),a(r.signal.reason??new DOMException("Aborted","AbortError"));return}const u=()=>{r.signal.removeEventListener("abort",d)},d=()=>{const f=e.get(n);(f==null?void 0:f.controller)===r&&e.delete(n),u(),a(r.signal.reason??new DOMException("Aborted","AbortError"))};e.set(n,{...c,promptId:i,resolve:f=>{u(),s(f)},reject:f=>{u(),a(f)}}),r.signal.addEventListener("abort",d,{once:!0})})}function vx(e,t){return JSON.stringify([e,t])}function H$(e){const t=typeof e.state.modes=="object"&&e.state.modes!==null?e.state.modes:void 0,n=(t==null?void 0:t.currentModeId)??(t==null?void 0:t.currentMode);return typeof n=="string"?n:void 0}function tr(e,t,n,r){if(!t)throw Cn(e,n,"Daemon session is not connected",r);return t}function Cn(e,t,n,r){if(Ap(n)){if(n instanceof Error)return n;const s=n instanceof DOMException?n.message:"Aborted",a=new Error(s);return a.name="AbortError",a}const i=n instanceof Error?n.message:String(n);return e({severity:"error",category:"user_action",operation:r,code:`daemon.${r}.failed`,message:`${t}: ${i}`,debugMessage:i,recoverable:!0}),q$(n instanceof Error?n:new Error(i))}function Ap(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function q$(e){return Object.assign(e,{_alreadyDispatched:!0})}function F$(e){return e.charAt(0).toUpperCase()+e.slice(1)}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */const V$=33e4;function G$({getClient:e,getWorkspaceCwd:t,baseUrl:n,token:r}){return{async listSessions(){const i=Ct(e,"List sessions failed"),s=t();return s?Xe(i.listWorkspaceSessions(s),"List sessions timed out"):[]},async deleteSession(i){const s=Ct(e,"Delete session failed"),a=await Xe(s.deleteSessionsData([i]),"Delete session timed out");if(a.errors.length>0)throw new Error(a.errors[0].error);return a.removed.length>0||a.notFound.length>0},async deleteSessions(i){const s=Ct(e,"Delete sessions failed");return Xe(s.deleteSessionsData(i),"Delete sessions timed out")},async loadMcpStatus(){const i=Ct(e,"Load MCP status failed");return Xe(i.workspaceMcp(),"Load MCP status timed out")},async loadMcpTools(i){const s=Ct(e,"Load MCP tools failed");try{return await Xe(s.workspaceMcpTools(i),"Load MCP tools timed out")}catch{return{v:1,workspaceCwd:"",serverName:i,initialized:!1,acpChannelLive:!1,tools:[],errors:[{kind:"mcp_tools",status:"error",error:"The connected daemon does not expose MCP tool details."}]}}},async restartMcpServer(i){const s=Ct(e,"Restart MCP server failed");return Xe(s.restartMcpServer(i),"Restart MCP server timed out",5*6e4)},async manageMcpServer(i,s){const a=Ct(e,"Manage MCP server failed"),o=s==="authenticate"?10*6e4:5*6e4;return Xe(a.manageMcpServer(i,s),"Manage MCP server timed out",o)},async loadSkillsStatus(){const i=Ct(e,"Load skills failed");return Xe(i.workspaceSkills(),"Load skills timed out")},async loadExtensionsStatus(){const i=Ct(e,"Load extensions failed");return Xe(i.workspaceExtensions(),"Load extensions timed out")},async loadToolsStatus(){const i=Ct(e,"Load tools failed");return Xe(i.workspaceTools(),"Load tools timed out")},async setWorkspaceToolEnabled(i,s){const a=Ct(e,"Set tool enabled failed");return Xe(a.setWorkspaceToolEnabled(i,s),"Set tool enabled timed out")},async loadSettingsStatus(){const i=Ct(e,"Load settings failed");return Xe(i.workspaceSettings(),"Load settings timed out")},async setWorkspaceSetting(i,s,a){const o=Ct(e,"Set setting failed");return Xe(o.setWorkspaceSetting(i,s,a),"Set setting timed out")},async loadMemoryStatus(){const i=Ct(e,"Load memory failed");return Xe(i.workspaceMemory(),"Load memory timed out")},async readWorkspaceFile(i){const s=Ct(e,"Read workspace file failed");return Xe(s.readWorkspaceFile(i),"Read workspace file timed out")},async writeMemory(i){const s=Ct(e,"Write memory failed");return Xe(s.writeWorkspaceMemory(i),"Write memory timed out")},async listAgents(){const i=Ct(e,"List agents failed");return Xe(i.listWorkspaceAgents(),"List agents timed out")},async getAgent(i){const s=Ct(e,"Get agent failed");return Xe(s.getWorkspaceAgent(i),"Get agent timed out")},async createAgent(i){const s=Ct(e,"Create agent failed");return Xe(s.createWorkspaceAgent(i),"Create agent timed out")},async generateAgent(i){const s=Ct(e,"Generate agent failed");return Xe(s.generateWorkspaceAgent(i),"Generate agent timed out",V$)},async deleteAgent(i,s){const a=Ct(e,"Delete agent failed");return Xe(a.deleteWorkspaceAgent(i,s?{scope:s}:{}),"Delete agent timed out")},async globWorkspace(i,s){Ct(e,"Glob workspace failed");const a=Ib(n,"/glob");a.searchParams.set("pattern",i),(s==null?void 0:s.maxResults)!==void 0&&a.searchParams.set("maxResults",String(s.maxResults)),(s==null?void 0:s.includeIgnored)!==void 0&&a.searchParams.set("includeIgnored",s.includeIgnored?"1":"0"),(s==null?void 0:s.cwd)!==void 0&&a.searchParams.set("cwd",s.cwd);const o=await Xe(fetch(Db(a,n),{headers:Nb(r)}),"Glob workspace timed out");if(!o.ok)throw new Error(await Rb(o,"GET /glob"));const l=await o.json();return{matches:Array.isArray(l.matches)?l.matches.filter(c=>typeof c=="string"):[]}},async loadProviders(){const i=Ct(e,"Load providers failed");return Xe(i.workspaceProviders(),"Load providers timed out")},async readFileBytes(i,s){const a=Ct(e,"Read file bytes failed");return Xe(a.readWorkspaceFileBytes(i,s??{}),"Read file bytes timed out")},async writeFile(i){const s=Ct(e,"Write file failed");return Xe(s.writeWorkspaceFile(i),"Write file timed out")},async editFile(i){const s=Ct(e,"Edit file failed");return Xe(s.editWorkspaceFile(i),"Edit file timed out")},async stat(i){Ct(e,"Stat file failed");const s=Ib(n,"/stat");s.searchParams.set("path",i);const a=await Xe(fetch(Db(s,n),{headers:Nb(r)}),"Stat file timed out");if(!a.ok)throw new Error(await Rb(a,"GET /stat"));return await a.json()},async listDirectory(i){Ct(e,"List directory failed");const s=Ib(n,"/list");s.searchParams.set("path",i);const a=await Xe(fetch(Db(s,n),{headers:Nb(r)}),"List directory timed out");if(!a.ok)throw new Error(await Rb(a,"GET /list"));return await a.json()},async loadEnv(){const i=Ct(e,"Load env failed");return Xe(i.workspaceEnv(),"Load env timed out")},async loadPreflight(){const i=Ct(e,"Load preflight failed");return Xe(i.workspacePreflight(),"Load preflight timed out")},async initWorkspace(i){const s=Ct(e,"Init workspace failed");return Xe(s.initWorkspace(i),"Init workspace timed out")},async updateAgent(i,s,a){const o=Ct(e,"Update agent failed");return Xe(o.updateWorkspaceAgent(i,s,a?{scope:a}:{}),"Update agent timed out")},async installExtension(i,s){const a=Ct(e,"Install extension failed");return Xe(a.installExtension(i,s),"Install extension timed out")},async checkExtensionUpdates(i){const s=Ct(e,"Check extension updates failed");return Xe(s.checkExtensionUpdates(i),"Check extension updates timed out")},async refreshExtensions(i){const s=Ct(e,"Refresh extensions failed");return Xe(s.refreshExtensions(i),"Refresh extensions timed out")},async enableExtension(i,s,a){const o=Ct(e,"Enable extension failed");return Xe(o.enableExtension(i,s,a),"Enable extension timed out")},async disableExtension(i,s,a){const o=Ct(e,"Disable extension failed");return Xe(o.disableExtension(i,s,a),"Disable extension timed out")},async updateExtension(i,s){const a=Ct(e,"Update extension failed");return Xe(a.updateExtension(i,s),"Update extension timed out")},async uninstallExtension(i,s){const a=Ct(e,"Uninstall extension failed");return Xe(a.uninstallExtension(i,s),"Uninstall extension timed out")},async startDeviceFlow(i){const s=Ct(e,"Start device flow failed");return Xe(s.startDeviceFlow({providerId:i}),"Start device flow timed out")},async getDeviceFlow(i,s){const a=Ct(e,"Get device flow failed");return Xe(a.getDeviceFlow(i,s),"Get device flow timed out")},async cancelDeviceFlow(i){const s=Ct(e,"Cancel device flow failed");return Xe(s.cancelDeviceFlow(i),"Cancel device flow timed out")},async getAuthStatus(){const i=Ct(e,"Get auth status failed");return Xe(i.getAuthStatus(),"Get auth status timed out")},async getAuthProviders(){const i=Ct(e,"Get auth providers failed");return Xe(i.getAuthProviders(),"Get auth providers timed out")},async installAuthProvider(i){const s=Ct(e,"Install auth provider failed");return Xe(s.installAuthProvider(i),"Install auth provider timed out")}}}function Ct(e,t){const n=e();if(!n)throw new Error(`${t}: DaemonClient is not connected`);return n}function Nb(e){const t={};return e&&(t.Authorization=`Bearer ${e}`),t}function Ib(e,t){const n=$A(e),r=typeof window>"u"?"http://localhost":window.location.origin;return new URL(`${n}${t}`,r)}function Db(e,t){return $A(t)?e.toString():`${e.pathname}${e.search}`}function $A(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===47;)t--;return t===e.length?e:e.slice(0,t)}async function Rb(e,t){try{const n=await e.json(),r=typeof n.error=="string"?n.error:typeof n.message=="string"?n.message:void 0;return r?`${t}: ${r}`:`${t}: HTTP ${e.status}`}catch{return`${t}: HTTP ${e.status}`}}const w3=v.createContext(void 0);let Dh;function W$({baseUrl:e,token:t,workspaceCwd:n,autoConnect:r=!0,transport:i,children:s}){const a=v.useMemo(()=>r?new SA({baseUrl:e,token:t,transport:i}):void 0,[r,e,t,i]),o=v.useRef(a);o.current=a;const l=v.useRef(void 0),c=v.useRef(void 0),u=v.useRef(n),[d,f]=v.useState(void 0),[m,p]=v.useState(r?"connecting":"idle"),[b,x]=v.useState(void 0),g=v.useCallback(()=>{if(!a)return Promise.reject(new Error("Daemon workspace client unavailable"));if(l.current!==a&&(l.current=a,c.current=void 0),!c.current){const C=a.capabilities().catch(E=>{throw c.current===C&&(c.current=void 0),E});c.current=C}return c.current},[a]);v.useEffect(()=>{if(!a)return;p("connecting"),x(void 0),f(void 0),Dh===a&&(Dh=void 0);let C=!1;return g().then(E=>{C||(f(E),p("connected"))}).catch(E=>{C||(x(E instanceof Error?E:new Error(String(E))),p("error"))}),()=>{C=!0,Dh=a,queueMicrotask(()=>{Dh===a&&(Dh=void 0,a.dispose())})}},[a,g]),u.current=(d==null?void 0:d.workspaceCwd)??n;const y=v.useMemo(()=>G$({getClient:()=>o.current,getWorkspaceCwd:()=>u.current,baseUrl:e,token:t}),[e,t]),w=v.useMemo(()=>{if(a)return{client:a,token:t,baseUrl:e,workspaceCwd:(d==null?void 0:d.workspaceCwd)??n,status:m,error:b,capabilities:d,getCapabilities:g,actions:y}},[a,t,e,n,m,b,d,g,y]);return h.jsx(w3.Provider,{value:w,children:s})}function UA(){const e=v.useContext(w3);if(!e)throw new Error("useDaemonWorkspace must be used within DaemonWorkspaceProvider");return e}function tc(){return UA().actions}function HA(){return v.useContext(w3)}function K$(e){if(e.length===0)return"idle";const t=e[e.length-1];if((t==null?void 0:t.kind)==="thought"&&T6(t))return"thinking";if((t==null?void 0:t.kind)==="assistant"&&T6(t)||(t==null?void 0:t.kind)==="tool"&&C6(t))return"responding";for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.kind==="user")break;if(r.kind==="tool"&&C6(r))return"responding"}return"idle"}function Y$(e,t="idle"){const n=K$(e);return t==="idle"||n!=="idle"?n:t==="waiting"?"waiting":"responding"}function T6(e){return e.streaming===!0}function C6(e){return e.status==="running"||e.status==="in_progress"}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */const xx=new Set;let Sg;function E6(){return Sg}function X$(e){return xx.add(e),()=>{xx.delete(e)}}function Q$(e){Sg={...e},qA()}function Ob(){Sg!==void 0&&(Sg=void 0,qA())}function qA(){for(const e of xx)e()}function J$(e){if(!e||typeof e!="object")return;const t=e;if(t.type!=="followup_suggestion")return;const n=t.data;if(!n||typeof n!="object")return;const r=n,i=r.sessionId,s=r.suggestion,a=r.promptId;if(!(typeof i!="string"||typeof s!="string"||s.length===0||typeof a!="string"))return{sessionId:i,suggestion:s,promptId:a}}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */const wx=new Set,FA=Object.freeze([]),jb=64;let xl=FA;function A6(){return xl}function Z$(e){return wx.add(e),()=>{wx.delete(e)}}function eU(e){const t=[...xl,{sessionId:e.sessionId,messages:[...e.messages],...e.originatorClientId?{originatorClientId:e.originatorClientId}:{}}];if(t.length>jb){const n=t.length-jb;console.debug(`[mid-turn] sidechannel buffer over ${jb}; evicting ${n} oldest batch(es)`),xl=t.slice(n)}else xl=t;VA()}function tU(e){if(e.length===0||xl.length===0)return;const t=new Set(e),n=xl.filter(r=>!t.has(r));n.length!==xl.length&&(xl=n.length===0?FA:n,VA())}function VA(){for(const e of wx)e()}function nU(e){if(!e||typeof e!="object")return;const t=e;if(t.type!==CA)return;const n=t.data;if(!n||typeof n!="object")return;const r=n,i=r.sessionId,s=r.messages;if(typeof i!="string"||!Array.isArray(s))return;const a=s.filter(l=>typeof l=="string"&&l.length>0);if(a.length===0)return;const o=t.originatorClientId;return{sessionId:i,messages:a,...typeof o=="string"?{originatorClientId:o}:{}}}const GA=v.createContext(void 0),WA=v.createContext(void 0),k3=v.createContext(void 0),KA=v.createContext(void 0),YA=v.createContext(void 0),XA=v.createContext(void 0),rU=new Set([401,403,404,410]),iU=2e5,sU={memoryVersion:0,agentsVersion:0,toolsVersion:0,settingsVersion:0,mcpVersion:0,extensionsVersion:0,initVersion:0,authVersion:0},aU=new Set([401,403]);function oU({baseUrl:e,token:t,workspaceCwd:n,initialSessionId:r,clientId:i,createSessionRequest:s,maxQueued:a=1024,maxBlocks:o=iU,suppressOwnUserEcho:l=!0,includeRawEvent:c=!1,autoConnect:u=!0,autoReconnect:d=!0,missingSessionBehavior:f="create",reconnectDelayMs:m=1e3,maxReconnectDelayMs:p=1e4,heartbeatIntervalMs:b=3e4,heartbeatFailureThreshold:x=3,loadWarnings:g,children:y}){const w=HA(),C=e??(w==null?void 0:w.baseUrl),E=t??(w==null?void 0:w.token),S=n??(w==null?void 0:w.workspaceCwd),T=v.useRef(w==null?void 0:w.client);T.current=w==null?void 0:w.client;const j=v.useRef(w==null?void 0:w.capabilities);j.current=w==null?void 0:w.capabilities;const z=v.useRef(w==null?void 0:w.getCapabilities);z.current=w==null?void 0:w.getCapabilities;const R=v.useRef(S);R.current=S;const D=v.useMemo(()=>k$({maxBlocks:o}),[o]),N=v.useRef(void 0),B=v.useRef(void 0),P=v.useRef(new Map),J=v.useRef(new Map),q=v.useRef(void 0),W=v.useRef(0),$=v.useRef(void 0),Z=v.useRef(!1),M=v.useRef({suppressOwnUserEcho:l,includeRawEvent:c}),X=v.useRef({reconnectDelayMs:m,maxReconnectDelayMs:p}),H=v.useRef(g),O=v.useRef(void 0);(!O.current||i)&&(O.current=_6(i)),M.current={suppressOwnUserEcho:l,includeRawEvent:c},X.current={reconnectDelayMs:m,maxReconnectDelayMs:p},H.current=g;const se=s==null?void 0:s.modelServiceId,ke=s==null?void 0:s.sessionScope,[be,Ee]=v.useState("idle"),[qe,wt]=v.useState(r),[Mt,bt]=v.useState("load"),[Je,Ge]=v.useState(0),[Pt,Ze]=v.useState(0),[re,le]=v.useState({status:u?"connecting":"idle"}),De=v.useRef(0),[We,pe]=v.useState([]),st=v.useCallback(Te=>{const Pe={...Te,id:Te.id??`daemon-notice-${Date.now()}-${++De.current}`,createdAt:Te.createdAt??Date.now()};return pe(dt=>[...dt.slice(-49),Pe]),Pe},[]),ae=v.useCallback(Te=>{pe(Pe=>Pe.filter(dt=>dt.id!==Te))},[]),je=v.useCallback(()=>{pe([])},[]),Oe=v.useMemo(()=>({notices:We,dismissNotice:ae,clearNotices:je}),[je,ae,We]),[$e,te]=v.useState(sU);v.useEffect(()=>{if(!u)return;if(!T.current&&!C){le({status:"error",error:"DaemonSessionProvider requires a baseUrl prop or an ancestor DaemonWorkspaceProvider."});return}const Te=new AbortController;let Pe=!1;return(async()=>{var Ht,Xt,Dn,jn,Zn,Sn,_r,me,G,ne,Ke;const St=T.current??new SA({baseUrl:C,token:E});let et,$t,Tt=qe,or=!qe&&Pt>0,Yn=0,Xa=!1;for(;!Pe&&!Te.signal.aborted;){try{let Sr=!1,ni=!1,pn=!1,gn,Tr;if(!et){le(rn=>({...rn,status:"connecting",error:void 0}));const Re=z.current,gt=j.current??(Re?await Re():await St.capabilities());if(Pe||Te.signal.aborted)return;$t=gt,Z.current=Array.isArray(gt.features)&&gt.features.includes("client_heartbeat");const zt=R.current??gt.workspaceCwd,Tn=qe&&Mt==="resume"?xm.resume:xm.load,on=i?O.current:_6(void 0,qe??Tt),tn=qe?await Tn(St,qe,{workspaceCwd:zt},on):Tt?await xm.load(St,Tt,{workspaceCwd:zt},on):await xm.createOrAttach(St,{...se!==void 0?{modelServiceId:se}:{},...or?{sessionScope:"thread"}:ke!==void 0?{sessionScope:ke}:{},workspaceCwd:zt},on);if(!i&&tn.clientId&&(O.current=tn.clientId,zA(tn.clientId,tn.sessionId)),Pe||Te.signal.aborted){S6({baseUrl:C,token:E,sessionId:tn.sessionId,clientId:tn.clientId}).catch(rn=>console.warn("[DaemonSessionProvider] detach failed:",rn));return}const Yi=B.current;Yi!==tn.sessionId&&je(),Yi!==void 0&&tn.sessionId!==Yi?(Ee("idle"),Er($),pn=!0):Yi!==void 0&&(tn.replaySnapshot.compactedReplay.length+tn.replaySnapshot.liveJournal.length>0?(Ee("idle"),Er($),pn=!0):(D.dispatch({type:"assistant.done",reason:"reconnected"}),D.getSnapshot().awaitingResync&&D.clearAwaitingResync())),Sr=Yi!==void 0&&Yi===tn.sessionId,ni=tn.replaySnapshot.compactedReplay.length>0||tn.replaySnapshot.liveJournal.length>0;const ha=[...tn.replaySnapshot.compactedReplay,...tn.replaySnapshot.liveJournal];gn=N$(ha),Tr=x3(gn),et=tn,Tt=et.sessionId,or=!1,B.current=et.sessionId,N.current=et}const Nt=et,[hi,Vr,vs]=await Promise.allSettled([St.workspaceProviders(),Nt.supportedCommands(),Nt.context()]),Qa=hi.status==="fulfilled"?hi.value:void 0,Ks=Vr.status==="fulfilled"?Vr.value:void 0,Ja=vs.status==="fulfilled"?vs.value:void 0,er=[hi.status==="rejected"?(Ht=H.current)==null?void 0:Ht.models:void 0,Vr.status==="rejected"?(Xt=H.current)==null?void 0:Xt.commands:void 0,vs.status==="rejected"?(Dn=H.current)==null?void 0:Dn.context:void 0].filter(Re=>!!Re),Gr=T$(Qa),xs=C$(Ja),Ki=xs&&xs.models.length>0?xs.models:Gr.models,ws=(xs==null?void 0:xs.currentModel)??Gr.currentModel,ua=ws===Gr.currentModel?Gr.contextWindow:(jn=Gr.models.find(Re=>Re.id===ws))==null?void 0:jn.contextWindow,Vo=(xs==null?void 0:xs.contextWindow)??((Zn=Ki.find(Re=>Re.id===ws))==null?void 0:Zn.contextWindow)??ua,{commands:Go,skills:xu}=OA(Ks),wu=M$(Ja);le(Re=>({status:"connected",sessionId:Nt.sessionId,...Nt.clientId?{clientId:Nt.clientId}:{},workspaceCwd:Nt.workspaceCwd,commands:Go,skills:xu,models:Ki,currentModel:ws,currentMode:wu,displayName:A$(Nt.state)??(Re.sessionId===Nt.sessionId?Re.displayName:void 0),tokenUsage:gn!==void 0?gn:Re.sessionId===Nt.sessionId?Re.tokenUsage:void 0,tokenCount:Tr!==void 0?Tr:Re.sessionId===Nt.sessionId?Re.tokenCount??0:0,contextWindow:Vo,providers:Qa,supportedCommands:Ks,context:Ja,capabilities:$t,catchingUp:Sr||Nt.lastEventId!=null||void 0})),Ee(P.current.has(Nt.sessionId)?"streaming":"idle"),er.length>0&&D.dispatch(er.map(Re=>({type:"status",text:Re})));const Wo=q.current,Ko=(Wo==null?void 0:Wo.sessionId)===Nt.sessionId?Wo:void 0,{compactedReplay:sc,liveJournal:da}=Nt.replaySnapshot,Ys=[...sc,...da];if(pn&&!(ni&&Ys.length>0)&&D.reset(),ni&&Ys.length>0){const Re={...M.current,suppressOwnUserEcho:!1},gt=[];for(const ot of Ys)try{const on=M6(ot,Nt.clientId,Re,le,{updateConnection:!1});if(gt.push(...N6(ot,on,st)),ot.type==="turn_complete"){const tn=((Sn=ot.data)==null?void 0:Sn.stopReason)??"end_turn";gt.push({type:"assistant.done",reason:tn})}else ot.type==="turn_error"&&gt.push({type:"assistant.done",reason:"error"})}catch(on){const tn=on instanceof Error?on.message:String(on);st({severity:"warning",category:"protocol",operation:"normalize_event",code:"daemon.replay_event_malformed",message:"Skipped malformed replay event",debugMessage:tn,recoverable:!0}),console.warn("[DaemonSessionProvider] skipped malformed replay event:",on)}pn&&D.reset(),gt.length>0&&(D.dispatch(gt),Bb(gt,te));for(const ot of Ys)Lb(P.current,J.current,Nt.sessionId,ot,D,Ee,$,{requireBoundPromptId:!0});const zt=Ys.some(ot=>ot.type==="turn_complete"||ot.type==="turn_error"||ot.type==="prompt_cancelled");Ys.some(cU)&&!zt&&Ee(ot=>ot==="idle"?"waiting":ot),le(ot=>({...ot,catchingUp:void 0}))}Ko&&(q.current=void 0,clearTimeout(Ko.timeout),Ko.resolve());let Q=!1,oe=!1,he,Ye=[];for await(const Re of Nt.events({signal:Te.signal,maxQueued:a})){Q||(Q=!0,Yn=0);try{const gt=J$(Re);if(gt){Q$(gt);continue}const zt=nU(Re);if(zt){eU(zt);continue}const Tn=M6(Re,Nt.clientId,M.current,le),ot=N6(Re,Tn,st);if(Re.type==="state_resync_required"&&(typeof Re.data=="object"&&Re.data!==null?Re.data.reason:void 0)==="epoch_reset"){Ee("idle"),Er($),Nt.setLastEventId(0),he=[],Ye=[];continue}if(he){if(Ye.push(Re),he.push(...ot),Re.type==="turn_complete"){const yn=((_r=Re.data)==null?void 0:_r.stopReason)??"end_turn";he.push({type:"assistant.done",reason:yn})}else Re.type==="turn_error"&&he.push({type:"assistant.done",reason:"error"});if(ot.some(yn=>yn.type==="session.replay_complete")){P.current.has(Nt.sessionId)||(Er($),he.push({type:"assistant.done",reason:"replay_complete"}),Ee("idle"));const yn=he,Za=Ye;he=void 0,Ye=[],D.reset(),yn.length>0&&(D.dispatch(yn),Bb(yn,te));for(const ue of Za)Lb(P.current,J.current,Nt.sessionId,ue,D,Ee,$,{requireBoundPromptId:!0});le(ue=>({...ue,catchingUp:void 0}))}if(Re.type==="session_closed"&&((me=Re.data)==null?void 0:me.reason)==="client_close"){Xa=!0;const yn=Nt.sessionId,Za=P.current.get(yn);Za==null||Za.controller.abort(),P.current.delete(yn),et=void 0,N.current=void 0;break}continue}Bb(ot,te),ot.length>0&&Ee(rn=>rn==="waiting"?"streaming":rn);const on=Lb(P.current,J.current,Nt.sessionId,Re,D,Ee,$),Yi=!P.current.has(Nt.sessionId)&&D.getSnapshot().activeAssistantBlockId!=null?ot.filter(rn=>rn.type!=="debug"):ot;D.dispatch(Yi);for(const rn of ot)rn.type==="prompt.cancelled"&&rn.originatorClientId!==Nt.clientId?(Ee("idle"),Er($),P.current.delete(Nt.sessionId)):rn.type==="session.replay_complete"&&(le(yn=>({...yn,catchingUp:void 0})),D.getSnapshot().awaitingResync&&D.clearAwaitingResync(),P.current.has(Nt.sessionId)||(Er($),D.dispatch({type:"assistant.done",reason:"replay_complete"}),Ee("idle")));const ha=!on&&!P.current.has(Nt.sessionId);if(ha&&(ot.some(yn=>yn.type==="user.text.delta")?Ee("waiting"):I6(ot)&&Ee(yn=>yn==="idle"?"streaming":yn)),ha&&Re.type==="turn_complete"){Er($);const rn=((G=Re.data)==null?void 0:G.stopReason)??"end_turn";D.dispatch({type:"assistant.done",reason:rn}),Ee("idle")}else ha&&Re.type==="turn_error"?(Er($),D.dispatch({type:"assistant.done",reason:"error"}),Ee("idle")):ha&&I6(ot)&&B$(D,$,"passive_observer",3e3,()=>Ee("idle"));if(Re.type==="state_resync_required"){const rn=typeof Re.data=="object"&&Re.data!==null?Re.data.reason:void 0;if(Ee("idle"),Er($),D.reset(),rn==="epoch_reset")Nt.setLastEventId(0);else{console.warn("[DaemonSessionProvider] ring eviction detected, reloading session (sessionId=%s)",Nt.sessionId),oe=!0,et=void 0,N.current=void 0,le(yn=>({...yn,status:"connecting",error:void 0}));break}}if(Re.type==="session_closed"&&((ne=Re.data)==null?void 0:ne.reason)==="client_close"){Xa=!0;const rn=Nt.sessionId,yn=P.current.get(rn);yn==null||yn.controller.abort(),P.current.delete(rn),et=void 0,N.current=void 0;break}}catch(gt){const zt=gt instanceof Error?gt.message:String(gt);st({severity:"warning",category:"protocol",operation:"normalize_event",code:"daemon.event_malformed",message:"Skipped malformed daemon event",debugMessage:zt,recoverable:!0}),console.warn("[DaemonSessionProvider] skipped malformed daemon event:",gt)}}if(Xa){D.dispatch({type:"assistant.done",reason:"cancelled"}),Ee("idle"),Er($),le(Re=>({...Re,status:"disconnected",sessionId:void 0,error:void 0}));return}!Pe&&!Te.signal.aborted&&!oe&&(((Ke=N.current)==null?void 0:Ke.sessionId)===Nt.sessionId&&(Er($),Ee("idle"),console.debug("[DaemonSessionProvider] SSE stream ended"),D.dispatch({type:"assistant.done",reason:"stream_ended"})),le(Re=>({...Re,status:"disconnected",error:void 0})))}catch(Sr){if(Pe||Te.signal.aborted)return;const ni=Sr instanceof Error?Sr.message:String(Sr),pn=et==null?void 0:et.sessionId,gn=bU(Sr),Tr=yU(Sr),Nt=Tr&&!gn&&f==="disconnect";if(pn&&(gn||Tr)){const Vr=P.current.get(pn);Vr==null||Vr.controller.abort(),P.current.delete(pn)}Er($),Ee("idle");const hi=q.current;if(hi&&(hi.sessionId===qe||hi.sessionId===Tt)&&(q.current=void 0,clearTimeout(hi.timeout),hi.reject(Sr)),gn||Tr){if(et=void 0,N.current=void 0,gn){le({status:"error",error:ni});return}if(Nt){le(Vr=>({...Vr,status:"disconnected",sessionId:void 0,error:ni}));return}Tt=void 0,qe&&wt(void 0)}else console.debug("[DaemonSessionProvider] retriable SSE error, preserving session for delta resume (sessionId=%s)",et==null?void 0:et.sessionId);if(!d){et=void 0,N.current=void 0,le({status:"error",error:ni});return}le(Vr=>({...Vr,status:"disconnected",error:ni}))}if(!d){N.current=void 0,le(Sr=>({...Sr,status:"disconnected"}));return}Yn+=1;const bu=X.current,vu=j$(Yn,bu.reconnectDelayMs,bu.maxReconnectDelayMs);le(Sr=>({...Sr,status:"disconnected",error:`Reconnecting in ${vu}ms`})),await L$(vu,Te.signal)}})(),()=>{const Ht=N.current;Pe=!0,Te.abort(),Ee("idle"),Er($),q.current&&(clearTimeout(q.current.timeout),q.current.reject(new DOMException("Session load interrupted by cleanup","AbortError")),q.current=void 0),Ht!=null&&Ht.clientId&&S6({baseUrl:C,token:E,sessionId:Ht.sessionId,clientId:Ht.clientId}).catch(Xt=>console.warn("[DaemonSessionProvider] detach failed:",Xt)),N.current=void 0}},[u,d,f,C,E,n,se,ke,a,D,qe,Mt,Je,Pt,i,je,st]),v.useEffect(()=>{if(!Z.current||b<=0||x<=0||!re.sessionId)return;let Te=!1,Pe=0;const dt=setInterval(()=>{const Ht=N.current;Ht&&Ht.heartbeat().then(()=>{Te||(Pe>=x&&le(Xt=>Xt.sessionId===Ht.sessionId?{...Xt,status:"connected",error:void 0}:Xt),Pe=0)}).catch(Xt=>{if(Te||(Pe+=1,Pe<x))return;const Dn=Xt instanceof Error?Xt.message:"Session heartbeat failed";le(jn=>jn.sessionId===Ht.sessionId?{...jn,status:"disconnected",error:Dn}:jn)})},b);return()=>{Te=!0,clearInterval(dt)}},[re.sessionId,x,b]);const ye=v.useMemo(()=>$$({store:D,sessionRef:N,activePromptsRef:P,settledPromptsRef:J,pendingSessionLoadRef:q,pendingSessionLoadIdRef:W,heartbeatSupportedRef:Z,passiveAssistantDoneTimerRef:$,addNotice:st,setConnection:le,setPromptStatus:Ee,setRestoreSessionId:wt,setRestoreMode:bt,setRestoreSessionNonce:Ge,setNewSessionNonce:Ze}),[st,D]);return h.jsx(GA.Provider,{value:D,children:h.jsx(WA.Provider,{value:re,children:h.jsx(KA.Provider,{value:be,children:h.jsx(YA.Provider,{value:Oe,children:h.jsx(XA.Provider,{value:$e,children:h.jsx(k3.Provider,{value:ye,children:y})})})})})})}function Lb(e,t,n,r,i,s,a,o={}){var l;if(r.type!=="turn_complete"&&r.type!=="turn_error")return!1;const c=(l=r.data)==null?void 0:l.promptId;if(!c)return!1;const u=e.get(n);if(!u||o.requireBoundPromptId&&u.promptId===void 0||u.promptId!==void 0&&u.promptId!==c)return!1;Er(a);try{const d=u3(r,c);if(!d)return!1;i.dispatch({type:"assistant.done",reason:d.stopReason}),s("idle"),u.resolve?(e.delete(n),u.resolve(d)):(e.delete(n),t.set(vx(n,c),{status:"resolved",result:d}))}catch(d){i.dispatch({type:"assistant.done",reason:"error"}),s("idle"),u.reject?(e.delete(n),u.reject(d)):(e.delete(n),t.set(vx(n,c),{status:"rejected",error:d}))}return!0}function lU(e){return e.type==="turn_complete"}function cU(e){var t;if(e.type!=="session_update")return!1;const n=e.data;return((t=n==null?void 0:n.update)==null?void 0:t.sessionUpdate)==="user_message_chunk"}function M6(e,t,n,r,i={}){i.updateConnection!==!1&&E$(e,r);const s=tP(e,{clientId:t,suppressOwnUserEcho:n.suppressOwnUserEcho,includeRawEvent:n.includeRawEvent}),a=mU(e);return lU(e)?a?[a]:[]:a?[...s,a]:s}function N6(e,t,n){const r=[];for(const i of t){if(i.type!=="error"){r.push(i);continue}if(e.type==="turn_error"){r.push(i);continue}const s=n(uU(e,i));(s.category==="protocol"||s.category==="connection")&&console.warn("[DaemonSessionProvider] daemon notice:",s)}return r}function uU(e,t){const n={message:t.text,debugMessage:t.text,recoverable:t.recoverable};switch(e.type){case"model_switch_failed":return{...n,severity:"error",category:"user_action",operation:"switch_model",code:"daemon.switch_model.failed"};case"session_died":return{...n,severity:"error",category:"connection",operation:"stream",code:t.errorKind??"daemon.session_died"};case"client_evicted":return{...n,severity:"warning",category:"connection",operation:"stream",code:"daemon.client_evicted"};case"stream_error":return{...n,severity:"warning",category:"connection",operation:"stream",code:t.errorKind??"daemon.stream_error"};default:return{...n,severity:"warning",category:"protocol",operation:"normalize_event",code:t.code??"daemon.protocol.error"}}}function _3(){const e=v.useContext(GA);if(!e)throw new Error("useDaemonTranscriptStore must be used within DaemonSessionProvider");return e}function B1(){const e=_3(),t=v.useCallback(()=>e.getSnapshot().blocks,[e]);return v.useSyncExternalStore(e.subscribe,t,t)}function S3(){const e=B1(),t=hU();return v.useMemo(()=>Y$(e,t),[e,t])}function T3(){const e=v.useContext(k3);if(!e)throw new Error("useDaemonActions must be used within DaemonSessionProvider");return e}function dU(){return v.useContext(k3)}function uu(){return v.useContext(XA)}function hU(){const e=v.useContext(KA);if(!e)throw new Error("useDaemonPromptStatus must be used within DaemonSessionProvider");return e}function du(){const e=v.useContext(WA);if(!e)throw new Error("useDaemonConnection must be used within DaemonSessionProvider");return e}function fU(){const e=v.useContext(YA);if(!e)throw new Error("useDaemonSessionNotices must be used within DaemonSessionProvider");return e}function I6(e){return e.some(t=>t.type==="assistant.text.delta"||t.type==="thought.text.delta"||t.type==="tool.update")}function mU(e){if(e.type!=="session_update")return null;const t=ho(e.data)?e.data:void 0,n=ho(t==null?void 0:t.update)?t.update:ho(e.data)?e.data:void 0;if(!n||n.sessionUpdate!=="agent_message_chunk")return null;const r=n._meta;if(!ho(r))return null;const i=pU(r.goalStatus);if(i)return D6(e,i);const s=gU(r.goalTerminal);if(s)return D6(e,s);const a=r.stopHookLoop;if(!ho(a))return null;const o=a.goal;return!ho(o)||!qc(o,"condition"),null}function D6(e,t){return{type:"status",...e.id!==void 0?{eventId:e.id}:{},...e.originatorClientId?{originatorClientId:e.originatorClientId}:{},text:"",source:"goal",data:t}}function pU(e){if(!ho(e))return null;const t=qc(e,"kind");if(t!=="set"&&t!=="cleared"&&t!=="achieved"&&t!=="failed"&&t!=="aborted")return null;const n=qc(e,"condition");if(!n)return null;const r=_f(e,"iterations"),i=_f(e,"durationMs"),s=_f(e,"setAt"),a=qc(e,"lastReason");return{kind:t,condition:n,...r!==void 0?{iterations:r}:{},...i!==void 0?{durationMs:i}:{},...s!==void 0?{setAt:s}:{},...a?{lastReason:a}:{}}}function gU(e){if(!ho(e))return null;const t=qc(e,"kind");if(t!=="achieved"&&t!=="failed"&&t!=="aborted")return null;const n=qc(e,"condition");if(!n)return null;const r=_f(e,"iterations"),i=_f(e,"durationMs"),s=qc(e,"lastReason");return{kind:t,condition:n,...r!==void 0?{iterations:r}:{},...i!==void 0?{durationMs:i}:{},...s?{lastReason:s}:{}}}function qc(e,t){const n=e[t];return typeof n=="string"?n:void 0}function _f(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Bb(e,t){let n=0,r=0,i=0,s=0,a=0,o=0,l,c=0,u=0;for(const d of e)switch(d.type){case"workspace.memory.changed":n+=1;break;case"workspace.agent.changed":r+=1;break;case"workspace.tool.toggled":i+=1;break;case"workspace.settings.changed":s+=1;break;case"workspace.mcp.budget_warning":case"workspace.mcp.child_refused":case"workspace.mcp.server_restarted":case"workspace.mcp.server_restart_refused":a+=1;break;case"workspace.extensions.changed":o+=1,l={...d.status?{status:d.status}:{},...d.source?{source:d.source}:{},...d.name?{name:d.name}:{},...d.version?{version:d.version}:{},...d.error?{error:d.error}:{},refreshed:d.refreshed,failed:d.failed};break;case"workspace.initialized":c+=1;break;case"auth.device_flow.started":case"auth.device_flow.throttled":case"auth.device_flow.authorized":case"auth.device_flow.failed":case"auth.device_flow.cancelled":u+=1;break}n+r+i+s+a+o+c+u!==0&&t(d=>({memoryVersion:d.memoryVersion+n,agentsVersion:d.agentsVersion+r,toolsVersion:d.toolsVersion+i,settingsVersion:d.settingsVersion+s,mcpVersion:d.mcpVersion+a,extensionsVersion:d.extensionsVersion+o,...l?{lastExtensionChange:l}:{},initVersion:d.initVersion+c,authVersion:d.authVersion+u}))}function yU(e){const t=QA(e);return t!==void 0&&rU.has(t)}function bU(e){const t=QA(e);return t!==void 0&&aU.has(t)}function QA(e){if(e instanceof Od||ho(e)&&typeof e.status=="number")return e.status}function ho(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function ih(e,t){const{autoLoad:n=!1,enabled:r=!0}=t,[i,s]=v.useState({data:void 0,loading:!1,error:void 0}),a=v.useRef(0),o=v.useCallback(async()=>{if(!r)return;const l=++a.current;s(c=>({...c,loading:!0,error:void 0}));try{const c=await e();return l!==a.current?void 0:(s({data:c,loading:!1,error:void 0}),c)}catch(c){if(l!==a.current)return;const u=c instanceof Error?c:new Error(String(c));s(d=>({...d,loading:!1,error:u}));return}},[r,e]);return v.useEffect(()=>{!n||!r||o()},[n,r,o]),{...i,reload:o}}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function O0(e,t,n){const r=v.useRef(!1);v.useEffect(()=>{if(!(e===void 0||!n)){if(!r.current){r.current=!0;return}t()}},[n,t,e])}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function vU(e={}){var t;const n=tc(),r=v.useCallback(()=>n.listAgents(),[n]),i=ih(r,e),s=uu();return O0(s==null?void 0:s.agentsVersion,i.reload,e.autoLoad===!0||i.data!==void 0),{...i,status:i.data,agents:((t=i.data)==null?void 0:t.agents)??[],getAgent:n.getAgent,createAgent:n.createAgent,generateAgent:n.generateAgent,deleteAgent:n.deleteAgent,updateAgent:n.updateAgent}}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function xU(e={}){const t=tc(),n=v.useCallback(()=>t.loadMcpStatus(),[t]),r=ih(n,e),i=uu();return O0(i==null?void 0:i.mcpVersion,r.reload,e.autoLoad===!0||r.data!==void 0),{...r,status:r.data,loadTools:t.loadMcpTools,restartServer:t.restartMcpServer,manageServer:t.manageMcpServer}}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function wU(e={}){var t;const n=tc(),r=v.useCallback(()=>n.loadMemoryStatus(),[n]),i=ih(r,e),s=uu();return O0(s==null?void 0:s.memoryVersion,i.reload,e.autoLoad===!0||i.data!==void 0),{...i,status:i.data,files:((t=i.data)==null?void 0:t.files)??[],readFile:n.readWorkspaceFile,writeMemory:n.writeMemory}}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function C3(e={}){const t=UA(),n=dU(),r=v.useCallback(()=>t.actions.listSessions(),[t.actions]),i=!!t.workspaceCwd,s=ih(r,{...e,enabled:(e.enabled??!0)&&i}),{reload:a}=s,o=v.useCallback(async c=>{const u=await t.actions.deleteSession(c);return u&&a(),u},[t.actions,a]),l=v.useCallback(async c=>{const u=await t.actions.deleteSessions(c);return(u.removed.length>0||u.notFound.length>0)&&a(),u},[t.actions,a]);return{...s,sessions:s.data??[],loadSession:n==null?void 0:n.loadSession,resumeSession:n==null?void 0:n.resumeSession,newSession:n==null?void 0:n.newSession,releaseSession:n==null?void 0:n.releaseSession,deleteSession:o,deleteSessions:l}}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function JA(e={}){var t;const n=tc(),r=v.useCallback(()=>n.loadToolsStatus(),[n]),i=ih(r,e),s=uu();return O0(s==null?void 0:s.toolsVersion,i.reload,e.autoLoad===!0||i.data!==void 0),{...i,status:i.data,tools:((t=i.data)==null?void 0:t.tools)??[],setEnabled:n.setWorkspaceToolEnabled}}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function kU(e={}){var t;const n=tc(),r=v.useCallback(()=>n.loadSettingsStatus(),[n]),i=ih(r,e),s=uu();return O0(s==null?void 0:s.settingsVersion,i.reload,e.autoLoad===!0||i.data!==void 0),{...i,status:i.data,settings:((t=i.data)==null?void 0:t.settings)??[],setValue:n.setWorkspaceSetting}}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */const _U=300,SU=100,Pu=Object.freeze({suggestion:null,isVisible:!1,shownAt:0});function zb(e){var t;const n=e;(t=n.clearFollowupSuggestion)==null||t.call(n)}function TU(e){const{enabled:t=!0,onStateChange:n,getOnAccept:r,getOnOutcome:i}=e;let s=Pu,a=null,o=!1,l=null;function c(x){s=x,n(x)}function u(){a&&(clearTimeout(a),a=null),l&&(clearTimeout(l),l=null)}return{setSuggestion:x=>{if(a&&(clearTimeout(a),a=null),!x){c(Pu);return}t&&(a=setTimeout(()=>{c({suggestion:x,isVisible:!0,shownAt:Date.now()})},_U))},accept:(x,g)=>{var y;if(o)return;a&&(clearTimeout(a),a=null),o=!0;const w=s.suggestion,{shownAt:C}=s;if(!w){o=!1;return}try{(y=i())==null||y({outcome:"accepted",accept_method:x,time_ms:C>0?Date.now()-C:0,suggestion_length:w.length})}catch(E){console.error("[followup] onOutcome callback threw:",E)}c(Pu),queueMicrotask(()=>{var E;try{g!=null&&g.skipOnAccept||(E=r())==null||E(w)}catch(S){console.error("[followup] onAccept callback threw:",S)}finally{l&&clearTimeout(l),l=setTimeout(()=>{o=!1},SU)}})},dismiss:()=>{var x;if(a&&(clearTimeout(a),a=null),!(!s.isVisible&&!s.suggestion)){if(s.isVisible&&s.suggestion)try{(x=i())==null||x({outcome:"ignored",time_ms:s.shownAt>0?Date.now()-s.shownAt:0,suggestion_length:s.suggestion.length})}catch(g){console.error("[followup] onOutcome callback threw:",g)}c(Pu)}},clear:()=>{u(),o=!1,c(Pu)},cleanup:()=>{u(),o=!1}}}function CU(e={}){const{enabled:t=!0,onAccept:n,onOutcome:r}=e,i=_3(),[s,a]=v.useState(Pu),o=v.useRef(n);o.current=n;const l=v.useRef(r);l.current=r;const c=v.useSyncExternalStore(i.subscribe,()=>i.getSnapshot().lastFollowupSuggestion,()=>i.getSnapshot().lastFollowupSuggestion),d=v.useSyncExternalStore(X$,E6,E6)??c,f=v.useMemo(()=>TU({enabled:t,onStateChange:a,getOnAccept:()=>o.current,getOnOutcome:()=>l.current}),[t]),{setSuggestion:m}=f;v.useEffect(()=>(t||f.clear(),()=>f.cleanup()),[f,t]);const p=v.useRef(void 0);v.useEffect(()=>{const y=d==null?void 0:d.promptId;y!==p.current&&(p.current=y,m((d==null?void 0:d.suggestion)??null))},[d,m]);const b=v.useCallback(()=>{f.clear(),zb(i),Ob(),p.current=void 0},[f,i]),x=v.useCallback((y,w)=>{f.accept(y,w),zb(i),Ob(),p.current=void 0},[f,i]),g=v.useCallback(()=>{f.dismiss(),zb(i),Ob(),p.current=void 0},[f,i]);return v.useMemo(()=>({followupState:s,onAcceptFollowup:x,onDismissFollowup:g,clear:b}),[s,x,g,b])}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function EU(){const e=v.useSyncExternalStore(Z$,A6,A6),t=v.useCallback(n=>tU(n),[]);return{batches:e,consume:t}}function AU(e){for(const t of e){if(!MU(t))continue;const n=t;if(n.resolved)continue;const r=td(n.toolCall),i=typeof(r==null?void 0:r.toolCallId)=="string"?r.toolCallId:typeof(r==null?void 0:r.id)=="string"?r.id:void 0,s=typeof(r==null?void 0:r.kind)=="string"?r.kind:void 0,a=td(r==null?void 0:r._meta),o=typeof(a==null?void 0:a.toolName)=="string"?a.toolName:void 0;return{id:n.requestId,sessionId:n.sessionId,toolCallId:i,title:n.title,toolKind:s,toolName:o,content:[{type:"text",text:n.title||"Tool permission"}],options:n.options.map(l=>({id:l.optionId,label:l.label,kind:IU(l.raw)})),rawInput:NU(n.toolCall)}}return null}function MU(e){return e.kind==="permission"}function NU(e){const t=td(e);return t?td(t.rawInput)??td(t.input)??td(t.args)??t:void 0}function td(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function IU(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e.kind;return t==="allow_once"||t==="allow_always"||t==="reject_once"||t==="reject_always"?t:void 0}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function DU(e,t,n,r){const i=[...e];let s=!1;for(const a of t)if(a.sessionId===n&&!(a.originatorClientId!==void 0&&a.originatorClientId!==r))for(const o of a.messages){const l=i.findIndex(c=>c.text===o&&(!c.images||c.images.length===0));l>=0&&(i.splice(l,1),s=!0)}return s?i:null}function RU(e,t,n){const r=new Array(e);return new Proxy(r,{get(i,s,a){if(typeof s=="string"){const o=s.charCodeAt(0);if(o>=48&&o<=57){const l=+s;if(Number.isInteger(l)&&l>=0&&l<e){let c=i[l];if(!c){const u=t[l*2];c=i[l]={index:l,key:n(l),start:u,size:t[l*2+1],end:u+t[l*2+1],lane:0}}return c}}if(s==="length")return e}return Reflect.get(i,s,a)}})}function Du(e,t,n){let r=n.initialDeps??[],i,s=!0;function a(){const o=e();return(o.length!==r.length||o.some((c,u)=>r[u]!==c))&&(r=o,i=t(...o),n!=null&&n.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1),i}return a.updateDeps=o=>{r=o},a}function R6(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const OU=(e,t)=>Math.abs(e-t)<1.01,jU=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}};let Rh;const Pb=()=>{if(Rh!==void 0)return Rh;if(typeof navigator>"u")return Rh=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Rh=!0;const e=navigator.maxTouchPoints;return Rh=navigator.platform==="MacIntel"&&e!==void 0&&e>0},O6=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},LU=e=>e,BU=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,i=new Array(r);for(let s=0;s<r;s++)i[s]=t+s;return i},zU=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:o,height:l}=a;t({width:Math.round(o),height:Math.round(l)})};if(i(O6(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){i({width:c.inlineSize,height:c.blockSize});return}}i(O6(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},Tg={passive:!0},PU=typeof window>"u"?!0:"onscrollend"in window,$U=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const s=e.options.useScrollendEvent&&PU;let a=0;const o=s?null:jU(i,()=>t(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=n(r),o==null||o(),t(a,d)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,Tg),s&&r.addEventListener("scrollend",u,Tg),()=>{r.removeEventListener("scroll",c),s&&r.removeEventListener("scrollend",u)}},UU=(e,t)=>$U(e,t,n=>{const{horizontal:r,isRtl:i}=e.options;return r?n.scrollLeft*(i&&-1||1):n.scrollTop}),HU=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),i=n.options.getItemKey(r);return n.itemSizeCache.get(i)??n.options.estimateSize(r)}if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),i=n.options.getItemKey(r),s=n.itemSizeCache.get(i);if(s!==void 0)return s}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},qU=(e,{adjustments:t=0,behavior:n},r)=>{var i,s;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},FU=qU;class VU{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const a=()=>{const o=s.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[c,u]of this.elementsCache)if(u===o){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,s,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{var r,i;const s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:LU,rangeExtractor:BU,onChange:()=>{},measureElement:HU,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const f in n){const m=n[f];m!==void 0&&(s[f]=m)}const a=this.options;let o=null,l=null,c=!1;if(a!==void 0&&a.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){const f=a.count,m=s.count,p=this.getMeasurements(),b=f>0?((r=p[0])==null?void 0:r.key)??a.getItemKey(0):null,x=f>0?((i=p[f-1])==null?void 0:i.key)??a.getItemKey(f-1):null;if(m!==f||f>0&&m>0&&(s.getItemKey(0)!==b||s.getItemKey(m-1)!==x)){c=!0;const w=f>0?this.getVirtualItemForOffset(this.getScrollOffset())??p[0]:null;w&&(o=[w.key,this.getScrollOffset()-w.start]);const C=s.followOnAppend===!0?"auto":s.followOnAppend||null;C&&m>f&&this.isAtEnd(a.scrollEndThreshold)&&(f===0||s.getItemKey(m-1)!==x)&&(l=C)}}this.options=s,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,d=0;if(o&&this.scrollOffset!==null){const[f,m]=o,p=this.getMeasurements(),{count:b,getItemKey:x}=this.options;let g=0;for(;g<b&&x(g)!==f;)g++;if(g<b){const y=p[g];if(y){const w=y.start+m;w!==this.scrollOffset&&(d=w-this.scrollOffset,this.scrollOffset=w,u=!0)}}}(u||l)&&(this.pendingScrollAnchor=[u?o[0]:null,u?o[1]:0,l,d])},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Du(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{this._intendedScrollOffset!==null&&Math.abs(s-this._intendedScrollOffset)<1.5&&(s=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=a,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const s=this.scrollElement,a=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!Pb()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};s.addEventListener("touchstart",a,Tg),s.addEventListener("touchend",o,Tg),this.unsubs.push(()=>{s.removeEventListener("touchstart",a),s.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const i=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled){const[s,a,o,l]=i;s!==null&&!o&&(Pb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;const i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=i,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let a=r-1;a>=0;a--){const o=n[a];if(i.has(o.lane))continue;const l=s.get(o.lane);if(l==null||o.end>l.end?s.set(o.lane,o):o.end<l.end&&i.set(o.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=Du(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,i,s,a,o,l)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:o,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=Du(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:o,laneAssignmentMode:l},c)=>{const u=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const d=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),o===1){const p=this.options.gap,b=n*2;let x=this._flatMeasurements;if(!x||x.length<b){const w=new Float64Array(b);x&&d>0&&w.set(x.subarray(0,d*2)),x=w,this._flatMeasurements=x}let g;if(d===0)g=r+i;else{const w=d-1;g=x[w*2]+x[w*2+1]+p}for(let w=d;w<n;w++){const C=s(w),E=u.get(C),S=typeof E=="number"?E:this.options.estimateSize(w);x[w*2]=g,x[w*2+1]=S,g+=S+p}const y=RU(n,x,s);return this.measurementsCache=y,y}const f=this.measurementsCache.slice(0,d),m=new Array(o).fill(void 0);for(let p=0;p<d;p++){const b=f[p];b&&(m[b.lane]=p)}for(let p=d;p<n;p++){const b=s(p),x=this.laneAssignments.get(p);let g,y;const w=l==="estimate"||u.has(b);if(x!==void 0&&this.options.lanes>1){g=x;const T=m[g],j=T!==void 0?f[T]:void 0;y=j?j.end+this.options.gap:r+i}else{const T=this.options.lanes===1?f[p-1]:this.getFurthestMeasurement(f,p);y=T?T.end+this.options.gap:r+i,g=T?T.lane:p%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(p,g)}const C=u.get(b),E=typeof C=="number"?C:this.options.estimateSize(p),S=y+E;f[p]={index:p,start:y,size:E,end:S,key:b,lane:g},m[g]=p}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Du(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,s)=>this.range=n.length>0&&r>0?GU({measurements:n,outerSize:r,scrollOffset:i,lanes:s,flat:s===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Du(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,s,a)=>s===null||a===null?[]:n({startIndex:s,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(i!==void 0&&this.range){const s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,i-s),o=Math.min(this.options.count-1,i+s);return n>=a&&n<=o}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(n),i=this.options.getItemKey(r),s=this.elementsCache.get(i);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var i,s;if(n<0||n>=this.options.count)return;let a,o,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),o=c[n*2],a=c[n*2+1];else{const f=this.measurementsCache[n];if(!f)return;l=f.key,o=f.start,a=f.size}const u=this.itemSizeCache.get(l)??a,d=r-u;if(d!==0){const f=this.options.anchorTo==="end"&&((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=f?this.getTotalSize():0,p=((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:o,size:a,end:o+a,lane:0},d,this):o<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!=="backward");(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,f?this.applyScrollAdjustment(this.getTotalSize()-m):p&&this.applyScrollAdjustment(d),this.notify(!1)}},this.getVirtualItems=Du(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const o=n[s],l=r[o];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const i=this._flatMeasurements,s=this.options.lanes===1&&i!=null,a=ZA(0,r.length-1,s?o=>i[o*2]:o=>R6(r[o]).start,n);return R6(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),s=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(r==="auto")if(a.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(a.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{const s=this.getOffsetForAlignment(n,r),a=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getOffsetForIndex(n,r);if(!s)return;const[a,o]=s,l=this.now();this.scrollState={index:n,align:o,behavior:i,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,s=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1){const s=r.length-1,a=this._flatMeasurements;a!=null?i=a[s*2]+a[s*2+1]:i=((n=r[s])==null?void 0:n.end)??0}else{const s=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&s.some(o=>o===null);){const o=r[a];s[o.lane]===null&&(s[o.lane]=o.end),a--}i=Math.max(...s.filter(o=>o!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const i of r)i&&this.itemSizeCache.has(i.key)&&n.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){t!==0&&(Pb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=r?r[0]:this.scrollState.lastTargetOffset,s=1,a=i!==this.scrollState.lastTargetOffset;if(!a&&OU(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=s){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(i-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=i,c||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const ZA=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function GU({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){const s=e.length-1,a=i?u=>i[u*2]:u=>e[u].start,o=i?u=>i[u*2]+i[u*2+1]:u=>e[u].end;if(e.length<=r)return{startIndex:0,endIndex:s};let l=ZA(0,s,a,n),c=l;if(r===1)for(;c<s&&o(c)<n+t;)c++;else if(r>1){const u=Array(r).fill(0);for(;c<s&&u.some(f=>f<n+t);){const f=e[c];u[f.lane]=f.end,c++}const d=Array(r).fill(n+t);for(;l>=0&&d.some(f=>f>=n);){const f=e[l];d[f.lane]=f.start,l--}l=Math.max(0,l-l%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const $b=typeof document<"u"?v.useLayoutEffect:v.useEffect;function WU({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const i=v.useReducer(c=>c+1,0)[1],s=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});s.current.enabled=t,s.current.mode=n;const a=c=>{const u=s.current;if(!u.enabled)return;const d=c.getTotalSize();if(u.container&&d!==u.lastSize){u.lastSize=d;const g=c.options.horizontal?"width":"height";u.container.style[g]=`${d}px`}const f=!!c.options.horizontal,m=u.mode==="transform",p=f?"left":"top",b=c.options.scrollMargin,x=c.getVirtualItems();for(const g of x){const y=g.start-b,w=c.elementsCache.get(g.key);w&&u.lastPositions.get(w)!==y&&(u.lastPositions.set(w,y),m?w.style.transform=f?`translate3d(${y}px, 0, 0)`:`translate3d(0, ${y}px, 0)`:w.style[p]=`${y}px`)}},o={...r,onChange:(c,u)=>{var d;const f=s.current;let m=!0;if(f.enabled){a(c);const p=c.range,b=f.prevRange;m=!b||b.isScrolling!==c.isScrolling||b.startIndex!==(p==null?void 0:p.startIndex)||b.endIndex!==(p==null?void 0:p.endIndex),m&&(f.prevRange=p?{startIndex:p.startIndex,endIndex:p.endIndex,isScrolling:c.isScrolling}:null)}m&&(e&&u?fw.flushSync(i):i()),(d=r.onChange)==null||d.call(r,c,u)}},[l]=v.useState(()=>{const c=new VU(o);return Object.assign(c,{containerRef:u=>{const d=s.current;if(d.container=u,d.lastSize=null,u&&d.enabled){const f=c.getTotalSize();d.lastSize=f;const m=c.options.horizontal?"width":"height";u.style[m]=`${f}px`}}})});return l.setOptions(o),$b(()=>l._didMount(),[]),$b(()=>l._willUpdate()),$b(()=>{a(l)}),l}function KU(e){return WU({observeElementRect:zU,observeElementOffset:UU,scrollToFn:FU,...e})}function eM(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function YU(e){var t;return((t=eM(e))==null?void 0:t.type)==="task_execution"}function z1(e){var n;const t=e.toolName.toLowerCase();return t==="agent"||t==="task"||e.subTools||e.subContent||YU(e.rawOutput)?!0:!!((n=e.args)!=null&&n.subagent_type)}function tM(e){var n;if(!z1(e))return!1;const t=eM(e.rawOutput);return(t==null?void 0:t.status)==="background"||((n=e.args)==null?void 0:n.run_in_background)===!0}const nM=v.createContext({}),XU=nM.Provider;function hu(){return v.useContext(nM)}const QU="_row_40fa3_1",JU="_tip_40fa3_12",j6={row:QU,tip:JU};function rM({timestamp:e,children:t}){return e===void 0?h.jsx(h.Fragment,{children:t}):h.jsxs("div",{className:j6.row,children:[t,h.jsx("span",{className:j6.tip,"aria-hidden":"true",children:Cg(e)})]})}function Cg(e,t=new Date){const n=new Date(e),r=a=>String(a).padStart(2,"0"),i=`${r(n.getHours())}:${r(n.getMinutes())}:${r(n.getSeconds())}`;return n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()?i:`${n.getFullYear()}-${r(n.getMonth()+1)}-${r(n.getDate())} ${i}`}function iM({className:e,style:t}){return h.jsx("svg",{className:e,style:t,width:"0.6em",height:"0.85em",viewBox:"0 0 10 14",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M1.5 1.5 L8 7 L1.5 12.5",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}const ZU="modulepreload",eH=function(e){return"/"+e},L6={},U=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=eH(l),l in L6)return;L6[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":ZU,c||(d.as="script"),d.crossOrigin="",d.href=l,o&&d.setAttribute("nonce",o),document.head.appendChild(d),c)return new Promise((f,m)=>{d.addEventListener("load",f),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})},$i={Dark:"dark",Light:"light"},Jh=[$i.Dark,$i.Light],sM=v.createContext($i.Dark),tH=sM.Provider;function aM(){return v.useContext(sM)}const Sc="ui.theme",nd="general.language";function E3(e,t){return e===$i.Light||e==="Qwen Light"?$i.Light:e===$i.Dark||e==="Qwen Dark"?$i.Dark:t}function B6(e){return e===$i.Light?"Qwen Light":"Qwen Dark"}function z6(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&t.push(a),i=r+1,r=n.indexOf(",",i)}return t}function oM(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const nH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iH={};function P6(e,t){return(iH.jsx?rH:nH).test(e)}const sH=/[ \t\n\f\r]/g;function P1(e){return typeof e=="object"?e.type==="text"?$6(e.value):!1:$6(e)}function $6(e){return e.replace(sH,"")===""}class j0{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}j0.prototype.normal={};j0.prototype.property={};j0.prototype.space=void 0;function lM(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new j0(n,r,t)}function Qf(e){return e.toLowerCase()}class Wi{constructor(t,n){this.attribute=n,this.property=t}}Wi.prototype.attribute="";Wi.prototype.booleanish=!1;Wi.prototype.boolean=!1;Wi.prototype.commaOrSpaceSeparated=!1;Wi.prototype.commaSeparated=!1;Wi.prototype.defined=!1;Wi.prototype.mustUseProperty=!1;Wi.prototype.number=!1;Wi.prototype.overloadedBoolean=!1;Wi.prototype.property="";Wi.prototype.spaceSeparated=!1;Wi.prototype.space=void 0;let aH=0;const Et=fu(),mr=fu(),kx=fu(),Ae=fu(),En=fu(),Fc=fu(),Ji=fu();function fu(){return 2**++aH}const _x=Object.freeze(Object.defineProperty({__proto__:null,boolean:Et,booleanish:mr,commaOrSpaceSeparated:Ji,commaSeparated:Fc,number:Ae,overloadedBoolean:kx,spaceSeparated:En},Symbol.toStringTag,{value:"Module"})),Ub=Object.keys(_x);class A3 extends Wi{constructor(t,n,r,i){let s=-1;if(super(t,n),U6(this,"space",i),typeof r=="number")for(;++s<Ub.length;){const a=Ub[s];U6(this,Ub[s],(r&_x[a])===_x[a])}}}A3.prototype.defined=!0;function U6(e,t,n){n&&(e[t]=n)}function sh(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new A3(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Qf(r)]=r,n[Qf(s.attribute)]=r}return new j0(t,n,e.space)}const cM=sh({properties:{ariaActiveDescendant:null,ariaAtomic:mr,ariaAutoComplete:null,ariaBusy:mr,ariaChecked:mr,ariaColCount:Ae,ariaColIndex:Ae,ariaColSpan:Ae,ariaControls:En,ariaCurrent:null,ariaDescribedBy:En,ariaDetails:null,ariaDisabled:mr,ariaDropEffect:En,ariaErrorMessage:null,ariaExpanded:mr,ariaFlowTo:En,ariaGrabbed:mr,ariaHasPopup:null,ariaHidden:mr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:En,ariaLevel:Ae,ariaLive:null,ariaModal:mr,ariaMultiLine:mr,ariaMultiSelectable:mr,ariaOrientation:null,ariaOwns:En,ariaPlaceholder:null,ariaPosInSet:Ae,ariaPressed:mr,ariaReadOnly:mr,ariaRelevant:null,ariaRequired:mr,ariaRoleDescription:En,ariaRowCount:Ae,ariaRowIndex:Ae,ariaRowSpan:Ae,ariaSelected:mr,ariaSetSize:Ae,ariaSort:null,ariaValueMax:Ae,ariaValueMin:Ae,ariaValueNow:Ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function uM(e,t){return t in e?e[t]:t}function dM(e,t){return uM(e,t.toLowerCase())}const oH=sh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fc,acceptCharset:En,accessKey:En,action:null,allow:null,allowFullScreen:Et,allowPaymentRequest:Et,allowUserMedia:Et,alpha:Et,alt:null,as:null,async:Et,autoCapitalize:null,autoComplete:En,autoFocus:Et,autoPlay:Et,blocking:En,capture:null,charSet:null,checked:Et,cite:null,className:En,closedBy:null,colorSpace:null,cols:Ae,colSpan:Ae,command:null,commandFor:null,content:null,contentEditable:mr,controls:Et,controlsList:En,coords:Ae|Fc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Et,defer:Et,dir:null,dirName:null,disabled:Et,download:kx,draggable:mr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Et,formTarget:null,headers:En,height:Ae,hidden:kx,high:Ae,href:null,hrefLang:null,htmlFor:En,httpEquiv:En,id:null,imageSizes:null,imageSrcSet:null,inert:Et,inputMode:null,integrity:null,is:null,isMap:Et,itemId:null,itemProp:En,itemRef:En,itemScope:Et,itemType:En,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Et,low:Ae,manifest:null,max:null,maxLength:Ae,media:null,method:null,min:null,minLength:Ae,multiple:Et,muted:Et,name:null,nonce:null,noModule:Et,noValidate:Et,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:Et,optimum:Ae,pattern:null,ping:En,placeholder:null,playsInline:Et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Et,referrerPolicy:null,rel:En,required:Et,reversed:Et,rows:Ae,rowSpan:Ae,sandbox:En,scope:null,scoped:Et,seamless:Et,selected:Et,shadowRootClonable:Et,shadowRootCustomElementRegistry:Et,shadowRootDelegatesFocus:Et,shadowRootMode:null,shadowRootSerializable:Et,shape:null,size:Ae,sizes:null,slot:null,span:Ae,spellCheck:mr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ae,step:null,style:null,tabIndex:Ae,target:null,title:null,translate:null,type:null,typeMustMatch:Et,useMap:null,value:mr,width:Ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:En,axis:null,background:null,bgColor:null,border:Ae,borderColor:null,bottomMargin:Ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Et,declare:Et,event:null,face:null,frame:null,frameBorder:null,hSpace:Ae,leftMargin:Ae,link:null,longDesc:null,lowSrc:null,marginHeight:Ae,marginWidth:Ae,noResize:Et,noHref:Et,noShade:Et,noWrap:Et,object:null,profile:null,prompt:null,rev:null,rightMargin:Ae,rules:null,scheme:null,scrolling:mr,standby:null,summary:null,text:null,topMargin:Ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ae,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Et,disablePictureInPicture:Et,disableRemotePlayback:Et,exportParts:Fc,part:En,prefix:null,property:null,results:Ae,security:null,unselectable:null},space:"html",transform:dM}),lH=sh({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ji,accentHeight:Ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ae,amplitude:Ae,arabicForm:null,ascent:Ae,attributeName:null,attributeType:null,azimuth:Ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ae,by:null,calcMode:null,capHeight:Ae,className:En,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ae,diffuseConstant:Ae,direction:null,display:null,dur:null,divisor:Ae,dominantBaseline:null,download:Et,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ae,enableBackground:null,end:null,event:null,exponent:Ae,externalResourcesRequired:null,fill:null,fillOpacity:Ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Fc,g2:Fc,glyphName:Fc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ae,horizOriginX:Ae,horizOriginY:Ae,id:null,ideographic:Ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ae,k:Ae,k1:Ae,k2:Ae,k3:Ae,k4:Ae,kernelMatrix:Ji,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ae,overlineThickness:Ae,paintOrder:null,panose1:null,path:null,pathLength:Ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:En,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ae,pointsAtY:Ae,pointsAtZ:Ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ji,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ji,rev:Ji,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ji,requiredFeatures:Ji,requiredFonts:Ji,requiredFormats:Ji,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ae,specularExponent:Ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ae,strikethroughThickness:Ae,string:null,stroke:null,strokeDashArray:Ji,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ae,strokeOpacity:Ae,strokeWidth:null,style:null,surfaceScale:Ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ji,tabIndex:Ae,tableValues:null,target:null,targetX:Ae,targetY:Ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ji,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ae,underlineThickness:Ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ae,values:null,vAlphabetic:Ae,vMathematical:Ae,vectorEffect:null,vHanging:Ae,vIdeographic:Ae,version:null,vertAdvY:Ae,vertOriginX:Ae,vertOriginY:Ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uM}),hM=sh({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()}}),fM=sh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dM}),mM=sh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),cH={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"},uH=/[A-Z]/g,H6=/-[a-z]/g,dH=/^data[-\w.:]+$/i;function M3(e,t){const n=Qf(t);let r=t,i=Wi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&dH.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(H6,fH);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!H6.test(s)){let a=s.replace(uH,hH);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=A3}return new i(r,t)}function hH(e){return"-"+e.toLowerCase()}function fH(e){return e.charAt(1).toUpperCase()}const N3=lM([cM,oH,hM,fM,mM],"html"),ah=lM([cM,lH,hM,fM,mM],"svg");function q6(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function pM(e){return e.join(" ").trim()}var I3={},F6=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,mH=/\n/g,pH=/^\s*/,gH=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,yH=/^:\s*/,bH=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vH=/^[;\s]*/,xH=/^\s+|\s+$/g,wH=`
`,V6="/",G6="*",Tc="",kH="comment",_H="declaration";function SH(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var b=p.match(mH);b&&(n+=b.length);var x=p.lastIndexOf(wH);r=~x?p.length-x:r+p.length}function s(){var p={line:n,column:r};return function(b){return b.position=new a(p),c(),b}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var b=new Error(t.source+":"+n+":"+r+": "+p);if(b.reason=p,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(p){var b=p.exec(e);if(b){var x=b[0];return i(x),e=e.slice(x.length),b}}function c(){l(pH)}function u(p){var b;for(p=p||[];b=d();)b!==!1&&p.push(b);return p}function d(){var p=s();if(!(V6!=e.charAt(0)||G6!=e.charAt(1))){for(var b=2;Tc!=e.charAt(b)&&(G6!=e.charAt(b)||V6!=e.charAt(b+1));)++b;if(b+=2,Tc===e.charAt(b-1))return o("End of comment missing");var x=e.slice(2,b-2);return r+=2,i(x),e=e.slice(b),r+=2,p({type:kH,comment:x})}}function f(){var p=s(),b=l(gH);if(b){if(d(),!l(yH))return o("property missing ':'");var x=l(bH),g=p({type:_H,property:W6(b[0].replace(F6,Tc)),value:x?W6(x[0].replace(F6,Tc)):Tc});return l(vH),g}}function m(){var p=[];u(p);for(var b;b=f();)b!==!1&&(p.push(b),u(p));return p}return c(),m()}function W6(e){return e?e.replace(xH,Tc):Tc}var TH=SH,CH=Vp&&Vp.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I3,"__esModule",{value:!0});I3.default=AH;const EH=CH(TH);function AH(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,EH.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var $1={};Object.defineProperty($1,"__esModule",{value:!0});$1.camelCase=void 0;var MH=/^--[a-zA-Z0-9_-]+$/,NH=/-([a-z])/g,IH=/^[^-]+$/,DH=/^-(webkit|moz|ms|o|khtml)-/,RH=/^-(ms)-/,OH=function(e){return!e||IH.test(e)||MH.test(e)},jH=function(e,t){return t.toUpperCase()},K6=function(e,t){return"".concat(t,"-")},LH=function(e,t){return t===void 0&&(t={}),OH(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(RH,K6):e=e.replace(DH,K6),e.replace(NH,jH))};$1.camelCase=LH;var BH=Vp&&Vp.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},zH=BH(I3),PH=$1;function Sx(e,t){var n={};return!e||typeof e!="string"||(0,zH.default)(e,function(r,i){r&&i&&(n[(0,PH.camelCase)(r,t)]=i)}),n}Sx.default=Sx;var $H=Sx;const UH=p1($H),gM=yM("end"),D3=yM("start");function yM(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 HH(e){const t=D3(e),n=gM(e);if(t&&n)return{start:t,end:n}}function Sf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Y6(e.position):"start"in e||"end"in e?Y6(e):"line"in e||"column"in e?Tx(e):""}function Tx(e){return X6(e&&e.line)+":"+X6(e&&e.column)}function Y6(e){return Tx(e&&e.start)+"-"+Tx(e&&e.end)}function X6(e){return e&&typeof e=="number"?e:1}class ci extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Sf(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ci.prototype.file="";ci.prototype.name="";ci.prototype.reason="";ci.prototype.message="";ci.prototype.stack="";ci.prototype.column=void 0;ci.prototype.line=void 0;ci.prototype.ancestors=void 0;ci.prototype.cause=void 0;ci.prototype.fatal=void 0;ci.prototype.place=void 0;ci.prototype.ruleId=void 0;ci.prototype.source=void 0;const R3={}.hasOwnProperty,qH=new Map,FH=/[A-Z]/g,VH=new Set(["table","tbody","thead","tfoot","tr"]),GH=new Set(["td","th"]),bM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function WH(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=tq(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=eq(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"?ah:N3,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=vM(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function vM(e,t,n){if(t.type==="element")return KH(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return YH(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return QH(e,t,n);if(t.type==="mdxjsEsm")return XH(e,t);if(t.type==="root")return JH(e,t,n);if(t.type==="text")return ZH(e,t)}function KH(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ah,e.schema=i),e.ancestors.push(t);const s=wM(e,t.tagName,!1),a=nq(e,t);let o=j3(e,t);return VH.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!P1(l):!0})),xM(e,a,s,t),O3(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function YH(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)}Jf(e,t.position)}function XH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jf(e,t.position)}function QH(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ah,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:wM(e,t.name,!0),a=rq(e,t),o=j3(e,t);return xM(e,a,s,t),O3(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function JH(e,t,n){const r={};return O3(r,j3(e,t)),e.create(t,e.Fragment,r,n)}function ZH(e,t){return t.value}function xM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function O3(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function eq(e,t,n){return r;function r(i,s,a,o){const c=Array.isArray(a.children)?n:t;return o?c(s,a,o):c(s,a)}}function tq(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=D3(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function nq(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&R3.call(t.properties,i)){const s=iq(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&GH.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function rq(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Jf(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else Jf(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function j3(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:qH;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const o=vM(e,s,a);o!==void 0&&n.push(o)}return n}function iq(e,t,n){const r=M3(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?oM(n):pM(n)),r.property==="style"){let i=typeof n=="object"?n:sq(e,String(n));return e.stylePropertyNameCase==="css"&&(i=aq(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?cH[r.property]||r.property:r.attribute,n]}}function sq(e,t){try{return UH(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ci("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=bM+"#cannot-parse-style-attribute",i}}function wM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=P6(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=P6(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return R3.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Jf(e)}function Jf(e,t){const n=new ci("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=bM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function aq(e){const t={};let n;for(n in e)R3.call(e,n)&&(t[oq(n)]=e[n]);return t}function oq(e){let t=e.replace(FH,lq);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lq(e){return"-"+e.toLowerCase()}const Hb={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"]},cq={};function L3(e,t){const n=cq,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return kM(e,r,i)}function kM(e,t,n){if(uq(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 Q6(e.children,t,n)}return Array.isArray(e)?Q6(e,t,n):""}function Q6(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=kM(e[i],t,n);return r.join("")}function uq(e){return!!(e&&typeof e=="object")}const J6=document.createElement("i");function B3(e){const t="&"+e+";";J6.innerHTML=t;const n=J6.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ds(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Ns(e,t){return e.length>0?(ds(e,e.length,0,t),e):t}const Z6={}.hasOwnProperty;function _M(e){const t={};let n=-1;for(;++n<e.length;)dq(t,e[n]);return t}function dq(e,t){let n;for(n in t){const i=(Z6.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){Z6.call(i,a)||(i[a]=[]);const o=s[a];hq(i[a],Array.isArray(o)?o:o?[o]:[])}}}function hq(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ds(e,0,0,r)}function SM(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)}function ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Si=nc(/[A-Za-z]/),ai=nc(/[\dA-Za-z]/),fq=nc(/[#-'*+\--9=?A-Z^-~]/);function Eg(e){return e!==null&&(e<32||e===127)}const Cx=nc(/\d/),mq=nc(/[\dA-Fa-f]/),pq=nc(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function Nn(e){return e!==null&&(e<0||e===32)}function Gt(e){return e===-2||e===-1||e===32}const U1=nc(new RegExp("\\p{P}|\\p{S}","u")),Zc=nc(/\s/);function nc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function oh(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&ai(e.charCodeAt(n+1))&&ai(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function qt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return Gt(l)?(e.enter(n),o(l)):t(l)}function o(l){return Gt(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const gq={tokenize:yq};function yq(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),qt(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return it(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const bq={tokenize:vq},eS={tokenize:xq};function vq(e){const t=this,n=[];let r=0,i,s,a;return o;function o(w){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const C=t.events.length;let E=C,S;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){S=t.events[E][1].end;break}g(r);let T=C;for(;T<t.events.length;)t.events[T][1].end={...S},T++;return ds(t.events,E+1,0,t.events.slice(C)),t.events.length=T,c(w)}return o(w)}function c(w){if(r===n.length){if(!i)return f(w);if(i.currentConstruct&&i.currentConstruct.concrete)return p(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(eS,u,d)(w)}function u(w){return i&&y(),g(r),f(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(w)}function f(w){return t.containerState={},e.attempt(eS,m,p)(w)}function m(w){return r++,n.push([t.currentConstruct,t.containerState]),f(w)}function p(w){if(w===null){i&&y(),g(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),b(w)}function b(w){if(w===null){x(e.exit("chunkFlow"),!0),g(0),e.consume(w);return}return it(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(w),b)}function x(w,C){const E=t.sliceStream(w);if(C&&E.push(null),w.previous=s,s&&(s.next=w),s=w,i.defineSkip(w.start),i.write(E),t.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<a&&(!i.events[S][1].end||i.events[S][1].end.offset>a))return;const T=t.events.length;let j=T,z,R;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(z){R=t.events[j][1].end;break}z=!0}for(g(r),S=T;S<t.events.length;)t.events[S][1].end={...R},S++;ds(t.events,j+1,0,t.events.slice(T)),t.events.length=S}}function g(w){let C=n.length;for(;C-- >w;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=w}function y(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function xq(e,t,n){return qt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function jd(e){if(e===null||Nn(e)||Zc(e))return 1;if(U1(e))return 2}function H1(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Ex={name:"attention",resolveAll:wq,tokenize:kq};function wq(e,t){let n=-1,r,i,s,a,o,l,c,u;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;l=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 d={...e[r][1].end},f={...e[n][1].start};tS(d,-l),tS(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ns(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ns(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Ns(c,H1(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ns(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Ns(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,ds(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function kq(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=jd(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const c=e.exit("attentionSequence"),u=jd(l),d=!u||u===2&&i||n.includes(l),f=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!f)),c._close=!!(s===42?f:f&&(u||!d)),t(l)}}function tS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _q={name:"autolink",tokenize:Sq};function Sq(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(m){return Si(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||ai(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||ai(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Eg(m)?n(m):(e.consume(m),l)}function c(m){return m===64?(e.consume(m),u):fq(m)?(e.consume(m),c):n(m)}function u(m){return ai(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,u):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||ai(m))&&r++<63){const p=m===45?f:d;return e.consume(m),p}return n(m)}}const L0={partial:!0,tokenize:Tq};function Tq(e,t,n){return r;function r(s){return Gt(s)?qt(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||it(s)?t(s):n(s)}}const TM={continuation:{tokenize:Eq},exit:Aq,name:"blockQuote",tokenize:Cq};function Cq(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return Gt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Eq(e,t,n){const r=this;return i;function i(a){return Gt(a)?qt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(TM,t,n)(a)}}function Aq(e){e.exit("blockQuote")}const CM={name:"characterEscape",tokenize:Mq};function Mq(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return pq(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const EM={name:"characterReference",tokenize:Nq};function Nq(e,t,n){const r=this;let i=0,s,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=ai,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=mq,u):(e.enter("characterReferenceValue"),s=7,a=Cx,u(d))}function u(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===ai&&!B3(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<s?(e.consume(d),u):n(d)}}const nS={partial:!0,tokenize:Dq},rS={concrete:!0,name:"codeFenced",tokenize:Iq};function Iq(e,t,n){const r=this,i={partial:!0,tokenize:E};let s=0,a=0,o;return l;function l(S){return c(S)}function c(S){const T=r.events[r.events.length-1];return s=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,o=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===o?(a++,e.consume(S),u):a<3?n(S):(e.exit("codeFencedFenceSequence"),Gt(S)?qt(e,d,"whitespace")(S):d(S))}function d(S){return S===null||it(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(nS,b,C)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||it(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):Gt(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qt(e,m,"whitespace")(S)):S===96&&S===o?n(S):(e.consume(S),f)}function m(S){return S===null||it(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||it(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===o?n(S):(e.consume(S),p)}function b(S){return e.attempt(i,C,x)(S)}function x(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),g}function g(S){return s>0&&Gt(S)?qt(e,y,"linePrefix",s+1)(S):y(S)}function y(S){return S===null||it(S)?e.check(nS,b,C)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||it(S)?(e.exit("codeFlowValue"),y(S)):(e.consume(S),w)}function C(S){return e.exit("codeFenced"),t(S)}function E(S,T,j){let z=0;return R;function R(J){return S.enter("lineEnding"),S.consume(J),S.exit("lineEnding"),D}function D(J){return S.enter("codeFencedFence"),Gt(J)?qt(S,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):N(J)}function N(J){return J===o?(S.enter("codeFencedFenceSequence"),B(J)):j(J)}function B(J){return J===o?(z++,S.consume(J),B):z>=a?(S.exit("codeFencedFenceSequence"),Gt(J)?qt(S,P,"whitespace")(J):P(J)):j(J)}function P(J){return J===null||it(J)?(S.exit("codeFencedFence"),T(J)):j(J)}}}function Dq(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const qb={name:"codeIndented",tokenize:Oq},Rq={partial:!0,tokenize:jq};function Oq(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),qt(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):it(c)?e.attempt(Rq,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||it(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function jq(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):it(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):qt(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):it(a)?i(a):n(a)}}const Lq={name:"codeText",previous:zq,resolve:Bq,tokenize:Pq};function Bq(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 zq(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Pq(e,t,n){let r=0,i,s;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):it(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||it(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}class $q{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 s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Oh(this.left,r),s.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),Oh(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Oh(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);Oh(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Oh(this.left,n.reverse())}}}function Oh(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 AM(e){const t={};let n=-1,r,i,s,a,o,l,c;const u=new $q(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Uq(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=u.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},o=u.slice(i,n),o.unshift(r),u.splice(i,n-i+1,o))}}return ds(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Uq(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],c={};let u,d,f=-1,m=n,p=0,b=0;const x=[b];for(;m;){for(;e.get(++i)[1]!==m;);s.push(i),m._tokenizer||(u=r.sliceStream(m),m.next||u.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(b=f+1,x.push(b),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):x.pop(),f=x.length;f--;){const g=o.slice(x[f],x[f+1]),y=s.pop();l.push([y,y+g.length-1]),e.splice(y,2,g)}for(l.reverse(),f=-1;++f<l.length;)c[p+l[f][0]]=p+l[f][1],p+=l[f][1]-l[f][0]-1;return c}const Hq={resolve:Fq,tokenize:Vq},qq={partial:!0,tokenize:Gq};function Fq(e){return AM(e),e}function Vq(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):it(o)?e.check(qq,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Gq(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),qt(e,s,"linePrefix")}function s(a){if(a===null||it(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function MM(e,t,n,r,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(g),e.exit(s),f):g===null||g===32||g===41||Eg(g)?n(g):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(g))}function f(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===62?(e.exit("chunkString"),e.exit(o),f(g)):g===null||g===60||it(g)?n(g):(e.consume(g),g===92?p:m)}function p(g){return g===60||g===62||g===92?(e.consume(g),m):m(g)}function b(g){return!u&&(g===null||g===41||Nn(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,b):g===41?(e.consume(g),u--,b):g===null||g===32||g===40||Eg(g)?n(g):(e.consume(g),g===92?x:b)}function x(g){return g===40||g===41||g===92?(e.consume(g),b):b(g)}}function NM(e,t,n,r,i,s){const a=this;let o=0,l;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(s),u}function u(m){return o>999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(s),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):it(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||it(m)||o++>999?(e.exit("chunkString"),u(m)):(e.consume(m),l||(l=!Gt(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function IM(e,t,n,r,i,s){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),c(f))}function c(f){return f===a?(e.exit(s),l(a)):f===null?n(f):it(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),qt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===a||f===null||it(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===a||f===92?(e.consume(f),u):u(f)}}function Tf(e,t){let n;return r;function r(i){return it(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Gt(i)?qt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Wq={name:"definition",tokenize:Yq},Kq={partial:!0,tokenize:Xq};function Yq(e,t,n){const r=this;let i;return s;function s(m){return e.enter("definition"),a(m)}function a(m){return NM.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=ia(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return Nn(m)?Tf(e,c)(m):c(m)}function c(m){return MM(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return e.attempt(Kq,d,d)(m)}function d(m){return Gt(m)?qt(e,f,"whitespace")(m):f(m)}function f(m){return m===null||it(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function Xq(e,t,n){return r;function r(o){return Nn(o)?Tf(e,i)(o):n(o)}function i(o){return IM(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return Gt(o)?qt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||it(o)?t(o):n(o)}}const Qq={name:"hardBreakEscape",tokenize:Jq};function Jq(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return it(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Zq={name:"headingAtx",resolve:eF,tokenize:tF};function eF(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ds(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function tF(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||Nn(u)?(e.exit("atxHeadingSequence"),o(u)):n(u)}function o(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||it(u)?(e.exit("atxHeading"),t(u)):Gt(u)?qt(e,o,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),o(u))}function c(u){return u===null||u===35||Nn(u)?(e.exit("atxHeadingText"),o(u)):(e.consume(u),c)}}const nF=["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"],iS=["pre","script","style","textarea"],rF={concrete:!0,name:"htmlFlow",resolveTo:aF,tokenize:oF},iF={partial:!0,tokenize:cF},sF={partial:!0,tokenize:lF};function aF(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 oF(e,t,n){const r=this;let i,s,a,o,l;return c;function c(O){return u(O)}function u(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),f):O===47?(e.consume(O),s=!0,b):O===63?(e.consume(O),i=3,r.interrupt?t:M):Si(O)?(e.consume(O),a=String.fromCharCode(O),x):n(O)}function f(O){return O===45?(e.consume(O),i=2,m):O===91?(e.consume(O),i=5,o=0,p):Si(O)?(e.consume(O),i=4,r.interrupt?t:M):n(O)}function m(O){return O===45?(e.consume(O),r.interrupt?t:M):n(O)}function p(O){const se="CDATA[";return O===se.charCodeAt(o++)?(e.consume(O),o===se.length?r.interrupt?t:N:p):n(O)}function b(O){return Si(O)?(e.consume(O),a=String.fromCharCode(O),x):n(O)}function x(O){if(O===null||O===47||O===62||Nn(O)){const se=O===47,ke=a.toLowerCase();return!se&&!s&&iS.includes(ke)?(i=1,r.interrupt?t(O):N(O)):nF.includes(a.toLowerCase())?(i=6,se?(e.consume(O),g):r.interrupt?t(O):N(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):s?y(O):w(O))}return O===45||ai(O)?(e.consume(O),a+=String.fromCharCode(O),x):n(O)}function g(O){return O===62?(e.consume(O),r.interrupt?t:N):n(O)}function y(O){return Gt(O)?(e.consume(O),y):R(O)}function w(O){return O===47?(e.consume(O),R):O===58||O===95||Si(O)?(e.consume(O),C):Gt(O)?(e.consume(O),w):R(O)}function C(O){return O===45||O===46||O===58||O===95||ai(O)?(e.consume(O),C):E(O)}function E(O){return O===61?(e.consume(O),S):Gt(O)?(e.consume(O),E):w(O)}function S(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),l=O,T):Gt(O)?(e.consume(O),S):j(O)}function T(O){return O===l?(e.consume(O),l=null,z):O===null||it(O)?n(O):(e.consume(O),T)}function j(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Nn(O)?E(O):(e.consume(O),j)}function z(O){return O===47||O===62||Gt(O)?w(O):n(O)}function R(O){return O===62?(e.consume(O),D):n(O)}function D(O){return O===null||it(O)?N(O):Gt(O)?(e.consume(O),D):n(O)}function N(O){return O===45&&i===2?(e.consume(O),q):O===60&&i===1?(e.consume(O),W):O===62&&i===4?(e.consume(O),X):O===63&&i===3?(e.consume(O),M):O===93&&i===5?(e.consume(O),Z):it(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(iF,H,B)(O)):O===null||it(O)?(e.exit("htmlFlowData"),B(O)):(e.consume(O),N)}function B(O){return e.check(sF,P,H)(O)}function P(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),J}function J(O){return O===null||it(O)?B(O):(e.enter("htmlFlowData"),N(O))}function q(O){return O===45?(e.consume(O),M):N(O)}function W(O){return O===47?(e.consume(O),a="",$):N(O)}function $(O){if(O===62){const se=a.toLowerCase();return iS.includes(se)?(e.consume(O),X):N(O)}return Si(O)&&a.length<8?(e.consume(O),a+=String.fromCharCode(O),$):N(O)}function Z(O){return O===93?(e.consume(O),M):N(O)}function M(O){return O===62?(e.consume(O),X):O===45&&i===2?(e.consume(O),M):N(O)}function X(O){return O===null||it(O)?(e.exit("htmlFlowData"),H(O)):(e.consume(O),X)}function H(O){return e.exit("htmlFlow"),t(O)}}function lF(e,t,n){const r=this;return i;function i(a){return it(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function cF(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(L0,t,n)}}const uF={name:"htmlText",tokenize:dF};function dF(e,t,n){const r=this;let i,s,a;return o;function o(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),l}function l(M){return M===33?(e.consume(M),c):M===47?(e.consume(M),E):M===63?(e.consume(M),w):Si(M)?(e.consume(M),j):n(M)}function c(M){return M===45?(e.consume(M),u):M===91?(e.consume(M),s=0,p):Si(M)?(e.consume(M),y):n(M)}function u(M){return M===45?(e.consume(M),m):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),f):it(M)?(a=d,W(M)):(e.consume(M),d)}function f(M){return M===45?(e.consume(M),m):d(M)}function m(M){return M===62?q(M):M===45?f(M):d(M)}function p(M){const X="CDATA[";return M===X.charCodeAt(s++)?(e.consume(M),s===X.length?b:p):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),x):it(M)?(a=b,W(M)):(e.consume(M),b)}function x(M){return M===93?(e.consume(M),g):b(M)}function g(M){return M===62?q(M):M===93?(e.consume(M),g):b(M)}function y(M){return M===null||M===62?q(M):it(M)?(a=y,W(M)):(e.consume(M),y)}function w(M){return M===null?n(M):M===63?(e.consume(M),C):it(M)?(a=w,W(M)):(e.consume(M),w)}function C(M){return M===62?q(M):w(M)}function E(M){return Si(M)?(e.consume(M),S):n(M)}function S(M){return M===45||ai(M)?(e.consume(M),S):T(M)}function T(M){return it(M)?(a=T,W(M)):Gt(M)?(e.consume(M),T):q(M)}function j(M){return M===45||ai(M)?(e.consume(M),j):M===47||M===62||Nn(M)?z(M):n(M)}function z(M){return M===47?(e.consume(M),q):M===58||M===95||Si(M)?(e.consume(M),R):it(M)?(a=z,W(M)):Gt(M)?(e.consume(M),z):q(M)}function R(M){return M===45||M===46||M===58||M===95||ai(M)?(e.consume(M),R):D(M)}function D(M){return M===61?(e.consume(M),N):it(M)?(a=D,W(M)):Gt(M)?(e.consume(M),D):z(M)}function N(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,B):it(M)?(a=N,W(M)):Gt(M)?(e.consume(M),N):(e.consume(M),P)}function B(M){return M===i?(e.consume(M),i=void 0,J):M===null?n(M):it(M)?(a=B,W(M)):(e.consume(M),B)}function P(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Nn(M)?z(M):(e.consume(M),P)}function J(M){return M===47||M===62||Nn(M)?z(M):n(M)}function q(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function W(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),$}function $(M){return Gt(M)?qt(e,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):Z(M)}function Z(M){return e.enter("htmlTextData"),a(M)}}const z3={name:"labelEnd",resolveAll:pF,resolveTo:gF,tokenize:yF},hF={tokenize:bF},fF={tokenize:vF},mF={tokenize:xF};function pF(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&&ds(e,0,e.length,n),e}function gF(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=Ns(o,e.slice(s+1,s+r+3)),o=Ns(o,[["enter",u,t]]),o=Ns(o,H1(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=Ns(o,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),o=Ns(o,e.slice(a+1)),o=Ns(o,[["exit",l,t]]),ds(e,s,e.length,o),e}function yF(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(f){return s?s._inactive?d(f):(a=r.parser.defined.includes(ia(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(hF,u,a?u:d)(f):f===91?e.attempt(fF,u,a?c:d)(f):a?u(f):d(f)}function c(f){return e.attempt(mF,u,d)(f)}function u(f){return t(f)}function d(f){return s._balanced=!0,n(f)}}function bF(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Nn(d)?Tf(e,s)(d):s(d)}function s(d){return d===41?u(d):MM(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Nn(d)?Tf(e,l)(d):u(d)}function o(d){return n(d)}function l(d){return d===34||d===39||d===40?IM(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Nn(d)?Tf(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function vF(e,t,n){const r=this;return i;function i(o){return NM.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(ia(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function xF(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const wF={name:"labelStartImage",resolveAll:z3.resolveAll,tokenize:kF};function kF(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const _F={name:"labelStartLink",resolveAll:z3.resolveAll,tokenize:SF};function SF(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Fb={name:"lineEnding",tokenize:TF};function TF(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qt(e,t,"linePrefix")}}const Mp={name:"thematicBreak",tokenize:CF};function CF(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||it(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Gt(c)?qt(e,o,"whitespace")(c):o(c))}}const Oi={continuation:{tokenize:NF},exit:DF,name:"list",tokenize:MF},EF={partial:!0,tokenize:RF},AF={partial:!0,tokenize:IF};function MF(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Cx(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Mp,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return Cx(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(L0,r.interrupt?n:u,e.attempt(EF,f,d))}function u(m){return r.containerState.initialBlankLine=!0,s++,f(m)}function d(m){return Gt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function NF(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(L0,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qt(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!Gt(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(AF,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,qt(e,e.attempt(Oi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function IF(e,t,n){const r=this;return qt(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function DF(e){e.exit(this.containerState.type)}function RF(e,t,n){const r=this;return qt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!Gt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const sS={name:"setextUnderline",resolveTo:OF,tokenize:jF};function OF(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function jF(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),Gt(c)?qt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||it(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const LF={tokenize:BF};function BF(e){const t=this,n=e.attempt(L0,r,e.attempt(this.parser.constructs.flowInitial,i,qt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Hq,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const zF={resolveAll:RM()},PF=DM("string"),$F=DM("text");function DM(e){return{resolveAll:RM(e==="text"?UF:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(u){return c(u)?s(u):o(u)}function o(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function RM(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function UF(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 s=i.length,a=-1,o=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(c===-2)l=!0,o++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const HF={42:Oi,43:Oi,45:Oi,48:Oi,49:Oi,50:Oi,51:Oi,52:Oi,53:Oi,54:Oi,55:Oi,56:Oi,57:Oi,62:TM},qF={91:Wq},FF={[-2]:qb,[-1]:qb,32:qb},VF={35:Zq,42:Mp,45:[sS,Mp],60:rF,61:sS,95:Mp,96:rS,126:rS},GF={38:EM,92:CM},WF={[-5]:Fb,[-4]:Fb,[-3]:Fb,33:wF,38:EM,42:Ex,60:[_q,uF],91:_F,92:[Qq,CM],93:z3,95:Ex,96:Lq},KF={null:[Ex,zF]},YF={null:[42,95]},XF={null:[]},QF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:YF,contentInitial:qF,disable:XF,document:HF,flow:VF,flowInitial:FF,insideSpan:KF,string:GF,text:WF},Symbol.toStringTag,{value:"Module"}));function JF(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={},s=[];let a=[],o=[];const l={attempt:T(E),check:T(S),consume:y,enter:w,exit:C,interrupt:T(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:p,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(D){return a=Ns(a,D),x(),a[a.length-1]!==null?[]:(j(t,0),c.events=H1(s,c.events,c),c.events)}function f(D,N){return eV(m(D),N)}function m(D){return ZF(a,D)}function p(){const{_bufferIndex:D,_index:N,line:B,column:P,offset:J}=r;return{_bufferIndex:D,_index:N,line:B,column:P,offset:J}}function b(D){i[D.line]=D.column,R()}function x(){let D;for(;r._index<a.length;){const N=a[r._index];if(typeof N=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<N.length;)g(N.charCodeAt(r._bufferIndex));else g(N)}}function g(D){u=u(D)}function y(D){it(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,R()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function w(D,N){const B=N||{};return B.type=D,B.start=p(),c.events.push(["enter",B,c]),o.push(B),B}function C(D){const N=o.pop();return N.end=p(),c.events.push(["exit",N,c]),N}function E(D,N){j(D,N.from)}function S(D,N){N.restore()}function T(D,N){return B;function B(P,J,q){let W,$,Z,M;return Array.isArray(P)?H(P):"tokenize"in P?H([P]):X(P);function X(be){return Ee;function Ee(qe){const wt=qe!==null&&be[qe],Mt=qe!==null&&be.null,bt=[...Array.isArray(wt)?wt:wt?[wt]:[],...Array.isArray(Mt)?Mt:Mt?[Mt]:[]];return H(bt)(qe)}}function H(be){return W=be,$=0,be.length===0?q:O(be[$])}function O(be){return Ee;function Ee(qe){return M=z(),Z=be,be.partial||(c.currentConstruct=be),be.name&&c.parser.constructs.disable.null.includes(be.name)?ke():be.tokenize.call(N?Object.assign(Object.create(c),N):c,l,se,ke)(qe)}}function se(be){return D(Z,M),J}function ke(be){return M.restore(),++$<W.length?O(W[$]):q}}}function j(D,N){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&ds(c.events,N,c.events.length-N,D.resolve(c.events.slice(N),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function z(){const D=p(),N=c.previous,B=c.currentConstruct,P=c.events.length,J=Array.from(o);return{from:P,restore:q};function q(){r=D,c.previous=N,c.currentConstruct=B,c.events.length=P,o=J,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ZF(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function eV(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=t?" ":"	";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function tV(e){const r={constructs:_M([QF,...(e||{}).extensions||[]]),content:i(gq),defined:[],document:i(bq),flow:i(LF),lazy:{},string:i(PF),text:i($F)};return r;function i(s){return a;function a(o){return JF(r,s,o)}}}function nV(e){for(;!AM(e););return e}const aS=/[\0\t\n\r]/g;function rV(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let c,u,d,f,m;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(aS.lastIndex=d,c=aS.exec(s),f=c&&c.index!==void 0?c.index:s.length,m=s.charCodeAt(f),!c){t=s.slice(d);break}if(m===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(s.slice(d,f)),e+=f-d),m){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const iV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sV(e){return e.replace(iV,aV)}function aV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return SM(n.slice(s?2:1),s?16:10)}return B3(n)||e}const OM={}.hasOwnProperty;function oV(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),lV(n)(nV(tV(n).document().write(rV()(e,t,!0))))}function lV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(We),autolinkProtocol:z,autolinkEmail:z,atxHeading:s(Ze),blockQuote:s(Mt),characterEscape:z,characterReference:z,codeFenced:s(bt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(bt,a),codeText:s(Je,a),codeTextData:z,data:z,codeFlowValue:z,definition:s(Ge),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Pt),hardBreakEscape:s(re),hardBreakTrailing:s(re),htmlFlow:s(le,a),htmlFlowData:z,htmlText:s(le,a),htmlTextData:z,image:s(De),label:a,link:s(We),listItem:s(st),listItemValue:f,listOrdered:s(pe,d),listUnordered:s(pe),paragraph:s(ae),reference:O,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ze),strong:s(je),thematicBreak:s($e)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:wt,autolinkProtocol:qe,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:be,characterReference:Ee,codeFenced:l(x),codeFencedFence:b,codeFencedFenceInfo:m,codeFencedFenceMeta:p,codeFlowValue:R,codeIndented:l(g),codeText:l(J),codeTextData:R,data:R,definition:l(),definitionDestinationString:C,definitionLabelString:y,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(B),htmlFlowData:R,htmlText:l(P),htmlTextData:R,image:l(W),label:Z,labelText:$,lineEnding:D,link:l(q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:se,resourceDestinationString:M,resourceTitleString:X,resource:H,setextHeading:l(j),setextHeadingLineSequence:T,setextHeadingText:S,strong:l(),thematicBreak:l()}};jM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let ye={type:"root",children:[]};const Te={stack:[ye],tokenStack:[],config:t,enter:o,exit:c,buffer:a,resume:u,data:n},Pe=[];let dt=-1;for(;++dt<te.length;)if(te[dt][1].type==="listOrdered"||te[dt][1].type==="listUnordered")if(te[dt][0]==="enter")Pe.push(dt);else{const Ht=Pe.pop();dt=i(te,Ht,dt)}for(dt=-1;++dt<te.length;){const Ht=t[te[dt][0]];OM.call(Ht,te[dt][1].type)&&Ht[te[dt][1].type].call(Object.assign({sliceSerialize:te[dt][2].sliceSerialize},Te),te[dt][1])}if(Te.tokenStack.length>0){const Ht=Te.tokenStack[Te.tokenStack.length-1];(Ht[1]||oS).call(Te,void 0,Ht[0])}for(ye.position={start:Zo(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Zo(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},dt=-1;++dt<t.transforms.length;)ye=t.transforms[dt](ye)||ye;return ye}function i(te,ye,Te){let Pe=ye-1,dt=-1,Ht=!1,Xt,Dn,jn,Zn;for(;++Pe<=Te;){const Sn=te[Pe];switch(Sn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Sn[0]==="enter"?dt++:dt--,Zn=void 0;break}case"lineEndingBlank":{Sn[0]==="enter"&&(Xt&&!Zn&&!dt&&!jn&&(jn=Pe),Zn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Zn=void 0}if(!dt&&Sn[0]==="enter"&&Sn[1].type==="listItemPrefix"||dt===-1&&Sn[0]==="exit"&&(Sn[1].type==="listUnordered"||Sn[1].type==="listOrdered")){if(Xt){let _r=Pe;for(Dn=void 0;_r--;){const me=te[_r];if(me[1].type==="lineEnding"||me[1].type==="lineEndingBlank"){if(me[0]==="exit")continue;Dn&&(te[Dn][1].type="lineEndingBlank",Ht=!0),me[1].type="lineEnding",Dn=_r}else if(!(me[1].type==="linePrefix"||me[1].type==="blockQuotePrefix"||me[1].type==="blockQuotePrefixWhitespace"||me[1].type==="blockQuoteMarker"||me[1].type==="listItemIndent"))break}jn&&(!Dn||jn<Dn)&&(Xt._spread=!0),Xt.end=Object.assign({},Dn?te[Dn][1].start:Sn[1].end),te.splice(Dn||Pe,0,["exit",Xt,Sn[2]]),Pe++,Te++}if(Sn[1].type==="listItemPrefix"){const _r={type:"listItem",_spread:!1,start:Object.assign({},Sn[1].start),end:void 0};Xt=_r,te.splice(Pe,0,["enter",_r,Sn[2]]),Pe++,Te++,jn=void 0,Zn=!0}}}return te[ye][1]._spread=Ht,Te}function s(te,ye){return Te;function Te(Pe){o.call(this,te(Pe),Pe),ye&&ye.call(this,Pe)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(te,ye,Te){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([ye,Te||void 0]),te.position={start:Zo(ye.start),end:void 0}}function l(te){return ye;function ye(Te){te&&te.call(this,Te),c.call(this,Te)}}function c(te,ye){const Te=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==te.type&&(ye?ye.call(this,te,Pe[0]):(Pe[1]||oS).call(this,te,Pe[0]));else throw new Error("Cannot close `"+te.type+"` ("+Sf({start:te.start,end:te.end})+"): it’s not open");Te.position.end=Zo(te.end)}function u(){return L3(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(te){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function m(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=te}function p(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=te}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.value=te.replace(/(\r?\n|\r)$/g,"")}function y(te){const ye=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ye,Te.identifier=ia(this.sliceSerialize(te)).toLowerCase()}function w(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.title=te}function C(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.url=te}function E(te){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Te=this.sliceSerialize(te).length;ye.depth=Te}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function T(te){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function z(te){const Te=this.stack[this.stack.length-1].children;let Pe=Te[Te.length-1];(!Pe||Pe.type!=="text")&&(Pe=Oe(),Pe.position={start:Zo(te.start),end:void 0},Te.push(Pe)),this.stack.push(Pe)}function R(te){const ye=this.stack.pop();ye.value+=this.sliceSerialize(te),ye.position.end=Zo(te.end)}function D(te){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ye.children[ye.children.length-1];Te.position.end=Zo(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(z.call(this,te),R.call(this,te))}function N(){this.data.atHardBreak=!0}function B(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.value=te}function P(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.value=te}function J(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.value=te}function q(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=ye,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function W(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=ye,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function $(te){const ye=this.sliceSerialize(te),Te=this.stack[this.stack.length-2];Te.label=sV(ye),Te.identifier=ia(ye).toLowerCase()}function Z(){const te=this.stack[this.stack.length-1],ye=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Pe=te.children;Te.children=Pe}else Te.alt=ye}function M(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.url=te}function X(){const te=this.resume(),ye=this.stack[this.stack.length-1];ye.title=te}function H(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function se(te){const ye=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ye,Te.identifier=ia(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function ke(te){this.data.characterReferenceType=te.type}function be(te){const ye=this.sliceSerialize(te),Te=this.data.characterReferenceType;let Pe;Te?(Pe=SM(ye,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=B3(ye);const dt=this.stack[this.stack.length-1];dt.value+=Pe}function Ee(te){const ye=this.stack.pop();ye.position.end=Zo(te.end)}function qe(te){R.call(this,te);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(te)}function wt(te){R.call(this,te);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(te)}function Mt(){return{type:"blockquote",children:[]}}function bt(){return{type:"code",lang:null,meta:null,value:""}}function Je(){return{type:"inlineCode",value:""}}function Ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pt(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function re(){return{type:"break"}}function le(){return{type:"html",value:""}}function De(){return{type:"image",title:null,url:"",alt:null}}function We(){return{type:"link",title:null,url:"",children:[]}}function pe(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function st(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function ae(){return{type:"paragraph",children:[]}}function je(){return{type:"strong",children:[]}}function Oe(){return{type:"text",value:""}}function $e(){return{type:"thematicBreak"}}}function Zo(e){return{line:e.line,column:e.column,offset:e.offset}}function jM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jM(e,r):cV(e,r)}}function cV(e,t){let n;for(n in t)if(OM.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 oS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Sf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Sf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Sf({start:t.start,end:t.end})+") is still open")}function uV(e){const t=this;t.parser=n;function n(r){return oV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function dV(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 hV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function fV(e,t){const n=t.value?t.value+`
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function mV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=oh(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function yV(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 bV(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LM(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),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function vV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return LM(e,t);const i={src:oh(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function xV(e,t){const n={src:oh(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 wV(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 kV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return LM(e,t);const i={href:oh(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function _V(e,t){const n={href:oh(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 SV(e,t,n){const r=e.all(t),i=n?TV(n):BM(t),s={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const u=r[o];(i||o!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
`}),u.type==="element"&&u.tagName==="p"&&!i?a.push(...u.children):a.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function TV(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=BM(n[r])}return t}function BM(e){const t=e.spread;return t??e.children.length>1}function CV(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 a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function EV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function MV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NV(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=D3(t.children[1]),l=gM(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function IV(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<o;){const d=t.children[l],f={},m=a?a[l]:void 0;m&&(f.align=m);let p={type:"element",tagName:s,properties:f,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function DV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const lS=9,cS=32;function RV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(uS(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(uS(t.slice(i),i>0,!1)),s.join("")}function uS(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===lS||s===cS;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===lS||s===cS;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function OV(e,t){const n={type:"text",value:RV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const LV={blockquote:dV,break:hV,code:fV,delete:mV,emphasis:pV,footnoteReference:gV,heading:yV,html:bV,imageReference:vV,image:xV,inlineCode:wV,linkReference:kV,link:_V,listItem:SV,list:CV,paragraph:EV,root:AV,strong:MV,table:NV,tableCell:DV,tableRow:IV,text:OV,thematicBreak:jV,toml:km,yaml:km,definition:km,footnoteDefinition:km};function km(){}const zM=-1,q1=0,Cf=1,Ag=2,P3=3,$3=4,U3=5,H3=6,PM=7,$M=8,dS=typeof self=="object"?self:globalThis,BV=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case q1:case zM:return n(a,i);case Cf:{const o=n([],i);for(const l of a)o.push(r(l));return o}case Ag:{const o=n({},i);for(const[l,c]of a)o[r(l)]=r(c);return o}case P3:return n(new Date(a),i);case $3:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case U3:{const o=n(new Map,i);for(const[l,c]of a)o.set(r(l),r(c));return o}case H3:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case PM:{const{name:o,message:l}=a;return n(new dS[o](l),i)}case $M:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new dS[s](a),i)};return r},hS=e=>BV(new Map,e)(0),Ru="",{toString:zV}={},{keys:PV}=Object,jh=e=>{const t=typeof e;if(t!=="object"||!e)return[q1,t];const n=zV.call(e).slice(8,-1);switch(n){case"Array":return[Cf,Ru];case"Object":return[Ag,Ru];case"Date":return[P3,Ru];case"RegExp":return[$3,Ru];case"Map":return[U3,Ru];case"Set":return[H3,Ru];case"DataView":return[Cf,n]}return n.includes("Array")?[Cf,n]:n.includes("Error")?[PM,n]:[Ag,n]},_m=([e,t])=>e===q1&&(t==="function"||t==="symbol"),$V=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=jh(a);switch(o){case q1:{let u=a;switch(l){case"bigint":o=$M,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([zM],a)}return i([o,u],a)}case Cf:{if(l){let f=a;return l==="DataView"?f=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(a)),i([l,[...f]],a)}const u=[],d=i([o,u],a);for(const f of a)u.push(s(f));return d}case Ag:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const u=[],d=i([o,u],a);for(const f of PV(a))(e||!_m(jh(a[f])))&&u.push([s(f),s(a[f])]);return d}case P3:return i([o,a.toISOString()],a);case $3:{const{source:u,flags:d}=a;return i([o,{source:u,flags:d}],a)}case U3:{const u=[],d=i([o,u],a);for(const[f,m]of a)(e||!(_m(jh(f))||_m(jh(m))))&&u.push([s(f),s(m)]);return d}case H3:{const u=[],d=i([o,u],a);for(const f of a)(e||!_m(jh(f)))&&u.push(s(f));return d}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},fS=(e,{json:t,lossy:n}={})=>{const r=[];return $V(!(t||n),!!t,new Map,r)(e),r},Mg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?hS(fS(e,t)):structuredClone(e):(e,t)=>hS(fS(e,t));function UV(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 HV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function qV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||UV,r=e.options.footnoteBackLabel||HV,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),f=oh(d.toLowerCase());let m=0;const p=[],b=e.footnoteCounts.get(d);for(;b!==void 0&&++m<=b;){p.length>0&&p.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,m);typeof y=="string"&&(y={type:"text",value:y}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const y=x.children[x.children.length-1];y&&y.type==="text"?y.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...p)}else u.push(...p);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(u,!0)};e.patch(c,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Mg(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
`}]}}const B0=function(e){if(e==null)return WV;if(typeof e=="function")return F1(e);if(typeof e=="object")return Array.isArray(e)?FV(e):VV(e);if(typeof e=="string")return GV(e);throw new Error("Expected function, string, or object as test")};function FV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=B0(e[n]);return F1(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function VV(e){const t=e;return F1(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function GV(e){return F1(t);function t(n){return n&&n.type===e}}function F1(e){return t;function t(n,r,i){return!!(KV(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function WV(){return!0}function KV(e){return e!==null&&typeof e=="object"&&"type"in e}const UM=[],YV=!0,Ax=!1,HM="skip";function q3(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=B0(i),a=r?-1:1;o(e,void 0,[])();function o(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=UM,p,b,x;if((!t||s(l,c,u[u.length-1]||void 0))&&(m=XV(n(l,u)),m[0]===Ax))return m;if("children"in l&&l.children){const g=l;if(g.children&&m[0]!==HM)for(b=(r?g.children.length:-1)+a,x=u.concat(g);b>-1&&b<g.children.length;){const y=g.children[b];if(p=o(y,b,x)(),p[0]===Ax)return p;b=typeof p[1]=="number"?p[1]:b+a}}return m}}}function XV(e){return Array.isArray(e)?e:typeof e=="number"?[YV,e]:e==null?UM:[e]}function F3(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),q3(e,s,o,i);function o(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return a(l,d,u)}}const Mx={}.hasOwnProperty,QV={};function JV(e,t){const n=t||QV,r=new Map,i=new Map,s=new Map,a={...LV,...n.handlers},o={all:c,applyData:eG,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:ZV,wrap:nG};return F3(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,f=String(u.identifier).toUpperCase();d.has(f)||d.set(f,u)}}),o;function l(u,d){const f=u.type,m=o.handlers[f];if(Mx.call(o.handlers,f)&&m)return m(o,u,d);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in u){const{children:b,...x}=u,g=Mg(x);return g.children=o.all(u),g}return Mg(u)}return(o.options.unknownHandler||tG)(o,u,d)}function c(u){const d=[];if("children"in u){const f=u.children;let m=-1;for(;++m<f.length;){const p=o.one(f[m],u);if(p){if(m&&f[m-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=mS(p.value)),!Array.isArray(p)&&p.type==="element")){const b=p.children[0];b&&b.type==="text"&&(b.value=mS(b.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function ZV(e,t){e.position&&(t.position=HH(e))}function eG(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,Mg(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function tG(e,t){const n=t.data||{},r="value"in t&&!(Mx.call(n,"hProperties")||Mx.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 nG(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function mS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function pS(e,t){const n=JV(e,t),r=n.one(e,void 0),i=qV(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function rG(e,t){return e&&"run"in e?async function(n,r){const i=pS(n,{file:r,...t});await e.run(i,r)}:function(n,r){return pS(n,{file:r,...e||t})}}function gS(e){if(e)throw e}var Np=Object.prototype.hasOwnProperty,qM=Object.prototype.toString,yS=Object.defineProperty,bS=Object.getOwnPropertyDescriptor,vS=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qM.call(t)==="[object Array]"},xS=function(t){if(!t||qM.call(t)!=="[object Object]")return!1;var n=Np.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Np.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Np.call(t,i)},wS=function(t,n){yS&&n.name==="__proto__"?yS(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},kS=function(t,n){if(n==="__proto__")if(Np.call(t,n)){if(bS)return bS(t,n).value}else return;return t[n]},iG=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,c=arguments.length,u=!1;for(typeof o=="boolean"&&(u=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=kS(o,n),i=kS(t,n),o!==i&&(u&&i&&(xS(i)||(s=vS(i)))?(s?(s=!1,a=r&&vS(r)?r:[]):a=r&&xS(r)?r:{},wS(o,{name:n,newValue:e(u,a,i)})):typeof i<"u"&&wS(o,{name:n,newValue:i}));return o};const Vb=p1(iG);function Nx(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 sG(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...c){const u=e[++s];let d=-1;if(l){a(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?aG(u,o)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function aG(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(c){const u=c;if(o&&n)throw u;return i(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const Ea={basename:oG,dirname:lG,extname:cG,join:uG,sep:"/"};function oG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');z0(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function lG(e){if(z0(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 cG(e){z0(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function uG(...e){let t=-1,n;for(;++t<e.length;)z0(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":dG(n)}function dG(e){z0(e);const t=e.codePointAt(0)===47;let n=hG(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hG(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function z0(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fG={cwd:mG};function mG(){return"/"}function Ix(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pG(e){if(typeof e=="string")e=new URL(e);else if(!Ix(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 gG(e)}function gG(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 Gb=["history","path","basename","stem","extname","dirname"];class FM{constructor(t){let n;t?Ix(t)?n={path:t}:typeof t=="string"||yG(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":fG.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Gb.length;){const s=Gb[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Gb.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ea.basename(this.path):void 0}set basename(t){Kb(t,"basename"),Wb(t,"basename"),this.path=Ea.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ea.dirname(this.path):void 0}set dirname(t){_S(this.basename,"dirname"),this.path=Ea.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ea.extname(this.path):void 0}set extname(t){if(Wb(t,"extname"),_S(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ea.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ix(t)&&(t=pG(t)),Kb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ea.basename(this.path,this.extname):void 0}set stem(t){Kb(t,"stem"),Wb(t,"stem"),this.path=Ea.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 ci(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 Wb(e,t){if(e&&e.includes(Ea.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ea.sep+"`")}function Kb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _S(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function yG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bG=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},vG={}.hasOwnProperty;class V3 extends bG{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=sG()}copy(){const t=new V3;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Vb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Qb("data",this.frozen),this.namespace[t]=n,this):vG.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Qb("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=Sm(t),r=this.parser||this.Parser;return Yb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Yb("process",this.parser||this.Parser),Xb("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=Sm(t),l=r.parse(o);r.run(l,o,function(u,d,f){if(u||!d||!f)return c(u);const m=d,p=r.stringify(m,f);kG(p)?f.value=p:f.result=p,c(u,f)});function c(u,d){u||!d?a(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Yb("processSync",this.parser||this.Parser),Xb("processSync",this.compiler||this.Compiler),this.process(t,i),TS("processSync","process",n),r;function i(s,a){n=!0,gS(s),r=a}}run(t,n,r){SS(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=Sm(n);i.run(t,l,c);function c(u,d,f){const m=d||t;u?o(u):a?a(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),TS("runSync","run",r),i;function s(a,o){gS(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=Sm(n),i=this.compiler||this.Compiler;return Xb("stringify",i),SS(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Qb("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))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");o(c.plugins),c.settings&&(i.settings=Vb(!0,i.settings,c.settings))}function o(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...u]);else if(u.length>0){let[m,...p]=u;const b=r[f][1];Nx(b)&&Nx(m)&&(m=Vb(!0,b,m)),r[f]=[c,m,...p]}}}}const xG=new V3().freeze();function Yb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Xb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qb(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 SS(e){if(!Nx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function TS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Sm(e){return wG(e)?e:new FM(e)}function wG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kG(e){return typeof e=="string"||_G(e)}function _G(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const SG="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",CS=[],ES={allowDangerousHtml:!0},TG=/^(https?|ircs?|mailto|xmpp)$/i,CG=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function EG(e){const t=AG(e),n=MG(e);return NG(t.runSync(t.parse(n),n),e)}function AG(e){const t=e.rehypePlugins||CS,n=e.remarkPlugins||CS,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ES}:ES;return xG().use(uV).use(n).use(rG,r).use(t)}function MG(e){const t=e.children||"",n=new FM;return typeof t=="string"&&(n.value=t),n}function NG(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||IG;for(const u of CG)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+SG+u.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),F3(e,c),WH(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return a?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let m;for(m in Hb)if(Object.hasOwn(Hb,m)&&Object.hasOwn(u.properties,m)){const p=u.properties[m],b=Hb[m];(b===null||b.includes(u.tagName))&&(u.properties[m]=l(String(p||""),m,u))}}if(u.type==="element"){let m=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(u,d,f)),m&&f&&typeof d=="number")return o&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function IG(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||TG.test(e.slice(0,t))?e:""}function Ng(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 DG(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function RG(e,t,n){const i=B0((n||{}).ignore||[]),s=OG(t);let a=-1;for(;++a<s.length;)q3(e,"text",o);function o(c,u){let d=-1,f;for(;++d<u.length;){const m=u[d],p=f?f.children:void 0;if(i(m,p?p.indexOf(m):void 0,f))return;f=m}if(f)return l(c,u)}function l(c,u){const d=u[u.length-1],f=s[a][0],m=s[a][1];let p=0;const x=d.children.indexOf(c);let g=!1,y=[];f.lastIndex=0;let w=f.exec(c.value);for(;w;){const C=w.index,E={index:w.index,input:w.input,stack:[...u,c]};let S=m(...w,E);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=C+1:(p!==C&&y.push({type:"text",value:c.value.slice(p,C)}),Array.isArray(S)?y.push(...S):S&&y.push(S),p=C+w[0].length,g=!0),!f.global)break;w=f.exec(c.value)}return g?(p<c.value.length&&y.push({type:"text",value:c.value.slice(p)}),d.children.splice(x,1,...y)):y=[c],x+y.length}}function OG(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([jG(i[0]),LG(i[1])])}return t}function jG(e){return typeof e=="string"?new RegExp(DG(e),"g"):e}function LG(e){return typeof e=="function"?e:function(){return e}}const Jb="phrasing",Zb=["autolink","link","image","label"];function BG(){return{transforms:[FG],enter:{literalAutolink:PG,literalAutolinkEmail:ev,literalAutolinkHttp:ev,literalAutolinkWww:ev},exit:{literalAutolink:qG,literalAutolinkEmail:HG,literalAutolinkHttp:$G,literalAutolinkWww:UG}}}function zG(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Jb,notInConstruct:Zb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Jb,notInConstruct:Zb},{character:":",before:"[ps]",after:"\\/",inConstruct:Jb,notInConstruct:Zb}]}}function PG(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ev(e){this.config.enter.autolinkProtocol.call(this,e)}function $G(e){this.config.exit.autolinkProtocol.call(this,e)}function UG(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 HG(e){this.config.exit.autolinkEmail.call(this,e)}function qG(e){this.exit(e)}function FG(e){RG(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),GG]],{ignore:["link","linkReference"]})}function VG(e,t,n,r,i){let s="";if(!VM(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!WG(n)))return!1;const a=KG(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function GG(e,t,n,r){return!VM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function WG(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 KG(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=Ng(e,"(");let s=Ng(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function VM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Zc(n)||U1(n))&&(!t||n!==47)}GM.peek=rW;function YG(){this.buffer()}function XG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function QG(){this.buffer()}function JG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ia(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eW(e){this.exit(e)}function tW(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ia(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nW(e){this.exit(e)}function rW(){return"["}function GM(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function iW(){return{enter:{gfmFootnoteCallString:YG,gfmFootnoteCall:XG,gfmFootnoteDefinitionLabelString:QG,gfmFootnoteDefinition:JG},exit:{gfmFootnoteCallString:ZG,gfmFootnoteCall:eW,gfmFootnoteDefinitionLabelString:tW,gfmFootnoteDefinition:nW}}}function sW(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:GM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),u(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?WM:aW))),c(),l}}function aW(e,t,n){return t===0?e:WM(e,t,n)}function WM(e,t,n){return(n?"":"    ")+e}const oW=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];KM.peek=hW;function lW(){return{canContainEols:["delete"],enter:{strikethrough:uW},exit:{strikethrough:dW}}}function cW(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oW}],handlers:{delete:KM}}}function uW(e){this.enter({type:"delete",children:[]},e)}function dW(e){this.exit(e)}function KM(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function hW(){return"~"}function fW(e){return e.length}function mW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fW,s=[],a=[],o=[],l=[];let c=0,u=-1;for(;++u<e.length;){const b=[],x=[];let g=-1;for(e[u].length>c&&(c=e[u].length);++g<e[u].length;){const y=pW(e[u][g]);if(n.alignDelimiters!==!1){const w=i(y);x[g]=w,(l[g]===void 0||w>l[g])&&(l[g]=w)}b.push(y)}a[u]=b,o[u]=x}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)s[d]=AS(r[d]);else{const b=AS(r);for(;++d<c;)s[d]=b}d=-1;const f=[],m=[];for(;++d<c;){const b=s[d];let x="",g="";b===99?(x=":",g=":"):b===108?x=":":b===114&&(g=":");let y=n.alignDelimiters===!1?1:Math.max(1,l[d]-x.length-g.length);const w=x+"-".repeat(y)+g;n.alignDelimiters!==!1&&(y=x.length+y+g.length,y>l[d]&&(l[d]=y),m[d]=y),f[d]=w}a.splice(1,0,f),o.splice(1,0,m),u=-1;const p=[];for(;++u<a.length;){const b=a[u],x=o[u];d=-1;const g=[];for(;++d<c;){const y=b[d]||"";let w="",C="";if(n.alignDelimiters!==!1){const E=l[d]-(x[d]||0),S=s[d];S===114?w=" ".repeat(E):S===99?E%2?(w=" ".repeat(E/2+.5),C=" ".repeat(E/2-.5)):(w=" ".repeat(E/2),C=w):C=" ".repeat(E)}n.delimiterStart!==!1&&!d&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||d)&&g.push(" "),n.alignDelimiters!==!1&&g.push(w),g.push(y),n.alignDelimiters!==!1&&g.push(C),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&g.push("|")}p.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return p.join(`
`)}function pW(e){return e==null?"":String(e)}function AS(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}const MS={}.hasOwnProperty;function gW(e,t){const n=t||{};function r(i,...s){let a=r.invalid;const o=r.handlers;if(i&&MS.call(i,e)){const l=String(i[e]);a=MS.call(o,l)?o[l]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function yW(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),bW);return i(),a}function bW(e,t,n){return">"+(n?"":" ")+e}function vW(e,t){return NS(e,t.inConstruct,!0)&&!NS(e,t.notInConstruct,!1)}function NS(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 IS(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&vW(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function YM(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function xW(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 wW(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 kW(e,t,n,r){const i=wW(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(xW(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(s,_W);return d(),f}const o=n.createTracker(r),l=i.repeat(Math.max(YM(s,i)+1,3)),c=n.enter("codeFenced");let u=o.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);u+=o.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);u+=o.move(" "),u+=o.move(n.safe(e.meta,{before:u,after:`
`,encode:["`"],...o.current()})),d()}return u+=o.move(`
`),s&&(u+=o.move(s+`
`)),u+=o.move(l),c(),u}function _W(e,t,n){return(n?"":"    ")+e}function G3(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 SW(e,t,n,r){const i=G3(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
`,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),a(),c}function TW(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 Zf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ig(e,t,n){const r=jd(e),i=jd(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}}XM.peek=CW;function XM(e,t,n,r){const i=TW(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const c=l.charCodeAt(0),u=Ig(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Zf(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Ig(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+Zf(d));const m=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},o+l+m}function CW(e,t,n){return n.options.emphasis||"*"}function EW(e,t){let n=!1;return F3(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ax}),!!((!e.depth||e.depth<3)&&L3(e)&&(t.options.setext||n))}function AW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(EW(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
`,after:`
`});return d(),u(),f+`
`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");s.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(c)&&(c=Zf(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),o(),c}QM.peek=MW;function QM(e){return e.value||""}function MW(){return"<"}JM.peek=NW;function JM(e,t,n,r){const i=G3(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),c+=l.move(")"),a(),c}function NW(){return"!"}ZM.peek=IW;function ZM(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const c=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=u,s(),i==="full"||!c||c!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function IW(){return"!"}eN.peek=DW;function eN(e,t,n){let r=e.value||"",i="`",s=-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+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function DW(){return"`"}function tN(e,t){const n=L3(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))}nN.peek=RW;function nN(e,t,n,r){const i=G3(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(tN(e,n)){const u=n.stack;n.stack=[],o=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),n.stack=u,d}o=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),o(),c}function RW(e,t,n){return tN(e,n)?"<":"["}rN.peek=OW;function rN(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=u,s(),i==="full"||!c||c!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function OW(){return"["}function W3(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 jW(e){const t=W3(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 LW(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 iN(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 BW(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?LW(n):W3(n);const o=e.ordered?a==="."?")":".":jW(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.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&&(l=!0),iN(n)===a&&u){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),c}function zW(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 PW(e,t,n,r){const i=zW(n);let s=n.bulletCurrent||W3(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),u);return l(),c;function u(d,f,m){return f?(m?"":" ".repeat(a))+d:(m?s:s+" ".repeat(a-s.length))+d}}function $W(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const UW=B0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function HW(e,t,n,r){return(e.children.some(function(a){return UW(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function qW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sN.peek=FW;function sN(e,t,n,r){const i=qW(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const c=l.charCodeAt(0),u=Ig(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Zf(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Ig(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+Zf(d));const m=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},o+l+m}function FW(e,t,n){return n.options.strong||"*"}function VW(e,t,n,r){return n.safe(e.value,r)}function GW(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 WW(e,t,n){const r=(iN(n)+(n.options.ruleSpaces?" ":"")).repeat(GW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const aN={blockquote:yW,break:IS,code:kW,definition:SW,emphasis:XM,hardBreak:IS,heading:AW,html:QM,image:JM,imageReference:ZM,inlineCode:eN,link:nN,linkReference:rN,list:BW,listItem:PW,paragraph:$W,root:HW,strong:sN,text:VW,thematicBreak:WW};function KW(){return{enter:{table:YW,tableData:DS,tableHeader:DS,tableRow:QW},exit:{codeText:JW,table:XW,tableData:tv,tableHeader:tv,tableRow:tv}}}function YW(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 XW(e){this.exit(e),this.data.inTable=void 0}function QW(e){this.enter({type:"tableRow",children:[]},e)}function tv(e){this.exit(e)}function DS(e){this.enter({type:"tableCell",children:[]},e)}function JW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ZW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ZW(e,t){return t==="|"?t:e}function eK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:a,tableCell:l,tableRow:o}};function a(m,p,b,x){return c(u(m,b,x),m.align)}function o(m,p,b,x){const g=d(m,b,x),y=c([g]);return y.slice(0,y.indexOf(`
`))}function l(m,p,b,x){const g=b.enter("tableCell"),y=b.enter("phrasing"),w=b.containerPhrasing(m,{...x,before:s,after:s});return y(),g(),w}function c(m,p){return mW(m,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(m,p,b){const x=m.children;let g=-1;const y=[],w=p.enter("table");for(;++g<x.length;)y[g]=d(x[g],p,b);return w(),y}function d(m,p,b){const x=m.children;let g=-1;const y=[],w=p.enter("tableRow");for(;++g<x.length;)y[g]=l(x[g],m,p,b);return w(),y}function f(m,p,b){let x=aN.inlineCode(m,p,b);return b.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function tK(){return{exit:{taskListCheckValueChecked:RS,taskListCheckValueUnchecked:RS,paragraph:rK}}}function nK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:iK}}}function RS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function rK(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 s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===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 iK(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=aN.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+a}}function sK(){return[BG(),iW(),lW(),KW(),tK()]}function aK(e){return{extensions:[zG(),sW(e),cW(),eK(e),nK()]}}const oK={tokenize:fK,partial:!0},oN={tokenize:mK,partial:!0},lN={tokenize:pK,partial:!0},cN={tokenize:gK,partial:!0},lK={tokenize:yK,partial:!0},uN={name:"wwwAutolink",tokenize:dK,previous:hN},dN={name:"protocolAutolink",tokenize:hK,previous:fN},Po={name:"emailAutolink",tokenize:uK,previous:mN},Va={};function cK(){return{text:Va}}let dc=48;for(;dc<123;)Va[dc]=Po,dc++,dc===58?dc=65:dc===91&&(dc=97);Va[43]=Po;Va[45]=Po;Va[46]=Po;Va[95]=Po;Va[72]=[Po,dN];Va[104]=[Po,dN];Va[87]=[Po,uN];Va[119]=[Po,uN];function uK(e,t,n){const r=this;let i,s;return a;function a(d){return!Dx(d)||!mN.call(r,r.previous)||K3(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return Dx(d)?(e.consume(d),o):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(lK,u,c)(d):d===45||d===95||ai(d)?(s=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return s&&i&&Si(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function dK(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!hN.call(r,r.previous)||K3(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(oK,e.attempt(oN,e.attempt(lN,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function hK(e,t,n){const r=this;let i="",s=!1;return a;function a(d){return(d===72||d===104)&&fN.call(r,r.previous)&&!K3(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(Si(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?c:(s=!0,l)):n(d)}function c(d){return d===null||Eg(d)||Nn(d)||Zc(d)||U1(d)?n(d):e.attempt(oN,e.attempt(lN,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function fK(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function mK(e,t,n){let r,i,s;return a;function a(c){return c===46||c===95?e.check(cN,l,o)(c):c===null||Nn(c)||Zc(c)||c!==45&&U1(c)?l(c):(s=!0,e.consume(c),a)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function l(c){return i||r||!s?n(c):t(c)}}function pK(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(cN,t,s)(a):a===null||Nn(a)||Zc(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function gK(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||Nn(o)||Zc(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Nn(o)||Zc(o)?t(o):r(o)}function s(o){return Si(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):Si(o)?(e.consume(o),a):n(o)}}function yK(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return ai(s)?n(s):t(s)}}function hN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Nn(e)}function fN(e){return!Si(e)}function mN(e){return!(e===47||Dx(e))}function Dx(e){return e===43||e===45||e===46||e===95||ai(e)}function K3(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}const bK={tokenize:CK,partial:!0};function vK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:_K,continuation:{tokenize:SK},exit:TK}},text:{91:{name:"gfmFootnoteCall",tokenize:kK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:xK,resolveTo:wK}}}}function xK(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const c=ia(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function wK(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 s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function kK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(s>999||d===93&&!a||d===null||d===91||Nn(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(ia(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Nn(d)||(a=!0),s++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function _K(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(a>999||p===93&&!o||p===null||p===91||Nn(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=ia(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Nn(p)||(o=!0),a++,e.consume(p),p===92?d:u}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,u):u(p)}function f(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),qt(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function SK(e,t,n){return e.check(L0,t,e.attempt(bK,t,n))}function TK(e){e.exit("gfmFootnoteDefinition")}function CK(e,t,n){const r=this;return qt(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function EK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},f=[["enter",u,o],["enter",a[c][1],o],["exit",a[c][1],o],["enter",d,o]],m=o.parser.constructs.insideSpan.null;m&&ds(f,f.length,0,H1(m,a.slice(c+1,l),o)),ds(f,f.length,0,[["exit",d,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",u,o]]),ds(a,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const c=this.previous,u=this.events;let d=0;return f;function f(p){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(p):(a.enter("strikethroughSequenceTemporary"),m(p))}function m(p){const b=jd(c);if(p===126)return d>1?l(p):(a.consume(p),d++,m);if(d<2&&!n)return l(p);const x=a.exit("strikethroughSequenceTemporary"),g=jd(p);return x._open=!g||g===2&&!!b,x._close=!b||b===2&&!!g,o(p)}}}class AK{constructor(){this.map=[]}add(t,n,r){MK(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[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 s of i)t.push(s);i=r.pop()}this.map.length=0}}function MK(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 NK(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 s=r.length-1;r[s]=r[s]==="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 IK(){return{flow:{null:{name:"table",tokenize:DK,resolveAll:RK}}}}function DK(e,t,n){const r=this;let i=0,s=0,a;return o;function o(R){let D=r.events.length-1;for(;D>-1;){const P=r.events[D][1].type;if(P==="lineEnding"||P==="linePrefix")D--;else break}const N=D>-1?r.events[D][1].type:null,B=N==="tableHead"||N==="tableRow"?S:l;return B===S&&r.parser.lazy[r.now().line]?n(R):B(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(a=!0,s+=1),u(R)}function u(R){return R===null?n(R):it(R)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),m):n(R):Gt(R)?qt(e,u,"whitespace")(R):(s+=1,a&&(a=!1,i+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),a=!0,u):(e.enter("data"),d(R)))}function d(R){return R===null||R===124||Nn(R)?(e.exit("data"),u(R)):(e.consume(R),R===92?f:d)}function f(R){return R===92||R===124?(e.consume(R),d):d(R)}function m(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),a=!1,Gt(R)?qt(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):p(R))}function p(R){return R===45||R===58?x(R):R===124?(a=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),b):E(R)}function b(R){return Gt(R)?qt(e,x,"whitespace")(R):x(R)}function x(R){return R===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),g):R===45?(s+=1,g(R)):R===null||it(R)?C(R):E(R)}function g(R){return R===45?(e.enter("tableDelimiterFiller"),y(R)):E(R)}function y(R){return R===45?(e.consume(R),y):R===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(R))}function w(R){return Gt(R)?qt(e,C,"whitespace")(R):C(R)}function C(R){return R===124?p(R):R===null||it(R)?!a||i!==s?E(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):E(R)}function E(R){return n(R)}function S(R){return e.enter("tableRow"),T(R)}function T(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),T):R===null||it(R)?(e.exit("tableRow"),t(R)):Gt(R)?qt(e,T,"whitespace")(R):(e.enter("data"),j(R))}function j(R){return R===null||R===124||Nn(R)?(e.exit("data"),T(R)):(e.consume(R),R===92?z:j)}function z(R){return R===92||R===124?(e.consume(R),j):j(R)}}function RK(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,c,u,d;const f=new AK;for(;++n<e.length;){const m=e[n],p=m[1];m[0]==="enter"?p.type==="tableHead"?(o=!1,l!==0&&(OS(f,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",u,t]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],d=Tm(f,t,s,i,void 0,d),s=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],d=Tm(f,t,s,i,void 0,d)),s=a,a=[s[1],n,0,0])):p.type==="tableHead"?(o=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],d=Tm(f,t,s,i,n,d)):a[1]!==0&&(d=Tm(f,t,a,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&OS(f,t,l,c,u),f.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=NK(t.events,n))}return e}function Tm(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},$u(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=$u(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=$u(t.events,n[2]),u=$u(t.events,n[3]),d={type:o,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],m=t.events[n[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,b=n[3]-n[2]-1;e.add(p,b,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},$u(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function OS(e,t,n,r,i){const s=[],a=$u(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function $u(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const OK={name:"tasklistCheck",tokenize:LK};function jK(){return{text:{91:OK}}}function LK(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Nn(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return it(l)?t(l):Gt(l)?e.check({tokenize:BK},t,n)(l):n(l)}}function BK(e,t,n){return qt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function zK(e){return _M([cK(),vK(),EK(e),IK(),jK()])}const PK={};function jS(e){const t=this,n=e||PK,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(zK(n)),s.push(sK()),a.push(aK(n))}function $K(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},l)}function t(){this.buffer()}function n(){const l=this.resume(),c=this.stack[this.stack.length-1];c.type,c.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(l){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),u=this.stack[this.stack.length-1];u.type,this.exit(l),u.value=c;const d=u.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,this.exit(l),u.value=c,u.data.hChildren.push({type:"text",value:c})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function UK(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(s,a,o,l){const c=s.value||"",u=o.createTracker(l),d="$".repeat(Math.max(YM(c,"$")+1,2)),f=o.enter("mathFlow");let m=u.move(d);if(s.meta){const p=o.enter("mathFlowMeta");m+=u.move(o.safe(s.meta,{after:`
`,before:m,encode:["$"],...u.current()})),p()}return m+=u.move(`
`),c&&(m+=u.move(c+`
`)),m+=u.move(d),f(),m}function r(s,a,o){let l=s.value||"",c=1;for(t||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const u="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<o.unsafe.length;){const f=o.unsafe[d];if(!f.atBreak)continue;const m=o.compilePattern(f);let p;for(;p=m.exec(l);){let b=p.index;l.codePointAt(b)===10&&l.codePointAt(b-1)===13&&b--,l=l.slice(0,b)+" "+l.slice(p.index+1)}}return u+l+u}function i(){return"$"}}const HK={tokenize:qK,concrete:!0,name:"mathFlow"},LS={tokenize:FK,partial:!0};function qK(e,t,n){const r=this,i=r.events[r.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let a=0;return o;function o(y){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),l(y)}function l(y){return y===36?(e.consume(y),a++,l):a<2?n(y):(e.exit("mathFlowFenceSequence"),qt(e,c,"whitespace")(y))}function c(y){return y===null||it(y)?d(y):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),u(y))}function u(y){return y===null||it(y)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),d(y)):y===36?n(y):(e.consume(y),u)}function d(y){return e.exit("mathFlowFence"),r.interrupt?t(y):e.attempt(LS,f,x)(y)}function f(y){return e.attempt({tokenize:g,partial:!0},x,m)(y)}function m(y){return(s?qt(e,p,"linePrefix",s+1):p)(y)}function p(y){return y===null?x(y):it(y)?e.attempt(LS,f,x)(y):(e.enter("mathFlowValue"),b(y))}function b(y){return y===null||it(y)?(e.exit("mathFlowValue"),p(y)):(e.consume(y),b)}function x(y){return e.exit("mathFlow"),t(y)}function g(y,w,C){let E=0;return qt(y,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function S(z){return y.enter("mathFlowFence"),y.enter("mathFlowFenceSequence"),T(z)}function T(z){return z===36?(E++,y.consume(z),T):E<a?C(z):(y.exit("mathFlowFenceSequence"),qt(y,j,"whitespace")(z))}function j(z){return z===null||it(z)?(y.exit("mathFlowFence"),w(z)):C(z)}}}function FK(e,t,n){const r=this;return i;function i(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function VK(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:GK,previous:WK,name:"mathText"};function r(i,s,a){let o=0,l,c;return u;function u(b){return i.enter("mathText"),i.enter("mathTextSequence"),d(b)}function d(b){return b===36?(i.consume(b),o++,d):o<2&&!n?a(b):(i.exit("mathTextSequence"),f(b))}function f(b){return b===null?a(b):b===36?(c=i.enter("mathTextSequence"),l=0,p(b)):b===32?(i.enter("space"),i.consume(b),i.exit("space"),f):it(b)?(i.enter("lineEnding"),i.consume(b),i.exit("lineEnding"),f):(i.enter("mathTextData"),m(b))}function m(b){return b===null||b===32||b===36||it(b)?(i.exit("mathTextData"),f(b)):(i.consume(b),m)}function p(b){return b===36?(i.consume(b),l++,p):l===o?(i.exit("mathTextSequence"),i.exit("mathText"),s(b)):(c.type="mathTextData",m(b))}}}function GK(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==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",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="mathTextData",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 WK(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function KK(e){return{flow:{36:HK},text:{36:VK(e)}}}class Ce extends Error{constructor(t,n){var r="KaTeX parse error: "+t,i,s,a=n&&n.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),c;i>15?c="…"+o.slice(i-15,i):c=o.slice(0,i);var u;s+15<o.length?u=o.slice(s,s+15)+"…":u=o.slice(s),r+=c+l+u}super(r),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Ce.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=t}}var YK=/([A-Z])/g,XK=e=>e.replace(YK,"-$1").toLowerCase(),QK={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},JK=/[&><"']/g,li=e=>String(e).replace(JK,t=>QK[t]),Ip=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?Ip(e.body[0]):e:e.type==="font"?Ip(e.body):e,ZK=new Set(["mathord","textord","atom"]),$o=e=>ZK.has(Ip(e).type),eY=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Dg={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function tY(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function nY(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return tY(t)}function rY(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:nY(r)}class Y3{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Dg)){var r=Dg[n];r&&rY(this,n,t,r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Ce("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=eY(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class el{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Aa[iY[this.id]]}sub(){return Aa[sY[this.id]]}fracNum(){return Aa[aY[this.id]]}fracDen(){return Aa[oY[this.id]]}cramp(){return Aa[lY[this.id]]}text(){return Aa[cY[this.id]]}isTight(){return this.size>=2}}var X3=0,Rg=1,pd=2,Eo=3,e0=4,Ls=5,Ld=6,Ci=7,Aa=[new el(X3,0,!1),new el(Rg,0,!0),new el(pd,1,!1),new el(Eo,1,!0),new el(e0,2,!1),new el(Ls,2,!0),new el(Ld,3,!1),new el(Ci,3,!0)],iY=[e0,Ls,e0,Ls,Ld,Ci,Ld,Ci],sY=[Ls,Ls,Ls,Ls,Ci,Ci,Ci,Ci],aY=[pd,Eo,e0,Ls,Ld,Ci,Ld,Ci],oY=[Eo,Eo,Ls,Ls,Ci,Ci,Ci,Ci],lY=[Rg,Rg,Eo,Eo,Ls,Ls,Ci,Ci],cY=[X3,Rg,pd,Eo,pd,Eo,pd,Eo],At={DISPLAY:Aa[X3],TEXT:Aa[pd],SCRIPT:Aa[e0],SCRIPTSCRIPT:Aa[Ld]},Rx=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function uY(e){for(var t=0;t<Rx.length;t++)for(var n=Rx[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Dp=[];Rx.forEach(e=>e.blocks.forEach(t=>Dp.push(...t)));function pN(e){for(var t=0;t<Dp.length;t+=2)if(e>=Dp[t]&&e<=Dp[t+1])return!0;return!1}var Ar=e=>e+" "+e,Ou=80,dY=function(t,n){return"M95,"+(622+t+n)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+t/2.075+" -"+t+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+t)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},hY=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+t/2.084+" -"+t+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+t)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},fY=function(t,n){return"M983 "+(10+t+n)+`
l`+t/3.13+" -"+t+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},mY=function(t,n){return"M424,"+(2398+t+n)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+t)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
h400000v`+(40+t)+"h-400000z"},pY=function(t,n){return"M473,"+(2713+t+n)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},gY=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},yY=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},bY=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=dY(n,Ou);break;case"sqrtSize1":i=hY(n,Ou);break;case"sqrtSize2":i=fY(n,Ou);break;case"sqrtSize3":i=mY(n,Ou);break;case"sqrtSize4":i=pY(n,Ou);break;case"sqrtTall":i=yY(n,Ou,r)}return i},vY=function(t,n){switch(t){case"⎜":return Ar("M291 0 H417 V"+n+" H291z");case"∣":return Ar("M145 0 H188 V"+n+" H145z");case"∥":return Ar("M145 0 H188 V"+n+" H145z")+Ar("M367 0 H410 V"+n+" H367z");case"⎟":return Ar("M457 0 H583 V"+n+" H457z");case"⎢":return Ar("M319 0 H403 V"+n+" H319z");case"⎥":return Ar("M263 0 H347 V"+n+" H263z");case"⎪":return Ar("M384 0 H504 V"+n+" H384z");case"⏐":return Ar("M312 0 H355 V"+n+" H312z");case"‖":return Ar("M257 0 H300 V"+n+" H257z")+Ar("M478 0 H521 V"+n+" H478z");default:return""}},BS={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Ar("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Ar("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Ar("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Ar("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Ar("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Ar("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Ar("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Ar("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},xY=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function wY(e){return"toText"in e}class lh{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(wY(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Ox={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},kY={ex:!0,em:!0,mu:!0},gN=function(t){return typeof t!="string"&&(t=t.unit),t in Ox||t in kY||t==="ex"},Qn=function(t,n){var r;if(t.unit in Ox)r=Ox[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new Ce("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},Ie=function(t){return+t.toFixed(4)+"em"},Hl=function(t){return t.filter(n=>n).join(" ")},Q3=function(t){var n="";for(var r of Object.keys(t)){var i=t[r];i!==void 0&&(n+=XK(r)+":"+i+";")}return n},yN=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},bN=function(t){var n=document.createElement(t);n.className=Hl(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n},_Y=/[\s"'>/=\x00-\x1f]/,vN=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+li(Hl(this.classes))+'"');var r=Q3(this.style);r&&(n+=' style="'+li(r)+'"');for(var i of Object.keys(this.attributes)){if(_Y.test(i))throw new Ce("Invalid attribute name '"+i+"'");n+=" "+i+'="'+li(this.attributes[i])+'"'}n+=">";for(var s=0;s<this.children.length;s++)n+=this.children[s].toMarkup();return n+="</"+t+">",n};class ch{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,yN.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return bN.call(this,"span")}toMarkup(){return vN.call(this,"span")}}class V1{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,yN.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return bN.call(this,"a")}toMarkup(){return vN.call(this,"a")}}class SY{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+li(this.src)+'"'+(' alt="'+li(this.alt)+'"'),n=Q3(this.style);return n&&(t+=' style="'+li(n)+'"'),t+="'/>",t}}var TY={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class ps{constructor(t,n,r,i,s,a,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=r||0,this.italic=i||0,this.skew=s||0,this.width=a||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var c=uY(this.text.charCodeAt(0));c&&this.classes.push(c+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=TY[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Ie(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Hl(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=li(Hl(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+Ie(this.italic)+";"),r+=Q3(this.style),r&&(t=!0,n+=' style="'+li(r)+'"');var i=li(this.text);return t?(n+=">",n+=i,n+="</span>",n):i}}class Lo{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+li(this.attributes[n])+'"';t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</svg>",t}}class ql{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",BS[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+li(this.alternate)+'"/>':'<path d="'+li(BS[this.pathName])+'"/>'}}class jx{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+li(this.attributes[n])+'"';return t+="/>",t}}function CY(e){if(e instanceof ps)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function EY(e){if(e instanceof ch)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var AY=e=>e instanceof ch||e instanceof V1||e instanceof lh,Oa={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Cm={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},zS={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function xN(e,t){Oa[e]=t}function J3(e,t,n){if(!Oa[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Oa[t][r];if(!i&&e[0]in zS&&(r=zS[e[0]].charCodeAt(0),i=Oa[t][r]),!i&&n==="text"&&pN(r)&&(i=Oa[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var nv={};function MY(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!nv[t]){var n=nv[t]={cssEmPerMu:Cm.quad[t]/18};for(var r in Cm)Cm.hasOwnProperty(r)&&(n[r]=Cm[r][t])}return nv[t]}var Wn={math:{},text:{}};function k(e,t,n,r,i,s){Wn[e][i]={font:t,group:n,replace:r},s&&r&&(Wn[e][r]=Wn[e][i])}var _="math",ge="text",A="main",F="ams",Kn="accent-token",Ve="bin",Ni="close",uh="inner",pt="mathord",kr="op-token",ys="open",P0="punct",V="rel",Uo="spacing",K="textord";k(_,A,V,"≡","\\equiv",!0);k(_,A,V,"≺","\\prec",!0);k(_,A,V,"≻","\\succ",!0);k(_,A,V,"∼","\\sim",!0);k(_,A,V,"⊥","\\perp");k(_,A,V,"⪯","\\preceq",!0);k(_,A,V,"⪰","\\succeq",!0);k(_,A,V,"≃","\\simeq",!0);k(_,A,V,"∣","\\mid",!0);k(_,A,V,"≪","\\ll",!0);k(_,A,V,"≫","\\gg",!0);k(_,A,V,"≍","\\asymp",!0);k(_,A,V,"∥","\\parallel");k(_,A,V,"⋈","\\bowtie",!0);k(_,A,V,"⌣","\\smile",!0);k(_,A,V,"⊑","\\sqsubseteq",!0);k(_,A,V,"⊒","\\sqsupseteq",!0);k(_,A,V,"≐","\\doteq",!0);k(_,A,V,"⌢","\\frown",!0);k(_,A,V,"∋","\\ni",!0);k(_,A,V,"∝","\\propto",!0);k(_,A,V,"⊢","\\vdash",!0);k(_,A,V,"⊣","\\dashv",!0);k(_,A,V,"∋","\\owns");k(_,A,P0,".","\\ldotp");k(_,A,P0,"⋅","\\cdotp");k(_,A,P0,"⋅","·");k(ge,A,K,"⋅","·");k(_,A,K,"#","\\#");k(ge,A,K,"#","\\#");k(_,A,K,"&","\\&");k(ge,A,K,"&","\\&");k(_,A,K,"ℵ","\\aleph",!0);k(_,A,K,"∀","\\forall",!0);k(_,A,K,"ℏ","\\hbar",!0);k(_,A,K,"∃","\\exists",!0);k(_,A,K,"∇","\\nabla",!0);k(_,A,K,"♭","\\flat",!0);k(_,A,K,"ℓ","\\ell",!0);k(_,A,K,"♮","\\natural",!0);k(_,A,K,"♣","\\clubsuit",!0);k(_,A,K,"℘","\\wp",!0);k(_,A,K,"♯","\\sharp",!0);k(_,A,K,"♢","\\diamondsuit",!0);k(_,A,K,"ℜ","\\Re",!0);k(_,A,K,"♡","\\heartsuit",!0);k(_,A,K,"ℑ","\\Im",!0);k(_,A,K,"♠","\\spadesuit",!0);k(_,A,K,"§","\\S",!0);k(ge,A,K,"§","\\S");k(_,A,K,"¶","\\P",!0);k(ge,A,K,"¶","\\P");k(_,A,K,"†","\\dag");k(ge,A,K,"†","\\dag");k(ge,A,K,"†","\\textdagger");k(_,A,K,"‡","\\ddag");k(ge,A,K,"‡","\\ddag");k(ge,A,K,"‡","\\textdaggerdbl");k(_,A,Ni,"⎱","\\rmoustache",!0);k(_,A,ys,"⎰","\\lmoustache",!0);k(_,A,Ni,"⟯","\\rgroup",!0);k(_,A,ys,"⟮","\\lgroup",!0);k(_,A,Ve,"∓","\\mp",!0);k(_,A,Ve,"⊖","\\ominus",!0);k(_,A,Ve,"⊎","\\uplus",!0);k(_,A,Ve,"⊓","\\sqcap",!0);k(_,A,Ve,"∗","\\ast");k(_,A,Ve,"⊔","\\sqcup",!0);k(_,A,Ve,"◯","\\bigcirc",!0);k(_,A,Ve,"∙","\\bullet",!0);k(_,A,Ve,"‡","\\ddagger");k(_,A,Ve,"≀","\\wr",!0);k(_,A,Ve,"⨿","\\amalg");k(_,A,Ve,"&","\\And");k(_,A,V,"⟵","\\longleftarrow",!0);k(_,A,V,"⇐","\\Leftarrow",!0);k(_,A,V,"⟸","\\Longleftarrow",!0);k(_,A,V,"⟶","\\longrightarrow",!0);k(_,A,V,"⇒","\\Rightarrow",!0);k(_,A,V,"⟹","\\Longrightarrow",!0);k(_,A,V,"↔","\\leftrightarrow",!0);k(_,A,V,"⟷","\\longleftrightarrow",!0);k(_,A,V,"⇔","\\Leftrightarrow",!0);k(_,A,V,"⟺","\\Longleftrightarrow",!0);k(_,A,V,"↦","\\mapsto",!0);k(_,A,V,"⟼","\\longmapsto",!0);k(_,A,V,"↗","\\nearrow",!0);k(_,A,V,"↩","\\hookleftarrow",!0);k(_,A,V,"↪","\\hookrightarrow",!0);k(_,A,V,"↘","\\searrow",!0);k(_,A,V,"↼","\\leftharpoonup",!0);k(_,A,V,"⇀","\\rightharpoonup",!0);k(_,A,V,"↙","\\swarrow",!0);k(_,A,V,"↽","\\leftharpoondown",!0);k(_,A,V,"⇁","\\rightharpoondown",!0);k(_,A,V,"↖","\\nwarrow",!0);k(_,A,V,"⇌","\\rightleftharpoons",!0);k(_,F,V,"≮","\\nless",!0);k(_,F,V,"","\\@nleqslant");k(_,F,V,"","\\@nleqq");k(_,F,V,"⪇","\\lneq",!0);k(_,F,V,"≨","\\lneqq",!0);k(_,F,V,"","\\@lvertneqq");k(_,F,V,"⋦","\\lnsim",!0);k(_,F,V,"⪉","\\lnapprox",!0);k(_,F,V,"⊀","\\nprec",!0);k(_,F,V,"⋠","\\npreceq",!0);k(_,F,V,"⋨","\\precnsim",!0);k(_,F,V,"⪹","\\precnapprox",!0);k(_,F,V,"≁","\\nsim",!0);k(_,F,V,"","\\@nshortmid");k(_,F,V,"∤","\\nmid",!0);k(_,F,V,"⊬","\\nvdash",!0);k(_,F,V,"⊭","\\nvDash",!0);k(_,F,V,"⋪","\\ntriangleleft");k(_,F,V,"⋬","\\ntrianglelefteq",!0);k(_,F,V,"⊊","\\subsetneq",!0);k(_,F,V,"","\\@varsubsetneq");k(_,F,V,"⫋","\\subsetneqq",!0);k(_,F,V,"","\\@varsubsetneqq");k(_,F,V,"≯","\\ngtr",!0);k(_,F,V,"","\\@ngeqslant");k(_,F,V,"","\\@ngeqq");k(_,F,V,"⪈","\\gneq",!0);k(_,F,V,"≩","\\gneqq",!0);k(_,F,V,"","\\@gvertneqq");k(_,F,V,"⋧","\\gnsim",!0);k(_,F,V,"⪊","\\gnapprox",!0);k(_,F,V,"⊁","\\nsucc",!0);k(_,F,V,"⋡","\\nsucceq",!0);k(_,F,V,"⋩","\\succnsim",!0);k(_,F,V,"⪺","\\succnapprox",!0);k(_,F,V,"≆","\\ncong",!0);k(_,F,V,"","\\@nshortparallel");k(_,F,V,"∦","\\nparallel",!0);k(_,F,V,"⊯","\\nVDash",!0);k(_,F,V,"⋫","\\ntriangleright");k(_,F,V,"⋭","\\ntrianglerighteq",!0);k(_,F,V,"","\\@nsupseteqq");k(_,F,V,"⊋","\\supsetneq",!0);k(_,F,V,"","\\@varsupsetneq");k(_,F,V,"⫌","\\supsetneqq",!0);k(_,F,V,"","\\@varsupsetneqq");k(_,F,V,"⊮","\\nVdash",!0);k(_,F,V,"⪵","\\precneqq",!0);k(_,F,V,"⪶","\\succneqq",!0);k(_,F,V,"","\\@nsubseteqq");k(_,F,Ve,"⊴","\\unlhd");k(_,F,Ve,"⊵","\\unrhd");k(_,F,V,"↚","\\nleftarrow",!0);k(_,F,V,"↛","\\nrightarrow",!0);k(_,F,V,"⇍","\\nLeftarrow",!0);k(_,F,V,"⇏","\\nRightarrow",!0);k(_,F,V,"↮","\\nleftrightarrow",!0);k(_,F,V,"⇎","\\nLeftrightarrow",!0);k(_,F,V,"△","\\vartriangle");k(_,F,K,"ℏ","\\hslash");k(_,F,K,"▽","\\triangledown");k(_,F,K,"◊","\\lozenge");k(_,F,K,"Ⓢ","\\circledS");k(_,F,K,"®","\\circledR");k(ge,F,K,"®","\\circledR");k(_,F,K,"∡","\\measuredangle",!0);k(_,F,K,"∄","\\nexists");k(_,F,K,"℧","\\mho");k(_,F,K,"Ⅎ","\\Finv",!0);k(_,F,K,"⅁","\\Game",!0);k(_,F,K,"‵","\\backprime");k(_,F,K,"▲","\\blacktriangle");k(_,F,K,"▼","\\blacktriangledown");k(_,F,K,"■","\\blacksquare");k(_,F,K,"⧫","\\blacklozenge");k(_,F,K,"★","\\bigstar");k(_,F,K,"∢","\\sphericalangle",!0);k(_,F,K,"∁","\\complement",!0);k(_,F,K,"ð","\\eth",!0);k(ge,A,K,"ð","ð");k(_,F,K,"╱","\\diagup");k(_,F,K,"╲","\\diagdown");k(_,F,K,"□","\\square");k(_,F,K,"□","\\Box");k(_,F,K,"◊","\\Diamond");k(_,F,K,"¥","\\yen",!0);k(ge,F,K,"¥","\\yen",!0);k(_,F,K,"✓","\\checkmark",!0);k(ge,F,K,"✓","\\checkmark");k(_,F,K,"ℶ","\\beth",!0);k(_,F,K,"ℸ","\\daleth",!0);k(_,F,K,"ℷ","\\gimel",!0);k(_,F,K,"ϝ","\\digamma",!0);k(_,F,K,"ϰ","\\varkappa");k(_,F,ys,"┌","\\@ulcorner",!0);k(_,F,Ni,"┐","\\@urcorner",!0);k(_,F,ys,"└","\\@llcorner",!0);k(_,F,Ni,"┘","\\@lrcorner",!0);k(_,F,V,"≦","\\leqq",!0);k(_,F,V,"⩽","\\leqslant",!0);k(_,F,V,"⪕","\\eqslantless",!0);k(_,F,V,"≲","\\lesssim",!0);k(_,F,V,"⪅","\\lessapprox",!0);k(_,F,V,"≊","\\approxeq",!0);k(_,F,Ve,"⋖","\\lessdot");k(_,F,V,"⋘","\\lll",!0);k(_,F,V,"≶","\\lessgtr",!0);k(_,F,V,"⋚","\\lesseqgtr",!0);k(_,F,V,"⪋","\\lesseqqgtr",!0);k(_,F,V,"≑","\\doteqdot");k(_,F,V,"≓","\\risingdotseq",!0);k(_,F,V,"≒","\\fallingdotseq",!0);k(_,F,V,"∽","\\backsim",!0);k(_,F,V,"⋍","\\backsimeq",!0);k(_,F,V,"⫅","\\subseteqq",!0);k(_,F,V,"⋐","\\Subset",!0);k(_,F,V,"⊏","\\sqsubset",!0);k(_,F,V,"≼","\\preccurlyeq",!0);k(_,F,V,"⋞","\\curlyeqprec",!0);k(_,F,V,"≾","\\precsim",!0);k(_,F,V,"⪷","\\precapprox",!0);k(_,F,V,"⊲","\\vartriangleleft");k(_,F,V,"⊴","\\trianglelefteq");k(_,F,V,"⊨","\\vDash",!0);k(_,F,V,"⊪","\\Vvdash",!0);k(_,F,V,"⌣","\\smallsmile");k(_,F,V,"⌢","\\smallfrown");k(_,F,V,"≏","\\bumpeq",!0);k(_,F,V,"≎","\\Bumpeq",!0);k(_,F,V,"≧","\\geqq",!0);k(_,F,V,"⩾","\\geqslant",!0);k(_,F,V,"⪖","\\eqslantgtr",!0);k(_,F,V,"≳","\\gtrsim",!0);k(_,F,V,"⪆","\\gtrapprox",!0);k(_,F,Ve,"⋗","\\gtrdot");k(_,F,V,"⋙","\\ggg",!0);k(_,F,V,"≷","\\gtrless",!0);k(_,F,V,"⋛","\\gtreqless",!0);k(_,F,V,"⪌","\\gtreqqless",!0);k(_,F,V,"≖","\\eqcirc",!0);k(_,F,V,"≗","\\circeq",!0);k(_,F,V,"≜","\\triangleq",!0);k(_,F,V,"∼","\\thicksim");k(_,F,V,"≈","\\thickapprox");k(_,F,V,"⫆","\\supseteqq",!0);k(_,F,V,"⋑","\\Supset",!0);k(_,F,V,"⊐","\\sqsupset",!0);k(_,F,V,"≽","\\succcurlyeq",!0);k(_,F,V,"⋟","\\curlyeqsucc",!0);k(_,F,V,"≿","\\succsim",!0);k(_,F,V,"⪸","\\succapprox",!0);k(_,F,V,"⊳","\\vartriangleright");k(_,F,V,"⊵","\\trianglerighteq");k(_,F,V,"⊩","\\Vdash",!0);k(_,F,V,"∣","\\shortmid");k(_,F,V,"∥","\\shortparallel");k(_,F,V,"≬","\\between",!0);k(_,F,V,"⋔","\\pitchfork",!0);k(_,F,V,"∝","\\varpropto");k(_,F,V,"◀","\\blacktriangleleft");k(_,F,V,"∴","\\therefore",!0);k(_,F,V,"∍","\\backepsilon");k(_,F,V,"▶","\\blacktriangleright");k(_,F,V,"∵","\\because",!0);k(_,F,V,"⋘","\\llless");k(_,F,V,"⋙","\\gggtr");k(_,F,Ve,"⊲","\\lhd");k(_,F,Ve,"⊳","\\rhd");k(_,F,V,"≂","\\eqsim",!0);k(_,A,V,"⋈","\\Join");k(_,F,V,"≑","\\Doteq",!0);k(_,F,Ve,"∔","\\dotplus",!0);k(_,F,Ve,"∖","\\smallsetminus");k(_,F,Ve,"⋒","\\Cap",!0);k(_,F,Ve,"⋓","\\Cup",!0);k(_,F,Ve,"⩞","\\doublebarwedge",!0);k(_,F,Ve,"⊟","\\boxminus",!0);k(_,F,Ve,"⊞","\\boxplus",!0);k(_,F,Ve,"⋇","\\divideontimes",!0);k(_,F,Ve,"⋉","\\ltimes",!0);k(_,F,Ve,"⋊","\\rtimes",!0);k(_,F,Ve,"⋋","\\leftthreetimes",!0);k(_,F,Ve,"⋌","\\rightthreetimes",!0);k(_,F,Ve,"⋏","\\curlywedge",!0);k(_,F,Ve,"⋎","\\curlyvee",!0);k(_,F,Ve,"⊝","\\circleddash",!0);k(_,F,Ve,"⊛","\\circledast",!0);k(_,F,Ve,"⋅","\\centerdot");k(_,F,Ve,"⊺","\\intercal",!0);k(_,F,Ve,"⋒","\\doublecap");k(_,F,Ve,"⋓","\\doublecup");k(_,F,Ve,"⊠","\\boxtimes",!0);k(_,F,V,"⇢","\\dashrightarrow",!0);k(_,F,V,"⇠","\\dashleftarrow",!0);k(_,F,V,"⇇","\\leftleftarrows",!0);k(_,F,V,"⇆","\\leftrightarrows",!0);k(_,F,V,"⇚","\\Lleftarrow",!0);k(_,F,V,"↞","\\twoheadleftarrow",!0);k(_,F,V,"↢","\\leftarrowtail",!0);k(_,F,V,"↫","\\looparrowleft",!0);k(_,F,V,"⇋","\\leftrightharpoons",!0);k(_,F,V,"↶","\\curvearrowleft",!0);k(_,F,V,"↺","\\circlearrowleft",!0);k(_,F,V,"↰","\\Lsh",!0);k(_,F,V,"⇈","\\upuparrows",!0);k(_,F,V,"↿","\\upharpoonleft",!0);k(_,F,V,"⇃","\\downharpoonleft",!0);k(_,A,V,"⊶","\\origof",!0);k(_,A,V,"⊷","\\imageof",!0);k(_,F,V,"⊸","\\multimap",!0);k(_,F,V,"↭","\\leftrightsquigarrow",!0);k(_,F,V,"⇉","\\rightrightarrows",!0);k(_,F,V,"⇄","\\rightleftarrows",!0);k(_,F,V,"↠","\\twoheadrightarrow",!0);k(_,F,V,"↣","\\rightarrowtail",!0);k(_,F,V,"↬","\\looparrowright",!0);k(_,F,V,"↷","\\curvearrowright",!0);k(_,F,V,"↻","\\circlearrowright",!0);k(_,F,V,"↱","\\Rsh",!0);k(_,F,V,"⇊","\\downdownarrows",!0);k(_,F,V,"↾","\\upharpoonright",!0);k(_,F,V,"⇂","\\downharpoonright",!0);k(_,F,V,"⇝","\\rightsquigarrow",!0);k(_,F,V,"⇝","\\leadsto");k(_,F,V,"⇛","\\Rrightarrow",!0);k(_,F,V,"↾","\\restriction");k(_,A,K,"‘","`");k(_,A,K,"$","\\$");k(ge,A,K,"$","\\$");k(ge,A,K,"$","\\textdollar");k(_,A,K,"%","\\%");k(ge,A,K,"%","\\%");k(_,A,K,"_","\\_");k(ge,A,K,"_","\\_");k(ge,A,K,"_","\\textunderscore");k(_,A,K,"∠","\\angle",!0);k(_,A,K,"∞","\\infty",!0);k(_,A,K,"′","\\prime");k(_,A,K,"△","\\triangle");k(_,A,K,"Γ","\\Gamma",!0);k(_,A,K,"Δ","\\Delta",!0);k(_,A,K,"Θ","\\Theta",!0);k(_,A,K,"Λ","\\Lambda",!0);k(_,A,K,"Ξ","\\Xi",!0);k(_,A,K,"Π","\\Pi",!0);k(_,A,K,"Σ","\\Sigma",!0);k(_,A,K,"Υ","\\Upsilon",!0);k(_,A,K,"Φ","\\Phi",!0);k(_,A,K,"Ψ","\\Psi",!0);k(_,A,K,"Ω","\\Omega",!0);k(_,A,K,"A","Α");k(_,A,K,"B","Β");k(_,A,K,"E","Ε");k(_,A,K,"Z","Ζ");k(_,A,K,"H","Η");k(_,A,K,"I","Ι");k(_,A,K,"K","Κ");k(_,A,K,"M","Μ");k(_,A,K,"N","Ν");k(_,A,K,"O","Ο");k(_,A,K,"P","Ρ");k(_,A,K,"T","Τ");k(_,A,K,"X","Χ");k(_,A,K,"¬","\\neg",!0);k(_,A,K,"¬","\\lnot");k(_,A,K,"⊤","\\top");k(_,A,K,"⊥","\\bot");k(_,A,K,"∅","\\emptyset");k(_,F,K,"∅","\\varnothing");k(_,A,pt,"α","\\alpha",!0);k(_,A,pt,"β","\\beta",!0);k(_,A,pt,"γ","\\gamma",!0);k(_,A,pt,"δ","\\delta",!0);k(_,A,pt,"ϵ","\\epsilon",!0);k(_,A,pt,"ζ","\\zeta",!0);k(_,A,pt,"η","\\eta",!0);k(_,A,pt,"θ","\\theta",!0);k(_,A,pt,"ι","\\iota",!0);k(_,A,pt,"κ","\\kappa",!0);k(_,A,pt,"λ","\\lambda",!0);k(_,A,pt,"μ","\\mu",!0);k(_,A,pt,"ν","\\nu",!0);k(_,A,pt,"ξ","\\xi",!0);k(_,A,pt,"ο","\\omicron",!0);k(_,A,pt,"π","\\pi",!0);k(_,A,pt,"ρ","\\rho",!0);k(_,A,pt,"σ","\\sigma",!0);k(_,A,pt,"τ","\\tau",!0);k(_,A,pt,"υ","\\upsilon",!0);k(_,A,pt,"ϕ","\\phi",!0);k(_,A,pt,"χ","\\chi",!0);k(_,A,pt,"ψ","\\psi",!0);k(_,A,pt,"ω","\\omega",!0);k(_,A,pt,"ε","\\varepsilon",!0);k(_,A,pt,"ϑ","\\vartheta",!0);k(_,A,pt,"ϖ","\\varpi",!0);k(_,A,pt,"ϱ","\\varrho",!0);k(_,A,pt,"ς","\\varsigma",!0);k(_,A,pt,"φ","\\varphi",!0);k(_,A,Ve,"∗","*",!0);k(_,A,Ve,"+","+");k(_,A,Ve,"−","-",!0);k(_,A,Ve,"⋅","\\cdot",!0);k(_,A,Ve,"∘","\\circ",!0);k(_,A,Ve,"÷","\\div",!0);k(_,A,Ve,"±","\\pm",!0);k(_,A,Ve,"×","\\times",!0);k(_,A,Ve,"∩","\\cap",!0);k(_,A,Ve,"∪","\\cup",!0);k(_,A,Ve,"∖","\\setminus",!0);k(_,A,Ve,"∧","\\land");k(_,A,Ve,"∨","\\lor");k(_,A,Ve,"∧","\\wedge",!0);k(_,A,Ve,"∨","\\vee",!0);k(_,A,K,"√","\\surd");k(_,A,ys,"⟨","\\langle",!0);k(_,A,ys,"∣","\\lvert");k(_,A,ys,"∥","\\lVert");k(_,A,Ni,"?","?");k(_,A,Ni,"!","!");k(_,A,Ni,"⟩","\\rangle",!0);k(_,A,Ni,"∣","\\rvert");k(_,A,Ni,"∥","\\rVert");k(_,A,V,"=","=");k(_,A,V,":",":");k(_,A,V,"≈","\\approx",!0);k(_,A,V,"≅","\\cong",!0);k(_,A,V,"≥","\\ge");k(_,A,V,"≥","\\geq",!0);k(_,A,V,"←","\\gets");k(_,A,V,">","\\gt",!0);k(_,A,V,"∈","\\in",!0);k(_,A,V,"","\\@not");k(_,A,V,"⊂","\\subset",!0);k(_,A,V,"⊃","\\supset",!0);k(_,A,V,"⊆","\\subseteq",!0);k(_,A,V,"⊇","\\supseteq",!0);k(_,F,V,"⊈","\\nsubseteq",!0);k(_,F,V,"⊉","\\nsupseteq",!0);k(_,A,V,"⊨","\\models");k(_,A,V,"←","\\leftarrow",!0);k(_,A,V,"≤","\\le");k(_,A,V,"≤","\\leq",!0);k(_,A,V,"<","\\lt",!0);k(_,A,V,"→","\\rightarrow",!0);k(_,A,V,"→","\\to");k(_,F,V,"≱","\\ngeq",!0);k(_,F,V,"≰","\\nleq",!0);k(_,A,Uo," ","\\ ");k(_,A,Uo," ","\\space");k(_,A,Uo," ","\\nobreakspace");k(ge,A,Uo," ","\\ ");k(ge,A,Uo," "," ");k(ge,A,Uo," ","\\space");k(ge,A,Uo," ","\\nobreakspace");k(_,A,Uo,"","\\nobreak");k(_,A,Uo,"","\\allowbreak");k(_,A,P0,",",",");k(_,A,P0,";",";");k(_,F,Ve,"⊼","\\barwedge",!0);k(_,F,Ve,"⊻","\\veebar",!0);k(_,A,Ve,"⊙","\\odot",!0);k(_,A,Ve,"⊕","\\oplus",!0);k(_,A,Ve,"⊗","\\otimes",!0);k(_,A,K,"∂","\\partial",!0);k(_,A,Ve,"⊘","\\oslash",!0);k(_,F,Ve,"⊚","\\circledcirc",!0);k(_,F,Ve,"⊡","\\boxdot",!0);k(_,A,Ve,"△","\\bigtriangleup");k(_,A,Ve,"▽","\\bigtriangledown");k(_,A,Ve,"†","\\dagger");k(_,A,Ve,"⋄","\\diamond");k(_,A,Ve,"⋆","\\star");k(_,A,Ve,"◃","\\triangleleft");k(_,A,Ve,"▹","\\triangleright");k(_,A,ys,"{","\\{");k(ge,A,K,"{","\\{");k(ge,A,K,"{","\\textbraceleft");k(_,A,Ni,"}","\\}");k(ge,A,K,"}","\\}");k(ge,A,K,"}","\\textbraceright");k(_,A,ys,"{","\\lbrace");k(_,A,Ni,"}","\\rbrace");k(_,A,ys,"[","\\lbrack",!0);k(ge,A,K,"[","\\lbrack",!0);k(_,A,Ni,"]","\\rbrack",!0);k(ge,A,K,"]","\\rbrack",!0);k(_,A,ys,"(","\\lparen",!0);k(_,A,Ni,")","\\rparen",!0);k(ge,A,K,"<","\\textless",!0);k(ge,A,K,">","\\textgreater",!0);k(_,A,ys,"⌊","\\lfloor",!0);k(_,A,Ni,"⌋","\\rfloor",!0);k(_,A,ys,"⌈","\\lceil",!0);k(_,A,Ni,"⌉","\\rceil",!0);k(_,A,K,"\\","\\backslash");k(_,A,K,"∣","|");k(_,A,K,"∣","\\vert");k(ge,A,K,"|","\\textbar",!0);k(_,A,K,"∥","\\|");k(_,A,K,"∥","\\Vert");k(ge,A,K,"∥","\\textbardbl");k(ge,A,K,"~","\\textasciitilde");k(ge,A,K,"\\","\\textbackslash");k(ge,A,K,"^","\\textasciicircum");k(_,A,V,"↑","\\uparrow",!0);k(_,A,V,"⇑","\\Uparrow",!0);k(_,A,V,"↓","\\downarrow",!0);k(_,A,V,"⇓","\\Downarrow",!0);k(_,A,V,"↕","\\updownarrow",!0);k(_,A,V,"⇕","\\Updownarrow",!0);k(_,A,kr,"∐","\\coprod");k(_,A,kr,"⋁","\\bigvee");k(_,A,kr,"⋀","\\bigwedge");k(_,A,kr,"⨄","\\biguplus");k(_,A,kr,"⋂","\\bigcap");k(_,A,kr,"⋃","\\bigcup");k(_,A,kr,"∫","\\int");k(_,A,kr,"∫","\\intop");k(_,A,kr,"∬","\\iint");k(_,A,kr,"∭","\\iiint");k(_,A,kr,"∏","\\prod");k(_,A,kr,"∑","\\sum");k(_,A,kr,"⨂","\\bigotimes");k(_,A,kr,"⨁","\\bigoplus");k(_,A,kr,"⨀","\\bigodot");k(_,A,kr,"∮","\\oint");k(_,A,kr,"∯","\\oiint");k(_,A,kr,"∰","\\oiiint");k(_,A,kr,"⨆","\\bigsqcup");k(_,A,kr,"∫","\\smallint");k(ge,A,uh,"…","\\textellipsis");k(_,A,uh,"…","\\mathellipsis");k(ge,A,uh,"…","\\ldots",!0);k(_,A,uh,"…","\\ldots",!0);k(_,A,uh,"⋯","\\@cdots",!0);k(_,A,uh,"⋱","\\ddots",!0);k(_,A,K,"⋮","\\varvdots");k(ge,A,K,"⋮","\\varvdots");k(_,A,Kn,"ˊ","\\acute");k(_,A,Kn,"ˋ","\\grave");k(_,A,Kn,"¨","\\ddot");k(_,A,Kn,"~","\\tilde");k(_,A,Kn,"ˉ","\\bar");k(_,A,Kn,"˘","\\breve");k(_,A,Kn,"ˇ","\\check");k(_,A,Kn,"^","\\hat");k(_,A,Kn,"⃗","\\vec");k(_,A,Kn,"˙","\\dot");k(_,A,Kn,"˚","\\mathring");k(_,A,pt,"","\\@imath");k(_,A,pt,"","\\@jmath");k(_,A,K,"ı","ı");k(_,A,K,"ȷ","ȷ");k(ge,A,K,"ı","\\i",!0);k(ge,A,K,"ȷ","\\j",!0);k(ge,A,K,"ß","\\ss",!0);k(ge,A,K,"æ","\\ae",!0);k(ge,A,K,"œ","\\oe",!0);k(ge,A,K,"ø","\\o",!0);k(ge,A,K,"Æ","\\AE",!0);k(ge,A,K,"Œ","\\OE",!0);k(ge,A,K,"Ø","\\O",!0);k(ge,A,Kn,"ˊ","\\'");k(ge,A,Kn,"ˋ","\\`");k(ge,A,Kn,"ˆ","\\^");k(ge,A,Kn,"˜","\\~");k(ge,A,Kn,"ˉ","\\=");k(ge,A,Kn,"˘","\\u");k(ge,A,Kn,"˙","\\.");k(ge,A,Kn,"¸","\\c");k(ge,A,Kn,"˚","\\r");k(ge,A,Kn,"ˇ","\\v");k(ge,A,Kn,"¨",'\\"');k(ge,A,Kn,"˝","\\H");k(ge,A,Kn,"◯","\\textcircled");var wN={"--":!0,"---":!0,"``":!0,"''":!0};k(ge,A,K,"–","--",!0);k(ge,A,K,"–","\\textendash");k(ge,A,K,"—","---",!0);k(ge,A,K,"—","\\textemdash");k(ge,A,K,"‘","`",!0);k(ge,A,K,"‘","\\textquoteleft");k(ge,A,K,"’","'",!0);k(ge,A,K,"’","\\textquoteright");k(ge,A,K,"“","``",!0);k(ge,A,K,"“","\\textquotedblleft");k(ge,A,K,"”","''",!0);k(ge,A,K,"”","\\textquotedblright");k(_,A,K,"°","\\degree",!0);k(ge,A,K,"°","\\degree");k(ge,A,K,"°","\\textdegree",!0);k(_,A,K,"£","\\pounds");k(_,A,K,"£","\\mathsterling",!0);k(ge,A,K,"£","\\pounds");k(ge,A,K,"£","\\textsterling",!0);k(_,F,K,"✠","\\maltese");k(ge,F,K,"✠","\\maltese");var PS='0123456789/@."';for(var rv=0;rv<PS.length;rv++){var $S=PS.charAt(rv);k(_,A,K,$S,$S)}var US='0123456789!@*()-=+";:?/.,';for(var iv=0;iv<US.length;iv++){var HS=US.charAt(iv);k(ge,A,K,HS,HS)}var Og="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var sv=0;sv<Og.length;sv++){var Em=Og.charAt(sv);k(_,A,pt,Em,Em),k(ge,A,K,Em,Em)}k(_,F,K,"C","ℂ");k(ge,F,K,"C","ℂ");k(_,F,K,"H","ℍ");k(ge,F,K,"H","ℍ");k(_,F,K,"N","ℕ");k(ge,F,K,"N","ℕ");k(_,F,K,"P","ℙ");k(ge,F,K,"P","ℙ");k(_,F,K,"Q","ℚ");k(ge,F,K,"Q","ℚ");k(_,F,K,"R","ℝ");k(ge,F,K,"R","ℝ");k(_,F,K,"Z","ℤ");k(ge,F,K,"Z","ℤ");k(_,A,pt,"h","ℎ");k(ge,A,pt,"h","ℎ");var kt;for(var pi=0;pi<Og.length;pi++){var nr=Og.charAt(pi);kt=String.fromCharCode(55349,56320+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56372+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56424+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56580+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56684+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56736+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56788+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56840+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56944+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),pi<26&&(kt=String.fromCharCode(55349,56632+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt),kt=String.fromCharCode(55349,56476+pi),k(_,A,pt,nr,kt),k(ge,A,K,nr,kt))}kt="𝕜";k(_,A,pt,"k",kt);k(ge,A,K,"k",kt);for(var hc=0;hc<10;hc++){var tl=hc.toString();kt=String.fromCharCode(55349,57294+hc),k(_,A,pt,tl,kt),k(ge,A,K,tl,kt),kt=String.fromCharCode(55349,57314+hc),k(_,A,pt,tl,kt),k(ge,A,K,tl,kt),kt=String.fromCharCode(55349,57324+hc),k(_,A,pt,tl,kt),k(ge,A,K,tl,kt),kt=String.fromCharCode(55349,57334+hc),k(_,A,pt,tl,kt),k(ge,A,K,tl,kt)}var Lx="ÐÞþ";for(var av=0;av<Lx.length;av++){var Am=Lx.charAt(av);k(_,A,pt,Am,Am),k(ge,A,K,Am,Am)}var Bx={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},qS={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},FS={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},NY={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Cc={mathClass:"",textClass:"",font:""},VS={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},GS={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},WS={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},zx={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Px={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},KS={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},$x={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},YS=[Bx,Bx,qS,qS,FS,FS,NY,Cc,Cc,Cc,VS,VS,GS,GS,WS,WS,zx,zx,Px,Px,KS,KS,Cc,Cc,$x,$x],IY=[Bx,Cc,zx,Px,$x],DY=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return YS[i]}else if(120782<=r&&r<=120831){var s=Math.floor((r-120782)/10);return IY[s]}else{if(r===120485||r===120486)return YS[0];if(120486<r&&r<120782)return Cc;throw new Ce("Unsupported character: "+e)}},G1=function(t,n,r){if(Wn[r][t]){var i=Wn[r][t].replace;i&&(t=i)}return{value:t,metrics:J3(t,n,r)}},xi=function(t,n,r,i,s){var a=G1(t,n,r),o=a.metrics;t=a.value;var l;if(o){var c=o.italic;(r==="text"||i&&i.font==="mathit")&&(c=0),l=new ps(t,o.height,o.depth,c,o.skew,o.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+r+"'")),l=new ps(t,0,0,0,0,0,s);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var u=i.getColor();u&&(l.style.color=u)}return l},Z3=function(t,n,r,i){return i===void 0&&(i=[]),r.font==="boldsymbol"&&G1(t,"Main-Bold",n).metrics?xi(t,"Main-Bold",n,r,i.concat(["mathbf"])):t==="\\"||Wn[n][t].font==="main"?xi(t,"Main-Regular",n,r,i):xi(t,"AMS-Regular",n,r,i.concat(["amsrm"]))},RY=function(t,n,r){return r!=="textord"&&G1(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},W1=function(t,n,r){var i=t.mode,s=t.text,a=["mord"],{font:o,fontFamily:l,fontWeight:c,fontShape:u}=n,d=i==="math"||i==="text"&&!!o,f=d?o:l,m="",p="";if(s.charCodeAt(0)===55349){var b=DY(s);m=b.font,p=b[i+"Class"]}if(m)return xi(s,m,i,n,a.concat(p));if(f){var x,g;if(f==="boldsymbol"){var y=RY(s,i,r);x=y.fontName,g=[y.fontClass]}else d?(x=Ux[o].fontName,g=[o]):(x=Mm(l,c,u),g=[l,c,u]);if(G1(s,x,i).metrics)return xi(s,x,i,n,a.concat(g));if(wN.hasOwnProperty(s)&&x.slice(0,10)==="Typewriter"){for(var w=[],C=0;C<s.length;C++)w.push(xi(s[C],x,i,n,a.concat(g)));return Ho(w)}}if(r==="mathord")return xi(s,"Math-Italic",i,n,a.concat(["mathnormal"]));if(r==="textord"){var E=Wn[i][s]&&Wn[i][s].font;if(E==="ams"){var S=Mm("amsrm",c,u);return xi(s,S,i,n,a.concat("amsrm",c,u))}else if(E==="main"||!E){var T=Mm("textrm",c,u);return xi(s,T,i,n,a.concat(c,u))}else{var j=Mm(E,c,u);return xi(s,j,i,n,a.concat(j,c,u))}}else throw new Error("unexpected type: "+r+" in makeOrd")},OY=(e,t)=>{if(Hl(e.classes)!==Hl(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},kN=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof ps&&r instanceof ps&&OY(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},ek=function(t){for(var n=0,r=0,i=0,s=0;s<t.children.length;s++){var a=t.children[s];a.height>n&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},we=function(t,n,r,i){var s=new ch(t,n,r,i);return ek(s),s},Fl=(e,t,n,r)=>new ch(e,t,n,r),Bd=function(t,n,r){var i=we([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=Ie(i.height),i.maxFontSize=1,i},jY=function(t,n,r,i){var s=new V1(t,n,r,i);return ek(s),s},Ho=function(t){var n=new lh(t);return ek(n),n},zd=function(t,n){return t instanceof lh?we([],[t],n):t},LY=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,s=i,a=1;a<n.length;a++){var o=-n[a].shift-s-n[a].elem.depth,l=o-(n[a-1].elem.height+n[a-1].elem.depth);s=s+o,r.push({type:"kern",size:l}),r.push(n[a])}return{children:r,depth:i}}var c;if(t.positionType==="top"){for(var u=t.positionData,d=0;d<t.children.length;d++){var f=t.children[d];u-=f.type==="kern"?f.size:f.elem.height+f.elem.depth}c=u}else if(t.positionType==="bottom")c=-t.positionData;else{var m=t.children[0];if(m.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")c=-m.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")c=-m.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:c}},un=function(t,n){for(var{children:r,depth:i}=LY(t),s=0,a=0;a<r.length;a++){var o=r[a];if(o.type==="elem"){var l=o.elem;s=Math.max(s,l.maxFontSize,l.height)}}s+=2;var c=we(["pstrut"],[]);c.style.height=Ie(s);for(var u=[],d=i,f=i,m=i,p=0;p<r.length;p++){var b=r[p];if(b.type==="kern")m+=b.size;else{var x=b.elem,g=b.wrapperClasses||[],y=b.wrapperStyle||{},w=we(g,[c,x],void 0,y);w.style.top=Ie(-s-m-x.depth),b.marginLeft&&(w.style.marginLeft=b.marginLeft),b.marginRight&&(w.style.marginRight=b.marginRight),u.push(w),m+=x.height+x.depth}d=Math.min(d,m),f=Math.max(f,m)}var C=we(["vlist"],u);C.style.height=Ie(f);var E;if(d<0){var S=we([],[]),T=we(["vlist"],[S]);T.style.height=Ie(-d);var j=we(["vlist-s"],[new ps("​")]);E=[we(["vlist-r"],[C,j]),we(["vlist-r"],[T])]}else E=[we(["vlist-r"],[C])];var z=we(["vlist-t"],E);return E.length===2&&z.classes.push("vlist-t2"),z.height=f,z.depth=-d,z},_N=(e,t)=>{var n=we(["mspace"],[],t),r=Qn(e,t);return n.style.marginRight=Ie(r),n},Mm=(e,t,n)=>{var r,i;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?i="BoldItalic":t==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},Ux={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},SN={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},TN=function(t,n){var[r,i,s]=SN[t],a=new ql(r),o=new Lo([a],{width:Ie(i),height:Ie(s),style:"width:"+Ie(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Fl(["overlay"],[o],n);return l.height=s,l.style.height=Ie(s),l.style.width=Ie(i),l},Xn={number:3,unit:"mu"},fc={number:4,unit:"mu"},so={number:5,unit:"mu"},BY={mord:{mop:Xn,mbin:fc,mrel:so,minner:Xn},mop:{mord:Xn,mop:Xn,mrel:so,minner:Xn},mbin:{mord:fc,mop:fc,mopen:fc,minner:fc},mrel:{mord:so,mop:so,mopen:so,minner:so},mopen:{},mclose:{mop:Xn,mbin:fc,mrel:so,minner:Xn},mpunct:{mord:Xn,mop:Xn,mrel:so,mopen:Xn,mclose:Xn,mpunct:Xn,minner:Xn},minner:{mord:Xn,mop:Xn,mbin:fc,mrel:so,mopen:Xn,mpunct:Xn,minner:Xn}},zY={mord:{mop:Xn},mop:{mord:Xn,mop:Xn},mbin:{},mrel:{},mopen:{},mclose:{mop:Xn},mpunct:{},minner:{mop:Xn}},CN={},jg={},Lg={};function ze(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:a}=e,o={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)CN[n[l]]=o;t&&(s&&(jg[t]=s),a&&(Lg[t]=a))}function mu(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;ze({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Bg=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},xr=function(t){return t.type==="ordgroup"?t.body:[t]},PY=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),$Y=new Set(["rightmost","mrel","mclose","mpunct"]),UY={display:At.DISPLAY,text:At.TEXT,script:At.SCRIPT,scriptscript:At.SCRIPTSCRIPT},HY={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},jr=function(t,n,r,i){i===void 0&&(i=[null,null]);for(var s=[],a=0;a<t.length;a++){var o=hn(t[a],n);if(o instanceof lh){var l=o.children;s.push(...l)}else s.push(o)}if(kN(s),!r)return s;var c=n;if(t.length===1){var u=t[0];u.type==="sizing"?c=n.havingSize(u.size):u.type==="styling"&&(c=n.havingStyle(UY[u.style]))}var d=we([i[0]||"leftmost"],[],n),f=we([i[1]||"rightmost"],[],n),m=r==="root";return Hx(s,(p,b)=>{var x=b.classes[0],g=p.classes[0];x==="mbin"&&$Y.has(g)?b.classes[0]="mord":g==="mbin"&&PY.has(x)&&(p.classes[0]="mord")},{node:d},f,m),Hx(s,(p,b)=>{var x,g,y=Fx(b),w=Fx(p),C=y&&w?p.hasClass("mtight")?(x=zY[y])==null?void 0:x[w]:(g=BY[y])==null?void 0:g[w]:null;if(C)return _N(C,c)},{node:d},f,m),s},Hx=function(t,n,r,i,s){i&&t.push(i);for(var a=0;a<t.length;a++){var o=t[a],l=EN(o);if(l){Hx(l.children,n,r,null,s);continue}var c=!o.hasClass("mspace");if(c){var u=n(o,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),a++))}c?r.node=o:s&&o.hasClass("newline")&&(r.node=we(["leftmost"])),r.insertAfter=(d=>f=>{t.splice(d+1,0,f),a++})(a)}i&&t.pop()},EN=function(t){return t instanceof lh||t instanceof V1||t instanceof ch&&t.hasClass("enclosing")?t:null},qx=function(t,n){var r=EN(t);if(r){var i=r.children;if(i.length){if(n==="right")return qx(i[i.length-1],"right");if(n==="left")return qx(i[0],"left")}}return t},Fx=function(t,n){if(!t)return null;n&&(t=qx(t,n));var r=t.classes[0];return HY[r]||null},t0=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return we(n.concat(r))},hn=function(t,n,r){if(!t)return we();if(jg[t.type]){var i=jg[t.type](t,n);if(r&&n.size!==r.size){i=we(n.sizingClasses(r),[i],n);var s=n.sizeMultiplier/r.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Ce("Got group of unknown type: '"+t.type+"'")};function Nm(e,t){var n=we(["base"],e,t),r=we(["strut"]);return r.style.height=Ie(n.height+n.depth),n.depth&&(r.style.verticalAlign=Ie(-n.depth)),n.children.unshift(r),n}function Vx(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=jr(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var s=[],a=[],o=0;o<r.length;o++)if(a.push(r[o]),r[o].hasClass("mbin")||r[o].hasClass("mrel")||r[o].hasClass("allowbreak")){for(var l=!1;o<r.length-1&&r[o+1].hasClass("mspace")&&!r[o+1].hasClass("newline");)o++,a.push(r[o]),r[o].hasClass("nobreak")&&(l=!0);l||(s.push(Nm(a,t)),a=[])}else r[o].hasClass("newline")&&(a.pop(),a.length>0&&(s.push(Nm(a,t)),a=[]),s.push(r[o]));a.length>0&&s.push(Nm(a,t));var c;n?(c=Nm(jr(n,t,!0),t),c.classes=["tag"],s.push(c)):i&&s.push(i);var u=we(["katex-html"],s);if(u.setAttribute("aria-hidden","true"),c){var d=c.children[0];d.style.height=Ie(u.height+u.depth),u.depth&&(d.style.verticalAlign=Ie(-u.depth))}return u}function AN(e){return new lh(e)}class Me{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Hl(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof wr&&this.children[r+1]instanceof wr){for(var i=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof wr;)i+=this.children[++r].toText();t.appendChild(new wr(i).toNode())}else t.appendChild(this.children[r].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=li(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+li(Hl(this.classes))+'"'),t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}let wr=class{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return li(this.toText())}toText(){return this.text}};class MN{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Ie(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Ie(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var qY=new Set(["\\imath","\\jmath"]),FY=new Set(["mrow","mtable"]),Vs=function(t,n,r){return Wn[n][t]&&Wn[n][t].replace&&t.charCodeAt(0)!==55349&&!(wN.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=Wn[n][t].replace),new wr(t)},tk=function(t){return t.length===1?t[0]:new Me("mrow",t)},VY={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},nk=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,i=VY[n];if(i)return typeof i=="function"?i(e):i;var s=e.text;if(qY.has(s))return null;if(Wn[r][s]){var a=Wn[r][s].replace;a&&(s=a)}var o=Ux[n].fontName;return J3(s,o,r)?Ux[n].variant:null};function ov(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof wr&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof wr&&n.text===","}else return!1}var bs=function(t,n,r){if(t.length===1){var i=In(t[0],n);return r&&i instanceof Me&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o<t.length;o++){var l=In(t[o],n);if(l instanceof Me&&a instanceof Me){if(l.type==="mtext"&&a.type==="mtext"&&l.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...l.children);continue}else if(l.type==="mn"&&a.type==="mn"){a.children.push(...l.children);continue}else if(ov(l)&&a.type==="mn"){a.children.push(...l.children);continue}else if(l.type==="mn"&&ov(a))l.children=[...a.children,...l.children],s.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(a.type==="mn"||ov(a))){var c=l.children[0];c instanceof Me&&c.type==="mn"&&(c.children=[...a.children,...c.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var u=a.children[0];if(u instanceof wr&&u.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof wr&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},Vl=function(t,n,r){return tk(bs(t,n,r))},In=function(t,n){if(!t)return new Me("mrow");if(Lg[t.type])return Lg[t.type](t,n);throw new Ce("Got group of unknown type: '"+t.type+"'")};function XS(e,t,n,r,i){var s=bs(e,n),a;s.length===1&&s[0]instanceof Me&&FY.has(s[0].type)?a=s[0]:a=new Me("mrow",s);var o=new Me("annotation",[new wr(t)]);o.setAttribute("encoding","application/x-tex");var l=new Me("semantics",[a,o]),c=new Me("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return we([u],[c])}var GY=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],QS=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],JS=function(t,n){return n.size<2?t:GY[t-1][n.size-1]};class fo{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||fo.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=QS[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new fo(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:JS(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:QS[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=JS(fo.BASESIZE,t);return this.size===n&&this.textSize===fo.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==fo.BASESIZE?["sizing","reset-size"+this.size,"size"+fo.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=MY(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}fo.BASESIZE=6;var NN=function(t){return new fo({style:t.displayMode?At.DISPLAY:At.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},IN=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=we(r,[t])}return t},WY=function(t,n,r){var i=NN(r),s;if(r.output==="mathml")return XS(t,n,i,r.displayMode,!0);if(r.output==="html"){var a=Vx(t,i);s=we(["katex"],[a])}else{var o=XS(t,n,i,r.displayMode,!1),l=Vx(t,i);s=we(["katex"],[o,l])}return IN(s,r)},KY=function(t,n,r){var i=NN(r),s=Vx(t,i),a=we(["katex"],[s]);return IN(a,r)},YY={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},K1=function(t){var n=new Me("mo",[new wr(YY[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},XY={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},QY=new Set(["widehat","widecheck","widetilde","utilde"]),Y1=function(t,n){function r(){var o=4e5,l=t.label.slice(1);if(QY.has(l)&&"base"in t){var c=t.base.type==="ordgroup"?t.base.body.length:1,u,d,f;if(c>5)l==="widehat"||l==="widecheck"?(u=420,o=2364,f=.42,d=l+"4"):(u=312,o=2340,f=.34,d="tilde4");else{var m=[1,1,2,2,3,3][c];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],u=[0,239,300,360,420][m],f=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],u=[0,260,286,306,312][m],f=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var p=new ql(d),b=new Lo([p],{width:"100%",height:Ie(f),viewBox:"0 0 "+o+" "+u,preserveAspectRatio:"none"});return{span:Fl([],[b],n),minWidth:0,height:f}}else{var x=[],g=XY[l];if(!g)throw new Error('No SVG data for "'+l+'".');var[y,w,C]=g,E=C/1e3,S=y.length,T,j;if(S===1){if(g.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[g[3]]}else if(S===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(S===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
                    `+S+" children.");for(var z=0;z<S;z++){var R=new ql(y[z]),D=new Lo([R],{width:"400em",height:Ie(E),viewBox:"0 0 "+o+" "+C,preserveAspectRatio:j[z]+" slice"}),N=Fl([T[z]],[D],n);if(S===1)return{span:N,minWidth:w,height:E};N.style.height=Ie(E),x.push(N)}return{span:we(["stretchy"],x,n),minWidth:w,height:E}}}var{span:i,minWidth:s,height:a}=r();return i.height=a,i.style.height=Ie(a),s>0&&(i.style.minWidth=Ie(s)),i},JY=function(t,n,r,i,s){var a,o=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(a=we(["stretchy",n],[],s),n==="fbox"){var l=s.color&&s.getColor();l&&(a.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(n)&&c.push(new jx({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&c.push(new jx({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new Lo(c,{width:"100%",height:Ie(o)});a=Fl([],[u],s)}return a.height=o,a.style.height=Ie(o),a},ZY={bin:1,close:1,inner:1,open:1,punct:1,rel:1},eX={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function tX(e){return e in ZY}function Bt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function X1(e){var t=Q1(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Q1(e){return e&&(e.type==="atom"||eX.hasOwnProperty(e.type))?e:null}var DN=e=>{if(e instanceof ps)return e;if(AY(e)&&e.children.length===1)return DN(e.children[0])},rk=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=Bt(e.base,"accent"),n=r.base,e.base=n,i=EY(hn(e,t)),e.base=r):(r=Bt(e,"accent"),n=r.base);var s=hn(n,t.havingCrampedStyle()),a=r.isShifty&&$o(n),o=0;if(a){var l,c;o=(l=(c=DN(s))==null?void 0:c.skew)!=null?l:0}var u=r.label==="\\c",d=u?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight),f;if(r.isStretchy)f=Y1(r,t),f=un({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Ie(2*o)+")",marginLeft:Ie(2*o)}:void 0}]});else{var m,p;r.label==="\\vec"?(m=TN("vec",t),p=SN.vec[1]):(m=W1({mode:r.mode,text:r.label},t,"textord"),m=CY(m),m.italic=0,p=m.width,u&&(d+=m.depth)),f=we(["accent-body"],[m]);var b=r.label==="\\textcircled";b&&(f.classes.push("accent-full"),d=s.height);var x=o;b||(x-=p/2),f.style.left=Ie(x),r.label==="\\textcircled"&&(f.style.top=".2em"),f=un({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:f}]})}var g=we(["mord","accent"],[f],t);return i?(i.children[0]=g,i.height=Math.max(g.height,i.height),i.classes[0]="mord",i):g},RN=(e,t)=>{var n=e.isStretchy?K1(e.label):new Me("mo",[Vs(e.label,e.mode)]),r=new Me("mover",[In(e.base,t),n]);return r.setAttribute("accent","true"),r},nX=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ze({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Bg(t[0]),r=!nX.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:rk,mathmlBuilder:RN});ze({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:rk,mathmlBuilder:RN});ze({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=hn(e.base,t),r=Y1(e,t),i=e.label==="\\utilde"?.12:0,s=un({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return we(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=K1(e.label),r=new Me("munder",[In(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Im=e=>{var t=new Me("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ze({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=zd(hn(e.body,r,t),t),s=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;e.below&&(r=t.havingStyle(n.sub()),a=zd(hn(e.below,r,t),t),a.classes.push(s+"-arrow-pad"));var o=Y1(e,t),l=-t.fontMetrics().axisHeight+.5*o.height,c=-t.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(c-=i.depth);var u;if(a){var d=-t.fontMetrics().axisHeight+a.height+.5*o.height+.111;u=un({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else u=un({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return we(["mrel","x-arrow"],[u],t)},mathmlBuilder(e,t){var n=K1(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=Im(In(e.body,t));if(e.below){var s=Im(In(e.below,t));r=new Me("munderover",[n,s,i])}else r=new Me("mover",[n,i])}else if(e.below){var a=Im(In(e.below,t));r=new Me("munder",[n,a])}else r=Im(),r=new Me("mover",[n,r]);return r}});function ON(e,t){var n=jr(e.body,t,!0);return we([e.mclass],n,t)}function jN(e,t){var n,r=bs(e.body,t);return e.mclass==="minner"?n=new Me("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new Me("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new Me("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}ze({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:xr(i),isCharacterBox:$o(i)}},htmlBuilder:ON,mathmlBuilder:jN});var J1=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};ze({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:J1(t[0]),body:xr(t[1]),isCharacterBox:$o(t[1])}}});ze({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],s=t[0],a;r!=="\\stackrel"?a=J1(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:xr(i)},l={type:"supsub",mode:s.mode,base:o,sup:r==="\\underset"?null:s,sub:r==="\\underset"?s:null};return{type:"mclass",mode:n.mode,mclass:a,body:[l],isCharacterBox:$o(l)}},htmlBuilder:ON,mathmlBuilder:jN});ze({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:J1(t[0]),body:xr(t[0])}},htmlBuilder(e,t){var n=jr(e.body,t,!0),r=we([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=bs(e.body,t),r=new Me("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var rX={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},ZS=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),e7=e=>e.type==="textord"&&e.text==="@",iX=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function sX(e,t,n){var r=rX[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),s={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[s],[]),o=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,o]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function aX(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Ce("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],s=0;s<t.length;s++){for(var a=t[s],o=ZS(),l=0;l<a.length;l++)if(!e7(a[l]))o.body.push(a[l]);else{r.push(o),l+=1;var c=X1(a[l]).text,u=new Array(2);if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(c))if("<>AV".includes(c))for(var d=0;d<2;d++){for(var f=!0,m=l+1;m<a.length;m++){if(iX(a[m],c)){f=!1,l=m;break}if(e7(a[m]))throw new Ce("Missing a "+c+" character to complete a CD arrow.",a[m]);u[d].body.push(a[m])}if(f)throw new Ce("Missing a "+c+" character to complete a CD arrow.",a[l])}else throw new Ce('Expected one of "<>AV=|." after @',a[l]);var p=sX(c,u,e),b={type:"styling",body:[p],mode:"math",style:"display",resetFont:!0};r.push(b),o=ZS()}s%2===0?r.push(o):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var x=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}ze({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=zd(hn(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Ie(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Me("mrow",[In(e.label,t)]);return n=new Me("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Me("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});ze({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=zd(hn(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Me("mrow",[In(e.fragment,t)])}});ze({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Bt(t[0],"ordgroup"),i=r.body,s="",a=0;a<i.length;a++){var o=Bt(i[a],"textord");s+=o.text}var l=parseInt(s),c;if(isNaN(l))throw new Ce("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new Ce("\\@char with invalid code point "+s);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:c}}});var LN=(e,t)=>{var n=jr(e.body,t.withColor(e.color),!1);return Ho(n)},BN=(e,t)=>{var n=bs(e.body,t.withColor(e.color)),r=new Me("mstyle",n);return r.setAttribute("mathcolor",e.color),r};ze({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Bt(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:xr(i)}},htmlBuilder:LN,mathmlBuilder:BN});ze({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Bt(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:LN,mathmlBuilder:BN});ze({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&Bt(i,"size").value}},htmlBuilder(e,t){var n=we(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Ie(Qn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Me("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Ie(Qn(e.size,t)))),n}});var Gx={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},zN=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ce("Expected a control sequence",e);return t},oX=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},PN=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};ze({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Gx[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Gx[r.text]),Bt(t.parseFunction(),"internal");throw new Ce("Invalid token after macro prefix",r)}});ze({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Ce("Expected a control sequence",r);for(var s=0,a,o=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){a=t.gullet.future(),o[s].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ce('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==s+1)throw new Ce('Argument number "'+r.text+'" out of order');s++,o.push([])}else{if(r.text==="EOF")throw new Ce("Expected a macro definition");o[s].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return a&&l.unshift(a),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},n===Gx[n]),{type:"internal",mode:t.mode}}});ze({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=zN(t.gullet.popToken());t.gullet.consumeSpaces();var i=oX(t);return PN(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});ze({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=zN(t.gullet.popToken()),i=t.gullet.popToken(),s=t.gullet.popToken();return PN(t,r,s,n==="\\\\globalfuture"),t.gullet.pushToken(s),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var Zh=function(t,n,r){var i=Wn.math[t]&&Wn.math[t].replace,s=J3(i||t,n,r);if(!s)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return s},ik=function(t,n,r,i){var s=r.havingBaseStyle(n),a=we(i.concat(s.sizingClasses(r)),[t],r),o=s.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=s.sizeMultiplier,a},$N=function(t,n,r){var i=n.havingBaseStyle(r),s=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Ie(s),t.height-=s,t.depth+=s},lX=function(t,n,r,i,s,a){var o=xi(t,"Main-Regular",s,i),l=ik(o,n,i,a);return $N(l,i,n),l},cX=function(t,n,r,i){return xi(t,"Size"+n+"-Regular",r,i)},UN=function(t,n,r,i,s,a){var o=cX(t,n,s,i),l=ik(we(["delimsizing","size"+n],[o],i),At.TEXT,i,a);return r&&$N(l,i,At.TEXT),l},lv=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=we(["delimsizinginner",i],[we([],[xi(t,n,r)])]);return{type:"elem",elem:s}},cv=function(t,n,r){var i=Oa["Size4-Regular"][t.charCodeAt(0)]?Oa["Size4-Regular"][t.charCodeAt(0)][4]:Oa["Size1-Regular"][t.charCodeAt(0)][4],s=new ql("inner",vY(t,Math.round(1e3*n))),a=new Lo([s],{width:Ie(i),height:Ie(n),style:"width:"+Ie(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),o=Fl([],[a],r);return o.height=n,o.style.height=Ie(n),o.style.width=Ie(i),{type:"elem",elem:o}},Wx=.008,Dm={type:"kern",size:-1*Wx},uX=new Set(["|","\\lvert","\\rvert","\\vert"]),dX=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),HN=function(t,n,r,i,s,a){var o,l,c,u,d="",f=0;o=c=u=t,l=null;var m="Size1-Regular";t==="\\uparrow"?c=u="⏐":t==="\\Uparrow"?c=u="‖":t==="\\downarrow"?o=c="⏐":t==="\\Downarrow"?o=c="‖":t==="\\updownarrow"?(o="\\uparrow",c="⏐",u="\\downarrow"):t==="\\Updownarrow"?(o="\\Uparrow",c="‖",u="\\Downarrow"):uX.has(t)?(c="∣",d="vert",f=333):dX.has(t)?(c="∥",d="doublevert",f=556):t==="["||t==="\\lbrack"?(o="⎡",c="⎢",u="⎣",m="Size4-Regular",d="lbrack",f=667):t==="]"||t==="\\rbrack"?(o="⎤",c="⎥",u="⎦",m="Size4-Regular",d="rbrack",f=667):t==="\\lfloor"||t==="⌊"?(c=o="⎢",u="⎣",m="Size4-Regular",d="lfloor",f=667):t==="\\lceil"||t==="⌈"?(o="⎡",c=u="⎢",m="Size4-Regular",d="lceil",f=667):t==="\\rfloor"||t==="⌋"?(c=o="⎥",u="⎦",m="Size4-Regular",d="rfloor",f=667):t==="\\rceil"||t==="⌉"?(o="⎤",c=u="⎥",m="Size4-Regular",d="rceil",f=667):t==="("||t==="\\lparen"?(o="⎛",c="⎜",u="⎝",m="Size4-Regular",d="lparen",f=875):t===")"||t==="\\rparen"?(o="⎞",c="⎟",u="⎠",m="Size4-Regular",d="rparen",f=875):t==="\\{"||t==="\\lbrace"?(o="⎧",l="⎨",u="⎩",c="⎪",m="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(o="⎫",l="⎬",u="⎭",c="⎪",m="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(o="⎧",u="⎩",c="⎪",m="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(o="⎫",u="⎭",c="⎪",m="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(o="⎧",u="⎭",c="⎪",m="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(o="⎫",u="⎩",c="⎪",m="Size4-Regular");var p=Zh(o,m,s),b=p.height+p.depth,x=Zh(c,m,s),g=x.height+x.depth,y=Zh(u,m,s),w=y.height+y.depth,C=0,E=1;if(l!==null){var S=Zh(l,m,s);C=S.height+S.depth,E=2}var T=b+w+C,j=Math.max(0,Math.ceil((n-T)/(E*g))),z=T+j*E*g,R=i.fontMetrics().axisHeight;r&&(R*=i.sizeMultiplier);var D=z/2-R,N=[];if(d.length>0){var B=z-b-w,P=Math.round(z*1e3),J=xY(d,Math.round(B*1e3)),q=new ql(d,J),W=Ie(f/1e3),$=Ie(P/1e3),Z=new Lo([q],{width:W,height:$,viewBox:"0 0 "+f+" "+P}),M=Fl([],[Z],i);M.height=P/1e3,M.style.width=W,M.style.height=$,N.push({type:"elem",elem:M})}else{if(N.push(lv(u,m,s)),N.push(Dm),l===null){var X=z-b-w+2*Wx;N.push(cv(c,X,i))}else{var H=(z-b-w-C)/2+2*Wx;N.push(cv(c,H,i)),N.push(Dm),N.push(lv(l,m,s)),N.push(Dm),N.push(cv(c,H,i))}N.push(Dm),N.push(lv(o,m,s))}var O=i.havingBaseStyle(At.TEXT),se=un({positionType:"bottom",positionData:D,children:N});return ik(we(["delimsizing","mult"],[se],O),At.TEXT,i,a)},uv=80,dv=.08,hv=function(t,n,r,i,s){var a=bY(t,i,r),o=new ql(t,a),l=new Lo([o],{width:"400em",height:Ie(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Fl(["hide-tail"],[l],s)},hX=function(t,n){var r=n.havingBaseSizing(),i=WN("\\surd",t*r.sizeMultiplier,GN,r),s=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),o,l,c,u,d;return i.type==="small"?(u=1e3+1e3*a+uv,t<1?s=1:t<1.4&&(s=.7),l=(1+a+dv)/s,c=(1+a)/s,o=hv("sqrtMain",l,u,a,n),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(u=(1e3+uv)*Ef[i.size],c=(Ef[i.size]+a)/s,l=(Ef[i.size]+a+dv)/s,o=hv("sqrtSize"+i.size,l,u,a,n),o.style.minWidth="1.02em",d=1/s):(l=t+a+dv,c=t+a,u=Math.floor(1e3*t+a)+uv,o=hv("sqrtTall",l,u,a,n),o.style.minWidth="0.742em",d=1.056),o.height=c,o.style.height=Ie(l),{span:o,advanceWidth:d,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*s}},qN=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),fX=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),FN=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Ef=[0,1.2,1.8,2.4,3],VN=function(t,n,r,i,s){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),qN.has(t)||FN.has(t))return UN(t,n,!1,r,i,s);if(fX.has(t))return HN(t,Ef[n],!1,r,i,s);throw new Ce("Illegal delimiter: '"+t+"'")},mX=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],pX=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"stack"}],GN=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],gX=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},WN=function(t,n,r,i){for(var s=Math.min(2,3-i.style.size),a=s;a<r.length;a++){var o=r[a];if(o.type==="stack")break;var l=Zh(t,gX(o),"math"),c=l.height+l.depth;if(o.type==="small"){var u=i.havingBaseStyle(o.style);c*=u.sizeMultiplier}if(c>n)return o}return r[r.length-1]},Kx=function(t,n,r,i,s,a){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var o;FN.has(t)?o=mX:qN.has(t)?o=GN:o=pX;var l=WN(t,n,o,i);return l.type==="small"?lX(t,l.style,r,i,s,a):l.type==="large"?UN(t,l.size,r,i,s,a):HN(t,n,r,i,s,a)},fv=function(t,n,r,i,s,a){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,u=Math.max(n-o,r+o),d=Math.max(u/500*l,2*u-c);return Kx(t,d,!0,i,s,a)},t7={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},yX=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function n7(e){return"isMiddle"in e}function Z1(e,t){var n=Q1(e);if(n&&yX.has(n.text))return n;throw n?new Ce("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Ce("Invalid delimiter type '"+e.type+"'",e)}ze({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Z1(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:t7[e.funcName].size,mclass:t7[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?we([e.mclass]):VN(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Vs(e.delim,e.mode));var n=new Me("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Ie(Ef[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function r7(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ze({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Ce("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Z1(t[0],e).text,color:n}}});ze({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Z1(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=Bt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{r7(e);for(var n=jr(e.body,t,!0,["mopen","mclose"]),r=0,i=0,s=!1,a=0;a<n.length;a++){var o=n[a];n7(o)?s=!0:(r=Math.max(n[a].height,r),i=Math.max(n[a].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var l;if(e.left==="."?l=t0(t,["mopen"]):l=fv(e.left,r,i,t,e.mode,["mopen"]),n.unshift(l),s)for(var c=1;c<n.length;c++){var u=n[c];if(n7(u)){var d=u.isMiddle;n[c]=fv(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===".")f=t0(t,["mclose"]);else{var m=e.rightColor?t.withColor(e.rightColor):t;f=fv(e.right,r,i,m,e.mode,["mclose"])}return n.push(f),we(["minner"],n,t)},mathmlBuilder:(e,t)=>{r7(e);var n=bs(e.body,t);if(e.left!=="."){var r=new Me("mo",[Vs(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new Me("mo",[Vs(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return tk(n)}});ze({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Z1(t[0],e);if(!e.parser.leftrightDepth)throw new Ce("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=t0(t,[]):(n=VN(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Vs("|","text"):Vs(e.delim,e.mode),r=new Me("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var ey=(e,t)=>{var n=zd(hn(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,s,a,o=$o(e.body);if(r==="sout")s=we(["stretchy","sout"]),s.height=t.fontMetrics().defaultRuleThickness/i,a=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=Qn({number:.6,unit:"pt"},t),c=Qn({number:.35,unit:"ex"},t),u=t.havingBaseSizing();i=i/u.sizeMultiplier;var d=n.height+n.depth+l+c;n.style.paddingLeft=Ie(d/2+l);var f=Math.floor(1e3*d*i),m=gY(f),p=new Lo([new ql("phase",m)],{width:"400em",height:Ie(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=Fl(["hide-tail"],[p],t),s.style.height=Ie(d),a=n.depth+l+c}else{/cancel/.test(r)?o||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var b,x,g=0;/box/.test(r)?(g=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),b=t.fontMetrics().fboxsep+(r==="colorbox"?0:g),x=b):r==="angl"?(g=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),b=4*g,x=Math.max(0,.25-n.depth)):(b=o?.2:0,x=b),s=JY(n,r,b,x,t),/fbox|boxed|fcolorbox/.test(r)?(s.style.borderStyle="solid",s.style.borderWidth=Ie(g)):r==="angl"&&g!==.049&&(s.style.borderTopWidth=Ie(g),s.style.borderRightWidth=Ie(g)),a=n.depth+x,e.backgroundColor&&(s.style.backgroundColor=e.backgroundColor,e.borderColor&&(s.style.borderColor=e.borderColor))}var y;if(e.backgroundColor)y=un({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:n,shift:0}]});else{var w=/cancel|phase/.test(r)?["svg-align"]:[];y=un({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:w}]})}return/cancel/.test(r)&&(y.height=n.height,y.depth=n.depth),/cancel/.test(r)&&!o?we(["mord","cancel-lap"],[y],t):we(["mord"],[y],t)},ty=(e,t)=>{var n,r=new Me(e.label.includes("colorbox")?"mpadded":"menclose",[In(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+Ie(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ze({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=Bt(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:ey,mathmlBuilder:ty});ze({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=Bt(t[0],"color-token").color,a=Bt(t[1],"color-token").color,o=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,borderColor:s,body:o}},htmlBuilder:ey,mathmlBuilder:ty});ze({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});ze({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:ey,mathmlBuilder:ty});ze({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:ey,mathmlBuilder:ty});ze({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var KN={};function Ga(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:a}=e,o={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)KN[n[l]]=o;s&&(jg[t]=s),a&&(Lg[t]=a)}var YN={};function I(e,t){YN[e]=t}class Bi{constructor(t,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=r}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new Bi(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class hs{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new hs(n,Bi.range(this,t))}}function i7(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var ny=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Ce("{"+e.envName+"} can be used only in display mode.")},bX=new Set(["gather","gather*"]);function sk(e){if(!e.includes("ed"))return!e.includes("*")}function rc(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ce("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var p=[],b=[p],x=[],g=[],y=l!=null?[]:void 0;function w(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new hs("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(w(),g.push(i7(e));;){var E=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var S={type:"ordgroup",mode:e.mode,body:E};n&&(S={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[S]}),p.push(S);var T=e.fetch().text;if(T==="&"){if(d&&p.length===d){if(c||o)throw new Ce("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),p.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(b.length>1||!u)&&b.pop(),g.length<b.length+1&&g.push([]);break}else if(T==="\\\\"){e.consume();var j=void 0;e.gullet.future().text!==" "&&(j=e.parseSizeGroup(!0)),x.push(j?j.value:null),C(),g.push(i7(e)),p=[],b.push(p),w()}else throw new Ce("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:i,arraystretch:a,body:b,cols:s,rowGaps:x,hskipBeforeAndAfter:r,hLinesBeforeRow:g,colSeparationType:o,tags:y,leqno:f}}function ak(e){return e.slice(0,1)==="d"?"display":"text"}var Wa=function(t,n){var r,i,s=t.body.length,a=t.hLinesBeforeRow,o=0,l=new Array(s),c=[],u=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),d=1/n.fontMetrics().ptPerEm,f=5*d;if(t.colSeparationType&&t.colSeparationType==="small"){var m=n.havingStyle(At.SCRIPT).sizeMultiplier;f=.2778*(m/n.sizeMultiplier)}var p=t.colSeparationType==="CD"?Qn({number:3,unit:"ex"},n):12*d,b=3*d,x=t.arraystretch*p,g=.7*x,y=.3*x,w=0;function C(Te){for(var Pe=0;Pe<Te.length;++Pe)Pe>0&&(w+=.25),c.push({pos:w,isDashed:Te[Pe]})}for(C(a[0]),r=0;r<t.body.length;++r){var E=t.body[r],S=g,T=y;o<E.length&&(o=E.length);var j={cells:new Array(E.length),height:0,depth:0,pos:0};for(i=0;i<E.length;++i){var z=hn(E[i],n);T<z.depth&&(T=z.depth),S<z.height&&(S=z.height),j.cells[i]=z}var R=t.rowGaps[r],D=0;R&&(D=Qn(R,n),D>0&&(D+=y,T<D&&(T=D),D=0)),t.addJot&&r<t.body.length-1&&(T+=b),j.height=S,j.depth=T,w+=S,j.pos=w,w+=T+D,l[r]=j,C(a[r+1])}var N=w/2+n.fontMetrics().axisHeight,B=t.cols||[],P=[],J,q,W=[];if(t.tags&&t.tags.some(Te=>Te))for(r=0;r<s;++r){var $=l[r],Z=$.pos-N,M=t.tags[r],X=void 0;M===!0?X=we(["eqn-num"],[],n):M===!1?X=we([],[],n):X=we([],jr(M,n,!0),n),X.depth=$.depth,X.height=$.height,W.push({type:"elem",elem:X,shift:Z})}for(i=0,q=0;i<o||q<B.length;++i,++q){for(var H,O=B[q],se=!0;((ke=O)==null?void 0:ke.type)==="separator";){var ke;if(se||(J=we(["arraycolsep"],[]),J.style.width=Ie(n.fontMetrics().doubleRuleSep),P.push(J)),O.separator==="|"||O.separator===":"){var be=O.separator==="|"?"solid":"dashed",Ee=we(["vertical-separator"],[],n);Ee.style.height=Ie(w),Ee.style.borderRightWidth=Ie(u),Ee.style.borderRightStyle=be,Ee.style.margin="0 "+Ie(-u/2);var qe=w-N;qe&&(Ee.style.verticalAlign=Ie(-qe)),P.push(Ee)}else throw new Ce("Invalid separator type: "+O.separator);q++,O=B[q],se=!1}if(!(i>=o)){var wt=void 0;if(i>0||t.hskipBeforeAndAfter){var Mt,bt;wt=(Mt=(bt=O)==null?void 0:bt.pregap)!=null?Mt:f,wt!==0&&(J=we(["arraycolsep"],[]),J.style.width=Ie(wt),P.push(J))}var Je=[];for(r=0;r<s;++r){var Ge=l[r],Pt=Ge.cells[i];if(Pt){var Ze=Ge.pos-N;Pt.depth=Ge.depth,Pt.height=Ge.height,Je.push({type:"elem",elem:Pt,shift:Ze})}}var re=un({positionType:"individualShift",children:Je}),le=we(["col-align-"+(((H=O)==null?void 0:H.align)||"c")],[re]);if(P.push(le),i<o-1||t.hskipBeforeAndAfter){var De,We;wt=(De=(We=O)==null?void 0:We.postgap)!=null?De:f,wt!==0&&(J=we(["arraycolsep"],[]),J.style.width=Ie(wt),P.push(J))}}}var pe=we(["mtable"],P);if(c.length>0){for(var st=Bd("hline",n,u),ae=Bd("hdashline",n,u),je=[{type:"elem",elem:pe,shift:0}];c.length>0;){var Oe=c.pop(),$e=Oe.pos-N;Oe.isDashed?je.push({type:"elem",elem:ae,shift:$e}):je.push({type:"elem",elem:st,shift:$e})}pe=un({positionType:"individualShift",children:je})}if(W.length===0)return we(["mord"],[pe],n);var te=un({positionType:"individualShift",children:W}),ye=we(["tag"],[te],n);return Ho([pe,ye])},vX={c:"center ",l:"left ",r:"right "},Ka=function(t,n){for(var r=[],i=new Me("mtd",[],["mtr-glue"]),s=new Me("mtd",[],["mml-eqn-num"]),a=0;a<t.body.length;a++){for(var o=t.body[a],l=[],c=0;c<o.length;c++)l.push(new Me("mtd",[In(o[c],n)]));t.tags&&t.tags[a]&&(l.unshift(i),l.push(i),t.leqno?l.unshift(s):l.push(s)),r.push(new Me("mtr",l))}var u=new Me("mtable",r),d=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);u.setAttribute("rowspacing",Ie(d));var f="",m="";if(t.cols&&t.cols.length>0){var p=t.cols,b="",x=!1,g=0,y=p.length;p[0].type==="separator"&&(f+="top ",g=1),p[p.length-1].type==="separator"&&(f+="bottom ",y-=1);for(var w=g;w<y;w++){var C=p[w];C.type==="align"?(m+=vX[C.align],x&&(b+="none "),x=!0):C.type==="separator"&&x&&(b+=C.separator==="|"?"solid ":"dashed ",x=!1)}u.setAttribute("columnalign",m.trim()),/[sd]/.test(b)&&u.setAttribute("columnlines",b.trim())}if(t.colSeparationType==="align"){for(var E=t.cols||[],S="",T=1;T<E.length;T++)S+=T%2?"0em ":"1em ";u.setAttribute("columnspacing",S.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?u.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?u.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?u.setAttribute("columnspacing","0.5em"):u.setAttribute("columnspacing","1em");var j="",z=t.hLinesBeforeRow;f+=z[0].length>0?"left ":"",f+=z[z.length-1].length>0?"right ":"";for(var R=1;R<z.length-1;R++)j+=z[R].length===0?"none ":z[R][0]?"dashed ":"solid ";return/[sd]/.test(j)&&u.setAttribute("rowlines",j.trim()),f!==""&&(u=new Me("menclose",[u]),u.setAttribute("notation",f.trim())),t.arraystretch&&t.arraystretch<1&&(u=new Me("mstyle",[u]),u.setAttribute("scriptlevel","1")),u},XN=function(t,n){t.envName.includes("ed")||ny(t);var r=[],i=t.envName.includes("at")?"alignat":"align",s=t.envName==="split",a=rc(t.parser,{cols:r,addJot:!0,autoTag:s?void 0:sk(t.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:t.parser.settings.leqno},"display"),o=0,l=0,c={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var u="",d=0;d<n[0].body.length;d++){var f=Bt(n[0].body[d],"textord");u+=f.text}o=Number(u),l=o*2}var m=!l;a.body.forEach(function(g){for(var y=1;y<g.length;y+=2){var w=Bt(g[y],"styling"),C=Bt(w.body[0],"ordgroup");C.body.unshift(c)}if(m)l<g.length&&(l=g.length);else{var E=g.length/2;if(o<E)throw new Ce("Too many math in a row: "+("expected "+o+", but got "+E),g[0])}});for(var p=0;p<l;++p){var b="r",x=0;p%2===1?b="l":p>0&&m&&(x=1),r[p]={type:"align",align:b,pregap:x,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Ga({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Q1(t[0]),r=n?[t[0]]:Bt(t[0],"ordgroup").body,i=r.map(function(a){var o=X1(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ce("Unknown column alignment: "+l,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return rc(e.parser,s,ak(e.envName))},htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new Ce("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=rc(e.parser,r,ak(e.envName)),a=Math.max(0,...s.body.map(o=>o.length));return s.cols=new Array(a).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=rc(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Q1(t[0]),r=n?[t[0]]:Bt(t[0],"ordgroup").body,i=r.map(function(o){var l=X1(o),c=l.text;if("lc".includes(c))return{type:"align",align:c};throw new Ce("Unknown column alignment: "+c,o)});if(i.length>1)throw new Ce("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},a=rc(e.parser,s,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ce("{subarray} can contain only one column");return a},htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=rc(e.parser,t,ak(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:XN,htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){bX.has(e.envName)&&ny(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:sk(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return rc(e.parser,t,"display")},htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:XN,htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){ny(e);var t={autoTag:sk(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return rc(e.parser,t,"display")},htmlBuilder:Wa,mathmlBuilder:Ka});Ga({type:"array",names:["CD"],props:{numArgs:0},handler(e){return ny(e),aX(e.parser)},htmlBuilder:Wa,mathmlBuilder:Ka});I("\\nonumber","\\gdef\\@eqnsw{0}");I("\\notag","\\nonumber");ze({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Ce(e.funcName+" valid only within array environment")}});var s7=KN;ze({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new Ce("Invalid environment name",i);for(var s="",a=0;a<i.body.length;++a)s+=Bt(i.body[a],"textord").text;if(r==="\\begin"){if(!s7.hasOwnProperty(s))throw new Ce("No such environment: "+s,i);var o=s7[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",o),u={mode:n.mode,envName:s,parser:n},d=o.handler(u,l,c);n.expect("\\end",!1);var f=n.nextToken,m=Bt(n.parseFunction(),"environment");if(m.name!==s)throw new Ce("Mismatch: \\begin{"+s+"} matched by \\end{"+m.name+"}",f);return d}return{type:"environment",mode:n.mode,name:s,nameGroup:i}}});var QN=(e,t)=>{var n=e.font,r=t.withFont(n);return hn(e.body,r)},JN=(e,t)=>{var n=e.font,r=t.withFont(n);return In(e.body,r)},a7={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ze({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Bg(t[0]),s=r;return s in a7&&(s=a7[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:QN,mathmlBuilder:JN});ze({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:J1(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:$o(r)}}});ze({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:s}=n,a=n.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:QN,mathmlBuilder:JN});var xX=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),s;s=t.havingStyle(r);var a=hn(e.numer,s,t);if(e.continued){var o=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<o?o:a.height,a.depth=a.depth<l?l:a.depth}s=t.havingStyle(i);var c=hn(e.denom,s,t),u,d,f;e.hasBarLine?(e.barSize?(d=Qn(e.barSize,t),u=Bd("frac-line",t,d)):u=Bd("frac-line",t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var m,p,b;n.size===At.DISPLAY.size?(m=t.fontMetrics().num1,d>0?p=3*f:p=7*f,b=t.fontMetrics().denom1):(d>0?(m=t.fontMetrics().num2,p=f):(m=t.fontMetrics().num3,p=3*f),b=t.fontMetrics().denom2);var x;if(u){var y=t.fontMetrics().axisHeight;m-a.depth-(y+.5*d)<p&&(m+=p-(m-a.depth-(y+.5*d))),y-.5*d-(c.height-b)<p&&(b+=p-(y-.5*d-(c.height-b)));var w=-(y-.5*d);x=un({positionType:"individualShift",children:[{type:"elem",elem:c,shift:b},{type:"elem",elem:u,shift:w},{type:"elem",elem:a,shift:-m}]})}else{var g=m-a.depth-(c.height-b);g<p&&(m+=.5*(p-g),b+=.5*(p-g)),x=un({positionType:"individualShift",children:[{type:"elem",elem:c,shift:b},{type:"elem",elem:a,shift:-m}]})}s=t.havingStyle(n),x.height*=s.sizeMultiplier/t.sizeMultiplier,x.depth*=s.sizeMultiplier/t.sizeMultiplier;var C;n.size===At.DISPLAY.size?C=t.fontMetrics().delim1:n.size===At.SCRIPTSCRIPT.size?C=t.havingStyle(At.SCRIPT).fontMetrics().delim2:C=t.fontMetrics().delim2;var E,S;return e.leftDelim==null?E=t0(t,["mopen"]):E=Kx(e.leftDelim,C,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?S=we([]):e.rightDelim==null?S=t0(t,["mclose"]):S=Kx(e.rightDelim,C,!0,t.havingStyle(n),e.mode,["mclose"]),we(["mord"].concat(s.sizingClasses(t)),[E,we(["mfrac"],[x]),S],t)},wX=(e,t)=>{var n=new Me("mfrac",[In(e.numer,t),In(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=Qn(e.barSize,t);n.setAttribute("linethickness",Ie(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var s=new Me("mo",[new wr(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(n),e.rightDelim!=null){var a=new Me("mo",[new wr(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}return tk(i)}return n},ZN=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};ze({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=t[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c=r==="\\cfrac",u=null;return c||r.startsWith("\\d")?u="display":r.startsWith("\\t")&&(u="text"),ZN({type:"genfrac",mode:n.mode,numer:i,denom:s,continued:c,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},u)},htmlBuilder:xX,mathmlBuilder:wX});ze({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var o7=["display","text","script","scriptscript"],l7=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};ze({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],s=Bg(t[0]),a=s.type==="atom"&&s.family==="open"?l7(s.text):null,o=Bg(t[1]),l=o.type==="atom"&&o.family==="close"?l7(o.text):null,c=Bt(t[2],"size"),u,d=null;c.isBlank?u=!0:(d=c.value,u=d.number>0);var f=null,m=t[3];if(m.type==="ordgroup"){if(m.body.length>0){var p=Bt(m.body[0],"textord");f=o7[Number(p.text)]}}else m=Bt(m,"textord"),f=o7[Number(m.text)];return ZN({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:a,rightDelim:l},f)}});ze({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Bt(t[0],"size").value,token:i}}});ze({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=Bt(t[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));var a=t[2],o=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:a,continued:!1,hasBarLine:o,barSize:s,leftDelim:null,rightDelim:null}}});var eI=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?hn(e.sup,t.havingStyle(n.sup()),t):hn(e.sub,t.havingStyle(n.sub()),t),i=Bt(e.base,"horizBrace")):i=Bt(e,"horizBrace");var s=hn(i.base,t.havingBaseStyle(At.DISPLAY)),a=Y1(i,t),o;if(i.isOver?o=un({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=un({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),r){var l=we(["minner",i.isOver?"mover":"munder"],[o],t);i.isOver?o=un({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=un({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return we(["minner",i.isOver?"mover":"munder"],[o],t)},kX=(e,t)=>{var n=K1(e.label);return new Me(e.isOver?"mover":"munder",[In(e.base,t),n])};ze({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:eI,mathmlBuilder:kX});ze({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Bt(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:xr(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=jr(e.body,t,!1);return jY(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Vl(e.body,t);return n instanceof Me||(n=new Me("mrow",[n])),n.setAttribute("href",e.href),n}});ze({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Bt(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<r.length;s++){var a=r[s];a==="~"&&(a="\\textasciitilde"),i.push({type:"textord",mode:"text",text:a})}var o={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:xr(o)}}});ze({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:xr(t[0])}},htmlBuilder(e,t){var n=jr(e.body,t.withFont(""),!1);return Ho(n)},mathmlBuilder(e,t){return new Me("mrow",bs(e.body,t.withFont("")))}});ze({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,s=Bt(t[0],"raw").string,a=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=s,o={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,o={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,o={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var c=s.split(","),u=0;u<c.length;u++){var d=c[u],f=d.indexOf("=");if(f<0)throw new Ce("\\htmlData key/value '"+d+"' missing equals sign");var m=d.slice(0,f),p=d.slice(f+1);l["data-"+m.trim()]=p}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(o)?{type:"html",mode:n.mode,attributes:l,body:xr(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=jr(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=we(r,n,t);for(var s in e.attributes)s!=="class"&&e.attributes.hasOwnProperty(s)&&i.setAttribute(s,e.attributes[s]);return i},mathmlBuilder:(e,t)=>Vl(e.body,t)});ze({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:xr(t[0]),mathml:xr(t[1])}},htmlBuilder:(e,t)=>{var n=jr(e.html,t,!1);return Ho(n)},mathmlBuilder:(e,t)=>Vl(e.mathml,t)});var mv=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Ce("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!gN(r))throw new Ce("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ze({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},s={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(n[0])for(var l=Bt(n[0],"raw").string,c=l.split(","),u=0;u<c.length;u++){var d=c[u].split("=");if(d.length===2){var f=d[1].trim();switch(d[0].trim()){case"alt":o=f;break;case"width":i=mv(f);break;case"height":s=mv(f);break;case"totalheight":a=mv(f);break;default:throw new Ce("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var m=Bt(t[0],"url").url;return o===""&&(o=m,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:m})?{type:"includegraphics",mode:r.mode,alt:o,width:i,height:s,totalheight:a,src:m}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Qn(e.height,t),r=0;e.totalheight.number>0&&(r=Qn(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Qn(e.width,t));var s={height:Ie(n+r)};i>0&&(s.width=Ie(i)),r>0&&(s.verticalAlign=Ie(-r));var a=new SY(e.src,e.alt,s);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new Me("mglyph",[]);n.setAttribute("alt",e.alt);var r=Qn(e.height,t),i=0;if(e.totalheight.number>0&&(i=Qn(e.totalheight,t)-r,n.setAttribute("valign",Ie(-i))),n.setAttribute("height",Ie(r+i)),e.width.number>0){var s=Qn(e.width,t);n.setAttribute("width",Ie(s))}return n.setAttribute("src",e.src),n}});ze({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Bt(t[0],"size");if(n.settings.strict){var s=r[1]==="m",a=i.value.unit==="mu";s?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return _N(e.dimension,t)},mathmlBuilder(e,t){var n=Qn(e.dimension,t);return new MN(n)}});ze({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=we([],[hn(e.body,t)]),n=we(["inner"],[n],t)):n=we(["inner"],[hn(e.body,t)]);var r=we(["fix"],[]),i=we([e.alignment],[n,r],t),s=we(["strut"]);return s.style.height=Ie(i.height+i.depth),i.depth&&(s.style.verticalAlign=Ie(-i.depth)),i.children.unshift(s),i=we(["thinbox"],[i],t),we(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Me("mpadded",[In(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});ze({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var s=n==="\\("?"\\)":"$",a=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ze({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Ce("Mismatched "+e.funcName)}});var c7=(e,t)=>{switch(t.style.size){case At.DISPLAY.size:return e.display;case At.TEXT.size:return e.text;case At.SCRIPT.size:return e.script;case At.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ze({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:xr(t[0]),text:xr(t[1]),script:xr(t[2]),scriptscript:xr(t[3])}},htmlBuilder:(e,t)=>{var n=c7(e,t),r=jr(n,t,!1);return Ho(r)},mathmlBuilder:(e,t)=>{var n=c7(e,t);return Vl(n,t)}});var tI=(e,t,n,r,i,s,a)=>{e=we([],[e]);var o=n&&$o(n),l,c;if(t){var u=hn(t,r.havingStyle(i.sup()),r);c={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=hn(n,r.havingStyle(i.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(c&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;f=un({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Ie(-s)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:Ie(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var p=e.height-a;f=un({positionType:"top",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Ie(-s)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(c){var b=e.depth+a;f=un({positionType:"bottom",positionData:b,children:[{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:Ie(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var x=[f];if(l&&s!==0&&!o){var g=we(["mspace"],[],r);g.style.marginRight=Ie(s),x.unshift(g)}return we(["mop","op-limits"],x,r)},nI=new Set(["\\smallint"]),dh=(e,t)=>{var n,r,i=!1,s;e.type==="supsub"?(n=e.sup,r=e.sub,s=Bt(e.base,"op"),i=!0):s=Bt(e,"op");var a=t.style,o=!1;a.size===At.DISPLAY.size&&s.symbol&&!nI.has(s.name)&&(o=!0);var l,c;if(s.symbol){var u=o?"Size2-Regular":"Size1-Regular",d="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(d=s.name.slice(1),s.name=d==="oiint"?"\\iint":"\\iiint"),l=xi(s.name,u,"math",t,["mop","op-symbol",o?"large-op":"small-op"]),c=l.italic,d.length>0){var f=TN(d+"Size"+(o?"2":"1"),t);l=un({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),s.name="\\"+d,l.classes.unshift("mop"),l.italic=c}}else if(s.body){var m=jr(s.body,t,!0);m.length===1&&m[0]instanceof ps?(l=m[0],l.classes[0]="mop"):l=we(["mop"],m,t)}else{for(var p=[],b=1;b<s.name.length;b++)p.push(Z3(s.name[b],s.mode,t));l=we(["mop"],p,t)}var x=0,g=0;if((l instanceof ps||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift){var y;x=(l.height-l.depth)/2-t.fontMetrics().axisHeight,g=(y=l.italic)!=null?y:0}return i?tI(l,n,r,t,a,g,x):(x&&(l.style.position="relative",l.style.top=Ie(x)),l)},$0=(e,t)=>{var n;if(e.symbol)n=new Me("mo",[Vs(e.name,e.mode)]),nI.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Me("mo",bs(e.body,t));else{n=new Me("mi",[new wr(e.name.slice(1))]);var r=new Me("mo",[Vs("⁡","text")]);e.parentIsSupSub?n=new Me("mrow",[n,r]):n=AN([n,r])}return n},_X={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ze({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=_X[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:dh,mathmlBuilder:$0});ze({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:xr(r)}},htmlBuilder:dh,mathmlBuilder:$0});var SX={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ze({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:dh,mathmlBuilder:$0});ze({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:dh,mathmlBuilder:$0});ze({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=SX[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:dh,mathmlBuilder:$0});var rI=(e,t)=>{var n,r,i=!1,s;e.type==="supsub"?(n=e.sup,r=e.sub,s=Bt(e.base,"operatorname"),i=!0):s=Bt(e,"operatorname");var a;if(s.body.length>0){for(var o=s.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=jr(o,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof ps&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=we(["mop"],l,t)}else a=we(["mop"],[],t);return i?tI(a,n,r,t,t.style,0,0):a},TX=(e,t)=>{for(var n=bs(e.body,t.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var s=n[i];if(!(s instanceof MN))if(s instanceof Me)switch(s.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var a=s.children[0];s.children.length===1&&a instanceof wr?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var o=n.map(u=>u.toText()).join("");n=[new wr(o)]}var l=new Me("mi",n);l.setAttribute("mathvariant","normal");var c=new Me("mo",[Vs("⁡","text")]);return e.parentIsSupSub?new Me("mrow",[l,c]):AN([l,c])};ze({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:xr(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rI,mathmlBuilder:TX});I("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");mu({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Ho(jr(e.body,t,!1)):we(["mord"],jr(e.body,t,!0),t)},mathmlBuilder(e,t){return Vl(e.body,t,!0)}});ze({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=hn(e.body,t.havingCrampedStyle()),r=Bd("overline-line",t),i=t.fontMetrics().defaultRuleThickness,s=un({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return we(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new Me("mo",[new wr("‾")]);n.setAttribute("stretchy","true");var r=new Me("mover",[In(e.body,t),n]);return r.setAttribute("accent","true"),r}});ze({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:xr(r)}},htmlBuilder:(e,t)=>{var n=jr(e.body,t.withPhantom(),!1);return Ho(n)},mathmlBuilder:(e,t)=>{var n=bs(e.body,t);return new Me("mphantom",n)}});I("\\hphantom","\\smash{\\phantom{#1}}");ze({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=we(["inner"],[hn(e.body,t.withPhantom())]),r=we(["fix"],[]);return we(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=bs(xr(e.body),t),r=new Me("mphantom",n),i=new Me("mpadded",[r]);return i.setAttribute("width","0px"),i}});ze({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Bt(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=hn(e.body,t),r=Qn(e.dy,t);return un({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Me("mpadded",[In(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});ze({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});ze({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],s=Bt(t[0],"size"),a=Bt(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Bt(i,"size").value,width:s.value,height:a.value}},htmlBuilder(e,t){var n=we(["mord","rule"],[],t),r=Qn(e.width,t),i=Qn(e.height,t),s=e.shift?Qn(e.shift,t):0;return n.style.borderRightWidth=Ie(r),n.style.borderTopWidth=Ie(i),n.style.bottom=Ie(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Qn(e.width,t),r=Qn(e.height,t),i=e.shift?Qn(e.shift,t):0,s=t.color&&t.getColor()||"black",a=new Me("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Ie(n)),a.setAttribute("height",Ie(r));var o=new Me("mpadded",[a]);return i>=0?o.setAttribute("height",Ie(i)):(o.setAttribute("height",Ie(i)),o.setAttribute("depth",Ie(-i))),o.setAttribute("voffset",Ie(i)),o}});function iI(e,t,n){for(var r=jr(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var a=r[s].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[s].classes,t.sizingClasses(n)):r[s].classes[a+1]==="reset-size"+t.size&&(r[s].classes[a+1]="reset-size"+n.size),r[s].height*=i,r[s].depth*=i}return Ho(r)}var u7=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],CX=(e,t)=>{var n=t.havingSize(e.size);return iI(e.body,n,t)};ze({type:"sizing",names:u7,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:u7.indexOf(r)+1,body:s}},htmlBuilder:CX,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=bs(e.body,n),i=new Me("mstyle",r);return i.setAttribute("mathsize",Ie(n.sizeMultiplier)),i}});ze({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,s=!1,a=n[0]&&Bt(n[0],"ordgroup");if(a)for(var o,l=0;l<a.body.length;++l){var c=a.body[l];if(o=X1(c).text,o==="t")i=!0;else if(o==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var u=t[0];return{type:"smash",mode:r.mode,body:u,smashHeight:i,smashDepth:s}},htmlBuilder:(e,t)=>{var n=we([],[hn(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return we(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);var i=un({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return we(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Me("mpadded",[In(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});ze({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],s=t[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(e,t){var n=hn(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=zd(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,s=i;t.style.id<At.TEXT.id&&(s=t.fontMetrics().xHeight);var a=i+s/4,o=n.height+n.depth+a+i,{span:l,ruleWidth:c,advanceWidth:u}=hX(o,t),d=l.height-c;d>n.height+n.depth+a&&(a=(a+d-n.height-n.depth)/2);var f=l.height-n.height-a-c;n.style.paddingLeft=Ie(u);var m=un({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+f)},{type:"elem",elem:l},{type:"kern",size:c}]});if(e.index){var p=t.havingStyle(At.SCRIPTSCRIPT),b=hn(e.index,p,t),x=.6*(m.height-m.depth),g=un({positionType:"shift",positionData:-x,children:[{type:"elem",elem:b}]}),y=we(["root"],[g]);return we(["mord","sqrt"],[y,m],t)}else return we(["mord","sqrt"],[m],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Me("mroot",[In(n,t),In(r,t)]):new Me("msqrt",[In(n,t)])}});var Yx={display:At.DISPLAY,text:At.TEXT,script:At.SCRIPT,scriptscript:At.SCRIPTSCRIPT};function EX(e){return e in Yx}ze({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!0,n),a=r.slice(1,r.length-5);if(!EX(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(e,t){var n=Yx[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),iI(e.body,r,t)},mathmlBuilder(e,t){var n=Yx[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=bs(e.body,r),s=new Me("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});var AX=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===At.DISPLAY.size||r.alwaysHandleSupSub);return i?dh:null}else if(r.type==="operatorname"){var s=r.alwaysHandleSupSub&&(n.style.size===At.DISPLAY.size||r.limits);return s?rI:null}else{if(r.type==="accent")return $o(r.base)?rk:null;if(r.type==="horizBrace"){var a=!t.sub;return a===r.isOver?eI:null}else return null}else return null};mu({type:"supsub",htmlBuilder(e,t){var n=AX(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:s}=e,a=hn(r,t),o,l,c=t.fontMetrics(),u=0,d=0,f=r&&$o(r);if(i){var m=t.havingStyle(t.style.sup());o=hn(i,m,t),f||(u=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(s){var p=t.havingStyle(t.style.sub());l=hn(s,p,t),f||(d=a.depth+p.fontMetrics().subDrop*p.sizeMultiplier/t.sizeMultiplier)}var b;t.style===At.DISPLAY?b=c.sup1:t.style.cramped?b=c.sup3:b=c.sup2;var x=t.sizeMultiplier,g=Ie(.5/c.ptPerEm/x),y=null;if(l){var w=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof ps||w){var C;y=Ie(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){u=Math.max(u,b,o.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var S=c.defaultRuleThickness,T=4*S;if(u-o.depth-(l.height-d)<T){d=T-(u-o.depth)+l.height;var j=.8*c.xHeight-(u-o.depth);j>0&&(u+=j,d-=j)}var z=[{type:"elem",elem:l,shift:d,marginRight:g,marginLeft:y},{type:"elem",elem:o,shift:-u,marginRight:g}];E=un({positionType:"individualShift",children:z})}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var R=[{type:"elem",elem:l,marginLeft:y,marginRight:g}];E=un({positionType:"shift",positionData:d,children:R})}else if(o)u=Math.max(u,b,o.depth+.25*c.xHeight),E=un({positionType:"shift",positionData:-u,children:[{type:"elem",elem:o,marginRight:g}]});else throw new Error("supsub must have either sup or sub.");var D=Fx(a,"right")||"mord";return we([D],[a,we(["msupsub"],[E])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var s=[In(e.base,t)];e.sub&&s.push(In(e.sub,t)),e.sup&&s.push(In(e.sup,t));var a;if(n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var c=e.base;c&&c.type==="op"&&c.limits&&t.style===At.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(t.style===At.DISPLAY||c.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===At.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===At.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(t.style===At.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||t.style===At.DISPLAY)?a="mover":a="msup"}return new Me(a,s)}});mu({type:"atom",htmlBuilder(e,t){return Z3(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Me("mo",[Vs(e.text,e.mode)]);if(e.family==="bin"){var r=nk(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var sI={mi:"italic",mn:"normal",mtext:"normal"};mu({type:"mathord",htmlBuilder(e,t){return W1(e,t,"mathord")},mathmlBuilder(e,t){var n=new Me("mi",[Vs(e.text,e.mode,t)]),r=nk(e,t)||"italic";return r!==sI[n.type]&&n.setAttribute("mathvariant",r),n}});mu({type:"textord",htmlBuilder(e,t){return W1(e,t,"textord")},mathmlBuilder(e,t){var n=Vs(e.text,e.mode,t),r=nk(e,t)||"normal",i;return e.mode==="text"?i=new Me("mtext",[n]):/[0-9]/.test(e.text)?i=new Me("mn",[n]):e.text==="\\prime"?i=new Me("mo",[n]):i=new Me("mi",[n]),r!==sI[i.type]&&i.setAttribute("mathvariant",r),i}});var pv={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},gv={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};mu({type:"spacing",htmlBuilder(e,t){if(gv.hasOwnProperty(e.text)){var n=gv[e.text].className||"";if(e.mode==="text"){var r=W1(e,t,"textord");return r.classes.push(n),r}else return we(["mspace",n],[Z3(e.text,e.mode,t)],t)}else{if(pv.hasOwnProperty(e.text))return we(["mspace",pv[e.text]],[],t);throw new Ce('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(gv.hasOwnProperty(e.text))n=new Me("mtext",[new wr(" ")]);else{if(pv.hasOwnProperty(e.text))return new Me("mspace");throw new Ce('Unknown type of space "'+e.text+'"')}return n}});var d7=()=>{var e=new Me("mtd",[]);return e.setAttribute("width","50%"),e};mu({type:"tag",mathmlBuilder(e,t){var n=new Me("mtable",[new Me("mtr",[d7(),new Me("mtd",[Vl(e.body,t)]),d7(),new Me("mtd",[Vl(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var h7={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},f7={"\\textbf":"textbf","\\textmd":"textmd"},MX={"\\textit":"textit","\\textup":"textup"},m7=(e,t)=>{var n=e.font;if(n){if(h7[n])return t.withTextFontFamily(h7[n]);if(f7[n])return t.withTextFontWeight(f7[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(MX[n])};ze({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:xr(i),font:r}},htmlBuilder(e,t){var n=m7(e,t),r=jr(e.body,n,!0);return we(["mord","text"],r,n)},mathmlBuilder(e,t){var n=m7(e,t);return Vl(e.body,n)}});ze({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=hn(e.body,t),r=Bd("underline-line",t),i=t.fontMetrics().defaultRuleThickness,s=un({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return we(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new Me("mo",[new wr("‾")]);n.setAttribute("stretchy","true");var r=new Me("munder",[In(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});ze({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=hn(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return un({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Me("mpadded",[In(e.body,t)],["vcenter"]);return new Me("mrow",[n])}});ze({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Ce("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=p7(e),r=[],i=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var a=n[s];a==="~"&&(a="\\textasciitilde"),r.push(xi(a,"Typewriter-Regular",e.mode,i,["mord","texttt"]))}return we(["mord","text"].concat(i.sizingClasses(t)),kN(r),i)},mathmlBuilder(e,t){var n=new wr(p7(e)),r=new Me("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var p7=e=>e.body.replace(/ /g,e.star?"␣":" "),wl=CN,aI=`[ \r
	]`,NX="\\\\[a-zA-Z@]+",IX="\\\\[^\uD800-\uDFFF]",DX="("+NX+")"+aI+"*",RX=`\\\\(
|[ \r	]+
?)[ \r	]*`,Xx="[̀-ͯ]",OX=new RegExp(Xx+"+$"),jX="("+aI+"+)|"+(RX+"|")+"([!-\\[\\]-‧‪-퟿豈-]"+(Xx+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Xx+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+DX)+("|"+IX+")");class g7{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(jX,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new hs("EOF",new Bi(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new Ce("Unexpected character: '"+t[n]+"'",new hs(t[n],new Bi(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=t.indexOf(`
`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new hs(i,new Bi(this,n,this.tokenRegex.lastIndex))}}class LX{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ce("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(t)&&(s[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var BX=YN;I("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});I("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});I("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});I("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});I("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});I("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");I("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var y7={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};I("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Ce("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=y7[t.text],r==null||r>=n)throw new Ce("Invalid base-"+n+" digit "+t.text);for(var i;(i=y7[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return"\\@char{"+r+"}"});var ok=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new Ce("\\newcommand's first argument must be a macro name");var s=i[0].text,a=e.isDefined(s);if(a&&!t)throw new Ce("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!n)throw new Ce("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var o=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=e.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ce("Invalid number of arguments: "+l);o=parseInt(l),i=e.consumeArg().tokens}return a&&r||e.macros.set(s,{tokens:i,numArgs:o}),""};I("\\newcommand",e=>ok(e,!1,!0,!1));I("\\renewcommand",e=>ok(e,!0,!1,!1));I("\\providecommand",e=>ok(e,!0,!0,!0));I("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});I("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});I("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),wl[n],Wn.math[n],Wn.text[n]),""});I("\\bgroup","{");I("\\egroup","}");I("~","\\nobreakspace");I("\\lq","`");I("\\rq","'");I("\\aa","\\r a");I("\\AA","\\r A");I("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");I("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");I("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");I("ℬ","\\mathscr{B}");I("ℰ","\\mathscr{E}");I("ℱ","\\mathscr{F}");I("ℋ","\\mathscr{H}");I("ℐ","\\mathscr{I}");I("ℒ","\\mathscr{L}");I("ℳ","\\mathscr{M}");I("ℛ","\\mathscr{R}");I("ℭ","\\mathfrak{C}");I("ℌ","\\mathfrak{H}");I("ℨ","\\mathfrak{Z}");I("\\Bbbk","\\Bbb{k}");I("\\llap","\\mathllap{\\textrm{#1}}");I("\\rlap","\\mathrlap{\\textrm{#1}}");I("\\clap","\\mathclap{\\textrm{#1}}");I("\\mathstrut","\\vphantom{(}");I("\\underbar","\\underline{\\text{#1}}");I("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');I("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");I("\\ne","\\neq");I("≠","\\neq");I("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");I("∉","\\notin");I("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");I("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");I("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");I("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");I("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");I("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");I("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");I("⟂","\\perp");I("‼","\\mathclose{!\\mkern-0.8mu!}");I("∌","\\notni");I("⌜","\\ulcorner");I("⌝","\\urcorner");I("⌞","\\llcorner");I("⌟","\\lrcorner");I("©","\\copyright");I("®","\\textregistered");I("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');I("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');I("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');I("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');I("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");I("⋮","\\vdots");I("\\varGamma","\\mathit{\\Gamma}");I("\\varDelta","\\mathit{\\Delta}");I("\\varTheta","\\mathit{\\Theta}");I("\\varLambda","\\mathit{\\Lambda}");I("\\varXi","\\mathit{\\Xi}");I("\\varPi","\\mathit{\\Pi}");I("\\varSigma","\\mathit{\\Sigma}");I("\\varUpsilon","\\mathit{\\Upsilon}");I("\\varPhi","\\mathit{\\Phi}");I("\\varPsi","\\mathit{\\Psi}");I("\\varOmega","\\mathit{\\Omega}");I("\\substack","\\begin{subarray}{c}#1\\end{subarray}");I("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");I("\\boxed","\\fbox{$\\displaystyle{#1}$}");I("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");I("\\implies","\\DOTSB\\;\\Longrightarrow\\;");I("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");I("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");I("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var b7={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},zX=new Set(["bin","rel"]);I("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in b7?t=b7[n]:(n.slice(0,4)==="\\not"||n in Wn.math&&zX.has(Wn.math[n].group))&&(t="\\dotsb"),t});var lk={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};I("\\dotso",function(e){var t=e.future().text;return t in lk?"\\ldots\\,":"\\ldots"});I("\\dotsc",function(e){var t=e.future().text;return t in lk&&t!==","?"\\ldots\\,":"\\ldots"});I("\\cdots",function(e){var t=e.future().text;return t in lk?"\\@cdots\\,":"\\@cdots"});I("\\dotsb","\\cdots");I("\\dotsm","\\cdots");I("\\dotsi","\\!\\cdots");I("\\dotsx","\\ldots\\,");I("\\DOTSI","\\relax");I("\\DOTSB","\\relax");I("\\DOTSX","\\relax");I("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");I("\\,","\\tmspace+{3mu}{.1667em}");I("\\thinspace","\\,");I("\\>","\\mskip{4mu}");I("\\:","\\tmspace+{4mu}{.2222em}");I("\\medspace","\\:");I("\\;","\\tmspace+{5mu}{.2777em}");I("\\thickspace","\\;");I("\\!","\\tmspace-{3mu}{.1667em}");I("\\negthinspace","\\!");I("\\negmedspace","\\tmspace-{4mu}{.2222em}");I("\\negthickspace","\\tmspace-{5mu}{.277em}");I("\\enspace","\\kern.5em ");I("\\enskip","\\hskip.5em\\relax");I("\\quad","\\hskip1em\\relax");I("\\qquad","\\hskip2em\\relax");I("\\tag","\\@ifstar\\tag@literal\\tag@paren");I("\\tag@paren","\\tag@literal{({#1})}");I("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ce("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});I("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");I("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");I("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");I("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");I("\\newline","\\\\\\relax");I("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oI=Ie(Oa["Main-Regular"][84][1]-.7*Oa["Main-Regular"][65][1]);I("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oI+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");I("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oI+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");I("\\hspace","\\@ifstar\\@hspacer\\@hspace");I("\\@hspace","\\hskip #1\\relax");I("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");I("\\ordinarycolon",":");I("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");I("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');I("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');I("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');I("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');I("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');I("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');I("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');I("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');I("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');I("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');I("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');I("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');I("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');I("∷","\\dblcolon");I("∹","\\eqcolon");I("≔","\\coloneqq");I("≕","\\eqqcolon");I("⩴","\\Coloneqq");I("\\ratio","\\vcentcolon");I("\\coloncolon","\\dblcolon");I("\\colonequals","\\coloneqq");I("\\coloncolonequals","\\Coloneqq");I("\\equalscolon","\\eqqcolon");I("\\equalscoloncolon","\\Eqqcolon");I("\\colonminus","\\coloneq");I("\\coloncolonminus","\\Coloneq");I("\\minuscolon","\\eqcolon");I("\\minuscoloncolon","\\Eqcolon");I("\\coloncolonapprox","\\Colonapprox");I("\\coloncolonsim","\\Colonsim");I("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");I("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");I("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");I("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");I("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");I("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");I("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");I("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");I("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");I("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");I("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");I("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");I("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");I("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");I("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");I("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");I("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");I("\\nleqq","\\html@mathml{\\@nleqq}{≰}");I("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");I("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");I("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");I("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");I("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");I("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");I("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");I("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");I("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");I("\\imath","\\html@mathml{\\@imath}{ı}");I("\\jmath","\\html@mathml{\\@jmath}{ȷ}");I("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");I("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");I("⟦","\\llbracket");I("⟧","\\rrbracket");I("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");I("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");I("⦃","\\lBrace");I("⦄","\\rBrace");I("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");I("⦵","\\minuso");I("\\darr","\\downarrow");I("\\dArr","\\Downarrow");I("\\Darr","\\Downarrow");I("\\lang","\\langle");I("\\rang","\\rangle");I("\\uarr","\\uparrow");I("\\uArr","\\Uparrow");I("\\Uarr","\\Uparrow");I("\\N","\\mathbb{N}");I("\\R","\\mathbb{R}");I("\\Z","\\mathbb{Z}");I("\\alef","\\aleph");I("\\alefsym","\\aleph");I("\\Alpha","\\mathrm{A}");I("\\Beta","\\mathrm{B}");I("\\bull","\\bullet");I("\\Chi","\\mathrm{X}");I("\\clubs","\\clubsuit");I("\\cnums","\\mathbb{C}");I("\\Complex","\\mathbb{C}");I("\\Dagger","\\ddagger");I("\\diamonds","\\diamondsuit");I("\\empty","\\emptyset");I("\\Epsilon","\\mathrm{E}");I("\\Eta","\\mathrm{H}");I("\\exist","\\exists");I("\\harr","\\leftrightarrow");I("\\hArr","\\Leftrightarrow");I("\\Harr","\\Leftrightarrow");I("\\hearts","\\heartsuit");I("\\image","\\Im");I("\\infin","\\infty");I("\\Iota","\\mathrm{I}");I("\\isin","\\in");I("\\Kappa","\\mathrm{K}");I("\\larr","\\leftarrow");I("\\lArr","\\Leftarrow");I("\\Larr","\\Leftarrow");I("\\lrarr","\\leftrightarrow");I("\\lrArr","\\Leftrightarrow");I("\\Lrarr","\\Leftrightarrow");I("\\Mu","\\mathrm{M}");I("\\natnums","\\mathbb{N}");I("\\Nu","\\mathrm{N}");I("\\Omicron","\\mathrm{O}");I("\\plusmn","\\pm");I("\\rarr","\\rightarrow");I("\\rArr","\\Rightarrow");I("\\Rarr","\\Rightarrow");I("\\real","\\Re");I("\\reals","\\mathbb{R}");I("\\Reals","\\mathbb{R}");I("\\Rho","\\mathrm{P}");I("\\sdot","\\cdot");I("\\sect","\\S");I("\\spades","\\spadesuit");I("\\sub","\\subset");I("\\sube","\\subseteq");I("\\supe","\\supseteq");I("\\Tau","\\mathrm{T}");I("\\thetasym","\\vartheta");I("\\weierp","\\wp");I("\\Zeta","\\mathrm{Z}");I("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");I("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");I("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");I("\\bra","\\mathinner{\\langle{#1}|}");I("\\ket","\\mathinner{|{#1}\\rangle}");I("\\braket","\\mathinner{\\langle{#1}\\rangle}");I("\\Bra","\\left\\langle#1\\right|");I("\\Ket","\\left|#1\\right\\rangle");var lI=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,s=t.consumeArg().tokens,a=t.macros.get("|"),o=t.macros.get("\\|");t.macros.beginGroup();var l=d=>f=>{e&&(f.macros.set("|",a),i.length&&f.macros.set("\\|",o));var m=d;if(!d&&i.length){var p=f.future();p.text==="|"&&(f.popToken(),m=!0)}return{tokens:m?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...s,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};I("\\bra@ket",lI(!1));I("\\bra@set",lI(!0));I("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");I("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");I("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");I("\\angln","{\\angl n}");I("\\blue","\\textcolor{##6495ed}{#1}");I("\\orange","\\textcolor{##ffa500}{#1}");I("\\pink","\\textcolor{##ff00af}{#1}");I("\\red","\\textcolor{##df0030}{#1}");I("\\green","\\textcolor{##28ae7b}{#1}");I("\\gray","\\textcolor{gray}{#1}");I("\\purple","\\textcolor{##9d38bd}{#1}");I("\\blueA","\\textcolor{##ccfaff}{#1}");I("\\blueB","\\textcolor{##80f6ff}{#1}");I("\\blueC","\\textcolor{##63d9ea}{#1}");I("\\blueD","\\textcolor{##11accd}{#1}");I("\\blueE","\\textcolor{##0c7f99}{#1}");I("\\tealA","\\textcolor{##94fff5}{#1}");I("\\tealB","\\textcolor{##26edd5}{#1}");I("\\tealC","\\textcolor{##01d1c1}{#1}");I("\\tealD","\\textcolor{##01a995}{#1}");I("\\tealE","\\textcolor{##208170}{#1}");I("\\greenA","\\textcolor{##b6ffb0}{#1}");I("\\greenB","\\textcolor{##8af281}{#1}");I("\\greenC","\\textcolor{##74cf70}{#1}");I("\\greenD","\\textcolor{##1fab54}{#1}");I("\\greenE","\\textcolor{##0d923f}{#1}");I("\\goldA","\\textcolor{##ffd0a9}{#1}");I("\\goldB","\\textcolor{##ffbb71}{#1}");I("\\goldC","\\textcolor{##ff9c39}{#1}");I("\\goldD","\\textcolor{##e07d10}{#1}");I("\\goldE","\\textcolor{##a75a05}{#1}");I("\\redA","\\textcolor{##fca9a9}{#1}");I("\\redB","\\textcolor{##ff8482}{#1}");I("\\redC","\\textcolor{##f9685d}{#1}");I("\\redD","\\textcolor{##e84d39}{#1}");I("\\redE","\\textcolor{##bc2612}{#1}");I("\\maroonA","\\textcolor{##ffbde0}{#1}");I("\\maroonB","\\textcolor{##ff92c6}{#1}");I("\\maroonC","\\textcolor{##ed5fa6}{#1}");I("\\maroonD","\\textcolor{##ca337c}{#1}");I("\\maroonE","\\textcolor{##9e034e}{#1}");I("\\purpleA","\\textcolor{##ddd7ff}{#1}");I("\\purpleB","\\textcolor{##c6b9fc}{#1}");I("\\purpleC","\\textcolor{##aa87ff}{#1}");I("\\purpleD","\\textcolor{##7854ab}{#1}");I("\\purpleE","\\textcolor{##543b78}{#1}");I("\\mintA","\\textcolor{##f5f9e8}{#1}");I("\\mintB","\\textcolor{##edf2df}{#1}");I("\\mintC","\\textcolor{##e0e5cc}{#1}");I("\\grayA","\\textcolor{##f6f7f7}{#1}");I("\\grayB","\\textcolor{##f0f1f2}{#1}");I("\\grayC","\\textcolor{##e3e5e6}{#1}");I("\\grayD","\\textcolor{##d6d8da}{#1}");I("\\grayE","\\textcolor{##babec2}{#1}");I("\\grayF","\\textcolor{##888d93}{#1}");I("\\grayG","\\textcolor{##626569}{#1}");I("\\grayH","\\textcolor{##3b3e40}{#1}");I("\\grayI","\\textcolor{##21242c}{#1}");I("\\kaBlue","\\textcolor{##314453}{#1}");I("\\kaGreen","\\textcolor{##71B307}{#1}");var cI={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class PX{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new LX(BX,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new g7(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new hs("EOF",r.loc)),this.pushTokens(i),new hs("",Bi.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),s,a=0,o=0;do{if(s=this.popToken(),n.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new Ce("Extra }",s)}else if(s.text==="EOF")throw new Ce("Unexpected end of input in a macro argument, expected '"+(t&&r?t[o]:"}")+"'",s);if(t&&r)if((a===0||a===1&&t[o]==="{")&&s.text===t[o]){if(++o,o===t.length){n.splice(-o,o);break}}else o=0}while(a!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:s}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Ce("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;i<r.length;i++){var s=this.popToken();if(r[i]!==s.text)throw new Ce("Use of the macro doesn't match its definition",s)}}for(var a=[],o=0;o<t;o++)a.push(this.consumeArg(n&&n[o+1]).tokens);return a}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Ce("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ce("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var o=s.length-1;o>=0;--o){var l=s[o];if(l.text==="#"){if(o===0)throw new Ce("Incomplete placeholder at end of macro body",l);if(l=s[--o],l.text==="#")s.splice(o+1,1);else if(/^[1-9]$/.test(l.text))s.splice(o,2,...a[+l.text-1]);else throw new Ce("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new hs(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var s=0;if(i.includes("#"))for(var a=i.replace(/##/g,"");a.includes("#"+(s+1));)++s;for(var o=new g7(i,this.settings),l=[],c=o.lex();c.text!=="EOF";)l.push(c),c=o.lex();l.reverse();var u={tokens:l,numArgs:s};return u}return i}isDefined(t){return this.macros.has(t)||wl.hasOwnProperty(t)||Wn.math.hasOwnProperty(t)||Wn.text.hasOwnProperty(t)||cI.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:wl.hasOwnProperty(t)&&!wl[t].primitive}}var v7=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Rm=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),yv={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},x7={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let uI=class dI{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new PX(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Ce("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new hs("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(dI.endOfExpression.has(i.text)||n&&i.text===n||t&&wl[i.text]&&wl[i.text].infix)break;var s=this.parseAtom(n);if(s){if(s.type==="internal")continue}else break;r.push(s)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i<t.length;i++){var s=t[i];if(s.type==="infix"){if(n!==-1)throw new Ce("only one infix operator per group",s.token);n=i,r=s.replaceWith}}if(n!==-1&&r){var a,o,l=t.slice(0,n),c=t.slice(n+1);l.length===1&&l[0].type==="ordgroup"?a=l[0]:a={type:"ordgroup",mode:this.mode,body:l},c.length===1&&c[0].type==="ordgroup"?o=c[0]:o={type:"ordgroup",mode:this.mode,body:c};var u;return r==="\\\\abovefrac"?u=this.callFunction(r,[a,t[n],o],[]):u=this.callFunction(r,[a,o],[]),[u]}else return t}handleSupSubscript(t){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var i;do{var s;i=this.parseGroup(t)}while(((s=i)==null?void 0:s.type)==="internal");if(!i)throw new Ce("Expected group after '"+r+"'",n);return i}formatUnsupportedCmd(t){for(var n=[],r=0;r<t.length;r++)n.push({type:"textord",mode:"text",text:t[r]});var i={type:"text",mode:this.mode,body:n},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(t){var n=this.parseGroup("atom",t);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var r,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(n&&n.type==="op"){var a=s.text==="\\limits";n.limits=a,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=s.text==="\\limits");else throw new Ce("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(r)throw new Ce("Double superscript",s);r=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new Ce("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(r)throw new Ce("Double superscript",s);var o={type:"textord",mode:this.mode,text:"\\prime"},l=[o];for(this.consume();this.fetch().text==="'";)l.push(o),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:l}}else if(Rm[s.text]){var c=v7.test(s.text),u=[];for(u.push(new hs(Rm[s.text])),this.consume();;){var d=this.fetch().text;if(!Rm[d]||v7.test(d)!==c)break;u.unshift(new hs(Rm[d])),this.consume()}var f=this.subparse(u);c?i={type:"ordgroup",mode:"math",body:f}:r={type:"ordgroup",mode:"math",body:f}}else break}return r||i?{type:"supsub",mode:this.mode,base:n,sup:r,sub:i}:n}parseFunction(t,n){var r=this.fetch(),i=r.text,s=wl[i];if(!s)return null;if(this.consume(),n&&n!=="atom"&&!s.allowedInArgument)throw new Ce("Got function '"+i+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!s.allowedInText)throw new Ce("Can't use function '"+i+"' in text mode",r);if(this.mode==="math"&&s.allowedInMath===!1)throw new Ce("Can't use function '"+i+"' in math mode",r);var{args:a,optArgs:o}=this.parseArguments(i,s);return this.callFunction(i,a,o,r,t)}callFunction(t,n,r,i,s){var a={funcName:t,parser:this,token:i,breakOnTokenText:s},o=wl[t];if(o&&o.handler)return o.handler(a,n,r);throw new Ce("No function handler for "+t)}parseArguments(t,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var i=[],s=[],a=0;a<r;a++){var o=n.argTypes&&n.argTypes[a],l=a<n.numOptionalArgs;("primitive"in n&&n.primitive&&o==null||n.type==="sqrt"&&a===1&&s[0]==null)&&(o="primitive");var c=this.parseGroupOfType("argument to '"+t+"'",o,l);if(l)s.push(c);else if(c!=null)i.push(c);else throw new Ce("Null argument, please report this as a bug")}return{args:i,optArgs:s}}parseGroupOfType(t,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var i=this.parseArgumentGroup(r,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text",resetFont:!0}:null}case"raw":{var s=this.parseStringGroup("raw",r);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(r)throw new Ce("A primitive argument cannot be optional");var a=this.parseGroup(t);if(a==null)throw new Ce("Expected group as "+t,this.fetch());return a}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new Ce("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var i="",s;(s=this.fetch()).text!=="EOF";)i+=s.text,this.consume();return this.consume(),r.text=i,r}parseRegexGroup(t,n){for(var r=this.fetch(),i=r,s="",a;(a=this.fetch()).text!=="EOF"&&t.test(s+a.text);)i=a,s+=i.text,this.consume();if(s==="")throw new Ce("Invalid "+n+": '"+r.text+"'",r);return r.range(i,s)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new Ce("Invalid color: '"+n.text+"'",n);var i=r[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(t){var n,r=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",r=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!i)throw new Ce("Invalid size: '"+n.text+"'",n);var s={number:+(i[1]+i[2]),unit:i[3]};if(!gN(s))throw new Ce("Invalid unit: '"+s.unit+"'",n);return{type:"size",mode:this.mode,value:s,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,n){var r=this.gullet.scanArgument(t);if(r==null)return null;var i=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:r.loc,body:s};return n&&this.switchMode(i),a}parseGroup(t,n){var r=this.fetch(),i=r.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var a=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,a),l=this.fetch();this.expect(a),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:Bi.range(r,l),body:o,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(n,t)||this.parseSymbol(),s==null&&i[0]==="\\"&&!cI.hasOwnProperty(i)){if(this.settings.throwOnError)throw new Ce("Undefined control sequence: "+i,r);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(t){for(var n=t.length-1,r=0;r<n;++r){var i=t[r];if(i.type==="textord"){var s=i.text,a=t[r+1];if(!(!a||a.type!=="textord")){if(s==="-"&&a.text==="-"){var o=t[r+2];r+1<n&&o&&o.type==="textord"&&o.text==="-"?(t.splice(r,3,{type:"textord",mode:"text",loc:Bi.range(i,o),text:"---"}),n-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:Bi.range(i,a),text:"--"}),n-=1)}(s==="'"||s==="`")&&a.text===s&&(t.splice(r,2,{type:"textord",mode:"text",loc:Bi.range(i,a),text:s+s}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),i=r.charAt(0)==="*";if(i&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new Ce(`\\verb assertion failed --
                    please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}x7.hasOwnProperty(n[0])&&!Wn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=x7[n[0]]+n.slice(1));var s=OX.exec(n);s&&(n=n.substring(0,s.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var a;if(Wn[this.mode][n]){this.settings.strict&&this.mode==="math"&&Lx.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var o=Wn[this.mode][n].group,l=Bi.range(t),c;tX(o)?c={type:"atom",mode:this.mode,family:o,loc:l,text:n}:c={type:o,mode:this.mode,loc:l,text:n},a=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(pN(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),a={type:"textord",mode:"text",loc:Bi.range(t),text:n};else return null;if(this.consume(),s)for(var u=0;u<s[0].length;u++){var d=s[0][u];if(!yv[d])throw new Ce("Unknown accent ' "+d+"'",t);var f=yv[d][this.mode]||yv[d].text;if(!f)throw new Ce("Accent "+d+" unsupported in "+this.mode+" mode",t);a={type:"accent",mode:this.mode,loc:Bi.range(t),label:f,isStretchy:!1,isShifty:!0,base:a}}return a}};uI.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var ck=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new uI(t,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Ce("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new hs("\\df@tag")])}]}return i},uk=function(t,n,r){n.textContent="";var i=ry(t,r).toNode();n.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),uk=function(){throw new Ce("KaTeX doesn't work in quirks mode.")});var hI=function(t,n){var r=ry(t,n).toMarkup();return r},fI=function(t,n){var r=new Y3(n);return ck(t,r)},mI=function(t,n,r){if(r.throwOnError||!(t instanceof Ce))throw t;var i=we(["katex-error"],[new ps(n)]);return i.setAttribute("title",t.toString()),i.setAttribute("style","color:"+r.errorColor),i},ry=function(t,n){var r=new Y3(n);try{var i=ck(t,r);return WY(i,t,r)}catch(s){return mI(s,t,r)}},pI=function(t,n){var r=new Y3(n);try{var i=ck(t,r);return KY(i,t,r)}catch(s){return mI(s,t,r)}},gI="0.16.47",yI={Span:ch,Anchor:V1,SymbolNode:ps,SvgNode:Lo,PathNode:ql,LineNode:jx},Qx={version:gI,render:uk,renderToString:hI,ParseError:Ce,SETTINGS_SCHEMA:Dg,__parse:fI,__renderToDomTree:ry,__renderToHTMLTree:pI,__setFontMetrics:xN,__defineSymbol:k,__defineFunction:ze,__defineMacro:I,__domTree:yI};const Txe=Object.freeze(Object.defineProperty({__proto__:null,ParseError:Ce,SETTINGS_SCHEMA:Dg,__defineFunction:ze,__defineMacro:I,__defineSymbol:k,__domTree:yI,__parse:fI,__renderToDomTree:ry,__renderToHTMLTree:pI,__setFontMetrics:xN,default:Qx,get render(){return uk},renderToString:hI,version:gI},Symbol.toStringTag,{value:"Module"})),$X={};function w7(e){const t=this,n=e||$X,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(KK(n)),s.push($K()),a.push(UK(n))}const k7=/[#.]/g;function UX(e,t){const n=e||"",r={};let i=0,s,a;for(;i<n.length;){k7.lastIndex=i;const o=k7.exec(n),l=n.slice(i,o?o.index:n.length);l&&(s?s==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:a=l,i+=l.length),o&&(s=o[0],i++)}return{type:"element",tagName:a||t||"div",properties:r,children:[]}}function bI(e,t,n){const r=n?VX(n):void 0;function i(s,a,...o){let l;if(s==null){l={type:"root",children:[]};const c=a;o.unshift(c)}else{l=UX(s,t);const c=l.tagName.toLowerCase(),u=r?r.get(c):void 0;if(l.tagName=u||c,HX(a))o.unshift(a);else for(const[d,f]of Object.entries(a))qX(e,l.properties,d,f)}for(const c of o)Jx(l.children,c);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function HX(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 s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function qX(e,t,n,r){const i=M3(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=q6(r):i.commaSeparated?s=z6(r):i.commaOrSpaceSeparated?s=q6(z6(r).join(" ")):s=_7(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?FX(r):String(r);if(Array.isArray(s)){const a=[];for(const o of s)a.push(_7(i,i.property,o));s=a}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function Jx(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)Jx(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Jx(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function _7(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Qf(n)===Qf(t)))return!0}return n}function FX(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function VX(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const GX=["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"],WX=bI(N3,"div"),KX=bI(ah,"g",GX),bv={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function YX(e,t){return vI(e,{})||{type:"root",children:[]}}function vI(e,t){const n=XX(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function XX(e,t){switch(e.nodeType){case 1:return eQ(e,t);case 3:return JX(e);case 8:return ZX(e);case 9:return S7(e,t);case 10:return QX();case 11:return S7(e,t);default:return}}function S7(e,t){return{type:"root",children:xI(e,t)}}function QX(){return{type:"doctype"}}function JX(e){return{type:"text",value:e.nodeValue||""}}function ZX(e){return{type:"comment",value:e.nodeValue||""}}function eQ(e,t){const n=e.namespaceURI,r=n===bv.svg?KX:WX,i=n===bv.html?e.tagName.toLowerCase():e.tagName,s=n===bv.html&&i==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++l<a.length;)o[a[l]]=e.getAttribute(a[l])||"";return r(i,o,xI(s,t))}function xI(e,t){const n=e.childNodes,r=[];let i=-1;for(;++i<n.length;){const s=vI(n[i],t);s!==void 0&&r.push(s)}return r}new DOMParser;function tQ(e,t){const n=nQ(e);return YX(n)}function nQ(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const T7=function(e,t,n){const r=B0(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},pu=function(e){if(e==null)return sQ;if(typeof e=="string")return iQ(e);if(typeof e=="object")return rQ(e);if(typeof e=="function")return dk(e);throw new Error("Expected function, string, or array as `test`")};function rQ(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=pu(e[n]);return dk(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function iQ(e){return dk(t);function t(n){return n.tagName===e}}function dk(e){return t;function t(n,r,i){return!!(aQ(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function sQ(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function aQ(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const C7=/\n/g,E7=/[\t ]+/g,Zx=pu("br"),A7=pu(mQ),oQ=pu("p"),M7=pu("tr"),lQ=pu(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",fQ,pQ]),wI=pu(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function cQ(e,t){const n=t||{},r="children"in e?e.children:[],i=wI(e),s=SI(e,{whitespace:n.whitespace||"normal"}),a=[];(e.type==="text"||e.type==="comment")&&a.push(..._I(e,{breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<r.length;)a.push(...kI(r[o],e,{whitespace:s,breakBefore:o?void 0:i,breakAfter:o<r.length-1?Zx(r[o+1]):i}));const l=[];let c;for(o=-1;++o<a.length;){const u=a[o];typeof u=="number"?c!==void 0&&u>c&&(c=u):u&&(c!==void 0&&c>-1&&l.push(`
`.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function kI(e,t,n){return e.type==="element"?uQ(e,t,n):e.type==="text"?n.whitespace==="normal"?_I(e,n):dQ(e):[]}function uQ(e,t,n){const r=SI(e,n),i=e.children||[];let s=-1,a=[];if(lQ(e))return a;let o,l;for(Zx(e)||M7(e)&&T7(t,e,M7)?l=`
`:oQ(e)?(o=2,l=2):wI(e)&&(o=1,l=1);++s<i.length;)a=a.concat(kI(i[s],e,{whitespace:r,breakBefore:s?void 0:o,breakAfter:s<i.length-1?Zx(i[s+1]):l}));return A7(e)&&T7(t,e,A7)&&a.push("	"),o&&a.unshift(o),l&&a.push(l),a}function _I(e,t){const n=String(e.value),r=[],i=[];let s=0;for(;s<=n.length;){C7.lastIndex=s;const l=C7.exec(n),c=l&&"index"in l?l.index:n.length;r.push(hQ(n.slice(s,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,c===n.length?t.breakAfter:!0)),s=c+1}let a=-1,o;for(;++a<r.length;)r[a].charCodeAt(r[a].length-1)===8203||a<r.length-1&&r[a+1].charCodeAt(0)===8203?(i.push(r[a]),o=void 0):r[a]?(typeof o=="number"&&i.push(o),i.push(r[a]),o=0):(a===0||a===r.length-1)&&i.push(0);return i}function dQ(e){return[String(e.value)]}function hQ(e,t,n){const r=[];let i=0,s;for(;i<e.length;){E7.lastIndex=i;const a=E7.exec(e);s=a?a.index:e.length,!i&&!s&&a&&!t&&r.push(""),i!==s&&r.push(e.slice(i,s)),i=a?s+a[0].length:s}return i!==s&&!n&&r.push(""),r.join(" ")}function SI(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function fQ(e){return!!(e.properties||{}).hidden}function mQ(e){return e.tagName==="td"||e.tagName==="th"}function pQ(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const gQ={},yQ=[];function N7(e){const t=e||gQ;return function(n,r){q3(n,"element",function(i,s){const a=Array.isArray(i.properties.className)?i.properties.className:yQ,o=a.includes("language-math"),l=a.includes("math-display"),c=a.includes("math-inline");let u=l;if(!o&&!l&&!c)return;let d=s[s.length-1],f=i;if(i.tagName==="code"&&o&&d&&d.type==="element"&&d.tagName==="pre"&&(f=d,d=s[s.length-2],u=!0),!d)return;const m=cQ(f,{whitespace:"pre"});let p;try{p=Qx.renderToString(m,{...t,displayMode:u,throwOnError:!0})}catch(x){const g=x,y=g.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...s,i],cause:g,place:i.position,ruleId:y,source:"rehype-katex"});try{p=Qx.renderToString(m,{...t,displayMode:u,strict:"ignore",throwOnError:!1})}catch{p=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(x)},children:[{type:"text",value:m}]}]}}typeof p=="string"&&(p=tQ(p).children);const b=d.children.indexOf(f);return d.children.splice(b,1,...p),HM})}}const TI=[{id:"abap",name:"ABAP",import:()=>U(()=>import("./abap-DsBKuouk.js"),[])},{id:"actionscript-3",name:"ActionScript",import:()=>U(()=>import("./actionscript-3-D_z4Izcz.js"),[])},{id:"ada",name:"Ada",import:()=>U(()=>import("./ada-727ZlQH0.js"),[])},{id:"angular-html",name:"Angular HTML",import:()=>U(()=>import("./angular-html-LfdN0zeE.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]))},{id:"angular-ts",name:"Angular TypeScript",import:()=>U(()=>import("./angular-ts-CKsD7JZE.js"),__vite__mapDeps([4,0,1,2,3,5]))},{id:"apache",name:"Apache Conf",import:()=>U(()=>import("./apache-Dn00JSTd.js"),[])},{id:"apex",name:"Apex",import:()=>U(()=>import("./apex-COJ4H7py.js"),[])},{id:"apl",name:"APL",import:()=>U(()=>import("./apl-BBq3IX1j.js"),__vite__mapDeps([6,1,2,3,7,8,9]))},{id:"applescript",name:"AppleScript",import:()=>U(()=>import("./applescript-Bu5BbsvL.js"),[])},{id:"ara",name:"Ara",import:()=>U(()=>import("./ara-7O62HKoU.js"),[])},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>U(()=>import("./asciidoc-BPT9niGB.js"),[])},{id:"asm",name:"Assembly",import:()=>U(()=>import("./asm-Dhn9LcZ4.js"),[])},{id:"astro",name:"Astro",import:()=>U(()=>import("./astro-CqkE3fuf.js"),__vite__mapDeps([10,9,2,11,3,12]))},{id:"awk",name:"AWK",import:()=>U(()=>import("./awk-eg146-Ew.js"),[])},{id:"ballerina",name:"Ballerina",import:()=>U(()=>import("./ballerina-Du268qiB.js"),[])},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>U(()=>import("./bat-fje9CFhw.js"),[])},{id:"beancount",name:"Beancount",import:()=>U(()=>import("./beancount-BwXTMy5W.js"),[])},{id:"berry",name:"Berry",aliases:["be"],import:()=>U(()=>import("./berry-3xVqZejG.js"),[])},{id:"bibtex",name:"BibTeX",import:()=>U(()=>import("./bibtex-xW4inM5L.js"),[])},{id:"bicep",name:"Bicep",import:()=>U(()=>import("./bicep-DHo0CJ0O.js"),[])},{id:"blade",name:"Blade",import:()=>U(()=>import("./blade-a8OxSdnT.js"),__vite__mapDeps([13,1,2,3,7,8,14,9]))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>U(()=>import("./bsl-Dgyn0ogV.js"),__vite__mapDeps([15,16]))},{id:"c",name:"C",import:()=>U(()=>import("./c-C3t2pwGQ.js"),[])},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>U(()=>import("./cadence-DNquZEk8.js"),[])},{id:"cairo",name:"Cairo",import:()=>U(()=>import("./cairo--RitsXJZ.js"),__vite__mapDeps([17,18]))},{id:"clarity",name:"Clarity",import:()=>U(()=>import("./clarity-BHOwM8T6.js"),[])},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>U(()=>import("./clojure-DxSadP1t.js"),[])},{id:"cmake",name:"CMake",import:()=>U(()=>import("./cmake-DbXoA79R.js"),[])},{id:"cobol",name:"COBOL",import:()=>U(()=>import("./cobol-PTqiYgYu.js"),__vite__mapDeps([19,1,2,3,8]))},{id:"codeowners",name:"CODEOWNERS",import:()=>U(()=>import("./codeowners-Bp6g37R7.js"),[])},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>U(()=>import("./codeql-sacFqUAJ.js"),[])},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>U(()=>import("./coffee-dyiR41kL.js"),__vite__mapDeps([20,2]))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>U(()=>import("./common-lisp-C7gG9l05.js"),[])},{id:"coq",name:"Coq",import:()=>U(()=>import("./coq-Dsg_Bt_b.js"),[])},{id:"cpp",name:"C++",aliases:["c++"],import:()=>U(()=>import("./cpp-BksuvNSY.js"),__vite__mapDeps([21,22,23,24,14]))},{id:"crystal",name:"Crystal",import:()=>U(()=>import("./crystal-DtDmRg-F.js"),__vite__mapDeps([25,1,2,3,14,24,26]))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>U(()=>import("./csharp-D9R-vmeu.js"),[])},{id:"css",name:"CSS",import:()=>U(()=>import("./css-BPhBrDlE.js"),[])},{id:"csv",name:"CSV",import:()=>U(()=>import("./csv-B0qRVHPH.js"),[])},{id:"cue",name:"CUE",import:()=>U(()=>import("./cue-DtFQj3wx.js"),[])},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>U(()=>import("./cypher-m2LEI-9-.js"),[])},{id:"d",name:"D",import:()=>U(()=>import("./d-BoXegm-a.js"),[])},{id:"dart",name:"Dart",import:()=>U(()=>import("./dart-B9wLZaAG.js"),[])},{id:"dax",name:"DAX",import:()=>U(()=>import("./dax-ClGRhx96.js"),[])},{id:"desktop",name:"Desktop",import:()=>U(()=>import("./desktop-DEIpsLCJ.js"),[])},{id:"diff",name:"Diff",import:()=>U(()=>import("./diff-BgYniUM_.js"),[])},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>U(()=>import("./docker-COcR7UxN.js"),[])},{id:"dotenv",name:"dotEnv",import:()=>U(()=>import("./dotenv-BjQB5zDj.js"),[])},{id:"dream-maker",name:"Dream Maker",import:()=>U(()=>import("./dream-maker-C-nORZOA.js"),[])},{id:"edge",name:"Edge",import:()=>U(()=>import("./edge-D5gP-w-T.js"),__vite__mapDeps([27,11,1,2,3,28]))},{id:"elixir",name:"Elixir",import:()=>U(()=>import("./elixir-CLiX3zqd.js"),__vite__mapDeps([29,1,2,3]))},{id:"elm",name:"Elm",import:()=>U(()=>import("./elm-CmHSxxaM.js"),__vite__mapDeps([30,23,24]))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>U(()=>import("./emacs-lisp-BX77sIaO.js"),[])},{id:"erb",name:"ERB",import:()=>U(()=>import("./erb-BYTLMnw6.js"),__vite__mapDeps([31,1,2,3,32,33,7,8,14,34,11,35,36,21,22,23,24,26,37,38]))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>U(()=>import("./erlang-B-DoSBHF.js"),[])},{id:"fennel",name:"Fennel",import:()=>U(()=>import("./fennel-bCA53EVm.js"),[])},{id:"fish",name:"Fish",import:()=>U(()=>import("./fish-w-ucz2PV.js"),[])},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>U(()=>import("./fluent-Dayu4EKP.js"),[])},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>U(()=>import("./fortran-fixed-form-TqA4NnZg.js"),__vite__mapDeps([39,40]))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>U(()=>import("./fortran-free-form-DKXYxT9g.js"),[])},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>U(()=>import("./fsharp-XplgxFYe.js"),__vite__mapDeps([41,42]))},{id:"gdresource",name:"GDResource",import:()=>U(()=>import("./gdresource-BHYsBjWJ.js"),__vite__mapDeps([43,44,45]))},{id:"gdscript",name:"GDScript",import:()=>U(()=>import("./gdscript-DfxzS6Rs.js"),[])},{id:"gdshader",name:"GDShader",import:()=>U(()=>import("./gdshader-SKMF96pI.js"),[])},{id:"genie",name:"Genie",import:()=>U(()=>import("./genie-ajMbGru0.js"),[])},{id:"gherkin",name:"Gherkin",import:()=>U(()=>import("./gherkin--30QC5Em.js"),[])},{id:"git-commit",name:"Git Commit Message",import:()=>U(()=>import("./git-commit-i4q6IMui.js"),__vite__mapDeps([46,47]))},{id:"git-rebase",name:"Git Rebase Message",import:()=>U(()=>import("./git-rebase-B-v9cOL2.js"),__vite__mapDeps([48,26]))},{id:"gleam",name:"Gleam",import:()=>U(()=>import("./gleam-B430Bg39.js"),[])},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>U(()=>import("./glimmer-js-D-cwc0-E.js"),__vite__mapDeps([49,2,11,3,1]))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>U(()=>import("./glimmer-ts-pgjy16dm.js"),__vite__mapDeps([50,11,3,2,1]))},{id:"glsl",name:"GLSL",import:()=>U(()=>import("./glsl-DBO2IWDn.js"),__vite__mapDeps([23,24]))},{id:"gnuplot",name:"Gnuplot",import:()=>U(()=>import("./gnuplot-CM8KxXT1.js"),[])},{id:"go",name:"Go",import:()=>U(()=>import("./go-B1SYOhNW.js"),[])},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>U(()=>import("./graphql-cDcHW_If.js"),__vite__mapDeps([34,2,11,35,36]))},{id:"groovy",name:"Groovy",import:()=>U(()=>import("./groovy-DkBy-JyN.js"),[])},{id:"hack",name:"Hack",import:()=>U(()=>import("./hack-D1yCygmZ.js"),__vite__mapDeps([51,1,2,3,14]))},{id:"haml",name:"Ruby Haml",import:()=>U(()=>import("./haml-B2EZWmdv.js"),__vite__mapDeps([33,2,3]))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>U(()=>import("./handlebars-BQGss363.js"),__vite__mapDeps([52,1,2,3,38]))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>U(()=>import("./haskell-BILxekzW.js"),[])},{id:"haxe",name:"Haxe",import:()=>U(()=>import("./haxe-C5wWYbrZ.js"),[])},{id:"hcl",name:"HashiCorp HCL",import:()=>U(()=>import("./hcl-HzYwdGDm.js"),[])},{id:"hjson",name:"Hjson",import:()=>U(()=>import("./hjson-T-Tgc4AT.js"),[])},{id:"hlsl",name:"HLSL",import:()=>U(()=>import("./hlsl-ifBTmRxC.js"),[])},{id:"html",name:"HTML",import:()=>U(()=>import("./html-C2L_23MC.js"),__vite__mapDeps([1,2,3]))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>U(()=>import("./html-derivative-CSfWNPLT.js"),__vite__mapDeps([28,1,2,3]))},{id:"http",name:"HTTP",import:()=>U(()=>import("./http-FRrOvY1W.js"),__vite__mapDeps([53,26,9,7,8,34,2,11,35,36]))},{id:"hxml",name:"HXML",import:()=>U(()=>import("./hxml-TIA70rKU.js"),__vite__mapDeps([54,55]))},{id:"hy",name:"Hy",import:()=>U(()=>import("./hy-BMj5Y0dO.js"),[])},{id:"imba",name:"Imba",import:()=>U(()=>import("./imba-bv_oIlVt.js"),__vite__mapDeps([56,11]))},{id:"ini",name:"INI",aliases:["properties"],import:()=>U(()=>import("./ini-BjABl1g7.js"),[])},{id:"java",name:"Java",import:()=>U(()=>import("./java-xI-RfyKK.js"),[])},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>U(()=>import("./javascript-ySlJ1b_l.js"),[])},{id:"jinja",name:"Jinja",import:()=>U(()=>import("./jinja-DGy0s7-h.js"),__vite__mapDeps([57,1,2,3]))},{id:"jison",name:"Jison",import:()=>U(()=>import("./jison-BqZprYcd.js"),__vite__mapDeps([58,2]))},{id:"json",name:"JSON",import:()=>U(()=>import("./json-BQoSv7ci.js"),[])},{id:"json5",name:"JSON5",import:()=>U(()=>import("./json5-w8dY5SsB.js"),[])},{id:"jsonc",name:"JSON with Comments",import:()=>U(()=>import("./jsonc-TU54ms6u.js"),[])},{id:"jsonl",name:"JSON Lines",import:()=>U(()=>import("./jsonl-DREVFZK8.js"),[])},{id:"jsonnet",name:"Jsonnet",import:()=>U(()=>import("./jsonnet-BfivnA6A.js"),[])},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>U(()=>import("./jssm-P4WzXJd0.js"),[])},{id:"jsx",name:"JSX",import:()=>U(()=>import("./jsx-BAng5TT0.js"),[])},{id:"julia",name:"Julia",aliases:["jl"],import:()=>U(()=>import("./julia-BBuGR-5E.js"),__vite__mapDeps([59,21,22,23,24,14,18,2,60]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>U(()=>import("./kotlin-B5lbUyaz.js"),[])},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>U(()=>import("./kusto-mebxcVVE.js"),[])},{id:"latex",name:"LaTeX",import:()=>U(()=>import("./latex-C-cWTeAZ.js"),__vite__mapDeps([61,62,60]))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>U(()=>import("./lean-XBlWyCtg.js"),[])},{id:"less",name:"Less",import:()=>U(()=>import("./less-BfCpw3nA.js"),[])},{id:"liquid",name:"Liquid",import:()=>U(()=>import("./liquid-D3W5UaiH.js"),__vite__mapDeps([63,1,2,3,9]))},{id:"log",name:"Log file",import:()=>U(()=>import("./log-Cc5clBb7.js"),[])},{id:"logo",name:"Logo",import:()=>U(()=>import("./logo-IuBKFhSY.js"),[])},{id:"lua",name:"Lua",import:()=>U(()=>import("./lua-CvWAzNxB.js"),__vite__mapDeps([37,24]))},{id:"luau",name:"Luau",import:()=>U(()=>import("./luau-Du5NY7AG.js"),[])},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>U(()=>import("./make-Bvotw-X0.js"),[])},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>U(()=>import("./markdown-UIAJJxZW.js"),[])},{id:"marko",name:"Marko",import:()=>U(()=>import("./marko-z0MBrx5-.js"),__vite__mapDeps([64,3,65,5,2]))},{id:"matlab",name:"MATLAB",import:()=>U(()=>import("./matlab-D9-PGadD.js"),[])},{id:"mdc",name:"MDC",import:()=>U(()=>import("./mdc-DB_EDNY_.js"),__vite__mapDeps([66,42,38,28,1,2,3]))},{id:"mdx",name:"MDX",import:()=>U(()=>import("./mdx-sdHcTMYB.js"),[])},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>U(()=>import("./mermaid-Ci6OQyBP.js"),[])},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>U(()=>import("./mipsasm-BC5c_5Pe.js"),[])},{id:"mojo",name:"Mojo",import:()=>U(()=>import("./mojo-Tz6hzZYG.js"),[])},{id:"move",name:"Move",import:()=>U(()=>import("./move-DB_GagMm.js"),[])},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>U(()=>import("./narrat-DLbgOhZU.js"),[])},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>U(()=>import("./nextflow-B0XVJmRM.js"),[])},{id:"nginx",name:"Nginx",import:()=>U(()=>import("./nginx-D_VnBJ67.js"),__vite__mapDeps([67,37,24]))},{id:"nim",name:"Nim",import:()=>U(()=>import("./nim-ZlGxZxc3.js"),__vite__mapDeps([68,24,1,2,3,7,8,23,42]))},{id:"nix",name:"Nix",import:()=>U(()=>import("./nix-shcSOmrb.js"),[])},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>U(()=>import("./nushell-D4Tzg5kh.js"),[])},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>U(()=>import("./objective-c-Deuh7S70.js"),[])},{id:"objective-cpp",name:"Objective-C++",import:()=>U(()=>import("./objective-cpp-BUEGK8hf.js"),[])},{id:"ocaml",name:"OCaml",import:()=>U(()=>import("./ocaml-BNioltXt.js"),[])},{id:"pascal",name:"Pascal",import:()=>U(()=>import("./pascal-JqZropPD.js"),[])},{id:"perl",name:"Perl",import:()=>U(()=>import("./perl-CHQXSrWU.js"),__vite__mapDeps([69,1,2,3,7,8,14]))},{id:"php",name:"PHP",import:()=>U(()=>import("./php-B5ebYQev.js"),__vite__mapDeps([70,1,2,3,7,8,14,9]))},{id:"plsql",name:"PL/SQL",import:()=>U(()=>import("./plsql-LKU2TuZ1.js"),[])},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>U(()=>import("./po-BFLt1xDp.js"),[])},{id:"polar",name:"Polar",import:()=>U(()=>import("./polar-DKykz6zU.js"),[])},{id:"postcss",name:"PostCSS",import:()=>U(()=>import("./postcss-B3ZDOciz.js"),[])},{id:"powerquery",name:"PowerQuery",import:()=>U(()=>import("./powerquery-CSHBycmS.js"),[])},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>U(()=>import("./powershell-BIEUsx6d.js"),[])},{id:"prisma",name:"Prisma",import:()=>U(()=>import("./prisma-B48N-Iqd.js"),[])},{id:"prolog",name:"Prolog",import:()=>U(()=>import("./prolog-BY-TUvya.js"),[])},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>U(()=>import("./proto-zocC4JxJ.js"),[])},{id:"pug",name:"Pug",aliases:["jade"],import:()=>U(()=>import("./pug-CM9l7STV.js"),__vite__mapDeps([71,2,3,1]))},{id:"puppet",name:"Puppet",import:()=>U(()=>import("./puppet-Cza_XSSt.js"),[])},{id:"purescript",name:"PureScript",import:()=>U(()=>import("./purescript-Bg-kzb6g.js"),[])},{id:"python",name:"Python",aliases:["py"],import:()=>U(()=>import("./python-DhUJRlN_.js"),[])},{id:"qml",name:"QML",import:()=>U(()=>import("./qml-D8XfuvdV.js"),__vite__mapDeps([72,2]))},{id:"qmldir",name:"QML Directory",import:()=>U(()=>import("./qmldir-C8lEn-DE.js"),[])},{id:"qss",name:"Qt Style Sheets",import:()=>U(()=>import("./qss-DhMKtDLN.js"),[])},{id:"r",name:"R",import:()=>U(()=>import("./r-CwjWoCRV.js"),[])},{id:"racket",name:"Racket",import:()=>U(()=>import("./racket-CzouJOBO.js"),[])},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>U(()=>import("./raku-B1bQXN8T.js"),[])},{id:"razor",name:"ASP.NET Razor",import:()=>U(()=>import("./razor-CNLDkMZG.js"),__vite__mapDeps([73,1,2,3,74]))},{id:"reg",name:"Windows Registry Script",import:()=>U(()=>import("./reg-5LuOXUq_.js"),[])},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>U(()=>import("./regexp-DWJ3fJO_.js"),[])},{id:"rel",name:"Rel",import:()=>U(()=>import("./rel-DJlmqQ1C.js"),[])},{id:"riscv",name:"RISC-V",import:()=>U(()=>import("./riscv-QhoSD0DR.js"),[])},{id:"rst",name:"reStructuredText",import:()=>U(()=>import("./rst-4NLicBqY.js"),__vite__mapDeps([75,28,1,2,3,21,22,23,24,14,18,26,38,76,32,33,7,8,34,11,35,36,37]))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>U(()=>import("./ruby-DeZ3UC14.js"),__vite__mapDeps([32,1,2,3,33,7,8,14,34,11,35,36,21,22,23,24,26,37,38]))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>U(()=>import("./rust-Be6lgOlo.js"),[])},{id:"sas",name:"SAS",import:()=>U(()=>import("./sas-BmTFh92c.js"),__vite__mapDeps([77,14]))},{id:"sass",name:"Sass",import:()=>U(()=>import("./sass-BJ4Li9vH.js"),[])},{id:"scala",name:"Scala",import:()=>U(()=>import("./scala-DQVVAn-B.js"),[])},{id:"scheme",name:"Scheme",import:()=>U(()=>import("./scheme-BJGe-b2p.js"),[])},{id:"scss",name:"SCSS",import:()=>U(()=>import("./scss-C31hgJw-.js"),__vite__mapDeps([5,3]))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>U(()=>import("./sdbl-BLhTXw86.js"),[])},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>U(()=>import("./shaderlab-B7qAK45m.js"),__vite__mapDeps([78,79]))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>U(()=>import("./shellscript-atvbtKCR.js"),[])},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>U(()=>import("./shellsession-C_rIy8kc.js"),__vite__mapDeps([80,26]))},{id:"smalltalk",name:"Smalltalk",import:()=>U(()=>import("./smalltalk-DkLiglaE.js"),[])},{id:"solidity",name:"Solidity",import:()=>U(()=>import("./solidity-C1w2a3ep.js"),[])},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>U(()=>import("./soy-C-lX7w71.js"),__vite__mapDeps([81,1,2,3]))},{id:"sparql",name:"SPARQL",import:()=>U(()=>import("./sparql-bYkjHRlG.js"),__vite__mapDeps([82,83]))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>U(()=>import("./splunk-Cf8iN4DR.js"),[])},{id:"sql",name:"SQL",import:()=>U(()=>import("./sql-COK4E0Yg.js"),[])},{id:"ssh-config",name:"SSH Config",import:()=>U(()=>import("./ssh-config-BknIz3MU.js"),[])},{id:"stata",name:"Stata",import:()=>U(()=>import("./stata-DorPZHa4.js"),__vite__mapDeps([84,14]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>U(()=>import("./stylus-BeQkCIfX.js"),[])},{id:"svelte",name:"Svelte",import:()=>U(()=>import("./svelte-MSaWC3Je.js"),__vite__mapDeps([85,2,11,3,12]))},{id:"swift",name:"Swift",import:()=>U(()=>import("./swift-BSxZ-RaX.js"),[])},{id:"system-verilog",name:"SystemVerilog",import:()=>U(()=>import("./system-verilog-C7L56vO4.js"),[])},{id:"systemd",name:"Systemd Units",import:()=>U(()=>import("./systemd-CUnW07Te.js"),[])},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>U(()=>import("./talonscript-C1XDQQGZ.js"),[])},{id:"tasl",name:"Tasl",import:()=>U(()=>import("./tasl-CQjiPCtT.js"),[])},{id:"tcl",name:"Tcl",import:()=>U(()=>import("./tcl-DQ1-QYvQ.js"),[])},{id:"templ",name:"Templ",import:()=>U(()=>import("./templ-dwX3ZSMB.js"),__vite__mapDeps([86,87,2,3]))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>U(()=>import("./terraform-BbSNqyBO.js"),[])},{id:"tex",name:"TeX",import:()=>U(()=>import("./tex-rYs2v40G.js"),__vite__mapDeps([62,60]))},{id:"toml",name:"TOML",import:()=>U(()=>import("./toml-CB2ApiWb.js"),[])},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>U(()=>import("./ts-tags-CipyTH0X.js"),__vite__mapDeps([88,11,3,2,23,24,1,14,7,8]))},{id:"tsv",name:"TSV",import:()=>U(()=>import("./tsv-B_m7g4N7.js"),[])},{id:"tsx",name:"TSX",import:()=>U(()=>import("./tsx-B6W0miNI.js"),[])},{id:"turtle",name:"Turtle",import:()=>U(()=>import("./turtle-BMR_PYu6.js"),[])},{id:"twig",name:"Twig",import:()=>U(()=>import("./twig-NC5TFiHP.js"),__vite__mapDeps([89,3,2,5,70,1,7,8,14,9,18,32,33,34,11,35,36,21,22,23,24,26,37,38]))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>U(()=>import("./typescript-Dj6nwHGl.js"),[])},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>U(()=>import("./typespec-BpWG_bgh.js"),[])},{id:"typst",name:"Typst",aliases:["typ"],import:()=>U(()=>import("./typst-BVUVsWT6.js"),[])},{id:"v",name:"V",import:()=>U(()=>import("./v-CAQ2eGtk.js"),[])},{id:"vala",name:"Vala",import:()=>U(()=>import("./vala-BFOHcciG.js"),[])},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>U(()=>import("./vb-CdO5JTpU.js"),[])},{id:"verilog",name:"Verilog",import:()=>U(()=>import("./verilog-CJaU5se_.js"),[])},{id:"vhdl",name:"VHDL",import:()=>U(()=>import("./vhdl-DYoNaHQp.js"),[])},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>U(()=>import("./viml-m4uW47V2.js"),[])},{id:"vue",name:"Vue",import:()=>U(()=>import("./vue-BuYVFjOK.js"),__vite__mapDeps([90,1,2,3,11,9,28]))},{id:"vue-html",name:"Vue HTML",import:()=>U(()=>import("./vue-html-xdeiXROB.js"),__vite__mapDeps([91,90,1,2,3,11,9,28]))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>U(()=>import("./vyper-nyqBNV6O.js"),[])},{id:"wasm",name:"WebAssembly",import:()=>U(()=>import("./wasm-C6j12Q_x.js"),[])},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>U(()=>import("./wenyan-7A4Fjokl.js"),[])},{id:"wgsl",name:"WGSL",import:()=>U(()=>import("./wgsl-CB0Krxn9.js"),[])},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>U(()=>import("./wikitext-DCE3LsBG.js"),[])},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>U(()=>import("./wolfram-C3FkfJm5.js"),[])},{id:"xml",name:"XML",import:()=>U(()=>import("./xml-e3z08dGr.js"),__vite__mapDeps([7,8]))},{id:"xsl",name:"XSL",import:()=>U(()=>import("./xsl-Dd0NUgwM.js"),__vite__mapDeps([92,7,8]))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>U(()=>import("./yaml-CVw76BM1.js"),[])},{id:"zenscript",name:"ZenScript",import:()=>U(()=>import("./zenscript-HnGAYVZD.js"),[])},{id:"zig",name:"Zig",import:()=>U(()=>import("./zig-BVz_zdnA.js"),[])}],bQ=Object.fromEntries(TI.map(e=>[e.id,e.import])),vQ=Object.fromEntries(TI.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))||[]})),xQ={...bQ,...vQ},wQ=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>U(()=>import("./andromeeda-C3khCPGq.js"),[])},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>U(()=>import("./aurora-x-D-2ljcwZ.js"),[])},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>U(()=>import("./ayu-dark-Cv9koXgw.js"),[])},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>U(()=>import("./catppuccin-frappe-CD_QflpE.js"),[])},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>U(()=>import("./catppuccin-latte-DRW-0cLl.js"),[])},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>U(()=>import("./catppuccin-macchiato-C-_shW-Y.js"),[])},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>U(()=>import("./catppuccin-mocha-LGGdnPYs.js"),[])},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>U(()=>import("./dark-plus-C3mMm8J8.js"),[])},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>U(()=>import("./dracula-BzJJZx-M.js"),[])},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>U(()=>import("./dracula-soft-BXkSAIEj.js"),[])},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>U(()=>import("./everforest-dark-BgDCqdQA.js"),[])},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>U(()=>import("./everforest-light-C8M2exoo.js"),[])},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>U(()=>import("./github-dark-DHJKELXO.js"),[])},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>U(()=>import("./github-dark-default-Cuk6v7N8.js"),[])},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>U(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[])},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>U(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[])},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>U(()=>import("./github-light-DAi9KRSo.js"),[])},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>U(()=>import("./github-light-default-D7oLnXFd.js"),[])},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>U(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[])},{id:"houston",displayName:"Houston",type:"dark",import:()=>U(()=>import("./houston-DnULxvSX.js"),[])},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>U(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[])},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>U(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[])},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>U(()=>import("./kanagawa-wave-DWedfzmr.js"),[])},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>U(()=>import("./laserwave-DUszq2jm.js"),[])},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>U(()=>import("./light-plus-B7mTdjB0.js"),[])},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>U(()=>import("./material-theme-D5KoaKCx.js"),[])},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>U(()=>import("./material-theme-darker-BfHTSMKl.js"),[])},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>U(()=>import("./material-theme-lighter-B0m2ddpp.js"),[])},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>U(()=>import("./material-theme-ocean-CyktbL80.js"),[])},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>U(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[])},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>U(()=>import("./min-dark-CafNBF8u.js"),[])},{id:"min-light",displayName:"Min Light",type:"light",import:()=>U(()=>import("./min-light-CTRr51gU.js"),[])},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>U(()=>import("./monokai-D4h5O-jR.js"),[])},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>U(()=>import("./night-owl-C39BiMTA.js"),[])},{id:"nord",displayName:"Nord",type:"dark",import:()=>U(()=>import("./nord-Ddv68eIx.js"),[])},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>U(()=>import("./one-dark-pro-GBQ2dnAY.js"),[])},{id:"one-light",displayName:"One Light",type:"light",import:()=>U(()=>import("./one-light-PoHY5YXO.js"),[])},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>U(()=>import("./plastic-3e1v2bzS.js"),[])},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>U(()=>import("./poimandres-CS3Unz2-.js"),[])},{id:"red",displayName:"Red",type:"dark",import:()=>U(()=>import("./red-bN70gL4F.js"),[])},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>U(()=>import("./rose-pine-CmCqftbK.js"),[])},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>U(()=>import("./rose-pine-dawn-Ds-gbosJ.js"),[])},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>U(()=>import("./rose-pine-moon-CjDtw9vr.js"),[])},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>U(()=>import("./slack-dark-BthQWCQV.js"),[])},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>U(()=>import("./slack-ochin-DqwNpetd.js"),[])},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>U(()=>import("./snazzy-light-Bw305WKR.js"),[])},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>U(()=>import("./solarized-dark-DXbdFlpD.js"),[])},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>U(()=>import("./solarized-light-L9t79GZl.js"),[])},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>U(()=>import("./synthwave-84-CbfX1IO0.js"),[])},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>U(()=>import("./tokyo-night-DBQeEorK.js"),[])},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>U(()=>import("./vesper-BEBZ7ncR.js"),[])},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>U(()=>import("./vitesse-black-Bkuqu6BP.js"),[])},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>U(()=>import("./vitesse-dark-D0r3Knsf.js"),[])},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>U(()=>import("./vitesse-light-CVO1_9PV.js"),[])}],kQ=Object.fromEntries(wQ.map(e=>[e.id,e.import]));let Ao=class extends Error{constructor(t){super(t),this.name="ShikiError"}},hk=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function _Q(){return 2147483648}function SQ(){return typeof performance<"u"?performance.now():Date.now()}const TQ=(e,t)=>e+(t-e%t)%t;async function CQ(e){let t,n;const r={};function i(m){n=m,r.HEAPU8=new Uint8Array(m),r.HEAPU32=new Uint32Array(m)}function s(m,p,b){r.HEAPU8.copyWithin(m,p,p+b)}function a(m){try{return t.grow(m-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function o(m){const p=r.HEAPU8.length;m=m>>>0;const b=_Q();if(m>b)return!1;for(let x=1;x<=4;x*=2){let g=p*(1+.2/x);g=Math.min(g,m+100663296);const y=Math.min(b,TQ(Math.max(m,g),65536));if(a(y))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(m,p,b=1024){const x=p+b;let g=p;for(;m[g]&&!(g>=x);)++g;if(g-p>16&&m.buffer&&l)return l.decode(m.subarray(p,g));let y="";for(;p<g;){let w=m[p++];if(!(w&128)){y+=String.fromCharCode(w);continue}const C=m[p++]&63;if((w&224)===192){y+=String.fromCharCode((w&31)<<6|C);continue}const E=m[p++]&63;if((w&240)===224?w=(w&15)<<12|C<<6|E:w=(w&7)<<18|C<<12|E<<6|m[p++]&63,w<65536)y+=String.fromCharCode(w);else{const S=w-65536;y+=String.fromCharCode(55296|S>>10,56320|S&1023)}}return y}function u(m,p){return m?c(r.HEAPU8,m,p):""}const d={emscripten_get_now:SQ,emscripten_memcpy_big:s,emscripten_resize_heap:o,fd_write:()=>0};async function f(){const p=await e({env:d,wasi_snapshot_preview1:d});t=p.memory,i(t.buffer),Object.assign(r,p),r.UTF8ToString=u}return await f(),r}var EQ=Object.defineProperty,AQ=(e,t,n)=>t in e?EQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nr=(e,t,n)=>(AQ(e,typeof t!="symbol"?t+"":t,n),n);let Pr=null;function MQ(e){throw new hk(e.UTF8ToString(e.getLastOnigError()))}class iy{constructor(t){Nr(this,"utf16Length"),Nr(this,"utf8Length"),Nr(this,"utf16Value"),Nr(this,"utf8Value"),Nr(this,"utf16OffsetToUtf8"),Nr(this,"utf8OffsetToUtf16");const n=t.length,r=iy._utf8ByteLength(t),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const a=i?new Uint32Array(r+1):null;i&&(a[r]=n);const o=new Uint8Array(r);let l=0;for(let c=0;c<n;c++){const u=t.charCodeAt(c);let d=u,f=!1;if(u>=55296&&u<=56319&&c+1<n){const m=t.charCodeAt(c+1);m>=56320&&m<=57343&&(d=(u-55296<<10)+65536|m-56320,f=!0)}i&&(s[c]=l,f&&(s[c+1]=l),d<=127?a[l+0]=c:d<=2047?(a[l+0]=c,a[l+1]=c):d<=65535?(a[l+0]=c,a[l+1]=c,a[l+2]=c):(a[l+0]=c,a[l+1]=c,a[l+2]=c,a[l+3]=c)),d<=127?o[l++]=d:d<=2047?(o[l++]=192|(d&1984)>>>6,o[l++]=128|(d&63)>>>0):d<=65535?(o[l++]=224|(d&61440)>>>12,o[l++]=128|(d&4032)>>>6,o[l++]=128|(d&63)>>>0):(o[l++]=240|(d&1835008)>>>18,o[l++]=128|(d&258048)>>>12,o[l++]=128|(d&4032)>>>6,o[l++]=128|(d&63)>>>0),f&&c++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=o,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=a}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const s=t.charCodeAt(r);let a=s,o=!1;if(s>=55296&&s<=56319&&r+1<i){const l=t.charCodeAt(r+1);l>=56320&&l<=57343&&(a=(s-55296<<10)+65536|l-56320,o=!0)}a<=127?n+=1:a<=2047?n+=2:a<=65535?n+=3:n+=4,o&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const _a=class{constructor(e){if(Nr(this,"id",++_a.LAST_ID),Nr(this,"_onigBinding"),Nr(this,"content"),Nr(this,"utf16Length"),Nr(this,"utf8Length"),Nr(this,"utf16OffsetToUtf8"),Nr(this,"utf8OffsetToUtf16"),Nr(this,"ptr"),!Pr)throw new hk("Must invoke loadWasm first.");this._onigBinding=Pr,this.content=e;const t=new iy(e);this.utf16Length=t.utf16Length,this.utf8Length=t.utf8Length,this.utf16OffsetToUtf8=t.utf16OffsetToUtf8,this.utf8OffsetToUtf16=t.utf8OffsetToUtf16,this.utf8Length<1e4&&!_a._sharedPtrInUse?(_a._sharedPtr||(_a._sharedPtr=Pr.omalloc(1e4)),_a._sharedPtrInUse=!0,Pr.HEAPU8.set(t.utf8Value,_a._sharedPtr),this.ptr=_a._sharedPtr):this.ptr=t.createString(Pr)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===_a._sharedPtr?_a._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};let U0=_a;Nr(U0,"LAST_ID",0);Nr(U0,"_sharedPtr",0);Nr(U0,"_sharedPtrInUse",!1);class NQ{constructor(t){if(Nr(this,"_onigBinding"),Nr(this,"_ptr"),!Pr)throw new hk("Must invoke loadWasm first.");const n=[],r=[];for(let o=0,l=t.length;o<l;o++){const c=new iy(t[o]);n[o]=c.createString(Pr),r[o]=c.utf8Length}const i=Pr.omalloc(4*t.length);Pr.HEAPU32.set(n,i/4);const s=Pr.omalloc(4*t.length);Pr.HEAPU32.set(r,s/4);const a=Pr.createOnigScanner(i,s,t.length);for(let o=0,l=t.length;o<l;o++)Pr.ofree(n[o]);Pr.ofree(s),Pr.ofree(i),a===0&&MQ(Pr),this._onigBinding=Pr,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new U0(t);const s=this._findNextMatchSync(t,n,!1,i);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const s=this._onigBinding,a=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(a===0)return null;const o=s.HEAPU32;let l=a/4;const c=o[l++],u=o[l++],d=[];for(let f=0;f<u;f++){const m=t.convertUtf8OffsetToUtf16(o[l++]),p=t.convertUtf8OffsetToUtf16(o[l++]);d[f]={start:m,end:p,length:p-m}}return{index:c,captureIndices:d}}}function IQ(e){return typeof e.instantiator=="function"}function DQ(e){return typeof e.default=="function"}function RQ(e){return typeof e.data<"u"}function OQ(e){return typeof Response<"u"&&e instanceof Response}function jQ(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 Om;function LQ(e){if(Om)return Om;async function t(){Pr=await CQ(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),IQ(r)?r=await r.instantiator(n):DQ(r)?r=await r.default(n):(RQ(r)&&(r=r.data),OQ(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await BQ(r)(n):r=await zQ(r)(n):jQ(r)?r=await vv(r)(n):r instanceof WebAssembly.Module?r=await vv(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await vv(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Om=t(),Om}function vv(e){return t=>WebAssembly.instantiate(e,t)}function BQ(e){return t=>WebAssembly.instantiateStreaming(e,t)}function zQ(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let PQ;function $Q(){return PQ}async function CI(e){return e&&await LQ(e),{createScanner(t){return new NQ(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new U0(t)}}}function UQ(e){return fk(e)}function fk(e){return Array.isArray(e)?HQ(e):e instanceof RegExp?e:typeof e=="object"?qQ(e):e}function HQ(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=fk(e[n]);return t}function qQ(e){let t={};for(let n in e)t[n]=fk(e[n]);return t}function EI(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function AI(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?AI(e.substring(0,e.length-1)):e.substr(~t+1)}var xv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,jm=class{static hasCaptures(e){return e===null?!1:(xv.lastIndex=0,xv.test(e))}static replaceCaptures(e,t,n){return e.replace(xv,(r,i,s,a)=>{let o=n[parseInt(i||s,10)];if(o){let l=t.substring(o.start,o.end);for(;l[0]===".";)l=l.substring(1);switch(a){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function MI(e,t){return e<t?-1:e>t?1:0}function NI(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 s=MI(e[i],t[i]);if(s!==0)return s}return 0}return n-r}function I7(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 II(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var DI=class{constructor(e){ie(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}},zg=class{constructor(e,t,n){ie(this,"_cachedMatchRoot",new DI(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(GQ(e),t)}static createFromParsedTheme(e,t){return KQ(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=>FQ(e.parent,i.parentScopes));return r?new RI(r.fontStyle,r.foreground,r.background):null}},wv=class Rp{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Rp(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Rp(n,t[r]);return n}push(t){return new Rp(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 FQ(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&&!VQ(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function VQ(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var RI=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function GQ(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,s=t.length;i<s;i++){let a=t[i];if(!a.settings)continue;let o;if(typeof a.scope=="string"){let d=a.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),o=d.split(",")}else Array.isArray(a.scope)?o=a.scope:o=[""];let l=-1;if(typeof a.settings.fontStyle=="string"){l=0;let d=a.settings.fontStyle.split(" ");for(let f=0,m=d.length;f<m;f++)switch(d[f]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof a.settings.foreground=="string"&&I7(a.settings.foreground)&&(c=a.settings.foreground);let u=null;typeof a.settings.background=="string"&&I7(a.settings.background)&&(u=a.settings.background);for(let d=0,f=o.length;d<f;d++){let p=o[d].trim().split(" "),b=p[p.length-1],x=null;p.length>1&&(x=p.slice(0,p.length-1),x.reverse()),n[r++]=new WQ(b,x,i,l,c,u)}}return n}var WQ=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},ko=(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))(ko||{});function KQ(e,t){e.sort((l,c)=>{let u=MI(l.scope,c.scope);return u!==0||(u=NI(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let s=new YQ(t),a=new RI(n,s.getId(r),s.getId(i)),o=new QQ(new e2(0,null,-1,0,0),[]);for(let l=0,c=e.length;l<c;l++){let u=e[l];o.insert(0,u.scope,u.parentScopes,u.fontStyle,s.getId(u.foreground),s.getId(u.background))}return new zg(s,a,o)}var YQ=class{constructor(e){ie(this,"_isFrozen");ie(this,"_lastColorId");ie(this,"_id2color");ie(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)}},XQ=Object.freeze([]),e2=class OI{constructor(t,n,r,i,s){ie(this,"scopeDepth");ie(this,"parentScopes");ie(this,"fontStyle");ie(this,"foreground");ie(this,"background");this.scopeDepth=t,this.parentScopes=n||XQ,this.fontStyle=r,this.foreground=i,this.background=s}clone(){return new OI(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)}},QQ=class t2{constructor(t,n=[],r={}){ie(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 s=n.parentScopes[i].length-t.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,s;if(r===-1?(i=t,s=""):(i=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(t2._cmpBySpecificity),n}insert(t,n,r,i,s,a){if(n===""){this._doInsertHere(t,r,i,s,a);return}let o=n.indexOf("."),l,c;o===-1?(l=n,c=""):(l=n.substring(0,o),c=n.substring(o+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new t2(this._mainRule.clone(),e2.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,i,s,a)}_doInsertHere(t,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(t,r,i,s);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let l=this._rulesWithParentScopes[a];if(NI(l.parentScopes,n)===0){l.acceptOverwrite(t,r,i,s);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new e2(t,n,r,i,s))}},Pd=class Ts{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Ts.getLanguageId(t),r=Ts.getTokenType(t),i=Ts.getFontStyle(t),s=Ts.getForeground(t),a=Ts.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:a})}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,s,a,o){let l=Ts.getLanguageId(t),c=Ts.getTokenType(t),u=Ts.containsBalancedBrackets(t)?1:0,d=Ts.getFontStyle(t),f=Ts.getForeground(t),m=Ts.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),i!==null&&(u=i?1:0),s!==-1&&(d=s),a!==0&&(f=a),o!==0&&(m=o),(l<<0|c<<8|u<<10|d<<11|f<<15|m<<24)>>>0}};function Pg(e,t){const n=[],r=JQ(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=a();if(n.push({matcher:c,priority:l}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const l=s();return c=>!!l&&!l(c)}if(i==="("){i=r.next();const l=o();return i===")"&&(i=r.next()),l}if(D7(i)){const l=[];do l.push(i),i=r.next();while(D7(i));return c=>t(l,c)}return null}function a(){const l=[];let c=s();for(;c;)l.push(c),c=s();return u=>l.every(d=>d(u))}function o(){const l=[];let c=a();for(;c&&(l.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=a()}return u=>l.some(d=>d(u))}}function D7(e){return!!e&&!!e.match(/[\w\.:]+/)}function JQ(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 jI(e){typeof e.dispose=="function"&&e.dispose()}var n0=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ZQ=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},eJ=class{constructor(){ie(this,"_references",[]);ie(this,"_seenReferenceKeys",new Set);ie(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))}},tJ=class{constructor(e,t){ie(this,"seenFullScopeRequests",new Set);ie(this,"seenPartialScopeRequests",new Set);ie(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new n0(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new eJ;for(const n of e)nJ(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof n0){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 nJ(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 s=n.lookup(t);e instanceof n0?Op({baseGrammar:s,selfGrammar:i},r):n2(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const a=n.injections(e.scopeName);if(a)for(const o of a)r.add(new n0(o))}function n2(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];$g([r],t,n)}}function Op(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&$g(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&$g(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function $g(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?EI({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&$g(r.patterns,{...t,repository:i},n);const s=r.include;if(!s)continue;const a=LI(s);switch(a.kind){case 0:Op({...t,selfGrammar:t.baseGrammar},n);break;case 1:Op(t,n);break;case 2:n2(a.ruleName,{...t,repository:i},n);break;case 3:case 4:const o=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(o){const l={baseGrammar:t.baseGrammar,selfGrammar:o,repository:i};a.kind===4?n2(a.ruleName,l,n):Op(l,n)}else a.kind===4?n.add(new ZQ(a.scopeName,a.ruleName)):n.add(new n0(a.scopeName));break}}}var rJ=class{constructor(){ie(this,"kind",0)}},iJ=class{constructor(){ie(this,"kind",1)}},sJ=class{constructor(e){ie(this,"kind",2);this.ruleName=e}},aJ=class{constructor(e){ie(this,"kind",3);this.scopeName=e}},oJ=class{constructor(e,t){ie(this,"kind",4);this.scopeName=e,this.ruleName=t}};function LI(e){if(e==="$base")return new rJ;if(e==="$self")return new iJ;const t=e.indexOf("#");if(t===-1)return new aJ(e);if(t===0)return new sJ(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new oJ(n,r)}}var lJ=/\\(\d+)/,R7=/\\(\d+)/g,cJ=-1,BI=-2;var H0=class{constructor(t,n,r,i){ie(this,"$location");ie(this,"id");ie(this,"_nameIsCapturing");ie(this,"_name");ie(this,"_contentNameIsCapturing");ie(this,"_contentName");this.$location=t,this.id=n,this._name=r||null,this._nameIsCapturing=jm.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=jm.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${AI(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,n){return!this._nameIsCapturing||this._name===null||t===null||n===null?this._name:jm.replaceCaptures(this._name,t,n)}getContentName(t,n){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:jm.replaceCaptures(this._contentName,t,n)}},uJ=class extends H0{constructor(t,n,r,i,s){super(t,n,r,i);ie(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=s}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!")}},dJ=class extends H0{constructor(t,n,r,i,s){super(t,n,r,null);ie(this,"_match");ie(this,"captures");ie(this,"_cachedCompiledPatterns");this._match=new r0(i,this.id),this.captures=s,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 i0,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},O7=class extends H0{constructor(t,n,r,i,s){super(t,n,r,i);ie(this,"hasMissingPatterns");ie(this,"patterns");ie(this,"_cachedCompiledPatterns");this.patterns=s.patterns,this.hasMissingPatterns=s.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 i0,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},r2=class extends H0{constructor(t,n,r,i,s,a,o,l,c,u){super(t,n,r,i);ie(this,"_begin");ie(this,"beginCaptures");ie(this,"_end");ie(this,"endHasBackReferences");ie(this,"endCaptures");ie(this,"applyEndPatternLast");ie(this,"hasMissingPatterns");ie(this,"patterns");ie(this,"_cachedCompiledPatterns");this._begin=new r0(s,this.id),this.beginCaptures=a,this._end=new r0(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=c||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.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 i0;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}},Ug=class extends H0{constructor(t,n,r,i,s,a,o,l,c){super(t,n,r,i);ie(this,"_begin");ie(this,"beginCaptures");ie(this,"whileCaptures");ie(this,"_while");ie(this,"whileHasBackReferences");ie(this,"hasMissingPatterns");ie(this,"patterns");ie(this,"_cachedCompiledPatterns");ie(this,"_cachedCompiledWhilePatterns");this._begin=new r0(s,this.id),this.beginCaptures=a,this.whileCaptures=l,this._while=new r0(o,BI),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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 i0;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 i0,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},zI=class ri{static createCaptureRule(t,n,r,i,s){return t.registerRule(a=>new uJ(n,a,r,i,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new dJ(t.$vscodeTextmateLocation,t.id,t.name,t.match,ri._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=EI({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new O7(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,ri._compilePatterns(s,n,r))}return t.while?new Ug(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ri._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,ri._compileCaptures(t.whileCaptures||t.captures,n,r),ri._compilePatterns(t.patterns,n,r)):new r2(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,ri._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,ri._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,ri._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let s=0;for(const a in t){if(a==="$vscodeTextmateLocation")continue;const o=parseInt(a,10);o>s&&(s=o)}for(let a=0;a<=s;a++)i[a]=null;for(const a in t){if(a==="$vscodeTextmateLocation")continue;const o=parseInt(a,10);let l=0;t[a].patterns&&(l=ri.getCompiledRuleId(t[a],n,r)),i[o]=ri.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s];let l=-1;if(o.include){const c=LI(o.include);switch(c.kind){case 0:case 1:l=ri.getCompiledRuleId(r[o.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=ri.getCompiledRuleId(u,n,r));break;case 3:case 4:const d=c.scopeName,f=c.kind===4?c.ruleName:null,m=n.getExternalGrammar(d,r);if(m)if(f){let p=m.repository[f];p&&(l=ri.getCompiledRuleId(p,n,m.repository))}else l=ri.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else l=ri.getCompiledRuleId(o,n,r);if(l!==-1){const c=n.getRule(l);let u=!1;if((c instanceof O7||c instanceof r2||c instanceof Ug)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;i.push(l)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},r0=class PI{constructor(t,n){ie(this,"source");ie(this,"ruleId");ie(this,"hasAnchor");ie(this,"hasBackReferences");ie(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let i=0,s=[],a=!1;for(let o=0;o<r;o++)if(t.charAt(o)==="\\"&&o+1<r){const c=t.charAt(o+1);c==="z"?(s.push(t.substring(i,o)),s.push("$(?!\\n)(?<!\\n)"),i=o+2):(c==="A"||c==="G")&&(a=!0),o++}this.hasAnchor=a,i===0?this.source=t:(s.push(t.substring(i,r)),this.source=s.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=lJ.test(this.source):this.hasBackReferences=!1}clone(){return new PI(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 R7.lastIndex=0,this.source.replace(R7,(i,s)=>II(r[parseInt(s,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=[],s,a,o,l;for(s=0,a=this.source.length;s<a;s++)o=this.source.charAt(s),t[s]=o,n[s]=o,r[s]=o,i[s]=o,o==="\\"&&s+1<a&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="",n[s+1]="",r[s+1]="A",i[s+1]="A"):l==="G"?(t[s+1]="",n[s+1]="G",r[s+1]="",i[s+1]="G"):(t[s+1]=l,n[s+1]=l,r[s+1]=l,i[s+1]=l),s++);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}},i0=class{constructor(){ie(this,"_items");ie(this,"_hasAnchors");ie(this,"_cached");ie(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 j7(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 j7(e,r,this._items.map(i=>i.ruleId))}},j7=class{constructor(e,t,n){ie(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(`
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},kv=class{constructor(e,t){this.languageId=e,this.tokenType=t}},yo,hJ=(yo=class{constructor(t,n){ie(this,"_defaultAttributes");ie(this,"_embeddedLanguagesMatcher");ie(this,"_getBasicScopeAttributes",new DI(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new kv(n,r)}));this._defaultAttributes=new kv(t,8),this._embeddedLanguagesMatcher=new fJ(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?yo._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(yo.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!")}},ie(yo,"_NULL_SCOPE_METADATA",new kv(0,0)),ie(yo,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),yo),fJ=class{constructor(e){ie(this,"values");ie(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>II(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])}},L7=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function $I(e,t,n,r,i,s,a,o){const l=t.content.length;let c=!1,u=-1;if(a){const m=mJ(e,t,n,r,i,s);i=m.stack,r=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const d=Date.now();for(;!c;){if(o!==0&&Date.now()-d>o)return new L7(i,!0);f()}return new L7(i,!1);function f(){const m=pJ(e,t,n,r,i,u);if(!m){s.produce(i,l),c=!0;return}const p=m.captureIndices,b=m.matchedRuleId,x=p&&p.length>0?p[0].end>r:!1;if(b===cJ){const g=i.getRule(e);s.produce(i,p[0].start),i=i.withContentNameScopesList(i.nameScopesList),ef(e,t,n,i,s,g.endCaptures,p),s.produce(i,p[0].end);const y=i;if(i=i.parent,u=y.getAnchorPos(),!x&&y.getEnterPos()===r){i=y,s.produce(i,l),c=!0;return}}else{const g=e.getRule(b);s.produce(i,p[0].start);const y=i,w=g.getName(t.content,p),C=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(b,r,u,p[0].end===l,null,C,C),g instanceof r2){const E=g;ef(e,t,n,i,s,E.beginCaptures,p),s.produce(i,p[0].end),u=p[0].end;const S=E.getContentName(t.content,p),T=C.pushAttributed(S,e);if(i=i.withContentNameScopesList(T),E.endHasBackReferences&&(i=i.withEndRule(E.getEndWithResolvedBackReferences(t.content,p))),!x&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(g instanceof Ug){const E=g;ef(e,t,n,i,s,E.beginCaptures,p),s.produce(i,p[0].end),u=p[0].end;const S=E.getContentName(t.content,p),T=C.pushAttributed(S,e);if(i=i.withContentNameScopesList(T),E.whileHasBackReferences&&(i=i.withEndRule(E.getWhileWithResolvedBackReferences(t.content,p))),!x&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(ef(e,t,n,i,s,g.captures,p),s.produce(i,p[0].end),i=i.pop(),!x){i=i.safePop(),s.produce(i,l),c=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function mJ(e,t,n,r,i,s){let a=i.beginRuleCapturedEOL?0:-1;const o=[];for(let l=i;l;l=l.pop()){const c=l.getRule(e);c instanceof Ug&&o.push({rule:c,stack:l})}for(let l=o.pop();l;l=o.pop()){const{ruleScanner:c,findOptions:u}=bJ(l.rule,e,l.stack.endRule,n,r===a),d=c.findNextMatchSync(t,r,u);if(d){if(d.ruleId!==BI){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),ef(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),a=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:a,isFirstLine:n}}function pJ(e,t,n,r,i,s){const a=gJ(e,t,n,r,i,s),o=e.getInjections();if(o.length===0)return a;const l=yJ(o,e,t,n,r,i,s);if(!l)return a;if(!a)return l;const c=a.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:a}function gJ(e,t,n,r,i,s){const a=i.getRule(e),{ruleScanner:o,findOptions:l}=UI(a,e,i.endRule,n,r===s),c=o.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function yJ(e,t,n,r,i,s,a){let o=Number.MAX_VALUE,l=null,c,u=0;const d=s.contentNameScopesList.getScopeNames();for(let f=0,m=e.length;f<m;f++){const p=e[f];if(!p.matcher(d))continue;const b=t.getRule(p.ruleId),{ruleScanner:x,findOptions:g}=UI(b,t,null,r,i===a),y=x.findNextMatchSync(n,i,g);if(!y)continue;const w=y.captureIndices[0].start;if(!(w>=o)&&(o=w,l=y.captureIndices,c=y.ruleId,u=p.priority,o===i))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function UI(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function bJ(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ef(e,t,n,r,i,s,a){if(s.length===0)return;const o=t.content,l=Math.min(s.length,a.length),c=[],u=a[0].end;for(let d=0;d<l;d++){const f=s[d];if(f===null)continue;const m=a[d];if(m.length===0)continue;if(m.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=m.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,m.start):i.produce(r,m.start),f.retokenizeCapturedWithRuleId){const b=f.getName(o,a),x=r.contentNameScopesList.pushAttributed(b,e),g=f.getContentName(o,a),y=x.pushAttributed(g,e),w=r.push(f.retokenizeCapturedWithRuleId,m.start,-1,!1,null,x,y),C=e.createOnigString(o.substring(0,m.end));$I(e,C,n&&m.start===0,m.start,w,i,!1,0),jI(C);continue}const p=f.getName(o,a);if(p!==null){const x=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(p,e);c.push(new vJ(x,m.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var vJ=class{constructor(e,t){ie(this,"scopes");ie(this,"endPos");this.scopes=e,this.endPos=t}};function xJ(e,t,n,r,i,s,a,o){return new kJ(e,t,n,r,i,s,a,o)}function B7(e,t,n,r,i){const s=Pg(t,Hg),a=zI.getCompiledRuleId(n,r,i.repository);for(const o of s)e.push({debugSelector:t,matcher:o.matcher,ruleId:a,grammar:i,priority:o.priority})}function Hg(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(wJ(t[i],r))return n=i+1,!0;return!1})}function wJ(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 kJ=class{constructor(e,t,n,r,i,s,a,o){ie(this,"_rootId");ie(this,"_lastRuleId");ie(this,"_ruleId2desc");ie(this,"_includedGrammars");ie(this,"_grammarRepository");ie(this,"_grammar");ie(this,"_injections");ie(this,"_basicScopeAttributesProvider");ie(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=o,this._basicScopeAttributesProvider=new hJ(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=z7(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const c=Pg(l,Hg);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:i[l]})}}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 a in i)B7(t,a,i[a],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(a=>{const o=this.getExternalGrammar(a);if(o){const l=o.injectionSelector;l&&B7(t,l,o,this,o)}})}return t.sort((i,s)=>i.priority-s.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]=z7(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=zI.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===i2.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=Pd.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null);let m;f?m=Af.createRootAndLookUpScopeName(f,d,this):m=Af.createRoot("unknown",d),t=new i2(null,this._rootId,-1,-1,!1,null,m,m)}else i=!1,t.reset();e=e+`
`;const s=this.createOnigString(e),a=s.content.length,o=new SJ(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=$I(this,s,i,0,t,o,!0,r);return jI(s),{lineLength:a,lineTokens:o,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function z7(e,t){return e=UQ(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 Af=class Sa{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 s of n)i=wv.push(i,s.scopeNames),r=new Sa(r,i,s.encodedTokenAttributes);return r}static createRoot(t,n){return new Sa(null,new wv(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new wv(null,t),a=r.themeProvider.themeMatch(s),o=Sa.mergeAttributes(n,i,a);return new Sa(null,s,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Sa.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,s=0,a=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,a=r.backgroundId),Pd.set(t,n.languageId,n.tokenType,null,i,s,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Sa._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const s of r)i=Sa._pushAttributed(i,s,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),a=r.themeProvider.themeMatch(s),o=Sa.mergeAttributes(t.tokenAttributes,i,a);return new Sa(t,s,o)}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}},Ds,i2=(Ds=class{constructor(t,n,r,i,s,a,o,l){ie(this,"_stackElementBrand");ie(this,"_enterPos");ie(this,"_anchorPos");ie(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(t){return t===null?!1:Ds._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Af.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(){Ds._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,a,o){return new Ds(this,t,n,r,i,s,a,o)}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 Ds(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=Af.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Ds(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Af.fromExtension(r,n.contentNameScopesList))}},ie(Ds,"NULL",new Ds(null,0,0,0,!1,null,null,null)),Ds),_J=class{constructor(e,t){ie(this,"balancedBracketScopes");ie(this,"unbalancedBracketScopes");ie(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Pg(n,Hg).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Pg(n,Hg).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}},SJ=class{constructor(e,t,n,r){ie(this,"_emitBinaryTokens");ie(this,"_lineText");ie(this,"_tokens");ie(this,"_binaryTokens");ie(this,"_lastTokenEndIndex");ie(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,s=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=(e==null?void 0:e.getScopeNames())??[];for(const o of this._tokenTypeOverrides)o.matcher(a)&&(i=Pd.set(i,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(a))}if(s&&(i=Pd.set(i,0,8,s,-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}},TJ=class{constructor(e,t){ie(this,"_grammars",new Map);ie(this,"_rawGrammars",new Map);ie(this,"_injectionGrammars",new Map);ie(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 s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,xJ(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},CJ=class{constructor(t){ie(this,"_options");ie(this,"_syncRegistry");ie(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new TJ(zg.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(zg.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 _J(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,s){const a=new tJ(this._syncRegistry,t);for(;a.Q.length>0;)a.Q.map(o=>this._loadSingleGrammar(o.scopeName)),a.processQueue();return this._grammarForScopeName(t,n,r,i,s)}_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,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,s)}},s2=i2.NULL;const EJ=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],AJ=/["&'<>`]/g,MJ=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,NJ=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,IJ=/[|\\{}()[\]^$+*?.]/g,P7=new WeakMap;function DJ(e,t){if(e=e.replace(t.subset?RJ(t.subset):AJ,r),t.subset||t.escapeOnly)return e;return e.replace(MJ,n).replace(NJ,r);function n(i,s,a){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,a.charCodeAt(s+2),t)}function r(i,s,a){return t.format(i.charCodeAt(0),a.charCodeAt(s+1),t)}}function RJ(e){let t=P7.get(e);return t||(t=OJ(e),P7.set(e,t)),t}function OJ(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(IJ,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const jJ=/[\dA-Fa-f]/;function LJ(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!jJ.test(String.fromCharCode(t))?r:r+";"}const BJ=/\d/;function zJ(e,t,n){const r="&#"+String(e);return n&&t&&!BJ.test(String.fromCharCode(t))?r:r+";"}const PJ=["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"],_v={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:"€"},$J=["cent","copy","divide","gt","lt","not","para","times"],HI={}.hasOwnProperty,a2={};let Lm;for(Lm in _v)HI.call(_v,Lm)&&(a2[_v[Lm]]=Lm);const UJ=/[^\dA-Za-z]/;function HJ(e,t,n,r){const i=String.fromCharCode(e);if(HI.call(a2,i)){const s=a2[i],a="&"+s;return n&&PJ.includes(s)&&!$J.includes(s)&&(!r||t&&t!==61&&UJ.test(String.fromCharCode(t)))?a:a+";"}return""}function qJ(e,t,n){let r=LJ(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=HJ(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=zJ(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function gd(e,t){return DJ(e,Object.assign({format:qJ},t))}const FJ=/^>|^->|<!--|-->|--!>|<!-$/g,VJ=[">"],GJ=["<",">"];function WJ(e,t,n,r){return r.settings.bogusComments?"<?"+gd(e.value,Object.assign({},r.settings.characterReferences,{subset:VJ}))+">":"<!--"+e.value.replace(FJ,i)+"-->";function i(s){return gd(s,Object.assign({},r.settings.characterReferences,{subset:GJ}))}}function KJ(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const Lr=FI(1),qI=FI(-1),YJ=[];function FI(e){return t;function t(n,r,i){const s=n?n.children:YJ;let a=(r||0)+e,o=s[a];if(!i)for(;o&&P1(o);)a+=e,o=s[a];return o}}const XJ={}.hasOwnProperty;function VI(e){return t;function t(n,r,i){return XJ.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const mk=VI({body:JJ,caption:Sv,colgroup:Sv,dd:nZ,dt:tZ,head:Sv,html:QJ,li:eZ,optgroup:rZ,option:iZ,p:ZJ,rp:$7,rt:$7,tbody:aZ,td:U7,tfoot:oZ,th:U7,thead:sZ,tr:lZ});function Sv(e,t,n){const r=Lr(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&P1(r.value.charAt(0)))}function QJ(e,t,n){const r=Lr(n,t);return!r||r.type!=="comment"}function JJ(e,t,n){const r=Lr(n,t);return!r||r.type!=="comment"}function ZJ(e,t,n){const r=Lr(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 eZ(e,t,n){const r=Lr(n,t);return!r||r.type==="element"&&r.tagName==="li"}function tZ(e,t,n){const r=Lr(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function nZ(e,t,n){const r=Lr(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function $7(e,t,n){const r=Lr(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function rZ(e,t,n){const r=Lr(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function iZ(e,t,n){const r=Lr(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function sZ(e,t,n){const r=Lr(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function aZ(e,t,n){const r=Lr(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function oZ(e,t,n){return!Lr(n,t)}function lZ(e,t,n){const r=Lr(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function U7(e,t,n){const r=Lr(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const cZ=VI({body:hZ,colgroup:fZ,head:dZ,html:uZ,tbody:mZ});function uZ(e){const t=Lr(e,-1);return!t||t.type!=="comment"}function dZ(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 hZ(e){const t=Lr(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&P1(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function fZ(e,t,n){const r=qI(n,t),i=Lr(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&mk(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function mZ(e,t,n){const r=qI(n,t),i=Lr(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&mk(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Bm={name:[[`	
\f\r &/=>`.split(""),`	
\f\r "&'/=>\``.split("")],[`\0	
\f\r "&'/<=>`.split(""),`\0	
\f\r "&'/<=>\``.split("")]],unquoted:[[`	
\f\r &>`.split(""),`\0	
\f\r "&'<=>\``.split("")],[`\0	
\f\r "&'<=>\``.split(""),`\0	
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function pZ(e,t,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let a=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const o=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=ah);const c=gZ(r,e.properties),u=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,u&&(a=!1),(c||!s||!cZ(e,t,n))&&(o.push("<",e.tagName,c?" "+c:""),a&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(u),!a&&(!s||!mk(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function gZ(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=yZ(e,i,t[i]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function yZ(e,t,n){const r=M3(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let a=e.quote,o;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 l=gd(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Bm.name[i][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?oM:pM)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(o=gd(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Bm.unquoted[i][s]}))),o!==n&&(e.settings.quoteSmart&&Ng(n,a)>Ng(n,e.alternative)&&(a=e.alternative),o=a+gd(n,Object.assign({},e.settings.characterReferences,{subset:(a==="'"?Bm.single:Bm.double)[i][s],attribute:!0}))+a),l+(o&&"="+o))}const bZ=["<","&"];function GI(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:gd(e.value,Object.assign({},r.settings.characterReferences,{subset:bZ}))}function vZ(e,t,n,r){return r.settings.allowDangerousHtml?e.value:GI(e,t,n,r)}function xZ(e,t,n,r){return r.all(e)}const wZ=gW("type",{invalid:kZ,unknown:_Z,handlers:{comment:WJ,doctype:KJ,element:pZ,raw:vZ,root:xZ,text:GI}});function kZ(e){throw new Error("Expected node, not `"+e+"`")}function _Z(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const SZ={},TZ={},CZ=[];function EZ(e,t){const n=SZ,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:AZ,all:MZ,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||EJ,characterReferences:n.characterReferences||TZ,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ah:N3,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function AZ(e,t,n){return wZ(e,t,n,this)}function MZ(e){const t=[],n=e&&e.children||CZ;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function NZ(e){return Array.isArray(e)?e:[e]}function sy(e,t=!1){var s;const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let a=0;a<n.length;a+=2){const o=t?n[a]+(n[a+1]||""):n[a];i.push([o,r]),r+=n[a].length,r+=((s=n[a+1])==null?void 0:s.length)||0}return i}function pk(e){return!e||["plaintext","txt","text","plain"].includes(e)}function WI(e){return e==="ansi"||pk(e)}function gk(e){return e==="none"}function KI(e){return gk(e)}function YI(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 IZ(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 DZ(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 s=n.filter(a=>i.offset<a&&a<i.offset+i.content.length).map(a=>a-i.offset).sort((a,o)=>a-o);return s.length?IZ(i,s):i})):e}async function XI(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function qg(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function Nc(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function QI(e){const t={};return e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle&&(e.fontStyle&ko.Italic&&(t["font-style"]="italic"),e.fontStyle&ko.Bold&&(t["font-weight"]="bold"),e.fontStyle&ko.Underline&&(t["text-decoration"]="underline")),t}function RZ(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function OZ(e){const t=sy(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let s=i,a=0;for(const o of t){if(s<o.length)break;s-=o.length,a++}return{line:a,character:s}}function r(i,s){let a=0;for(let o=0;o<i;o++)a+=t[o].length;return a+=s,a}return{lines:t,indexToPos:n,posToIndex:r}}class ki extends Error{constructor(t){super(t),this.name="ShikiError"}}const JI=new WeakMap;function ay(e,t){JI.set(e,t)}function s0(e){return JI.get(e)}class hh{constructor(...t){ie(this,"_stacks",{});ie(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 hh(Object.fromEntries(NZ(n).map(r=>[r,s2])),t)}getInternalStack(t=this.theme){return this._stacks[t]}get scopes(){return H7(this._stacks[this.theme])}getScopes(t=this.theme){return H7(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.scopes}}}function H7(e){const t=[],n=new Set;function r(i){var a;if(n.has(i))return;n.add(i);const s=(a=i==null?void 0:i.nameScopesList)==null?void 0:a.scopeName;s&&t.push(s),i.parent&&r(i.parent)}return r(e),t}function jZ(e,t){if(!(e instanceof hh))throw new ki("Invalid grammar state");return e.getInternalStack(t)}function LZ(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(a){if(typeof a=="number"){if(a<0||a>n.source.length)throw new ki(`Invalid decoration offset: ${a}. Code length: ${n.source.length}`);return{...i.indexToPos(a),offset:a}}else{const o=i.lines[a.line];if(o===void 0)throw new ki(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${i.lines.length}`);if(a.character<0||a.character>o.length)throw new ki(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${o.length}`);return{...a,offset:i.posToIndex(a.line,a.character)}}};const i=OZ(n.source),s=(n.options.decorations||[]).map(a=>({...a,start:r(a.start),end:r(a.end)}));BZ(s),e.set(n.meta,{decorations:s,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var a;if(!((a=this.options.decorations)!=null&&a.length))return;const i=t(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return DZ(n,i)},code(n){var u;if(!((u=this.options.decorations)!=null&&u.length))return;const r=t(this),i=Array.from(n.children).filter(d=>d.type==="element"&&d.tagName==="span");if(i.length!==r.converter.lines.length)throw new ki(`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 s(d,f,m,p){const b=i[d];let x="",g=-1,y=-1;if(f===0&&(g=0),m===0&&(y=0),m===Number.POSITIVE_INFINITY&&(y=b.children.length),g===-1||y===-1)for(let C=0;C<b.children.length;C++)x+=ZI(b.children[C]),g===-1&&x.length===f&&(g=C+1),y===-1&&x.length===m&&(y=C+1);if(g===-1)throw new ki(`Failed to find start index for decoration ${JSON.stringify(p.start)}`);if(y===-1)throw new ki(`Failed to find end index for decoration ${JSON.stringify(p.end)}`);const w=b.children.slice(g,y);if(!p.alwaysWrap&&w.length===b.children.length)o(b,p,"line");else if(!p.alwaysWrap&&w.length===1&&w[0].type==="element")o(w[0],p,"token");else{const C={type:"element",tagName:"span",properties:{},children:w};o(C,p,"wrapper"),b.children.splice(g,w.length,C)}}function a(d,f){i[d]=o(i[d],f,"line")}function o(d,f,m){var x;const p=f.properties||{},b=f.transform||(g=>g);return d.tagName=f.tagName||"span",d.properties={...d.properties,...p,class:d.properties.class},(x=f.properties)!=null&&x.class&&YI(d,f.properties.class),d=b(d,m)||d,d}const l=[],c=r.decorations.sort((d,f)=>f.start.offset-d.start.offset);for(const d of c){const{start:f,end:m}=d;if(f.line===m.line)s(f.line,f.character,m.character,d);else if(f.line<m.line){s(f.line,f.character,Number.POSITIVE_INFINITY,d);for(let p=f.line+1;p<m.line;p++)l.unshift(()=>a(p,d));s(m.line,0,m.character,d)}}l.forEach(d=>d())}}}function BZ(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new ki(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],s=n.start.offset<i.start.offset&&i.start.offset<n.end.offset,a=n.start.offset<i.end.offset&&i.end.offset<n.end.offset,o=i.start.offset<n.start.offset&&n.start.offset<i.end.offset,l=i.start.offset<n.end.offset&&n.end.offset<i.end.offset;if(s||a||o||l){if(a&&a||o&&l)continue;throw new ki(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function ZI(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(ZI).join(""):""}const zZ=[LZ()];function Fg(e){return[...e.transformers||[],...zZ]}var Ic=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Tv={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function PZ(e,t){const n=e.indexOf("\x1B[",t);if(n!==-1){const r=e.indexOf("m",n);return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function q7(e,t){let n=1;const r=e[t+n++];let i;if(r==="2"){const s=[e[t+n++],e[t+n++],e[t+n]].map(a=>Number.parseInt(a));s.length===3&&!s.some(a=>Number.isNaN(a))&&(i={type:"rgb",rgb:s})}else if(r==="5"){const s=Number.parseInt(e[t+n]);Number.isNaN(s)||(i={type:"table",index:Number(s)})}return[n,i]}function $Z(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],i=Number.parseInt(r);if(!Number.isNaN(i))if(i===0)t.push({type:"resetAll"});else if(i<=9)Tv[i]&&t.push({type:"setDecoration",value:Tv[i]});else if(i<=29){const s=Tv[i-20];s&&t.push({type:"resetDecoration",value:s})}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Ic[i-30]}});else if(i===38){const[s,a]=q7(e,n);a&&t.push({type:"setForegroundColor",value:a}),n+=s}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Ic[i-40]}});else if(i===48){const[s,a]=q7(e,n);a&&t.push({type:"setBackgroundColor",value:a}),n+=s}else i===49?t.push({type:"resetBackgroundColor"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Ic[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Ic[i-100+8]}})}return t}function UZ(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const a=PZ(r,s),o=a.sequence?r.substring(s,a.startPosition):r.substring(s);if(o.length>0&&i.push({value:o,foreground:e,background:t,decorations:new Set(n)}),a.sequence){const l=$Z(a.sequence);for(const c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=a.position}while(s<r.length);return i}}}var HZ={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 qZ(e=HZ){function t(o){return e[o]}function n(o){return`#${o.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let c=0;c<Ic.length;c++)r.push(t(Ic[c]));let o=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let d=0;d<6;d++)r.push(n([o[c],o[u],o[d]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function s(o){return i()[o]}function a(o){switch(o.type){case"named":return t(o.name);case"rgb":return n(o.rgb);case"table":return s(o.index)}}return{value:a}}function FZ(e,t,n){const r=qg(e,n),i=sy(t),s=qZ(Object.fromEntries(Ic.map(o=>{var l;return[o,(l=e.colors)==null?void 0:l[`terminal.ansi${o[0].toUpperCase()}${o.substring(1)}`]]}))),a=UZ();return i.map(o=>a.parse(o[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?s.value(l.background):e.bg,u=l.foreground?s.value(l.foreground):e.fg):(c=l.foreground?s.value(l.foreground):e.fg,u=l.background?s.value(l.background):void 0),c=Nc(c,r),u=Nc(u,r),l.decorations.has("dim")&&(c=VZ(c));let d=ko.None;return l.decorations.has("bold")&&(d|=ko.Bold),l.decorations.has("italic")&&(d|=ko.Italic),l.decorations.has("underline")&&(d|=ko.Underline),{content:l.value,offset:o[1],color:c,bgColor:u,fontStyle:d}}))}function VZ(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t)if(t[3]){const r=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${r}`}else return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(r=>`${r}${r}`).join("")}80`;const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function yk(e,t,n={}){const{lang:r="text",theme:i=e.getLoadedThemes()[0]}=n;if(pk(r)||gk(i))return sy(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:s,colorMap:a}=e.setTheme(i);if(r==="ansi")return FZ(s,t,n);const o=e.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Ao(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Ao(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return WZ(t,o,s,a,n)}function GZ(...e){if(e.length===2)return s0(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(pk(i)||gk(s))throw new Ao("Plain language does not have grammar state");if(i==="ansi")throw new Ao("ANSI language does not have grammar state");const{theme:a,colorMap:o}=t.setTheme(s),l=t.getLanguage(i);return new hh(Vg(n,l,a,o,r).stateStack,l.name,a.name)}function WZ(e,t,n,r,i){const s=Vg(e,t,n,r,i),a=new hh(Vg(e,t,n,r,i).stateStack,t.name,n.name);return ay(s.tokens,a),s.tokens}function Vg(e,t,n,r,i){const s=qg(n,i),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:o=500}=i,l=sy(e);let c=i.grammarState?jZ(i.grammarState,n.name)??s2:i.grammarContextCode!=null?Vg(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:s2,u=[];const d=[];for(let f=0,m=l.length;f<m;f++){const[p,b]=l[f];if(p===""){u=[],d.push([]);continue}if(a>0&&p.length>=a){u=[],d.push([{content:p,offset:b,color:"",fontStyle:0}]);continue}let x,g,y;i.includeExplanation&&(x=t.tokenizeLine(p,c),g=x.tokens,y=0);const w=t.tokenizeLine2(p,c,o),C=w.tokens.length/2;for(let E=0;E<C;E++){const S=w.tokens[2*E],T=E+1<C?w.tokens[2*E+2]:p.length;if(S===T)continue;const j=w.tokens[2*E+1],z=Nc(r[Pd.getForeground(j)],s),R=Pd.getFontStyle(j),D={content:p.substring(S,T),offset:b+S,color:z,fontStyle:R};if(i.includeExplanation){const N=[];if(i.includeExplanation!=="scopeName")for(const P of n.settings){let J;switch(typeof P.scope){case"string":J=P.scope.split(/,/).map(q=>q.trim());break;case"object":J=P.scope;break;default:continue}N.push({settings:P,selectors:J.map(q=>q.split(/ /))})}D.explanation=[];let B=0;for(;S+B<T;){const P=g[y],J=p.substring(P.startIndex,P.endIndex);B+=J.length,D.explanation.push({content:J,scopes:i.includeExplanation==="scopeName"?KZ(P.scopes):YZ(N,P.scopes)}),y+=1}}u.push(D)}d.push(u),u=[],c=w.ruleStack}return{tokens:d,stateStack:c}}function KZ(e){return e.map(t=>({scopeName:t}))}function YZ(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];n[r]={scopeName:s,themeMatches:QZ(e,s,t.slice(0,r))}}return n}function F7(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function XZ(e,t,n){if(!F7(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)F7(e[r],n[i])&&(r-=1),i-=1;return r===-1}function QZ(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const a of i)if(XZ(a,t,n)){r.push(s);break}return r}function eD(e,t,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const c=yk(e,t,{...n,theme:l.theme}),u=s0(c),d=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:c,state:u,theme:d}}),s=JZ(...i.map(l=>l.tokens)),a=s[0].map((l,c)=>l.map((u,d)=>{const f={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=u.explanation),s.forEach((m,p)=>{const{content:b,explanation:x,offset:g,...y}=m[c][d];f.variants[r[p].color]=y}),f})),o=i[0].state?new hh(Object.fromEntries(i.map(l=>{var c;return[l.theme,(c=l.state)==null?void 0:c.getInternalStack(l.theme)]})),i[0].state.lang):void 0;return o&&ay(a,o),a}function JZ(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(l=>l[r]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));const a=i.map(()=>0),o=i.map(l=>l[0]);for(;o.every(l=>l);){const l=Math.min(...o.map(c=>c.content.length));for(let c=0;c<n;c++){const u=o[c];u.content.length===l?(s[c].push(u),a[c]+=1,o[c]=i[c][a[c]]):(s[c].push({...u,content:u.content.slice(0,l)}),o[c]={...u,content:u.content.slice(l),offset:u.offset+l})}}}return t}function Gg(e,t,n){let r,i,s,a,o,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-"}=n,d=Object.entries(n.themes).filter(x=>x[1]).map(x=>({color:x[0],theme:x[1]})).sort((x,g)=>x.color===c?-1:g.color===c?1:0);if(d.length===0)throw new Ao("`themes` option must not be empty");const f=eD(e,t,n);if(l=s0(f),c&&!d.find(x=>x.color===c))throw new Ao(`\`themes\` option must contain the defaultColor key \`${c}\``);const m=d.map(x=>e.getTheme(x.theme)),p=d.map(x=>x.color);s=f.map(x=>x.map(g=>ZZ(g,p,u,c))),l&&ay(s,l);const b=d.map(x=>qg(x.theme,n));i=d.map((x,g)=>(g===0&&c?"":`${u+x.color}:`)+(Nc(m[g].fg,b[g])||"inherit")).join(";"),r=d.map((x,g)=>(g===0&&c?"":`${u+x.color}-bg:`)+(Nc(m[g].bg,b[g])||"inherit")).join(";"),a=`shiki-themes ${m.map(x=>x.name).join(" ")}`,o=c?void 0:[i,r].join(";")}else if("theme"in n){const c=qg(n.theme,n);s=yk(e,t,n);const u=e.getTheme(n.theme);r=Nc(u.bg,c),i=Nc(u.fg,c),a=u.name,l=s0(s)}else throw new Ao("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:a,rootStyle:o,grammarState:l}}function ZZ(e,t,n,r){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(l=>QI(e.variants[l])),a=new Set(s.flatMap(l=>Object.keys(l))),o={};return s.forEach((l,c)=>{for(const u of a){const d=l[u]||"inherit";if(c===0&&r)o[u]=d;else{const f=u==="color"?"":u==="background-color"?"-bg":`-${u}`,m=n+t[c]+(u==="color"?"":f);o[m]=d}}}),i.htmlStyle=o,i}function Wg(e,t,n,r={meta:{},options:n,codeToHast:(i,s)=>Wg(e,i,s),codeToTokens:(i,s)=>Gg(e,i,s)}){var m,p;let i=t;for(const b of Fg(n))i=((m=b.preprocess)==null?void 0:m.call(r,i,n))||i;let{tokens:s,fg:a,bg:o,themeName:l,rootStyle:c,grammarState:u}=Gg(e,i,n);const{mergeWhitespaces:d=!0}=n;d===!0?s=tee(s):d==="never"&&(s=nee(s));const f={...r,get source(){return i}};for(const b of Fg(n))s=((p=b.tokens)==null?void 0:p.call(f,s))||s;return eee(s,{...n,fg:a,bg:o,themeName:l,rootStyle:c},f,u)}function eee(e,t,n,r=s0(e)){var p,b,x;const i=Fg(t),s=[],a={type:"root",children:[]},{structure:o="classic",tabindex:l="0"}=t;let c={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...l!==!1&&l!=null?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([g])=>!g.startsWith("_")))},children:[]},u={type:"element",tagName:"code",properties:{},children:s};const d=[],f={...n,structure:o,addClassToHast:YI,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return a},get pre(){return c},get code(){return u},get lines(){return d}};if(e.forEach((g,y)=>{var E,S;y&&(o==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):o==="classic"&&s.push({type:"text",value:`
`}));let w={type:"element",tagName:"span",properties:{class:"line"},children:[]},C=0;for(const T of g){let j={type:"element",tagName:"span",properties:{...T.htmlAttrs},children:[{type:"text",value:T.content}]};T.htmlStyle;const z=RZ(T.htmlStyle||QI(T));z&&(j.properties.style=z);for(const R of i)j=((E=R==null?void 0:R.span)==null?void 0:E.call(f,j,y+1,C,w,T))||j;o==="inline"?a.children.push(j):o==="classic"&&w.children.push(j),C+=T.content.length}if(o==="classic"){for(const T of i)w=((S=T==null?void 0:T.line)==null?void 0:S.call(f,w,y+1))||w;d.push(w),s.push(w)}}),o==="classic"){for(const g of i)u=((p=g==null?void 0:g.code)==null?void 0:p.call(f,u))||u;c.children.push(u);for(const g of i)c=((b=g==null?void 0:g.pre)==null?void 0:b.call(f,c))||c;a.children.push(c)}let m=a;for(const g of i)m=((x=g==null?void 0:g.root)==null?void 0:x.call(f,m))||m;return r&&ay(m,r),m}function tee(e){return e.map(t=>{const n=[];let r="",i=0;return t.forEach((s,a)=>{const l=!(s.fontStyle&&s.fontStyle&ko.Underline);l&&s.content.match(/^\s+$/)&&t[a+1]?(i||(i=s.offset),r+=s.content):r?(l?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=0,r=""):n.push(s)}),n})}function nee(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,s,a]=r;if(!i&&!a)return n;const o=[{...n,offset:n.offset+i.length,content:s}];return i&&o.unshift({content:i,offset:n.offset}),a&&o.push({content:a,offset:n.offset+i.length+s.length}),o}))}function ree(e,t,n){var s;const r={meta:{},options:n,codeToHast:(a,o)=>Wg(e,a,o),codeToTokens:(a,o)=>Gg(e,a,o)};let i=EZ(Wg(e,t,n,r));for(const a of Fg(n))i=((s=a.postprocess)==null?void 0:s.call(r,i,n))||i;return i}const V7={light:"#333333",dark:"#bbbbbb"},G7={light:"#fffffe",dark:"#1e1e1e"},W7="__shiki_resolved";function bk(e){var o,l,c,u,d;if(e!=null&&e[W7])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 f=t.settings?t.settings.find(m=>!m.name&&!m.scope):void 0;(o=f==null?void 0:f.settings)!=null&&o.foreground&&(r=f.settings.foreground),(l=f==null?void 0:f.settings)!=null&&l.background&&(n=f.settings.background),!r&&((c=t==null?void 0:t.colors)!=null&&c["editor.foreground"])&&(r=t.colors["editor.foreground"]),!n&&((u=t==null?void 0:t.colors)!=null&&u["editor.background"])&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?V7.light:V7.dark),n||(n=t.type==="light"?G7.light:G7.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 s=new Map;function a(f){var p;if(s.has(f))return s.get(f);i+=1;const m=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(p=t.colorReplacements)!=null&&p[`#${m}`]?a(f):(s.set(f,m),m)}t.settings=t.settings.map(f=>{var x,g;const m=((x=f.settings)==null?void 0:x.foreground)&&!f.settings.foreground.startsWith("#"),p=((g=f.settings)==null?void 0:g.background)&&!f.settings.background.startsWith("#");if(!m&&!p)return f;const b={...f,settings:{...f.settings}};if(m){const y=a(f.settings.foreground);t.colorReplacements[y]=f.settings.foreground,b.settings.foreground=y}if(p){const y=a(f.settings.background);t.colorReplacements[y]=f.settings.background,b.settings.background=y}return b});for(const f of Object.keys(t.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!((d=t.colors[f])!=null&&d.startsWith("#"))){const m=a(t.colors[f]);t.colorReplacements[m]=t.colors[f],t.colors[f]=m}return Object.defineProperty(t,W7,{enumerable:!1,writable:!1,value:!0}),t}async function tD(e){return Array.from(new Set((await Promise.all(e.filter(t=>!WI(t)).map(async t=>await XI(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function nD(e){return(await Promise.all(e.map(async n=>KI(n)?null:bk(await XI(n))))).filter(n=>!!n)}class iee extends CJ{constructor(n,r,i,s={}){super(n);ie(this,"_resolvedThemes",new Map);ie(this,"_resolvedGrammars",new Map);ie(this,"_langMap",new Map);ie(this,"_langGraph",new Map);ie(this,"_textmateThemeCache",new WeakMap);ie(this,"_loadedThemesCache",null);ie(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=i,this._alias=s,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=bk(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=zg.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){if(this._alias[n]){const r=new Set([n]);for(;this._alias[n];){if(n=this._alias[n],r.has(n))throw new ki(`Circular alias \`${Array.from(r).join(" -> ")} -> ${n}\``);r.add(n)}}return this._resolvedGrammars.get(n)}loadLanguage(n){var a,o,l,c;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(u=>{var d;return(d=u.embeddedLangsLazy)==null?void 0:d.includes(n.name)}));this._resolver.addLanguage(n);const i={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const s=this.loadGrammarWithConfiguration(n.scopeName,1,i);if(s.name=n.name,this._resolvedGrammars.set(n.name,s),n.aliases&&n.aliases.forEach(u=>{this._alias[u]=n.name}),this._loadedLanguagesCache=null,r.size)for(const u of r)this._resolvedGrammars.delete(u.name),this._loadedLanguagesCache=null,(o=(a=this._syncRegistry)==null?void 0:a._injectionGrammars)==null||o.delete(u.scopeName),(c=(l=this._syncRegistry)==null?void 0:l._grammars)==null||c.delete(u.scopeName),this.loadLanguage(this._langMap.get(u.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const s of n)this.resolveEmbeddedLanguages(s);const r=Array.from(this._langGraph.entries()),i=r.filter(([s,a])=>!a);if(i.length){const s=r.filter(([a,o])=>{var l;return o&&((l=o.embeddedLangs)==null?void 0:l.some(c=>i.map(([u])=>u).includes(c)))}).filter(a=>!i.includes(a));throw new ki(`Missing languages ${i.map(([a])=>`\`${a}\``).join(", ")}, required by ${s.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[s,a]of r)this._resolver.addLanguage(a);for(const[s,a]of r)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){if(this._langMap.set(n.name,n),this._langGraph.set(n.name,n),n.embeddedLangs)for(const r of n.embeddedLangs)this._langGraph.set(r,this._langMap.get(r))}}class see{constructor(t,n){ie(this,"_langs",new Map);ie(this,"_scopeToLang",new Map);ie(this,"_injections",new Map);ie(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 s=n.slice(0,i).join(".");r=[...r,...this._injections.get(s)||[]]}return r}}let Lh=0;function aee(e){Lh+=1,e.warnings!==!1&&Lh>=10&&Lh%10===0&&console.warn(`[Shiki] ${Lh} 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 ki("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(bk),i=new see(e.engine,n),s=new iee(i,r,n,e.langAlias);let a;function o(y){x();const w=s.getGrammar(typeof y=="string"?y:y.name);if(!w)throw new ki(`Language \`${y}\` not found, you may need to load it first`);return w}function l(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};x();const w=s.getTheme(y);if(!w)throw new ki(`Theme \`${y}\` not found, you may need to load it first`);return w}function c(y){x();const w=l(y);a!==y&&(s.setTheme(w),a=y);const C=s.getColorMap();return{theme:w,colorMap:C}}function u(){return x(),s.getLoadedThemes()}function d(){return x(),s.getLoadedLanguages()}function f(...y){x(),s.loadLanguages(y.flat(1))}async function m(...y){return f(await tD(y))}function p(...y){x();for(const w of y.flat(1))s.loadTheme(w)}async function b(...y){return x(),p(await nD(y))}function x(){if(t)throw new ki("Shiki instance has been disposed")}function g(){t||(t=!0,s.dispose(),Lh-=1)}return{setTheme:c,getTheme:l,getLanguage:o,getLoadedThemes:u,getLoadedLanguages:d,loadLanguage:m,loadLanguageSync:f,loadTheme:b,loadThemeSync:p,dispose:g,[Symbol.dispose]:g}}async function oee(e={}){e.loadWasm;const[t,n,r]=await Promise.all([nD(e.themes||[]),tD(e.langs||[]),e.engine||CI(e.loadWasm||$Q())]);return aee({...e,themes:t,langs:n,engine:r})}async function lee(e={}){const t=await oee(e);return{getLastGrammarState:(...n)=>GZ(t,...n),codeToTokensBase:(n,r)=>yk(t,n,r),codeToTokensWithThemes:(n,r)=>eD(t,n,r),codeToTokens:(n,r)=>Gg(t,n,r),codeToHast:(n,r)=>Wg(t,n,r),codeToHtml:(n,r)=>ree(t,n,r),...t,getInternalContext:()=>t}}function cee(e,t,n){let r,i,s;{const o=e;r=o.langs,i=o.themes,s=o.engine}async function a(o){function l(m){if(typeof m=="string"){if(WI(m))return[];const p=r[m];if(!p)throw new Ao(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return p}return m}function c(m){if(KI(m))return"none";if(typeof m=="string"){const p=i[m];if(!p)throw new Ao(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return p}return m}const u=(o.themes??[]).map(m=>c(m)),d=(o.langs??[]).map(m=>l(m)),f=await lee({engine:o.engine??s(),...o,themes:u,langs:d});return{...f,loadLanguage(...m){return f.loadLanguage(...m.map(l))},loadTheme(...m){return f.loadTheme(...m.map(c))}}}return a}function uee(e){let t;async function n(r={}){if(t){const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}else return t=e({...r,themes:r.themes||[],langs:r.langs||[]}),t}return n}function dee(e){const t=uee(e);return{getSingletonHighlighter(n){return t(n)},async codeToHtml(n,r){return(await t({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)})).codeToHtml(n,r)},async codeToHast(n,r){return(await t({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)})).codeToHast(n,r)},async codeToTokens(n,r){return(await t({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)})).codeToTokens(n,r)},async codeToTokensBase(n,r){return(await t({langs:[r.lang],themes:[r.theme]})).codeToTokensBase(n,r)},async codeToTokensWithThemes(n,r){return(await t({langs:[r.lang],themes:Object.values(r.themes).filter(Boolean)})).codeToTokensWithThemes(n,r)},async getLastGrammarState(n,r){return(await t({langs:[r.lang],themes:[r.theme]})).getLastGrammarState(n,r)}}}const hee=cee({langs:xQ,themes:kQ,engine:()=>CI(U(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{codeToHtml:fee}=dee(hee),zm=["en","zh-CN"],vk={"about.auth":"Auth","about.baseUrl":"Base URL","about.fastModel":"Fast Model","about.memoryUsage":"Memory Usage","about.model":"Model","about.noProxy":"no proxy","about.noSandbox":"no sandbox","about.platform":"OS","about.proxy":"Proxy","about.qwenCode":"Qwen Code","about.runtime":"Runtime","about.sandbox":"Sandbox","about.sessionId":"Session ID","about.title":"Status","agent.back":"Back","agent.builtInBadge":"(built-in)","agent.action.delete":"Delete Agent","agent.action.edit":"Edit Agent","agent.action.view":"View Agent","agent.chooseAction":e=>`Choose action for ${(e==null?void 0:e.name)??""}`,"agent.chooseActionTitle":"Choose Action","agent.colorLabel":"Color: ","agent.colorUpdated":e=>`Updated color for ${(e==null?void 0:e.name)??""}`,"agent.create":"Create a new subagent","agent.create.button":"Create Agent","agent.create.colorSelection":"Choose Background Color","agent.create.confirm":"Confirm and Save","agent.create.desc":"Create a new subagent","agent.create.descPlaceholder":"What does this agent do?","agent.create.describeAgent":"Describe Your Subagent","agent.create.description":"Description","agent.create.editAgain":"Edit","agent.create.enterDescription":"Enter Description","agent.create.enterName":"Enter Subagent Name","agent.create.enterPrompt":"Enter System Prompt","agent.create.generateFailed":e=>`Failed to generate subagent: ${(e==null?void 0:e.error)??"Unknown error"}`,"agent.create.generatingConfig":"Generating subagent configuration...","agent.create.loading":"Creating...","agent.create.location":"Choose Location","agent.create.method":"Choose Generation Method","agent.create.method.manual":"Manual Creation","agent.create.method.qwen":"Generate with Qwen Code","agent.create.method.qwen.recommended":"Generate with Qwen Code (Recommended)","agent.create.method.qwen.desc":"LLM generates name, prompt, and description","agent.create.name":"Name","agent.create.namePlaceholder":"my-agent","agent.create.nameHelp":"Enter a clear, unique name for this subagent.","agent.create.project":"Project","agent.create.project.cli":"Project-level (.qwen/agents/)","agent.create.project.desc":"Create a project-level subagent","agent.create.prompt":"System prompt","agent.create.promptPlaceholder":"You are a specialized agent that...","agent.create.promptPlaceholder.cli":"e.g., You are an expert code reviewer...","agent.create.promptHelp":"Write the system prompt that defines this subagent's behavior. Be comprehensive for best results.","agent.create.preview":"Preview","agent.create.qwenHint":"Describe what this subagent should do and when it should be used. (Be comprehensive for best results)","agent.create.qwenPlaceholder":"> e.g., Expert code reviewer that reviews code based on best practices...","agent.create.required":"Name, description, and system prompt are required.","agent.create.save":"Save Agent","agent.create.scope":"Choose where to save the subagent","agent.create.manualDescHelp":"Describe when and how this subagent should be used.","agent.create.manualDescPlaceholder":"e.g., Reviews code for best practices and potential bugs.","agent.create.toolsSelection":"Select Tools","agent.create.tools.all":"All Tools","agent.create.tools.allDefault":"All Tools (Default)","agent.create.tools.allInfo":"All tools selected, including MCP tools","agent.create.tools.allInfoFallback":"All tools selected, including MCP tools","agent.create.tools.editLabel":"• Edit tools:","agent.create.tools.executionLabel":"• Execution tools:","agent.create.tools.none":"(none)","agent.create.tools.readEdit":"Read & Edit Tools","agent.create.tools.readEditExecute":"Read & Edit & Execution Tools","agent.create.tools.readOnlyLabel":"• Read-only tools:","agent.create.tools.readOnly":"Read-only Tools","agent.create.tools.selected":"Selected tools:","agent.create.user":"User","agent.create.user.cli":"User-level (~/.qwen/agents/)","agent.create.user.desc":"Create a user-level subagent","agent.createFirstHint":"Use '/agents create' to create your first subagent.","agent.created":e=>`Created ${(e==null?void 0:e.name)??""}`,"agent.delete":"Delete","agent.delete.confirm":e=>`Are you sure you want to delete "${(e==null?void 0:e.name)??""}"?`,"agent.delete.loading":"Deleting...","agent.delete.no":"No","agent.delete.title":e=>`Delete ${(e==null?void 0:e.name)??""}`,"agent.delete.yes":"Yes, delete","agent.deleted":e=>`Deleted ${(e==null?void 0:e.name)??""}`,"agent.edit":"Edit","agent.edit.color":"Edit Color","agent.edit.tools":"Edit Tools","agent.editColorTitle":e=>`Edit Color: ${(e==null?void 0:e.name)??""}`,"agent.editTitle":e=>`Edit ${(e==null?void 0:e.name)??""}`,"agent.empty":"No subagents found.","agent.footer.back":"Esc to go back","agent.footer.cliBack":"Enter to select, ↑↓ to navigate, Esc to go back","agent.footer.cliSelect":"Enter to select, ↑↓ to navigate, Esc to close","agent.footer.close":"Esc to close","agent.footer.deleteConfirm":"Enter to confirm, Esc to cancel","agent.footer.enterNext":"Press Enter to continue, Esc to go back","agent.footer.generating":"Esc to cancel","agent.footer.createLocation":"Press Enter to continue, ↑↓ to navigate, Esc to cancel","agent.footer.createContinue":"Press Enter to continue, ↑↓ to navigate, Esc to go back","agent.footer.final":"Press Enter to save, e to save and edit, Esc to go back","agent.footer.nav":"↑↓ navigate · Enter select · Esc back","agent.footer.navBack":"↑↓ navigate · Enter select · Esc back","agent.footer.navSelect":"↑↓ navigate · Enter select · Esc close","agent.footer.viewerBack":"Esc to go back","agent.filePathLabel":"File Path: ","agent.label":"Agent","agent.location":"Location","agent.level.builtin":"Built-in","agent.level.extension":"Extension","agent.level.project":"Project","agent.level.user":"User","agent.manage":"Manage","agent.manage.desc":"Manage existing subagents","agent.modelLabel":"Model: ","agent.overriddenBadge":"(overridden by project level agent)","agent.readonly":"This agent is read-only.","agent.select":"Select an agent.","agent.selectAction":"Select an action","agent.descriptionLabel":"Description:","agent.systemPromptLabel":"System Prompt:","agent.step":e=>`Step ${(e==null?void 0:e.n)??""}`,"agent.tools":"Tools","agent.toolsLabel":"Tools: ","agent.toolsUpdated":e=>`Updated tools for ${(e==null?void 0:e.name)??""}`,"agent.usingCount":e=>`Using: ${(e==null?void 0:e.count)??0} agents`,"agent.view":"View","agents.closed":"Agents panel closed.","agents.title":"Agents","subagent.toggleStream":"Toggle agent stream details","toast.dismiss":"Dismiss notification","toast.dismissShort":"Dismiss","insight.ready":"Insight report generated successfully!","request.cancelled":"Request cancelled.","approval.execQuestion":e=>`Allow execution of: '${(e==null?void 0:e.tool)??""}'?`,"approval.changeQuestion":"Apply this change?","approval.launchAgentQuestion":"Launch this agent?","approval.option.allowOnce":"Yes, allow once","approval.option.rejectOnce":"No, suggest changes (esc)","approval.option.allowAllEdits":"Allow All Edits","approval.option.allowAlwaysProject":"Always allow in this project","approval.option.allowAlwaysUser":"Always allow for this user","common.back":"back","common.cancel":"cancel","common.close":"close","common.current":"current","common.disabled":"disabled","common.enabled":"enabled","common.enterSelect":"Enter to select","common.invalid":"invalid","common.loading":"Loading...","common.navigate":"↑↓ to navigate","common.refresh":"refresh","common.search":"Search","common.valid":"valid","common.clients":e=>`${(e==null?void 0:e.count)??0} clients`,"agent.count":e=>`${(e==null?void 0:e.count)??0} agents`,"askUser.footer":"↑/↓: Navigate | ←/→: Switch tabs | Enter: Select | Esc: Cancel","askUser.footerMulti":"↑/↓: Navigate | Space: Toggle | ←/→: Switch tabs | Enter: Confirm | Esc: Cancel","askUser.submit":"Submit","askUser.submitAnswers":"Submit answers","askUser.cancel":"Cancel","askUser.confirmTitle":"Your answers:","askUser.confirmPrompt":"Ready to submit your answers?","askUser.multiHint":"multiple choice","askUser.typePlaceholder":"Type something...","askUser.title":e=>`Ask user ${(e==null?void 0:e.count)??0} question${Number((e==null?void 0:e.count)??0)===1?"":"s"} ←`,"copy.failedFallback":"Failed to copy to the clipboard","copy.inlineLatexMissing":"No matching inline LaTeX expression found in the last AI output.","copy.latexMissing":"No matching LaTeX block found in the last AI output.","copy.noOutput":"No output in history","copy.noText":"Last AI output contains no text to copy.","copy.codeMissing":"No matching code block found in the last AI output.","copy.outputCopied":"Last output copied to the clipboard","copy.toClipboard":e=>`${(e==null?void 0:e.label)??"Selection"} copied to the clipboard`,"code.copy":"Copy","code.copied":"Copied!","mermaid.rendering":"Rendering diagram...","mermaid.viewCode":"</>","mermaid.viewDiagram":"⊞","contextUsage.active":"active","contextUsage.autocompactBuffer":"Autocompact buffer","contextUsage.bodyLoaded":"body loaded","contextUsage.builtinTools":"Built-in tools","contextUsage.contextWindow":"Context window","contextUsage.detailHint":"Run /context detail for per-item breakdown.","contextUsage.estimatedOverhead":"Estimated pre-conversation overhead","contextUsage.free":"Free","contextUsage.memoryFiles":"Memory files","contextUsage.messages":"Messages","contextUsage.mcpTools":"MCP tools","contextUsage.model":"Model","contextUsage.noApiResponse":"No API response yet. Send a message to see actual usage.","contextUsage.overLimit":"Context exceeds limit! Use /compress or /clear to reduce.","contextUsage.skills":"Skills","contextUsage.systemPrompt":"System prompt","contextUsage.title":"Context Usage","contextUsage.tokens":"tokens","contextUsage.usageByCategory":"Usage by category","contextUsage.used":"Used","delete.cannotCurrent":"Cannot delete the current active session.","delete.deleted":"Session deleted.","delete.deletedCount":e=>`${(e==null?void 0:e.count)??0} session(s) deleted.`,"delete.deleting":"Deleting...","delete.failed":e=>`Failed to delete session.${e!=null&&e.reason?` ${e.reason}`:""}`,"delete.footer":"↑↓ navigate · Space select · Enter delete · Esc cancel","delete.noMatch":e=>`No session matching "${(e==null?void 0:e.query)??""}"`,"delete.none":"No sessions to delete","delete.allFailed":e=>`Failed to delete ${(e==null?void 0:e.count)??0} session(s): ${(e==null?void 0:e.reason)??"unknown error"}`,"delete.nonRemoved":"No sessions were deleted.","delete.notFound":"Session not found — it may have been deleted already.","delete.partialFail":e=>`${(e==null?void 0:e.removed)??0} deleted, ${(e==null?void 0:e.failed)??0} failed: ${(e==null?void 0:e.detail)??"unknown error"}`,"delete.matches":e=>`${(e==null?void 0:e.count)??0} matches`,"delete.pressSearch":"Press / to search; Space to select; Enter to delete","delete.selected":e=>`${(e==null?void 0:e.count)??0} selected`,"delete.title":"Delete Session","time.justNow":"just now","time.minutesAgo":e=>`${(e==null?void 0:e.count)??0} min ago`,"time.hoursAgo":e=>`${(e==null?void 0:e.count)??0}h ago`,"time.daysAgo":e=>`${(e==null?void 0:e.count)??0}d ago`,"dialog.footer.close":"Esc to close","dialog.footer.confirmCancel":"Enter to confirm · Esc to cancel","release.cannotCurrent":"Cannot release the current active session.","release.released":"Session released successfully.","release.failed":e=>`Failed to release session.${e!=null&&e.reason?` ${e.reason}`:""}`,"release.footer":"↑↓ to navigate · Enter to release · Esc to cancel","release.inactive":"Only active live sessions can be released.","release.inactiveBadge":"inactive","release.noMatch":e=>`No session matching "${(e==null?void 0:e.query)??""}"`,"release.none":"No live sessions to release","release.pressSearch":"Press / to search; Enter releases the selected live session","release.releasing":"Releasing...","release.title":"Release Session","dialog.footer.menu":"Esc to menu","dialog.footer.mcpServers":"↑↓ to navigate · Enter details · r refresh · Esc close","dialog.footer.mcpSelect":"↑↓ to navigate · Enter select · Esc back","dialog.footer.modelFast":"↑↓ to navigate · / to search · c for custom · Enter to set fast model · Esc to cancel","dialog.footer.navSelectCancel":"↑↓ to navigate · Enter to select · Esc to cancel","dialog.footer.navSelectClose":"↑↓ to navigate · Enter to select · Esc to close","dialog.footer.navSelectMenu":"↑↓ to navigate · Enter to select · Esc to menu","dialog.footer.navOpenClose":"↑↓ to navigate · Enter to open · Esc to close","dialog.footer.navOpenMenu":"↑↓ to navigate · Enter to open · Esc to menu","dialog.footer.back":"Esc to go back","dialog.footer.backClose":"Esc to close","dialog.footer.saveClose":"↑↓ switch fields · ⌘/Ctrl+Enter to save · Esc to close","dialog.footer.saveMenu":"↑↓ switch fields · ⌘/Ctrl+Enter to save · Esc to menu","dialog.footer.search":"Type to search · Enter to commit · Esc to clear","dialog.footer.select":"Enter to select","editor.escClearHint":"Press Esc again to clear.","editor.hintCommands":"commands","editor.hintFiles":"files","editor.hintNext":"next","editor.hintPrev":"previous","editor.hintSearch":"search","editor.noHistory":"No matching history","editor.placeholder":"Type a message or @ file path","editor.processing":"Processing. New messages will be queued.","editor.searchHint":"ctrl+r next · tab accept · enter send · esc cancel","editor.searchLabel":"reverse-i-search:","editor.searchPlaceholder":"type to search...","error.unsupportedTheme":"Unsupported theme. Use /theme light or /theme dark.","queue.cleared":"Queued messages cleared","queue.footer":"Press ↑ to edit queued messages · Esc to clear queue","queue.imageCount":e=>`(+${(e==null?void 0:e.count)??0} images)`,"queue.more":e=>`... (+${(e==null?void 0:e.count)??0} more)`,"help.builtIn":"Built-in commands","help.commandCount":e=>`${(e==null?void 0:e.count)??0} commands`,"help.commandMeta.builtIn":"built-in","help.commandMeta.custom":"custom","help.commandMeta.subcommands":e=>`${(e==null?void 0:e.count)??0} subcommands`,"help.commandsIntro":"Browse built-in commands:","help.customGroup":"Custom, skills, plugins, MCP","help.customIntro":"Browse custom, skill, plugin, and MCP commands:","help.empty":"No commands are currently available.","help.emptyCustom":"No custom commands are currently available.","help.footer":"Tab/Shift+Tab to switch tabs · ↑/↓ or PgUp/PgDn to scroll · Esc to close","help.intro":"Qwen Code understands your codebase, makes edits with your permission, and executes commands right from your terminal.","help.section.shortcuts":"Shortcuts","help.shortcut.addContext":"Add files or folders as context","help.shortcut.altWords":"Jump through words","help.shortcut.clear":"Clear the screen","help.shortcut.commandMenu":"Open command menu","help.shortcut.completion":"Accept completion or switch help tabs","help.shortcut.history":"Cycle prompt history or scroll lists","help.shortcut.searchHistory":"Search prompt history","help.shortcut.newline":"Insert a newline","help.shortcut.pasteImages":"Paste images","help.shortcut.shell":"Run shell commands","help.shortcut.togglePanel":"Toggle this panel","help.shortcut.retry":"Retry last request","help.shortcut.compact":"Toggle compact mode","retry.hint":"Press Ctrl+Y to retry or click to retry","retry.none":"No failed request to retry.","branch.failed":"Failed to branch session.","branch.success":e=>`Copied session. New session name: "${(e==null?void 0:e.name)??""}". Switched to the new session.`,"fork.empty":"Please provide a directive. Usage: /fork <directive>","fork.failed":e=>`Failed to launch fork: ${(e==null?void 0:e.reason)??""}`,"fork.notStarted":"Background agent was not launched.","fork.started":e=>`Started background agent: "${(e==null?void 0:e.name)??""}". Track it in background tasks.`,"command.hidden":"This command is not available.","help.shortcut.approvals":"Cycle approval modes","help.shortcut.cancel":"Close dialogs or cancel operation","bug.failed":"Failed to load system info for bug report.","bug.popupBlocked":"Popup blocked — please allow popups and try again.","bug.submitted":"Bug report opened in a new tab.","clear.blocked":"Cannot clear while streaming — cancel first (Esc).","error.unknown":"Unknown error","shell.command":"Shell Command","compact.enabled":"Compact mode enabled","compact.disabled":"Compact mode disabled","compact.hint":"Press Ctrl+O to show full tool output","compact.saveFailed":"Failed to save compact mode","help.subcommands":"subcommands","help.tab.commands":"commands","help.tab.custom":"custom-commands","help.tab.general":"general","help.title":"Help","slash.category.custom":"Custom commands","slash.category.skill":"Skill commands","slash.category.system":"System commands","language.changed":e=>`UI language changed to ${(e==null?void 0:e.language)??""}`,"language.current":e=>`Current UI language: ${(e==null?void 0:e.language)??""}`,"language.invalid":"Invalid language. Available: en, zh-CN","language.options":"Available options:","language.set":"Set UI language","language.usage":"Usage: /language ui [en|zh-CN]","local.agents":"Manage subagents","local.approvalMode":"Change approval mode","local.auth":"Connect an LLM provider","auth.title":"Connect a Provider","auth.step.protocol":"Protocol","auth.step.baseUrl":"Base URL","auth.step.apiKey":"API Key","auth.step.models":"Model IDs","auth.step.advanced":"Advanced Config","auth.stepCount":e=>`Step ${(e==null?void 0:e.step)??""}/${(e==null?void 0:e.total)??""}`,"auth.apiKeyRequired":"API key cannot be empty.","auth.baseUrlInvalid":"Base URL must start with http:// or https://.","auth.baseUrlPrompt":"Enter the API endpoint for this protocol.","auth.baseUrlRequired":"Base URL cannot be empty.","auth.documentation":"Documentation","auth.modelsRequired":"Model IDs cannot be empty.","auth.review":"Review","auth.reviewText":"The following JSON will be saved to settings.json:","auth.saving":"Saving...","auth.termsTitle":"Terms of Services and Privacy Notice","auth.continue":"Continue","auth.footer.back":"Enter to select, ↑↓ to navigate, Esc to go back","auth.footer.close":"Enter to select, ↑↓ to navigate, Esc to close","auth.footer.input":"Enter to submit, Esc to go back","auth.footer.save":"Enter to save, Esc to go back","auth.footer.advanced":"↑↓ to navigate, Space to toggle, Enter to continue, Esc to go back","auth.modelsPrompt":e=>`Enter model IDs separated by commas. Examples: ${(e==null?void 0:e.modelIds)??""}`,"auth.advanced.prompt":"Optional: configure advanced generation settings.","auth.advanced.thinking":"Enable thinking","auth.advanced.thinkingDesc":"Allows the model to perform extended reasoning before responding.","auth.advanced.modality":"Enable modality","auth.advanced.modalityDesc":"Enables multimodal input capabilities (image, video, etc.).","auth.advanced.modalityImage":"Image","auth.advanced.modalityVideo":"Video","auth.advanced.modalityAudio":"Audio","auth.advanced.modalityPdf":"PDF","auth.advanced.contextWindow":"Context window","auth.advanced.contextDesc":"Max input tokens (leave empty to auto-detect from model name).","auth.advanced.contextPlaceholder":"Context window (optional)","local.btw":"Ask a quick side question without affecting the main conversation. Usage: /btw <your question>","btw.empty":"Please provide a question. Usage: /btw <your question>","btw.emptyAnswer":"No response received.","btw.failed":"Failed to answer btw question","btw.answering":"+ Answering...","btw.shortcuts.pending":"Press Escape, Ctrl+C, or Ctrl+D to cancel","btw.shortcuts.done":"Press Space, Enter, or Escape to dismiss","local.clear":"Start a new session with empty context; previous session stays on disk (resumable with /resume)","local.context":'Show context window usage breakdown. Use "/context detail" for per-item breakdown.',"local.copy":"Copy last output or snippet","local.delete":"Delete a session permanently","local.release":"Release a live session","local.branch":"Copy the current conversation into a new session","local.fork":"Start a background agent from this conversation","local.help":"Show help and commands","local.language":"Change UI language","local.mcp":"Manage MCP servers","local.memory":"Manage memory","local.model":"Switch model or set fast model","local.new":"Start a new conversation","local.plan":"Enter Plan mode","local.goal":"Set a goal and keep working until it is met","local.recap":"Generate a session recap","recap.loading":"Generating recap...","recap.empty":"Not enough conversation context for a recap yet.","recap.failed":"Failed to generate recap","local.rename":"Rename current session","rename.empty":"Please enter a session name, for example /rename project debugging, or use /rename --auto.","rename.success":e=>`Session renamed to ${(e==null?void 0:e.name)??""}`,"local.reset":"Reset current conversation","local.resume":"Resume a previous session","local.skills":"View available skills","local.stats":"Show session statistics","local.tasks":"View background tasks","local.status":"Show version info","local.theme":"Change theme","local.settings":"View and edit settings","local.extensions":"Manage extensions. Usage: /extensions manage|install <source>","extensions.label":"extension","extensions.action.failed":e=>`Extension action failed${e!=null&&e.name?` for "${e.name}"`:e!=null&&e.source?` from "${e.source}"`:""}: ${(e==null?void 0:e.error)??"Unknown error"}`,"extensions.commands.refreshFailed":"Failed to refresh extension commands.","extensions.install.failed":e=>`Failed to install extension${e!=null&&e.source?` from "${e.source}"`:""}: ${(e==null?void 0:e.error)??"Unknown error"}`,"extensions.manage.agents":"Agents:","extensions.manage.checkingUpdates":"Checking for updates...","extensions.manage.commands":"Commands:","extensions.manage.contextFiles":"Context files:","extensions.manage.count":e=>`${(e==null?void 0:e.count)??0} extensions installed`,"extensions.manage.detailsTitle":"Extension Details","extensions.manage.disable":"Disable Extension","extensions.manage.disabled":e=>`Extension "${(e==null?void 0:e.name)??"extension"}" disabled.`,"extensions.manage.empty":"No extensions installed.","extensions.manage.enable":"Enable Extension","extensions.manage.enabled":e=>`Extension "${(e==null?void 0:e.name)??"extension"}" enabled.`,"extensions.manage.footer.back":"Esc to go back","extensions.manage.footer.confirm":"Enter confirm · Esc cancel","extensions.manage.footer.list":"↑↓ to navigate · Enter select · r refresh · Esc close","extensions.manage.footer.select":"↑↓ to navigate · Enter select · Esc back","extensions.manage.loading":"Loading extensions...","extensions.manage.mcpServers":"MCP servers:","extensions.manage.name":"Name:","extensions.manage.notUpdatable":"not updatable","extensions.manage.path":"Path:","extensions.manage.queued":e=>`Extension action queued for "${(e==null?void 0:e.name)??"extension"}".`,"extensions.manage.refreshed":e=>`Extensions refreshed in ${(e==null?void 0:e.refreshed)??0} session(s), ${(e==null?void 0:e.failed)??0} failed.`,"extensions.manage.settings":"Settings:","extensions.manage.skills":"Skills:","extensions.manage.source":"Source:","extensions.manage.status":"Status:","extensions.manage.status.disabled":"disabled","extensions.manage.status.enabled":"enabled","extensions.manage.title":"Manage Extensions","extensions.manage.unknownUpdate":"unknown","extensions.manage.uninstalled":e=>`Extension "${(e==null?void 0:e.name)??"extension"}" uninstalled.`,"extensions.manage.uninstallAction":"Uninstall Extension","extensions.manage.uninstallConfirm":e=>`Uninstall extension "${(e==null?void 0:e.name)??"extension"}"?`,"extensions.manage.upToDate":"up to date","extensions.manage.update":"Update Extension","extensions.manage.updateAvailable":"update available","extensions.manage.updateError":"update check failed","extensions.manage.updated":e=>`Extension "${(e==null?void 0:e.name)??"extension"}" updated.`,"extensions.manage.updatedWithVersion":e=>`Extension "${(e==null?void 0:e.name)??"extension"}" updated to v${(e==null?void 0:e.version)??""}.`,"extensions.manage.version":"Version:","extensions.manage.viewDetails":"View Details","extensions.install.installed":e=>`Extension "${(e==null?void 0:e.name)??"extension"}" installed.`,"extensions.install.installedWithVersion":e=>`Extension "${(e==null?void 0:e.name)??"extension"}" v${(e==null?void 0:e.version)??""} installed.`,"extensions.install.missingOptionValue":e=>`Missing value for ${(e==null?void 0:e.option)??"option"}`,"extensions.install.requestFailed":"Failed to install extension","extensions.install.started":e=>`Installing extension from "${(e==null?void 0:e.source)??""}"...`,"extensions.install.unknownOption":e=>`Unknown option ${(e==null?void 0:e.option)??""}`,"extensions.install.usage":"Usage: /extensions manage|install <source>","extensions.install.waitForSession":"Wait for the session to connect before installing an extension.","extensions.install.waitForTurn":"Wait for the current turn to finish before installing an extension.","local.tools":"List available tools. Usage: /tools [desc]","loadWarning.commands":"Failed to load command list; slash commands may be incomplete.","loadWarning.context":"Failed to load session context; current mode may be inaccurate.","loadWarning.models":"Failed to load model list; some model details may be unavailable.","mcp.action.auth":"Authenticate","mcp.action.authHint":"Not exposed by daemon yet","mcp.action.authMessage":"Daemon serve does not expose MCP authentication yet.","mcp.action.clearAuth":"Clear Authentication","mcp.action.disable":"Disable","mcp.action.done":e=>`${(e==null?void 0:e.action)??"Action"} complete.`,"mcp.action.enable":"Enable","mcp.action.enableMessage":"Daemon serve does not expose MCP enable/disable yet.","mcp.action.failed":e=>`Failed: ${(e==null?void 0:e.error)??""}`,"mcp.action.running":e=>`${(e==null?void 0:e.action)??"Action"}...`,"mcp.action.reauth":"Re-authenticate","mcp.annotation.destructive":"destructive","mcp.annotation.idempotent":"idempotent","mcp.annotation.openWorld":"open-world","mcp.annotation.readOnly":"read-only","mcp.annotations":"Annotations","mcp.oauth.server":"Server","mcp.oauth.starting":e=>`Starting OAuth authentication for MCP server '${(e==null?void 0:e.name)??""}'...`,"mcp.oauth.title":"OAuth Authentication","mcp.clientBudget":e=>`${(e==null?void 0:e.count)??0}/${(e==null?void 0:e.budget)??0} clients · ${(e==null?void 0:e.mode)??"off"}`,"mcp.command":"Command","mcp.description":"Description:","mcp.action.reconnect":"Reconnect","mcp.action.restart":"Restart","mcp.action.tools":"View tools","mcp.action.toolsHint":"Enter to inspect","mcp.empty":"No MCP servers configured.","mcp.emptyTools":"No tools discovered.","mcp.inputSchema":"Input schema","mcp.loadingStatus":"Loading MCP status...","mcp.loadingTools":"Loading tools...","mcp.name":"Name","mcp.noDescription":"No description","mcp.noSchema":"No input schema.","mcp.serverTool":"Server tool","mcp.servers":e=>`${(e==null?void 0:e.count)??0} servers`,"mcp.configuredServers":"Configured MCP servers:","mcp.fromExtension":e=>`(from ${(e==null?void 0:e.name)??""})`,"mcp.extensionMcp":"Extension MCP","mcp.invalidReason":e=>`invalid: ${(e==null?void 0:e.reason)??""}`,"mcp.invalidReasonLabel":"Reason:","mcp.invalidToolHelp":"Tools must have both name and description to be used by the LLM.","mcp.invalidToolWarning":"Warning: This tool cannot be called by the LLM","mcp.manageServers":"Manage MCP servers","mcp.parameters":"Parameters:","mcp.required":" required","mcp.scrollPosition":e=>`${(e==null?void 0:e.current)??0}/${(e==null?void 0:e.total)??0}`,"mcp.shortcut.back":"Esc to back","mcp.shortcut.close":"Esc to close","mcp.shortcut.selectBack":"↑↓ to navigate · Enter to select · Esc to back","mcp.shortcut.selectClose":"↑↓ to navigate · Enter to select · Esc to close","mcp.settings":"Settings","mcp.extension":e=>`Extension: ${(e==null?void 0:e.name)??""}`,"mcp.starting":e=>`⏳ MCP servers are starting up (${(e==null?void 0:e.count)??0} initializing)...`,"mcp.startingNote":"Note: First startup may take longer. Tool availability will update automatically.","mcp.restartSkipped":e=>`Skipped ${(e==null?void 0:e.name)??""}: ${(e==null?void 0:e.reason)??""}`,"mcp.restarted":e=>`Restarted ${(e==null?void 0:e.name)??""} in ${(e==null?void 0:e.duration)??0}ms`,"mcp.restartEntries":e=>`Restarted ${(e==null?void 0:e.restarted)??0}/${(e==null?void 0:e.total)??0} ${(e==null?void 0:e.name)??""} entries${e!=null&&e.failedReasons?` (failed: ${e.failedReasons})`:""}`,"mcp.source":"Source","mcp.source.extension":"Extension","mcp.source.project":"Workspace Settings","mcp.source.user":"User Settings","mcp.status":"Status","mcp.status.blocked":"Blocked","mcp.status.connected":"connected","mcp.status.connecting":"connecting","mcp.status.disconnected":"disconnected","mcp.status.disconnectedTitle":"Disconnected","mcp.status.disabled":"disabled","mcp.status.ready":"Ready","mcp.status.starting":"Starting... (first startup may take longer)","mcp.status.unknown":"unknown","mcp.tipDesc":"to show server and tool descriptions","mcp.tipNodesc":"to hide descriptions","mcp.tipSchema":"to show tool parameter schemas","mcp.tips":"💡 Tips:","mcp.toolCount":e=>`${(e==null?void 0:e.count)??0} tool`,"mcp.toolsCount":e=>`${(e==null?void 0:e.count)??0} tools`,"mcp.toolsLabel":"Tools:","mcp.title":"MCP Servers","mcp.toolDetail":"Tool Detail","mcp.tools":"Tools","mcp.toolsForServer":e=>`Tools for ${(e==null?void 0:e.name)??"Server"}`,"mcp.transport":"Transport","mcp.use":"Use","mcp.userMcp":"User MCP","mcp.workingDirectory":"Working Directory","goal.aborted":"Goal aborted","goal.achieved":"Goal achieved","goal.check":"Goal check","goal.cleared":"Goal cleared","goal.failed":"Goal could not be achieved","goal.judge":"Judge","goal.label":"Goal","goal.lastCheck":"Last check","goal.notYetMet":"not yet met","goal.set":"Goal set","goal.statusActive":"/goal active","goal.turn":e=>`${(e==null?void 0:e.count)??0} turn`,"goal.turnLabel":e=>`turn ${(e==null?void 0:e.count)??0}`,"goal.turns":e=>`${(e==null?void 0:e.count)??0} turns`,"memory.add":"Add","memory.add.desc":"Write a durable memory","memory.autoDream":e=>`Auto-dream: ${(e==null?void 0:e.status)??"unknown"} · ${(e==null?void 0:e.lastDream)??"never"} · /dream to run`,"memory.autoDreamUnsupported":"Auto-dream settings are not available from web-shell yet.","memory.autoFolder":"Open auto-memory folder","memory.autoMemory":e=>`Auto-memory: ${(e==null?void 0:e.status)??"unknown"}`,"memory.autoMemoryUnsupported":"Auto-memory settings are not available from web-shell yet.","memory.autoSkill":e=>`Auto-skill: ${(e==null?void 0:e.status)??"unknown"}`,"memory.autoSkillUnsupported":"Auto-skill settings are not available from web-shell yet.","memory.chooseScope":"Choose where to save the memory","memory.closed":"Memory panel closed.","memory.contentEmpty":"Memory content is empty.","memory.file":"Memory file","memory.fileOpen":"Memory file opened.","memory.fileTruncated":"Memory file opened. Content is truncated.","memory.files":"Memory Files","memory.footer":"Enter to confirm · Esc to cancel","memory.footer.back":"Esc to go back","memory.global":"User memory","memory.global.desc":"Saved to the global user memory file","memory.globalReadUnsupported":"Global memory is outside the bound workspace, so the current daemon file-read API cannot open its content.","memory.loading":"Loading memory...","memory.loadingFile":"Loading memory file...","memory.lastDream":"5 hours ago","memory.menu":"Memory","memory.never":"never","memory.noFiles":"No memory files found.","memory.on":"on","memory.openFolderUnsupported":"Opening the auto-memory folder is not available from web-shell yet.","memory.placeholder":e=>`Write ${(e==null?void 0:e.scope)??"memory"} content...`,"memory.project":"Project memory","memory.project.desc":"Saved to this workspace memory file","memory.refresh":"Refresh","memory.refresh.desc":"Reload memory file information","memory.refreshed":"Memory refreshed.","memory.save":"Save Memory","memory.savedIn":e=>`Saved in ${(e==null?void 0:e.path)??""}`,"memory.saved":e=>`${(e==null?void 0:e.scope)??"Memory"} saved: ${(e==null?void 0:e.bytes)??0} bytes -> ${(e==null?void 0:e.path)??""}`,"memory.saving":"Saving...","memory.show":"Show","memory.show.desc":"Show configured memory files","memory.status":"Workspace and user memory files","memory.unknown":"unknown","memory.write":"Write memory content","mode.auto":"Auto mode","mode.auto.desc":"Automatically decide when approval is needed","mode.auto.notice":"Auto mode enabled. An LLM classifier evaluates each tool call and auto-approves safe actions, blocks risky ones. To exit: Shift+Tab or /approval-mode default.","mode.footer":"(Use Enter to select, Esc to cancel)","mode.name.plan":"plan","mode.name.default":"default","mode.name.auto-edit":"auto-edit","mode.name.auto":"auto","mode.name.yolo":"yolo","mode.desc.plan":"Analyze only, do not modify files or execute commands","mode.desc.default":"Require approval for file edits or shell commands","mode.desc.auto-edit":"Automatically approve file edits","mode.desc.auto":"auto mode","mode.desc.yolo":"Automatically approve all tools","mode.select":"Approval Mode","mode.autoApproved":e=>e!=null&&e.tool?`Auto-approved: ${e.tool}`:"Pending tool call auto-approved by mode switch.","mode.auto-edit":"Auto-accept edits","mode.auto-edit.desc":"Automatically approve file read/write operations","mode.default":"Default mode","mode.default.desc":"Ask before each tool call","mode.plan":"Plan mode","mode.plan.desc":"Analyze and plan without running tools","mode.unknown":"unknown mode","mode.yolo":"YOLO mode","mode.yolo.desc":"Automatically approve all operations","plan.title":"Plan","model.contextWindow":"Context Window","model.contextWindow.unknown":"(unknown)","model.current":e=>`current: ${(e==null?void 0:e.model)??"unknown"}`,"model.modality":"Modality","model.modality.text":"text","model.modality.textOnly":"text-only","model.modality.image":"image","model.modality.pdf":"pdf","model.modality.audio":"audio","model.modality.video":"video","model.baseUrl":"Base URL","model.apiKey":"API Key","model.default":"(default)","model.notSet":"(not set)","model.footer":"Enter select, ↑↓ navigate, Esc close","model.searchHint":"Press / to search","model.fastHint":"for suggestions and side tasks","model.noMatch":e=>`No model matching "${(e==null?void 0:e.query)??""}"`,"model.none":"No models available","model.select":"Select Model","model.setFast":"Set Fast Model","model.switch":"Switch Model","model.unknown":"unknown","resume.current":"current","resume.activePrompt":"active prompt","resume.filter":"Filter","resume.noMatch":e=>`No session matching "${(e==null?void 0:e.query)??""}"`,"resume.none":"No sessions to resume","resume.pressSearch":"Press / to search","resume.search":"Search","resume.title":"Resume Session","parallelAgents.title":"Parallel agents","parallelAgents.done":e=>`${(e==null?void 0:e.done)??0}/${(e==null?void 0:e.total)??0} done`,"skills.available":"Available skills:","skills.none":"No skills are currently available.","skills.empty":"No skills available.","skills.footer":e=>e!=null&&e.name?`Use /skills ${e.name} to invoke · r to refresh · Esc to close`:"r to refresh · Esc to close","skills.invocable":e=>`${(e==null?void 0:e.enabled)??0}/${(e==null?void 0:e.total)??0} invocable`,"skills.loading":"Loading skills...","skills.run":"Run skill","skills.status.disabled":"disabled","skills.title":"Skills","stats.accepted":"Accepted:","stats.agreementRate":"Overall Agreement Rate:","stats.api":"API","stats.apiTime":"API Time","stats.avgDuration":"Avg Duration","stats.avgLatency":"Avg Latency","stats.cached":"Cached","stats.cacheDesc":"of input tokens were served from the cache, reducing costs.","stats.calls":"Calls","stats.codeChanges":"Code Changes","stats.decisionSummary":"User Decision Summary","stats.duration":"Duration","stats.errors":"Errors","stats.inputTokens":"Input Tokens","stats.metric":"Metric","stats.modelStats":"Model Stats","stats.modelTip":"Tip: For a full token breakdown, run /stats model.","stats.modelUsage":"Model Usage","stats.modified":"Modified:","stats.noApiCalls":"No API calls have been made in this session.","stats.noToolCalls":"No tool calls have been made in this session.","stats.output":"Output","stats.outputTokens":"Output Tokens","stats.overview":"Session Overview","stats.performance":"Performance","stats.prompt":"Prompt","stats.prompts":"Prompts","stats.rejected":"Rejected:","stats.reqs":"Reqs","stats.requests":"Requests","stats.savingsHighlight":"Savings Highlight:","stats.successRate":"Success Rate","stats.thoughts":"Thoughts","stats.title":"Session Stats","stats.tokens":"Tokens","stats.toolCalls":"Tool Calls","stats.toolName":"Tool Name","stats.toolStats":"Tool Stats","stats.toolTime":"Tool Time","stats.total":"Total","stats.totalReviewed":"Total Reviewed Suggestions:","status.contextUsed":e=>`${(e==null?void 0:e.pct)??"0.0"}% context used`,"status.disconnected":"Disconnected","status.modeHint":"(shift + tab or click to switch)","status.shortcuts":"? for shortcuts","stream.cancel":"esc to cancel","stream.tokens":e=>`${(e==null?void 0:e.count)??0} tokens`,"theme.current":e=>`current: ${(e==null?void 0:e.theme)??""}`,"theme.auto":"Auto","theme.dark":"Dark","theme.dark.desc":"Terminal-style dark skin.","theme.light":"Light","theme.light.desc":"Terminal-style light skin.","theme.title":"Theme","todo.allDone":"All tasks completed","todo.collapse":"Collapse task list","todo.completedAbove":e=>`✓ ${(e==null?void 0:e.count)??0} completed`,"todo.detail.api":"API","todo.detail.cached":"Cached","todo.detail.end":"End","todo.detail.hide":"Hide task detail","todo.detail.input":"Input","todo.detail.noResources":"Token & time usage wasn't captured for this task.","todo.detail.output":"Output","todo.detail.sectionSpent":"Time spent","todo.detail.sectionTime":"Time","todo.detail.sectionTokens":"Tokens","todo.detail.show":"Show task detail","todo.detail.start":"Start","todo.detail.tool":"Tool","todo.expand":"Expand task list","todo.locate":"Show in transcript","todo.more":e=>`... ${(e==null?void 0:e.count)??0} more`,"todo.moreAbove":e=>`... ${(e==null?void 0:e.count)??0} earlier`,"todo.showLess":"Show less","todo.title":"Current tasks","turn.collapse":"Collapse steps","turn.expand":"Expand steps","turn.cached":"cached","turn.executionSteps":e=>{const t=(e==null?void 0:e.count)??0;return`Execution ${t} step${t===1?"":"s"}`},"turn.toolCalls":e=>{const t=(e==null?void 0:e.count)??0;return`${t} tool call${t===1?"":"s"}`},"tasks.title":"Background tasks","tasks.empty":"No tasks currently running","tasks.refreshStale":"Task status may be stale; reconnecting...","tasks.cancelFailed":"Failed to cancel task","tasks.alreadyStopped":"Task already stopped","tasks.moreAbove":e=>`^ ${(e==null?void 0:e.count)??0} more above`,"tasks.moreBelow":e=>`v ${(e==null?void 0:e.count)??0} more below`,"tasks.running":"Running","tasks.completed":"Completed","tasks.failed":"Failed","tasks.cancelled":"Stopped","tasks.paused":"Paused","tasks.kind.shell":"Shell","tasks.kind.monitor":"Monitor","tasks.pill.agent":e=>`${(e==null?void 0:e.count)??0} local agent`,"tasks.pill.agents":e=>`${(e==null?void 0:e.count)??0} local agents`,"tasks.pill.agentPaused":e=>`${(e==null?void 0:e.count)??0} local agent paused`,"tasks.pill.agentsPaused":e=>`${(e==null?void 0:e.count)??0} local agents paused`,"tasks.pill.done":e=>`${(e==null?void 0:e.count)??0} task done`,"tasks.pill.doneMany":e=>`${(e==null?void 0:e.count)??0} tasks done`,"tasks.pill.monitor":e=>`${(e==null?void 0:e.count)??0} monitor`,"tasks.pill.monitors":e=>`${(e==null?void 0:e.count)??0} monitors`,"tasks.pill.shell":e=>`${(e==null?void 0:e.count)??0} shell`,"tasks.pill.shells":e=>`${(e==null?void 0:e.count)??0} shells`,"tasks.confirmStop":"x again to confirm stop · ends the blocking turn","tasks.shortcut.select":"↑/↓ select","tasks.shortcut.view":"Enter view","tasks.shortcut.stop":"x stop","tasks.shortcut.abandon":"x abandon","tasks.shortcut.listClose":"←/Esc close","tasks.shortcut.detailBack":"← go back","tasks.shortcut.detailClose":"Esc/Enter/Space close","tasks.shortcut.close":"Esc close","tasks.shortcut.cancelConfirm":"Esc cancel","tasks.detail.workingDir":"Working dir","tasks.detail.outputFile":"Output file","tasks.detail.command":"Command","tasks.detail.events":e=>`${(e==null?void 0:e.count)??0} events`,"tasks.detail.exit":e=>`exit ${(e==null?void 0:e.exitCode)??""}`,"tasks.detail.dropped":e=>`${(e==null?void 0:e.count)??0} dropped`,"tasks.detail.error":"Error","tasks.detail.stoppedBecause":"Stopped because","tasks.detail.resumeBlocked":"Resume blocked","tasks.detail.progress":"Progress","tasks.detail.prompt":"Prompt","tasks.detail.type":"Type","tasks.detail.tokens":e=>`${(e==null?void 0:e.count)??0} tokens`,"tasks.detail.toolCalls":e=>`${(e==null?void 0:e.count)??0} tool calls`,"tips.items":"Type / to see all available commands.|Use @ to reference file paths.|Press Esc to cancel an in-flight request.|Use Shift+Enter for a newline.|Press ↑↓ to browse message history.","tools.available":"Available tools:","tools.none":"No tools available.","tools.empty":"No built-in tools available. Open a session first.","tools.footer":e=>e!=null&&e.name?`${e!=null&&e.details?"Enter/Space for details · ":""}t to toggle ${e.name} · r to refresh · Esc to close`:"r to refresh · Esc to close","tools.details.hide":"Hide details","tools.details.show":"Show details","tools.loading":"Loading tools...","tools.status.disabled":"disabled","tools.status.enabled":"enabled","tools.summary":e=>`${(e==null?void 0:e.enabled)??0}/${(e==null?void 0:e.total)??0} enabled`,"tools.title":"Tools","tools.update.disable":"Disable","tools.update.enable":"Enable","tools.updating":"Updating...","tool.collapse":"▲ Collapse","tool.expand":"Expand","tool.collapseHint":"Collapse","tool.showAll":e=>`▼ Show all (${(e==null?void 0:e.count)??0} lines)`,"tool.showLess":"▲ Show less","tool.showFullLines":"▼ Show full lines","tool.linesTotal":e=>`▼ ${(e==null?void 0:e.count)??0} lines total`,"thinking.expand":"Expand thinking","thinking.collapse":"Collapse thinking","settings.title":"Settings","settings.loading":"Loading settings...","settings.empty":"No settings available.","settings.footer":"↑↓ Navigate  Enter Toggle  Tab Scope  r Reload  ESC Close","settings.footer.edit":"Enter Save  ESC Cancel","settings.footer.theme":"↑↓ Navigate  Enter Select  ESC Back","settings.scope.user":"User","settings.scope.workspace":"Workspace","settings.value.on":"ON","settings.value.off":"OFF","settings.modifiedIn":e=>`(Modified in ${(e==null?void 0:e.scope)??""})`,"settings.alsoModifiedIn":e=>`(Also modified in ${(e==null?void 0:e.scope)??""})`,"settings.invalidNumber":"Invalid number","settings.readOnly":"User-scope settings are read-only in daemon mode.","settings.requiresRestart":"This change requires a restart to take effect.","settings.corrupted":e=>`Settings file was corrupted${(e==null?void 0:e.recovered)==="true"?" (recovered from backup)":""}`,"welcome.changeModel":"(/model to change)","welcome.defaultModel":"unknown model","welcome.modeHint":"Shift+Tab or /approval-mode","welcome.tipLabel":"Tips:"},mee={...vk,"toolName.edit":"编辑","toolName.write_file":"写入文件","toolName.read_file":"读取文件","toolName.grep_search":"Grep","toolName.glob":"Glob","toolName.run_shell_command":"运行命令","toolName.todo_write":"任务清单","toolName.save_memory":"保存记忆","toolName.agent":"Agent","toolName.skill":"技能","toolName.enter_plan_mode":"进入计划模式","toolName.exit_plan_mode":"退出计划模式","toolName.web_fetch":"网络抓取","toolName.web_search":"网络搜索","toolName.list_directory":"列出文件","toolName.lsp":"LSP","toolName.ask_user_question":"询问用户","toolName.cron_create":"创建定时任务","toolName.cron_list":"定时任务列表","toolName.cron_delete":"删除定时任务","toolName.task_create":"创建任务","toolName.task_update":"更新任务","toolName.task_list":"任务列表","toolName.task_stop":"停止任务","toolName.team_create":"创建团队","toolName.team_delete":"删除团队","toolName.send_message":"发送消息","toolName.structured_output":"结构化输出","toolName.monitor":"监控","toolName.notebook_edit":"编辑 Notebook","toolName.tool_search":"工具搜索","toolName.enter_worktree":"进入 Worktree","toolName.exit_worktree":"退出 Worktree","toolName.workflow":"工作流","toolName.bash":"运行命令","toolName.shell":"Shell 命令","toolName.read":"读取文件","toolName.write":"写入文件","toolName.search":"Grep","about.auth":"认证","about.baseUrl":"Base URL","about.fastModel":"快速模型","about.memoryUsage":"内存使用","about.model":"模型","about.noProxy":"no proxy","about.noSandbox":"no sandbox","about.platform":"操作系统","about.proxy":"代理","about.qwenCode":"Qwen Code","about.runtime":"运行环境","about.sandbox":"沙箱","about.sessionId":"会话 ID","about.title":"状态","agent.back":"返回","agent.builtInBadge":"（内置）","agent.action.delete":"删除智能体","agent.action.edit":"编辑智能体","agent.action.view":"查看智能体","agent.chooseAction":e=>`选择操作：${(e==null?void 0:e.name)??""}`,"agent.chooseActionTitle":"选择操作","agent.colorLabel":"颜色：","agent.colorUpdated":e=>`已更新 ${(e==null?void 0:e.name)??""} 的颜色`,"agent.create":"创建新的智能体","agent.create.button":"创建智能体","agent.create.colorSelection":"选择背景颜色","agent.create.confirm":"确认并保存","agent.create.desc":"创建新的智能体","agent.create.descPlaceholder":"这个智能体做什么？","agent.create.describeAgent":"描述您的子智能体","agent.create.description":"描述","agent.create.editAgain":"编辑","agent.create.enterDescription":"输入描述","agent.create.enterName":"输入子智能体名称","agent.create.enterPrompt":"输入系统提示词","agent.create.generateFailed":e=>`生成子智能体失败：${(e==null?void 0:e.error)??"未知错误"}`,"agent.create.generatingConfig":"正在生成子智能体配置...","agent.create.loading":"创建中...","agent.create.location":"选择位置","agent.create.method":"选择生成方式","agent.create.method.manual":"手动创建","agent.create.method.qwen":"使用 Qwen Code 生成","agent.create.method.qwen.recommended":"使用 Qwen Code 生成（推荐）","agent.create.method.qwen.desc":"LLM 生成名称、提示词和描述","agent.create.name":"名称","agent.create.namePlaceholder":"my-agent","agent.create.nameHelp":"输入此子智能体清晰且唯一的名称。","agent.create.project":"项目","agent.create.project.cli":"项目级 (.qwen/agents/)","agent.create.project.desc":"创建项目级智能体","agent.create.prompt":"系统提示词","agent.create.promptPlaceholder":"你是一个专门的智能体...","agent.create.promptPlaceholder.cli":"例如：你是一名专业的代码审查员...","agent.create.promptHelp":"编写定义此子智能体行为的系统提示词。为了获得最佳效果，请全面描述。","agent.create.preview":"预览","agent.create.qwenHint":"描述此子智能体应该做什么以及何时使用它。（为了获得最佳效果，请全面描述）","agent.create.qwenPlaceholder":"> 例如：专业的代码审查员，根据最佳实践审查代码...","agent.create.required":"名称、描述和系统提示词均为必填项。","agent.create.save":"保存智能体","agent.create.scope":"选择智能体的保存位置","agent.create.manualDescHelp":"描述此子智能体应该在何时以及如何使用。","agent.create.manualDescPlaceholder":"例如：根据最佳实践和潜在 bug 审查代码。","agent.create.toolsSelection":"选择工具","agent.create.tools.all":"所有工具","agent.create.tools.allDefault":"所有工具（默认）","agent.create.tools.allInfo":"已选择所有工具，包括 MCP 工具","agent.create.tools.allInfoFallback":"已选择所有工具，包括 MCP 工具","agent.create.tools.editLabel":"• 编辑工具:","agent.create.tools.executionLabel":"• 执行工具:","agent.create.tools.none":"（无）","agent.create.tools.readEdit":"读取和编辑工具","agent.create.tools.readEditExecute":"读取、编辑和执行工具","agent.create.tools.readOnlyLabel":"• 只读工具:","agent.create.tools.readOnly":"只读工具","agent.create.tools.selected":"已选择的工具:","agent.create.user":"用户","agent.create.user.cli":"用户级 (~/.qwen/agents/)","agent.create.user.desc":"创建用户级智能体","agent.createFirstHint":"使用 '/agents create' 创建第一个智能体。","agent.created":e=>`已创建 ${(e==null?void 0:e.name)??""}`,"agent.delete":"删除","agent.delete.confirm":e=>`确定要删除 "${(e==null?void 0:e.name)??""}" 吗？`,"agent.delete.loading":"删除中...","agent.delete.no":"否","agent.delete.title":e=>`删除 ${(e==null?void 0:e.name)??""}`,"agent.delete.yes":"是，删除","agent.deleted":e=>`已删除 ${(e==null?void 0:e.name)??""}`,"agent.edit":"编辑","agent.edit.color":"编辑颜色","agent.edit.tools":"编辑工具","agent.editColorTitle":e=>`编辑颜色：${(e==null?void 0:e.name)??""}`,"agent.editTitle":e=>`编辑 ${(e==null?void 0:e.name)??""}`,"agent.empty":"未找到智能体。","agent.footer.back":"Esc 返回","agent.footer.cliBack":"Enter 选择 · ↑↓ 导航 · Esc 返回","agent.footer.cliSelect":"Enter 选择 · ↑↓ 导航 · Esc 关闭","agent.footer.close":"Esc 关闭","agent.footer.deleteConfirm":"Enter 确认，Esc 取消","agent.footer.enterNext":"按 Enter 继续，Esc 返回","agent.footer.generating":"Esc 取消","agent.footer.createLocation":"按 Enter 继续，↑↓ 导航，Esc 取消","agent.footer.createContinue":"按 Enter 继续，↑↓ 导航，Esc 返回","agent.footer.final":"按 Enter 保存，e 保存并编辑，Esc 返回","agent.footer.nav":"↑↓ 导航 · Enter 选择 · Esc 返回","agent.footer.navBack":"↑↓ 导航 · Enter 选择 · Esc 返回","agent.footer.navSelect":"↑↓ 导航 · Enter 选择 · Esc 关闭","agent.footer.viewerBack":"Esc 返回","agent.filePathLabel":"文件路径：","agent.label":"智能体","agent.location":"位置","agent.level.builtin":"内置","agent.level.extension":"扩展","agent.level.project":"项目","agent.level.user":"用户","agent.manage":"管理","agent.manage.desc":"管理已有智能体","agent.modelLabel":"模型：","agent.overriddenBadge":"（已被项目级智能体覆盖）","agent.readonly":"该智能体是只读的。","agent.select":"请选择一个智能体。","agent.selectAction":"选择操作","agent.descriptionLabel":"描述：","agent.systemPromptLabel":"系统提示词：","agent.step":e=>`步骤 ${(e==null?void 0:e.n)??""}`,"agent.tools":"工具","agent.toolsLabel":"工具：","agent.toolsUpdated":e=>`已更新 ${(e==null?void 0:e.name)??""} 的工具`,"agent.usingCount":e=>`使用中：${(e==null?void 0:e.count)??0} 个智能体`,"agent.view":"查看","agents.closed":"智能体面板已关闭。","agents.title":"智能体","subagent.toggleStream":"展开/收起子智能体详情","toast.dismiss":"关闭通知","toast.dismissShort":"关闭","insight.ready":"Insight 报告已生成！","request.cancelled":"请求已取消。","approval.execQuestion":e=>`允许执行：'${(e==null?void 0:e.tool)??""}'？`,"approval.changeQuestion":"是否继续？","approval.launchAgentQuestion":"启动这个 agent？","approval.option.allowOnce":"是，允许一次","approval.option.rejectOnce":"否，建议更改 (esc)","approval.option.allowAllEdits":"允许所有编辑","approval.option.allowAlwaysProject":"在本项目中总是允许","approval.option.allowAlwaysUser":"对该用户总是允许","common.back":"返回","common.cancel":"取消","common.close":"关闭","common.current":"当前","common.disabled":"已禁用","common.enabled":"已启用","common.enterSelect":"回车选择","common.invalid":"无效","common.loading":"加载中...","common.navigate":"↑↓ 导航","common.refresh":"刷新","common.search":"搜索","common.valid":"有效","common.clients":e=>`${(e==null?void 0:e.count)??0} 个客户端`,"agent.count":e=>`${(e==null?void 0:e.count)??0} 个智能体`,"askUser.footer":"↑/↓: 导航 | ←/→: 切换标签页 | Enter: 选择 | Esc: 取消","askUser.footerMulti":"↑/↓: 导航 | 空格: 切换 | ←/→: 切换标签页 | Enter: 确认 | Esc: 取消","askUser.submit":"提交","askUser.submitAnswers":"提交答案","askUser.cancel":"取消","askUser.confirmTitle":"您的答案：","askUser.confirmPrompt":"准备好提交您的答案了吗？","askUser.multiHint":"可多选","askUser.typePlaceholder":"输入内容...","askUser.title":e=>`向用户询问 ${(e==null?void 0:e.count)??0} 个问题 ←`,"copy.failedFallback":"复制到剪贴板失败","copy.inlineLatexMissing":"最后一条 AI 输出中没有匹配的行内 LaTeX 表达式。","copy.latexMissing":"最后一条 AI 输出中没有匹配的 LaTeX 块。","copy.noOutput":"历史记录中没有可复制的输出","copy.noText":"最后一条 AI 输出没有可复制的文本。","copy.codeMissing":"最后一条 AI 输出中没有匹配的代码块。","copy.outputCopied":"已复制最后一条输出到剪贴板","copy.toClipboard":e=>`${(e==null?void 0:e.label)??"内容"} 已复制到剪贴板`,"code.copy":"复制","code.copied":"已复制！","mermaid.rendering":"正在渲染图表...","mermaid.viewCode":"</>","mermaid.viewDiagram":"⊞","contextUsage.active":"已激活","contextUsage.autocompactBuffer":"自动压缩缓冲区","contextUsage.bodyLoaded":"已加载正文","contextUsage.builtinTools":"内置工具","contextUsage.contextWindow":"上下文窗口","contextUsage.detailHint":"运行 /context detail 查看逐项明细。","contextUsage.estimatedOverhead":"预估的对话前开销","contextUsage.free":"空闲","contextUsage.memoryFiles":"Memory 文件","contextUsage.messages":"消息","contextUsage.mcpTools":"MCP 工具","contextUsage.model":"模型","contextUsage.noApiResponse":"尚无 API 响应。发送一条消息后可查看实际使用量。","contextUsage.overLimit":"上下文已超过限制！请使用 /compress 或 /clear 减少占用。","contextUsage.skills":"Skills","contextUsage.systemPrompt":"系统提示词","contextUsage.title":"上下文使用情况","contextUsage.tokens":"tokens","contextUsage.usageByCategory":"按类别统计","contextUsage.used":"已用","delete.cannotCurrent":"无法删除当前活动会话。","delete.deleted":"会话已删除。","delete.deletedCount":e=>`已删除 ${(e==null?void 0:e.count)??0} 个会话。`,"delete.deleting":"删除中...","delete.failed":e=>`删除会话失败。${e!=null&&e.reason?` ${e.reason}`:""}`,"delete.footer":"↑↓ 导航 · Space 选择 · Enter 删除 · Esc 取消","delete.noMatch":e=>`没有匹配 "${(e==null?void 0:e.query)??""}" 的会话`,"delete.none":"没有可删除的会话","delete.allFailed":e=>`删除 ${(e==null?void 0:e.count)??0} 个会话失败: ${(e==null?void 0:e.reason)??"未知错误"}`,"delete.nonRemoved":"没有会话被删除。","delete.notFound":"会话未找到，可能已被删除。","delete.partialFail":e=>`已删除 ${(e==null?void 0:e.removed)??0} 个，${(e==null?void 0:e.failed)??0} 个失败: ${(e==null?void 0:e.detail)??"未知错误"}`,"delete.matches":e=>`${(e==null?void 0:e.count)??0} 个匹配`,"delete.pressSearch":"按 / 搜索；Space 选择；Enter 删除","delete.selected":e=>`已选 ${(e==null?void 0:e.count)??0} 个`,"delete.title":"删除会话","time.justNow":"刚刚","time.minutesAgo":e=>`${(e==null?void 0:e.count)??0} 分钟前`,"time.hoursAgo":e=>`${(e==null?void 0:e.count)??0} 小时前`,"time.daysAgo":e=>`${(e==null?void 0:e.count)??0} 天前`,"dialog.footer.close":"Esc 关闭","dialog.footer.confirmCancel":"Enter 确认 · Esc 取消","release.cannotCurrent":"不能释放当前活动会话。","release.released":"会话已释放。","release.failed":e=>`释放会话失败。${e!=null&&e.reason?` ${e.reason}`:""}`,"release.footer":"↑↓ 导航 · Enter 释放 · Esc 取消","release.inactive":"只有活跃的 live session 才能释放。","release.inactiveBadge":"非活跃","release.noMatch":e=>`没有匹配 "${(e==null?void 0:e.query)??""}" 的会话`,"release.none":"没有可释放的 live session","release.pressSearch":"按 / 搜索；Enter 释放选中的 live session","release.releasing":"释放中...","release.title":"释放会话","dialog.footer.menu":"Esc 返回菜单","dialog.footer.mcpServers":"↑↓ 导航 · Enter 查看详情 · r 刷新 · Esc 关闭","dialog.footer.mcpSelect":"↑↓ 导航 · Enter 选择 · Esc 返回","dialog.footer.modelFast":"↑↓ 导航 · / 搜索 · c 自定义 · Enter 设置 fast model · Esc 取消","dialog.footer.navSelectCancel":"↑↓ 导航 · Enter 选择 · Esc 取消","dialog.footer.navSelectClose":"↑↓ 导航 · Enter 选择 · Esc 关闭","dialog.footer.navSelectMenu":"↑↓ 导航 · Enter 选择 · Esc 返回菜单","dialog.footer.navOpenClose":"↑↓ 导航 · Enter 打开 · Esc 关闭","dialog.footer.navOpenMenu":"↑↓ 导航 · Enter 打开 · Esc 返回菜单","dialog.footer.back":"Esc 返回","dialog.footer.backClose":"Esc 关闭","dialog.footer.saveClose":"↑↓ 切换输入框 · ⌘/Ctrl+Enter 保存 · Esc 关闭","dialog.footer.saveMenu":"↑↓ 切换输入框 · ⌘/Ctrl+Enter 保存 · Esc 返回菜单","dialog.footer.search":"输入搜索 · Enter 确认 · Esc 清空","dialog.footer.select":"Enter 选择","editor.escClearHint":"再按一次 Esc 清空输入。","editor.hintCommands":"命令","editor.hintFiles":"文件","editor.hintNext":"下一条","editor.hintPrev":"上一条","editor.hintSearch":"搜索","editor.noHistory":"没有匹配的历史记录","editor.placeholder":"输入消息或 @ 文件路径","editor.processing":"处理中。新消息会进入队列。","editor.searchHint":"ctrl+r 下一条 · tab 采纳 · enter 发送 · esc 取消","editor.searchLabel":"历史搜索：","editor.searchPlaceholder":"输入以搜索…","error.unsupportedTheme":"不支持该主题。请使用 /theme light 或 /theme dark。","queue.cleared":"已清空排队消息","queue.footer":"按 ↑ 编辑排队消息 · Esc 清空队列","queue.imageCount":e=>`（+${(e==null?void 0:e.count)??0} 张图片）`,"queue.more":e=>`...（还有 ${(e==null?void 0:e.count)??0} 条）`,"help.builtIn":"内置命令","help.commandCount":e=>`${(e==null?void 0:e.count)??0} 个命令`,"help.commandMeta.builtIn":"内置","help.commandMeta.custom":"自定义","help.commandMeta.subcommands":e=>`${(e==null?void 0:e.count)??0} 个子命令`,"help.commandsIntro":"浏览内置命令：","help.customGroup":"自定义、skills、plugins、MCP","help.customIntro":"浏览自定义、skill、plugin 和 MCP 命令：","help.empty":"当前没有可用命令。","help.emptyCustom":"当前没有可用的自定义命令。","help.footer":"Tab/Shift+Tab 切换标签 · ↑/↓ 或 PgUp/PgDn 滚动 · Esc 关闭","help.intro":"Qwen Code 可以理解代码库，在你的许可下修改文件，并直接执行命令。","help.section.shortcuts":"快捷键","help.shortcut.addContext":"添加文件或目录作为上下文","help.shortcut.altWords":"按词跳转","help.shortcut.clear":"清屏","help.shortcut.commandMenu":"打开命令菜单","help.shortcut.completion":"接受补全或切换帮助标签","help.shortcut.history":"切换历史 prompt 或滚动列表","help.shortcut.searchHistory":"搜索历史 prompt","help.shortcut.newline":"插入换行","help.shortcut.pasteImages":"粘贴图片","help.shortcut.shell":"运行 shell 命令","help.shortcut.togglePanel":"切换此面板","help.shortcut.retry":"重试上次请求","help.shortcut.compact":"切换紧凑模式","retry.hint":"按 Ctrl+Y 重试或点击重试","retry.none":"没有可重试的失败请求。","branch.failed":"分支会话失败。","branch.success":e=>`已复制会话，新会话名称为： "${(e==null?void 0:e.name)??""}"，当前已切换到新的会话。`,"fork.empty":"请提供任务指令。用法：/fork <指令>","fork.failed":e=>`启动后台智能体失败：${(e==null?void 0:e.reason)??""}`,"fork.notStarted":"后台智能体未启动。","fork.started":e=>`已启动后台智能体："${(e==null?void 0:e.name)??""}"，可在后台任务中查看。`,"command.hidden":"该命令不可用。","help.shortcut.approvals":"切换审批模式","help.shortcut.cancel":"关闭弹窗或取消操作","bug.failed":"加载系统信息失败，无法提交 Bug 报告。","bug.popupBlocked":"弹窗被拦截，请允许弹窗后重试。","bug.submitted":"Bug 报告已在新标签页中打开。","clear.blocked":"流式输出中无法清屏 — 先按 Esc 取消。","error.unknown":"未知错误","shell.command":"Shell 命令","compact.enabled":"紧凑模式已开启","compact.disabled":"紧凑模式已关闭","compact.hint":"按 Ctrl+O 显示完整工具输出","compact.saveFailed":"保存紧凑模式失败","help.subcommands":"子命令","help.tab.commands":"命令","help.tab.custom":"自定义命令","help.tab.general":"概览","help.title":"帮助","slash.category.custom":"自定义","slash.category.skill":"Skill","slash.category.system":"系统","language.changed":e=>`UI 语言已切换为 ${(e==null?void 0:e.language)??""}`,"language.current":e=>`当前 UI 语言：${(e==null?void 0:e.language)??""}`,"language.invalid":"语言无效。可用值：en, zh-CN","language.options":"可用选项：","language.set":"设置 UI 语言","language.usage":"用法：/language ui [en|zh-CN]","local.agents":"管理智能体","local.approvalMode":"切换审批模式","local.auth":"连接 LLM provider","auth.title":"连接 Provider","auth.step.protocol":"协议","auth.step.baseUrl":"Base URL","auth.step.apiKey":"API Key","auth.step.models":"模型 ID","auth.step.advanced":"高级配置","auth.stepCount":e=>`步骤 ${(e==null?void 0:e.step)??""}/${(e==null?void 0:e.total)??""}`,"auth.apiKeyRequired":"API key 不能为空。","auth.baseUrlInvalid":"Base URL 必须以 http:// 或 https:// 开头。","auth.baseUrlPrompt":"输入此协议的 API endpoint。","auth.baseUrlRequired":"Base URL 不能为空。","auth.documentation":"文档","auth.modelsRequired":"模型 ID 不能为空。","auth.review":"确认","auth.reviewText":"以下 JSON 将保存到 settings.json：","auth.saving":"正在保存...","auth.termsTitle":"服务条款和隐私声明","auth.continue":"继续","auth.footer.back":"Enter 选择 · ↑↓ 导航 · Esc 返回","auth.footer.close":"Enter 选择 · ↑↓ 导航 · Esc 关闭","auth.footer.input":"Enter 提交 · Esc 返回","auth.footer.save":"Enter 保存 · Esc 返回","auth.footer.advanced":"↑↓ 导航 · Space 切换 · Enter 继续 · Esc 返回","auth.modelsPrompt":e=>`输入以逗号分隔的模型 ID。例如：${(e==null?void 0:e.modelIds)??""}`,"auth.advanced.prompt":"可选：配置高级生成设置。","auth.advanced.thinking":"启用 thinking","auth.advanced.thinkingDesc":"允许模型在回复前进行扩展推理。","auth.advanced.modality":"启用多模态","auth.advanced.modalityDesc":"启用图片、视频等多模态输入能力。","auth.advanced.modalityImage":"图片","auth.advanced.modalityVideo":"视频","auth.advanced.modalityAudio":"音频","auth.advanced.modalityPdf":"PDF","auth.advanced.contextWindow":"上下文窗口","auth.advanced.contextDesc":"最大输入 token 数（留空则根据模型名称自动检测）。","auth.advanced.contextPlaceholder":"上下文窗口（可选）","local.btw":"快速问一个不影响主对话的侧边问题。用法：/btw <your question>","btw.empty":"请提供一个问题。用法：/btw <你的问题>","btw.emptyAnswer":"未收到回答。","btw.failed":"回答 btw 问题失败","btw.answering":"+ 正在回答...","btw.shortcuts.pending":"按 Escape、Ctrl+C 或 Ctrl+D 取消","btw.shortcuts.done":"按 Space、Enter 或 Escape 关闭","local.clear":"以空上下文开始新会话；之前的会话会保留在磁盘上（可用 /resume 恢复）","local.context":'显示上下文窗口使用情况明细。使用 "/context detail" 查看逐项明细',"local.copy":"复制最后输出或代码片段","local.delete":"永久删除会话","local.release":"释放 live session","local.branch":"将当前对话复制到新会话","local.fork":"基于当前对话启动后台智能体","local.help":"查看帮助和可用命令","local.language":"切换 UI 语言","local.mcp":"管理 MCP servers","local.memory":"管理 memory","local.model":"切换模型或设置 fast model","local.new":"开始新对话","local.plan":"进入 Plan 模式","local.goal":"设置目标并持续工作直到完成","local.recap":"生成会话摘要","recap.loading":"正在生成摘要...","recap.empty":"对话内容还不够，暂时无法生成摘要。","recap.failed":"生成摘要失败","local.rename":"重命名当前会话","rename.empty":"请输入会话名称，例如 /rename 项目调试，或使用 /rename --auto。","rename.success":e=>`会话已重命名为 ${(e==null?void 0:e.name)??""}`,"local.reset":"重置当前对话","local.resume":"恢复历史会话","local.skills":"查看可用 skills","local.stats":"查看会话统计","local.tasks":"查看后台任务","local.status":"查看版本信息","local.theme":"切换主题","local.settings":"查看和编辑设置","local.extensions":"管理扩展。用法: /extensions manage|install <source>","extensions.label":"扩展","extensions.action.failed":e=>`扩展操作失败${e!=null&&e.name?`（${e.name}）`:e!=null&&e.source?`（${e.source}）`:""}：${(e==null?void 0:e.error)??"未知错误"}`,"extensions.commands.refreshFailed":"刷新扩展命令失败。","extensions.install.failed":e=>`安装扩展失败${e!=null&&e.source?`（${e.source}）`:""}：${(e==null?void 0:e.error)??"未知错误"}`,"extensions.manage.agents":"智能体：","extensions.manage.checkingUpdates":"正在检查更新...","extensions.manage.commands":"命令：","extensions.manage.contextFiles":"上下文文件：","extensions.manage.count":e=>`已安装 ${(e==null?void 0:e.count)??0} 个扩展`,"extensions.manage.detailsTitle":"扩展详情","extensions.manage.disable":"禁用扩展","extensions.manage.disabled":e=>`扩展 "${(e==null?void 0:e.name)??"扩展"}" 已禁用。`,"extensions.manage.empty":"未安装扩展。","extensions.manage.enable":"启用扩展","extensions.manage.enabled":e=>`扩展 "${(e==null?void 0:e.name)??"扩展"}" 已启用。`,"extensions.manage.footer.back":"Esc 返回","extensions.manage.footer.confirm":"Enter 确认 · Esc 取消","extensions.manage.footer.list":"↑↓ 导航 · Enter 选择 · r 刷新 · Esc 关闭","extensions.manage.footer.select":"↑↓ 导航 · Enter 选择 · Esc 返回","extensions.manage.loading":"正在加载扩展...","extensions.manage.mcpServers":"MCP servers：","extensions.manage.name":"名称：","extensions.manage.notUpdatable":"不可更新","extensions.manage.path":"路径：","extensions.manage.queued":e=>`扩展 "${(e==null?void 0:e.name)??"扩展"}" 的操作已提交。`,"extensions.manage.refreshed":e=>`已刷新 ${(e==null?void 0:e.refreshed)??0} 个 session，${(e==null?void 0:e.failed)??0} 个失败。`,"extensions.manage.settings":"设置：","extensions.manage.skills":"Skills：","extensions.manage.source":"来源：","extensions.manage.status":"状态：","extensions.manage.status.disabled":"已禁用","extensions.manage.status.enabled":"已启用","extensions.manage.title":"管理扩展","extensions.manage.unknownUpdate":"未知","extensions.manage.uninstalled":e=>`扩展 "${(e==null?void 0:e.name)??"扩展"}" 已卸载。`,"extensions.manage.uninstallAction":"卸载扩展","extensions.manage.uninstallConfirm":e=>`确定卸载扩展 "${(e==null?void 0:e.name)??"扩展"}"？`,"extensions.manage.upToDate":"已是最新","extensions.manage.update":"更新扩展","extensions.manage.updateAvailable":"有可用更新","extensions.manage.updateError":"检查更新失败","extensions.manage.updated":e=>`扩展 "${(e==null?void 0:e.name)??"扩展"}" 已更新。`,"extensions.manage.updatedWithVersion":e=>`扩展 "${(e==null?void 0:e.name)??"扩展"}" 已更新到 v${(e==null?void 0:e.version)??""}。`,"extensions.manage.version":"版本：","extensions.manage.viewDetails":"查看详情","extensions.install.installed":e=>`扩展 "${(e==null?void 0:e.name)??"扩展"}" 已安装。`,"extensions.install.installedWithVersion":e=>`扩展 "${(e==null?void 0:e.name)??"扩展"}" v${(e==null?void 0:e.version)??""} 已安装。`,"extensions.install.missingOptionValue":e=>`${(e==null?void 0:e.option)??"选项"} 缺少值`,"extensions.install.requestFailed":"安装扩展失败","extensions.install.started":e=>`正在从 "${(e==null?void 0:e.source)??""}" 安装扩展...`,"extensions.install.unknownOption":e=>`未知选项 ${(e==null?void 0:e.option)??""}`,"extensions.install.usage":"用法: /extensions manage|install <source>","extensions.install.waitForSession":"等待会话连接后再安装扩展。","extensions.install.waitForTurn":"等待当前回合结束后再安装扩展。","local.tools":"列出可用工具。用法: /tools [desc]","loadWarning.commands":"命令列表加载失败，斜杠命令可能不完整。","loadWarning.context":"会话上下文加载失败，当前模式可能不准确。","loadWarning.models":"模型列表加载失败，部分模型详情可能不可用。","mcp.action.auth":"认证","mcp.action.authHint":"daemon 尚未暴露","mcp.action.authMessage":"daemon serve 尚未暴露 MCP 认证能力。","mcp.action.clearAuth":"清空认证","mcp.action.disable":"禁用","mcp.action.done":e=>`${(e==null?void 0:e.action)??"操作"}完成。`,"mcp.action.enable":"启用","mcp.action.enableMessage":"daemon serve 尚未暴露 MCP 启用/禁用能力。","mcp.action.failed":e=>`失败：${(e==null?void 0:e.error)??""}`,"mcp.action.running":e=>`${(e==null?void 0:e.action)??"操作"}中...`,"mcp.action.reauth":"重新认证","mcp.annotation.destructive":"破坏性","mcp.annotation.idempotent":"幂等","mcp.annotation.openWorld":"开放世界","mcp.annotation.readOnly":"只读","mcp.annotations":"注解","mcp.oauth.server":"服务器","mcp.oauth.starting":e=>`正在为 MCP server '${(e==null?void 0:e.name)??""}' 启动 OAuth 认证...`,"mcp.oauth.title":"OAuth 认证","mcp.clientBudget":e=>`${(e==null?void 0:e.count)??0}/${(e==null?void 0:e.budget)??0} 个客户端 · ${(e==null?void 0:e.mode)??"off"}`,"mcp.command":"命令","mcp.description":"描述：","mcp.action.reconnect":"重新连接","mcp.action.restart":"重启","mcp.action.tools":"查看工具","mcp.action.toolsHint":"Enter 查看","mcp.empty":"未配置 MCP 服务器。","mcp.emptyTools":"没有发现工具。","mcp.inputSchema":"输入 schema","mcp.loadingStatus":"正在加载 MCP 状态...","mcp.loadingTools":"正在加载工具...","mcp.name":"名称","mcp.noDescription":"没有描述","mcp.noSchema":"没有输入 schema。","mcp.serverTool":"服务器工具","mcp.servers":e=>`${(e==null?void 0:e.count)??0} 个服务器`,"mcp.configuredServers":"已配置的 MCP 服务器：","mcp.fromExtension":e=>`（来自 ${(e==null?void 0:e.name)??""}）`,"mcp.extensionMcp":"扩展 MCP","mcp.invalidReason":e=>`无效：${(e==null?void 0:e.reason)??""}`,"mcp.invalidReasonLabel":"原因：","mcp.invalidToolHelp":"工具必须同时包含 name 和 description 才能被 LLM 使用。","mcp.invalidToolWarning":"警告：这个工具不能被 LLM 调用","mcp.manageServers":"管理 MCP servers","mcp.parameters":"参数：","mcp.required":" 必填","mcp.scrollPosition":e=>`${(e==null?void 0:e.current)??0}/${(e==null?void 0:e.total)??0}`,"mcp.shortcut.back":"Esc 返回","mcp.shortcut.close":"Esc 关闭","mcp.shortcut.selectBack":"↑↓ 导航 · Enter 选择 · Esc 返回","mcp.shortcut.selectClose":"↑↓ 导航 · Enter 选择 · Esc 关闭","mcp.settings":"设置","mcp.extension":e=>`扩展：${(e==null?void 0:e.name)??""}`,"mcp.starting":e=>`⏳ MCP 服务器正在启动（${(e==null?void 0:e.count)??0} 个初始化中）...`,"mcp.startingNote":"注意：首次启动可能需要更长时间。工具可用性会自动更新。","mcp.restartSkipped":e=>`已跳过 ${(e==null?void 0:e.name)??""}：${(e==null?void 0:e.reason)??""}`,"mcp.restarted":e=>`已重启 ${(e==null?void 0:e.name)??""}，耗时 ${(e==null?void 0:e.duration)??0}ms`,"mcp.restartEntries":e=>`已重启 ${(e==null?void 0:e.name)??""} 的 ${(e==null?void 0:e.restarted)??0}/${(e==null?void 0:e.total)??0} 个条目${e!=null&&e.failedReasons?`（失败：${e.failedReasons}）`:""}`,"mcp.source":"来源","mcp.source.extension":"扩展","mcp.source.project":"工作区设置","mcp.source.user":"用户设置","mcp.status":"状态","mcp.status.blocked":"已阻止","mcp.status.connected":"已连接","mcp.status.connecting":"连接中","mcp.status.disconnected":"未连接","mcp.status.disconnectedTitle":"已断开","mcp.status.disabled":"已禁用","mcp.status.ready":"就绪","mcp.status.starting":"启动中...（首次启动可能需要更长时间）","mcp.status.unknown":"未知","mcp.tipDesc":"显示 server 和工具描述","mcp.tipNodesc":"隐藏描述","mcp.tipSchema":"显示工具参数 schema","mcp.tips":"💡 提示：","mcp.toolCount":e=>`${(e==null?void 0:e.count)??0} 个工具`,"mcp.toolsCount":e=>`${(e==null?void 0:e.count)??0} 个工具`,"mcp.toolsLabel":"工具：","mcp.title":"MCP Servers","mcp.toolDetail":"工具详情","mcp.tools":"工具","mcp.toolsForServer":e=>`${(e==null?void 0:e.name)??"Server"} 的工具`,"mcp.transport":"传输","mcp.use":"使用","mcp.userMcp":"用户 MCP","mcp.workingDirectory":"工作目录","goal.aborted":"目标已中止","goal.achieved":"目标已达成","goal.check":"目标检查","goal.cleared":"目标已清除","goal.failed":"目标未能达成","goal.judge":"判断","goal.label":"目标","goal.lastCheck":"上次检查","goal.notYetMet":"尚未满足","goal.set":"目标已设置","goal.statusActive":"/goal 运行中","goal.turn":e=>`${(e==null?void 0:e.count)??0} 轮`,"goal.turnLabel":e=>`第 ${(e==null?void 0:e.count)??0} 轮`,"goal.turns":e=>`${(e==null?void 0:e.count)??0} 轮`,"memory.add":"添加","memory.add.desc":"写入一条持久 memory","memory.autoDream":e=>`自动整理：${(e==null?void 0:e.status)??"未知"} · ${(e==null?void 0:e.lastDream)??"从未"} · /dream 立即运行`,"memory.autoDreamUnsupported":"web-shell 暂不支持修改自动整理设置。","memory.autoFolder":"打开自动记忆文件夹","memory.autoMemory":e=>`自动记忆：${(e==null?void 0:e.status)??"未知"}`,"memory.autoMemoryUnsupported":"web-shell 暂不支持修改自动记忆设置。","memory.autoSkill":e=>`自动技能：${(e==null?void 0:e.status)??"未知"}`,"memory.autoSkillUnsupported":"web-shell 暂不支持修改自动技能设置。","memory.chooseScope":"选择 memory 的保存位置","memory.closed":"Memory 面板已关闭。","memory.contentEmpty":"Memory 内容为空。","memory.file":"Memory 文件","memory.fileOpen":"Memory 文件已打开。","memory.fileTruncated":"Memory 文件已打开，内容已截断。","memory.files":"Memory 文件","memory.footer":"Enter 确认 · Esc 取消","memory.footer.back":"Esc 返回","memory.global":"User memory","memory.global.desc":"保存到全局用户 memory 文件","memory.globalReadUnsupported":"全局 memory 位于当前 workspace 之外，当前 daemon 文件读取接口不能打开它的内容。","memory.loading":"正在加载 memory...","memory.loadingFile":"正在加载 memory 文件...","memory.lastDream":"5 hours ago","memory.menu":"Memory","memory.never":"从未","memory.noFiles":"未找到 memory 文件。","memory.on":"开","memory.openFolderUnsupported":"web-shell 暂不支持打开自动记忆文件夹。","memory.placeholder":e=>`写入${(e==null?void 0:e.scope)??"memory"}内容...`,"memory.project":"Project memory","memory.project.desc":"保存到当前 workspace memory 文件","memory.refresh":"刷新","memory.refresh.desc":"重新加载 memory 文件信息","memory.refreshed":"Memory 已刷新。","memory.save":"保存 Memory","memory.savedIn":e=>`Saved in ${(e==null?void 0:e.path)??""}`,"memory.saved":e=>`${(e==null?void 0:e.scope)??"Memory"} 已保存：${(e==null?void 0:e.bytes)??0} 字节 -> ${(e==null?void 0:e.path)??""}`,"memory.saving":"保存中...","memory.show":"查看","memory.show.desc":"查看已配置的 memory 文件","memory.status":"Workspace 和用户 memory 文件","memory.unknown":"未知","memory.write":"写入 memory 内容","mode.auto":"Auto 模式","mode.auto.desc":"自动判断是否需要请求批准","mode.auto.notice":"Auto 模式已启用。LLM 分类器会评估每个工具调用，自动批准安全操作，拦截危险操作。退出方式：Shift+Tab 或 /approval-mode default。","mode.footer":"(Enter 选择，Esc 取消)","mode.name.plan":"plan","mode.name.default":"default","mode.name.auto-edit":"auto-edit","mode.name.auto":"auto","mode.name.yolo":"yolo","mode.desc.plan":"仅分析，不修改文件或执行命令","mode.desc.default":"编辑文件或执行命令前需要批准","mode.desc.auto-edit":"自动批准文件编辑","mode.desc.auto":"auto 模式","mode.desc.yolo":"自动批准所有工具","mode.select":"审批模式","mode.autoApproved":e=>e!=null&&e.tool?`已自动批准：${e.tool}`:"切换模式后自动批准了待处理的工具调用。","mode.auto-edit":"自动编辑","mode.auto-edit.desc":"自动批准文件读写操作","mode.default":"默认模式","mode.default.desc":"每次工具调用都需要确认","mode.plan":"Plan 模式","mode.plan.desc":"仅分析和规划，不执行工具","mode.unknown":"未知模式","mode.yolo":"YOLO 模式","mode.yolo.desc":"自动批准所有操作","plan.title":"计划","model.contextWindow":"上下文窗口","model.contextWindow.unknown":"（未知）","model.current":e=>`当前：${(e==null?void 0:e.model)??"未知"}`,"model.modality":"模态","model.modality.text":"文本","model.modality.textOnly":"仅文本","model.modality.image":"图片","model.modality.pdf":"PDF","model.modality.audio":"音频","model.modality.video":"视频","model.baseUrl":"Base URL","model.apiKey":"API Key","model.default":"（默认）","model.notSet":"（未设置）","model.footer":"Enter 选择，↑↓ 导航，Esc 关闭","model.searchHint":"按 / 搜索","model.fastHint":"用于建议和旁路任务","model.noMatch":e=>`没有匹配 "${(e==null?void 0:e.query)??""}" 的模型`,"model.none":"没有可用模型","model.select":"选择模型","model.setFast":"设置 Fast Model","model.switch":"切换模型","model.unknown":"未知","resume.current":"当前","resume.activePrompt":"正在运行","resume.filter":"筛选","resume.noMatch":e=>`没有匹配 "${(e==null?void 0:e.query)??""}" 的会话`,"resume.none":"没有可恢复的会话","resume.pressSearch":"按 / 搜索","resume.search":"搜索","resume.title":"恢复会话","parallelAgents.title":"并行智能体","parallelAgents.done":e=>`${(e==null?void 0:e.done)??0}/${(e==null?void 0:e.total)??0} 完成`,"skills.available":"可用 skills:","skills.none":"当前没有可用 skill。","skills.empty":"没有可用 skill。","skills.footer":e=>e!=null&&e.name?`使用 /skills ${e.name} 调用 · r 刷新 · Esc 关闭`:"r 刷新 · Esc 关闭","skills.invocable":e=>`${(e==null?void 0:e.enabled)??0}/${(e==null?void 0:e.total)??0} 可调用`,"skills.loading":"正在加载 skills...","skills.run":"运行 skill","skills.status.disabled":"已禁用","skills.title":"Skills","stats.accepted":"已接受：","stats.agreementRate":"总体同意率：","stats.api":"API","stats.apiTime":"API 耗时","stats.avgDuration":"平均耗时","stats.avgLatency":"平均延迟","stats.cached":"缓存","stats.cacheDesc":"的输入 Token 来自缓存，降低了成本。","stats.calls":"调用次数","stats.codeChanges":"代码变更","stats.decisionSummary":"用户决策摘要","stats.duration":"时长","stats.errors":"错误数","stats.inputTokens":"输入 Token","stats.metric":"指标","stats.modelStats":"模型统计（技术细节）","stats.modelTip":"提示：运行 /stats model 查看完整 Token 明细。","stats.modelUsage":"模型使用","stats.modified":"已修改：","stats.noApiCalls":"本次会话暂无 API 调用。","stats.noToolCalls":"本次会话暂无工具调用。","stats.output":"输出","stats.outputTokens":"输出 Token","stats.overview":"会话概览","stats.performance":"性能","stats.prompt":"提示","stats.prompts":"对话轮次","stats.rejected":"已拒绝：","stats.reqs":"请求","stats.requests":"请求数","stats.savingsHighlight":"节省亮点：","stats.successRate":"成功率","stats.thoughts":"思考","stats.title":"会话统计","stats.tokens":"Token","stats.toolCalls":"工具调用","stats.toolName":"工具名称","stats.toolStats":"工具统计（技术细节）","stats.toolTime":"工具耗时","stats.total":"总计","stats.totalReviewed":"已审核建议总数：","status.contextUsed":e=>`上下文已用 ${(e==null?void 0:e.pct)??"0.0"}%`,"status.disconnected":"断开连接","status.modeHint":"(shift + tab 或点击切换)","status.shortcuts":"? 查看快捷键","stream.cancel":"esc 取消","stream.tokens":e=>`${(e==null?void 0:e.count)??0} tokens`,"theme.current":e=>`当前：${(e==null?void 0:e.theme)??""}`,"theme.auto":"自动","theme.dark":"暗色","theme.dark.desc":"仿终端暗色皮肤。","theme.light":"亮色","theme.light.desc":"仿终端亮色皮肤。","theme.title":"主题","todo.allDone":"任务已全部完成","todo.collapse":"折叠任务列表","todo.completedAbove":e=>`✓ 已完成 ${(e==null?void 0:e.count)??0} 项`,"todo.detail.api":"API","todo.detail.cached":"缓存","todo.detail.end":"结束","todo.detail.hide":"收起任务明细","todo.detail.input":"输入","todo.detail.noResources":"未采集到该任务的 Token 与耗时明细。","todo.detail.output":"输出","todo.detail.sectionSpent":"耗时","todo.detail.sectionTime":"时间","todo.detail.sectionTokens":"Token","todo.detail.show":"查看任务明细","todo.detail.start":"开始","todo.detail.tool":"工具","todo.expand":"展开任务列表","todo.locate":"在会话中定位","todo.more":e=>`... 还有 ${(e==null?void 0:e.count)??0} 项`,"todo.moreAbove":e=>`... 前面还有 ${(e==null?void 0:e.count)??0} 项`,"todo.showLess":"收起","todo.title":"当前任务","turn.collapse":"折叠步骤","turn.expand":"展开步骤","turn.cached":"缓存","turn.executionSteps":e=>`执行过程 ${(e==null?void 0:e.count)??0} 步`,"turn.toolCalls":e=>`工具 ${(e==null?void 0:e.count)??0} 次`,"tasks.title":"后台任务","tasks.empty":"当前没有运行中的任务","tasks.refreshStale":"任务状态可能已过期，正在重连...","tasks.cancelFailed":"取消任务失败","tasks.alreadyStopped":"任务已停止","tasks.moreAbove":e=>`^ 上方还有 ${(e==null?void 0:e.count)??0} 个`,"tasks.moreBelow":e=>`v 下方还有 ${(e==null?void 0:e.count)??0} 个`,"tasks.running":"运行中","tasks.completed":"已完成","tasks.failed":"失败","tasks.cancelled":"已停止","tasks.paused":"已暂停","tasks.kind.shell":"Shell","tasks.kind.monitor":"监控","tasks.pill.agent":e=>`${(e==null?void 0:e.count)??0} 个本地智能体`,"tasks.pill.agents":e=>`${(e==null?void 0:e.count)??0} 个本地智能体`,"tasks.pill.agentPaused":e=>`${(e==null?void 0:e.count)??0} 个本地智能体已暂停`,"tasks.pill.agentsPaused":e=>`${(e==null?void 0:e.count)??0} 个本地智能体已暂停`,"tasks.pill.done":e=>`${(e==null?void 0:e.count)??0} 个任务完成`,"tasks.pill.doneMany":e=>`${(e==null?void 0:e.count)??0} 个任务完成`,"tasks.pill.monitor":e=>`${(e==null?void 0:e.count)??0} 个监控`,"tasks.pill.monitors":e=>`${(e==null?void 0:e.count)??0} 个监控`,"tasks.pill.shell":e=>`${(e==null?void 0:e.count)??0} 个 shell`,"tasks.pill.shells":e=>`${(e==null?void 0:e.count)??0} 个 shell`,"tasks.confirmStop":"再按 x 确认停止 · 会终结当前阻塞轮次","tasks.shortcut.select":"↑/↓ 选择","tasks.shortcut.view":"Enter 查看","tasks.shortcut.stop":"x 停止","tasks.shortcut.abandon":"x 放弃","tasks.shortcut.listClose":"←/Esc 关闭","tasks.shortcut.detailBack":"← 返回","tasks.shortcut.detailClose":"Esc/Enter/Space 关闭","tasks.shortcut.close":"Esc 关闭","tasks.shortcut.cancelConfirm":"Esc 取消","tasks.detail.workingDir":"工作目录","tasks.detail.outputFile":"输出文件","tasks.detail.command":"命令","tasks.detail.events":e=>`${(e==null?void 0:e.count)??0} 个事件`,"tasks.detail.exit":e=>`退出码 ${(e==null?void 0:e.exitCode)??""}`,"tasks.detail.dropped":e=>`${(e==null?void 0:e.count)??0} 个已丢弃`,"tasks.detail.error":"错误","tasks.detail.stoppedBecause":"停止原因","tasks.detail.resumeBlocked":"恢复被阻止","tasks.detail.progress":"执行进度","tasks.detail.prompt":"提示词","tasks.detail.type":"类型","tasks.detail.tokens":e=>`${(e==null?void 0:e.count)??0} tokens`,"tasks.detail.toolCalls":e=>`${(e==null?void 0:e.count)??0} 次工具调用`,"tips.items":"输入 / 查看所有可用命令。|使用 @ 引用文件路径。|按 Esc 取消正在进行的请求。|使用 Shift+Enter 换行。|按 ↑↓ 浏览历史消息。","tools.available":"可用工具:","tools.none":"没有可用工具。","tools.empty":"没有可用的内置工具。请先打开一个会话。","tools.footer":e=>e!=null&&e.name?`${e!=null&&e.details?"Enter/Space 查看详情 · ":""}t 切换 ${e.name} · r 刷新 · Esc 关闭`:"r 刷新 · Esc 关闭","tools.details.hide":"收起详情","tools.details.show":"展开详情","tools.loading":"正在加载工具...","tools.status.disabled":"已禁用","tools.status.enabled":"已启用","tools.summary":e=>`${(e==null?void 0:e.enabled)??0}/${(e==null?void 0:e.total)??0} 已启用`,"tools.title":"工具","tools.update.disable":"禁用","tools.update.enable":"启用","tools.updating":"更新中...","tool.collapse":"▲ 收起","tool.expand":"展开","tool.collapseHint":"收起","tool.showAll":e=>`▼ 显示全部（${(e==null?void 0:e.count)??0} 行）`,"tool.showLess":"▲ 显示更少","tool.showFullLines":"▼ 显示完整行","tool.linesTotal":e=>`▼ 共 ${(e==null?void 0:e.count)??0} 行`,"thinking.expand":"展开思考","thinking.collapse":"收起思考","welcome.changeModel":"(/model 切换)","welcome.defaultModel":"未知模型","settings.title":"设置","settings.loading":"正在加载设置...","settings.empty":"暂无可用设置。","settings.footer":"↑↓ 导航  Enter 切换  Tab 切换作用域  r 刷新  ESC 关闭","settings.footer.edit":"Enter 保存  ESC 取消","settings.footer.theme":"↑↓ 导航  Enter 选择  ESC 返回","settings.scope.user":"用户","settings.scope.workspace":"工作区","settings.value.on":"开","settings.value.off":"关","settings.modifiedIn":e=>`（已在${(e==null?void 0:e.scope)??""}中修改）`,"settings.alsoModifiedIn":e=>`（同时在${(e==null?void 0:e.scope)??""}中修改）`,"settings.invalidNumber":"无效数字","settings.readOnly":"User 级别设置在 daemon 模式下为只读。","settings.requiresRestart":"此更改需要重启后才能生效。","settings.corrupted":e=>`设置文件已损坏${(e==null?void 0:e.recovered)==="true"?"（已从备份恢复）":""}`,"settings.category.General":"通用","settings.category.UI":"界面","settings.category.Privacy":"隐私","settings.category.Model":"模型","settings.category.Context":"上下文","settings.category.Tools":"工具","settings.category.Daemon":"守护进程","settings.category.Experimental":"实验性","settings.category.Advanced":"高级","settings.label.general.enableAutoUpdate":"启用自动更新","settings.description.general.enableAutoUpdate":"启动时自动检查并安装更新。","settings.label.general.showSessionRecap":"显示会话回顾","settings.description.general.showSessionRecap":"离开终端一段时间后返回时，自动显示一行“上次停在这里”的回顾。默认关闭。也可以随时使用 /recap 手动触发。","settings.label.general.sessionRecapAwayThresholdMinutes":"会话回顾离开阈值（分钟）","settings.description.general.sessionRecapAwayThresholdMinutes":"终端失焦多少分钟后，下一次重新聚焦时触发自动回顾。默认与 Claude Code 一致为 5 分钟；如果只是短暂切换窗口，可以调高。","settings.label.general.cleanupPeriodDays":"清理周期（天）","settings.description.general.cleanupPeriodDays":"~/.qwen/file-history/ 中用于 /rewind 的会话备份保留天数。后台清理最多每天运行一次。设为 0 表示最小保留（约 1 小时），仍会保护最近一小时触碰过的会话和当前活动会话。","settings.label.general.gitCoAuthor.commit":"归因：commit","settings.description.general.gitCoAuthor.commit":"通过 Qwen Code 创建 commit 时，添加 Co-authored-by trailer，并写入逐文件 AI 归因 git note。关闭后两者都会跳过。","settings.label.general.gitCoAuthor.pr":"归因：PR","settings.description.general.gitCoAuthor.pr":"运行 gh pr create 时，在 PR 描述中追加 Qwen Code 归因行。","settings.label.general.language":"语言：界面","settings.description.general.language":"用户界面的语言。使用 auto 可根据系统设置自动检测；也可以在 ~/.qwen/locales/ 中放置 JS 语言文件来使用自定义语言代码。","settings.label.general.dynamicCommandTranslation":"语言：动态命令翻译","settings.description.general.dynamicCommandTranslation":"为动态 slash command 描述启用 AI 翻译。关闭后动态命令使用原始描述，也不会触发翻译模型调用。","settings.label.general.preventSystemSleep":"运行时防止系统睡眠","settings.description.general.preventSystemSleep":"当 Qwen Code 正在流式生成模型回复或执行工具时防止系统睡眠。空闲输入状态和权限确认状态不会阻止睡眠。","settings.label.ui.theme":"主题","settings.description.ui.theme":"界面的颜色主题。","settings.label.ui.hideTips":"隐藏提示","settings.description.ui.hideTips":"隐藏界面中的帮助提示。","settings.label.ui.enableWelcomeBack":"显示欢迎回来对话框","settings.description.ui.enableWelcomeBack":"回到有历史会话的项目时显示欢迎回来对话框。选择“开始新的聊天会话”后，在项目摘要变化前不会再次显示。","settings.label.ui.enableUserFeedback":"启用用户反馈","settings.description.ui.enableUserFeedback":"对话结束后显示可选反馈对话框，帮助改进 Qwen 表现。","settings.label.ui.enableFollowupSuggestions":"启用后续建议","settings.description.ui.enableFollowupSuggestions":"任务完成后显示上下文相关的后续建议。按 Tab 或右方向键接受，按 Enter 接受并提交。","settings.label.ui.compactMode":"紧凑模式","settings.description.ui.compactMode":"隐藏工具输出和思考内容，显示更简洁的视图（可用 Ctrl+O 切换）。","settings.label.ui.compactInline":"紧凑内联","settings.description.ui.compactInline":"在每个分组内紧凑显示工具内容，而不是跨分组合并。需要先启用紧凑模式。","settings.label.ui.shellOutputMaxLines":"Shell 输出最大行数","settings.description.ui.shellOutputMaxLines":"内联显示的 shell 输出最大行数。设为 0 可取消限制并显示完整输出；隐藏行数仍会通过 +N lines 指示器展示。","settings.label.privacy.usageStatisticsEnabled":"启用使用统计","settings.description.privacy.usageStatisticsEnabled":"启用使用统计收集。","settings.label.fastModel":"快速模型","settings.description.fastModel":"用于生成提示建议和推测执行的模型。留空则使用主模型。较小/更快的模型（例如 qwen3-coder-flash）可以降低延迟和成本。","settings.label.context.fileFiltering.respectGitIgnore":"遵守 .gitignore","settings.description.context.fileFiltering.respectGitIgnore":"搜索时遵守 .gitignore 文件。","settings.label.context.fileFiltering.respectQwenIgnore":"遵守 .qwenignore","settings.description.context.fileFiltering.respectQwenIgnore":"搜索时遵守 .qwenignore 文件。","settings.label.context.fileFiltering.enableFuzzySearch":"启用模糊搜索","settings.description.context.fileFiltering.enableFuzzySearch":"搜索文件时启用模糊搜索。","settings.label.tools.toolSearch.enabled":"启用 ToolSearch","settings.description.tools.toolSearch.enabled":"启用后，MCP 工具会通过 ToolSearch 按需加载，以减少提示词大小。对于依赖前缀 KV 缓存的模型（如 DeepSeek），可关闭此项来保持提示词前缀稳定并提高缓存命中率。","settings.label.tools.shell.enableInteractiveShell":"交互式 Shell（PTY）","settings.description.tools.shell.enableInteractiveShell":"使用 node-pty 提供交互式 shell 体验。PTY 不可用时回退到 child_process。","settings.label.tools.computerUse.enabled":"启用 Computer Use","settings.description.tools.computerUse.enabled":"启用后（默认），会注册 9 个 computer_use__* 延迟内置工具。","settings.label.policy.permissionStrategy":"权限协调策略","settings.description.policy.permissionStrategy":"多个客户端连接时权限请求的决策方式。first-responder 表示任意客户端先响应者生效；designated 表示仅提示发起方决策；consensus 表示需要 N-of-M 投票同意；local-only 表示只有 loopback 客户端可决策。需要重启 daemon 后生效。","settings.option.policy.permissionStrategy.first-responder":"先响应者","settings.option.policy.permissionStrategy.designated":"指定发起方","settings.option.policy.permissionStrategy.consensus":"共识法定人数","settings.option.policy.permissionStrategy.local-only":"仅本机","settings.label.experimental.enableCronTools":"启用 Cron/Loop 工具","settings.description.experimental.enableCronTools":"启用会话内 cron/loop 工具（实验性）。启用后，模型可以用 cron_create、cron_list 和 cron_delete 创建周期性提示。也可通过 QWEN_CODE_ENABLE_CRON=1 环境变量启用。","settings.label.experimental.emitToolUseSummaries":"工具使用摘要","settings.description.experimental.emitToolUseSummaries":"每个工具批次完成后生成一个简短的 LLM 标签。紧凑模式下会替代通用的 Tool × N 标题；完整模式下显示为工具组下方的弱化 ● <label> 行。需要配置快速模型。","settings.label.agents.arena.preserveArtifacts":"保留 Arena 产物","settings.description.agents.arena.preserveArtifacts":"启用后，Arena worktree 和会话状态文件会在会话结束或主智能体退出后保留。","welcome.modeHint":"Shift+Tab 或 /approval-mode","welcome.tipLabel":"提示："},pee={en:vk,"zh-CN":mee},gee={en:"English [en]","zh-CN":"中文 [zh-CN]"},rD=v.createContext({language:"en",t:e=>e});function jl(e){const t=e==null?void 0:e.trim().toLowerCase();return t&&(t==="zh"||t==="zh-cn"||t==="zh_cn")?"zh-CN":"en"}function xk(e){if(typeof e!="string")return;const t=e.trim().toLowerCase().replace(/_/g,"-");if(t){if(t==="auto")return jl(typeof navigator<"u"?navigator.language:void 0);if(t==="zh"||t==="zh-cn"||t==="chinese"||t==="中文")return"zh-CN";if(t==="en"||t==="en-us"||t==="english")return"en"}}function wk(e){return gee[e]}function iD(e){const t=pee[e];return(n,r)=>{const i=t[n]??vk[n]??n;return typeof i=="function"?i(r):i}}function yee({language:e,children:t}){const n=v.useMemo(()=>({language:e,t:iD(e)}),[e]);return h.jsx(rD.Provider,{value:n,children:t})}function ft(){return v.useContext(rD)}const bee="_content_dkiti_1",vee="_inlineCode_dkiti_62",xee="_link_dkiti_71",wee="_tableWrapper_dkiti_80",kee="_table_dkiti_80",_ee="_image_dkiti_103",See="_codeBlock_dkiti_109",Tee="_codeBlockHeader_dkiti_118",Cee="_codeBlockLang_dkiti_127",Eee="_codeBlockCopy_dkiti_133",Aee="_codeBlockContent_dkiti_149",Mee="_codeBlockPlain_dkiti_166",Nee="_mermaidBlock_dkiti_181",Iee="_mermaidInline_dkiti_193",Dee="_mermaidLoading_dkiti_212",Ree="_mermaidActions_dkiti_219",ln={content:bee,inlineCode:vee,link:xee,tableWrapper:wee,table:kee,image:_ee,codeBlock:See,codeBlockHeader:Tee,codeBlockLang:Cee,codeBlockCopy:Eee,codeBlockContent:Aee,codeBlockPlain:Mee,mermaidBlock:Nee,mermaidInline:Iee,mermaidLoading:Dee,mermaidActions:Ree},Oee=new Set(["javascript","typescript","python","rust","go","java","c","cpp","csharp","ruby","php","swift","kotlin","scala","shell","bash","zsh","fish","powershell","sql","html","css","scss","json","yaml","toml","xml","markdown","dockerfile","graphql","lua","r","matlab","perl","haskell","elixir","erlang","clojure","dart","vue","svelte","astro","tsx","jsx","diff"]),sD=/^(https?:|mailto:)/i,jee=/^data:image\/(png|jpeg|gif|webp);base64,/i;function Lee(e){if(!e)return!1;const t=e.trim();return t?t.startsWith("#")||t.startsWith("/")&&!t.startsWith("//")?!0:sD.test(t):!1}function aD(e){if(!e)return!1;const t=e.trim();return t?t.startsWith("#")||t.startsWith("/")&&!t.startsWith("//")||jee.test(t)?!0:sD.test(t):!1}const Bee=128,Ec=new Map;function zee(e,t,n){const r=`${t}\0${n}\0${e}`,i=Ec.get(r);return i!==void 0?Promise.resolve(i):fee(e,{lang:t,theme:n}).then(s=>{if(Ec.size>=Bee){const a=Ec.keys().next().value;a!==void 0&&Ec.delete(a)}return Ec.set(r,s),s})}let K7,Pee=0;function $ee({code:e}){const{t}=ft(),n=aM(),[r,i]=v.useState(null),[s,a]=v.useState(null),[o,l]=v.useState("diagram"),[c,u]=v.useState(!1),d=n==="light"?"default":"dark";v.useEffect(()=>{let m=!1;i(null),a(null);const p=setTimeout(()=>{U(()=>import("./mermaid.core-CwF8A_xO.js").then(b=>b.bm),[]).then(async b=>{if(m)return;const x=b.default;K7!==d&&(x.initialize({startOnLoad:!1,theme:d,securityLevel:"strict",suppressErrorRendering:!0}),K7=d);try{const g=`mermaid-${++Pee}`,{svg:y}=await x.render(g,e.trim());m||i(y)}catch(g){m||a(g instanceof Error?g.message:"Mermaid render failed")}})},150);return()=>{m=!0,clearTimeout(p)}},[e,d]);const f=()=>{navigator.clipboard.writeText(e).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)},()=>{})};return s?h.jsxs("div",{className:ln.codeBlock,children:[h.jsx("div",{className:ln.codeBlockHeader,children:h.jsx("span",{className:ln.codeBlockLang,children:"mermaid (error)"})}),h.jsx("pre",{className:`${ln.codeBlockContent} ${ln.codeBlockPlain}`,children:h.jsx("code",{children:e})})]}):h.jsxs("div",{className:ln.codeBlock,children:[h.jsxs("div",{className:ln.codeBlockHeader,children:[h.jsx("span",{className:ln.codeBlockLang,children:"mermaid"}),h.jsxs("span",{className:ln.mermaidActions,children:[h.jsx("button",{className:ln.codeBlockCopy,onClick:()=>l(o==="diagram"?"code":"diagram"),children:t(o==="diagram"?"mermaid.viewCode":"mermaid.viewDiagram")}),h.jsx("button",{className:ln.codeBlockCopy,onClick:f,children:t(c?"code.copied":"code.copy")})]})]}),o==="code"?h.jsx("pre",{className:`${ln.codeBlockContent} ${ln.codeBlockPlain}`,children:h.jsx("code",{children:e})}):r?h.jsx("div",{className:`${ln.mermaidBlock} ${ln.mermaidInline}`,dangerouslySetInnerHTML:{__html:r}}):h.jsx("div",{className:`${ln.mermaidBlock} ${ln.mermaidLoading} ${ln.mermaidInline}`,children:h.jsx("span",{children:t("mermaid.rendering")})})]})}function Uee({className:e,children:t,deferMermaid:n}){const{t:r}=ft(),i=aM(),[s,a]=v.useState(null),[o,l]=v.useState(!1),c=e==null?void 0:e.match(/language-(\w+)/),u=(c==null?void 0:c[1])||"",d=String(t).replace(/\n$/,""),f=Oee.has(u)?u:"text",m=i==="light"?"github-light-default":"github-dark-default";v.useEffect(()=>{if(u==="mermaid"||f==="text"){a(null);return}const b=`${f}\0${m}\0${d}`;if(Ec.has(b)){a(Ec.get(b));return}let x=!1;a(null);const g=setTimeout(()=>{zee(d,f,m).then(y=>{x||a(y)}).catch(()=>{x||a(null)})},120);return()=>{x=!0,clearTimeout(g)}},[d,u,f,m]);const p=()=>{navigator.clipboard.writeText(d).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)},()=>{})};return u==="mermaid"&&!n?h.jsx($ee,{code:d}):h.jsxs("div",{className:ln.codeBlock,children:[h.jsxs("div",{className:ln.codeBlockHeader,children:[h.jsx("span",{className:ln.codeBlockLang,children:u||"text"}),h.jsx("button",{className:ln.codeBlockCopy,onClick:p,children:r(o?"code.copied":"code.copy")})]}),s?h.jsx("div",{className:ln.codeBlockContent,dangerouslySetInnerHTML:{__html:s}}):h.jsx("pre",{className:`${ln.codeBlockContent} ${ln.codeBlockPlain}`,children:h.jsx("code",{children:d})})]})}function Hee({children:e}){return h.jsx("code",{className:ln.inlineCode,children:e})}function oD(e){return{code({className:t,children:n}){return(t==null?void 0:t.startsWith("language-"))||typeof n=="string"&&n.includes(`
`)?h.jsx(Uee,{className:t,deferMermaid:e,children:String(n)}):h.jsx(Hee,{children:n})},pre({children:t}){return h.jsx(h.Fragment,{children:t})},a({href:t,children:n}){const r=Lee(t)?t:void 0;return h.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:ln.link,children:n})},table({children:t}){return h.jsx("div",{className:ln.tableWrapper,children:h.jsx("table",{className:ln.table,children:t})})},img({src:t,alt:n}){const r=aD(t)?t:void 0;return h.jsx("img",{src:r,alt:n||"",className:ln.image})}}}const qee=oD(),Fee=oD(!0),yd=v.memo(function({content:t,source:n,deferMermaid:r}){const{markdown:i}=hu();if(!t)return null;const s=n?i:void 0,a=n&&(s!=null&&s.transformMarkdown)?s.transformMarkdown(t,{source:n}):t,o=r?Fee:qee,l=s!=null&&s.components?{...o,...s.components}:o,c=s!=null&&s.remarkPlugins?[jS,w7,...s.remarkPlugins]:[jS,w7],u=s!=null&&s.rehypePlugins?[N7,...s.rehypePlugins]:[N7];return h.jsx("div",{className:n!=="thinking"?ln.content:void 0,"data-markdown-source":n,children:h.jsx(EG,{remarkPlugins:c,rehypePlugins:u,components:l,children:a})})}),Vee="_message_1htq5_1",Gee="_collapsedHead_1htq5_14",Wee="_prefix_1htq5_18",Kee="_body_1htq5_24",Yee="_collapseRow_1htq5_38",Xee="_collapseToggle_1htq5_54",Qee="_collapseMeta_1htq5_74",Jee="_images_1htq5_80",Zee="_imageThumb_1htq5_87",pa={message:Vee,collapsedHead:Gee,prefix:Wee,body:Kee,collapseRow:Yee,collapseToggle:Xee,collapseMeta:Qee,images:Jee,imageThumb:Zee};function ete(e){if(e<1e3)return`${Math.max(0,Math.round(e))}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/60),r=Math.round(t-n*60);return`${n}m ${r}s`}function Cv(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:`${e}`}function tte(e,t,n){const r=[];if(t!==void 0&&r.push(ete(t)),e.inputTokens!==void 0&&e.outputTokens!==void 0){const i=e.cachedTokens??0,s=i>0&&e.inputTokens>0?` (${Cv(i)} ${n("turn.cached")}, ${Math.round(i/e.inputTokens*100)}%)`:"";r.push(`↑${Cv(e.inputTokens)}${s} ↓${Cv(e.outputTokens)}`)}return e.toolCallCount!==void 0&&e.toolCallCount>0&&r.push(n("turn.toolCalls",{count:e.toolCallCount})),r.join(" · ")}function nte(e){return e.inputTokens!==void 0&&e.outputTokens!==void 0||e.toolCallCount!==void 0&&e.toolCallCount>0}function rte(e){const[t,n]=v.useState(()=>Date.now());return v.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[e]),t}const ite=v.memo(function({content:t,images:n,collapse:r,onToggleCollapse:i}){const{t:s}=ft(),a=!!r&&r.hiddenCount>0,o=r==null?void 0:r.liveStartedAt,l=!!r&&(a||o!==void 0||nte(r)),c=rte(o!==void 0&&l),u=v.useRef(0);let d;o!==void 0&&l?(u.current=Math.max(u.current,Math.max(0,c-o)),d=u.current):l&&(r==null?void 0:r.elapsedMs)!==void 0?(u.current=Math.max(u.current,r.elapsedMs),d=u.current):d=void 0;const f=r?tte(r,d,s):"",m=!!f&&l;return h.jsxs("div",{className:r!=null&&r.collapsed?`${pa.message} ${pa.collapsedHead}`:pa.message,children:[h.jsx("span",{className:pa.prefix,children:h.jsx(iM,{})}),h.jsxs("div",{className:pa.body,children:[n&&n.length>0&&h.jsx("div",{className:pa.images,children:n.map((p,b)=>{const x=p.data.startsWith("data:")?p.data:`data:${p.mimeType};base64,${p.data}`;return aD(x)?h.jsx("img",{src:x,alt:`User uploaded image ${b+1}`,className:pa.imageThumb},b):null})}),t,r&&i&&(a||m)&&h.jsxs("div",{className:pa.collapseRow,children:[a&&h.jsx("button",{type:"button",className:pa.collapseToggle,onClick:()=>i(r.turnId),"aria-expanded":!r.collapsed,"aria-label":r.collapsed?s("turn.expand"):s("turn.collapse"),title:r.collapsed?s("turn.expand"):s("turn.collapse"),children:`${r.collapsed?"▸":"▾"} ${s("turn.executionSteps",{count:r.hiddenCount})}`}),m&&h.jsx("span",{className:pa.collapseMeta,children:a?` · ${f}`:f})]})]})]})}),ste="_message_hrrk6_1",ate="_prefix_hrrk6_8",ote="_thinking_hrrk6_15",lte="_thinkingBody_hrrk6_28",cte="_thinkingPreviewWrap_hrrk6_59",ute="_thinkingExpandedWrap_hrrk6_60",dte="_thinkingPreview_hrrk6_59",hte="_thinkingPreviewTail_hrrk6_73",fte="_expandToggle_hrrk6_88",mte="_thinkingPreviewOverflow_hrrk6_111",pte="_content_hrrk6_147",gte="_contentBody_hrrk6_152",gi={message:ste,prefix:ate,thinking:ote,thinkingBody:lte,thinkingPreviewWrap:cte,thinkingExpandedWrap:ute,thinkingPreview:dte,thinkingPreviewTail:hte,expandToggle:fte,thinkingPreviewOverflow:mte,content:pte,contentBody:gte},yte=v.memo(function({content:t,thinking:n,isStreaming:r}){const{t:i}=ft(),s=v.useContext(gh),{compactThinking:a}=hu(),[o,l]=v.useState(!1),[c,u]=v.useState(!1),d=v.useRef(null),f=a&&!o;v.useEffect(()=>{const p=d.current;!p||!f||u(p.scrollHeight>p.clientHeight)},[f,n]),v.useEffect(()=>{const p=d.current;if(!p||!f)return;let b=0;const x=()=>{u(p.scrollHeight>p.clientHeight)},g=()=>{cancelAnimationFrame(b),b=requestAnimationFrame(x)};g();const y=new ResizeObserver(g);return y.observe(p),()=>{cancelAnimationFrame(b),y.disconnect()}},[f]),v.useEffect(()=>{const p=d.current;!p||!f||(r&&!t?p.scrollTop=p.scrollHeight:p.scrollTop=0)},[f,r,n,t]);const m=v.useCallback(()=>{l(p=>!p)},[]);return h.jsxs("div",{className:gi.message,children:[n&&!s&&h.jsxs("div",{className:gi.thinking,children:[h.jsx("span",{className:gi.prefix,children:"✦"}),h.jsx("div",{className:gi.thinkingBody,children:f?h.jsxs("div",{className:c?`${gi.thinkingPreviewWrap} ${gi.thinkingPreviewOverflow}`:gi.thinkingPreviewWrap,children:[h.jsx("div",{ref:d,className:`${gi.thinkingPreview} ${r?gi.thinkingPreviewTail:""}`,children:h.jsx(yd,{content:n,source:"thinking",deferMermaid:r})}),c&&h.jsx("button",{className:gi.expandToggle,onClick:m,"aria-expanded":!1,"aria-label":i("thinking.expand"),title:i("thinking.expand"),children:"▼"})]}):h.jsxs("div",{className:gi.thinkingExpandedWrap,children:[h.jsx(yd,{content:n,source:"thinking",deferMermaid:r}),a&&o&&h.jsx("button",{className:gi.expandToggle,onClick:m,"aria-expanded":!0,"aria-label":i("thinking.collapse"),title:i("thinking.collapse"),children:"▲"})]})})]}),t&&h.jsxs("div",{className:gi.content,children:[h.jsx("span",{className:gi.prefix,children:"✦"}),h.jsx("div",{className:gi.contentBody,children:h.jsx(yd,{content:t,source:"assistant",deferMermaid:r})})]})]})}),bte="_panel_1mqv4_1",vte="_title_1mqv4_17",xte="_metaLine_1mqv4_23",wte="_progress_1mqv4_33",kte="_spacer_1mqv4_39",_te="_row_1mqv4_43",Ste="_detailRow_1mqv4_44",Tte="_subDetailRow_1mqv4_45",Cte="_symbol_1mqv4_66",Ete="_label_1mqv4_70",Ate="_value_1mqv4_74",Mte="_detailName_1mqv4_81",Nte="_sectionTitle_1mqv4_89",Ite="_detailSection_1mqv4_95",Dte="_skillBlock_1mqv4_101",Rte="_hint_1mqv4_106",Ote="_detailCommand_1mqv4_112",jte="_bodyLoaded_1mqv4_133",Lte="_accent_1mqv4_138",Bte="_secondary_1mqv4_142",zte="_warning_1mqv4_146",Pte="_error_1mqv4_150",$te="_success_1mqv4_154",vt={panel:bte,title:vte,metaLine:xte,progress:wte,spacer:kte,row:_te,detailRow:Ste,subDetailRow:Tte,symbol:Cte,label:Ete,value:Ate,detailName:Mte,sectionTitle:Nte,detailSection:Ite,skillBlock:Dte,hint:Rte,detailCommand:Ote,bodyLoaded:jte,accent:Lte,secondary:Bte,warning:zte,error:Pte,success:$te},o2="web-shell:context-usage:v1:",il="█",lD="▒",cD="░",uD=30;function Ute(e){return`${o2}${JSON.stringify(e)}`}function Hte(e){if(!e.startsWith(o2))return null;try{const t=JSON.parse(e.slice(o2.length));return!(t!=null&&t.usage)||typeof t.usage.totalTokens!="number"?null:t}catch{return null}}function dD(e,t){return e.length<=t?e:`${e.slice(0,t-1)}…`}function $d(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:`${e}`}function qte(e,t){if(t<=0)return"0.0";const n=e/t*100;return n>100?">100":n.toFixed(1)}function Fte(e){return[...e].sort((t,n)=>n.tokens-t.tokens)}function Vte({usedPercentage:e,bufferPercentage:t}){const r=Math.round(Math.min(e,100)/100*56),i=Math.round(Math.min(t,Math.max(0,100-e))/100*56),s=Math.max(0,56-r-i),a=e>80?vt.error:e>60?vt.warning:vt.accent;return h.jsxs("div",{className:vt.progress,"aria-hidden":"true",children:[h.jsx("span",{className:a,children:il.repeat(Math.max(0,r))}),h.jsx("span",{className:vt.secondary,children:cD.repeat(Math.max(0,s))}),h.jsx("span",{className:vt.warning,children:lD.repeat(Math.max(0,i))})]})}function ao({symbol:e,label:t,tokens:n,tokenLabel:r,contextWindowSize:i,symbolClassName:s=vt.secondary,isOverLimit:a}){return h.jsxs("div",{className:vt.row,children:[h.jsx("span",{className:`${vt.symbol} ${s}`,children:e}),h.jsx("span",{className:vt.label,children:t}),h.jsxs("span",{className:a?vt.error:vt.value,children:[$d(n)," ",r," (",qte(n,i),"%)"]})]})}const Ev="/context detail";function Gte({hint:e,onShowDetail:t}){const n=t?e.indexOf(Ev):-1;return n<0?h.jsx("div",{className:vt.hint,children:e}):h.jsxs("div",{className:vt.hint,children:[e.slice(0,n),h.jsx("button",{type:"button",className:vt.detailCommand,onClick:t,children:Ev}),e.slice(n+Ev.length)]})}function Wte({name:e,tokens:t,tokenLabel:n}){return h.jsxs("div",{className:vt.detailRow,children:[h.jsxs("span",{className:vt.secondary,children:["└"," "]}),h.jsx("span",{className:vt.detailName,title:e,children:dD(e,uD)}),h.jsxs("span",{className:vt.value,children:[$d(t)," ",n]})]})}function Av({title:e,items:t,getName:n,tokenLabel:r}){const i=Fte(t);return i.length===0?null:h.jsxs("section",{className:vt.detailSection,children:[h.jsx("div",{className:vt.sectionTitle,children:e}),i.map(s=>h.jsx(Wte,{name:n(s),tokens:s.tokens,tokenLabel:r},n(s)))]})}function Kte({skills:e,labels:t}){const n=[...e].sort((r,i)=>r.loaded!==i.loaded?r.loaded?-1:1:i.tokens+(i.bodyTokens??0)-(r.tokens+(r.bodyTokens??0)));return n.length===0?null:h.jsxs("section",{className:vt.detailSection,children:[h.jsx("div",{className:vt.sectionTitle,children:t.skills}),n.map(r=>h.jsxs("div",{className:vt.skillBlock,children:[h.jsxs("div",{className:vt.detailRow,children:[h.jsxs("span",{className:vt.secondary,children:["└"," "]}),h.jsxs("span",{className:vt.detailName,title:r.name,children:[dD(r.name,uD),r.loaded&&h.jsxs("span",{className:vt.success,children:[" ",t.active]})]}),h.jsxs("span",{className:vt.value,children:[$d(r.tokens)," ",t.tokens]})]}),r.loaded&&r.bodyTokens!=null&&r.bodyTokens>0&&h.jsxs("div",{className:vt.subDetailRow,children:[h.jsxs("span",{className:vt.secondary,children:["  └"," "]}),h.jsx("span",{className:vt.bodyLoaded,children:t.bodyLoaded}),h.jsxs("span",{className:vt.success,children:["+",$d(r.bodyTokens)," ",t.tokens]})]})]},r.name))]})}function Yte({status:e,onShowDetail:t}){const{t:n}=ft(),{usage:r}=e,{breakdown:i,contextWindowSize:s}=r,a=s>0?r.totalTokens/s*100:0,o=a>100,l=s>0?i.autocompactBuffer/s*100:0;return h.jsxs("div",{className:vt.panel,children:[h.jsx("div",{className:vt.title,children:n("contextUsage.title")}),r.isEstimated?h.jsx(h.Fragment,{children:h.jsxs("div",{className:vt.metaLine,children:[h.jsxs("span",{children:[n("contextUsage.model"),": ",r.modelName]}),h.jsxs("span",{children:[n("contextUsage.contextWindow"),":"," ",$d(s)," ",n("contextUsage.tokens")]})]})}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:vt.metaLine,children:[h.jsxs("span",{children:[n("contextUsage.model"),": ",r.modelName]}),h.jsxs("span",{children:[n("contextUsage.contextWindow"),":"," ",$d(s)," ",n("contextUsage.tokens")]})]}),o&&h.jsx("div",{className:vt.error,children:n("contextUsage.overLimit")})]}),h.jsx(Vte,{usedPercentage:Math.min(a,100),bufferPercentage:l}),h.jsx("div",{className:vt.spacer}),h.jsx(ao,{symbol:il,label:n("contextUsage.used"),tokens:r.totalTokens,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s,symbolClassName:o?vt.error:vt.accent,isOverLimit:o}),h.jsx(ao,{symbol:cD,label:n("contextUsage.free"),tokens:i.freeSpace,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s}),h.jsx(ao,{symbol:lD,label:n("contextUsage.autocompactBuffer"),tokens:i.autocompactBuffer,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s,symbolClassName:vt.warning}),h.jsx("div",{className:vt.spacer}),h.jsx("div",{className:vt.sectionTitle,children:n("contextUsage.usageByCategory")}),h.jsx(ao,{symbol:il,label:n("contextUsage.systemPrompt"),tokens:i.systemPrompt,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s,symbolClassName:vt.accent}),h.jsx(ao,{symbol:il,label:n("contextUsage.builtinTools"),tokens:i.builtinTools,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s,symbolClassName:vt.accent}),i.mcpTools>0&&h.jsx(ao,{symbol:il,label:n("contextUsage.mcpTools"),tokens:i.mcpTools,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s,symbolClassName:vt.accent}),h.jsx(ao,{symbol:il,label:n("contextUsage.memoryFiles"),tokens:i.memoryFiles,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s,symbolClassName:vt.accent}),h.jsx(ao,{symbol:il,label:n("contextUsage.skills"),tokens:i.skills,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s,symbolClassName:vt.accent}),!r.isEstimated&&h.jsx(ao,{symbol:il,label:n("contextUsage.messages"),tokens:i.messages,tokenLabel:n("contextUsage.tokens"),contextWindowSize:s,symbolClassName:vt.accent}),r.showDetails?h.jsxs(h.Fragment,{children:[h.jsx(Av,{title:n("contextUsage.builtinTools"),items:r.builtinTools,getName:c=>"name"in c?c.name:c.path,tokenLabel:n("contextUsage.tokens")}),h.jsx(Av,{title:n("contextUsage.mcpTools"),items:r.mcpTools,getName:c=>"name"in c?c.name:c.path,tokenLabel:n("contextUsage.tokens")}),h.jsx(Av,{title:n("contextUsage.memoryFiles"),items:r.memoryFiles,getName:c=>"path"in c?c.path:c.name,tokenLabel:n("contextUsage.tokens")}),h.jsx(Kte,{skills:r.skills,labels:{active:n("contextUsage.active"),bodyLoaded:n("contextUsage.bodyLoaded"),skills:n("contextUsage.skills"),tokens:n("contextUsage.tokens")}})]}):h.jsx(Gte,{hint:n("contextUsage.detailHint"),onShowDetail:t})]})}const Xte={edit:"Edit",write_file:"WriteFile",read_file:"ReadFile",grep_search:"Grep",glob:"Glob",run_shell_command:"Shell",todo_write:"TodoList",save_memory:"SaveMemory",agent:"Agent",skill:"Skill",exit_plan_mode:"ExitPlanMode",web_fetch:"WebFetch",list_directory:"ListFiles",lsp:"Lsp",ask_user_question:"AskUserQuestion",cron_create:"CronCreate",cron_list:"CronList",cron_delete:"CronDelete",task_stop:"TaskStop",send_message:"SendMessage",structured_output:"StructuredOutput",monitor:"Monitor",notebook_edit:"NotebookEdit",tool_search:"ToolSearch",enter_worktree:"EnterWorktree",exit_worktree:"ExitWorktree",enter_plan_mode:"EnterPlanMode",task_create:"TaskCreate",task_update:"TaskUpdate",task_list:"TaskList",team_create:"TeamCreate",team_delete:"TeamDelete",workflow:"Workflow",web_search:"WebSearch",bash:"Shell",shell:"Shell Command",read:"ReadFile",write:"WriteFile",search:"Grep"};function hD(e){return Xte[e]??e}function gu(e,t){const n=`toolName.${e}`,r=t(n);return r===n?hD(e):r}function q0(e){const t=e.toLowerCase();return t==="ask_user_question"||t==="askuserquestion"}function qr(e,t){return e.length<=t?e:e.slice(0,t)+"..."}const l2=2e3;function fD(e,t){const n=Jte(e,t);if(n)return qr(n,l2);const r=Zte(e,t);return r?qr(r,l2):""}function Pa(e){var t;if(!e.content)return u2(e.rawOutput);for(const n of e.content)if(n.type==="content"&&((t=n.content)!=null&&t.text))return n.content.text;return u2(e.rawOutput)}function Qte(e){if(e.status!=="completed"&&e.status!=="failed")return"";const t=e.toolName.toLowerCase();if(t==="grep_search"||t==="grep"||t==="search"){const a=Y7((u2(e.rawOutput)??"").trim());if(a)return a}const n=Pa(e);if(!n)return"";const r=n.split(`
`),i=r.length;if(t==="read"||t==="read_file"||t==="readfile")return`${i} line(s)`;if(t==="glob")return`Found ${r.filter(o=>o.trim()).length} matching file(s)`;if(t==="list_directory"||t==="listfiles")return`${r.filter(o=>o.trim()).length} item(s)`;if(Gl(t)){if(i>3)return`${i} lines of output`;const a=r[0]||"";return qr(a,80)}if(t==="grep_search"||t==="grep"||t==="search"){const a=Y7(n.trim());return a||`${r.filter(l=>l.trim()).length} result(s)`}if(t==="edit"||t==="write"||t==="write_file"||t==="editfile")return"";if(t==="webfetch"||t==="web_fetch"||t==="fetch"){const a=r[0]||"";return qr(a,80)}if(t==="websearch"||t==="web_search"){const a=r.filter(o=>o.trim()).length;return a>1?`${a} result(s)`:r[0]||""}if(q0(t))return"";const s=r[0]||"";return qr(s,80)}function Jte(e,t){if(!e.title)return null;const n=hD(e.toolName),r=e.title.trim();if(r===e.toolName||r===n)return null;const i=[n,e.toolName];for(const s of i)if(r.startsWith(s)){const a=r.slice(s.length);if(/^(:\s*|\s+)/.test(a))return X7(a.replace(/^:\s*|\s+/,""),t)}return X7(r,t)}function Y7(e){return e==="No matches found"||/^Found \d+ match(?:es)?(?: \(truncated\))?$/.test(e)?e:null}function Zte(e,t){const n=e.args||{},r=e.toolName.toLowerCase();if(n.command){let i=String(n.command);return n.directory&&r!=="shell"&&(i+=` [in ${rd(String(n.directory),t)}]`),n.is_background?i+=" [background]":n.timeout&&(i+=` [timeout: ${String(n.timeout)}ms]`),n.description&&(i+=` (${String(n.description).replace(/\n/g," ")})`),qr(i,l2)}if(r==="grep_search"||r==="grep"||r==="search"){const i=n.pattern??n.query;if(i){let s=`'${String(i)}'`;return n.path?s+=` in path '${String(n.path)}'`:(r==="grep_search"||r==="grep")&&(s+=" in path './'"),n.glob&&(s+=` (filter: '${String(n.glob)}')`),s}}if(r==="glob"&&n.pattern){let i=`'${String(n.pattern)}'`;return n.path&&(i+=` in path '${String(n.path)}'`),i}if(n.file_path)return n.description?String(n.description):rd(String(n.file_path),t);if(n.url){const i=String(n.url),s=typeof n.prompt=="string"?n.prompt:void 0,a=s?`${i} — "${qr(s,40)}"`:i;return qr(a,80)}if(n.path)return rd(String(n.path),t);if(n.query)return qr(String(n.query),60);if(r==="list_directory"||r==="listfiles"){const i=n.path||n.directory||"";return rd(String(i),t)}return n.description?String(n.description):""}function Gl(e){const t=e.toLowerCase();return t==="run_shell_command"||t==="bash"||t==="shell"||t==="execute_command"}function Ua(e,t){var n;return e.callId===t?!0:((n=e.subTools)==null?void 0:n.some(r=>Ua(r,t)))??!1}function X7(e,t){const n=e.trim();return mD(c2(n))?rd(n,t):n.replace(/(?:[A-Za-z]:)?\/[^\s'")]+/g,r=>rd(r,t))}function rd(e,t){const n=c2(e),r=t?c2(t).replace(/\/+$/,""):"";return r&&(n===r||n.startsWith(`${r}/`))?n.slice(r.length+1)||".":mD(n)?ene(n):n}function c2(e){return e.replace(/\\/g,"/")}function mD(e){return e.startsWith("/")||/^[A-Za-z]:\//.test(e)}function ene(e){return e.replace(/\/+$/,"").split("/").pop()||e}function oy(e){if(!e||typeof e!="object")return;const t=e;return t.type==="task_execution"?t:void 0}function kk(e){if(!e.rawOutput||typeof e.rawOutput!="object")return"";const t=e.rawOutput,n=typeof t.terminateReason=="string"?t.terminateReason:"";return typeof t.reason=="string"&&t.reason||n&&n!=="GOAL"&&n||typeof t.error=="string"&&t.error||""}function ly(e){if(e.status==="failed")return"failed";if(!e.rawOutput||typeof e.rawOutput!="object")return e.status;const t=e.rawOutput,n=typeof t.status=="string"?t.status.toLowerCase():"",r=kk(e);return n==="cancelled"||n==="canceled"||r.toLowerCase().includes("cancel")?"failed":e.status}function _k(e){return e>=1e6?`${(e/1e6).toFixed(1)}M tokens`:e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k tokens":`${e} tokens`}const tne="general-purpose";function Sk(e){var r;const t=oy(e.rawOutput);if(t){const i=t.subagentName;if(typeof i=="string"&&i)return i}const n=(r=e.args)==null?void 0:r.subagent_type;return typeof n=="string"&&n?n:e.toolName==="task"?"task":tne}function Tk(e){var s,a;if(e.title){const o=e.title.indexOf(": ");if(o>0)return e.title.slice(o+2)}const t=(s=e.args)==null?void 0:s.description;if(typeof t=="string"&&t.trim())return t.trim();const n=oy(e.rawOutput),r=n==null?void 0:n.taskDescription;if(typeof r=="string"&&r.trim())return r.trim();const i=(a=e.args)==null?void 0:a.prompt;return typeof i=="string"&&i.trim()?i.trim().split(`
`)[0]??"":""}function pD(e,t){var s,a;if(e.status!=="in_progress")return"";const n=e.subTools;if(!n||n.length===0)return"";const r=n[n.length-1];if(r.status!=="in_progress"&&r.status!=="pending")return"";let i=gu(r.toolName??"",t);if(r.title){const o=r.title.indexOf(": ");i+=" "+(o>0?r.title.slice(o+2):r.title)}else(s=r.args)!=null&&s.command?i+=" "+String(r.args.command):(a=r.args)!=null&&a.file_path&&(i+=" "+String(r.args.file_path));return qr(i,50)}function u2(e){if(!e)return null;if(typeof e=="string")return e;if(typeof e!="object")return null;const t=e;return typeof t.output=="string"?t.output:typeof t.stdout=="string"?t.stdout:typeof t.content=="string"?t.content:typeof t.reason=="string"?t.reason:typeof t.terminateReason=="string"?t.terminateReason:typeof t.error=="string"?t.error:typeof t.text=="string"?t.text:null}const nne="_panel_9jmqd_1",rne="_title_9jmqd_18",ine="_sectionTitle_9jmqd_24",sne="_spacer_9jmqd_30",ane="_pivotRow_9jmqd_36",one="_metricCell_9jmqd_42",lne="_metricCellSection_9jmqd_49",cne="_metricCellSub_9jmqd_57",une="_modelCell_9jmqd_65",dne="_modelCellHeader_9jmqd_72",hne="_divider_9jmqd_80",fne="_kvRow_9jmqd_88",mne="_kvSubRow_9jmqd_95",pne="_kvLabel_9jmqd_103",gne="_kvValue_9jmqd_107",yne="_tableRow_9jmqd_116",bne="_tableNameCol_9jmqd_122",vne="_tableToolCol_9jmqd_132",xne="_tableNumCol_9jmqd_140",wne="_success_9jmqd_150",kne="_error_9jmqd_154",_ne="_secondary_9jmqd_158",Sne="_warning_9jmqd_162",Ne={panel:nne,title:rne,sectionTitle:ine,spacer:sne,pivotRow:ane,metricCell:one,metricCellSection:lne,metricCellSub:cne,modelCell:une,modelCellHeader:dne,divider:hne,kvRow:fne,kvSubRow:mne,kvLabel:pne,kvValue:gne,tableRow:yne,tableNameCol:bne,tableToolCol:vne,tableNumCol:xne,success:wne,error:kne,secondary:_ne,warning:Sne},d2="web-shell:session-stats:v1:";function Tne(e,t="overview"){return`${d2}${JSON.stringify({_view:t,...e})}`}function Cne(e){if(!e.startsWith(d2))return null;try{const t=JSON.parse(e.slice(d2.length));if(!t||typeof t.durationMs!="number")return null;const n=t._view??"overview";return delete t._view,{view:n,status:t}}catch{return null}}function Ll(e){if(e<=0)return"0s";if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=Math.floor(t%60),s=[];return n>0&&s.push(`${n}h`),r>0&&s.push(`${r}m`),i>0&&s.push(`${i}s`),s.join(" ")||"0s"}function Ac({label:e,children:t}){return h.jsxs("div",{className:Ne.kvRow,children:[h.jsx("span",{className:Ne.kvLabel,children:e}),h.jsx("span",{className:Ne.kvValue,children:t})]})}function Mf({label:e,children:t}){return h.jsxs("div",{className:Ne.kvSubRow,children:[h.jsxs("span",{className:Ne.secondary,children:["»"," ",e]}),h.jsx("span",{className:Ne.kvValue,children:t})]})}function gD(e){return Object.entries(e).filter(([,t])=>t.api.totalRequests>0).map(([t,n])=>{const r=t.split("::"),i=r[0],s=r[1],a=s?`${i} (${s})`:i;return{key:t,label:a,metrics:n}})}function Ene(e){return e.api.totalRequests===0?0:e.api.totalErrors/e.api.totalRequests*100}function Ane(e){return e.api.totalRequests===0?0:e.api.totalLatencyMs/e.api.totalRequests}function Mne(e){return e.tokens.prompt===0?0:e.tokens.cached/e.tokens.prompt*100}function ga({metric:e,values:t,variant:n="normal"}){const r=n==="section"?Ne.metricCellSection:n==="sub"?Ne.metricCellSub:Ne.metricCell;return h.jsxs("div",{className:Ne.pivotRow,children:[h.jsx("span",{className:r,children:n==="sub"?`↳ ${e}`:e}),t.map((i,s)=>h.jsx("span",{className:Ne.modelCell,children:i},s))]})}function Nne({status:e}){const{t}=ft(),{models:n,tools:r,files:i}=e,s=Object.values(n).reduce((b,x)=>b+x.api.totalLatencyMs,0),a=r.totalDurationMs,o=s+a,l=o>0?s/o*100:0,c=o>0?a/o*100:0,u=r.totalCalls>0?r.totalSuccess/r.totalCalls*100:0,d=gD(n),f=d.reduce((b,x)=>b+x.metrics.tokens.cached,0),m=d.reduce((b,x)=>b+x.metrics.tokens.prompt,0),p=m>0?f/m*100:0;return h.jsxs("div",{className:Ne.panel,children:[h.jsx("div",{className:Ne.title,children:t("stats.title")}),h.jsx("div",{className:Ne.sectionTitle,children:t("stats.overview")}),h.jsx(Ac,{label:t("stats.duration"),children:Ll(e.durationMs)}),h.jsx(Ac,{label:t("stats.prompts"),children:e.promptCount}),h.jsx(Ac,{label:t("stats.toolCalls"),children:h.jsxs("span",{children:[r.totalCalls," ",h.jsx("span",{className:Ne.secondary,children:"("}),h.jsxs("span",{className:Ne.success,children:["✓",r.totalSuccess]})," ",h.jsxs("span",{className:Ne.error,children:["✗",r.totalFail]}),h.jsx("span",{className:Ne.secondary,children:")"})]})}),h.jsx(Ac,{label:t("stats.successRate"),children:h.jsxs("span",{className:u>=90?Ne.success:u>=70?Ne.warning:Ne.error,children:[u.toFixed(1),"%"]})}),(i.totalLinesAdded>0||i.totalLinesRemoved>0)&&h.jsx(Ac,{label:t("stats.codeChanges"),children:h.jsxs("span",{children:[h.jsxs("span",{className:Ne.success,children:["+",i.totalLinesAdded]})," ",h.jsxs("span",{className:Ne.error,children:["-",i.totalLinesRemoved]})]})}),h.jsx("div",{className:Ne.spacer}),h.jsx("div",{className:Ne.sectionTitle,children:t("stats.performance")}),h.jsxs(Mf,{label:t("stats.apiTime"),children:[Ll(s)," ",h.jsxs("span",{className:Ne.secondary,children:["(",l.toFixed(1),"%)"]})]}),h.jsxs(Mf,{label:t("stats.toolTime"),children:[Ll(a)," ",h.jsxs("span",{className:Ne.secondary,children:["(",c.toFixed(1),"%)"]})]}),d.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Ne.spacer}),h.jsx("div",{className:Ne.sectionTitle,children:t("stats.modelUsage")}),h.jsx("div",{className:Ne.spacer}),h.jsxs("div",{className:Ne.tableRow,children:[h.jsx("span",{className:Ne.tableNameCol,children:t("stats.modelUsage")}),h.jsx("span",{className:Ne.tableNumCol,children:t("stats.reqs")}),h.jsx("span",{className:Ne.tableNumCol,children:t("stats.inputTokens")}),h.jsx("span",{className:Ne.tableNumCol,children:t("stats.outputTokens")})]}),h.jsx("div",{className:Ne.divider}),d.map(b=>h.jsxs("div",{className:Ne.tableRow,children:[h.jsx("span",{className:Ne.tableNameCol,children:b.label}),h.jsx("span",{className:Ne.tableNumCol,children:b.metrics.api.totalRequests}),h.jsx("span",{className:`${Ne.tableNumCol} ${Ne.warning}`,children:b.metrics.tokens.prompt.toLocaleString()}),h.jsx("span",{className:`${Ne.tableNumCol} ${Ne.warning}`,children:b.metrics.tokens.candidates.toLocaleString()})]},b.key)),p>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Ne.spacer}),h.jsxs("div",{children:[h.jsx("span",{className:Ne.success,children:t("stats.savingsHighlight")})," ",f.toLocaleString()," (",p.toFixed(1),"%)"," ",t("stats.cacheDesc")]}),h.jsxs("div",{className:Ne.secondary,children:["»"," ",t("stats.modelTip")]})]})]})]})}function Ine({status:e}){const{t}=ft(),n=gD(e.models);if(n.length===0)return h.jsxs("div",{className:Ne.panel,children:[h.jsx("div",{className:Ne.title,children:t("stats.modelStats")}),h.jsx("div",{children:t("stats.noApiCalls")})]});const r=n.some(a=>a.metrics.tokens.cached>0),i=n.some(a=>a.metrics.tokens.thoughts>0),s=a=>n.map(o=>a(o.metrics));return h.jsxs("div",{className:Ne.panel,children:[h.jsx("div",{className:Ne.title,children:t("stats.modelStats")}),h.jsx("div",{className:Ne.spacer}),h.jsxs("div",{className:Ne.pivotRow,children:[h.jsx("span",{className:Ne.metricCellSection,children:t("stats.metric")}),n.map(a=>h.jsx("span",{className:Ne.modelCellHeader,children:a.label},a.key))]}),h.jsx("div",{className:Ne.divider}),h.jsx(ga,{metric:t("stats.api"),values:[],variant:"section"}),h.jsx(ga,{metric:t("stats.requests"),values:s(a=>a.api.totalRequests.toLocaleString())}),h.jsx(ga,{metric:t("stats.errors"),values:s(a=>{const o=Ene(a);return h.jsxs("span",{className:a.api.totalErrors>0?Ne.error:void 0,children:[a.api.totalErrors.toLocaleString()," (",o.toFixed(1),"%)"]})})}),h.jsx(ga,{metric:t("stats.avgLatency"),values:s(a=>Ll(Ane(a)))}),h.jsx("div",{className:Ne.spacer}),h.jsx(ga,{metric:t("stats.tokens"),values:[],variant:"section"}),h.jsx(ga,{metric:t("stats.total"),values:s(a=>h.jsx("span",{className:Ne.warning,children:a.tokens.total.toLocaleString()}))}),h.jsx(ga,{metric:t("stats.prompt"),values:s(a=>a.tokens.prompt.toLocaleString()),variant:"sub"}),r&&h.jsx(ga,{metric:t("stats.cached"),values:s(a=>h.jsxs("span",{className:Ne.success,children:[a.tokens.cached.toLocaleString()," (",Mne(a).toFixed(1),"%)"]})),variant:"sub"}),i&&h.jsx(ga,{metric:t("stats.thoughts"),values:s(a=>a.tokens.thoughts.toLocaleString()),variant:"sub"}),h.jsx(ga,{metric:t("stats.output"),values:s(a=>a.tokens.candidates.toLocaleString()),variant:"sub"})]})}function Dne(e){return Object.entries(e).filter(([,t])=>t.count>0).sort((t,n)=>n[1].count-t[1].count).map(([t,n])=>({name:t,stats:n}))}function Rne({status:e}){const{t}=ft(),n=Dne(e.tools.byName);if(n.length===0)return h.jsxs("div",{className:Ne.panel,children:[h.jsx("div",{className:Ne.title,children:t("stats.toolStats")}),h.jsx("div",{children:t("stats.noToolCalls")})]});const r=Object.values(e.tools.byName).reduce((a,o)=>{var l,c,u;return a.accept+=((l=o.decisions)==null?void 0:l.accept)??0,a.reject+=((c=o.decisions)==null?void 0:c.reject)??0,a.modify+=((u=o.decisions)==null?void 0:u.modify)??0,a},{accept:0,reject:0,modify:0}),i=r.accept+r.reject+r.modify,s=i>0?r.accept/i*100:0;return h.jsxs("div",{className:Ne.panel,children:[h.jsx("div",{className:Ne.title,children:t("stats.toolStats")}),h.jsx("div",{className:Ne.spacer}),h.jsxs("div",{className:Ne.tableRow,children:[h.jsx("span",{className:Ne.tableToolCol,children:t("stats.toolName")}),h.jsx("span",{className:Ne.tableNumCol,children:t("stats.calls")}),h.jsx("span",{className:Ne.tableNumCol,children:t("stats.successRate")}),h.jsx("span",{className:Ne.tableNumCol,children:t("stats.avgDuration")})]}),h.jsx("div",{className:Ne.divider}),n.map(a=>{const o=a.stats.count>0?a.stats.success/a.stats.count*100:0,l=a.stats.count>0?a.stats.durationMs/a.stats.count:0;return h.jsxs("div",{className:Ne.tableRow,children:[h.jsx("span",{className:`${Ne.tableToolCol} ${Ne.metricCell}`,children:gu(a.name,t)}),h.jsx("span",{className:Ne.tableNumCol,children:a.stats.count}),h.jsxs("span",{className:`${Ne.tableNumCol} ${o>=90?Ne.success:o>=70?Ne.warning:Ne.error}`,children:[o.toFixed(1),"%"]}),h.jsx("span",{className:Ne.tableNumCol,children:Ll(l)})]},a.name)}),h.jsx("div",{className:Ne.spacer}),h.jsx("div",{className:Ne.sectionTitle,children:t("stats.decisionSummary")}),h.jsx(Ac,{label:t("stats.totalReviewed"),children:i}),h.jsx(Mf,{label:t("stats.accepted"),children:h.jsx("span",{className:Ne.success,children:r.accept})}),h.jsx(Mf,{label:t("stats.rejected"),children:h.jsx("span",{className:Ne.error,children:r.reject})}),h.jsx(Mf,{label:t("stats.modified"),children:h.jsx("span",{className:Ne.warning,children:r.modify})}),h.jsx("div",{className:Ne.divider}),h.jsx(Ac,{label:t("stats.agreementRate"),children:h.jsx("span",{className:i>0?s>=90?Ne.success:s>=70?Ne.warning:Ne.error:void 0,children:i>0?`${s.toFixed(1)}%`:"--"})})]})}function One({view:e,status:t}){switch(e){case"model":return h.jsx(Ine,{status:t});case"tools":return h.jsx(Rne,{status:t});default:return h.jsx(Nne,{status:t})}}function cy(e){return{serialize(t){return`${e}${JSON.stringify(t)}`},parse(t){if(!t.startsWith(e))return null;try{const n=JSON.parse(t.slice(e.length));return!n||typeof n!="object"?null:n}catch{return null}}}}const jne="_panel_1qrll_1",Lne="_title_1qrll_17",Bne="_row_1qrll_23",zne="_rowGap_1qrll_31",Pne="_label_1qrll_35",$ne="_value_1qrll_41",Une="_accent_1qrll_46",Dc={panel:jne,title:Lne,row:Bne,rowGap:zne,label:Pne,value:$ne,accent:Une},{serialize:Hne,parse:qne}=cy("web-shell:status:v1:");function Js({label:e,children:t,gap:n}){return h.jsxs("div",{className:`${Dc.row}${n?` ${Dc.rowGap}`:""}`,children:[h.jsx("span",{className:Dc.label,children:e}),h.jsx("span",{className:Dc.value,children:t})]})}function Fne({info:e}){const{t}=ft();return h.jsxs("div",{className:Dc.panel,children:[h.jsx("div",{className:Dc.title,children:t("about.title")}),e.cliVersion&&h.jsx(Js,{label:t("about.qwenCode"),children:h.jsx("span",{className:Dc.accent,children:e.cliVersion})}),e.runtime&&h.jsx(Js,{label:t("about.runtime"),children:e.runtime}),e.platform&&h.jsx(Js,{label:t("about.platform"),children:e.platform}),e.auth&&h.jsx(Js,{label:t("about.auth"),gap:!0,children:e.auth}),e.baseUrl&&h.jsx(Js,{label:t("about.baseUrl"),children:e.baseUrl}),e.model&&h.jsx(Js,{label:t("about.model"),children:e.model}),e.fastModel&&e.fastModel!==e.model&&h.jsx(Js,{label:t("about.fastModel"),children:e.fastModel}),e.sessionId&&h.jsx(Js,{label:t("about.sessionId"),children:e.sessionId}),h.jsx(Js,{label:t("about.sandbox"),children:e.sandbox||t("about.noSandbox")}),h.jsx(Js,{label:t("about.proxy"),children:e.proxy||t("about.noProxy")}),e.memoryUsage&&h.jsx(Js,{label:t("about.memoryUsage"),children:e.memoryUsage})]})}function Kg(e){return e instanceof HTMLElement?e.isContentEditable?!0:!!e.closest('input, textarea, select, [contenteditable="true"], .cm-editor, [data-keyboard-scope]'):!1}function Vne(e){return e instanceof HTMLElement?!!e.closest("[data-keyboard-scope]"):!1}function ui(e,t,n=50){const r=v.useRef(e);v.useEffect(()=>{r.current=e},[e]),v.useEffect(()=>{const i=a=>{a.defaultPrevented||Kg(a.target)&&!Vne(a.target)||r.current(a)},s=setTimeout(()=>{window.addEventListener("keydown",i)},n);return()=>{clearTimeout(s),window.removeEventListener("keydown",i)}},t)}const Gne="_panel_1ndg7_1",Wne="_title_1ndg7_14",Kne="_header_1ndg7_19",Yne="_startup_1ndg7_25",Xne="_note_1ndg7_29",Qne="_secondary_1ndg7_30",Jne="_row_1ndg7_40",Zne="_selected_1ndg7_49",ere="_disabled_1ndg7_53",tre="_pointer_1ndg7_57",nre="_nameCell_1ndg7_63",rre="_truncate_1ndg7_70",ire="_separator_1ndg7_76",sre="_sectionTitle_1ndg7_80",are="_groupTitle_1ndg7_81",ore="_success_1ndg7_85",lre="_warning_1ndg7_89",cre="_error_1ndg7_93",ure="_group_1ndg7_81",dre="_list_1ndg7_103",hre="_description_1ndg7_109",fre="_schema_1ndg7_114",mre="_shortcuts_1ndg7_132",pre="_detail_1ndg7_138",gre="_serverFields_1ndg7_144",yre="_serverField_1ndg7_144",bre="_serverFieldLabel_1ndg7_157",vre="_detailBlock_1ndg7_161",xre="_parameters_1ndg7_162",wre="_invalidBlock_1ndg7_163",kre="_parameterRow_1ndg7_173",_re="_actionMessage_1ndg7_178",Sre="_oauthPage_1ndg7_184",Tre="_scrollHint_1ndg7_190",Ue={panel:Gne,title:Wne,header:Kne,startup:Yne,note:Xne,secondary:Qne,row:Jne,selected:Zne,disabled:ere,pointer:tre,nameCell:nre,truncate:rre,separator:ire,sectionTitle:sre,groupTitle:are,success:ore,warning:lre,error:cre,group:ure,list:dre,description:hre,schema:fre,shortcuts:mre,detail:pre,serverFields:gre,serverField:yre,serverFieldLabel:bre,detailBlock:vre,parameters:xre,invalidBlock:wre,parameterRow:kre,actionMessage:_re,oauthPage:Sre,scrollHint:Tre},a0="web-shell:mcp-panel-active",mc=10,{serialize:Cre,parse:Ere}=cy("web-shell:mcp-status:v1:");function yD(e){const t=Ere(e);return!t||!t.status?null:t}function Pm(e,t){if(e.disabled)return{icon:"✗",text:t("mcp.status.disabled"),className:Ue.error};switch(e.mcpStatus){case"connected":return{icon:"✓",text:t("mcp.status.connected"),className:Ue.success};case"connecting":return{icon:"🔄",text:t("mcp.status.starting"),className:Ue.warning};case"disconnected":default:return{icon:"🔴",text:t("mcp.status.disconnectedTitle"),className:Ue.error}}}function bD(e){const t=e.schema,n=(t==null?void 0:t.parametersJsonSchema)??(t==null?void 0:t.parameters)??t;return n&&typeof n=="object"?n:null}function Are(e){const t=bD(e);return t?JSON.stringify(t,null,2):""}function Mre(e,t){return e.extensionName?t("mcp.extensionMcp"):t("mcp.userMcp")}function Nre(e,t){return e.source==="project"?t("mcp.source.project"):e.source==="extension"||e.extensionName?t("mcp.source.extension"):t("mcp.source.user")}function Ire(e,t){var r;const n=e.config;if(n!=null&&n.httpUrl)return`${n.httpUrl} (http)`;if(n!=null&&n.url)return`${n.url} (sse)`;if(n!=null&&n.command){const i=((r=n.args)==null?void 0:r.join(" "))??"";return`${n.command} ${i} (stdio)`.trim()}return e.transport?`(${e.transport})`:t("mcp.status.unknown")}function Mv(e,t){const n=e.annotations??{},r=[];return n.destructiveHint&&r.push(t("mcp.annotation.destructive")),n.readOnlyHint&&r.push(t("mcp.annotation.readOnly")),n.openWorldHint&&r.push(t("mcp.annotation.openWorld")),n.idempotentHint&&r.push(t("mcp.annotation.idempotent")),r.join(", ")}function Q7(e,t){window.dispatchEvent(new CustomEvent(a0,{detail:{id:e,active:t}}))}function J7(e){if(e&&typeof e=="object"){const t=e.body;if(t&&typeof t=="object"){const n=t.data;if(n&&typeof n=="object"){const i=n.details;if(typeof i=="string"&&i)return i}const r=t.error;if(typeof r=="string"&&r)return r}if(e instanceof Error&&e.message)return e.message}return String(e)}function $m(e,t,n){return[`${t("mcp.oauth.server")}: ${e}`,"",t("mcp.oauth.starting",{name:e}),...n?["",n]:[]].join(`
`)}function Dre(e,t){return e?t("mcp.required"):""}function Rre(e,t){const n=bD(e),r=n==null?void 0:n.properties,i=Array.isArray(n==null?void 0:n.required)?new Set(n.required.filter(a=>typeof a=="string")):new Set;if(!r||typeof r!="object"){const a=Are(e);return a?h.jsx("pre",{className:Ue.schema,children:a}):null}const s=Object.entries(r);return s.length===0?null:h.jsxs("div",{className:Ue.parameters,children:[h.jsx("div",{className:Ue.sectionTitle,children:t("mcp.parameters")}),s.map(([a,o])=>{const l=o&&typeof o=="object"?o:{},c=typeof l.type=="string"?l.type:"any",u=typeof l.description=="string"?l.description:"";return h.jsx("div",{className:Ue.parameterRow,children:`• ${a}${Dre(i.has(a),t)}: ${c}${u?` - ${u}`:""}`},a)})]})}function Ore({message:e}){var X;const{t}=ft(),n=xU({autoLoad:!1}),[r,i]=v.useState(e.status),[s,a]=v.useState(e.toolsByServer),[o,l]=v.useState(null),[c,u]=v.useState(!1),d=v.useRef(`mcp-${Math.random().toString(36).slice(2)}`),[f,m]=v.useState(!0),[p,b]=v.useState("servers"),[x,g]=v.useState(0),[y,w]=v.useState(0),[C,E]=v.useState(0),S=v.useMemo(()=>r.servers??[],[r.servers]),T=S[x]??null,j=v.useMemo(()=>{var H;return T?((H=s[T.name])==null?void 0:H.tools)??[]:[]},[T,s]),z=j[C]??null,R=v.useMemo(()=>j.length<=mc||C<mc-1?0:Math.min(C-mc+1,j.length-mc),[C,j.length]),D=v.useMemo(()=>j.slice(R,R+mc),[j,R]),N=S.filter(H=>!H.disabled&&H.mcpStatus==="connecting").length,B=v.useMemo(()=>{const H=[];for(const O of S){const se=Mre(O,t),ke=H.find(be=>be.label===se);ke?ke.servers.push(O):H.push({label:se,servers:[O]})}return H},[S,t]),P=v.useMemo(()=>S.length===0?20:Math.min(Math.max(...S.map(H=>H.name.length))+2,35),[S]),J=v.useMemo(()=>j.length===0?30:Math.min(Math.max(...j.map(H=>H.name.length))+2,50),[j]),q=v.useMemo(()=>{if(!T)return[];const H=[];return!T.disabled&&j.length>0&&H.push({id:"view-tools",label:t("mcp.action.tools")}),!T.disabled&&T.mcpStatus==="disconnected"&&H.push({id:"reconnect",label:t("mcp.action.reconnect")}),H.push({id:T.disabled?"enable":"disable",label:T.disabled?t("mcp.action.enable"):t("mcp.action.disable")}),T.disabled||(H.push({id:"authenticate",label:T.hasOAuthTokens?t("mcp.action.reauth"):t("mcp.action.auth")}),T.hasOAuthTokens&&H.push({id:"clear-auth",label:t("mcp.action.clearAuth")})),H},[T,j.length,t]),W=v.useCallback(async()=>{var O;const H=await n.reload();if(H){i(H);const se=((O=H.servers)==null?void 0:O.find(ke=>ke.name===(T==null?void 0:T.name)))??null;if(se){const ke=await n.loadTools(se.name);a(be=>({...be,[se.name]:ke}))}}},[n,T==null?void 0:T.name]),$=v.useCallback(async H=>{if(!(!T||H.disabled||c)){if(H.id==="view-tools"){b("tools"),E(0),l(null);return}u(!0),H.id==="authenticate"&&b("oauth"),l(H.id==="authenticate"?$m(T.name,t):t("mcp.action.running",{action:H.label}));try{let O=null;if(H.id==="reconnect")await n.restartServer(T.name);else{const se=await n.manageServer(T.name,H.id),ke=[...se.messages??[],...se.authUrl?[se.authUrl]:[]].join(`
`);ke&&(O=H.id==="authenticate"?$m(T.name,t,ke):ke)}await W(),l(O??t("mcp.action.done",{action:H.label}))}catch(O){l(H.id==="authenticate"?$m(T.name,t,J7(O)):t("mcp.action.failed",{error:J7(O)}))}finally{u(!1)}}},[c,n,W,T,t]);if(v.useEffect(()=>{const H=d.current;return Q7(H,f),()=>Q7(H,!1)},[f]),v.useEffect(()=>{const H=O=>{const se=O.detail;se!=null&&se.active&&se.id&&se.id!==d.current&&m(!1)};return window.addEventListener(a0,H),()=>window.removeEventListener(a0,H)},[]),ui(H=>{if(f){if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),p==="servers"?m(!1):p==="server"?(b("servers"),w(0),l(null)):p==="oauth"?(b("server"),l(null)):p==="tools"?(b("server"),E(0)):b("tools");return}if(H.key==="ArrowUp"||H.key==="ArrowDown"){H.preventDefault(),H.stopPropagation();const O=H.key==="ArrowUp"?-1:1;p==="servers"?(g(se=>Math.min(Math.max(se+O,0),S.length-1)),w(0)):p==="server"?w(se=>Math.min(Math.max(se+O,0),q.length-1)):p==="tools"&&E(se=>Math.min(Math.max(se+O,0),j.length-1));return}if(H.key==="Enter")if(H.preventDefault(),H.stopPropagation(),p==="servers"&&S.length>0)b("server"),w(0);else if(p==="server"&&q.length>0){const O=q[y];O&&$(O)}else p==="tools"&&j.length>0&&b("tool")}},[f,y,j.length,q,$,S.length,p]),!f)return null;if(S.length===0)return h.jsxs("div",{className:Ue.panel,"data-keyboard-scope":!0,children:[h.jsxs("div",{className:Ue.header,children:[h.jsx("div",{className:Ue.title,children:t("mcp.manageServers")}),h.jsx("div",{className:Ue.secondary,children:t("mcp.servers",{count:0})})]}),h.jsx("div",{className:Ue.secondary,children:t("mcp.empty")}),h.jsx("div",{className:Ue.shortcuts,children:t("mcp.shortcut.close")})]});const Z=p==="servers"?t("mcp.manageServers"):p==="server"?(T==null?void 0:T.name)??t("mcp.manageServers"):p==="oauth"?t("mcp.oauth.title"):p==="tools"?t("mcp.toolsForServer",{name:(T==null?void 0:T.name)??"Server"}):(z==null?void 0:z.name)??t("mcp.toolDetail"),M=p==="servers"?t("mcp.servers",{count:S.length}):p==="server"||p==="oauth"?"":p==="tools"?t(j.length===1?"mcp.toolCount":"mcp.toolsCount",{count:j.length}):(z==null?void 0:z.serverToolName)??(T==null?void 0:T.name)??"";return h.jsxs("div",{className:Ue.panel,"data-keyboard-scope":!0,children:[N>0&&h.jsxs("div",{children:[h.jsx("div",{className:Ue.startup,children:t("mcp.starting",{count:N})}),h.jsx("div",{className:Ue.note,children:t("mcp.startingNote")})]}),h.jsxs("div",{className:Ue.header,children:[h.jsx("div",{className:Ue.title,children:Z}),M&&h.jsx("div",{className:Ue.secondary,children:M})]}),p==="servers"&&h.jsx("div",{className:Ue.list,children:B.map(H=>{let O=0;for(const se of B){if(se===H)break;O+=se.servers.length}return h.jsxs("div",{className:Ue.group,children:[h.jsx("div",{className:Ue.groupTitle,children:H.label}),H.servers.map((se,ke)=>{const be=O+ke,Ee=be===x,qe=Pm(se,t);return h.jsxs("div",{className:Ee?`${Ue.row} ${Ue.selected}`:Ue.row,onClick:()=>{g(be),b("server"),w(0)},onMouseEnter:()=>g(be),children:[h.jsx("span",{className:Ue.pointer,children:Ee?"❯":""}),h.jsx("span",{className:Ue.nameCell,style:{width:`${P}ch`},children:se.name}),h.jsx("span",{className:Ue.separator,children:"·"}),h.jsxs("span",{className:qe.className,children:[qe.icon," ",qe.text]})]},se.name)})]},H.label)})}),p==="server"&&T&&h.jsxs("div",{className:Ue.detail,children:[h.jsxs("div",{className:Ue.serverFields,children:[h.jsxs("div",{className:Ue.serverField,children:[h.jsxs("span",{className:Ue.serverFieldLabel,children:[t("mcp.status"),":"]}),h.jsxs("span",{className:Pm(T,t).className,children:[Pm(T,t).icon," ",Pm(T,t).text]})]}),h.jsxs("div",{className:Ue.serverField,children:[h.jsxs("span",{className:Ue.serverFieldLabel,children:[t("mcp.source"),":"]}),h.jsx("span",{children:Nre(T,t)})]}),h.jsxs("div",{className:Ue.serverField,children:[h.jsxs("span",{className:Ue.serverFieldLabel,children:[t("mcp.command"),":"]}),h.jsx("span",{className:Ue.truncate,children:Ire(T,t)})]}),((X=T.config)==null?void 0:X.cwd)&&h.jsxs("div",{className:Ue.serverField,children:[h.jsxs("span",{className:Ue.serverFieldLabel,children:[t("mcp.workingDirectory"),":"]}),h.jsx("span",{className:Ue.truncate,children:T.config.cwd})]}),!T.disabled&&h.jsxs("div",{className:Ue.serverField,children:[h.jsxs("span",{className:Ue.serverFieldLabel,children:[t("mcp.tools"),":"]}),h.jsx("span",{children:t(j.length===1?"mcp.toolCount":"mcp.toolsCount",{count:j.length})})]})]}),h.jsx("div",{className:Ue.list,children:q.map((H,O)=>{const se=O===y,ke=[Ue.row,se?Ue.selected:"",H.disabled?Ue.disabled:""].filter(Boolean).join(" ");return h.jsxs("div",{className:ke,onClick:()=>{w(O),$(H)},children:[h.jsx("span",{className:Ue.pointer,children:se?"❯":""}),h.jsx("span",{children:H.label})]},H.id)})}),o&&h.jsx("pre",{className:Ue.actionMessage,children:o})]}),p==="oauth"&&h.jsx("div",{className:Ue.oauthPage,children:h.jsx("pre",{className:Ue.actionMessage,children:o??(T?$m(T.name,t):t("mcp.status.unknown"))})}),p==="tools"&&h.jsx("div",{className:Ue.list,children:j.length===0?h.jsx("div",{className:Ue.secondary,children:t("mcp.emptyTools")}):D.map((H,O)=>{const se=R+O,ke=se===C,be=Mv(H,t);return h.jsxs("div",{className:ke?`${Ue.row} ${Ue.selected}`:Ue.row,onClick:()=>{E(se),b("tool")},onMouseEnter:()=>E(se),children:[h.jsx("span",{className:Ue.pointer,children:ke?"❯":""}),h.jsx("span",{className:Ue.nameCell,style:{width:`${J}ch`},children:H.name}),H.isValid?be?h.jsx("span",{className:Ue.secondary,children:be}):null:h.jsx("span",{className:Ue.warning,children:t("mcp.invalidReason",{reason:H.invalidReason||t("mcp.status.unknown")})})]},H.name)})}),p==="tools"&&j.length>mc&&h.jsxs("div",{className:Ue.scrollHint,children:[R>0?"↑ ":"  ",t("mcp.scrollPosition",{current:C+1,total:j.length}),R+mc<j.length?" ↓":""]}),p==="tool"&&z&&h.jsxs("div",{className:Ue.detail,children:[!z.isValid&&h.jsxs("div",{className:Ue.invalidBlock,children:[h.jsx("div",{className:Ue.sectionTitle,children:t("mcp.invalidToolWarning")}),h.jsxs("div",{children:[t("mcp.invalidReasonLabel")," ",z.invalidReason||t("mcp.status.unknown")]}),h.jsx("div",{className:Ue.secondary,children:t("mcp.invalidToolHelp")})]}),z.description&&h.jsxs("div",{className:Ue.detailBlock,children:[h.jsx("div",{className:Ue.sectionTitle,children:t("mcp.description")}),h.jsx("div",{className:Ue.description,children:z.description.trim()})]}),Mv(z,t)&&h.jsxs("div",{className:Ue.detailBlock,children:[h.jsx("span",{className:Ue.sectionTitle,children:t("mcp.annotations")})," ",h.jsx("span",{children:Mv(z,t)})]}),Rre(z,t)]}),h.jsx("div",{className:Ue.shortcuts,children:t(p==="servers"?"mcp.shortcut.selectClose":p==="server"||p==="tools"?"mcp.shortcut.selectBack":"mcp.shortcut.back")})]})}function vD(e){const t=Math.max(0,Math.floor(e/1e3)),n=t%60,r=Math.floor(t/60);if(r===0)return`${n}s`;const i=r%60,s=Math.floor(r/60);return s===0?`${i}m ${n}s`:`${s}h ${i}m`}const jre="_panel_jsvnw_1",Lre="_title_jsvnw_13",Bre="_sectionTitle_jsvnw_18",zre="_overflowHint_jsvnw_22",Pre="_header_jsvnw_27",$re="_secondary_jsvnw_33",Ure="_row_jsvnw_37",Hre="_selected_jsvnw_45",qre="_pointer_jsvnw_49",Fre="_nameCell_jsvnw_55",Vre="_truncate_jsvnw_62",Gre="_separator_jsvnw_68",Wre="_list_jsvnw_72",Kre="_success_jsvnw_78",Yre="_warning_jsvnw_82",Xre="_error_jsvnw_86",Qre="_detail_jsvnw_90",Jre="_detailField_jsvnw_99",Zre="_detailFieldLabel_jsvnw_106",eie="_shortcuts_jsvnw_111",tie="_confirmHint_jsvnw_117",nie="_statusBadge_jsvnw_121",rie="_activityCurrent_jsvnw_127",iie="_activityPast_jsvnw_134",sie="_promptContent_jsvnw_141",ut={panel:jre,title:Lre,sectionTitle:Bre,overflowHint:zre,header:Pre,secondary:$re,row:Ure,selected:Hre,pointer:qre,nameCell:Fre,truncate:Vre,separator:Gre,list:Wre,success:Kre,warning:Yre,error:Xre,detail:Qre,detailField:Jre,detailFieldLabel:Zre,shortcuts:eie,confirmHint:tie,statusBadge:nie,activityCurrent:rie,activityPast:iie,promptContent:sie},Ud="web-shell:tasks-panel-active",aie=3e3,Z7=8,{serialize:oie,parse:lie}=cy("web-shell:tasks-status:v1:");function cie(e){const t=lie(e);return!t||!t.snapshot?null:t}function e8(e,t){window.dispatchEvent(new CustomEvent(Ud,{detail:{id:e,active:t}}))}function t8(e){return e.status==="running"||e.status==="paused"}function Nv(e){return[...e].sort((t,n)=>{const r=t8(t),i=t8(n);return r!==i?r?-1:1:r?n.startTime-t.startTime:(n.endTime??n.startTime)-(t.endTime??t.startTime)})}function uie(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function xD(e){switch(e){case"running":return ut.success;case"paused":return ut.warning;case"completed":return ut.success;case"failed":return ut.error;case"cancelled":return ut.warning;default:return""}}function die(e){switch(e){case"paused":return"⏸";case"completed":return"✓";case"failed":case"cancelled":return"✗";case"running":return null;default:return null}}function hie(e){switch(e.kind){case"agent":return e.isBackgrounded?e.label:`[blocking] ${e.label}`;case"shell":return`[shell] ${e.command}`;case"monitor":return`[monitor] ${e.description}`}}function fie(e,t){if(e.length<=Z7)return{visible:e,windowStart:0,hiddenAbove:0,hiddenBelow:0};const n=Math.max(1,Z7-2),r=Math.max(0,Math.min(t-Math.floor(n/2),e.length-n)),i=Math.min(e.length,r+n);return{visible:e.slice(r,i),windowStart:r,hiddenAbove:r,hiddenBelow:e.length-i}}function mie(e,t,n){const r=gu(e,n),i=t?t.replace(/\s*\n\s*/g," ").trim():"";return i?`${r}(${i})`:r}function wD({message:e,manageActiveEvent:t=!0,onClose:n}){const{t:r}=ft(),i=T3(),[s,a]=v.useState(()=>Nv(e.snapshot.tasks)),[o,l]=v.useState(!0),[c,u]=v.useState("list"),[d,f]=v.useState(0),[m,p]=v.useState(null),[b,x]=v.useState(!1),[g,y]=v.useState(!1),[w,C]=v.useState(null),E=v.useRef(`tasks-${Math.random().toString(36).slice(2)}`),S=v.useRef(!1),T=v.useRef(null),j=s.length===0?0:Math.min(d,s.length-1),z=s[j]??null;v.useEffect(()=>{if(!o)return;const Z=setInterval(()=>{S.current||(S.current=!0,i.getTasks().then(M=>{a(Nv(M.tasks)),y(!1)}).catch(M=>{console.warn("[web-shell] failed to refresh tasks:",M),y(!0)}).finally(()=>{S.current=!1}))},aie);return()=>clearInterval(Z)},[o,i]),v.useEffect(()=>{s.length===0&&d!==0&&f(0),d>=s.length&&s.length>0&&f(s.length-1)},[s.length,d]),v.useEffect(()=>{if(!o||c!=="detail"){T.current=null;return}if(!z){T.current=null,u("list");return}const $=T.current;if(!$||$.taskId!==z.id){T.current={taskId:z.id,status:z.status};return}$.status==="running"&&z.status!=="running"&&(p(null),u("list"))},[o,c,z]),v.useEffect(()=>{if(!t)return;const $=E.current;return e8($,o),()=>e8($,!1)},[o,t]),v.useEffect(()=>{if(!t)return;const $=Z=>{const M=Z.detail;M!=null&&M.active&&M.id&&M.id!==E.current&&l(!1)};return window.addEventListener(Ud,$),()=>window.removeEventListener(Ud,$)},[t]),v.useEffect(()=>{o||n==null||n()},[o,n]);const R=v.useCallback(async $=>{if(b)return;const Z=$.status==="running",M=$.kind==="agent"&&$.status==="paused";if(!Z&&!M)return;if($.kind==="agent"&&!$.isBackgrounded&&m!==$.id){p($.id);return}p(null),x(!0);try{if(!(await i.cancelTask($.id,$.kind)).cancelled){C(r("tasks.alreadyStopped"));return}const O=await i.getTasks();a(Nv(O.tasks)),C(null)}catch(H){console.warn("[web-shell] failed to cancel task:",H),C(r("tasks.cancelFailed"))}finally{x(!1)}},[i,b,m,r]);if(ui($=>{if(o){if($.key==="Escape"){if($.preventDefault(),$.stopPropagation(),m){p(null);return}c==="detail"?u("list"):l(!1);return}if($.key==="ArrowLeft"){$.preventDefault(),$.stopPropagation(),c==="detail"?(p(null),u("list")):l(!1);return}if(($.key==="ArrowUp"||$.key==="ArrowDown")&&c==="list"){if($.preventDefault(),$.stopPropagation(),s.length===0)return;const Z=$.key==="ArrowUp"?-1:1;f(M=>Math.min(Math.max(M+Z,0),s.length-1)),p(null);return}if($.key==="Enter"){$.preventDefault(),$.stopPropagation(),c==="list"&&z?u("detail"):c==="detail"&&l(!1);return}if($.key===" "&&c==="detail"){$.preventDefault(),$.stopPropagation(),l(!1);return}if($.key==="x"&&!$.ctrlKey&&!$.metaKey){$.preventDefault(),$.stopPropagation(),z&&R(z);return}}},[o,c,s.length,z,R,m]),!o)return null;const D=m!==null&&z!==null&&m===z.id,N=[];D?(N.push(r("tasks.confirmStop")),N.push(r("tasks.shortcut.cancelConfirm"))):(N.push(r("tasks.shortcut.select")),N.push(r("tasks.shortcut.view")),(z==null?void 0:z.status)==="running"?N.push(r("tasks.shortcut.stop")):(z==null?void 0:z.kind)==="agent"&&(z==null?void 0:z.status)==="paused"&&N.push(r("tasks.shortcut.abandon")),N.push(r("tasks.shortcut.listClose")));const B=[];if(D?(B.push(r("tasks.confirmStop")),B.push(r("tasks.shortcut.cancelConfirm"))):(B.push(r("tasks.shortcut.detailBack")),B.push(r("tasks.shortcut.detailClose")),(z==null?void 0:z.status)==="running"?B.push(r("tasks.shortcut.stop")):(z==null?void 0:z.kind)==="agent"&&(z==null?void 0:z.status)==="paused"&&B.push(r("tasks.shortcut.abandon"))),s.length===0)return h.jsxs("div",{className:ut.panel,"data-keyboard-scope":!0,children:[h.jsxs("div",{className:ut.header,children:[h.jsx("div",{className:ut.title,children:r("tasks.title")}),g&&h.jsx("div",{className:ut.warning,children:r("tasks.refreshStale")}),w&&h.jsx("div",{className:ut.error,children:w})]}),h.jsxs("div",{children:[h.jsxs("div",{className:ut.sectionTitle,children:[r("tasks.title")," ",h.jsx("span",{className:ut.secondary,children:"(0)"})]}),h.jsx("div",{className:ut.secondary,children:r("tasks.empty")})]}),h.jsx("div",{className:ut.shortcuts,children:r("tasks.shortcut.close")})]});const{visible:P,windowStart:J,hiddenAbove:q,hiddenBelow:W}=fie(s,j);return h.jsxs("div",{className:ut.panel,"data-keyboard-scope":!0,children:[c==="list"&&h.jsxs("div",{className:ut.header,children:[h.jsx("div",{className:ut.title,children:r("tasks.title")}),g&&h.jsx("div",{className:ut.warning,children:r("tasks.refreshStale")}),w&&h.jsx("div",{className:ut.error,children:w})]}),c==="list"&&h.jsxs("div",{className:ut.list,children:[h.jsxs("div",{className:ut.sectionTitle,children:[r("tasks.title")," ",h.jsxs("span",{className:ut.secondary,children:["(",s.length,")"]})]}),q>0&&h.jsx("div",{className:ut.overflowHint,children:r("tasks.moreAbove",{count:q})}),P.map(($,Z)=>{const M=J+Z,X=M===j,H=xD($.status);return h.jsxs("div",{className:X?`${ut.row} ${ut.selected}`:ut.row,onClick:()=>{f(M),u("detail")},onMouseEnter:()=>f(M),children:[h.jsx("span",{className:ut.pointer,children:X?"❯":""}),h.jsx("span",{className:$.status==="running"?ut.nameCell:`${ut.nameCell} ${H}`,children:hie($)})]},$.id)}),W>0&&h.jsx("div",{className:ut.overflowHint,children:r("tasks.moreBelow",{count:W})})]}),c==="detail"&&z&&h.jsxs(h.Fragment,{children:[w&&h.jsx("div",{className:ut.error,children:w}),h.jsx(gie,{task:z,t:r})]}),h.jsx("div",{className:D?`${ut.shortcuts} ${ut.confirmHint}`:ut.shortcuts,children:(c==="list"?N:B).join(" · ")})]})}function pie(e,t){switch(e.kind){case"agent":return`${e.subagentType??"Agent"} › ${e.label}`;case"shell":return`${t("tasks.kind.shell")} › ${e.command}`;case"monitor":return`${t("tasks.kind.monitor")} › ${e.description}`}}function gie({task:e,t}){var a,o;const n=die(e.status),r=xD(e.status),i=[vD(e.runtimeMs)];e.kind==="agent"&&((a=e.stats)!=null&&a.totalTokens)&&i.push(t("tasks.detail.tokens",{count:uie(e.stats.totalTokens)})),e.kind==="agent"&&((o=e.stats)==null?void 0:o.toolUses)!==void 0&&i.push(t("tasks.detail.toolCalls",{count:e.stats.toolUses})),e.kind!=="agent"&&e.pid!==void 0&&i.push(`pid ${e.pid}`),e.kind==="shell"&&e.exitCode!==void 0&&i.push(t("tasks.detail.exit",{exitCode:e.exitCode})),e.kind==="monitor"&&(i.push(t("tasks.detail.events",{count:e.eventCount})),e.droppedLines>0&&i.push(t("tasks.detail.dropped",{count:e.droppedLines})),e.exitCode!==void 0&&i.push(t("tasks.detail.exit",{exitCode:e.exitCode})));const s=e.kind==="agent"&&e.prompt?e.prompt.split(`
`):[];return h.jsxs("div",{className:ut.detail,children:[h.jsx("div",{className:ut.title,children:pie(e,t)}),h.jsxs("div",{className:ut.statusBadge,children:[n&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:r,children:[n," ",t(`tasks.${e.status}`)]}),h.jsx("span",{className:ut.separator,children:"·"})]}),h.jsx("span",{className:ut.secondary,children:i.join(" · ")})]}),e.kind==="shell"&&h.jsxs(h.Fragment,{children:[h.jsx(Bh,{label:t("tasks.detail.workingDir"),value:e.cwd}),e.outputFile&&h.jsx(Bh,{label:t("tasks.detail.outputFile"),value:e.outputFile})]}),e.kind==="monitor"&&h.jsx(Bh,{label:t("tasks.detail.command"),value:e.command}),e.kind==="agent"&&e.subagentType&&h.jsx(Bh,{label:t("tasks.detail.type"),value:e.subagentType}),e.kind==="agent"&&e.recentActivities&&e.recentActivities.length>0&&h.jsxs("div",{children:[h.jsx("div",{className:ut.detailFieldLabel,children:t("tasks.detail.progress")}),e.recentActivities.slice(-5).map((l,c,u)=>{const d=c===u.length-1,f=mie(l.name,l.description,t);return h.jsxs("div",{className:d?ut.activityCurrent:ut.activityPast,children:[d?"> ":"  ",f]},`${l.at}-${c}`)})]}),e.kind==="agent"&&e.prompt&&h.jsxs("div",{children:[h.jsx("div",{className:ut.detailFieldLabel,children:t("tasks.detail.prompt")}),h.jsx("div",{className:ut.promptContent,children:s.slice(0,5).map((l,c,u)=>h.jsx("div",{className:ut.truncate,children:c===u.length-1&&s.length>5?`${l}…`:l||" "},c))})]}),e.kind==="agent"&&e.outputFile&&h.jsx(Bh,{label:t("tasks.detail.outputFile"),value:e.outputFile}),e.kind==="agent"&&e.status==="paused"&&e.resumeBlockedReason&&h.jsxs("div",{children:[h.jsx("div",{className:`${ut.detailFieldLabel} ${ut.error}`,children:t("tasks.detail.resumeBlocked")}),h.jsx("div",{className:ut.error,children:e.resumeBlockedReason})]}),e.error&&h.jsxs("div",{children:[h.jsx("div",{className:`${ut.detailFieldLabel} ${e.kind==="monitor"&&e.status!=="failed"?ut.warning:ut.error}`,children:e.kind==="monitor"&&e.status!=="failed"?t("tasks.detail.stoppedBecause"):t("tasks.detail.error")}),h.jsx("div",{className:e.kind==="monitor"&&e.status!=="failed"?ut.warning:ut.error,children:e.error})]})]})}function Bh({label:e,value:t}){return h.jsxs("div",{className:ut.detailField,children:[h.jsx("span",{className:ut.detailFieldLabel,children:e}),h.jsx("span",{className:ut.truncate,children:t})]})}const yie="_message_1obwq_1",bie="_prefix_1obwq_11",vie="_body_1obwq_16",xie="_title_1obwq_21",wie="_muted_1obwq_25",kie="_accent_1obwq_29",_ie="_success_1obwq_33",Sie="_error_1obwq_37",Tie="_warning_1obwq_41",Cie="_row_1obwq_45",Eie="_label_1obwq_51",Aie="_value_1obwq_56",vi={message:yie,prefix:bie,body:vie,title:xie,muted:wie,accent:kie,success:_ie,error:Sie,warning:Tie,row:Cie,label:Eie,value:Aie},h2="web-shell-goal-status-active",{serialize:n8,parse:Mie}=cy(S$),Nie=new Set(["set","achieved","cleared","failed","aborted","checking"]);function Yg(e){const t=typeof e=="string"?Mie(e):e;return Iie(t)}function Iie(e){if(!e||typeof e!="object")return null;const t=e,n=t.kind,r=t.condition;if(typeof n!="string"||!Nie.has(n)||typeof r!="string")return null;const i=Iv(t.iterations),s=Iv(t.durationMs),a=Iv(t.setAt),o=typeof t.lastReason=="string"?t.lastReason:void 0;return{kind:n,condition:r,...i!==void 0?{iterations:i}:{},...s!==void 0?{durationMs:s}:{},...a!==void 0?{setAt:a}:{},...o!==void 0?{lastReason:o}:{}}}function Iv(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Die(e,t){return t(e===1?"goal.turn":"goal.turns",{count:e})}function Rie(e,t){switch(e.kind){case"checking":return{prefix:"○",title:`${t("goal.check")}${e.iterations&&e.iterations>0?` · ${t("goal.turnLabel",{count:e.iterations})}`:""} · ${t("goal.notYetMet")}`,colorClass:vi.muted};case"set":return{prefix:"◎",title:t("goal.set"),colorClass:vi.accent};case"achieved":return{prefix:"✓",title:t("goal.achieved"),colorClass:vi.success};case"cleared":return{prefix:"○",title:t("goal.cleared"),colorClass:vi.muted};case"failed":return{prefix:"✖",title:t("goal.failed"),colorClass:vi.error};case"aborted":return{prefix:"!",title:t("goal.aborted"),colorClass:vi.warning}}}function Oie({status:e,activateFooter:t=!1}){var l;const{t:n}=ft();v.useEffect(()=>{if(!t)return;const c=e.kind==="set"||e.kind==="checking";window.dispatchEvent(new CustomEvent(h2,{detail:{active:c,condition:e.condition,setAt:e.setAt}}))},[t,e.condition,e.kind,e.setAt]);const r=Rie(e,n),i=[];e.kind!=="checking"&&(e.iterations&&e.iterations>0&&i.push(Die(e.iterations,n)),typeof e.durationMs=="number"&&i.push(vD(e.durationMs)));const s=i.length>0?` · ${i.join(" · ")}`:"",a=(e.kind==="checking"||e.kind==="achieved"||e.kind==="failed"||e.kind==="aborted")&&((l=e.lastReason)==null?void 0:l.trim()),o=e.kind==="checking"?n("goal.judge"):n("goal.lastCheck");return h.jsxs("div",{className:vi.message,children:[h.jsx("span",{className:`${vi.prefix} ${r.colorClass}`,children:r.prefix}),h.jsxs("div",{className:vi.body,children:[h.jsxs("div",{className:`${vi.title} ${r.colorClass}`,children:[r.title,s&&h.jsx("span",{className:vi.muted,children:s})]}),h.jsxs("div",{className:vi.row,children:[h.jsxs("span",{className:vi.label,children:[n("goal.label"),":"]}),h.jsx("span",{className:vi.value,children:e.condition})]}),a&&h.jsxs("div",{className:vi.muted,children:[o,": ",a]})]})]})}const jie="_message_t0ujh_1",Lie="_flushMessage_t0ujh_9",Bie="_info_t0ujh_27",zie="_modelSwitch_t0ujh_33",Pie="_error_t0ujh_37",$ie="_warning_t0ujh_43",Uie="_retryHint_t0ujh_49",Hie="_retryButton_t0ujh_56",Zs={message:jie,flushMessage:Lie,info:Bie,modelSwitch:zie,error:Pie,warning:$ie,retryHint:Uie,retryButton:Hie},qie=v.memo(function({content:t,variant:n,source:r,data:i,onShowContextDetail:s,isLatest:a=!1,showRetryHint:o=!1,onRetryClick:l}){const{t:c}=ft(),u=n==="info"?Hte(t):null;if(u)return h.jsx("div",{className:Zs.flushMessage,children:h.jsx(Yte,{status:u,onShowDetail:s})});const d=n==="info"?Cne(t):null;if(d)return h.jsx("div",{className:Zs.flushMessage,children:h.jsx(One,{view:d.view,status:d.status})});const f=n==="info"?qne(t):null;if(f)return h.jsx("div",{className:Zs.flushMessage,children:h.jsx(Fne,{info:f})});const m=n==="info"?yD(t):null;if(m)return h.jsx("div",{className:Zs.flushMessage,children:h.jsx(Ore,{message:m})});const p=n==="info"?cie(t):null;if(p)return h.jsx("div",{className:Zs.flushMessage,children:h.jsx(wD,{message:p})});const b=n==="info"?Yg(r==="goal"?i:t):null;if(b)return h.jsx("div",{className:Zs.flushMessage,children:h.jsx(Oie,{status:b,activateFooter:a})});const x=n==="info"&&t.startsWith("● authType:");return h.jsxs("div",{className:`${Zs.message} ${Zs[n]} ${x?Zs.modelSwitch:""}`,children:[x?h.jsx("pre",{children:t}):n==="info"?h.jsx(yd,{content:t}):h.jsx("pre",{children:t}),o&&l&&h.jsx("div",{className:Zs.retryHint,children:h.jsx("button",{type:"button",className:Zs.retryButton,onClick:l,children:c("retry.hint")})})]})}),Fie="_group_gkc7z_1",Vie="_line_gkc7z_15",Gie="_lineMain_gkc7z_20",Wie="_icon_gkc7z_27",Kie="_iconDone_gkc7z_32",Yie="_iconError_gkc7z_36",Xie="_iconPending_gkc7z_40",Qie="_iconSpin_gkc7z_44",Jie="_lineName_gkc7z_56",Zie="_lineArg_gkc7z_63",ese="_lineElapsed_gkc7z_73",tse="_lineExpandable_gkc7z_80",nse="_agentSummary_gkc7z_95",rse="_lineOutput_gkc7z_104",ise="_lineFullArg_gkc7z_116",sse="_lineDetail_gkc7z_128",ase="_expandedBash_gkc7z_131",ose="_expandedRead_gkc7z_132",lse="_expandedOutput_gkc7z_136",cse="_expandedEdit_gkc7z_149",use="_expandBtn_gkc7z_163",dse="_todoProgress_gkc7z_182",hse="_todoBody_gkc7z_189",fse="_compactGroup_gkc7z_193",mse="_compactHeader_gkc7z_201",pse="_compactCount_gkc7z_208",gse="_compactHint_gkc7z_214",rt={group:Fie,line:Vie,lineMain:Gie,icon:Wie,iconDone:Kie,iconError:Yie,iconPending:Xie,iconSpin:Qie,lineName:Jie,lineArg:Zie,lineElapsed:ese,lineExpandable:tse,agentSummary:nse,lineOutput:rse,lineFullArg:ise,lineDetail:sse,expandedBash:ase,expandedRead:ose,expandedOutput:lse,expandedEdit:cse,expandBtn:use,todoProgress:dse,todoBody:hse,compactGroup:fse,compactHeader:mse,compactCount:pse,compactHint:gse};function kl({status:e}){switch(e){case"completed":case"success":return h.jsx("span",{className:`${rt.icon} ${rt.iconDone}`,children:"✓"});case"failed":case"error":case"cancelled":case"canceled":return h.jsx("span",{className:`${rt.icon} ${rt.iconError}`,children:"✗"});case"in_progress":case"running":return h.jsx("span",{className:`${rt.icon} ${rt.iconSpin}`,children:"⟳"});default:return h.jsx("span",{className:`${rt.icon} ${rt.iconPending}`,children:"○"})}}function F0(e,t){if(!e)return"";const n=Math.round(((t||Date.now())-e)/1e3);if(n<3)return"";if(n<60)return`${n}s`;const r=Math.floor(n/60),i=n%60;return`${r}m ${i}s`}function kD(e){if(!e)return"";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}const yse="_panel_zc0gy_1",bse="_header_zc0gy_13",vse="_desc_zc0gy_25",xse="_toggle_zc0gy_34",wse="_meta_zc0gy_40",kse="_body_zc0gy_46",_se="_content_zc0gy_57",Sse="_stream_zc0gy_72",Tse="_streamCollapsed_zc0gy_82",Cse="_scrollWindow_zc0gy_89",Ese="_expandToggle_zc0gy_94",Ase="_tabBar_zc0gy_109",Mse="_tab_zc0gy_109",Nse="_tabActive_zc0gy_131",Ise="_tools_zc0gy_136",Dse="_toolTimeRow_zc0gy_153",Rse="_toolTimeTip_zc0gy_157",Fn={panel:yse,header:bse,desc:vse,toggle:xse,meta:wse,body:kse,content:_se,stream:Sse,streamCollapsed:Tse,scrollWindow:Cse,expandToggle:Ese,tabBar:Ase,tab:Mse,tabActive:Nse,tools:Ise,toolTimeRow:Dse,toolTimeTip:Rse};function _D(e){return!!e&&typeof e=="object"&&e.type==="task_execution"}function Ose({timestamp:e,children:t}){return e===void 0?h.jsx(h.Fragment,{children:t}):h.jsxs("div",{className:Fn.toolTimeRow,children:[t,h.jsx("span",{className:Fn.toolTimeTip,"aria-hidden":"true",children:Cg(e)})]})}const jse=v.memo(function({tool:t}){const n=t.subTools||t.subContent?h.jsx(Ck,{tool:t}):h.jsx(MD,{tool:t});return h.jsx(Ose,{timestamp:t.startTime,children:n})});function Lse({tc:e}){const{t}=ft(),n=e.description||"";return h.jsx("div",{className:rt.line,children:h.jsxs("div",{className:rt.lineMain,children:[h.jsx(kl,{status:e.status}),h.jsx("span",{className:rt.lineName,children:gu(e.name,t)}),n&&h.jsx("span",{className:rt.lineArg,children:qr(n,70)})]})})}function Bse(e){var t;if(e.rawOutput&&_D(e.rawOutput)&&e.rawOutput.result)return e.rawOutput.result;if(e.content){for(const n of e.content)if(n.type==="content"&&((t=n.content)!=null&&t.text))return n.content.text}if(e.rawOutput){if(typeof e.rawOutput=="string")return e.rawOutput;const n=e.rawOutput;if(typeof n.output=="string")return n.output;if(typeof n.result=="string")return n.result;if(typeof n.content=="string")return n.content;if(typeof n.reason=="string")return n.reason;if(typeof n.terminateReason=="string"&&n.terminateReason!=="GOAL")return n.terminateReason;if(typeof n.error=="string")return n.error;if(typeof n.text=="string")return n.text}return""}function zse({text:e}){const{compactThinking:t}=hu(),{t:n}=ft(),[r,i]=v.useState(!1),[s,a]=v.useState(!1),o=v.useRef(null),l=t&&!r;return v.useEffect(()=>{const c=o.current;!c||!l||(a(c.scrollHeight>c.clientHeight),c.scrollTop=c.scrollHeight)},[l,e]),v.useEffect(()=>{const c=o.current;if(!c||!l)return;const u=()=>a(c.scrollHeight>c.clientHeight),d=new ResizeObserver(u);return d.observe(c),()=>d.disconnect()},[l]),h.jsxs("div",{children:[h.jsx("pre",{ref:o,className:l?`${Fn.stream} ${Fn.streamCollapsed}`:Fn.stream,children:e}),t&&(s||r)&&h.jsx("button",{className:Fn.expandToggle,onClick:()=>i(c=>!c),"aria-expanded":r,"aria-label":n("subagent.toggleStream"),children:r?"▲":"▼"})]})}function Pse({content:e}){const{compactThinking:t}=hu();return h.jsx("div",{className:t?Fn.scrollWindow:void 0,children:h.jsx(yd,{content:e,source:"assistant"})})}function r8({pinTail:e,itemCount:t,children:n}){const{compactThinking:r}=hu(),i=v.useRef(null);return v.useEffect(()=>{const s=i.current;!s||!r||(s.scrollTop=e?s.scrollHeight:0)},[r,e,t]),h.jsx("div",{ref:i,className:r?`${Fn.tools} ${Fn.scrollWindow}`:Fn.tools,children:n})}function Ck({tool:e,defaultExpanded:t,hideHeader:n,inline:r}){var S,T,j,z;const i=e.status==="completed"||e.status==="failed",s=ly(e),[a,o]=v.useState(t??!1),[l,c]=v.useState("result"),u=_D(e.rawOutput)?e.rawOutput:null,d=((S=e.subTools)==null?void 0:S.length)||((T=u==null?void 0:u.toolCalls)==null?void 0:T.length)||0,f=Tk(e),m=Sk(e),p=F0(e.startTime,e.endTime)||kD((j=u==null?void 0:u.executionSummary)==null?void 0:j.totalDurationMs),b=u!=null&&u.tokenCount&&u.tokenCount>0?u.tokenCount:(z=u==null?void 0:u.executionSummary)==null?void 0:z.totalTokens,x=b?_k(b):"",g=i?Bse(e):"",y=v.useMemo(()=>e.subTools&&e.subTools.length>0?null:(u==null?void 0:u.toolCalls)||null,[e.subTools,u]),w=!!(e.subContent||g),C=!!(e.subTools&&e.subTools.length>0||y&&y.length>0),E=w&&C;return h.jsxs("div",{className:r?void 0:Fn.panel,children:[!n&&h.jsxs("div",{className:Fn.header,onClick:()=>o(!a),children:[h.jsx(kl,{status:s}),h.jsxs("span",{className:rt.lineName,children:[m,":"]}),f&&h.jsx("span",{className:Fn.desc,children:qr(f,50)}),i&&d>0&&h.jsxs("span",{className:Fn.meta,children:["· ",d," tools"]}),p&&h.jsxs("span",{className:Fn.meta,children:["· ",p]}),x&&h.jsxs("span",{className:Fn.meta,children:["· ",x]}),!i&&h.jsx("span",{className:Fn.toggle,children:a?"▼":"▶"})]}),(a||n)&&h.jsxs("div",{className:Fn.body,children:[E&&h.jsxs("div",{className:Fn.tabBar,children:[h.jsx("button",{className:`${Fn.tab} ${l==="result"?Fn.tabActive:""}`,onClick:()=>c("result"),children:"Result"}),h.jsxs("button",{className:`${Fn.tab} ${l==="tools"?Fn.tabActive:""}`,onClick:()=>c("tools"),children:["Tools (",d,")"]})]}),(!E||l==="result")&&w&&h.jsx("div",{className:Fn.content,children:i?h.jsx(Pse,{content:e.subContent||g}):e.subContent&&h.jsx(zse,{text:e.subContent})}),(!E||l==="tools")&&h.jsxs(h.Fragment,{children:[e.subTools&&e.subTools.length>0&&h.jsx(r8,{pinTail:!i,itemCount:e.subTools.length,children:e.subTools.map(R=>h.jsx(jse,{tool:R},R.callId))}),y&&y.length>0&&h.jsx(r8,{pinTail:!i,itemCount:y.length,children:y.map(R=>h.jsx(Lse,{tc:R},R.callId))})]})]})]})}const $se="_view_f1xgr_1",Use="_stats_f1xgr_9",Hse="_statAdd_f1xgr_18",qse="_statDel_f1xgr_22",Fse="_lines_f1xgr_26",Vse="_line_f1xgr_26",Gse="_lineAdd_f1xgr_38",Wse="_lineDel_f1xgr_42",Kse="_lineHeader_f1xgr_46",Yse="_lineContext_f1xgr_52",Xse="_lineNo_f1xgr_56",Qse="_marker_f1xgr_66",Jse="_content_f1xgr_81",ya={view:$se,stats:Use,statAdd:Hse,statDel:qse,lines:Fse,line:Vse,lineAdd:Gse,lineDel:Wse,lineHeader:Kse,lineContext:Yse,lineNo:Xse,marker:Qse,content:Jse};function Zse(e){let t=0,n=0;const r=[];let i=0,s=0;for(const a of e.split(`
`))if(a.startsWith("@@")){const o=a.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);o&&(i=parseInt(o[1],10),s=parseInt(o[2],10)),r.push({type:"header",content:a})}else a.startsWith("+")&&!a.startsWith("+++ ")?(t++,r.push({type:"add",content:a.slice(1),newLine:s}),s++):a.startsWith("-")&&!a.startsWith("--- ")?(n++,r.push({type:"del",content:a.slice(1),oldLine:i}),i++):(r.push({type:"context",content:a.startsWith(" ")?a.slice(1):a,oldLine:i,newLine:s}),i++,s++);return{lines:r,additions:t,deletions:n}}const eae=v.memo(function({diff:t}){if(!t)return null;const{lines:n,additions:r,deletions:i}=Zse(t);return h.jsxs("div",{className:ya.view,children:[h.jsxs("div",{className:ya.stats,children:[r>0&&h.jsxs("span",{className:ya.statAdd,children:["+",r]}),i>0&&h.jsxs("span",{className:ya.statDel,children:["-",i]})]}),h.jsx("div",{className:ya.lines,children:n.map((s,a)=>h.jsxs("div",{className:`${ya.line} ${ya[`line${s.type[0].toUpperCase()}${s.type.slice(1)}`]}`,children:[h.jsx("span",{className:ya.lineNo,children:s.type==="header"?"":s.oldLine??s.newLine}),h.jsx("span",{className:ya.marker,children:s.type==="add"?"+":s.type==="del"?"-":s.type==="header"?"":" "}),h.jsx("span",{className:ya.content,children:s.content})]},a))})]})}),tae="_approval_1ucyy_1",nae="_header_1ucyy_10",rae="_icon_1ucyy_20",iae="_name_1ucyy_26",sae="_desc_1ucyy_35",aae="_content_1ucyy_44",oae="_code_1ucyy_58",lae="_codeBlock_1ucyy_66",cae="_question_1ucyy_76",uae="_options_1ucyy_81",dae="_option_1ucyy_81",hae="_optionActive_1ucyy_99",fae="_pointer_1ucyy_103",mae="_num_1ucyy_109",pae="_label_1ucyy_114",yi={approval:tae,header:nae,icon:rae,name:iae,desc:sae,content:aae,code:oae,codeBlock:lae,question:cae,options:uae,option:dae,optionActive:hae,pointer:fae,num:mae,label:pae};function gae(e){if(!e)return{toolName:"",description:""};const t=e.indexOf(": ");if(t>0){const n=e.slice(0,t);return/^[A-Za-z][\w.-]{0,40}$/.test(n)?{toolName:n,description:e.slice(t+2)}:{toolName:e,description:""}}return{toolName:e,description:""}}function yae(e){const t=[];for(const n of e.content)n.type==="text"&&n.text&&t.push(n.text);return t.join(`
`)}function bae(e){return e.kind==="bash"||e.kind==="exec"||e.kind==="shell"}function vae(e){if(!e.rawInput)return null;const t=e.rawInput;return typeof t.command=="string"?t.command:typeof t.input=="string"?t.input:null}function i8(e){if(e.length>1&&(e[0].kind==="allow_always"||e[0].kind==="reject_always")){const t=e.findIndex(n=>n.kind==="allow_once"||n.kind==="reject_once");return t>=0?t:1}return 0}function s8(e){return e.kind==="allow_once"?0:e.kind==="allow_always"&&e.id==="proceed_always_project"?1:e.kind==="allow_always"&&e.id==="proceed_always_user"?2:e.kind==="allow_always"?3:e.kind==="reject_once"||e.kind==="reject_always"?4:5}function Um(e){return e.map((t,n)=>({option:t,index:n})).sort((t,n)=>{const r=s8(t.option)-s8(n.option);return r===0?t.index-n.index:r}).map(({option:t})=>t)}function xae(e){if(e.kind==="allow_once")return"approval.option.allowOnce";if(e.kind==="reject_once")return"approval.option.rejectOnce";if(e.kind==="allow_always"){if(e.id==="proceed_always_project")return"approval.option.allowAlwaysProject";if(e.id==="proceed_always_user")return"approval.option.allowAlwaysUser";if(e.id==="proceed_always")return"approval.option.allowAllEdits"}}function Rc({request:e,onConfirm:t}){const{t:n}=ft(),r=v.useMemo(()=>Um(e.options),[e.options]),[i,s]=v.useState(()=>i8(Um(e.options))),a=v.useRef(e);a.current=e;const o=v.useRef(i),l=v.useRef(!1),c=v.useRef(!1);v.useEffect(()=>{const y=i8(Um(a.current.options));l.current=!1,c.current=!1,o.current=y,s(y)},[e.id]);const{toolName:u,description:d}=gae(e.title),f=yae(e),m=v.useCallback(y=>{l.current||(l.current=!0,t(a.current.id,y))},[t]),p=v.useCallback(y=>{if(y.defaultPrevented||Kg(y.target))return;const w=a.current,C=Um(w.options),E=C.length;if(y.key==="ArrowUp"||y.key==="k")y.preventDefault(),c.current=!0,s(S=>{const T=(S-1+E)%E;return o.current=T,T});else if(y.key==="ArrowDown"||y.key==="j")y.preventDefault(),c.current=!0,s(S=>{const T=(S+1)%E;return o.current=T,T});else if(y.key==="Enter"){if(y.preventDefault(),!c.current){c.current=!0;return}const S=C[o.current];S&&m(S.id)}else if(y.key==="Escape"){y.preventDefault();const S=w.options.find(T=>T.kind==="reject_once"||T.kind==="reject_always");S&&m(S.id)}else if(y.key>="1"&&y.key<="9"){const S=parseInt(y.key)-1;S<E&&(y.preventDefault(),c.current=!0,m(C[S].id))}},[m]);v.useEffect(()=>{const y=setTimeout(()=>{window.addEventListener("keydown",p)},250);return()=>{clearTimeout(y),window.removeEventListener("keydown",p)}},[p]);const b=bae(e),x=Rz(e.toolName),g=vae(e);return h.jsxs("div",{className:yi.approval,children:[h.jsxs("div",{className:yi.header,children:[h.jsx("span",{className:yi.icon,children:"?"}),h.jsx("span",{className:yi.name,children:u}),d&&h.jsx("span",{className:yi.desc,children:d})]}),b&&g?h.jsx("div",{className:yi.code,children:h.jsx("pre",{className:yi.codeBlock,children:g})}):f&&f!==e.title?h.jsx("pre",{className:yi.content,children:f}):null,h.jsx("div",{className:yi.question,children:x?n("approval.launchAgentQuestion"):b?n("approval.execQuestion",{tool:u}):n("approval.changeQuestion")}),h.jsx("div",{className:yi.options,children:r.map((y,w)=>{const C=w===i,E=xae(y),S=E?n(E):y.label;return h.jsxs("div",{className:`${yi.option} ${C?yi.optionActive:""}`,onClick:()=>m(y.id),children:[h.jsx("span",{className:yi.pointer,children:C?"›":" "}),h.jsxs("span",{className:yi.num,children:[w+1,"."]}),h.jsx("span",{className:yi.label,children:S})]},y.id)})})]})}const a8={30:"#4a4a4a",31:"#fc8181",32:"#48bb78",33:"#ecc94b",34:"#4a9eff",35:"#b794f4",36:"#76e4f7",37:"#e0e6f0",90:"#5a6a8a",91:"#feb2b2",92:"#9ae6b4",93:"#fefcbf",94:"#90cdf4",95:"#d6bcfa",96:"#b2f5ea",97:"#ffffff"};function wae(e){const t=[];let n,r=!1,i=!1,s=0;const a=new RegExp(String.raw`\x1b\[([0-9;]*)m`,"g");let o;for(;(o=a.exec(e))!==null;){o.index>s&&t.push({text:e.slice(s,o.index),color:n,bold:r,dim:i}),s=o.index+o[0].length;const l=o[1].split(";").map(Number);for(const c of l)c===0?(n=void 0,r=!1,i=!1):c===1?r=!0:c===2?i=!0:c===22?(r=!1,i=!1):c>=30&&c<=37||c>=90&&c<=97?n=a8[c]:c===39&&(n=void 0)}return s<e.length&&t.push({text:e.slice(s),color:n,bold:r,dim:i}),t}function kae(e){return new RegExp(String.raw`\x1b\[`).test(e)}function fh(e){const t=e.toLowerCase();return t==="todo_write"||t==="todowrite"}function Dv(e){const t=e.flatMap((n,r)=>{const i=Xg(n),s=Hm(i,"content");return s?[{id:Hm(i,"id")??`plan-${r}`,content:s,status:jae(Hm(i,"status")),priority:Lae(Hm(i,"priority"))}]:[]});return t.length>0?t:void 0}function Ek(e){if(!fh(e.toolName)&&e.kind!=="other")return;const t=l8(e.args);if(t)return Dv(t);const n=Xg(e.rawOutput),r=l8(n);if(r)return Dv(r);const i=Array.isArray(n==null?void 0:n.entries)?n.entries:void 0;return i?Dv(i):void 0}function _ae(e){return e.some(t=>t.status==="pending"||t.status==="in_progress")}function o0(e){switch(e){case"completed":return"●";case"in_progress":return"◐";case"pending":return"○"}}const o8={todos:[],allCompleted:!1,sourceMessageId:null,sourceCallId:null};function Sae(e){let t=[],n=null,r=null,i=!1;for(const a of e){if(a.role==="user"){i=!0;continue}if(a.role==="plan"){t=a.todos,n=a.id,r=null,i=!1;continue}if(a.role==="tool_group")for(const o of a.tools){const l=Ek(o);l&&(t=l,n=a.id,r=o.callId,i=!1)}}if(t.length===0)return o8;const s=!_ae(t);return s&&i?o8:{todos:t,allCompleted:s,sourceMessageId:n,sourceCallId:r}}function Ak(e){return JSON.stringify([e.id,e.content])}function uy(e){if(e.role==="plan")return[{key:e.id,todos:e.todos}];if(e.role==="tool_group"){const t=[];for(const n of e.tools){const r=Ek(n);r&&t.push({key:n.callId,todos:r,stats:Mae(n)})}return t}return[]}function Tae(e){const t=new Map,n=new Map;for(const r of e)for(const{key:i,todos:s}of uy(r)){const a=[];for(const o of s){const l=Ak(o),c=n.get(l);o.status==="in_progress"&&c!=="in_progress"?a.push({kind:"started",id:o.id,content:o.content}):o.status==="completed"&&c!=="completed"&&c!==void 0&&a.push({kind:"completed",id:o.id,content:o.content}),n.set(l,o.status)}t.set(i,{events:a})}return t}function Cae(e){const t=[];for(const n of e)for(const{key:r,todos:i}of uy(n))t.push(JSON.stringify([r,i.map(s=>[s.id,s.status,s.content])]));return t.join(`
`)}function Eae(e){const t=[];for(const n of e){if(n.role==="tool_group")for(const r of n.tools)!fh(r.toolName)&&(r.startTime!==void 0||r.endTime!==void 0)&&t.push(JSON.stringify(["span",r.callId,r.startTime,r.endTime]));for(const{key:r,todos:i,stats:s}of uy(n))t.push(JSON.stringify([r,n.timestamp,i.map(a=>[a.id,a.status,a.content]),s]))}return t.join(`
`)}function Aae(e,t){if(e.length<=t)return{start:0,end:e.length};const n=e.findIndex(a=>a.status==="in_progress"),r=n>=0?n:e.findIndex(a=>a.status==="pending");let i=Math.max(0,Math.max(0,r)-1);const s=Math.min(e.length,i+t);return i=Math.max(0,s-t),{start:i,end:s}}function Mae(e){var a;const t=Xg((a=Xg(e.rawOutput))==null?void 0:a.stats);if(!t)return;const n=o=>{const l=t[o];return typeof l=="number"&&Number.isFinite(l)?l:void 0},r=n("promptTokens"),i=n("cachedTokens"),s=n("candidateTokens");if(!(r===void 0||i===void 0||s===void 0))return{promptTokens:r,cachedTokens:i,candidateTokens:s,apiTimeMs:n("apiTimeMs")??0}}function Nae(e){const t=[];for(const n of e)if(n.role==="tool_group")for(const r of n.tools){if(fh(r.toolName))continue;const{startTime:i,endTime:s}=r;typeof i=="number"&&typeof s=="number"&&s>=i&&t.push({start:i,end:s})}return t.sort((n,r)=>n.start-r.start),t}function Iae(e,t,n){let r=0,i=e.length;for(;r<i;){const a=r+i>>>1;e[a].start<t?r=a+1:i=a}let s=0;for(let a=r;a<e.length&&e[a].start<=n;a++)s+=e[a].end-e[a].start;return s}function Dae(e,t){const n=(r,i)=>Math.max(0,i-r);return{inputTokens:n(e.promptTokens,t.promptTokens),cachedTokens:n(e.cachedTokens,t.cachedTokens),outputTokens:n(e.candidateTokens,t.candidateTokens),apiTimeMs:n(e.apiTimeMs,t.apiTimeMs)}}function Rae(e,t){const n={};return e&&(e.inputTokens>0||e.outputTokens>0||e.cachedTokens>0||e.apiTimeMs>0)&&(n.inputTokens=e.inputTokens,n.cachedTokens=e.cachedTokens,n.outputTokens=e.outputTokens,e.apiTimeMs>0&&(n.apiTimeMs=e.apiTimeMs)),t!==void 0&&t>0&&(n.toolTimeMs=t),Object.keys(n).length>0?n:void 0}function Oae(e){var o;const t=new Map,n=new Map,r=new Map,i=new Set,s=Nae(e),a=l=>{let c=t.get(l);return c||(c={},t.set(l,c)),c};for(const l of e){const c=l.timestamp;for(const{todos:u,stats:d}of uy(l))for(const f of u){const m=Ak(f),p=n.get(m);if(f.status==="in_progress"&&p!=="in_progress")i.has(m)&&(i.delete(m),r.delete(m),t.delete(m)),r.get(m)===void 0&&(r.set(m,d),c!==void 0&&(a(m).startTs=c));else if(f.status==="completed"&&p!=="completed"&&p!==void 0){const b=r.get(m),x=b&&d?Dae(b,d):void 0,g=(o=t.get(m))==null?void 0:o.startTs,y=g!==void 0&&c!==void 0?Iae(s,g,c):void 0,w=Rae(x,y);if(c!==void 0||w){const C=a(m);c!==void 0&&(C.endTs=c),w&&(C.resources=w)}}f.status==="completed"&&i.add(m),n.set(m,f.status)}}return t}function l8(e){const t=e==null?void 0:e.todos;return Array.isArray(t)?t:void 0}function jae(e){return e==="completed"||e==="in_progress"||e==="pending"?e:"pending"}function Lae(e){return e==="high"||e==="medium"||e==="low"?e:void 0}function Xg(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function Hm(e,t){const n=e==null?void 0:e[t];return typeof n=="string"&&n.length>0?n:void 0}const Bae="_list_wqkzx_1",zae="_summary_wqkzx_2",Pae="_row_wqkzx_8",$ae="_num_wqkzx_16",Uae="_icon_wqkzx_23",Hae="_text_wqkzx_29",qae="_inProgress_wqkzx_43",Fae="_completed_wqkzx_48",Vae="_item_wqkzx_62",Gae="_rowButton_wqkzx_69",Wae="_detailChevron_wqkzx_82",Kae="_detail_wqkzx_82",Yae="_detailSection_wqkzx_100",Xae="_detailSectionTitle_wqkzx_106",Qae="_detailRows_wqkzx_114",Jae="_detailLabel_wqkzx_122",Zae="_detailValue_wqkzx_126",eoe="_detailDuration_wqkzx_132",toe="_detailHint_wqkzx_136",Zt={list:Bae,summary:zae,row:Pae,num:$ae,icon:Uae,text:Hae,inProgress:qae,completed:Fae,item:Vae,rowButton:Gae,detailChevron:Wae,detail:Kae,detailSection:Yae,detailSectionTitle:Xae,detailRows:Qae,detailLabel:Jae,detailValue:Zae,detailDuration:eoe,detailHint:toe};function f2(e){switch(e){case"completed":return Zt.completed;case"in_progress":return Zt.inProgress;case"pending":return""}}function SD({todos:e,events:t}){const{t:n}=ft();if(t.length===0){if(e.length>0&&e.every(s=>s.status==="completed"))return h.jsx("div",{className:Zt.summary,children:h.jsxs("div",{className:`${Zt.row} ${Zt.completed}`,children:[h.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:"✓"}),h.jsx("span",{className:Zt.text,children:n("todo.allDone")})]})});const i=e.find(s=>s.status==="in_progress")??e.find(s=>s.status==="pending");return i?h.jsx("div",{className:Zt.summary,children:h.jsxs("div",{className:`${Zt.row} ${f2(i.status)}`,children:[h.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:o0(i.status)}),h.jsx("span",{className:Zt.text,children:i.content})]})}):null}return h.jsx("div",{className:Zt.summary,children:t.map(r=>h.jsxs("div",{className:`${Zt.row} ${r.kind==="completed"?Zt.completed:Zt.inProgress}`,children:[h.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:o0(r.kind==="completed"?"completed":"in_progress")}),h.jsx("span",{className:Zt.text,children:r.content})]},`${r.kind}-${r.id}`))})}function pc({label:e,value:t,suffix:n}){return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:Zt.detailLabel,children:e}),h.jsxs("span",{className:Zt.detailValue,children:[t,n]})]})}function Rv({title:e,children:t}){return h.jsxs("div",{className:Zt.detailSection,children:[h.jsx("div",{className:Zt.detailSectionTitle,children:e}),h.jsx("div",{className:Zt.detailRows,children:t})]})}function noe({detail:e}){const{t}=ft(),{startTs:n,endTs:r,resources:i}=e,s=n!==void 0||r!==void 0,a=(i==null?void 0:i.inputTokens)!==void 0,o=(i==null?void 0:i.apiTimeMs)!==void 0||(i==null?void 0:i.toolTimeMs)!==void 0;return h.jsxs("div",{className:Zt.detail,children:[s&&h.jsxs(Rv,{title:t("todo.detail.sectionTime"),children:[n!==void 0&&h.jsx(pc,{label:t("todo.detail.start"),value:Cg(n)}),r!==void 0&&h.jsx(pc,{label:t("todo.detail.end"),value:Cg(r),suffix:n!==void 0?h.jsxs("span",{className:Zt.detailDuration,children:[" ","(",Ll(r-n),")"]}):void 0})]}),a&&h.jsxs(Rv,{title:t("todo.detail.sectionTokens"),children:[h.jsx(pc,{label:t("todo.detail.input"),value:((i==null?void 0:i.inputTokens)??0).toLocaleString()}),h.jsx(pc,{label:t("todo.detail.output"),value:((i==null?void 0:i.outputTokens)??0).toLocaleString()}),h.jsx(pc,{label:t("todo.detail.cached"),value:((i==null?void 0:i.cachedTokens)??0).toLocaleString()})]}),o&&h.jsxs(Rv,{title:t("todo.detail.sectionSpent"),children:[(i==null?void 0:i.apiTimeMs)!==void 0&&h.jsx(pc,{label:t("todo.detail.api"),value:Ll(i.apiTimeMs)}),(i==null?void 0:i.toolTimeMs)!==void 0&&h.jsx(pc,{label:t("todo.detail.tool"),value:Ll(i.toolTimeMs)})]}),!i&&h.jsx("div",{className:Zt.detailHint,children:t("todo.detail.noResources")})]})}function roe(e){return!!e&&(e.endTs!==void 0||e.resources!==void 0)}function TD({todos:e,numbered:t=!1}){const{t:n}=ft(),r=v.useContext(sj),[i,s]=v.useState(()=>new Set),a=`${String(e.length).length+1}ch`,o=l=>s(c=>{const u=new Set(c);return u.has(l)?u.delete(l):u.add(l),u});return h.jsx("div",{className:Zt.list,children:e.map((l,c)=>{const u=l.id||String(c),d=r.get(Ak(l)),f=roe(d),m=f&&i.has(u),p=h.jsxs(h.Fragment,{children:[t&&h.jsxs("span",{className:Zt.num,style:{minWidth:a},children:[c+1,"."]}),h.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:o0(l.status)}),h.jsx("span",{className:Zt.text,children:l.content}),f&&h.jsx("span",{className:Zt.detailChevron,"aria-hidden":"true",children:m?"▾":"▸"})]});return h.jsxs("div",{className:Zt.item,children:[f?h.jsx("button",{type:"button",className:`${Zt.row} ${Zt.rowButton} ${f2(l.status)}`,onClick:b=>{b.stopPropagation(),o(u)},"aria-expanded":m,title:n(m?"todo.detail.hide":"todo.detail.show"),children:p}):h.jsx("div",{className:`${Zt.row} ${f2(l.status)}`,children:p}),m&&d&&h.jsx(noe,{detail:d})]},u)})})}const CD=5;function ioe(e){const t=e.toolName.toLowerCase();if(q0(e.toolName))return!!Pa(e);if(t==="write_file"||t==="writefile")return!!poe(e)||c8(e);if(e.status!=="completed"&&e.status!=="failed")return!1;if(Gl(t)){const n=Pa(e);return!!n&&n.trim().length>0&&n.split(`
`).length>1}if(t==="edit"||t==="write"||t==="editfile")return c8(e);if(t==="read"||t==="read_file"||t==="readfile"){const n=Pa(e);return!!n&&n.split(`
`).length>3}return!1}function soe(e){const t=e.toolName.toLowerCase();return Gl(t)||t==="write_file"||t==="writefile"||t==="edit"||t==="write"||t==="editfile"||t==="read"||t==="read_file"||t==="readfile"||q0(e.toolName)}function aoe(e){var t;return(t=e.content)!=null&&t.some(n=>n.type==="diff")?!0:!!ED(e)}function c8(e){return aoe(e)||!!Pa(e)}function ooe(e){if(e.content){const t=e.content.find(n=>n.type==="diff");if(t&&t.type==="diff")return uoe(t.oldText||"",t.newText||"")}return ED(e)}function ED(e){if(e.rawOutput&&typeof e.rawOutput=="object"){const t=e.rawOutput;if(loe(t))return"";if(typeof t.fileDiff=="string")return t.fileDiff}return""}function loe(e){return e.truncatedForSession===!0&&"fileName"in e&&"newContent"in e}const coe=25e4;function uoe(e,t){const n=e.split(`
`),r=t.split(`
`),i=n.length,s=r.length;if(i*s>coe){const u=n.map(f=>f?`-${f}`:"-"),d=r.map(f=>f?`+${f}`:"+");return[...u,...d].join(`
`)}const a=Array.from({length:i+1},()=>Array(s+1).fill(0));for(let u=1;u<=i;u++)for(let d=1;d<=s;d++)a[u][d]=n[u-1]===r[d-1]?a[u-1][d-1]+1:Math.max(a[u-1][d],a[u][d-1]);const o=[];let l=i,c=s;for(;l>0||c>0;)l>0&&c>0&&n[l-1]===r[c-1]?(o.push(` ${n[l-1]}`),l--,c--):c>0&&(l===0||a[l][c-1]>=a[l-1][c])?(o.push(`+${r[c-1]}`),c--):(o.push(`-${n[l-1]}`),l--);return o.reverse().join(`
`)}const Ov=150,u8=25,doe=60;function hoe(e){const t=e.find(i=>i.key==="ui.shellOutputMaxLines"),n=t==null?void 0:t.values.effective;return Math.max(0,Math.floor((typeof n=="number"?n:CD)||0))}function d8(e,t){return e.length<=t?e:e.slice(0,t)+" …"}function foe({tool:e,maxLines:t}){const{t:n}=ft(),[r,i]=v.useState(!1),s=v.useMemo(()=>Pa(e)||"",[e]),a=v.useMemo(()=>s.split(`
`),[s]),o=t>0&&a.length>t,l=Math.max(0,a.length-t),c=v.useMemo(()=>a.some(m=>m.length>Ov),[a]),u=o||c,d=v.useMemo(()=>r?s:o?[`... first ${l} lines hidden ...`,...a.slice(-t).map(m=>d8(m,Ov))].join(`
`):a.map(m=>d8(m,Ov)).join(`
`),[l,o,a,t,s,r]),f=v.useMemo(()=>kae(d)?wae(d):null,[d]);return h.jsxs("div",{className:rt.expandedBash,children:[h.jsx("pre",{className:rt.expandedOutput,children:f?f.map((m,p)=>h.jsx("span",{style:{color:m.color,fontWeight:m.bold?"bold":void 0,opacity:m.dim?.6:void 0},children:m.text},p)):d}),u&&h.jsx("button",{className:rt.expandBtn,onClick:()=>i(!r),"aria-expanded":r,children:r?n("tool.showLess"):o?n("tool.showAll",{count:a.length}):n("tool.showFullLines")})]})}function moe({tool:e}){const{t}=ft(),[n,r]=v.useState(!1),i=v.useMemo(()=>Pa(e)||"",[e]),s=v.useMemo(()=>i.split(`
`),[i]),a=s.length>u8,o=v.useMemo(()=>a&&!n?s.slice(0,u8).join(`
`):i,[i,a,s,n]);return h.jsxs("div",{className:rt.expandedRead,children:[h.jsx("pre",{className:rt.expandedOutput,children:o}),a&&h.jsx("button",{className:rt.expandBtn,onClick:()=>r(!n),"aria-expanded":n,children:n?t("tool.showLess"):t("tool.linesTotal",{count:s.length})})]})}function h8({tool:e}){const t=v.useMemo(()=>ooe(e),[e]),n=v.useMemo(()=>Pa(e)||"",[e]);return!t&&!n?null:h.jsx("div",{className:rt.expandedEdit,children:t?h.jsx(eae,{diff:t}):h.jsx("pre",{className:rt.expandedOutput,children:n})})}function poe(e){var n,r;if((n=e.args)!=null&&n.content)return e.args.content;if((r=e.args)!=null&&r.new_string)return e.args.new_string;const t=Pa(e);if(t)return t;if(e.rawOutput&&typeof e.rawOutput=="object"){const i=e.rawOutput;if(typeof i.content=="string")return i.content;if(typeof i.newContent=="string")return i.newContent}return""}function goe({tool:e,todos:t,expanded:n}){var s;const i=((s=v.useContext(u5).get(e.callId))==null?void 0:s.events)??[];return h.jsx("div",{className:rt.todoBody,children:n?h.jsx(TD,{todos:t}):h.jsx(SD,{todos:t,events:i})})}function yoe(e,t){var f,m;const n=oy(e.rawOutput),r=kk(e),i=ly(e),s=Sk(e),a=Tk(e),o=((f=e.subTools)==null?void 0:f.length)||((m=n==null?void 0:n.toolCalls)==null?void 0:m.length)||0,l=n==null?void 0:n.executionSummary,c=l&&typeof l.totalDurationMs=="number"?kD(l.totalDurationMs):F0(e.startTime,e.endTime??(e.status==="in_progress"&&t?t:void 0)),u=n&&typeof n.tokenCount=="number"&&n.tokenCount>0?n.tokenCount:l&&typeof l.totalTokens=="number"&&l.totalTokens>0?l.totalTokens:0,d=u>0?_k(u):"";return{agentType:s,description:a,subToolCount:o,elapsed:c,tokens:d,status:i,reason:r}}function f8(e){if(e.status==="completed")return!1;const t=e.toolName.toLowerCase();return!!(q0(e.toolName)||t==="write_file"||t==="writefile"||t==="edit"||t==="editfile"||Gl(t))}function boe({tool:e}){const t=Pa(e)||"";return h.jsx("pre",{className:rt.expandedOutput,children:t})}function AD(e){const t=e.toolName.toLowerCase();return z1(e)?"agent":Gl(t)?"shell":Mk(t)?"fetch":fh(t)?"todo":t==="read"||t==="read_file"||t==="readfile"?"read":t==="edit"||t==="editfile"?"edit":t==="write"||t==="write_file"||t==="writefile"?"write":"other"}function voe({description:e,elapsed:t}){return h.jsxs(h.Fragment,{children:[e&&h.jsx("span",{className:rt.lineArg,children:e}),t&&h.jsx("span",{className:rt.lineElapsed,children:t})]})}function m2({info:e}){const{renderToolHeaderExtra:t}=hu(),n=t==null?void 0:t(e);return n?h.jsx(h.Fragment,{children:n}):h.jsx(voe,{description:e.description,elapsed:e.elapsed})}function xoe(e){return e.length>doe||e.includes(`
`)}function woe(e){return e.find(t=>t.status==="in_progress")??e[e.length-1]}function Mk(e){const t=e.toLowerCase();return t==="web_fetch"||t==="webfetch"||t==="fetch"}const koe=ly;function _oe({tools:e,workspaceCwd:t}){const{t:n}=ft(),r=woe(e),i=gu(r.toolName,n),s=koe(r),a=fD(r,t),o=Gl(r.toolName)||Mk(r.toolName)?"":F0(r.startTime,r.endTime);return h.jsxs("div",{className:rt.compactGroup,children:[h.jsxs("div",{className:rt.compactHeader,children:[h.jsx(kl,{status:s}),h.jsx("span",{className:rt.lineName,children:i}),e.length>1&&h.jsxs("span",{className:rt.compactCount,children:["× ",e.length]}),h.jsx(m2,{info:{kind:AD(r),tool:r,displayName:i,description:a,elapsed:o,workspaceCwd:t}})]}),h.jsx("div",{className:rt.compactHint,children:n("compact.hint")})]})}function Soe(e,t){var i,s;if(((i=e.approval)==null?void 0:i.id)!==((s=t.approval)==null?void 0:s.id)||e.onConfirm!==t.onConfirm||e.workspaceCwd!==t.workspaceCwd||e.shellOutputMaxLines!==t.shellOutputMaxLines)return!1;const n=e.tool,r=t.tool;return n.callId===r.callId&&n.toolName===r.toolName&&n.status===r.status&&n.startTime===r.startTime&&n.endTime===r.endTime&&n.subContent===r.subContent&&n.rawOutput===r.rawOutput&&n.args===r.args&&n.content===r.content&&n.title===r.title&&Toe(n.subTools,r.subTools)}function Toe(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],i=t[n];if(r.callId!==i.callId||r.toolName!==i.toolName||r.status!==i.status||r.endTime!==i.endTime||r.rawOutput!==i.rawOutput||r.args!==i.args||r.subContent!==i.subContent||r.title!==i.title)return!1}return!0}const MD=v.memo(function({tool:t,approval:n,onConfirm:r,workspaceCwd:i,shellOutputMaxLines:s=CD}){const{t:a}=ft(),o=v.useContext(gh),[l,c]=v.useState(()=>!o&&f8(t)),u=v.useRef(!1),[d,f]=v.useState(()=>Date.now());v.useEffect(()=>{c(o?!1:f8(t)),u.current=!1},[o,t.callId,t.toolName]);const m=z1(t),p=n&&n.toolCallId===t.callId,b=!p&&(n==null?void 0:n.toolCallId)&&m&&Ua(t,n.toolCallId),x=m&&t.status==="in_progress";if(v.useEffect(()=>{if(!x)return;f(Date.now());const P=setInterval(()=>f(Date.now()),1e3);return()=>clearInterval(P)},[x]),v.useEffect(()=>{!m&&t.status==="completed"&&!u.current&&c(!1)},[m,t.status]),m){if(p&&r)return h.jsx("div",{className:rt.line,children:h.jsx(Rc,{request:n,onConfirm:r})});const P=yoe(t,d),J=a("agent.label"),q=t.status==="completed"||t.status==="failed",W=pD(t,a),$=t.status==="pending"?"pending":"running",Z=[W,$,P.elapsed].filter(Boolean).join(" · "),M=l||!!b;return h.jsxs("div",{className:rt.line,children:[h.jsxs("div",{className:rt.lineMain,children:[h.jsx(kl,{status:t.status}),h.jsx("span",{className:rt.lineName,children:J}),h.jsx(m2,{info:{kind:"agent",tool:t,displayName:J,description:P.description?qr(P.description,60):"",elapsed:"",workspaceCwd:i}})]}),!q&&h.jsxs("div",{className:`${rt.agentSummary} ${rt.lineExpandable}`,onClick:()=>c(!l),children:[h.jsx(kl,{status:t.status}),h.jsxs("span",{className:rt.lineName,children:[P.agentType,":"]}),h.jsx("span",{className:rt.lineArg,children:qr(P.description||P.agentType,50)}),Z&&h.jsxs("span",{className:rt.lineElapsed,children:["· ",Z]})]}),q&&h.jsxs("div",{className:`${rt.agentSummary} ${rt.lineExpandable}`,onClick:()=>c(!l),children:[h.jsx(kl,{status:P.status}),h.jsxs("span",{className:rt.lineName,children:[P.agentType,":"]}),h.jsx("span",{className:rt.lineArg,children:qr(P.description,50)}),P.subToolCount>0&&h.jsxs("span",{className:rt.lineElapsed,children:["· ",P.subToolCount," tools"]}),P.elapsed&&h.jsxs("span",{className:rt.lineElapsed,children:["· ",P.elapsed]}),P.tokens&&h.jsxs("span",{className:rt.lineElapsed,children:["· ",P.tokens]}),P.reason&&h.jsxs("span",{className:rt.lineElapsed,children:["· ",qr(P.reason,80)]})]}),p&&r&&h.jsx(Rc,{request:n,onConfirm:r}),b&&r&&h.jsx(Rc,{request:n,onConfirm:r}),M&&h.jsx("div",{className:rt.lineDetail,children:h.jsx(Ck,{tool:t,hideHeader:!0,defaultExpanded:!0,inline:!0})})]})}const g=fD(t,i),y=Qte(t),w=gu(t.toolName,a),C=Gl(t.toolName)||Mk(t.toolName)?"":F0(t.startTime,t.endTime),E=t.toolName.toLowerCase(),S=fh(E),T=S?Ek(t):void 0,j=!!T&&T.length>0,z=T?T.filter(P=>P.status==="completed").length:0,R=!S&&xoe(g),D=S?j:ioe(t)||R,N=l&&R,B=soe(t);return p&&r?h.jsx("div",{className:rt.line,children:h.jsx(Rc,{request:n,onConfirm:r})}):h.jsxs("div",{className:rt.line,children:[h.jsxs("div",{className:`${rt.lineMain} ${D?rt.lineExpandable:""}`,title:D?a(l?"tool.collapseHint":"tool.expand"):void 0,"aria-expanded":D?l:void 0,role:D?"button":void 0,tabIndex:D?0:void 0,onClick:D?()=>{u.current=!0,c(P=>!P)}:void 0,onKeyDown:D?P=>{P.key!=="Enter"&&P.key!==" "||(P.preventDefault(),u.current=!0,c(J=>!J))}:void 0,children:[h.jsx(kl,{status:t.status}),h.jsx("span",{className:rt.lineName,children:w}),S&&j&&h.jsxs("span",{className:rt.todoProgress,children:[z,"/",T.length]}),h.jsx(m2,{info:{kind:AD(t),tool:t,displayName:w,description:S||N?"":g,elapsed:S?"":C,workspaceCwd:i}})]}),S&&j&&h.jsx(goe,{tool:t,todos:T,expanded:l}),S&&!j&&y&&h.jsx("div",{className:rt.lineOutput,children:y}),N&&h.jsx("div",{className:rt.lineFullArg,children:g}),!S&&y&&(!l||!B)&&h.jsx("div",{className:rt.lineOutput,children:y}),!S&&l&&B&&h.jsxs("div",{className:rt.lineDetail,children:[Gl(E)&&h.jsx(foe,{tool:t,maxLines:s}),(E==="write_file"||E==="writefile")&&h.jsx(h8,{tool:t}),(E==="edit"||E==="write"||E==="editfile")&&h.jsx(h8,{tool:t}),(E==="read"||E==="read_file"||E==="readfile")&&h.jsx(moe,{tool:t}),q0(t.toolName)&&h.jsx(boe,{tool:t})]})]})},Soe),Coe=v.memo(function({tools:t,pendingApproval:n,onConfirm:r,workspaceCwd:i,shellOutputMaxLines:s}){const a=v.useContext(gh),o=(n==null?void 0:n.toolCallId)&&t.find(u=>u.callId===n.toolCallId),l=(n==null?void 0:n.toolCallId)&&t.some(u=>Ua(u,n.toolCallId)),c=a&&!l;return o&&t.length===1&&r?h.jsx(Rc,{request:n,onConfirm:r}):c?h.jsx(_oe,{tools:t,workspaceCwd:i}):h.jsx("div",{className:rt.group,children:t.map(u=>h.jsx(MD,{tool:u,approval:n,onConfirm:r,workspaceCwd:i,shellOutputMaxLines:s},u.callId))})}),Eoe="_message_19jij_1",Aoe="_header_19jij_6",Moe="_chevron_19jij_20",Noe="_title_19jij_26",Ioe="_progress_19jij_35",zh={message:Eoe,header:Aoe,chevron:Moe,title:Noe,progress:Ioe};function Doe({id:e,todos:t}){var i;const r=((i=v.useContext(u5).get(e))==null?void 0:i.events)??[];return h.jsx(SD,{todos:t,events:r})}const Roe=v.memo(function({id:t,todos:n}){const{t:r}=ft(),[i,s]=v.useState(!1);if(n.length===0)return null;const a=n.length,o=n.filter(l=>l.status==="completed").length;return h.jsxs("div",{className:zh.message,children:[h.jsxs("button",{type:"button",className:zh.header,onClick:()=>s(l=>!l),"aria-expanded":i,title:r(i?"todo.collapse":"todo.expand"),children:[h.jsx("span",{className:zh.chevron,"aria-hidden":"true",children:i?"▾":"▸"}),h.jsx("span",{className:zh.title,children:r("plan.title")}),h.jsxs("span",{className:zh.progress,children:[o,"/",a]})]}),i?h.jsx(TD,{todos:n,numbered:!0}):h.jsx(Doe,{id:t,todos:n})]})}),Ooe="_message_1ahub_1",joe="_content_1ahub_11",Loe="_question_1ahub_17",Boe="_prefix_1ahub_24",zoe="_answer_1ahub_28",Poe="_pending_1ahub_32",$oe="_shortcuts_1ahub_36",gc={message:Ooe,content:joe,question:Loe,prefix:Boe,answer:zoe,pending:Poe,shortcuts:$oe},ND=v.memo(function({question:t,answer:n,isPending:r}){const{t:i}=ft();return h.jsxs("div",{className:gc.message,children:[h.jsxs("div",{className:gc.content,children:[h.jsxs("div",{className:gc.question,children:[h.jsx("span",{className:gc.prefix,children:"/btw "}),h.jsx("span",{children:t})]}),h.jsx("div",{className:gc.answer,children:r?h.jsx("span",{className:gc.pending,children:i("btw.answering")}):h.jsx(yd,{content:n})})]}),h.jsx("div",{className:gc.shortcuts,children:i(r?"btw.shortcuts.pending":"btw.shortcuts.done")})]})}),Uoe="_message_102cm_1",Hoe="_compact_102cm_16",qoe="_header_102cm_21",Foe="_status_102cm_30",Voe="_name_102cm_35",Goe="_command_102cm_43",Woe="_output_102cm_52",Koe="_compactHint_102cm_63",oo={message:Uoe,compact:Hoe,header:qoe,status:Foe,name:Voe,command:Goe,output:Woe,compactHint:Koe},Yoe=v.memo(function({command:t,output:n}){const r=v.useContext(gh),{t:i}=ft();return h.jsxs("div",{className:r?`${oo.message} ${oo.compact}`:oo.message,children:[h.jsxs("div",{className:oo.header,children:[h.jsx("span",{className:oo.status,children:"✓"}),h.jsx("span",{className:oo.name,children:i("shell.command")}),t&&h.jsx("span",{className:oo.command,children:t})]}),r?h.jsx("div",{className:oo.compactHint,children:i("compact.hint")}):n&&h.jsx("pre",{className:oo.output,children:n})]})}),Xoe="_progress_11zl8_1",Qoe="_spinner_11zl8_12",Joe="_bar_11zl8_19",Zoe="_stage_11zl8_25",ele="_icon_11zl8_29",tle="_done_11zl8_35",nle="_error_11zl8_43",rle="_detail_11zl8_51",ile="_path_11zl8_56",zr={progress:Xoe,spinner:Qoe,bar:Joe,stage:Zoe,icon:ele,done:tle,error:nle,detail:rle,path:ile},m8=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"];function sle({progress:e}){const{stage:t,progress:n,detail:r,isComplete:i,error:s}=e,[a,o]=v.useState(0),l=30,c=Math.round(n/100*l),u=l-c,d="█".repeat(Math.max(0,c))+"░".repeat(Math.max(0,u));return v.useEffect(()=>{if(i||s)return;const f=setInterval(()=>{o(m=>(m+1)%m8.length)},120);return()=>clearInterval(f)},[i,s]),s?h.jsxs("div",{className:`${zr.progress} ${zr.error}`,children:[h.jsx("span",{className:zr.icon,children:"✕"}),h.jsx("span",{className:zr.stage,children:t}),h.jsx("div",{className:zr.detail,children:s})]}):i?h.jsxs("div",{className:`${zr.progress} ${zr.done}`,children:[h.jsx("span",{className:zr.icon,children:"✓"}),h.jsx("span",{className:zr.stage,children:t})]}):h.jsxs("div",{className:zr.progress,children:[h.jsx("span",{className:zr.spinner,children:m8[a]}),h.jsx("span",{className:zr.bar,children:d}),h.jsxs("span",{className:zr.stage,children:[t,r?` (${r})`:""]})]})}function ale({path:e}){const{t}=ft();return h.jsxs("div",{className:`${zr.progress} ${zr.done}`,children:[h.jsx("span",{className:zr.icon,children:"✓"}),h.jsx("span",{className:zr.stage,children:t("insight.ready")}),h.jsx("span",{className:zr.path,children:e})]})}const ole=v.memo(function({message:t,pendingApproval:n,onConfirm:r,onShowContextDetail:i,workspaceCwd:s,isLatest:a=!1,showRetryHint:o=!1,onRetryClick:l,shellOutputMaxLines:c,collapse:u,onToggleCollapse:d}){const f=(()=>{switch(t.role){case"user":return h.jsx(ite,{content:t.content,images:t.images,collapse:u,onToggleCollapse:d});case"assistant":return h.jsx(yte,{content:t.content,thinking:t.thinking,isStreaming:t.isStreaming});case"tool_group":return h.jsx(Coe,{tools:t.tools,pendingApproval:n,onConfirm:r,workspaceCwd:s,shellOutputMaxLines:c});case"plan":return h.jsx(Roe,{id:t.id,todos:t.todos});case"system":return h.jsx(qie,{content:t.content,variant:t.variant,source:t.source,data:t.data,onShowContextDetail:i,isLatest:a,showRetryHint:o&&t.retryable===!0,onRetryClick:l});case"user_shell":return h.jsx(Yoe,{command:t.command,output:t.output});case"btw":return h.jsx(ND,{question:t.question,answer:t.answer,isPending:t.isPending});case"insight_progress":return h.jsx(sle,{progress:{stage:t.stage,progress:t.progress,detail:t.detail}});case"insight_ready":return h.jsx(ale,{path:t.path});case"insight_error":return h.jsx("div",{style:{color:"var(--error-color, #e06c75)"},children:t.error});default:return null}})();return f===null?null:h.jsx(rM,{timestamp:t.timestamp,children:f})},lle);function lle(e,t){var n,r;return((n=e.pendingApproval)==null?void 0:n.id)!==((r=t.pendingApproval)==null?void 0:r.id)||e.onConfirm!==t.onConfirm||e.onShowContextDetail!==t.onShowContextDetail||e.workspaceCwd!==t.workspaceCwd||e.isLatest!==t.isLatest||e.showRetryHint!==t.showRetryHint||e.onRetryClick!==t.onRetryClick||e.shellOutputMaxLines!==t.shellOutputMaxLines||e.onToggleCollapse!==t.onToggleCollapse||!cle(e.collapse,t.collapse)?!1:ule(e.message,t.message)}function cle(e,t){return e===t?!0:!e||!t?!1:e.turnId===t.turnId&&e.collapsed===t.collapsed&&e.hiddenCount===t.hiddenCount&&e.elapsedMs===t.elapsedMs&&e.inputTokens===t.inputTokens&&e.outputTokens===t.outputTokens&&e.cachedTokens===t.cachedTokens&&e.toolCallCount===t.toolCallCount&&e.liveStartedAt===t.liveStartedAt}function ule(e,t){if(e===t)return!0;if(e.id!==t.id||e.role!==t.role||e.timestamp!==t.timestamp)return!1;switch(e.role){case"user":return t.role==="user"&&e.content===t.content&&fle(e.images,t.images);case"assistant":return t.role==="assistant"&&e.content===t.content&&e.thinking===t.thinking&&e.isStreaming===t.isStreaming;case"system":return t.role==="system"&&e.content===t.content&&e.variant===t.variant&&e.retryable===t.retryable&&e.source===t.source&&e.data===t.data;case"user_shell":return t.role==="user_shell"&&e.command===t.command&&e.output===t.output&&e.cwd===t.cwd;case"btw":return t.role==="btw"&&e.question===t.question&&e.answer===t.answer&&e.isPending===t.isPending;case"insight_progress":return t.role==="insight_progress"&&e.stage===t.stage&&e.progress===t.progress&&e.detail===t.detail;case"insight_ready":return t.role==="insight_ready"&&e.path===t.path;case"insight_error":return t.role==="insight_error"&&e.error===t.error;case"plan":return t.role==="plan"&&dle(e.todos,t.todos);case"tool_group":return t.role==="tool_group"&&e.tools.length===t.tools.length&&e.tools.every((n,r)=>ID(n,t.tools[r]));default:return!1}}function dle(e,t){return e.length===t.length&&e.every((n,r)=>{const i=t[r];return i&&n.id===i.id&&n.content===i.content&&n.status===i.status&&n.priority===i.priority})}function ID(e,t){return t?e.callId===t.callId&&e.toolName===t.toolName&&e.status===t.status&&e.title===t.title&&e.kind===t.kind&&e.startTime===t.startTime&&e.endTime===t.endTime&&e.subContent===t.subContent&&nl(e.args)===nl(t.args)&&nl(e.rawOutput)===nl(t.rawOutput)&&nl(e.locations)===nl(t.locations)&&nl(e.content)===nl(t.content)&&hle(e.subTools,t.subTools):!1}function hle(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every((n,r)=>ID(n,t[r]))}const p8=new WeakMap;function fle(e,t){return e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,r)=>n.data===t[r].data&&n.mimeType===t[r].mimeType)}function nl(e){if(e===void 0)return"";if(e!==null&&typeof e=="object"){let t=p8.get(e);if(t!==void 0)return t;try{t=JSON.stringify(e)}catch{t=String(e)}return p8.set(e,t),t}try{return JSON.stringify(e)}catch{return String(e)}}const mle="_group_513hv_1",ple="_header_513hv_12",gle="_headerDot_513hv_22",yle="_headerCount_513hv_26",ble="_list_513hv_31",vle="_row_513hv_39",xle="_rowStats_513hv_53",wle="_rowDesc_513hv_61",kle="_rowTool_513hv_71",_le="_detail_513hv_75",ba={group:mle,header:ple,headerDot:gle,headerCount:yle,list:ble,row:vle,rowStats:xle,rowDesc:wle,rowTool:kle,detail:_le};function Sle(e){const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}function Tle(e,t){const n=[],r=oy(e.rawOutput),i=r==null?void 0:r.executionSummary,s=i&&typeof i.totalDurationMs=="number"?Sle(i.totalDurationMs):F0(e.startTime,e.endTime??(e.status==="in_progress"?t:void 0));s&&n.push(s);const a=r&&typeof r.tokenCount=="number"&&r.tokenCount>0?r.tokenCount:i&&typeof i.totalTokens=="number"&&i.totalTokens>0?i.totalTokens:0;a>0&&n.push(_k(a));const o=kk(e);return o&&n.push(qr(o,80)),n.join(" · ")}function Cle({agents:e,pendingApproval:t,onConfirm:n}){const{t:r}=ft(),[i,s]=v.useState(null),[a,o]=v.useState(()=>Date.now()),l=e.some(f=>f.status==="in_progress");v.useEffect(()=>{if(!l)return;const f=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(f)},[l]);const c=e.filter(f=>f.status==="completed"||f.status==="failed").length,u=e.length,d=t!=null&&t.toolCallId?e.find(f=>Ua(f,t.toolCallId)):void 0;return h.jsxs("div",{className:ba.group,children:[h.jsxs("div",{className:ba.header,children:[h.jsx("span",{children:r("parallelAgents.title")}),h.jsx("span",{className:ba.headerDot,children:"·"}),h.jsx("span",{className:ba.headerCount,children:r("parallelAgents.done",{done:c,total:u})})]}),h.jsx("div",{className:ba.list,children:e.map(f=>{const m=Sk(f),p=Tk(f),b=pD(f,r),x=Tle(f,a),g=ly(f),y=i===f.callId;return h.jsxs("div",{children:[h.jsxs("div",{className:ba.row,onClick:()=>s(y?null:f.callId),children:[h.jsx(kl,{status:g}),h.jsxs("span",{className:ba.rowDesc,children:[qr(p||m,50),b&&h.jsx("span",{className:ba.rowTool,children:` (${b})`})]}),x&&h.jsx("span",{className:ba.rowStats,children:x})]}),y&&h.jsx("div",{className:ba.detail,children:h.jsx(Ck,{tool:f,hideHeader:!0})})]},f.callId)})}),d&&t&&n&&h.jsx(Rc,{request:t,onConfirm:n})]})}const Ele="_question_mx5aq_1",Ale="_titleLine_mx5aq_9",Mle="_icon_mx5aq_16",Nle="_toolName_mx5aq_22",Ile="_toolDesc_mx5aq_27",Dle="_tabs_mx5aq_31",Rle="_tab_mx5aq_31",Ole="_tabActive_mx5aq_51",jle="_tabCheck_mx5aq_57",Lle="_header_mx5aq_65",Ble="_text_mx5aq_72",zle="_multiHint_mx5aq_78",Ple="_options_mx5aq_83",$le="_option_mx5aq_83",Ule="_optionActive_mx5aq_98",Hle="_optionLabel_mx5aq_98",qle="_optionSelected_mx5aq_99",Fle="_pointer_mx5aq_107",Vle="_checkbox_mx5aq_114",Gle="_optionNum_mx5aq_126",Wle="_optionContent_mx5aq_132",Kle="_optionPlaceholder_mx5aq_142",Yle="_optionDesc_mx5aq_147",Xle="_customInput_mx5aq_153",Qle="_submitTab_mx5aq_169",Jle="_summary_mx5aq_173",Zle="_summaryRow_mx5aq_180",ece="_summaryLabel_mx5aq_186",tce="_summaryValue_mx5aq_191",nce="_footer_mx5aq_226",yt={question:Ele,titleLine:Ale,icon:Mle,toolName:Nle,toolDesc:Ile,tabs:Dle,tab:Rle,tabActive:Ole,tabCheck:jle,header:Lle,text:Ble,multiHint:zle,options:Ple,option:$le,optionActive:Ule,optionLabel:Hle,optionSelected:qle,pointer:Fle,checkbox:Vle,optionNum:Gle,optionContent:Wle,optionPlaceholder:Kle,optionDesc:Yle,customInput:Xle,submitTab:Qle,summary:Jle,summaryRow:Zle,summaryLabel:ece,summaryValue:tce,footer:nce};function rce({request:e,onConfirm:t}){const{t:n}=ft(),r=v.useMemo(()=>{var $;return Array.isArray(($=e.rawInput)==null?void 0:$.questions)?e.rawInput.questions:[]},[e.rawInput]),[i,s]=v.useState(0),[a,o]=v.useState(0),[l,c]=v.useState({}),[u,d]=v.useState({}),[f,m]=v.useState({}),[p,b]=v.useState(!1),x=v.useRef(!1),g=r.length+1,y=i===r.length;v.useEffect(()=>{x.current=!1,s(0),o(0),c({}),d({}),m({}),b(!1)},[e.id]);const w=y?void 0:r[i],C=(w==null?void 0:w.multiSelect)??!1,E=y?2:((w==null?void 0:w.options.length)??0)+1,S=(w==null?void 0:w.options.length)??0,T=v.useCallback(($,Z=l,M=u,X=f)=>{if($===r.length)return 0;const H=r[$];if(!H)return 0;const O=H.options.length;if(H.multiSelect){const be=X[$]||[],Ee=H.options.findIndex(qe=>be.includes(qe.label));return Ee>=0?Ee:M[$]?O:0}const se=Z[$],ke=H.options.findIndex(be=>be.label===se);return ke>=0?ke:M[$]||se?O:0},[l,u,r,f]),j=v.useCallback(()=>{const $={};for(let Z=0;Z<r.length;Z++){const M=r[Z];if(M)if(M.multiSelect){const X=f[Z]||[],H=u[Z],O=H?[...X,H]:X;$[String(Z)]=O.join(", ")}else $[String(Z)]=l[Z]||u[Z]||""}return $},[r,f,u,l]),z=v.useCallback(()=>{if(x.current)return;const $=e.options.find(Z=>Z.kind==="allow_once");$&&(x.current=!0,t(e.id,$.id,j()))},[j,e,t]),R=v.useCallback(()=>{if(x.current)return;const $=e.options.find(Z=>Z.kind==="reject_once"||Z.kind==="reject_always");$&&(x.current=!0,t(e.id,$.id,void 0))},[e,t]),D=v.useCallback($=>{g<=1||s(Z=>{const M=(Z+$+g)%g;return o(T(M)),b(!1),M})},[T,g]),N=v.useCallback($=>{$!==void 0&&d(Z=>({...Z,[i]:$})),b(!0)},[i]),B=v.useCallback($=>{if(y){$===0?z():R();return}if(!w)return;if($===w.options.length){N();return}const M=w.options[$].label;if(C){const X=f[i]||[],H=X.includes(M)?X.filter(O=>O!==M):[...X,M];m({...f,[i]:H})}else{const X={...l,[i]:M};if(c(X),i<r.length-1){const H=i+1;s(H),o(T(H,X))}else s(r.length),o(T(r.length,X))}},[y,w,i,C,f,l,r,z,R,N,T]),P=v.useCallback($=>{if(y||!w||!C)return;if($===w.options.length){N();return}const Z=w.options[$].label,M=f[i]||[],X=M.includes(Z)?M.filter(H=>H!==Z):[...M,Z];m({...f,[i]:X})},[y,w,C,f,i,N]);v.useEffect(()=>{if(p)return;const $=M=>{M.preventDefault(),M.stopPropagation()},Z=M=>{if(!M.defaultPrevented)if(M.key==="ArrowDown"||M.key==="j")$(M),o(X=>Math.min(X+1,E-1));else if(M.key==="ArrowUp"||M.key==="k")$(M),o(X=>Math.max(X-1,0));else if(M.key==="ArrowRight")$(M),D(1);else if(M.key==="ArrowLeft")$(M),D(-1);else if(M.key===" ")$(M),C?P(a):B(a);else if(M.key==="Enter")if($(M),C)if(i<r.length-1){const X=i+1;s(X),o(T(X))}else s(r.length),o(T(r.length));else B(a);else if(M.key==="Escape")$(M),R();else if(M.key>="1"&&M.key<="9"){const X=parseInt(M.key)-1;X<E&&($(M),o(X),C?P(X):B(X))}else!y&&a===S&&M.key.length===1&&!M.metaKey&&!M.ctrlKey&&!M.altKey&&($(M),N(M.key))};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[p,E,a,S,C,y,i,r.length,B,P,R,D,N,T]);const J=$=>{if($.key==="Enter"){$.preventDefault(),$.stopPropagation();const Z=u[i];if(Z){if(!C){const M={...l,[i]:Z};if(c(M),i<r.length-1){const X=i+1;s(X),o(T(X,M)),b(!1);return}s(r.length),o(T(r.length,M)),b(!1);return}if(b(!1),i<r.length-1){const M=i+1;s(M),o(T(M))}else s(r.length),o(T(r.length))}}else $.key==="Escape"?($.preventDefault(),$.stopPropagation(),b(!1)):$.key==="ArrowDown"?($.preventDefault(),$.stopPropagation(),b(!1),o(Z=>Math.min(Z+1,E-1))):$.key==="ArrowUp"?($.preventDefault(),$.stopPropagation(),b(!1),o(Z=>Math.max(Z-1,0))):$.key==="Tab"&&($.preventDefault(),$.stopPropagation(),b(!1),D($.shiftKey?-1:1))};if(r.length===0)return null;const q=$=>{const Z=r[$];return Z?Z.multiSelect?(f[$]||[]).length>0||!!u[$]:!!l[$]||!!u[$]:!1},W=$=>{const Z=r[$];if(!Z)return"";if(Z.multiSelect){const M=f[$]||[],X=u[$];return(X?[...M,X]:M).join(", ")}return l[$]||u[$]||""};return h.jsxs("div",{className:yt.question,children:[h.jsxs("div",{className:yt.titleLine,children:[h.jsx("span",{className:yt.icon,children:"?"}),h.jsx("span",{className:yt.toolName,children:gu("ask_user_question",n)}),h.jsx("span",{className:yt.toolDesc,children:n("askUser.title",{count:r.length})})]}),h.jsxs("div",{className:yt.tabs,children:[r.map(($,Z)=>h.jsxs("button",{className:`${yt.tab} ${Z===i?yt.tabActive:""}`,onClick:()=>{s(Z),o(T(Z)),b(!1)},children:[$.header,q(Z)&&h.jsx("span",{className:yt.tabCheck,children:" ✓"})]},Z)),h.jsx("button",{className:`${yt.tab} ${y?yt.tabActive:""}`,onClick:()=>{s(r.length),o(T(r.length)),b(!1)},children:n("askUser.submit")})]}),y?h.jsxs("div",{className:yt.submitTab,children:[h.jsx("div",{className:yt.header,children:n("askUser.confirmTitle")}),h.jsx("div",{className:yt.summary,children:r.map(($,Z)=>h.jsxs("div",{className:yt.summaryRow,children:[h.jsxs("span",{className:yt.summaryLabel,children:[$.header,":"]}),h.jsx("span",{className:yt.summaryValue,children:W(Z)||"—"})]},Z))}),h.jsx("div",{className:yt.text,children:n("askUser.confirmPrompt")}),h.jsxs("div",{className:yt.options,children:[h.jsxs("div",{className:`${yt.option} ${a===0?yt.optionActive:""}`,onClick:z,onMouseEnter:()=>o(0),children:[h.jsx("span",{className:yt.pointer,children:a===0?"›":" "}),h.jsx("span",{className:yt.optionNum,children:"1."}),h.jsx("span",{className:yt.optionLabel,children:n("askUser.submitAnswers")})]}),h.jsxs("div",{className:`${yt.option} ${a===1?yt.optionActive:""}`,onClick:R,onMouseEnter:()=>o(1),children:[h.jsx("span",{className:yt.pointer,children:a===1?"›":" "}),h.jsx("span",{className:yt.optionNum,children:"2."}),h.jsx("span",{className:yt.optionLabel,children:n("askUser.cancel")})]})]})]}):w?h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:yt.text,children:[w.question,C&&h.jsxs("span",{className:yt.multiHint,children:[" ","(",n("askUser.multiHint"),")"]})]}),h.jsxs("div",{className:yt.options,children:[w.options.map(($,Z)=>{const M=Z===a,X=C?(f[i]||[]).includes($.label):l[i]===$.label;return h.jsxs("div",{className:`${yt.option} ${M?yt.optionActive:""} ${X?yt.optionSelected:""}`,onClick:()=>{o(Z),C?P(Z):B(Z)},onMouseEnter:()=>o(Z),children:[h.jsx("span",{className:yt.pointer,children:M?"›":" "}),C&&h.jsx("span",{className:yt.checkbox,children:X?"[✓]":"[ ]"}),h.jsxs("span",{className:yt.optionNum,children:[Z+1,"."]}),h.jsxs("span",{className:yt.optionContent,children:[h.jsx("span",{className:yt.optionLabel,children:$.label}),$.description&&h.jsx("span",{className:yt.optionDesc,children:$.description})]})]},$.label)}),(()=>{const $=a===w.options.length,Z=!!u[i];return h.jsxs("div",{className:`${yt.option} ${$?yt.optionActive:""} ${Z?yt.optionSelected:""}`,onClick:()=>{o(w.options.length),N()},onMouseEnter:()=>o(w.options.length),children:[h.jsx("span",{className:yt.pointer,children:$?"›":" "}),C&&h.jsx("span",{className:yt.checkbox,children:Z?"[✓]":"[ ]"}),h.jsxs("span",{className:yt.optionNum,children:[w.options.length+1,"."]}),p?h.jsx("input",{type:"text",className:yt.customInput,placeholder:n("askUser.typePlaceholder"),value:u[i]||"",onChange:M=>d({...u,[i]:M.target.value}),onKeyDown:J,onBlur:()=>b(!1),autoFocus:!0}):h.jsx("span",{className:`${yt.optionLabel} ${u[i]?"":yt.optionPlaceholder}`,children:u[i]||n("askUser.typePlaceholder")})]})})()]})]}):null,h.jsx("div",{className:yt.footer,children:n(C?"askUser.footerMulti":"askUser.footer")})]})}const ice="_list_cbo0z_1",sce="_rowFlash_cbo0z_23",g8={list:ice,rowFlash:sce};function y8(e){var t;return!!((t=e.rawInput)!=null&&t.questions)&&Array.isArray(e.rawInput.questions)}function ace(e,t){if(!(t!=null&&t.toolCallId))return!1;for(const n of e)if(n.role==="tool_group"&&n.tools.some(r=>Ua(r,t.toolCallId)))return!0;return!1}function oce(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="user")return n.id}return null}function b8(e){return e.role==="tool_group"&&e.tools.length===1&&z1(e.tools[0])}function jv(e){return e.role==="tool_group"&&e.tools.length===1&&tM(e.tools[0])}function v8(e){return e.role==="assistant"&&!!e.thinking&&!e.content}function x8(e,t){return e.role!=="tool_group"?!1:!!(t!=null&&t.toolCallId&&e.tools.some(n=>Ua(n,t.toolCallId)))}function w8(e){return!!(e.role==="assistant"&&e.thinking&&!e.content)}function lce(e,t){const n=[];let r=0;for(;r<e.length;){const i=e[r];if(i.role!=="tool_group"||x8(i,t)){w8(i)||n.push(i),r++;continue}const s=[i];let a=r,o=r+1;for(;o<e.length;){const c=e[o];if(w8(c)){o++;continue}if(c.role==="tool_group"&&!x8(c,t)){s.push(c),a=o,o++;continue}break}if(s.length===1){n.push(i),r++;continue}const l=s.flatMap(c=>c.role==="tool_group"?c.tools:[]);n.push({id:s[0].id,role:"tool_group",tools:l}),r=a+1}return n}function cce(e){const t=[];let n=0;for(;n<e.length;){if(jv(e[n])){const r=[];let i=n;for(;i<e.length;){const s=e[i];if(jv(s)){r.push(s),i++;continue}if(v8(s)){let a=i+1;for(;a<e.length&&v8(e[a]);)a++;if(a<e.length&&jv(e[a])){i=a;continue}}break}if(r.length>=2){t.push({type:"parallel_agents",key:`par-${r[0].id}`,agents:r.map(s=>s.tools[0]),timestamp:r[0].timestamp}),n=i;continue}}if(b8(e[n])){const r=n;for(;n<e.length&&b8(e[n]);)n++;if(n-r>=2){const i=e.slice(r,n);t.push({type:"parallel_agents",key:`par-${i[0].id}`,agents:i.map(s=>s.tools[0]),timestamp:i[0].timestamp})}else t.push({type:"message",key:e[r].id,message:e[r]})}else t.push({type:"message",key:e[n].id,message:e[n]}),n++}return t}function uce(e){return e.type==="parallel_agents"?`group:${e.key}`:`msg:${e.key}`}function dce(e){return e.type==="message"&&e.message.role==="assistant"&&!!e.message.content&&e.message.content.trim().length>0}function k8(e,t){if(e.type==="parallel_agents")return!0;switch(e.message.role){case"tool_group":case"plan":return!0;case"assistant":return!t;case"user":case"system":case"user_shell":case"btw":case"insight_progress":case"insight_ready":case"insight_error":return!1;default:return e.message,!1}}function hce(e){return e.type==="parallel_agents"?!0:e.message.role==="tool_group"||e.message.role==="plan"}function fce(e){return e.type==="message"?e.message.timestamp:e.timestamp}function mce(e){return e.type==="message"&&e.message.role==="assistant"?e.message.usage:void 0}function pce(e){return e.type==="parallel_agents"?e.agents.length:e.message.role==="tool_group"?e.message.tools.length:0}function gce(e,t){for(let n=Math.min(t,e.length-1);n>=0;n--){const r=e[n];if(r.type==="message"&&r.message.role==="user")return r.message.id}return null}function yce(e,t,n,r){if(!r)return!1;for(let i=t;i<=n;i++){const s=e[i];if(s.type==="parallel_agents"){if(s.agents.some(a=>Ua(a,r)))return!0}else if(s.message.role==="tool_group"&&s.message.tools.some(a=>Ua(a,r)))return!0}return!1}function bce(e,{overrides:t,isResponding:n,pendingApprovalCallId:r,enabled:i}){if(!i||e.length===0)return e;const s=[];for(let o=0;o<e.length;o++){const l=e[o];l.type==="message"&&l.message.role==="user"&&s.push(o)}if(s.length===0)return e;const a=[];for(let o=0;o<s[0];o++)a.push(e[o]);for(let o=0;o<s.length;o++){const l=s[o],c=(o+1<s.length?s[o+1]:e.length)-1,u=e[l],d=u.message.id,f=o===s.length-1&&n,m=yce(e,l,c,r);let p=-1,b=l;for(let B=l+1;B<=c;B++)hce(e[B])&&(b=B);for(let B=c;B>b;B--)if(dce(e[B])){p=B;break}let x=0,g,y=0,w=0,C=0,E=0,S=!1;for(let B=l+1;B<=c;B++){const P=k8(e[B],B===p);P&&x++,E+=pce(e[B]);const J=P||B===p?fce(e[B]):void 0;J!==void 0&&(g=g===void 0?J:Math.max(g,J));const q=mce(e[B]);q&&(y+=q.inputTokens,w+=q.outputTokens,C+=q.cachedTokens??0,S=!0)}const T=u.message.timestamp,j=f?T??Date.now():void 0,z=T!==void 0&&g!==void 0&&g>=T?g-T:void 0;if(m||x===0&&!(S||z!==void 0||j!==void 0)){for(let B=l;B<=c;B++)a.push(e[B]);continue}const N=!(x===0?!0:t.has(d)?t.get(d):f);if(a.push({type:"message",key:u.key,message:u.message,collapse:{turnId:d,collapsed:N,hiddenCount:x,...z!==void 0?{elapsedMs:z}:{},...S?{inputTokens:y,outputTokens:w}:{},...C>0?{cachedTokens:C}:{},...E>0?{toolCallCount:E}:{},...j!==void 0?{liveStartedAt:j}:{}}}),!N){for(let B=l+1;B<=c;B++)a.push(e[B]);continue}for(let B=l+1;B<=c;B++){const P=e[B];B===p&&f||k8(P,B===p)||(B===p&&P.type==="message"&&P.message.role==="assistant"&&P.message.thinking?a.push({type:"message",key:P.key,message:{...P.message,thinking:void 0}}):a.push(P))}}return a}function Lv(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if(i.type==="message"){if(i.message.id===t||n&&i.message.role==="tool_group"&&i.message.tools.some(s=>Ua(s,n)))return r}else if(n&&i.agents.some(s=>Ua(s,n)))return r}return-1}const Bv=0,vce=120,xce=80,wce=200,kce=240,DD=200;function _ce(e,t=DD){return e>t}const Sce=v.forwardRef(function({messages:t,pendingApproval:n,onConfirm:r,onShowContextDetail:i,catchingUp:s,isResponding:a=!1,welcomeHeader:o,workspaceCwd:l,tailContent:c,tailKey:u="tail",virtualScrollThreshold:d=DD,shellOutputMaxLines:f,autoScrollTailIntoView:m=!1,showRetryHint:p=!1,onRetryClick:b},x){const g=v.useContext(gh),y=v.useMemo(()=>g?lce(t,n):t,[g,t,n]),w=v.useMemo(()=>cce(y),[y]),{collapseCompletedTurns:C}=hu(),E=C??!0,[S,T]=v.useState(()=>new Map),j=v.useCallback(pe=>{D.current=!1,T(st=>{const ae=st.get(pe)??!1,je=new Map(st);return je.set(pe,!ae),je})},[]),z=v.useMemo(()=>bce(w,{overrides:S,isResponding:a,pendingApprovalCallId:(n==null?void 0:n.toolCallId)??null,enabled:E}),[w,S,a,n==null?void 0:n.toolCallId,E]),R=v.useRef(null),D=v.useRef(!0),N=v.useRef(0),B=v.useRef(!1),P=v.useRef(0),J=v.useRef(null),q=v.useRef(s),W=v.useRef(s),$=v.useRef(!1);W.current=s;const Z=v.useMemo(()=>n?y8(n)?!0:!ace(t,n):!1,[n,t]),M=c!=null,X=!!o,H=X?1:0,O=H+z.length,se=O+(Z?1:0),ke=se+(M?1:0),be=_ce(ke,d),Ee=v.useCallback(pe=>{if(X&&pe===Bv)return"slot:header";if(Z&&pe===O)return n?`slot:approval:${n.id}`:"slot:approval";if(M&&pe===se)return`slot:tail:${u}`;const st=z[pe-H];return st?uce(st):`slot:row:${pe}`},[X,Z,O,n,M,se,u,z,H]),qe=v.useCallback(()=>{const pe=R.current;if(!pe||pe.scrollHeight<=pe.clientHeight)return;P.current+=1;const st=P.current;B.current=!0,pe.scrollTop=pe.scrollHeight,N.current=pe.scrollTop,requestAnimationFrame(()=>{P.current===st&&(B.current=!1)})},[]),wt=KU({count:ke,enabled:be,getScrollElement:()=>R.current,getItemKey:Ee,estimateSize:pe=>X&&pe===Bv?vce:Z&&pe===O?wce:M&&pe===se?kce:xce,overscan:20,useFlushSync:!1,useAnimationFrameWithResizeObserver:!0}),[Mt,bt]=v.useState(null);v.useEffect(()=>{if(!Mt)return;const pe=setTimeout(()=>bt(null),1600);return()=>clearTimeout(pe)},[Mt]);const Je=v.useCallback(pe=>{var je,Oe;D.current=!1,P.current+=1;const st=P.current;B.current=!0,be?wt.scrollToIndex(pe,{align:"center"}):(Oe=(je=R.current)==null?void 0:je.querySelector(`[data-index="${pe}"]`))==null||Oe.scrollIntoView({block:"center"}),setTimeout(()=>{P.current===st&&(B.current=!1)},150);const ae=Ee(pe);bt(null),requestAnimationFrame(()=>bt(ae))},[be,wt,Ee]),Ge=v.useRef(null),Pt=v.useCallback((pe,st)=>{const ae=Lv(z,pe,st);if(ae>=0)return Ge.current=null,Je(ae+H),!0;const je=Lv(w,pe,st);if(je<0)return!1;const Oe=gce(w,je);return Oe?(Ge.current={messageId:pe,callId:st},T($e=>{if($e.get(Oe)===!0)return $e;const te=new Map($e);return te.set(Oe,!0),te}),!0):!1},[z,w,H,Je]);v.useImperativeHandle(x,()=>({scrollToMessage:Pt}),[Pt]),v.useEffect(()=>{const pe=Ge.current;if(!pe)return;const st=Lv(z,pe.messageId,pe.callId);st<0||(Ge.current=null,Je(st+H))},[z,H,Je]);const Ze=v.useCallback(()=>{const pe=R.current;if(!pe)return;if(B.current){N.current=pe.scrollTop;return}const st=N.current,ae=pe.scrollTop;N.current=ae;const je=pe.scrollHeight-ae-pe.clientHeight;ae<st-1&&(D.current=!1),je<30&&(D.current=!0)},[]);v.useEffect(()=>{t.length===0&&(D.current=!0,Ge.current=null,T(pe=>pe.size?new Map:pe))},[t.length]),v.useEffect(()=>{const pe=R.current;if(!pe)return;const st=new ResizeObserver(()=>{W.current||D.current&&requestAnimationFrame(()=>{!W.current&&D.current&&qe()})});return st.observe(pe),()=>st.disconnect()},[qe]),v.useEffect(()=>{const pe=oce(t);if(s){J.current=pe;return}pe&&pe!==J.current&&(D.current=!0,Ge.current=null,requestAnimationFrame(qe)),J.current=pe},[t,s,qe]),v.useEffect(()=>{q.current&&!s&&(D.current=!0,requestAnimationFrame(qe)),q.current=s},[s,qe]),v.useEffect(()=>{m&&M&&!$.current&&(D.current=!0,requestAnimationFrame(()=>{D.current&&qe()})),$.current=M},[m,M,qe]);const re=v.useCallback(pe=>{if(X&&pe===Bv)return o;if(Z&&pe===O)return n&&y8(n)?h.jsx(rce,{request:n,onConfirm:r}):n?h.jsx(Rc,{request:n,onConfirm:r}):null;if(M&&pe===se)return c;const st=pe-H,ae=z[st];return ae?ae.type==="parallel_agents"?h.jsx(rM,{timestamp:ae.timestamp,children:h.jsx(Cle,{agents:ae.agents,pendingApproval:n,onConfirm:r})}):h.jsx(ole,{message:ae.message,pendingApproval:n,onConfirm:r,onShowContextDetail:i,workspaceCwd:l,isLatest:st===z.length-1,showRetryHint:p,onRetryClick:b,shellOutputMaxLines:f,collapse:ae.collapse,onToggleCollapse:j}):null},[X,o,M,c,se,Z,O,n,r,i,H,z,l,p,b,f,j]),le=wt.getVirtualItems(),De=wt.getTotalSize(),We=v.useCallback(pe=>Mt===pe?g8.rowFlash:void 0,[Mt]);return v.useLayoutEffect(()=>{s||D.current&&qe()},[De,t,ke,s,qe]),h.jsx("div",{ref:R,className:g8.list,onScroll:Ze,children:be?h.jsx("div",{style:{height:De,width:"100%",position:"relative"},children:le.map(pe=>h.jsx("div",{"data-index":pe.index,ref:wt.measureElement,className:We(String(pe.key)),style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${pe.start}px)`},children:re(pe.index)},pe.key))}):Array.from({length:ke},(pe,st)=>{const ae=Ee(st);return h.jsx("div",{"data-index":st,className:We(ae),children:re(st)},ae)})})});let p2=[],RD=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?RD:p2).push(n=n+e[t])})();function Tce(e){if(e<768)return!1;for(let t=0,n=p2.length;;){let r=t+n>>1;if(e<p2[r])n=r;else if(e>=RD[r])t=r+1;else return!0;if(t==n)return!1}}function _8(e){return e>=127462&&e<=127487}const S8=8205;function Cce(e,t,n=!0,r=!0){return(n?OD:Ece)(e,t,r)}function OD(e,t,n){if(t==e.length)return t;t&&jD(e.charCodeAt(t))&&LD(e.charCodeAt(t-1))&&t--;let r=zv(e,t);for(t+=T8(r);t<e.length;){let i=zv(e,t);if(r==S8||i==S8||n&&Tce(i))t+=T8(i),r=i;else if(_8(i)){let s=0,a=t-2;for(;a>=0&&_8(zv(e,a));)s++,a-=2;if(s%2==0)break;t+=2}else break}return t}function Ece(e,t,n){for(;t>0;){let r=OD(e,t-2,n);if(r<t)return r;t--}return 0}function zv(e,t){let n=e.charCodeAt(t);if(!LD(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return jD(r)?(n-55296<<10)+(r-56320)+65536:n}function jD(e){return e>=56320&&e<57344}function LD(e){return e>=55296&&e<56320}function T8(e){return e<65536?1:2}class nn{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=Hd(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Ma.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=Hd(this,t,n);let r=[];return this.decompose(t,n,r,0),Ma.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new Nf(this),s=new Nf(t);for(let a=n,o=n;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(t=1){return new Nf(this,t)}iterRange(t,n=this.length){return new BD(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new zD(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?nn.empty:t.length<=32?new cr(t):Ma.from(cr.split(t,[]))}}class cr extends nn{constructor(t,n=Ace(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let s=0;;s++){let a=this.text[s],o=i+a.length;if((n?r:o)>=t)return new Mce(i,o,r,a);i=o+1,r++}}decompose(t,n,r,i){let s=t<=0&&n>=this.length?this:new cr(C8(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let a=r.pop(),o=jp(s.text,a.text.slice(),0,s.length);if(o.length<=32)r.push(new cr(o,a.length+s.length));else{let l=o.length>>1;r.push(new cr(o.slice(0,l)),new cr(o.slice(l)))}}else r.push(s)}replace(t,n,r){if(!(r instanceof cr))return super.replace(t,n,r);[t,n]=Hd(this,t,n);let i=jp(this.text,jp(r.text,C8(this.text,0,t)),n),s=this.length+r.length-(n-t);return i.length<=32?new cr(i,s):Ma.from(cr.split(i,[]),s)}sliceString(t,n=this.length,r=`
`){[t,n]=Hd(this,t,n);let i="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let o=this.text[a],l=s+o.length;s>t&&a&&(i+=r),t<l&&n>s&&(i+=o.slice(Math.max(0,t-s),n-s)),s=l+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let s of t)r.push(s),i+=s.length+1,r.length==32&&(n.push(new cr(r,i)),r=[],i=-1);return i>-1&&n.push(new cr(r,i)),n}}class Ma extends nn{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let s=0;;s++){let a=this.children[s],o=i+a.length,l=r+a.lines-1;if((n?l:o)>=t)return a.lineInner(t,n,r,i);i=o+1,r=l+1}}decompose(t,n,r,i){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let o=this.children[s],l=a+o.length;if(t<=l&&n>=a){let c=i&((a<=t?1:0)|(l>=n?2:0));a>=t&&l<=n&&!c?r.push(o):o.decompose(t-a,n-a,r,c)}a=l+1}}replace(t,n,r){if([t,n]=Hd(this,t,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let a=this.children[i],o=s+a.length;if(t>=s&&n<=o){let l=a.replace(t-s,n-s,r),c=this.lines-a.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Ma(u,this.length-(n-t)+r.length)}return super.replace(s,o,l)}s=o+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=`
`){[t,n]=Hd(this,t,n);let i="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let o=this.children[s],l=a+o.length;a>t&&s&&(i+=r),t<l&&n>a&&(i+=o.sliceString(t-a,n-a,r)),a=l+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Ma))return 0;let r=0,[i,s,a,o]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==a||s==o)return r;let l=this.children[i],c=t.children[s];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let m of t)r+=m.lines;if(r<32){let m=[];for(let p of t)p.flatten(m);return new cr(m,n)}let i=Math.max(32,r>>5),s=i<<1,a=i>>1,o=[],l=0,c=-1,u=[];function d(m){let p;if(m.lines>s&&m instanceof Ma)for(let b of m.children)d(b);else m.lines>a&&(l>a||!l)?(f(),o.push(m)):m instanceof cr&&l&&(p=u[u.length-1])instanceof cr&&m.lines+p.lines<=32?(l+=m.lines,c+=m.length+1,u[u.length-1]=new cr(p.text.concat(m.text),p.length+1+m.length)):(l+m.lines>i&&f(),l+=m.lines,c+=m.length+1,u.push(m))}function f(){l!=0&&(o.push(u.length==1?u[0]:Ma.from(u,c)),c=-1,l=u.length=0)}for(let m of t)d(m);return f(),o.length==1?o[0]:new Ma(o,n)}}nn.empty=new cr([""],0);function Ace(e){let t=-1;for(let n of e)t+=n.length+1;return t}function jp(e,t,n=0,r=1e9){for(let i=0,s=0,a=!0;s<e.length&&i<=r;s++){let o=e[s],l=i+o.length;l>=n&&(l>r&&(o=o.slice(0,r-i)),i<n&&(o=o.slice(n-i)),a?(t[t.length-1]+=o,a=!1):t.push(o)),i=l+1}return t}function C8(e,t,n){return jp(e,[""],t,n)}class Nf{constructor(t,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof cr?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],a=s>>1,o=i instanceof cr?i.text.length:i.children.length;if(a==(n>0?o:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=`
`,this;t--}else if(i instanceof cr){let l=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,t))return this.value=t==0?l:n>0?l.slice(t):l.slice(0,l.length-t),this;t-=l.length}else{let l=i.children[a+(n<0?-1:0)];t>l.length?(t-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof cr?l.text.length:l.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class BD{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new Nf(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class zD{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(nn.prototype[Symbol.iterator]=function(){return this.iter()},Nf.prototype[Symbol.iterator]=BD.prototype[Symbol.iterator]=zD.prototype[Symbol.iterator]=function(){return this});class Mce{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Hd(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function oi(e,t,n=!0,r=!0){return Cce(e,t,n,r)}function Nce(e){return e>=56320&&e<57344}function Ice(e){return e>=55296&&e<56320}function ol(e,t){let n=e.charCodeAt(t);if(!Ice(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Nce(r)?(n-55296<<10)+(r-56320)+65536:n}function Dce(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Uu(e){return e<65536?1:2}const g2=/\r\n?|\n/;var is=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(is||(is={}));class $a{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;n<this.sections.length;n+=2)t+=this.sections[n];return t}get newLength(){let t=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];t+=r<0?this.sections[n]:r}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(t(r,i,s),i+=s):i+=a,r+=s}}iterChangedRanges(t,n=!1){y2(this,t,n)}get invertedDesc(){let t=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?t.push(r,i):t.push(i,r)}return new $a(t)}composeDesc(t){return this.empty?t:t.empty?this:PD(this,t)}mapDesc(t,n=!1){return t.empty?this:b2(this,t,n)}mapPos(t,n=-1,r=is.Simple){let i=0,s=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],l=this.sections[a++],c=i+o;if(l<0){if(c>t)return s+(t-i);s+=o}else{if(r!=is.Simple&&c>=t&&(r==is.TrackDel&&i<t&&c>t||r==is.TrackBefore&&i<t||r==is.TrackAfter&&c>t))return null;if(c>t||c==t&&n<0&&!o)return t==i||n<0?s:s+l;s+=l}i=c}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return s}touchesRange(t,n=t){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],a=this.sections[r++],o=i+s;if(a>=0&&i<=n&&o>=t)return i<t&&o>n?"cover":!0;i=o}return!1}toString(){let t="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];t+=(t?" ":"")+r+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new $a(t)}static create(t){return new $a(t)}}class Ir extends $a{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return y2(this,(n,r,i,s,a)=>t=t.replace(i,i+(r-n),a),!1),t}mapDesc(t,n=!1){return b2(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let a=n[i],o=n[i+1];if(o>=0){n[i]=o,n[i+1]=a;let l=i>>1;for(;r.length<l;)r.push(nn.empty);r.push(a?t.slice(s,s+a):nn.empty)}s+=a}return new Ir(n,r)}compose(t){return this.empty?t:t.empty?this:PD(this,t,!0)}map(t,n=!1){return t.empty?this:b2(this,t,n,!0)}iterChanges(t,n=!1){y2(this,t,n)}get desc(){return $a.create(this.sections)}filter(t){let n=[],r=[],i=[],s=new l0(this);e:for(let a=0,o=0;;){let l=a==t.length?1e9:t[a++];for(;o<l||o==l&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,l-o);ii(i,u,-1);let d=s.ins==-1?-1:s.off==0?s.ins:0;ii(n,u,d),d>0&&_l(r,n,s.text),s.forward(u),o+=u}let c=t[a++];for(;o<c;){if(s.done)break e;let u=Math.min(s.len,c-o);ii(n,u,-1),ii(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),o+=u}}return{changes:new Ir(n,r),filtered:$a.create(i)}}toJSON(){let t=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?t.push(r):i==0?t.push([r]):t.push([r].concat(this.inserted[n>>1].toJSON()))}return t}static of(t,n,r){let i=[],s=[],a=0,o=null;function l(u=!1){if(!u&&!i.length)return;a<n&&ii(i,n-a,-1);let d=new Ir(i,s);o=o?o.compose(d.map(o)):d,i=[],s=[],a=0}function c(u){if(Array.isArray(u))for(let d of u)c(d);else if(u instanceof Ir){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),o=o?o.compose(u.map(o)):u}else{let{from:d,to:f=d,insert:m}=u;if(d>f||d<0||f>n)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${n})`);let p=m?typeof m=="string"?nn.of(m.split(r||g2)):m:nn.empty,b=p.length;if(d==f&&b==0)return;d<a&&l(),d>a&&ii(i,d-a,-1),ii(i,f-d,b),_l(s,i,p),a=f}}return c(t),l(!o),o}static empty(t){return new Ir(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<t.length;i++){let s=t[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,o)=>o&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(nn.empty);r[i]=nn.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new Ir(n,r)}static createSet(t,n){return new Ir(t,n)}}function ii(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function _l(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(nn.empty);e.push(n)}}function y2(e,t,n){let r=e.inserted;for(let i=0,s=0,a=0;a<e.sections.length;){let o=e.sections[a++],l=e.sections[a++];if(l<0)i+=o,s+=o;else{let c=i,u=s,d=nn.empty;for(;c+=o,u+=l,l&&r&&(d=d.append(r[a-2>>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)o=e.sections[a++],l=e.sections[a++];t(i,c,s,u,d),i=c,s=u}}}function b2(e,t,n,r=!1){let i=[],s=r?[]:null,a=new l0(e),o=new l0(t);for(let l=-1;;){if(a.done&&o.len||o.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&o.ins==-1){let c=Math.min(a.len,o.len);ii(i,c,-1),a.forward(c),o.forward(c)}else if(o.ins>=0&&(a.ins<0||l==a.i||a.off==0&&(o.len<a.len||o.len==a.len&&!n))){let c=o.len;for(ii(i,o.ins,-1);c;){let u=Math.min(a.len,c);a.ins>=0&&l<a.i&&a.len<=u&&(ii(i,0,a.ins),s&&_l(s,i,a.text),l=a.i),a.forward(u),c-=u}o.next()}else if(a.ins>=0){let c=0,u=a.len;for(;u;)if(o.ins==-1){let d=Math.min(u,o.len);c+=d,u-=d,o.forward(d)}else if(o.ins==0&&o.len<u)u-=o.len,o.next();else break;ii(i,c,l<a.i?a.ins:0),s&&l<a.i&&_l(s,i,a.text),l=a.i,a.forward(a.len-u)}else{if(a.done&&o.done)return s?Ir.createSet(i,s):$a.create(i);throw new Error("Mismatched change set lengths")}}}function PD(e,t,n=!1){let r=[],i=n?[]:null,s=new l0(e),a=new l0(t);for(let o=!1;;){if(s.done&&a.done)return i?Ir.createSet(r,i):$a.create(r);if(s.ins==0)ii(r,s.len,0,o),s.next();else if(a.len==0&&!a.done)ii(r,0,a.ins,o),i&&_l(i,r,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,a.len),c=r.length;if(s.ins==-1){let u=a.ins==-1?-1:a.off?0:a.ins;ii(r,l,u,o),i&&u&&_l(i,r,a.text)}else a.ins==-1?(ii(r,s.off?0:s.len,l,o),i&&_l(i,r,s.textBit(l))):(ii(r,s.off?0:s.len,a.off?0:a.ins,o),i&&!a.off&&_l(i,r,a.text));o=(s.ins>l||a.ins>=0&&a.len>l)&&(o||r.length>c),s.forward2(l),a.forward(l)}}}}class l0{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length?nn.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?nn.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class Oc{constructor(t,n,r){this.from=t,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Oc(r,i,this.flags)}extend(t,n=t,r=0){if(t<=this.anchor&&n>=this.anchor)return Se.range(t,n,void 0,void 0,r);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return Se.range(this.anchor,i,void 0,void 0,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Se.range(t.anchor,t.head)}static create(t,n,r){return new Oc(t,n,r)}}class Se{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:Se.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(t.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Se([this.main],0)}addRange(t,n=!0){return Se.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,Se.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Se(t.ranges.map(n=>Oc.fromJSON(n)),t.main)}static single(t,n=t){return new Se([Se.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<t.length;i++){let s=t[i];if(s.empty?s.from<=r:s.from<r)return Se.normalized(t.slice(),n);r=s.to}return new Se(t,n)}static cursor(t,n=0,r,i){return Oc.create(t,t,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(t,n,r,i,s){let a=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&t!=n&&(s=n<t?1:-1),n<t?Oc.create(n,t,48|a):Oc.create(t,n,(s?s<0?8:16:0)|a)}static normalized(t,n=0){let r=t[n];t.sort((i,s)=>i.from-s.from),n=t.indexOf(r);for(let i=1;i<t.length;i++){let s=t[i],a=t[i-1];if(s.empty?s.from<=a.to:s.from<a.to){let o=a.from,l=Math.max(s.to,a.to);i<=n&&n--,t.splice(--i,2,s.anchor>s.head?Se.range(l,o):Se.range(o,l))}}return new Se(t,n)}}function $D(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let Nk=0;class ht{constructor(t,n,r,i,s){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Nk++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new ht(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:Ik),!!t.static,t.enables)}of(t){return new Lp([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Lp(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Lp(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function Ik(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class Lp{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=Nk++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,s=this.id,a=t[s]>>1,o=this.type==2,l=!1,c=!1,u=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?c=!0:((n=t[d.id])!==null&&n!==void 0?n:1)&1||u.push(t[d.id]);return{create(d){return d.values[a]=r(d),1},update(d,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||v2(d,u)){let m=r(d);if(o?!E8(m,d.values[a],i):!i(m,d.values[a]))return d.values[a]=m,1}return 0},reconfigure:(d,f)=>{let m,p=f.config.address[s];if(p!=null){let b=Jg(f,p);if(this.dependencies.every(x=>x instanceof ht?f.facet(x)===d.facet(x):x instanceof Ya?f.field(x,!1)==d.field(x,!1):!0)||(o?E8(m=r(d),b,i):i(m=r(d),b)))return d.values[a]=b,0}else m=r(d);return d.values[a]=m,1}}}}function E8(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function v2(e,t){let n=!1;for(let r of t)If(e,r)&1&&(n=!0);return n}function Rce(e,t,n){let r=n.map(l=>e[l.id]),i=n.map(l=>l.type),s=r.filter(l=>!(l&1)),a=e[t.id]>>1;function o(l){let c=[];for(let u=0;u<r.length;u++){let d=Jg(l,r[u]);if(i[u]==2)for(let f of d)c.push(f);else c.push(d)}return t.combine(c)}return{create(l){for(let c of r)If(l,c);return l.values[a]=o(l),1},update(l,c){if(!v2(l,s))return 0;let u=o(l);return t.compare(u,l.values[a])?0:(l.values[a]=u,1)},reconfigure(l,c){let u=v2(l,r),d=c.config.facets[t.id],f=c.facet(t);if(d&&!u&&Ik(n,d))return l.values[a]=f,0;let m=o(l);return t.compare(m,f)?(l.values[a]=f,0):(l.values[a]=m,1)}}}const qm=ht.define({static:!0});class Ya{constructor(t,n,r,i,s){this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(t){let n=new Ya(Nk++,t.create,t.update,t.compare||((r,i)=>r===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(qm).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],a=this.updateF(s,i);return this.compareF(s,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let s=r.facet(qm),a=i.facet(qm),o;return(o=s.find(l=>l.field==this))&&o!=a.find(l=>l.field==this)?(r.values[n]=o.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(t){return[this,qm.of({field:this,create:t})]}get extension(){return this}}const Mc={lowest:4,low:3,default:2,high:1,highest:0};function Ph(e){return t=>new UD(t,e)}const yu={highest:Ph(Mc.highest),high:Ph(Mc.high),default:Ph(Mc.default),low:Ph(Mc.low),lowest:Ph(Mc.lowest)};class UD{constructor(t,n){this.inner=t,this.prec=n}}class mh{of(t){return new x2(this,t)}reconfigure(t){return mh.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class x2{constructor(t,n){this.compartment=t,this.inner=n}}class Qg{constructor(t,n,r,i,s,a){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(t){let n=this.address[t.id];return n==null?t.default:this.staticValues[n>>1]}static resolve(t,n,r){let i=[],s=Object.create(null),a=new Map;for(let f of Oce(t,n,a))f instanceof Ya?i.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let o=Object.create(null),l=[],c=[];for(let f of i)o[f.id]=c.length<<1,c.push(m=>f.slot(m));let u=r==null?void 0:r.config.facets;for(let f in s){let m=s[f],p=m[0].facet,b=u&&u[f]||[];if(m.every(x=>x.type==0))if(o[p.id]=l.length<<1|1,Ik(b,m))l.push(r.facet(p));else{let x=p.combine(m.map(g=>g.value));l.push(r&&p.compare(x,r.facet(p))?r.facet(p):x)}else{for(let x of m)x.type==0?(o[x.id]=l.length<<1|1,l.push(x.value)):(o[x.id]=c.length<<1,c.push(g=>x.dynamicSlot(g)));o[p.id]=c.length<<1,c.push(x=>Rce(x,p,m))}}let d=c.map(f=>f(o));return new Qg(t,a,d,o,l,s)}}function Oce(e,t,n){let r=[[],[],[],[],[]],i=new Map;function s(a,o){let l=i.get(a);if(l!=null){if(l<=o)return;let c=r[l].indexOf(a);c>-1&&r[l].splice(c,1),a instanceof x2&&n.delete(a.compartment)}if(i.set(a,o),Array.isArray(a))for(let c of a)s(c,o);else if(a instanceof x2){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(a.compartment)||a.inner;n.set(a.compartment,c),s(c,o)}else if(a instanceof UD)s(a.inner,a.prec);else if(a instanceof Ya)r[o].push(a),a.provides&&s(a.provides,o);else if(a instanceof Lp)r[o].push(a),a.facet.extensions&&s(a.facet.extensions,Mc.default);else{let c=a.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,o)}}return s(e,Mc.default),r.reduce((a,o)=>a.concat(o))}function If(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Jg(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const HD=ht.define(),w2=ht.define({combine:e=>e.some(t=>t),static:!0}),qD=ht.define({combine:e=>e.length?e[0]:void 0,static:!0}),FD=ht.define(),VD=ht.define(),GD=ht.define(),WD=ht.define({combine:e=>e.length?e[0]:!1});class qo{constructor(t,n){this.type=t,this.value=n}static define(){return new jce}}class jce{of(t){return new qo(this,t)}}class Lce{constructor(t){this.map=t}of(t){return new _n(this,t)}}class _n{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new _n(this.type,n)}is(t){return this.type==t}static define(t={}){return new Lce(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let s=i.map(n);s&&r.push(s)}return r}}_n.reconfigure=_n.define();_n.appendConfig=_n.define();class Rr{constructor(t,n,r,i,s,a){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,r&&$D(r,n.newLength),s.some(o=>o.type==Rr.time)||(this.annotations=s.concat(Rr.time.of(Date.now())))}static create(t,n,r,i,s,a){return new Rr(t,n,r,i,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Rr.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Rr.time=qo.define();Rr.userEvent=qo.define();Rr.addToHistory=qo.define();Rr.remote=qo.define();function Bce(e,t){let n=[];for(let r=0,i=0;;){let s,a;if(r<e.length&&(i==t.length||t[i]>=e[r]))s=e[r++],a=e[r++];else if(i<t.length)s=t[i++],a=t[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function KD(e,t,n){var r;let i,s,a;return n?(i=t.changes,s=Ir.empty(t.changes.length),a=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),s=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(i)),{changes:a,selection:t.selection?t.selection.map(s):(r=e.selection)===null||r===void 0?void 0:r.map(i),effects:_n.mapEffects(e.effects,i).concat(_n.mapEffects(t.effects,s)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function k2(e,t,n){let r=t.selection,i=bd(t.annotations);return t.userEvent&&(i=i.concat(Rr.userEvent.of(t.userEvent))),{changes:t.changes instanceof Ir?t.changes:Ir.of(t.changes||[],n,e.facet(qD)),selection:r&&(r instanceof Se?r:Se.single(r.anchor,r.head)),effects:bd(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function YD(e,t,n){let r=k2(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let s=1;s<t.length;s++){t[s].filter===!1&&(n=!1);let a=!!t[s].sequential;r=KD(r,k2(e,t[s],a?r.changes.newLength:e.doc.length),a)}let i=Rr.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Pce(n?zce(i):i)}function zce(e){let t=e.startState,n=!0;for(let i of t.facet(FD)){let s=i(e);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:Bce(n,s))}if(n!==!0){let i,s;if(n===!1)s=e.changes.invertedDesc,i=Ir.empty(t.doc.length);else{let a=e.changes.filter(n);i=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}e=Rr.create(t,i,e.selection&&e.selection.map(s),_n.mapEffects(e.effects,s),e.annotations,e.scrollIntoView)}let r=t.facet(VD);for(let i=r.length-1;i>=0;i--){let s=r[i](e);s instanceof Rr?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Rr?e=s[0]:e=YD(t,bd(s),!1)}return e}function Pce(e){let t=e.startState,n=t.facet(GD),r=e;for(let i=n.length-1;i>=0;i--){let s=n[i](e);s&&Object.keys(s).length&&(r=KD(r,k2(t,s,e.changes.newLength),!0))}return r==e?e:Rr.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const $ce=[];function bd(e){return e==null?$ce:Array.isArray(e)?e:[e]}var _o=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(_o||(_o={}));const Uce=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let _2;try{_2=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Hce(e){if(_2)return _2.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Uce.test(n)))return!0}return!1}function qce(e){return t=>{if(!/\S/.test(t))return _o.Space;if(Hce(t))return _o.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return _o.Word;return _o.Other}}class mn{constructor(t,n,r,i,s,a){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)If(this,o<<1);this.computeSlot=null}field(t,n=!0){let r=this.config.address[t.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return If(this,r),Jg(this,r)}update(...t){return YD(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let o of t.effects)o.is(mh.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,c)=>i.set(c,l)),n=null),i.set(o.value.compartment,o.value.extension)):o.is(_n.reconfigure)?(n=null,r=o.value):o.is(_n.appendConfig)&&(n=null,r=bd(r).concat(o.value));let s;n?s=t.startState.values.slice():(n=Qg.resolve(r,i,this),s=new mn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let a=t.startState.facet(w2)?t.newSelection:t.newSelection.asSingle();new mn(n,t.newDoc,a,s,(o,l)=>l.update(o,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:Se.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),s=[r.range],a=bd(r.effects);for(let o=1;o<n.ranges.length;o++){let l=t(n.ranges[o]),c=this.changes(l.changes),u=c.map(i);for(let f=0;f<o;f++)s[f]=s[f].map(u);let d=i.mapDesc(c,!0);s.push(l.range.map(d)),i=i.compose(u),a=_n.mapEffects(a,u).concat(_n.mapEffects(bd(l.effects),d))}return{changes:i,selection:Se.create(s,n.mainIndex),effects:a}}changes(t=[]){return t instanceof Ir?t:Ir.of(t,this.doc.length,this.facet(mn.lineSeparator))}toText(t){return nn.of(t.split(this.facet(mn.lineSeparator)||g2))}sliceDoc(t=0,n=this.doc.length){return this.doc.sliceString(t,n,this.lineBreak)}facet(t){let n=this.config.address[t.id];return n==null?t.default:(If(this,n),Jg(this,n))}toJSON(t){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let r in t){let i=t[r];i instanceof Ya&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(t[r]),this))}return n}static fromJSON(t,n={},r){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(t,s)){let a=r[s],o=t[s];i.push(a.init(l=>a.spec.fromJSON(o,l)))}}return mn.create({doc:t.doc,selection:Se.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=Qg.resolve(t.extensions||[],new Map),r=t.doc instanceof nn?t.doc:nn.of((t.doc||"").split(n.staticFacet(mn.lineSeparator)||g2)),i=t.selection?t.selection instanceof Se?t.selection:Se.single(t.selection.anchor,t.selection.head):Se.single(0);return $D(i,r.length),n.staticFacet(w2)||(i=i.asSingle()),new mn(n,r,i,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(mn.tabSize)}get lineBreak(){return this.facet(mn.lineSeparator)||`
`}get readOnly(){return this.facet(WD)}phrase(t,...n){for(let r of this.facet(mn.phrases))if(Object.prototype.hasOwnProperty.call(r,t)){t=r[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),t}languageDataAt(t,n,r=-1){let i=[];for(let s of this.facet(HD))for(let a of s(this,n,r))Object.prototype.hasOwnProperty.call(a,t)&&i.push(a[t]);return i}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return qce(n.length?n[0]:"")}wordAt(t){let{text:n,from:r,length:i}=this.doc.lineAt(t),s=this.charCategorizer(t),a=t-r,o=t-r;for(;a>0;){let l=oi(n,a,!1);if(s(n.slice(l,a))!=_o.Word)break;a=l}for(;o<i;){let l=oi(n,o);if(s(n.slice(o,l))!=_o.Word)break;o=l}return a==o?null:Se.range(a+r,o+r)}}mn.allowMultipleSelections=w2;mn.tabSize=ht.define({combine:e=>e.length?e[0]:4});mn.lineSeparator=qD;mn.readOnly=WD;mn.phrases=ht.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(i=>e[i]==t[i])}});mn.languageData=HD;mn.changeFilter=FD;mn.transactionFilter=VD;mn.transactionExtender=GD;mh.reconfigure=_n.define();function dy(e,t,n={}){let r={};for(let i of e)for(let s of Object.keys(i)){let a=i[s],o=r[s];if(o===void 0)r[s]=a;else if(!(o===a||a===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](o,a);else throw new Error("Config merge conflict for field "+s)}for(let i in t)r[i]===void 0&&(r[i]=t[i]);return r}class Wl{eq(t){return this==t}range(t,n=t){return S2.create(t,n,this)}}Wl.prototype.startSide=Wl.prototype.endSide=0;Wl.prototype.point=!1;Wl.prototype.mapMode=is.TrackDel;function Dk(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}let S2=class XD{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new XD(t,n,r)}};function T2(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Rk{constructor(t,n,r,i){this.from=t,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,n,r,i=0){let s=r?this.to:this.from;for(let a=i,o=s.length;;){if(a==o)return a;let l=a+o>>1,c=s[l]-t||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==a)return c>=0?a:o;c>=0?o=l:a=l+1}}between(t,n,r,i){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,s);s<a;s++)if(i(this.from[s]+t,this.to[s]+t,this.value[s])===!1)return!1}map(t,n){let r=[],i=[],s=[],a=-1,o=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+t,d=this.to[l]+t,f,m;if(u==d){let p=n.mapPos(u,c.startSide,c.mapMode);if(p==null||(f=m=p,c.startSide!=c.endSide&&(m=n.mapPos(u,c.endSide),m<f)))continue}else if(f=n.mapPos(u,c.startSide),m=n.mapPos(d,c.endSide),f>m||f==m&&c.startSide>0&&c.endSide<=0)continue;(m-f||c.endSide-c.startSide)<0||(a<0&&(a=f),c.point&&(o=Math.max(o,m-f)),r.push(c),i.push(f-a),s.push(m-a))}return{mapped:r.length?new Rk(i,s,r,o):null,pos:a}}}class vn{constructor(t,n,r,i){this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(t,n,r,i){return new vn(t,n,r,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=t,a=t.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(T2)),this.isEmpty)return n.length?vn.of(n):this;let o=new QD(this,null,-1).goto(0),l=0,c=[],u=new eu;for(;o.value||l<n.length;)if(l<n.length&&(o.from-n[l].from||o.startSide-n[l].value.startSide)>=0){let d=n[l++];u.addInner(d.from,d.to,d.value)||c.push(d)}else o.rangeIndex==1&&o.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(o.chunkIndex)<n[l].from)&&(!a||i>this.chunkEnd(o.chunkIndex)||s<this.chunkPos[o.chunkIndex])&&u.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!a||i>o.to||s<o.from||a(o.from,o.to,o.value))&&(u.addInner(o.from,o.to,o.value)||c.push(S2.create(o.from,o.to,o.value))),o.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?vn.empty:this.nextLayer.update({add:c,filter:a,filterFrom:i,filterTo:s}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let a=0;a<this.chunk.length;a++){let o=this.chunkPos[a],l=this.chunk[a],c=t.touchesRange(o,o+l.length);if(c===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(t.mapPos(o));else if(c===!0){let{mapped:u,pos:d}=l.map(o,t);u&&(i=Math.max(i,u.maxPoint),n.push(u),r.push(d))}}let s=this.nextLayer.map(t);return n.length==0?s:new vn(r,n,s||vn.empty,i)}between(t,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],a=this.chunk[i];if(n>=s&&t<=s+a.length&&a.between(s,t-s,n-s,r)===!1)return}this.nextLayer.between(t,n,r)}}iter(t=0){return c0.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return c0.from(t).goto(n)}static compare(t,n,r,i,s=-1){let a=t.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=s),o=n.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=s),l=A8(a,o,r),c=new $h(a,l,s),u=new $h(o,l,s);r.iterGaps((d,f,m)=>M8(c,d,u,f,m,i)),r.empty&&r.length==0&&M8(c,0,u,0,0,i)}static eq(t,n,r=0,i){i==null&&(i=999999999);let s=t.filter(u=>!u.isEmpty&&n.indexOf(u)<0),a=n.filter(u=>!u.isEmpty&&t.indexOf(u)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let o=A8(s,a),l=new $h(s,o,0).goto(r),c=new $h(a,o,0).goto(r);for(;;){if(l.to!=c.to||!C2(l.active,c.active)||l.point&&(!c.point||!Dk(l.point,c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(t,n,r,i,s=-1){let a=new $h(t,null,s).goto(n),o=n,l=a.openStart;for(;;){let c=Math.min(a.to,r);if(a.point){let u=a.activeForPoint(a.to),d=a.pointFrom<n?u.length+1:a.point.startSide<0?u.length:Math.min(u.length,l);i.point(o,c,a.point,u,d,a.pointRank),l=Math.min(a.openEnd(c),u.length)}else c>o&&(i.span(o,c,a.active,l),l=a.openEnd(c));if(a.to>r)return l+(a.point&&a.to>r?1:0);o=a.to,a.next()}}static of(t,n=!1){let r=new eu;for(let i of t instanceof S2?[t]:n?Fce(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return vn.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=vn.empty;i=i.nextLayer)n=new vn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}vn.empty=new vn([],[],null,-1);function Fce(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(T2(t,r)>0)return e.slice().sort(T2);t=r}return e}vn.empty.nextLayer=vn.empty;class eu{finishChunk(t){this.chunks.push(new Rk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new eu)).add(t,n,r)}addInner(t,n,r){let i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}finish(){return this.finishInner(vn.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=vn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function A8(e,t,n){let r=new Map;for(let s of e)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&r.set(s.chunk[a],s.chunkPos[a]);let i=new Set;for(let s of t)for(let a=0;a<s.chunk.length;a++){let o=r.get(s.chunk[a]);o!=null&&(n?n.mapPos(o):o)==s.chunkPos[a]&&!(n!=null&&n.touchesRange(o,o+s.chunk[a].length))&&i.add(s.chunk[a])}return i}class QD{constructor(t,n,r,i=0){this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,n,!1),this}gotoInner(t,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<t||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,n){(this.to-t||this.endSide-n)<0&&this.gotoInner(t,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=t+n.from[this.rangeIndex];if(this.from=r,this.to=t+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class c0{constructor(t){this.heap=t}static from(t,n=null,r=-1){let i=[];for(let s=0;s<t.length;s++)for(let a=t[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new QD(a,n,r,s));return i.length==1?i[0]:new c0(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let r of this.heap)r.goto(t,n);for(let r=this.heap.length>>1;r>=0;r--)Pv(this.heap,r);return this.next(),this}forward(t,n){for(let r of this.heap)r.forward(t,n);for(let r=this.heap.length>>1;r>=0;r--)Pv(this.heap,r);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Pv(this.heap,0)}}}function Pv(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class $h{constructor(t,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=c0.from(t,n,r)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){Fm(this.active,t),Fm(this.activeTo,t),Fm(this.activeRank,t),this.minActive=N8(this.active,this.activeTo)}addActive(t){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Vm(this.active,n,r),Vm(this.activeTo,n,i),Vm(this.activeRank,n,s),t&&Vm(t,n,this.cursor.from),this.minActive=N8(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Fm(r,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<t;i--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(t){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}function M8(e,t,n,r,i,s){e.goto(t),n.goto(r);let a=r+i,o=r,l=r-t,c=!!s.boundChange;for(let u=!1;;){let d=e.to+l-n.to,f=d||e.endSide-n.endSide,m=f<0?e.to+l:n.to,p=Math.min(m,a);if(e.point||n.point?(e.point&&n.point&&Dk(e.point,n.point)&&C2(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(o,p,e.point,n.point),u=!1):(u&&s.boundChange(o),p>o&&!C2(e.active,n.active)&&s.compareRange(o,p,e.active,n.active),c&&p<a&&(d||e.openEnd(m)!=n.openEnd(m))&&(u=!0)),m>a)break;o=m,f<=0&&e.next(),f>=0&&n.next()}}function C2(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!Dk(e[n],t[n]))return!1;return!0}function Fm(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function Vm(e,t,n){for(let r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function N8(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function V0(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=oi(e,i));return r}function Vce(e,t,n,r){for(let i=0,s=0;;){if(s>=t)return i;if(i==e.length)break;s+=e.charCodeAt(i)==9?n-s%n:1,i=oi(e,i)}return e.length}const E2="ͼ",I8=typeof Symbol>"u"?"__"+E2:Symbol.for(E2),A2=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),D8=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Kl{constructor(t,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,o,l,c){let u=[],d=/^@(\w+)\b/.exec(a[0]),f=d&&d[1]=="keyframes";if(d&&o==null)return l.push(a[0]+";");for(let m in o){let p=o[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>a.map(x=>b.replace(/&/,x))).reduce((b,x)=>b.concat(x)),p,l);else if(p&&typeof p=="object"){if(!d)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(i(m),p,u,f)}else p!=null&&u.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+p+";")}(u.length||f)&&l.push((r&&!d&&!c?a.map(r):a).join(", ")+" {"+u.join(" ")+"}")}for(let a in t)s(i(a),t[a],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let t=D8[I8]||1;return D8[I8]=t+1,E2+t.toString(36)}static mount(t,n,r){let i=t[A2],s=r&&r.nonce;i?s&&i.setNonce(s):i=new Gce(t,s),i.mount(Array.isArray(n)?n:[n],t)}}let R8=new Map;class Gce{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let s=R8.get(r);if(s)return t[A2]=s;this.sheet=new i.CSSStyleSheet,R8.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[A2]=this}mount(t,n){let r=this.sheet,i=0,s=0;for(let a=0;a<t.length;a++){let o=t[a],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),r)for(let c=0;c<o.rules.length;c++)r.insertRule(o.rules[c],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let l=0;l<this.modules.length;l++)a+=this.modules[l].getRules()+`
`;this.styleTag.textContent=a;let o=n.head||n;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var Yl={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u0={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Wce=typeof navigator<"u"&&/Mac/.test(navigator.platform),Kce=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Xr=0;Xr<10;Xr++)Yl[48+Xr]=Yl[96+Xr]=String(Xr);for(var Xr=1;Xr<=24;Xr++)Yl[Xr+111]="F"+Xr;for(var Xr=65;Xr<=90;Xr++)Yl[Xr]=String.fromCharCode(Xr+32),u0[Xr]=String.fromCharCode(Xr);for(var $v in Yl)u0.hasOwnProperty($v)||(u0[$v]=Yl[$v]);function Yce(e){var t=Wce&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Kce&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?u0:Yl)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let wi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},M2=typeof document<"u"?document:{documentElement:{style:{}}};const N2=/Edge\/(\d+)/.exec(wi.userAgent),JD=/MSIE \d/.test(wi.userAgent),I2=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wi.userAgent),hy=!!(JD||I2||N2),O8=!hy&&/gecko\/(\d+)/i.test(wi.userAgent),Uv=!hy&&/Chrome\/(\d+)/.exec(wi.userAgent),j8="webkitFontSmoothing"in M2.documentElement.style,D2=!hy&&/Apple Computer/.test(wi.vendor),L8=D2&&(/Mobile\/\w+/.test(wi.userAgent)||wi.maxTouchPoints>2);var He={mac:L8||/Mac/.test(wi.platform),windows:/Win/.test(wi.platform),linux:/Linux|X11/.test(wi.platform),ie:hy,ie_version:JD?M2.documentMode||6:I2?+I2[1]:N2?+N2[1]:0,gecko:O8,gecko_version:O8?+(/Firefox\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,chrome:!!Uv,chrome_version:Uv?+Uv[1]:0,ios:L8,android:/Android\b/.test(wi.userAgent),webkit:j8,webkit_version:j8?+(/\bAppleWebKit\/(\d+)/.exec(wi.userAgent)||[0,0])[1]:0,safari:D2,safari_version:D2?+(/\bVersion\/(\d+(\.\d+)?)/.exec(wi.userAgent)||[0,0])[1]:0,tabSize:M2.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Ok(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const Zg=Object.create(null);function jk(e,t,n){if(e==t)return!0;e||(e=Zg),t||(t=Zg);let r=Object.keys(e),i=Object.keys(t);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function Xce(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]==null&&e.removeAttribute(r)}for(let n in t){let r=t[n];n=="style"?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function B8(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i=="style"?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i=="style"?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Qce(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class Fo{eq(t){return!1}updateDOM(t,n,r){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var Ei=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(Ei||(Ei={}));class an extends Wl{constructor(t,n,r,i){super(),this.startSide=t,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(t){return new G0(t)}static widget(t){let n=Math.max(-1e4,Math.min(1e4,t.side||0)),r=!!t.block;return n+=r&&!t.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new tu(t,n,n,r,t.widget||null,!1)}static replace(t){let n=!!t.block,r,i;if(t.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:a}=ZD(t,n);r=(s?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new tu(t,r,i,n,t.widget||null,!0)}static line(t){return new W0(t)}static set(t,n=!1){return vn.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}an.none=vn.empty;class G0 extends an{constructor(t){let{start:n,end:r}=ZD(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Ok(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||Zg}eq(t){return this==t||t instanceof G0&&this.tagName==t.tagName&&jk(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}G0.prototype.point=!1;class W0 extends an{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof W0&&this.spec.class==t.spec.class&&jk(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}W0.prototype.mapMode=is.TrackBefore;W0.prototype.point=!0;class tu extends an{constructor(t,n,r,i,s,a){super(n,r,s,t),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?is.TrackBefore:is.TrackAfter:is.TrackDel}get type(){return this.startSide!=this.endSide?Ei.WidgetRange:this.startSide<=0?Ei.WidgetBefore:Ei.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof tu&&Jce(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}tu.prototype.point=!0;function ZD(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n??t,end:r??t}}function Jce(e,t){return e==t||!!(e&&t&&e.compare(t))}function vd(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}class d0 extends Wl{constructor(t,n,r){super(),this.tagName=t,this.attributes=n,this.rank=r}eq(t){return t==this||t instanceof d0&&this.tagName==t.tagName&&jk(this.attributes,t.attributes)}static create(t){return new d0(t.tagName,t.attributes||Zg,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return vn.of(t,n)}}d0.prototype.startSide=d0.prototype.endSide=-1;function h0(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function R2(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function Df(e,t){if(!t.anchorNode)return!1;try{return R2(e,t.anchorNode)}catch{return!1}}function Rf(e){return e.nodeType==3?m0(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function Of(e,t,n,r){return n?z8(e,t,n,r,-1)||z8(e,t,n,r,1):!1}function Xl(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function e1(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function z8(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Bo(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=Xl(e)+(i<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=i<0?Bo(e):0}else return!1}}function Bo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function f0(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Zce(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function eR(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function eue(e,t,n,r,i,s,a,o){let l=e.ownerDocument,c=l.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let f,m=u==l.body,p=1,b=1;if(m)f=Zce(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:b}=eR(u,y)),f={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*b}}let x=0,g=0;if(i=="nearest")t.top<f.top+a?(g=t.top-(f.top+a),n>0&&t.bottom>f.bottom+g&&(g=t.bottom-f.bottom+a)):t.bottom>f.bottom-a&&(g=t.bottom-f.bottom+a,n<0&&t.top-g<f.top&&(g=t.top-(f.top+a)));else{let y=t.bottom-t.top,w=f.bottom-f.top;g=(i=="center"&&y<=w?t.top+y/2-w/2:i=="start"||i=="center"&&n<0?t.top-a:t.bottom-w+a)-f.top}if(r=="nearest"?t.left<f.left+s?(x=t.left-(f.left+s),n>0&&t.right>f.right+x&&(x=t.right-f.right+s)):t.right>f.right-s&&(x=t.right-f.right+s,n<0&&t.left<f.left+x&&(x=t.left-(f.left+s))):x=(r=="center"?t.left+(t.right-t.left)/2-(f.right-f.left)/2:r=="start"==o?t.left-s:t.right-(f.right-f.left)+s)-f.left,x||g)if(m)c.scrollBy(x,g);else{let y=0,w=0;if(g){let C=u.scrollTop;u.scrollTop+=g/b,w=(u.scrollTop-C)*b}if(x){let C=u.scrollLeft;u.scrollLeft+=x/p,y=(u.scrollLeft-C)*p}t={left:t.left-y,top:t.top-w,right:t.right-y,bottom:t.bottom-w},y&&Math.abs(y-x)<1&&(r="nearest"),w&&Math.abs(w-g)<1&&(i="nearest")}if(m)break;(t.top<f.top||t.bottom>f.bottom||t.left<f.left||t.right>f.right)&&(t={left:Math.max(t.left,f.left),right:Math.min(t.right,f.right),top:Math.max(t.top,f.top),bottom:Math.min(t.bottom,f.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function tR(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),t&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class tue{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:r}=t;this.set(n,Math.min(t.anchorOffset,n?Bo(n):0),r,Math.min(t.focusOffset,r?Bo(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let kc=null;He.safari&&He.safari_version>=26&&(kc=!1);function nR(e){if(e.setActive)return e.setActive();if(kc)return e.focus(kc);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(kc==null?{get preventScroll(){return kc={preventScroll:!0},!0}}:void 0),!kc){kc=!1;for(let n=0;n<t.length;){let r=t[n++],i=t[n++],s=t[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let P8;function m0(e,t,n=t){let r=P8||(P8=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function xd(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,e.dispatchEvent(s);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,e.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function nue(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function rue(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Bo(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Bo(n))}else{if(n==e)return!0;r=Xl(n),n=n.parentNode}}function rR(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function iR(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Bo(n)}else if(n.parentNode&&!e1(n))r=Xl(n),n=n.parentNode;else return null}}function sR(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!e1(n))r=Xl(n)+1,n=n.parentNode;else return null}}class ra{constructor(t,n,r=!0){this.node=t,this.offset=n,this.precise=r}static before(t,n){return new ra(t.parentNode,Xl(t),n)}static after(t,n){return new ra(t.parentNode,Xl(t)+1,n)}}var $n=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}($n||($n={}));const nu=$n.LTR,Lk=$n.RTL;function aR(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const iue=aR("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),sue=aR("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),O2=Object.create(null),va=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);O2[t]=n,O2[n]=-t}function oR(e){return e<=247?iue[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?sue[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const aue=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ja{get dir(){return this.level%2?Lk:nu}constructor(t,n,r){this.from=t,this.to=n,this.level=r}side(t,n){return this.dir==n==t?this.to:this.from}forward(t,n){return t==(this.dir==n)}static find(t,n,r,i){let s=-1;for(let a=0;a<t.length;a++){let o=t[a];if(o.from<=n&&o.to>=n){if(o.level==r)return a;(s<0||(i!=0?i<0?o.from<n:o.to>n:t[s].level>o.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function lR(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!lR(r.inner,i.inner))return!1}return!0}const An=[];function oue(e,t,n,r,i){for(let s=0;s<=r.length;s++){let a=s?r[s-1].to:t,o=s<r.length?r[s].from:n,l=s?256:i;for(let c=a,u=l,d=l;c<o;c++){let f=oR(e.charCodeAt(c));f==512?f=u:f==8&&d==4&&(f=16),An[c]=f==4?2:f,f&7&&(d=f),u=f}for(let c=a,u=l,d=l;c<o;c++){let f=An[c];if(f==128)c<o-1&&u==An[c+1]&&u&24?f=An[c]=u:An[c]=256;else if(f==64){let m=c+1;for(;m<o&&An[m]==64;)m++;let p=c&&u==8||m<n&&An[m]==8?d==1?1:8:256;for(let b=c;b<m;b++)An[b]=p;c=m-1}else f==8&&d==1&&(An[c]=1);u=f,f&7&&(d=f)}}}function lue(e,t,n,r,i){let s=i==1?2:1;for(let a=0,o=0,l=0;a<=r.length;a++){let c=a?r[a-1].to:t,u=a<r.length?r[a].from:n;for(let d=c,f,m,p;d<u;d++)if(m=O2[f=e.charCodeAt(d)])if(m<0){for(let b=o-3;b>=0;b-=3)if(va[b+1]==-m){let x=va[b+2],g=x&2?i:x&4?x&1?s:i:0;g&&(An[d]=An[va[b]]=g),o=b;break}}else{if(va.length==189)break;va[o++]=d,va[o++]=f,va[o++]=l}else if((p=An[d])==2||p==1){let b=p==i;l=b?0:1;for(let x=o-3;x>=0;x-=3){let g=va[x+2];if(g&2)break;if(b)va[x+2]|=2;else{if(g&4)break;va[x+2]|=4}}}}}function cue(e,t,n,r){for(let i=0,s=r;i<=n.length;i++){let a=i?n[i-1].to:e,o=i<n.length?n[i].from:t;for(let l=a;l<o;){let c=An[l];if(c==256){let u=l+1;for(;;)if(u==o){if(i==n.length)break;u=n[i++].to,o=i<n.length?n[i].from:t}else if(An[u]==256)u++;else break;let d=s==1,f=(u<t?An[u]:r)==1,m=d==f?d?1:2:r;for(let p=u,b=i,x=b?n[b-1].to:e;p>l;)p==x&&(p=n[--b].from,x=b?n[b-1].to:e),An[--p]=m;l=u}else s=c,l++}}}function j2(e,t,n,r,i,s,a){let o=r%2?2:1;if(r%2==i%2)for(let l=t,c=0;l<n;){let u=!0,d=!1;if(c==s.length||l<s[c].from){let b=An[l];b!=o&&(u=!1,d=b==16)}let f=!u&&o==1?[]:null,m=u?r:r+1,p=l;e:for(;;)if(c<s.length&&p==s[c].from){if(d)break e;let b=s[c];if(!u)for(let x=b.to,g=c+1;;){if(x==n)break e;if(g<s.length&&s[g].from==x)x=s[g++].to;else{if(An[x]==o)break e;break}}if(c++,f)f.push(b);else{b.from>l&&a.push(new ja(l,b.from,m));let x=b.direction==nu!=!(m%2);L2(e,x?r+1:r,i,b.inner,b.from,b.to,a),l=b.to}p=b.to}else{if(p==n||(u?An[p]!=o:An[p]==o))break;p++}f?j2(e,l,p,r+1,i,f,a):l<p&&a.push(new ja(l,p,m)),l=p}else for(let l=n,c=s.length;l>t;){let u=!0,d=!1;if(!c||l>s[c-1].to){let b=An[l-1];b!=o&&(u=!1,d=b==16)}let f=!u&&o==1?[]:null,m=u?r:r+1,p=l;e:for(;;)if(c&&p==s[c-1].to){if(d)break e;let b=s[--c];if(!u)for(let x=b.from,g=c;;){if(x==t)break e;if(g&&s[g-1].to==x)x=s[--g].from;else{if(An[x-1]==o)break e;break}}if(f)f.push(b);else{b.to<l&&a.push(new ja(b.to,l,m));let x=b.direction==nu!=!(m%2);L2(e,x?r+1:r,i,b.inner,b.from,b.to,a),l=b.from}p=b.from}else{if(p==t||(u?An[p-1]!=o:An[p-1]==o))break;p--}f?j2(e,p,l,r+1,i,f,a):p<l&&a.push(new ja(p,l,m)),l=p}}function L2(e,t,n,r,i,s,a){let o=t%2?2:1;oue(e,i,s,r,o),lue(e,i,s,r,o),cue(i,s,r,o),j2(e,i,s,t,n,r,a)}function uue(e,t,n){if(!e)return[new ja(0,0,t==Lk?1:0)];if(t==nu&&!n.length&&!aue.test(e))return cR(e.length);if(n.length)for(;e.length>An.length;)An[An.length]=256;let r=[],i=t==nu?0:1;return L2(e,i,i,n,0,e.length,r),r}function cR(e){return[new ja(0,e,0)]}let uR="";function due(e,t,n,r,i){var s;let a=r.head-e.from,o=ja.find(t,a,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=t[o],c=l.side(i,n);if(a==c){let f=o+=i?1:-1;if(f<0||f>=t.length)return null;l=t[o=f],a=l.side(!i,n),c=l.side(i,n)}let u=oi(e.text,a,l.forward(i,n));(u<l.from||u>l.to)&&(u=c),uR=e.text.slice(Math.min(a,u),Math.max(a,u));let d=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return d&&u==c&&d.level+(i?0:1)<l.level?Se.cursor(d.side(!i,n)+e.from,d.forward(i,n)?1:-1,d.level):Se.cursor(u+e.from,l.forward(i,n)?-1:1,l.level)}function hue(e,t,n){for(let r=t;r<n;r++){let i=oR(e.charCodeAt(r));if(i==1)return nu;if(i==2||i==4)return Lk}return nu}const dR=ht.define(),hR=ht.define(),fR=ht.define(),mR=ht.define(),B2=ht.define(),pR=ht.define(),gR=ht.define(),Bk=ht.define(),zk=ht.define(),yR=ht.define({combine:e=>e.some(t=>t)}),bR=ht.define({combine:e=>e.some(t=>t)}),vR=ht.define();class wd{constructor(t,n,r,i,s,a=!1){this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=a}map(t){return t.empty?this:new wd(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new wd(Se.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Gm=_n.define({map:(e,t)=>e.map(t)}),xR=_n.define();function as(e,t,n){let r=e.facet(mR);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const po=ht.define({combine:e=>e.length?e[0]:!0});let fue=0;const id=ht.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}});class gs{constructor(t,n,r,i,s){this.id=t,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(id.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(id.of({plugin:this,arg:t}))}static define(t,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:a}=n||{};return new gs(fue++,t,r,i,o=>{let l=[];return a&&l.push(fy.of(c=>{let u=c.plugin(o);return u?a(u):an.none})),s&&l.push(s(o)),l})}static fromClass(t,n){return gs.define((r,i)=>new t(r,i),n)}}class Hv{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(as(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){as(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){as(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const wR=ht.define(),Pk=ht.define(),fy=ht.define(),kR=ht.define(),$k=ht.define(),K0=ht.define(),_R=ht.define();function $8(e,t){let n=e.state.facet(_R);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(e):s),i=[];return vn.spans(r,t.from,t.to,{point(){},span(s,a,o,l){let c=s-t.from,u=a-t.from,d=i;for(let f=o.length-1;f>=0;f--,l--){let m=o[f].spec.bidiIsolate,p;if(m==null&&(m=hue(t.text,c,u)),l>0&&d.length&&(p=d[d.length-1]).to==c&&p.direction==m)p.to=u,d=p.inner;else{let b={from:c,to:u,direction:m,inner:[]};d.push(b),d=b.inner}}}}),i}const SR=ht.define();function Uk(e){let t=0,n=0,r=0,i=0;for(let s of e.state.facet(SR)){let a=s(e);a&&(a.left!=null&&(t=Math.max(t,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:t,right:n,top:r,bottom:i}}const tf=ht.define();class Bs{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new Bs(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,r=this;for(;n>0;n--){let i=t[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),t.splice(n-1,1)}}return t.splice(n,0,r),t}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,s=0,a=0;;){let o=i<t.length?t[i].fromB:1e9,l=s<n.length?n[s]:1e9,c=Math.min(o,l);if(c==1e9)break;let u=c+a,d=c,f=u;for(;;)if(s<n.length&&n[s]<=d){let m=n[s+1];s+=2,d=Math.max(d,m);for(let p=i;p<t.length&&t[p].fromB<=d;p++)a=t[p].toA-t[p].toB;f=Math.max(f,m+a)}else if(i<t.length&&t[i].fromB<=d){let m=t[i++];d=Math.max(d,m.toB),f=Math.max(f,m.toA),a=m.toA-m.toB}else break;r.push(new Bs(u,f,c,d))}return r}}class t1{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Ir.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,a,o,l)=>i.push(new Bs(s,a,o,l))),this.changedRanges=i}static create(t,n,r){return new t1(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const mue=[];class ar{constructor(t,n,r=0){this.dom=t,this.length=n,this.flags=r,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return mue}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&Xce(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let r=n;for(let i of this.children){if(i==t)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n){return null}domPosFor(t,n){let r=Xl(this.dom),i=this.length?t>0:n>0;return new ra(this.parent.dom,r+(i?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof py)return t;return null}static get(t){return t.cmTile}}class my extends ar{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,r=null,i,s=(t==null?void 0:t.node)==n?t:null,a=0;for(let o of this.children){if(o.sync(t),a+=o.length+o.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=o.dom&&(s.written=!0),o.dom.parentNode==n)for(;i&&i!=o.dom;)i=U8(i);else n.insertBefore(o.dom,i);r=o.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=U8(i);this.length=a}}function U8(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class py extends my{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=ar.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let a=r.children[i++];if(a instanceof Mo)n.push(i),r=a,i=0;else{let o=s+a.length,l=t(a,s);if(l!==void 0)return l;s=o+a.breakAfter}}}resolveBlock(t,n){let r,i=-1,s,a=-1;if(this.blockTiles((o,l)=>{let c=l+o.length;if(t>=l&&t<=c){if(o.isWidget()&&n>=-1&&n<=1){if(o.flags&32)return!0;o.flags&16&&(r=void 0)}(l<t||t==c&&(n<-1?o.length:o.covers(1)))&&(!r||!o.isWidget()&&r.isWidget())&&(r=o,i=t-l),(c>t||t==l&&(n>1?o.length:o.covers(-1)))&&(!s||!o.isWidget()&&s.isWidget())&&(s=o,a=t-l)}}),!r&&!s)throw new Error("No tile at position "+t);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:a}}}class Mo extends my{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new Mo(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class qd extends my{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,r){let i=new qd(n||document.createElement("div"),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(t,n,r){let i=null,s=-1,a=null,o=-1;function l(u,d){for(let f=0,m=0;f<u.children.length&&m<=d;f++){let p=u.children[f],b=m+p.length;b>=d&&(p.isComposite()?l(p,d-m):(!a||a.isHidden&&(n>0||r&&gue(a,p)))&&(b>d||p.flags&32)?(a=p,o=d-m):(m<d||p.flags&16&&!p.isHidden)&&(i=p,s=d-m)),m=b}}l(this,t);let c=(n<0?i:a)||i||a;return c?{tile:c,offset:c==i?s:o}:null}coordsIn(t,n){let r=this.resolveInline(t,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):pue(this)}domIn(t,n){let r=this.resolveInline(t,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new ra(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let a=r.tile.parent,o=!1;for(let l of a.children){if(o)return new ra(l.dom,0);l==r.tile&&(o=!0)}}return new ra(this.dom,0)}}function pue(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Rf(t);return n[n.length-1]||null}function gue(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Pi extends my{constructor(t,n){super(t),this.mark=n}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new Pi(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class jc extends ar{constructor(t,n){super(t,n.length),this.text=n}sync(t){this.flags&2||(super.sync(t),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(t,n){let r=this.dom.nodeValue.length;t>r&&(t=r);let i=t,s=t,a=0;t==0&&n<0||t==r&&n>=0?He.chrome||He.gecko||(t?(i--,a=1):s<r&&(s++,a=-1)):n<0?i--:s<r&&s++;let o=m0(this.dom,i,s).getClientRects();if(!o.length)return null;let l=o[(a?a<0:n>=0)?0:o.length-1];return He.safari&&!a&&l.width==0&&(l=Array.prototype.find.call(o,c=>c.width)||l),a?f0(l,a<0):l||null}static of(t,n){let r=new jc(n||document.createTextNode(t),t);return n||(r.flags|=2),r}}class ru extends ar{constructor(t,n,r,i){super(t,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,r){let i=this.widget.coordsAt(this.dom,t,n);if(i)return i;if(r)return f0(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let o=this.flags&16?!0:this.flags&32?!1:t>0;for(let l=o?s.length-1:0;a=s[l],!(t>0?l==0:l==s.length-1||a.top<a.bottom);l+=o?-1:1);return f0(a,!o)}}get overrideDOMText(){if(!this.length)return nn.empty;let{root:t}=this;if(!t)return nn.empty;let n=this.posAtStart;return t.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,s){return s||(s=t.toDOM(n),t.editable||(s.contentEditable="false")),new ru(s,r,t,i)}}class n1 extends ar{constructor(t){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,t)}get isHidden(){return!0}get overrideDOMText(){return nn.empty}coordsIn(t){return this.dom.getBoundingClientRect()}}class yue{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,r){let{tile:i,index:s,beforeBreak:a,parents:o}=this;for(;t||n>0;)if(i.isComposite())if(a){if(!t)break;r&&r.break(),t--,a=!1}else if(s==i.children.length){if(!t&&!o.length)break;r&&r.leave(i),a=!!i.breakAfter,{tile:i,index:s}=o.pop(),s++}else{let l=i.children[s],c=l.breakAfter;(n>0?l.length<=t:l.length<t)&&(!r||r.skip(l,0,l.length)!==!1||!l.isComposite)?(a=!!c,s++,t-=l.length):(o.push({tile:i,index:s}),i=l,s=0,r&&l.isComposite()&&r.enter(l))}else if(s==i.length)a=!!i.breakAfter,{tile:i,index:s}=o.pop(),s++;else if(t){let l=Math.min(t,i.length-s);r&&r.skip(i,s,s+l),t-=l,s+=l}else break;return this.tile=i,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class bue{constructor(t,n,r,i){this.from=t,this.to=n,this.wrapper=r,this.rank=i}}class vue{constructor(t,n,r){this.cache=t,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(t,n,r,i){var s;this.flushBuffer();let a=this.ensureMarks(n,r),o=a.lastChild;if(o&&o.isText()&&!(o.flags&8)&&o.length+t.length<512){this.cache.reused.set(o,2);let l=a.children[a.children.length-1]=new jc(o.dom,o.text+t);l.parent=a}else a.append(i||jc.of(t,(s=this.cache.find(jc))===null||s===void 0?void 0:s.dom));this.pos+=t.length,this.afterWidget=null}addComposition(t,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?qv(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let o=n.marks.length-1;o>=0;o--){let l=n.marks[o],c=i.lastChild;if(c instanceof Pi&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(qv(l.dom)),i=c;else{if(this.cache.reused.get(l)){let d=ar.get(l.dom);d&&d.setDOM(qv(l.dom))}let u=Pi.of(l.mark,l.dom);i.append(u),i=u}this.cache.reused.set(l,2)}let s=ar.get(t.text);s&&this.cache.reused.set(s,2);let a=new jc(t.text,t.text.nodeValue);a.flags|=8,this.pos=t.range.toB,i.append(a)}addInlineWidget(t,n,r){let i=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var r;t||(t=TR);let i=qd.start(t,n||((r=this.cache.find(qd))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var r;let i=this.curLine;for(let s=t.length-1;s>=0;s--){let a=t[s],o;if(n>0&&(o=i.lastChild)&&o instanceof Pi&&o.mark.eq(a))i=o,n--;else{let l=Pi.of(a,(r=this.cache.find(Pi,c=>c.mark.eq(a)))===null||r===void 0?void 0:r.dom);i.append(l),i=l,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!H8(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(He.ios&&H8(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Fv,0,32)||new ru(Fv.toDOM(),0,Fv,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to<this.pos&&this.wrappers.splice(t,1);for(let t=this.blockWrappers;t.value&&t.from<=this.pos;t.next())if(t.to>=this.pos){let n=t.rank*102+t.value.rank,r=new bue(t.from,t.to,t.value,n),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-r.rank||this.wrappers[i-1].to-r.to)<0;)i--;this.wrappers.splice(i,0,r)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Mo&&i.wrapper.eq(r.wrapper))n=i;else{let s=Mo.of(r.wrapper,(t=this.cache.find(Mo,a=>a.wrapper.eq(r.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),r=this.cache.find(n1,void 0,1);return r&&(r.flags=n),r||new n1(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class xue{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=i;let o=this.textOff=Math.min(t,i.length);return s?null:i.slice(0,o)}let n=Math.min(this.text.length,this.textOff+t),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const r1=[ru,qd,jc,Pi,n1,Mo,py];for(let e=0;e<r1.length;e++)r1[e].bucket=e;class wue{constructor(t){this.view=t,this.buckets=r1.map(()=>[]),this.index=r1.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,r=this.buckets[n];r.length<6?r.push(t):r[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,r=2){let i=t.bucket,s=this.buckets[i],a=this.index[i];for(let o=s.length-1;o>=0;o--){let l=(o+a)%s.length,c=s[l];if((!n||n(c))&&!this.reused.has(c))return s.splice(l,1),l<a&&this.index[i]--,this.reused.set(c,r),c}return null}findWidget(t,n,r){let i=this.buckets[0];if(i.length)for(let s=0,a=0;;s++){if(s==i.length){if(a)return null;a=1,s=0}let o=i[s];if(!this.reused.has(o)&&(a==0?o.widget.compare(t):o.widget.constructor==t.constructor&&t.updateDOM(o.dom,this.view,o.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,o.widget==t&&o.length==n&&(o.flags&497)==r?(this.reused.set(o,1),o):(this.reused.set(o,2),new ru(o.dom,n,t,o.flags&-498|r))}}reuse(t){return this.reused.set(t,1),t}maybeReuse(t,n=2){if(!this.reused.has(t))return this.reused.set(t,n),t.dom}clear(){for(let t=0;t<this.buckets.length;t++)this.buckets[t].length=this.index[t]=0}}class kue{constructor(t,n,r,i,s){this.view=t,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new wue(t),this.text=new xue(t.state.doc),this.builder=new vue(this.cache,new py(t,t.contentDOM),vn.iter(r)),this.cache.reused.set(n,2),this.old=new yue(n),this.reuseWalker={skip:(a,o,l)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(t,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,a=0;;){let o=a<t.length?t[a++]:null,l=o?o.fromA:this.old.root.length;if(l>i){let c=l-i;this.preserve(c,!a,!o),i=l,s+=c}if(!o)break;n&&o.fromA<=n.range.fromA&&o.toA>=n.range.toA?(this.forward(o.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,o.toA),this.emit(n.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(s,o.toB)),s=o.toB,i=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(t,n,r){let i=Tue(this.old),s=this.openMarks;this.old.advance(t,r?1:-1,{skip:(a,o,l)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(l-o);else{let c=l>0||o<a.length?ru.of(a.widget,this.view,l-o,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,i,s),s=i.length)}else if(a.isText())this.builder.ensureLine(null),!o&&l==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,i,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(o,l),i,s)),s=i.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof n1)this.cache.add(a);else if(a instanceof Pi)this.builder.ensureLine(null),this.builder.addMark(a,i,s),this.cache.reused.set(a,1),s=i.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof Pi&&i.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?i.length&&(i.length=s=0):a instanceof Pi&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let r=null,i=this.builder,s=0,a=vn.spans(this.decorations,t,n,{point:(o,l,c,u,d,f)=>{if(c instanceof tu){if(this.disallowBlockEffectsFor[f]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,d>u.length)i.continueWidget(l-o);else{let m=c.widget||(c.block?Fd.block:Fd.inline),p=_ue(c),b=this.cache.findWidget(m,l-o,p)||ru.of(m,this.view,l-o,p);c.block?(c.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(b)):(i.ensureLine(r),i.addInlineWidget(b,u,d))}r=null}else r=Sue(r,c);l>o&&this.text.skip(l-o)},span:(o,l,c,u)=>{for(let d=o;d<l;){let f=this.text.next(Math.min(512,l-d));f==null?(i.addLineStartIfNotCovered(r),i.addBreak(),d++):(i.ensureLine(r),i.addText(f,c,d==o?u:c.length),d+=f.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=a>s,this.openMarks=a}forward(t,n,r=1){n-t<=10?this.old.advance(n-t,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(t){let n=[],r=null;for(let i=t.parentNode;;i=i.parentNode){let s=ar.get(i);if(i==this.view.contentDOM)break;s instanceof Pi?n.push(s):s!=null&&s.isLine()?r=s:s instanceof Mo||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new qd(i,TR):r||n.push(Pi.of(new G0({tagName:i.nodeName.toLowerCase(),attributes:Qce(i)}),i)))}return{line:r,marks:n}}}function H8(e,t){let n=r=>{for(let i of r.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}function _ue(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const TR={class:"cm-line"};function Sue(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||(e={class:"cm-line"}),n&&Ok(n,e),r&&(e.class+=" "+r)),e}function Tue(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Pi&&t.push(r.mark)}return t}function qv(e){let t=ar.get(e);return t&&t.setDOM(e.cloneNode()),e}class Fd extends Fo{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Fd.inline=new Fd("span");Fd.block=new Fd("div");const Fv=new class extends Fo{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class q8{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=an.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new py(t,t.contentDOM),this.updateInner([new Bs(0,0,0,t.state.doc.length)],null)}update(t){var n;let r=t.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:d})=>d<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!Oue(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let s=i>-1?Eue(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:d}=this.hasComposition;r=new Bs(u,d,t.changes.mapPos(u,-1),t.changes.mapPos(d,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(He.ie||He.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,o=this.blockWrappers;this.updateDeco();let l=Nue(a,this.decorations,t.changes);l.length&&(r=Bs.extendWithRanges(r,l));let c=Due(o,this.blockWrappers,t.changes);return c.length&&(r=Bs.extendWithRanges(r,c)),s&&!r.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||t.length){let a=this.tile,o=new kue(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ar.get(n.text)&&o.cache.reused.set(ar.get(n.text),2),this.tile=o.run(t,n),z2(a,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=He.chrome||He.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Vv&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let n of t.transactions)for(let r of n.effects)r.is(xR)&&(this.editContextFormatting=r.value)}updateSelection(t=!1,n=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,a=!s&&!(this.view.state.facet(po)||r.tabIndex>-1)&&Df(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||a))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),He.gecko&&l.empty&&!this.hasComposition&&Cue(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=u=new ra(f,0),o=!0}let d=this.view.observer.selectionRange;(o||!d.focusNode||(!Of(c.node,c.offset,d.anchorNode,d.anchorOffset)||!Of(u.node,u.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{He.android&&He.chrome&&r.contains(d.focusNode)&&Rue(d.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let f=h0(this.view.root);if(f)if(l.empty){if(He.gecko){let m=Aue(c.node,c.offset);if(m&&m!=3){let p=(m==1?iR:sR)(c.node,c.offset);p&&(c=new ra(p.node,p.offset))}}f.collapse(c.node,c.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(c.node,c.offset);try{f.extend(u.node,u.offset)}catch{}}else{let m=document.createRange();l.anchor>l.head&&([c,u]=[u,c]),m.setEnd(u.node,u.offset),m.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(m)}a&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new ra(d.anchorNode,d.anchorOffset),this.impreciseHead=u.precise?null:new ra(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&Of(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,r=h0(t.root),{anchorNode:i,anchorOffset:s}=t.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let o=a.posAtStart;if(n.head==o||n.head==o+a.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let d=t.observer.selectionRange;t.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(t,n){let r=this.tile.nearest(t);if(!r)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(t==r.dom)s=r.dom.childNodes[n];else{let a=Bo(t)==0?0:n==0?-1:1;for(;;){let o=t.parentNode;if(o==r.dom)break;a==0&&o.firstChild!=o.lastChild&&(t==o.firstChild?a=-1:a=1),t=o}a<0?s=t:s=t.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!ar.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let a=0,o=i;;a++){let l=r.children[a];if(l.dom==s)return o;o+=l.length+l.breakAfter}}else return r.isText()?t==r.dom?i+n:i+(n?r.length:0):i}domAtPos(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.domPosFor(t,n):r.domIn(i,n)}inlineDOMNearPos(t,n){let r,i=-1,s=!1,a,o=-1,l=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=t)return!0;c.flags&16&&(s=!0)}else{let d=u+c.length;if(u<=t&&(r=c,i=t-u,s=d<t),d>=t&&!a&&(a=c,o=t-u,l=u>t),u>t&&a)return!0}}),!r&&!a?this.domAtPos(t,n):(s&&a?r=null:l&&r&&(a=null),r&&n<0||!a?r.domIn(i,n):a.domIn(o,n))}coordsAt(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof Vv?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(t,n){let{tile:r}=this.tile.resolveBlock(t,n);return r.isLine()?r:null}coordsForChar(t){let{tile:n,offset:r}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function i(s,a){if(s.isComposite())for(let o of s.children){if(o.length>=a){let l=i(o,a);if(l)return l}if(a-=o.length,a<0)break}else if(s.isText()&&a<s.length){let o=oi(s.text,a);if(o==a)return null;let l=m0(s.dom,a,o).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return i(n,r)}measureVisibleLineHeights(t){let n=[],{from:r,to:i}=t,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,l=this.view.textDirection==$n.LTR,c=0,u=(d,f,m)=>{for(let p=0;p<d.children.length&&!(f>i);p++){let b=d.children[p],x=f+b.length,g=b.dom.getBoundingClientRect(),{height:y}=g;if(m&&!p&&(c+=g.top-m.top),b instanceof Mo)x>r&&u(b,f,g);else if(f>=r&&(c>0&&n.push(-c),n.push(y+c),c=0,a)){let w=b.dom.lastChild,C=w?Rf(w):[];if(C.length){let E=C[C.length-1],S=l?E.right-g.left:g.right-E.left;S>o&&(o=S,this.minWidth=s,this.minWidthFrom=f,this.minWidthTo=x)}}m&&p==d.children.length-1&&(c+=m.bottom-g.bottom),f=x+b.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?$n.RTL:$n.LTR}measureTextSize(){let t=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let o=0,l;for(let c of a.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=Rf(c.dom);if(u.length!=1)return;o+=u[0].width,l=u[0].height}if(o)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:o/a.length,textHeight:l}}});if(t)return t;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=Rf(n.firstChild)[0];r=n.getBoundingClientRect().height,i=a&&a.width?a.width/27:7,s=a&&a.height?a.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],a=s?s.from-1:this.view.state.doc.length;if(a>r){let o=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;t.push(an.replace({widget:new Vv(o),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!s)break;r=s.to+1}return an.set(t)}updateDeco(){let t=1,n=this.view.state.facet(fy).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet($k).map((s,a)=>{let o=typeof s=="function";return o&&(r=!0),o?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[t++]=r,n.push(vn.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;this.blockWrappers=this.view.state.facet(kR).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(t){var n;if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(vR))try{if(u(this.view,t.range,t))return!0}catch(d){as(this.view.state,d,"scroll handler")}let{range:r}=t,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let a=Uk(this.view),o={left:i.left-a.left,top:i.top-a.top,right:i.right+a.right,bottom:i.bottom+a.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(eue(this.view.scrollDOM,o,r.head<r.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,l),-l),Math.max(Math.min(t.yMargin,c),-c),this.view.textDirection==$n.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let u=this.view.docView.lineAt(r.head,1);u&&u.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(t){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){z2(this.tile)}}function z2(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let r of e.children)z2(r,t)}}function Cue(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function CR(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=iR(n.focusNode,n.focusOffset),i=sR(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let o=ar.get(i.node);if(!o||o.isText()&&o.text!=i.node.nodeValue)s=i;else if(e.docView.lastCompositionAfterCursor){let l=ar.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(s=i)}}if(e.docView.lastCompositionAfterCursor=s!=r,!s)return null;let a=t-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function Eue(e,t,n){let r=CR(e,n);if(!r)return null;let{node:i,from:s,to:a}=r,o=i.nodeValue;if(/[\n\r]/.test(o)||e.state.doc.sliceString(r.from,r.to)!=o)return null;let l=t.invertedDesc;return{range:new Bs(l.mapPos(s),l.mapPos(a),s,a),text:i}}function Aue(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable=="false"?2:0)}let Mue=class{constructor(){this.changes=[]}compareRange(t,n){vd(t,n,this.changes)}comparePoint(t,n){vd(t,n,this.changes)}boundChange(t){vd(t,t,this.changes)}};function Nue(e,t,n){let r=new Mue;return vn.compare(e,t,n,r),r.changes}class Iue{constructor(){this.changes=[]}compareRange(t,n){vd(t,n,this.changes)}comparePoint(){}boundChange(t){vd(t,t,this.changes)}}function Due(e,t,n){let r=new Iue;return vn.compare(e,t,n,r),r.changes}function Rue(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function Oue(e,t){let n=!1;return t&&e.iterChangedRanges((r,i)=>{r<t.to&&i>t.from&&(n=!0)}),n}class Vv extends Fo{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function jue(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),s=t-i.from;if(i.length==0)return Se.cursor(t);s==0?n=1:s==i.length&&(n=-1);let a=s,o=s;n<0?a=oi(i.text,s,!1):o=oi(i.text,s);let l=r(i.text.slice(a,o));for(;a>0;){let c=oi(i.text,a,!1);if(r(i.text.slice(c,a))!=l)break;a=c}for(;o<i.length;){let c=oi(i.text,o);if(r(i.text.slice(o,c))!=l)break;o=c}return Se.range(a+i.from,o+i.from)}function Lue(e,t,n,r,i){let s=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let o=e.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(e.defaultLineHeight-o)*.5)/o);s+=l*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+Vce(a,s,e.state.tabSize)}function P2(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>t)break;if(!(s.to<t)){if(s.from<t&&s.to>t)return s;(!i||s.type==Ei.Text&&(i.type!=s.type||(n<0?s.from<t:s.to>t)))&&(i=s)}}return i||r}return r}function Bue(e,t,n,r){let i=P2(e,t.head,t.assoc||-1),s=!r||i.type!=Ei.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(s){let a=e.dom.getBoundingClientRect(),o=e.textDirectionAt(i.from),l=e.posAtCoords({x:n==(o==$n.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(l!=null)return Se.cursor(l,n?-1:1)}return Se.cursor(n?i.to:i.from,n?-1:1)}function F8(e,t,n,r){let i=e.state.doc.lineAt(t.head),s=e.bidiSpans(i),a=e.textDirectionAt(i.from);for(let o=t,l=null;;){let c=due(i,s,a,o,n),u=uR;if(!c){if(i.number==(n?e.state.doc.lines:1))return o;u=`
`,i=e.state.doc.line(i.number+(n?1:-1)),s=e.bidiSpans(i),c=e.visualLineSide(i,!n)}if(l){if(!l(u))return o}else{if(!r)return c;l=r(u)}o=c}}function zue(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return s=>{let a=r(s);return i==_o.Space&&(i=a),i==a}}function Pue(e,t,n,r){let i=t.head,s=n?1:-1;if(i==(n?e.state.doc.length:0))return Se.cursor(i,t.assoc);let a=t.goalColumn,o,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(c)a==null&&(a=c.left-l.left),o=s<0?c.top:c.bottom;else{let p=e.viewState.lineBlockAt(i);a==null&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-p.from))),o=(s<0?p.top:p.bottom)+u}let d=l.left+a,f=e.viewState.heightOracle.textHeight>>1,m=r??f;for(let p=0;;p+=f){let b=o+(m+p)*s,x=$2(e,{x:d,y:b},!1,s);if(n?b>l.bottom:b<l.top)return Se.cursor(x.pos,x.assoc);let g=e.coordsAtPos(x.pos,x.assoc),y=g?(g.top+g.bottom)/2:0;if(!g||(n?y>o:y<o))return Se.cursor(x.pos,x.assoc,void 0,a)}}function jf(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(s,a,o)=>{if(t>s&&t<a){let l=r||n||(t-s<a-t?-1:1);t=l<0?s:a,r=l}});if(!r)return t}}function ER(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],s=null;if(i.empty){let a=jf(e,i.from,0);a!=i.from&&(s=Se.cursor(a,-1))}else{let a=jf(e,i.from,-1),o=jf(e,i.to,1);(a!=i.from||o!=i.to)&&(s=Se.range(i.from==i.anchor?a:o,i.from==i.head?a:o))}s&&(n||(n=t.ranges.slice()),n[r]=s)}return n?Se.create(n,t.mainIndex):t}function Gv(e,t,n){let r=jf(e.state.facet(K0).map(i=>i(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:Se.cursor(r,r<n.from?1:-1)}class Na{constructor(t,n){this.pos=t,this.assoc=n}}function $2(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),s=i.top+e.viewState.paddingTop,{x:a,y:o}=t,l=o-s,c;for(;;){if(l<0)return new Na(0,1);if(l>e.viewState.docHeight)return new Na(e.state.doc.length,-1);if(c=e.elementAtHeight(l),r==null)break;if(c.type==Ei.Text){if(r<0?c.to<e.viewport.from:c.from>e.viewport.to)break;let f=e.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(f&&(r<0?f.top<=l+s:f.bottom>=l+s))break}let d=e.viewState.heightOracle.textHeight/2;l=r>0?c.bottom+d:c.top-d}if(e.viewport.from>=c.to||e.viewport.to<=c.from){if(n)return null;if(c.type==Ei.Text){let d=Lue(e,i,c,a,o);return new Na(d,d==c.from?1:-1)}}if(c.type!=Ei.Text)return l<(c.top+c.bottom)/2?new Na(c.from,1):new Na(c.to,-1);let u=e.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=e.docView.lineAt(c.from,-2)),new $ue(e,a,o,e.textDirectionAt(c.from)).scanTile(u,c.from)}class $ue{constructor(t,n,r,i){this.view=t,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to<t)&&(this.line=this.view.state.doc.lineAt(t),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[ja.find(i,t-r.from,-1,n)].level==this.baseDir}dirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[ja.find(i,t-r.from,-1,n)].dir}bidiIn(t,n){let{spans:r,line:i}=this.bidiSpansAt(t);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(t,n,r=!1){let i=0,s=t.length-1,a=new Set,o=this.bidiIn(t[0],t[s]),l,c,u=-1,d=1e9,f;e:for(;i<s;){let p=s-i,b=i+s>>1;t:if(a.has(b)){let g=i+Math.floor(Math.random()*p);for(let y=0;y<p;y++){if(!a.has(g)){b=g;break t}g++,g==s&&(g=i)}break e}a.add(b);let x=n(b);if(x)for(let g=0;g<x.length;g++){let y=x[g],w=0;if(!(y.width==0&&x.length>1)){if(y.bottom<this.y)(!l||l.bottom<y.bottom)&&(l=y),w=1;else if(y.top>this.y)(!c||c.top>y.top)&&(c=y),w=-1;else{let C=y.left>this.x?this.x-y.left:y.right<this.x?this.x-y.right:0,E=Math.abs(C);E<d&&(u=b,d=E,f=y),C&&(w=C<0==(this.baseDir==$n.LTR)?-1:1)}w==-1&&(!o||this.baseDirAt(t[b],1))?s=b:w==1&&(!o||this.baseDirAt(t[b+1],-1))&&(i=b+1)}}}if(!f){if(!c&&!l)return{i:t[0],after:!1};let p=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(p.top+p.bottom)/2,this.scan(t,n,!0)}if(d&&!r){let{top:p,bottom:b}=f;if(l&&l.bottom>(p+p+b)/3)return this.y=l.bottom-1,this.scan(t,n,!0);if(c&&c.top<(p+b+b)/3)return this.y=c.top+1,this.scan(t,n,!0)}let m=(o?this.dirAt(t[u],1):this.baseDir)==$n.LTR;return{i:u,after:this.x>(f.left+f.right)/2==m}}scanText(t,n){let r=[];for(let s=0;s<t.length;s=oi(t.text,s))r.push(n+s);r.push(n+t.length);let i=this.scan(r,s=>{let a=r[s]-n,o=r[s+1]-n;return m0(t.dom,a,o).getClientRects()});return i.after?new Na(r[i.i+1],-1):new Na(r[i.i],1)}scanTile(t,n){if(!t.length)return new Na(n,1);if(t.children.length==1){let o=t.children[0];if(o.isText())return this.scanText(o,n);if(o.isComposite())return this.scanTile(o,n)}let r=[n];for(let o=0,l=n;o<t.children.length;o++)r.push(l+=t.children[o].length);let i=this.scan(r,o=>{let l=t.children[o];return l.flags&48?null:(l.dom.nodeType==1?l.dom:m0(l.dom,0,l.length)).getClientRects()}),s=t.children[i.i],a=r[i.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):i.after?new Na(r[i.i+1],-1):new Na(a,1)}}const Hu="";class Uue{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(mn.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=Hu}readRange(t,n){if(!t)return this;let r=t.parentNode;for(let i=t;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let a=ar.get(i),o=i.nextSibling;if(o==n){a!=null&&a.breakAfter&&!o&&r!=this.view.contentDOM&&this.lineBreak();break}let l=ar.get(o);(a&&l?a.breakAfter:(a?a.breakAfter:e1(i))||e1(o)&&(i.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!que(o,n)&&this.lineBreak(),i=o}return this.findPointBefore(r,n),this}readTextNode(t){let n=t.nodeValue;for(let r of this.points)r.node==t&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,o;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(o=i.exec(n))&&(s=o.index,a=o[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let l of this.points)l.node==t&&l.pos>this.text.length&&(l.pos-=a-1);r=s+a}}readNode(t){let n=ar.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let r of this.points)r.node==t&&t.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(t,n){for(let r of this.points)(t.nodeType==3?r.node==t:t.contains(r.node))&&(r.pos=this.text.length+(Hue(t,r.node,r.offset)?n:0))}}function Hue(e,t,n){for(;;){if(!t||n<Bo(t))return!1;if(t==e)return!0;n=Xl(t)+1,t=t.parentNode}}function que(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let r=ar.get(e);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class V8{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class Fue{constructor(t,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=t.docView,o=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=AR(t.docView.tile,n,r,0))){let l=s||a?[]:Gue(t),c=new Uue(l,t);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=Wue(l,this.bounds.from)}else{let l=t.observer.selectionRange,c=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!R2(t.contentDOM,l.focusNode)?o.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),u=a&&a.node==l.anchorNode&&a.offset==l.anchorOffset||!R2(t.contentDOM,l.anchorNode)?o.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=t.viewport;if((He.ios||He.chrome)&&o.main.empty&&c!=u&&(d.from>0||d.to<t.state.doc.length)){let f=Math.min(c,u),m=Math.max(c,u),p=d.from-f,b=d.to-m;(p==0||p==1||f==0)&&(b==0||b==-1||m==t.state.doc.length)&&(c=0,u=t.state.doc.length)}if(t.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(Se.range(u,c));else if(t.lineWrapping&&u==c&&!(o.main.empty&&o.main.head==c)&&t.inputState.lastTouchTime>Date.now()-100){let f=t.coordsAtPos(c,-1),m=0;f&&(m=t.inputState.lastTouchY<=f.bottom?-1:1),this.newSel=Se.create([Se.cursor(c,m)])}else this.newSel=Se.single(u,c)}}}function AR(e,t,n,r){if(e.isComposite()){let i=-1,s=-1,a=-1,o=-1;for(let l=0,c=r,u=r;l<e.children.length;l++){let d=e.children[l],f=c+d.length;if(c<t&&f>n)return AR(d,t,n,c);if(f>=t&&i==-1&&(i=l,s=c),c>n&&d.dom.parentNode==e.dom){a=l,o=u;break}u=f,c=f+d.breakAfter}return{from:s,to:o<0?r+e.length:o,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:a<e.children.length&&a>=0?e.children[a].dom:null}}else return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function MR(e,t){let n,{newSel:r}=t,{state:i}=e,s=i.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,c=s.from,u=null;(a===8||He.android&&t.text.length<l-o)&&(c=s.to,u="end");let d=i.doc.sliceString(o,l,Hu),f,m;!s.empty&&s.from>=o&&s.to<=l&&(t.typeOver||d!=t.text)&&d.slice(0,s.from-o)==t.text.slice(0,s.from-o)&&d.slice(s.to-o)==t.text.slice(f=t.text.length-(d.length-(s.to-o)))?n={from:s.from,to:s.to,insert:nn.of(t.text.slice(s.from-o,f).split(Hu))}:(m=NR(d,t.text,c-o,u))&&(He.chrome&&a==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==Hu+Hu&&m.toB--,n={from:o+m.from,to:o+m.toA,insert:nn.of(t.text.slice(m.from,m.toB).split(Hu))})}else r&&(!e.hasFocus&&i.facet(po)||i1(r,s))&&(r=null);if(!n&&!r)return!1;if((He.mac||He.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Se.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:nn.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&e.docView.lineHasWidget(s.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:i.toText(e.inputState.insertingText)}:He.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
 `&&e.lineWrapping&&(r&&(r=Se.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:nn.of([" "])}),n)return Hk(e,n,r,a);if(r&&!i1(r,s)){let o=!1,l="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(o=!0),l=e.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=ER(i.facet(K0).map(c=>c(e)),r))),e.dispatch({selection:r,scrollIntoView:o,userEvent:l}),!0}else return!1}function Hk(e,t,n,r=-1){if(He.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(He.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&xd(e.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&xd(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&xd(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a,o=()=>a||(a=Vue(e,t,n));return e.state.facet(pR).some(l=>l(e,t.from,t.to,s,o))||e.dispatch(o()),!0}function Vue(e,t,n){let r,i=e.state,s=i.selection.main,a=-1;if(t.from==t.to&&t.from<s.from||t.from>s.to){let l=t.from<s.from?-1:1,c=l<0?s.from:s.to,u=jf(i.facet(K0).map(d=>d(e)),c,l);t.from==u&&(a=u)}if(a>-1)r={changes:t,selection:Se.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let l=s.from<t.from?i.sliceDoc(s.from,t.from):"",c=s.to>t.to?i.sliceDoc(t.to,s.to):"";r=i.replaceSelection(e.state.toText(l+t.insert.sliceString(0,void 0,e.state.lineBreak)+c))}else{let l=i.changes(t),c=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let u=e.state.sliceDoc(t.from,t.to),d,f=n&&CR(e,n.main.head);if(f){let p=t.insert.length-(t.to-t.from);d={from:f.from,to:f.to-p}}else d=e.state.doc.lineAt(s.head);let m=s.to-t.to;r=i.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:l,range:c||p.map(l)};let b=p.to-m,x=b-u.length;if(e.state.sliceDoc(x,b)!=u||b>=d.from&&x<=d.to)return{range:p};let g=i.changes({from:x,to:b,insert:t.insert}),y=p.to-s.to;return{changes:g,range:c?Se.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):p.map(g)}})}else r={changes:l,selection:c&&i.selection.replaceRange(c)}}let o="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,o+=".compose",e.inputState.compositionFirstChange&&(o+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}function NR(e,t,n,r){let i=Math.min(e.length,t.length),s=0;for(;s<i&&e.charCodeAt(s)==t.charCodeAt(s);)s++;if(s==i&&e.length==t.length)return null;let a=e.length,o=t.length;for(;a>0&&o>0&&e.charCodeAt(a-1)==t.charCodeAt(o-1);)a--,o--;if(r=="end"){let l=Math.max(0,s-Math.min(a,o));n-=a+l-s}if(a<s&&e.length<t.length){let l=n<=s&&n>=a?s-n:0;s-=l,o=s+(o-a),a=s}else if(o<s){let l=n<=s&&n>=o?s-n:0;s-=l,a=s+(a-o),o=s}return{from:s,toA:a,toB:o}}function Gue(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new V8(n,r)),(i!=n||s!=r)&&t.push(new V8(i,s))),t}function Wue(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?Se.single(n+t,r+t):null}function i1(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class Kue{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,He.safari&&t.contentDOM.addEventListener("input",()=>null),He.gecko&&cde(t.contentDOM.ownerDocument)}handleEvent(t){!nde(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let r=this.handlers[t];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=Yue(t),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,o=r[s];o&&a!=!o.handlers.length&&(i.removeEventListener(s,this.handleEvent),o=null),o||i.addEventListener(s,this.handleEvent,{passive:a})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&DR.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),He.android&&He.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let n;return He.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&!t.shiftKey&&((n=IR.find(r=>r.keyCode==t.keyCode))&&!t.ctrlKey||Xue.indexOf(t.key)>-1&&t.ctrlKey)?(this.pendingIOSKey=n||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,xd(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(t){return!/^key/.test(t.type)||t.synthetic?!1:this.composing>0?!0:He.safari&&!He.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function G8(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){as(n.state,i)}}}function Yue(e){let t=Object.create(null);function n(r){return t[r]||(t[r]={observers:[],handlers:[]})}for(let r of e){let i=r.spec,s=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(s)for(let o in s){let l=s[o];l&&n(o).handlers.push(G8(r.value,l))}if(a)for(let o in a){let l=a[o];l&&n(o).observers.push(G8(r.value,l))}}for(let r in sa)n(r).handlers.push(sa[r]);for(let r in Vi)n(r).observers.push(Vi[r]);return t}const IR=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Xue="dthko",DR=[16,17,18,20,91,92,224,225],Wm=6;function Km(e){return Math.max(0,e)*.7+8}function Que(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class Jue{constructor(t,n,r,i){this.view=t,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=tR(t.contentDOM),this.atoms=t.state.facet(K0).map(a=>a(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(mn.allowMultipleSelections)&&Zue(t,n),this.dragging=tde(t,n)&&jR(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Que(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,r=0,i=0,s=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:o}=this.scrollParents.y.getBoundingClientRect());let l=Uk(this.view);t.clientX-l.left<=i+Wm?n=-Km(i-t.clientX):t.clientX+l.right>=a-Wm&&(n=Km(t.clientX-a)),t.clientY-l.top<=s+Wm?r=-Km(s-t.clientY):t.clientY+l.bottom>=o-Wm&&(r=Km(t.clientY-o)),this.setScrollSpeed(n,r)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,r=ER(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Zue(e,t){let n=e.state.facet(dR);return n.length?n[0](t):He.mac?t.metaKey:t.ctrlKey}function ede(e,t){let n=e.state.facet(hR);return n.length?n[0](t):He.mac?!t.altKey:!t.ctrlKey}function tde(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=h0(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let a=i[s];if(a.left<=t.clientX&&a.right>=t.clientX&&a.top<=t.clientY&&a.bottom>=t.clientY)return!0}return!1}function nde(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=ar.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}const sa=Object.create(null),Vi=Object.create(null),RR=He.ie&&He.ie_version<15||He.ios&&He.webkit_version<604;function rde(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),OR(e,n.value)},50)}function gy(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function OR(e,t){t=gy(e.state,Bk,t);let{state:n}=e,r,i=1,s=n.toText(t),a=s.lines==n.selection.ranges.length;if(U2!=null&&n.selection.ranges.every(l=>l.empty)&&U2==s.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let d=n.toText((a?s.line(i++).text:t)+n.lineBreak);return{changes:{from:u.from,insert:d},range:Se.cursor(c.from+d.length)}})}else a?r=n.changeByRange(l=>{let c=s.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:Se.cursor(l.from+c.length)}}):r=n.replaceSelection(s);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Vi.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft};Vi.wheel=Vi.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};sa.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Vi.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};Vi.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};sa.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(fR))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=sde(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new Jue(e,t,n,r)),r&&e.observer.ignore(()=>{nR(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function W8(e,t,n,r){if(r==1)return Se.cursor(t,n);if(r==2)return jue(e.state,t,n);{let i=e.docView.lineAt(t,n),s=e.state.doc.lineAt(i?i.posAtEnd:t),a=i?i.posAtStart:s.from,o=i?i.posAtEnd:s.to;return o<e.state.doc.length&&o==s.to&&o++,Se.range(a,o)}}const ide=He.ie&&He.ie_version<=11;let K8=null,Y8=0,X8=0;function jR(e){if(!ide)return e.detail;let t=K8,n=X8;return K8=e,X8=Date.now(),Y8=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Y8+1)%3:1}function sde(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=jR(t),i=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,a,o){let l=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=W8(e,l.pos,l.assoc,r);if(n.pos!=l.pos&&!a){let d=W8(e,n.pos,n.assoc,r),f=Math.min(d.from,u.from),m=Math.max(d.to,u.to);u=f<u.from?Se.range(f,m,u.assoc):Se.range(m,f,u.assoc)}return a?i.replaceRange(i.main.extend(u.from,u.to,u.assoc)):o&&r==1&&i.ranges.length>1&&(c=ade(i,l.pos))?c:o?i.addRange(u):Se.create([u])}}}function ade(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return Se.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}sa.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let s=i.posAtStart,a=s+i.length;(s>=n.to||a<=n.from)&&(n=Se.range(s,a))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",gy(e.state,zk,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};sa.dragend=e=>(e.inputState.draggedContent=null,!1);function Q8(e,t,n,r){if(n=gy(e.state,Bk,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=r&&s&&ede(e,t)?{from:s.from,to:s.to}:null,o={from:i,insert:n},l=e.state.changes(a?[a,o]:o);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}sa.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&Q8(e,t,r.filter(a=>a!=null).join(e.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let o=new FileReader;o.onerror=s,o.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(r[a]=o.result),s()},o.readAsText(n[a])}return!0}else{let r=t.dataTransfer.getData("Text");if(r)return Q8(e,t,r,!0),!0}return!1};sa.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=RR?null:t.clipboardData;return n?(OR(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(rde(e),!1)};function ode(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function lde(e){let t=[],n=[],r=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let i=-1;for(let{from:s}of e.selection.ranges){let a=e.doc.lineAt(s);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:gy(e,zk,t.join(e.lineBreak)),ranges:n,linewise:r}}let U2=null;sa.copy=sa.cut=(e,t)=>{if(!Df(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=lde(e.state);if(!n&&!i)return!1;U2=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=RR?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(ode(e,n),!1)};const LR=qo.define();function BR(e,t){let n=[];for(let r of e.facet(gR)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:LR.of(!0)}):null}function zR(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=BR(e.state,t);n?e.dispatch(n):e.update([])}},10)}Vi.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),zR(e)};Vi.blur=e=>{e.observer.clearSelectionRange(),zR(e)};Vi.compositionstart=Vi.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Vi.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,He.chrome&&He.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Vi.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};sa.beforeinput=(e,t)=>{var n,r;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=t.getTargetRanges();if(s&&a.length){let o=a[0],l=e.posAtDOM(o.startContainer,o.startOffset),c=e.posAtDOM(o.endContainer,o.endOffset);return Hk(e,{from:l,to:c,insert:e.state.toText(s)},null),!0}}let i;if(He.chrome&&He.android&&(i=IR.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return He.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),He.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Vi.compositionend(e,t),20),!1};const J8=new Set;function cde(e){J8.has(e)||(J8.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const Z8=["pre-wrap","normal","pre-line","break-spaces"];let Vd=!1;function eT(){Vd=!1}class ude{constructor(t){this.lineWrapping=t,this.doc=nn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Z8.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let r=0;r<t.length;r++){let i=t[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(t,n,r,i,s,a){let o=Z8.indexOf(t)>-1,l=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let c=0;c<a.length;c++){let u=a[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class dde{constructor(t,n){this.from=t,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class na{constructor(t,n,r,i,s){this.from=t,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?Ei.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof tu?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new na(this.from,this.length+t.length,this.top,this.height+t.height,n)}}var Rn=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(Rn||(Rn={}));const Bp=.001;class Ai{constructor(t,n,r=2){this.length=t,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>Bp&&(Vd=!0),this.height=t)}replace(t,n,r){return Ai.of(r)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,r,i){let s=this,a=r.doc;for(let o=i.length-1;o>=0;o--){let{fromA:l,toA:c,fromB:u,toB:d}=i[o],f=s.lineAt(l,Rn.ByPosNoHeight,r.setDoc(n),0,0),m=f.to>=c?f:s.lineAt(c,Rn.ByPosNoHeight,r,0,0);for(d+=m.to-c,c=m.to;o>0&&f.from<=i[o-1].toA;)l=i[o-1].fromA,u=i[o-1].fromB,o--,l<f.from&&(f=s.lineAt(l,Rn.ByPosNoHeight,r,0,0));u+=f.from-l,l=f.from;let p=qk.build(r.setDoc(a),t,u,d);s=s1(s,s.replace(l,c,p))}return s.updateHeight(r,0)}static empty(){return new es(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let o=t[n-1];o.break?t.splice(--n,1,o.left,null,o.right):t.splice(--n,1,o.left,o.right),r+=1+o.break,i-=o.size}else if(s>i*2){let o=t[r];o.break?t.splice(r,1,o.left,null,o.right):t.splice(r,1,o.left,o.right),r+=2+o.break,s-=o.size}else break;else if(i<s){let o=t[n++];o&&(i+=o.size)}else{let o=t[--r];o&&(s+=o.size)}let a=0;return t[n-1]==null?(a=1,n--):t[n]==null&&(a=1,r++),new fde(Ai.of(t.slice(0,n)),a,Ai.of(t.slice(r)))}}function s1(e,t){return e==t?e:(e.constructor!=t.constructor&&(Vd=!0),t)}Ai.prototype.size=1;const hde=an.replace({});class PR extends Ai{constructor(t,n,r){super(t,n),this.deco=r,this.spaceAbove=0}mainBlock(t,n){return new na(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(t,n,r,i){return this.spaceAbove&&t<r+this.spaceAbove?new na(i,0,r,this.spaceAbove,hde):this.mainBlock(r,i)}lineAt(t,n,r,i,s){let a=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(a):a}forEachLine(t,n,r,i,s,a){t<=s+this.length&&n>=s&&a(this.lineAt(0,Rn.ByPos,r,i,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class es extends PR{constructor(t,n,r){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(t,n){return new na(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof es||i instanceof Yr&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Yr?i=new es(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Ai.of(r)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Yr extends Ai{constructor(t){super(t,0)}heightMetrics(t,n){let r=t.doc.lineAt(n).number,i=t.doc.lineAt(n+this.length).number,s=i-r+1,a,o=0;if(t.lineWrapping){let l=Math.min(this.height,t.lineHeight*s);a=l/s,this.length>s+1&&(o=(this.height-l)/(this.length-s-1))}else a=this.height/s;return{firstLine:r,lastLine:i,perLine:a,perChar:o}}blockAt(t,n,r,i){let{firstLine:s,lastLine:a,perLine:o,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(t<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-r)/this.height))*this.length)),u=n.doc.lineAt(c),d=o+u.length*l,f=Math.max(r,t-d/2);return new na(u.from,u.length,f,d,0)}else{let c=Math.max(0,Math.min(a-s,Math.floor((t-r)/o))),{from:u,length:d}=n.doc.line(s+c);return new na(u,d,r+o*c,o,0)}}lineAt(t,n,r,i,s){if(n==Rn.ByHeight)return this.blockAt(t,r,i,s);if(n==Rn.ByPosNoHeight){let{from:m,to:p}=r.doc.lineAt(t);return new na(m,p-m,0,0,0)}let{firstLine:a,perLine:o,perChar:l}=this.heightMetrics(r,s),c=r.doc.lineAt(t),u=o+c.length*l,d=c.number-a,f=i+o*d+l*(c.from-s-d);return new na(c.from,c.length,Math.max(i,Math.min(f,i+this.height-u)),u,0)}forEachLine(t,n,r,i,s,a){t=Math.max(t,s),n=Math.min(n,s+this.length);let{firstLine:o,perLine:l,perChar:c}=this.heightMetrics(r,s);for(let u=t,d=i;u<=n;){let f=r.doc.lineAt(u);if(u==t){let p=f.number-o;d+=l*p+c*(t-s-p)}let m=l+c*f.length;a(new na(f.from,f.length,d,m,0)),d+=m,u=f.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof Yr?r[r.length-1]=new Yr(s.length+i):r.push(null,new Yr(i-1))}if(t>0){let s=r[0];s instanceof Yr?r[0]=new Yr(t+s.length):r.unshift(new Yr(t-1),null)}return Ai.of(r)}decomposeLeft(t,n){n.push(new Yr(t-1),null)}decomposeRight(t,n){n.push(null,new Yr(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],o=Math.max(n,i.from),l=-1;for(i.from>n&&a.push(new Yr(i.from-n-1).updateHeight(t,n));o<=s&&i.more;){let u=t.doc.lineAt(o).length;a.length&&a.push(null);let d=i.heights[i.index++],f=0;d<0&&(f=-d,d=i.heights[i.index++]),l==-1?l=d:Math.abs(d-l)>=Bp&&(l=-2);let m=new es(u,d,f);m.outdated=!1,a.push(m),o+=u+1}o<=s&&a.push(null,new Yr(s-o).updateHeight(t,o));let c=Ai.of(a);return(l<0||Math.abs(c.height-this.height)>=Bp||Math.abs(l-this.heightMetrics(t,n).perLine)>=Bp)&&(Vd=!0),s1(this,c)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class fde extends Ai{constructor(t,n,r){super(t.length+n+r.length,t.height+r.height,n|(t.outdated||r.outdated?2:0)),this.left=t,this.right=r,this.size=t.size+r.size}get break(){return this.flags&1}blockAt(t,n,r,i){let s=r+this.left.height;return t<s?this.left.blockAt(t,n,r,i):this.right.blockAt(t,n,s,i+this.left.length+this.break)}lineAt(t,n,r,i,s){let a=i+this.left.height,o=s+this.left.length+this.break,l=n==Rn.ByHeight?t<a:t<o,c=l?this.left.lineAt(t,n,r,i,s):this.right.lineAt(t,n,r,a,o);if(this.break||(l?c.to<o:c.from>o))return c;let u=n==Rn.ByPosNoHeight?Rn.ByPosNoHeight:Rn.ByPos;return l?c.join(this.right.lineAt(o,u,r,a,o)):this.left.lineAt(o,u,r,i,s).join(c)}forEachLine(t,n,r,i,s,a){let o=i+this.left.height,l=s+this.left.length+this.break;if(this.break)t<l&&this.left.forEachLine(t,n,r,i,s,a),n>=l&&this.right.forEachLine(t,n,r,o,l,a);else{let c=this.lineAt(l,Rn.ByPos,r,i,s);t<c.from&&this.left.forEachLine(t,c.from-1,r,i,s,a),c.to>=t&&c.from<=n&&a(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,o,l,a)}}replace(t,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(t,n,r),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-i,n-i,r));let s=[];t>0&&this.decomposeLeft(t,s);let a=s.length;for(let o of r)s.push(o);if(t>0&&tT(s,a-1),n<this.length){let o=s.length;this.decomposeRight(n,s),tT(s,o)}return Ai.of(s)}decomposeLeft(t,n){let r=this.left.length;if(t<=r)return this.left.decomposeLeft(t,n);n.push(this.left),this.break&&(r++,t>=r&&n.push(null)),t>r&&this.right.decomposeLeft(t-r,n)}decomposeRight(t,n){let r=this.left.length,i=r+this.break;if(t>=i)return this.right.decomposeRight(t-i,n);t<r&&this.left.decomposeRight(t,n),this.break&&t<i&&n.push(null),n.push(this.right)}balanced(t,n){return t.size>2*n.size||n.size>2*t.size?Ai.of(this.break?[t,null,n]:[t,n]):(this.left=s1(this.left,t),this.right=s1(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,r=!1,i){let{left:s,right:a}=this,o=n+s.length+this.break,l=null;return i&&i.from<=n+s.length&&i.more?l=s=s.updateHeight(t,n,r,i):s.updateHeight(t,n,r),i&&i.from<=o+a.length&&i.more?l=a=a.updateHeight(t,o,r,i):a.updateHeight(t,o,r),l?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function tT(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof Yr&&(r=e[t+1])instanceof Yr&&e.splice(t-1,3,new Yr(n.length+1+r.length))}const mde=5;class qk{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof es?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new es(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,r){if(t<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let a=n-t;r.block?this.addBlock(new PR(a,i,r)):(a||s||i>=mde)&&this.addLineDeco(i,s,a)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new es(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let r=new Yr(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof es)return t;let n=new es(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof es)&&!this.isCovered?this.nodes.push(new es(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=t;for(let i of this.nodes)i instanceof es&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(t,n,r,i){let s=new qk(r,t);return vn.spans(n,r,i,s,0),s.finish(r)}}function pde(e,t,n){let r=new gde;return vn.compare(e,t,n,r,0),r.changes}class gde{constructor(){this.changes=[]}compareRange(){}comparePoint(t,n,r,i){(t<n||r&&r.heightRelevant||i&&i.heightRelevant)&&vd(t,n,this.changes,5)}}function yde(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),o=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let c=e.parentNode;c&&c!=r.body;)if(c.nodeType==1){let u=c,d=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&d.overflow!="visible"){let f=u.getBoundingClientRect();s=Math.max(s,f.left),a=Math.min(a,f.right),o=Math.max(o,f.top),l=Math.min(c==e.parentNode?i.innerHeight:l,f.bottom)}c=d.position=="absolute"||d.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:o-(n.top+t),bottom:Math.max(o,l)-(n.top+t)}}function bde(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function vde(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class Wv{constructor(t,n,r,i){this.from=t,this.to=n,this.size=r,this.displaySize=i}static same(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(t,n){return an.replace({widget:new xde(this.displaySize*(n?t.scaleY:t.scaleX),n)}).range(this.from,this.to)}}class xde extends Fo{constructor(t,n){super(),this.size=t,this.vertical=n}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class nT{constructor(t,n){this.view=t,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=rT,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=$n.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(Pk).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new ude(r),this.stateDeco=iT(n),this.heightMap=Ai.empty().applyChanges(this.stateDeco,nn.empty,this.heightOracle.setDoc(n.doc),[new Bs(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=an.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!t.some(({from:s,to:a})=>i>=s&&i<=a)){let{from:s,to:a}=this.lineBlockAt(i);t.push(new Ym(s,a))}}return this.viewports=t.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?rT:new Fk(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(nf(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=iT(this.state);let i=t.changedRanges,s=Bs.extendWithRanges(i,pde(r,this.stateDeco,t?t.changes:Ir.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);eT(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||Vd)&&(t.flags|=2),o?(this.scrollAnchorPos=t.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let l=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(bR)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?$n.RTL:$n.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",o=n.getBoundingClientRect(),l=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,u=0;if(o.width&&o.height){let{scaleX:E,scaleY:S}=eR(n,o);(E>.005&&Math.abs(this.scaleX-E)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=E,this.scaleY=S,c|=16,a=l=!0)}let d=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=f)&&(this.paddingTop=d,this.paddingBottom=f,c|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=16);let m=tR(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=rR(this.scrollParent||t.win);let b=(this.printing?vde:yde)(n,this.paddingTop),x=b.top-this.pixelViewport.top,g=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(l=!0)),!this.inView&&!this.scrollTarget&&!bde(t.dom))return 0;let w=o.width;if((this.contentDOMWidth!=w||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=t.scrollDOM.clientHeight,c|=16),l){let E=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(E)&&(a=!0),a||i.lineWrapping&&Math.abs(w-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:T,textHeight:j}=t.docView.measureTextSize();a=S>0&&i.refresh(s,S,T,j,Math.max(5,w/T),E),a&&(t.docView.minWidth=0,c|=16)}x>0&&g>0?u=Math.max(x,g):x<0&&g<0&&(u=Math.min(x,g)),eT();for(let S of this.viewports){let T=S.from==this.viewport.from?E:t.docView.measureVisibleLineHeights(S);this.heightMap=(a?Ai.empty().applyChanges(this.stateDeco,nn.empty,this.heightOracle,[new Bs(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new dde(S.from,T))}Vd&&(c|=2)}let C=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return C&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,l=new Ym(i.lineAt(a-r*1e3,Rn.ByHeight,s,0,0).from,i.lineAt(o+(1-r)*1e3,Rn.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=i.lineAt(c,Rn.ByPos,s,0,0),f;n.y=="center"?f=(d.top+d.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<l.from?f=d.top:f=d.bottom-u,l=new Ym(i.lineAt(f-1e3/2,Rn.ByHeight,s,0,0).from,i.lineAt(f+u+1e3/2,Rn.ByHeight,s,0,0).to)}}return l}mapViewport(t,n){let r=n.mapPos(t.from,-1),i=n.mapPos(t.to,1);return new Ym(this.heightMap.lineAt(r,Rn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Rn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(t,Rn.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Rn.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(t==0||i<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=o+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&s<o+2*1e3}mapLineGaps(t,n){if(!t.length||n.empty)return t;let r=[];for(let i of t)n.touchesRange(i.from,i.to)||r.push(new Wv(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(t,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,a=i<<1;if(this.defaultTextDirection!=$n.LTR&&!r)return[];let o=[],l=(u,d,f,m)=>{if(d-u<s)return;let p=this.state.selection.main,b=[p.from];p.empty||b.push(p.to);for(let g of b)if(g>u&&g<d){l(u,g-10,f,m),l(g+10,d,f,m);return}let x=kde(t,g=>g.from>=f.from&&g.to<=f.to&&Math.abs(g.from-u)<s&&Math.abs(g.to-d)<s&&!b.some(y=>g.from<y&&g.to>y));if(!x){if(d<f.to&&n&&r&&n.visibleRanges.some(w=>w.from<=d&&w.to>=d)){let w=n.moveToLineBoundary(Se.cursor(d),!1,!0).head;w>u&&(d=w)}let g=this.gapSize(f,u,d,m),y=r||g<2e6?g:2e6;x=new Wv(u,d,g,y)}o.push(x)},c=u=>{if(u.length<a||u.type!=Ei.Text)return;let d=wde(u.from,u.to,this.stateDeco);if(d.total<a)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,m,p;if(r){let b=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,x,g;if(f!=null){let y=Qm(d,f),w=((this.visibleBottom-this.visibleTop)/2+b)/u.height;x=y-w,g=y+w}else x=(this.visibleTop-u.top-b)/u.height,g=(this.visibleBottom-u.top+b)/u.height;m=Xm(d,x),p=Xm(d,g)}else{let b=d.total*this.heightOracle.charWidth,x=i*this.heightOracle.charWidth,g=0;if(b>2e6)for(let S of t)S.from>=u.from&&S.from<u.to&&S.size!=S.displaySize&&S.from*this.heightOracle.charWidth+g<this.pixelViewport.left&&(g=S.size-S.displaySize);let y=this.pixelViewport.left+g,w=this.pixelViewport.right+g,C,E;if(f!=null){let S=Qm(d,f),T=((w-y)/2+x)/b;C=S-T,E=S+T}else C=(y-x)/b,E=(w+x)/b;m=Xm(d,C),p=Xm(d,E)}m>u.from&&l(u.from,m,u,d),p<u.to&&l(p,u.to,u,d)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return o}gapSize(t,n,r,i){let s=Qm(i,r)-Qm(i,n);return this.heightOracle.lineWrapping?t.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(t){Wv.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=an.set(t.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];vn.spans(n,this.viewport.from,this.viewport.to,{span(s,a){r.push({from:s,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let a=this.visibleRanges[s],o=r[s];(a.from!=o.from||a.to!=o.to)&&(i|=4,t&&t.mapPos(a.from,-1)==o.from&&t.mapPos(a.to,1)==o.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||nf(this.heightMap.lineAt(t,Rn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||nf(this.heightMap.lineAt(this.scaler.fromDOM(t),Rn.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return nf(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ym{constructor(t,n){this.from=t,this.to=n}}function wde(e,t,n){let r=[],i=e,s=0;return vn.spans(n,e,t,{span(){},point(a,o){a>i&&(r.push({from:i,to:a}),s+=a-i),i=o}},20),i<t&&(r.push({from:i,to:t}),s+=t-i),{total:s,ranges:r}}function Xm({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let i=0;;i++){let{from:s,to:a}=t[i],o=a-s;if(r<=o)return s+r;r-=o}}function Qm(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function kde(e,t){for(let n of e)if(t(n))return n}const rT={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function iT(e){let t=e.facet(fy).filter(r=>typeof r!="function"),n=e.facet($k).filter(r=>typeof r!="function");return n.length&&t.push(vn.join(n)),t}class Fk{constructor(t,n,r){let i=0,s=0,a=0;this.viewports=r.map(({from:o,to:l})=>{let c=n.lineAt(o,Rn.ByPos,t,0,0).top,u=n.lineAt(l,Rn.ByPos,t,0,0).bottom;return i+=u-c,{from:o,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let o of this.viewports)o.domTop=a+(o.top-s)*this.scale,a=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(t){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||t<s.top)return i+(t-r)*this.scale;if(t<=s.bottom)return s.domTop+(t-s.top);r=s.bottom,i=s.domBottom}}fromDOM(t){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||t<s.domTop)return r+(t-i)/this.scale;if(t<=s.domBottom)return s.top+(t-s.domTop);r=s.bottom,i=s.domBottom}}eq(t){return t instanceof Fk?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((n,r)=>n.from==t.viewports[r].from&&n.to==t.viewports[r].to):!1}}function nf(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new na(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>nf(i,t)):e._content)}const Jm=ht.define({combine:e=>e.join(" ")}),H2=ht.define({combine:e=>e.indexOf(!0)>-1}),q2=Kl.newName(),$R=Kl.newName(),UR=Kl.newName(),HR={"&light":"."+$R,"&dark":"."+UR};function F2(e,t,n){return new Kl(t,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return e;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):e+" "+r}})}const _de=F2("."+q2,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},HR),Sde={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Kv=He.ie&&He.ie_version<=11;class Tde{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new tue,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(He.ie&&He.ie_version<=11||He.ios&&t.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&He.android&&t.constructor.EDIT_CONTEXT!==!1&&!(He.chrome&&He.chrome_version<126)&&(this.editContext=new Ede(t),t.state.facet(po)&&(t.contentDOM.editContext=this.editContext.editContext)),Kv&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,r)=>n!=t[r]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(po)?r.root.activeElement!=this.dom:!Df(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(He.ie&&He.ie_version<=11||He.android&&He.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Of(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=h0(t.root);if(!n)return!1;let r=He.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&Cde(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Df(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&rue(this.dom,r)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(t,n){this.selectionRange.set(t.node,t.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&t<this.scrollTargets.length&&this.scrollTargets[t]==r?t++:n||(n=this.scrollTargets.slice(0,t)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(t<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,t)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Sde),Kv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Kv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&xd(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of t){let a=this.readMutation(s);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Df(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Fue(this.view,t,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=MR(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!i1(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let r=sT(n,t.previousSibling||t.target.previousSibling,-1),i=sT(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(po)!=t.state.facet(po)&&(t.view.contentDOM.editContext=t.state.facet(po)?this.editContext.editContext:null))}destroy(){var t,n,r;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function sT(e,t,n){for(;t;){let r=ar.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function aT(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return Of(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function Cde(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return aT(e,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?aT(e,n):null}class Ede{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=r=>{let i=t.state.selection.main,{anchor:s,head:a}=i,o=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:o,drifted:!1});let c=l-o>r.text.length;o==this.from&&s<this.from?o=s:l==this.to&&s>this.to&&(l=s);let u=NR(t.state.sliceDoc(o,l),r.text,(c?i.from:i.to)-o,c?"end":null);if(!u){let f=Se.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));i1(f,i)||t.dispatch({selection:f,userEvent:"select"});return}let d={from:u.from+o,to:u.toA+o,insert:nn.of(r.text.slice(u.from,u.toB).split(`
`))};if((He.mac||He.android)&&d.from==a-1&&/^\. ?$/.test(r.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:o,to:l,insert:nn.of([r.text.replace("."," ")])}),this.pendingContextChange=d,!t.state.readOnly){let f=this.to-this.from+(d.to-d.from+d.insert.length);Hk(t,d,Se.single(this.toEditorPos(r.selectionStart,f),this.toEditorPos(r.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),d.from<d.to&&!d.insert.length&&t.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let a=this.toEditorPos(r.rangeStart),o=this.toEditorPos(r.rangeEnd);a<o;a++){let l=t.coordsForChar(a);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let a=s.underlineStyle,o=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(o)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let u=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(o)?1:2}px`;i.push(an.mark({attributes:{style:u}}).range(l,c))}}}t.dispatch({effects:xR.of(an.set(i))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(t.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=h0(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,r=!1,i=this.pendingContextChange;return t.changes.iterChanges((s,a,o,l,c)=>{if(r)return;let u=c.length-(a-s);if(i&&a>=i.to)if(i.from==s&&i.to==a&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(t.state);if(s+=n,a+=n,a<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(t.state),!r}update(t){let n=this.pendingContextChange,r=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(r.from,r.to)&&t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to<t.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let r=this.composing;return r&&r.drifted?r.editorBase+(t-r.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class tt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:r}=t;this.dispatchTransactions=t.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||nue(t.parent)||document,this.viewState=new nT(this,t.state||mn.create(t)),t.scrollTo&&t.scrollTo.is(Gm)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(id).map(i=>new Hv(i));for(let i of this.plugins)i.update(this);this.observer=new Tde(this),this.inputState=new Kue(this),this.inputState.ensureHandlers(this.plugins),this.docView=new q8(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Rr?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let f of t){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,o=0,l=null;t.some(f=>f.annotation(LR))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,l=BR(s,a),l||(o=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(mn.phrases)!=this.state.facet(mn.phrases))return this.setState(s);i=t1.create(this,s,t),i.flags|=o;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let f of t){if(d&&(d=d.map(f.changes)),f.scrollIntoView){let{main:m}=f.state.selection,{x:p,y:b}=this.state.facet(tt.cursorScrollMargin);d=new wd(m.empty?m:Se.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,p)}for(let m of f.effects)m.is(Gm)&&(d=m.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=a1.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(tf)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Jm)!=i.state.facet(Jm)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(B2))try{f(i)}catch(m){as(this.state,m,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!MR(this,u)&&c.force&&xd(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new nT(this,t),this.plugins=t.facet(id).map(r=>new Hv(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new q8(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(id),r=t.state.facet(id);if(n!=r){let i=[];for(let s of r){let a=n.indexOf(s);if(a<0)i.push(new Hv(s));else{let o=this.plugins[a];o.mustUpdate=t,i.push(o)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=t;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let n=t.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){as(this.state,r,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(a<0)if(rR(r||this.win))s=-1,a=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(i);s=m.from,a=m.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(m=>{try{return m.read(this)}catch(p){return as(this.state,p),oT}}),d=t1.create(this,this.state,[]),f=!1;d.flags|=l,n?n.flags|=l:n=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),f=this.docView.update(d),f&&this.docViewUpdate());for(let m=0;m<c.length;m++)if(u[m]!=oT)try{let p=c[m];p.write&&p.write(u[m],this)}catch(p){as(this.state,p)}if(f&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let p=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a)/this.scaleY;if((p>1||p<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+p,r?r.scrollTop+=p:this.win.scrollBy(0,p),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let o of this.state.facet(B2))o(n)}get themeClasses(){return q2+" "+(this.state.facet(H2)?UR:$R)+" "+this.state.facet(Jm)}updateAttrs(){let t=lT(this,wR,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(po)?"true":"false",class:"cm-content",style:`${He.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),lT(this,Pk,n);let r=this.observer.ignore(()=>{let i=B8(this.contentDOM,this.contentAttrs,n),s=B8(this.dom,this.editorAttrs,t);return i||s});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let i of r.effects)if(i.is(tt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(tf);let t=this.state.facet(tt.cspNonce);Kl.mount(this.root,this.styleModules.concat(_de).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===t.key){this.measureRequests[n]=t;return}}this.measureRequests.push(t)}}plugin(t){let n=this.pluginMap.get(t);return(n===void 0||n&&n.plugin!=t)&&this.pluginMap.set(t,n=this.plugins.find(r=>r.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return Gv(this,t,F8(this,t,n,r))}moveByGroup(t,n){return Gv(this,t,F8(this,t,n,r=>zue(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),i=this.textDirectionAt(t.from),s=r[n?r.length-1:0];return Se.cursor(s.side(n,i)+t.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return Bue(this,t,n,r)}moveVertically(t,n,r){return Gv(this,t,Pue(this,t,n,r))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let r=$2(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),$2(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.docView.coordsAt(t,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(t),s=this.bidiSpans(i),a=s[ja.find(s,t-i.from,-1,n)];return f0(r,a.dir==$n.LTR==n>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(yR)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>Ade)return cR(t.length);let n=this.textDirectionAt(t.from),r;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||lR(s.isolates,r=$8(this,t))))return s.order;r||(r=$8(this,t));let i=uue(t.text,n,r);return this.bidiCache.push(new a1(t.from,t.to,n,r,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||He.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{nR(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var r,i,s,a;return Gm.of(new wd(typeof t=="number"?Se.cursor(t):t,(r=n.y)!==null&&r!==void 0?r:"nearest",(i=n.x)!==null&&i!==void 0?i:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(a=n.xMargin)!==null&&a!==void 0?a:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return Gm.of(new wd(Se.cursor(r.from),"start","start",r.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return gs.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return gs.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=Kl.newName(),i=[Jm.of(r),tf.of(F2(`.${r}`,t))];return n&&n.dark&&i.push(H2.of(!0)),i}static baseTheme(t){return yu.lowest(tf.of(F2("."+q2,t,HR)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&ar.get(r)||ar.get(t);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}tt.styleModule=tf;tt.inputHandler=pR;tt.clipboardInputFilter=Bk;tt.clipboardOutputFilter=zk;tt.scrollHandler=vR;tt.focusChangeEffect=gR;tt.perLineTextDirection=yR;tt.exceptionSink=mR;tt.updateListener=B2;tt.editable=po;tt.mouseSelectionStyle=fR;tt.dragMovesSelection=hR;tt.clickAddsSelectionRange=dR;tt.decorations=fy;tt.blockWrappers=kR;tt.outerDecorations=$k;tt.atomicRanges=K0;tt.bidiIsolatedRanges=_R;tt.cursorScrollMargin=ht.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r=="number"?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}});tt.scrollMargins=SR;tt.darkTheme=H2;tt.cspNonce=ht.define({combine:e=>e.length?e[0]:""});tt.contentAttributes=Pk;tt.editorAttributes=wR;tt.lineWrapping=tt.contentAttributes.of({class:"cm-lineWrapping"});tt.announce=_n.define();const Ade=4096,oT={};class a1{constructor(t,n,r,i,s,a){this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=a}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:$n.LTR;for(let s=Math.max(0,t.length-10);s<t.length;s++){let a=t[s];a.dir==i&&!n.touchesRange(a.from,a.to)&&r.push(new a1(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function lT(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let s=r[i],a=typeof s=="function"?s(e):s;a&&Ok(a,n)}return n}const Mde=He.mac?"mac":He.windows?"win":He.linux?"linux":"key";function Nde(e,t){const n=e.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,a,o;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))t=="mac"?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),o&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function Zm(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}const Ide=yu.default(tt.domEventHandlers({keydown(e,t){return jde(Dde(t.state),e,t,"editor")}})),p0=ht.define({enables:Ide}),cT=new WeakMap;function Dde(e){let t=e.facet(p0),n=cT.get(t);return n||cT.set(t,n=Ode(t.reduce((r,i)=>r.concat(i),[]))),n}let ml=null;const Rde=4e3;function Ode(e,t=Mde){let n=Object.create(null),r=Object.create(null),i=(a,o)=>{let l=r[a];if(l==null)r[a]=o;else if(l!=o)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,o,l,c,u)=>{var d,f;let m=n[a]||(n[a]=Object.create(null)),p=o.split(/ (?!$)/).map(g=>Nde(g,t));for(let g=1;g<p.length;g++){let y=p.slice(0,g).join(" ");i(y,!0),m[y]||(m[y]={preventDefault:!0,stopPropagation:!1,run:[w=>{let C=ml={view:w,prefix:y,scope:a};return setTimeout(()=>{ml==C&&(ml=null)},Rde),!0}]})}let b=p.join(" ");i(b,!1);let x=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((f=(d=m._any)===null||d===void 0?void 0:d.run)===null||f===void 0?void 0:f.slice())||[]});l&&x.run.push(l),c&&(x.preventDefault=!0),u&&(x.stopPropagation=!0)};for(let a of e){let o=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let c of o){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=a;for(let f in u)u[f].run.push(m=>d(m,V2))}let l=a[t]||a.key;if(l)for(let c of o)s(c,l,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(c,"Shift-"+l,a.shift,a.preventDefault,a.stopPropagation)}return n}let V2=null;function jde(e,t,n,r){V2=t;let i=Yce(t),s=ol(i,0),a=Uu(s)==i.length&&i!=" ",o="",l=!1,c=!1,u=!1;ml&&ml.view==n&&ml.scope==r&&(o=ml.prefix+" ",DR.indexOf(t.keyCode)<0&&(c=!0,ml=null));let d=new Set,f=x=>{if(x){for(let g of x.run)if(!d.has(g)&&(d.add(g),g(n)))return x.stopPropagation&&(u=!0),!0;x.preventDefault&&(x.stopPropagation&&(u=!0),c=!0)}return!1},m=e[r],p,b;return m&&(f(m[o+Zm(i,t,!a)])?l=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(He.windows&&t.ctrlKey&&t.altKey)&&!(He.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=Yl[t.keyCode])&&p!=i?(f(m[o+Zm(p,t,!0)])||t.shiftKey&&(b=u0[t.keyCode])!=i&&b!=p&&f(m[o+Zm(b,t,!1)]))&&(l=!0):a&&t.shiftKey&&f(m[o+Zm(i,t,!0)])&&(l=!0),!l&&f(m._any)&&(l=!0)),c&&(l=!0),l&&u&&t.stopPropagation(),V2=null,l}class Vc{constructor(t,n,r,i,s){this.className=t,this.left=n,this.top=r,this.width=i,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=qR(t);return[new Vc(n,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return Lde(t,n,r)}}function qR(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==$n.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function uT(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let s=e.dom.getBoundingClientRect(),a=(i.top+i.bottom)/2,o=e.posAtCoords({x:s.left+1,y:a}),l=e.posAtCoords({x:s.right-1,y:a});return o==null||l==null?r:{from:Math.max(r.from,Math.min(o,l)),to:Math.min(r.to,Math.max(o,l))}}function Lde(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),s=e.textDirection==$n.LTR,a=e.contentDOM,o=a.getBoundingClientRect(),l=qR(e),c=a.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=o.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=o.right-(u?parseInt(u.paddingRight):0),m=P2(e,r,1),p=P2(e,i,-1),b=m.type==Ei.Text?m:null,x=p.type==Ei.Text?p:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=uT(e,r,1,b)),x&&(e.lineWrapping||p.widgetLineBreaks)&&(x=uT(e,i,-1,x)),b&&x&&b.from==x.from&&b.to==x.to)return y(w(n.from,n.to,b));{let E=b?w(n.from,null,b):C(m,!1),S=x?w(null,n.to,x):C(p,!0),T=[];return(b||m).to<(x||p).from-(b&&x?1:0)||m.widgetLineBreaks>1&&E.bottom+e.defaultLineHeight/2<S.top?T.push(g(d,E.bottom,f,S.top)):E.bottom<S.top&&e.elementAtHeight((E.bottom+S.top)/2).type==Ei.Text&&(E.bottom=S.top=(E.bottom+S.top)/2),y(E).concat(T).concat(y(S))}function g(E,S,T,j){return new Vc(t,E-l.left,S-l.top,Math.max(0,T-E),j-S)}function y({top:E,bottom:S,horizontal:T}){let j=[];for(let z=0;z<T.length;z+=2)j.push(g(T[z],E,T[z+1],S));return j}function w(E,S,T){let j=1e9,z=-1e9,R=[];function D(P,J,q,W,$){let Z=e.coordsAtPos(P,P==T.to?-2:2),M=e.coordsAtPos(q,q==T.from?2:-2);!Z||!M||(j=Math.min(Z.top,M.top,j),z=Math.max(Z.bottom,M.bottom,z),$==$n.LTR?R.push(s&&J?d:Z.left,s&&W?f:M.right):R.push(!s&&W?d:M.left,!s&&J?f:Z.right))}let N=E??T.from,B=S??T.to;for(let P of e.visibleRanges)if(P.to>N&&P.from<B)for(let J=Math.max(P.from,N),q=Math.min(P.to,B);;){let W=e.state.doc.lineAt(J);for(let $ of e.bidiSpans(W)){let Z=$.from+W.from,M=$.to+W.from;if(Z>=q)break;M>J&&D(Math.max(Z,J),E==null&&Z<=N,Math.min(M,q),S==null&&M>=B,$.dir)}if(J=W.to+1,J>=q)break}return R.length==0&&D(N,E==null,B,S==null,e.textDirection),{top:j,bottom:z,horizontal:R}}function C(E,S){let T=o.top+(S?E.top:E.bottom);return{top:T,bottom:T,horizontal:[]}}}function Bde(e,t){return e.constructor==t.constructor&&e.eq(t)}class zde{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(zp)!=t.state.facet(zp)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,r=t.facet(zp);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:n}=this.view;(t!=this.scaleX||n!=this.scaleY)&&(this.scaleX=t,this.scaleY=n,this.dom.style.transform=`scale(${1/t}, ${1/n})`)}draw(t){if(t.length!=this.drawn.length||t.some((n,r)=>!Bde(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of t)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=t,He.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const zp=ht.define();function FR(e){return[gs.define(t=>new zde(t,e)),zp.of(e)]}const Gd=ht.define({combine(e){return dy(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function Pde(e={}){return[Gd.of(e),$de,Ude,Hde,bR.of(!0)]}function VR(e){return e.startState.facet(Gd)!=e.state.facet(Gd)}const $de=FR({above:!0,markers(e){let{state:t}=e,n=t.facet(Gd),r=[];for(let i of t.selection.ranges){let s=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(s&&He.ios&&n.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=i.empty?i:Se.cursor(i.head,i.assoc);for(let l of Vc.forRange(e,a,o))r.push(l)}}return r},update(e,t){e.transactions.some(r=>r.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=VR(e);return n&&dT(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){dT(t.state,e)},class:"cm-cursorLayer"});function dT(e,t){t.style.animationDuration=e.facet(Gd).cursorBlinkRate+"ms"}const Ude=FR({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let i of r)if(!i.empty)for(let s of Vc.forRange(e,"cm-selectionBackground",i))t.push(s);if(He.ios&&!n.empty&&e.state.facet(Gd).iosSelectionHandles){for(let i of Vc.forRange(e,"cm-selectionHandle cm-selectionHandle-start",Se.cursor(n.from,1)))t.push(i);for(let i of Vc.forRange(e,"cm-selectionHandle cm-selectionHandle-end",Se.cursor(n.to,1)))t.push(i)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||VR(e)},class:"cm-selectionLayer"}),Hde=yu.highest(tt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function hT(e,t,n,r,i){t.lastIndex=0;for(let s=e.iterRange(n,r),a=n,o;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;o=t.exec(s.value);)i(a+o.index,o)}function qde(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:s}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class Fde{constructor(t){const{regexp:n,decoration:r,decorate:i,boundary:s,maxLength:a=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(o,l,c,u)=>i(u,c,c+o[0].length,o,l);else if(typeof r=="function")this.addMatch=(o,l,c,u)=>{let d=r(o,l,c);d&&u(c,c+o[0].length,d)};else if(r)this.addMatch=(o,l,c,u)=>u(c,c+o[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=a}createDeco(t){let n=new eu,r=n.add.bind(n);for(let{from:i,to:s}of qde(t,this.maxLength))hT(t.state.doc,this.regexp,i,s,(a,o)=>this.addMatch(o,t,a,r));return n.finish()}updateDeco(t,n){let r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges((s,a,o,l)=>{l>=t.view.viewport.from&&o<=t.view.viewport.to&&(r=Math.min(o,r),i=Math.max(l,i))}),t.viewportMoved||i-r>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}updateRange(t,n,r,i){for(let s of t.visibleRanges){let a=Math.max(s.from,r),o=Math.min(s.to,i);if(o>=a){let l=t.state.doc.lineAt(a),c=l.to<o?t.state.doc.lineAt(o):l,u=Math.max(s.from,l.from),d=Math.min(s.to,c.to);if(this.boundary){for(;a>l.from;a--)if(this.boundary.test(l.text[a-1-l.from])){u=a;break}for(;o<c.to;o++)if(this.boundary.test(c.text[o-c.from])){d=o;break}}let f=[],m,p=(b,x,g)=>f.push(g.range(b,x));if(l==c)for(this.regexp.lastIndex=u-l.from;(m=this.regexp.exec(l.text))&&m.index<d-l.from;)this.addMatch(m,t,m.index+l.from,p);else hT(t.state.doc,this.regexp,u,d,(b,x)=>this.addMatch(x,t,b,p));n=n.update({filterFrom:u,filterTo:d,filter:(b,x)=>b<u||x>d,add:f})}}return n}}const G2=/x/.unicode!=null?"gu":"g",Vde=new RegExp(`[\0-\b
--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF￹-￼]`,G2),Gde={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Yv=null;function Wde(){var e;if(Yv==null&&typeof document<"u"&&document.body){let t=document.body.style;Yv=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return Yv||!1}const Pp=ht.define({combine(e){let t=dy(e,{render:null,specialChars:Vde,addSpecialChars:null});return(t.replaceTabs=!Wde())&&(t.specialChars=new RegExp("	|"+t.specialChars.source,G2)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,G2)),t}});function Kde(e={}){return[Pp.of(e),Yde()]}let fT=null;function Yde(){return fT||(fT=gs.fromClass(class{constructor(e){this.view=e,this.decorations=an.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Pp)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Fde({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,s=ol(t[0],0);if(s==9){let a=i.lineAt(r),o=n.state.tabSize,l=V0(a.text,o,r-a.from);return an.replace({widget:new Zde((o-l%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=an.replace({widget:new Jde(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Pp);e.startState.facet(Pp)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const Xde="•";function Qde(e){return e>=32?Xde:e==10?"␤":String.fromCharCode(9216+e)}class Jde extends Fo{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=Qde(this.code),r=t.state.phrase("Control character")+" "+(Gde[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let s=document.createElement("span");return s.textContent=n,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class Zde extends Fo{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="	",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}class ehe extends Fo{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?Rf(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=f0(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function mT(e){let t=gs.fromClass(class{constructor(n){this.view=n,this.placeholder=e?an.set([an.widget({widget:new ehe(e),side:1}).range(0)]):an.none}get decorations(){return this.view.state.doc.length?an.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,tt.contentAttributes.of({"aria-placeholder":e})]:t}const ep="-10000px";class the{constructor(t,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter(a=>a);let s=null;this.tooltipViews=this.tooltips.map(a=>s=r(a,s))}update(t,n){var r;let i=t.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(t);return!1}let a=[],o=n?[]:null;for(let l=0;l<s.length;l++){let c=s[l],u=-1;if(c){for(let d=0;d<this.tooltips.length;d++){let f=this.tooltips[d];f&&f.create==c.create&&(u=d)}if(u<0)a[l]=this.createTooltipView(c,l?a[l-1]:null),o&&(o[l]=!!c.above);else{let d=a[l]=this.tooltipViews[u];o&&(o[l]=n[u]),d.update&&d.update(t)}}}for(let l of this.tooltipViews)a.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(o.forEach((l,c)=>n[c]=l),n.length=o.length),this.input=i,this.tooltips=s,this.tooltipViews=a,!0}}function nhe(e={}){return $p.of(e)}function rhe(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const $p=ht.define({combine:e=>{var t,n,r;return{position:He.ios?"absolute":((t=e.find(i=>i.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=e.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||rhe}}}),pT=new WeakMap,GR=gs.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet($p);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new the(e,WR,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet($p);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=ep,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(e=r.destroy)===null||e===void 0||e.call(r);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(He.safari){let a=s.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=Uk(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,a)=>{let o=this.manager.tooltipViews[a];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet($p).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:s}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let l=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:u}=c,d=e.pos[o],f=e.size[o];if(!d||l.clip!==!1&&(d.bottom<=Math.max(n.top,r.top)||d.top>=Math.min(n.bottom,r.bottom)||d.right<Math.max(n.left,r.left)-.1||d.left>Math.min(n.right,r.right)+.1)){u.style.top=ep;continue}let m=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=m?7:0,b=f.right-f.left,x=(t=pT.get(c))!==null&&t!==void 0?t:f.bottom-f.top,g=c.offset||she,y=this.view.textDirection==$n.LTR,w=f.width>r.right-r.left?y?r.left:r.right-f.width:y?Math.max(r.left,Math.min(d.left-(m?14:0)+g.x,r.right-b)):Math.min(Math.max(r.left,d.left-b+(m?14:0)-g.x),r.right-b),C=this.above[o];!l.strictSide&&(C?d.top-x-p-g.y<r.top:d.bottom+x+p+g.y>r.bottom)&&C==r.bottom-d.bottom>d.top-r.top&&(C=this.above[o]=!C);let E=(C?d.top-r.top:r.bottom-d.bottom)-p;if(E<x&&c.resize!==!1){if(E<this.view.defaultLineHeight){u.style.top=ep;continue}pT.set(c,x),u.style.height=(x=E)/s+"px"}else u.style.height&&(u.style.height="");let S=C?d.top-x-p-g.y:d.bottom+p+g.y,T=w+b;if(c.overlap!==!0)for(let j of a)j.left<T&&j.right>w&&j.top<S+x&&j.bottom>S&&(S=C?j.top-x-2-p:j.bottom+p+2);if(this.position=="absolute"?(u.style.top=(S-e.parent.top)/s+"px",gT(u,(w-e.parent.left)/i)):(u.style.top=S/s+"px",gT(u,w/i)),m){let j=d.left+(y?g.x:-g.x)-(w+14-7);m.style.left=j/i+"px"}c.overlap!==!0&&a.push({left:w,top:S,right:T,bottom:S+x}),u.classList.toggle("cm-tooltip-above",C),u.classList.toggle("cm-tooltip-below",!C),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=ep}},{eventObservers:{scroll(){this.maybeMeasure()}}});function gT(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const ihe=tt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),she={x:0,y:0},WR=ht.define({enables:[GR,ihe]});function KR(e,t){let n=e.plugin(GR);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}class Wd extends Wl{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Wd.prototype.elementClass="";Wd.prototype.toDOM=void 0;Wd.prototype.mapMode=is.TrackBefore;Wd.prototype.startSide=Wd.prototype.endSide=-1;Wd.prototype.point=!0;const ahe=1024;let ohe=0;class Xv{constructor(t,n){this.from=t,this.to=n}}class en{constructor(t={}){this.id=ohe++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Gs.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}en.closedBy=new en({deserialize:e=>e.split(" ")});en.openedBy=new en({deserialize:e=>e.split(" ")});en.group=new en({deserialize:e=>e.split(" ")});en.isolate=new en({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});en.contextHash=new en({perNode:!0});en.lookAhead=new en({perNode:!0});en.mounted=new en({perNode:!0});class Lf{constructor(t,n,r,i=!1){this.tree=t,this.overlay=n,this.parser=r,this.bracketed=i}static get(t){return t&&t.props&&t.props[en.mounted.id]}}const lhe=Object.create(null);class Gs{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):lhe,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new Gs(t.name||"",n,t.id,r);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(en.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(en.group),s=-1;s<(i?i.length:0);s++){let a=n[s<0?r.name:i[s]];if(a)return a}}}}Gs.none=new Gs("",Object.create(null),0,8);const tp=new WeakMap,yT=new WeakMap;var ur;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"})(ur||(ur={}));class ei{constructor(t,n,r,i,s){if(this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,o]of s)this.props[typeof a=="number"?a:a.id]=o}}toString(){let t=Lf.get(this);if(t&&!t.overlay)return t.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(t=0){return new K2(this.topNode,t)}cursorAt(t,n=0,r=0){let i=tp.get(this)||this.topNode,s=new K2(i);return s.moveTo(t,n),tp.set(this,s._tree),s}get topNode(){return new Hs(this,0,0,null)}resolve(t,n=0){let r=g0(tp.get(this)||this.topNode,t,n,!1);return tp.set(this,r),r}resolveInner(t,n=0){let r=g0(yT.get(this)||this.topNode,t,n,!0);return yT.set(this,r),r}resolveStack(t,n=0){return dhe(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:s=this.length}=t,a=t.mode||0,o=(a&ur.IncludeAnonymous)>0;for(let l=this.cursor(a|ur.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!o&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(o||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Wk(Gs.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new ei(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new ei(Gs.none,n,r,i)))}static build(t){return hhe(t)}}ei.empty=new ei(Gs.none,[],[],0);class Vk{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Vk(this.buffer,this.index)}}class Ql{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return Gs.none}toString(){let t=[];for(let n=0;n<this.buffer.length;)t.push(this.childString(n)),n=this.buffer[n+3];return t.join(",")}childString(t){let n=this.buffer[t],r=this.buffer[t+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),t+=4,r==t)return s;let a=[];for(;t<r;)a.push(this.childString(t)),t=this.buffer[t+3];return s+"("+a.join(",")+")"}findChild(t,n,r,i,s){let{buffer:a}=this,o=-1;for(let l=t;l!=n&&!(YR(s,i,a[l+1],a[l+2])&&(o=l,r>0));l=a[l+3]);return o}slice(t,n,r){let i=this.buffer,s=new Uint16Array(n-t),a=0;for(let o=t,l=0;o<n;){s[l++]=i[o++],s[l++]=i[o++]-r;let c=s[l++]=i[o++]-r;s[l++]=i[o++]-t,a=Math.max(a,c)}return new Ql(s,a,this.set)}}function YR(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function g0(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let a=!r&&e instanceof Hs&&e.index<0?null:e.parent;if(!a)return e;e=a}let s=r?0:ur.IgnoreOverlays;if(r)for(let a=e,o=a.parent;o;a=o,o=a.parent)a instanceof Hs&&a.index<0&&((i=o.enter(t,n,s))===null||i===void 0?void 0:i.from)!=a.from&&(e=o);for(;;){let a=e.enter(t,n,s);if(!a)return e;e=a}}class XR{cursor(t=0){return new K2(this,t)}getChild(t,n=null,r=null){let i=bT(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return bT(this,t,n,r)}resolve(t,n=0){return g0(this,t,n,!1)}resolveInner(t,n=0){return g0(this,t,n,!0)}matchContext(t){return W2(this.parent,t)}enterUnfinishedNodesBefore(t){let n=this.childBefore(t),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Hs extends XR{constructor(t,n,r,i){super(),this._tree=t,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,s=0){for(let a=this;;){for(let{children:o,positions:l}=a._tree,c=n>0?o.length:-1;t!=c;t+=n){let u=o[t],d=l[t]+a.from,f;if(!(!(s&ur.EnterBracketed&&u instanceof ei&&(f=Lf.get(u))&&!f.overlay&&f.bracketed&&r>=d&&r<=d+u.length)&&!YR(i,r,d,d+u.length))){if(u instanceof Ql){if(s&ur.ExcludeBuffers)continue;let m=u.findChild(0,u.buffer.length,n,r-d,i);if(m>-1)return new Sl(new che(a,u,t,d),null,m)}else if(s&ur.IncludeAnonymous||!u.type.isAnonymous||Gk(u)){let m;if(!(s&ur.IgnoreMounts)&&(m=Lf.get(u))&&!m.overlay)return new Hs(m.tree,d,t,a);let p=new Hs(u,d,t,a);return s&ur.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,r,i,s)}}}if(s&ur.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?t=a.index+n:t=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&ur.IgnoreOverlays)&&(i=Lf.get(this._tree))&&i.overlay){let s=t-this.from,a=r&ur.EnterBracketed&&i.bracketed;for(let{from:o,to:l}of i.overlay)if((n>0||a?o<=s:o<s)&&(n<0||a?l>=s:l>s))return new Hs(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function bT(e,t,n,r){let i=e.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(t)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function W2(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class che{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class Sl extends XR{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return s<0?null:new Sl(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&ur.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new Sl(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Sl(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Sl(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let a=r.buffer[this.index+1];t.push(r.slice(i,s,a)),n.push(0)}return new ei(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function QR(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;s<e.length;s++){let a=e[s];(a.from>n.from||a.to<n.to)&&(n=a,t=s)}let r=n instanceof Hs&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new uhe(i,n)}class uhe{constructor(t,n){this.heads=t,this.node=n}get next(){return QR(this.heads)}}function dhe(e,t,n){let r=e.resolveInner(t,n),i=null;for(let s=r instanceof Hs?r:r.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(i||(i=[r])).push(a.resolve(t,n)),s=a}else{let a=Lf.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new Hs(a.tree,a.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(g0(o,t,n,!1))}}return i?QR(i):r}class K2{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~ur.EnterBracketed,t instanceof Hs)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof Hs?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&ur.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ur.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&ur.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+t,a=t<0?-1:r._tree.children.length;s!=a;s+=t){let o=r._tree.children[s];if(this.mode&ur.IncludeAnonymous||o instanceof Ql||!o.type.isAnonymous||Gk(o))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,n););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,n=null,r=0;if(t&&t.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let a=t;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new Sl(this.buffer,n,this.stack[i]);return this.bufferNode=new Sl(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(t){if(!this.buffer)return W2(this.node.parent,t);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=t.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return W2(this._tree,t,i);let a=r[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(t[i]&&t[i]!=a.name)return!1;i--}}return!0}}function Gk(e){return e.children.some(t=>t instanceof Ql||!t.type.isAnonymous||Gk(t))}function hhe(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=ahe,reused:s=[],minRepeatType:a=r.types.length}=e,o=Array.isArray(n)?new Vk(n,n.length):n,l=r.types,c=0,u=0;function d(E,S,T,j,z,R){let{id:D,start:N,end:B,size:P}=o,J=u,q=c;if(P<0)if(o.next(),P==-1){let X=s[D];T.push(X),j.push(N-E);return}else if(P==-3){c=D;return}else if(P==-4){u=D;return}else throw new RangeError(`Unrecognized record size: ${P}`);let W=l[D],$,Z,M=N-E;if(B-N<=i&&(Z=x(o.pos-S,z))){let X=new Uint16Array(Z.size-Z.skip),H=o.pos-Z.size,O=X.length;for(;o.pos>H;)O=g(Z.start,X,O);$=new Ql(X,B-Z.start,r),M=Z.start-E}else{let X=o.pos-P;o.next();let H=[],O=[],se=D>=a?D:-1,ke=0,be=B;for(;o.pos>X;)se>=0&&o.id==se&&o.size>=0?(o.end<=be-i&&(p(H,O,N,ke,o.end,be,se,J,q),ke=H.length,be=o.end),o.next()):R>2500?f(N,X,H,O):d(N,X,H,O,se,R+1);if(se>=0&&ke>0&&ke<H.length&&p(H,O,N,ke,N,be,se,J,q),H.reverse(),O.reverse(),se>-1&&ke>0){let Ee=m(W,q);$=Wk(W,H,O,0,H.length,0,B-N,Ee,Ee)}else $=b(W,H,O,B-N,J-B,q)}T.push($),j.push(M)}function f(E,S,T,j){let z=[],R=0,D=-1;for(;o.pos>S;){let{id:N,start:B,end:P,size:J}=o;if(J>4)o.next();else{if(D>-1&&B<D)break;D<0&&(D=P-i),z.push(N,B,P),R++,o.next()}}if(R){let N=new Uint16Array(R*4),B=z[z.length-2];for(let P=z.length-3,J=0;P>=0;P-=3)N[J++]=z[P],N[J++]=z[P+1]-B,N[J++]=z[P+2]-B,N[J++]=J;T.push(new Ql(N,z[2]-B,r)),j.push(B-E)}}function m(E,S){return(T,j,z)=>{let R=0,D=T.length-1,N,B;if(D>=0&&(N=T[D])instanceof ei){if(!D&&N.type==E&&N.length==z)return N;(B=N.prop(en.lookAhead))&&(R=j[D]+N.length+B)}return b(E,T,j,z,R,S)}}function p(E,S,T,j,z,R,D,N,B){let P=[],J=[];for(;E.length>j;)P.push(E.pop()),J.push(S.pop()+T-z);E.push(b(r.types[D],P,J,R-z,N-R,B)),S.push(z-T)}function b(E,S,T,j,z,R,D){if(R){let N=[en.contextHash,R];D=D?[N].concat(D):[N]}if(z>25){let N=[en.lookAhead,z];D=D?[N].concat(D):[N]}return new ei(E,S,T,j,D)}function x(E,S){let T=o.fork(),j=0,z=0,R=0,D=T.end-i,N={size:0,start:0,skip:0};e:for(let B=T.pos-E;T.pos>B;){let P=T.size;if(T.id==S&&P>=0){N.size=j,N.start=z,N.skip=R,R+=4,j+=4,T.next();continue}let J=T.pos-P;if(P<0||J<B||T.start<D)break;let q=T.id>=a?4:0,W=T.start;for(T.next();T.pos>J;){if(T.size<0)if(T.size==-3||T.size==-4)q+=4;else break e;else T.id>=a&&(q+=4);T.next()}z=W,j+=P,R+=q}return(S<0||j==E)&&(N.size=j,N.start=z,N.skip=R),N.size>4?N:void 0}function g(E,S,T){let{id:j,start:z,end:R,size:D}=o;if(o.next(),D>=0&&j<a){let N=T;if(D>4){let B=o.pos-(D-4);for(;o.pos>B;)T=g(E,S,T)}S[--T]=N,S[--T]=R-E,S[--T]=z-E,S[--T]=j}else D==-3?c=j:D==-4&&(u=j);return T}let y=[],w=[];for(;o.pos>0;)d(e.start||0,e.bufferStart||0,y,w,-1,0);let C=(t=e.length)!==null&&t!==void 0?t:y.length?w[0]+y[0].length:0;return new ei(l[e.topID],y.reverse(),w.reverse(),C)}const vT=new WeakMap;function Up(e,t){if(!e.isAnonymous||t instanceof Ql||t.type!=e)return 1;let n=vT.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof ei)){n=1;break}n+=Up(e,r)}vT.set(t,n)}return n}function Wk(e,t,n,r,i,s,a,o,l){let c=0;for(let p=r;p<i;p++)c+=Up(e,t[p]);let u=Math.ceil(c*1.5/8),d=[],f=[];function m(p,b,x,g,y){for(let w=x;w<g;){let C=w,E=b[w],S=Up(e,p[w]);for(w++;w<g;w++){let T=Up(e,p[w]);if(S+T>=u)break;S+=T}if(w==C+1){if(S>u){let T=p[C];m(T.children,T.positions,0,T.children.length,b[C]+y);continue}d.push(p[C])}else{let T=b[w-1]+p[w-1].length-E;d.push(Wk(e,p,b,C,w,E,T,null,l))}f.push(E+y-s)}}return m(t,n,r,i,0),(o||l)(d,f,a)}class Gc{constructor(t,n,r,i,s=!1,a=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new Gc(0,t.length,t,0,!1,r)];for(let s of n)s.to>t.length&&i.push(s);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],s=1,a=t.length?t[0]:null;for(let o=0,l=0,c=0;;o++){let u=o<n.length?n[o]:null,d=u?u.fromA:1e9;if(d-l>=r)for(;a&&a.from<d;){let f=a;if(l>=f.from||d<=f.to||c){let m=Math.max(f.from,l)-c,p=Math.min(f.to,d)-c;f=m>=p?null:new Gc(m,p,f.tree,f.offset+c,o>0,!!u)}if(f&&i.push(f),a.to>d)break;a=s<t.length?t[s++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class fhe{startParse(t,n,r){return typeof t=="string"&&(t=new mhe(t)),r=r?r.length?r.map(i=>new Xv(i.from,i.to)):[new Xv(0,0)]:[new Xv(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let s=i.advance();if(s)return s}}}class mhe{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new en({perNode:!0});let phe=0;class Is{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=phe++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof Is&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Is(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(t){let n=new o1(t);return r=>r.modified.indexOf(n)>-1?r:o1.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let ghe=0;class o1{constructor(t){this.name=t,this.instances=[],this.id=ghe++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(o=>o.base==t&&yhe(n,o.modified));if(r)return r;let i=[],s=new Is(t.name,i,t,n);for(let o of n)o.instances.push(s);let a=bhe(n);for(let o of t.set)if(!o.modified.length)for(let l of a)i.push(o1.get(o,l));return s}}function yhe(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function bhe(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((n,r)=>r.length-n.length)}function vhe(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],a=2,o=i;for(let d=0;;){if(o=="..."&&d>0&&d+3==i.length){a=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!f)throw new RangeError("Invalid path: "+i);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),d+=f[0].length,d==i.length)break;let m=i[d++];if(d==i.length&&m=="!"){a=0;break}if(m!="/")throw new RangeError("Invalid path: "+i);o=i.slice(d)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new y0(r,a,l>0?s.slice(0,l):null);t[c]=u.sort(t[c])}}return JR.add(t)}const JR=new en({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new y0(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class y0{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}y0.empty=new y0([],2,null);function ZR(e,t){let n=Object.create(null);for(let s of e)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let a of s.tag)n[a.id]=s.class;let{scope:r,all:i=null}=t||{};return{style:s=>{let a=i;for(let o of s)for(let l of o.set){let c=n[l.id];if(c){a=a?a+" "+c:c;break}}return a},scope:r}}function xhe(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function whe(e,t,n,r=0,i=e.length){let s=new khe(r,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),r,i,"",s.highlighters),s.flush(i)}class khe{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,s){let{type:a,from:o,to:l}=t;if(o>=r||l<=n)return;a.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(a)));let c=i,u=_he(t)||y0.empty,d=xhe(s,u.tags);if(d&&(c&&(c+=" "),c+=d,u.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(n,o),c),u.opaque)return;let f=t.tree&&t.tree.prop(en.mounted);if(f&&f.overlay){let m=t.node.enter(f.overlay[0].from+o,1),p=this.highlighters.filter(x=>!x.scope||x.scope(f.tree.type)),b=t.firstChild();for(let x=0,g=o;;x++){let y=x<f.overlay.length?f.overlay[x]:null,w=y?y.from+o:l,C=Math.max(n,g),E=Math.min(r,w);if(C<E&&b)for(;t.from<E&&(this.highlightRange(t,C,E,i,s),this.startSpan(Math.min(E,t.to),c),!(t.to>=w||!t.nextSibling())););if(!y||w>r)break;g=y.to+o,g>n&&(this.highlightRange(m.cursor(),Math.max(n,y.from+o),Math.min(r,g),"",p),this.startSpan(Math.min(r,g),c))}b&&t.parent()}else if(t.firstChild()){f&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,s),this.startSpan(Math.min(r,t.to),c)}while(t.nextSibling());t.parent()}}}function _he(e){let t=e.type.prop(JR);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const Le=Is.define,np=Le(),ll=Le(),xT=Le(ll),wT=Le(ll),cl=Le(),rp=Le(cl),Qv=Le(cl),Ta=Le(),yc=Le(Ta),xa=Le(),wa=Le(),Y2=Le(),Uh=Le(Y2),ip=Le(),Be={comment:np,lineComment:Le(np),blockComment:Le(np),docComment:Le(np),name:ll,variableName:Le(ll),typeName:xT,tagName:Le(xT),propertyName:wT,attributeName:Le(wT),className:Le(ll),labelName:Le(ll),namespace:Le(ll),macroName:Le(ll),literal:cl,string:rp,docString:Le(rp),character:Le(rp),attributeValue:Le(rp),number:Qv,integer:Le(Qv),float:Le(Qv),bool:Le(cl),regexp:Le(cl),escape:Le(cl),color:Le(cl),url:Le(cl),keyword:xa,self:Le(xa),null:Le(xa),atom:Le(xa),unit:Le(xa),modifier:Le(xa),operatorKeyword:Le(xa),controlKeyword:Le(xa),definitionKeyword:Le(xa),moduleKeyword:Le(xa),operator:wa,derefOperator:Le(wa),arithmeticOperator:Le(wa),logicOperator:Le(wa),bitwiseOperator:Le(wa),compareOperator:Le(wa),updateOperator:Le(wa),definitionOperator:Le(wa),typeOperator:Le(wa),controlOperator:Le(wa),punctuation:Y2,separator:Le(Y2),bracket:Uh,angleBracket:Le(Uh),squareBracket:Le(Uh),paren:Le(Uh),brace:Le(Uh),content:Ta,heading:yc,heading1:Le(yc),heading2:Le(yc),heading3:Le(yc),heading4:Le(yc),heading5:Le(yc),heading6:Le(yc),contentSeparator:Le(Ta),list:Le(Ta),quote:Le(Ta),emphasis:Le(Ta),strong:Le(Ta),link:Le(Ta),monospace:Le(Ta),strikethrough:Le(Ta),inserted:Le(),deleted:Le(),changed:Le(),invalid:Le(),meta:ip,documentMeta:Le(ip),annotation:Le(ip),processingInstruction:Le(ip),definition:Is.defineModifier("definition"),constant:Is.defineModifier("constant"),function:Is.defineModifier("function"),standard:Is.defineModifier("standard"),local:Is.defineModifier("local"),special:Is.defineModifier("special")};for(let e in Be){let t=Be[e];t instanceof Is&&(t.name=e)}ZR([{tag:Be.link,class:"tok-link"},{tag:Be.heading,class:"tok-heading"},{tag:Be.emphasis,class:"tok-emphasis"},{tag:Be.strong,class:"tok-strong"},{tag:Be.keyword,class:"tok-keyword"},{tag:Be.atom,class:"tok-atom"},{tag:Be.bool,class:"tok-bool"},{tag:Be.url,class:"tok-url"},{tag:Be.labelName,class:"tok-labelName"},{tag:Be.inserted,class:"tok-inserted"},{tag:Be.deleted,class:"tok-deleted"},{tag:Be.literal,class:"tok-literal"},{tag:Be.string,class:"tok-string"},{tag:Be.number,class:"tok-number"},{tag:[Be.regexp,Be.escape,Be.special(Be.string)],class:"tok-string2"},{tag:Be.variableName,class:"tok-variableName"},{tag:Be.local(Be.variableName),class:"tok-variableName tok-local"},{tag:Be.definition(Be.variableName),class:"tok-variableName tok-definition"},{tag:Be.special(Be.variableName),class:"tok-variableName2"},{tag:Be.definition(Be.propertyName),class:"tok-propertyName tok-definition"},{tag:Be.typeName,class:"tok-typeName"},{tag:Be.namespace,class:"tok-namespace"},{tag:Be.className,class:"tok-className"},{tag:Be.macroName,class:"tok-macroName"},{tag:Be.propertyName,class:"tok-propertyName"},{tag:Be.operator,class:"tok-operator"},{tag:Be.comment,class:"tok-comment"},{tag:Be.meta,class:"tok-meta"},{tag:Be.invalid,class:"tok-invalid"},{tag:Be.punctuation,class:"tok-punctuation"}]);var Jv;const rf=new en,She=new en;class La{constructor(t,n,r=[],i=""){this.data=t,this.name=i,mn.prototype.hasOwnProperty("tree")||Object.defineProperty(mn.prototype,"tree",{get(){return aa(this)}}),this.parser=n,this.extension=[Yd.of(this),mn.languageData.of((s,a,o)=>{let l=kT(s,a,o),c=l.type.prop(rf);if(!c)return[];let u=s.facet(c),d=l.type.prop(She);if(d){let f=l.resolve(a-l.from,o);for(let m of d)if(m.test(f,s)){let p=s.facet(m.facet);return m.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(t,n,r=-1){return kT(t,n,r).type.prop(rf)==this.data}findRegions(t){let n=t.facet(Yd);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,a)=>{if(s.prop(rf)==this.data){r.push({from:a,to:a+s.length});return}let o=s.prop(en.mounted);if(o){if(o.tree.prop(rf)==this.data){if(o.overlay)for(let l of o.overlay)r.push({from:l.from+a,to:l.to+a});else r.push({from:a,to:a+s.length});return}else if(o.overlay){let l=r.length;if(i(o.tree,o.overlay[0].from+a),r.length>l)return}}for(let l=0;l<s.children.length;l++){let c=s.children[l];c instanceof ei&&i(c,s.positions[l]+a)}};return i(aa(t),0),r}get allowsNesting(){return!0}}La.setState=_n.define();function kT(e,t,n){let r=e.facet(Yd),i=aa(e).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(t,n,ur.ExcludeBuffers|ur.EnterBracketed))s.type.isTop&&(i=s);return i}function aa(e){let t=e.field(La.state,!1);return t?t.tree:ei.empty}class The{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let r=this.cursorPos-this.string.length;return t<r||n>=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-r,n-r)}}let Hh=null;class l1{constructor(t,n,r=[],i,s,a,o,l){this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=a,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new l1(t,n,[],ei.empty,0,r,[],null)}startParse(){return this.parser.startParse(new The(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=ei.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Gc.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,n;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Gc.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Hh;Hh=this;try{return t()}finally{Hh=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=_T(t,n.from,n.to);return t}changes(t,n){let{fragments:r,tree:i,treeLen:s,viewport:a,skipped:o}=this;if(this.takeTree(),!t.empty){let l=[];if(t.iterChangedRanges((c,u,d,f)=>l.push({fromA:c,toA:u,fromB:d,toB:f})),r=Gc.applyChanges(r,l),i=ei.empty,s=0,a={from:t.mapPos(a.from,-1),to:t.mapPos(a.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let u=t.mapPos(c.from,1),d=t.mapPos(c.to,-1);u<d&&o.push({from:u,to:d})}}}return new l1(this.parser,n,r,i,s,a,o,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<t.to&&s>t.from&&(this.fragments=_T(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends fhe{createParse(n,r,i){let s=i[0].from,a=i[i.length-1].to;return{parsedPos:s,advance(){let l=Hh;if(l){for(let c of i)l.tempSkipped.push(c);t&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,t]):t)}return this.parsedPos=a,new ei(Gs.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return Hh}}function _T(e,t,n){return Gc.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class Kd{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Kd(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=l1.create(t.facet(Yd).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Kd(r)}}La.state=Ya.define({create:Kd.init,update(e,t){for(let n of t.effects)if(n.is(La.setState))return n.value;return t.startState.facet(Yd)!=t.state.facet(Yd)?Kd.init(t.state):e.apply(t)}});let eO=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(eO=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const Zv=typeof navigator<"u"&&(!((Jv=navigator.scheduling)===null||Jv===void 0)&&Jv.isInputPending)?()=>navigator.scheduling.isInputPending():null,Che=gs.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(La.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(La.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=eO(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(La.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,t&&!Zv?Math.max(25,t.timeRemaining()-5):1e9),o=s.context.treeLen<i&&r.doc.length>i+1e3,l=s.context.work(()=>Zv&&Zv()||Date.now()>a,i+(o?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:La.setState.of(new Kd(s.context))})),this.chunkBudget>0&&!(l&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>as(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Yd=ht.define({combine(e){return e.length?e[0]:null},enables:e=>[La.state,Che,tt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),Ehe=ht.define(),Kk=ht.define({combine:e=>{if(!e.length)return"  ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function c1(e){let t=e.facet(Kk);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function u1(e,t){let n="",r=e.tabSize,i=e.facet(Kk)[0];if(i=="	"){for(;t>=r;)n+="	",t-=r;i=" "}for(let s=0;s<t;s++)n+=i;return n}function tO(e,t){e instanceof mn&&(e=new yy(e));for(let r of e.state.facet(Ehe)){let i=r(e,t);if(i!==void 0)return i}let n=aa(e.state);return n.length>=t?Mhe(e,n,t):null}class yy{constructor(t,n={}){this.state=t,this.options=n,this.unit=c1(t)}lineAt(t,n=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==t?{text:"",from:t}:(n<0?i<t:i<=t)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(t,n=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(t,n);return r.slice(t-i,Math.min(r.length,t+100-i))}column(t,n=1){let{text:r,from:i}=this.lineAt(t,n),s=this.countColumn(r,t-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(s+=a-this.countColumn(r,r.search(/\S|$/))),s}countColumn(t,n=t.length){return V0(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:r,from:i}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let a=s(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ahe=new en;function Mhe(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let a=i;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)r={node:s[a],next:r}}return nO(r,e,n)}function nO(e,t,n){for(let r=e;r;r=r.next){let i=Ihe(r.node);if(i)return i(Yk.create(t,n,r))}return 0}function Nhe(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function Ihe(e){let t=e.type.prop(Ahe);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(en.closedBy))){let i=e.lastChild,s=i&&r.indexOf(i.name)>-1;return a=>jhe(a,!0,1,void 0,s&&!Nhe(a)?i.from:void 0)}return e.parent==null?Dhe:null}function Dhe(){return 0}class Yk extends yy{constructor(t,n,r){super(t.state,t.options),this.base=t,this.pos=n,this.context=r}get node(){return this.context.node}static create(t,n,r){return new Yk(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Rhe(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return nO(this.context.next,this.base,this.pos)}}function Rhe(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Ohe(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),a=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let o=n.to;;){let l=t.childAfter(o);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=a)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}o=l.to}}function jhe(e,t,n,r,i){let s=e.textAfter,a=s.match(/^\s*/)[0].length,o=r&&s.slice(a,a+r.length)==r||i==e.pos+a,l=Ohe(e);return l?o?e.column(l.from):e.column(l.to):e.baseIndent+(o?0:e.unit*n)}class by{constructor(t,n){this.specs=t;let r;function i(o){let l=Kl.newName();return(r||(r=Object.create(null)))["."+l]=o,l}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof La?o=>o.prop(rf)==a.data:a?o=>o==a:void 0,this.style=ZR(t.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=r?new Kl(r):null,this.themeType=n.themeType}static define(t,n){return new by(t,n||{})}}const X2=ht.define(),rO=ht.define({combine(e){return e.length?[e[0]]:null}});function e4(e){let t=e.facet(X2);return t.length?t:e.facet(rO)}function Lhe(e,t){let n=[zhe],r;return e instanceof by&&(e.module&&n.push(tt.styleModule.of(e.module)),r=e.themeType),t!=null&&t.fallback?n.push(rO.of(e)):r?n.push(X2.computeN([tt.darkTheme],i=>i.facet(tt.darkTheme)==(r=="dark")?[e]:[])):n.push(X2.of(e)),n}class Bhe{constructor(t){this.markCache=Object.create(null),this.tree=aa(t.state),this.decorations=this.buildDeco(t,e4(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=aa(t.state),r=e4(t.state),i=r!=e4(t.startState),{viewport:s}=t.view,a=t.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!i&&n.type==this.tree.type&&a>=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=a):(n!=this.tree||t.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return an.none;let r=new eu;for(let{from:i,to:s}of t.visibleRanges)whe(this.tree,n,(a,o,l)=>{r.add(a,o,this.markCache[l]||(this.markCache[l]=an.mark({class:l})))},i,s);return r.finish()}}const zhe=yu.high(gs.fromClass(Bhe,{decorations:e=>e.decorations})),Phe=by.define([{tag:Be.meta,color:"#404740"},{tag:Be.link,textDecoration:"underline"},{tag:Be.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Be.emphasis,fontStyle:"italic"},{tag:Be.strong,fontWeight:"bold"},{tag:Be.strikethrough,textDecoration:"line-through"},{tag:Be.keyword,color:"#708"},{tag:[Be.atom,Be.bool,Be.url,Be.contentSeparator,Be.labelName],color:"#219"},{tag:[Be.literal,Be.inserted],color:"#164"},{tag:[Be.string,Be.deleted],color:"#a11"},{tag:[Be.regexp,Be.escape,Be.special(Be.string)],color:"#e40"},{tag:Be.definition(Be.variableName),color:"#00f"},{tag:Be.local(Be.variableName),color:"#30a"},{tag:[Be.typeName,Be.namespace],color:"#085"},{tag:Be.className,color:"#167"},{tag:[Be.special(Be.variableName),Be.macroName],color:"#256"},{tag:Be.definition(Be.propertyName),color:"#00c"},{tag:Be.comment,color:"#940"},{tag:Be.invalid,color:"#f00"}]),$he=1e4,Uhe="()[]{}",Hhe=new en;function Q2(e,t,n){let r=e.prop(t<0?en.openedBy:en.closedBy);if(r)return r;if(e.name.length==1){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function J2(e){let t=e.type.prop(Hhe);return t?t(e.node):e}function sd(e,t,n,r={}){let i=r.maxScanDistance||$he,s=r.brackets||Uhe,a=aa(e),o=a.resolveInner(t,n);for(let l=o;l;l=l.parent){let c=Q2(l.type,n,s);if(c&&l.from<l.to){let u=J2(l);if(u&&(n>0?t>=u.from&&t<u.to:t>u.from&&t<=u.to))return qhe(e,t,n,l,u,c,s)}}return Fhe(e,t,n,a,o.type,i,s)}function qhe(e,t,n,r,i,s,a){let o=r.parent,l={from:i.from,to:i.to},c=0,u=o==null?void 0:o.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let d=J2(u);return{start:l,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(Q2(u.type,n,a))c++;else if(Q2(u.type,-n,a)){if(c==0){let d=J2(u);return{start:l,end:d&&d.from<d.to?{from:d.from,to:d.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function Fhe(e,t,n,r,i,s,a){if(n<0?!t:t==e.doc.length)return null;let o=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=a.indexOf(o);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let f=0;!u.next().done&&f<=s;){let m=u.value;n<0&&(f+=m.length);let p=t+f*n;for(let b=n>0?0:m.length-1,x=n>0?m.length:-1;b!=x;b+=n){let g=a.indexOf(m[b]);if(!(g<0||r.resolveInner(p+b,1).type!=i))if(g%2==0==n>0)d++;else{if(d==1)return{start:c,end:{from:p+b,to:p+b+1},matched:g>>1==l>>1};d--}}n>0&&(f+=m.length)}return u.done?{start:c,matched:!1}:null}const Vhe=Object.create(null),ST=[Gs.none],TT=[],CT=Object.create(null),Ghe=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Ghe[e]=Whe(Vhe,t);function t4(e,t){TT.indexOf(e)>-1||(TT.push(e),console.warn(t))}function Whe(e,t){let n=[];for(let o of t.split(" ")){let l=[];for(let c of o.split(".")){let u=e[c]||Be[c];u?typeof u=="function"?l.length?l=l.map(u):t4(c,`Modifier ${c} used at start of tag`):l.length?t4(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:t4(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(o=>o.id),s=CT[i];if(s)return s.id;let a=CT[i]=Gs.define({id:ST.length,name:r,props:[vhe({[r]:n})]});return ST.push(a),a.id}$n.RTL,$n.LTR;const Khe=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Qk(e.state,n.from);return r.line?Yhe(e):r.block?Qhe(e):!1};function Xk(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}const Yhe=Xk(efe,0),Xhe=Xk(iO,0),Qhe=Xk((e,t)=>iO(e,t,Zhe(t)),0);function Qk(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const qh=50;function Jhe(e,{open:t,close:n},r,i){let s=e.sliceDoc(r-qh,r),a=e.sliceDoc(i,i+qh),o=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(a)[0].length,c=s.length-o;if(s.slice(c-t.length,c)==t&&a.slice(l,l+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:i+l,margin:l&&1}};let u,d;i-r<=2*qh?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+qh),d=e.sliceDoc(i-qh,i));let f=/^\s*/.exec(u)[0].length,m=/\s*$/.exec(d)[0].length,p=d.length-m-n.length;return u.slice(f,f+t.length)==t&&d.slice(p,p+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(u.charAt(f+t.length))?1:0},close:{pos:i-m-n.length,margin:/\s/.test(d.charAt(p-1))?1:0}}:null}function Zhe(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>r.from?t[s].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function iO(e,t,n=t.selection.ranges){let r=n.map(s=>Qk(t,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,a)=>Jhe(t,r[a],s.from,s.to));if(e!=2&&!i.every(s=>s))return{changes:t.changes(n.map((s,a)=>i[a]?[]:[{from:s.from,insert:r[a].open+" "},{from:s.to,insert:" "+r[a].close}]))};if(e!=1&&i.some(s=>s)){let s=[];for(let a=0,o;a<i.length;a++)if(o=i[a]){let l=r[a],{open:c,close:u}=o;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:s}}return null}function efe(e,t,n=t.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:a}of n){let o=r.length,l=1e9,c;for(let u=s;u<=a;){let d=t.doc.lineAt(u);if(c==null&&(c=Qk(t,d.from).line,!c))continue e;if(d.from>i&&(s==a||a>d.from)){i=d.from;let f=/^\s*/.exec(d.text)[0].length,m=f==d.length,p=d.text.slice(f,f+c.length)==c?f:-1;f<d.text.length&&f<l&&(l=f),r.push({line:d,comment:p,token:c,indent:f,empty:m,single:!1})}u=d.to+1}if(l<1e9)for(let u=o;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==o+1&&(r[o].single=!0)}if(e!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:l,indent:c,empty:u,single:d}of r)(d||!u)&&s.push({from:o.from+c,insert:l+" "});let a=t.changes(s);return{changes:a,selection:t.selection.map(a,1)}}else if(e!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:o,token:l}of r)if(o>=0){let c=a.from+o,u=c+l.length;a.text[u-a.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}const Z2=qo.define(),tfe=qo.define(),nfe=ht.define(),sO=ht.define({combine(e){return dy(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,i)=>t(r,i)||n(r,i)})}}),aO=Ya.define({create(){return Ba.empty},update(e,t){let n=t.state.facet(sO),r=t.annotation(Z2);if(r){let l=Ui.fromTransaction(t,r.selection),c=r.side,u=c==0?e.undone:e.done;return l?u=d1(u,u.length,n.minDepth,l):u=uO(u,t.startState.selection),new Ba(c==0?r.rest:u,c==0?u:r.rest)}let i=t.annotation(tfe);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Rr.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Ui.fromTransaction(t),a=t.annotation(Rr.time),o=t.annotation(Rr.userEvent);return s?e=e.addChanges(s,a,o,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,o,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Ba(e.done.map(Ui.fromJSON),e.undone.map(Ui.fromJSON))}});function oO(e={}){return[aO,sO.of(e),tt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?lO:t.inputType=="historyRedo"?ew:null;return r?(t.preventDefault(),r(n)):!1}})]}function vy(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(aO,!1);if(!i)return!1;let s=i.pop(e,n,t);return s?(r(s),!0):!1}}const lO=vy(0,!1),ew=vy(1,!1),rfe=vy(0,!0),ife=vy(1,!0);class Ui{constructor(t,n,r,i,s){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(t){return new Ui(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new Ui(t.changes&&Ir.fromJSON(t.changes),[],t.mapped&&$a.fromJSON(t.mapped),t.startSelection&&Se.fromJSON(t.startSelection),t.selectionsAfter.map(Se.fromJSON))}static fromTransaction(t,n){let r=zs;for(let i of t.startState.facet(nfe)){let s=i(t);s.length&&(r=r.concat(s))}return!r.length&&t.changes.empty?null:new Ui(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,zs)}static selection(t){return new Ui(void 0,zs,void 0,void 0,t)}}function d1(e,t,n,r){let i=t+1>n+20?t-n-1:0,s=e.slice(i,t);return s.push(r),s}function sfe(e,t){let n=[],r=!1;return e.iterChangedRanges((i,s)=>n.push(i,s)),t.iterChangedRanges((i,s,a,o)=>{for(let l=0;l<n.length;){let c=n[l++],u=n[l++];o>=c&&a<=u&&(r=!0)}}),r}function afe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function cO(e,t){return e.length?t.length?e.concat(t):e:t}const zs=[],ofe=200;function uO(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-ofe));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),d1(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Ui.selection([t])]}function lfe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function n4(e,t){if(!e.length)return e;let n=e.length,r=zs;for(;n;){let i=cfe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=e.slice(0,n);return s[n-1]=i,s}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Ui.selection(r)]:zs}function cfe(e,t,n){let r=cO(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):zs,n);if(!e.changes)return Ui.selection(r);let i=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new Ui(i,_n.mapEffects(e.effects,t),a,e.startSelection.map(s),r)}const ufe=/^(input\.type|delete)($|\.)/;class Ba{constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Ba(this.done,this.undone):this}addChanges(t,n,r,i,s){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!r||ufe.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,sfe(o.changes,t.changes))||r=="input.type.compose")?a=d1(a,a.length-1,i.minDepth,new Ui(t.changes.compose(o.changes),cO(_n.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,zs)):a=d1(a,a.length,i.minDepth,t),new Ba(a,zs,n,r)}addSelection(t,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:zs;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&afe(s[s.length-1],t)?this:new Ba(uO(this.done,t),this.undone,n,r)}addMapping(t){return new Ba(n4(this.done,t),n4(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let i=t==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],a=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Z2.of({side:t,rest:lfe(i),selection:a}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=i.length==1?zs:i.slice(0,i.length-1);return s.mapped&&(o=n4(o,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Z2.of({side:t,rest:o,selection:a}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ba.empty=new Ba(zs,zs);const dO=[{key:"Mod-z",run:lO,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ew,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ew,preventDefault:!0},{key:"Mod-u",run:rfe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:ife,preventDefault:!0}];function ph(e,t){return Se.create(e.ranges.map(t),e.mainIndex)}function la(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ca({state:e,dispatch:t},n){let r=ph(e.selection,n);return r.eq(e.selection,!0)?!1:(t(la(e,r)),!0)}function xy(e,t){return Se.cursor(t?e.to:e.from)}function hO(e,t){return ca(e,n=>n.empty?e.moveByChar(n,t):xy(n,t))}function di(e){return e.textDirectionAt(e.state.selection.main.head)==$n.LTR}const fO=e=>hO(e,!di(e)),mO=e=>hO(e,di(e));function pO(e,t){return ca(e,n=>n.empty?e.moveByGroup(n,t):xy(n,t))}const dfe=e=>pO(e,!di(e)),hfe=e=>pO(e,di(e));function ffe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function wy(e,t,n){let r=aa(e).resolveInner(t.head),i=n?en.closedBy:en.openedBy;for(let l=t.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;ffe(e,c,i)?r=c:l=n?c.to:c.from}let s=r.type.prop(i),a,o;return s&&(a=n?sd(e,r.from,1):sd(e,r.to,-1))&&a.matched?o=n?a.end.to:a.end.from:o=n?r.to:r.from,Se.cursor(o,n?-1:1)}const mfe=e=>ca(e,t=>wy(e.state,t,!di(e))),pfe=e=>ca(e,t=>wy(e.state,t,di(e)));function gO(e,t){return ca(e,n=>{if(!n.empty)return xy(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const yO=e=>gO(e,!1),bO=e=>gO(e,!0);function vO(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let s of e.state.facet(tt.scrollMargins)){let a=s(e);a!=null&&a.top&&(n=Math.max(a==null?void 0:a.top,n)),a!=null&&a.bottom&&(r=Math.max(a==null?void 0:a.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function xO(e,t){let n=vO(e),{state:r}=e,i=ph(r.selection,a=>a.empty?e.moveVertically(a,t,n.height):xy(a,t));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let a=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),l=o.top+n.marginTop,c=o.bottom-n.marginBottom;a&&a.top>l&&a.bottom<c&&(s=tt.scrollIntoView(i.main.head,{y:"start",yMargin:a.top-l}))}return e.dispatch(la(r,i),{effects:s}),!0}const ET=e=>xO(e,!1),tw=e=>xO(e,!0);function ic(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&t.head!=r.from+s&&(i=Se.cursor(r.from+s))}return i}const gfe=e=>ca(e,t=>ic(e,t,!0)),yfe=e=>ca(e,t=>ic(e,t,!1)),bfe=e=>ca(e,t=>ic(e,t,!di(e))),vfe=e=>ca(e,t=>ic(e,t,di(e))),xfe=e=>ca(e,t=>Se.cursor(e.lineBlockAt(t.head).from,1)),wfe=e=>ca(e,t=>Se.cursor(e.lineBlockAt(t.head).to,-1));function kfe(e,t,n){let r=!1,i=ph(e.selection,s=>{let a=sd(e,s.head,-1)||sd(e,s.head,1)||s.head>0&&sd(e,s.head-1,1)||s.head<e.doc.length&&sd(e,s.head+1,-1);if(!a||!a.end)return s;r=!0;let o=a.start.from==s.head?a.end.to:a.end.from;return Se.cursor(o)});return r?(t(la(e,i)),!0):!1}const _fe=({state:e,dispatch:t})=>kfe(e,t);function Ws(e,t){let n=ph(e.state.selection,r=>{let i=t(r);return Se.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(la(e.state,n)),!0)}function wO(e,t){return Ws(e,n=>e.moveByChar(n,t))}const kO=e=>wO(e,!di(e)),_O=e=>wO(e,di(e));function SO(e,t){return Ws(e,n=>e.moveByGroup(n,t))}const Sfe=e=>SO(e,!di(e)),Tfe=e=>SO(e,di(e)),Cfe=e=>Ws(e,t=>wy(e.state,t,!di(e))),Efe=e=>Ws(e,t=>wy(e.state,t,di(e)));function TO(e,t){return Ws(e,n=>e.moveVertically(n,t))}const CO=e=>TO(e,!1),EO=e=>TO(e,!0);function AO(e,t){return Ws(e,n=>e.moveVertically(n,t,vO(e).height))}const AT=e=>AO(e,!1),MT=e=>AO(e,!0),Afe=e=>Ws(e,t=>ic(e,t,!0)),Mfe=e=>Ws(e,t=>ic(e,t,!1)),Nfe=e=>Ws(e,t=>ic(e,t,!di(e))),Ife=e=>Ws(e,t=>ic(e,t,di(e))),Dfe=e=>Ws(e,t=>Se.cursor(e.lineBlockAt(t.head).from)),Rfe=e=>Ws(e,t=>Se.cursor(e.lineBlockAt(t.head).to)),NT=({state:e,dispatch:t})=>(t(la(e,{anchor:0})),!0),IT=({state:e,dispatch:t})=>(t(la(e,{anchor:e.doc.length})),!0),DT=({state:e,dispatch:t})=>(t(la(e,{anchor:e.selection.main.anchor,head:0})),!0),RT=({state:e,dispatch:t})=>(t(la(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Ofe=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),jfe=({state:e,dispatch:t})=>{let n=ky(e).map(({from:r,to:i})=>Se.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:Se.create(n),userEvent:"select"})),!0},Lfe=({state:e,dispatch:t})=>{let n=ph(e.selection,r=>{let i=aa(e),s=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:o}=a;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return Se.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(la(e,n)),!0)};function MO(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(t?a.to<e.state.doc.length:a.from>0)for(let o=s;;){let l=e.moveVertically(o,t);if(l.head<a.from||l.head>a.to){i.some(c=>c.head==l.head)||i.push(l);break}else{if(l.head==o.head)break;o=l}}}return i.length==r.ranges.length?!1:(e.dispatch(la(n,Se.create(i,i.length-1))),!0)}const Bfe=e=>MO(e,!1),zfe=e=>MO(e,!0),Pfe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Se.create([n.main]):n.main.empty||(r=Se.create([Se.cursor(n.main.head)])),r?(t(la(e,r)),!0):!1};function Y0(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(s=>{let{from:a,to:o}=s;if(a==o){let l=t(s);l<a?(n="delete.backward",l=sp(e,l,!1)):l>a&&(n="delete.forward",l=sp(e,l,!0)),a=Math.min(a,l),o=Math.max(o,l)}else a=sp(e,a,!1),o=sp(e,o,!0);return a==o?{range:s}:{changes:{from:a,to:o},range:Se.cursor(a,a<s.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?tt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function sp(e,t,n){if(e instanceof tt)for(let r of e.state.facet(tt.atomicRanges).map(i=>i(e)))r.between(t,t,(i,s)=>{i<t&&s>t&&(t=n?s:i)});return t}const NO=(e,t,n)=>Y0(e,r=>{let i=r.from,{state:s}=e,a=s.doc.lineAt(i),o,l;if(n&&!t&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(o=a.text.slice(0,i-a.from))){if(o[o.length-1]=="	")return i-1;let c=V0(o,s.tabSize),u=c%c1(s)||c1(s);for(let d=0;d<u&&o[o.length-1-d]==" ";d++)i--;l=i}else l=oi(a.text,i-a.from,t,t)+a.from,l==i&&a.number!=(t?s.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(a.text.slice(l-a.from,i-a.from))&&(l=oi(a.text,l-a.from,!1,!1)+a.from);return l}),nw=e=>NO(e,!1,!0),IO=e=>NO(e,!0,!1),DO=(e,t)=>Y0(e,n=>{let r=n.head,{state:i}=e,s=i.doc.lineAt(r),a=i.charCategorizer(r);for(let o=null;;){if(r==(t?s.to:s.from)){r==n.head&&s.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let l=oi(s.text,r-s.from,t)+s.from,c=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),u=a(c);if(o!=null&&u!=o)break;(c!=" "||r!=n.head)&&(o=u),r=l}return r}),RO=e=>DO(e,!1),$fe=e=>DO(e,!0),Ufe=e=>Y0(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Hfe=e=>Y0(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),qfe=e=>Y0(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Ffe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:nn.of(["",""])},range:Se.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Vfe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,s=e.doc.lineAt(i),a=i==s.from?i-1:oi(s.text,i-s.from,!1)+s.from,o=i==s.to?i+1:oi(s.text,i-s.from,!0)+s.from;return{changes:{from:a,to:o,insert:e.doc.slice(i,o).append(e.doc.slice(a,i))},range:Se.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ky(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=e.doc.lineAt(r.to-1)),n>=i.number){let a=t[t.length-1];a.to=s.to,a.ranges.push(r)}else t.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return t}function OO(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let s of ky(e)){if(n?s.to==e.doc.length:s.from==0)continue;let a=e.doc.lineAt(n?s.to+1:s.from-1),o=a.length+1;if(n){r.push({from:s.to,to:a.to},{from:s.from,insert:a.text+e.lineBreak});for(let l of s.ranges)i.push(Se.range(Math.min(e.doc.length,l.anchor+o),Math.min(e.doc.length,l.head+o)))}else{r.push({from:a.from,to:s.from},{from:s.to,insert:e.lineBreak+a.text});for(let l of s.ranges)i.push(Se.range(l.anchor-o,l.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Se.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Gfe=({state:e,dispatch:t})=>OO(e,t,!1),Wfe=({state:e,dispatch:t})=>OO(e,t,!0);function jO(e,t,n){if(e.readOnly)return!1;let r=[];for(let s of ky(e))n?r.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):r.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Kfe=({state:e,dispatch:t})=>jO(e,t,!1),Yfe=({state:e,dispatch:t})=>jO(e,t,!0),Xfe=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ky(t).map(({from:i,to:s})=>(i>0?i--:s<t.doc.length&&s++,{from:i,to:s}))),r=ph(t.selection,i=>{let s;if(e.lineWrapping){let a=e.lineBlockAt(i.head),o=e.coordsAtPos(i.head,i.assoc||1);o&&(s=a.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(i,!0,s)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Qfe(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=aa(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),s;return r&&i&&r.to<=t&&i.from>=t&&(s=r.type.prop(en.closedBy))&&s.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const OT=LO(!1),Jfe=LO(!0);function LO(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:s,to:a}=i,o=t.doc.lineAt(s),l=!e&&s==a&&Qfe(t,s);e&&(s=a=(a<=o.to?o:t.doc.lineAt(a)).to);let c=new yy(t,{simulateBreak:s,simulateDoubleBreak:!!l}),u=tO(c,s);for(u==null&&(u=V0(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));a<o.to&&/\s/.test(o.text[a-o.from]);)a++;l?{from:s,to:a}=l:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let d=["",u1(t,u)];return l&&d.push(u1(t,c.lineIndent(o.from,-1))),{changes:{from:s,to:a,insert:nn.of(d)},range:Se.cursor(s+1+d[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Jk(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let s=e.changes(i);return{changes:i,range:Se.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const Zfe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new yy(e,{overrideIndentation:s=>{let a=n[s];return a??-1}}),i=Jk(e,(s,a,o)=>{let l=tO(r,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let c=/^\s*/.exec(s.text)[0],u=u1(e,l);(c!=u||o.from<s.from+c.length)&&(n[s.from]=l,a.push({from:s.from,to:s.from+c.length,insert:u}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0},e0e=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Jk(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Kk)})}),{userEvent:"input.indent"})),!0),t0e=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Jk(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=V0(i,e.tabSize),a=0,o=u1(e,Math.max(0,s-c1(e)));for(;a<i.length&&a<o.length&&i.charCodeAt(a)==o.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+i.length,insert:o.slice(a)})}),{userEvent:"delete.dedent"})),!0),n0e=e=>(e.setTabFocusMode(),!0),r0e=[{key:"Ctrl-b",run:fO,shift:kO,preventDefault:!0},{key:"Ctrl-f",run:mO,shift:_O},{key:"Ctrl-p",run:yO,shift:CO},{key:"Ctrl-n",run:bO,shift:EO},{key:"Ctrl-a",run:xfe,shift:Dfe},{key:"Ctrl-e",run:wfe,shift:Rfe},{key:"Ctrl-d",run:IO},{key:"Ctrl-h",run:nw},{key:"Ctrl-k",run:Ufe},{key:"Ctrl-Alt-h",run:RO},{key:"Ctrl-o",run:Ffe},{key:"Ctrl-t",run:Vfe},{key:"Ctrl-v",run:tw}],i0e=[{key:"ArrowLeft",run:fO,shift:kO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:dfe,shift:Sfe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:bfe,shift:Nfe,preventDefault:!0},{key:"ArrowRight",run:mO,shift:_O,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:hfe,shift:Tfe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:vfe,shift:Ife,preventDefault:!0},{key:"ArrowUp",run:yO,shift:CO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:NT,shift:DT},{mac:"Ctrl-ArrowUp",run:ET,shift:AT},{key:"ArrowDown",run:bO,shift:EO,preventDefault:!0},{mac:"Cmd-ArrowDown",run:IT,shift:RT},{mac:"Ctrl-ArrowDown",run:tw,shift:MT},{key:"PageUp",run:ET,shift:AT},{key:"PageDown",run:tw,shift:MT},{key:"Home",run:yfe,shift:Mfe,preventDefault:!0},{key:"Mod-Home",run:NT,shift:DT},{key:"End",run:gfe,shift:Afe,preventDefault:!0},{key:"Mod-End",run:IT,shift:RT},{key:"Enter",run:OT,shift:OT},{key:"Mod-a",run:Ofe},{key:"Backspace",run:nw,shift:nw,preventDefault:!0},{key:"Delete",run:IO,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:RO,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:$fe,preventDefault:!0},{mac:"Mod-Backspace",run:Hfe,preventDefault:!0},{mac:"Mod-Delete",run:qfe,preventDefault:!0}].concat(r0e.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),BO=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:mfe,shift:Cfe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:pfe,shift:Efe},{key:"Alt-ArrowUp",run:Gfe},{key:"Shift-Alt-ArrowUp",run:Kfe},{key:"Alt-ArrowDown",run:Wfe},{key:"Shift-Alt-ArrowDown",run:Yfe},{key:"Mod-Alt-ArrowUp",run:Bfe},{key:"Mod-Alt-ArrowDown",run:zfe},{key:"Escape",run:Pfe},{key:"Mod-Enter",run:Jfe},{key:"Alt-l",mac:"Ctrl-l",run:jfe},{key:"Mod-i",run:Lfe,preventDefault:!0},{key:"Mod-[",run:t0e},{key:"Mod-]",run:e0e},{key:"Mod-Alt-\\",run:Zfe},{key:"Shift-Mod-k",run:Xfe},{key:"Shift-Mod-\\",run:_fe},{key:"Mod-/",run:Khe},{key:"Alt-A",run:Xhe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:n0e}].concat(i0e);class zO{constructor(t,n,r,i){this.state=t,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=aa(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search(PO(t,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,r){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function jT(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function s0e(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let s=1;s<i.length;s++)n[i[s]]=!0}let r=jT(t)+jT(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function a0e(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:s0e(t);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:t,validFor:n}:null}}class LT{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function Wc(e){return e.selection.main.from}function PO(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?e:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const $O=qo.define();function o0e(e,t,n,r){let{main:i}=e.selection,s=n-i.from,a=r-i.from;return{...e.changeByRange(o=>{if(o!=i&&n!=r&&e.sliceDoc(o.from+s,o.from+a)!=e.sliceDoc(n,r))return{range:o};let l=e.toText(t);return{changes:{from:o.from+s,to:r==i.from?o.to:o.from+a,insert:l},range:Se.cursor(o.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const BT=new WeakMap;function l0e(e){if(!Array.isArray(e))return e;let t=BT.get(e);return t||BT.set(e,t=a0e(e)),t}const h1=_n.define(),b0=_n.define();class c0e{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<t.length;){let r=ol(t,n),i=Uu(r);this.chars.push(r);let s=t.slice(n,n+i),a=s.toUpperCase();this.folded.push(ol(a==s?s.toLowerCase():a,0)),n+=i}this.astral=t.length!=this.chars.length}ret(t,n){return this.score=t,this.matched=n,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:s,byWord:a}=this;if(n.length==1){let y=ol(t,0),w=Uu(y),C=w==t.length?0:-100;if(y!=n[0])if(y==r[0])C+=-200;else return null;return this.ret(C,[0,w])}let o=t.indexOf(this.pattern);if(o==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,c=0;if(o<0){for(let y=0,w=Math.min(t.length,200);y<w&&c<l;){let C=ol(t,y);(C==n[c]||C==r[c])&&(i[c++]=y),y+=Uu(C)}if(c<l)return null}let u=0,d=0,f=!1,m=0,p=-1,b=-1,x=/[a-z]/.test(t),g=!0;for(let y=0,w=Math.min(t.length,200),C=0;y<w&&d<l;){let E=ol(t,y);o<0&&(u<l&&E==n[u]&&(s[u++]=y),m<l&&(E==n[m]||E==r[m]?(m==0&&(p=y),b=y+1,m++):m=0));let S,T=E<255?E>=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(S=Dce(E))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!y||T==1&&x||C==0&&T!=0)&&(n[d]==E||r[d]==E&&(f=!0)?a[d++]=y:a.length&&(g=!1)),C=T,y+=Uu(E)}return d==l&&a[0]==0&&g?this.result(-100+(f?-200:0),a,t):m==l&&p==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):o>-1?this.ret(-700-t.length,[o,o+this.pattern.length]):m==l?this.ret(-900-t.length,[p,b]):d==l?this.result(-100+(f?-200:0)+-700+(g?0:-1100),a,t):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,t)}result(t,n,r){let i=[],s=0;for(let a of n){let o=a+(this.astral?Uu(ol(r,a)):1);s&&i[s-1]==a?i[s-1]=o:(i[s++]=a,i[s++]=o)}return this.ret(t-r.length,i)}}class u0e{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let n=t.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(t.length==this.pattern.length?0:-100),this)}}const Hr=ht.define({combine(e){return dy(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:d0e,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>r=>zT(t(r),n(r)),optionClass:(t,n)=>r=>zT(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function zT(e,t){return e?t?e+" "+t:e:t}function d0e(e,t,n,r,i,s){let a=e.textDirection==$n.RTL,o=a,l=!1,c="top",u,d,f=t.left-i.left,m=i.right-t.right,p=r.right-r.left,b=r.bottom-r.top;if(o&&f<Math.min(p,m)?o=!1:!o&&m<Math.min(p,f)&&(o=!0),p<=(o?f:m))u=Math.max(i.top,Math.min(n.top,i.bottom-b))-t.top,d=Math.min(400,o?f:m);else{l=!0,d=Math.min(400,(a?t.right:i.right-t.left)-30);let y=i.bottom-t.bottom;y>=b||y>t.top?u=n.bottom-t.top:(c="bottom",u=t.bottom-n.top)}let x=(t.bottom-t.top)/s.offsetHeight,g=(t.right-t.left)/s.offsetWidth;return{style:`${c}: ${u/x}px; max-width: ${d/g}px`,class:"cm-completionInfo-"+(l?a?"left-narrow":"right-narrow":o?"left":"right")}}const Zk=_n.define();function h0e(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,s){let a=document.createElement("span");a.className="cm-completionLabel";let o=n.displayLabel||n.label,l=0;for(let c=0;c<s.length;){let u=s[c++],d=s[c++];u>l&&a.appendChild(document.createTextNode(o.slice(l,u)));let f=a.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(u,d))),f.className="cm-completionMatchedText",l=d}return l<o.length&&a.appendChild(document.createTextNode(o.slice(l))),a},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),t.sort((n,r)=>n.position-r.position).map(n=>n.render)}function r4(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}class f0e{constructor(t,n,r){this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=t.state.field(n),{options:s,selected:a}=i.open,o=t.state.facet(Hr);this.optionContent=h0e(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=r4(s.length,a,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=t.state.field(n).open;for(let u=l.target,d;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(d=/-(\d+)$/.exec(u.id))&&+d[1]<c.length){this.applyCompletion(t,c[+d[1]]),l.preventDefault();return}if(l.target==this.list){let u=this.list.classList.contains("cm-completionListIncompleteTop")&&l.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&l.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;u!=null&&(t.dispatch({effects:Zk.of(u)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(Hr).closeOnBlur&&l.relatedTarget!=t.contentDOM&&t.dispatch({effects:b0.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let r=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),r!=i){let{options:s,selected:a,disabled:o}=r.open;(!i.open||i.open.options!=s)&&(this.range=r4(s.length,a,t.state.facet(Hr).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),o!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=r4(n.options.length,n.selected,this.view.state.facet(Hr).maxRenderedOptions),this.showOptions(n.options,t.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:s}=i;if(!s)return;let a=typeof s=="string"?document.createTextNode(s):s(i);if(!a)return;"then"in a?a.then(o=>{o&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(o,i)}).catch(o=>as(this.view.state,o,"completion info")):(this.addInfoPane(a,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)r.appendChild(t),this.infoDestroy=null;else{let{dom:i,destroy:s}=t;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==t?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&p0e(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),s=this.space;if(!s){let a=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return i.top>Math.min(s.bottom,n.bottom)-10||i.bottom<Math.max(s.top,n.top)+10?null:this.view.state.facet(Hr).positionInfo(this.view,n,i,r,s,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",a=>{a.target==i&&a.preventDefault()});let s=null;for(let a=r.from;a<r.to;a++){let{completion:o,match:l}=t[a],{section:c}=o;if(c){let f=typeof c=="string"?c:c.name;if(f!=s&&(a>r.from||r.from==0))if(s=f,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let m=i.appendChild(document.createElement("completion-section"));m.textContent=f}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+a,u.setAttribute("role","option");let d=this.optionClass(o);d&&(u.className=d);for(let f of this.optionContent){let m=f(o,this.view.state,this.view,l);m&&u.appendChild(m)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function m0e(e,t){return n=>new f0e(n,e,t)}function p0e(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function PT(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function g0e(e,t){let n=[],r=null,i=null,s=u=>{n.push(u);let{section:d}=u.completion;if(d){r||(r=[]);let f=typeof d=="string"?d:d.name;r.some(m=>m.name==f)||r.push(typeof d=="string"?{name:f}:d)}},a=t.facet(Hr);for(let u of e)if(u.hasResult()){let d=u.result.getMatch;if(u.result.filter===!1)for(let f of u.result.options)s(new LT(f,u.source,d?d(f):[],1e9-n.length));else{let f=t.sliceDoc(u.from,u.to),m,p=a.filterStrict?new u0e(f):new c0e(f);for(let b of u.result.options)if(m=p.match(b.label)){let x=b.displayLabel?d?d(b,m.matched):[]:m.matched,g=m.score+(b.boost||0);if(s(new LT(b,u.source,x,g)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:y}=b.section;i||(i=Object.create(null)),i[y]=Math.max(g,i[y]||-1e9)}}}}if(r){let u=Object.create(null),d=0,f=(m,p)=>(m.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(m.name<p.name?-1:1);for(let m of r.sort(f))d-=1e5,u[m.name]=d;for(let m of n){let{section:p}=m.completion;p&&(m.score+=u[typeof p=="string"?p:p.name])}}let o=[],l=null,c=a.compareCompletions;for(let u of n.sort((d,f)=>f.score-d.score||c(d.completion,f.completion))){let d=u.completion;!l||l.label!=d.label||l.detail!=d.detail||l.type!=null&&d.type!=null&&l.type!=d.type||l.apply!=d.apply||l.boost!=d.boost?o.push(u):PT(u.completion)>PT(l)&&(o[o.length-1]=u),l=u.completion}return o}class ad{constructor(t,n,r,i,s,a){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new ad(this.options,$T(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,s,a){if(i&&!a&&t.some(c=>c.isPending))return i.setDisabled();let o=g0e(t,n);if(!o.length)return i&&t.some(c=>c.isPending)?i.setDisabled():null;let l=n.facet(Hr).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let u=0;u<o.length;u++)if(o[u].completion==c){l=u;break}}return new ad(o,$T(r,l),{pos:t.reduce((c,u)=>u.hasResult()?Math.min(c,u.from):c,1e8),create:k0e,above:s.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(t){return new ad(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new ad(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class f1{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new f1(x0e,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Hr),s=(r.override||n.languageDataAt("autocomplete",Wc(n)).map(l0e)).map(l=>(this.active.find(u=>u.source==l)||new Ps(l,this.active.some(u=>u.state!=0)?1:0)).update(t,r));s.length==this.active.length&&s.every((l,c)=>l==this.active[c])&&(s=this.active);let a=this.open,o=t.effects.some(l=>l.is(e5));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||s.some(l=>l.hasResult()&&t.changes.touchesRange(l.from,l.to))||!y0e(s,this.active)||o?a=ad.build(s,n,this.id,a,r,o):a&&a.disabled&&!s.some(l=>l.isPending)&&(a=null),!a&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new Ps(l.source,0):l));for(let l of t.effects)l.is(Zk)&&(a=a&&a.setSelected(l.value,this.id));return s==this.active&&a==this.open?this:new f1(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?b0e:v0e}}function y0e(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,s=r==t.length;if(i||s)return i==s;if(e[n++].result!=t[r++].result)return!1}}const b0e={"aria-autocomplete":"list"},v0e={};function $T(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const x0e=[];function UO(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation($O);if(r&&t.activateOnCompletion(r))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Ps{constructor(t,n,r=!1){this.source=t,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=UO(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Ps(i.source,0)),r&4&&i.state==0&&(i=new Ps(this.source,1)),i=i.updateFor(t,r);for(let s of t.effects)if(s.is(h1))i=new Ps(i.source,1,s.value);else if(s.is(b0))i=new Ps(i.source,0);else if(s.is(e5))for(let a of s.value)a.source==i.source&&(i=a);return i}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Wc(t.state))}}class kd extends Ps{constructor(t,n,r,i,s,a){super(t,3,n),this.limit=r,this.result=i,this.from=s,this.to=a}hasResult(){return!0}updateFor(t,n){var r;if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let s=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=Wc(t.state);if(o>a||!i||n&2&&(Wc(t.startState)==this.from||o<this.limit))return new Ps(this.source,n&4?1:0);let l=t.changes.mapPos(this.limit);return w0e(i.validFor,t.state,s,a)?new kd(this.source,this.explicit,l,i,s,a):i.update&&(i=i.update(i,s,a,new zO(t.state,o,!1)))?new kd(this.source,this.explicit,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Wc(t.state)):new Ps(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new kd(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new Ps(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function w0e(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):PO(e,!0).test(i)}const e5=_n.define({map(e,t){return e.map(n=>n.map(t))}}),_i=Ya.define({create(){return f1.start()},update(e,t){return e.update(t)},provide:e=>[WR.from(e,t=>t.tooltip),tt.contentAttributes.from(e,t=>t.attrs)]});function t5(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(_i).active.find(i=>i.source==t.source);return r instanceof kd?(typeof n=="string"?e.dispatch({...o0e(e.state,n,r.from,r.to),annotations:$O.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const k0e=m0e(_i,t5);function Tl(e,t="option"){return n=>{let r=n.state.field(_i,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Hr).interactionDelay)return!1;let i=1,s;t=="page"&&(s=KR(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,o=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:a-1;return o<0?o=t=="page"?0:a-1:o>=a&&(o=t=="page"?a-1:0),n.dispatch({effects:Zk.of(o)}),!0}}const HO=e=>{let t=e.state.field(_i,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Hr).interactionDelay?!1:t5(e,t.open.options[t.open.selected])},Lc=e=>e.state.field(_i,!1)?(e.dispatch({effects:h1.of(!0)}),!0):!1,Hp=e=>{let t=e.state.field(_i,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:b0.of(null)}),!0)};class _0e{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const S0e=50,T0e=1e3,C0e=gs.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(_i).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(_i),n=e.state.facet(Hr);if(!e.selectionSet&&!e.docChanged&&e.startState.field(_i)==t)return;let r=e.transactions.some(s=>{let a=UO(s,n);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;s<this.running.length;s++){let a=this.running[s];if(r||a.context.abortOnDocChange&&e.docChanged||a.updates.length+e.transactions.length>S0e&&Date.now()-a.time>T0e){for(let o of a.context.abortListeners)try{o()}catch(l){as(this.view.state,l)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(a=>a.is(h1)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(a=>a.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(_i);for(let n of t.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Hr).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Wc(t),r=new zO(t,n,e.explicit,this.view),i=new _0e(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:b0.of(null)}),as(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Hr).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Hr),r=this.view.state.field(_i);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let o=Wc(s.updates.length?s.updates[0].startState:this.view.state),l=Math.min(o,s.done.from+(s.active.explicit?0:1)),c=new kd(s.active.source,s.active.explicit,l,s.done,s.done.from,(e=s.done.to)!==null&&e!==void 0?e:o);for(let u of s.updates)c=c.update(u,n);if(c.hasResult()){t.push(c);continue}}let a=r.active.find(o=>o.source==s.active.source);if(a&&a.isPending)if(s.done==null){let o=new Ps(s.active.source,0);for(let l of s.updates)o=o.update(l,n);o.isPending||t.push(o)}else this.startQuery(a)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:e5.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(_i,!1);if(t&&t.tooltip&&this.view.state.facet(Hr).closeOnBlur){let n=t.open&&KR(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:b0.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:h1.of(!1)}),20),this.composing=0}}}),E0e=typeof navigator=="object"&&/Win/.test(navigator.platform),A0e=yu.highest(tt.domEventHandlers({keydown(e,t){let n=t.state.field(_i,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(E0e&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(a=>a.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&t5(t,r),!1}})),M0e=tt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),qO=new class extends Wl{};qO.startSide=1;qO.endSide=-1;function N0e(e={}){return[A0e,_i,Hr.of(e),C0e,D0e,M0e]}const I0e=[{key:"Ctrl-Space",run:Lc},{mac:"Alt-`",run:Lc},{mac:"Alt-i",run:Lc},{key:"Escape",run:Hp},{key:"ArrowDown",run:Tl(!0)},{key:"ArrowUp",run:Tl(!1)},{key:"PageDown",run:Tl(!0,"page")},{key:"PageUp",run:Tl(!1,"page")},{key:"Enter",run:HO}],D0e=yu.highest(p0.computeN([Hr],e=>e.facet(Hr).defaultKeymap?[I0e]:[]));function Ri(e){let t=e.field(_i,!1);return t&&t.active.some(n=>n.isPending)?"pending":t&&t.active.some(n=>n.state!=0)?"active":null}const R0e=[Kde(),oO(),Pde(),Lhe(Phe,{fallback:!0}),p0.of([...BO,...dO])],v0=["custom","skill","system"];function m1(e){return e.displayCategory?e.displayCategory:e.source==="builtin-command"?"system":e.source==="bundled-skill"||e.source==="skill"?"skill":"custom"}function O0e(e,t,n=v0){return rw(m1(e),n)-rw(m1(t),n)}function rw(e,t=v0){const n=t.indexOf(e);return n>=0?n:t.length+v0.indexOf(e)}const n5=String.raw`([^\s/]+)`,_y={agents:[{name:"manage",description:"管理现有 subagents"},{name:"create",description:"创建新的 subagent"}],theme:[{name:"light",description:"切换到浅色主题"},{name:"dark",description:"切换到深色主题"}],export:[{name:"md",description:"将会话导出为 Markdown 文件"},{name:"html",description:"将会话导出为 HTML 文件"},{name:"json",description:"将会话导出为 JSON 文件"},{name:"jsonl",description:"将会话导出为 JSONL 文件（每行一条消息）"}],language:[{name:"ui",description:"设置 UI 语言",children:[{name:"en",description:"English"},{name:"zh-CN",description:"中文"}]},{name:"output",description:"设置 LLM 输出语言"}],extensions:[{name:"manage",description:"管理扩展"},{name:"install",description:"安装扩展"}]},Sy={agents:[{name:"manage",description:"Manage existing subagents"},{name:"create",description:"Create a new subagent"}],theme:[{name:"light",description:"Switch to light theme"},{name:"dark",description:"Switch to dark theme"}],export:[{name:"md",description:"Export as Markdown"},{name:"html",description:"Export as HTML"},{name:"json",description:"Export as JSON"},{name:"jsonl",description:"Export as JSONL"}],language:[{name:"ui",description:"Set UI language",children:[{name:"en",description:"English"},{name:"zh-CN",description:"中文"}]},{name:"output",description:"Set LLM output language"}],extensions:[{name:"manage",description:"Manage installed extensions"},{name:"install",description:"Install an extension from a source"}]},Ty={context:[{name:"detail",description:"显示详细上下文信息"}],copy:[{name:"code",description:"复制代码块"},{name:"latex",description:"复制 LaTeX 公式"},{name:"inline-latex",description:"复制行内 LaTeX 公式"}],tools:[{name:"desc",description:"显示工具详细描述"}],stats:[{name:"model",description:"显示各模型使用统计"},{name:"tools",description:"显示工具使用统计"}],mcp:[{name:"desc",description:"显示 MCP server 和工具描述"},{name:"nodesc",description:"隐藏 MCP server 和工具描述"},{name:"schema",description:"显示工具参数 schema"}],memory:[{name:"show",description:"查看 memory 文件"},{name:"add",description:"新增 memory"},{name:"refresh",description:"刷新 memory 文件列表"}]},Cy={context:[{name:"detail",description:"Show detailed context info"}],copy:[{name:"code",description:"Copy code blocks"},{name:"latex",description:"Copy LaTeX formula"},{name:"inline-latex",description:"Copy inline LaTeX formula"}],tools:[{name:"desc",description:"Show tool descriptions"}],stats:[{name:"model",description:"Show per-model usage statistics"},{name:"tools",description:"Show tool usage statistics"}],mcp:[{name:"desc",description:"Show MCP server and tool descriptions"},{name:"nodesc",description:"Hide MCP server and tool descriptions"},{name:"schema",description:"Show tool parameter schemas"}],memory:[{name:"show",description:"Show memory files"},{name:"add",description:"Add memory"},{name:"refresh",description:"Refresh memory files"}]};function j0e(e,t,n,r){if(e==="skills"&&t.length===0)return!n||n.length===0?null:n.map(a=>({name:a.name,description:a.description}));let s=(r==="zh-CN"?_y:Sy)[e];if(s||(s=(r==="zh-CN"?Ty:Cy)[e]),!s)return null;for(const a of t){const o=s.find(l=>l.name===a);if(!(o!=null&&o.children))return null;s=o.children}return s}function FO(e,t,n){const r=e.toLowerCase(),i=t.toLowerCase(),s=r.startsWith(n),a=i.startsWith(n);return s!==a?s?-1:1:e.localeCompare(t)}function L0e(e,t,n,r){const i=O0e(e,t,r);return i!==0?i:n?FO(e.name,t.name,n):0}const B0e={custom:"slash.category.custom",skill:"slash.category.skill",system:"slash.category.system"};function z0e(e){const t=document.createElement("completion-section");return t.className="cm-command-section-header",t.setAttribute("aria-label",e.name),t}function P0e(e,t,n){const r=m1(e);return{name:t(B0e[r]),rank:rw(r,n),header:z0e}}function $0e(e,t){if(!e||e.includes(" ")||/^[/@!?]/.test(e))return null;const n=e.toLowerCase(),r=t.find(i=>i.name.toLowerCase().startsWith(n));return r?`/${r.name} `:null}function U0e(e,t,n){var c;const r=e.match(new RegExp(`^/${n5}\\s+$`));if(!r)return null;const i=r[1],s=t.find(u=>u.name===i),a=n==="zh-CN"?_y:Sy;if((c=s==null?void 0:s.subcommands)!=null&&c.length||a[i]||i==="skills")return null;const l=(n==="zh-CN"?Ty:Cy)[i];return!l||l.length===0?null:`/${i} ${l[0].name} `}function H0e(e,t,n){var u,d;const r=e.match(new RegExp(`^/${n5}(\\s*)$`));if(!r)return null;const i=r[1],s=t.find(f=>f.name===i);if(!s)return null;const a=(u=s.argumentHint)==null?void 0:u.trim();if(a)return a;const o=n==="zh-CN"?_y:Sy;if((d=s.subcommands)!=null&&d.length||o[i]||i==="skills")return null;const c=(n==="zh-CN"?Ty:Cy)[i];return!c||c.length===0?null:`[${c.map(f=>f.name).join("|")}]`}function q0e(e,t=()=>[],n=()=>"en",r=s=>s,i=()=>v0){return s=>{var x,g;const a=s.state.doc.lineAt(s.pos),l=a.text.slice(0,s.pos-a.from).match(new RegExp(`^/${n5}\\s+(.*)$`));if(l){const[,y,w]=l,E=e().find(X=>X.name===y),S=n(),T=S==="zh-CN"?_y:Sy,j=S==="zh-CN"?Ty:Cy,z=!!T[y]||y==="skills",R=!!j[y];if(!((x=E==null?void 0:E.subcommands)!=null&&x.length)&&!z&&!R)return null;const D=w.split(/\s+/),N=D.pop()||"",B=D;if(!((g=E==null?void 0:E.subcommands)!=null&&g.length)&&!z&&R&&!N)return null;const P=j0e(y,B,t(),S);if(!P)return null;const J=N.toLowerCase(),q=`/${y} ${B.length>0?B.join(" ")+" ":""}`,W=P.filter(X=>!N||X.name.toLowerCase().includes(J)).sort((X,H)=>N?FO(X.name,H.name,J):0),$=y==="skills"&&B.length===0,Z=$?Math.max(...W.map(X=>X.name.length),0):0,M=W.map(X=>{const H=`${q}${X.name}`,O=Math.max(Z-X.name.length,0);return{label:X.name,...$?{displayLabel:`${X.name}${" ".repeat(O)}`,type:"skill"}:{},detail:X.description||void 0,...$&&X.description?{info:`/${X.name}

${X.description}`}:{},apply:`${H} `}});return M.length===0?null:{from:a.from,options:M,filter:!1}}const c=a.text.match(/^\/([^\s/]*)$/);if(!c)return null;const u=c[1],d=e(),f=i()??v0,m=u.toLowerCase(),b=d.filter(y=>u?y.name.toLowerCase().includes(m):!0).sort((y,w)=>L0e(y,w,m,f)).map(y=>{const w=`/${y.name}`,C=m1(y),E=C==="custom"||C==="skill";return{label:w,detail:y.description||void 0,...E&&y.description?{info:`${w}

${y.description}`}:{},apply:`${w} `,section:P0e(y,r,f)}});return b.length===0?null:{from:a.from,to:a.to,options:b,filter:!1}}}function F0e(e){return t=>V0e(t,e)}function V0e(e,t){const n=e.state.doc.lineAt(e.pos),i=n.text.slice(0,e.pos-n.from).match(/@([\w./-]*)$/);if(!i)return null;const s=t();if(!s)return null;const a=i[1],o=e.pos-i[0].length;return G0e(a,s).then(l=>l.length===0?null:{from:o,options:l.map(c=>({label:`@${c}`,apply:`@${c} `,type:"file"})),filter:!1})}async function G0e(e,t){try{const n=e?`${e}*`:"**/*";return(await t(n,{maxResults:50})).matches.filter(i=>i!==".")}catch{return[]}}const W0e="qwen-web-shell-history",VO=100;function K0e(e){try{const t=localStorage.getItem(e);if(!t)return[];const n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>typeof r=="string"):[]}catch{return[]}}function Y0e(e,t){try{localStorage.setItem(e,JSON.stringify(t.slice(-VO)))}catch{}}function UT(e=W0e){const t=v.useRef(e);t.current=e;const n=v.useRef(K0e(e)),r=v.useRef(-1),i=v.useRef(""),s=v.useRef(-1),[a,o]=v.useState(()=>({canUp:n.current.length>0,canDown:!1})),l=v.useCallback(()=>{const y=n.current,w=r.current;o({canUp:y.length>0&&(w===-1||w>0),canDown:w!==-1})},[]),c=v.useCallback(y=>{const w=n.current;w[w.length-1]!==y&&(w.push(y),w.length>VO&&w.shift(),Y0e(t.current,w),r.current=-1,l())},[l]),u=v.useCallback(y=>{const w=n.current;if(w.length===0)return null;if(r.current===-1)i.current=y,r.current=w.length-1;else if(r.current>0)r.current--;else return null;return l(),w[r.current]},[l]),d=v.useCallback(()=>{const y=n.current;return r.current===-1?null:r.current<y.length-1?(r.current++,l(),y[r.current]):(r.current=-1,l(),i.current)},[l]),f=v.useCallback(()=>r.current!==-1,[]),m=v.useCallback(()=>{r.current=-1,s.current=-1,l()},[l]),p=v.useCallback(y=>{const w=n.current;if(w.length===0||!y)return null;const C=s.current===-1?w.length-1:s.current-1;if(C<0)return s.current=-1,null;const E=y.toLowerCase();for(let S=C;S>=0;S--)if(w[S].toLowerCase().includes(E))return s.current=S,w[S];return s.current=-1,null},[]),b=v.useCallback(y=>{const w=y.trim().toLowerCase();return n.current.slice().reverse().filter(C=>!w||C.toLowerCase().includes(w))},[]),x=v.useCallback(y=>{const w=n.current;if(!y)return w.length>0?w[w.length-1]:null;for(let C=w.length-1;C>=0;C--)if(y(w[C]))return w[C];return null},[]),g=v.useCallback(()=>{s.current=-1},[]);return{push:c,navigateUp:u,navigateDown:d,isNavigating:f,reset:m,searchReverse:p,getReverseMatches:b,getLastEntry:x,resetSearch:g,nav:a}}const X0e=an.mark({class:"cm-input-slash"}),Q0e=an.mark({class:"cm-input-at"}),J0e=an.mark({class:"cm-input-code"});class Z0e extends Fo{constructor(t){super(),this.text=t}eq(t){return t.text===this.text}toDOM(){const t=document.createElement("span");return t.className="cm-input-slash-argument-hint",t.textContent=this.text,t}ignoreEvent(){return!0}}function HT(e,t,n){const r=new eu,i=e.state.doc,s=[];for(let a=1;a<=i.lines;a++){const o=i.line(a),l=o.text,c=o.from;if(l.startsWith("/")){const p=l.indexOf(" "),b=p===-1?l.length:p;s.push({from:c,to:c+b,deco:X0e})}const u=H0e(l,t(),n());if(u){const p=l.endsWith(" ")?"":" ";s.push({from:c+l.length,to:c+l.length,deco:an.widget({widget:new Z0e(`${p}${u}`),side:1})})}const d=/@[^\s]+/g;let f;for(;(f=d.exec(l))!==null;)s.push({from:c+f.index,to:c+f.index+f[0].length,deco:Q0e});const m=/`[^`]+`/g;for(;(f=m.exec(l))!==null;)s.push({from:c+f.index,to:c+f.index+f[0].length,deco:J0e})}s.sort((a,o)=>a.from-o.from||a.to-o.to);for(const{from:a,to:o,deco:l}of s)r.add(a,o,l);return r.finish()}function eme(e=()=>[],t=()=>"en"){return gs.fromClass(class{constructor(n){ie(this,"decorations");this.decorations=HT(n,e,t)}update(n){(n.docChanged||n.viewportChanged)&&(this.decorations=HT(n.view,e,t))}},{decorations:n=>n.decorations})}const tme=tt.baseTheme({".cm-input-slash":{color:"var(--accent-color, #4a9eff)",fontWeight:"bold"},".cm-input-at":{color:"var(--success-color, #48bb78)"},".cm-input-code":{background:"rgba(255, 255, 255, 0.06)",borderRadius:"3px",color:"var(--text-secondary, #a0aec0)"},".cm-input-slash-argument-hint":{color:"var(--text-tertiary, rgba(160, 174, 192, 0.55))",pointerEvents:"none"}}),nme="_container_1b7lf_1",rme="_borderTop_1b7lf_5",ime="_borderBottom_1b7lf_6",sme="_borderTopLabel_1b7lf_15",ame="_line_1b7lf_31",ome="_prefix_1b7lf_37",lme="_prefixShell_1b7lf_46",cme="_prefixAutoEdit_1b7lf_50",ume="_prefixYolo_1b7lf_54",dme="_shellMode_1b7lf_58",hme="_modePlan_1b7lf_64",fme="_modeAutoEdit_1b7lf_69",mme="_modeYolo_1b7lf_74",pme="_wrapper_1b7lf_79",gme="_hints_1b7lf_84",yme="_hintItem_1b7lf_95",bme="_hintKey_1b7lf_112",vme="_hintSep_1b7lf_126",xme="_searchBar_1b7lf_130",wme="_searchLabel_1b7lf_138",kme="_searchInput_1b7lf_143",_me="_searchHint_1b7lf_157",Sme="_searchResults_1b7lf_163",Tme="_searchResult_1b7lf_163",Cme="_searchResultActive_1b7lf_190",Eme="_searchResultMarker_1b7lf_195",Ame="_searchResultText_1b7lf_200",Mme="_searchEmpty_1b7lf_207",Nme="_images_1b7lf_213",Ime="_tags_1b7lf_220",Dme="_tag_1b7lf_220",Rme="_inlineTag_1b7lf_241",Ome="_tagLabel_1b7lf_257",jme="_tagValue_1b7lf_258",Lme="_tagRemove_1b7lf_276",Bme="_imageThumb_1b7lf_295",zme="_imageRemove_1b7lf_310",xt={container:nme,borderTop:rme,borderBottom:ime,borderTopLabel:sme,line:ame,prefix:ome,prefixShell:lme,prefixAutoEdit:cme,prefixYolo:ume,shellMode:dme,modePlan:hme,modeAutoEdit:fme,modeYolo:mme,wrapper:pme,hints:gme,hintItem:yme,hintKey:bme,hintSep:vme,searchBar:xme,searchLabel:wme,searchInput:kme,searchHint:_me,searchResults:Sme,searchResult:Tme,searchResultActive:Cme,searchResultMarker:Eme,searchResultText:Ame,searchEmpty:Mme,images:Nme,tags:Ime,tag:Dme,inlineTag:Rme,tagLabel:Ome,tagValue:jme,tagRemove:Lme,imageThumb:Bme,imageRemove:zme},qT=new mh,FT=new mh,Pme=1e3,$me=10;function Ume(e){return e.replace(/\r\n/g,`
`).replace(/\r/g,`
`)}function Hme(e){return[...e].length>Pme||e.split(`
`).length>$me}function qme(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fme(e,t,n){const i=`[Pasted Content ${[...n].length} chars]`,s=t===1?i:`${i} #${t}`;return e.set(s,n),{placeholderText:s,nextPasteId:t+1}}function Vme(e,t){for(const n of e.keys())t.includes(n)||e.delete(n);return e.size===0?1:null}function Gme(e,t){if(e.size===0)return t;const n=[...e.keys()].sort((i,s)=>s.length-i.length),r=new RegExp(n.map(qme).join("|"),"g");return t.replace(r,i=>e.get(i)??i)}function Wme(e,t){if(t)return"";switch(e){case"plan":return xt.modePlan;case"auto-edit":return xt.modeAutoEdit;case"yolo":return xt.modeYolo;default:return""}}function qp(e){var t,n;return((t=e.value)==null?void 0:t.trim())||((n=e.label)==null?void 0:n.trim())||e.id}function Kme(e){return e.map(qp).join(`
`)}function r5(e){var t;return((t=e.label)==null?void 0:t.trim())??""}function i5(e){var t;return((t=e.value)==null?void 0:t.trim())??""}function GO(e){return i5(e)||r5(e)||e.id}function i4(e,t){const n=Kme(t);return n?e?`${n}

${e}`:n:e}const iw=_n.define({map:e=>e}),s5=_n.define(),_c=_n.define();class Yme extends Fo{constructor(t){super(),this.tag=t}eq(t){return this.tag.id===t.tag.id&&this.tag.label===t.tag.label&&this.tag.value===t.tag.value&&this.tag.removable===t.tag.removable}toDOM(t){const n=document.createElement("span");n.className=xt.inlineTag;const r=r5(this.tag),i=i5(this.tag);if(r){const s=document.createElement("span");s.className=xt.tagLabel,s.textContent=r,n.appendChild(s)}if(i){const s=document.createElement("span");s.className=xt.tagValue,s.textContent=i,n.appendChild(s)}else if(!r){const s=document.createElement("span");s.className=xt.tagLabel,s.textContent=this.tag.id,n.appendChild(s)}if(this.tag.removable!==!1){const s=document.createElement("button");s.type="button",s.className=xt.tagRemove,s.setAttribute("aria-label",`Remove ${GO(this.tag)}`),s.textContent="×",s.addEventListener("mousedown",a=>a.preventDefault()),s.addEventListener("click",a=>{a.stopPropagation();const o=[];t.state.field(od).between(0,t.state.doc.length,(l,c,u)=>{const d=u.spec.tag;(d==null?void 0:d.id)===this.tag.id&&d.removable!==!1&&o.push({from:l,to:c,insert:""})}),o.length!==0&&(t.dispatch({changes:o,effects:s5.of({predicate:l=>l.id===this.tag.id}),scrollIntoView:!0}),t.focus())}),n.appendChild(s)}return n}ignoreEvent(){return!1}}function Xme(e){const t={widget:new Yme(e.tag),inclusive:!1,tag:e.tag};return an.replace(t).range(e.from,e.to)}const od=Ya.define({create(){return an.none},update(e,t){let n=e.map(t.changes);for(const r of t.effects)r.is(iw)?n=n.update({add:[Xme(r.value)]}):r.is(s5)?n=n.update({filter:(i,s,a)=>{const o=a.spec.tag;return o&&r.value.predicate?!r.value.predicate(o):!0}}):r.is(_c)&&(n=an.none);return n},provide:e=>[tt.decorations.from(e),tt.atomicRanges.of(t=>t.state.field(e))]});function Qme(e){const t=[];return e.state.field(od).between(0,e.state.doc.length,(n,r,i)=>{const s=i.spec.tag;s&&t.push(s)}),t}const Jme=v.forwardRef(function({onSubmit:t,onCycleMode:n,onToggleShortcuts:r,disabled:i=!1,placeholderText:s="Type a message...",commands:a,skills:o=[],slashCommandCategoryOrder:l,queuedMessages:c=[],onPopQueuedMessages:u,onClearQueuedMessages:d,currentMode:f="default",draftText:m,draftVersion:p,onFocusFooter:b,dialogOpen:x=!1,followupState:g,onAcceptFollowup:y,onDismissFollowup:w,sessionName:C,composerInput:E,composerInputVersion:S},T){const j=HA(),{language:z,t:R}=ft(),D=v.useRef(null),N=v.useRef(null),B=v.useRef(t);B.current=t;const P=v.useRef(n);P.current=n;const J=v.useRef(r);J.current=r;const q=v.useRef(i);q.current=i;const W=v.useRef(a);W.current=a;const $=v.useRef(o);$.current=o;const Z=v.useRef(l);Z.current=l;const M=v.useRef(R);M.current=R;const X=v.useRef(c);X.current=c;const H=v.useRef(u);H.current=u;const O=v.useRef(d);O.current=d;const se=v.useRef(g);se.current=g;const ke=v.useRef(y);ke.current=y;const be=v.useRef(w);be.current=w;const Ee=v.useRef(b);Ee.current=b;const qe=v.useRef(z);qe.current=z;const wt=v.useRef(j==null?void 0:j.actions);wt.current=j==null?void 0:j.actions;const[Mt,bt]=v.useState(!1),Je=v.useRef(Mt);Je.current=Mt;const[Ge,Pt]=v.useState(!1),[Ze,re]=v.useState(""),[le,De]=v.useState([]),[We,pe]=v.useState(0),st=v.useRef(null),ae=v.useRef(null),je=v.useRef(""),[Oe,$e]=v.useState([]),te=v.useRef([]),ye=v.useRef(new Map),Te=v.useRef(1),[Pe,dt]=v.useState([]),Ht=v.useRef([]);Ht.current=Pe;const Xt=v.useRef(E);Xt.current=E;const Dn=v.useRef(()=>!0),jn=v.useRef(null),Zn=UT(),Sn=UT("qwen-web-shell-command-history"),{push:_r,navigateUp:me,navigateDown:G,isNavigating:ne,reset:Ke,getReverseMatches:St,getLastEntry:et,resetSearch:$t}=Zn,Tt=v.useRef({push:_r,navigateUp:me,navigateDown:G,isNavigating:ne,reset:Ke,getReverseMatches:St,getLastEntry:et,resetSearch:$t});Tt.current={push:_r,navigateUp:me,navigateDown:G,isNavigating:ne,reset:Ke,getReverseMatches:St,getLastEntry:et,resetSearch:$t};const or=v.useRef(Sn);or.current=Sn,te.current=Oe;const Yn=v.useCallback(()=>{if(q.current)return;const Q=N.current;if(!Q)return;const oe=Q.state.doc.toString();je.current=oe,Pt(!0),re(oe);const he=Je.current?or.current:Tt.current;De(he.getReverseMatches(oe)),pe(0),he.resetSearch(),setTimeout(()=>{var Ye;return(Ye=st.current)==null?void 0:Ye.focus()},0)},[]),Xa=v.useRef(Yn);Xa.current=Yn;const bu=v.useCallback(()=>{if(q.current)return;const Q=N.current;if(!Q)return;if(Ri(Q.state)==="active"){Tl(!1)(Q),Q.focus();return}if(Q.state.doc.lines>1){Q.focus();return}const oe=Je.current?or.current:Tt.current,he=Q.state.doc.toString(),Ye=oe.navigateUp(he);Ye!==null&&Q.dispatch({changes:{from:0,to:Q.state.doc.length,insert:Ye},selection:{anchor:Ye.length}}),Q.focus()},[]),vu=v.useCallback(()=>{if(q.current)return;const Q=N.current;if(!Q)return;if(Ri(Q.state)==="active"){Tl(!0)(Q),Q.focus();return}if(Q.state.doc.lines>1){Q.focus();return}const he=(Je.current?or.current:Tt.current).navigateDown();he!==null&&Q.dispatch({changes:{from:0,to:Q.state.doc.length,insert:he},selection:{anchor:he.length}}),Q.focus()},[]);v.useEffect(()=>{var yn,Za;if(!D.current)return;const Q=document.createElement("div");Q.setAttribute("data-web-shell-tooltip-portal",""),Q.style.position="fixed",Q.style.inset="0",Q.style.zIndex="var(--web-shell-tooltip-z-index)",Q.style.pointerEvents="none";const oe=/\b\S*theme(?:Dark|Light)\S*/gi,he=()=>{var Rt,Ut;let ue=D.current,at=null;if(D.current){const ct=getComputedStyle(D.current);for(let It=0;It<ct.length;It+=1){const Qt=ct[It];Qt.startsWith("--")&&Q.style.setProperty(Qt,ct.getPropertyValue(Qt))}ct.getPropertyValue("--web-shell-tooltip-z-index").trim()||Q.style.setProperty("--web-shell-tooltip-z-index","1000")}for(;ue;){const ct=(Ut=(Rt=ue.className)==null?void 0:Rt.match)==null?void 0:Ut.call(Rt,oe);if(ct){at=ct[0];break}ue=ue.parentElement}at&&(Q.className=at)};he(),document.body.appendChild(Q);const Ye=new MutationObserver(he);let Re=D.current;for(;Re&&(Ye.observe(Re,{attributes:!0,attributeFilter:["class","style"]}),!((Za=(yn=Re.className)==null?void 0:yn.match)!=null&&Za.call(yn,oe)));)Re=Re.parentElement;const gt=(ue,at,Rt)=>{var ac;const Ut=(at??ue.state.doc.toString()).trim(),ct=Rt??Ht.current;if(!Ut&&ct.length===0)return!0;const It=Gme(ye.current,Ut),Qt=i4(It,ct),Ln=te.current,ks=Je.current;return B.current(ks?`!${Qt}`:Qt,Ln.length>0?[...Ln]:void 0)===!1||((ac=be.current)==null||ac.call(be),ye.current.clear(),Te.current=1,ks?(or.current.push(It),or.current.reset()):(Tt.current.push(It),Tt.current.reset()),dt([]),$e([]),ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:""},effects:_c.of()})),!0};Dn.current=gt;const zt=[q0e(()=>W.current,()=>$.current,()=>qe.current,ue=>M.current(ue),()=>Z.current),F0e(()=>{var ue;return(ue=wt.current)==null?void 0:ue.globWorkspace})],Tn=ue=>(ue.dispatch(ue.state.replaceSelection(`
`)),!0),ot=p0.of([{key:"Backspace",run:ue=>{var ct;const at=ue.state.selection.main;if(!at.empty||at.from!==0)return!1;let Rt=!1;if(ue.state.field(od).between(0,1,It=>{It===0&&(Rt=!0)}),Rt)return!1;let Ut=-1;for(let It=Ht.current.length-1;It>=0;It-=1)if(((ct=Ht.current[It])==null?void 0:ct.removable)!==!1){Ut=It;break}return Ut<0?!1:(dt(It=>It.filter((Qt,Ln)=>Ln!==Ut)),!0)}},{key:"Delete",run:ue=>{const at=ue.state.selection.main;if(!at.empty||at.from!==0)return!1;let Rt=!1;if(ue.state.field(od).between(0,1,ct=>{ct===0&&(Rt=!0)}),Rt)return!1;const Ut=Ht.current.findIndex(ct=>ct.removable!==!1);return Ut<0?!1:(dt(ct=>ct.filter((It,Qt)=>Qt!==Ut)),!0)}},{key:"Enter",run:ue=>{var Rt;if(Ri(ue.state)==="active")return!1;const at=se.current;return ue.state.doc.toString().length===0&&(at!=null&&at.isVisible)&&at.suggestion?((Rt=ke.current)==null||Rt.call(ke,"enter",{skipOnAccept:!0}),gt(ue,at.suggestion)):gt(ue)}},{key:"Shift-Enter",run:Tn},{key:"Ctrl-j",run:Tn},{key:"Mod-Enter",run:Tn},{key:"Alt-Enter",run:Tn},{key:"Escape",run:()=>{var ue;return Je.current?(bt(!1),!0):X.current.length===0?!1:((ue=O.current)==null?void 0:ue.call(O))??!1}},{key:"Ctrl-o",run:()=>!0},{key:"Ctrl-l",run:()=>!0},{key:"Ctrl-y",run:()=>!0},{key:"ArrowUp",run:ue=>{var It;const at=Je.current?or.current:Tt.current,Rt=at.isNavigating();if(Ri(ue.state)==="active"&&!Rt)return Tl(!1)(ue);if(Rt&&Hp(ue),ue.state.doc.lines>1)return!1;if(Je.current){const Qt=ue.state.doc.toString(),Ln=at.navigateUp(Qt);return Ln===null||ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:Ln},selection:{anchor:Ln.length}}),!0}if(X.current.length>0){const Qt=(It=H.current)==null?void 0:It.call(H);if(Qt){const Ln=ue.state.doc.toString(),ks=Ln.trim()?`${Qt}
${Ln}`:Qt;return ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:ks},selection:{anchor:ks.length}}),!0}}const Ut=ue.state.doc.toString(),ct=at.navigateUp(Ut);return ct===null?!1:(ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:ct},selection:{anchor:ct.length}}),!0)}},{key:"ArrowDown",run:ue=>{var ct;const at=Je.current?or.current:Tt.current,Rt=at.isNavigating();if(Ri(ue.state)==="active"&&!Rt)return Tl(!0)(ue);if(Rt&&Hp(ue),ue.state.doc.lines>1)return!1;if(Je.current){const It=at.navigateDown();return It===null||ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:It},selection:{anchor:It.length}}),!0}const Ut=at.navigateDown();return Ut===null?((ct=Ee.current)==null?void 0:ct.call(Ee))??!1:(ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:Ut},selection:{anchor:Ut.length}}),!0)}},{key:"Ctrl-r",run:()=>(Xa.current(),!0)},{key:"Tab",run:ue=>{var It;if(Ri(ue.state)==="active")return HO(ue);const at=ue.state.doc.toString(),Rt=U0e(at,W.current,qe.current);if(Rt)return ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:Rt},selection:{anchor:Rt.length}}),!0;const Ut=$0e(at,W.current);if(Ut)return ue.dispatch({changes:{from:0,to:ue.state.doc.length,insert:Ut},selection:{anchor:Ut.length}}),!0;const ct=se.current;return at.length===0&&(ct!=null&&ct.isVisible)&&ct.suggestion&&((It=ke.current)==null||It.call(ke,"tab")),!0}},{key:"ArrowRight",run:ue=>{var Rt;const at=se.current;return Ri(ue.state)!=="active"&&ue.state.doc.toString().length===0&&(at!=null&&at.isVisible)&&at.suggestion?((Rt=ke.current)==null||Rt.call(ke,"right"),!0):!1}},{key:"Shift-Tab",run:()=>{var ue;return(ue=P.current)==null||ue.call(P),!0}}]),on=tt.updateListener.of(ue=>{if(!ue.docChanged&&!ue.selectionSet)return;if(ue.docChanged&&ye.current.size>0){const ct=Vme(ye.current,ue.state.doc.toString());ct!==null&&(Te.current=ct)}const at=ue.state.selection.main;if(!at.empty)return;const Rt=ue.state.doc.lineAt(at.head);Rt.from===0&&Rt.text.startsWith("/")&&window.setTimeout(()=>{const ct=N.current;if(!ct||Ri(ct.state)==="active")return;const It=ct.state.selection.main;if(!It.empty)return;const Qt=ct.state.doc.lineAt(It.head);Qt.from===0&&Qt.text.startsWith("/")&&Lc(ct)},0)});let tn=!1;const Yi=tt.updateListener.of(ue=>{const at=jn.current,Rt=Ri(ue.state)==="active";if(at){const Ut=ue.state.doc;if(!(Ut.length===at.from+at.text.length&&Ut.sliceString(at.from)===at.text))jn.current=null;else if(tn&&!Rt){jn.current=null;const{view:It}=ue,{from:Qt}=at;window.setTimeout(()=>{if(N.current!==It)return;const Ln=It.state.doc;Ln.length===Qt+at.text.length&&Ln.sliceString(Qt)===at.text&&It.dispatch({changes:{from:Qt,to:Ln.length,insert:""}})},0)}}tn=Rt}),ha=mn.create({doc:"",extensions:[yu.highest(ot),R0e,oO(),p0.of([...BO,...dO]),N0e({override:zt,activateOnTyping:!0,icons:!1,optionClass:ue=>ue.type==="file"?"cm-file-completion":ue.info?"cm-command-info-completion":"",aboveCursor:!0,positionInfo:(ue,at,Rt,Ut,ct)=>{const It=Ut.bottom-Ut.top,Qt=ct.bottom-at.bottom,Ln=Qt>=It||Qt>at.top,ks=Ln?"top":"bottom",Yo=Ln?Rt.bottom-at.top:at.bottom-Rt.top;return{style:`${ks}: ${Yo}px`,class:"cm-completionInfo-right-narrow"}},activateOnCompletion:ue=>typeof ue.apply=="string"&&ue.apply.endsWith(" ")}),nhe({parent:Q}),FT.of(mT("")),tt.lineWrapping,qT.of(tt.editable.of(!0)),eme(()=>W.current,()=>qe.current),tme,od,on,Yi,tt.inputHandler.of((ue,at,Rt,Ut)=>{var ct,It,Qt;return Ut.length>0&&ue.state.doc.toString()===""&&((ct=se.current)!=null&&ct.isVisible)&&((It=be.current)==null||It.call(be)),Ut==="!"&&ue.state.doc.toString()===""&&Ri(ue.state)!=="active"?(bt(Ln=>!Ln),!0):Ut==="?"&&ue.state.doc.toString()===""&&Ri(ue.state)!=="active"?((Qt=J.current)==null||Qt.call(J),!0):!1}),tt.domEventHandlers({paste(ue){var Ln,ks,Yo,ac;const at=(Ln=ue.clipboardData)==null?void 0:Ln.items;if(!at)return!1;let Rt=!1;for(const oc of at)if(oc.type.startsWith("image/")){Rt=!0;const Xo=oc.getAsFile();if(!Xo)continue;const Xs=oc.type,yh=new FileReader;yh.onload=()=>{const eo=yh.result.split(",")[1];$e(ku=>[...ku,{data:eo,media_type:Xs}])},yh.readAsDataURL(Xo)}if(Rt)return ue.preventDefault(),!0;const Ut=Ume(((ks=ue.clipboardData)==null?void 0:ks.getData("text/plain"))??"");if(!Ut||!Hme(Ut))return!1;ue.preventDefault(),rn.state.doc.toString()===""&&((Yo=se.current)!=null&&Yo.isVisible)&&((ac=be.current)==null||ac.call(be));const{placeholderText:ct,nextPasteId:It}=Fme(ye.current,Te.current,Ut);Te.current=It;const Qt=rn.state.selection.main;return rn.dispatch({changes:{from:Qt.from,to:Qt.to,insert:ct},selection:{anchor:Qt.from+ct.length},scrollIntoView:!0}),!0}}),tt.theme({"&":{fontSize:"14px",background:"transparent",border:"none"},"&.cm-focused":{outline:"none"},".cm-scroller":{overflow:"visible"},".cm-content":{padding:"0",fontFamily:'var(--font-mono, "SF Mono", "Fira Code", monospace)',color:"var(--text-primary, #e0e0e0)",caretColor:"var(--accent-color, #4a9eff)"},".cm-line":{padding:"0"},".cm-placeholder":{color:"var(--text-dimmed, #666)"},".cm-cursor":{borderLeftColor:"var(--accent-color, #4a9eff)",borderLeftWidth:"2px"}})]}),rn=new tt({state:ha,parent:D.current});return N.current=rn,rn.focus(),()=>{rn.destroy(),N.current=null,Ye.disconnect(),Q.remove()}},[]),v.useEffect(()=>{const Q=N.current;Q&&(Q.dispatch({effects:qT.reconfigure(tt.editable.of(!i))}),i||Q.focus())},[i]),v.useEffect(()=>{const Q=N.current;if(!Q)return;const he=(g!=null&&g.isVisible&&g.suggestion?g.suggestion:null)??s;Q.dispatch({effects:FT.reconfigure(mT(he))})},[s,g==null?void 0:g.isVisible,g==null?void 0:g.suggestion]),v.useEffect(()=>{const Q=N.current;!Q||m===void 0||(Q.dispatch({changes:{from:0,to:Q.state.doc.length,insert:m},selection:{anchor:m.length}}),Q.focus())},[m,p]),v.useEffect(()=>{const Q=N.current;!Q||Ri(Q.state)!=="active"||(Hp(Q),window.setTimeout(()=>{N.current===Q&&Lc(Q)},0))},[z]),v.useEffect(()=>{const Q=N.current;Q&&(x?Q.contentDOM.blur():Q.focus())},[x]),v.useEffect(()=>{const Q=oe=>{var gt,zt,Tn,ot;if(q.current||Ge||x||oe.defaultPrevented)return;const he=N.current,Ye=se.current;if(he&&!he.hasFocus&&(Ye!=null&&Ye.isVisible)&&Ye.suggestion&&he.state.doc.toString().length===0&&!Kg(oe.target)){if(oe.key==="Tab"&&!oe.shiftKey&&!oe.metaKey&&!oe.ctrlKey&&!oe.altKey&&Ri(he.state)!=="active"){oe.preventDefault(),(gt=ke.current)==null||gt.call(ke,"tab");return}if(oe.key==="ArrowRight"&&!oe.shiftKey&&!oe.metaKey&&!oe.ctrlKey&&!oe.altKey&&Ri(he.state)!=="active"){oe.preventDefault(),(zt=ke.current)==null||zt.call(ke,"right");return}}if(oe.metaKey||oe.ctrlKey||oe.altKey||oe.key.length!==1||Kg(oe.target)||!he||he.hasFocus)return;if(oe.preventDefault(),oe.key==="!"&&he.state.doc.toString()===""){(Tn=se.current)!=null&&Tn.isVisible&&((ot=be.current)==null||ot.call(be)),bt(on=>!on),he.focus();return}const Re=he.state.selection.main;he.dispatch({changes:{from:Re.from,to:Re.to,insert:oe.key},selection:{anchor:Re.from+oe.key.length},scrollIntoView:!0}),he.focus(),(oe.key==="/"||oe.key==="@")&&window.setTimeout(()=>{const on=N.current;on&&on.hasFocus&&Lc(on)},0)};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[Ge,x]);const Sr=v.useCallback(()=>{var Q;(Q=N.current)==null||Q.focus()},[]),ni=v.useCallback((Q,oe)=>{const he=N.current;if(!he||!Q){he==null||he.focus();return}if((oe==null?void 0:oe.mode)==="replace"){he.dispatch({changes:{from:0,to:he.state.doc.length,insert:Q},effects:_c.of(),selection:{anchor:Q.length},scrollIntoView:!0}),he.focus();return}const Ye=he.state.selection.main;let Re=Q,gt=!1,zt=null,Tn=Q==="/"||Q==="@";if(Q==="/")he.state.doc.lineAt(Ye.head).text.startsWith("/")?gt=!0:he.state.doc.length>0&&(gt=!0,Tn=!1);else if(Q==="@"){const ot=Ye.from>0?he.state.doc.sliceString(Ye.from-1,Ye.from):"";he.state.doc.sliceString(Ye.from,Ye.from+1)==="@"?(gt=!0,zt=Ye.from+1):ot==="@"?gt=!0:ot&&!/\s/.test(ot)&&(Re=" @")}gt?zt!==null&&he.dispatch({selection:{anchor:zt},scrollIntoView:!0}):(he.dispatch({changes:{from:Ye.from,to:Ye.to,insert:Re},selection:{anchor:Ye.from+Re.length},scrollIntoView:!0}),Tn&&(jn.current={text:Re,from:Ye.from})),he.focus(),Tn&&window.setTimeout(()=>{const ot=N.current;ot&&ot.hasFocus&&Lc(ot)},0)},[]),pn=v.useCallback(()=>{var Q;return((Q=N.current)==null?void 0:Q.state.doc.toString())??""},[]),gn=v.useCallback(Q=>{const oe=N.current;oe&&(oe.dispatch({changes:{from:0,to:oe.state.doc.length,insert:Q},effects:_c.of(),selection:{anchor:Q.length},scrollIntoView:!0}),oe.focus())},[]),Tr=v.useCallback(Q=>{const oe=N.current;if(!oe)return;const he=[];oe.state.field(od).between(0,oe.state.doc.length,(Ye,Re,gt)=>{const zt=gt.spec.tag;zt&&(!Q||Q(zt))&&he.push({from:Ye,to:Re,insert:""})}),oe.dispatch({...he.length>0?{changes:he}:{},effects:s5.of({predicate:Q}),scrollIntoView:!0})},[]),Nt=v.useCallback(Q=>{const oe=(Q==null?void 0:Q.text)??!0,he=(Q==null?void 0:Q.tags)??!0,Ye=N.current;oe&&Ye&&Ye.state.doc.length>0&&Ye.dispatch({changes:{from:0,to:Ye.state.doc.length,insert:""},effects:_c.of()}),oe&&($e([]),ye.current.clear(),Te.current=1),he&&(dt([]),oe||Tr())},[Tr]),hi=v.useCallback(()=>{Nt({text:!0,tags:!1})},[Nt]),Vr=v.useCallback((Q,oe)=>{if(Q.length!==0){if((oe==null?void 0:oe.placement)==="inline"){const he=N.current;if(!he)return;const Ye=he.state.selection.main;let Re=Ye.from;const gt=[],zt=Q.map(ot=>{const on=qp(ot);return gt.push({from:Re,to:Re+on.length,tag:ot}),Re+=on.length+1,on}).join(" "),Tn=zt?`${zt} `:"";he.dispatch({changes:{from:Ye.from,to:Ye.to,insert:Tn},effects:gt.length>0?gt.map(ot=>iw.of(ot)):void 0,selection:{anchor:Ye.from+Tn.length},scrollIntoView:!0}),he.focus();return}dt(he=>{const Ye=[...he];for(const Re of Q){const gt=Ye.findIndex(zt=>zt.id===Re.id);gt>=0?Ye[gt]=Re:Ye.push(Re)}return Ye})}},[]),vs=v.useCallback(Q=>{dt(oe=>oe.filter(he=>he.id!==Q||he.removable===!1)),Tr(oe=>oe.id===Q&&oe.removable!==!1)},[Tr]),Qa=v.useCallback(()=>{var Q;return(((Q=N.current)==null?void 0:Q.state.doc.toString().trim().length)??0)>0||Ht.current.length>0||te.current.length>0},[]),Ks=v.useCallback(Q=>{const oe=N.current;if(!oe)return;const he=Qme(oe);if((Q==null?void 0:Q.tagPlacement)==="inline"){Dn.current(oe,i4(Q.text??"",Q.tags??he),[]);return}if((Q==null?void 0:Q.text)!==void 0&&Q.tags===void 0&&he.length>0){Dn.current(oe,i4(Q.text,he),[]);return}Dn.current(oe,Q==null?void 0:Q.text,Q?Q.tags??[]:void 0)},[]),Ja=v.useCallback(()=>{const Q=Tt.current.getLastEntry(he=>!he.startsWith("/")&&!he.startsWith("!"));!Q||B.current(Q)===!1||$e([])},[]);v.useImperativeHandle(T,()=>({clearText:hi,clear:Nt,focus:Sr,getText:pn,hasInput:Qa,setText:gn,addTags:Vr,removeTag:vs,insertText:ni,retryLast:Ja,submit:Ks}),[Vr,Nt,hi,Sr,pn,Qa,ni,vs,Ja,gn,Ks]),v.useEffect(()=>{const Q=Xt.current;if(!Q)return;const oe=N.current;if(!oe)return;const he=Q.tagPlacement??"top";if(Q.tags!==void 0&&he==="top"&&dt([...Q.tags]),Q.text!==void 0||he==="inline"){const Re=he==="inline"?[...Q.tags??[]]:[],gt=Re.map(qp).join(" "),zt=he==="inline"?gt&&Q.text?`${gt} ${Q.text}`:gt||(Q.text??""):Q.text??"",Tn=[_c.of()];if(Re.length>0){let ot=0;for(const on of Re){const tn=qp(on);Tn.push(iw.of({from:ot,to:ot+tn.length,tag:on})),ot+=tn.length+1}}oe.dispatch({changes:{from:0,to:oe.state.doc.length,insert:zt},effects:Tn,selection:{anchor:zt.length},scrollIntoView:!0})}else oe.dispatch({effects:_c.of()});(Q.text!==void 0||Q.submit)&&oe.focus();let Ye=null;return Q.submit&&(Ye=window.setTimeout(()=>{N.current&&Ks(Q)},0)),()=>{Ye!==null&&window.clearTimeout(Ye)}},[S,Ks]);const er=v.useCallback(Q=>{const oe=N.current;oe&&oe.dispatch({changes:{from:0,to:oe.state.doc.length,insert:Q},selection:{anchor:Q.length},scrollIntoView:!0})},[]),Gr=v.useCallback((Q,oe=!0)=>{var Ye;Q&&er(je.current),Pt(!1),re(""),De([]),pe(0),(Je.current?or.current:Tt.current).resetSearch(),oe&&((Ye=N.current)==null||Ye.focus())},[er]);v.useEffect(()=>{if(!Ge)return;const Q=oe=>{if(oe instanceof MouseEvent&&oe.button!==0||oe.defaultPrevented)return;const he=ae.current,Ye=oe.target;he&&Ye instanceof Node&&!he.contains(Ye)&&Gr(!0,!1)};return window.addEventListener("mousedown",Q),window.addEventListener("touchstart",Q),()=>{window.removeEventListener("mousedown",Q),window.removeEventListener("touchstart",Q)}},[Ge,Gr]);const xs=v.useCallback(Q=>{var zt;if(!N.current)return;Gr(!1);const he=Q.trim();if(!he)return;const Ye=te.current,Re=Je.current;if(B.current(Re?`!${he}`:he,Ye.length>0?[...Ye]:void 0)===!1){er(Q);return}(zt=be.current)==null||zt.call(be),Re?(or.current.push(he),or.current.reset()):(Tt.current.push(he),Tt.current.reset()),$e([]),er("")},[Gr,er]),Ki=Q=>{if(Q.key==="Escape")Q.preventDefault(),Gr(!0);else if(Q.key==="Tab"){Q.preventDefault();const oe=le[We];oe&&er(oe),Gr(!1)}else if(Q.key==="Enter"){Q.preventDefault();const oe=le[We];oe?xs(oe):Gr(!1)}else Q.key==="r"&&Q.ctrlKey?(Q.preventDefault(),le.length>0&&pe(oe=>(oe+1)%le.length)):Q.key==="ArrowDown"?(Q.preventDefault(),le.length>0&&pe(oe=>(oe+1)%le.length)):Q.key==="ArrowUp"&&(Q.preventDefault(),le.length>0&&pe(oe=>(oe-1+le.length)%le.length))},ws=Q=>{const oe=Q.target.value;re(oe);const he=Je.current?or.current:Tt.current;De(he.getReverseMatches(oe)),pe(0),he.resetSearch()},ua=Wme(f,Mt),Vo=[xt.container,Mt?xt.shellMode:"",ua].filter(Boolean).join(" "),Go=Math.max(0,Math.min(We-2,le.length-6)),xu=le.slice(Go,Go+6),wu=[xt.prefix,Mt?xt.prefixShell:f==="yolo"?xt.prefixYolo:f==="auto-edit"?xt.prefixAutoEdit:""].filter(Boolean).join(" "),Wo=Mt?"!":f==="yolo"?"*":h.jsx(iM,{}),Ko=!Mt&&!Ge&&!(g!=null&&g.isVisible)&&!i&&!x,sc=(Mt?Sn:Zn).nav,da=(Q,oe)=>({type:"button",className:xt.hintItem,...oe?{"aria-haspopup":oe}:{},onMouseDown:he=>he.preventDefault(),onClick:he=>{he.stopPropagation(),Q()}}),Ys=Q=>{const oe=r5(Q),he=i5(Q);return!oe&&!he?h.jsx("span",{className:xt.tagLabel,children:Q.id}):h.jsxs(h.Fragment,{children:[oe&&h.jsx("span",{className:xt.tagLabel,children:oe}),he&&h.jsx("span",{className:xt.tagValue,children:he})]})};return h.jsxs("div",{className:Vo,onClick:Sr,children:[h.jsx("div",{className:xt.borderTop,children:C&&h.jsx("span",{className:xt.borderTopLabel,children:C})}),Ge&&h.jsxs("div",{ref:ae,children:[h.jsxs("div",{className:xt.searchBar,children:[h.jsx("span",{className:xt.searchLabel,children:R("editor.searchLabel")}),h.jsx("input",{ref:st,className:xt.searchInput,value:Ze,onChange:ws,onKeyDown:Ki,placeholder:R("editor.searchPlaceholder")}),h.jsx("span",{className:xt.searchHint,children:R("editor.searchHint")})]}),le.length>0&&h.jsx("div",{className:xt.searchResults,children:xu.map((Q,oe)=>{const he=Go+oe;return h.jsxs("button",{type:"button",className:`${xt.searchResult} ${he===We?xt.searchResultActive:""}`,onMouseDown:Ye=>{Ye.preventDefault(),er(Q),Gr(!1)},children:[h.jsx("span",{className:xt.searchResultMarker,children:he===We?"›":""}),h.jsx("span",{className:xt.searchResultText,children:Q})]},`${Q}-${he}`)})}),le.length===0&&h.jsx("div",{className:xt.searchEmpty,children:R("editor.noHistory")})]}),Oe.length>0&&h.jsx("div",{className:xt.images,children:Oe.map((Q,oe)=>h.jsxs("div",{className:xt.imageThumb,children:[h.jsx("img",{src:`data:${Q.media_type};base64,${Q.data}`,alt:""}),h.jsx("button",{className:xt.imageRemove,onClick:he=>{he.stopPropagation(),$e(Ye=>Ye.filter((Re,gt)=>gt!==oe))},children:"×"})]},oe))}),Pe.length>0&&h.jsx("div",{className:xt.tags,children:Pe.map(Q=>h.jsxs("span",{className:xt.tag,children:[Ys(Q),Q.removable!==!1&&h.jsx("button",{type:"button",className:xt.tagRemove,"aria-label":`Remove ${GO(Q)}`,onMouseDown:oe=>oe.preventDefault(),onClick:oe=>{var he;oe.stopPropagation(),vs(Q.id),(he=N.current)==null||he.focus()},onKeyDown:oe=>{var he;oe.key!=="Backspace"&&oe.key!=="Delete"||(oe.preventDefault(),vs(Q.id),(he=N.current)==null||he.focus())},children:"×"})]},Q.id))}),h.jsxs("div",{className:xt.line,children:[h.jsx("span",{className:wu,children:Wo}),h.jsx("div",{ref:D,className:xt.wrapper})]}),Ko&&h.jsxs("div",{className:xt.hints,children:[h.jsxs("button",{...da(bu),disabled:!sc.canUp,children:[h.jsx("span",{className:xt.hintKey,children:"↑"}),R("editor.hintPrev")]}),h.jsx("span",{className:xt.hintSep,children:"·"}),h.jsxs("button",{...da(vu),disabled:!sc.canDown,children:[h.jsx("span",{className:xt.hintKey,children:"↓"}),R("editor.hintNext")]}),h.jsx("span",{className:xt.hintSep,children:"·"}),h.jsxs("button",{...da(Yn,"dialog"),children:[h.jsx("span",{className:xt.hintKey,children:"ctrl+r"}),R("editor.hintSearch")]}),h.jsx("span",{className:xt.hintSep,children:"·"}),h.jsxs("button",{...da(()=>ni("/"),"listbox"),children:[h.jsx("span",{className:xt.hintKey,children:"/"}),R("editor.hintCommands")]}),h.jsx("span",{className:xt.hintSep,children:"·"}),h.jsxs("button",{...da(()=>ni("@"),"listbox"),children:[h.jsx("span",{className:xt.hintKey,children:"@"}),R("editor.hintFiles")]})]}),h.jsx("div",{className:xt.borderBottom})]})}),Zme="_bar_14ys9_1",epe="_left_14ys9_11",tpe="_right_14ys9_12",npe="_settingsButton_14ys9_22",rpe="_modeButton_14ys9_48",ipe="_modeHint_14ys9_61",spe="_modeLabel_14ys9_66",ape="_modeDefault_14ys9_70",ope="_modePlan_14ys9_74",lpe="_modeAutoEdit_14ys9_78",cpe="_modeAuto_14ys9_78",upe="_modeYolo_14ys9_86",dpe="_shortcutsButton_14ys9_95",hpe="_modelButton_14ys9_113",fpe="_model_14ys9_113",mpe="_escapeHint_14ys9_132",ppe="_disconnected_14ys9_142",gpe="_contextButton_14ys9_146",ype="_context_14ys9_146",bpe="_goal_14ys9_169",vpe="_separator_14ys9_175",xpe="_taskPill_14ys9_179",ir={bar:Zme,left:epe,right:tpe,settingsButton:npe,modeButton:rpe,modeHint:ipe,modeLabel:spe,modeDefault:ape,modePlan:ope,modeAutoEdit:lpe,modeAuto:cpe,modeYolo:upe,shortcutsButton:dpe,modelButton:hpe,model:fpe,escapeHint:mpe,disconnected:ppe,contextButton:gpe,context:ype,goal:bpe,separator:vpe,taskPill:xpe},wpe=1e3;function kpe(e,t){switch(e){case"default":return{label:t("mode.default"),className:ir.modeDefault};case"plan":return{label:t("mode.plan"),className:ir.modePlan};case"auto-edit":return{label:t("mode.auto-edit"),className:ir.modeAutoEdit};case"auto":return{label:t("mode.auto"),className:ir.modeAuto};case"yolo":return{label:t("mode.yolo"),className:ir.modeYolo};default:return null}}function _pe(){return h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"3"}),h.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function s4(e,t,n,r){return r(e===1?t:n,{count:e})}function Spe(e,t){if(e.length===0)return"";const n=e.filter(i=>i.status==="running");if(n.length>0){const i={agent:0,shell:0,monitor:0};for(const a of n)i[a.kind]++;const s=[];return i.shell>0&&s.push(s4(i.shell,"tasks.pill.shell","tasks.pill.shells",t)),i.agent>0&&s.push(s4(i.agent,"tasks.pill.agent","tasks.pill.agents",t)),i.monitor>0&&s.push(s4(i.monitor,"tasks.pill.monitor","tasks.pill.monitors",t)),s.join(", ")}const r=e.filter(i=>i.kind==="agent"&&i.status==="paused");return r.length>0?t(r.length===1?"tasks.pill.agentPaused":"tasks.pill.agentsPaused",{count:r.length}):t(e.length===1?"tasks.pill.done":"tasks.pill.doneMany",{count:e.length})}function Tpe(e){if(e<1e3)return"";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}const Cpe=v.forwardRef(function({escapeHint:t,onSelectMode:n,onSelectModel:r,onShowContext:i,onOpenSettings:s,onOpenTasks:a,onReturnToInput:o,tasks:l,activeGoal:c,hideSettings:u,onToggleShortcuts:d},f){const m=du(),p=m.status==="connected",b=m.currentModel??"",x=m.currentMode??"",g=m.tokenCount??0,y=m.contextWindow??0,{t:w}=ft(),E=(y>0?g/y*100:0).toFixed(1),S=kpe(x,w),[,T]=v.useState(0),j=v.useRef(null);v.useEffect(()=>{if(!c)return;const B=setInterval(()=>T(P=>(P+1)%1e6),wpe);return()=>clearInterval(B)},[c]);const z=v.useMemo(()=>Spe(l,w),[l,w]),R=c?Tpe(Date.now()-c.setAt):"",D=c?`◎ ${w("goal.statusActive")}${R?` (${R})`:""}`:"";v.useImperativeHandle(f,()=>({focusTaskPill(){var B;return z?((B=j.current)==null||B.focus({preventScroll:!0}),!0):!1}}),[z]);const N=B=>{if(B.key==="Enter"||B.key==="ArrowDown"||B.key==="n"&&B.ctrlKey){B.preventDefault(),B.stopPropagation(),a==null||a();return}if(B.key==="ArrowUp"||B.key==="Escape"||B.key==="p"&&B.ctrlKey){B.preventDefault(),B.stopPropagation(),o==null||o();return}B.key.length===1&&!B.metaKey&&!B.ctrlKey&&!B.altKey&&(B.preventDefault(),B.stopPropagation(),o==null||o(B.key))};return h.jsxs("div",{className:ir.bar,children:[h.jsxs("div",{className:ir.left,children:[p&&!u&&h.jsx("button",{type:"button",className:ir.settingsButton,onClick:s,onMouseDown:B=>B.stopPropagation(),onTouchStart:B=>B.stopPropagation(),title:w("settings.title"),"aria-label":w("settings.title"),"aria-haspopup":"dialog",children:h.jsx(_pe,{})}),t?h.jsx("span",{className:ir.escapeHint,children:w("editor.escClearHint")}):h.jsxs(h.Fragment,{children:[S&&h.jsxs("button",{type:"button",className:ir.modeButton,onClick:n,onMouseDown:B=>B.stopPropagation(),onTouchStart:B=>B.stopPropagation(),title:w("mode.select"),"aria-haspopup":"listbox",children:[h.jsx("span",{className:`${ir.modeLabel} ${S.className}`,children:S.label}),h.jsx("span",{className:ir.modeHint,children:w("status.modeHint")})]}),d?h.jsx("button",{type:"button",className:ir.shortcutsButton,onClick:d,onMouseDown:B=>B.stopPropagation(),onTouchStart:B=>B.stopPropagation(),"aria-haspopup":"dialog","aria-label":w("status.shortcuts"),children:w("status.shortcuts")}):h.jsx("span",{children:w("status.shortcuts")})]}),z&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:ir.separator,children:"·"}),h.jsx("button",{ref:j,type:"button",className:ir.taskPill,onClick:a,onKeyDown:N,disabled:!a,children:z})]})]}),h.jsxs("div",{className:ir.right,children:[!p&&h.jsx("span",{className:ir.disconnected,children:w("status.disconnected")}),b&&h.jsx("button",{type:"button",className:ir.modelButton,onClick:r,onMouseDown:B=>B.stopPropagation(),onTouchStart:B=>B.stopPropagation(),title:w("model.select"),"aria-haspopup":"listbox",children:h.jsx("span",{className:ir.model,children:b})}),y>0&&g>0&&h.jsx("button",{type:"button",className:ir.contextButton,onClick:i,title:w("contextUsage.title"),children:h.jsx("span",{className:ir.context,children:w("status.contextUsed",{pct:E})})}),D&&h.jsx("span",{className:ir.goal,title:c==null?void 0:c.condition,children:D})]})]})}),Epe="_panel_9g5lg_1",Ape="_column_9g5lg_8",Mpe="_item_9g5lg_14",Npe="_key_9g5lg_20",Ipe="_desc_9g5lg_25",lo={panel:Epe,column:Ape,item:Mpe,key:Npe,desc:Ipe};function WO(){if(typeof navigator>"u")return!1;const e=navigator.userAgentData,t=(e==null?void 0:e.platform)||navigator.platform||"";return/mac|iphone|ipad|ipod/i.test(t)}function Dpe(){return WO()?"cmd+v":"ctrl+v"}function Rpe(){return WO()?"shift+enter / ctrl+j / opt+enter / cmd+enter":"shift+enter / ctrl+j / alt+enter / ctrl+enter"}const a4=[{key:"/",descriptionKey:"help.shortcut.commandMenu"},{key:"@",descriptionKey:"help.shortcut.addContext"},{key:"shift+tab",descriptionKey:"help.shortcut.approvals"},{key:"esc",descriptionKey:"help.shortcut.cancel"},{key:Rpe(),descriptionKey:"help.shortcut.newline"},{key:"ctrl+l",descriptionKey:"help.shortcut.clear"},{key:"ctrl+y",descriptionKey:"help.shortcut.retry"},{key:"ctrl+o",descriptionKey:"help.shortcut.compact"},{key:"ctrl+r",descriptionKey:"help.shortcut.searchHistory"},{key:"↑ / ↓",descriptionKey:"help.shortcut.history"},{key:"?",descriptionKey:"help.shortcut.togglePanel"}];function Ope({onClose:e}){const{t}=ft(),n=v.useRef(null),r=v.useRef(e);r.current=e,v.useEffect(()=>{const l=u=>{var m;if(u instanceof MouseEvent&&u.button!==0||u.defaultPrevented)return;const d=n.current,f=u.target;d&&f instanceof Node&&!d.contains(f)&&((m=r.current)==null||m.call(r))},c=u=>{var d;u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),(d=r.current)==null||d.call(r))};return window.addEventListener("mousedown",l),window.addEventListener("touchstart",l),window.addEventListener("keydown",c,!0),()=>{window.removeEventListener("mousedown",l),window.removeEventListener("touchstart",l),window.removeEventListener("keydown",c,!0)}},[]);const i=[...a4.slice(0,-1),{key:Dpe(),descriptionKey:"help.shortcut.pasteImages"},a4[a4.length-1]],s=Math.ceil(i.length/2),a=i.slice(0,s),o=i.slice(s);return h.jsxs("div",{ref:n,className:lo.panel,children:[h.jsx("div",{className:lo.column,children:a.map(l=>h.jsxs("div",{className:lo.item,children:[h.jsx("span",{className:lo.key,children:l.key}),h.jsx("span",{className:lo.desc,children:t(l.descriptionKey)})]},l.key))}),h.jsx("div",{className:lo.column,children:o.map(l=>h.jsxs("div",{className:lo.item,children:[h.jsx("span",{className:lo.key,children:l.key}),h.jsx("span",{className:lo.desc,children:t(l.descriptionKey)})]},l.key))})]})}const jpe=15e3,Lpe=["I'm Feeling Lucky","Shipping awesomeness... ","Painting the serifs back on...","Consulting the digital spirits...","Reticulating splines...","Generating witty retort...","Polishing the algorithms...","Don't rush perfection (or my code)...","Brewing fresh bytes...","Counting electrons...","Engaging cognitive processors...","Checking for syntax errors in the universe...","One moment, optimizing humor...","Untangling neural nets...","Compiling brilliance...","Loading wit.exe...","Preparing a witty response...","Just a sec, I'm debugging reality...","Crafting a response worthy of your patience...","Resolving dependencies... and existential crises...","Garbage collecting... be right back...","Converting coffee into code...","Looking for a misplaced semicolon...","Pre-heating the servers...","Loading the next great idea...","Just a moment, I'm in the zone...","Hold tight, I'm crafting a masterpiece...","Warp speed engaged...","Don't panic...","Following the white rabbit...","The truth is in here... somewhere...","Loading... Do a barrel roll!","Finding a suitable loading screen pun...","Distracting you with this witty phrase...","Almost there... probably...","Hmmm... let me think...","That's not a bug, it's an undocumented feature...","Engage.","I'll be back... with an answer.","Letting the thoughts marinate...","Initiating thoughtful gaze...","Dividing by zero... just kidding!","Buffering... because even AIs need a moment.","Entangling quantum particles for a faster response...","Recalibrating the humor-o-meter.","Enhancing... Enhancing... Still loading.","Have you tried turning it off and on again? (The loading screen, not me.)","Constructing additional pylons...","New line? That's Ctrl+J."],Bpe=["正在努力搬砖，请稍候...","老板在身后，快加载啊！","头发掉光前，一定能加载完...","服务器正在深呼吸，准备放大招...","正在向服务器投喂咖啡...","正在赋能全链路，寻找关键抓手...","正在降本增效，优化加载路径...","正在打破部门壁垒，沉淀方法论...","正在拥抱变化，迭代核心价值...","正在对齐颗粒度，打磨底层逻辑...","大力出奇迹，正在强行加载...","只要我不写代码，代码就没有 Bug...","正在把 Bug 转化为 Feature...","只要我不尴尬，Bug 就追不上我...","正在试图理解去年的自己写了什么...","正在猿力觉醒中，请耐心等待...","正在询问产品经理：这需求是真的吗？","正在给产品经理画饼，请稍等...","每一行代码，都在努力让世界变得更好一点点...","每一个伟大的想法，都值得这份耐心的等待...","别急，美好的事物总是需要一点时间去酝酿...","愿你的代码永无 Bug，愿你的梦想终将成真...","哪怕只有 0.1% 的进度，也是在向目标靠近...","加载的是字节，承载的是对技术的热爱..."];function VT(e){return(e??(typeof navigator<"u"?navigator.language.toLowerCase():"")).toLowerCase().startsWith("zh")?Bpe:Lpe}function zpe(){const e=S3(),t=B1(),n=e!=="idle",r=v.useRef(0),i=v.useRef(0),[s,a]=v.useState({estimatedOutputTokens:0,isReceivingContent:!1}),o=v.useMemo(()=>{let c=0,u=0,d=!1;const f=new Set;let m=-1;for(let p=t.length-1;p>=0;p--)if(t[p].kind==="user"){m=p;break}for(let p=m+1;p<t.length;p++){const b=t[p];if(b.kind==="assistant"&&!b.parentToolCallId&&(c+=b.text.length,b.streaming&&(d=!0)),b.kind==="tool"&&!b.parentToolCallId){if(b.rawInput!==void 0)try{c+=JSON.stringify(b.rawInput).length}catch{}const x=Ppe(b.rawOutput);x!==void 0&&!f.has(b.toolCallId)&&(u+=x,f.add(b.toolCallId))}}return{chars:c,agentTokens:u,isReceiving:d}},[t]),l=v.useRef(o);return l.current=o,o.chars<i.current&&(r.current=o.chars),i.current=o.chars,v.useEffect(()=>{if(!n){r.current=0,a({estimatedOutputTokens:0,isReceivingContent:!1});return}const c=setInterval(()=>{const{chars:u,agentTokens:d,isReceiving:f}=l.current;if(u<r.current){r.current=u,a({estimatedOutputTokens:d+Math.round(u/4),isReceivingContent:f});return}const m=u-r.current;if(m<=0){a(x=>{const g={estimatedOutputTokens:d+Math.round(r.current/4),isReceivingContent:f};return x.estimatedOutputTokens===g.estimatedOutputTokens&&x.isReceivingContent===g.isReceivingContent?x:g});return}let p;m<70?p=3:m<=200?p=Math.max(3,Math.round(m*.2)):p=50;const b=Math.min(r.current+p,u);r.current=b,a({estimatedOutputTokens:d+Math.round(b/4),isReceivingContent:f})},100);return()=>clearInterval(c)},[n]),s}function Ppe(e){if(typeof e!="object"||e===null||!("type"in e)||e.type!=="task_execution")return;const t=e,n=t.tokenCount;if(typeof n=="number"&&n>0)return n;const r=t.executionSummary;if(typeof r=="object"&&r!==null){const i=r.totalTokens;if(typeof i=="number"&&i>0)return i}}function $pe(e){return e<1e3?`${e}`:e<1e4?`${(e/1e3).toFixed(1)}k`:`${Math.floor(e/1e3)}k`}const Upe="_status_14l8l_1",Hpe="_spinner_14l8l_12",qpe="_label_14l8l_16",Fpe="_meta_14l8l_20",ap={status:Upe,spinner:Hpe,label:qpe,meta:Fpe};function Vpe(){const e=S3(),{estimatedOutputTokens:t,isReceivingContent:n}=zpe(),{language:r,t:i}=ft(),[s,a]=v.useState(0),o=v.useRef(Date.now()),[l,c]=v.useState(0),[u,d]=v.useState(()=>VT(r)[0]??""),f=e!=="idle";if(v.useEffect(()=>{if(!f){a(0);return}o.current=Date.now(),a(0);const y=setInterval(()=>{a(Math.floor((Date.now()-o.current)/1e3))},1e3);return()=>clearInterval(y)},[f]),v.useEffect(()=>{const y=VT(r);if(e==="idle"||y.length===0){d(y[0]??"");return}const w=()=>{const E=Math.floor(Math.random()*y.length);d(y[E]??"")};w();const C=setInterval(w,jpe);return()=>clearInterval(C)},[r,e]),v.useEffect(()=>{if(e==="idle")return;const y=setInterval(()=>{c(w=>(w+1)%4)},250);return()=>clearInterval(y)},[e]),e==="idle")return null;const m=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],p=m[l%m.length],b=n?"↓":"↑",x=s<60?`${s}s`:Gpe(s*1e3),g=t>0?` · ${b} ${i("stream.tokens",{count:$pe(t)})}`:"";return h.jsxs("div",{className:ap.status,children:[h.jsx("span",{className:ap.spinner,children:p}),u&&h.jsx("span",{className:ap.label,children:u}),h.jsxs("span",{className:ap.meta,children:["(",x,g," · ",i("stream.cancel"),")"]})]})}function Gpe(e){if(e<=0)return"0s";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,s=[];return n>0&&s.push(`${n}h`),r>0&&s.push(`${r}m`),i>0&&s.push(`${i}s`),s.length>0?s.join(" "):"0s"}const Wpe="_host_1k5oc_1",Kpe="_toast_1k5oc_13",Ype="_message_1k5oc_32",Xpe="_close_1k5oc_40",Qpe="_info_1k5oc_59",Jpe="_success_1k5oc_67",Zpe="_warning_1k5oc_75",ege="_error_1k5oc_83",sf={host:Wpe,toast:Kpe,message:Ype,close:Xpe,info:Qpe,success:Jpe,warning:Zpe,error:ege};function tge({toasts:e,onDismiss:t,autoDismissMs:n=5e3}){return e.length===0?null:h.jsx("div",{className:sf.host,role:"status","aria-live":"polite",children:e.map(r=>h.jsx(nge,{toast:r,onDismiss:t,autoDismissMs:n},r.id))})}function nge({toast:e,onDismiss:t,autoDismissMs:n}){const{t:r}=ft();return v.useEffect(()=>{const i=window.setTimeout(()=>t(e.id),n);return()=>window.clearTimeout(i)},[n,t,e.id]),h.jsxs("div",{className:`${sf.toast} ${sf[e.tone]}`,children:[h.jsx("div",{className:sf.message,children:e.message}),h.jsx("button",{type:"button",className:sf.close,onClick:()=>t(e.id),"aria-label":r("toast.dismiss"),title:r("toast.dismissShort"),children:"x"})]})}const rge="_panel_hf9dp_1",ige="_header_hf9dp_11",sge="_toggle_hf9dp_18",age="_chevron_hf9dp_34",oge="_title_hf9dp_40",lge="_progress_hf9dp_47",cge="_collapsedCurrent_hf9dp_54",uge="_locate_hf9dp_64",dge="_list_hf9dp_81",hge="_item_hf9dp_91",fge="_num_hf9dp_101",mge="_icon_hf9dp_107",pge="_pending_hf9dp_112",gge="_content_hf9dp_116",yge="_inProgress_hf9dp_120",bge="_completed_hf9dp_128",vge="_moreLine_hf9dp_145",xge="_moreText_hf9dp_162",wge="_allDone_hf9dp_174",fn={panel:rge,header:ige,toggle:sge,chevron:age,title:oge,progress:lge,collapsedCurrent:cge,locate:uge,list:dge,item:hge,num:fge,icon:mge,pending:pge,content:gge,inProgress:yge,completed:bge,moreLine:vge,moreText:xge,allDone:wge},GT=5,KO="web-shell:todo-panel-collapsed";function kge(){try{return window.localStorage.getItem(KO)==="true"}catch{return!1}}function _ge(e){try{window.localStorage.setItem(KO,e?"true":"false")}catch{}}function WT(e){switch(e){case"completed":return fn.completed;case"in_progress":return fn.inProgress;case"pending":return fn.pending}}const Sge=v.memo(function({todos:t,title:n,onLocateSource:r}){const{t:i}=ft(),[s,a]=v.useState(kge),[o,l]=v.useState(!1);if(t.length===0)return null;const c=t.length,u=t.filter(T=>T.status==="completed").length,d=u===c,f=t.findIndex(T=>T.status==="in_progress"),m=f>=0?f:t.findIndex(T=>T.status==="pending"),p=m>=0?t[m]:void 0,{start:b,end:x}=o?{start:0,end:c}:Aae(t,GT),g=t.slice(b,x),y=b,w=c-x,C=t.slice(0,b).every(T=>T.status==="completed"),E=()=>{a(T=>{const j=!T;return _ge(j),j})},S=`${String(c).length+1}ch`;return h.jsxs("section",{className:fn.panel,"aria-label":n??i("todo.title"),children:[h.jsxs("div",{className:fn.header,children:[h.jsxs("button",{type:"button",className:fn.toggle,onClick:E,"aria-expanded":!s,title:i(s?"todo.expand":"todo.collapse"),children:[h.jsx("span",{className:fn.chevron,"aria-hidden":"true",children:s?"▸":"▾"}),h.jsx("span",{className:fn.title,children:n??i("todo.title")}),h.jsxs("span",{className:fn.progress,children:[u,"/",c]}),s&&(d?h.jsxs("span",{className:`${fn.collapsedCurrent} ${fn.allDone}`,children:["✓ ",i("todo.allDone")]}):p?h.jsxs("span",{className:`${fn.collapsedCurrent} ${WT(p.status)}`,children:[h.jsx("span",{className:fn.icon,"aria-hidden":"true",children:o0(p.status)}),h.jsx("span",{className:fn.content,title:p.content,children:p.content})]}):null)]}),r&&h.jsx("button",{type:"button",className:fn.locate,onClick:r,title:i("todo.locate"),"aria-label":i("todo.locate"),children:"↗"})]}),!s&&h.jsx("div",{className:fn.list,children:d?h.jsxs("div",{className:fn.allDone,children:["✓ ",i("todo.allDone")]}):h.jsxs(h.Fragment,{children:[y>0&&h.jsxs("button",{type:"button",className:fn.moreLine,onClick:()=>l(!0),children:[h.jsx("span",{className:fn.num,style:{width:S}}),h.jsx("span",{className:fn.moreText,children:C?i("todo.completedAbove",{count:y}):i("todo.moreAbove",{count:y})})]}),g.map((T,j)=>h.jsxs("div",{className:`${fn.item} ${WT(T.status)}`,children:[h.jsxs("span",{className:fn.num,style:{width:S},children:[b+j+1,"."]}),h.jsx("span",{className:fn.icon,"aria-hidden":"true",children:o0(T.status)}),h.jsx("span",{className:fn.content,title:T.content,children:T.content})]},T.id||b+j)),w>0&&h.jsxs("button",{type:"button",className:fn.moreLine,onClick:()=>l(!0),children:[h.jsx("span",{className:fn.num,style:{width:S}}),h.jsx("span",{className:fn.moreText,children:i("todo.more",{count:w})})]}),o&&c>GT&&h.jsxs("button",{type:"button",className:fn.moreLine,onClick:()=>l(!1),children:[h.jsx("span",{className:fn.num,style:{width:S}}),h.jsx("span",{className:fn.moreText,children:i("todo.showLess")})]})]})})]})}),Tge="_header_niipg_1",Cge="_banner_niipg_8",Ege="_logo_niipg_15",Age="_panel_niipg_29",Mge="_titleRow_niipg_41",Nge="_title_niipg_41",Ige="_version_niipg_54",Dge="_subtitle_niipg_59",Rge="_metaLine_niipg_63",Oge="_sep_niipg_76",jge="_terminalLabel_niipg_80",Lge="_model_niipg_85",Bge="_modelHint_niipg_93",zge="_cwd_niipg_99",Pge="_tip_niipg_108",$ge="_tipLabel_niipg_116",Uge="_tipText_niipg_120",Cr={header:Tge,banner:Cge,logo:Ege,panel:Age,titleRow:Mge,title:Nge,version:Ige,subtitle:Dge,metaLine:Rge,sep:Oge,terminalLabel:jge,model:Lge,modelHint:Bge,cwd:zge,tip:Pge,tipLabel:$ge,tipText:Uge},Hge=["Type / to open commands; Tab completes slash commands and saved prompts.","Add a QWEN.md file to give Qwen Code durable project context.","Use ! to run shell commands through Qwen Code, for example !ls.","When a chat gets long, use /compress to free context.","Use Shift+Tab or /approval-mode to switch approval modes quickly.","Use /clear or /new to start fresh; previous sessions stay resumable."],qge=["输入 / 打开命令弹窗；Tab 可以补全斜杠命令和已保存的 prompt。","添加 QWEN.md 文件，为 Qwen Code 提供持久的项目上下文。","可以使用 ! 从 Qwen Code 运行 shell 命令，例如 !ls。","对话变长时，使用 /compress 压缩历史并释放上下文。","使用 Shift+Tab 或 /approval-mode 快速切换权限模式。","使用 /clear 或 /new 开始新想法；之前的会话仍可从历史恢复。"],Fge=`
 ▄▄▄▄▄▄  ▄▄     ▄▄ ▄▄▄▄▄▄▄ ▄▄▄    ▄▄
██╔═══██╗██║    ██║██╔════╝████╗  ██║
██║   ██║██║ █╗ ██║█████╗  ██╔██╗ ██║
██║▄▄ ██║██║███╗██║██╔══╝  ██║╚██╗██║
╚██████╔╝╚███╔███╔╝███████╗██║ ╚████║
 ╚══▀▀═╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═══╝
`.trim();function Vge(e){const t=e==="zh-CN"?qge:Hge;return t[Math.floor(Math.random()*t.length)]}function Gge(e,t=72){if(!e||e.length<=t)return e;const n=Math.max(12,Math.floor((t-3)*.38)),r=Math.max(18,t-n-3);return`${e.slice(0,n)}...${e.slice(-r)}`}function Wge(e,t){switch(e){case"plan":return t("mode.plan");case"auto-edit":return t("mode.auto-edit");case"yolo":return t("mode.yolo");case"default":return t("mode.default");default:return e||t("mode.unknown")}}function Kge({version:e,cwd:t,currentModel:n,currentMode:r,hideTips:i=!1}){const{language:s,t:a}=ft(),o=v.useMemo(()=>Vge(s),[s]),l=v.useMemo(()=>Gge(t),[t]),c=n||a("welcome.defaultModel"),u=Wge(r,a);return h.jsxs("div",{className:Cr.header,children:[h.jsxs("div",{className:Cr.banner,children:[h.jsx("pre",{className:Cr.logo,"aria-hidden":"true",children:Fge}),h.jsxs("div",{className:Cr.panel,children:[h.jsxs("div",{className:Cr.titleRow,children:[h.jsx("span",{className:Cr.title,children:">_ Qwen Code"}),e&&h.jsxs("span",{className:Cr.version,children:["(v",e,")"]})]}),h.jsx("div",{className:Cr.subtitle,"aria-hidden":"true",children:" "}),h.jsxs("div",{className:Cr.metaLine,children:[h.jsx("span",{className:Cr.terminalLabel,children:"Web terminal"}),h.jsx("span",{className:Cr.sep,children:"|"}),h.jsx("span",{className:Cr.model,children:c}),h.jsx("span",{className:Cr.modelHint,children:a("welcome.changeModel")})]}),h.jsxs("div",{className:Cr.metaLine,children:[h.jsx("span",{children:u}),h.jsx("span",{className:Cr.modelHint,children:a("welcome.modeHint")})]}),l&&h.jsx("div",{className:Cr.cwd,title:t,children:l})]})]}),!i&&h.jsxs("div",{className:Cr.tip,children:[h.jsx("span",{className:Cr.tipLabel,children:a("welcome.tipLabel")}),h.jsx("span",{className:Cr.tipText,children:o})]})]})}const Yge="_panel_t3qdz_1",Xge="_header_t3qdz_17",Qge="_title_t3qdz_23",Jge="_list_t3qdz_27",Zge="_row_t3qdz_35",e1e="_selected_t3qdz_43",t1e="_label_t3qdz_43",n1e="_pointer_t3qdz_47",r1e="_number_t3qdz_55",i1e="_footer_t3qdz_66",ka={panel:Yge,header:Xge,title:Qge,list:Jge,row:Zge,selected:e1e,label:t1e,pointer:n1e,number:r1e,footer:i1e},YO="web-shell:approval-mode-panel-active";function s1e({currentMode:e,onSelect:t,onClose:n}){const{t:r}=ft(),i=v.useRef(`approval-mode-${Math.random().toString(36).slice(2)}`),s=v.useRef(null),a=v.useRef(null),o=v.useRef(n);v.useEffect(()=>{o.current=n},[n]);const l=d3.map(m=>({id:m,name:r(`mode.name.${m}`),description:r(`mode.desc.${m}`)})),[c,u]=v.useState(()=>{const m=l.findIndex(p=>p.id===e);return m>=0?m:0}),d=v.useCallback(m=>{window.dispatchEvent(new CustomEvent(YO,{detail:{id:i.current,active:m}}))},[]);v.useEffect(()=>(d(!0),()=>d(!1)),[d]),v.useEffect(()=>{const m=p=>{if(p instanceof MouseEvent&&p.button!==0||p.defaultPrevented)return;const b=a.current,x=p.target;b&&x instanceof Node&&!b.contains(x)&&o.current()};return window.addEventListener("mousedown",m),window.addEventListener("touchstart",m),()=>{window.removeEventListener("mousedown",m),window.removeEventListener("touchstart",m)}},[]),v.useEffect(()=>{c>=l.length&&l.length>0&&u(l.length-1)},[l.length,c]),v.useEffect(()=>{var p;const m=(p=s.current)==null?void 0:p.children[c];m==null||m.scrollIntoView({block:"nearest"})},[c]);const f=v.useCallback(()=>{const m=l[c];m&&(t(m.id),n())},[l,n,t,c]);return ui(m=>{if(m.defaultPrevented)return;const p=()=>{m.preventDefault(),m.stopPropagation()};if(m.key==="Escape"){p(),n();return}if(m.key==="ArrowDown"||m.key==="j"){p(),u(b=>l.length>0?(b+1)%l.length:0);return}if(m.key==="ArrowUp"||m.key==="k"){p(),u(b=>l.length>0?(b-1+l.length)%l.length:0);return}if(m.key==="Enter"){p(),f();return}},[l.length,f,n]),h.jsxs("div",{ref:a,className:ka.panel,children:[h.jsx("div",{className:ka.header,children:h.jsx("span",{className:ka.title,children:r("mode.select")})}),h.jsx("div",{className:ka.list,ref:s,role:"listbox","aria-label":r("mode.select"),children:l.map((m,p)=>{const b=p===c;return h.jsxs("div",{role:"option","aria-selected":b,className:`${ka.row} ${b?ka.selected:""}`,onClick:()=>{t(m.id),n()},onMouseEnter:()=>u(p),children:[h.jsx("span",{className:ka.pointer,children:b?"›":" "}),h.jsxs("span",{className:ka.number,children:[p+1,"."]}),h.jsxs("span",{className:ka.label,children:[m.name," - ",m.description]})]},m.id)})}),h.jsx("div",{className:ka.footer,children:r("mode.footer")})]})}const a1e="_selected_13bnm_115",o1e="_disabled_13bnm_131",l1e={"resume-picker":"_resume-picker_13bnm_4","resume-picker-header":"_resume-picker-header_13bnm_14","resume-picker-close":"_resume-picker-close_13bnm_21","resume-picker-title":"_resume-picker-title_13bnm_42","resume-picker-count":"_resume-picker-count_13bnm_48","resume-picker-search":"_resume-picker-search_13bnm_53","resume-picker-search-label":"_resume-picker-search-label_13bnm_62","resume-picker-search-input":"_resume-picker-search-input_13bnm_66","resume-picker-search-value":"_resume-picker-search-value_13bnm_76","resume-picker-search-hint":"_resume-picker-search-hint_13bnm_80","resume-picker-sep":"_resume-picker-sep_13bnm_84","resume-picker-list":"_resume-picker-list_13bnm_89","resume-picker-empty":"_resume-picker-empty_13bnm_95","resume-picker-item":"_resume-picker-item_13bnm_101","resume-picker-session-item":"_resume-picker-session-item_13bnm_108",selected:a1e,"resume-picker-keyboard-only":"_resume-picker-keyboard-only_13bnm_123",disabled:o1e,"resume-picker-item-row":"_resume-picker-item-row_13bnm_136","resume-picker-item-prefix":"_resume-picker-item-prefix_13bnm_145","resume-picker-item-title":"_resume-picker-item-title_13bnm_155","resume-picker-item-checkbox":"_resume-picker-item-checkbox_13bnm_168","resume-picker-item-number":"_resume-picker-item-number_13bnm_180","resume-picker-item-provider":"_resume-picker-item-provider_13bnm_188","resume-picker-item-meta":"_resume-picker-item-meta_13bnm_201","resume-picker-item-detail":"_resume-picker-item-detail_13bnm_210","resume-picker-item-check":"_resume-picker-item-check_13bnm_168","resume-picker-item-badge":"_resume-picker-item-badge_13bnm_226","mcp-status":"_mcp-status_13bnm_235","mcp-status-connected":"_mcp-status-connected_13bnm_239","mcp-status-connecting":"_mcp-status-connecting_13bnm_243","mcp-status-disconnected":"_mcp-status-disconnected_13bnm_247","mcp-status-disabled":"_mcp-status-disabled_13bnm_251","mcp-status-unknown":"_mcp-status-unknown_13bnm_252","resume-picker-item-current":"_resume-picker-item-current_13bnm_256","resume-picker-footer":"_resume-picker-footer_13bnm_261","resume-picker-detail-panel":"_resume-picker-detail-panel_13bnm_267","resume-picker-detail-row":"_resume-picker-detail-row_13bnm_277","resume-picker-detail-label":"_resume-picker-detail-label_13bnm_284","resume-picker-detail-value":"_resume-picker-detail-value_13bnm_289","dialog-inline-button":"_dialog-inline-button_13bnm_294","dialog-primary-button":"_dialog-primary-button_13bnm_295","dialog-danger-button":"_dialog-danger-button_13bnm_296","dialog-inline-actions":"_dialog-inline-actions_13bnm_319","dialog-form":"_dialog-form_13bnm_335","dialog-form-row":"_dialog-form-row_13bnm_363","dialog-textarea":"_dialog-textarea_13bnm_369","dialog-split":"_dialog-split_13bnm_374","dialog-split-list":"_dialog-split-list_13bnm_381","tools-desc-expanded":"_tools-desc-expanded_13bnm_385","tools-desc-body":"_tools-desc-body_13bnm_397","dialog-detail":"_dialog-detail_13bnm_404","dialog-detail-title":"_dialog-detail-title_13bnm_412","dialog-detail-shortcut":"_dialog-detail-shortcut_13bnm_420","dialog-detail-meta":"_dialog-detail-meta_13bnm_427","dialog-detail-body":"_dialog-detail-body_13bnm_432"};function ee(...e){return e.filter(t=>!!t).map(t=>l1e[t]).filter(Boolean).join(" ")}function a5(e,t){const n=Date.now()-new Date(e).getTime(),r=Math.floor(n/6e4);if(r<1)return t("time.justNow");if(r<60)return t("time.minutesAgo",{count:r});const i=Math.floor(r/60);if(i<24)return t("time.hoursAgo",{count:i});const s=Math.floor(i/24);return s<7?t("time.daysAgo",{count:s}):new Date(e).toLocaleDateString()}function c1e({onSelect:e,onClose:t}){const{t:n}=ft(),r=du(),{sessions:i,loading:s,error:a}=C3({autoLoad:!0}),o=r.sessionId,[l,c]=v.useState(0),[u,d]=v.useState(!1),[f,m]=v.useState(""),p=v.useRef(null),b=f?i.filter(g=>{const y=f.toLowerCase();return(g.displayName||"").toLowerCase().includes(y)||g.sessionId.toLowerCase().includes(y)}):i;v.useEffect(()=>{l>=b.length&&b.length>0&&c(b.length-1)},[b.length,l]),v.useEffect(()=>{var y;const g=(y=p.current)==null?void 0:y.children[l];g==null||g.scrollIntoView({block:"nearest"})},[l]);const x=v.useCallback(()=>{const g=b[l];g&&(e(g.sessionId),t())},[b,l,e,t]);return ui(g=>{if(u){if(g.key==="Escape"){g.preventDefault(),f?m(""):d(!1);return}if(g.key==="Enter"){g.preventDefault(),b.length>0&&d(!1);return}if(g.key==="ArrowUp"||g.key==="ArrowDown"){g.preventDefault(),d(!1),g.key==="ArrowDown"&&c(y=>Math.min(y+1,b.length-1));return}return}if(g.key==="Escape"){g.preventDefault(),f?(m(""),c(0)):t();return}if(g.key==="ArrowDown"||g.key==="j"){g.preventDefault(),c(y=>Math.min(y+1,b.length-1));return}if(g.key==="ArrowUp"||g.key==="k"){g.preventDefault(),l===0?d(!0):c(y=>Math.max(y-1,0));return}if(g.key==="Enter"){g.preventDefault(),x();return}if(g.key==="/"){g.preventDefault(),d(!0);return}},[u,f,b,l,t,x]),h.jsxs("div",{className:ee("resume-picker","resume-picker-keyboard-only"),children:[h.jsxs("div",{className:ee("resume-picker-header"),children:[h.jsx("span",{className:ee("resume-picker-title"),children:n("resume.title")}),f&&h.jsxs("span",{className:ee("resume-picker-count"),children:["(",b.length," matches)"]}),h.jsx("button",{className:ee("resume-picker-close"),onClick:t,title:n("common.close"),children:"ESC"})]}),h.jsx("div",{className:ee("resume-picker-search"),children:u?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:ee("resume-picker-search-label"),children:[n("resume.search"),":"," "]}),h.jsx("input",{className:ee("resume-picker-search-input"),value:f,onChange:g=>{m(g.target.value),c(0)},autoFocus:!0,placeholder:""})]}):f?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:ee("resume-picker-search-label"),children:[n("resume.filter"),":"," "]}),h.jsx("span",{className:ee("resume-picker-search-value"),children:f})]}):h.jsx("span",{className:ee("resume-picker-search-hint"),children:n("resume.pressSearch")})}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsxs("div",{className:ee("resume-picker-list"),ref:p,children:[s&&h.jsx("div",{className:ee("resume-picker-empty"),children:n("common.loading")}),!s&&a&&h.jsx("div",{className:ee("resume-picker-empty"),children:a.message||"Failed to load sessions"}),!s&&!a&&b.length===0&&h.jsx("div",{className:ee("resume-picker-empty"),children:f?n("resume.noMatch",{query:f}):n("resume.none")}),!s&&b.map((g,y)=>{const w=g.sessionId===o;return h.jsxs("div",{className:ee("resume-picker-item","resume-picker-session-item",y===l&&!u?"selected":void 0,w?"resume-picker-item-current":void 0),onClick:()=>{e(g.sessionId),t()},children:[h.jsxs("div",{className:ee("resume-picker-item-row"),children:[h.jsx("span",{className:ee("resume-picker-item-prefix"),children:y===l&&!u?"›":" "}),h.jsx("span",{className:ee("resume-picker-item-title"),children:g.displayName||g.sessionId.slice(0,8)}),w&&h.jsx("span",{className:ee("resume-picker-item-badge"),children:n("resume.current")})]}),h.jsxs("div",{className:ee("resume-picker-item-meta"),children:[h.jsx("span",{children:(g.updatedAt||g.createdAt)&&a5(g.updatedAt||g.createdAt||"",n)}),h.jsx("span",{className:ee("resume-picker-item-detail"),children:n("common.clients",{count:g.clientCount??0})}),g.hasActivePrompt&&h.jsx("span",{className:ee("resume-picker-item-detail"),children:n("resume.activePrompt")})]})]},g.sessionId)})]}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsx("div",{className:ee("resume-picker-footer"),children:n(u?"dialog.footer.search":"dialog.footer.navSelectCancel")})]})}const u1e="_panel_lkmzh_1",d1e="_titleLine_lkmzh_14",h1e="_icon_lkmzh_21",f1e="_title_lkmzh_14",m1e="_subtitle_lkmzh_33",p1e="_stepHeader_lkmzh_38",g1e="_text_lkmzh_45",y1e="_options_lkmzh_51",b1e="_option_lkmzh_51",v1e="_optionActive_lkmzh_66",x1e="_optionLabel_lkmzh_66",w1e="_pointer_lkmzh_71",k1e="_optionContent_lkmzh_82",_1e="_optionDesc_lkmzh_92",S1e="_badge_lkmzh_98",T1e="_colorDot_lkmzh_107",C1e="_colorPreview_lkmzh_116",E1e="_toolDetail_lkmzh_149",A1e="_toolDetailTitle_lkmzh_154",M1e="_toolDetailBody_lkmzh_159",N1e="_toolList_lkmzh_160",I1e="_textInput_lkmzh_172",D1e="_textArea_lkmzh_190",R1e="_summary_lkmzh_210",O1e="_summaryRow_lkmzh_217",j1e="_summaryLabel_lkmzh_223",L1e="_summaryValue_lkmzh_229",B1e="_summaryBlockTitle_lkmzh_234",z1e="_summaryBlock_lkmzh_234",P1e="_hiddenAction_lkmzh_248",$1e="_groupLabel_lkmzh_260",U1e="_footer_lkmzh_273",H1e="_agentCount_lkmzh_281",q1e="_viewer_lkmzh_286",F1e="_viewerRow_lkmzh_310",V1e="_viewerLabel_lkmzh_317",G1e="_viewerSectionTitle_lkmzh_322",W1e="_viewerBlock_lkmzh_327",K1e="_closed_lkmzh_334",Y1e="_closedText_lkmzh_338",X1e="_loading_lkmzh_344",Q1e="_error_lkmzh_349",de={panel:u1e,titleLine:d1e,icon:h1e,title:f1e,subtitle:m1e,stepHeader:p1e,text:g1e,options:y1e,option:b1e,optionActive:v1e,optionLabel:x1e,pointer:w1e,optionContent:k1e,optionDesc:_1e,badge:S1e,colorDot:T1e,colorPreview:C1e,toolDetail:E1e,toolDetailTitle:A1e,toolDetailBody:M1e,toolList:N1e,textInput:I1e,textArea:D1e,summary:R1e,summaryRow:O1e,summaryLabel:j1e,summaryValue:L1e,summaryBlockTitle:B1e,summaryBlock:z1e,hiddenAction:P1e,groupLabel:$1e,footer:U1e,agentCount:H1e,viewer:q1e,viewerRow:F1e,viewerLabel:V1e,viewerSectionTitle:G1e,viewerBlock:W1e,closed:K1e,closedText:Y1e,loading:X1e,error:Q1e},XO="web-shell:agents-panel-active",go=[{id:"auto",name:"Automatic Color",value:"auto"},{id:"blue",name:"Blue",value:"#3b82f6"},{id:"green",name:"Green",value:"#10b981"},{id:"purple",name:"Purple",value:"#8b5cf6"},{id:"orange",name:"Orange",value:"#f59e0b"},{id:"red",name:"Red",value:"#ef4444"},{id:"cyan",name:"Cyan",value:"#06b6d4"}];function o4(e,t){window.dispatchEvent(new CustomEvent(XO,{detail:{id:e,active:t}}))}function Fp(e){if(e==="project")return"workspace";if(e==="user")return"global"}function af(e){return Fp(e.level)!==void 0&&!e.isBuiltin&&e.level!=="extension"}function QO(e){return e&&e!=="auto"?e:void 0}function J1e(e){return e.displayName||e.name}function o5(e){const t=e.toLowerCase();return["read","grep","glob","ls","list","search","fetch","webfetch","web_fetch","websearch","web_search","think","todo","context"].some(n=>t.includes(n))}function l5(e){const t=e.toLowerCase();return["edit","write","delete","move","patch","replace","create"].some(n=>t.includes(n))}function c5(e){const t=e.toLowerCase();return["shell","exec","run","command","terminal","bash","spawn"].some(n=>t.includes(n))}function KT(e,t){if(!t||t.length===0)return 0;const n=new Set(t),r=e.findIndex(i=>i.id==="all"||i.tools.length!==n.size?!1:i.tools.every(s=>n.has(s)));return r>=0?r:0}function Z1e({mode:e,onMessage:t,onClose:n}){var me;const{t:r}=ft(),{agents:i,loading:s,reload:a,getAgent:o,createAgent:l,generateAgent:c,deleteAgent:u,updateAgent:d}=vU({autoLoad:!0}),{tools:f}=JA({autoLoad:!0}),[m,p]=v.useState(!1),b=v.useRef(`agents-${Math.random().toString(36).slice(2)}`),[x,g]=v.useState(()=>e==="manage"?"manage":e==="create"||e==="create-user"||e==="create-project"?"create":"menu"),[y,w]=v.useState(0),[C,E]=v.useState(["agent-selection"]),[S,T]=v.useState(0),[j,z]=v.useState(null),[R,D]=v.useState(0),[N,B]=v.useState(!1),[P,J]=v.useState(null),[q,W]=v.useState(1),[$,Z]=v.useState(()=>e==="create-user"?"global":"workspace"),[M,X]=v.useState("manual"),[H,O]=v.useState(""),[se,ke]=v.useState(""),[be,Ee]=v.useState(""),[qe,wt]=v.useState("auto"),[Mt,bt]=v.useState([]),[Je,Ge]=v.useState(0),[Pt,Ze]=v.useState(!1),[re,le]=v.useState(!1),De=v.useRef(0),We=C[C.length-1],pe=v.useCallback(()=>{p(!0),o4(b.current,!1),n()},[n]);v.useEffect(()=>{if(m)return;const G=b.current;return o4(G,!0),()=>o4(G,!1)},[m]);const st=v.useMemo(()=>{const G=i.filter(et=>et.level==="project"),ne=i.filter(et=>et.level==="user"),Ke=i.filter(et=>et.level==="builtin"),St=i.filter(et=>et.level==="extension");return{project:G,user:ne,builtin:Ke,extension:St}},[i]),ae=v.useMemo(()=>[...st.project,...st.user,...st.builtin,...st.extension],[st]),je=v.useMemo(()=>{const G=f.filter(et=>et.enabled).map(J1e).sort((et,$t)=>et.localeCompare($t)),ne=G.filter(o5),Ke=G.filter(l5),St=G.filter(c5);return[{id:"all",label:r("agent.create.tools.all"),tools:[]},{id:"read",label:r("agent.create.tools.readOnly"),tools:ne},{id:"edit",label:r("agent.create.tools.readEdit"),tools:[...new Set([...ne,...Ke])]},{id:"execute",label:r("agent.create.tools.readEditExecute"),tools:[...new Set([...ne,...Ke,...St])]}]},[r,f]);v.useEffect(()=>{if(x!=="manage")return;const G=ae[S];G&&(We==="action-selection"||We==="agent-viewer"||We==="edit-options"||We==="edit-tools"||We==="edit-color"||We==="delete-confirmation")&&o(G.name).then(z).catch(ne=>J(ne instanceof Error?ne.message:String(ne)))},[x,ae,S,We,o]),v.useEffect(()=>{S>=ae.length&&ae.length>0&&T(ae.length-1)},[ae.length,S]);const Oe=v.useCallback(G=>{E(ne=>[...ne,G]),D(0)},[]),$e=v.useCallback(()=>{E(G=>G.length<=1?G:G.slice(0,-1)),D(0)},[]),te=v.useCallback(()=>{const G=ae[S];if(!G||!af(G))return;const ne=Fp(G.level);ne&&(B(!0),u(G.name,ne).then(()=>{t(r("agent.deleted",{name:G.name})),z(null),E(["agent-selection"]),T(0),a()}).catch(Ke=>J(Ke instanceof Error?Ke.message:String(Ke))).finally(()=>B(!1)))},[ae,S,u,t,a,r]),ye=v.useCallback(G=>{const ne=ae[S];if(!ne||!af(ne))return;const Ke=Fp(ne.level);Ke&&(B(!0),d(ne.name,{color:G},Ke).then(()=>{t(r("agent.colorUpdated",{name:ne.name})),$e(),a()}).catch(St=>J(St instanceof Error?St.message:String(St))).finally(()=>B(!1)))},[ae,S,d,t,$e,a,r]),Te=v.useCallback(G=>{const ne=ae[S];if(!ne||!af(ne))return;const Ke=Fp(ne.level);Ke&&(B(!0),d(ne.name,{tools:G},Ke).then(()=>{t(r("agent.toolsUpdated",{name:ne.name})),$e(),a()}).catch(St=>J(St instanceof Error?St.message:String(St))).finally(()=>B(!1)))},[ae,S,d,t,$e,a,r]),Pe=v.useCallback(()=>{if(!H.trim()||!se.trim()||!be.trim()){J(r("agent.create.required"));return}B(!0),l({name:H.trim(),description:se.trim(),systemPrompt:be.trim(),scope:$,tools:Mt,color:qe!=="auto"?qe:void 0}).then(G=>{t(r("agent.created",{name:G.agent.name})),pe()}).catch(G=>J(G instanceof Error?G.message:String(G))).finally(()=>B(!1))},[H,se,be,$,Mt,qe,l,t,pe,r]),dt=M==="manual"?8:6,Ht=M==="manual"?6:4,Xt=M==="manual"?7:5;ui(G=>{var Ke,St;if(m||re||G.defaultPrevented)return;const ne=()=>{G.preventDefault(),G.stopPropagation()};if(x==="menu"){G.key==="ArrowDown"||G.key==="j"?(ne(),w(et=>Math.min(et+1,1))):G.key==="ArrowUp"||G.key==="k"?(ne(),w(et=>Math.max(et-1,0))):G.key==="Enter"||G.key===" "?(ne(),g(y===0?"manage":"create")):G.key==="Escape"&&(ne(),pe());return}if(x==="manage"){if(G.key==="Escape"){ne(),C.length<=1?e==="manage"?pe():(g("menu"),w(0)):$e();return}if(We==="agent-selection"){const et=ae.length;G.key==="ArrowDown"||G.key==="j"?(ne(),T($t=>Math.min($t+1,et-1))):G.key==="ArrowUp"||G.key==="k"?(ne(),T($t=>Math.max($t-1,0))):(G.key==="Enter"||G.key===" ")&&(ne(),et>0&&Oe("action-selection"));return}if(We==="action-selection"){const et=ae[S],Tt=(et?!af(et):!0)?["view","back"]:["view","edit","delete","back"],or=Tt.length;if(G.key==="ArrowDown"||G.key==="j")ne(),D(Yn=>Math.min(Yn+1,or-1));else if(G.key==="ArrowUp"||G.key==="k")ne(),D(Yn=>Math.max(Yn-1,0));else if(G.key==="Enter"||G.key===" "){ne();const Yn=Tt[R];Yn==="view"?Oe("agent-viewer"):Yn==="edit"?Oe("edit-options"):Yn==="delete"?Oe("delete-confirmation"):Yn==="back"&&$e()}return}if(We==="agent-viewer")return;if(We==="edit-options"){const et=["tools","color","back"],$t=et.length;if(G.key==="ArrowDown"||G.key==="j")ne(),D(Tt=>Math.min(Tt+1,$t-1));else if(G.key==="ArrowUp"||G.key==="k")ne(),D(Tt=>Math.max(Tt-1,0));else if(G.key==="Enter"||G.key===" "){ne();const Tt=et[R];Tt==="tools"?(Oe("edit-tools"),D(KT(je,j==null?void 0:j.tools))):Tt==="color"?Oe("edit-color"):Tt==="back"&&$e()}return}if(We==="edit-tools"){const et=je.length;G.key==="ArrowDown"||G.key==="j"?(ne(),D($t=>Math.min($t+1,et-1))):G.key==="ArrowUp"||G.key==="k"?(ne(),D($t=>Math.max($t-1,0))):(G.key==="Enter"||G.key===" ")&&(ne(),N||Te(((Ke=je[R])==null?void 0:Ke.tools)??[]));return}if(We==="edit-color"){const et=go.length;G.key==="ArrowDown"||G.key==="j"?(ne(),D($t=>Math.min($t+1,et-1))):G.key==="ArrowUp"||G.key==="k"?(ne(),D($t=>Math.max($t-1,0))):(G.key==="Enter"||G.key===" ")&&(ne(),N||ye(go[R].value));return}if(We==="delete-confirmation"){G.key==="y"||G.key==="Enter"?(ne(),N||te()):G.key==="n"&&(ne(),$e());return}return}if(x==="create"){if(Pt){G.key==="Escape"&&(ne(),De.current+=1,Ze(!1),le(!0));return}if(G.key==="Escape"){ne(),q<=1?e==="create"||e==="create-user"||e==="create-project"?pe():(g("menu"),w(1)):(W($t=>$t-1),Ge(0));return}if(q===1){G.key==="ArrowDown"||G.key==="j"?(ne(),Ge($t=>Math.min($t+1,1))):G.key==="ArrowUp"||G.key==="k"?(ne(),Ge($t=>Math.max($t-1,0))):(G.key==="Enter"||G.key===" ")&&(ne(),Z(Je===0?"workspace":"global"),W(2),Ge(0));return}if(q===2){G.key==="ArrowDown"||G.key==="j"?(ne(),Ge($t=>Math.min($t+1,1))):G.key==="ArrowUp"||G.key==="k"?(ne(),Ge($t=>Math.max($t-1,0))):(G.key==="Enter"||G.key===" ")&&(ne(),X(Je===0?"qwen":"manual"),W(3),Ge(0),le(!0));return}if(M==="manual"&&q>=3&&q<=5){le(!0);return}if(M==="qwen"&&q===3){le(!0);return}if(q===Ht){const $t=je.length;G.key==="ArrowDown"||G.key==="j"?(ne(),Ge(Tt=>Math.min(Tt+1,$t-1))):G.key==="ArrowUp"||G.key==="k"?(ne(),Ge(Tt=>Math.max(Tt-1,0))):(G.key==="Enter"||G.key===" ")&&(ne(),bt(((St=je[Je])==null?void 0:St.tools)??[]),W(Tt=>Tt+1),Ge(0));return}if(q===Xt){const $t=go.length;G.key==="ArrowDown"||G.key==="j"?(ne(),Ge(Tt=>Math.min(Tt+1,$t-1))):G.key==="ArrowUp"||G.key==="k"?(ne(),Ge(Tt=>Math.max(Tt-1,0))):(G.key==="Enter"||G.key===" ")&&(ne(),wt(go[Je].value),W(Tt=>Tt+1),Ge(0));return}if(M==="manual"&&q===dt||M==="qwen"&&q===dt){(G.key==="Enter"||G.key===" "||G.key==="s"||G.key==="e")&&(ne(),N||Pe());return}}},[m,re,x,e,y,C,We,ae,S,R,N,Pt,q,Je,M,$,dt,Ht,Xt,je,pe,Oe,$e,te,ye,Te,Pe,j==null?void 0:j.tools]);const Dn=v.useCallback(async()=>{const G=se.trim();if(!G||Pt)return;const ne=De.current+1;De.current=ne,Ze(!0),le(!1),J(null);try{const Ke=await c(G);if(De.current!==ne)return;O(Ke.name),ke(Ke.description),Ee(Ke.systemPrompt),W(M==="manual"?6:4),Ge(0)}catch(Ke){if(De.current!==ne)return;J(r("agent.create.generateFailed",{error:Ke instanceof Error?Ke.message:String(Ke)})),le(!0)}finally{De.current===ne&&Ze(!1)}},[se,Pt,M,c,r]),jn=v.useCallback((G,ne)=>{if(G.key==="Enter"&&!G.shiftKey){if(G.preventDefault(),G.stopPropagation(),ne==="name"&&H.trim())W(4),le(!0);else if(ne==="prompt"&&be.trim())W(5),le(!0);else if(ne==="desc"&&se.trim()){if(M==="qwen"){Dn();return}W(M==="manual"?6:4),Ge(0),le(!1)}}else G.key==="Escape"&&(G.preventDefault(),G.stopPropagation(),le(!1),W(Ke=>Ke-1),Ge(0))},[H,se,be,M,Dn]);if(m)return h.jsx("div",{className:`${de.panel} ${de.closed}`,children:h.jsx("div",{className:de.closedText,children:r("agents.closed")})});if(s&&i.length===0)return h.jsxs("div",{className:de.panel,children:[h.jsxs("div",{className:de.titleLine,children:[h.jsx("span",{className:de.icon,children:"?"}),h.jsx("span",{className:de.title,children:r("agents.title")})]}),h.jsx("div",{className:de.loading,children:r("common.loading")})]});const Zn=((me=ae[S])==null?void 0:me.name)??"",Sn=x==="manage"&&We==="agent-viewer"?QO(j==null?void 0:j.color):void 0,_r=x==="manage"?We==="agent-selection"?r("agents.title"):We==="action-selection"?r("agent.chooseActionTitle"):We==="agent-viewer"?Zn:We==="edit-options"?r("agent.editTitle",{name:Zn}):We==="edit-tools"?r("agent.edit.tools"):We==="edit-color"?r("agent.editColorTitle",{name:Zn}):r("agent.delete.title",{name:Zn}):r("agents.title");return h.jsxs("div",{className:de.panel,children:[x!=="create"&&h.jsxs("div",{className:de.titleLine,children:[h.jsx("span",{className:de.icon,children:"?"}),h.jsx("span",{className:de.title,style:{color:Sn},children:_r}),h.jsx("span",{className:de.subtitle,children:r("agent.count",{count:i.length})})]}),P&&h.jsx("div",{className:de.error,children:P}),x==="menu"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.text,children:r("agent.selectAction")}),h.jsxs("div",{className:de.options,children:[h.jsx(ns,{idx:0,active:y===0,label:r("agent.manage"),desc:r("agent.manage.desc"),onClick:()=>{w(0),g("manage")},onHover:()=>w(0)}),h.jsx(ns,{idx:1,active:y===1,label:r("agent.create"),desc:r("agent.create.desc"),onClick:()=>{w(1),g("create")},onHover:()=>w(1)})]}),h.jsx("div",{className:de.footer,children:r("agent.footer.nav")})]}),x==="manage"&&h.jsx(eye,{step:We,agents:ae,agentGroups:st,selectedAgentIdx:S,selectedAgent:j,selIdx:R,busy:N,toolCategories:je,onSelectAgent:G=>{T(G),Oe("action-selection")},onHoverAgent:T,onSelectAction:G=>{G==="view"?Oe("agent-viewer"):G==="edit"?Oe("edit-options"):G==="delete"?Oe("delete-confirmation"):G==="back"&&$e()},onHoverAction:D,onSelectEditOption:G=>{G==="tools"?(Oe("edit-tools"),D(KT(je,j==null?void 0:j.tools))):G==="color"?Oe("edit-color"):G==="back"&&$e()},onSelectTools:G=>{N||Te(G)},onSelectColor:G=>{N||ye(G)},onHoverColor:D,t:r}),x==="create"&&h.jsx(tye,{step:q,totalSteps:dt,method:M,scope:$,name:H,desc:se,prompt:be,color:qe,tools:Mt,toolCategories:je,selIdx:Je,busy:N,generating:Pt,inputFocused:re,onSetName:O,onSetDesc:ke,onSetPrompt:Ee,onInputKeyDown:jn,onInputFocus:()=>le(!0),onInputBlur:()=>le(!1),onSelectLocation:G=>{Ge(G),Z(G===0?"workspace":"global"),W(2),Ge(0)},onHoverLocation:Ge,onSelectMethod:G=>{Ge(G),X(G===0?"qwen":"manual"),W(3),Ge(0),le(!0)},onHoverMethod:Ge,onSelectTools:G=>{var ne;bt(((ne=je[G])==null?void 0:ne.tools)??[]),W(Ke=>Ke+1),Ge(0)},onHoverTools:Ge,onSelectColor:G=>{wt(go[G].value),W(ne=>ne+1),Ge(0)},onHoverColor:Ge,onSave:()=>{N||Pe()},t:r})]})}function ns({idx:e,active:t,label:n,desc:r,badge:i,colorDot:s,numbered:a=!1,onClick:o,onHover:l}){return h.jsxs("div",{className:`${de.option} ${t?de.optionActive:""}`,onClick:o,onMouseEnter:l,children:[h.jsx("span",{className:de.pointer,children:t?"›":" "}),h.jsxs("span",{className:de.optionContent,children:[h.jsxs("span",{className:de.optionLabel,children:[a?`${e+1}. `:"",s&&h.jsx("span",{className:de.colorDot,style:{backgroundColor:s==="auto"?"#888":s}}),n,i&&h.jsx("span",{className:de.badge,children:i})]}),r&&h.jsx("span",{className:de.optionDesc,children:r})]})]})}function eye({step:e,agents:t,agentGroups:n,selectedAgentIdx:r,selectedAgent:i,selIdx:s,busy:a,toolCategories:o,onSelectAgent:l,onHoverAgent:c,onSelectAction:u,onHoverAction:d,onSelectEditOption:f,onSelectTools:m,onSelectColor:p,onHoverColor:b,t:x}){if(e==="agent-selection"){if(t.length===0)return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.text,children:x("agent.empty")}),h.jsx("div",{className:de.text,children:x("agent.createFirstHint")}),h.jsx("div",{className:de.footer,children:x("agent.footer.close")})]});let g=0;const y=new Set(n.project.map(C=>C.name)),w=(C,E)=>{if(E.length===0)return null;const S=g;return g+=E.length,h.jsxs("div",{children:[h.jsx("div",{className:de.groupLabel,children:C}),h.jsx("div",{className:de.options,children:E.map((T,j)=>h.jsx(ns,{idx:S+j,active:r===S+j,label:T.name,colorDot:QO(T.color),badge:T.isBuiltin?x("agent.builtInBadge"):T.level==="user"&&y.has(T.name)?x("agent.overriddenBadge"):void 0,onClick:()=>l(S+j),onHover:()=>c(S+j)},`${T.level}:${T.name}`))})]},C)};return h.jsxs(h.Fragment,{children:[w(x("agent.level.project"),n.project),w(x("agent.level.user"),n.user),w(x("agent.level.builtin"),n.builtin),w(x("agent.level.extension"),n.extension),h.jsx("div",{className:de.agentCount,children:x("agent.usingCount",{count:n.project.length+n.user.filter(C=>!y.has(C.name)).length+n.builtin.length+n.extension.length})}),h.jsx("div",{className:de.footer,children:x("agent.footer.cliSelect")})]})}if(e==="action-selection"){const g=t[r],w=(g?!af(g):!0)?[{id:"view",label:x("agent.action.view")},{id:"back",label:x("agent.back")}]:[{id:"view",label:x("agent.action.view")},{id:"edit",label:x("agent.action.edit")},{id:"delete",label:x("agent.action.delete")},{id:"back",label:x("agent.back")}];return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.options,children:w.map((C,E)=>h.jsx(ns,{idx:E,active:s===E,label:C.label,onClick:()=>u(C.id),onHover:()=>d(E)},C.id))}),h.jsx("div",{className:de.footer,children:x("agent.footer.cliBack")})]})}if(e==="agent-viewer")return h.jsxs(h.Fragment,{children:[i?h.jsxs("div",{className:de.viewer,children:[h.jsxs("div",{className:de.viewerRow,children:[h.jsx("span",{className:de.viewerLabel,children:x("agent.filePathLabel")}),h.jsx("span",{children:i.filePath||""})]}),h.jsxs("div",{className:de.viewerRow,children:[h.jsx("span",{className:de.viewerLabel,children:x("agent.toolsLabel")}),h.jsx("span",{children:i.tools&&i.tools.length>0?i.tools.join(", "):"*"})]}),i.model&&h.jsxs("div",{className:de.viewerRow,children:[h.jsx("span",{className:de.viewerLabel,children:x("agent.modelLabel")}),h.jsx("span",{children:i.model})]}),i.color&&i.color!=="auto"&&h.jsxs("div",{className:de.viewerRow,children:[h.jsx("span",{className:de.viewerLabel,children:x("agent.colorLabel")}),h.jsx("span",{style:{color:i.color},children:i.color})]}),h.jsx("div",{className:de.viewerSectionTitle,children:x("agent.descriptionLabel")}),h.jsx("div",{className:de.viewerBlock,children:i.description}),h.jsx("div",{className:de.viewerSectionTitle,children:x("agent.systemPromptLabel")}),h.jsx("div",{className:de.viewerBlock,children:i.systemPrompt})]}):h.jsx("div",{className:de.loading,children:x("common.loading")}),h.jsx("div",{className:de.footer,children:x("agent.footer.viewerBack")})]});if(e==="edit-options"){const g=[{id:"tools",label:x("agent.edit.tools")},{id:"color",label:x("agent.edit.color")},{id:"back",label:x("agent.back")}];return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.options,children:g.map((y,w)=>h.jsx(ns,{idx:w,active:s===w,label:y.label,onClick:()=>f(y.id),onHover:()=>d(w)},y.id))}),h.jsx("div",{className:de.footer,children:x("agent.footer.cliBack")})]})}if(e==="edit-tools"){const g=o[s]??o[0],y=(g==null?void 0:g.tools)??[],w=y.filter(o5),C=y.filter(l5),E=y.filter(c5);return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.options,children:o.map((S,T)=>h.jsx(ns,{idx:T,active:s===T,label:S.label,numbered:!0,onClick:()=>m(S.tools),onHover:()=>d(T)},S.id))}),h.jsx("div",{className:de.toolDetail,children:(g==null?void 0:g.id)==="all"?h.jsx("div",{className:de.toolDetailBody,children:x("agent.create.tools.allInfo")}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.toolDetailTitle,children:x("agent.create.tools.selected")}),h.jsx("div",{className:de.toolList,children:y.length===0?x("agent.create.tools.none"):h.jsxs(h.Fragment,{children:[w.length>0&&h.jsxs("div",{children:[x("agent.create.tools.readOnlyLabel")," ",w.join(", ")]}),C.length>0&&h.jsxs("div",{children:[x("agent.create.tools.editLabel")," ",C.join(", ")]}),E.length>0&&h.jsxs("div",{children:[x("agent.create.tools.executionLabel")," ",E.join(", ")]})]})})]})}),h.jsx("div",{className:de.footer,children:x("agent.footer.cliBack")})]})}if(e==="edit-color")return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.options,children:go.map((g,y)=>h.jsx(ns,{idx:y,active:s===y,label:g.name,colorDot:g.value,onClick:()=>p(g.value),onHover:()=>b(y)},g.id))}),h.jsx("div",{className:de.footer,children:x("agent.footer.cliBack")})]});if(e==="delete-confirmation"){const g=t[r];return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.text,children:a?x("agent.delete.loading"):x("agent.delete.confirm",{name:(g==null?void 0:g.name)??""})}),h.jsx("div",{className:de.footer,children:x("agent.footer.deleteConfirm")})]})}return null}function tye({step:e,totalSteps:t,method:n,scope:r,name:i,desc:s,prompt:a,color:o,tools:l,toolCategories:c,selIdx:u,busy:d,generating:f,inputFocused:m,onSetName:p,onSetDesc:b,onSetPrompt:x,onInputKeyDown:g,onInputFocus:y,onInputBlur:w,onSelectLocation:C,onHoverLocation:E,onSelectMethod:S,onHoverMethod:T,onSelectTools:j,onHoverTools:z,onSelectColor:R,onHoverColor:D,onSave:N,t:B}){var M,X;const P=v.useRef(null),J=v.useRef(null),q=v.useRef(null);v.useEffect(()=>{var H,O,se,ke;m&&(n==="manual"?e===3?(H=P.current)==null||H.focus():e===4?(O=q.current)==null||O.focus():e===5&&((se=J.current)==null||se.focus()):e===3&&((ke=J.current)==null||ke.focus()))},[e,n,m]);const W=H=>`${B("agent.step",{n:e})}: ${H}`;if(e===1)return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.location"))}),h.jsxs("div",{className:de.options,children:[h.jsx(ns,{idx:0,active:u===0,label:B("agent.create.project.cli"),numbered:!0,onClick:()=>C(0),onHover:()=>E(0)}),h.jsx(ns,{idx:1,active:u===1,label:B("agent.create.user.cli"),numbered:!0,onClick:()=>C(1),onHover:()=>E(1)})]}),h.jsx("div",{className:de.footer,children:B("agent.footer.createLocation")})]});if(e===2)return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.method"))}),h.jsxs("div",{className:de.options,children:[h.jsx(ns,{idx:0,active:u===0,label:B("agent.create.method.qwen.recommended"),numbered:!0,onClick:()=>S(0),onHover:()=>T(0)}),h.jsx(ns,{idx:1,active:u===1,label:B("agent.create.method.manual"),numbered:!0,onClick:()=>S(1),onHover:()=>T(1)})]}),h.jsx("div",{className:de.footer,children:B("agent.footer.createContinue")})]});if(n==="manual"&&e===3)return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.enterName"))}),h.jsx("div",{className:de.text,children:B("agent.create.nameHelp")}),h.jsx("input",{ref:P,className:de.textInput,value:i,onChange:H=>p(H.target.value),onKeyDown:H=>g(H,"name"),onFocus:y,onBlur:w,placeholder:B("agent.create.namePlaceholder"),autoFocus:!0}),h.jsx("div",{className:de.footer,children:B("agent.footer.enterNext")})]});if(n==="manual"&&e===4)return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.enterPrompt"))}),h.jsx("div",{className:de.text,children:B("agent.create.promptHelp")}),h.jsx("textarea",{ref:q,className:de.textArea,value:a,onChange:H=>x(H.target.value),onKeyDown:H=>g(H,"prompt"),onFocus:y,onBlur:w,placeholder:B("agent.create.promptPlaceholder.cli"),autoFocus:!0}),h.jsx("div",{className:de.footer,children:B("agent.footer.enterNext")})]});if(n==="manual"&&e===5)return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.enterDescription"))}),h.jsx("div",{className:de.text,children:B("agent.create.manualDescHelp")}),h.jsx("textarea",{ref:J,className:de.textArea,value:s,onChange:H=>b(H.target.value),onKeyDown:H=>g(H,"desc"),onFocus:y,onBlur:w,placeholder:B("agent.create.manualDescPlaceholder"),autoFocus:!0}),h.jsx("div",{className:de.footer,children:B("agent.footer.enterNext")})]});if(n==="qwen"&&e===3)return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.describeAgent"))}),h.jsx("div",{className:de.text,children:B("agent.create.qwenHint")}),f?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.text,children:B("agent.create.generatingConfig")}),h.jsx("div",{className:de.footer,children:B("agent.footer.generating")})]}):h.jsxs(h.Fragment,{children:[h.jsx("textarea",{ref:J,className:de.textArea,value:s,onChange:H=>b(H.target.value),onKeyDown:H=>g(H,"desc"),onFocus:y,onBlur:w,placeholder:B("agent.create.qwenPlaceholder"),autoFocus:!0}),h.jsx("div",{className:de.footer,children:B("agent.footer.enterNext")})]})]});if(e===(n==="manual"?6:4)){const H=c[u]??c[0],O=(H==null?void 0:H.tools)??[],se=(H==null?void 0:H.id)==="all"?B("agent.create.tools.allInfo"):O.length>0?O.join(", "):B("agent.create.tools.none"),ke=O.filter(o5),be=O.filter(l5),Ee=O.filter(c5);return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.toolsSelection"))}),h.jsx("div",{className:de.options,children:c.map((qe,wt)=>h.jsx(ns,{idx:wt,active:u===wt,label:qe.label,numbered:!0,onClick:()=>j(wt),onHover:()=>z(wt)},qe.id))}),h.jsx("div",{className:de.toolDetail,children:(H==null?void 0:H.id)==="all"?h.jsx("div",{className:de.toolDetailBody,children:se}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.toolDetailTitle,children:B("agent.create.tools.selected")}),h.jsx("div",{className:de.toolList,children:O.length===0?se:h.jsxs(h.Fragment,{children:[ke.length>0&&h.jsxs("div",{children:[B("agent.create.tools.readOnlyLabel")," ",ke.join(", ")]}),be.length>0&&h.jsxs("div",{children:[B("agent.create.tools.editLabel")," ",be.join(", ")]}),Ee.length>0&&h.jsxs("div",{children:[B("agent.create.tools.executionLabel")," ",Ee.join(", ")]})]})})]})}),h.jsx("div",{className:de.footer,children:B("agent.footer.createContinue")})]})}if(e===(n==="manual"?7:5)){const H=((M=go[u])==null?void 0:M.value)??"auto",O=i||B("agent.label");return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.colorSelection"))}),h.jsx("div",{className:de.options,children:go.map((se,ke)=>h.jsx(ns,{idx:ke,active:u===ke,label:se.name,colorDot:se.value,numbered:!0,onClick:()=>R(ke),onHover:()=>D(ke)},se.id))}),h.jsxs("div",{className:de.colorPreview,children:[h.jsxs("span",{children:[B("agent.create.preview"),":"]}),h.jsxs("span",{style:{color:H==="auto"?"var(--text-primary)":H},children:[" ",O," "]})]}),h.jsx("div",{className:de.footer,children:B("agent.footer.createContinue")})]})}if(e===t){const H=((X=go.find(se=>se.value===o))==null?void 0:X.name)??o,O=l.length===0?"*":l.join(", ");return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:de.stepHeader,children:W(B("agent.create.confirm"))}),h.jsxs("div",{className:de.summary,children:[h.jsxs("div",{className:de.summaryRow,children:[h.jsxs("span",{className:de.summaryLabel,children:[B("agent.create.name"),":"]}),h.jsx("span",{className:de.summaryValue,children:i||"—"})]}),h.jsxs("div",{className:de.summaryRow,children:[h.jsxs("span",{className:de.summaryLabel,children:[B("agent.location"),":"]}),h.jsx("span",{className:de.summaryValue,children:B(r==="workspace"?"agent.create.project.cli":"agent.create.user.cli")})]}),h.jsxs("div",{className:de.summaryRow,children:[h.jsx("span",{className:de.summaryLabel,children:B("agent.toolsLabel")}),h.jsx("span",{className:de.summaryValue,children:O})]}),o!=="auto"&&h.jsxs("div",{className:de.summaryRow,children:[h.jsxs("span",{className:de.summaryLabel,children:[B("agent.create.colorSelection"),":"]}),h.jsx("span",{className:de.summaryValue,children:H})]}),h.jsx("div",{className:de.summaryBlockTitle,children:B("agent.descriptionLabel")}),h.jsx("div",{className:de.summaryBlock,children:s||"—"}),h.jsx("div",{className:de.summaryBlockTitle,children:B("agent.systemPromptLabel")}),h.jsx("div",{className:de.summaryBlock,children:a||"—"})]}),h.jsx("button",{type:"button",className:de.hiddenAction,onClick:N,disabled:d,children:B(d?"agent.create.loading":"agent.create.save")}),h.jsx("div",{className:de.footer,children:B("agent.footer.final")})]})}return null}const nye="_panel_asdx1_1",rye="_title_asdx1_17",iye="_row_asdx1_21",sye="_selected_asdx1_29",aye="_disabled_asdx1_33",oye="_pointer_asdx1_42",lye="_label_asdx1_53",cye="_secondary_asdx1_58",uye="_error_asdx1_62",dye="_toggles_asdx1_66",hye="_list_asdx1_67",fye="_description_asdx1_74",mye="_content_asdx1_79",pye="_shortcuts_asdx1_90",gye="_modalBackdrop_asdx1_96",yye="_modal_asdx1_96",bye="_modalHeader_asdx1_121",vye="_modalTitle_asdx1_129",xye="_modalFooter_asdx1_137",wye="_editor_asdx1_149",kye="_primaryButton_asdx1_163",_ye="_closeButton_asdx1_179",Dt={panel:nye,title:rye,row:iye,selected:sye,disabled:aye,pointer:oye,label:lye,secondary:cye,error:uye,toggles:dye,list:hye,description:fye,content:mye,shortcuts:pye,modalBackdrop:gye,modal:yye,modalHeader:bye,modalTitle:vye,modalFooter:xye,editor:wye,primaryButton:kye,closeButton:_ye},JO="web-shell:memory-panel-active";function l4(e,t){return e.find(n=>n.scope===t)}function YT(e,t,n){const r=(e==null?void 0:e.path)??t;return n("memory.savedIn",{path:r})}function c4(e){return(e==null?void 0:e.value)==="managed"}function op(e,t){return t(e==="global"?"memory.global":"memory.project")}function Sye({refreshSignal:e=0,addSignal:t=0,addScope:n="workspace",portalHost:r,onMessage:i,onClose:s}){const{t:a}=ft(),o=v.useRef(`memory-${Math.random().toString(36).slice(2)}`),{files:l,loading:c,error:u,readFile:d,reload:f,writeMemory:m}=wU({autoLoad:!0}),p=v.useRef(null),[b,x]=v.useState("list"),[g,y]=v.useState(0),[w,C]=v.useState(!1),[E,S]=v.useState(null),[T,j]=v.useState(null),[z,R]=v.useState(""),[D,N]=v.useState(!1),[B,P]=v.useState(!1),[J,q]=v.useState(""),[W,$]=v.useState("workspace"),[Z,M]=v.useState(!1),[X,H]=v.useState(!1),[O,se]=v.useState(!1),ke=v.useCallback(ae=>{window.dispatchEvent(new CustomEvent(JO,{detail:{id:o.current,active:ae}}))},[]);v.useEffect(()=>(ke(!w),()=>ke(!1)),[w,ke]),v.useEffect(()=>{u&&S(u.message)},[u]),v.useEffect(()=>{e<=0||f().then(()=>S(a("memory.refreshed"))).catch(ae=>{S(ae instanceof Error?ae.message:String(ae))})},[e,f,a]),v.useEffect(()=>{t<=0||(x("list"),y(n==="global"?0:1),S(null),se(!0))},[n,t]);const be=l4(l,"global"),Ee=l4(l,"workspace"),qe=v.useMemo(()=>[{label:a("memory.global"),value:"global",description:YT(be,"~/.qwen/QWEN.md",a),file:be},{label:a("memory.project"),value:"workspace",description:YT(Ee,"QWEN.md",a),file:Ee},{label:a("memory.autoFolder"),value:"managed"}],[be,a,Ee]),wt=v.useCallback(()=>{C(!0),s()},[s]),Mt=v.useCallback((ae,je)=>{if(S(null),je==="managed"){const Oe=a("memory.openFolderUnsupported");S(Oe),i==null||i(Oe,"status");return}if(!ae){const Oe=a("memory.noFiles");S(Oe);return}j(ae),R(""),x("detail"),N(!0),d(ae.path).then(Oe=>{R(Oe.content)}).catch(Oe=>{const $e=Oe instanceof Error?Oe.message:String(Oe);R($e)}).finally(()=>N(!1))},[i,d,a]),bt=v.useCallback(ae=>{const je=l4(l,ae);$(ae),q(""),S(null),se(!1),P(!0),requestAnimationFrame(()=>{var Oe;return(Oe=p.current)==null?void 0:Oe.focus()}),je&&(M(!0),d(je.path).then(Oe=>{q(Oe.content),Oe.truncated&&S(a("memory.fileTruncated")),requestAnimationFrame(()=>{var $e;return($e=p.current)==null?void 0:$e.focus()})}).catch(Oe=>{const $e=Oe instanceof Error?Oe.message:String(Oe);S($e),i==null||i($e,"error")}).finally(()=>M(!1)))},[l,i,d,a]),Je=v.useCallback((ae=g)=>{const je=qe[ae];if(je&&!c4(je)){if(O){(je.value==="global"||je.value==="workspace")&&bt(je.value);return}Mt(je.file,je.value)}},[O,qe,bt,Mt,g]),Ge=v.useCallback(()=>{P(!1),q(""),S(null),M(!1)},[]),Pt=v.useCallback(()=>{const ae=J;if(!ae.trim()){S(a("memory.contentEmpty"));return}H(!0),S(null),m({scope:W,mode:"replace",content:ae}).then(je=>{const Oe=a("memory.saved",{scope:op(W,a),bytes:je.bytesWritten,path:je.filePath});P(!1),q(""),S(Oe),i==null||i(Oe,"status"),f().catch(()=>{})}).catch(je=>{const Oe=je instanceof Error?je.message:String(je);S(Oe),i==null||i(Oe,"error")}).finally(()=>H(!1))},[J,W,i,f,a,m]);if(ui(ae=>{if(w||ae.defaultPrevented)return;const je=ae.target,Oe=(je==null?void 0:je.tagName)==="TEXTAREA"||(je==null?void 0:je.tagName)==="INPUT",$e=()=>{ae.preventDefault(),ae.stopPropagation()};if(ae.key==="Escape"){$e(),B?Ge():b==="detail"?(x("list"),j(null),R(""),S(null)):wt();return}if(B){(ae.metaKey||ae.ctrlKey)&&ae.key==="Enter"&&($e(),X||Pt());return}if(!Oe){if(b==="autoMemory"){ae.key==="ArrowDown"||ae.key==="j"?($e(),x("autoDream")):ae.key==="Enter"&&$e();return}if(b==="autoDream"){ae.key==="ArrowUp"||ae.key==="k"?($e(),x("autoMemory")):ae.key==="ArrowDown"||ae.key==="j"?($e(),x("autoSkill")):ae.key==="Enter"&&$e();return}if(b==="autoSkill"){ae.key==="ArrowUp"||ae.key==="k"?($e(),x("autoDream")):ae.key==="ArrowDown"||ae.key==="j"?($e(),x("list"),y(0)):ae.key==="Enter"&&$e();return}if(b!=="detail"){if(ae.key==="ArrowUp"||ae.key==="k"){$e(),g===0?x("autoSkill"):y(te=>Math.max(te-1,0));return}if(ae.key==="ArrowDown"||ae.key==="j"){$e(),y(te=>(te+1)%qe.length);return}if(ae.key==="Enter"){$e(),Je();return}if(/^[1-9]$/.test(ae.key)){$e();const te=Number(ae.key)-1;if(te>=qe.length)return;x("list"),y(te),c4(qe[te])||Je(te)}}}},[w,b,wt,Ge,O,B,qe.length,qe,Pt,X,g,Je]),w)return h.jsx("div",{className:Dt.panel,children:h.jsx("div",{className:Dt.secondary,children:a("memory.closed")})});const Ze=b==="autoMemory",re=b==="autoDream",le=b==="autoSkill",De=E??(c?a("memory.loading"):null),We=a("memory.on"),pe=()=>{x("list"),j(null),R(""),S(null)},st=h.jsxs(h.Fragment,{children:[T?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Dt.modalBackdrop,onClick:pe}),h.jsxs("div",{className:Dt.modal,role:"dialog","aria-modal":"true","aria-label":T.path,children:[h.jsxs("div",{className:Dt.modalHeader,children:[h.jsx("span",{className:Dt.modalTitle,children:T.path}),h.jsx("button",{type:"button",className:Dt.closeButton,onClick:pe,children:"ESC"})]}),h.jsx("pre",{className:Dt.content,children:D?a("memory.loadingFile"):z})]})]}):null,B?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Dt.modalBackdrop,onClick:Ge}),h.jsxs("div",{className:Dt.modal,role:"dialog","aria-modal":"true","aria-label":op(W,a),children:[h.jsxs("div",{className:Dt.modalHeader,children:[h.jsx("span",{className:Dt.modalTitle,children:op(W,a)}),h.jsx("button",{type:"button",className:Dt.closeButton,onClick:Ge,children:"ESC"})]}),h.jsx("textarea",{ref:p,className:Dt.editor,value:J,onChange:ae=>q(ae.target.value),onKeyDown:ae=>{if(ae.key==="Escape"){ae.preventDefault(),ae.stopPropagation(),Ge();return}(ae.metaKey||ae.ctrlKey)&&ae.key==="Enter"&&(ae.preventDefault(),X||Pt())},placeholder:a("memory.placeholder",{scope:op(W,a)})}),h.jsxs("div",{className:Dt.modalFooter,children:[h.jsx("span",{children:a(Z?"memory.loadingFile":"dialog.footer.saveClose")}),h.jsx("button",{type:"button",className:Dt.primaryButton,disabled:X||Z,onClick:Pt,children:a(X?"memory.saving":"memory.save")})]})]})]}):null]});return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Dt.panel,children:[h.jsx("div",{className:Dt.title,children:a("memory.menu")}),h.jsxs("div",{className:Dt.toggles,children:[h.jsxs("div",{className:`${Dt.row} ${Dt.disabled} ${Ze?Dt.selected:""}`,onMouseEnter:()=>x("autoMemory"),children:[h.jsx("span",{className:Dt.pointer,children:Ze?"›":" "}),h.jsx("span",{className:Dt.label,children:a("memory.autoMemory",{status:We})})]}),h.jsxs("div",{className:`${Dt.row} ${Dt.disabled} ${re?Dt.selected:""}`,onMouseEnter:()=>x("autoDream"),children:[h.jsx("span",{className:Dt.pointer,children:re?"›":" "}),h.jsx("span",{className:Dt.label,children:a("memory.autoDream",{status:We,lastDream:a("memory.lastDream")})})]}),h.jsxs("div",{className:`${Dt.row} ${Dt.disabled} ${le?Dt.selected:""}`,onMouseEnter:()=>x("autoSkill"),children:[h.jsx("span",{className:Dt.pointer,children:le?"›":" "}),h.jsx("span",{className:Dt.label,children:a("memory.autoSkill",{status:We})})]})]}),u&&h.jsx("div",{className:Dt.error,children:u.message}),De&&h.jsx("div",{className:Dt.secondary,children:De}),h.jsx("div",{className:Dt.list,children:qe.map((ae,je)=>{const Oe=b==="list"&&je===g,$e=c4(ae);return h.jsxs("div",{className:`${Dt.row} ${$e?Dt.disabled:""} ${Oe?Dt.selected:""}`,onClick:()=>{$e||Je(je)},onMouseEnter:()=>{x("list"),y(je)},children:[h.jsx("span",{className:Dt.pointer,children:Oe?"›":" "}),h.jsxs("span",{className:Dt.label,children:[je+1,". ",ae.label]}),ae.description?h.jsx("span",{className:Dt.description,children:ae.description}):null]},ae.value)})}),h.jsx("div",{className:Dt.shortcuts,children:a(T?"memory.footer.back":"memory.footer")})]}),r?fw.createPortal(st,r):null]})}const Tye="_panel_mjusq_1",Cye="_header_mjusq_17",Eye="_title_mjusq_23",Aye="_list_mjusq_31",Mye="_row_mjusq_39",Nye="_selected_mjusq_52",Iye="_label_mjusq_52",Dye="_pointer_mjusq_56",Rye="_number_mjusq_64",Oye="_provider_mjusq_70",jye="_badge_mjusq_81",Lye="_detail_mjusq_86",Bye="_detailRow_mjusq_94",zye="_detailLabel_mjusq_100",Pye="_detailValue_mjusq_106",$ye="_footer_mjusq_112",Uye="_empty_mjusq_118",Wr={panel:Tye,header:Cye,title:Eye,list:Aye,row:Mye,selected:Nye,label:Iye,pointer:Dye,number:Rye,provider:Oye,badge:jye,detail:Lye,detailRow:Bye,detailLabel:zye,detailValue:Pye,footer:$ye,empty:Uye},ZO="web-shell:model-panel-active";function Hye(e,t){return e?`${e.toLocaleString()} ${t("contextUsage.tokens")}`:t("model.contextWindow.unknown")}function qye(e,t){if(!e)return t("model.modality.textOnly");const n=[];return e.image&&n.push(t("model.modality.image")),e.pdf&&n.push(t("model.modality.pdf")),e.audio&&n.push(t("model.modality.audio")),e.video&&n.push(t("model.modality.video")),n.length===0?t("model.modality.textOnly"):`${t("model.modality.text")} · ${n.join(" · ")}`}function XT(e){if(e.authType)return e.authType;const t=e.id.match(/\(([^()]+)\)$/);return t==null?void 0:t[1]}function Fye(e){return e.label?e.label:e.baseModelId?e.baseModelId:e.id.replace(/\([^()]+\)$/,"")}function Vye(e){return[e.authType??"",e.id,e.baseUrl??"",e.envKey??""].join("\0")}function QT(e,t){return t?e.baseModelId??e.id.replace(/\([^()]+\)$/,""):e.id}function lp({label:e,value:t}){return h.jsxs("div",{className:Wr.detailRow,children:[h.jsxs("span",{className:Wr.detailLabel,children:[e,":"]}),h.jsx("span",{className:Wr.detailValue,children:t})]})}function Gye({mode:e="main",onSelect:t,onClose:n}){const r=du(),i=r.currentModel??"",s=v.useMemo(()=>r.models??[],[r.models]),{t:a}=ft(),o=v.useRef(`model-${Math.random().toString(36).slice(2)}`),l=v.useRef(null),c=v.useRef(null),u=v.useRef(n);v.useEffect(()=>{u.current=n},[n]);const d=e==="fast",[f,m]=v.useState(()=>{const g=s.findIndex(y=>y.id===i);return g>=0?g:0}),p=s[f],b=v.useCallback(g=>{window.dispatchEvent(new CustomEvent(ZO,{detail:{id:o.current,active:g}}))},[]);v.useEffect(()=>(b(!0),()=>b(!1)),[b]),v.useEffect(()=>{const g=y=>{if(y instanceof MouseEvent&&y.button!==0||y.defaultPrevented)return;const w=c.current,C=y.target;w&&C instanceof Node&&!w.contains(C)&&u.current()};return window.addEventListener("mousedown",g),window.addEventListener("touchstart",g),()=>{window.removeEventListener("mousedown",g),window.removeEventListener("touchstart",g)}},[]),v.useEffect(()=>{f>=s.length&&s.length>0&&m(s.length-1)},[s.length,f]),v.useEffect(()=>{var y;const g=(y=l.current)==null?void 0:y.children[f];g==null||g.scrollIntoView({block:"nearest"})},[f]);const x=v.useCallback(()=>{const g=s[f];g&&(t(QT(g,d)),n())},[s,d,n,t,f]);return ui(g=>{if(g.defaultPrevented)return;const y=()=>{g.preventDefault(),g.stopPropagation()};if(g.key==="Escape"){y(),n();return}if(g.key==="ArrowDown"||g.key==="j"){y(),m(w=>s.length>0?(w+1)%s.length:0);return}if(g.key==="ArrowUp"||g.key==="k"){y(),m(w=>s.length>0?(w-1+s.length)%s.length:0);return}if(g.key==="Enter"){y(),x();return}},[s.length,x,n]),h.jsxs("div",{ref:c,className:Wr.panel,children:[h.jsx("div",{className:Wr.header,children:h.jsx("span",{className:Wr.title,children:a(d?"model.setFast":"model.select")})}),h.jsxs("div",{className:Wr.list,ref:l,role:"listbox","aria-label":a(d?"model.setFast":"model.select"),children:[s.length===0?h.jsx("div",{className:Wr.empty,children:a("model.none")}):null,s.map((g,y)=>{const w=y===f,C=XT(g);return h.jsxs("div",{role:"option","aria-selected":w,className:`${Wr.row} ${w?Wr.selected:""}`,onClick:()=>{t(QT(g,d)),n()},children:[h.jsx("span",{className:Wr.pointer,children:w?"›":" "}),h.jsxs("span",{className:Wr.number,children:[y+1,"."]}),C?h.jsxs("span",{className:Wr.provider,children:["[",C,"]"]}):null,h.jsx("span",{className:Wr.label,children:Fye(g)}),g.isRuntime?h.jsx("span",{className:Wr.badge,children:"Runtime"}):null]},Vye(g))})]}),p?h.jsxs("div",{className:Wr.detail,children:[h.jsx(lp,{label:a("model.modality"),value:qye(p.modalities,a)}),h.jsx(lp,{label:a("model.contextWindow"),value:Hye(p.contextWindow,a)}),XT(p)!=="qwen-oauth"?h.jsxs(h.Fragment,{children:[h.jsx(lp,{label:a("model.baseUrl"),value:p.baseUrl??a("model.default")}),h.jsx(lp,{label:a("model.apiKey"),value:p.envKey??a("model.notSet")})]}):null]}):null,h.jsx("div",{className:Wr.footer,children:a("model.footer")})]})}const Wye="_panel_1ocne_1",Kye="_title_1ocne_13",Yye="_text_1ocne_18",Xye="_muted_1ocne_23",Qye="_options_1ocne_27",Jye="_option_1ocne_27",Zye="_optionActive_1ocne_42",ebe="_label_1ocne_42",tbe="_pointer_1ocne_46",nbe="_description_1ocne_57",rbe="_input_1ocne_63",ibe="_preview_1ocne_79",sbe="_error_1ocne_91",abe="_link_1ocne_96",obe="_terms_1ocne_103",lbe="_footer_1ocne_110",Hn={panel:Wye,title:Kye,text:Yye,muted:Xye,options:Qye,option:Jye,optionActive:Zye,label:ebe,pointer:tbe,description:nbe,input:rbe,preview:ibe,error:sbe,link:abe,terms:obe,footer:lbe},sw="web-shell:auth-panel-active",cbe=[{value:"openai",label:"OpenAI-compatible",description:"Standard OpenAI API format (most common)"},{value:"anthropic",label:"Anthropic-compatible",description:"Anthropic Messages API format"},{value:"gemini",label:"Gemini-compatible",description:"Google Gemini API format"}];function Fh(e){return e==="anthropic"?"https://api.anthropic.com/v1":e==="gemini"?"https://generativelanguage.googleapis.com":"https://api.openai.com/v1"}function JT(e){var t;return((t=e==null?void 0:e.models)==null?void 0:t.map(n=>n.id).join(", "))??""}function ube(e,t,n){var r;return e==="protocol"?n("auth.step.protocol"):e==="baseUrl"?((r=t.uiLabels)==null?void 0:r.baseUrlStepTitle)??n("auth.step.baseUrl"):n(e==="apiKey"?"auth.step.apiKey":e==="models"?"auth.step.models":"auth.step.advanced")}function dbe(e){const t=e.trim();return t?t.length<=6?"***":`${t.slice(0,3)}...${t.slice(-4)}`:"(not set)"}function u4(e){return[...new Set(e.split(",").map(t=>t.trim()).filter(t=>t.length>0))]}function hbe({onMessage:e,onClose:t}){var Zn,Sn,_r;const{t:n}=ft(),r=tc(),[i,s]=v.useState("groups"),[a,o]=v.useState(0),[l,c]=v.useState(0),[u,d]=v.useState("providers"),[f,m]=v.useState(0),[p,b]=v.useState(),[x,g]=v.useState("alibaba"),[y,w]=v.useState(null),[C,E]=v.useState("openai"),[S,T]=v.useState(""),[j,z]=v.useState(""),[R,D]=v.useState(""),[N,B]=v.useState(!1),[P,J]=v.useState(!1),[q,W]=v.useState(!0),[$,Z]=v.useState(!0),[M,X]=v.useState(!1),[H,O]=v.useState(!1),[se,ke]=v.useState(""),[be,Ee]=v.useState(!0),[qe,wt]=v.useState(!1),[Mt,bt]=v.useState(null);v.useEffect(()=>{const me=`auth-${Math.random().toString(36).slice(2)}`;return window.dispatchEvent(new CustomEvent(sw,{detail:{id:me,active:!0}})),()=>{window.dispatchEvent(new CustomEvent(sw,{detail:{id:me,active:!1}}))}},[]),v.useEffect(()=>{r.getAuthProviders().then(me=>{b(me),Ee(!1)}).catch(me=>{bt(me instanceof Error?me.message:String(me)),Ee(!1)})},[r]);const Je=v.useMemo(()=>(p==null?void 0:p.groups)??[],[p]),Ge=v.useMemo(()=>{var G;return(((G=Je.find(ne=>ne.id===x))==null?void 0:G.providerIds)??[]).map(ne=>p==null?void 0:p.providers.find(Ke=>Ke.id===ne)).filter(ne=>!!ne)},[p,x,Je]),Pt=(y==null?void 0:y.steps)??[],Ze=Pt[f],re=(y==null?void 0:y.showAdvancedConfig)===!0,le=v.useMemo(()=>P?["thinking","modality","image","video","audio","pdf","context"]:["thinking","modality","context"],[P]),De=le.indexOf("context"),We=le.length,pe=Pt.length+(re?1:0),st=Ze==="apiKey"||Ze==="models"||Ze==="baseUrl"&&!Array.isArray(y==null?void 0:y.baseUrl),ae=i==="groups"?Je.length:i==="providers"?Ge.length:Ze==="protocol"?((y==null?void 0:y.protocolOptions)??[y==null?void 0:y.protocol]).length:Ze==="baseUrl"&&Array.isArray(y==null?void 0:y.baseUrl)?y.baseUrl.length:Ze==="advancedConfig"?We:0,[je,Oe]=v.useState(0),$e=v.useCallback((me,G="providers")=>{var Ke,St;w(me),d(G);const ne=((Ke=me.protocolOptions)==null?void 0:Ke[0])??me.protocol;E(ne),typeof me.baseUrl=="string"?T(me.baseUrl):Array.isArray(me.baseUrl)?T(((St=me.baseUrl[0])==null?void 0:St.url)??""):T(Fh(ne)),z(""),D(JT(me)),B(!1),J(!1),W(!0),Z(!0),X(!1),O(!1),ke(""),m(0),Oe(0),bt(null),s(me.steps.length>0?"step":"review")},[]),te=v.useCallback(()=>{if(bt(null),i==="groups"){t();return}if(i==="providers"){s("groups");return}if(i==="review"){s("step"),m(Math.max(0,Pt.length-1));return}if(f>0){m(me=>me-1),Oe(0);return}s(u)},[t,u,f,Pt.length,i]),ye=v.useCallback(()=>{if(!y||qe)return;wt(!0),bt(null);const me=Number(se);r.installAuthProvider({providerId:y.id,protocol:C,baseUrl:S,apiKey:j,modelIds:u4(R),advancedConfig:N||P||Number.isFinite(me)&&me>0?{...N?{enableThinking:!0}:{},...P?{multimodal:{...q?{image:!0}:{},...$?{video:!0}:{},...M?{audio:!0}:{},...H?{pdf:!0}:{}}}:{},...Number.isFinite(me)&&me>0?{contextWindowSize:me}:{}}:void 0}).then(G=>{e(G.message),t()}).catch(G=>{const ne=G instanceof Error?G.message:String(G);bt(ne),e(ne,"error")}).finally(()=>wt(!1))},[j,S,se,P,M,q,H,$,R,t,e,C,y,qe,N,r]),Te=v.useCallback(()=>{if(y){if(Ze==="baseUrl"){const me=S.trim()||Fh(C);if(!me){bt(n("auth.baseUrlRequired"));return}if(!/^https?:\/\//i.test(me)){bt(n("auth.baseUrlInvalid"));return}S.trim()||T(me)}if(Ze==="apiKey"&&j.trim().length===0){bt(n("auth.apiKeyRequired"));return}if(Ze==="models"&&u4(R).length===0){bt(n("auth.modelsRequired"));return}bt(null),f>=Pt.length-1?re?s("review"):ye():(m(me=>me+1),Oe(0))}},[j,S,Ze,R,C,y,ye,re,f,Pt.length,n]),Pe=v.useCallback(me=>{switch(me){case"thinking":B(G=>!G);return;case"modality":J(G=>!G);return;case"image":W(G=>!G);return;case"video":Z(G=>!G);return;case"audio":X(G=>!G);return;case"pdf":O(G=>!G);return;case"context":Te();return;default:return}},[Te]),dt=v.useCallback(()=>{if(i==="groups"){const me=Je[a];if(!me)return;if(me.id==="custom"){const G=me.providerIds.map(ne=>p==null?void 0:p.providers.find(Ke=>Ke.id===ne)).find(ne=>!!ne);G&&$e(G,"groups");return}g(me.id),c(0),s("providers");return}if(i==="providers"){const me=Ge[l];me&&$e(me,"providers");return}if(i==="review"){ye();return}if(!(!y||!Ze)){if(Ze==="protocol"){const me=(y.protocolOptions??[y.protocol])[je];me&&(E(me),y.baseUrl||T(Fh(me))),Te();return}if(Ze==="baseUrl"&&Array.isArray(y.baseUrl)){const me=y.baseUrl[je];me&&T(me.url),Te();return}if(Ze==="advancedConfig"){Pe(le[je]);return}Te()}},[Ze,p,Te,a,Je,je,y,l,Ge,ye,$e,i,Pe,le]),Ht=v.useCallback(me=>{if(i==="groups"){const G=Je[me];if(!G)return;if(G.id==="custom"){const ne=G.providerIds.map(Ke=>p==null?void 0:p.providers.find(St=>St.id===Ke)).find(Ke=>!!Ke);ne&&$e(ne,"groups");return}g(G.id),c(0),s("providers");return}if(i==="providers"){const G=Ge[me];G&&$e(G,"providers");return}if(!y||!Ze){i==="review"&&ye();return}if(Ze==="protocol"){const G=(y.protocolOptions??[y.protocol])[me];G&&(E(G),y.baseUrl||T(Fh(G))),Te();return}if(Ze==="baseUrl"&&Array.isArray(y.baseUrl)){const G=y.baseUrl[me];G&&T(G.url),Te();return}Ze==="advancedConfig"&&Pe(le[me])},[Ze,p,Te,Je,Pe,le,y,Ge,ye,$e,i]);ui(me=>{if(me.key==="Escape"){me.preventDefault(),te();return}if(me.key==="Enter"){me.preventDefault(),dt();return}if(me.key===" "){Ze==="advancedConfig"&&(me.preventDefault(),dt());return}if(ae>0&&(me.key==="ArrowUp"||me.key==="ArrowDown")){me.preventDefault();const G=me.key==="ArrowUp"?-1:1,ne=Ke=>(Ke+ae+G)%ae;i==="groups"?o(ne):i==="providers"?c(ne):Oe(ne)}},[dt,Ze,te,ae,i]);const Xt=(me,G,ne)=>h.jsx("div",{className:Hn.options,children:me.map((Ke,St)=>h.jsxs("div",{className:`${Hn.option} ${G===St?Hn.optionActive:""}`,onClick:()=>{ne(St),Ht(St)},children:[h.jsx("span",{className:Hn.pointer,children:G===St?"›":" "}),h.jsxs("div",{children:[h.jsxs("div",{className:Hn.label,children:[St+1,". ",Ke.label]}),Ke.description&&h.jsx("div",{className:Hn.description,children:Ke.description})]})]},Ke.value))}),Dn=()=>{if(!y||!Ze)return null;if(Ze==="protocol"){const ne=y.protocolOptions??[y.protocol];return Xt(cbe.filter(Ke=>ne.includes(Ke.value)),je,Oe)}if(Ze==="baseUrl")return Array.isArray(y.baseUrl)?Xt(y.baseUrl.map(ne=>({value:ne.url,label:ne.label,description:ne.url})),je,Oe):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Hn.text,children:n("auth.baseUrlPrompt")}),h.jsx("input",{className:Hn.input,value:S,placeholder:Fh(C),onChange:ne=>{T(ne.target.value),bt(null)},onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),ne.stopPropagation(),Te())},autoFocus:!0}),y.documentationUrl&&h.jsx("a",{className:Hn.link,href:y.documentationUrl,target:"_blank",rel:"noreferrer",children:n("auth.documentation")})]});if(Ze==="apiKey")return h.jsxs(h.Fragment,{children:[y.documentationUrl&&h.jsxs("a",{className:Hn.link,href:y.documentationUrl,target:"_blank",rel:"noreferrer",children:[n("auth.documentation"),": ",y.documentationUrl]}),h.jsx("input",{className:Hn.input,type:"password",value:j,placeholder:y.apiKeyPlaceholder??"sk-...",onChange:ne=>{z(ne.target.value),bt(null)},onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),ne.stopPropagation(),Te())},autoFocus:!0})]});if(Ze==="models"){const ne=JT(y);return h.jsxs(h.Fragment,{children:[ne&&h.jsx("div",{className:Hn.muted,children:n("auth.modelsPrompt",{modelIds:ne})}),h.jsx("input",{className:Hn.input,value:R,placeholder:ne||"model-id-1, model-id-2",onChange:Ke=>{D(Ke.target.value),bt(null)},onKeyDown:Ke=>{Ke.key==="Enter"&&(Ke.preventDefault(),Ke.stopPropagation(),Te())},autoFocus:!0})]})}const me=ne=>ne?"◉":"○",G=[{value:"thinking",label:`${me(N)} ${n("auth.advanced.thinking")}`,description:n("auth.advanced.thinkingDesc")},{value:"modality",label:`${me(P)} ${n("auth.advanced.modality")}`,description:n("auth.advanced.modalityDesc")}];return P&&G.push({value:"image",label:`${me(q)} ${n("auth.advanced.modalityImage")}`},{value:"video",label:`${me($)} ${n("auth.advanced.modalityVideo")}`},{value:"audio",label:`${me(M)} ${n("auth.advanced.modalityAudio")}`},{value:"pdf",label:`${me(H)} ${n("auth.advanced.modalityPdf")}`}),G.push({value:"context",label:`${n("auth.advanced.contextWindow")}: ${se||"auto"}`,description:n("auth.advanced.contextDesc")}),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Hn.text,children:n("auth.advanced.prompt")}),Xt(G,je,Oe),h.jsx("input",{className:Hn.input,value:se,placeholder:"auto",onChange:ne=>ke(ne.target.value.replace(/[^0-9]/g,"")),onFocus:()=>Oe(De),onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),ne.stopPropagation(),Te())}})]})},jn=v.useMemo(()=>{if(!y)return"";const me=y.envKey??`${C.toUpperCase()}_API_KEY`,G=u4(R),ne={};if(N&&(ne.extra_body={enable_thinking:!0}),P){const et={};q&&(et.image=!0),$&&(et.video=!0),M&&(et.audio=!0),H&&(et.pdf=!0),Object.keys(et).length>0&&(ne.modalities=et)}const Ke=Number(se);Number.isFinite(Ke)&&Ke>0&&(ne.contextWindowSize=Ke);const St=Object.keys(ne).length>0;return JSON.stringify({env:{[me]:dbe(j)},modelProviders:{[C]:G.map(et=>({id:et,name:et,baseUrl:S.trim(),envKey:me,...St?{generationConfig:ne}:{}}))},security:{auth:{selectedType:C}},model:{name:G[0]}},null,2)},[j,S,se,P,M,q,H,$,R,C,y,N]);return h.jsxs("div",{className:Hn.panel,"data-keyboard-scope":!0,children:[h.jsx("div",{className:Hn.title,children:i==="groups"?n("auth.title"):i==="providers"?n(((Zn=Je.find(me=>me.id===x))==null?void 0:Zn.label)??""):y&&Ze?`${n(((Sn=y.uiLabels)==null?void 0:Sn.flowTitle)??y.label)} · ${n("auth.stepCount",{step:f+1,total:pe})} · ${ube(Ze,y,n)}`:y&&i==="review"?`${n(((_r=y.uiLabels)==null?void 0:_r.flowTitle)??y.label)} · ${n("auth.stepCount",{step:pe,total:pe})} · ${n("auth.review")}`:n("auth.review")}),be&&h.jsx("div",{className:Hn.muted,children:n("common.loading")}),i==="groups"&&!be&&Xt(Je.map(me=>({value:me.id,label:n(me.label),description:n(me.description)})),a,o),i==="providers"&&Xt(Ge.map(me=>({value:me.id,label:n(me.label),description:n(me.description)})),l,c),i==="step"&&Dn(),i==="review"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Hn.text,children:n("auth.reviewText")}),h.jsx("div",{className:Hn.preview,children:jn})]}),Mt&&h.jsx("div",{className:Hn.error,children:Mt}),i==="groups"&&!be&&h.jsxs("div",{className:Hn.terms,children:[h.jsxs("div",{children:[n("auth.termsTitle"),":"]}),h.jsx("a",{className:Hn.link,href:"https://qwenlm.github.io/qwen-code-docs/en/users/support/tos-privacy/",target:"_blank",rel:"noreferrer",children:"https://qwenlm.github.io/qwen-code-docs/en/users/support/tos-privacy/"})]}),i!=="groups"&&h.jsx("div",{className:Hn.footer,children:n(Ze==="advancedConfig"?"auth.footer.advanced":i==="review"?qe?"auth.saving":"auth.footer.save":st?"auth.footer.input":"auth.footer.back")})]})}function ZT(e){return e.displayName||e.name}function fbe({onClose:e}){const{t}=ft(),{status:n,tools:r,loading:i,error:s,reload:a,setEnabled:o}=JA({autoLoad:!0}),[l,c]=v.useState(0),[u,d]=v.useState(null),[f,m]=v.useState(null),[p,b]=v.useState(()=>new Set),x=v.useRef(null),g=r[l],y=g?p.has(g.name):!1;v.useEffect(()=>{var S,T;s?m(s.message):(T=(S=n==null?void 0:n.errors)==null?void 0:S[0])!=null&&T.error?m(n.errors[0].error):n&&m(null)},[n,s]);const w=v.useCallback(S=>{m(null),d(S.name),o(S.name,!S.enabled).then(()=>a()).catch(T=>{m(T instanceof Error?T.message:String(T))}).finally(()=>d(null))},[a,o]),C=v.useCallback(S=>{b(T=>{const j=new Set(T);return j.has(S.name)?j.delete(S.name):j.add(S.name),j})},[]);v.useEffect(()=>{l>=r.length&&r.length>0&&c(r.length-1)},[l,r.length]),v.useEffect(()=>{var T;const S=(T=x.current)==null?void 0:T.children[l];S==null||S.scrollIntoView({block:"nearest"})},[l]),ui(S=>{if(S.key==="Escape"){S.preventDefault(),e();return}if(S.key==="ArrowDown"||S.key==="j"){S.preventDefault(),c(T=>Math.min(T+1,Math.max(r.length-1,0)));return}if(S.key==="ArrowUp"||S.key==="k"){S.preventDefault(),c(T=>Math.max(T-1,0));return}if(S.key==="r"){S.preventDefault(),a();return}if((S.key==="Enter"||S.key===" ")&&(g!=null&&g.description)){S.preventDefault(),C(g);return}S.key==="t"&&g&&(S.preventDefault(),w(g))},[w,e,a,g,C,r.length]);const E=v.useMemo(()=>{if(!n)return"";const S=r.filter(T=>T.enabled).length;return t("tools.summary",{enabled:S,total:r.length})},[n,r,t]);return h.jsxs("div",{className:ee("resume-picker","resume-picker-keyboard-only"),children:[h.jsxs("div",{className:ee("resume-picker-header"),children:[h.jsx("span",{className:ee("resume-picker-title"),children:t("tools.title")}),h.jsx("span",{className:ee("resume-picker-count"),children:E}),h.jsx("button",{className:ee("resume-picker-close"),onClick:e,title:t("common.close"),children:"ESC"})]}),(f||i)&&h.jsx("div",{className:ee("resume-picker-search"),children:h.jsx("span",{className:ee("resume-picker-search-hint"),children:f||t("tools.loading")})}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsxs("div",{className:ee("resume-picker-list"),ref:x,children:[!i&&r.length===0&&h.jsx("div",{className:ee("resume-picker-empty"),children:t("tools.empty")}),r.map((S,T)=>{const j=p.has(S.name),z=S.description??"",R=S.displayName&&S.displayName!==S.name?S.name:"",D=j?"":R||(z.length>80?`${z.slice(0,80)}...`:z);return h.jsxs("div",{className:ee("resume-picker-item","resume-picker-session-item",T===l?"selected":void 0),onClick:()=>{c(T),S.description&&C(S)},children:[h.jsxs("div",{className:ee("resume-picker-item-row"),children:[h.jsx("span",{className:ee("resume-picker-item-prefix"),children:T===l?"›":" "}),h.jsx("span",{className:ee("resume-picker-item-title"),children:ZT(S)})]}),h.jsxs("div",{className:ee("resume-picker-item-meta"),children:[h.jsx("span",{children:u===S.name?"...":S.enabled?t("tools.status.enabled"):t("tools.status.disabled")}),!j&&D&&h.jsx("span",{className:ee("resume-picker-item-detail"),children:D})]}),j&&z&&h.jsx("div",{className:ee("tools-desc-expanded"),children:h.jsx("div",{className:ee("tools-desc-body"),children:z})})]},S.name)})]}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsx("div",{className:ee("resume-picker-footer"),children:g?t("tools.footer",{name:ZT(g),details:g!=null&&g.description?t(y?"tools.details.hide":"tools.details.show"):""}):t("tools.footer")})]})}const mbe="update available";function aw(e,t){return e.isActive?t("extensions.manage.status.enabled"):t("extensions.manage.status.disabled")}function e9(e,t){switch(e){case"update available":return t("extensions.manage.updateAvailable");case"up to date":return t("extensions.manage.upToDate");case"not updatable":return t("extensions.manage.notUpdatable");case"checking for updates":return t("extensions.manage.checkingUpdates");case"error":return t("extensions.manage.updateError");default:return t("extensions.manage.unknownUpdate")}}function ju(e){return e&&e.length>0?e.join(", "):"-"}function pbe({onClose:e}){const{t}=ft(),n=du(),r=tc(),i=uu(),[s,a]=v.useState("list"),[o,l]=v.useState(0),[c,u]=v.useState(0),[d,f]=v.useState(0),[m,p]=v.useState("disable"),[b,x]=v.useState([]),[g,y]=v.useState({}),[w,C]=v.useState(!1),[E,S]=v.useState(!1),[T,j]=v.useState(null),[z,R]=v.useState(null),D=v.useRef(null),N=b[o],B=v.useCallback(()=>(C(!0),r.loadExtensionsStatus().then(X=>{var H,O;x(X.extensions??[]),R(((O=(H=X.errors)==null?void 0:H[0])==null?void 0:O.error)??null)}).catch(X=>{R(X instanceof Error?X.message:String(X))}).finally(()=>C(!1))),[r]),P=v.useCallback(()=>{const X=n.clientId;return X?(S(!0),r.checkExtensionUpdates(X).then(H=>y(H.states)).catch(H=>{R(H instanceof Error?H.message:String(H))}).finally(()=>S(!1))):(R(t("extensions.install.waitForSession")),Promise.resolve())},[r,n.clientId,t]),J=v.useCallback(()=>{const X=n.clientId;if(!X){R(t("extensions.install.waitForSession"));return}S(!0),r.refreshExtensions(X).then(async H=>{R(t("extensions.manage.refreshed",{refreshed:H.refreshed,failed:H.failed})),await B(),await P()}).catch(H=>{R(H instanceof Error?H.message:String(H))}).finally(()=>S(!1))},[r,P,n.clientId,B,t]);v.useEffect(()=>{B()},[B]),v.useEffect(()=>{b.length>0&&P()},[P,b.length]),v.useEffect(()=>{((i==null?void 0:i.extensionsVersion)??0)>0&&(y({}),B())},[B,i==null?void 0:i.extensionsVersion]),v.useEffect(()=>{o>=b.length&&b.length>0&&l(b.length-1)},[b.length,o]),v.useEffect(()=>{var O;const X=s==="actions"?c:s==="scope"?d:o,H=(O=D.current)==null?void 0:O.children[X];H==null||H.scrollIntoView({block:"nearest"})},[c,d,o,s]);const q=v.useCallback((X,H)=>{const O=n.clientId;if(!O){R(t("extensions.install.waitForSession"));return}j(H),R(null),X(O).then(()=>R(t("extensions.manage.queued",{name:H}))).catch(se=>{R(se instanceof Error?se.message:String(se))}).finally(()=>j(null))},[n.clientId,t]),W=v.useMemo(()=>{if(!N)return[];const X=g[N.name]??N.updateState,H=[{label:t("extensions.manage.viewDetails"),run:()=>a("details")}];return H.push({label:t("extensions.manage.update"),hint:e9(X,t),disabled:X!==mbe||T===N.name,run:()=>q(O=>r.updateExtension(N.name,O),N.name)}),H.push({label:N.isActive?t("extensions.manage.disable"):t("extensions.manage.enable"),disabled:T===N.name,run:()=>{p(N.isActive?"disable":"enable"),f(0),a("scope")}}),H.push({label:t("extensions.manage.uninstallAction"),disabled:T===N.name,run:()=>a("uninstall")}),H},[r,T,q,N,t,g]);v.useEffect(()=>{c>=W.length&&W.length>0&&u(W.length-1)},[c,W.length]);const $=v.useCallback(X=>{N&&(q(H=>m==="enable"?r.enableExtension(N.name,{scope:X},H):r.disableExtension(N.name,{scope:X},H),N.name),a("actions"))},[r,q,m,N]);ui(X=>{if(X.key==="Escape"){X.preventDefault(),s==="list"?e():s==="actions"?a("list"):(s==="details"||s==="scope"||s==="uninstall")&&a("actions");return}if(X.key==="ArrowDown"||X.key==="j"){X.preventDefault(),s==="list"?l(H=>Math.min(H+1,Math.max(b.length-1,0))):s==="actions"?u(H=>Math.min(H+1,Math.max(W.length-1,0))):s==="scope"&&f(H=>Math.min(H+1,1));return}if(X.key==="ArrowUp"||X.key==="k"){X.preventDefault(),s==="list"?l(H=>Math.max(H-1,0)):s==="actions"?u(H=>Math.max(H-1,0)):s==="scope"&&f(H=>Math.max(H-1,0));return}if(X.key==="Enter"){if(X.preventDefault(),s==="list"&&N)a("actions"),u(0);else if(s==="actions"){const H=W[c];H&&!H.disabled&&H.run()}else s==="scope"?$(d===0?"user":"workspace"):s==="uninstall"&&N&&(q(H=>r.uninstallExtension(N.name,H),N.name),a("list"));return}X.key==="r"&&(X.preventDefault(),s==="list"&&J())},[c,r,W,P,b.length,B,e,J,q,d,$,N,s]);const Z=s==="list"?t("extensions.manage.title"):s==="details"?t("extensions.manage.detailsTitle"):(N==null?void 0:N.name)??t("extensions.manage.title"),M=t(s==="list"?"extensions.manage.footer.list":s==="details"?"extensions.manage.footer.back":s==="uninstall"?"extensions.manage.footer.confirm":"extensions.manage.footer.select");return h.jsxs("div",{className:ee("resume-picker"),children:[h.jsxs("div",{className:ee("resume-picker-header"),children:[h.jsx("span",{className:ee("resume-picker-title"),children:Z}),s==="list"&&h.jsx("span",{className:ee("resume-picker-count"),children:t("extensions.manage.count",{count:b.length})}),h.jsx("button",{className:ee("resume-picker-close"),onClick:e,title:t("common.close"),children:"ESC"})]}),h.jsx("div",{className:ee("resume-picker-search"),children:h.jsx("span",{className:ee("resume-picker-search-hint"),children:z||t(w?"extensions.manage.loading":E?"extensions.manage.checkingUpdates":"common.enterSelect")})}),h.jsx("div",{className:ee("resume-picker-sep")}),s==="list"&&h.jsxs("div",{className:ee("resume-picker-list"),ref:D,children:[!w&&b.length===0&&h.jsx("div",{className:ee("resume-picker-empty"),children:t("extensions.manage.empty")}),b.map((X,H)=>{const O=g[X.name]??X.updateState;return h.jsxs("div",{className:ee("resume-picker-item",H===o?"selected":void 0),onClick:()=>{l(H),a("actions"),u(0)},onMouseEnter:()=>l(H),children:[h.jsxs("div",{className:ee("resume-picker-item-row"),children:[h.jsx("span",{className:ee("resume-picker-item-prefix"),children:H===o?"›":" "}),h.jsx("span",{className:ee("resume-picker-item-title"),children:X.name}),h.jsxs("span",{className:ee("resume-picker-item-badge"),children:["v",X.version]}),h.jsx("span",{className:ee("resume-picker-item-badge"),children:aw(X,t)})]}),h.jsx("div",{className:ee("resume-picker-item-meta"),children:e9(O,t)})]},X.id||X.name)})]}),s==="actions"&&N&&h.jsxs("div",{className:ee("resume-picker-list"),ref:D,children:[h.jsxs("div",{className:ee("dialog-detail"),children:[h.jsxs("div",{children:[t("extensions.manage.version")," ",N.version]}),h.jsxs("div",{children:[t("extensions.manage.status")," ",aw(N,t)]}),h.jsxs("div",{children:[t("extensions.manage.source")," ",N.source??"-"]})]}),W.map((X,H)=>h.jsxs("div",{className:ee("resume-picker-item",H===c?"selected":void 0,X.disabled?"disabled":void 0),onClick:()=>{X.disabled||X.run()},onMouseEnter:()=>u(H),children:[h.jsx("span",{className:ee("resume-picker-item-prefix"),children:H===c?"›":" "}),h.jsx("span",{className:ee("resume-picker-item-title"),children:X.label}),X.hint&&h.jsx("span",{className:ee("resume-picker-item-badge"),children:X.hint})]},X.label))]}),s==="details"&&N&&h.jsx(gbe,{extension:N}),s==="scope"&&N&&h.jsx("div",{className:ee("resume-picker-list"),ref:D,children:["user","workspace"].map((X,H)=>h.jsxs("div",{className:ee("resume-picker-item",H===d?"selected":void 0),onClick:()=>$(X),onMouseEnter:()=>f(H),children:[h.jsx("span",{className:ee("resume-picker-item-prefix"),children:H===d?"›":" "}),h.jsx("span",{className:ee("resume-picker-item-title"),children:t(X==="user"?"settings.scope.user":"settings.scope.workspace")})]},X))}),s==="uninstall"&&N&&h.jsxs("div",{className:ee("dialog-detail"),children:[h.jsx("div",{children:t("extensions.manage.uninstallConfirm",{name:N.name})}),h.jsx("button",{className:ee("dialog-danger-button"),disabled:T===N.name,onClick:()=>{q(X=>r.uninstallExtension(N.name,X),N.name),a("list")},children:t("extensions.manage.uninstallAction")})]}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsx("div",{className:ee("resume-picker-footer"),children:M})]})}function gbe({extension:e}){const{t}=ft(),n=e.details;return h.jsx("div",{className:ee("resume-picker-list"),children:h.jsxs("div",{className:ee("resume-picker-detail-panel"),children:[h.jsx(ea,{label:t("extensions.manage.name"),value:e.name}),h.jsx(ea,{label:t("extensions.manage.version"),value:e.version}),h.jsx(ea,{label:t("extensions.manage.status"),value:aw(e,t)}),h.jsx(ea,{label:t("extensions.manage.path"),value:e.path}),h.jsx(ea,{label:t("extensions.manage.source"),value:e.source??"-"}),h.jsx(ea,{label:t("extensions.manage.commands"),value:ju(n==null?void 0:n.commands)}),h.jsx(ea,{label:t("extensions.manage.skills"),value:ju(n==null?void 0:n.skills)}),h.jsx(ea,{label:t("extensions.manage.agents"),value:ju(n==null?void 0:n.agents)}),h.jsx(ea,{label:t("extensions.manage.mcpServers"),value:ju(n==null?void 0:n.mcpServers)}),h.jsx(ea,{label:t("extensions.manage.contextFiles"),value:ju(n==null?void 0:n.contextFiles)}),h.jsx(ea,{label:t("extensions.manage.settings"),value:ju(n==null?void 0:n.settings)})]})})}function ea({label:e,value:t}){return h.jsxs("div",{className:ee("resume-picker-detail-row"),children:[h.jsx("span",{className:ee("resume-picker-detail-label"),children:e}),h.jsx("span",{className:ee("resume-picker-detail-value"),children:t})]})}const ybe="_panel_1xj4i_1",bbe="_header_1xj4i_16",vbe="_title_1xj4i_22",xbe="_secondary_1xj4i_26",wbe="_hint_1xj4i_30",kbe="_list_1xj4i_34",_be="_category_1xj4i_44",Sbe="_item_1xj4i_54",Tbe="_row_1xj4i_65",Cbe="_pointer_1xj4i_72",Ebe="_label_1xj4i_80",Abe="_selected_1xj4i_89",Mbe="_scopeHint_1xj4i_96",Nbe="_value_1xj4i_101",Ibe="_editWrap_1xj4i_109",Dbe="_editInput_1xj4i_113",Rbe="_detail_1xj4i_130",Obe="_detailEllipsis_1xj4i_140",jbe="_detailText_1xj4i_144",Lbe="_detailTextScrolling_1xj4i_148",Bbe="_footer_1xj4i_165",zbe="_empty_1xj4i_171",Wt={panel:ybe,header:bbe,title:vbe,secondary:xbe,hint:wbe,list:kbe,category:_be,item:Sbe,row:Tbe,pointer:Cbe,label:Ebe,selected:Abe,scopeHint:Mbe,value:Nbe,editWrap:Ibe,editInput:Dbe,detail:Rbe,detailEllipsis:Obe,detailText:jbe,detailTextScrolling:Lbe,footer:Bbe,empty:zbe},ej="web-shell:settings-panel-active",t9=new Set(["fastModel"]);function Ey(e,t,n){const r=e(t);return r===t?n:r}function Pbe(e,t){return Ey(t,`settings.category.${e}`,e)}function $be(e,t){return Ey(t,`settings.label.${e.key}`,e.label)}function Ube(e,t){if(e.description)return Ey(t,`settings.description.${e.key}`,e.description)}function Hbe(e,t,n,r){return Ey(r,`settings.option.${e.key}.${String(t)}`,n)}function qbe(e,t,n){const r=x0(e,t);if(r==null)return"";if(e.key===Sc){const s=E3(r,$i.Dark);return n(`theme.${s}`)}if(e.key===nd){const s=xk(r);return s?wk(s):String(r)}if(e.type==="boolean")return n(r===!0?"settings.value.on":"settings.value.off");if(e.type==="enum"&&e.options){const s=e.options.find(a=>a.value===r);return s?Hbe(e,s.value,s.label,n):String(r)}const i=String(r);return i.length>24?i.slice(0,21)+"...":i}function tj(e,t){return(t==="user"?e.values.user:e.values.workspace)!==void 0}function Fbe(e,t){if(t==="workspace"?e.values.user!==void 0:e.values.workspace!==void 0)return tj(e,t)?"settings.alsoModifiedIn":"settings.modifiedIn"}function x0(e,t){const n=t==="user"?e.values.user:e.values.workspace;return n!==void 0?n:e.values.effective}function Vbe(e,t){return x0(e,t)!==!0}function Gbe(e,t){var s;if(!((s=e.options)!=null&&s.length))return x0(e,t);const n=x0(e,t),i=(e.options.findIndex(a=>a.value===n)+1)%e.options.length;return e.options[i].value}function Wbe(e,t){const n=new Map;for(const r of e){let i=n.get(r.category);i||(i=[],n.set(r.category,i)),i.push(r)}return Array.from(n.entries()).map(([r,i])=>({category:Pbe(r,t),items:i}))}function Kbe(e){const t=[];for(const n of e){t.push({type:"header",category:n.category});for(const r of n.items)t.push({type:"setting",setting:r})}return t}function cp(e,t,n){const r=e.length;if(r===0)return t;let i=t;for(let s=0;s<r;s++)if(i=(i+n+r)%r,e[i].type==="setting")return i;return t}function Ybe({settingsState:e,onClose:t,onLanguageChange:n,onSubDialog:r,onThemeChange:i}){const{t:s}=ft(),{status:a,settings:o,loading:l,error:c,reload:u,setValue:d}=e,[f,m]=v.useState("workspace"),[p,b]=v.useState(0),[x,g]=v.useState(null),[y,w]=v.useState(null),[C,E]=v.useState(null),[S,T]=v.useState(null),[j,z]=v.useState(0),[R,D]=v.useState(0),N=v.useRef(`settings-${Math.random().toString(36).slice(2)}`),B=v.useRef(null),P=v.useRef(null),J=v.useRef(null),q=v.useRef(p),W=v.useRef(t);v.useEffect(()=>{W.current=t},[t]);const $=v.useMemo(()=>Kbe(Wbe(o,s)),[o,s]),[Z,M]=v.useState(!1),X=$[p],H=(X==null?void 0:X.type)==="setting"&&X.setting?Ube(X.setting,s):void 0,O=l&&!a,se=o.find(re=>re.key===Sc),ke=E3(se==null?void 0:se.values.effective),be=o.find(re=>re.key===nd),Ee=xk(be==null?void 0:be.values.effective),qe=v.useRef(null),[wt,Mt]=v.useState(null);v.useLayoutEffect(()=>{const re=qe.current;if(!re)return;const le=()=>{const We=re.scrollWidth-re.clientWidth,pe=window.matchMedia("(prefers-reduced-motion: reduce)").matches;We>1&&!pe?Mt({distance:We,duration:Math.max(3,We/80/.7)}):Mt(null)};le();const De=new ResizeObserver(le);return De.observe(re),()=>De.disconnect()},[H]);const bt=v.useCallback(re=>{window.dispatchEvent(new CustomEvent(ej,{detail:{id:N.current,active:re}}))},[]);v.useEffect(()=>(bt(!0),()=>bt(!1)),[bt]),v.useEffect(()=>{const re=le=>{if(le instanceof MouseEvent&&le.button!==0||le.defaultPrevented)return;const De=B.current,We=le.target;De&&We instanceof Node&&!De.contains(We)&&W.current()};return window.addEventListener("mousedown",re),window.addEventListener("touchstart",re),()=>{window.removeEventListener("mousedown",re),window.removeEventListener("touchstart",re)}},[]),v.useEffect(()=>{var re;c?w(c.message):(re=a==null?void 0:a.warnings)!=null&&re.length?w(a.warnings.map(le=>s("settings.corrupted",{recovered:le.recovered?"true":"false"})).join("; ")):o.length>0&&!Z&&w(null)},[c,o,a,s,Z]),v.useEffect(()=>{var re;$.length!==0&&(p>=$.length?b(cp($,$.length,-1)):((re=$[p])==null?void 0:re.type)!=="setting"&&b(cp($,p-1,1)))},[p,$]),v.useEffect(()=>{q.current=p},[p]),v.useEffect(()=>{var le;const re=(le=P.current)==null?void 0:le.children[p];re==null||re.scrollIntoView({block:"nearest"})},[p]),v.useEffect(()=>{var le;if(S!=="theme")return;const re=(le=P.current)==null?void 0:le.children[j];re==null||re.scrollIntoView({block:"nearest"})},[j,S]),v.useEffect(()=>{var le;if(S!=="language")return;const re=(le=P.current)==null?void 0:le.children[R];re==null||re.scrollIntoView({block:"nearest"})},[R,S]),v.useEffect(()=>{C&&setTimeout(()=>{var re;return(re=J.current)==null?void 0:re.focus()},0)},[C]),v.useEffect(()=>{if(S!=="theme")return;const re=ke?Jh.indexOf(ke):-1;z(re>=0?re:0)},[S,ke]),v.useEffect(()=>{if(S!=="language")return;const re=Ee?zm.indexOf(Ee):-1;D(re>=0?re:0)},[S,Ee]);const Je=v.useCallback((re,le)=>{Z||w(null),g(re),d("workspace",re,le).then(async De=>{try{await u()}catch{}De!=null&&De.requiresRestart&&re!==nd&&(M(!0),w(s("settings.requiresRestart")))}).catch(De=>{w(De instanceof Error?De.message:String(De))}).finally(()=>g(null))},[u,Z,d,s]),Ge=v.useCallback(re=>{if(!(C&&C.key===re.key)){if(E(null),f!=="workspace"){w(s("settings.readOnly"));return}if(re.key===Sc){T("theme");return}if(re.key===nd){T("language");return}if(t9.has(re.key)){r(re.key);return}if(re.type==="boolean"){Je(re.key,Vbe(re,f));return}if(re.type==="enum"){Je(re.key,Gbe(re,f));return}(re.type==="string"||re.type==="number")&&E({key:re.key,draft:String(x0(re,f)??"")})}},[C,Je,r,f,s]),Pt=v.useCallback(()=>{if(!C)return;const re=$.find(We=>{var pe;return We.type==="setting"&&((pe=We.setting)==null?void 0:pe.key)===C.key}),le=re==null?void 0:re.setting;if(!le){E(null);return}let De=C.draft;if(le.type==="number"){const We=C.draft.trim();if(We===""||!Number.isFinite(Number(We))){w(s("settings.invalidNumber"));return}De=Number(We)}E(null),Je(le.key,De)},[C,$,Je,s]);ui(re=>{if(re.defaultPrevented)return;const le=()=>{re.preventDefault(),re.stopPropagation()};if(C){if(re.key==="Escape"){le(),E(null);return}if(re.key==="Enter"){le(),Pt();return}return}if(S==="theme"){if(re.key==="Escape"){le(),T(null);return}if(re.key==="ArrowDown"||re.key==="j"){le(),z(De=>Math.min(De+1,Jh.length-1));return}if(re.key==="ArrowUp"||re.key==="k"){le(),z(De=>Math.max(De-1,0));return}if((re.key==="Enter"||re.key===" ")&&!x){le();const De=Jh[j];De&&(T(null),i(De),Je(Sc,B6(De)));return}return}if(S==="language"){if(re.key==="Escape"){le(),T(null);return}if(re.key==="ArrowDown"||re.key==="j"){le(),D(De=>Math.min(De+1,zm.length-1));return}if(re.key==="ArrowUp"||re.key==="k"){le(),D(De=>Math.max(De-1,0));return}if((re.key==="Enter"||re.key===" ")&&!x){le();const De=zm[R];De&&(T(null),n(De),t());return}return}if(re.key==="Escape"){le(),t();return}if(re.key==="ArrowDown"||re.key==="j"){le(),b(De=>cp($,De,1));return}if(re.key==="ArrowUp"||re.key==="k"){le(),b(De=>cp($,De,-1));return}if(re.key==="Tab"){le(),m(De=>De==="workspace"?"user":"workspace");return}if(re.key==="r"&&!re.ctrlKey&&!re.metaKey&&!re.altKey){le(),u();return}if((re.key==="Enter"||re.key===" ")&&!x){le();const De=$[q.current];(De==null?void 0:De.type)==="setting"&&De.setting&&Ge(De.setting)}},[x,C,Ge,Pt,Je,S,t,n,u,$,R,j,i]);const Ze=s(f==="workspace"?"settings.scope.workspace":"settings.scope.user");return h.jsxs("div",{ref:B,className:Wt.panel,"data-keyboard-scope":!0,children:[h.jsxs("div",{className:Wt.header,children:[h.jsx("span",{className:Wt.title,children:S==="theme"?`${s("settings.title")} / ${s("theme.title")}`:S==="language"?`${s("settings.title")} / ${s("language.set")}`:s("settings.title")}),h.jsx("span",{className:Wt.secondary,children:Ze})]}),(y||O)&&h.jsx("div",{className:Wt.hint,children:y||s("settings.loading")}),h.jsx("div",{className:Wt.list,ref:P,role:"listbox",children:S==="theme"?Jh.map((re,le)=>h.jsx("div",{role:"option","aria-selected":le===j,className:`${Wt.item} ${le===j?Wt.selected:""}`,onClick:()=>{x||(z(le),T(null),i(re),Je(Sc,B6(re)))},children:h.jsxs("div",{className:Wt.row,children:[h.jsx("span",{className:Wt.pointer,children:le===j?"›":" "}),h.jsx("span",{className:Wt.label,children:s(`theme.${re}`)}),h.jsx("span",{className:Wt.value,children:re===ke?"✓":""})]})},re)):S==="language"?zm.map((re,le)=>h.jsx("div",{role:"option","aria-selected":le===R,className:`${Wt.item} ${le===R?Wt.selected:""}`,onClick:()=>{x||(D(le),T(null),n(re),t())},children:h.jsxs("div",{className:Wt.row,children:[h.jsx("span",{className:Wt.pointer,children:le===R?"›":" "}),h.jsx("span",{className:Wt.label,children:wk(re)}),h.jsx("span",{className:Wt.value,children:re===Ee?"✓":""})]})},re)):h.jsxs(h.Fragment,{children:[!l&&$.length===0&&h.jsx("div",{className:Wt.empty,children:s("settings.empty")}),$.map((re,le)=>{if(re.type==="header")return h.jsx("div",{role:"presentation",className:Wt.category,children:re.category},`cat-${re.category}`);const De=re.setting,We=le===p,pe=(C==null?void 0:C.key)===De.key,st=t9.has(De.key)||De.key===Sc||De.key===nd,ae=tj(De,f),je=Fbe(De,f);return h.jsxs("div",{role:"option","aria-selected":We,className:`${Wt.item} ${We?Wt.selected:""}`,onClick:()=>{x||(b(le),Ge(De))},children:[h.jsxs("div",{className:Wt.row,children:[h.jsx("span",{className:Wt.pointer,children:We?"›":" "}),h.jsxs("span",{className:Wt.label,children:[$be(De,s),je&&h.jsxs("span",{className:Wt.scopeHint,children:[" ",s(je,{scope:s(f==="workspace"?"settings.scope.user":"settings.scope.workspace")})]})]}),h.jsx("span",{className:Wt.value,children:x===De.key?"...":`${qbe(De,f,s)}${ae?"*":""}${st?" ▸":""}`})]}),pe&&C&&h.jsx("div",{className:Wt.editWrap,children:h.jsx("input",{ref:J,className:Wt.editInput,type:De.type==="number"?"number":"text",value:C.draft,onChange:Oe=>E({key:C.key,draft:Oe.target.value}),onKeyDown:Oe=>{Oe.key==="Enter"&&(Oe.preventDefault(),Pt()),Oe.key==="Escape"&&(Oe.preventDefault(),E(null))}})})]},De.key)})]})}),h.jsx("div",{ref:qe,className:wt?Wt.detail:`${Wt.detail} ${Wt.detailEllipsis}`,title:H||void 0,children:h.jsx("span",{className:wt?`${Wt.detailText} ${Wt.detailTextScrolling}`:Wt.detailText,style:wt?{"--marquee-distance":`${wt.distance}px`,"--marquee-duration":`${wt.duration}s`}:void 0,children:H||" "},p)}),h.jsx("div",{className:Wt.footer,children:s(C?"settings.footer.edit":S?"settings.footer.theme":"settings.footer")})]})}const Xbe="_dialog_gh65b_1",Qbe="_body_gh65b_5",Jbe="_tabs_gh65b_14",Zbe="_brand_gh65b_21",eve="_tab_gh65b_14",tve="_tabActive_gh65b_33",nve="_general_gh65b_38",rve="_intro_gh65b_45",ive="_sectionTitle_gh65b_50",sve="_shortcuts_gh65b_55",ave="_shortcut_gh65b_55",ove="_shortcutKey_gh65b_70",lve="_shortcutDesc_gh65b_77",cve="_commandList_gh65b_83",uve="_commandListIntro_gh65b_90",dve="_commandGroup_gh65b_95",hve="_commandGroupTitle_gh65b_102",fve="_command_gh65b_83",mve="_commandRow_gh65b_120",pve="_commandName_gh65b_127",gve="_commandMeta_gh65b_135",yve="_commandDescription_gh65b_144",bve="_commandSubcommands_gh65b_151",vve="_empty_gh65b_158",Vn={dialog:Xbe,body:Qbe,tabs:Jbe,brand:Zbe,tab:eve,tabActive:tve,general:nve,intro:rve,sectionTitle:ive,shortcuts:sve,shortcut:ave,shortcutKey:ove,shortcutDesc:lve,commandList:cve,commandListIntro:uve,commandGroup:dve,commandGroupTitle:hve,command:fve,commandRow:mve,commandName:pve,commandMeta:gve,commandDescription:yve,commandSubcommands:bve,empty:vve},of=[{id:"general",labelKey:"help.tab.general"},{id:"commands",labelKey:"help.tab.commands"},{id:"custom-commands",labelKey:"help.tab.custom"}],xve="https://qwenlm.github.io/qwen-code-docs/",ow=new Set(["about","agents","approval-mode","arena","auth","branch","btw","bug","clear","compress","context","copy","release","diff","directory","docs","doctor","dream","editor","export","extensions","forget","goal","help","hooks","ide","init","insight","language","lsp","mcp","memory","model","new","permissions","plan","quit","recap","remember","rename","reset","restore","resume","rewind","settings","setup-github","skills","stats","status","statusline","summary","tasks","terminal-setup","theme","tools","trust","vim"]),wve=[["@","help.shortcut.addContext"],["!","help.shortcut.shell"],["/","help.shortcut.commandMenu"],["Tab","help.shortcut.completion"],["Esc","help.shortcut.cancel"],["Ctrl+J","help.shortcut.newline"],["Ctrl+L","help.shortcut.clear"],["Ctrl+Y","help.shortcut.retry"],["Ctrl+O","help.shortcut.compact"],["Shift+Tab","help.shortcut.approvals"],["Alt+Left/Right","help.shortcut.altWords"],["Up/Down","help.shortcut.history"]];function kve(e){return[`/${e.name}`,e.argumentHint].filter(Boolean).join(" ")}function _ve(e,t){var r;return[ow.has(e.name)?t("help.commandMeta.builtIn"):t("help.commandMeta.custom"),(r=e.subcommands)!=null&&r.length?t("help.commandMeta.subcommands",{count:e.subcommands.length}):void 0].filter(Boolean).join(" · ")}function Sve(e,t,n){const r=e.filter(a=>a.name&&a.description!==void 0).sort((a,o)=>a.name.localeCompare(o.name)),i=r.filter(a=>ow.has(a.name)),s=r.filter(a=>!ow.has(a.name));return t?s.length?[{key:"custom",title:n("help.customGroup"),commands:s}]:[]:i.length?[{key:"built-in",title:n("help.builtIn"),commands:i}]:[]}function Tve({activeTab:e}){const{t}=ft();return h.jsxs("div",{className:Vn.tabs,children:[h.jsx("span",{className:Vn.brand,children:"Qwen Code"}),of.map(n=>h.jsx("span",{className:`${Vn.tab} ${n.id===e?Vn.tabActive:""}`,children:t(n.labelKey)},n.id))]})}function Cve(){const{t:e}=ft();return h.jsxs("div",{className:Vn.general,children:[h.jsx("div",{className:Vn.intro,children:e("help.intro")}),h.jsx("div",{className:Vn.sectionTitle,children:e("help.section.shortcuts")}),h.jsx("div",{className:Vn.shortcuts,children:wve.map(([t,n])=>h.jsxs("div",{className:Vn.shortcut,children:[h.jsx("span",{className:Vn.shortcutKey,children:t}),h.jsx("span",{className:Vn.shortcutDesc,children:e(n)})]},t))})]})}function n9({commands:e,customOnly:t}){const{t:n}=ft(),r=v.useMemo(()=>Sve(e,t,n),[e,t,n]),i=v.useRef(null);return ui(s=>{const a=i.current;a&&(s.key==="ArrowDown"||s.key==="j"?(s.preventDefault(),a.scrollBy({top:32,behavior:"smooth"})):s.key==="ArrowUp"||s.key==="k"?(s.preventDefault(),a.scrollBy({top:-32,behavior:"smooth"})):s.key==="PageDown"?(s.preventDefault(),a.scrollBy({top:a.clientHeight,behavior:"smooth"})):s.key==="PageUp"?(s.preventDefault(),a.scrollBy({top:-a.clientHeight,behavior:"smooth"})):s.key==="Home"?(s.preventDefault(),a.scrollTo({top:0,behavior:"smooth"})):s.key==="End"&&(s.preventDefault(),a.scrollTo({top:a.scrollHeight,behavior:"smooth"})))},[]),v.useEffect(()=>{var s;(s=i.current)==null||s.scrollTo({top:0})},[t,e]),r.length===0?h.jsx("div",{className:Vn.empty,children:n(t?"help.emptyCustom":"help.empty")}):h.jsxs("div",{className:Vn.commandList,ref:i,children:[h.jsx("div",{className:Vn.commandListIntro,children:n(t?"help.customIntro":"help.commandsIntro")}),r.map(s=>h.jsxs("div",{className:Vn.commandGroup,children:[h.jsxs("div",{className:Vn.commandGroupTitle,children:[s.title,h.jsx("span",{children:s.commands.length})]}),s.commands.map(a=>{var o;return h.jsxs("div",{className:Vn.command,children:[h.jsxs("div",{className:Vn.commandRow,children:[h.jsx("span",{className:Vn.commandName,children:kve(a)}),h.jsx("span",{className:Vn.commandMeta,children:_ve(a,n)})]}),a.description&&h.jsx("div",{className:Vn.commandDescription,children:a.description}),!!((o=a.subcommands)!=null&&o.length)&&h.jsxs("div",{className:Vn.commandSubcommands,children:[n("help.subcommands"),": ",a.subcommands.join(", ")]})]},a.name)})]},s.key))]})}function Eve({commands:e,onClose:t}){const{t:n}=ft(),[r,i]=v.useState("general");return ui(s=>{if(s.key==="Escape"){s.preventDefault(),t();return}if(s.key==="Tab"){s.preventDefault();const a=of.findIndex(c=>c.id===r),o=s.shiftKey?-1:1,l=(a+o+of.length)%of.length;i(of[l].id)}},[r,t]),h.jsxs("div",{className:`${ee("resume-picker")} ${Vn.dialog}`,children:[h.jsxs("div",{className:ee("resume-picker-header"),children:[h.jsx("span",{className:ee("resume-picker-title"),children:n("help.title")}),h.jsx("span",{className:ee("resume-picker-count"),children:n("help.commandCount",{count:e.length})}),h.jsx("button",{className:ee("resume-picker-close"),onClick:t,title:n("common.close"),children:"ESC"})]}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsxs("div",{className:Vn.body,children:[h.jsx(Tve,{activeTab:r}),r==="general"&&h.jsx(Cve,{}),r==="commands"&&h.jsx(n9,{commands:e,customOnly:!1}),r==="custom-commands"&&h.jsx(n9,{commands:e,customOnly:!0})]}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsxs("div",{className:ee("resume-picker-footer"),children:[n("help.footer")," · ",xve]})]})}function Ave({currentTheme:e,onSelect:t,onClose:n}){const{t:r}=ft(),i=Jh.map(c=>({id:c,label:r(`theme.${c}`),description:r(`theme.${c}.desc`)})),[s,a]=v.useState(()=>{const c=i.findIndex(u=>u.id===e);return c>=0?c:0}),o=v.useRef(null);v.useEffect(()=>{var u;const c=(u=o.current)==null?void 0:u.children[s];c==null||c.scrollIntoView({block:"nearest"})},[s]);const l=v.useCallback(()=>{const c=i[s];c&&(t(c.id),n())},[n,t,s,i]);return ui(c=>{if(c.key==="Escape"){c.preventDefault(),n();return}if(c.key==="ArrowDown"||c.key==="j"){c.preventDefault(),a(u=>Math.min(u+1,i.length-1));return}if(c.key==="ArrowUp"||c.key==="k"){c.preventDefault(),a(u=>Math.max(u-1,0));return}c.key==="Enter"&&(c.preventDefault(),l())},[l,n,i.length]),h.jsxs("div",{className:ee("resume-picker"),children:[h.jsxs("div",{className:ee("resume-picker-header"),children:[h.jsx("span",{className:ee("resume-picker-title"),children:r("theme.title")}),h.jsx("span",{className:ee("resume-picker-count"),children:r("theme.current",{theme:e})}),h.jsx("button",{className:ee("resume-picker-close"),onClick:n,title:r("common.close"),children:"ESC"})]}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsx("div",{className:ee("resume-picker-list"),ref:o,children:i.map((c,u)=>h.jsxs("div",{className:ee("resume-picker-item",u===s?"selected":void 0),onClick:()=>{t(c.id),n()},onMouseEnter:()=>a(u),children:[h.jsxs("div",{className:ee("resume-picker-item-row"),children:[h.jsx("span",{className:ee("resume-picker-item-prefix"),children:u===s?"›":" "}),h.jsx("span",{className:ee("resume-picker-item-title"),children:c.label}),c.id===e&&h.jsx("span",{className:ee("resume-picker-item-check"),children:" ✓"})]}),h.jsx("div",{className:ee("resume-picker-item-meta"),children:c.description})]},c.id))}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsx("div",{className:ee("resume-picker-footer"),children:r("dialog.footer.navSelectCancel")})]})}function Mve({onDeleted:e,onError:t,onClose:n}){const{t:r}=ft(),i=du(),{sessions:s,loading:a,error:o,deleteSession:l,deleteSessions:c}=C3({autoLoad:!0}),u=i.sessionId,[d,f]=v.useState(!1),[m,p]=v.useState(0),[b,x]=v.useState(new Set),[g,y]=v.useState(!1),[w,C]=v.useState(""),[E,S]=v.useState(null),T=v.useRef(null);v.useEffect(()=>{o&&S(o.message)},[o]);const j=v.useMemo(()=>w?s.filter(N=>{const B=w.toLowerCase();return(N.displayName||"").toLowerCase().includes(B)||N.sessionId.toLowerCase().includes(B)}):s,[s,w]);v.useEffect(()=>{if(w&&b.size>0){const N=new Set(j.map(B=>B.sessionId));x(B=>{const P=new Set([...B].filter(J=>N.has(J)));return P.size===B.size?B:P})}},[w,j,b.size]),v.useEffect(()=>{m>=j.length&&j.length>0&&p(j.length-1)},[j.length,m]),v.useEffect(()=>{var B;const N=(B=T.current)==null?void 0:B.children[m];N==null||N.scrollIntoView({block:"nearest"})},[m]);const z=v.useCallback(N=>{N!==u&&x(B=>{const P=new Set(B);return P.has(N)?P.delete(N):P.add(N),P})},[u]),R=v.useCallback(()=>{if(d)return;if(b.size>0){const B=new Set(j.map(J=>J.sessionId)),P=Array.from(b).filter(J=>B.has(J));if(P.length===0)return;f(!0),c(P).then(J=>{const q=J.removed.length+J.notFound.length,W=J.errors.length;if(W>0&&q>0){t(new Error(r("delete.partialFail",{removed:q,failed:W,detail:J.errors[0].error}))),n();return}if(W>0){S(r("delete.allFailed",{count:W,reason:J.errors[0].error})),f(!1),x(new Set);return}if(q===0){S(r("delete.nonRemoved")),f(!1),x(new Set);return}e([...J.removed,...J.notFound]),n()}).catch(J=>{t(J),f(!1)});return}const N=j[m];if(N){if(N.sessionId===u){S(r("delete.cannotCurrent"));return}f(!0),l(N.sessionId).then(B=>{if(!B){S(r("delete.notFound")),f(!1);return}e([N.sessionId]),n()}).catch(B=>{t(B),f(!1)})}},[u,l,c,d,j,n,e,t,m,b,r]);ui(N=>{if(!d){if(g){if(N.key==="Escape"){N.preventDefault(),w?C(""):y(!1);return}if(N.key==="Enter"){N.preventDefault(),j.length>0&&(y(!1),p(0));return}(N.key==="ArrowUp"||N.key==="ArrowDown")&&(N.preventDefault(),y(!1),N.key==="ArrowDown"&&p(B=>Math.min(B+1,j.length-1)));return}if(N.key==="Escape"){N.preventDefault(),w?(C(""),p(0)):n();return}if(N.key==="ArrowDown"||N.key==="j"){N.preventDefault(),p(B=>Math.min(B+1,j.length-1));return}if(N.key==="ArrowUp"||N.key==="k"){N.preventDefault(),m===0?y(!0):p(B=>Math.max(B-1,0));return}if(N.key===" "){N.preventDefault();const B=j[m];B&&z(B.sessionId);return}if(N.key==="Enter"){N.preventDefault(),R();return}N.key==="/"&&(N.preventDefault(),y(!0))}},[d,j,R,n,g,w,m,z]);const D=b.size>0;return h.jsxs("div",{className:ee("resume-picker","resume-picker-keyboard-only"),children:[h.jsxs("div",{className:ee("resume-picker-header"),children:[h.jsx("span",{className:ee("resume-picker-title"),children:r("delete.title")}),D&&h.jsxs("span",{className:ee("resume-picker-count"),children:["(",r("delete.selected",{count:b.size}),")"]}),!D&&w&&h.jsxs("span",{className:ee("resume-picker-count"),children:["(",r("delete.matches",{count:j.length}),")"]}),h.jsx("button",{className:ee("resume-picker-close"),onClick:n,title:r("common.close"),children:"ESC"})]}),h.jsx("div",{className:ee("resume-picker-search"),children:g?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:ee("resume-picker-search-label"),children:[r("resume.search"),":"," "]}),h.jsx("input",{className:ee("resume-picker-search-input"),value:w,onChange:N=>{C(N.target.value),p(0)},autoFocus:!0,placeholder:""})]}):w?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:ee("resume-picker-search-label"),children:[r("resume.filter"),":"," "]}),h.jsx("span",{className:ee("resume-picker-search-value"),children:w})]}):h.jsx("span",{className:ee("resume-picker-search-hint"),children:E||r(d?"delete.deleting":a?"common.loading":"delete.pressSearch")})}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsxs("div",{className:ee("resume-picker-list"),ref:T,children:[a&&h.jsx("div",{className:ee("resume-picker-empty"),children:r("common.loading")}),!a&&o&&h.jsx("div",{className:ee("resume-picker-empty"),children:o.message}),!a&&!o&&j.length===0&&h.jsx("div",{className:ee("resume-picker-empty"),children:w?r("delete.noMatch",{query:w}):r("delete.none")}),!a&&j.map((N,B)=>{const P=N.sessionId===u,q=b.has(N.sessionId)?"[x] ":"[ ] ";return h.jsxs("div",{className:ee("resume-picker-item","resume-picker-session-item",B===m&&!g?"selected":void 0,P?"resume-picker-item-current":void 0,P?"disabled":void 0),onClick:()=>{p(B),P||z(N.sessionId)},children:[h.jsxs("div",{className:ee("resume-picker-item-row"),children:[h.jsx("span",{className:ee("resume-picker-item-prefix"),children:B===m&&!g?"›":" "}),h.jsx("span",{className:ee("resume-picker-item-checkbox"),children:q}),h.jsx("span",{className:ee("resume-picker-item-title"),children:N.displayName||N.sessionId.slice(0,8)}),P&&h.jsx("span",{className:ee("resume-picker-item-badge"),children:r("resume.current")})]}),h.jsxs("div",{className:ee("resume-picker-item-meta"),children:[h.jsx("span",{children:(N.updatedAt||N.createdAt)&&a5(N.updatedAt||N.createdAt||"",r)}),h.jsx("span",{className:ee("resume-picker-item-detail"),children:r("common.clients",{count:N.clientCount??0})}),N.hasActivePrompt&&h.jsx("span",{className:ee("resume-picker-item-detail"),children:r("resume.activePrompt")})]})]},N.sessionId)})]}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsx("div",{className:ee("resume-picker-footer"),children:r(g?"dialog.footer.search":"delete.footer")})]})}function Nve({onReleased:e,onError:t,onClose:n}){const{t:r}=ft(),i=du(),{sessions:s,loading:a,error:o,releaseSession:l}=C3({autoLoad:!0}),c=i.sessionId,[u,d]=v.useState(!1),[f,m]=v.useState(0),[p,b]=v.useState(!1),[x,g]=v.useState(""),[y,w]=v.useState(null),C=v.useRef(null);v.useEffect(()=>{o&&w(o.message)},[o]);const E=x?s.filter(T=>{const j=x.toLowerCase();return(T.displayName||"").toLowerCase().includes(j)||T.sessionId.toLowerCase().includes(j)}):s;v.useEffect(()=>{f>=E.length&&E.length>0&&m(E.length-1)},[E.length,f]),v.useEffect(()=>{var j;const T=(j=C.current)==null?void 0:j.children[f];T==null||T.scrollIntoView({block:"nearest"})},[f]);const S=v.useCallback(T=>{const j=T??E[f];if(!j||u)return;if(!((j.clientCount??0)>0||j.hasActivePrompt===!0)){w(r("release.inactive"));return}if(j.sessionId===c){w(r("release.cannotCurrent"));return}l&&(d(!0),l(j.sessionId).then(()=>{e(j.sessionId),n()}).catch(R=>{t(R),d(!1)}))},[c,u,E,n,t,e,l,f,r]);return ui(T=>{if(!u){if(p){if(T.key==="Escape"){T.preventDefault(),x?g(""):b(!1);return}if(T.key==="Enter"){T.preventDefault(),E.length>0&&b(!1);return}(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),b(!1),T.key==="ArrowDown"&&m(j=>Math.min(j+1,E.length-1)));return}if(T.key==="Escape"){T.preventDefault(),x?(g(""),m(0)):n();return}if(T.key==="ArrowDown"||T.key==="j"){T.preventDefault(),m(j=>Math.min(j+1,E.length-1));return}if(T.key==="ArrowUp"||T.key==="k"){T.preventDefault(),f===0?b(!0):m(j=>Math.max(j-1,0));return}if(T.key==="Enter"){T.preventDefault(),S();return}T.key==="/"&&(T.preventDefault(),b(!0))}},[u,E.length,S,n,p,x,f]),h.jsxs("div",{className:ee("resume-picker","resume-picker-keyboard-only"),children:[h.jsxs("div",{className:ee("resume-picker-header"),children:[h.jsx("span",{className:ee("resume-picker-title"),children:r("release.title")}),x&&h.jsxs("span",{className:ee("resume-picker-count"),children:["(",E.length," matches)"]}),h.jsx("button",{className:ee("resume-picker-close"),onClick:n,title:r("common.close"),children:"ESC"})]}),h.jsx("div",{className:ee("resume-picker-search"),children:p?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:ee("resume-picker-search-label"),children:[r("resume.search"),":"," "]}),h.jsx("input",{className:ee("resume-picker-search-input"),value:x,onChange:T=>{g(T.target.value),m(0)},autoFocus:!0,placeholder:""})]}):x?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:ee("resume-picker-search-label"),children:[r("resume.filter"),":"," "]}),h.jsx("span",{className:ee("resume-picker-search-value"),children:x})]}):h.jsx("span",{className:ee("resume-picker-search-hint"),children:y||r(u?"release.releasing":a?"common.loading":"release.pressSearch")})}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsxs("div",{className:ee("resume-picker-list"),ref:C,children:[a&&h.jsx("div",{className:ee("resume-picker-empty"),children:r("common.loading")}),!a&&E.length===0&&h.jsx("div",{className:ee("resume-picker-empty"),children:x?r("release.noMatch",{query:x}):r("release.none")}),!a&&E.map((T,j)=>{const z=T.sessionId===c,R=(T.clientCount??0)>0||T.hasActivePrompt===!0,D=z||!R;return h.jsxs("div",{className:ee("resume-picker-item","resume-picker-session-item",j===f&&!p?"selected":void 0,D?"resume-picker-item-current":void 0,D?"disabled":void 0),onClick:()=>{m(j),D||S(T)},children:[h.jsxs("div",{className:ee("resume-picker-item-row"),children:[h.jsx("span",{className:ee("resume-picker-item-prefix"),children:j===f&&!p?"›":" "}),h.jsx("span",{className:ee("resume-picker-item-title"),children:T.displayName||T.sessionId.slice(0,8)}),z&&h.jsx("span",{className:ee("resume-picker-item-badge"),children:r("resume.current")}),!z&&!R&&h.jsx("span",{className:ee("resume-picker-item-badge"),children:r("release.inactiveBadge")})]}),h.jsxs("div",{className:ee("resume-picker-item-meta"),children:[h.jsx("span",{children:(T.updatedAt||T.createdAt)&&a5(T.updatedAt||T.createdAt||"",r)}),h.jsx("span",{className:ee("resume-picker-item-detail"),children:r("common.clients",{count:T.clientCount??0})}),T.hasActivePrompt&&h.jsx("span",{className:ee("resume-picker-item-detail"),children:r("resume.activePrompt")})]})]},T.sessionId)})]}),h.jsx("div",{className:ee("resume-picker-sep")}),h.jsx("div",{className:ee("resume-picker-footer"),children:r(p?"dialog.footer.search":"release.footer")})]})}function Ive(e){return[{name:"help",description:e("local.help")},{name:"theme",description:e("local.theme"),argumentHint:"light|dark",subcommands:["light","dark"]},{name:"language",description:e("local.language"),argumentHint:"ui [en|zh-CN]",subcommands:["ui"]},{name:"plan",description:e("local.plan"),argumentHint:"<prompt>"},{name:"btw",description:e("local.btw"),argumentHint:"<your question>"},{name:"copy",description:e("local.copy"),argumentHint:"[code|<lang>|latex|inline-latex] [index]"},{name:"delete",description:e("local.delete")},{name:"release",description:e("local.release")},{name:"auth",description:e("local.auth")},{name:"approval-mode",description:e("local.approvalMode"),argumentHint:"<mode>"},{name:"model",description:e("local.model"),argumentHint:"[--fast] [<model>]"},{name:"mcp",description:e("local.mcp"),argumentHint:"desc|nodesc|schema|auth|noauth"},{name:"skills",description:e("local.skills")},{name:"status",description:e("local.status")},{name:"stats",description:e("local.stats"),argumentHint:"[model|tools]",subcommands:["model","tools"]},{name:"tools",description:e("local.tools"),argumentHint:"[desc]"},{name:"memory",description:e("local.memory")},{name:"context",description:e("local.context"),argumentHint:"[detail]"},{name:"agents",description:e("local.agents"),argumentHint:"manage|create"},{name:"goal",description:e("local.goal"),argumentHint:"[<condition> | clear]"},{name:"tasks",description:e("local.tasks")},{name:"recap",description:e("local.recap")},{name:"branch",description:e("local.branch"),argumentHint:"[<name>]"},{name:"fork",description:e("local.fork"),argumentHint:"<directive>"},{name:"clear",description:e("local.clear")},{name:"new",description:e("local.new")},{name:"reset",description:e("local.reset")},{name:"rename",description:e("local.rename"),argumentHint:"[--auto] [<name>]"},{name:"resume",description:e("local.resume"),argumentHint:"<session-id>"},{name:"settings",description:e("local.settings")},{name:"extensions",description:e("local.extensions"),argumentHint:"manage|install <source>",subcommands:["manage","install"]}].map(n=>({...n,source:"builtin-command"}))}function Dve(...e){const t=new Map;for(const n of e)for(const r of n){const i=t.get(r.name);i?t.set(r.name,{...i,...r,description:r.description||i.description,argumentHint:r.argumentHint??i.argumentHint}):t.set(r.name,r)}return[...t.values()]}function Rve(e){const[t,n]=v.useState(e);return v.useEffect(()=>{const r=window.requestAnimationFrame(()=>{n(e)});return()=>window.cancelAnimationFrame(r)},[e]),t}const Ove=3e3,jve=2;function r9(e){return e.some(t=>t.status==="running"||t.status==="paused")}function Lve(e,t,n=0){const r=T3(),[i,s]=v.useState([]),[a,o]=v.useState(!1),[l,c]=v.useState(!1),u=v.useRef(0),d=v.useRef(!1);v.useEffect(()=>{if(!t){s([]),o(!1),u.current=0;return}},[t]),v.useEffect(()=>{!t||!e||(u.current=0,o(!0))},[t,e]),v.useEffect(()=>{!t||n===0||(u.current=0,o(!0))},[t,n]),v.useEffect(()=>{if(l||!t||!a)return;let m=!1;const p=()=>{d.current||(d.current=!0,r.getTasks().then(x=>{if(!m){if(s(x.tasks),x.tasks.length===0){u.current+=1,u.current>=jve&&o(!1);return}u.current=0,r9(x.tasks)||o(!1)}}).catch(x=>{m||console.warn("[web-shell] failed to refresh tasks:",x)}).finally(()=>{d.current=!1}))};p();const b=setInterval(p,Ove);return()=>{m=!0,clearInterval(b)}},[r,t,a,l]);const f=v.useRef(i);return f.current=i,v.useEffect(()=>{const m=p=>{const b=p.detail,x=(b==null?void 0:b.active)===!0;c(x),!x&&r9(f.current)&&o(!0)};return window.addEventListener(Ud,m),()=>window.removeEventListener(Ud,m)},[]),i}/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */function Bve(e){return e.startsWith("language_changed (unrecognized daemon event):")||e.startsWith("Model switched: ")}function zve(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.displayName=="string"&&t.displayName?t.displayName:typeof t.newSessionId=="string"?t.newSessionId.slice(0,8):null}function Pve(e){const n=e.meta;return(n==null?void 0:n.source)==="background_notification"&&n.qwenDiscreteMessage===!0&&n.backgroundTask!==void 0}function $ve(e){return Pve(e)||!e.text&&!e.usage?null:e}function i9(e){return e.text.length===0}function Uve(e){const t=e.flatMap((n,r)=>{const i=qi(n),s=zi(i,"content");return s?[{id:zi(i,"id")??`plan-${r}`,content:s,status:Wve(zi(i,"status")),...(()=>{const o=Kve(zi(i,"priority"));return o?{priority:o}:{}})()}]:[]});return t.length>0?t:void 0}function s9(e,t){if(!e)return t;if(!t)return e;const n=(e.cachedTokens??0)+(t.cachedTokens??0);return{inputTokens:e.inputTokens+t.inputTokens,outputTokens:e.outputTokens+t.outputTokens,...n>0?{cachedTokens:n}:{}}}function Hve(e,t={}){var l,c;const n=[],r=((l=t.labels)==null?void 0:l.promptCancelled)??"Request cancelled.",i=new Map,s=new Map;let a=null,o=!1;for(let u=0;u<e.length;u++){const d=e[u],f=d.serverTimestamp??d.clientReceivedAt;switch(d.kind){case"user":{a=null,o=!1;const m=d,p={id:d.id,role:"user",content:m.text,timestamp:f};m.images&&m.images.length>0&&(p.images=m.images.map(b=>({data:b.data,mimeType:b.mimeType||"image/*"}))),n.push(p);break}case"assistant":{const m=$ve(d);if(!m)break;const p=m.parentToolCallId?i.get(m.parentToolCallId):void 0;if(p){a9(p,m.text);break}const b=o4e(m.text);if(b){let g=null,y=!1,w=0,C=0;for(const E of b)E.kind==="insight"?E.data.type==="insight_progress"?g=E.data:E.data.type==="insight_ready"?(y=!0,n.push({id:`${d.id}-ir-${w++}`,role:"insight_ready",path:E.data.path,timestamp:f})):E.data.type==="insight_error"&&(y=!0,n.push({id:`${d.id}-ie-${C++}`,role:"insight_error",error:E.data.error,timestamp:f})):(n.push({id:`${d.id}-t-${n.length}`,role:"assistant",content:E.text,timestamp:f}),a=n.length-1);g&&!y&&n.push({id:`${d.id}-ip`,role:"insight_progress",stage:g.stage,progress:g.progress,detail:g.detail,timestamp:f}),o=!0;break}const x=a!==null?n[a]:void 0;if(x&&x.role==="assistant"&&!o&&!i9(m)){const g=s9(x.usage,m.usage);n[a]={...x,content:x.content+m.text,isStreaming:m.streaming,...g?{usage:g}:{}},o=!1}else if(!i9(m))n.push({id:d.id,role:"assistant",content:m.text,isStreaming:m.streaming,timestamp:f,...m.usage?{usage:m.usage}:{}}),a=n.length-1,o=!1;else if(m.usage&&x&&x.role==="assistant"){const g=s9(x.usage,m.usage);n[a]={...x,...g?{usage:g}:{}}}break}case"thought":{const m=d,p=m.parentToolCallId?i.get(m.parentToolCallId):void 0;if(p){a9(p,m.text);break}const b=a!==null?n[a]:void 0;b&&b.role==="assistant"&&!o&&!b.content?(n[a]={...b,thinking:(b.thinking||"")+m.text,isStreaming:m.streaming},o=!1):(n.push({id:d.id,role:"assistant",content:"",thinking:m.text,isStreaming:m.streaming,timestamp:f}),a=n.length-1,o=!1);break}case"tool":{const p=Yve(d),b=s.get(p.callId);b!=null&&b.title&&(p.title=b.title),!p.args&&(b!=null&&b.args)&&(p.args=b.args);const x=p.parentToolCallId?i.get(p.parentToolCallId):void 0,g=i.get(p.callId);if(g){o9(g,p);break}if(x){qve(x,p),i.set(p.callId,p);break}d4(n,d.id,p,f),i.set(p.callId,p),o=!0;break}case"shell":{const m=d,p=n[n.length-1];if(p&&p.role==="tool_group"){const b=Fve(p.tools),x=p.tools[b];if(x){const g=typeof x.rawOutput=="string"?x.rawOutput:"",y={...x,rawOutput:g+m.text};n[n.length-1]={...p,tools:[...p.tools.slice(0,b),y,...p.tools.slice(b+1)]},i.get(x.callId)===x&&i.set(x.callId,y)}}else n.push({id:d.id,role:"tool_group",tools:[{callId:d.id,toolName:"shell",status:"completed",kind:"execute",rawOutput:m.text}],timestamp:f}),o=!0;break}case"user_shell":{const m=d;n.push({id:d.id,role:"user_shell",command:m.command,output:m.text,...m.cwd?{cwd:m.cwd}:{},timestamp:f}),o=!0;break}case"permission":{const m=d;Qve(m,s);const p=Xve(m);if(!p)break;const b=nj(p);if(!m.resolved)break;const x=i.get(p.callId);if(x){const g=x.status;p.toolName=x.toolName,m.resolved&&(h4(m.resolved)?p.status=b?p.status:"in_progress":(p.status="failed",p.endTime=m.updatedAt)),o9(x,p),m.resolved&&b&&h4(m.resolved)&&(x.status=g);break}if(m.resolved){h4(m.resolved)?(b||(p.status="in_progress"),d4(n,d.id,p,f),i.set(p.callId,p),o=!0):(p.status="failed",p.endTime=m.updatedAt,d4(n,d.id,p,f),i.set(p.callId,p),o=!0);break}break}case"status":case"debug":{const m=d,p=m.source==="session_branched"?zve(m.data):null,b=p&&((c=t.labels)!=null&&c.branchSuccess)?t.labels.branchSuccess(p):m.text;if(Bve(b))break;const x=Gve(b);if(x){n.push({id:d.id,role:"plan",todos:x,timestamp:f}),o=!0;break}n.push({id:d.id,role:"system",content:b,variant:"info",timestamp:f,...m.source?{source:m.source}:{},...m.data!==void 0?{data:m.data}:{}}),o=!0;break}case"error":{const m=d;n.push({id:d.id,role:"system",content:m.text,variant:"error",retryable:m.source==="turn_error",timestamp:f,...m.source?{source:m.source}:{},...m.data!==void 0?{data:m.data}:{}}),o=!0;break}case"prompt_cancelled":n.push({id:d.id,role:"system",content:r,variant:"info",timestamp:f}),o=!0;break}}return n}function qve(e,t){e.subTools||(e.subTools=[]),e.subTools.push(t)}function a9(e,t){e.subContent=(e.subContent||"")+t}function d4(e,t,n,r){const i=a=>nj(a)||fh(a.toolName),s=e[e.length-1];if(s&&s.role==="tool_group"&&s.id.startsWith("tg-")&&!i(n)&&!s.tools.some(i)){s.tools.push(n);return}e.push({id:`tg-${t}`,role:"tool_group",tools:[n],timestamp:r})}function Fve(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="execute"&&n.status==="in_progress")return t}for(let t=e.length-1;t>=0;t--)if(e[t].kind==="execute")return t;return e.length-1}function o9(e,t){e.status=t.status??e.status,e.title=t.title??e.title,e.toolName=t.toolName??e.toolName,e.kind=t.kind??e.kind,e.content=t.content??e.content,e.endTime=t.endTime??e.endTime,e.rawOutput=t.rawOutput??e.rawOutput,e.args=t.args??e.args,e.locations=t.locations??e.locations}function nj(e){var n;const t=e.toolName.toLowerCase();return t==="agent"||t==="task"||e.subTools||e.subContent||Vve(e.rawOutput)?!0:!!((n=e.args)!=null&&n.subagent_type)}function Vve(e){return!!e&&typeof e=="object"&&e.type==="task_execution"}function Gve(e){const t=e.startsWith("plan: ")?e.slice(6):void 0;if(t)try{const n=JSON.parse(t),r=qi(n);return(r==null?void 0:r.sessionUpdate)!=="plan"||!Array.isArray(r.entries)?void 0:Uve(r.entries)}catch{return}}function qi(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function zi(e,t){const n=e==null?void 0:e[t];return typeof n=="string"&&n.length>0?n:void 0}function Wve(e){return e==="completed"||e==="in_progress"||e==="pending"?e:"pending"}function Kve(e){return e==="high"||e==="medium"||e==="low"?e:void 0}function Yve(e){const t=Zve(e),n=Jve(e,t),r=e4e(e.content),i={running:"in_progress",pending:"pending",confirming:"pending",background:"pending",completed:"completed",failed:"failed",cancelled:"completed",canceled:"completed",in_progress:"in_progress"},s=e.status==="completed"||e.status==="failed"||e.status==="cancelled"||e.status==="canceled";return{callId:e.toolCallId,toolName:e.toolName||"unknown",title:e.title,status:(n?"pending":i[e.status])||e.status||"in_progress",kind:ij(e.toolName,e.toolKind),rawOutput:t,args:e.rawInput,parentToolCallId:e.parentToolCallId,startTime:e.createdAt,endTime:s&&!n?e.updatedAt:void 0,...r?{content:r}:{}}}function Xve(e){const t=qi(e.toolCall);if(!t)return;const n=rj(t);if(Array.isArray(n==null?void 0:n.questions))return;const r=qi(t._meta),i=zi(t,"kind"),s=zi(r,"toolName")??zi(t,"toolName")??zi(t,"name")??(n!=null&&n.subagent_type?"agent":void 0)??(i==="fetch"?"web_fetch":i),a=zi(t,"toolCallId")??zi(t,"id");return!a||!s?void 0:{callId:a,toolName:s,title:zi(t,"title")??e.title,status:"pending",kind:ij(s,i),args:n,startTime:e.createdAt}}function Qve(e,t){const n=qi(e.toolCall),r=zi(n,"toolCallId")??zi(n,"id");if(!r)return;const i=zi(n,"title")??e.title,s=n?rj(n):void 0;Array.isArray(s==null?void 0:s.questions)&&t.set(r,{...i?{title:i}:{},...s?{args:s}:{}})}function h4(e){const[t="",n=""]=e.toLowerCase().split(":",2);return l9(t)?!0:t!=="selected"?!1:l9(n.trim())}function l9(e){return e==="allow"||e==="allowed"||e==="approve"||e==="approved"||e==="accept"||e==="accepted"||e==="confirm"||e==="confirmed"||e==="proceed"||e==="proceed_once"||e==="proceed_always_project"||e==="proceed_always_user"||e==="allow_once"||e==="allow_always"||e==="success"||e==="succeeded"}function rj(e){return qi(e.rawInput)??qi(e.input)??qi(e.args)}function Jve(e,t){var i;const n=(i=e.toolName)==null?void 0:i.toLowerCase();if(n!=="agent"&&n!=="task")return!1;const r=qi(t);return(r==null?void 0:r.status)==="background"}function Zve(e){return t4e(e)&&e.status==="failed"?n4e(e)??e.details??e.rawOutput:!r4e(e.status)||!e.details?e.rawOutput??e.details:e.rawOutput&&typeof e.rawOutput=="object"&&!Array.isArray(e.rawOutput)?{...e.rawOutput,status:e.status,reason:e.details}:{status:e.status,reason:e.details,text:typeof e.rawOutput=="string"&&e.rawOutput?e.rawOutput:e.details}}function e4e(e){if(!Array.isArray(e))return;const t=e.flatMap(n=>{const r=qi(n);if(!r)return[];const i=r.type;if(i==="content"){const s=qi(r.content);return!s||typeof s.type!="string"?[]:[{type:"content",content:{...s,type:s.type}}]}if(i==="diff"){const s=r.newText;if(typeof s!="string")return[];const a=r.path,o=r.oldText;return[{type:"diff",...typeof a=="string"?{path:a}:{},...typeof o=="string"?{oldText:o}:{},newText:s}]}if(i==="terminal"){const s=r.terminalId;return[{type:"terminal",...typeof s=="string"?{terminalId:s}:{}}]}return[]});return t.length>0?t:void 0}function t4e(e){if(!e.toolName)return!1;const t=e.toolName.toLowerCase();return t==="ask_user_question"||t==="askuserquestion"}function n4e(e){if(!Array.isArray(e.content))return;const t=e.content.map(n=>{var r;return(r=n==null?void 0:n.content)==null?void 0:r.text}).filter(n=>!!n);if(!(!t||t.length===0))return t.join(`
`)}function r4e(e){return e==="cancelled"||e==="canceled"}const i4e=['"insight_progress":','"insight_ready":','"insight_error":'];function s4e(e){try{const t=JSON.parse(e),n=qi(t.insight_progress);if(n&&typeof n.stage=="string"&&typeof n.progress=="number")return{type:"insight_progress",stage:n.stage,progress:n.progress,detail:typeof n.detail=="string"?n.detail:void 0};const r=qi(t.insight_ready);if(r&&typeof r.path=="string")return{type:"insight_ready",path:r.path};const i=qi(t.insight_error);if(i&&typeof i.error=="string")return{type:"insight_error",error:i.error}}catch{}return null}function a4e(e,t){if(e[t]!=="{")return null;let n=0,r=!1,i=!1;for(let s=t;s<e.length;s++){const a=e[s];if(i){i=!1;continue}if(a==="\\"&&r){i=!0;continue}if(a==='"'){r=!r;continue}if(!r){if(a==="{")n++;else if(a==="}"&&(n--,n===0))return e.slice(t,s+1)}}return null}function o4e(e){const t=[];let n=0,r=0,i=!1;for(;r<e.length;){const a=e.indexOf("{",r);if(a===-1)break;const o=e.slice(a+1).trimStart();if(!i4e.some(f=>o.startsWith(f))){r=a+1;continue}const c=a4e(e,a);if(!c){r=a+1;continue}const u=s4e(c);if(!u){r=a+1;continue}i=!0;const d=e.slice(n,a).trim();d&&t.push({kind:"text",text:d}),t.push({kind:"insight",data:u}),n=a+c.length,r=n}if(!i)return null;const s=e.slice(n).trim();return s&&t.push({kind:"text",text:s}),t.length>0?t:null}function ij(e,t){if(t)return t;if(!e)return;const n=e.toLowerCase();if(n==="bash"||n==="execute")return"execute";if(n==="read")return"read";if(n==="edit"||n==="write")return"edit";if(n.includes("search")||n==="grep"||n==="glob")return"search";if(n==="agent"||n==="task")return"other"}function l4e(e){const t=B1();return v.useMemo(()=>Hve(t,{labels:{promptCancelled:e("request.cancelled"),branchSuccess:n=>e("branch.success",{name:n})}}),[t,e])}function rl(e){const[t,n]=v.useState(null);return v.useEffect(()=>{const r=i=>{const s=i.detail;if(!(s!=null&&s.id)&&(s==null?void 0:s.active)===!1){n(null);return}s!=null&&s.id&&(s.active?n(s.id):n(a=>a===s.id?null:a))};return window.addEventListener(e,r),()=>window.removeEventListener(e,r)},[e]),t!==null}function c4e(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((s,a)=>s===t[a]);const n=Object.keys(e),r=t,i=e;return n.length!==Object.keys(r).length?!1:n.every(s=>{const a=i[s],o=r[s];return a===o?!0:Array.isArray(a)&&Array.isArray(o)?a.length===o.length&&a.every((l,c)=>l===o[c]):!1})}function u4e(e){const t=v.useRef(e);return c4e(t.current,e)||(t.current=e),t.current}function d4e(e,t){const n=v.useRef(e);return e.length!==n.current.length?(n.current=e,e):(e.some((i,s)=>t(i)!==t(n.current[s]))&&(n.current=e),n.current)}const Mr={NO_OUTPUT:"No output in history",NO_TEXT:"Last AI output contains no text to copy.",CODE_MISSING:"No matching code block found in the last AI output.",LATEX_MISSING:"No matching LaTeX block found in the last AI output.",INLINE_LATEX_MISSING:"No matching inline LaTeX expression found in the last AI output.",OUTPUT_COPIED:"Last output copied to the clipboard",CLIPBOARD_PREFIX:"Failed to copy to the clipboard. ",COPIED_SUFFIX:" copied to the clipboard"},c9=1024,h4e=new RegExp(String.raw`(?<![\w$])\$(?![\s\d$])(?=[^$\n]{1,${c9}}\S\$)([^$\n]{1,${c9}})\$(?![\w$])`,"g");function f4e(e){var c,u,d;const t=[],n=e.split(/\r?\n/),r=/^ *(`{3,}|~{3,}) *([^`]*)$/,i=new Map;let s=null,a=null,o=null,l=[];for(const f of n){const m=f.match(r);if(!s){if(m){if(s=m[1]??null,a=((u=(c=m[2])==null?void 0:c.trim().split(/\s+/)[0])==null?void 0:u.toLowerCase())||null,a){const p=(i.get(a)??0)+1;i.set(a,p),o=p}else o=null;l=[]}continue}if(m&&((d=m[1])!=null&&d.startsWith(s[0]??""))&&m[1].length>=s.length){t.push({lang:a,content:l.join(`
`),index:t.length+1,langIndex:o}),s=null,a=null,o=null,l=[];continue}l.push(f)}return t}function m4e(e){var l;const t=[],n=e.split(/\r?\n/),r=/^ *(`{3,}|~{3,}) *([^`]*)$/,i=/^ *\$\$ *$/;let s=null,a=!1,o=[];for(const c of n){const u=c.match(r);if(s){u&&((l=u[1])!=null&&l.startsWith(s[0]??""))&&u[1].length>=s.length&&(s=null);continue}if(!a){if(u){s=u[1]??null;continue}i.test(c)&&(a=!0,o=[]);continue}if(i.test(c)){t.push({content:o.join(`
`),index:t.length+1}),a=!1,o=[];continue}o.push(c)}return t}function p4e(e){var o;const t=[],n=e.split(/\r?\n/),r=/^ *(`{3,}|~{3,}) *([^`]*)$/,i=/^ *\$\$ *$/;let s=null,a=!1;for(const l of n){const c=l.match(r);if(s){c&&((o=c[1])!=null&&o.startsWith(s[0]??""))&&c[1].length>=s.length&&(s=null);continue}if(a){i.test(l)&&(a=!1);continue}if(c){s=c[1]??null;continue}if(i.test(l)){a=!0;continue}for(const u of l.matchAll(h4e)){const d=u[1];d&&t.push({content:d,index:t.length+1})}}return t}function u9(e,t){return t&&e.langIndex!==null?`${t} code block ${e.langIndex}`:`Code block ${e.index}`}function g4e(e,t){var u;const n=t.trim().split(/\s+/).filter(Boolean),r=(u=n[0])==null?void 0:u.toLowerCase();if(!r)return;const i=f4e(e);if(i.length===0)return null;let s=null,a=null;const o=r==="code"?n.slice(1):n.map(d=>d);r!=="code"&&(s=r);for(const d of o)/^\d+$/.test(d)?a=Number(d):d.toLowerCase()!=="code"&&(s=d.toLowerCase());const l=s?i.filter(d=>d.lang===s):i;if(l.length===0)return null;if(a!==null){const d=s?l.find(f=>f.langIndex===a):i.find(f=>f.index===a);return d?{content:d.content,label:u9(d,s)}:null}const c=l[l.length-1];return c?{content:c.content,label:u9(c,s)}:null}function d9(e,t){const n=p4e(e);if(n.length===0)return null;let r=null;for(const s of t)/^\d+$/.test(s)&&(r=Number(s));const i=r!==null?n.find(s=>s.index===r):n[n.length-1];return i?{content:i.content,label:`Inline LaTeX expression ${i.index}`}:null}function y4e(e,t){var c;const n=t.trim().split(/\s+/).filter(Boolean),r=(c=n[0])==null?void 0:c.toLowerCase();if(r!=="latex"&&r!=="math"&&r!=="inline-latex")return;if(r==="inline-latex")return d9(e,n.slice(1));const i=n.slice(1),s=i.findIndex(u=>u.toLowerCase()==="inline");if(s!==-1)return d9(e,i.filter((u,d)=>d!==s));const a=m4e(e);if(a.length===0)return null;let o=null;for(const u of i)/^\d+$/.test(u)&&(o=Number(u));const l=o!==null?a.find(u=>u.index===o):a[a.length-1];return l?{content:l.content,label:`LaTeX block ${l.index}`}:null}function b4e(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant"&&n.content)return n.content}return null}function v4e(e){var t;return typeof navigator>"u"||!((t=navigator.clipboard)!=null&&t.writeText)?Promise.reject(new Error("Clipboard API is not available")):navigator.clipboard.writeText(e)}async function x4e(e,t,n=v4e){const r=b4e(e);if(r===null)return{status:"info",message:Mr.NO_OUTPUT};if(!r)return{status:"info",message:Mr.NO_TEXT};try{const i=y4e(r,t);if(i===null)return{status:"info",message:t.trim().split(/\s+/).some(l=>l==="inline")||t.trim().toLowerCase().startsWith("inline-latex")?Mr.INLINE_LATEX_MISSING:Mr.LATEX_MISSING};if(i!==void 0)return await n(i.content),{status:"info",message:`${i.label}${Mr.COPIED_SUFFIX}`};const s=g4e(r,t);if(s===null)return{status:"info",message:Mr.CODE_MISSING};const a=(s==null?void 0:s.content)??r;return await n(a),{status:"info",message:s?`${s.label}${Mr.COPIED_SUFFIX}`:Mr.OUTPUT_COPIED}}catch(i){const s=i instanceof Error?i.message:String(i);return{status:"error",message:`${Mr.CLIPBOARD_PREFIX}${s}`}}}function h9(e,t){const n={nodeVersion:"",npmVersion:"",authSource:"",platform:"",arch:"",sandbox:"",proxy:"",memoryUsage:""};if(e)for(const r of e.cells){const i=r.detail;r.kind==="node_version"&&(i!=null&&i.version)?n.nodeVersion=i.version:r.kind==="npm"&&(i!=null&&i.version)?n.npmVersion=String(i.version).replace(/^npm\s*/i,""):r.kind==="auth"&&(i!=null&&i.source)&&(n.authSource=i.source)}if(t)for(const r of t.cells)r.kind==="platform"?(n.platform=r.name,r.value&&(n.arch=r.value)):r.kind==="sandbox"&&r.name==="SANDBOX"?n.sandbox=r.value||"":r.kind==="proxy"&&r.present&&r.value?n.proxy=`${r.name}: ${r.value}`:r.kind==="memory"&&r.value&&(n.memoryUsage=r.value);return n}function w4e(e){return e.cmd!=="tasks"?!1:(e.getTasks().then(t=>{e.dispatch([{type:"status",text:oie({snapshot:t})}])}).catch(t=>{e.reportError(t,"Failed to load tasks")}),!0)}const k4e="_app_14rk3_1",_4e="_themeDark_14rk3_24",S4e="_themeLight_14rk3_61",T4e="_dialogOverlay_14rk3_98",C4e="_content_14rk3_107",E4e="_contentHasMessages_14rk3_115",A4e="_footer_14rk3_119",M4e="_footerHidden_14rk3_124",N4e="_bottomPanels_14rk3_128",I4e="_tasksBottomPanel_14rk3_135",D4e="_btwPanel_14rk3_143",R4e="_composer_14rk3_149",O4e="_queuedPrompts_14rk3_154",j4e="_queuedPrompt_14rk3_154",L4e="_queuedHint_14rk3_172",Br={app:k4e,themeDark:_4e,themeLight:S4e,dialogOverlay:T4e,content:C4e,contentHasMessages:E4e,footer:A4e,footerHidden:M4e,bottomPanels:N4e,tasksBottomPanel:I4e,btwPanel:D4e,composer:R4e,queuedPrompts:O4e,queuedPrompt:j4e,queuedHint:L4e},gh=v.createContext(!1),u5=v.createContext(new Map),sj=v.createContext(new Map);function B4e({timeline:e,details:t,children:n}){return h.jsx(u5.Provider,{value:e,children:h.jsx(sj.Provider,{value:t,children:n})})}const up=d3,f4=3,f9=240,m9="ui.compactMode",z4e="ui.hideTips";function p9(e){return e.trim().replace(/^\/+/,"").toLowerCase()}const aj=new Set(["clear","stop","off","reset","none","cancel"]);function P4e(e){const t=e.replace(/^\/goal\b/i,"").trim().toLowerCase();return aj.has(t)}function $4e(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind!=="status")continue;const r=n,i=r.source==="goal"?Yg(r.data):Yg(r.text);if(i)return i.kind==="set"||i.kind==="checking"?{condition:i.condition,setAt:i.setAt??n.serverTimestamp??n.createdAt}:null}return null}const g9={insertText:()=>{},setText:()=>{},addTags:()=>{},removeTag:()=>{},clear:()=>{},submit:()=>{}};function y9(e,t){if(e){if(typeof e=="function"){e(t);return}e.current=t}}function U4e(e){if(typeof window>"u")return;const t=new URL(window.location.href);t.pathname=`/session/${encodeURIComponent(e)}`,t.searchParams.delete("token"),t.searchParams.delete("daemon"),window.history.replaceState(null,"",t)}function H4e(){if(typeof window>"u")return"en";const e=new URLSearchParams(window.location.search);return jl(e.get("language")??e.get("lang")??navigator.language)}function q4e(e,t){return e instanceof Error?e.message:t}function m4(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function Vh(e){return typeof e=="object"&&e!==null&&e._alreadyDispatched===!0}function F4e(e){e.length>0&&console.info("[web-shell] useSessionNotices()",{notices:e})}function V4e(e){return e.category==="validation"||e.category==="user_action"||e.category==="system"}function G4e(e){return e.severity==="warning"?"warning":e.severity==="info"?"info":"error"}function p4(e){return typeof e=="object"&&e!==null}function W4e(e){const t=e.trim();return t.startsWith("USE_")?t.slice(4).toLowerCase().replace(/_/g,"-"):t.toLowerCase()}function K4e(e){if(!p4(e))return null;const t=e._meta;if(!p4(t))return null;const n=t.qwenModelSwitch;if(!p4(n))return null;const r=n.authType,i=n.modelId,s=n.baseUrl,a=n.apiKey;return typeof r!="string"||typeof i!="string"||typeof s!="string"||typeof a!="string"?null:{authType:r,modelId:i,baseUrl:s,apiKey:a,...typeof n.isRuntime=="boolean"?{isRuntime:n.isRuntime}:{}}}function Y4e(e){return`● authType: ${W4e(e.authType)}
  Using ${e.isRuntime?"runtime ":""}model: ${e.modelId}
  Base URL: ${e.baseUrl}
  API key: ${e.apiKey}`}function X4e(e){const t="Model switched: ";return e.startsWith(t)?e.slice(t.length).trim().replace(/\([^()]+\)$/,""):null}function Q4e(e){var n;if(!e.startsWith("● authType:"))return null;const t=e.match(/\n {2}Using (?:runtime )?model: ([^\n]+)/);return((n=t==null?void 0:t[1])==null?void 0:n.trim())||null}function b9(e){const t=new Set;for(const n of e){if(n.role!=="system"||n.variant!=="info")continue;const r=Q4e(n.content);r&&t.add(r)}return t.size===0?[...e]:e.filter(n=>{if(n.role!=="system"||n.variant!=="info")return!0;const r=X4e(n.content);return!r||!t.has(r)})}function J4e(e){return e.some(t=>t.role==="system"&&t.variant==="info"&&yD(t.content)!==null)}function v9(e){return d3.includes(e)}function Z4e(e){return e.toolKind==="edit"}function exe(e){const t=e.trim().replace(/[\r\n]+/g," ");return t?t==="--"?{type:"manual",displayName:""}:t.startsWith("-- ")?{type:"manual",displayName:t.slice(3).trim()}:t.toLowerCase()==="--auto"?{type:"auto"}:t.startsWith("--")?{type:"delegate"}:{type:"manual",displayName:t}:{type:"auto"}}function txe(e){var n;if(((n=e.args)==null?void 0:n.is_background)!==!0)return!1;const t=e.toolName.toLowerCase();return t==="shell"||t==="bash"||t==="run_shell_command"||t==="exec"}function nxe(e){const t=[];for(const n of e)if(n.role==="tool_group")for(const r of n.tools)(tM(r)||txe(r))&&t.push(`${r.callId}:${r.status}`);return t.join("|")}function rxe(e){const t={id:e.id,label:e.label,description:e.description,runtimeMs:e.runtimeMs,startTime:e.startTime,endTime:e.endTime,error:e.error};switch(e.kind){case"agent":return{...t,kind:"agent",status:e.status,subagentType:e.subagentType,isBackgrounded:e.isBackgrounded,prompt:e.prompt};case"shell":return{...t,kind:"shell",status:e.status,command:e.command,cwd:e.cwd,pid:e.pid,exitCode:e.exitCode};case"monitor":return{...t,kind:"monitor",status:e.status,command:e.command,pid:e.pid,exitCode:e.exitCode};default:return e}}function ixe(e,t){return e===Mr.NO_OUTPUT?t("copy.noOutput"):e===Mr.NO_TEXT?t("copy.noText"):e===Mr.CODE_MISSING?t("copy.codeMissing"):e===Mr.LATEX_MISSING?t("copy.latexMissing"):e===Mr.INLINE_LATEX_MISSING?t("copy.inlineLatexMissing"):e===Mr.OUTPUT_COPIED?t("copy.outputCopied"):e.startsWith(Mr.CLIPBOARD_PREFIX)?`${t("copy.failedFallback")}. ${e.slice(Mr.CLIPBOARD_PREFIX.length)}`:e.endsWith(Mr.COPIED_SUFFIX)?t("copy.toClipboard",{label:e.slice(0,-Mr.COPIED_SUFFIX.length)}):e}function sxe({prompts:e,t}){return e.length===0?null:h.jsxs("div",{className:Br.queuedPrompts,children:[e.slice(0,f4).map(n=>{var a;const r=n.text.replace(/\s+/g," ").trim(),i=r.length>f9?`${r.slice(0,f9)}...`:r,s=((a=n.images)==null?void 0:a.length)??0;return h.jsxs("div",{className:Br.queuedPrompt,children:[i,s>0?` ${t("queue.imageCount",{count:s})}`:""]},n.id)}),e.length>f4&&h.jsx("div",{className:Br.queuedPrompt,children:t("queue.more",{count:e.length-f4})}),h.jsx("div",{className:Br.queuedHint,children:t("queue.footer")})]})}function axe({onSessionIdChange:e,theme:t,onThemeChange:n,language:r,onLanguageChange:i,className:s,style:a,onConnectionChange:o,onStreamingStateChange:l,onError:c,onBugReport:u,hiddenSlashCommands:d,slashCommandCategoryOrder:f,renderToolHeaderExtra:m,renderWelcomeHeader:p,renderFooter:b,compactThinking:x=!1,collapseCompletedTurns:g=!0,virtualScrollThreshold:y,markdown:w,onTranscriptChange:C,onToast:E,composerRef:S,composerInput:T,composerInputVersion:j}={}){var A5;const[z,R]=v.useState(()=>r===void 0?H4e():jl(r)),D=v.useMemo(()=>iD(z),[z]),N=v.useMemo(()=>({renderToolHeaderExtra:m,renderWelcomeHeader:p,renderFooter:b,compactThinking:x,collapseCompletedTurns:g,markdown:w}),[m,p,b,x,g,w]),B=b,P=_3(),J=B1(),q=du(),W=T3(),{notices:$,dismissNotice:Z}=fU(),M=tc(),X=v.useRef(E);X.current=E;const H=v.useRef(0),[O,se]=v.useState([]),ke=v.useCallback(L=>{se(Y=>Y.filter(ce=>ce.id!==L))},[]),be=v.useCallback((L,Y)=>{if(X.current){X.current(L,Y);return}const ce={id:`web-shell-toast-${Date.now()}-${++H.current}`,tone:L,message:Y};se(Qe=>[...Qe.filter(Fe=>Fe.tone!==L||Fe.message!==Y),ce].slice(-4))},[]),Ee=l4e(D),qe=v.useRef(Ee);qe.current=Ee;const[wt,Mt]=v.useState(null),[bt,Je]=v.useState(null),Ge=v.useRef(1),Pt=v.useRef(1),Ze=v.useRef(null),re=v.useRef(null),le=v.useRef(q.sessionId),De=v.useMemo(()=>{const L=[wt].filter(ce=>ce!==null);if(L.length===0)return b9(Ee);const Y=[...Ee];for(const ce of L.sort((Qe,lt)=>Qe.anchorIndex-lt.anchorIndex)){const Qe=ce.anchorAfterId?Y.findIndex(Fe=>Fe.id===ce.anchorAfterId):-1,lt=Qe>=0?Qe+1:Math.min(ce.anchorIndex,Y.length);Y.splice(lt,0,ce.message)}return b9(Y)},[Ee,wt]),We=v.useMemo(()=>J4e(De),[De]);v.useEffect(()=>{We||window.dispatchEvent(new CustomEvent(a0,{detail:{active:!1}}))},[We]);const pe=Rve(J),st=v.useMemo(()=>AU(pe),[pe]),ae=u4e(st),je=v.useRef(ae);je.current=ae;const Oe=ae!==null,$e=v.useMemo(()=>Sae(Ee),[Ee]),te=v.useRef(null),ye=v.useMemo(()=>{const L=Cae(Ee),Y=te.current;if(Y&&Y.signature===L)return Y.timeline;const ce=Tae(Ee);return te.current={signature:L,timeline:ce},ce},[Ee]),Te=v.useRef(null),Pe=v.useMemo(()=>{const L=Eae(Ee),Y=Te.current;if(Y&&Y.signature===L)return Y.details;const ce=Oae(Ee);return Te.current={signature:L,details:ce},ce},[Ee]),dt=d4e($e.todos,L=>`${L.id}:${L.status}:${L.content}`),Ht=$e.allCompleted,[Xt,Dn]=v.useState("hidden"),jn=q.catchingUp||dt.length===0?"hidden":Ht?Xt==="hidden"?"hidden":"completed":"active";jn!==Xt&&Dn(jn);const Zn=jn!=="hidden",Sn=v.useMemo(()=>nxe(Ee),[Ee]),[_r,me]=v.useState(0),G=Lve(Sn,q.status==="connected",_r),ne=v.useMemo(()=>b?G.map(rxe):[],[G,b]),Ke=v.useRef(null),St=v.useRef(null),et=v.useCallback(L=>{St.current=L,y9(S,L??g9)},[S]);v.useEffect(()=>{y9(S,St.current??g9)},[S]);const $t=v.useRef(null),Tt=v.useCallback(()=>{var L;$e.sourceMessageId&&((L=$t.current)==null||L.scrollToMessage($e.sourceMessageId,$e.sourceCallId??void 0))},[$e.sourceMessageId,$e.sourceCallId]),[or,Yn]=v.useState(null),Xa=v.useRef(null);Xa.current=or;const{followupState:bu,onAcceptFollowup:vu,onDismissFollowup:Sr,clear:ni}=CU({onAccept:L=>{var Y;(Y=St.current)==null||Y.insertText(L)}}),pn=v.useCallback((L,Y,ce)=>{ni();const Qe=!L.trimStart().startsWith("/");!(ce!=null&&ce.retry)&&Qe&&(Nt.current=L,hi.current=Y,vs.current=null),Ks(!1);const lt={images:Y,optimisticUserMessage:ce==null?void 0:ce.optimisticUserMessage,retry:ce==null?void 0:ce.retry};return W.sendPrompt(L,lt)},[ni,W]),gn=S3(),Tr=v.useRef(gn),Nt=v.useRef(""),hi=v.useRef(void 0),Vr=v.useRef(null),vs=v.useRef(null),[Qa,Ks]=v.useState(!1),Ja=v.useRef(Qa);Ja.current=Qa;const er=q.status==="connected",[Gr,xs]=v.useState([]);v.useEffect(()=>{er&&M.loadSkillsStatus().then(L=>{xs(((L==null?void 0:L.skills)??[]).map(Y=>({name:Y.name,description:Y.description??""})).sort((Y,ce)=>Y.name.localeCompare(ce.name)))}).catch(()=>{})},[er,M]);const[Ki,ws]=v.useState(null),[ua,Vo]=v.useState(!1),[Go,xu]=v.useState(!1),[wu,Wo]=v.useState(!1),[Ko,sc]=v.useState(!1),[da,Ys]=v.useState(!1),[Q,oe]=v.useState(!1),[he,Ye]=v.useState(!1),[Re,gt]=v.useState(!1),[zt,Tn]=v.useState(!1),[ot,on]=v.useState(!1),[tn,Yi]=v.useState(!1),[ha,rn]=v.useState(0),[yn,Za]=v.useState(0),ue=uu(),at=v.useRef((ue==null?void 0:ue.extensionsVersion)??0);v.useEffect(()=>{const L=(ue==null?void 0:ue.extensionsVersion)??0;if(L!==at.current){at.current=L;const Y=ue==null?void 0:ue.lastExtensionChange;if((Y==null?void 0:Y.status)==="failed"){P.dispatch([{type:"error",text:D("extensions.action.failed",{name:Y.name??"",source:Y.source??"",error:Y.error??D("error.unknown")})}]);return}if((Y==null?void 0:Y.status)==="installed"){const ce=Y.name??Y.source??D("extensions.label");P.dispatch([{type:"status",text:Y.version?D("extensions.install.installedWithVersion",{name:ce,version:Y.version}):D("extensions.install.installed",{name:ce})}])}else if(Y!=null&&Y.status){const ce=Y.name??Y.source??D("extensions.label"),Qe=Y.status==="updated"&&Y.version?"extensions.manage.updatedWithVersion":`extensions.manage.${Y.status}`;P.dispatch([{type:"status",text:D(Qe,{name:ce,version:Y.version??""})}])}W.refreshCommands().catch(()=>{P.dispatch([{type:"error",text:D("extensions.commands.refreshFailed")}])})}},[ue==null?void 0:ue.extensionsVersion,ue==null?void 0:ue.lastExtensionChange,W,P,D]);const[Rt,Ut]=v.useState("workspace"),[ct,It]=v.useState(null),[Qt,Ln]=v.useState(null),[ks,Yo]=v.useState(!1),[ac,oc]=v.useState(!1),Xo=v.useRef(0),Xs=v.useRef(null),yh=rl(YO),[eo,ku]=v.useState(null),uj=rl(a0),dj=rl(Ud),hj=rl(XO),fj=rl(JO),mj=rl(ZO),pj=rl(ej),gj=rl(sw),[Ay,My]=v.useState(t??$i.Dark),[bh,X0]=v.useState(""),d5=v.useRef(bh);d5.current=bh;const Q0=v.useRef(q);Q0.current=q;const yj=q.displayName,[Qo,Ny]=v.useState("default"),[_u,Su]=v.useState([]),fi=v.useRef([]),bj=v.useRef(1),J0=v.useRef(!1),Iy=Go||wu||Ko||da||Q||he||Re,Xi=Iy||(ua||tn||ct!==null||ot||Ki!==null||zt)||yh||uj||dj||hj||fj||mj||pj||gj,mt=v.useCallback((L,Y)=>{if(m4(L))return;if(_A(L)){console.debug("[web-shell] turn error rendered in transcript",L);return}if(Vh(L)){console.debug("[web-shell] error already handled by notice",L);return}const ce=q4e(L,Y);console.error("[web-shell]",ce,L),be("error",ce)},[be]);v.useEffect(()=>{F4e($);for(const L of $)V4e(L)?be(G4e(L),L.message):L.category==="lifecycle"?console.debug("[web-shell] daemon notice",L):console.warn("[web-shell] daemon notice",L),Z(L.id)},[Z,$,be]);const Dy=v.useRef(u);Dy.current=u,v.useEffect(()=>{var L;le.current=q.sessionId,(L=Ze.current)==null||L.abort(),Ze.current=null,Mt(null),Je(null),ku(null),tm.current=0},[q.sessionId]);const h5=v.useCallback(()=>{var lt;const L=`local-recap-${Ge.current++}`,Y=Ee.length,ce=(lt=Ee.at(-1))==null?void 0:lt.id,Qe=q.sessionId;Mt({anchorAfterId:ce,anchorIndex:Y,message:{id:L,role:"system",content:`※ recap: ${D("recap.loading")}`,variant:"info"}}),W.recapSession().then(Fe=>{le.current===Qe&&Mt({anchorAfterId:ce,anchorIndex:Y,message:{id:L,role:"system",content:Fe.recap?`※ recap: ${Fe.recap}`:D("recap.empty"),variant:"info"}})},Fe=>{le.current===Qe&&(Mt(null),!m4(Fe)&&!Vh(Fe)&&console.warn("[web-shell] unhandled recap failure",Fe))})},[q.sessionId,Ee,W,D]),f5=v.useCallback(L=>{var Fe;const Y=L.trim();if(!Y){be("error",D("btw.empty"));return}const ce=`local-btw-${Pt.current++}`,Qe=q.sessionId;(Fe=Ze.current)==null||Fe.abort();const lt=new AbortController;Ze.current=lt,Je({id:ce,role:"btw",question:Y,answer:"",isPending:!0}),W.btwSession(Y,{signal:lt.signal}).then(xe=>{le.current===Qe&&Ze.current===lt&&(Ze.current=null,Je({id:ce,role:"btw",question:Y,answer:xe.answer||D("btw.emptyAnswer"),isPending:!1}))},xe=>{le.current===Qe&&Ze.current===lt&&(Ze.current=null,Je(null),!m4(xe)&&!Vh(xe)&&console.warn("[web-shell] unhandled btw failure",xe))})},[q.sessionId,be,W,D]),m5=v.useCallback(()=>{var L;(L=Ze.current)==null||L.abort(),Ze.current=null,Je(null)},[]);v.useEffect(()=>{const L=Y=>{var xe;if(Xi||ae)return;const ce=bt;if(!ce||ce.role!=="btw")return;const Qe=Y.key.toLowerCase(),lt=Y.key==="Escape"&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!Y.shiftKey,Fe=Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!Y.shiftKey&&(Qe==="c"||Qe==="d");if(ce.isPending){if(!lt&&!Fe)return}else{const ve=((xe=St.current)==null?void 0:xe.hasInput())??!1;if(!(!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!Y.shiftKey&&(Y.key==="Escape"||!ve&&(Y.key==="Enter"||Y.key===" "))))return}Y.preventDefault(),Y.stopPropagation(),m5()};return window.addEventListener("keydown",L,!0),()=>window.removeEventListener("keydown",L,!0)},[Xi,bt,m5,ae]),v.useEffect(()=>{fi.current=_u},[_u]);const Qi=v.useCallback((L,Y,ce)=>{const Qe=L.trim();if(!Qe)return!0;const lt=!!Y&&Y.length>0,Fe={id:bj.current++,text:Qe,images:Y?[...Y]:void 0,onComplete:ce};if(fi.current=[...fi.current,Fe],Su(fi.current),!lt){let xe=re.current;xe||(xe=new AbortController,re.current=xe),W.enqueueMidTurnMessage(Qe,{signal:xe.signal})}return!0},[W]);v.useEffect(()=>{if(gn!=="idle")return;const L=re.current;L&&(console.debug("[mid-turn] turn settled; cancelling any in-flight push"),L.abort(),re.current=null)},[gn]);const p5=v.useCallback(()=>{const[L,...Y]=fi.current;return L?(fi.current=Y,Su(Y),L):null},[]),vj=v.useCallback(()=>{const L=fi.current;return L.length===0?null:(fi.current=[],Su([]),L.map(Y=>Y.text).join(`

`))},[]),Ry=v.useCallback(()=>fi.current.length===0?!1:(fi.current=[],Su([]),P.dispatch([{type:"status",text:D("queue.cleared")}]),!0),[P,D]),{batches:vh,consume:g5}=EU();v.useEffect(()=>{const L=q.sessionId;if(!L||vh.length===0)return;q.clientId===void 0&&vh.some(ce=>ce.sessionId===L&&ce.originatorClientId!==void 0)&&console.debug("[mid-turn] originator-stamped batches but no client id; dedupe skipped (may resend next turn)");const Y=DU(fi.current,vh,L,q.clientId);Y&&(fi.current=Y,Su(Y)),g5(vh.filter(ce=>ce.sessionId===L))},[vh,q.sessionId,q.clientId,g5]);const Z0=v.useCallback(L=>{My(L),n==null||n(L)},[n]),xh=v.useCallback(L=>{R(L),i==null||i(L)},[i]),y5=v.useCallback(()=>{Yo(L=>!L)},[]),xj=v.useCallback(()=>{Yo(!1)},[]),b5=kU({autoLoad:!0}),{settings:wh,setValue:v5,reload:x5}=b5,Tu=wh.find(L=>L.key===m9),Cu=wh.find(L=>L.key===Sc),Eu=wh.find(L=>L.key===z4e),Au=wh.find(L=>L.key===nd),wj=hoe(wh),[Oy,jy]=v.useState(!1),Ly=v.useRef(Oy);Ly.current=Oy,v.useEffect(()=>{const L=Tu==null?void 0:Tu.values.effective;typeof L=="boolean"&&jy(L)},[Tu==null?void 0:Tu.values.effective]),v.useEffect(()=>{if(t){My(t);return}const L=E3(Cu==null?void 0:Cu.values.effective);L&&My(L)},[t,Cu==null?void 0:Cu.values.effective]),v.useEffect(()=>{if(r!==void 0){R(jl(r));return}const L=xk(Au==null?void 0:Au.values.effective);L&&R(L)},[r,Au==null?void 0:Au.values.effective]);const kj=v.useCallback(L=>{const Y=z,ce=`/language ui ${L}`;xh(L);const Qe=()=>Promise.all([W.refreshCommands(),x5()]);if(Tr.current!=="idle"){Qi(ce,void 0,Qe);return}pn(ce).then(Qe).catch(lt=>{xh(Y),mt(lt,"Failed to sync /language command")})},[Qi,xh,x5,mt,pn,z,W]),w5=v.useCallback(()=>{if(Tr.current!=="idle"){P.dispatch([{type:"status",text:D("clear.blocked")}]);return}P.reset()},[P,D]),k5=v.useCallback(()=>{const L=Ly.current,Y=!Ly.current;jy(Y),v5("workspace",m9,Y).catch(ce=>{jy(L),mt(ce,D("compact.saveFailed"))})},[mt,v5,D]),Mu=v.useCallback(L=>{if(!v9(L)){mt(new Error(`Unsupported approval mode: ${L}`),D("local.approvalMode"));return}W.setApprovalMode(L).then(Y=>{const ce=Y.mode||L;Ny(ce),ce==="auto"&&P.dispatch([{type:"status",text:D("mode.auto.notice")}]);const Qe=je.current;if(!Qe)return;if(L==="yolo"||L==="auto-edit"&&Z4e(Qe)){const Fe=Qe.options.find(xe=>xe.kind==="allow_once");if(Fe){const xe=Qe.title||"";P.dispatch([{type:"status",text:D("mode.autoApproved",{tool:xe})}]),W.submitPermission(Qe.id,Fe.id).catch(ve=>{mt(ve,"Failed to auto-approve tool call")})}}}).catch(Y=>{mt(Y,D("local.approvalMode"))})},[W,mt,P,D]);v.useEffect(()=>{Tr.current=gn},[gn]),v.useEffect(()=>{let L=null;for(let ce=J.length-1;ce>=0;ce--){const Qe=J[ce];if((Qe==null?void 0:Qe.kind)==="user")break;if((Qe==null?void 0:Qe.kind)==="error"&&Qe.source==="turn_error"){L=Qe.id;break}if((Qe==null?void 0:Qe.kind)!=="debug")break}const Y=er&&L!==null&&L!==vs.current&&Nt.current.length>0;Vr.current=Y?L:null,Ks(Y)},[J,er]),v.useEffect(()=>{l==null||l(gn)},[gn,l]),v.useEffect(()=>{o==null||o(q.status)},[q.status,o]),v.useEffect(()=>{C==null||C(J)},[J,C]),v.useEffect(()=>{if(q.error){const L=new Error(q.error);c==null||c(L)}},[q.error,c]),v.useEffect(()=>{q.currentModel&&X0(q.currentModel)},[q.currentModel]),v.useEffect(()=>{q.currentMode&&Ny(q.currentMode)},[q.currentMode]),v.useEffect(()=>{q.sessionId&&(Yn(null),e==null||e(q.sessionId),e||U4e(q.sessionId))},[q.sessionId,e]),v.useEffect(()=>{const L=$4e(J);Yn(Y=>L?(Y==null?void 0:Y.condition)===L.condition&&Y.setAt===L.setAt?Y:L:Y&&null)},[J]),v.useEffect(()=>{const L=Y=>{const ce=Y.detail;if(!(ce!=null&&ce.active)){Yn(null);return}ce.condition&&Yn({condition:ce.condition,setAt:ce.setAt??Date.now()})};return window.addEventListener(h2,L),()=>window.removeEventListener(h2,L)},[]);const em=v.useRef(null),tm=v.useRef(0);v.useEffect(()=>{tm.current=0},[q.sessionId]),v.useEffect(()=>{function ce(){if(document.hidden){em.current===null&&(em.current=Date.now());return}const Qe=em.current;if(em.current=null,Qe===null||Date.now()-Qe<18e4||Tr.current!=="idle"||!q.sessionId)return;const lt=P.getSnapshot().blocks.length;lt-tm.current<4||(tm.current=lt,W.recapSession().then(Fe=>{Fe.recap&&P.dispatch([{type:"status",text:`※ recap: ${Fe.recap}`}])},Fe=>{console.error("[auto-recap] failed:",Fe)}))}return document.addEventListener("visibilitychange",ce),()=>document.removeEventListener("visibilitychange",ce)},[q.sessionId,W,P]);const By=v.useCallback(()=>{const L=v9(Qo)?up.indexOf(Qo):-1,Y=up[(L+1)%up.length];Mu(Y)},[Qo,Mu]),kh=v.useCallback((L,Y)=>{P.appendLocalUserMessage(L),W.getContextUsage({detail:Y}).then(ce=>{P.dispatch([{type:"status",text:Ute(ce)}])}).catch(ce=>{mt(ce,"Failed to load context usage")})},[P,W,mt]),_j=v.useCallback(()=>{kh("/context detail",!0)},[kh]),Sj=v.useCallback(()=>{W.getTasks().then(L=>{ku({snapshot:L})}).catch(L=>{mt(L,"Failed to load tasks")})},[mt,W]),_5=v.useCallback((L,Y)=>{Yn({condition:L,setAt:Y}),P.dispatch([{type:"status",text:n8({kind:"set",condition:L,setAt:Y})}])},[P]),S5=v.useCallback(L=>{L&&(P.dispatch([{type:"status",text:n8({kind:"cleared",condition:L.condition,durationMs:Date.now()-L.setAt})}]),Yn(null))},[P]),nm=v.useCallback(L=>(P.appendLocalUserMessage(L),W.clearGoal().catch(Y=>{mt(Y,"Failed to clear /goal")}),!0),[mt,W,P]),T5=v.useCallback((L,Y,ce)=>{const Qe=L.replace(/^\/goal\b/i,"").trim(),lt=Qe.toLowerCase(),Fe=(ce==null?void 0:ce.sendToDaemon)??!0;return Qe&&aj.has(lt)?Fe?nm(L):(P.appendLocalUserMessage(L),S5(Xa.current),!0):Qe?(P.appendLocalUserMessage(L),Fe?(pn(L,Y,{optimisticUserMessage:!1}).catch(xe=>{mt(xe,"Failed to send /goal command")}),!0):(_5(Qe,Date.now()),!0)):(P.appendLocalUserMessage(L),Fe&&pn(L,Y,{optimisticUserMessage:!1}).catch(xe=>mt(xe,"Failed to send /goal command")),!0)},[S5,_5,nm,mt,pn,P]),zy=v.useMemo(()=>new Set((d??[]).map(p9).filter(Boolean)),[d]),Py=zy.has("settings"),$y=v.useCallback((L,Y)=>{var Qe;const ce=Tr.current!=="idle";if(L.startsWith("/")){const lt=L.match(/^\/([\w-]+)/);if(lt){const Fe=lt[1];if(Fe==="help")return Ys(!0),!0;if(Fe==="tasks")return P.appendLocalUserMessage(L),w4e({cmd:Fe,getTasks:W.getTasks,dispatch:xe=>P.dispatch(xe),reportError:mt}),!0;if(Fe==="goal")return ce?P4e(L)?nm(L):Qi(L,Y):T5(L,Y);if(Fe==="theme"){const xe=L.slice(lt[0].length).trim().toLowerCase();return xe==="dark"||xe==="light"?Z0(xe):xe?be("error",D("error.unsupportedTheme")):oe(!0),!0}if(Fe==="language"){const xe=L.slice(lt[0].length).trim(),[ve,Jt]=xe.split(/\s+/);if(!xe)return P.dispatch([{type:"status",text:[D("language.current",{language:wk(z)}),D("language.usage"),D("language.options"),"  - en: English","  - zh-CN: 中文"].join(`
`)}]),!0;if((ve==null?void 0:ve.toLowerCase())==="ui"){if(!Jt)return P.dispatch([{type:"status",text:[D("language.set"),"",D("language.usage"),"",D("language.options"),"  - en: English","  - zh-CN: 中文"].join(`
`)}]),!0;const Ot=Jt.toLowerCase();if(!["en","zh","zh-cn","zh_cn"].includes(Ot))return be("error",D("language.invalid")),!0;const fr=jl(Jt);return xh(fr),ce||pn(`/language ui ${fr}`).then(()=>W.refreshCommands()).catch(_s=>{mt(_s,"Failed to sync /language command")}),!0}}if(Fe==="copy"){const xe=L.slice(lt[0].length).trim();return x4e(qe.current,xe).then(ve=>{P.dispatch([{type:ve.status==="error"?"error":"status",text:ixe(ve.message,D)}])}).catch(ve=>{mt(ve,D("copy.failedFallback"))}),!0}if(Fe==="delete")return Wo(!0),!0;if(Fe==="release")return sc(!0),!0;if(Fe==="branch"){if(ce)return Qi(L,Y);const xe=L.slice(lt[0].length).trim();return W.branchSession(xe||void 0).then(ve=>{P.dispatch([{type:"status",text:D("branch.success",{name:ve.displayName})}])}).catch(ve=>{mt(ve,D("branch.failed"))}),!0}if(Fe==="fork"){if(ce)return Qi(L,Y);const xe=L.slice(lt[0].length).trim();return xe?(W.forkSession(xe).then(ve=>{if(!ve.launched){be("warning",D("fork.notStarted"));return}me(Jt=>Jt+1),be("success",D("fork.started",{name:ve.description}))}).catch(ve=>{const Jt=ve instanceof Error?ve.message:String(ve);mt(ve,D("fork.failed",{reason:Jt}))}),!0):(be("error",D("fork.empty")),!0)}if(Fe==="auth")return P.appendLocalUserMessage(L),Yi(!0),!0;if(Fe==="model"){const xe=L.slice(lt[0].length).trim();return xe==="--fast"?(P.appendLocalUserMessage(L),ws("fast"),!0):xe.startsWith("--fast ")?ce?Qi(L,Y):(pn(L,Y).catch(ve=>mt(ve,"Failed to send /model --fast")),!0):(xe?W.setModel(xe).then(()=>{X0(xe)}).catch(ve=>{mt(ve,D("model.switch"))}):(P.appendLocalUserMessage(L),ws("main")),!0)}if(Fe==="plan"){if(ce)return Qi(L,Y);const xe=L.slice(lt[0].length).trim();return W.setApprovalMode("plan").then(()=>{Ny("plan"),xe&&pn(xe,Y).catch(ve=>mt(ve,"Failed to send plan prompt"))}).catch(ve=>{mt(ve,D("mode.plan"))}),!0}if(Fe==="approval-mode"){const xe=L.slice(lt[0].length).trim();return xe?Mu(xe):(P.appendLocalUserMessage(L),Vo(!0)),!0}if(Fe==="mcp"){const xe=L.slice(lt[0].length).trim().toLowerCase();return P.appendLocalUserMessage(L),M.loadMcpStatus().then(async ve=>{const Jt={};await Promise.all(((ve==null?void 0:ve.servers)??[]).map(async Ot=>{try{Jt[Ot.name]=await M.loadMcpTools(Ot.name)}catch{}})),P.dispatch([{type:"status",text:Cre({status:ve,toolsByServer:Jt,showDescriptions:xe==="desc",showSchema:xe==="schema",showTips:!xe})}])}).catch(ve=>{mt(ve,"Failed to load MCP status")}),!0}if(Fe==="skills"){if(L.slice(lt[0].length).trim()){if(ce)return Qi(L,Y);pn(L,Y).catch(ve=>mt(ve,"Failed to send /skills command"))}else P.appendLocalUserMessage(L),M.loadSkillsStatus().then(ve=>{const Jt=((ve==null?void 0:ve.skills)??[]).map(Ot=>({name:Ot.name,description:Ot.description??""})).sort((Ot,lr)=>Ot.name.localeCompare(lr.name));if(xs(Jt),Jt.length===0)P.dispatch([{type:"status",text:D("skills.none")}]);else{const Ot=Jt.map(lr=>`- ${lr.name}`).join(`
`);P.dispatch([{type:"status",text:`${D("skills.available")}

${Ot}`}])}}).catch(ve=>{mt(ve,"Failed to load skills")});return!0}if(Fe==="tools"){const xe=L.slice(lt[0].length).trim().toLowerCase();return xe==="desc"||xe==="descriptions"?Ye(!0):(P.appendLocalUserMessage(L),M.loadToolsStatus().then(ve=>{const Jt=(ve==null?void 0:ve.tools)??[];if(Jt.length===0)P.dispatch([{type:"status",text:D("tools.none")}]);else{const Ot=Jt.map(lr=>`- ${lr.displayName||lr.name}`).join(`
`);P.dispatch([{type:"status",text:`${D("tools.available")}

${Ot}`}])}}).catch(ve=>{mt(ve,"Failed to load tools")})),!0}if(Fe==="settings")return Py?(P.appendLocalUserMessage(L),P.dispatch([{type:"status",text:D("command.hidden")}]),!0):(P.appendLocalUserMessage(L),Tn(!0),!0);if(Fe==="context"){const xe=L.slice(lt[0].length).trim().toLowerCase();if(xe===""||xe==="detail"||xe==="-d")return kh(L,xe==="detail"||xe==="-d"),!0}if(Fe==="memory"){const xe=L.slice(lt[0].length).trim().toLowerCase();if(P.appendLocalUserMessage(L),xe==="refresh")rn(ve=>ve+1);else if(xe==="add"||xe.startsWith("add ")){const ve=xe.slice(3).trim();Ut(ve==="user"||ve==="global"?"global":"workspace"),Za(Jt=>Jt+1)}return on(!0),!0}if(Fe==="agents"){const xe=L.slice(lt[0].length).trim().toLowerCase();P.appendLocalUserMessage(L);let ve="menu";return xe==="create"?ve="create":xe==="create user"||xe==="create global"?ve="create-user":xe==="create project"||xe==="create workspace"?ve="create-project":xe==="manage"&&(ve="manage"),It(ve),!0}if(Fe==="extensions"){const xe=L.slice(lt[0].length).trim(),ve=(Qe=xe.split(/\s+/)[0])==null?void 0:Qe.toLowerCase();if(!ve||ve==="manage")return P.appendLocalUserMessage(L),gt(!0),!0;if(ve==="install"){const Jt=xe.slice(7).trim().split(/\s+/);let Ot="",lr,fr,_s,lc,fa=null;for(let Ss=0;Ss<Jt.length;Ss++){const mi=Jt[Ss];if(mi)if(mi==="--auto-update")_s=!0;else if(mi==="--pre-release"||mi==="--allow-pre-release")lc=!0;else if(mi==="--ref"||mi==="--registry"){const cc=Jt[Ss+1];if(!cc||cc.startsWith("--")){fa=D("extensions.install.missingOptionValue",{option:mi});break}mi==="--ref"?lr=cc:fr=cc,Ss+=1}else if(mi.startsWith("--")){fa=D("extensions.install.unknownOption",{option:mi});break}else if(!Ot)Ot=mi;else{fa=D("extensions.install.usage");break}}if(fa)return P.appendLocalUserMessage(L),P.dispatch([{type:"error",text:fa}]),!0;if(!Ot)return P.appendLocalUserMessage(L),P.dispatch([{type:"error",text:D("extensions.install.usage")}]),!0;if(ce)return P.appendLocalUserMessage(L),P.dispatch([{type:"error",text:D("extensions.install.waitForTurn")}]),!0;const ma=Q0.current.clientId;return ma?(P.appendLocalUserMessage(L),P.dispatch([{type:"status",text:D("extensions.install.started",{source:Ot})}]),M.installExtension({source:Ot,...lr?{ref:lr}:{},...fr?{registry:fr}:{},..._s!==void 0?{autoUpdate:_s}:{},...lc!==void 0?{allowPreRelease:lc}:{},consent:!0},ma).then(()=>{}).catch(Ss=>{mt(Ss,D("extensions.install.requestFailed"))}),!0):(P.appendLocalUserMessage(L),P.dispatch([{type:"error",text:D("extensions.install.waitForSession")}]),!0)}return P.appendLocalUserMessage(L),P.dispatch([{type:"error",text:D("extensions.install.usage")}]),!0}if(Fe==="clear")return W.newSession().catch(xe=>{mt(xe,"Failed to create a new session")}),!0;if(Fe==="new"||Fe==="reset")return W.newSession().catch(xe=>{mt(xe,"Failed to create a new session")}),!0;if(Fe==="rename"){const xe=exe(L.slice(lt[0].length));if(xe.type==="auto"||xe.type==="delegate")return ce?Qi(L,Y):(pn(L,Y).catch(Jt=>mt(Jt,"Failed to send /rename command")),!0);const ve=xe.displayName;return ve?(W.renameSession(ve).then(()=>{P.dispatch([{type:"status",text:D("rename.success",{name:ve})}])}).catch(Jt=>{mt(Jt,"Failed to rename session")}),!0):(be("error",D("rename.empty")),!0)}if(Fe==="resume"){const xe=L.slice(lt[0].length).trim();return xe?W.loadSession(xe).catch(ve=>{mt(ve,"Failed to load session")}):xu(!0),!0}if(Fe==="recap")return h5(),!0;if(Fe==="btw")return f5(L.slice(lt[0].length)),!0;if(Fe==="stats"){const xe=L.slice(lt[0].length).trim().toLowerCase();let ve="overview";return xe==="model"?ve="model":xe==="tools"&&(ve="tools"),P.appendLocalUserMessage(L),W.getStats().then(Jt=>{P.dispatch([{type:"status",text:Tne(Jt,ve)}])}).catch(()=>{}),!0}if(Fe==="status"||Fe==="about")return P.appendLocalUserMessage(L),Promise.all([M.loadPreflight().catch(()=>null),M.loadProviders().catch(()=>null),M.loadEnv().catch(()=>null)]).then(([xe,ve,Jt])=>{var cc,M5,N5,I5,D5,R5;const Ot=h9(xe,Jt);let lr=Ot.authSource;!lr&&((cc=ve==null?void 0:ve.current)!=null&&cc.authType)&&(lr=ve.current.authType);const fr=[];Ot.nodeVersion&&fr.push(`Node.js v${Ot.nodeVersion}`),Ot.npmVersion&&fr.push(`npm ${Ot.npmVersion}`);let _s="";lr&&(lr.startsWith("oauth")||lr==="qwen-oauth"?_s="Qwen OAuth":_s=`API Key - ${lr}`);const lc=`${Ot.platform} ${Ot.arch}`.trim(),fa=d5.current,ma=Q0.current,mi={cliVersion:((M5=ma.capabilities)==null?void 0:M5.qwenCodeVersion)||"",runtime:fr.join(" / "),platform:lc,auth:_s,baseUrl:((N5=ve==null?void 0:ve.current)==null?void 0:N5.baseUrl)||"",model:fa||ma.currentModel||((I5=ve==null?void 0:ve.current)==null?void 0:I5.modelId)||"",fastModel:((D5=ve==null?void 0:ve.current)==null?void 0:D5.fastModelId)||fa||ma.currentModel||((R5=ve==null?void 0:ve.current)==null?void 0:R5.modelId)||"",sessionId:ma.sessionId||"",sandbox:Ot.sandbox,proxy:Ot.proxy,memoryUsage:Ot.memoryUsage};P.dispatch([{type:"status",text:Hne(mi)}])}),!0;if(Fe==="bug"){const xe=L.slice(lt[0].length).trim();return P.appendLocalUserMessage(L),Promise.all([M.loadPreflight().catch(()=>null),M.loadEnv().catch(()=>null)]).then(([ve,Jt])=>{var _s;const Ot=h9(ve,Jt),lr=((_s=Q0.current.capabilities)==null?void 0:_s.qwenCodeVersion)||"",fr={};if(lr&&(fr.cliVersion=lr),Ot.nodeVersion&&(fr.nodeVersion=Ot.nodeVersion),Ot.npmVersion&&(fr.npmVersion=Ot.npmVersion),Ot.platform&&(fr.platform=Ot.platform),Ot.arch&&(fr.arch=Ot.arch),Ot.sandbox&&(fr.sandbox=Ot.sandbox),Ot.memoryUsage&&(fr.memoryUsage=Ot.memoryUsage),Dy.current)Dy.current({title:xe,systemInfo:fr}),P.dispatch([{type:"status",text:D("bug.submitted")}]);else{const lc=Object.entries(fr).filter(([,Ss])=>Ss).map(([Ss,mi])=>`${Ss}: ${mi}`).join(`
`),fa=`https://github.com/QwenLM/qwen-code/issues/new?template=bug_report.yml&title=${encodeURIComponent(xe)}&info=${encodeURIComponent(`
`+lc+`
`)}`,ma=window.open(fa,"_blank");ma?(ma.opener=null,P.dispatch([{type:"status",text:D("bug.submitted")}])):be("error",D("bug.popupBlocked"))}}).catch(ve=>{mt(ve,D("bug.failed"))}),!0}}return ce?Qi(L,Y):(pn(L,Y).catch(Fe=>mt(Fe,"Failed to send command")),!0)}else if(L.startsWith("!")){if(ce)return Qi(L,Y);const lt=L.slice(1).trim();return lt?(W.sendShellCommand(lt).catch(Fe=>{mt(Fe,"Failed to execute shell command")}),!0):!1}else return ce?Qi(L,Y):(pn(L,Y).catch(lt=>mt(lt,"Failed to send message")),!0)},[pn,W,P,Qi,nm,T5,Z0,Mu,xh,Py,be,mt,h5,f5,z,kh,D,M]);v.useEffect(()=>{if(J0.current||!er||gn!=="idle"||Xi||ae||_u.length===0)return;const L=p5();if(!L)return;J0.current=!0;let Y=!1;const ce=window.setTimeout(()=>{var Qe;Y=!0;try{$y(L.text,L.images),(Qe=L.onComplete)==null||Qe.call(L)}finally{J0.current=!1}},0);return()=>{Y||(fi.current=[L,...fi.current],Su(fi.current)),window.clearTimeout(ce),J0.current=!1}},[er,Xi,$y,ae,p5,_u,gn]);const Tj=v.useCallback((L,Y,ce)=>{W.submitPermission(L,Y,ce).catch(Qe=>{mt(Qe,"Failed to submit permission choice")})},[W,mt]),C5=v.useCallback(()=>{W.cancel().catch(L=>{mt(L,"Failed to cancel request")})},[W,mt]),Cj=v.useCallback(()=>{var L;return Xi?!1:((L=Ke.current)==null?void 0:L.focusTaskPill())??!1},[Xi]),rm=v.useCallback(L=>{var Y,ce;if(L){(Y=St.current)==null||Y.insertText(L);return}(ce=St.current)==null||ce.focus()},[]),Uy=v.useCallback(()=>{Ja.current&&er&&Tr.current==="idle"&&Vr.current&&Nt.current?(vs.current=Vr.current,Ks(!1),pn(Nt.current,hi.current,{optimisticUserMessage:!1,retry:!0}).catch(L=>mt(L,"Failed to retry prompt"))):P.dispatch([{type:"status",text:D("retry.none")}])},[er,pn,mt,P,D]);v.useEffect(()=>{const L=Y=>{if(!Xi&&Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!Y.shiftKey){if(Y.key==="l"){Y.preventDefault(),w5();return}if(Y.key==="o"){Y.preventDefault(),k5();return}if(Y.key==="y"){Y.preventDefault(),Uy();return}}};return window.addEventListener("keydown",L,!0),()=>window.removeEventListener("keydown",L,!0)},[Xi,w5,k5,Uy,P,D]),v.useEffect(()=>{const L=()=>{Xo.current=0,oc(!1),Xs.current&&(clearTimeout(Xs.current),Xs.current=null)},Y=ce=>{var Qe,lt;if(!(ce.defaultPrevented||ce.isComposing)){if(ce.key!=="Escape"){Xo.current>0&&L(),ce.key==="Tab"&&ce.shiftKey&&!Xi&&(ce.preventDefault(),By());return}if(!(ae||Xi)){if(eo){ce.preventDefault(),ce.stopPropagation(),ku(null),rm(),L();return}if(Ry()){ce.preventDefault(),L();return}if((Qe=St.current)!=null&&Qe.hasInput()){ce.preventDefault(),Xo.current===0?(Xo.current=1,oc(!0),Xs.current&&clearTimeout(Xs.current),Xs.current=setTimeout(()=>{L()},500)):((lt=St.current)==null||lt.clear(),L());return}if(gn!=="idle"){ce.preventDefault(),C5(),L();return}}}};return window.addEventListener("keydown",Y),()=>{window.removeEventListener("keydown",Y),Xo.current=0,oc(!1),Xs.current&&(clearTimeout(Xs.current),Xs.current=null)}},[gn,C5,By,ae,Xi,eo,rm,Ry]);const Ej=!er,Aj=v.useCallback(L=>{W.setModel(L).then(Y=>{const ce=K4e(Y);X0((ce==null?void 0:ce.modelId)??L),ce&&P.dispatch({type:"debug",text:Y4e(ce)})}).catch(Y=>{mt(Y,D("model.switch"))})},[W,P,mt,D]),Mj=v.useCallback(L=>{gn==="idle"&&pn(`/model --fast ${L}`).catch(Y=>{mt(Y,"Failed to switch fast model")})},[pn,gn,mt]),E5=v.useMemo(()=>{const L=new Set(q.skills??[]);return Dve(q.commands??[],Ive(D)).filter(Y=>!zy.has(p9(Y.name))).map(Y=>L.has(Y.name)?{...Y,displayCategory:"skill",description:Y.description||D("skills.run")}:Y)},[q.commands,q.skills,zy,D]),Hy=v.useMemo(()=>{var L;return{version:((L=q.capabilities)==null?void 0:L.qwenCodeVersion)||"",cwd:q.workspaceCwd||"",currentModel:bh,currentMode:Qo,hideTips:(Eu==null?void 0:Eu.values.effective)===!0}},[(A5=q.capabilities)==null?void 0:A5.qwenCodeVersion,q.workspaceCwd,bh,Qo,Eu==null?void 0:Eu.values.effective]),Nj=v.useMemo(()=>p?p(Hy):h.jsx(Kge,{...Hy}),[p,Hy]),Ij=[Br.app,Ay===$i.Light?Br.themeLight:Br.themeDark,s].filter(Boolean).join(" ");return h.jsx(tH,{value:Ay,children:h.jsx(yee,{language:z,children:h.jsxs("div",{className:Ij,style:a,"data-web-shell-root":!0,children:[!E&&h.jsx(tge,{toasts:O,onDismiss:ke}),Iy&&h.jsxs("div",{className:Br.dialogOverlay,"data-keyboard-scope":!0,children:[Go&&h.jsx(c1e,{onSelect:L=>{W.loadSession(L).catch(Y=>{mt(Y,"Failed to load session")})},onClose:()=>xu(!1)}),wu&&h.jsx(Mve,{onDeleted:L=>{P.dispatch([{type:"status",text:L.length===1?`${D("delete.deleted")} (${L[0].slice(0,8)})`:D("delete.deletedCount",{count:L.length})}])},onError:L=>{if(Vh(L))return;const Y=L instanceof Error?L.message:String(L);be("error",D("delete.failed",{reason:Y}))},onClose:()=>Wo(!1)}),Ko&&h.jsx(Nve,{onReleased:L=>{P.dispatch([{type:"status",text:`${D("release.released")} (${L.slice(0,8)})`}])},onError:L=>{if(Vh(L))return;const Y=L instanceof Error?L.message:String(L);be("error",D("release.failed",{reason:Y}))},onClose:()=>sc(!1)}),da&&h.jsx(Eve,{commands:E5,onClose:()=>Ys(!1)}),Q&&h.jsx(Ave,{currentTheme:Ay,onSelect:Z0,onClose:()=>oe(!1)}),he&&h.jsx(fbe,{onClose:()=>Ye(!1)}),Re&&h.jsx(pbe,{onClose:()=>gt(!1)})]}),h.jsx(XU,{value:N,children:h.jsx(gh.Provider,{value:Oy,children:h.jsxs(B4e,{timeline:ye,details:Pe,children:[h.jsxs("div",{className:Zn?`${Br.content} ${Br.contentHasMessages}`:Br.content,style:Iy?{visibility:"hidden"}:void 0,children:[h.jsx(Sce,{ref:$t,messages:De,pendingApproval:ae,onConfirm:Tj,onShowContextDetail:_j,catchingUp:q.catchingUp,isResponding:gn!=="idle",workspaceCwd:q.workspaceCwd||"",shellOutputMaxLines:wj,showRetryHint:Qa,onRetryClick:Uy,welcomeHeader:Nj,tailContent:ct||ot||Ki||tn||ua||zt?h.jsxs(h.Fragment,{children:[tn&&h.jsx(hbe,{onMessage:(L,Y="status")=>{P.dispatch([Y==="error"?{type:"error",text:L}:{type:"status",text:L}])},onClose:()=>Yi(!1)}),ua&&h.jsx(s1e,{currentMode:Qo,onSelect:Mu,onClose:()=>Vo(!1)}),Ki&&h.jsx(Gye,{mode:Ki,onSelect:Ki==="fast"?Mj:Aj,onClose:()=>ws(null)}),ct&&h.jsx(Z1e,{mode:ct,onMessage:L=>P.dispatch([{type:"status",text:L}]),onClose:()=>It(null)}),ot&&h.jsx(Sye,{refreshSignal:ha,addSignal:yn,addScope:Rt,portalHost:Qt,onMessage:(L,Y="status")=>{P.dispatch([{type:Y,text:L}])},onClose:()=>on(!1)}),zt&&h.jsx(Ybe,{settingsState:b5,onClose:()=>Tn(!1),onLanguageChange:kj,onThemeChange:Z0,onSubDialog:L=>{Tn(!1),L==="fastModel"?ws("fast"):L==="tools.approvalMode"&&Vo(!0)}})]}):void 0,tailKey:ct||ot||Ki||tn||ua||zt?`inline-${tn?"auth":"none"}-${Ki??"none"}-${ct??"none"}-${ot?"memory":"none"}-${ua?"approval":"none"}-${zt?"settings":"none"}`:void 0,autoScrollTailIntoView:ua||Ki!==null||zt,virtualScrollThreshold:y}),(bt==null?void 0:bt.role)==="btw"&&h.jsx("div",{className:Br.btwPanel,children:h.jsx(ND,{question:bt.question,answer:bt.answer,isPending:bt.isPending})}),h.jsx(Vpe,{})]}),h.jsx("div",{ref:Ln,"data-web-shell-overlay-root":!0})]})})}),h.jsxs("div",{className:Xi?`${Br.footer} ${Br.footerHidden}`:Br.footer,children:[Zn&&!eo&&h.jsx("div",{className:Br.bottomPanels,children:h.jsx(Sge,{todos:dt,onLocateSource:$e.sourceMessageId?Tt:void 0})}),!Oe&&h.jsxs("div",{className:Br.composer,children:[h.jsx(sxe,{prompts:_u,t:D}),h.jsx(Jme,{ref:et,onSubmit:$y,onCycleMode:By,onToggleShortcuts:y5,disabled:Ej,commands:E5,skills:Gr,slashCommandCategoryOrder:f,queuedMessages:_u.map(L=>L.text),onFocusFooter:Cj,onPopQueuedMessages:vj,onClearQueuedMessages:Ry,currentMode:Qo,sessionName:yj,dialogOpen:Xi||eo!==null,followupState:bu,onAcceptFollowup:vu,onDismissFollowup:Sr,composerInput:T,composerInputVersion:j,placeholderText:D(er?gn!=="idle"?"editor.processing":"editor.placeholder":"common.loading")})]}),eo&&h.jsx("div",{className:Br.tasksBottomPanel,children:h.jsx(wD,{message:eo,manageActiveEvent:!1,onClose:()=>{ku(null),rm()}})}),!Oe&&!eo&&(ks?h.jsx(Ope,{onClose:xj}):B?h.jsx(B,{connected:er,mode:Qo,model:bh,streamingState:gn,contextUsageRatio:(q.contextWindow??0)>0?(q.tokenCount??0)/(q.contextWindow??0):0,activeGoal:or,tasks:ne,availableModes:up,availableModels:(q.models??[]).map(L=>({id:L.id,label:L.label,contextWindow:L.contextWindow})),skills:Gr,onSelectMode:L=>Mu(L),onSelectModel:L=>{W.setModel(L).then(()=>{X0(L)})}}):h.jsx(Cpe,{escapeHint:ac,onSelectMode:()=>Vo(L=>!L),onSelectModel:()=>ws(L=>L?null:"main"),onShowContext:()=>kh("/context",!1),onOpenSettings:()=>Tn(L=>!L),ref:Ke,onOpenTasks:()=>Sj(),onReturnToInput:rm,tasks:G,activeGoal:or,hideSettings:Py,onToggleShortcuts:y5}))]})]})})})}function oxe(){if(typeof window>"u")return"";const e=new URLSearchParams(window.location.search).get("daemon")||"";return e?uxe(e):""}let dp;function lxe(){return dp||(typeof window>"u"?void 0:(dp=new URLSearchParams(window.location.hash.replace(/^#/,"")).get("token")||new URLSearchParams(window.location.search).get("token")||void 0,dp))}function cxe(){if(typeof window>"u")return;const e=new URL(window.location.href);let t=!1;if(e.searchParams.has("token")&&(e.searchParams.delete("token"),t=!0),e.hash){const n=new URLSearchParams(e.hash.replace(/^#/,""));if(n.has("token")){n.delete("token");const r=n.toString();e.hash=r?`#${r}`:"",t=!0}}t&&window.history.replaceState(null,"",e)}function uxe(e){try{const t=new URL(e,window.location.origin);if(!(t.protocol==="http:"||t.protocol==="https:"))return"";if(t.origin===window.location.origin)return t.origin;if(!(t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="::1"||t.hostname==="[::1]"))return"";const i=window.location.port||(window.location.protocol==="https:"?"443":"80");return(t.port||(t.protocol==="https:"?"443":"80"))!==i?"":t.origin}catch{return""}}const dxe=oxe(),hxe=lxe();cxe();const oj="qwen-code-web-shell-language",lj="qwen-code-web-shell-theme";function cj(e){if(e===$i.Dark||e===$i.Light)return e}function fxe(){const e=new URLSearchParams(window.location.search).get("theme");return cj(e)}function mxe(){try{return cj(window.localStorage.getItem(lj))}catch{return}}function pxe(e){try{window.localStorage.setItem(lj,e)}catch{}}function gxe(){return fxe()??mxe()??$i.Dark}function yxe(){try{const e=window.localStorage.getItem(oj);return e?jl(e):void 0}catch{return}}function bxe(e){try{window.localStorage.setItem(oj,e)}catch{}}function vxe(){const e=new URLSearchParams(window.location.search),t=e.get("language")??e.get("lang");return jl(t||(yxe()??navigator.language))}function xxe(){const e=window.location.pathname.match(/\/session\/([^/]+)/);if(e)try{return decodeURIComponent(e[1])}catch{return}}function wxe(){const[e,t]=v.useState(()=>gxe()),[n,r]=v.useState(()=>vxe()),i=v.useMemo(()=>xxe(),[]),s=dxe||window.location.origin,a=v.useCallback(l=>{t(l),pxe(l)},[]),o=v.useCallback(l=>{r(l),bxe(l)},[]);return h.jsx(W$,{baseUrl:s,token:hxe,children:h.jsx(oU,{initialSessionId:i,suppressOwnUserEcho:!0,children:h.jsx(axe,{theme:e,onThemeChange:a,language:n,onLanguageChange:o,compactThinking:!0})})})}Iz.createRoot(document.getElementById("root")).render(h.jsx(Jj.StrictMode,{children:h.jsx(wxe,{})}));export{U as _,Vp as c,p1 as g,Txe as k};
